refactor: citizen missig
This commit is contained in:
parent
aa823d68aa
commit
bad389f6be
3 changed files with 23 additions and 14 deletions
|
|
@ -443,15 +443,16 @@ export const useCustomerBranchForm = defineStore('form-customer-branch', () => {
|
|||
|
||||
let resetFormData = structuredClone(defaultFormData);
|
||||
|
||||
const currentFormData = ref<CustomerBranchCreate & { id?: string }>(
|
||||
structuredClone(defaultFormData),
|
||||
);
|
||||
const currentFormData = ref<
|
||||
CustomerBranchCreate & { id?: string; codeCustomer?: string }
|
||||
>(structuredClone(defaultFormData));
|
||||
|
||||
const state = ref<{
|
||||
dialogType: 'info' | 'create' | 'edit';
|
||||
dialogOpen: boolean;
|
||||
dialogModal: boolean;
|
||||
currentCustomerId: string;
|
||||
customerType?: 'CORP' | 'PERS';
|
||||
}>({
|
||||
dialogType: 'info',
|
||||
dialogOpen: false,
|
||||
|
|
@ -474,7 +475,6 @@ export const useCustomerBranchForm = defineStore('form-customer-branch', () => {
|
|||
resetFormData = {
|
||||
id: _data.id,
|
||||
code: _data.code,
|
||||
customerCode: '',
|
||||
provinceId: _data.provinceId,
|
||||
districtId: _data.districtId,
|
||||
subDistrictId: _data.subDistrictId,
|
||||
|
|
@ -558,7 +558,8 @@ export const useCustomerBranchForm = defineStore('form-customer-branch', () => {
|
|||
const res = await customerStore.createBranch({
|
||||
...currentFormData.value,
|
||||
citizenId:
|
||||
customerFormStore.currentFormData.customerType === 'CORP'
|
||||
(state.value.customerType ||
|
||||
customerFormStore.currentFormData.customerType) === 'CORP'
|
||||
? undefined
|
||||
: currentFormData.value.citizenId,
|
||||
customerId: state.value.currentCustomerId,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue