From 7e17a4a7affec26462cdeb66087be4da9b3c6590 Mon Sep 17 00:00:00 2001
From: zhangc <zc@123>
Date: 星期一, 09 十二月 2024 08:49:31 +0800
Subject: [PATCH] Generating...
---
src/main/webapp/static/js/node/node.js | 56 ++++++++++++++++++++++++++++++++++++++++++++++++++++++--
1 files changed, 54 insertions(+), 2 deletions(-)
diff --git a/src/main/webapp/static/js/node/node.js b/src/main/webapp/static/js/node/node.js
index ac5aaf8..de3d782 100644
--- a/src/main/webapp/static/js/node/node.js
+++ b/src/main/webapp/static/js/node/node.js
@@ -2,6 +2,7 @@
var admin;
var areas;
var matXmSelect;
+var printContent = [];
layui.config({
base: baseUrl + "/static/layui/lay/modules/"
}).extend({
@@ -77,18 +78,32 @@
});
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();
}
@@ -101,6 +116,12 @@
} else if (obj.event === 'del') { // 鍒犻櫎
doDel(obj);
}
+ });
+
+ // 妯℃澘閫夋嫨
+ form.on('radio(selectTemplateRadio)', function (data) {
+ $('.template-preview').hide();
+ $('#template-preview-'+data.value).show();
});
/* 鏄剧ず琛ㄥ崟寮圭獥 */
@@ -201,6 +222,7 @@
// 鎵归噺鎵撳嵃
function printBatch(printMsgList, type) {
+
var data = [];
for (var i = 0; i<printMsgList.length; i ++) {
if (printMsgList[i] != null && printMsgList[i] !== '') {
@@ -226,6 +248,36 @@
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){
--
Gitblit v1.9.1