From 3a07f2ca675bbd3c55893f7731b8f49d854b0e07 Mon Sep 17 00:00:00 2001
From: gaoluyang <2820782392@qq.com>
Date: 星期四, 26 三月 2026 10:59:25 +0800
Subject: [PATCH] 军泰伟业 1.语法修改
---
src/views/salesManagement/returnOrder/components/detailDia.vue | 20 +++++++++++++++-----
1 files changed, 15 insertions(+), 5 deletions(-)
diff --git a/src/views/salesManagement/returnOrder/components/detailDia.vue b/src/views/salesManagement/returnOrder/components/detailDia.vue
index dedfecc..9c9a73d 100644
--- a/src/views/salesManagement/returnOrder/components/detailDia.vue
+++ b/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 #unQuantity="{ row }">
+ {{ calcAlreadyReturned(row) }}
+ </template>
+ </PIMTable>
</div>
</div>
<template #footer>
@@ -41,13 +45,19 @@
const tableData = ref([]);
const availableProducts = ref([]);
+const calcAlreadyReturned = (row) => {
+ const total = Number(row?.shippingNum ?? row?.totalQuantity ?? 0);
+ const returned = Number(row?.returnQuantity ?? row?.num ?? 0);
+ if (!Number.isFinite(total) || !Number.isFinite(returned)) return 0;
+ return total - returned;
+};
+
const tableColumn = [
{align: "center", label: "浜у搧澶х被", prop: "productCategory"},
- {align: "center", label: "瑙勬牸鍨嬪彿", prop: "specificationModel"},
+ {align: "center", label: "鍥剧焊缂栧彿", prop: "specificationModel"},
{align: "center", label: "鍗曚綅", prop: "unit", width: 80},
{align: "center", label: "鎬绘暟閲�", prop: "shippingNum", width: 120},
- {align: "center", label: "宸查��璐ф暟閲�", prop: "totalReturnNum", width: 120},
- {align: "center", label: "鏈��璐ф暟閲�", prop: "unQuantity", width: 120},
+ {align: "center", label: "鏈��璐ф暟閲�", prop: "unQuantity", width: 120, dataType: "slot", slot: "unQuantity"},
{align: "center", label: "閫�璐ф暟閲�", prop: "returnQuantity", width: 120},
{align: "center", label: "閫�璐т骇鍝佸崟浠�", prop: "price", width: 120},
{align: "center", label: "閫�璐т骇鍝侀噾棰�", prop: "amount", width: 120},
@@ -106,7 +116,7 @@
isQuality: raw?.isQuality ?? 2,
remark: raw?.remark ?? "",
};
- return product ? { ...product, ...normalized } : normalized;
+ return product ? { ...product, ...normalized, returnQuantity: normalized.returnQuantity } : normalized;
}) : [];
} catch (e) {
console.error("Failed to load detail", e);
--
Gitblit v1.9.3