扫描提醒优化

This commit is contained in:
wuteng 2026-01-16 17:05:05 +08:00
parent 3a12613cd6
commit a596fd8944

View File

@ -420,27 +420,32 @@ export default {
// 检查 // 检查
let scanInfo = {scanType:"20",opType:2,scanData:scanData, blLastTrack:this.blLastTrack?1:0} let scanInfo = {scanType:"20",opType:2,scanData:scanData, blLastTrack:this.blLastTrack?1:0}
let count = 0;
doScan(scanInfo).then(response => { doScan(scanInfo).then(response => {
console.log(response);
let scanRstItem = response.data.scanResult[0]; let scanRstItem = response.data.scanResult[0];
console.log(scanRstItem); let scanRstItems = response.data.scanResult;
if(scanRstItem.result != 'success'){ // if(scanRstItem.result != 'success'){
this.$modal.msgError(scanRstItem.message); // this.$modal.msgError(scanRstItem.message);
return; // return;
} // }
let newList = []; let newList = [];
this.emisTmsScanRecordList.forEach(item => { this.emisTmsScanRecordList.forEach(item => {
if(this.ids.indexOf(item.billCode) > -1){ // item.billcode 在 scanResultItem 里面result 不是成功 就加入newList
this.dataMap[item.billCode]=null; let scanRstItemResult = scanRstItems.find(scanRstItem => scanRstItem.billCode == item.billCode);
}else{ if (scanRstItemResult.result != 'success') {
if (count == 0) {
this.$modal.msgError(scanRstItem.message);
}
count++;
newList.push(item); newList.push(item);
} }
}) })
this.ids = []; this.ids = [];
this.selection = null; this.selection = null;
this.emisTmsScanRecordList = newList; this.emisTmsScanRecordList = newList;
this.$modal.msgSuccess(scanRstItem.message); if(newList.length == 0){ // 所有都成功
this.$modal.msgSuccess("上传成功");
}
}); });