From 9a4530ace0c4305af2d75fc95654a16c6007fd5b Mon Sep 17 00:00:00 2001
From: 王佳豪 <g675230687@126.com>
Date: 星期三, 07 七月 2021 16:06:15 +0800
Subject: [PATCH] 平仓管理、平仓日入库支持同时查询成品和原材料

---
 src/main/webapp/static/js/locNormal/locNormal.js            |   60 ++++++++-----------
 src/main/java/com/zy/asrs/controller/LocAreaController.java |    6 ++
 src/main/webapp/static/js/locNormal/locNormalIn.js          |    2 
 src/main/webapp/views/locNormal/locNormal.html              |    9 ---
 src/main/webapp/views/locNormal/normalReport.html           |   10 ---
 src/main/webapp/static/js/locNormal/normalReport.js         |   61 ++++++++------------
 6 files changed, 57 insertions(+), 91 deletions(-)

diff --git a/src/main/java/com/zy/asrs/controller/LocAreaController.java b/src/main/java/com/zy/asrs/controller/LocAreaController.java
index c2bd1fa..c039b18 100644
--- a/src/main/java/com/zy/asrs/controller/LocAreaController.java
+++ b/src/main/java/com/zy/asrs/controller/LocAreaController.java
@@ -139,4 +139,10 @@
         List<LocArea> result = locAreaService.queryAllLocArea(areaType);
         return R.ok(result);
     }
+
+    @RequestMapping(value = "locArea/query/allArea")
+    public R queryAllArea() {
+        List<LocArea> result = locAreaService.selectList(new EntityWrapper<>());
+        return R.ok(result);
+    }
 }
diff --git a/src/main/webapp/static/js/locNormal/locNormal.js b/src/main/webapp/static/js/locNormal/locNormal.js
index 9a18ffb..28424f4 100644
--- a/src/main/webapp/static/js/locNormal/locNormal.js
+++ b/src/main/webapp/static/js/locNormal/locNormal.js
@@ -19,41 +19,6 @@
     return cols;
 }
 
