| | |
| | | cols: [[ |
| | | {type: 'checkbox'} |
| | | // ,{field: 'uuid', align: 'center',title: '编号'} |
| | | ,{field: 'orderNo', align: 'center',title: '订单编号'} |
| | | ,{field: 'orderNo', align: 'center',title: '单据编号', minWidth: 200} |
| | | ,{field: 'orderTime', align: 'center',title: '单据日期'} |
| | | ,{field: 'docType$', align: 'center',title: '单据类型'} |
| | | ,{field: 'docType$', align: 'center',title: '单据类型', templet: '#docTypeTpl', width: 100} |
| | | ,{field: 'itemName', align: 'center',title: '项目'} |
| | | ,{field: 'allotItemId$', align: 'center',title: '调拨项目编号', hide: true} |
| | | ,{field: 'defNumber', align: 'center',title: '初始票据号', hide: true} |
| | | ,{field: 'number', align: 'center',title: '票据号'} |
| | | ,{field: 'cstmrName', align: 'center',title: '客户', hide: true} |
| | | ,{field: 'number', align: 'center',title: '票据号', hide: true} |
| | | ,{field: 'cstmrName', align: 'center',title: '客户'} |
| | | ,{field: 'tel', align: 'center',title: '联系方式', hide: true} |
| | | ,{field: 'operMemb', align: 'center',title: '操作人员'} |
| | | ,{field: 'totalFee', align: 'center',title: '合计金额'} |
| | | ,{field: 'totalFee', align: 'center',title: '合计金额', hide: true} |
| | | ,{field: 'discount', align: 'center',title: '优惠率', hide: true} |
| | | ,{field: 'discountFee', align: 'center',title: '优惠金额', hide: true} |
| | | ,{field: 'otherFee', align: 'center',title: '销售或采购费用合计', hide: true} |
| | |
| | | }); |
| | | /* 表格2重置 */ |
| | | form.on('submit(orderTbReset)', function (data) { |
| | | insTb2.reload({page: {curr: 1}}); |
| | | insTb2.reload({where: null,page: {curr: 1}}); |
| | | return false; |
| | | }); |
| | | |
| | |
| | | case 'print': |
| | | layer.confirm('开始打印' +data.number + ' 拣货单?', {shadeClose: true}, function(){ |
| | | layer.closeAll(); |
| | | printPakouts(data.number); |
| | | printPakouts(data.orderNo); |
| | | }) |
| | | break; |
| | | // 修改 |
| | |
| | | |
| | | // 生成拣货单 |
| | | function stockOut(orderNo) { |
| | | // layer.confirm(number + ' 订单开始拣货?', {shadeClose: true}, function(){ |
| | | layer.closeAll(); |
| | | $.ajax({ |
| | | url: baseUrl+"/work/stock/out/create", |
| | |
| | | , btn: ['打印拣货单'] |
| | | }, function() { |
| | | layer.closeAll(); |
| | | printPakouts(number); |
| | | printPakouts(orderNo); |
| | | } |
| | | ) |
| | | // 缺料 |
| | |
| | | // }); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | // 打印拣货单 |
| | | function printPakouts(orderNo) { |
| | | $.ajax({ |
| | | url: baseUrl+"/work/stock/out/print", |
| | | headers: {'token': localStorage.getItem('token')}, |
| | | data: JSON.stringify({ |
| | | orderNo: orderNo |
| | | }), |
| | | contentType:'application/json;charset=UTF-8', |
| | | method: 'POST', |
| | | success: function (res) { |
| | | if (res.code === 200){ |
| | | res.data["barcodeUrl"]=baseUrl+"/order/code/auth?type=1¶m="+res.data.docNum; |
| | | 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+"/pakout/print/auth", |
| | | headers: {'token': localStorage.getItem('token')}, |
| | | data: { |
| | | docNumber: orderNo |
| | | }, |
| | | 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}) |
| | | } |
| | | } |
| | | }) |
| | | }); |
| | | }) |
| | | }); |
| | | box.hide(); |
| | | } else if (res.code === 403){ |
| | | top.location.href = baseUrl+"/"; |
| | | } else { |
| | | layer.msg(res.msg, {icon: 2}) |
| | | } |
| | | } |
| | | }) |
| | | } |
| | | |
| | | // // 搜索栏搜索事件 |
| | | // form.on('submit(search)', function (data) { |