diff --git a/src/components/05_quotation/ProductItem.vue b/src/components/05_quotation/ProductItem.vue index aae67bfa..307dd447 100644 --- a/src/components/05_quotation/ProductItem.vue +++ b/src/components/05_quotation/ProductItem.vue @@ -208,9 +208,17 @@ watch( () => props.employeeRows, (a, b) => { if (a === undefined || b === undefined) return; + + const removed = b.findIndex( + (c) => !a.find((d) => JSON.stringify(c) === JSON.stringify(d)), + ); + if (a.length < b.length) { rows.value.forEach((p) => { const maxValue = Math.max(...p.workerIndex); + if (removed !== -1) { + p.workerIndex = p.workerIndex.map((i) => (i > removed ? i - 1 : i)); + } p.workerIndex = p.workerIndex.filter((i) => i !== maxValue); }); }