| | |
| | | var admin; |
| | | var areas; |
| | | var matXmSelect; |
| | | var printContent = []; |
| | | layui.config({ |
| | | base: baseUrl + "/static/layui/lay/modules/" |
| | | }).extend({ |
| | |
| | | }); |
| | | doDel({ids: ids}); |
| | | } else if (obj.event === 'printBatch') { |
| | | printContent = []; |
| | | if (checkRows.length === 0) { |
| | | layer.msg('请选择要打印的数据', {icon: 2}); |
| | | return; |
| | | } |
| | | var printContent = checkRows.map(function (d) { |
| | | printContent = checkRows.map(function (d) { |
| | | if (!d.LAY_INDETERMINATE && d.type === 3) { |
| | | return d.name; |
| | | } else { |
| | | return null; |
| | | } |
| | | }); |
| | | printBatch(printContent, 1); |
| | | layer.open({ |
| | | type: 1, |
| | | title: '批量打印 [数量'+ printContent.length +']', |
| | | area: ['500px'], |
| | | shadeClose: true, |
| | | content: $('#printDataDiv'), |
| | | success: function(layero, index){ |
| | | }, |
| | | end: function () { |
| | | } |
| | | }); |
| | | |
| | | |
| | | //printBatch(printContent, 1); |
| | | }else if (obj.event === 'nodeInit'){ |
| | | nodeInit(); |
| | | } |
| | |
| | | } else if (obj.event === 'del') { // 删除 |
| | | doDel(obj); |
| | | } |
| | | }); |
| | | |
| | | // 模板选择 |
| | | form.on('radio(selectTemplateRadio)', function (data) { |
| | | $('.template-preview').hide(); |
| | | $('#template-preview-'+data.value).show(); |
| | | }); |
| | | |
| | | /* 显示表单弹窗 */ |
| | |
| | | |
| | | // 批量打印 |
| | | function printBatch(printMsgList, type) { |
| | | |
| | | var data = []; |
| | | for (var i = 0; i<printMsgList.length; i ++) { |
| | | if (printMsgList[i] != null && printMsgList[i] !== '') { |
| | | var barcodeUrl; |
| | | if (type === 1) { |
| | | barcodeUrl = baseUrl+"/barcode/qrcode/auth?type="+type+"¶m="+printMsgList[i]+"&width="+200+"&height="+70; |
| | | barcodeUrl = baseUrl+"/mac/code/auth?type="+type+"¶m="+printMsgList[i]+"&width="+200+"&height="+70; |
| | | } else { |
| | | barcodeUrl = baseUrl+"/barcode/qrcode/auth?type="+type+"¶m="+printMsgList[i]+"&width="+400+"&height="+180; |
| | | barcodeUrl = baseUrl+"/mac/code/auth?type="+type+"¶m="+printMsgList[i]+"&width="+400+"&height="+180; |
| | | } |
| | | data.push({ |
| | | item: printMsgList[i], |
| | |
| | | box.hide(); |
| | | } |
| | | |
| | | // 开始打印 |
| | | form.on('submit(doPrint)', function (data) { |
| | | var templateNo = data.field.selectTemplate; |
| | | var data = []; |
| | | var type = 1; |
| | | for (var i = 0; i<printContent.length; i ++) { |
| | | if (printContent[i] != null && printContent[i] !== '') { |
| | | var barcodeUrl; |
| | | if (type === 1) { |
| | | barcodeUrl = baseUrl+"/mac/code/auth?type="+type+"¶m="+printContent[i]+"&width="+200+"&height="+70; |
| | | } else { |
| | | barcodeUrl = baseUrl+"/mac/code/auth?type="+type+"¶m="+printContent[i]+"&width="+400+"&height="+180; |
| | | } |
| | | data.push({ |
| | | item: printContent[i], |
| | | barcodeUrl: barcodeUrl |
| | | }) |
| | | } |
| | | } |
| | | var templateDom = $("#templatePreview"+templateNo); |
| | | var tpl = templateDom.html(); |
| | | var template = Handlebars.compile(tpl); |
| | | var html = template({data: data}); |
| | | var box = $("#box"); |
| | | box.html(html); |
| | | box.show(); |
| | | box.print({mediaPrint:true}); |
| | | box.hide(); |
| | | }); |
| | | |
| | | |
| | | function nodeInit(){ |
| | | layer.prompt({title: '请输入口令,并重置库位', formType: 1, shadeClose: true}, function(pass, idx){ |