Skip to content

Commit 24bbd4e

Browse files
ba1q1fit2-zhao
authored andcommitted
fix: price delete
1 parent 113af76 commit 24bbd4e

File tree

1 file changed

+3
-2
lines changed
  • frontend/packages/web/src/components/business/crm-sub-table

1 file changed

+3
-2
lines changed

frontend/packages/web/src/components/business/crm-sub-table/index.vue

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -271,7 +271,8 @@
271271
}
272272
isProcessingDataSourceChange.value = true;
273273
const key = field.businessKey || field.id;
274-
if (isPriceSubTableShowSubField) {
274+
const parents = source.filter((s) => !s.parentId);
275+
if (isPriceSubTableShowSubField && val.filter((e) => parents.some((p) => p.id === e)).length > 0) {
275276
// 价格表子表格特殊处理,需要填充多行
276277
const children = source.filter(
277278
(s) => s.parentId && data.value.every((r) => r.price_sub !== s.id) // 过滤已存在的行
@@ -312,7 +313,7 @@
312313
applyDataSourceShowFields(field, row[key], row, source, row.price_sub);
313314
}
314315
} else {
315-
row[key] = val;
316+
row[key] = val.filter((e) => parents.some((p) => p.id === e)).length > 0 ? val : [];
316317
applyDataSourceShowFields(field, val, row, source, row.price_sub);
317318
}
318319
sumInitialOptions.value = sumInitialOptions.value.concat(

0 commit comments

Comments
 (0)