;
isImageEdit: boolean;
currentCustomerId?: string;
+ imageList: { list: string[]; selectedImage: string };
}>({
dialogType: 'info',
dialogOpen: false,
@@ -98,6 +105,7 @@ export const useCustomerForm = defineStore('form-customer', () => {
treeFile: [],
formDataOcr: {},
isImageEdit: false,
+ imageList: { list: [], selectedImage: '' },
});
watch(
@@ -160,6 +168,7 @@ export const useCustomerForm = defineStore('form-customer', () => {
state.value.editCustomerCode = data.code;
state.value.customerImageUrl = `${baseUrl}/customer/${id}/image/${data.selectedImage}`;
state.value.defaultCustomerImageUrl = `${baseUrl}/customer/${id}/image/${data.selectedImage}`;
+ currentBranchRootId.value = data.branch[0].id || '';
resetFormData.registeredBranchId = data.registeredBranchId;
resetFormData.status = data.status;
@@ -255,7 +264,6 @@ export const useCustomerForm = defineStore('form-customer', () => {
async function addCurrentCustomerBranch() {
if (currentFormData.value.customerBranch?.some((v) => !v.id)) return;
currentFormData.value.customerBranch?.push({
- id: '',
customerId: '',
branchCode:
currentFormData.value.customerBranch.length !== 0
@@ -495,11 +503,14 @@ export const useCustomerForm = defineStore('form-customer', () => {
}
return {
+ onCreateImageList,
tabFieldRequired,
registerAbleBranchOption,
state,
resetFormData,
currentFormData,
+ currentBranchRootId,
+
isFormDataDifferent,
resetForm,
assignFormData,
@@ -779,6 +790,7 @@ export const useEmployeeForm = defineStore('form-employee', () => {
}
| undefined;
ocr: boolean;
+ imageList: { list: string[]; selectedImage: string };
}>({
currentBranchId: '',
isImageEdit: false,
@@ -803,6 +815,7 @@ export const useEmployeeForm = defineStore('form-employee', () => {
infoEmployeePersonCard: [],
formDataEmployeeOwner: undefined,
ocr: false,
+ imageList: { list: [], selectedImage: '' },
});
const defaultFormData: EmployeeCreate & { image?: File } = {
@@ -955,6 +968,7 @@ export const useEmployeeForm = defineStore('form-employee', () => {
state.value.currentIndexVisa = -1;
state.value.currentIndexCheckup = -1;
state.value.currentIndexWorkHistory = -1;
+ state.value.imageList = { list: [], selectedImage: '' };
// state.value.currentTab = 'personalInfo';
if (clean) {
state.value.formDataEmployeeOwner = undefined;
@@ -1384,12 +1398,10 @@ export const useEmployeeForm = defineStore('form-employee', () => {
statusSave: true,
})),
),
- employeeOtherInfo: structuredClone(
- {
- ...payload.employeeOtherInfo,
- statusSave: !!payload.employeeOtherInfo?.id ? true : false,
- } || {},
- ),
+ employeeOtherInfo: structuredClone({
+ ...(payload.employeeOtherInfo ?? {}),
+ statusSave: true,
+ }),
employeeWork: structuredClone(
payload.employeeWork?.length === 0
? state.value.dialogModal
@@ -1663,6 +1675,7 @@ export const useEmployeeForm = defineStore('form-employee', () => {
state,
currentFromDataEmployee,
resetEmployeeData,
+
addPassport,
addVisa,
addCheckup,
diff --git a/src/pages/04_product-service/MainPage.vue b/src/pages/04_product-service/MainPage.vue
index 442401f1..17cd4040 100644
--- a/src/pages/04_product-service/MainPage.vue
+++ b/src/pages/04_product-service/MainPage.vue
@@ -102,6 +102,8 @@ const {
deleteWork,
importProduct,
+
+ productExport,
} = productServiceStore;
const { workNameItems } = storeToRefs(productServiceStore);
@@ -1169,6 +1171,7 @@ function clearFormService() {
profileSubmit.value = false;
imageProduct.value = undefined;
profileFileImg.value = null;
+ serviceTab.value = 1;
}
function sameFormService() {
@@ -1896,6 +1899,25 @@ async function submitWorkName(
else await editWork(workId, data);
}
+async function triggerExport() {
+ productExport({
+ pageSize: 100_000,
+ productGroupId: currentIdGroup.value,
+ query: !!inputSearchProductAndService.value
+ ? inputSearchProductAndService.value
+ : undefined,
+ status:
+ currentStatus.value === 'INACTIVE'
+ ? 'INACTIVE'
+ : currentStatus.value === 'ACTIVE'
+ ? 'ACTIVE'
+ : undefined,
+
+ startDate: searchDate.value[0] ? new Date(searchDate.value[0]) : undefined,
+ endDate: searchDate.value[1] ? new Date(searchDate.value[1]) : undefined,
+ });
+}
+
watch(
() => formService.value.attributes.workflowId,
async (a, b) => {
@@ -2229,7 +2251,6 @@ watch(
-
+
+
@@ -4357,6 +4385,7 @@ watch(
-import { onMounted, reactive, ref, watch, computed } from 'vue';
+import { onMounted, onUnmounted, reactive, ref, watch, computed } from 'vue';
import { storeToRefs } from 'pinia';
import { useQuasar } from 'quasar';
import { useI18n } from 'vue-i18n';
@@ -60,7 +60,6 @@ const flowStore = useFlowStore();
const userBranch = useMyBranch();
const navigatorStore = useNavigator();
const customerStore = useCustomerStore();
-
const {
fetchListOfOptionBranch,
customerFormUndo,
@@ -76,6 +75,7 @@ const {
const {
state: customerFormState,
currentFormData: customerFormData,
+ currentBranchRootId,
registerAbleBranchOption,
tabFieldRequired,
} = storeToRefs(customerFormStore);
@@ -89,6 +89,8 @@ const fieldSelectedOption = computed(() => {
value: v.name,
}));
});
+
+const keyAddDialog = ref(0);
const special = ref(false);
const branchId = ref('');
const agentPrice = ref(false);
@@ -273,6 +275,10 @@ const customerNameInfo = computed(() => {
return name || '-';
});
+function handleWindowFocus() {
+ fetchQuotationList();
+}
+
onMounted(async () => {
pageState.gridView = $q.screen.lt.md ? true : false;
navigatorStore.current.title = 'quotation.title';
@@ -310,6 +316,12 @@ onMounted(async () => {
}
flowStore.rotate();
+
+ window.addEventListener('focus', handleWindowFocus);
+});
+
+onUnmounted(() => {
+ window.removeEventListener('focus', handleWindowFocus);
});
async function fetchQuotationList(mobileFetch?: boolean) {
@@ -765,8 +777,13 @@ async function filterBySellerId() {
:worker-count="item.row._count.worker"
:worker-max="item.row.workerMax || item.row._count.worker"
:customer-name="
- item.row.customerBranch.registerName ||
- `${item.row.customerBranch.firstName || '-'} ${item.row.customerBranch.lastName || ''}`
+ 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 || ''}`
"
:reporter="
$i18n.locale === 'eng'
@@ -865,6 +882,7 @@ async function filterBySellerId() {
@@ -999,6 +1018,7 @@ async function filterBySellerId() {
() => {
customerFormState.dialogModal = false;
onCreateImageList = { selectedImage: '', list: [] };
+ keyAddDialog++;
}
"
>
@@ -1190,7 +1210,7 @@ async function filterBySellerId() {
customerFormData.customerBranch[0].legalPersonNo
"
v-model:business-type="
- customerFormData.customerBranch[0].businessType
+ customerFormData.customerBranch[0].businessTypeId
"
v-model:job-position="
customerFormData.customerBranch[0].jobPosition
@@ -1271,7 +1291,6 @@ async function filterBySellerId() {
res = await customerStore.createBranch({
...customerFormData.customerBranch[idx],
customerId: customerFormState.editCustomerId || '',
- id: undefined,
});
}
if (res) {
diff --git a/src/pages/05_quotation/PaymentForm.vue b/src/pages/05_quotation/PaymentForm.vue
index 64f57560..cf3d7c63 100644
--- a/src/pages/05_quotation/PaymentForm.vue
+++ b/src/pages/05_quotation/PaymentForm.vue
@@ -1,15 +1,9 @@
-
-
-
-
-
-
-
-
-
- {{ $t('quotation.receiptDialog.paymentWait') }}
-
-
-
-
-
- {{ data.workName }}
-
-
- {{ data.code }}
-
-
- ฿ {{ formatNumberDecimal(data.finalPrice, 2) || '0.00' }}
-
-
-
-
-
-
-
-
-
- {{ $t('general.total') }}
-
- ฿
- {{ formatNumberDecimal(data.totalPrice, 2) || '0.00' }}
-
-
-
- {{ $t('quotation.discountList') }}
-
- ฿
- {{ formatNumberDecimal(data.totalDiscount, 2) || '0.00' }}
-
-
-
- {{ $t('general.totalAfterDiscount') }}
-
- ฿
- {{
- formatNumberDecimal(
- data.totalPrice - data.totalDiscount,
- 2,
- ) || '0.00'
- }}
-
-
-
- {{ $t('general.totalVatExcluded') }}
-
- ฿ {{ formatNumberDecimal(data.vatExcluded, 2) || '0.00' }}
-
-
-
- {{
- $t('general.vat', {
- msg: `${config && Math.round(config.vat * 100)}%`,
- })
- }}
-
- ฿ {{ formatNumberDecimal(data.vat, 2) || '0.00' }}
-
-
-
- {{ $t('general.totalVatIncluded') }}
-
- ฿
- {{
- formatNumberDecimal(
- data.totalPrice - data.totalDiscount + data.vat,
- 2,
- ) || '0.00'
- }}
-
-
-
- {{ $t('general.discountAfterVat') }}
-
- ฿ {{ formatNumberDecimal(data.discount, 2) || '0.00' }}
-
-
-
-
-
-
- {{ $t('quotation.totalPriceBaht') }}:
-
- {{ formatNumberDecimal(data.finalPrice, 2) || '0.00' }}
-
-
-
-
-
-
-