async sacnOrder(){
uni.scanCode({
scanType: ['barCode'],
success:(async(res) => {
console.log('条码类型:'+res.scanType);
console.log('条码内容:'+res.result);
this.orderNo = res.result;
res = await this.$myRequest({
url:'/***/tmsApp/queryOrder',
data:{
orderNo:this.orderNo
},
method:'GET'
})
var item = res.data.data.receiptDTO;
if(item == undefined){
uni.showToast({
title:'未查询到此送货单',
icon:"none"
})
return
}
var flag = 0;
let swipeList = this.swipeList;
if(swipeList !==undefined && swipeList.length > 0 ){
swipeList.forEach(item1 =>{
if(item1.id == item.id ){
flag = 1;
}
})
}
if(flag == 1){
uni.showToast({
title:'此送货单已扫描',
icon:"none"
})
return
}
let key = "options";
let value = [
{
text: '删除',
style: {
backgroundColor: 'rgb(255,58,49)'
}
}
];
item[key] = value;
let date = new Date();
let dateNew = this.dateFormat("YYYYmmddHHMM", date)
console.log('扫描一维码,时间查看'+JSON.stringify(dateNew));
item["inCarStartDate"] = dateNew;
this.swipeList.push(item);
var trayN = parseInt(this.trayAllNum);
this.orderAllNum = this.swipeList.length;
this.trayAllNum = trayN+parseInt(item.tray);
console.log("result:"+JSON.stringify(swipeList, null, 2));
}),
})
},
0 个回复