From 8bc35cc4f75cfb435577e34763002f69def6a1a2 Mon Sep 17 00:00:00 2001
From: dubin <bindu_bean@163.com>
Date: 星期六, 07 二月 2026 16:53:18 +0800
Subject: [PATCH] 调试

---
 src/main/webapp/static/js/pakStore/clampOut.js |  251 ++++++++++++++++++++++++++++++-------------------
 1 files changed, 152 insertions(+), 99 deletions(-)

diff --git a/src/main/webapp/static/js/pakStore/clampOut.js b/src/main/webapp/static/js/pakStore/clampOut.js
index da70def..94d946b 100644
--- a/src/main/webapp/static/js/pakStore/clampOut.js
+++ b/src/main/webapp/static/js/pakStore/clampOut.js
@@ -1,78 +1,14 @@
-var locDetlLayerIdx;
-var tableIns;
-var locDetlData = [];
-function getCol() {
-    var cols = [
-        {field: 'locNo', align: 'center',title: '搴撲綅鍙�', merge: true, style: 'font-weight: bold'}
-    ];
-    cols.push.apply(cols, detlCols);
-    return cols;
-}
+var pageCurr;
 
 layui.config({
     base: baseUrl + "/static/layui/lay/modules/"
-}).use(['table','laydate', 'form', 'admin', 'tableMerge'], function() {
+}).use(['table','laydate', 'form', 'admin'], function() {
     var table = layui.table;
     var $ = layui.jquery;
     var layer = layui.layer;
     var layDate = layui.laydate;
     var form = layui.form;
     var admin = layui.admin;
-    var tableMerge = layui.tableMerge;
-
-    tableIns = table.render({
-        elem: '#chooseData',
-        headers: {token: localStorage.getItem('token')},
-        data: [],
-        even: true,
-        toolbar: '#toolbar',
-        cellMinWidth: 50,
-        cols: [getCol()],
-        done: function(res, curr, count) {
-            tableMerge.render(this);
-            limit();
-            getOutBound();
-        }
-    });
-
-    // 鐩戝惉澶村伐鍏锋爮浜嬩欢
-    table.on('toolbar(chooseData)', function (obj) {
-        switch (obj.event) {
-            case 'outbound':
-                if (locDetlData.length === 0){
-                    layer.msg('璇峰厛娣诲姞骞舵澘搴撳瓨', {icon: 2});
-                } else {
-                    var staNo = $("#staNoSelect").val();
-                    if (staNo === "" || staNo === null){
-                        layer.msg("璇烽�夋嫨鍑哄簱绔�", {icon: 2});
-                        return;
-                    }
-                    let param = {
-                        outSite: staNo,
-                        locDetls: locDetlData
-                    }
-                    $.ajax({
-                        url: baseUrl+"/locClamp/out/start",
-                        headers: {'token': localStorage.getItem('token')},
-                        data: JSON.stringify(param),
-                        contentType:'application/json;charset=UTF-8',
-                        method: 'POST',
-                        success: function (res) {
-                            if (res.code === 200){
-                                locDetlData = [];
-                                tableIns.reload({data: locDetlData});
-                                layer.msg(res.msg, {icon: 1});
-                            } else if (res.code === 403){
-                                top.location.href = baseUrl+"/";
-                            } else {
-                                layer.msg(res.msg, {icon: 2})
-                            }
-                        }
-                    });
-                }
-                break;
-        }
-    });
 
     // 鑾峰彇鍑哄簱鍙�
     function getOutBound(){
@@ -97,42 +33,159 @@
         })
     }
 
