From 1573adab705da74a98ad5a174f031e9171437c0c Mon Sep 17 00:00:00 2001
From: skyouc <creaycat@gmail.com>
Date: 星期四, 15 一月 2026 10:55:00 +0800
Subject: [PATCH] 出入库功能优化

---
 src/main/webapp/static/js/locAroundBind/locAroundBind.js |   81 +++++++++++++++++++++++++++-------------
 1 files changed, 54 insertions(+), 27 deletions(-)

diff --git a/src/main/webapp/static/js/locAroundBind/locAroundBind.js b/src/main/webapp/static/js/locAroundBind/locAroundBind.js
index 2e7564f..9361d1f 100644
--- a/src/main/webapp/static/js/locAroundBind/locAroundBind.js
+++ b/src/main/webapp/static/js/locAroundBind/locAroundBind.js
@@ -12,7 +12,7 @@
     // 鏁版嵁娓叉煋
     tableIns = table.render({
         elem: '#locAroundBind',
-        headers: { token: localStorage.getItem('token') },
+        headers: {token: localStorage.getItem('token')},
         url: baseUrl + '/locAroundBind/list/auth',
         page: true,
         limit: 15,
@@ -21,16 +21,16 @@
         cellMinWidth: 50,
         height: 'full-120',
         cols: [[
-            { type: 'checkbox' }
-            , { field: 'id', align: 'center', title: 'ID' , hide: true }
-            , { field: 'devId', align: 'center', title: '鏈哄彴ID', hide: true }
-            , { field: 'devNo', align: 'center', title: '鏈哄彴鍙�' }
-            , { field: 'devName', align: 'center', title: '璁惧鍚嶇О' }
-            , { field: 'blocId', align: 'center', title: '搴撲綅ID', hide: true }
-            , { field: 'blocNo', align: 'center', title: '宸ヤ綅' }
-            ,{field: 'locType$', align:'center', title: '宸ヤ綅鐘舵��'}
-            , { field: 'def$', align: 'center', title: '宸ヤ綅绫诲瀷' }
-            , { fixed: 'right', title: '鎿嶄綔', align: 'center', toolbar: '#operate', width: 120 }
+            {type: 'checkbox'}
+            , {field: 'id', align: 'center', title: 'ID', hide: true}
+            , {field: 'devId', align: 'center', title: '鏈哄彴ID', hide: true}
+            , {field: 'devNo', align: 'center', title: '鏈哄彴鍙�'}
+            , {field: 'devName', align: 'center', title: '璁惧鍚嶇О'}
+            , {field: 'blocId', align: 'center', title: '搴撲綅ID', hide: true}
+            , {field: 'blocNo', align: 'center', title: '宸ヤ綅'}
+            , {field: 'locType$', align: 'center', title: '宸ヤ綅鐘舵��'}
+            , {field: 'def$', align: 'center', title: '宸ヤ綅绫诲瀷'}
+            , {fixed: 'right', title: '鎿嶄綔', align: 'center', toolbar: '#operate', width: 240}
         ]],
         request: {
             pageName: 'curr',
@@ -66,7 +66,7 @@
         searchData['orderByType'] = obj.type;
         tableIns.reload({
             where: searchData,
-            page: { curr: 1 }
+            page: {curr: 1}
         });
     });
 
@@ -79,7 +79,7 @@
                 break;
             case 'deleteData':
                 if (checkStatus.length === 0) {
-                    layer.msg('璇烽�夋嫨瑕佸垹闄ょ殑鏁版嵁', { icon: 2 });
+                    layer.msg('璇烽�夋嫨瑕佸垹闄ょ殑鏁版嵁', {icon: 2});
                     return;
                 }
                 del(checkStatus.map(function (d) {
@@ -87,7 +87,7 @@
                 }));
                 break;
             case 'exportData':
-                admin.confirm('纭畾瀵煎嚭Excel鍚�', { shadeClose: true }, function () {
+                admin.confirm('纭畾瀵煎嚭Excel鍚�', {shadeClose: true}, function () {
                     var titles = [];
                     var fields = [];
                     obj.config.cols[0].map(function (col) {
@@ -106,7 +106,7 @@
                     };
                     $.ajax({
                         url: baseUrl + "/locAroundBind/export/auth",
-                        headers: { 'token': localStorage.getItem('token') },
+                        headers: {'token': localStorage.getItem('token')},
                         data: JSON.stringify(param),
                         dataType: 'json',
                         contentType: 'application/json;charset=UTF-8',
@@ -118,15 +118,15 @@
                             } else if (res.code === 403) {
                                 top.location.href = baseUrl + "/";
                             } else {
-                                layer.msg(res.msg, { icon: 2 })
+                                layer.msg(res.msg, {icon: 2})
                             }
                         }
                     });
                 });
                 break;
             case "init":
-                layer.prompt({ title: '璇疯緭鍏ュ彛浠わ紝骞堕噸缃簱浣�', formType: 1, shadeClose: true }, function (pass, idx) {
-                    http.get(baseUrl + "/locMast/init/pwd", { pwd: pass }, function (res) {
+                layer.prompt({title: '璇疯緭鍏ュ彛浠わ紝骞堕噸缃簱浣�', formType: 1, shadeClose: true}, function (pass, idx) {
+                    http.get(baseUrl + "/locMast/init/pwd", {pwd: pass}, function (res) {
                         if (res.data) {
                             layer.open({
                                 type: 1,
@@ -149,11 +149,26 @@
         }
     });
 
+    // iframe鐗╂枡璇︽儏
+    function locDetlToLayer(val) {
+        locNo = val;
+        layer.open({
+            type: 2,
+            title: '搴撳瓨鏄庣粏',
+            maxmin: true,
+            area: [top.detailWidth, top.detailHeight],
+            shadeClose: true,
+            content: '../report/locDetl.html',
+            success: function(layero, index){
+            }
+        });
+    }
+
     // 鍒濆鍖栦繚瀛�
     form.on('submit(initDo)', function (data) {
         $.ajax({
             url: baseUrl + "/locAroundBind/bind/init",
-            headers: { 'token': localStorage.getItem('token') },
+            headers: {'token': localStorage.getItem('token')},
             data: JSON.stringify(data.field),
             contentType: 'application/json;charset=UTF-8',
             method: 'POST',
@@ -182,6 +197,17 @@
             case "del":
                 del([data.id]);
                 break;
+            // 鏌ョ湅鏄庣粏
+            case 'locDetl':
+                if (data.locType.trim() === ''
+                    || data.locType.trim() === 'S'
+                    || data.locType.trim() === 'D'
+                    || data.locType.trim() === 'O') {
+                    layer.msg("宸ヤ綅鐨勭姸鎬佷笉瀛樺湪鐗╂枡");
+                    return;
+                }
+                locDetlToLayer(data.blocNo);
+                break;
         }
     });
 
@@ -199,19 +225,19 @@
                     var loadIndex = layer.load(2);
                     $.ajax({
                         url: baseUrl + "/locAroundBind/" + (mData ? 'update' : 'add') + "/auth",
-                        headers: { 'token': localStorage.getItem('token') },
+                        headers: {'token': localStorage.getItem('token')},
                         data: data.field,
                         method: 'POST',
                         success: function (res) {
                             layer.close(loadIndex);
                             if (res.code === 200) {
                                 layer.close(dIndex);
-                                layer.msg(res.msg, { icon: 1 });
+                                layer.msg(res.msg, {icon: 1});
                                 tableReload();
                             } else if (res.code === 403) {
                                 top.location.href = baseUrl + "/";
                             } else {
-                                layer.msg(res.msg, { icon: 2 });
+                                layer.msg(res.msg, {icon: 2});
                             }
                         }
                     })
@@ -233,18 +259,18 @@
             var loadIndex = layer.load(2);
             $.ajax({
                 url: baseUrl + "/locAroundBind/delete/auth",
-                headers: { 'token': localStorage.getItem('token') },
-                data: { ids: ids },
+                headers: {'token': localStorage.getItem('token')},
+                data: {ids: ids},
                 method: 'POST',
                 success: function (res) {
                     layer.close(loadIndex);
                     if (res.code === 200) {
-                        layer.msg(res.msg, { icon: 1 });
+                        layer.msg(res.msg, {icon: 1});
                         tableReload();
                     } else if (res.code === 403) {
                         top.location.href = baseUrl + "/";
                     } else {
-                        layer.msg(res.msg, { icon: 2 });
+                        layer.msg(res.msg, {icon: 2});
                     }
                 }
             })
@@ -270,6 +296,7 @@
 
         }, 300);
     }
+
     layDateRender();
 
 });
@@ -286,6 +313,6 @@
     });
     tableIns.reload({
         where: searchData,
-        page: { curr: pageCurr }
+        page: {curr: pageCurr}
     });
 }

--
Gitblit v1.9.1