From 13d295c4210ee589b3e524bd157f85c63bca5a3e Mon Sep 17 00:00:00 2001
From: zwl <1051256694@qq.com>
Date: 星期四, 30 四月 2026 13:12:08 +0800
Subject: [PATCH] 1.出库单据转历史档有问题 2.新增单据历史档 3.修复入库完成转明细失败

---
 src/main/webapp/static/js/locMast/locMast.js |  141 ++++++++++++++++++++++++++---------------------
 1 files changed, 78 insertions(+), 63 deletions(-)

diff --git a/src/main/webapp/static/js/locMast/locMast.js b/src/main/webapp/static/js/locMast/locMast.js
index 6f25367..7ae6ada 100644
--- a/src/main/webapp/static/js/locMast/locMast.js
+++ b/src/main/webapp/static/js/locMast/locMast.js
@@ -1,4 +1,5 @@
 var pageCurr;
+var batchAreaLocNos = [];
 layui.use(['table','laydate', 'form'], function(){
     var table = layui.table;
     var $ = layui.jquery;
@@ -22,8 +23,9 @@
             {type: 'checkbox', fixed: 'left'}
 //            ,{field: 'id', title: 'ID', sort: true,align: 'center', fixed: 'left', width: 80}
             ,{field: 'locNo', align: 'center',title: '搴撲綅鍙�',sort:true, hide:false}
+            ,{field: 'areaId$', align: 'center',title: '搴撳尯',sort:true, hide:false}
+            ,{field: 'locAlias', align: 'center',title: '搴撲綅鍒悕',sort:true, hide:false}
             ,{field: 'locSts$', align: 'center',title: '搴撲綅鐘舵��',width:200, hide:false}
-            ,{field: 'whsType$', align: 'center',title: '搴撲綅绫诲瀷',width:200, hide:false}
             // ,{field: 'pltType', align: 'center',title: ''}
             // ,{field: 'ctnType', align: 'center',title: ''}
             // ,{field: 'locSts', align: 'center',title: ''}
@@ -33,12 +35,6 @@
             ,{field: 'bay1', align: 'center',title: '鍒�', sort:true, hide:false}
             ,{field: 'lev1', align: 'center',title: '灞�', sort:true, hide:false}
             ,{field: 'gro1', align: 'center',title: '缁�', sort:true, hide:false}
-            ,{field: 'fullPlt', align: 'center',title: '婊℃澘', templet:function(row){
-                    var html = "<input value='fullPlt' type='checkbox' lay-skin='primary' lay-filter='tableCheckbox' disabled table-index='"+row.LAY_TABLE_INDEX+"'";
-                    if(row.fullPlt === 'Y'){html += " checked ";}
-                    html += ">";
-                    return html;
-                },width:80, hide:false}
             // ,{field: 'outEnable', align: 'center',title: ''}
             ,{field: 'ioTime$', align: 'center',title: 'ioTime', hide:true}
             // ,{field: 'firstTime$', align: 'center',title: '', hide:true}
@@ -59,7 +55,7 @@
             ,{field: 'locType2$', align: 'center',title: '瀹界獎绫诲瀷', hide:true}
             ,{field: 'locType3$', align: 'center',title: '杞婚噸绫诲瀷', hide:true}
 
-            ,{fixed: 'right', title:'鎿嶄綔', align: 'center', toolbar: '#operate', width:100}
+            ,{fixed: 'right', title:'鎿嶄綔', align: 'center', toolbar: '#operate', width:160}
         ]],
         request: {
             pageName: 'curr',
@@ -82,14 +78,6 @@
             }
             pageCurr=curr;
             limit();
-            form.on('checkbox(tableCheckbox)', function (data) {
-                var _index = $(data.elem).attr('table-index')||0;
-                if(data.elem.checked){
-                    res.data[_index][data.value] = 'Y';
-                }else{
-                    res.data[_index][data.value] = 'N';
-                }
-            });
         }
     });
 
@@ -168,6 +156,28 @@
                             }
                         })
                     });
+                }
+                break;
+            case 'batchArea':
+                var areaData = checkStatus.data;
+                if (areaData.length === 0){
+                    layer.msg('璇烽�夋嫨鏁版嵁');
+                } else {
+                    batchAreaLocNos = areaData.map(function (item) {
+                        return item.locNo;
+                    });
+                    $('#batchAreaId').val('');
+                    layer.open({
+                        type: 1,
+                        title: '鎵归噺淇敼搴撳尯',
+                        area: ["360px"],
+                        maxmin: true,
+                        shadeClose: true,
+                        content: $("#batchAreaDiv"),
+                        success: function () {
+                            form.render('select');
+                        }
+                    })
                 }
                 break;
             case 'exportData':
@@ -257,6 +267,23 @@
                     }
                 });
                 break;
