Browse Source

修改补料已经有库存余额提示 2024/8/9

hella_vue3
王志国 4 weeks ago
parent
commit
3f7a11fbf2
  1. 65
      src/pages/repleinsh/coms/comScanReplishPack.vue

65
src/pages/repleinsh/coms/comScanReplishPack.vue

@ -97,6 +97,7 @@ const comscan = ref()
const balanceQtyEditRef = ref()
const detailOptions = ref([])
const detailGiveupOptions = ref([])
const toLocationAreaTypeList = ref([])
onMounted(() => {
detailOptions.value = getDetailOption()
detailGiveupOptions.value = getDetailGiveupOption()
@ -138,6 +139,7 @@ const initData = () => {
fromInventoryStatuses.value = jobContent.value.outInventoryStatuses
toLocation.value = dataContent.value[0]
toLocationCode.value = dataContent.value[0].toLocationCode
toLocationAreaTypeList.value = getDirectoryItemArray(jobContent.value.toAreaTypes)
// fromLocationList.value = getFromLocationList()
}
}
@ -194,15 +196,72 @@ const onScan = (result)=> {
comMessageRef.value.showQuestionMessage(
`扫描物料包装【${result.package.packUnit}】与任务推荐包装规格【${item.packUnit}】不一致.是否要继续发料?`, res => {
if (res) {
onScanResult(result)
getToLocationBalance(result)
}
});
} else {
onScanResult(result)
getToLocationBalance(result)
}
}
}
const onScanResult = (result) => {
//
const getToLocationBalance = (result)=> {
uni.showLoading({
title: '查询中',
mask: true
})
let filters = []
if (result.package.parentNumber) {
let packingNumber = result.package.parentNumber + "," + result.package.number;
filters.push({
column: "packingNumber",
action: "in",
value: packingNumber
})
} else {
filters.push({
column: "packingNumber",
action: "==",
value: result.package.number
})
}
filters.push({
column: "itemCode",
action: "==",
value: result.package.itemCode
})
filters.push({
column: "batch",
action: "==",
value: result.package.batch
})
filters.push({
column: "areaType",
action: "in",
value: toLocationAreaTypeList.value.join(',')
})
var params = {
filters: filters,
pageNo: 1,
pageSize: 100,
}
getBalanceByFilter(params).then(res => {
uni.hideLoading()
if (res.data.list.length > 0) {
showErrorMessage("包装在库位【" + res.data.list[0].locationCode + "】已有库存余额");
} else {
queryBalance(result);
}
// callback(res.data)
}).catch(err => {
showErrorMessage(err.message);
})
}
const queryBalance = (result) => {
try {
// if (fromLocationCode.value == '') {
// showErrorMessage('', (res) => {

Loading…
Cancel
Save