chore: clean

This commit is contained in:
Methapon Metanipat 2024-10-11 11:54:22 +07:00
parent 0a832974f5
commit 3e7755f6dc

View file

@ -2,17 +2,8 @@
import { useI18n } from 'vue-i18n'; import { useI18n } from 'vue-i18n';
import { storeToRefs } from 'pinia'; import { storeToRefs } from 'pinia';
import { useQuasar } from 'quasar'; import { useQuasar } from 'quasar';
import { useRouter } from 'vue-router'; import { computed, nextTick, onMounted, reactive, ref, watch } from 'vue';
import { import { dialogCheckData } from 'stores/utils';
computed,
nextTick,
onBeforeMount,
onMounted,
reactive,
ref,
watch,
} from 'vue';
import { dialog, dialogCheckData } from 'stores/utils';
import { quotationProductTree } from './utils'; import { quotationProductTree } from './utils';
// NOTE: Import stores // NOTE: Import stores
@ -21,7 +12,6 @@ import { useEmployeeForm } from 'src/pages/03_customer-management/form';
import useProductServiceStore from 'stores/product-service'; import useProductServiceStore from 'stores/product-service';
import { baseUrl, waitAll } from 'src/stores/utils'; import { baseUrl, waitAll } from 'src/stores/utils';
import useCustomerStore from 'stores/customer'; import useCustomerStore from 'stores/customer';
import useEmployeeStore from 'stores/employee';
import useOptionStore from 'stores/options'; import useOptionStore from 'stores/options';
import { useQuotationForm } from './form'; import { useQuotationForm } from './form';
import useOcrStore from 'stores/ocr'; import useOcrStore from 'stores/ocr';
@ -36,12 +26,10 @@ import {
ProductGroup, ProductGroup,
Product, Product,
Service, Service,
Work,
} from 'src/stores/product-service/types'; } from 'src/stores/product-service/types';
// NOTE: Import Components // NOTE: Import Components
import FormEmployeePassport from 'components/03_customer-management/FormEmployeePassport.vue'; import FormEmployeePassport from 'components/03_customer-management/FormEmployeePassport.vue';
import BasicInformation from 'components/03_customer-management/employee/BasicInformation.vue';
import FormEmployeeVisa from 'components/03_customer-management/FormEmployeeVisa.vue'; import FormEmployeeVisa from 'components/03_customer-management/FormEmployeeVisa.vue';
import FormReferDocument from 'src/components/05_quotation/FormReferDocument.vue'; import FormReferDocument from 'src/components/05_quotation/FormReferDocument.vue';
import { UploadFileGroup, noticeJobEmployment } from 'components/upload-file'; import { UploadFileGroup, noticeJobEmployment } from 'components/upload-file';
@ -63,12 +51,10 @@ import ProductServiceForm from './ProductServiceForm.vue';
import QuotationFormInfo from './QuotationFormInfo.vue'; import QuotationFormInfo from './QuotationFormInfo.vue';
import ProfileBanner from 'components/ProfileBanner.vue'; import ProfileBanner from 'components/ProfileBanner.vue';
import DialogForm from 'components/DialogForm.vue'; import DialogForm from 'components/DialogForm.vue';
import SideMenu from 'components/SideMenu.vue';
import { import {
uploadFileListEmployee, uploadFileListEmployee,
columnsAttachment, columnsAttachment,
} from 'src/pages/03_customer-management/constant'; } from 'src/pages/03_customer-management/constant';
import { group } from 'node:console';
import { precisionRound } from 'src/utils/arithmetic'; import { precisionRound } from 'src/utils/arithmetic';
import { useConfigStore } from 'src/stores/config'; import { useConfigStore } from 'src/stores/config';
@ -87,18 +73,15 @@ type Node = {
}; };
type ProductGroupId = string; type ProductGroupId = string;
type Id = string;
const configStore = useConfigStore(); const configStore = useConfigStore();
const productServiceStore = useProductServiceStore(); const productServiceStore = useProductServiceStore();
const employeeFormStore = useEmployeeForm(); const employeeFormStore = useEmployeeForm();
const customerStore = useCustomerStore(); const customerStore = useCustomerStore();
const quotationForm = useQuotationForm(); const quotationForm = useQuotationForm();
const employeeStore = useEmployeeStore();
const optionStore = useOptionStore(); const optionStore = useOptionStore();
const { t, locale } = useI18n(); const { locale } = useI18n();
const ocrStore = useOcrStore(); const ocrStore = useOcrStore();
const router = useRouter();
const $q = useQuasar(); const $q = useQuasar();
const { const {
@ -113,10 +96,7 @@ const { data: config } = storeToRefs(configStore);
const refSelectZoneEmployee = ref<InstanceType<typeof SelectZone>>(); const refSelectZoneEmployee = ref<InstanceType<typeof SelectZone>>();
const mrz = ref<Awaited<ReturnType<typeof parseResultMRZ>>>(); const mrz = ref<Awaited<ReturnType<typeof parseResultMRZ>>>();
const selectedBranchIssuer = ref('');
const selectedCustomer = ref('');
const toggleWorker = ref(true); const toggleWorker = ref(true);
const rows = ref<Node[]>([]);
const branchId = ref(''); const branchId = ref('');
const currentQuotationId = ref<string | undefined>(undefined); const currentQuotationId = ref<string | undefined>(undefined);
const date = ref(); const date = ref();
@ -172,7 +152,6 @@ const summaryPrice = computed(() =>
), ),
); );
const quotationNo = ref('');
const payBank = ref(''); const payBank = ref('');
const pageState = reactive({ const pageState = reactive({
@ -197,14 +176,7 @@ const productGroup = ref<ProductGroup[]>([]);
const { state: employeeFormState, currentFromDataEmployee } = const { state: employeeFormState, currentFromDataEmployee } =
storeToRefs(employeeFormStore); storeToRefs(employeeFormStore);
const product = ref<Record<Id, Product>>({});
const service = ref<Record<Id, Service>>({});
const selectedGroupSub = ref<'product' | 'service' | null>(null); const selectedGroupSub = ref<'product' | 'service' | null>(null);
const selectedGroup = ref<ProductGroup | null>(null);
const selectedProductServiceId = ref('');
const formDataEmployee = ref< const formDataEmployee = ref<
EmployeeWorker & { EmployeeWorker & {
attachment?: { attachment?: {
@ -249,7 +221,7 @@ async function assignToProductServiceList() {
vat: v.vat || 0, vat: v.vat || 0,
pricePerUnit: v.pricePerUnit || 0, pricePerUnit: v.pricePerUnit || 0,
discount: v.discount || 0, discount: v.discount || 0,
amount: v.discount || 0, amount: v.amount || 0,
product: v.product, product: v.product,
work: v.work || null, work: v.work || null,
service: v.service || null, service: v.service || null,
@ -623,7 +595,7 @@ watch(
v-model:branch-id="branchId" v-model:branch-id="branchId"
v-model:customer-branch-id="quotationFormData.customerBranchId" v-model:customer-branch-id="quotationFormData.customerBranchId"
:readonly="readonly" :readonly="readonly"
@add-customer="triggerSelectTypeCustomerd()" @add-customer=""
/> />
</header> </header>
@ -824,7 +796,7 @@ watch(
:class="{ 'full-height': $q.screen.gt.xs }" :class="{ 'full-height': $q.screen.gt.xs }"
> >
<QuotationFormInfo <QuotationFormInfo
:quotation-no="quotationFull && quotationFull.code" :quotation-no="(quotationFull && quotationFull.code) || ''"
v-model:urgent="quotationFormData.urgent" v-model:urgent="quotationFormData.urgent"
v-model:actor="quotationFormData.actorName" v-model:actor="quotationFormData.actorName"
v-model:work-name="quotationFormData.workName" v-model:work-name="quotationFormData.workName"