From fff32dc747a54cfa796c3ebde3334d54c7a827a3 Mon Sep 17 00:00:00 2001
From: Junjie <540245094@qq.com>
Date: 星期二, 12 八月 2025 08:40:21 +0800
Subject: [PATCH] #

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

diff --git a/src/main/webapp/static/js/pakStore/stockOut.js b/src/main/webapp/static/js/pakStore/stockOut.js
index af9afd9..485f456 100644
--- a/src/main/webapp/static/js/pakStore/stockOut.js
+++ b/src/main/webapp/static/js/pakStore/stockOut.js
@@ -1,8 +1,9 @@
-var admin;
+var locDetlLayerIdx;
 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: '搴撲綅鍙�'}
     ];
@@ -14,12 +15,12 @@
 
 layui.config({
     base: baseUrl + "/static/layui/lay/modules/"
-}).use(['admin', 'table','laydate', 'form'], function() {
+}).use(['table','laydate', 'form', 'admin'], function() {
     var table = layui.table;
     var $ = layui.jquery;
     var layer = layui.layer;
     var form = layui.form;
-    admin = layui.admin;
+    var admin = layui.admin;
 
     tableIns = table.render({
         elem: '#chooseData',
@@ -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;
@@ -134,23 +158,25 @@
             }
         })
     }
+
+
+    $(document).on('click','#mat-query', function () {
+        let loadIndex = layer.msg('璇锋眰涓�...', {icon: 16, shade: 0.01, time: false});
+        locDetlLayerIdx = layer.open({
+            type: 2,
+            title: false,
+            closeBtn: false,
+            maxmin: false,
+            area: ['90%', '85%'],
+            shadeClose: true,
+            content: 'locDetlQuery.html',
+            success: function(layero, index){
+                layer.close(loadIndex);
+            }
+        });
+    })
+
 })
-
-
-var locDetlLayerIdx;
-function getLocDetl() {
-    locDetlLayerIdx = layer.open({
-        type: 2,
-        title: false,
-        closeBtn: false,
-        maxmin: false,
-        area: ['90%', '85%'],
-        shadeClose: true,
-        content: 'locDetlQuery.html',
-        success: function(layero, index){
-        }
-    });
-}
 
 // 娣诲姞琛ㄦ牸鏁版嵁
 function addTableData(data) {
@@ -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