From 094ba2c92c77330da08ecfc145d37257374eaa11 Mon Sep 17 00:00:00 2001
From: luxiaotao1123 <t1341870251@163.com>
Date: 星期二, 23 六月 2020 10:19:17 +0800
Subject: [PATCH] #

---
 src/main/webapp/static/js/pakStore/emptyOut.js |   77 +++++++++++++++++++++++++++++++-------
 1 files changed, 63 insertions(+), 14 deletions(-)

diff --git a/src/main/webapp/static/js/pakStore/emptyOut.js b/src/main/webapp/static/js/pakStore/emptyOut.js
index 6453b9d..de3963c 100644
--- a/src/main/webapp/static/js/pakStore/emptyOut.js
+++ b/src/main/webapp/static/js/pakStore/emptyOut.js
@@ -6,6 +6,29 @@
     var layDate = layui.laydate;
     var form = layui.form;
 
+    // 鑾峰彇鍑哄簱鍙�
+    function getOutBound(){
+        $.ajax({
+            url: baseUrl+"/available/empty/take/site",
+            headers: {'token': localStorage.getItem('token')},
+            method: 'POST',
+            async: false,
+            success: function (res) {
+                if (res.code === 200){
+                    var tpl = $("#takeSiteSelectTemplate").html();
+                    var template = Handlebars.compile(tpl);
+                    var html = template(res);
+                    $('#staNoSelect').append(html);
+                    form.render('select');
+                } else if (res.code === 403){
+                    top.location.href = baseUrl+"/";
+                }else {
+                    layer.msg(res.msg)
+                }
+            }
+        })
+    }
+
     // 鏁版嵁娓叉煋
     tableIns = table.render({
         elem: '#locMast',
@@ -13,6 +36,8 @@
         url: baseUrl+'/locMast/list/auth',
         page: true,
         limit: 16,
+        limits: [16, 30, 50, 100, 200, 500],
+        where: {loc_type: "D"},
         even: true,
         toolbar: '#toolbar',
         defaultToolbar: ['filter'],
@@ -25,7 +50,7 @@
             ,{field: 'crnNo', align: 'center',title: '鍫嗗灈鏈哄彿'}
             ,{field: 'row1', align: 'center',title: '鎺�'}
             ,{field: 'bay1', align: 'center',title: '鍒�'}
-            ,{field: 'lev1', align: 'center',title: '灞�', sort:true}
+            ,{field: 'lev1', align: 'center',title: '灞�'}
             ,{field: 'fullPlt', align: 'center',title: '婊℃澘', templet:function(row){
                     var html = "<input value='fullPlt' type='checkbox' disabled=鈥榙isabled鈥� lay-skin='primary' lay-filter='tableCheckbox' table-index='"+row.LAY_TABLE_INDEX+"'";
                     if(row.fullPlt === 'Y'){html += " checked ";}
@@ -34,7 +59,6 @@
                 },width:80}
             ,{field: 'modiUser$', align: 'center',title: '淇敼浜哄憳',event: 'modiUser'}
             ,{field: 'modiTime$', align: 'center',title: '淇敼鏃堕棿'}
-
         ]],
         request: {
             pageName: 'curr',
@@ -56,6 +80,7 @@
                 top.location.href = baseUrl+"/";
             }
             pageCurr=curr;
+            getOutBound();
             limit();
             form.on('checkbox(tableCheckbox)', function (data) {
                 var _index = $(data.elem).attr('table-index')||0;
@@ -70,19 +95,43 @@
 
     // 鐩戝惉澶村伐鍏锋爮浜嬩欢
     table.on('toolbar(locMast)', function (obj) {
-        var checkStatus = table.checkStatus(obj.config.id);
+        var data = table.checkStatus(obj.config.id).data;
         switch (obj.event) {
             case 'outbound':
-                layer.open({
-                    type: 1,
-                    title: '鍑哄簱',
-                    maxmin: true,
-                    area: [top.detailWidth, top.detailHeight],
-                    shadeClose: true,
-                    content: $("#outboundDiv"),
-                    success: function (layero, index) {
-                    }
+                var staNo = $("#staNoSelect").val();
+                if (staNo === "" || staNo === null){
+                    layer.msg("璇烽�夋嫨鍑哄簱鍙�");
+                    return;
+                }
+                var locNos = [];
+                data.forEach(function(elem) {
+                    locNos.push(elem.locNo);
                 });
+                if (data.length === 0){
+                    layer.msg('璇疯嚦灏戦�変腑涓�琛屾暟鎹�');
+                } else {
+                    $.ajax({
+                        url: baseUrl+"/empty/plate/out/start",
+                        headers: {'token': localStorage.getItem('token')},
+                        data: {
+                            outSite: staNo,
+                            locNos: locNos
+                        },
+                        method: 'POST',
+                        traditional:true,
+                        success: function (res) {
+                            if (res.code === 200){
+                                tableReload(); // 閲嶈浇琛ㄦ牸
+                                getOutBound(); // 閲嶈浇鍑哄簱鍙�
+                                layer.msg(res.msg);
+                            } else if (res.code === 403){
+                                top.location.href = baseUrl+"/";
+                            } else {
+                                layer.msg(res.msg)
+                            }
+                        }
+                    });
+                }
                 break;
         }
     });
@@ -92,6 +141,7 @@
         pageCurr = 1;
         $('#detlTable').css("display", 'none');
         tableReload(false);
+        getOutBound();
     });
 
     // 鎼滅储鏍忛噸缃簨浠�
@@ -100,6 +150,7 @@
         clearFormVal($('#search-box'));
         $('#detlTable').css("display", 'none');
         tableReload(false);
+        getOutBound();
     });
 
 })
@@ -132,5 +183,3 @@
         }
     });
 }
-
-

--
Gitblit v1.9.1