| | |
| | | ,{field: 'userId', align: 'center',title: '用户ID', hide: true} |
| | | |
| | | ,{field: 'wrkSts$', align: 'center',title: '工作状态' ,templet: '#wrkStsTpl' , width: 100} |
| | | ,{field: 'printTimes', align: 'center', title: '打印次数',width: 90} |
| | | ,{field: 'zpallet', align: 'center',title: '条形码' , hide:true} |
| | | ,{field: 'createTime$', align: 'center',title: '', hide:true} |
| | | ,{field: 'createBy', align: 'center',title: '', hide:true} |
| | |
| | | // 监听行工具事件 |
| | | table.on('tool(leftTable)', function(obj){ |
| | | var data = obj.data; |
| | | |
| | | |
| | | |
| | | switch (obj.event) { |
| | | case 'printOrder': |
| | | printPick(data); |
| | |
| | | case "del": |
| | | var ids = [data.id]; |
| | | del(ids); |
| | | break; |
| | | case "complete": |
| | | donePickOut(data); |
| | | break; |
| | | } |
| | | }); |
| | |
| | | tableReload(false); |
| | | }); |
| | | |
| | | function printPick(data){ |
| | | function donePickOut(data) { |
| | | $.ajax({ |
| | | url:baseUrl + "/pickout/done/auth", |
| | | headers : {'token' : localStorage.getItem('token')}, |
| | | data: JSON.stringify(data), |
| | | contentType:'application/json;charset=UTF-8', |
| | | method: 'POST', |
| | | success: function (res) { |
| | | |
| | | leftTB.reload(); |
| | | } |
| | | }) |
| | | } |
| | | |
| | | function printPick(data){ |
| | | $.ajax({ |
| | | url:baseUrl + "/work/pick/out/print", |
| | | headers : {'token' : localStorage.getItem('token')}, |
| | | data: JSON.stringify(data), |
| | | contentType:'application/json;charset=UTF-8', |
| | | method: 'POST', |
| | | success: function (res) { |
| | | if (res.code === 200){ |
| | | console.log(res); |
| | | res.data["barcodeUrl"]=baseUrl+"/order/code/auth?type=1¶m="+res.data.pickout.wrkNo; |
| | | var tpl = $('#pakoutPrintTpl').html(); |
| | | var template = Handlebars.compile(tpl); |
| | | var html = template(res); |
| | | var box = $("#pakoutPrintBox"); |
| | | box.html(html);box.show(); |
| | | box.print({ |
| | | mediaPrint:true, |
| | | deferred: $.Deferred().done(function () { |
| | | layer.confirm('[重要] 打印是否成功?', {btn: ['Yes', 'No']}, function(){ |
| | | $.ajax({ |
| | | url: baseUrl+"/pickout/print/auth", |
| | | headers: {'token': localStorage.getItem('token')}, |
| | | data: JSON.stringify(res.data.pickout), |
| | | contentType:'application/json;charset=UTF-8', |
| | | method: 'POST', |
| | | success: function (res) { |
| | | if (res.code === 200){ |
| | | layer.closeAll(); |
| | | $(".layui-laypage-btn")[0].click(); |
| | | layer.msg(res.msg, {icon: 1}) |
| | | } else if (res.code === 403){ |
| | | top.location.href = baseUrl+"/"; |
| | | } else { |
| | | layer.msg(res.msg, {icon: 2}) |
| | | } |
| | | leftTB.reload(); |
| | | } |
| | | }) |
| | | }); |
| | | }) |
| | | }); |
| | | box.hide(); |
| | | } |
| | | else if (res.code === 403){ |
| | | top.location.href = baseUrl+"/"; |
| | | }else { |
| | | layer.msg(res.msg, {icon: 2}) |
| | | } |
| | | |
| | | } |
| | | |
| | | }) |
| | | } |
| | | |
| | | |
| | |
| | | ,{field: 'price', align: 'center',title: '价格', hide:true} |
| | | ,{field: 'weight', align: 'center',title: '重量', hide:true} |
| | | ,{field: 'status', align: 'center',title: '状态' , hide:true} |
| | | ,{field: 'pickStaff', align: 'center',title: '拣货员ID'} |
| | | ,{field: 'pickStaff$', align: 'center',title: '拣货员ID'} |
| | | ,{field: 'pickStart$', align: 'center',title: '拣货开始时间'} |
| | | ,{field: 'pickEnd$', align: 'center',title: '拣货结束时间'} |
| | | ,{field: 'createTime$', align: 'center',title: '创建时间', hide:true} |