|
@ -28,7 +28,7 @@ |
|
|
|
|
|
|
|
|
<view v-if='allowModifyLocation'> |
|
|
<view v-if='allowModifyLocation'> |
|
|
<uni-combox :candidates="fromLocationList" v-model="fromLocationCode" placeholder="请扫描来源库位" |
|
|
<uni-combox :candidates="fromLocationList" v-model="fromLocationCode" placeholder="请扫描来源库位" |
|
|
@confirm="scanLocation" style='height: 30rpx;border:1px solid #fff ;'></uni-combox> |
|
|
@confirm="" style='height: 30rpx;border:1px solid #fff ;'></uni-combox> |
|
|
</view> |
|
|
</view> |
|
|
<view v-else> |
|
|
<view v-else> |
|
|
<text style="padding: 5px"> |
|
|
<text style="padding: 5px"> |
|
@ -122,7 +122,8 @@ |
|
|
businessType: {}, |
|
|
businessType: {}, |
|
|
inventoryStatus: [], |
|
|
inventoryStatus: [], |
|
|
managementPrecision: '', |
|
|
managementPrecision: '', |
|
|
fromInventoryStatuses: "" |
|
|
fromInventoryStatuses: "", |
|
|
|
|
|
isCheck:false |
|
|
} |
|
|
} |
|
|
}, |
|
|
}, |
|
|
created() { |
|
|
created() { |
|
@ -168,20 +169,30 @@ |
|
|
this.$emit("close", ''); |
|
|
this.$emit("close", ''); |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
scanLocation() { |
|
|
|
|
|
|
|
|
scanLocation(scanResult) { |
|
|
|
|
|
var isCheck = false; |
|
|
if (this.fromLocationCode == '') { |
|
|
if (this.fromLocationCode == '') { |
|
|
this.showMessage('来源库位不能为空', callback => { |
|
|
this.showErrorMessage('来源库位不能为空', callback => { |
|
|
this.locationGetFocus(); |
|
|
this.locationGetFocus(); |
|
|
}) |
|
|
}) |
|
|
return; |
|
|
return; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if(this.fromLocationList.length>0){ |
|
|
|
|
|
if(!this.isInLocationList(this.fromLocationCode)){ |
|
|
|
|
|
this.showErrorMessage("扫描库位【"+this.fromLocationCode+'】不在任务来源库位中', callback => { |
|
|
|
|
|
this.locationGetFocus(); |
|
|
|
|
|
}) |
|
|
|
|
|
return; |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
uni.showLoading({ |
|
|
uni.showLoading({ |
|
|
title: '扫描中...', |
|
|
title: '扫描中...', |
|
|
mask: true |
|
|
mask: true |
|
|
}); |
|
|
}); |
|
|
getBasicLocationByCode(this.fromLocationCode).then(res => { |
|
|
getBasicLocationByCode(this.fromLocationCode).then(res => { |
|
|
uni.hideLoading(); |
|
|
|
|
|
if (res.data.total > 0) { |
|
|
if (res.data.total > 0) { |
|
|
let result = res.data.list[0]; |
|
|
let result = res.data.list[0]; |
|
|
var type = result.type; |
|
|
var type = result.type; |
|
@ -189,8 +200,10 @@ |
|
|
if (available == "TRUE") { |
|
|
if (available == "TRUE") { |
|
|
if (checkDirectoryItemExist(this.fromLocationTypeArray, type)) { |
|
|
if (checkDirectoryItemExist(this.fromLocationTypeArray, type)) { |
|
|
this.location = result; |
|
|
this.location = result; |
|
|
this.packGetFocus(); |
|
|
// this.packGetFocus(); |
|
|
|
|
|
this.checkPackage(scanResult); |
|
|
} else { |
|
|
} else { |
|
|
|
|
|
uni.hideLoading(); |
|
|
var hint = getListLocationTypeDesc(this.fromLocationTypeArray); |
|
|
var hint = getListLocationTypeDesc(this.fromLocationTypeArray); |
|
|
this.showErrorMessage("库位[" + this.fromLocationCode + "]是" + |
|
|
this.showErrorMessage("库位[" + this.fromLocationCode + "]是" + |
|
|
getLocationTypeName(type) + ",<br>需要的库位类型是[" + hint + "]", callback => { |
|
|
getLocationTypeName(type) + ",<br>需要的库位类型是[" + hint + "]", callback => { |
|
@ -198,11 +211,13 @@ |
|
|
}) |
|
|
}) |
|
|
} |
|
|
} |
|
|
} else { |
|
|
} else { |
|
|
|
|
|
uni.hideLoading(); |
|
|
this.showErrorMessage("扫描库位[" + this.fromLocationCode + "]不可用", res => { |
|
|
this.showErrorMessage("扫描库位[" + this.fromLocationCode + "]不可用", res => { |
|
|
this.locationGetFocus(); |
|
|
this.locationGetFocus(); |
|
|
}) |
|
|
}) |
|
|
} |
|
|
} |
|
|
} else { |
|
|
} else { |
|
|
|
|
|
uni.hideLoading(); |
|
|
this.showErrorMessage('未查询到库位[' + this.fromLocationCode + ']', res => { |
|
|
this.showErrorMessage('未查询到库位[' + this.fromLocationCode + ']', res => { |
|
|
this.locationGetFocus(); |
|
|
this.locationGetFocus(); |
|
|
}) |
|
|
}) |
|
@ -215,36 +230,45 @@ |
|
|
}) |
|
|
}) |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
getScanResult(result) { |
|
|
getScanResult(result) { |
|
|
console.log("扫描", result) |
|
|
// console.log("扫描", result) |
|
|
if (this.fromLocationCode == '' || this.fromLocationCode == null) { |
|
|
// if (this.fromLocationCode == '' || this.fromLocationCode == null) { |
|
|
this.showMessage('请先扫描来源库位', callback => { |
|
|
// this.showMessage('请先扫描来源库位', callback => { |
|
|
this.locationGetFocus(); |
|
|
// this.locationGetFocus(); |
|
|
}) |
|
|
// }) |
|
|
return; |
|
|
// return; |
|
|
} else { |
|
|
// } else |
|
|
if (result.label != null) { |
|
|
this.scanLocation(result); |
|
|
this.scanResult = result; |
|
|
// debugger |
|
|
// uni.showLoading({ |
|
|
// if(this.isCheck){ |
|
|
// title: '查询中...', |
|
|
// this.checkPackage(result); |
|
|
// mask: true |
|
|
// } |
|
|
// }) |
|
|
}, |
|
|
getBalanceByManagementPrecision(result.label, this.fromLocationCode, this.fromInventoryStatuses, |
|
|
|
|
|
res => { |
|
|
checkPackage(result){ |
|
|
if (res.success) { |
|
|
if (result.label != null) { |
|
|
this.managementPrecision = res.managementPrecision |
|
|
this.scanResult = result; |
|
|
this.afterQueryBalance(res.data.list); |
|
|
// uni.showLoading({ |
|
|
} else { |
|
|
// title: '查询中...', |
|
|
this.showErrorMessage(res.message, res => { |
|
|
// mask: true |
|
|
this.packGetFocus(); |
|
|
// }) |
|
|
}) |
|
|
getBalanceByManagementPrecision(result.label, this.fromLocationCode, this.fromInventoryStatuses, |
|
|
} |
|
|
res => { |
|
|
// uni.hideLoading(); |
|
|
uni.hideLoading(); |
|
|
}); |
|
|
if (res.success) { |
|
|
} |
|
|
this.managementPrecision = res.managementPrecision |
|
|
|
|
|
this.afterQueryBalance(res.data.list); |
|
|
|
|
|
} else { |
|
|
|
|
|
this.showErrorMessage(res.message, res => { |
|
|
|
|
|
this.packGetFocus(); |
|
|
|
|
|
}) |
|
|
|
|
|
} |
|
|
|
|
|
// uni.hideLoading(); |
|
|
|
|
|
}); |
|
|
} |
|
|
} |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
afterQueryBalance(datas) { |
|
|
afterQueryBalance(datas) { |
|
|
if (this.allowNullBalance) { |
|
|
if (this.allowNullBalance) { |
|
|
this.allowNoneBalance(datas); |
|
|
this.allowNoneBalance(datas); |
|
@ -401,6 +425,20 @@ |
|
|
change(e) { |
|
|
change(e) { |
|
|
this.show = e.show |
|
|
this.show = e.show |
|
|
}, |
|
|
}, |
|
|
|
|
|
isInLocationList(location) { |
|
|
|
|
|
var item = this.fromLocationList.filter(res => { |
|
|
|
|
|
res = location |
|
|
|
|
|
}) |
|
|
|
|
|
if (item != undefined && item.length > 0) { |
|
|
|
|
|
return true |
|
|
|
|
|
} |
|
|
|
|
|
return false |
|
|
|
|
|
}, |
|
|
|
|
|
addLocationCode(code) { |
|
|
|
|
|
if (!this.isInLocationList(code)) { |
|
|
|
|
|
this.fromLocationList.push(code) |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
</script> |
|
|
</script> |
|
|