yyb
2 天以前 04d6024553ac73e67148ce578cb01b541eebd02a
src/views/salesManagement/returnOrder/components/detailDia.vue
@@ -20,7 +20,11 @@
      <div style="padding-top: 20px">
        <span class="descriptions">产品列表</span>
        <PIMTable :isShowPagination="false" rowKey="id" :column="tableColumn" :tableData="tableData" />
        <PIMTable :isShowPagination="false" rowKey="id" :column="tableColumn" :tableData="tableData">
          <template #totalReturnNum="{ row }">
            {{ calcAlreadyReturned(row) }}
          </template>
        </PIMTable>
      </div>
    </div>
    <template #footer>
@@ -101,6 +105,13 @@
const firstNonEmptyText = (...vals) => {
  const hit = vals.find((v) => !isEmptyText(v));
  return hit === undefined ? "" : hit;
};
const calcAlreadyReturned = (row) => {
  const total = Number(row?.stockOutNum ?? row?.totalQuantity ?? row?.totalReturnNum ?? 0);
  const un = Number(row?.unQuantity ?? 0);
  if (!Number.isFinite(total) || !Number.isFinite(un)) return 0;
  return Math.max(total - un, 0);
};
/** 详情表用 productName / model;合并时勿让空串盖掉出库行字段 */
@@ -241,7 +252,7 @@
  {align: "center", label: "规格型号", prop: "model"},
  {align: "center", label: "单位", prop: "unit", width: 80},
  {align: "center", label: "总数量", prop: "stockOutNum", width: 120},
  {align: "center", label: "已退货数量", prop: "totalReturnNum", width: 120},
  {align: "center", label: "已退货数量", prop: "totalReturnNum", width: 120, dataType: "slot", slot: "totalReturnNum"},
  {align: "center", label: "未退货数量", prop: "unQuantity", width: 120},
  {align: "center", label: "退货数量", prop: "returnQuantity", width: 120},
  {align: "center", label: "退货产品单价", prop: "price", width: 120},