| | |
| | | import com.zy.asrs.entity.Mat; |
| | | import com.zy.asrs.entity.MatPrint; |
| | | import com.zy.asrs.entity.OrderDetl; |
| | | import com.zy.asrs.entity.Pakout; |
| | | import com.zy.asrs.entity.result.KeyValueVo; |
| | | import com.zy.asrs.service.MatService; |
| | | import com.zy.asrs.service.PakoutService; |
| | | import com.zy.asrs.utils.MatExcelListener; |
| | | import com.zy.common.CodeRes; |
| | | import com.zy.common.config.AdminInterceptor; |
| | |
| | | private MatService matService; |
| | | @Autowired |
| | | private SnowflakeIdWorker snowflakeIdWorker; |
| | | @Autowired |
| | | private PakoutService pakoutService; |
| | | |
| | | @RequestMapping(value = "/mat/auto/matnr/auth") |
| | | public R autoMatnr(){ |
| | |
| | | return R.ok().add(orderDetl); |
| | | } |
| | | |
| | | @RequestMapping(value = "/pakOut/show") |
| | | public R showQR(){ |
| | | List<Pakout> manPakOuts = pakoutService.selectList(null); |
| | | return R.ok(manPakOuts); |
| | | } |
| | | |
| | | |
| | | /*************************************** 打印相关 ***********************************************/ |
| | | |
| | | @RequestMapping(value = "/mac/code/auth") |
| | |
| | | if (null == this.status){ return null; } |
| | | switch (this.status){ |
| | | case 1: |
| | | return "正常"; |
| | | return "已出库"; |
| | | case 0: |
| | | return "禁用"; |
| | | return "未出库"; |
| | | case 8: |
| | | return "未完全出库"; |
| | | case 9: |
| | | return "全部完成出库"; |
| | | default: |
| | | return String.valueOf(this.status); |
| | | } |
| | | } |
| | | |
| | | |
| | | public String getCreateBy$(){ |
| | | UserService service = SpringUtils.getBean(UserService.class); |
| | | User user = service.selectById(this.createBy); |
| | |
| | | var pageCurr; |
| | | var printMatCodeNos = []; |
| | | layui.config({ |
| | | base: baseUrl + "/static/layui/lay/modules/" |
| | | }).use(['table','laydate', 'form', 'admin'], function(){ |
| | | }).use(['table','laydate', 'form', 'admin' , 'layer'], function(){ |
| | | var table = layui.table; |
| | | var $ = layui.jquery; |
| | | var layer = layui.layer; |
| | | var layDate = layui.laydate; |
| | | var form = layui.form; |
| | | var admin = layui.admin; |
| | | |
| | | |
| | | // 数据渲染 |
| | | tableIns = table.render({ |
| | |
| | | cellMinWidth: 50, |
| | | height: 'full-120', |
| | | cols: [[ |
| | | {type: 'checkbox'} |
| | | ,{field: 'wrkNo', align: 'center',title: '任务号'} |
| | | ,{field: 'wrkSts$', align: 'center',title: '工作状态'} |
| | | ,{field: 'zpallet', align: 'center',title: '托盘号'} |
| | | ,{field: 'anfme', align: 'center',title: '出库数量'} |
| | | ,{field: 'nodeId', align: 'center',title: '关联货位'} |
| | | ,{field: 'locNo', align: 'center',title: '货位'} |
| | | ,{field: 'matnr', align: 'center',title: '商品编码'} |
| | | ,{field: 'maktx', align: 'center',title: '商品名称'} |
| | | ,{field: 'name', align: 'center',title: '名称'} |
| | | ,{field: 'specs', align: 'center',title: '规格'} |
| | | ,{field: 'model', align: 'center',title: '型号'} |
| | | ,{field: 'batch', align: 'center',title: '批号'} |
| | | ,{field: 'unit', align: 'center',title: '单位'} |
| | | ,{field: 'barcode', align: 'center',title: '货物条码'} |
| | | ,{field: 'docId', align: 'center',title: '单据类型'} |
| | | ,{field: 'docNum', align: 'center',title: '单据编号'} |
| | | ,{field: 'custName', align: 'center',title: '客户名称'} |
| | | ,{field: 'itemNum', align: 'center',title: '品项数'} |
| | | ,{field: 'count', align: 'center',title: '数量'} |
| | | ,{field: 'weight', align: 'center',title: '重量'} |
| | | // {type: 'checkbox'} |
| | | ,{field: 'wrkNo', align: 'center',title: 'id', hide:true} |
| | | ,{field: 'docNum',title: '拣货单号' , templet: '#orderNoTpl'} |
| | | ,{align: 'center', title: '明细', toolbar: '#tbLook', minWidth: 160, width: 160} |
| | | ,{field: 'status$', align: 'center',title: '状态'} |
| | | ,{field: 'createBy$', align: 'center',title: '添加人员'} |
| | | ,{field: 'createTime$', align: 'center',title: '添加时间'} |
| | | ,{field: 'updateBy$', align: 'center',title: '修改人员'} |
| | | ,{field: 'updateTime$', align: 'center',title: '修改时间'} |
| | | ,{field: 'memo', align: 'center',title: '备注'} |
| | | |
| | | ,{fixed: 'right', title:'操作', align: 'center', toolbar: '#operate', width:120} |
| | | // ,{field: 'custName', align: 'center',title: '客户名称', width: 160} |
| | | ,{field: 'createTime$', align: 'center',title: '操作时间'} |
| | | ]], |
| | | request: { |
| | | pageName: 'curr', |
| | |
| | | }); |
| | | }); |
| | | |
| | | function btnPrint(orderId, orderNo, settle) { |
| | | printMatCodeNos.push(orderNo) |
| | | var templateNo = 3; |
| | | $.ajax({ |
| | | // url: baseUrl+"/pakOut/print/auth", |
| | | url: baseUrl+"/pakOut/show", |
| | | headers: {'token': localStorage.getItem('token')}, |
| | | // data: {param: printMatCodeNos}, |
| | | method: 'POST', |
| | | async: false, |
| | | success: function (res) { |
| | | if (res.code === 200){ |
| | | layer.closeAll(); |
| | | for (let i=0;i<res.data.length;i++){ |
| | | var templateDom = $("#templatePreview"+templateNo); |
| | | var className = templateDom.attr("class"); |
| | | if (className === 'template-barcode') { |
| | | res.data[i]["barcodeUrl"]=baseUrl+"/mac/code/auth?type=1¶m="+res.data[i].docNum; |
| | | } else { |
| | | res.data[i]["barcodeUrl"]=baseUrl+"/mac/code/auth?type=2¶m="+res.data[i].docNum; |
| | | } |
| | | } |
| | | |
| | | |
| | | // var tpl = templateDom.html(); |
| | | // var template = Handlebars.compile(tpl); |
| | | // var html = template(res); |
| | | // var box = $("#box"); |
| | | // box.html(html); |
| | | // box.show(); |
| | | var imgUrl; |
| | | // console.log(res.data[0]); |
| | | for (let i=0;i<res.data.length;i++){ |
| | | if (res.data[i].docNum === orderNo){ |
| | | imgUrl = res.data[i]["barcodeUrl"]; |
| | | } |
| | | |
| | | } |
| | | |
| | | var img = '<img className="template-code template-qrcode" src='+imgUrl+' height="80%">' |
| | | layer.open({ |
| | | type: 1, |
| | | title: "拣货单", |
| | | area: '150px', |
| | | content: img |
| | | }) |
| | | |
| | | // box.print({mediaPrint:true}); |
| | | // box.hide(); |
| | | |
| | | } else if (res.code === 403){ |
| | | top.location.href = baseUrl+"/"; |
| | | }else { |
| | | layer.msg(res.msg) |
| | | } |
| | | } |
| | | }) |
| | | } |
| | | |
| | | // 监听头工具栏事件 |
| | | table.on('toolbar(pakout)', function (obj) { |
| | | var checkStatus = table.checkStatus(obj.config.id).data; |
| | |
| | | return d.matnr; |
| | | })); |
| | | break; |
| | | |
| | | case 'exportData': |
| | | admin.confirm('确定导出Excel吗', {shadeClose: true}, function(){ |
| | | var titles=[]; |
| | |
| | | case "del": |
| | | del([data.matnr]); |
| | | break; |
| | | case "wrkTrace": |
| | | btnPrint(data.wrkNo, data.docNum, 4); |
| | | break |
| | | case "look": |
| | | var $a = $(obj.tr).find('a[lay-event="look"]'); |
| | | var offset = $a.offset(); |
| | | var top = offset.top; |
| | | var left = offset.left; |
| | | layer.open({ |
| | | type: 1, |
| | | title: false, |
| | | area: '1200px', |
| | | offset: [top + 'px', (left - 530 + $a.outerWidth()) + 'px'], |
| | | shade: .01, |
| | | shadeClose: true, |
| | | fixed: false, |
| | | content: '<table id="lookSSXMTable" lay-filter="lookSSXMTable"></table>', |
| | | success: function (layero) { |
| | | table.render({ |
| | | elem: '#lookSSXMTable', |
| | | headers: {token: localStorage.getItem('token')}, |
| | | url: baseUrl+'/pakout/list/auth', |
| | | where: { |
| | | doc_num: data.docNum |
| | | }, |
| | | page: true, |
| | | cellMinWidth: 100, |
| | | cols: [[ |
| | | {type: 'numbers'}, |
| | | ,{field: 'id', align: 'center',title: 'id', hide:true} |
| | | ,{field: 'docNum', align: 'center',title: '拣货单号'} |
| | | ,{field: 'locNo', align: 'center',title: '库位'} |
| | | ,{field: 'matnr', align: 'center',title: '物料号'} |
| | | ,{field: 'maktx', align: 'center',title: '商品名称'} |
| | | ,{field: 'anfme', align: 'center',title: '数量'} |
| | | ,{field: 'createTime$', align: 'center',title: '操作时间'} |
| | | ,{field: 'status$', align: 'center',title: '状态'} |
| | | ,{field: 'memo', align: 'center',title: '备注'} |
| | | ,{field: 'createBy', align: 'center',title: '', hide:true} |
| | | ]], |
| | | request: { |
| | | pageName: 'curr', |
| | | pageSize: 'limit' |
| | | }, |
| | | parseData: function (res) { |
| | | return { |
| | | 'code': res.code, |
| | | 'msg': res.msg, |
| | | 'count': res.data.total, |
| | | 'data': res.data.records |
| | | } |
| | | }, |
| | | response: { |
| | | statusCode: 200 |
| | | }, |
| | | done: function () { |
| | | $(layero).find('.layui-table-view').css('margin', '0'); |
| | | }, |
| | | size: '' |
| | | }); |
| | | } |
| | | }); |
| | | } |
| | | }); |
| | | |
| | |
| | | |
| | | }); |
| | | |
| | | |
| | | // 关闭动作 |
| | | $(document).on('click','#data-detail-close', function () { |
| | | parent.layer.closeAll(); |
| | |
| | | <div class="layui-form toolbar" id="search-box"> |
| | | <div class="layui-form-item"> |
| | | <div class="layui-inline"> |
| | | <label class="layui-form-label">编号:</label> |
| | | <label class="layui-form-label">拣货单号:</label> |
| | | <div class="layui-input-inline"> |
| | | <input class="layui-input" type="text" name="id" placeholder="编号" autocomplete="off"> |
| | | <input class="layui-input" type="text" name="doc_num" placeholder="拣货单号" autocomplete="off"> |
| | | </div> |
| | | </div> |
| | | <div class="layui-inline">  |
| | |
| | | |
| | | <script type="text/html" id="toolbar"> |
| | | <div class="layui-btn-container"> |
| | | <button class="layui-btn layui-btn-sm" id="btn-add" lay-event="addData">新增</button> |
| | | <button class="layui-btn layui-btn-sm layui-btn-danger" id="btn-delete" lay-event="deleteData">删除</button> |
| | | <!-- <button class="layui-btn layui-btn-sm" id="btn-add" lay-event="addData">新增</button>--> |
| | | <!-- <button class="layui-btn layui-btn-sm layui-btn-danger" id="btn-delete" lay-event="deleteData">删除</button>--> |
| | | <button class="layui-btn layui-btn-primary layui-btn-sm" id="btn-export" lay-event="exportData" style="float: right">导出</button> |
| | | </div> |
| | | </script> |
| | | |
| | | <script type="text/html" id="orderNoTpl"> |
| | | {{d.docNum}} |
| | | <!-- {{# if(d.settle > 1 && d.settle !== 3){ }}--> |
| | | |
| | | <!-- {{# } }}--> |
| | | <i class="layui-icon layui-icon-about wrk-trace" lay-tips="查看二维码" lay-direction="2" lay-offset="-10px,0px" lay-event="wrkTrace"></i> |
| | | </script> |
| | | <script type="text/html" id="tbLook"> |
| | | <span class="layui-text"> |
| | | <a href="javascript:;" lay-event="look"> |
| | | <i class="layui-icon" style="font-size: 12px;"></i> 查看单据明细 |
| | | </a> |
| | | </span> |
| | | </script> |
| | | |
| | | <script type="text/html" id="operate"> |
| | |
| | | <script type="text/javascript" src="../../static/js/cool.js" charset="utf-8"></script> |
| | | <script type="text/javascript" src="../../static/js/pakout/pakout.js" charset="utf-8"></script> |
| | | </body> |
| | | |
| | | |
| | | <!-- 表单弹窗 --> |
| | | <script type="text/html" id="editDialog"> |
| | | <form id="detail" lay-filter="detail" class="layui-form admin-form model-form"> |