|
|
|
|
@ -816,23 +816,20 @@ export default {
|
|
|
|
|
const _that = this;
|
|
|
|
|
// #ifdef H5
|
|
|
|
|
// 扫码识别配送单
|
|
|
|
|
// _that.itemList.deliveryNo="GJ2602000001"; // GJ2602000002 20260100024 20260100025
|
|
|
|
|
// _that.getPsDetail();
|
|
|
|
|
this.scantype = 1; // 配送单扫码
|
|
|
|
|
// this.$refs.scan.showScan();
|
|
|
|
|
this.$refs.scan.start({
|
|
|
|
|
success: (val, res)=> {
|
|
|
|
|
console.log('扫描成功',val,res);
|
|
|
|
|
if(_that.scantype==2){
|
|
|
|
|
_that.palletNo=val;
|
|
|
|
|
_that.$forceUpdate();
|
|
|
|
|
_that.getPalletDetail();
|
|
|
|
|
}
|
|
|
|
|
else{
|
|
|
|
|
_that.itemList.deliveryNo=val; // GJ2602000002 20260100024 20260100025
|
|
|
|
|
_that.$forceUpdate();
|
|
|
|
|
_that.getPsDetail();
|
|
|
|
|
}
|
|
|
|
|
console.log('扫描成功',val,res);
|
|
|
|
|
if(_that.scantype==2){
|
|
|
|
|
_that.palletNo=val;
|
|
|
|
|
_that.$forceUpdate();
|
|
|
|
|
_that.getPalletDetail();
|
|
|
|
|
}
|
|
|
|
|
else{
|
|
|
|
|
_that.itemList.deliveryNo=val; // GJ2602000002 20260100024 20260100025
|
|
|
|
|
_that.$forceUpdate();
|
|
|
|
|
_that.getPsDetail();
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
fail: (rej)=>{
|
|
|
|
|
console.log('扫描失败',rej);
|
|
|
|
|
@ -893,8 +890,7 @@ export default {
|
|
|
|
|
if(res.data)
|
|
|
|
|
{
|
|
|
|
|
this.expanded=true;
|
|
|
|
|
this.palletAll=res.data;
|
|
|
|
|
this.pallet=res.data.pallet;
|
|
|
|
|
|
|
|
|
|
// 散装管件列表
|
|
|
|
|
this.otherinfo=res.data.other&&res.data.other.length>0?res.data.other:[];
|
|
|
|
|
this.instList = this.otherinfo.map(item => ({
|
|
|
|
|
@ -910,50 +906,6 @@ export default {
|
|
|
|
|
})
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 配送单号deliveryNo、工程编号project、制作图号dwgno、托盘表号instno、数量qty(合计)、
|
|
|
|
|
// 需求单位requireDepartCode、配送地址requireAddress、联系人(联系人requireName+‘ ‘+联系电话requirePhone)、
|
|
|
|
|
// 配送日期deliveryDate、配送车辆deliveryCar;(显示信息取第一条数据即可(每个配送单中的上述信息一致),数量需合计)
|
|
|
|
|
var firstpallet=this.pallet.length>0?this.pallet[0]:(this.otherinfo.length>0?this.otherinfo[0]:null);
|
|
|
|
|
if(!firstpallet){
|
|
|
|
|
this.$refs.uToast.show({
|
|
|
|
|
title: "配送单【"+this.itemList.deliveryNo+"】暂无托盘明细信息!\n 请重新扫码!",
|
|
|
|
|
type: "warning",
|
|
|
|
|
duration: 2000,
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
// 工程编号project
|
|
|
|
|
this.itemList.project=firstpallet?firstpallet.project:'';
|
|
|
|
|
// 制作图号dwgno
|
|
|
|
|
this.itemList.dwgno=firstpallet?firstpallet.dwgno:'';
|
|
|
|
|
// 托盘表号instno
|
|
|
|
|
this.itemList.instno=firstpallet?firstpallet.instno:'';
|
|
|
|
|
// 数量qty(合计)
|
|
|
|
|
// var qty=0;
|
|
|
|
|
// this.pallet.forEach(item=>{
|
|
|
|
|
// qty=qty+(item.qty?1.0*item.qty:0);
|
|
|
|
|
// });
|
|
|
|
|
// this.otherinfo.forEach(item=>{
|
|
|
|
|
// qty=qty+(item.qty?1.0*item.qty:0);
|
|
|
|
|
// });
|
|
|
|
|
//this.itemList.qty=qty.toFixed(2);
|
|
|
|
|
// 需求单位requireDepartCode
|
|
|
|
|
this.itemList.requireDepartCode=firstpallet?firstpallet.requireDepartCode:'';
|
|
|
|
|
// 配送地址requireAddress
|
|
|
|
|
this.itemList.requireAddress=firstpallet?firstpallet.requireAddress:'';
|
|
|
|
|
// 联系人(联系人requireName+‘ ‘+联系电话requirePhone)
|
|
|
|
|
this.itemList.requireName=firstpallet?firstpallet.requireName:''+' '+firstpallet?firstpallet.requirePhone:'';
|
|
|
|
|
// 配送日期deliveryDate
|
|
|
|
|
this.itemList.deliveryDate=firstpallet?firstpallet.deliveryDate:'';
|
|
|
|
|
// 配送车辆deliveryCar
|
|
|
|
|
this.itemList.deliveryCar=firstpallet?firstpallet.deliveryCar:'';
|
|
|
|
|
|
|
|
|
|
// var pallets = res.data.pallet&&res.data.pallet.length>0?res.data.pallet:[];
|
|
|
|
|
// this.palletData = pallets.map(item => ({
|
|
|
|
|
// ...item,
|
|
|
|
|
// isOpen: true,
|
|
|
|
|
// checked:true
|
|
|
|
|
// }));
|
|
|
|
|
this.$forceUpdate();
|
|
|
|
|
this.getByDelivery();
|
|
|
|
|
}
|
|
|
|
|
@ -991,11 +943,11 @@ export default {
|
|
|
|
|
const {data: res} = await uni.$http.get('/getDetailByDelivery',{deliveryNo:this.itemList.deliveryNo});
|
|
|
|
|
if(res.success){
|
|
|
|
|
if(res.data){
|
|
|
|
|
|
|
|
|
|
// 托盘列表信息
|
|
|
|
|
var pallets = res.data;
|
|
|
|
|
// 有托盘
|
|
|
|
|
var palletDetails = pallets.palletDetails?pallets.palletDetails:[];
|
|
|
|
|
this.palletData=[];
|
|
|
|
|
console.log(palletDetails)
|
|
|
|
|
palletDetails.forEach((item,index)=>{
|
|
|
|
|
item["checked"]=true;
|
|
|
|
|
var findx = this.palletData.findIndex(cell => item.palletNo === cell.palletNo);
|
|
|
|
|
@ -1028,8 +980,9 @@ export default {
|
|
|
|
|
|
|
|
|
|
// 无托盘
|
|
|
|
|
var noPalletDetails = pallets.noPalletDetails?pallets.noPalletDetails:[];
|
|
|
|
|
//配送单配送管件数量
|
|
|
|
|
this.itemList.qty=palletDetails.length+noPalletDetails.length
|
|
|
|
|
//配送单配送管件数量
|
|
|
|
|
this.itemList.qty=palletDetails.length+noPalletDetails.length
|
|
|
|
|
|
|
|
|
|
noPalletDetails.forEach((item,index)=>{
|
|
|
|
|
item["checked"]=true;
|
|
|
|
|
var findx = this.palletData.findIndex(cell => item.palletNo === cell.palletNo);
|
|
|
|
|
@ -1059,11 +1012,38 @@ export default {
|
|
|
|
|
this.$forceUpdate();
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
// this.palletData = pallets.map(item => ({
|
|
|
|
|
// ...item,
|
|
|
|
|
// isOpen: true,
|
|
|
|
|
// checked:true
|
|
|
|
|
// }));
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
this.palletAll=res.data;
|
|
|
|
|
this.pallet=res.data.palletDetails;
|
|
|
|
|
// 配送单号deliveryNo、工程编号project、制作图号dwgno、托盘表号instno、数量qty(合计)、
|
|
|
|
|
// 需求单位requireDepartCode、配送地址requireAddress、联系人(联系人requireName+‘ ‘+联系电话requirePhone)、
|
|
|
|
|
// 配送日期deliveryDate、配送车辆deliveryCar;(显示信息取第一条数据即可(每个配送单中的上述信息一致),数量需合计)
|
|
|
|
|
var firstpallet=this.pallet.length>0?this.pallet[0]:(noPalletDetails.length>0?noPalletDetails[0]:null);
|
|
|
|
|
if(!firstpallet){
|
|
|
|
|
this.$refs.uToast.show({
|
|
|
|
|
title: "配送单【"+this.itemList.deliveryNo+"】暂无托盘明细信息!\n 请重新扫码!",
|
|
|
|
|
type: "warning",
|
|
|
|
|
duration: 2000,
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
// 工程编号project
|
|
|
|
|
this.itemList.project=firstpallet?firstpallet.project:'';
|
|
|
|
|
// 制作图号dwgno
|
|
|
|
|
this.itemList.dwgno=firstpallet?firstpallet.dwgno:'';
|
|
|
|
|
// 托盘表号instno
|
|
|
|
|
this.itemList.instno=firstpallet?firstpallet.instno:'';
|
|
|
|
|
// 需求单位requireDepartCode
|
|
|
|
|
this.itemList.requireDepartCode=firstpallet?firstpallet.requireDepartCode:'';
|
|
|
|
|
// 配送地址requireAddress
|
|
|
|
|
this.itemList.requireAddress=firstpallet?firstpallet.requireAddress:'';
|
|
|
|
|
// 联系人(联系人requireName+‘ ‘+联系电话requirePhone)
|
|
|
|
|
this.itemList.requireName=firstpallet?firstpallet.requireName:''+' '+firstpallet?firstpallet.requirePhone:'';
|
|
|
|
|
// 配送日期deliveryDate
|
|
|
|
|
this.itemList.deliveryDate=firstpallet?firstpallet.deliveryDate:'';
|
|
|
|
|
// 配送车辆deliveryCar
|
|
|
|
|
this.itemList.deliveryCar=firstpallet?firstpallet.deliveryCar:'';
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
console.log(this.palletData)
|
|
|
|
|
}
|
|
|
|
|
|