From 9ea5ff67655241271bdf04bb50ca3a8d60c4e22a Mon Sep 17 00:00:00 2001
From: yuan <123@>
Date: 星期二, 11 八月 2026 15:07:02 +0800
Subject: [PATCH] fix: 用河南鹤壁代码覆盖山西长治
---
src/views/procurementManagement/purchaseReturnOrder/index.vue | 60 +++++++++++++-----------------------------------------------
1 files changed, 13 insertions(+), 47 deletions(-)
diff --git a/src/views/procurementManagement/purchaseReturnOrder/index.vue b/src/views/procurementManagement/purchaseReturnOrder/index.vue
index 2b73253..f8866e1 100644
--- a/src/views/procurementManagement/purchaseReturnOrder/index.vue
+++ b/src/views/procurementManagement/purchaseReturnOrder/index.vue
@@ -45,13 +45,8 @@
@click="handleDetail(row)"
>璇︽儏</el-button
>
- <el-button
- link
- size="small"
- :disabled="row.stockOutApproved"
- :style="{ color: row.stockOutApproved ? '#c0c4cc' : undefined }"
- @click="handleDelete(row)"
- >{{ row.stockOutApproved }}</el-button
+ <el-button link size="small" @click="handleDelete(row)"
+ >鍒犻櫎</el-button
>
</template>
</PIMTable>
@@ -94,20 +89,6 @@
<el-descriptions-item label="閫�鏂欎汉">{{
detailData.returnUserName || "--"
}}</el-descriptions-item>
- <el-descriptions-item label="鍙戣揣绫诲瀷">{{
- getShippingTypeLabel(detailData.shippingType)
- }}</el-descriptions-item>
- <el-descriptions-item v-if="String(detailData.shippingType) === '1'" label="鍙戣揣杞︾墝鍙�">{{
- detailData.truckPlateNo || "--"
- }}</el-descriptions-item>
- <template v-else-if="String(detailData.shippingType) === '2'">
- <el-descriptions-item label="蹇�掑叕鍙�">{{
- detailData.expressCompany || "--"
- }}</el-descriptions-item>
- <el-descriptions-item label="蹇�掑崟鍙�">{{
- detailData.expressNo || "--"
- }}</el-descriptions-item>
- </template>
<el-descriptions-item label="鏁村崟鎶樻墸棰�">{{
formatAmount(detailData.totalDiscountAmount)
}}</el-descriptions-item>
@@ -161,14 +142,13 @@
/>
<el-table-column label="鍗曚綅" prop="unit" width="80" />
<el-table-column label="鏁伴噺" prop="stockInNum" width="80" />
- <el-table-column label="閿�鍞彂璐ф暟閲�" prop="saleOutQuantity" width="110" />
<el-table-column label="鍙��璐ф暟閲�"
prop="unQuantity"
width="100" />
<el-table-column label="宸查��璐ф暟閲�"
width="100">
<template #default="scope">
- {{ formatAmount(scope.row.totalReturnNum || 0) }}
+ {{ calcAlreadyReturned(scope.row) }}
</template>
</el-table-column>
<!-- <el-table-column label="搴撳瓨棰勮鏁伴噺" prop="warnNum" width="120" /> -->
@@ -309,15 +289,6 @@
prop: "returnUserName",
width: 110,
},
- {
- label: "鍙戣揣绫诲瀷",
- prop: "shippingType",
- width: 100,
- formatData: (val) => getShippingTypeLabel(val),
- },
- { label: "鍙戣揣杞︾墝鍙�", prop: "truckPlateDisplay", width: 140 },
- { label: "蹇�掑叕鍙�", prop: "expressCompanyDisplay", width: 140 },
- { label: "蹇�掑崟鍙�", prop: "expressNoDisplay", width: 150 },
{
label: "鏁村崟鎶樻墸棰�",
@@ -370,7 +341,6 @@
},
{
name: "鍒犻櫎",
- disabled: (row) => !!row.stockOutApproved,
clickFun: (row) => {
handleDelete(row);
},
@@ -452,12 +422,7 @@
findPurchaseReturnOrderListPage({ ...searchForm.value, ...page })
.then((res) => {
tableLoading.value = false;
- tableData.value = (res.data.records || []).map((row) => ({
- ...row,
- truckPlateDisplay: String(row?.shippingType) === "1" ? (row?.truckPlateNo || "--") : "--",
- expressCompanyDisplay: String(row?.shippingType) === "2" ? (row?.expressCompany || "--") : "--",
- expressNoDisplay: String(row?.shippingType) === "2" ? (row?.expressNo || "--") : "--",
- }));
+ tableData.value = res.data.records;
page.total = res.data.total;
})
.catch(() => {
@@ -485,14 +450,6 @@
);
};
-const getShippingTypeLabel = (value) => {
- const shippingTypeMap = {
- 1: "璐ц溅",
- 2: "蹇��",
- };
- return shippingTypeMap[String(value)] || shippingTypeMap[value] || "--";
-};
-
const formatAmount = (value) => {
if (value === null || value === undefined || value === "") {
return "--";
@@ -504,6 +461,14 @@
return num.toFixed(2);
};
+/** 宸查��璐ф暟閲� = 鍏ュ簱琛屾�绘暟閲� 鈭� 褰撳墠鍙��璐ф暟閲忥紙鍓╀綑锛� */
+const calcAlreadyReturned = (row) => {
+ const total = Number(row?.stockInNum ?? row?.totalQuantity ?? row?.quantity ?? 0);
+ const un = Number(row?.unQuantity ?? 0);
+ if (!Number.isFinite(total) || !Number.isFinite(un)) return 0;
+ return Math.max(total - un, 0);
+};
+
onMounted(() => {
getList();
});
@@ -513,3 +478,4 @@
margin-top: unset;
}
</style>
+
--
Gitblit v1.9.3