From aa61aad410dba7922a248d43898105eb8e12de96 Mon Sep 17 00:00:00 2001
From: ytfl <ytfl@qq.com>
Date: 星期六, 16 八月 2025 11:04:24 +0800
Subject: [PATCH] #

---
 src/main/webapp/static/js/pakStore/stockOut.js |   29 ++++++++++++++++++++++++++++-
 1 files changed, 28 insertions(+), 1 deletions(-)

diff --git a/src/main/webapp/static/js/pakStore/stockOut.js b/src/main/webapp/static/js/pakStore/stockOut.js
index dc21d99..485f456 100644
--- a/src/main/webapp/static/js/pakStore/stockOut.js
+++ b/src/main/webapp/static/js/pakStore/stockOut.js
@@ -2,7 +2,8 @@
 var locDetlData = [];
 function getCol() {
     var cols = [
-        {field: 'count', align: 'center',title: '鍑哄簱鏁伴噺', edit:'text', width: 130,  style:'color: blue;font-weight: bold'}
+        {field: 'countWeight', align: 'center',title: '鍑哄簱杈呮暟閲�', edit:'text', width: 130,  style:'color: blue;font-weight: bold'}
+        ,{field: 'count', align: 'center',title: '鍑哄簱鏁伴噺', width: 130,  style:'color: blue;font-weight: bold'}
         ,{field: 'anfme', align: 'center',title: '搴撳瓨鏁伴噺'}
         ,{field: 'locNo$', align: 'center',title: '搴撲綅鍙�'}
     ];
@@ -28,6 +29,7 @@
         even: true,
         toolbar: '#toolbar',
         cellMinWidth: 50,
+        limit: 500,
         cols: [getCol()],
         done: function(res, curr, count) {
             limit();
@@ -56,6 +58,27 @@
                 }
             }
         }
+        if (obj.field === 'countWeight'){
+            let vle = Number(obj.value);
+            if (isNaN(vle)) {
+                layer.msg("璇疯緭鍏ユ暟瀛�", {icon: 2});
+                modify = false;
+            } else {
+                if (vle <= 0) {
+                    layer.msg("鏁伴噺蹇呴』澶т簬闆�", {icon: 2});
+                    modify = false;
+                }
+                if (vle > Number(data.weight)) {
+                    layer.msg("鍑哄簱鏁伴噺涓嶅緱澶т簬搴撳瓨鏁伴噺", {icon: 2});
+                    modify = false;
+                }
+
+                let arr = data.origin.split("/")
+                let mainAnfme = vle * parseFloat(arr[1]) * parseFloat(arr[0])
+                let flooredNum = Math.floor(mainAnfme * 10000) / 10000; // 鎴柇鍒板皬鏁扮偣鍚�4浣�
+                data.count = flooredNum
+            }
+        }
         if (modify) {
             data[obj.field] = obj.value;
         }
@@ -70,6 +93,7 @@
                     layer.msg('璇峰厛鎻愬彇鍟嗗搧搴撳瓨', {icon: 2});
                 } else {
                     var staNo = $("#staNoSelect").val();
+                    var itemId = $("#itemId").val();
                     if (staNo === "" || staNo === null){
                         layer.msg("璇烽�夋嫨鍑哄簱鍙�", {icon: 2});
                         return;
@@ -137,6 +161,7 @@
 
 
     $(document).on('click','#mat-query', function () {
+        let loadIndex = layer.msg('璇锋眰涓�...', {icon: 16, shade: 0.01, time: false});
         locDetlLayerIdx = layer.open({
             type: 2,
             title: false,
@@ -146,6 +171,7 @@
             shadeClose: true,
             content: 'locDetlQuery.html',
             success: function(layero, index){
+                layer.close(loadIndex);
             }
         });
     })
@@ -166,6 +192,7 @@
             data.splice(i--, 1);
         } else {
             data[i]["count"] = data[i]["anfme"];
+            data[i]["countWeight"] = data[i]["weight"];
         }
     }
     locDetlData.push.apply(locDetlData, data);

--
Gitblit v1.9.1