diff --git a/src/components/shared/select/SelectBusinessType.vue b/src/components/shared/select/SelectBusinessType.vue
index 12b6172e..211ed07e 100644
--- a/src/components/shared/select/SelectBusinessType.vue
+++ b/src/components/shared/select/SelectBusinessType.vue
@@ -158,39 +158,6 @@ function setDefaultValue() {
-
-
-
-
-
-
- {{ $t('general.add', { text: $t('menu.manage.businessType') }) }}
-
-
- {{ creatableDisabledText }}
-
-
-
-
-
-
-
-
diff --git a/src/components/shared/select/SelectCustomer.vue b/src/components/shared/select/SelectCustomer.vue
index 2e62eba8..73fafd79 100644
--- a/src/components/shared/select/SelectCustomer.vue
+++ b/src/components/shared/select/SelectCustomer.vue
@@ -30,7 +30,6 @@ defineEmits<{
type ExclusiveProps = {
simple?: boolean;
simpleBranchNo?: boolean;
- selectFirstValue?: boolean;
};
const props = defineProps & ExclusiveProps>();
@@ -65,14 +64,10 @@ onMounted(async () => {
setFirstValue();
}
- if (props.selectFirstValue) {
- setDefaultValue();
- } else await getSelectedOption();
-});
+ await getSelectedOption();
-function setDefaultValue() {
- setFirstValue();
-}
+ valueOption.value = selectOptions.value.find((v) => v.id === value.value);
+});
-
+
+
+
@@ -180,11 +177,3 @@ function setDefaultValue() {
-
-
diff --git a/src/pages/03_customer-management/MainPage.vue b/src/pages/03_customer-management/MainPage.vue
index 539a4a01..e02a381e 100644
--- a/src/pages/03_customer-management/MainPage.vue
+++ b/src/pages/03_customer-management/MainPage.vue
@@ -2263,7 +2263,7 @@ const emptyCreateDialog = ref(false);
customerFormData.customerBranch[0].legalPersonNo
"
v-model:business-type="
- customerFormData.customerBranch[0].businessTypeId
+ customerFormData.customerBranch[0].businessType
"
v-model:job-position="
customerFormData.customerBranch[0].jobPosition
diff --git a/src/pages/03_customer-management/components/employer/EmployerFormBusiness.vue b/src/pages/03_customer-management/components/employer/EmployerFormBusiness.vue
index 26b0d659..0717d54f 100644
--- a/src/pages/03_customer-management/components/employer/EmployerFormBusiness.vue
+++ b/src/pages/03_customer-management/components/employer/EmployerFormBusiness.vue
@@ -10,25 +10,10 @@ import { useI18n } from 'vue-i18n';
import ThaiBahtText from 'thai-baht-text';
import SelectBusinessType from 'src/components/shared/select/SelectBusinessType.vue';
-import BusinessTypeDialog from 'src/pages/16_business-type-management/BusinessTypeDialog.vue';
-
-import useBusinessTypeStore from 'src/stores/business-type';
-
const { locale } = useI18n({ useScope: 'global' });
const rawOption = ref();
-const businessTypeDialog = ref(false);
-const formDataBusinessType = ref<{
- name: string;
- nameEN: string;
-}>({
- name: '',
- nameEN: '',
-});
-
-const useBusinessType = useBusinessTypeStore();
-
const businessTypeId = defineModel('businessTypeId');
const jobPosition = defineModel('jobPosition');
const jobDescription = defineModel('jobDescription');
@@ -44,8 +29,6 @@ const typeBusinessENOption = ref([]);
const jobPositionOption = ref([]);
const jobPositionENOption = ref([]);
-const keySelect = ref(0);
-
defineProps<{
title?: string;
dense?: boolean;
@@ -55,20 +38,6 @@ defineProps<{
showTitle?: boolean;
}>();
-function resetFormBusinessType() {
- businessTypeDialog.value = false;
- formDataBusinessType.value = { name: '', nameEN: '' };
-}
-
-async function submitBusinessType() {
- const res = await useBusinessType.create(formDataBusinessType.value);
- if (res) {
- businessTypeId.value = res.id;
- resetFormBusinessType();
- keySelect.value++;
- }
-}
-
onMounted(async () => {
const resultOption = await fetch('/option/option.json');
rawOption.value = await resultOption.json();
@@ -152,24 +121,16 @@ let jobPositionENFilter = selectFilterOptionRefMod(
(businessTypeDialog = true)"
/>
(businessTypeDialog = true)"
+ :readonly
/>
-
-
diff --git a/src/pages/03_customer-management/form.ts b/src/pages/03_customer-management/form.ts
index fe875a3c..3abefdaa 100644
--- a/src/pages/03_customer-management/form.ts
+++ b/src/pages/03_customer-management/form.ts
@@ -30,8 +30,6 @@ export const useCustomerForm = defineStore('form-customer', () => {
const registerAbleBranchOption = ref<{ id: string; name: string }[]>();
- const currentBranchRootId = ref('');
-
const tabFieldRequired = ref<{
[key: string]: (keyof CustomerBranchCreate)[];
}>({
@@ -162,7 +160,6 @@ 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;
@@ -503,8 +500,6 @@ export const useCustomerForm = defineStore('form-customer', () => {
state,
resetFormData,
currentFormData,
- currentBranchRootId,
-
isFormDataDifferent,
resetForm,
assignFormData,
@@ -1668,7 +1663,6 @@ export const useEmployeeForm = defineStore('form-employee', () => {
state,
currentFromDataEmployee,
resetEmployeeData,
-
addPassport,
addVisa,
addCheckup,
diff --git a/src/pages/05_quotation/MainPage.vue b/src/pages/05_quotation/MainPage.vue
index 3551a047..b9b57354 100644
--- a/src/pages/05_quotation/MainPage.vue
+++ b/src/pages/05_quotation/MainPage.vue
@@ -60,6 +60,7 @@ const flowStore = useFlowStore();
const userBranch = useMyBranch();
const navigatorStore = useNavigator();
const customerStore = useCustomerStore();
+
const {
fetchListOfOptionBranch,
customerFormUndo,
@@ -75,7 +76,6 @@ const {
const {
state: customerFormState,
currentFormData: customerFormData,
- currentBranchRootId,
registerAbleBranchOption,
tabFieldRequired,
} = storeToRefs(customerFormStore);
@@ -89,8 +89,6 @@ const fieldSelectedOption = computed(() => {
value: v.name,
}));
});
-
-const keyAddDialog = ref(0);
const special = ref(false);
const branchId = ref('');
const agentPrice = ref(false);
@@ -867,7 +865,6 @@ async function filterBySellerId() {
@@ -1002,7 +999,6 @@ async function filterBySellerId() {
() => {
customerFormState.dialogModal = false;
onCreateImageList = { selectedImage: '', list: [] };
- keyAddDialog++;
}
"
>
@@ -1194,7 +1190,7 @@ async function filterBySellerId() {
customerFormData.customerBranch[0].legalPersonNo
"
v-model:business-type="
- customerFormData.customerBranch[0].businessTypeId
+ customerFormData.customerBranch[0].businessType
"
v-model:job-position="
customerFormData.customerBranch[0].jobPosition
@@ -1275,6 +1271,7 @@ async function filterBySellerId() {
res = await customerStore.createBranch({
...customerFormData.customerBranch[idx],
customerId: customerFormState.editCustomerId || '',
+ id: undefined,
});
}
if (res) {