From b7e08df5a07b3fa832a46ecc31983e16f2bccc8c Mon Sep 17 00:00:00 2001
From: whycq <10027870+whycq@user.noreply.gitee.com>
Date: 星期一, 24 七月 2023 14:56:01 +0800
Subject: [PATCH] # 出库作业,和库存明细管理 排序

---
 src/main/webapp/static/js/locStatis/locStatis.js |   83 ++++++++++++++++++++++++++++++++++++++++-
 1 files changed, 81 insertions(+), 2 deletions(-)

diff --git a/src/main/webapp/static/js/locStatis/locStatis.js b/src/main/webapp/static/js/locStatis/locStatis.js
index 2f49b1a..45911ea 100644
--- a/src/main/webapp/static/js/locStatis/locStatis.js
+++ b/src/main/webapp/static/js/locStatis/locStatis.js
@@ -60,9 +60,19 @@
         even: true,
         toolbar: '#toolbar',
         cellMinWidth: 50,
-        cols: [[{field: 'qty', align: 'center', title: '鏁伴噺', width: 80}
+        cols: [[{field: 'qty', align: 'center', title: '鍦ㄥ簱绠辨暟', width: 120}
             , {field: 'matNo', align: 'center', title: '浜у搧缂栫爜'}
             , {field: 'matName', align: 'center', title: '浜у搧鍚嶇О'}
+            , {field: 'specs', align: 'center',title: '瑙勬牸'}
+            , {field: 'unit', align: 'center',title: '鍗曚綅', width:80}
+            , {field: 'color', align: 'center',title: '棰滆壊'}
+            , {field: 'qtyBox', align: 'center',title: '姣忕鏁伴噺(PCS)'}
+            , {field: 'allQty', align: 'center',title: '鎬绘暟閲�(PCS)'}
+            , {field: 'weight', align: 'center',title: '姣忕閲嶉噺(KG)'}
+            , {field: 'str3', align: 'center',title: '瀹㈡埛鍚嶇О'}
+            , {field: 'str4', align: 'center',title: '椤圭洰淇℃伅'}
+            , {field: 'str5$', align: 'center',title: '绫诲埆'}
+            // , {field: 'supplier', align: 'center', title: '鎵瑰彿'}
             ]],
         request: {
             pageName: 'curr',
@@ -115,10 +125,79 @@
     table.on('toolbar(locStatis)', function (obj) {
         var checkStatus = table.checkStatus(obj.config.id);
         switch(obj.event) {
+            case 'syncStok':
+                alert('鎻掑叆鏁版嵁鍒癊RP鎺ュ彛搴撳瓨鍚屾琛�');
+                $.ajax({
+                    url: baseUrl + "/stock/stockSyncCount",
+                    headers: {'token': localStorage.getItem('token')},
+                    data: {},
+                    method: 'POST',
+                    traditional: true,
+                    success: function (res) {
+                        if (res.code === 200) {
+                            var msg = '';
+                            if (res.data == 0) {
+                                msg = '纭畾瑕佸悓姝ュ簱瀛樻暟鎹悧?'
+                            } else {
+                                msg = '鍚屾浠诲姟姝e湪杩涜锛岀‘瀹氳涓骞堕噸鏂板悓姝ュ悧?'
+                            }
+                            layer.confirm(msg, {
+                                    shadeClose: true
+                                    , btn: ['纭畾']
+                                }, function () {
+                                    if (res.data > 0) {
+                                        // 娓呯┖鍚屾涓婁紶娓呭崟鏁版嵁,鍐嶈繘琛屾彃鍏ユ暟鎹�
+                                        $.ajax({
+                                            url: baseUrl + "/stock/updateStockSync",
+                                            headers: {'token': localStorage.getItem('token')},
+                                            data: {},
+                                            contentType: 'application/json;charset=UTF-8',
+                                            method: 'POST',
+                                            success: function (res) {
+                                                if (res.code === 200) {
+                                                    layer.msg("鏇存柊涓婃姤搴撳瓨鏁版嵁鎴愬姛锛�");
+                                                } else if (res.code === 403) {
+                                                    top.location.href = baseUrl + "/";
+                                                } else {
+                                                    layer.msg(res.msg)
+                                                }
+                                            }
+                                        });
+                                    } else {
+                                        // 璋冪敤鍚屾涓婁紶娓呭崟鏁版嵁鎻掑叆鎺ュ彛
+                                        $.ajax({
+                                            url: baseUrl + "/stock/insertStockSync",
+                                            headers: {'token': localStorage.getItem('token')},
+                                            data: {},
+                                            contentType: 'application/json;charset=UTF-8',
+                                            method: 'POST',
+                                            success: function (res) {
+                                                if (res.code === 200) {
+                                                    layer.msg("鎻掑叆涓婃姤搴撳瓨鏁版嵁鎴愬姛锛�");
+                                                } else if (res.code === 403) {
+                                                    top.location.href = baseUrl + "/";
+                                                } else {
+                                                    layer.msg(res.msg)
+                                                }
+                                            }
+                                        });
+                                    }
+                                    layer.closeAll();
+                                }
+                            );
+                        } else if (res.code === 403) {
+                            top.location.href = baseUrl + "/";
+                        } else {
+                            layer.msg(res.msg)
+                        }
+                    }
+                });
+                break;
             case 'exportAll':
                 layer.closeAll();
                 layer.load(1, {shade: [0.1,'#fff']});
-                location.href = baseUrl + "/stock/statis/export";
+                location.href = baseUrl + "/stock/statis/export?matNo="+$("#matNo").val()+"&matName="+$("#matName").val()
+                    +"&supplier="+$("#supplier").val()+"&str3="+$("#str3").val()+"&str4="+$("#str4").val()+"&memo="+$("#memo").val();
                 layer.closeAll('loading');
                 break;
         }

--
Gitblit v1.9.1