From 375f337b2a91e59beb0b41dc89353de1e92aa6a1 Mon Sep 17 00:00:00 2001
From: chen.llin <1442464845@qq.comm>
Date: 星期四, 22 一月 2026 18:54:50 +0800
Subject: [PATCH] agv工作档增加 is_deleted

---
 src/main/webapp/static/js/locCache/locCache.js |  165 ++++++++++++++++++++++++++++++++++++++++++++----------
 1 files changed, 133 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..7158c29 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: 350 }]
         ],
         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,
@@ -145,6 +145,12 @@
             case "del":
                 del([data.id]);
                 break;
+            case "clearLoc":
+                clearLocation(data);
+                break;
+            case "setInStock":
+                setInStock(data);
+                break;
         }
     });
 
@@ -153,7 +159,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 +196,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 +268,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 });
                     }
                 }
             })
@@ -290,6 +326,71 @@
 
     layDateRender();
 
+    // 娓呯┖搴撲綅
+    function clearLocation(data) {
+        layer.confirm('纭娓呯┖搴撲綅锛�' + data.locNo + '锛�', {
+            skin: 'layui-layer-admin', shade: .1
+        }, function (i) {
+            layer.close(i);
+            var loadIndex = layer.load(2);
+            $.ajax({
+                url: baseUrl + "/locCache/lockOrUnlock/auth",
+                headers: { 'token': localStorage.getItem('token') },
+                data: {
+                    locNo: data.locNo,
+                    lock: false  // false琛ㄧず瑙i攣/娓呯┖
+                },
+                method: 'POST',
+                success: function (res) {
+                    layer.close(loadIndex);
+                    if (res.code === 200) {
+                        layer.msg(res.msg || '娓呯┖搴撲綅鎴愬姛', { icon: 1 });
+                        tableReload();
+                    } else if (res.code === 403) {
+                        top.location.href = baseUrl + "/";
+                    } else {
+                        layer.msg(res.msg || '娓呯┖搴撲綅澶辫触', { icon: 2 });
+                    }
+                }
+            })
+        });
+    }
+
+    // 鏀逛负鏈夎揣鐘舵��
+    function setInStock(data) {
+        layer.prompt({
+            title: '璇烽�夋嫨婊℃墭/绌烘墭',
+            formType: 2,
+            content: '<div style="padding: 20px;"><label><input type="radio" name="fullPlt" value="true" checked> 婊℃墭</label><br><br><label><input type="radio" name="fullPlt" value="false"> 绌烘墭</label></div>',
+            area: ['300px', '200px']
+        }, function(value, index, elem){
+            var fullPlt = $(elem).find('input[name="fullPlt"]:checked').val() === 'true';
+            layer.close(index);
+            var loadIndex = layer.load(2);
+            $.ajax({
+                url: baseUrl + "/locCache/lockOrUnlock/auth",
+                headers: { 'token': localStorage.getItem('token') },
+                data: {
+                    locNo: data.locNo,
+                    lock: true,  // true琛ㄧず閿佸畾/鏀逛负鏈夎揣
+                    fullPlt: fullPlt
+                },
+                method: 'POST',
+                success: function (res) {
+                    layer.close(loadIndex);
+                    if (res.code === 200) {
+                        layer.msg(res.msg || '鏀逛负鏈夎揣鐘舵�佹垚鍔�', { icon: 1 });
+                        tableReload();
+                    } else if (res.code === 403) {
+                        top.location.href = baseUrl + "/";
+                    } else {
+                        layer.msg(res.msg || '鏀逛负鏈夎揣鐘舵�佸け璐�', { icon: 2 });
+                    }
+                }
+            })
+        });
+    }
+
 });
 
 // 鍏抽棴鍔ㄤ綔
@@ -303,6 +404,6 @@
         searchData[this.name] = this.value;
     });
     tableIns.reload({
-        where: searchData, page: {curr: pageCurr}
+        where: searchData, page: { curr: pageCurr }
     });
 }

--
Gitblit v1.9.1