refactor: get contact number and name
Some checks failed
Spell Check / Spell Check with Typos (push) Failing after 5s
Some checks failed
Spell Check / Spell Check with Typos (push) Failing after 5s
This commit is contained in:
parent
e5b2114984
commit
0979b03acc
2 changed files with 23 additions and 0 deletions
|
|
@ -2,11 +2,18 @@
|
||||||
import SelectCustomer from '../shared/select/SelectCustomer.vue';
|
import SelectCustomer from '../shared/select/SelectCustomer.vue';
|
||||||
import SelectBranch from '../shared/select/SelectBranch.vue';
|
import SelectBranch from '../shared/select/SelectBranch.vue';
|
||||||
|
|
||||||
|
import { CustomerBranch } from 'src/stores/customer';
|
||||||
|
import { ref } from 'vue';
|
||||||
|
|
||||||
const branchId = defineModel<string>('branchId');
|
const branchId = defineModel<string>('branchId');
|
||||||
const customerBranchId = defineModel<string>('customerBranchId');
|
const customerBranchId = defineModel<string>('customerBranchId');
|
||||||
const agentPrice = defineModel<boolean>('agentPrice');
|
const agentPrice = defineModel<boolean>('agentPrice');
|
||||||
const special = defineModel<boolean>('special');
|
const special = defineModel<boolean>('special');
|
||||||
|
|
||||||
|
const customerBranchOption = defineModel<CustomerBranch>(
|
||||||
|
'customerBranchOption',
|
||||||
|
);
|
||||||
|
|
||||||
defineProps<{
|
defineProps<{
|
||||||
outlined?: boolean;
|
outlined?: boolean;
|
||||||
readonly?: boolean;
|
readonly?: boolean;
|
||||||
|
|
@ -67,10 +74,12 @@ defineEmits<{
|
||||||
required
|
required
|
||||||
:readonly
|
:readonly
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<SelectCustomer
|
<SelectCustomer
|
||||||
id="about-select-customer-branch-id"
|
id="about-select-customer-branch-id"
|
||||||
for="about-select-customer-branch-id"
|
for="about-select-customer-branch-id"
|
||||||
v-model:value="customerBranchId"
|
v-model:value="customerBranchId"
|
||||||
|
v-model:value-option="customerBranchOption"
|
||||||
:label="$t('quotation.customer')"
|
:label="$t('quotation.customer')"
|
||||||
:creatable-disabled-text="`(${$t('form.error.selectField', {
|
:creatable-disabled-text="`(${$t('form.error.selectField', {
|
||||||
field: $t('quotation.branchVirtual'),
|
field: $t('quotation.branchVirtual'),
|
||||||
|
|
|
||||||
|
|
@ -80,6 +80,8 @@ import { RouterLink, useRoute } from 'vue-router';
|
||||||
import { initLang, initTheme, Lang } from 'src/utils/ui';
|
import { initLang, initTheme, Lang } from 'src/utils/ui';
|
||||||
import { convertTemplate } from 'src/utils/string-template';
|
import { convertTemplate } from 'src/utils/string-template';
|
||||||
|
|
||||||
|
import { CustomerBranch } from 'src/stores/customer';
|
||||||
|
|
||||||
type Node = {
|
type Node = {
|
||||||
[key: string]: any;
|
[key: string]: any;
|
||||||
opened?: boolean;
|
opened?: boolean;
|
||||||
|
|
@ -94,6 +96,8 @@ type ProductGroupId = string;
|
||||||
|
|
||||||
const API_BASE_URL = import.meta.env.VITE_API_BASE_URL;
|
const API_BASE_URL = import.meta.env.VITE_API_BASE_URL;
|
||||||
|
|
||||||
|
const customerBranchOption = ref<CustomerBranch>();
|
||||||
|
|
||||||
const employeeStore = useEmployeeStore();
|
const employeeStore = useEmployeeStore();
|
||||||
const route = useRoute();
|
const route = useRoute();
|
||||||
const useReceiptStore = useReceipt();
|
const useReceiptStore = useReceipt();
|
||||||
|
|
@ -1067,6 +1071,15 @@ watch(
|
||||||
|
|
||||||
const productServiceNodes = ref<ProductTree>([]);
|
const productServiceNodes = ref<ProductTree>([]);
|
||||||
|
|
||||||
|
watch(customerBranchOption, () => {
|
||||||
|
if (!customerBranchOption.value) return;
|
||||||
|
|
||||||
|
quotationFormData.value.contactName =
|
||||||
|
customerBranchOption.value.contactName || '';
|
||||||
|
quotationFormData.value.contactTel =
|
||||||
|
customerBranchOption.value.contactTel || '';
|
||||||
|
});
|
||||||
|
|
||||||
watch(
|
watch(
|
||||||
() => productServiceList.value,
|
() => productServiceList.value,
|
||||||
() => {
|
() => {
|
||||||
|
|
@ -1519,6 +1532,7 @@ function covertToNode() {
|
||||||
v-model:customer-branch-id="
|
v-model:customer-branch-id="
|
||||||
quotationFormData.customerBranchId
|
quotationFormData.customerBranchId
|
||||||
"
|
"
|
||||||
|
v-model:customer-branch-option="customerBranchOption"
|
||||||
:readonly="readonly"
|
:readonly="readonly"
|
||||||
/>
|
/>
|
||||||
</template>
|
</template>
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue