diff --git a/mycomponents/scan/winScanPackAndLocation.vue b/mycomponents/scan/winScanPackAndLocation.vue
index 536b7969..5b653c14 100644
--- a/mycomponents/scan/winScanPackAndLocation.vue
+++ b/mycomponents/scan/winScanPackAndLocation.vue
@@ -28,7 +28,7 @@
+ @confirm="" style='height: 30rpx;border:1px solid #fff ;'>
@@ -122,7 +122,8 @@
businessType: {},
inventoryStatus: [],
managementPrecision: '',
- fromInventoryStatuses: ""
+ fromInventoryStatuses: "",
+ isCheck:false
}
},
created() {
@@ -168,20 +169,30 @@
this.$emit("close", '');
},
- scanLocation() {
+
+ scanLocation(scanResult) {
+ var isCheck = false;
if (this.fromLocationCode == '') {
- this.showMessage('来源库位不能为空', callback => {
+ this.showErrorMessage('来源库位不能为空', callback => {
this.locationGetFocus();
})
return;
}
+
+ if(this.fromLocationList.length>0){
+ if(!this.isInLocationList(this.fromLocationCode)){
+ this.showErrorMessage("扫描库位【"+this.fromLocationCode+'】不在任务来源库位中', callback => {
+ this.locationGetFocus();
+ })
+ return;
+ }
+ }
uni.showLoading({
title: '扫描中...',
mask: true
});
getBasicLocationByCode(this.fromLocationCode).then(res => {
- uni.hideLoading();
if (res.data.total > 0) {
let result = res.data.list[0];
var type = result.type;
@@ -189,8 +200,10 @@
if (available == "TRUE") {
if (checkDirectoryItemExist(this.fromLocationTypeArray, type)) {
this.location = result;
- this.packGetFocus();
+ // this.packGetFocus();
+ this.checkPackage(scanResult);
} else {
+ uni.hideLoading();
var hint = getListLocationTypeDesc(this.fromLocationTypeArray);
this.showErrorMessage("库位[" + this.fromLocationCode + "]是" +
getLocationTypeName(type) + ",
需要的库位类型是[" + hint + "]", callback => {
@@ -198,11 +211,13 @@
})
}
} else {
+ uni.hideLoading();
this.showErrorMessage("扫描库位[" + this.fromLocationCode + "]不可用", res => {
this.locationGetFocus();
})
}
} else {
+ uni.hideLoading();
this.showErrorMessage('未查询到库位[' + this.fromLocationCode + ']', res => {
this.locationGetFocus();
})
@@ -215,36 +230,45 @@
})
},
- getScanResult(result) {
- console.log("扫描", result)
- if (this.fromLocationCode == '' || this.fromLocationCode == null) {
- this.showMessage('请先扫描来源库位', callback => {
- this.locationGetFocus();
- })
- return;
- } else {
- if (result.label != null) {
- this.scanResult = result;
- // uni.showLoading({
- // title: '查询中...',
- // mask: true
- // })
- getBalanceByManagementPrecision(result.label, this.fromLocationCode, this.fromInventoryStatuses,
- res => {
- if (res.success) {
- this.managementPrecision = res.managementPrecision
- this.afterQueryBalance(res.data.list);
- } else {
- this.showErrorMessage(res.message, res => {
- this.packGetFocus();
- })
- }
- // uni.hideLoading();
- });
- }
+ getScanResult(result) {
+ // console.log("扫描", result)
+ // if (this.fromLocationCode == '' || this.fromLocationCode == null) {
+ // this.showMessage('请先扫描来源库位', callback => {
+ // this.locationGetFocus();
+ // })
+ // return;
+ // } else
+ this.scanLocation(result);
+ // debugger
+ // if(this.isCheck){
+ // this.checkPackage(result);
+ // }
+ },
+
+ checkPackage(result){
+ if (result.label != null) {
+ this.scanResult = result;
+ // uni.showLoading({
+ // title: '查询中...',
+ // mask: true
+ // })
+ getBalanceByManagementPrecision(result.label, this.fromLocationCode, this.fromInventoryStatuses,
+ res => {
+ 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) {
if (this.allowNullBalance) {
this.allowNoneBalance(datas);
@@ -401,6 +425,20 @@
change(e) {
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)
+ }
+ }
}
}
diff --git a/pages/deliver/job/deliverDetail.vue b/pages/deliver/job/deliverDetail.vue
index 3bd38488..4af0b5ee 100644
--- a/pages/deliver/job/deliverDetail.vue
+++ b/pages/deliver/job/deliverDetail.vue
@@ -224,7 +224,7 @@
})
//使用在途库,不查询管理模式
- if (this.jobContent.useOnTheWayLocation == 'TRUE') {
+ if (locationCode == null) {
this.submitJob();
} else {
//获取管理模式,封装参数
@@ -280,8 +280,7 @@
record.supplierCode = r.supplierCode;
//使用在途库不改变管理模式
- if (this.jobContent.useOnTheWayLocation ==
- 'TRUE') {
+ if (this.toLocationCode ==null) {
record.toPackingNumber = r
.packingNumber;
record.toBatch = r.batch;
diff --git a/pages/purchaseReturn/record/returnRecord.vue b/pages/purchaseReturn/record/returnRecord.vue
index 68f60fce..3ab0f291 100644
--- a/pages/purchaseReturn/record/returnRecord.vue
+++ b/pages/purchaseReturn/record/returnRecord.vue
@@ -286,7 +286,7 @@
submitItem.fromBatch = detail.batch;
submitItem.toBatch = detail.batch;
- submitItem.fromLocationCode = this.fromLocationCode;
+ submitItem.fromLocationCode = detail.locationCode;
submitItem.toLocationCode = ''; //采购退货直接出库,目标库位为空
submitItem.qty = detail.handleQty;