|
|
@@ -469,13 +469,20 @@ const print=(templateCode,code)=>{
|
|
|
showLoading()
|
|
|
fluxPrint(data)
|
|
|
.then(res => {
|
|
|
- scanSuccess()
|
|
|
- showNotify({ type: 'success', duration: 3000, message: '打印已发起,请检查打印情况' });
|
|
|
- printPickingList(code,currPackingList.value)
|
|
|
+ if(res.code==200){
|
|
|
+ scanSuccess()
|
|
|
+ showNotify({ type: 'success', duration: 3000, message: '打印已发起,请检查打印情况' });
|
|
|
+ printPickingList(code,currPackingList.value)
|
|
|
+ }else {
|
|
|
+ scanError()
|
|
|
+ tips.value=res.message || '系统异常,请联系技术支持!'
|
|
|
+ showNotify({ type: 'danger', duration: 3000, message: res.message || '系统异常,请联系技术支持!' });
|
|
|
+ }
|
|
|
})
|
|
|
.catch(err => {
|
|
|
scanError()
|
|
|
tips.value=err.message || '系统异常,请联系技术支持!'
|
|
|
+ showNotify({ type: 'danger', duration: 3000, message: err.message || '系统异常,请联系技术支持!' });
|
|
|
}).finally(() => {
|
|
|
closeLoading()
|
|
|
})
|
|
|
@@ -513,7 +520,8 @@ const printPickingList=(deliveryNo,curPackingList)=> {
|
|
|
code: deliveryNo,
|
|
|
printServer: printMap[0],
|
|
|
printName: printMap[1],
|
|
|
- templateCode: item.templateCode
|
|
|
+ templateCode: item.templateCode,
|
|
|
+ ignoreNoData:item.templateCode
|
|
|
};
|
|
|
const printCount = Math.max(item.printNum, 1)
|
|
|
printData.push(...new Array(printCount).fill(data));
|
|
|
@@ -533,10 +541,18 @@ const printRequests = async(index, dataList)=> {
|
|
|
try {
|
|
|
const res = await _printMode(dataList[index]);
|
|
|
if (res) {
|
|
|
- this.$message.success('打印成功');
|
|
|
+ if(res.code==200){
|
|
|
+ showNotify({ type: 'success', duration: 3000, message: '打印已发起,请检查打印情况' });
|
|
|
+ }else {
|
|
|
+ if(dataList[index].ignoreNoData && dataList[index].ignoreNoData==true && (res.message.includes('打印数据为空') ||res.message.includes('ignoreNoData'))){
|
|
|
+ return
|
|
|
+ }
|
|
|
+ showNotify({ type: 'danger', duration: 3000, message:res.message || '未知系统错误,请联系开发人员' });
|
|
|
+ }
|
|
|
}
|
|
|
} catch (error) {
|
|
|
console.error('打印请求发生错误:', error);
|
|
|
+ showNotify({ type: 'danger', duration: 3000, message: error.message || '系统异常,请联系技术支持!' });
|
|
|
} finally {
|
|
|
closeLoading();
|
|
|
await printRequests(index + 1, dataList);
|