+            case 'viewPhoto':
+                $.ajax({
+                    url: baseUrl + "/photo/loc/auth",
+                    headers: {'token': localStorage.getItem('token')},
+                    data: {locNo: data.locNo},
+                    method: 'GET',
+                    success: function (res) {
+                        if (res.code === 200) {
+                            showPhotoViewer(layer, res.data);
+                        } else if (res.code === 403) {
+                            top.location.href = baseUrl + "/";
+                        } else {
+                            layer.msg(res.msg);
+                        }
+                    }
+                });
+                break;
             // 缂栬緫
             case 'edit':
                 layer.open({
@@ -276,42 +303,6 @@
                         layero.find('iframe')[0].contentWindow.layui.form.render('checkbox');
                     }
                 });
-                break;
-            case 'whsType':
-                var param = top.reObject(data).whsType;
-                if (param === undefined) {
-                    layer.msg("鏃犳暟鎹�");
-                } else {
-                   layer.open({
-                       type: 2,
-                       title: '搴撲綅璇︽儏',
-                       maxmin: true,
-                       area: [top.detailWidth, top.detailHeight],
-                       shadeClose: false,
-                       content: '../basWhs/basWhs_detail.html',
-                       success: function(layero, index){
-                           $.ajax({
-                               url: baseUrl+"/basWhs/"+ param +"/auth",
-                               headers: {'token': localStorage.getItem('token')},
-                               method: 'GET',
-                               success: function (res) {
-                                   if (res.code === 200){
-                                       setFormVal(layer.getChildFrame('#detail', index), res.data, true);
-                                       top.convertDisabled(layer.getChildFrame('#data-detail :input', index), true);
-                                       layer.getChildFrame('#data-detail-submit-save,#data-detail-submit-edit,#prompt', index).hide();
-                                       layer.iframeAuto(index);layer.style(index, {top: (($(window).height()-layer.getChildFrame('#data-detail', index).height())/3)+"px"});
-                                       layero.find('iframe')[0].contentWindow.layui.form.render('select');
-                                       layero.find('iframe')[0].contentWindow.layui.form.render('checkbox');
-                                   } else if (res.code === 403){
-                                       parent.location.href = "/";
-                                   }else {
-                                       layer.msg(res.msg)
-                                   }
-                               }
-                           })
-                       }
-                   });
-                }
                 break;
             case 'modiUser':
                 var param = top.reObject(data).modiUser;
@@ -412,6 +403,36 @@
         })
     });
 
+    // 鎵归噺淇敼搴撳尯
+    form.on('submit(batchAreaDo)', function (data) {
+        if (batchAreaLocNos.length === 0) {
+            layer.msg('璇烽�夋嫨鏁版嵁');
+            return false;
+        }
+        $.ajax({
+            url: baseUrl+"/locMast/batch/area/auth",
+            headers: {'token': localStorage.getItem('token')},
+            data: JSON.stringify({
+                locNos: batchAreaLocNos,
+                areaId: data.field.areaId
+            }),
+            dataType:'json',
+            contentType:'application/json;charset=UTF-8',
+            method: 'POST',
+            success: function (res) {
+                if (res.code === 200){
+                    layer.closeAll();
+                    tableReload(false);
+                } else if (res.code === 403){
+                    parent.location.href = "/";
+                }else {
+                    layer.msg(res.msg)
+                }
+            }
+        });
+        return false;
+    });
+
     // 鏁版嵁淇濆瓨鍔ㄤ綔
     form.on('submit(save)', function () {
         if (banMsg != null){
@@ -433,6 +454,8 @@
         var data = {
 //            id: $('#id').val(),
             locNo: $('#locNo').val(),
+            areaId: $('#areaId').val(),
+            locAlias: $('#locAlias').val(),
             whsType: $('#whsType').val(),
             pltType: $('#pltType').val(),
             ctnType: $('#ctnType').val(),
@@ -442,6 +465,7 @@
             row1: $('#row1').val(),
             bay1: $('#bay1').val(),
             lev1: $('#lev1').val(),
+            gro1: $('#gro1').val(),
             fullPlt: $('#fullPlt').val(),
             locType: $('#locType').val(),
             outEnable: $('#outEnable').val(),
@@ -460,7 +484,8 @@
             barcode: $('#barcode').val(),
             PdcType: $('#PdcType').val(),
             ctnNo: $('#ctnNo').val(),
-
+            frozen: $('#frozen').val(),
+            frozenMemo: $('#frozenMemo').val()
         };
         $.ajax({
             url: baseUrl+"/locMast/"+name+"/auth",
@@ -483,16 +508,6 @@
             }
         })
     }
-
-    // 澶嶉�夋浜嬩欢
-    form.on('checkbox(detailCheckbox)', function (data) {
-        var el = data.elem;
-        if (el.checked) {
-            $(el).val('Y');
-        } else {
-            $(el).val('N');
-        }
-    });
 
     // 鎼滅储鏍忔悳绱簨浠�
     form.on('submit(search)', function (data) {

--
Gitblit v1.9.1