-    $(document).on('click','#mat-query', function () {
-        let loadIndex = layer.msg('璇锋眰涓�...', {icon: 16, shade: 0.01, time: false});
-        locDetlLayerIdx = layer.open({
-            type: 2,
-            title: false,
-            closeBtn: false,
-            maxmin: false,
-            area: ['90%', '85%'],
-            shadeClose: true,
-            content: 'clampDetlQuery.html',
-            success: function(layero, index){
-                layer.close(loadIndex);
+    // 鏁版嵁娓叉煋
+    tableIns = table.render({
+        elem: '#locMast',
+        headers: {token: localStorage.getItem('token')},
+        url: baseUrl+'/locMast/list/auth/lev/clamp',
+        page: true,
+        limit: 16,
+        limits: [16, 30, 50, 100, 200, 500],
+        where: {loc_sts: "F"},
+        even: true,
+        toolbar: '#toolbar',
+        defaultToolbar: ['filter'],
+        cellMinWidth: 50,
+        cols: [[
+            {type: 'checkbox', fixed: 'left'}
+            ,{field: 'locNo', align: 'center',title: '搴撲綅鍙�',sort:true}
+            ,{field: 'locSts$', align: 'center',title: '搴撲綅鐘舵��',width:200}
+            // ,{field: 'whsType$', align: 'center',title: '搴撲綅绫诲瀷'}
+            ,{field: 'barcode', align: 'center',title: '鎵樼洏鏉$爜'}
+            ,{field: 'crnNo', align: 'center',title: '鍫嗗灈鏈哄彿'}
+            ,{field: 'scWeight', align: 'center',title: '鎵樼洏鎬婚噸'}
+            ,{field: 'row1', align: 'center',title: '鎺�'}
+            ,{field: 'bay1', align: 'center',title: '鍒�'}
+            ,{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 ";}
+                    html += ">";
+                    return html;
+                },width:80}
+            ,{field: 'modiUser$', align: 'center',title: '淇敼浜哄憳',event: 'modiUser'}
+            ,{field: 'modiTime$', align: 'center',title: '淇敼鏃堕棿'}
+        ]],
+        request: {
+            pageName: 'curr',
+            pageSize: 'limit'
+        },
+        parseData: function (res) {
+            return {
+                'code': res.code,
+                'msg': res.msg,
+                'count': res.data.total,
+                'data': res.data.records
             }
-        });
-    })
+        },
+        response: {
+            statusCode: 200
+        },
+        done: function(res, curr, count) {
+            if (res.code === 403) {
+                top.location.href = baseUrl+"/";
+            }
+            pageCurr=curr;
+            getOutBound();
+            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';
+                }
+            });
+        }
+    });
+
+    // 鐩戝惉澶村伐鍏锋爮浜嬩欢
+    table.on('toolbar(locMast)', function (obj) {
+        var data = table.checkStatus(obj.config.id).data;
+        switch (obj.event) {
+            case 'outbound':
+                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+"/locClamp/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;
+        }
+    });
+
+    // 鎼滅储鏍忔悳绱簨浠�
+    form.on('submit(search)', function (data) {
+        pageCurr = 1;
+        $('#detlTable').css("display", 'none');
+        tableReload(false);
+        getOutBound();
+    });
+
+    // 鎼滅储鏍忛噸缃簨浠�
+    form.on('submit(reset)', function (data) {
+        pageCurr = 1;
+        clearFormVal($('#search-box'));
+        $('#detlTable').css("display", 'none');
+        tableReload(false);
+        getOutBound();
+    });
 
 })
 
-// 娣诲姞琛ㄦ牸鏁版嵁
-function addTableData(data) {
-    for (let i=0;i<data.length;i++){
-        let pass = false;
-        for (let j=0;j<locDetlData.length;j++){
-            if (data[i].matnr === locDetlData[j].matnr && data[i].batch === locDetlData[j].batch && data[i].locNo$ === locDetlData[j].locNo$) {
-                pass = true;
-                break;
+function tableReload(child) {
+    var searchData = {};
+    $.each($('#search-box [name]').serializeArray(), function() {
+        searchData[this.name] = this.value;
+    });
+    (child ? parent.tableIns : tableIns).reload({
+        where: searchData,
+        page: {
+            curr: pageCurr
+        },
+        done: function (res, curr, count) {
+            if (res.code === 403) {
+                top.location.href = baseUrl+"/";
             }
+            pageCurr=curr;
+            if (res.data.length === 0 && count !== 0) {
+                tableIns.reload({
+                    where: searchData,
+                    page: {
+                        curr: pageCurr-1
+                    }
+                });
+                pageCurr -= 1;
+            }
+            limit(child);
         }
-        if (pass) {
-            data.splice(i--, 1);
-        } else {
-            data[i]["count"] = data[i]["anfme"];
-        }
-
-    }
-    locDetlData.push.apply(locDetlData, data);
-    tableIns.reload({data: locDetlData});
-    layer.close(locDetlLayerIdx);
-}
\ No newline at end of file
+    });
+}

--
Gitblit v1.9.1