From d01658c63cd541fe4ea5cec5c4bd7f23b9408cdb Mon Sep 17 00:00:00 2001
From: 647556386 <647556386@qq.com>
Date: 星期六, 18 十月 2025 15:04:56 +0800
Subject: [PATCH] 前端,pda,后端接口更改,新增,优化

---
 WMS/WIDESEA_WMSClient/src/extension/outbound/extend/outOrderDetail.vue |  206 +++++++++++++++++++++++++++++++++++++-------------
 1 files changed, 151 insertions(+), 55 deletions(-)

diff --git a/WMS/WIDESEA_WMSClient/src/extension/outbound/extend/outOrderDetail.vue b/WMS/WIDESEA_WMSClient/src/extension/outbound/extend/outOrderDetail.vue
index 67f59b2..a8bfa49 100644
--- a/WMS/WIDESEA_WMSClient/src/extension/outbound/extend/outOrderDetail.vue
+++ b/WMS/WIDESEA_WMSClient/src/extension/outbound/extend/outOrderDetail.vue
@@ -14,13 +14,13 @@
               <span>宸查�変腑 {{ selection.length }} 椤�</span>
             </el-col>
             <el-col :span="8">
-              <!-- <el-link
+              <el-link
                 type="primary"
                 size="small"
-                style="float: right; height: 20px"
-                @click="lockstocks"
-                >閿佸畾搴撳瓨</el-link
-              > -->
+                style="float: left; height: 20px;"
+                @click="cancelOutFeedbackERP"
+                >鍑哄簱鏄庣粏鍙栨秷鎺ㄩ�丒RP</el-link
+              >
               <el-link
                 type="primary"
                 size="small"
@@ -69,6 +69,7 @@
             align="center"
           >
             <template #default="scoped">
+              <!-- 鍥炬爣鍒� -->
               <div v-if="item.type == 'icon'">
                 <el-tooltip
                   class="item"
@@ -83,10 +84,29 @@
                 ></el-tooltip>
               </div>
 
+              <!-- 鏍囩鍒� -->
               <div v-else-if="item.type == 'tag'">
                 <el-tag size="small">
                   {{ getDictionary(scoped.row, item) }}
                 </el-tag>
+              </div>
+
+              <!-- 鏅�氭枃鏈垪 - 甯︽孩鍑洪殣钘忓拰Tooltip -->
+              <div v-else>
+                <el-tooltip
+                  class="item"
+                  effect="dark"
+                  :content="formatCellContent(scoped.row[item.prop])"
+                  placement="top"
+                  :disabled="!shouldShowTooltip(scoped.row[item.prop], item)"
+                >
+                  <span 
+                    class="ellipsis-cell" 
+                    :style="{ width: calculateCellWidth(item) }"
+                  >
+                    {{ formatCellContent(scoped.row[item.prop]) }}
+                  </span>
+                </el-tooltip>
               </div>
             </template>
           </el-table-column>
@@ -131,14 +151,15 @@
           hidden: true,
         },
         {
-          prop: "materielCode",
-          title: "鐗╂枡缂栧彿",
-          type: "string",
-          width: 150,
+          prop: "viewDetail",
+          title: "鍑哄簱璇︾粏",
+          type: "icon",
+          width: 90,
+          icon: "el-icon-s-operation",
         },
         {
-          prop: "materielName",
-          title: "鐗╂枡鍚嶇О",
+          prop: "materielCode",
+          title: "鐗╂枡缂栧彿",
           type: "string",
           width: 150,
         },
@@ -146,18 +167,18 @@
           prop: "batchNo",
           title: "鎵规鍙�",
           type: "string",
-          width: 90,
+          width: 180,
+        },
+        {
+          prop: "supplierBatch",
+          title: "渚涘簲鍟嗘壒娆″彿",
+          type: "string",
+          width: 180,
         },
         {
           prop: "orderQuantity",
           title: "鍗曟嵁鏁伴噺",
           type: "string",
-          width: 90,
-        },
-        {
-          prop: "lockQuantity",
-          title: "閿佸畾鏁伴噺",
-          type: "int",
           width: 90,
         },
         {
@@ -167,10 +188,10 @@
           width: 90,
         },
         {
-          prop: "unit",
-          title: "鍗曚綅",
+          prop: "remark",
+          title: "澶囨敞",
           type: "string",
-          width: 90,
+          width: 180,
         },
         {
           prop: "orderDetailStatus",
@@ -180,18 +201,16 @@
           bindKey: "orderDetailStatusEnum",
         },
         {
-          prop: "assignStock",
-          title: "鎸囧畾搴撳瓨",
-          type: "icon",
-          width: 90,
-          icon: "el-icon-s-grid",
+          prop: "materielName",
+          title: "鐗╂枡鍚嶇О",
+          type: "string",
+          width: 150,
         },
         {
-          prop: "viewDetail",
-          title: "鍑哄簱璇︾粏",
-          type: "icon",
-          width: 90,
-          icon: "el-icon-s-operation",
+          prop: "locationName",
+          title: "鍑哄簱璐т綅",
+          type: "string",
+          width: 200,
         },
         {
           prop: "creater",
@@ -218,9 +237,10 @@
           width: 160,
         },
         {
-          prop: "remark",
-          title: "澶囨敞",
-          type: "string",
+          prop: "lockQuantity",
+          title: "閿佸畾鏁伴噺",
+          type: "int",
+          width: 90,
         },
       ],
       paginations: {
@@ -228,9 +248,8 @@
         order: "desc",
         Foots: "",
         total: 0,
-        // 2020.08.29澧炲姞鑷畾涔夊垎椤垫潯澶у皬
         sizes: [60, 100, 120],
-        size: 60, // 榛樿鍒嗛〉澶у皬
+        size: 60,
         Wheres: [],
         page: 1,
         rows: 60,
@@ -283,20 +302,24 @@
           return
         }
         
-        // 浠呭鏁板�煎垪姹傚拰
-        // 浠呭鏌愪竴鍒楁眰鍜�
-        if (column.property === 'lockQuantity' || column.property === 'overOutQuantity' || column.property === 'orderQuantity') {
+        // 浠呭鎸囧畾鏁板�煎垪姹傚拰骞朵繚鐣欎袱浣嶅皬鏁�
+        if (['lockQuantity', 'overOutQuantity', 'orderQuantity'].includes(column.property)) {
           const values = data.map(item => Number(item[column.property]))
-        console.log(values);
-        if (!values.every(value => isNaN(value))) {
-          sums[index] = values.reduce((prev, curr) => {
-            return prev + (isNaN(curr) ? 0 : curr)
-          }, 0)
+          
+          if (!values.every(value => isNaN(value))) {
+            // 璁$畻鎬诲拰
+            const total = values.reduce((prev, curr) => {
+              return prev + (isNaN(curr) ? 0 : curr)
+            }, 0)
+            
+            // 淇濈暀涓や綅灏忔暟
+            sums[index] = total.toFixed(2)
+          } else {
+            sums[index] = '-'
+          }
         } else {
-          sums[index] = '-'
+          sums[index] = ''
         }
-        }
-        
       })
 
       return sums
@@ -308,7 +331,7 @@
         rows: this.paginations.rows,
         sort: this.paginations.sort,
         order: this.paginations.order,
-        wheres: JSON.stringify(wheres), // 鏌ヨ鏉′欢锛屾牸寮忎负[{ name: "瀛楁", value: "xx" }]
+        wheres: JSON.stringify(wheres),
       };
       this.http
         .post("api/OutboundOrderDetail/GetPageData", param, "鏌ヨ涓�")
@@ -320,7 +343,6 @@
       if (column.prop == "assignStock") {
         this.$refs.child.open(row);
       } else {
-        //鐐瑰嚮鎵撳紑鍑哄簱璇︽儏
         this.$refs.selectedStock.open(row);
       }
     },
@@ -328,7 +350,7 @@
       if (this.selection.length === 0) {
         return this.$message.error("璇烽�夋嫨鍗曟嵁鏄庣粏");
       }
-      var keys = this.selection.map((item) => item.id); // 鑾峰彇閫変腑琛岀殑id
+      var keys = this.selection.map((item) => item.id);
       this.http
         .post("api/OutboundOrderDetail/LockOutboundStocks", keys, "鏁版嵁澶勭悊涓�")
         .then((x) => {
@@ -344,8 +366,7 @@
       if (this.selection.length === 0) {
         return this.$message.error("璇烽�夋嫨鍗曟嵁鏄庣粏");
       }
-      var keys = this.selection.map((item) => item.id); // 鑾峰彇閫変腑琛岀殑id
-console.log(keys);
+      var keys = this.selection.map((item) => item.id);
       this.http
         .post("api/Task/WMSGenerateOutboundTask", keys, "鏁版嵁澶勭悊涓�")
         .then((x) => {
@@ -357,6 +378,31 @@
           });
         });
     },
