diff --git a/src/components/02_personnel-management/FormPerson.vue b/src/components/02_personnel-management/FormPerson.vue
index cb0463af..1aee5b95 100644
--- a/src/components/02_personnel-management/FormPerson.vue
+++ b/src/components/02_personnel-management/FormPerson.vue
@@ -293,11 +293,15 @@ watch(
:readonly="readonly"
:label="$t('form.birthDate')"
:disabled-dates="disabledAfterToday"
- :rules="[
- (val: string) =>
- !!val ||
- $t('form.error.selectField', { field: $t('form.birthDate') }),
- ]"
+ :rules="
+ employee
+ ? []
+ : [
+ (val: string) =>
+ !!val ||
+ $t('form.error.selectField', { field: $t('form.birthDate') }),
+ ]
+ "
/>
+import { CustomerBranch } from 'src/stores/customer';
+
import SelectCustomer from '../shared/select/SelectCustomer.vue';
import SelectBranch from '../shared/select/SelectBranch.vue';
-import { CustomerBranch } from 'src/stores/customer';
-import { ref } from 'vue';
-
const branchId = defineModel('branchId');
const customerBranchId = defineModel('customerBranchId');
const agentPrice = defineModel('agentPrice');
@@ -74,7 +73,6 @@ defineEmits<{
required
:readonly
/>
-
import { QTableProps } from 'quasar';
-import { dateFormat, dateFormatJS } from 'src/utils/datetime';
+import { dateFormat } from 'src/utils/datetime';
import { formatNumberDecimal } from 'stores/utils';
@@ -86,11 +86,11 @@ defineEmits<{
- {{ dateFormatJS({ date: props.row.createdAt }) }}
+ {{ dateFormat(props.row.createdAt) }}
- {{ dateFormatJS({ date: props.row.dueDate }) }}
+ {{ dateFormat(props.row.dueDate) }}
diff --git a/src/components/08_request-list/DataDisplay.vue b/src/components/08_request-list/DataDisplay.vue
index f36acb4f..a52060f3 100644
--- a/src/components/08_request-list/DataDisplay.vue
+++ b/src/components/08_request-list/DataDisplay.vue
@@ -27,38 +27,26 @@ withDefaults(
class="app-text-muted q-pr-sm"
:width="iconSize || '2rem'"
/>
-
-
+
+
{{ label }}
-
+
{{ value }}
{{ value }}
-
+
{{ item }}
,
diff --git a/src/components/TreeComponent.vue b/src/components/TreeComponent.vue
index fca14f27..6abff3d4 100644
--- a/src/components/TreeComponent.vue
+++ b/src/components/TreeComponent.vue
@@ -96,9 +96,7 @@ defineEmits<{
expandedTree[expandedTree.length - 1] === node.id,
}"
>
- {{
- $i18n.locale === 'eng' ? node.nameEN || node.name : node.name
- }}
+ {{ node.name }}
{{ node.code }}
diff --git a/src/components/button/MainButton.vue b/src/components/button/MainButton.vue
index 08233063..836abe32 100644
--- a/src/components/button/MainButton.vue
+++ b/src/components/button/MainButton.vue
@@ -5,7 +5,6 @@ defineEmits<{
(e: 'click', v: MouseEvent): void;
}>();
defineProps<{
- id?: string;
icon?: string;
color: string;
iconOnly?: boolean;
@@ -19,7 +18,6 @@ defineProps<{
diff --git a/src/i18n/eng.ts b/src/i18n/eng.ts
index 3379ba60..9afb6737 100644
--- a/src/i18n/eng.ts
+++ b/src/i18n/eng.ts
@@ -161,7 +161,6 @@ export default {
documentStatus: 'Document Status',
advanceSearch: 'Advance Search',
totalPeople: '{meg} people',
- price: 'Price {price} Baht',
},
menu: {
@@ -1234,9 +1233,6 @@ export default {
taskListNotPending: 'One or more task is not pending.',
reqNotMet: 'Not Match',
systemError: 'A system error occurred.',
- taskOrderInvalid: 'Please select the product and the organization.',
-
- flowAccountProductIdNotFound: 'Product not found in flow account',
},
},
diff --git a/src/i18n/tha.ts b/src/i18n/tha.ts
index 921e25fd..3430d2f6 100644
--- a/src/i18n/tha.ts
+++ b/src/i18n/tha.ts
@@ -161,7 +161,6 @@ export default {
documentStatus: 'สถานะเอกสาร',
advanceSearch: 'ค้นหาขั้นสูง',
totalPeople: '{meg} คน',
- price: 'ราคา {price} บาท',
},
menu: {
@@ -1220,8 +1219,6 @@ export default {
'มีงานหนึ่งงานหรือมากกว่าที่ไม่อยู่ในสถานะรอดำเนินการ',
reqNotMet: 'ไม่ตรงกัน',
systemError: 'ระบบเกิดข้อผิดพลาด',
- taskOrderInvalid: 'โปรดเลือก สินค้าเเละสาขา',
- flowAccountProductIdNotFound: 'ไม่พบสินค้าใน flow account',
},
},
diff --git a/src/layouts/MainLayout.vue b/src/layouts/MainLayout.vue
index 29e106bc..c09effed 100644
--- a/src/layouts/MainLayout.vue
+++ b/src/layouts/MainLayout.vue
@@ -2,7 +2,7 @@
import { ref, onMounted, computed, reactive } from 'vue';
import { storeToRefs } from 'pinia';
import { useQuasar } from 'quasar';
-import { getUserId, getUsername, getName, logout, getRole } from 'src/services/keycloak';
+import { getUserId, getUsername, logout, getRole } from 'src/services/keycloak';
import { Icon } from '@iconify/vue';
import { useI18n } from 'vue-i18n';
import moment from 'moment';
@@ -39,7 +39,7 @@ const configStore = useConfigStore();
const { data: notificationData } = storeToRefs(notificationStore);
const { visible } = storeToRefs(loaderStore);
-const { t, locale } = useI18n({ useScope: 'global' });
+const { t } = useI18n({ useScope: 'global' });
const userStore = useUserStore();
const canvasModal = ref(false);
@@ -52,14 +52,8 @@ const unread = computed(
);
const userImage = ref();
const userGender = ref('');
-const userName = ref({ th: '', en: '' });
const canvasRef = ref();
-const displayName = computed(() => {
- if (!userName.value.th && !userName.value.en) return getName() || 'Guest';
- return locale.value === 'eng' ? userName.value.en : userName.value.th;
-});
-
const language: {
value: Lang;
label: string;
@@ -167,14 +161,9 @@ onMounted(async () => {
if (user === 'admin') return;
if (uid) {
const res = await userStore.fetchById(uid);
- if (res) {
- if (res.gender) {
- userGender.value = res.gender;
- userImage.value = `${baseUrl}/user/${uid}/profile-image/${res.selectedImage}`;
- }
- // เก็บชื่อทั้งสองภาษา
- userName.value.th = `${res.firstName || ''} ${res.lastName || ''}`.trim();
- userName.value.en = `${res.firstNameEN || ''} ${res.lastNameEN || ''}`.trim();
+ if (res && res.gender) {
+ userGender.value = res.gender;
+ userImage.value = `${baseUrl}/user/${uid}/profile-image/${res.selectedImage}`;
}
}
});
@@ -495,7 +484,6 @@ onMounted(async () => {
+
-
-
@@ -4385,7 +4357,6 @@ watch(
-import { onMounted, onUnmounted, reactive, ref, watch, computed } from 'vue';
+import { onMounted, reactive, ref, watch, computed } from 'vue';
import { storeToRefs } from 'pinia';
import { useQuasar } from 'quasar';
import { useI18n } from 'vue-i18n';
@@ -275,10 +275,6 @@ const customerNameInfo = computed(() => {
return name || '-';
});
-function handleWindowFocus() {
- fetchQuotationList();
-}
-
onMounted(async () => {
pageState.gridView = $q.screen.lt.md ? true : false;
navigatorStore.current.title = 'quotation.title';
@@ -316,12 +312,6 @@ onMounted(async () => {
}
flowStore.rotate();
-
- window.addEventListener('focus', handleWindowFocus);
-});
-
-onUnmounted(() => {
- window.removeEventListener('focus', handleWindowFocus);
});
async function fetchQuotationList(mobileFetch?: boolean) {
@@ -777,13 +767,8 @@ async function filterBySellerId() {
:worker-count="item.row._count.worker"
:worker-max="item.row.workerMax || item.row._count.worker"
:customer-name="
- item.row.customerBranch.customer.customerType === 'CORP'
- ? $i18n.locale === 'tha'
- ? item.row.customerBranch.registerName
- : item.row.customerBranch.registerNameEN
- : $i18n.locale === 'tha'
- ? `${item.row.customerBranch.firstName || '-'} ${item.row.customerBranch.lastName || ''}`
- : `${item.row.customerBranch.firstNameEN || '-'} ${item.row.customerBranch.lastNameEN || ''}`
+ item.row.customerBranch.registerName ||
+ `${item.row.customerBranch.firstName || '-'} ${item.row.customerBranch.lastName || ''}`
"
:reporter="
$i18n.locale === 'eng'
diff --git a/src/pages/05_quotation/PaymentForm.vue b/src/pages/05_quotation/PaymentForm.vue
index cf3d7c63..2d5f1579 100644
--- a/src/pages/05_quotation/PaymentForm.vue
+++ b/src/pages/05_quotation/PaymentForm.vue
@@ -1,9 +1,16 @@
@@ -661,115 +640,95 @@ onMounted(async () => {
-
-
- {{ $t('quotation.receiptDialog.paymentMethod') }}
-
-
-
-
-
{
- if (formPaymentMethod[i].channel === 'Cash') {
- formPaymentMethod[i].reference = null;
- formPaymentMethod[i].account = null;
- }
- }
- "
- />
-
-
-
- {
- formPaymentMethod[i].isEdit = false;
- formPaymentMethod[i].channel = payment.channel;
- formPaymentMethod[i].reference = payment.reference;
- formPaymentMethod[i].account = payment.account;
- }
- "
- />
-
-
-
-
-
-
+
+ {{ $t('quotation.receiptDialog.paymentMethod') }}
+
+
+
{
+ if (formPaymentMethod[i].channel === 'Cash') {
+ formPaymentMethod[i].reference = null;
+ formPaymentMethod[i].account = null;
+ }
+ }
+ "
+ />
+
+
+
+ {
+ formPaymentMethod[i].isEdit = false;
+ formPaymentMethod[i].channel = payment.channel;
+ formPaymentMethod[i].reference = payment.reference;
+ formPaymentMethod[i].account = payment.account;
+ }
+ "
+ />
+
+
+
+
();
-
const employeeStore = useEmployeeStore();
const route = useRoute();
const useReceiptStore = useReceipt();
@@ -115,6 +113,8 @@ const $q = useQuasar();
const openQuotation = ref(false);
const formMetadata = ref();
+const customerBranchOption = ref();
+
const rowsRequestList = ref([]);
const {
@@ -161,7 +161,49 @@ const selectedWorker = ref<
}[];
})[]
>([]);
-const selectedWorkerItem = ref([]);
+const selectedWorkerItem = computed(() => {
+ return [
+ ...selectedWorker.value.map((e) => ({
+ foreignRefNo: e.employeePassport
+ ? e.employeePassport[0]?.number || '-'
+ : '-',
+ employeeName:
+ locale.value === Lang.English
+ ? `${e.firstNameEN} ${e.lastNameEN}`
+ : e.firstName
+ ? `${e.firstName} ${e.lastName}`
+ : `${e.firstNameEN} ${e.lastNameEN}`,
+ birthDate: dateFormatJS({ date: e.dateOfBirth }),
+ gender: e.gender,
+ age: calculateAge(e.dateOfBirth),
+ nationality: optionStore.mapOption(e.nationality),
+ documentExpireDate:
+ e.employeePassport !== undefined &&
+ e.employeePassport[0]?.expireDate !== undefined
+ ? dateFormatJS({ date: e.employeePassport[0]?.expireDate })
+ : '-',
+ imgUrl: e.selectedImage
+ ? `${API_BASE_URL}/employee/${e.id}/image/${e.selectedImage}`
+ : '',
+ status: e.status,
+ })),
+
+ ...newWorkerList.value.map((v: any) => ({
+ foreignRefNo: v.passportNo,
+ employeeName:
+ locale.value === Lang.English
+ ? `${v.firstNameEN} ${v.lastNameEN}`
+ : `${v.firstName} ${v.lastName}`,
+ birthDate: dateFormatJS({ date: v.dateOfBirth }),
+ gender: v.gender,
+ age: calculateAge(v.dateOfBirth),
+ nationality: optionStore.mapOption(v.nationality),
+ documentExpireDate: '-',
+ imgUrl: '',
+ status: 'CREATED',
+ })),
+ ];
+});
const firstCodePayment = ref('');
const selectedProductGroup = ref('');
const selectedInstallmentNo = ref([]);
@@ -196,7 +238,7 @@ function getPrice(
) {
if (filterHook) list = list.filter(filterHook);
- const value = list.reduce(
+ return list.reduce(
(a, c) => {
if (
selectedInstallmentNo.value.length > 0 &&
@@ -236,8 +278,6 @@ function getPrice(
finalPrice: 0,
},
);
-
- return value;
}
const summaryPrice = computed(() => getPrice(productServiceList.value));
@@ -516,7 +556,7 @@ async function convertDataToFormSubmit() {
),
);
- selectedWorkerItem.value.forEach((v, i) => {
+ selectedWorker.value.forEach((v, i) => {
if (v.attachment !== undefined) {
v.attachment.forEach((value) => {
fileItemNewWorker.value.push({
@@ -533,7 +573,7 @@ async function convertDataToFormSubmit() {
quotationFormData.value.worker = JSON.parse(
JSON.stringify([
- ...selectedWorkerItem.value.map((v) => {
+ ...selectedWorker.value.map((v) => {
{
return v.id;
}
@@ -766,40 +806,7 @@ function toggleDeleteProduct(index: number) {
}
async function assignWorkerToSelectedWorker() {
- selectedWorkerItem.value = quotationFormData.value.worker.map((e) => {
- return {
- id: e.id,
- foreignRefNo: e.employeePassport
- ? e.employeePassport[0]?.number || '-'
- : '-',
- employeeName:
- locale.value === Lang.English
- ? `${e.firstNameEN} ${e.lastNameEN}`
- : `${e.firstName || e.firstNameEN} ${e.lastName || e.lastNameEN}`,
- birthDate: dateFormatJS({ date: e.dateOfBirth }),
- gender: e.gender,
- age: calculateAge(e.dateOfBirth),
- nationality: optionStore.mapOption(e.nationality),
- documentExpireDate:
- e.employeePassport !== undefined &&
- e.employeePassport[0]?.expireDate !== undefined
- ? dateFormatJS({ date: e.employeePassport[0]?.expireDate })
- : '-',
- imgUrl: e.selectedImage
- ? `${API_BASE_URL}/employee/${e.id}/image/${e.selectedImage}`
- : '',
- employeePassport: e.employeePassport,
- status: e.status,
- workerNew: false,
- lastNameEN: e.lastNameEN,
- lastName: e.lastName,
- middleNameEN: e.middleNameEN,
- middleName: e.middleName,
- firstNameEN: e.firstNameEN,
- firstName: e.firstName,
- namePrefix: e.namePrefix,
- };
- });
+ selectedWorker.value = quotationFormData.value.worker;
}
function convertToTable(nodes: Node[]) {
@@ -858,21 +865,21 @@ function convertToTable(nodes: Node[]) {
function convertEmployeeToTable(selected: Employee[]) {
productServiceList.value.forEach((v) => {
- if (selectedWorkerItem.value.length === 0 && v.amount === 1) v.amount -= 1;
+ if (selectedWorker.value.length === 0 && v.amount === 1) v.amount -= 1;
v.amount = Math.max(
- v.amount + selected.length - selectedWorkerItem.value.length,
+ v.amount + selected.length - selectedWorker.value.length,
1,
);
const oldWorkerId: string[] = [];
const newWorkerIndex: number[] = [];
- selectedWorkerItem.value.forEach((item, i) => {
+ selectedWorker.value.forEach((item, i) => {
if (v.workerIndex.includes(i)) oldWorkerId.push(item.id);
});
selected.forEach((item, i) => {
- if (selectedWorkerItem.value.find((n) => item.id === n.id)) return;
+ if (selectedWorker.value.find((n) => item.id === n.id)) return;
newWorkerIndex.push(i);
});
@@ -885,7 +892,7 @@ function convertEmployeeToTable(selected: Employee[]) {
pageState.employeeModal = false;
quotationFormData.value.workerMax = Math.max(
quotationFormData.value.workerMax || 1,
- selectedWorkerItem.value.length,
+ selectedWorker.value.length,
);
}
@@ -958,71 +965,6 @@ function viewProductFile(data: ProductRelation) {
pageState.imageDialogUrl = base64 ? base64[1] : '';
}
-function combineWorker(newWorker: any, oldWorker: any) {
- selectedWorkerItem.value = [
- ...oldWorker.map((e) => ({
- id: e.id,
- foreignRefNo: e.employeePassport
- ? e.employeePassport[0]?.number || '-'
- : '-',
- employeeName:
- locale.value === Lang.English
- ? `${e.firstNameEN} ${e.lastNameEN}`
- : `${e.firstName || e.firstNameEN} ${e.lastName || e.lastNameEN}`,
- birthDate: dateFormatJS({ date: e.dateOfBirth }),
- gender: e.gender,
- age: calculateAge(e.dateOfBirth),
- nationality: optionStore.mapOption(e.nationality),
- documentExpireDate:
- e.employeePassport !== undefined &&
- e.employeePassport[0]?.expireDate !== undefined
- ? dateFormatJS({ date: e.employeePassport[0]?.expireDate })
- : '-',
- imgUrl: e.selectedImage
- ? `${API_BASE_URL}/employee/${e.id}/image/${e.selectedImage}`
- : '',
-
- employeePassport: e.employeePassport,
- status: e.status,
- workerNew: false,
- lastNameEN: e.lastNameEN,
- lastName: e.lastName,
- middleNameEN: e.middleNameEN,
- middleName: e.middleName,
- firstNameEN: e.firstNameEN,
- firstName: e.firstName,
- namePrefix: e.namePrefix,
- })),
-
- ...newWorker.map((v: any) => ({
- id: v.id,
- foreignRefNo: v.passportNo || '-',
- employeeName:
- locale.value === Lang.English
- ? `${v.firstNameEN} ${v.lastNameEN}`
- : `${v.firstName || v.firstNameEN} ${v.lastName || v.lastNameEN}`,
- birthDate: dateFormatJS({ date: v.dateOfBirth }),
- gender: v.gender,
- age: calculateAge(v.dateOfBirth),
- nationality: optionStore.mapOption(v.nationality),
- documentExpireDate: '-',
- imgUrl: '',
- status: 'CREATED',
-
- lastNameEN: v.lastNameEN,
- lastName: v.lastName,
- middleNameEN: v.middleNameEN,
- middleName: v.middleName,
- firstNameEN: v.firstNameEN,
- firstName: v.firstName,
- namePrefix: v.namePrefix,
-
- dateOfBirth: v.dateOfBirth,
- workerNew: true,
- })),
- ];
-}
-
const sessionData = ref>();
onMounted(async () => {
@@ -1094,7 +1036,7 @@ watch(
() => quotationFormData.value.customerBranchId,
async (v) => {
if (!v) return;
- selectedWorkerItem.value = [];
+ selectedWorker.value = [];
},
);
@@ -1110,15 +1052,6 @@ watch(
const productServiceNodes = ref([]);
-watch(customerBranchOption, () => {
- if (!customerBranchOption.value) return;
-
- quotationFormData.value.contactName =
- customerBranchOption.value.contactName || '';
- quotationFormData.value.contactTel =
- customerBranchOption.value.contactTel || '';
-});
-
watch(
() => productServiceList.value,
() => {
@@ -1154,19 +1087,7 @@ watch(customerBranchOption, () => {
// }
function storeDataLocal() {
- const tempProductService = productService.value.map((v) => {
- return {
- ...v,
- vat: v.product[agentPrice ? 'agentPriceCalcVat' : 'calcVat']
- ? precisionRound(
- ((v.pricePerUnit * (1 + (config?.value.vat || 0.07)) * v.amount -
- v.discount) /
- (1 + (config?.value.vat || 0.07))) *
- 0.07,
- )
- : 0,
- };
- });
+ quotationFormData.value.productServiceList = productService.value;
localStorage.setItem(
'quotation-preview',
@@ -1175,7 +1096,7 @@ function storeDataLocal() {
codeInvoice: code.value,
codePayment: firstCodePayment.value,
...quotationFormData.value,
- productServiceList: tempProductService,
+ productServiceList: productService.value,
},
meta: {
source: {
@@ -1195,7 +1116,7 @@ function storeDataLocal() {
workName: quotationFormData.value.workName,
dueDate: quotationFormData.value.dueDate,
},
- selectedWorker: selectedWorkerItem.value,
+ selectedWorker: selectedWorker.value,
createdBy: quotationFormState.value.createdBy('tha'),
agentPrice: agentPrice.value,
},
@@ -1280,10 +1201,10 @@ async function getWorkerFromCriteria(
if (!ret) return false; // error, do not close dialog
const deduplicate = ret.result.filter(
- (a) => !selectedWorkerItem.value.find((b) => a.id === b.id),
+ (a) => !selectedWorker.value.find((b) => a.id === b.id),
);
- convertEmployeeToTable([...deduplicate, ...selectedWorkerItem.value]);
+ convertEmployeeToTable([...deduplicate, ...selectedWorker.value]);
return true;
}
@@ -1673,15 +1594,15 @@ function covertToNode() {
(v) =>
(quotationFormData.workerMax = Math.max(
v,
- selectedWorkerItem.length,
+ selectedWorker.length,
))
"
:employee-amount="
- quotationFormData.workerMax || selectedWorkerItem.length
+ quotationFormData.workerMax || selectedWorker.length
"
:readonly="readonly"
:rows="selectedWorkerItem"
- @delete="(i) => deleteItem(selectedWorkerItem, i)"
+ @delete="(i) => deleteItem(selectedWorker, i)"
/>
@@ -1925,7 +1846,7 @@ function covertToNode() {
installments: quotationFormData.paySplit,
},
'quotation-labor': {
- name: selectedWorkerItem.map(
+ name: selectedWorker.map(
(v, i) =>
`${i + 1}. ` +
`${v.employeePassport.length !== 0 ? v.employeePassport[0].number + '_' : ''}${v.namePrefix}.${v.firstNameEN ? `${v.firstNameEN} ${v.lastNameEN}` : `${v.firstName} ${v.lastName}`} `.toUpperCase(),
@@ -2018,7 +1939,6 @@ function covertToNode() {
view !== View.Receipt &&
view !== View.Complete
"
- :branch-id="quotationFull.registeredBranchId"
:readonly="
isRoleInclude(['sale', 'head_of_sale']) ||
!canAccess('quotation', 'edit')
@@ -2469,12 +2389,13 @@ function covertToNode() {
{
- combineWorker(v.newWorker, v.worker);
+ selectedWorker = v.worker;
}
"
/>
@@ -2517,7 +2438,7 @@ function covertToNode() {
{
@@ -275,7 +275,6 @@ watch(
{{ $t('quotation.totalPriceBaht') }}
-
+
{{
payType === 'SplitCustom' && view === View.Invoice
? formatNumberDecimal(Math.max(installmentAmount || 0, 0), 2) || 0
diff --git a/src/pages/05_quotation/QuotationFormWorkerAddDialog.vue b/src/pages/05_quotation/QuotationFormWorkerAddDialog.vue
index 64a7fbbf..89904bbf 100644
--- a/src/pages/05_quotation/QuotationFormWorkerAddDialog.vue
+++ b/src/pages/05_quotation/QuotationFormWorkerAddDialog.vue
@@ -341,13 +341,12 @@ watch(() => state.search, getWorkerList);
>
(),
{},
);
@@ -133,7 +133,7 @@ const optionStore = useOptionStore();
const employeeStore = useEmployeeStore();
const open = defineModel('open', { default: false });
-const newWorkerList = ref<
+const newWorkerList = defineModel<
(EmployeeWorker & {
attachment?: {
name?: string;
@@ -143,7 +143,7 @@ const newWorkerList = ref<
_meta?: Record;
}[];
})[]
->([]);
+>('newWorkerList', { default: [] });
const workerSelected = ref([]);
const workerList = ref([]);
const importWorkerCriteria = ref<{
@@ -208,13 +208,7 @@ function getEmployeeImageUrl(item: Employee) {
function init() {
if (props.preselectWorker) {
- workerSelected.value = JSON.parse(
- JSON.stringify(props.preselectWorker.filter((v) => !v.workerNew)),
- );
-
- newWorkerList.value = JSON.parse(
- JSON.stringify(props.preselectWorker.filter((v) => v.workerNew)),
- );
+ workerSelected.value = JSON.parse(JSON.stringify(props.preselectWorker));
}
getWorkerList();
}
@@ -614,14 +608,11 @@ watch(
solid
id="btn-success"
@click="
- () => {
- $emit('success', {
- worker: workerSelected,
- newWorker: newWorkerList,
- });
-
- open = false;
- }
+ (emits('success', {
+ worker: workerSelected,
+ newWorker: newWorkerList,
+ }),
+ (open = false))
"
>
{{ $t('general.select', { msg: $t('quotation.employeeList') }) }}
@@ -643,11 +634,9 @@ watch(
if (employeeFormState.currentTab === 'personalInfo') {
const currentEmployeeId =
await employeeFormStore.submitPersonal(onCreateImageList);
- newWorkerList.push(
- quotationForm.injectNewEmployee({
- data: { ...currentFromDataEmployee, id: currentEmployeeId },
- }),
- );
+ quotationForm.injectNewEmployee({
+ data: { ...currentFromDataEmployee, id: currentEmployeeId },
+ });
employeeFormState.isEmployeeEdit = false;
employeeFormState.dialogType = 'info';
}
diff --git a/src/pages/05_quotation/form.ts b/src/pages/05_quotation/form.ts
index 5b16785a..e44fa747 100644
--- a/src/pages/05_quotation/form.ts
+++ b/src/pages/05_quotation/form.ts
@@ -69,7 +69,6 @@ export const useQuotationForm = defineStore('form-quotation', () => {
file?: File;
_meta?: Record;
}[];
- workerNew: boolean;
})[]
>([]);
@@ -221,7 +220,7 @@ export const useQuotationForm = defineStore('form-quotation', () => {
},
callback?: () => void,
) {
- const temp = {
+ newWorkerList.value.push({
//passportNo: obj.data.passportNo,
//documentExpireDate: obj.data.documentExpireDate,
id: obj.data.id,
@@ -236,12 +235,9 @@ export const useQuotationForm = defineStore('form-quotation', () => {
gender: obj.data.gender,
dateOfBirth: obj.data.dateOfBirth,
attachment: obj.data.attachment,
- workerNew: true,
- };
+ });
callback?.();
-
- return temp;
}
function dialogDelete(callback: () => void) {
diff --git a/src/pages/08_request-list/DocumentExpansion.vue b/src/pages/08_request-list/DocumentExpansion.vue
index 5ac5208c..d262d953 100644
--- a/src/pages/08_request-list/DocumentExpansion.vue
+++ b/src/pages/08_request-list/DocumentExpansion.vue
@@ -61,7 +61,6 @@ const props = withDefaults(
readonly?: boolean;
listDocument: string[];
currentId: { customer: string; employee: string };
- prefix?: string;
}>(),
{
listDocument: () => [],
@@ -245,14 +244,14 @@ function changeCustomerTab(opts: { tab: 'customer' | 'employee' }) {