fix: get contact number and name

This commit is contained in:
Thanaphon Frappet 2025-08-22 14:03:48 +07:00 committed by Methapon2001
parent e5b2114984
commit 764d9bab3f
2 changed files with 19 additions and 0 deletions

View file

@ -1,4 +1,6 @@
<script setup lang="ts">
import { CustomerBranch } from 'src/stores/customer';
import SelectCustomer from '../shared/select/SelectCustomer.vue';
import SelectBranch from '../shared/select/SelectBranch.vue';
@ -7,6 +9,10 @@ const customerBranchId = defineModel<string>('customerBranchId');
const agentPrice = defineModel<boolean>('agentPrice');
const special = defineModel<boolean>('special');
const customerBranchOption = defineModel<CustomerBranch>(
'customerBranchOption',
);
defineProps<{
outlined?: boolean;
readonly?: boolean;
@ -71,6 +77,7 @@ defineEmits<{
id="about-select-customer-branch-id"
for="about-select-customer-branch-id"
v-model:value="customerBranchId"
v-model:value-option="customerBranchOption"
:label="$t('quotation.customer')"
:creatable-disabled-text="`(${$t('form.error.selectField', {
field: $t('quotation.branchVirtual'),

View file

@ -80,6 +80,8 @@ import { RouterLink, useRoute } from 'vue-router';
import { initLang, initTheme, Lang } from 'src/utils/ui';
import { convertTemplate } from 'src/utils/string-template';
import { CustomerBranch } from 'src/stores/customer';
type Node = {
[key: string]: any;
opened?: boolean;
@ -111,6 +113,8 @@ const $q = useQuasar();
const openQuotation = ref<boolean>(false);
const formMetadata = ref();
const customerBranchOption = ref<CustomerBranch>();
const rowsRequestList = ref<RequestData[]>([]);
const {
@ -1074,6 +1078,13 @@ watch(
},
);
watch(customerBranchOption, () => {
if (!customerBranchOption.value) return;
quotationFormData.value.contactName = customerBranchOption.value.contactName;
quotationFormData.value.contactTel = customerBranchOption.value.contactTel;
});
// async function searchEmployee(text: string) {
// let query: string | undefined = text;
// let pageSize = 50;
@ -1519,6 +1530,7 @@ function covertToNode() {
v-model:customer-branch-id="
quotationFormData.customerBranchId
"
v-model:customer-branch-option="customerBranchOption"
:readonly="readonly"
/>
</template>