|
@ -45,7 +45,7 @@ |
|
|
</view> |
|
|
</view> |
|
|
</view> |
|
|
</view> |
|
|
</uni-popup> |
|
|
</uni-popup> |
|
|
<balance-select ref="balanceSelect" @onSelectItem='selectBalanceItem'></balance-select> |
|
|
<!-- <balance-select ref="balanceSelect" @onSelectItem='selectBalanceItem'></balance-select> --> |
|
|
</view> |
|
|
</view> |
|
|
<comMessage ref="comMessage"></comMessage> |
|
|
<comMessage ref="comMessage"></comMessage> |
|
|
</template> |
|
|
</template> |
|
@ -171,7 +171,8 @@ |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
scanLocation(scanResult) { |
|
|
getScanResult(scanResult) { |
|
|
|
|
|
this.scanResult = scanResult; |
|
|
var isCheck = false; |
|
|
var isCheck = false; |
|
|
if (this.fromLocationCode == '') { |
|
|
if (this.fromLocationCode == '') { |
|
|
this.showErrorMessage('来源库位不能为空', callback => { |
|
|
this.showErrorMessage('来源库位不能为空', callback => { |
|
@ -193,6 +194,7 @@ |
|
|
title: '扫描中...', |
|
|
title: '扫描中...', |
|
|
mask: true |
|
|
mask: true |
|
|
}); |
|
|
}); |
|
|
|
|
|
|
|
|
getBasicLocationByCode(this.fromLocationCode).then(res => { |
|
|
getBasicLocationByCode(this.fromLocationCode).then(res => { |
|
|
if (res.data.total > 0) { |
|
|
if (res.data.total > 0) { |
|
|
let result = res.data.list[0]; |
|
|
let result = res.data.list[0]; |
|
@ -201,8 +203,7 @@ |
|
|
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.packCallBack(); |
|
|
this.checkPackage(scanResult); |
|
|
|
|
|
} else { |
|
|
} else { |
|
|
uni.hideLoading(); |
|
|
uni.hideLoading(); |
|
|
var hint = getListLocationTypeDesc(this.fromLocationTypeArray); |
|
|
var hint = getListLocationTypeDesc(this.fromLocationTypeArray); |
|
@ -212,11 +213,11 @@ |
|
|
}) |
|
|
}) |
|
|
} |
|
|
} |
|
|
} else { |
|
|
} else { |
|
|
uni.hideLoading(); |
|
|
|
|
|
this.showErrorMessage("扫描库位[" + this.fromLocationCode + "]不可用", res => { |
|
|
this.showErrorMessage("扫描库位[" + this.fromLocationCode + "]不可用", res => { |
|
|
this.locationGetFocus(); |
|
|
this.locationGetFocus(); |
|
|
}) |
|
|
}) |
|
|
} |
|
|
} |
|
|
|
|
|
uni.hideLoading(); |
|
|
} else { |
|
|
} else { |
|
|
uni.hideLoading(); |
|
|
uni.hideLoading(); |
|
|
this.showErrorMessage('未查询到库位[' + this.fromLocationCode + ']', res => { |
|
|
this.showErrorMessage('未查询到库位[' + this.fromLocationCode + ']', res => { |
|
@ -231,131 +232,13 @@ |
|
|
}) |
|
|
}) |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
getScanResult(result) { |
|
|
packCallBack() { |
|
|
// 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); |
|
|
|
|
|
} else if (this.noShowBalanceMessage) { |
|
|
|
|
|
this.countCallBack(datas); |
|
|
|
|
|
} else { |
|
|
|
|
|
this.mustHavaBalance(datas); |
|
|
|
|
|
} |
|
|
|
|
|
uni.hideLoading(); |
|
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
//允许无库存 |
|
|
|
|
|
allowNoneBalance(datas) { |
|
|
|
|
|
this.packCallBack(null); |
|
|
|
|
|
// if (datas.length == 0) { |
|
|
|
|
|
// this.packCallBack(null); |
|
|
|
|
|
// } else { |
|
|
|
|
|
// this.showErrorMessage('在来源库位[' + this.fromLocationCode + '],已经查找到该包装的库存记录,请重新扫描', res => { |
|
|
|
|
|
// this.packGetFocus(); |
|
|
|
|
|
// }) |
|
|
|
|
|
// } |
|
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
//必须有库存 |
|
|
|
|
|
mustHavaBalance(datas) { |
|
|
|
|
|
if (datas.length == 0) { |
|
|
|
|
|
this.showErrorMessage(this.getQueryCondition() + '<br>未查找到库存记录', res => { |
|
|
|
|
|
this.packGetFocus(); |
|
|
|
|
|
}) |
|
|
|
|
|
} else if (datas.length == 1) { |
|
|
|
|
|
let balance = datas[0]; |
|
|
|
|
|
this.packCallBack(balance); |
|
|
|
|
|
|
|
|
|
|
|
//因为盘点时有负库存,暂时去掉判断 2023年12月28日 |
|
|
|
|
|
|
|
|
|
|
|
// if (balance.qty > 0) { |
|
|
|
|
|
// this.packCallBack(balance); |
|
|
|
|
|
// } else { |
|
|
|
|
|
// this.showErrorMessage(this.getQueryCondition() + '<br>查找到库存记录数量为[' + balance.qty + "],<br>不可以进行操作", |
|
|
|
|
|
// res => { |
|
|
|
|
|
// this.packGetFocus(); |
|
|
|
|
|
// }) |
|
|
|
|
|
// } |
|
|
|
|
|
} else { |
|
|
|
|
|
this.showBalanceSelect(datas); |
|
|
|
|
|
} |
|
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
showBalanceSelect(items) { |
|
|
|
|
|
this.$refs.balanceSelect.openPopup(items); |
|
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
selectBalanceItem(balance) { |
|
|
|
|
|
this.packCallBack(balance); |
|
|
|
|
|
//因为盘点时有负库存,暂时去掉判断 2023年12月28日 |
|
|
|
|
|
// if (balance.qty > 0) { |
|
|
|
|
|
// this.packCallBack(balance); |
|
|
|
|
|
// } else { |
|
|
|
|
|
// this.showErrorMessage(this.getQueryCondition() + '<br>查找到库存记录数量为[' + balance.qty + "],不可以进行操作", |
|
|
|
|
|
// res => { |
|
|
|
|
|
// this.packGetFocus(); |
|
|
|
|
|
// }) |
|
|
|
|
|
// } |
|
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
//盘点回调 |
|
|
|
|
|
countCallBack(datas) { |
|
|
|
|
|
this.$refs.comscan.clear(); |
|
|
this.$refs.comscan.clear(); |
|
|
//返回标签信息、库存信息和管理模式 |
|
|
//返回标签信息、库存信息和管理模式 |
|
|
let data = { |
|
|
let data = { |
|
|
label: this.scanResult.label, |
|
|
label: this.scanResult.label, |
|
|
package: this.scanResult.package, |
|
|
package: this.scanResult.package, |
|
|
balance: datas, |
|
|
balance: null, |
|
|
fromLocationCode: this.fromLocationCode, |
|
|
|
|
|
} |
|
|
|
|
|
this.packGetFocus(); |
|
|
|
|
|
this.$emit("getCountScanResult", data); |
|
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
packCallBack(item) { |
|
|
|
|
|
this.$refs.comscan.clear(); |
|
|
|
|
|
//返回标签信息、库存信息和管理模式 |
|
|
|
|
|
let data = { |
|
|
|
|
|
label: this.scanResult.label, |
|
|
|
|
|
package: this.scanResult.package, |
|
|
|
|
|
balance: item, |
|
|
|
|
|
fromLocationCode: this.fromLocationCode, |
|
|
fromLocationCode: this.fromLocationCode, |
|
|
} |
|
|
} |
|
|
this.packGetFocus(); |
|
|
this.packGetFocus(); |
|
@ -379,36 +262,6 @@ |
|
|
this.locationOnFocus = true; |
|
|
this.locationOnFocus = true; |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
getQueryCondition() { |
|
|
|
|
|
let condition = '按照以下条件:<br>'; |
|
|
|
|
|
let label = this.scanResult.label; |
|
|
|
|
|
let status = getInventoryStatusDesc(this.inventoryStatus); |
|
|
|
|
|
switch (this.managementPrecision) { |
|
|
|
|
|
case 'BY_PACKAGING': |
|
|
|
|
|
condition = condition + '物料号=[' + label.itemCode + ']<br>箱码=[' + label.packingNumber + |
|
|
|
|
|
']<br>批次=[' + |
|
|
|
|
|
label.batch + |
|
|
|
|
|
']<br>库位=[' + this.fromLocationCode + ']' |
|
|
|
|
|
|
|
|
|
|
|
break; |
|
|
|
|
|
case 'BY_BATCH': |
|
|
|
|
|
condition = condition + '物料号=[' + label.itemCode + ']<br>批次=[' + |
|
|
|
|
|
label.batch + |
|
|
|
|
|
']<br>库位=[' + this.fromLocationCode + ']' |
|
|
|
|
|
break; |
|
|
|
|
|
case 'BY_QUANTITY': |
|
|
|
|
|
condition = condition + '物料号=[' + label.itemCode + ']<br>库位=[' + this.fromLocationCode + ']' |
|
|
|
|
|
break; |
|
|
|
|
|
case 'BY_UNIQUEID': |
|
|
|
|
|
condition = condition + '物料号=[' + label.itemCode + ']' |
|
|
|
|
|
break; |
|
|
|
|
|
} |
|
|
|
|
|
if (this.inventoryStatus.length > 0) { |
|
|
|
|
|
condition = condition + '<br>库存状态=[' + status + ']' |
|
|
|
|
|
} |
|
|
|
|
|
return condition; |
|
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
showMessage(message, callback) { |
|
|
showMessage(message, callback) { |
|
|
setTimeout(r => { |
|
|
setTimeout(r => { |
|
@ -428,9 +281,7 @@ |
|
|
this.show = e.show |
|
|
this.show = e.show |
|
|
}, |
|
|
}, |
|
|
isInLocationList(location) { |
|
|
isInLocationList(location) { |
|
|
|
|
|
|
|
|
var item = this.fromLocationList.find(res => res == location) |
|
|
var item = this.fromLocationList.find(res => res == location) |
|
|
|
|
|
|
|
|
if (item = undefined) { |
|
|
if (item = undefined) { |
|
|
return false |
|
|
return false |
|
|
} |
|
|
} |
|
|