feat: convert product serbice list back to tree
This commit is contained in:
parent
c64676b34c
commit
be69f66742
1 changed files with 12 additions and 2 deletions
|
|
@ -49,7 +49,7 @@ import { useI18n } from 'vue-i18n';
|
|||
import { Employee } from 'src/stores/employee/types';
|
||||
import QuotationFormWorkerSelect from '../05_quotation/QuotationFormWorkerSelect.vue';
|
||||
import { watch } from 'vue';
|
||||
import { ProductTree } from '../05_quotation/utils';
|
||||
import { ProductTree, quotationProductTree } from '../05_quotation/utils';
|
||||
import TableRequest from '../05_quotation/TableRequest.vue';
|
||||
import { RequestData, RequestDataStatus } from 'src/stores/request-list/types';
|
||||
import { useRequestList } from 'src/stores/request-list';
|
||||
|
|
@ -111,7 +111,6 @@ const productServiceList = ref<
|
|||
Required<QuotationPayload['productServiceList'][number]>[]
|
||||
>([]);
|
||||
const productServiceNodes = ref<ProductTree>([]);
|
||||
|
||||
const currentFormData = ref<DebitNotePayload>({
|
||||
productServiceList: [],
|
||||
debitNoteQuotationId: '',
|
||||
|
|
@ -264,6 +263,17 @@ const QUOTATION_STATUS = [
|
|||
'ProcessComplete',
|
||||
];
|
||||
|
||||
watch(
|
||||
() => productServiceList.value,
|
||||
() => {
|
||||
productServiceNodes.value = quotationProductTree(
|
||||
productServiceList.value,
|
||||
agentPrice.value,
|
||||
config.value?.vat,
|
||||
);
|
||||
},
|
||||
);
|
||||
|
||||
function toggleDeleteProduct(index: number) {
|
||||
// product display
|
||||
productServiceList.value.splice(index, 1);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue