From 859d732d9d3f3871be7ce59069f87ea00e0e24cb Mon Sep 17 00:00:00 2001
From: gaoluyang <2820782392@qq.com>
Date: 星期二, 17 三月 2026 16:53:44 +0800
Subject: [PATCH] 军泰伟业 1.仓储物流需要加上库位,库位暂时分为外购、自制、委外三种类型 2.生产订单加上库存数量,方便实时查看 3.产品发货后,若部分产品退回,可修改订单发货数量(减去退回的产品数量),若订单产品全部退回,可对发货的订单进行取消撤回操作
---
src/views/salesManagement/deliveryLedger/index.vue | 79 ++++++++++++++++++++++++++++++++++++++-
1 files changed, 77 insertions(+), 2 deletions(-)
diff --git a/src/views/salesManagement/deliveryLedger/index.vue b/src/views/salesManagement/deliveryLedger/index.vue
index 748480c..efd32a7 100644
--- a/src/views/salesManagement/deliveryLedger/index.vue
+++ b/src/views/salesManagement/deliveryLedger/index.vue
@@ -39,7 +39,7 @@
/>
</template>
</el-table-column>
- <el-table-column label="瀹℃牳鐘舵��" prop="status" align="center" width="120">
+ <el-table-column label="鐘舵��" prop="status" align="center" width="120">
<template #default="scope">
<el-tag :type="getApprovalStatusType(scope.row.status)">
{{ getApprovalStatusText(scope.row.status) }}
@@ -52,7 +52,7 @@
link
type="primary"
size="small"
- :disabled="(scope.row.waitShippingTotal || 0) <= 0"
+ :disabled="(scope.row.waitShippingTotal || 0) <= 0 || isRevoked(scope.row.status)"
@click="openForm('edit', scope.row)">鍒嗘壒鍙戣揣</el-button>
<el-button
link
@@ -117,6 +117,10 @@
<div class="summary-value shipped">{{ currentShippingOrder.shippingSuccessTotal || 0 }}</div>
</div>
<div class="summary-item">
+ <div class="summary-label">宸查��璐ф暟閲�</div>
+ <div class="summary-value returned">{{ currentShippingOrder.returnedQuantity || 0 }}</div>
+ </div>
+ <div class="summary-item">
<div class="summary-label">寰呭彂璐ф暟閲�</div>
<div class="summary-value waiting">{{ currentShippingOrder.waitShippingTotal || 0 }}</div>
</div>
@@ -169,6 +173,10 @@
<span class="info-label">鍙戣揣鏁伴噺</span>
<span class="info-value quantity">{{ record.shippingNum }}</span>
</div>
+ <div class="info-row">
+ <span class="info-label">閫�璐ф暟閲�</span>
+ <span class="info-value returned">{{ record.returnNum || 0 }}</span>
+ </div>
<div class="info-row" v-if="record.type === '璐ц溅'">
<span class="info-label">杞︾墝鍙�</span>
<span class="info-value">{{ record.shippingCarNumber || '--' }}</span>
@@ -194,6 +202,14 @@
preview-teleported
/>
</div>
+ </div>
+ <div class="record-actions" v-if="canRevokeShipping(record)">
+ <el-button
+ type="danger"
+ size="small"
+ @click="handleRevokeShipping(record)">
+ 鎾ら攢鍙戣揣
+ </el-button>
</div>
</div>
</div>
@@ -442,6 +458,11 @@
return;
}
+ if (type === 'edit' && isRevoked(row.status)) {
+ proxy.$modal.msgWarning("宸叉挙閿�鐘舵�佷笉鑳藉垎鎵瑰彂璐�");
+ return;
+ }
+
dialogMode.value = type === 'edit' ? 'edit' : 'view';
currentShippingOrder.value = row;
showAddForm.value = false;
@@ -517,6 +538,30 @@
if (!currentShippingOrder.value) return false;
const waitShipping = currentShippingOrder.value.waitShippingTotal || 0;
return waitShipping > 0;
+};
+
+// 鏄惁鍙互鎾ら攢鍙戣揣
+const canRevokeShipping = (record) => {
+ const shippingNum = record.shippingNum || 0;
+ const returnNum = record.returnNum || 0;
+ return shippingNum > 0 && returnNum > 0 && shippingNum === returnNum;
+};
+
+// 鎾ら攢鍙戣揣
+const handleRevokeShipping = (record) => {
+ ElMessageBox.confirm("姝ゆ搷浣滃皢鎾ら攢璇ュ彂璐ц褰曪紝鏄惁纭锛�", "鎾ら攢鍙戣揣", {
+ confirmButtonText: "纭",
+ cancelButtonText: "鍙栨秷",
+ type: "warning",
+ })
+ .then(() => {
+ updateShippingInfoDetail({ ...record, status: 3 }).then((res) => {
+ proxy.$modal.msgSuccess("鎾ら攢鎴愬姛");
+ loadShippingRecords(currentShippingOrder.value.id);
+ getList();
+ });
+ })
+ .catch(() => {});
};
// 鎻愪氦鍙戣揣
@@ -741,6 +786,7 @@
'瀹℃牳涓�': '瀹℃牳涓�',
'瀹℃牳鎷掔粷': '瀹℃牳鎷掔粷',
'瀹℃牳閫氳繃': '瀹℃牳閫氳繃',
+ '宸叉挙閿�': '宸叉挙閿�',
'0': '寰呭鏍�',
'1': '瀹℃牳涓�',
'2': '瀹℃牳鎷掔粷',
@@ -769,6 +815,7 @@
'瀹℃牳涓�': 'warning',
'瀹℃牳鎷掔粷': 'danger',
'瀹℃牳閫氳繃': 'success',
+ '宸叉挙閿�': 'warning',
'0': 'info',
'1': 'warning',
'2': 'danger',
@@ -799,6 +846,18 @@
}
const statusStr = String(status).trim();
return statusStr === '瀹℃牳涓�' || statusStr === '1';
+};
+
+// 妫�鏌ョ姸鎬佹槸鍚︿负"宸叉挙閿�"
+const isRevoked = (status) => {
+ if (status === null || status === undefined || status === '') {
+ return false;
+ }
+ if (typeof status === 'number') {
+ return status === 3;
+ }
+ const statusStr = String(status).trim();
+ return statusStr === '宸叉挙閿�' || statusStr === '3';
};
onMounted(() => {
@@ -881,6 +940,10 @@
&.shipped {
color: #67C23A;
+ }
+
+ &.returned {
+ color: #F56C6C;
}
&.waiting {
@@ -994,9 +1057,21 @@
color: #409EFF;
font-size: 16px;
}
+
+ &.returned {
+ font-weight: bold;
+ color: #F56C6C;
+ font-size: 16px;
+ }
}
}
+ .record-actions {
+ margin-top: 12px;
+ padding-top: 12px;
+ border-top: 1px solid #EBEEF5;
+ }
+
.record-images {
display: flex;
gap: 8px;
--
Gitblit v1.9.3