From 6d75b9bda39c710153183844ba1e8effbb730de1 Mon Sep 17 00:00:00 2001 From: zyx <zyx123456> Date: 星期二, 16 四月 2024 09:53:43 +0800 Subject: [PATCH] 单据、拣货单权限问题 --- src/main/webapp/static/js/picking/picking.js | 80 +++++++++++++++++++++++++++++++-------- 1 files changed, 63 insertions(+), 17 deletions(-) diff --git a/src/main/webapp/static/js/picking/picking.js b/src/main/webapp/static/js/picking/picking.js index 06fbb0f..f0f0b3c 100644 --- a/src/main/webapp/static/js/picking/picking.js +++ b/src/main/webapp/static/js/picking/picking.js @@ -12,6 +12,12 @@ var form = layui.form; var admin = layui.admin; + layDate.render({ + elem: '.layui-laydate-range' + ,type: 'datetime' + ,range: true + }); + // 鏁版嵁娓叉煋 tableIns = table.render({ elem: '#saasLog', @@ -27,11 +33,11 @@ // {type: 'checkbox'} {type: 'numbers'} ,{field: 'wrkNo', align: 'center',title: 'id', hide:true} - ,{field: 'docNum',title: '鎷h揣鍗曞彿' } + ,{field: 'doc_num',title: '鎷h揣鍗曞彿' } ,{align: 'center', title: '浜岀淮鐮�', toolbar: '#operate', width: 200 , hide:true} ,{align: 'center', title: '鏄庣粏', toolbar: '#tbLook', minWidth: 160, width: 160} ,{field: 'status$', align: 'center',title: '鐘舵��'} - // ,{field: 'custName', align: 'center',title: '瀹㈡埛鍚嶇О', width: 160} + ,{field: 'custName', align: 'center',title: '瀹㈡埛鍚嶇О', width: 160} ,{field: 'createTime$', align: 'center',title: '鎿嶄綔鏃堕棿'} ,{align: 'center', title: '鎿嶄綔', toolbar: '#operate'} @@ -85,18 +91,19 @@ // 鐩戝惉琛屽伐鍏蜂簨浠� table.on('tool(saasLog)', function(obj){ var data = obj.data; + console.log(data); switch (obj.event) { case "btnPrint": - btnPrint(data.wrkNo, data.docNum, 4); + btnPrint(data.wrkNo, data.doc_num, 4); break; case "wrkTrace": - btnPrint(data.wrkNo, data.docNum, 4); + btnPrint(data.wrkNo, data.doc_num, 4); break; case "btnPrint2": - btnPrint2(data.wrkNo, data.docNum, 4); + btnPrint2(data.wrkNo, data.doc_num, 4); break; case "del": - doDel(data.docNum); + doDel(data); break; case "look": var $a = $(obj.tr).find('a[lay-event="look"]'); @@ -105,8 +112,8 @@ var left = offset.left; layer.open({ type: 1, - title: false, - area: '1200px', + title: '鍗曟嵁鏄庣粏', + area: '1500px', offset: [top + 'px', (left - 450 + $a.outerWidth()) + 'px'], shade: .01, shadeClose: true, @@ -119,25 +126,29 @@ headers: {token: localStorage.getItem('token')}, url: baseUrl+'/ManPakOut/list/auth', where: { - doc_num: data.docNum, + doc_num: data.doc_num, uuid: data.uuid }, page: true, cellMinWidth: 100, cols: [[ {type: 'numbers'} - ,{field: 'id', align: 'center',title: 'id', hide:true} + ,{field: 'wrkNo', align: 'center',title: 'id', hide:true} ,{field: 'docNum', align: 'center',title: '鎷h揣鍗曞彿'} ,{field: 'uuid', align: 'center',title: 'uuid'} ,{field: 'locNo', align: 'center',title: '搴撲綅'} - ,{field: 'matnr', align: 'center',title: '鐗╂枡鍙�'} - ,{field: 'maktx', align: 'center',title: '鍟嗗搧鍚嶇О'} + ,{field: 'batch', align: 'center',title: '鎵瑰彿'} + ,{field: 'barcode', align: 'center',title: '鍖呭彿'} + // ,{field: 'matnr', align: 'center',title: '鐗╂枡鍙�'} + ,{field: 'maktx', align: 'center',title: '鐗屽彿'} ,{field: 'anfme', align: 'center',title: '鏁伴噺'} ,{field: 'createTime$', align: 'center',title: '鎿嶄綔鏃堕棿'} ,{field: 'count', align: 'center',title: '瀹屾垚鏁�'} ,{field: 'status$', align: 'center',title: '鐘舵��'} ,{field: 'memo', align: 'center',title: '澶囨敞'} + ,{field: 'specs', align: 'center',title: '鍙戣揣鏃堕棿'} ,{field: 'createBy', align: 'center',title: '', hide:true} + ,{align: 'center', title: '鎿嶄綔', toolbar: '#operateDetl'} ]], request: { pageName: 'curr', @@ -173,6 +184,41 @@ }); } }); + + table.on('tool(lookSSXMTable)', function(obj) { + var data = obj.data; + console.log(data); + switch (obj.event) { + case "delDetl": + layer.confirm('纭畾瑕佸垹闄ゅ悧锛�', { + shade: .1, + skin: 'layui-layer-admin' + }, function (i) { + layer.close(i); + layer.load(2); + $.ajax({ + url: baseUrl+"/pakout/deleteDetl/auth", + headers: {'token': localStorage.getItem('token')}, + data:{ + wrkNo:data.wrkNo + }, + method: 'GET', + success: function (res) { + layer.closeAll('loading'); + if (res.code === 200){ + tableIns.reload({page: {curr: 1}}); + layer.msg(res.msg, {icon: 1}); + } else if (res.code === 403){ + top.location.href = baseUrl+"/"; + }else { + layer.msg(res.msg, {icon: 2}); + } + } + }) + }) + break; + } + }) // 鎼滅储 form.on('submit(search)', function (data) { @@ -295,9 +341,9 @@ var className = templateDom.attr("class"); if (className === 'template-barcode') { - json.data[i]["barcodeUrl"] = baseUrl + "/ManPakOut/code/auth?type=2¶m=" + (json.data[i].docNum+";"+json.data[i].matnr+";"+json.data[i].maktx+";"+json.data[i].anfme+";"+json.data[i].locNo+";"); + json.data[i]["barcodeUrl"] = baseUrl + "/ManPakOut/code/auth?type=2¶m=" + (json.data[i].docNum+";"+json.data[i].matnr+";"+json.data[i].batch+";"+json.data[i].anfme+";"+json.data[i].locNo+";"+json.data[i].barcode+";"+json.data[i].nodeId+";"+json.data[i].wrkNo+";"+json.data[i].maktx); } else { - json.data[i]["barcodeUrl"] = baseUrl + "/ManPakOut/code/auth?type=2¶m=" + (json.data[i].docNum+";"+json.data[i].matnr+";"+json.data[i].maktx+";"+json.data[i].anfme+";"+json.data[i].locNo+";"); + json.data[i]["barcodeUrl"] = baseUrl + "/ManPakOut/code/auth?type=2¶m=" + (json.data[i].docNum+";"+json.data[i].matnr+";"+json.data[i].batch+";"+json.data[i].anfme+";"+json.data[i].locNo+";"+json.data[i].barcode+";"+json.data[i].nodeId+";"+json.data[i].wrkNo+";"+json.data[i].maktx); } } var tpl = templateDom.html(); @@ -317,8 +363,8 @@ }) } - function doDel(docNum) { - console.log(docNum) + function doDel(data) { + console.log(data) layer.confirm('纭畾瑕佸垹闄ゅ悧锛�', { shade: .1, skin: 'layui-layer-admin' @@ -329,7 +375,7 @@ url: baseUrl+"/pakout/delete/auth", headers: {'token': localStorage.getItem('token')}, data:{ - docNum:docNum + docNum:data.doc_num }, method: 'GET', success: function (res) { -- Gitblit v1.9.1