-// 鑾峰彇浠撳簱涓嬫媺
-$.ajax({
-    url: baseUrl + "/locArea/queryAll/auth",
-    headers: {'token': localStorage.getItem('token')},
-    // data: top.reObject(data),
-    method: 'POST',
-    success: function (res) {
-        if (res.data && res.data.length > 0) {
-            locArea = res.data;
-        }
-    },
-});
-
-// 搴撳尯涓嬫媺
-// 鑾峰彇浠撳簱涓嬫媺
-$.ajax({
-    url: baseUrl + "/locArea/queryAll/auth",
-    headers: {'token': localStorage.getItem('token')},
-    method: 'POST',
-    success: function (res) {
-        if (res.code === 200) {
-            var html = "";
-            if (res.data && res.data.length > 0) {
-                html += res.data.map(function (item) {
-                    return "<Option value=" + item.uuid + ">" + item.name + "</Option>";
-                });
-            }
-            $('#putSiteSelect').append(html);
-        } else if (res.code === 403) {
-            top.location.href = baseUrl + "/";
-        } else {
-            layer.msg(res.msg)
-        }
-    }
-})
 
 layui.use(['table', 'laydate', 'form', 'upload'], function () {
     var table = layui.table;
@@ -63,6 +28,31 @@
     var form = layui.form;
     var upload = layui.upload;
 
+    // 搴撳尯涓嬫媺
+    // 鑾峰彇浠撳簱涓嬫媺
+    $.ajax({
+        url: baseUrl + "/locArea/query/allArea",
+        headers: {'token': localStorage.getItem('token')},
+        method: 'POST',
+        success: function (res) {
+            if (res.code === 200) {
+                var html = "";
+                if (res.data && res.data.length > 0) {
+                    locArea = res.data;
+                    html += res.data.map(function (item) {
+                        return "<Option value=" + item.uuid + ">" + item.name + "</Option>";
+                    });
+                }
+                $('#putSiteSelect').append(html);
+                layui.form.render('select');
+            } else if (res.code === 403) {
+                top.location.href = baseUrl + "/";
+            } else {
+                layer.msg(res.msg)
+            }
+        }
+    });
+
     // 瀵煎叆excel
     var uploader = upload.render({
         elem: '#uploadEx'
diff --git a/src/main/webapp/static/js/locNormal/locNormalIn.js b/src/main/webapp/static/js/locNormal/locNormalIn.js
index 51b1a51..abf35fb 100644
--- a/src/main/webapp/static/js/locNormal/locNormalIn.js
+++ b/src/main/webapp/static/js/locNormal/locNormalIn.js
@@ -195,7 +195,7 @@
     function getInBound() {
         // 鑾峰彇浠撳簱涓嬫媺
         $.ajax({
-            url: baseUrl + "/locArea/queryAll/auth",
+            url: baseUrl + "/locArea/query/allArea",
             headers: {'token': localStorage.getItem('token')},
             method: 'POST',
             success: function (res) {
diff --git a/src/main/webapp/static/js/locNormal/normalReport.js b/src/main/webapp/static/js/locNormal/normalReport.js
index fd92248..29136ba 100644
--- a/src/main/webapp/static/js/locNormal/normalReport.js
+++ b/src/main/webapp/static/js/locNormal/normalReport.js
@@ -16,46 +16,10 @@
         , {field: 'mnemonic', align: 'center', title: '鐢熶骇鍗曞彿', width: 140}
         , {field: 'supplier', align: 'center', title: '閫氱煡鍗曞彿', width: 140}
         , {field: 'memo', align: 'center', title: '澶囨敞'}
-
     )
     return cols;
 }
 
-// 鑾峰彇浠撳簱涓嬫媺
-$.ajax({
-    url: baseUrl + "/locArea/queryAll/auth",
-    headers: {'token': localStorage.getItem('token')},
-    // data: top.reObject(data),
-    method: 'POST',
-    success: function (res) {
-        if (res.data && res.data.length > 0) {
-            locArea = res.data;
-        }
-    },
-});
-
-// 搴撳尯涓嬫媺
-// 鑾峰彇浠撳簱涓嬫媺
-$.ajax({
-    url: baseUrl + "/locArea/queryAll/auth",
-    headers: {'token': localStorage.getItem('token')},
-    method: 'POST',
-    success: function (res) {
-        if (res.code === 200) {
-            var html = "";
-            if (res.data && res.data.length > 0) {
-                html += res.data.map(function (item) {
-                    return "<Option value=" + item.uuid + ">" + item.name + "</Option>";
-                });
-            }
-            $('#putSiteSelect').append(html);
-        } else if (res.code === 403) {
-            top.location.href = baseUrl + "/";
-        } else {
-            layer.msg(res.msg)
-        }
-    }
-})
 
 layui.use(['table', 'laydate', 'form', 'upload'], function () {
     var table = layui.table;
@@ -65,6 +29,31 @@
     var form = layui.form;
     var upload = layui.upload;
 
+    // 搴撳尯涓嬫媺
+    // 鑾峰彇浠撳簱涓嬫媺
+    $.ajax({
+        url: baseUrl + "/locArea/query/allArea",
+        headers: {'token': localStorage.getItem('token')},
+        method: 'POST',
+        success: function (res) {
+            if (res.code === 200) {
+                var html = "";
+                if (res.data && res.data.length > 0) {
+                    locArea = res.data;
+                    html += res.data.map(function (item) {
+                        return "<Option value=" + item.uuid + ">" + item.name + "</Option>";
+                    });
+                }
+                $('#putSiteSelect').append(html);
+                layui.form.render('select');
+            } else if (res.code === 403) {
+                top.location.href = baseUrl + "/";
+            } else {
+                layer.msg(res.msg)
+            }
+        }
+    });
+
     // 鏁版嵁娓叉煋
     tableIns = table.render({
         elem: '#locNormal',
diff --git a/src/main/webapp/views/locNormal/locNormal.html b/src/main/webapp/views/locNormal/locNormal.html
index 61ef89a..dbc2095 100644
--- a/src/main/webapp/views/locNormal/locNormal.html
+++ b/src/main/webapp/views/locNormal/locNormal.html
@@ -168,15 +168,6 @@
         {{#  } else { }}
         {{#  } }}
     </script>
-    <script type="text/html" id="locArea">
-        {{
-        locArea.map(function(item){
-        if (d.warehouse == item.uuid) {
-        return item.name;
-        }
-        });
-        }}
-    </script>
     <script type="text/html" id="operate">
         {{#  if(d.state === '1'){ }}
         <button class="layui-btn layui-btn-xs layui-btn-normal btn-out" lay-event="outLocNormal">鍑哄簱</button>
diff --git a/src/main/webapp/views/locNormal/normalReport.html b/src/main/webapp/views/locNormal/normalReport.html
index 241bb6e..f8d5b5f 100644
--- a/src/main/webapp/views/locNormal/normalReport.html
+++ b/src/main/webapp/views/locNormal/normalReport.html
@@ -140,16 +140,6 @@
         <table class="layui-hide" id="locNormal" lay-filter="locNormal"></table>
     </div>
 
-    <script type="text/html" id="locArea">
-        {{
-        locArea.map(function(item){
-        if (d.warehouse == item.uuid) {
-        return item.name;
-        }
-        });
-        }}
-    </script>
-
 </div>
 
 <script type="text/javascript" src="../../static/js/jquery/jquery-3.3.1.min.js"></script>

--
Gitblit v1.9.1