From 44c6df2e7b14b2126b0157b07803ac83047d7829 Mon Sep 17 00:00:00 2001
From: zhou zhou <3272660260@qq.com>
Date: 星期五, 26 十二月 2025 16:20:20 +0800
Subject: [PATCH] #agv任务

---
 src/main/webapp/static/js/locCache/locCache.js |   94 +++++++++++++++++++++++++++++++----------------
 1 files changed, 62 insertions(+), 32 deletions(-)

diff --git a/src/main/webapp/static/js/locCache/locCache.js b/src/main/webapp/static/js/locCache/locCache.js
index 938cf5c..e9f2228 100644
--- a/src/main/webapp/static/js/locCache/locCache.js
+++ b/src/main/webapp/static/js/locCache/locCache.js
@@ -12,7 +12,7 @@
     // 鏁版嵁娓叉煋
     tableIns = table.render({
         elem: '#locCache',
-        headers: {token: localStorage.getItem('token')},
+        headers: { token: localStorage.getItem('token') },
         url: baseUrl + '/locCache/list/auth',
         page: true,
         limit: 15,
@@ -20,23 +20,23 @@
         toolbar: '#toolbar',
         cellMinWidth: 80,
         height: 'full-120',
-        cols: [[{type: 'checkbox'}, {field: 'locNo', align: 'center', title: '搴撲綅鍙�', width: 120}
-            , {field: 'barcode', align: 'center', title: '鎵樼洏鐮�'}
-            , {field: 'areaName', align: 'center', title: '搴撳尯鍚嶇О'}
+        cols: [[{ type: 'checkbox' }, { field: 'locNo', align: 'center', title: '搴撲綅鍙�', width: 120 }
+            , { field: 'barcode', align: 'center', title: '鎵樼洏鐮�' }
+            , { field: 'areaName', align: 'center', title: '搴撳尯鍚嶇О' }
             // , {field: 'whsType$', align: 'center', title: '搴撲綅绫诲瀷'}
-            , {field: 'locSts', align: 'center', title: '搴撲綅鐘舵��'}
-            , {field: 'row1', align: 'center', title: '鎺�'}
-            , {field: 'bay1', align: 'center', title: '鍒�'}
-            , {field: 'lev1', align: 'center', title: '灞�'}
+            , { field: 'locSts', align: 'center', title: '搴撲綅鐘舵��' }
+            , { field: 'row1', align: 'center', title: '鎺�' }
+            , { field: 'bay1', align: 'center', title: '鍒�' }
+            , { field: 'lev1', align: 'center', title: '灞�' }
             // , {field: 'locType', align: 'center', title: '搴撲綅绫诲瀷'}
-            , {field: 'sort', align: 'center', title: '浼樺厛绾�'}
-            , {field: 'modiUser$', align: 'center', title: '淇敼浜哄憳'}
-            , {field: 'modiTime$', align: 'center', title: '淇敼鏃堕棿'}
-            , {field: 'appeUser$', align: 'center', title: '鍒涘缓鑰�'}
-            , {field: 'appeTime$', align: 'center', title: '娣诲姞鏃堕棿'}
-            , {field: 'frozen', align: 'center', title: '鏄惁鍐荤粨,0.鏈喕缁擄紝1.宸插喕缁�', hide: true}
-            , {field: 'frozenMemo', align: 'center', title: '鍐荤粨澶囨敞', hide: true}
-            , {fixed: 'right', title: '鎿嶄綔', align: 'center', toolbar: '#operate', width: 160}]
+            , { field: 'sort', align: 'center', title: '浼樺厛绾�' }
+            , { field: 'modiUser$', align: 'center', title: '淇敼浜哄憳', hide: true }
+            , { field: 'modiTime$', align: 'center', title: '淇敼鏃堕棿' }
+            , { field: 'appeUser$', align: 'center', title: '鍒涘缓鑰�', hide: true }
+            , { field: 'appeTime$', align: 'center', title: '娣诲姞鏃堕棿', hide: true }
+            , { field: 'frozen', align: 'center', title: '鏄惁鍐荤粨', hide: true }
+            , { field: 'frozenMemo', align: 'center', title: '鍐荤粨澶囨敞', hide: true }
+            , { fixed: 'right', title: '鎿嶄綔', align: 'center', toolbar: '#operate', width: 200 }]
         ],
         request: {
             pageName: 'curr', pageSize: 'limit'
@@ -67,7 +67,7 @@
         searchData['orderByField'] = obj.field;
         searchData['orderByType'] = obj.type;
         tableIns.reload({
-            where: searchData, page: {curr: 1}
+            where: searchData, page: { curr: 1 }
         });
     });
 
@@ -80,14 +80,14 @@
                 break;
             case 'batchModifties':
                 if (checkStatus.length === 0) {
-                    layer.msg('璇烽�夋嫨闇�瑕佷慨鏀圭殑鏁版嵁淇℃伅', {icon: 2});
+                    layer.msg('璇烽�夋嫨闇�瑕佷慨鏀圭殑鏁版嵁淇℃伅', { icon: 2 });
                     return;
                 }
                 batchModifies();
                 break;
             case 'deleteData':
                 if (checkStatus.length === 0) {
-                    layer.msg('璇烽�夋嫨瑕佸垹闄ょ殑鏁版嵁', {icon: 2});
+                    layer.msg('璇烽�夋嫨瑕佸垹闄ょ殑鏁版嵁', { icon: 2 });
                     return;
                 }
                 del(checkStatus.map(function (d) {
@@ -95,8 +95,8 @@
                 }));
                 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,
@@ -153,7 +153,7 @@
         console.log(data.field)
         $.ajax({
             url: baseUrl + "/locCache/init/auth",
-            headers: {'token': localStorage.getItem('token')},
+            headers: { 'token': localStorage.getItem('token') },
             data: data.field,
             method: 'POST',
             async: false,
@@ -190,28 +190,58 @@
         admin.open({
             type: 1,
             area: '600px',
-            title: (mData ? '淇敼' : '娣诲姞') + '璁㈠崟鐘舵��',
+            title: (mData ? '淇敼' : '娣诲姞') + '搴撲綅缂撳瓨',
             content: $('#editDialog').html(),
             success: function (layero, dIndex) {
                 layDateRender(mData);
-                form.val('detail', mData);
+                // 鍔犺浇搴撳尯鍒楄〃
+                $.ajax({
+                    url: baseUrl + "/basAreasQuery/auth",
+                    headers: { 'token': localStorage.getItem('token') },
+                    data: { condition: '' },
+                    method: 'POST',
+                    success: function (res) {
+                        if (res.code === 200) {
+                            var areaSelect = $(layero).find('select[name="areaName"]');
+                            areaSelect.empty();
+                            areaSelect.append('<option value="">璇烽�夋嫨搴撳尯</option>');
+                            var list = res.data;
+                            for (var i = 0; i < list.length; i++) {
+                                areaSelect.append('<option value="' + list[i].value + '" data-id="' + list[i].id + '">' + list[i].value + '</option>');
+                            }
+                            // 璁剧疆琛ㄥ崟鍊�
+                            form.val('detail', mData);
+                            // 濡傛灉鏈夋暟鎹紝璁剧疆閫変腑鐨勫簱鍖�
+                            if (mData && mData.areaName) {
+                                areaSelect.val(mData.areaName);
+                            }
+                            form.render('select');
+                        }
+                    }
+                });
+                // 鐩戝惉搴撳尯閫夋嫨鍙樺寲锛屽悓姝reaId
+                form.on('select(editAreaName)', function (data) {
+                    var selectedOption = $(data.elem).find('option:selected');
+                    var areaId = selectedOption.attr('data-id') || '';
+                    $(layero).find('input[name="areaId"]').val(areaId);
+                });
                 form.on('submit(editSubmit)', function (data) {
                     var loadIndex = layer.load(2);
                     $.ajax({
                         url: baseUrl + "/locCache/" + (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 });
                             }
                         }
                     })
@@ -232,18 +262,18 @@
             var loadIndex = layer.load(2);
             $.ajax({
                 url: baseUrl + "/locCache/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 });
                     }
                 }
             })
@@ -303,6 +333,6 @@
         searchData[this.name] = this.value;
     });
     tableIns.reload({
-        where: searchData, page: {curr: pageCurr}
+        where: searchData, page: { curr: pageCurr }
     });
 }

--
Gitblit v1.9.1