Browse Source

修改扫描库位和箱码

wms3.0_pda
lijuncheng 10 months ago
parent
commit
d86546561d
  1. 104
      mycomponents/scan/winScanPackAndLocation.vue
  2. 5
      pages/deliver/job/deliverDetail.vue
  3. 2
      pages/purchaseReturn/record/returnRecord.vue

104
mycomponents/scan/winScanPackAndLocation.vue

@ -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>

5
pages/deliver/job/deliverDetail.vue

@ -224,7 +224,7 @@
}) })
//使 //使
if (this.jobContent.useOnTheWayLocation == 'TRUE') { if (locationCode == null) {
this.submitJob(); this.submitJob();
} else { } else {
// //
@ -280,8 +280,7 @@
record.supplierCode = r.supplierCode; record.supplierCode = r.supplierCode;
//使 //使
if (this.jobContent.useOnTheWayLocation == if (this.toLocationCode ==null) {
'TRUE') {
record.toPackingNumber = r record.toPackingNumber = r
.packingNumber; .packingNumber;
record.toBatch = r.batch; record.toBatch = r.batch;

2
pages/purchaseReturn/record/returnRecord.vue

@ -286,7 +286,7 @@
submitItem.fromBatch = detail.batch; submitItem.fromBatch = detail.batch;
submitItem.toBatch = detail.batch; submitItem.toBatch = detail.batch;
submitItem.fromLocationCode = this.fromLocationCode; submitItem.fromLocationCode = detail.locationCode;
submitItem.toLocationCode = ''; //退 submitItem.toLocationCode = ''; //退
submitItem.qty = detail.handleQty; submitItem.qty = detail.handleQty;

Loading…
Cancel
Save