refactor:handle mode info or edit

This commit is contained in:
Thanaphon Frappet 2024-10-10 13:31:46 +07:00
parent 659f78211e
commit a066b2c843
4 changed files with 46 additions and 10 deletions

View file

@ -16,6 +16,7 @@ import { useConfigStore } from 'stores/config';
import { Product, Service, Work } from 'src/stores/product-service/types';
defineProps<{
readonly?: boolean;
agentPrice: boolean;
employeeRows?: {
foreignRefNo: string;
@ -365,7 +366,10 @@ watch(
{{ formatNumberDecimal(calcPrice(props.row), 2) }}
</q-td>
<q-td>
<div class="row items-center full-width justify-end no-wrap">
<div
class="row items-center full-width justify-end no-wrap"
v-if="!readonly"
>
<q-btn
@click.stop="openEmployeeTable(item.title, props.rowIndex)"
dense

View file

@ -8,6 +8,7 @@ defineEmits<{
withDefaults(
defineProps<{
readonly?: boolean;
employeeAmount?: number;
fallbackImg?: string;
hideQuantity?: boolean;
@ -88,6 +89,7 @@ const columns = [
bordered
button-delete
img-column="employeeName"
:readonly="readonly"
:inTable
:columns
:rows

View file

@ -5,6 +5,7 @@ import DeleteButton from './button/DeleteButton.vue';
const props = withDefaults(
defineProps<{
readonly?: boolean;
rows: QTableProps['rows'];
columns: QTableProps['columns'];
flat?: boolean;
@ -91,7 +92,10 @@ defineEmits<{
<template v-slot:body-cell-action="props">
<q-td>
<div class="row items-center full-width justify-end no-wrap">
<div
class="row items-center full-width justify-end no-wrap"
v-if="!readonly"
>
<slot name="button" :props="props"></slot>
<DeleteButton
iconOnly