fix: reset quotation split and split count
This commit is contained in:
parent
db0e43ddbb
commit
1b37bc21a1
2 changed files with 35 additions and 17 deletions
|
|
@ -136,6 +136,9 @@ const refSelectZoneEmployee = ref<InstanceType<typeof SelectZone>>();
|
|||
const mrz = ref<Awaited<ReturnType<typeof parseResultMRZ>>>();
|
||||
const toggleWorker = ref(true);
|
||||
const tempPaySplitCount = ref(0);
|
||||
const tempPaySplit = ref<
|
||||
{ no: number; amount: number; name?: string; invoice?: boolean }[]
|
||||
>([]);
|
||||
const currentQuotationId = ref<string | undefined>(undefined);
|
||||
const date = ref();
|
||||
const preSelectedWorker = ref<Employee[]>([]);
|
||||
|
|
@ -371,6 +374,10 @@ async function fetchQuotation() {
|
|||
const id = currentQuotationId.value || quotationFormData.value.id || '';
|
||||
|
||||
await quotationForm.assignFormData(id, quotationFormState.value.mode);
|
||||
tempPaySplitCount.value = quotationFormData.value.paySplitCount || 0;
|
||||
tempPaySplit.value = JSON.parse(
|
||||
JSON.stringify(quotationFormData.value.paySplit),
|
||||
);
|
||||
}
|
||||
|
||||
await assignToProductServiceList();
|
||||
|
|
@ -697,6 +704,9 @@ function convertToTable(nodes: Node[]) {
|
|||
}).finalPrice,
|
||||
}));
|
||||
|
||||
tempPaySplit.value = JSON.parse(
|
||||
JSON.stringify(quotationFormData.value.paySplit),
|
||||
);
|
||||
pageState.productServiceModal = false;
|
||||
}
|
||||
|
||||
|
|
@ -960,10 +970,6 @@ function getStatus(
|
|||
doneIndex: number,
|
||||
doingIndex: number,
|
||||
) {
|
||||
console.log(
|
||||
status,
|
||||
QUOTATION_STATUS.findIndex((v) => v === status),
|
||||
);
|
||||
return QUOTATION_STATUS.findIndex((v) => v === status) >= doneIndex
|
||||
? 'done'
|
||||
: QUOTATION_STATUS.findIndex((v) => v === status) >= doingIndex
|
||||
|
|
@ -1402,7 +1408,8 @@ async function getWorkerFromCriteria(
|
|||
<QuotationFormInfo
|
||||
:view="view"
|
||||
:installment-no="selectedInstallmentNo"
|
||||
:pay-split-fixed="tempPaySplitCount"
|
||||
:pay-split-count-fixed="tempPaySplitCount"
|
||||
:pay-split-fixed="tempPaySplit"
|
||||
v-model:pay-type="quotationFormData.payCondition"
|
||||
v-model:pay-bank="payBank"
|
||||
v-model:pay-split-count="quotationFormData.paySplitCount"
|
||||
|
|
@ -1701,15 +1708,17 @@ async function getWorkerFromCriteria(
|
|||
</q-expansion-item>
|
||||
</template>
|
||||
|
||||
<QuotationFormReceipt
|
||||
v-if="view === View.Receipt"
|
||||
v-for="(v, i) in receiptList"
|
||||
:amount="v.amount"
|
||||
:date="v.date"
|
||||
:pay-type="quotationFormData.payCondition"
|
||||
:index="i"
|
||||
:pay-split-count="quotationFormData.paySplitCount || 0"
|
||||
/>
|
||||
<template v-if="view === View.Receipt">
|
||||
<QuotationFormReceipt
|
||||
v-for="(v, i) in receiptList"
|
||||
:key="i"
|
||||
:amount="v.amount"
|
||||
:date="v.date"
|
||||
:pay-type="quotationFormData.payCondition"
|
||||
:index="i"
|
||||
:pay-split-count="quotationFormData.paySplitCount || 0"
|
||||
/>
|
||||
</template>
|
||||
</div>
|
||||
</section>
|
||||
</article>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue