From 5b8069bf9b128503fd9a762b8cdba9a6335cf4cd Mon Sep 17 00:00:00 2001
From: wangxinhui <wangxinhui@hnkhzn.com>
Date: 星期五, 10 一月 2025 16:00:00 +0800
Subject: [PATCH] 1

---
 代码管理/WMS/WIDESEA_WMSClient/src/extension/stock/stockView.js |   47 +++++++++++++++++++++++++++++------------------
 1 files changed, 29 insertions(+), 18 deletions(-)

diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSClient/src/extension/stock/stockView.js" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSClient/src/extension/stock/stockView.js"
index e43f901..b54fb2e 100644
--- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSClient/src/extension/stock/stockView.js"
+++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSClient/src/extension/stock/stockView.js"
@@ -17,22 +17,22 @@
     methods: {
        //涓嬮潰杩欎簺鏂规硶鍙互淇濈暀涔熷彲浠ュ垹闄�
       onInit() {  
-        let InOrder = this.buttons.find(x => x.value == 'StockOutbound');
-        if (InOrder) {
-          InOrder.onClick = function () {
-            let rows = this.$refs.table.getSelected();
-            if (rows.length == 0) return this.$error("璇烽�夋嫨鏁版嵁!");
-            if (rows.length > 1) return this.$error("璇烽�夋嫨鍗曟潯鏁版嵁!");
-            var keys = rows.map(x => { return x.stockId });
-            this.http
-              .post("api/Task/Outbound?id="+keys[0], null, "鏁版嵁澶勭悊涓�")
-              .then((x) => {
-                if (!x.status) return this.$message.error(x.message);
-                this.$message.success("鎿嶄綔鎴愬姛");
-                this.refresh();
-              });
-          }
-        }
+        // let InOrder = this.buttons.find(x => x.value == 'StockOutbound');
+        // if (InOrder) {
+        //   InOrder.onClick = function () {
+        //     let rows = this.$refs.table.getSelected();
+        //     if (rows.length == 0) return this.$error("璇烽�夋嫨鏁版嵁!");
+        //     if (rows.length > 1) return this.$error("璇烽�夋嫨鍗曟潯鏁版嵁!");
+        //     var keys = rows.map(x => { return x.stockId });
+        //     this.http
+        //       .post("api/Task/Outbound?id="+keys[0], null, "鏁版嵁澶勭悊涓�")
+        //       .then((x) => {
+        //         if (!x.status) return this.$message.error(x.message);
+        //         this.$message.success("鎿嶄綔鎴愬姛");
+        //         this.refresh();
+        //       });
+        //   }
+        // }
         this.columns.forEach(column => {
           if (column.field == 'materielCode') {
             column.formatter = (row) => {
@@ -55,8 +55,8 @@
             }
           }
           if (column.field == 'materielInfo') {
-            const today = new Date()
             column.formatter = (row) => {
+              if(row.details.length<=0) return;
               const today = new Date();
               const closestDate = row.details
               .map(x => {
@@ -66,11 +66,22 @@
                 })
               .reduce((closest, current) => (current.diffInDays < closest.diffInDays? current : closest))
               .date;
-
+ 
               const daysSinceClosest = Math.ceil(Math.abs((today - closestDate) / (1000 * 60 * 60 * 24)));
               return '<span style="color: #F56C6C">'+ daysSinceClosest+"澶�"+'</span>';
             }
           }
+          if (column.field == 'sumStock') {
+            column.formatter = (row) => {
+              if(row.details.length<=0) return;
+              var sum=0;
+              const closestDate = row.details
+              .map(x => {
+                sum+=(x.stockQuantity)
+              })
+              return '<span style="color: #F56C6C">'+ sum+row.details[0].unit+'</span>';
+            }
+          }
         })
       },
       onInited() {

--
Gitblit v1.9.3