refactor: workerIndex
This commit is contained in:
parent
85b108a9b2
commit
7760f0f15a
4 changed files with 88 additions and 12 deletions
|
|
@ -222,6 +222,7 @@ function mapNode() {
|
|||
detail: p.product.detail,
|
||||
remark: p.product.remark,
|
||||
value: {
|
||||
workerIndex: [],
|
||||
vat: 0,
|
||||
pricePerUnit,
|
||||
discount: 0,
|
||||
|
|
@ -258,6 +259,7 @@ function mapNode() {
|
|||
subtitle: p.product.code || ' ',
|
||||
checked: true,
|
||||
value: {
|
||||
workerIndex: [],
|
||||
vat: 0,
|
||||
pricePerUnit,
|
||||
discount: 0,
|
||||
|
|
@ -282,6 +284,7 @@ function mapNode() {
|
|||
title: v.name,
|
||||
subtitle: v.code,
|
||||
value: {
|
||||
workerIndex: [],
|
||||
vat: 0,
|
||||
pricePerUnit,
|
||||
discount: 0,
|
||||
|
|
|
|||
|
|
@ -52,7 +52,13 @@ import ToggleButton from 'components/button/ToggleButton.vue';
|
|||
import FormAbout from 'components/05_quotation/FormAbout.vue';
|
||||
import SelectZone from 'components/shared/SelectZone.vue';
|
||||
import PersonCard from 'components/shared/PersonCard.vue';
|
||||
import { AddButton, SaveButton, EditButton } from 'components/button';
|
||||
import {
|
||||
AddButton,
|
||||
SaveButton,
|
||||
EditButton,
|
||||
UndoButton,
|
||||
DeleteButton,
|
||||
} from 'components/button';
|
||||
import ProductServiceForm from './ProductServiceForm.vue';
|
||||
import QuotationFormInfo from './QuotationFormInfo.vue';
|
||||
import ProfileBanner from 'components/ProfileBanner.vue';
|
||||
|
|
@ -250,7 +256,7 @@ async function assignToProductServiceList() {
|
|||
}),
|
||||
);
|
||||
selectedProductGroup.value =
|
||||
quotationFormData.value.productServiceList[0].product.productGroup?.id ||
|
||||
quotationFormData.value.productServiceList[0]?.product.productGroup?.id ||
|
||||
'';
|
||||
}
|
||||
}
|
||||
|
|
@ -424,6 +430,9 @@ function convertToTable(nodes: Node[]) {
|
|||
|
||||
list.forEach((v) => {
|
||||
v.amount = Math.max(selectedWorker.value.length, 1);
|
||||
for (let i = 0; i < selectedWorker.value.length; i++) {
|
||||
v.workerIndex.push(i);
|
||||
}
|
||||
});
|
||||
|
||||
productServiceList.value = list;
|
||||
|
|
@ -437,6 +446,14 @@ function convertEmployeeToTable() {
|
|||
v.amount + preSelectedWorker.value.length - selectedWorker.value.length,
|
||||
1,
|
||||
);
|
||||
|
||||
for (
|
||||
let i = 0;
|
||||
i < preSelectedWorker.value.length - selectedWorker.value.length;
|
||||
i++
|
||||
) {
|
||||
v.workerIndex.push(selectedWorker.value.length + i);
|
||||
}
|
||||
return v;
|
||||
});
|
||||
refSelectZoneEmployee.value?.assignSelect(
|
||||
|
|
@ -715,7 +732,6 @@ watch(
|
|||
productGroup.find((g) => g.id === selectedProductGroup)
|
||||
?.name || '-'
|
||||
}}
|
||||
<q-icon name="mdi-chevron-right" class="q-pl-sm" size="xs" />
|
||||
</span>
|
||||
|
||||
<ProductItem
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue