|
|
@@ -4136,35 +4136,35 @@
|
|
|
console.log(workData)
|
|
|
const data = getDocumentInfos.data
|
|
|
if(workData.value.liucheng_total=== '' || workData.value.liucheng_total === null){
|
|
|
- ElMessage({type: 'warning',message: '总流程不能玩为空'})
|
|
|
+ ElMessage({type: 'warning',message: '总流程不能为空'})
|
|
|
return false;
|
|
|
}
|
|
|
+ console.log(workData.value.start_liucheng)//这个是1
|
|
|
+ console.log(workData.value.liucheng_total)//这个是2 就是打印两次
|
|
|
+
|
|
|
|
|
|
for (let i = workData.value.start_liucheng; i <= workData.value.liucheng_total; i++) {
|
|
|
- const printdata = {
|
|
|
- "scpch": getDocumentInfos.data[0].Gd_gdbh,
|
|
|
- "xsddh": getDocumentInfos.data[0].销售订单号.split(' ')[1],
|
|
|
- "mbh": getDocumentInfos.data[0].mabao,
|
|
|
- "lcdh": `${workData.value.liucheng_total}-${i}`,
|
|
|
- "qrcode": `${getDocumentInfos.data[0].Gd_gdbh}-${workData.value.liucheng_total}-${i}`,
|
|
|
- "gdsm": getDocumentInfos.data[0].technique_sequence,
|
|
|
- "cpmc": getDocumentInfos.data[0].Gd_cpmc,
|
|
|
- "ztzs": workData.value.num,
|
|
|
- 'table': getDocumentInfos.data.gy_data.map(item=>({
|
|
|
- gxmc:item
|
|
|
- }))
|
|
|
- }
|
|
|
+ ((i) => {
|
|
|
+ const printdata = {
|
|
|
+ "scpch": getDocumentInfos.data[0].Gd_gdbh,
|
|
|
+ "xsddh": getDocumentInfos.data[0].销售订单号.split(' ')[1],
|
|
|
+ "mbh": getDocumentInfos.data[0].mabao,
|
|
|
+ "lcdh": `${workData.value.liucheng_total}-${i}`,
|
|
|
+ "qrcode": `${getDocumentInfos.data[0].Gd_gdbh}-${workData.value.liucheng_total}-${i}`,
|
|
|
+ "gdsm": getDocumentInfos.data[0].technique_sequence,
|
|
|
+ "cpmc": getDocumentInfos.data[0].Gd_cpmc,
|
|
|
+ "ztzs": workData.value.num,
|
|
|
+ 'table': getDocumentInfos.data.gy_data.map(item => ({
|
|
|
+ gxmc: item
|
|
|
+ }))
|
|
|
+ };
|
|
|
|
|
|
+ hiprintTemplate.print2(printdata);
|
|
|
+ // hiprintTemplate.toPdf(printdata,'流程单');
|
|
|
+ })(i);
|
|
|
+ }
|
|
|
|
|
|
- console.log(printdata); // 输出数据查看
|
|
|
|
|
|
- try {
|
|
|
- hiprintTemplate.print2(printdata); // 尝试打印
|
|
|
- // hiprintTemplate.toPdf(printdata, '流程单');
|
|
|
- } catch (error) {
|
|
|
- console.error('打印出错:', error); // 打印错误日志
|
|
|
- }
|
|
|
- }
|
|
|
|
|
|
|
|
|
// for (let i = workData.value.start_liucheng; i <= workData.value.liucheng_total; i++) {
|
|
|
@@ -4183,10 +4183,9 @@
|
|
|
// }))
|
|
|
// }
|
|
|
//
|
|
|
- // // console.log(printdata)
|
|
|
- // hiprintTemplate.print(printdata);
|
|
|
- // // hiprintTemplate.print2(printdata);
|
|
|
- // hiprintTemplate.toPdf(printdata,'流程单');
|
|
|
+ // // hiprintTemplate.print(printdata);
|
|
|
+ // hiprintTemplate.print2(printdata);
|
|
|
+ // // hiprintTemplate.toPdf(printdata,'流程单');
|
|
|
// }
|
|
|
|
|
|
// const printdata = {
|