refactor: set workerIndex
This commit is contained in:
parent
d82c728919
commit
319777bd05
2 changed files with 4 additions and 19 deletions
|
|
@ -265,9 +265,9 @@ async function convertDataToFormSubmit() {
|
||||||
quotationFormData.value.productServiceList = JSON.parse(
|
quotationFormData.value.productServiceList = JSON.parse(
|
||||||
JSON.stringify(
|
JSON.stringify(
|
||||||
productServiceList.value.map((v) => ({
|
productServiceList.value.map((v) => ({
|
||||||
workerIndex: [0, 1],
|
workerIndex: v.workerIndex,
|
||||||
discount: 1,
|
discount: v.discount,
|
||||||
amount: 1,
|
amount: v.amount,
|
||||||
product: v.product,
|
product: v.product,
|
||||||
work: v.work,
|
work: v.work,
|
||||||
service: v.service,
|
service: v.service,
|
||||||
|
|
|
||||||
|
|
@ -101,23 +101,8 @@ export const useQuotationForm = defineStore('form-quotation', () => {
|
||||||
resetFormData = Object.assign(data, {
|
resetFormData = Object.assign(data, {
|
||||||
productServiceList: data.productServiceList.map((v) => ({
|
productServiceList: data.productServiceList.map((v) => ({
|
||||||
...v,
|
...v,
|
||||||
worker: v.worker.map((value, index) => ({
|
|
||||||
// passportNo: obj.data.passportNo, wait api add
|
|
||||||
//documentExpireDate: obj.data.documentExpireDate,
|
|
||||||
id: value.id,
|
|
||||||
lastNameEN: value.lastNameEN,
|
|
||||||
lastName: value.lastName,
|
|
||||||
middleNameEN: value.middleNameEN,
|
|
||||||
middleName: value.middleName,
|
|
||||||
firstNameEN: value.firstNameEN,
|
|
||||||
firstName: value.firstName,
|
|
||||||
namePrefix: value.namePrefix,
|
|
||||||
nationality: value.nationality,
|
|
||||||
gender: value.gender,
|
|
||||||
dateOfBirth: value.dateOfBirth,
|
|
||||||
})),
|
|
||||||
workerIndex: v.worker.map((a) =>
|
workerIndex: v.worker.map((a) =>
|
||||||
data.worker.findIndex((b) => b.employeeId === a.id),
|
data.worker.findIndex((b) => b.employeeId === a.employeeId),
|
||||||
),
|
),
|
||||||
})),
|
})),
|
||||||
dueDate: new Date(data.dueDate),
|
dueDate: new Date(data.dueDate),
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue