diff --git a/src/components/05_quotation/ProductItem.vue b/src/components/05_quotation/ProductItem.vue index 94d38c56..69e80e68 100644 --- a/src/components/05_quotation/ProductItem.vue +++ b/src/components/05_quotation/ProductItem.vue @@ -5,6 +5,8 @@ import ThaiBahtText from 'thai-baht-text'; import { toWords } from 'number-to-words'; import { storeToRefs } from 'pinia'; +import WorkerItem from './WorkerItem.vue'; +import DeleteButton from '../button/DeleteButton.vue'; import { commaInput } from 'stores/utils'; import { precisionRound } from 'src/utils/arithmetic'; import TableComponents from 'components/TableComponents.vue'; @@ -15,6 +17,17 @@ import { Product, Service, Work } from 'src/stores/product-service/types'; defineProps<{ agentPrice: boolean; + employeeRows?: { + foreignRefNo: string; + employeeName: string; + birthDate: string; + gender: string; + age: string; + nationality: string; + documentExpireDate: string; + imgUrl: string; + status: string; + }[]; }>(); defineEmits<{ @@ -59,7 +72,9 @@ const summaryPrice = defineModel<{ }, }); -const currentBtnOpen = ref([]); +const currentBtnOpen = ref<{ title: string; opened: boolean[] }[]>([ + { title: '', opened: [] }, +]); const finalDiscount = ref(0); const finalDiscount4Show = ref(finalDiscount.value.toString()); @@ -104,7 +119,7 @@ const columns = [ }, { name: 'code', - align: 'center', + align: 'left', label: 'productService.group.code', field: (v) => v.product.code, }, @@ -150,12 +165,6 @@ const columns = [ label: 'quotation.sumPrice', field: 'sumPrice', }, - { - name: 'action', - align: 'left', - label: '', - field: 'action', - }, ] satisfies QTableProps['columns']; const EngBahtText = (number: number) => { @@ -167,14 +176,16 @@ const EngBahtText = (number: number) => { return `${bahtText} Baht${satang ? ` and ${satangText} Satang` : ''}`; }; -function openEmployeeTable(index: number) { - currentBtnOpen.value.map((_, i) => { +function openEmployeeTable(title: string, index: number) { + currentBtnOpen.value[0].title = title; + currentBtnOpen.value[0].opened.map((_, i) => { if (i !== index) { - currentBtnOpen.value[i] = false; + currentBtnOpen.value[0].opened[i] = false; } }); - currentBtnOpen.value[index] = !currentBtnOpen.value[index]; + currentBtnOpen.value[0].opened[index] = + !currentBtnOpen.value[0].opened[index]; } watch( @@ -202,251 +213,144 @@ watch( {{ item.title }} - - + + - - - - - - - - - - - - - - - + - -
- - - {{ $t('general.totalAmount') }} - - - {{ - $i18n.locale === 'eng' - ? EngBahtText(summary.finalPrice) - : ThaiBahtText(summary.finalPrice) - }} - - - -
-
- - {{ $t('quotation.allProductPrice') }} - - -
- -
- - {{ $t('quotation.quotationDiscount') }} - - -
- -
- - {{ $t('general.totalAmount') }} - - -
-
-
- - @@ -495,4 +399,8 @@ watch( bottom: 0; background: var(--side-color); } + +:deep(i.q-icon.mdi.mdi-alert.q-table__bottom-nodata-icon) { + color: #ffc224 !important; +} diff --git a/src/components/05_quotation/WorkerItem.vue b/src/components/05_quotation/WorkerItem.vue index f83722f9..57b5c801 100644 --- a/src/components/05_quotation/WorkerItem.vue +++ b/src/components/05_quotation/WorkerItem.vue @@ -10,6 +10,8 @@ withDefaults( defineProps<{ employeeAmount: number; fallbackImg?: string; + hideQuantity?: boolean; + inTable?: boolean; rows: { foreignRefNo: string; employeeName: string; @@ -86,6 +88,7 @@ const columns = [ bordered button-delete img-column="employeeName" + :inTable :columns :rows hidePagination @@ -118,7 +121,7 @@ const columns = [ -
+
{{ $t('general.numberOf', { msg: $t('quotation.employee') }) }} diff --git a/src/components/TableComponents.vue b/src/components/TableComponents.vue index 9559db7d..71cf52f6 100644 --- a/src/components/TableComponents.vue +++ b/src/components/TableComponents.vue @@ -14,6 +14,7 @@ const props = withDefaults( buttomDownload?: boolean; buttonDelete?: boolean; hidePagination?: boolean; + inTable?: boolean; imgColumn?: string; customColumn?: string[]; @@ -52,7 +53,7 @@ defineEmits<{ >