zhangwencui
2 天以前 f670b79094c95d791fc43c8fc8b5858ebf8426dc
src/pages/procurementManagement/purchaseReturnOrder/add.vue
@@ -547,11 +547,16 @@
  };
  const mergeSelectedProducts = selectedRows => {
    const existing = new Set((form.value.purchaseReturnOrderProductsDtos || []).map(i => String(i.salesLedgerProductId || i.id)));
    const existing = new Set(
      (form.value.purchaseReturnOrderProductsDtos || []).map(i =>
        String(i.stockInRecordId || i.salesLedgerProductId || i.id)
      )
    );
    const toAdd = (selectedRows || [])
      .filter(i => !existing.has(String(i.id)))
      .map(i => ({
        ...i,
        stockInRecordId: i.stockInRecordId || i.id,
        salesLedgerProductId: i.id,
        returnQuantity: 0,
        taxInclusiveTotalPrice: 0,
@@ -602,6 +607,7 @@
    loading.value = true;
    const rows = (form.value.purchaseReturnOrderProductsDtos || []).map(i => {
      const cloned = { ...i };
      cloned.stockInRecordId = cloned.stockInRecordId || cloned.id;
      syncRowTotal(cloned);
      return cloned;
    });