+
+    cancelOutFeedbackERP() {
+      if (this.selection.length === 0) {
+        return this.$message.error("璇烽�夋嫨鍗曟嵁鏄庣粏");
+      }
+      var keys = this.selection.map((item) => item.id);
+      this.$confirm("鏄惁鍙栨秷璇ュ嚭搴撳崟鏄庣粏","鍗曟嵁鍙栨秷璀﹀憡",{
+        confirmButtonText: "纭畾",
+        cancelButtonText: "鍙栨秷",
+        type: "warning",
+        center: true,
+        }).then(() => {
+          this.http
+          .post("api/OutboundOrderDetail/CancelOutFeedbackERP", keys, "鏁版嵁澶勭悊涓�")
+          .then((x) => {
+            if (!x.status) return this.$message.error(x.message);
+            this.$message.success("鎿嶄綔鎴愬姛");
+            this.showDetialBox = false;
+            this.$emit("parentCall", ($vue) => {
+              $vue.getData();
+            });
+          });
+        });
+    },
+
     setCurrent(row) {
       this.$refs.singleTable.setCurrentRow(row);
     },
@@ -413,7 +459,6 @@
         var item = this.dictionaryList.find((x) => x.dicNo == column.bindKey);
         if (item) {
           var dicItem = item.data.find((x) => x.key == row[column.prop]);
-          console.log(dicItem);
           if (dicItem) {
             return dicItem.value;
           } else {
@@ -424,12 +469,56 @@
         }
       }
     },
+    // 鏍煎紡鍖栧崟鍏冩牸鍐呭锛屽鐞唍ull/undefined
+    formatCellContent(content) {
+      if (content === null || content === undefined) {
+        return "鏃犳暟鎹�";
+      }
+      // 瀵规棩鏈熺被鍨嬭繘琛岀壒娈婂鐞嗭紙濡傛灉闇�瑕侊級
+      return content.toString();
+    },
+    // 璁$畻鍗曞厓鏍煎搴︼紝棰勭暀杈硅窛
+    calculateCellWidth(column) {
+      // 濡傛灉鍒楀畾涔変簡瀹藉害锛屽噺鍘�20px浣滀负鍐呰竟璺�
+      if (column.width) {
+        return `${column.width - 20}px`;
+      }
+      // 鏈畾涔夊搴﹀垯浣跨敤100%
+      return "100%";
+    },
+    // 鍒ゆ柇鏄惁闇�瑕佹樉绀篢ooltip
+    shouldShowTooltip(content, column) {
+      // 鏍囪涓轰笉闇�瑕佹孩鍑哄鐞嗙殑鍒椾笉鏄剧ずTooltip
+      if (column.noEllipsis) {
+        return false;
+      }
+      
+      // 绌哄唴瀹逛笉鏄剧ずTooltip
+      const cellContent = this.formatCellContent(content);
+      if (cellContent === "鏃犳暟鎹�") {
+        return false;
+      }
+      
+      // 鍐呭杈冪煭鏃朵篃涓嶆樉绀篢ooltip锛堟牴鎹疄闄呴渶姹傝皟鏁撮暱搴﹂槇鍊硷級
+      return cellContent.length > 8;
+    }
   },
 };
 </script>
 <style scoped>
 .text-button {
   border: 0px;
+}
+
+/* 鏂囨湰婧㈠嚭闅愯棌鏍峰紡 */
+.ellipsis-cell {
+  white-space: nowrap;
+  overflow: hidden;
+  text-overflow: ellipsis;
+  position: relative;
+  z-index: 1;
+  display: inline-block;
+  max-width: 100%;
 }
 </style>
 
@@ -444,12 +533,10 @@
 
 .box-table .el-table tbody tr:hover > td {
   background-color: #d8e0d4 !important;
-  /* color: #ffffff; */
 }
 
 .box-table .el-table tbody tr.current-row > td {
   background-color: #f0f9eb !important;
-  /* color: #ffffff; */
 }
 
 .el-table .success-row {
@@ -459,4 +546,13 @@
 .box-table .el-table {
   border: 1px solid #ebeef5;
 }
+
+/* 鍚堣琛屾枃鏈孩鍑哄鐞� */
+.el-table__footer-wrapper .el-table__cell {
+  white-space: nowrap;
+  overflow: hidden;
+  text-overflow: ellipsis;
+  position: relative;
+  z-index: 1;
+}
 </style>

--
Gitblit v1.9.3