From c6bc9682699d3e10dc06a3d6641a70179e64f9a1 Mon Sep 17 00:00:00 2001
From: luxiaotao1123 <t1341870251@63.com>
Date: 星期二, 14 九月 2021 08:32:11 +0800
Subject: [PATCH] Merge branch 'xgmasrs' of https://gitee.com/luxiaotao1123/zy-asrs into xgmasrs

---
 src/main/webapp/static/js/locStatis/locStatis.js |   70 ++++++++++++++++++++++++++++++++++
 1 files changed, 69 insertions(+), 1 deletions(-)

diff --git a/src/main/webapp/static/js/locStatis/locStatis.js b/src/main/webapp/static/js/locStatis/locStatis.js
index 2f49b1a..b667ef4 100644
--- a/src/main/webapp/static/js/locStatis/locStatis.js
+++ b/src/main/webapp/static/js/locStatis/locStatis.js
@@ -60,7 +60,7 @@
         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: '浜у搧鍚嶇О'}
             ]],
@@ -115,6 +115,74 @@
     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']});

--
Gitblit v1.9.1