fix: quotation customer

This commit is contained in:
puriphatt 2024-10-11 14:01:17 +07:00
parent 9845b95de2
commit af243af3bf
2 changed files with 14 additions and 17 deletions

View file

@ -63,7 +63,6 @@ async function init(val: string, type: 'branch' | 'customer') {
}) })
: await customerStore.fetchListCustomeBranch({ : await customerStore.fetchListCustomeBranch({
query: val, query: val,
registeredBranchId: branchId.value || undefined,
pageSize: 30, pageSize: 30,
}); });
if (res) { if (res) {
@ -91,15 +90,15 @@ onMounted(async () => {
await init('', 'customer'); await init('', 'customer');
}); });
watch( // watch(
() => branchId.value, // () => branchId.value,
async (v) => { // async (v) => {
if (v && customerBranchId.value && props.onCreate) { // if (v && customerBranchId.value && props.onCreate) {
console.log('form'); // console.log('form');
customerBranchId.value = ''; // customerBranchId.value = '';
} // }
}, // },
); // );
</script> </script>
<template> <template>
<div class="row"> <div class="row">
@ -149,7 +148,6 @@ watch(
<SelectInput <SelectInput
:readonly :readonly
incremental incremental
:disable="!branchId"
v-model="customerBranchId" v-model="customerBranchId"
class="col-md col-12" class="col-md col-12"
id="quotation-customer" id="quotation-customer"

View file

@ -544,11 +544,11 @@ watch(
url.searchParams.set('customerBranchId', v); url.searchParams.set('customerBranchId', v);
history.pushState({}, '', url.toString()); history.pushState({}, '', url.toString());
if (!v) return; // if (!v) return;
const retEmp = await customerStore.fetchBranchEmployee(v); // const retEmp = await customerStore.fetchBranchEmployee(v);
if (retEmp) { // if (retEmp) {
workerList.value = workerList.value = retEmp.data.result; // workerList.value = retEmp.data.result;
} // }
}, },
); );
@ -559,7 +559,6 @@ watch(
const url = new URL(window.location.href); const url = new URL(window.location.href);
url.searchParams.set('branchId', v); url.searchParams.set('branchId', v);
history.pushState({}, '', url.toString()); history.pushState({}, '', url.toString());
quotationFormData.value.customerBranchId = '';
}, },
); );
</script> </script>