|
@ -45,8 +45,9 @@ |
|
|
来源库位 |
|
|
来源库位 |
|
|
</view> |
|
|
</view> |
|
|
<view class="" style="width: 75%; padding: 8rpx;"> |
|
|
<view class="" style="width: 75%; padding: 8rpx;"> |
|
|
<uni-combox class="my-combox" :candidates="fromLocationList" v-model="fromLocationCode" placeholder="请选择库位" |
|
|
<uni-combox class="my-combox" :candidates="fromLocationList" v-model="fromLocationCode" |
|
|
@confirm="fromLocationUpdate" :inputStyle="inputStyleObject"></uni-combox> |
|
|
placeholder="请选择库位" @confirm="fromLocationUpdate" |
|
|
|
|
|
:inputStyle="inputStyleObject"></uni-combox> |
|
|
</view> |
|
|
</view> |
|
|
</view> |
|
|
</view> |
|
|
|
|
|
|
|
@ -95,8 +96,8 @@ |
|
|
<balance-select ref="balanceSelect" @onSelectItem='selectBalanceItem'></balance-select> |
|
|
<balance-select ref="balanceSelect" @onSelectItem='selectBalanceItem'></balance-select> |
|
|
<comMessage ref="comMessage"></comMessage> |
|
|
<comMessage ref="comMessage"></comMessage> |
|
|
<balance-qty-edit ref="balanceQtyEdit" @confirm="confirm" :isShowStatus="true"></balance-qty-edit> |
|
|
<balance-qty-edit ref="balanceQtyEdit" @confirm="confirm" :isShowStatus="true"></balance-qty-edit> |
|
|
<!-- 模拟扫描功能 --> |
|
|
<!-- 模拟扫描功能 --> |
|
|
<!-- <win-com-scan v-show="false" ref="comscansimulate" placeholder="箱标签" @getResult="onScan" :clearResult="true" |
|
|
<!-- <win-com-scan v-show="false" ref="comscansimulate" placeholder="箱标签" @getResult="onScan" :clearResult="true" |
|
|
headerType="HPQ,HMQ" :isShowHistory="false"> |
|
|
headerType="HPQ,HMQ" :isShowHistory="false"> |
|
|
</win-com-scan> --> |
|
|
</win-com-scan> --> |
|
|
</view> |
|
|
</view> |
|
@ -114,7 +115,8 @@ |
|
|
} from '@/common/array.js'; |
|
|
} from '@/common/array.js'; |
|
|
import { |
|
|
import { |
|
|
getWorkShopLineStation, |
|
|
getWorkShopLineStation, |
|
|
getBalanceByFilter |
|
|
getBalanceByFilter, |
|
|
|
|
|
getBalanceByParams, |
|
|
} from '@/api/request2.js'; |
|
|
} from '@/api/request2.js'; |
|
|
import { |
|
|
import { |
|
|
uniqueArray |
|
|
uniqueArray |
|
@ -131,11 +133,13 @@ |
|
|
import { |
|
|
import { |
|
|
getBalanceByManagementPrecision |
|
|
getBalanceByManagementPrecision |
|
|
} from '@/common/balance.js'; |
|
|
} from '@/common/balance.js'; |
|
|
import { getDirectoryItemArray } from '../../../common/directory.js'; |
|
|
import { |
|
|
|
|
|
getDirectoryItemArray |
|
|
|
|
|
} from '../../../common/directory.js'; |
|
|
|
|
|
|
|
|
export default { |
|
|
export default { |
|
|
name: 'winScanPack', |
|
|
name: 'winScanPack', |
|
|
emits: ["afterScan","closeScan"], |
|
|
emits: ["afterScan", "closeScan"], |
|
|
components: { |
|
|
components: { |
|
|
winComScan, |
|
|
winComScan, |
|
|
balance, |
|
|
balance, |
|
@ -170,9 +174,10 @@ import { getDirectoryItemArray } from '../../../common/directory.js'; |
|
|
fromInventoryStatuses: "", |
|
|
fromInventoryStatuses: "", |
|
|
packageInfo: {}, |
|
|
packageInfo: {}, |
|
|
label: {}, |
|
|
label: {}, |
|
|
inputStyleObject:{ |
|
|
inputStyleObject: { |
|
|
fontSize: "100rpx" |
|
|
fontSize: "100rpx" |
|
|
} |
|
|
}, |
|
|
|
|
|
bussinessCode: 'Issue' |
|
|
} |
|
|
} |
|
|
}, |
|
|
}, |
|
|
created() { |
|
|
created() { |
|
@ -184,7 +189,7 @@ import { getDirectoryItemArray } from '../../../common/directory.js'; |
|
|
this.scanOptions = getDetailEditRemoveOption(); |
|
|
this.scanOptions = getDetailEditRemoveOption(); |
|
|
}, |
|
|
}, |
|
|
methods: { |
|
|
methods: { |
|
|
openScanPopupForJobSimulate(content, jobcontent,scanMessage) { |
|
|
openScanPopupForJobSimulate(content, jobcontent, scanMessage) { |
|
|
this.issueRecord = []; |
|
|
this.issueRecord = []; |
|
|
this.dataContent = content; |
|
|
this.dataContent = content; |
|
|
this.jobContent = jobcontent; |
|
|
this.jobContent = jobcontent; |
|
@ -260,7 +265,7 @@ import { getDirectoryItemArray } from '../../../common/directory.js'; |
|
|
} |
|
|
} |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
onScanResult(result){ |
|
|
onScanResult(result) { |
|
|
try { |
|
|
try { |
|
|
let that = this; |
|
|
let that = this; |
|
|
if (that.fromLocationCode == '') { |
|
|
if (that.fromLocationCode == '') { |
|
@ -282,114 +287,92 @@ import { getDirectoryItemArray } from '../../../common/directory.js'; |
|
|
) |
|
|
) |
|
|
return; |
|
|
return; |
|
|
} else { |
|
|
} else { |
|
|
//查找库存信息 |
|
|
this.queryBalance(result); |
|
|
uni.showLoading({ |
|
|
|
|
|
title: '加载中', |
|
|
// this.getBalance(result.label, packageInfo, balances => { |
|
|
mask: true |
|
|
// this.packageInfo = packageInfo; |
|
|
}) |
|
|
// //扫描的是外包装 |
|
|
|
|
|
// let s = ''; |
|
|
this.getBalance(result.label, packageInfo, balances => { |
|
|
// if (!result.package.parentNumber) { |
|
|
this.packageInfo =packageInfo; |
|
|
// if (balances.list.length == 0) { |
|
|
//扫描的是外包装 |
|
|
// this.showErrorMessage('未查找到该包装的库存信息,请重新扫描') |
|
|
let s = ''; |
|
|
// } else { |
|
|
if (!result.package.parentNumber) { |
|
|
// let newBalances = balances.list.filter(b => b.locationCode == that |
|
|
if (balances.list.length == 0) { |
|
|
// .fromLocationCode); |
|
|
this.showErrorMessage('未查找到该包装的库存信息,请重新扫描') |
|
|
// if (newBalances.length == 0) { |
|
|
} else { |
|
|
// this.showErrorMessage('未查找到该包装的库存信息,请重新扫描') |
|
|
let newBalances = balances.list.filter(b => b.locationCode == that |
|
|
// } else if (newBalances.length == 1) { |
|
|
.fromLocationCode); |
|
|
// let balance = newBalances[0]; |
|
|
if (newBalances.length == 0) { |
|
|
|
|
|
this.showErrorMessage('未查找到该包装的库存信息,请重新扫描') |
|
|
|
|
|
} else if (newBalances.length == 1) { |
|
|
|
|
|
let balance = newBalances[0]; |
|
|
|
|
|
this.afterGetBalance(result.label, balance, packageInfo); |
|
|
|
|
|
} else { |
|
|
|
|
|
this.showBalanceSelect(newBalances); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
} else { |
|
|
|
|
|
//扫描的是小包装 |
|
|
|
|
|
if (balances.list.length == 0) { |
|
|
|
|
|
this.showErrorMessage('未查找到该包装的库存信息,请重新扫描') |
|
|
|
|
|
} else { |
|
|
|
|
|
//小包装库存 |
|
|
|
|
|
let subPackitems = balances.list.filter(r => r.packingNumber == packageInfo |
|
|
|
|
|
.number) |
|
|
|
|
|
//外包装库存 |
|
|
|
|
|
let subParentPackitems = balances.list.filter(r => r.packingNumber == |
|
|
|
|
|
packageInfo |
|
|
|
|
|
.parentNumber&&r.locationCode==this.fromLocationCode) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//小包装没有库存, |
|
|
|
|
|
if (subPackitems.length == 0) { |
|
|
|
|
|
//外包装有库存,出库后剩余库存未转换为出库包装规格 |
|
|
|
|
|
|
|
|
|
|
|
if (subParentPackitems.length > 0) { |
|
|
|
|
|
if(subParentPackitems.length==1){ |
|
|
|
|
|
let balance = subParentPackitems[0]; |
|
|
|
|
|
balance.qty=packageInfo.qty; |
|
|
|
|
|
this.afterGetBalance(result.label, balance, packageInfo); |
|
|
|
|
|
}else { |
|
|
|
|
|
this.showBalanceSelect(subParentPackitems); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
this.showErrorMessage('按外包装【' + packageInfo.parentNumber + '】和子包装【' + |
|
|
|
|
|
packageInfo.number + '】都未查找到库存余额') |
|
|
|
|
|
} |
|
|
|
|
|
} else { |
|
|
|
|
|
var locationCode = this.fromLocationCode |
|
|
|
|
|
if(balances.list==1){ |
|
|
|
|
|
locationCode=balances.list[0].locationCode |
|
|
|
|
|
}else { |
|
|
|
|
|
var manyBlances = balances.list.filter(r=>r.locationCode!=this.fromLocationCode) |
|
|
|
|
|
if(manyBlances.length>0){ |
|
|
|
|
|
locationCode = manyBlances[0].locationCode; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
this.showErrorMessage('该包装【' + packageInfo.number + '】在库位【' + |
|
|
|
|
|
locationCode + |
|
|
|
|
|
'】已经有库存余额,请重新扫描') |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// //小包装没有库存,外包装有库存 |
|
|
|
|
|
// if (subitems.length == 0 && subParentPackitems.length > 0) { |
|
|
|
|
|
// this.afterGetBalance(result.label, null, packageInfo); |
|
|
|
|
|
// } else if (subitems.length > 0 && subParentPackitems.length == 0) { |
|
|
|
|
|
// //小包装没有库存,外包装没有有库存 |
|
|
|
|
|
// this.showErrorMessage('该包装在库位【' + balances.list[0].locationCode + |
|
|
|
|
|
// '】已经有库存余额,请重新扫描') |
|
|
|
|
|
// } else { |
|
|
|
|
|
|
|
|
|
|
|
// } |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
uni.hideLoading(); |
|
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// getBalanceByManagementPrecision(result.label, that.fromLocationCode, that.fromInventoryStatuses, |
|
|
|
|
|
// balanceRes => { |
|
|
|
|
|
// if (balanceRes.success) { |
|
|
|
|
|
// let s = ''; |
|
|
|
|
|
// if (balanceRes.data.list.length == 0) { |
|
|
|
|
|
// this.afterGetBalance(result.label, null, packageInfo); |
|
|
|
|
|
// } else if (balanceRes.data.list.length == 1) { |
|
|
|
|
|
// let balance = balanceRes.data.list[0]; |
|
|
|
|
|
// this.afterGetBalance(result.label, balance, packageInfo); |
|
|
// this.afterGetBalance(result.label, balance, packageInfo); |
|
|
// } else { |
|
|
// } else { |
|
|
// this.showBalanceSelect(balanceRes.data.list); |
|
|
// this.showBalanceSelect(newBalances); |
|
|
// } |
|
|
// } |
|
|
|
|
|
// } |
|
|
|
|
|
// } else { |
|
|
|
|
|
// //扫描的是小包装 |
|
|
|
|
|
// if (balances.list.length == 0) { |
|
|
|
|
|
// this.showErrorMessage('未查找到该包装的库存信息,请重新扫描') |
|
|
// } else { |
|
|
// } else { |
|
|
// this.showErrorMessage(balanceRes.message.message); |
|
|
// //小包装库存 |
|
|
|
|
|
// let subPackitems = balances.list.filter(r => r.packingNumber == packageInfo |
|
|
|
|
|
// .number) |
|
|
|
|
|
// //外包装库存 |
|
|
|
|
|
// let subParentPackitems = balances.list.filter(r => r.packingNumber == |
|
|
|
|
|
// packageInfo |
|
|
|
|
|
// .parentNumber && r.locationCode == this.fromLocationCode) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// //小包装没有库存, |
|
|
|
|
|
// if (subPackitems.length == 0) { |
|
|
|
|
|
// //外包装有库存,出库后剩余库存未转换为出库包装规格 |
|
|
|
|
|
|
|
|
|
|
|
// if (subParentPackitems.length > 0) { |
|
|
|
|
|
// if (subParentPackitems.length == 1) { |
|
|
|
|
|
// let balance = subParentPackitems[0]; |
|
|
|
|
|
// balance.qty = packageInfo.qty; |
|
|
|
|
|
// this.afterGetBalance(result.label, balance, packageInfo); |
|
|
|
|
|
// } else { |
|
|
|
|
|
// this.showBalanceSelect(subParentPackitems); |
|
|
|
|
|
// } |
|
|
|
|
|
|
|
|
|
|
|
// } else { |
|
|
|
|
|
// this.showErrorMessage('按外包装【' + packageInfo.parentNumber + '】和子包装【' + |
|
|
|
|
|
// packageInfo.number + '】都未查找到库存余额') |
|
|
|
|
|
// } |
|
|
|
|
|
// } else { |
|
|
|
|
|
// var locationCode = this.fromLocationCode |
|
|
|
|
|
// if (balances.list == 1) { |
|
|
|
|
|
// locationCode = balances.list[0].locationCode |
|
|
|
|
|
// } else { |
|
|
|
|
|
// var manyBlances = balances.list.filter(r => r.locationCode != this |
|
|
|
|
|
// .fromLocationCode) |
|
|
|
|
|
// if (manyBlances.length > 0) { |
|
|
|
|
|
// locationCode = manyBlances[0].locationCode; |
|
|
|
|
|
// } |
|
|
|
|
|
|
|
|
|
|
|
// } |
|
|
|
|
|
// this.showErrorMessage('该包装【' + packageInfo.number + '】在库位【' + |
|
|
|
|
|
// locationCode + |
|
|
|
|
|
// '】已经有库存余额,请重新扫描') |
|
|
|
|
|
|
|
|
|
|
|
// // var locationCode = this.fromLocationCode |
|
|
|
|
|
// // if(balances.list==1){ |
|
|
|
|
|
// // locationCode=balances.list[0].locationCode |
|
|
|
|
|
// // }else { |
|
|
|
|
|
// // var manyBlances = balances.list.filter(r=>r.locationCode!=this.fromLocationCode) |
|
|
|
|
|
// // if(manyBlances.length>0){ |
|
|
|
|
|
// // locationCode = manyBlances[0].locationCode; |
|
|
|
|
|
// // } |
|
|
|
|
|
|
|
|
|
|
|
// // } |
|
|
|
|
|
// // this.showErrorMessage('该包装【' + packageInfo.number + '】在库位【' + |
|
|
|
|
|
// // locationCode + |
|
|
|
|
|
// // '】已经有库存余额,请重新扫描') |
|
|
|
|
|
// } |
|
|
// } |
|
|
// } |
|
|
// uni.hideLoading(); |
|
|
// } |
|
|
// }); |
|
|
// uni.hideLoading(); |
|
|
|
|
|
// }); |
|
|
} |
|
|
} |
|
|
} catch (e) { |
|
|
} catch (e) { |
|
|
this.showErrorMessage(e.stack) |
|
|
this.showErrorMessage(e.stack) |
|
@ -397,6 +380,53 @@ import { getDirectoryItemArray } from '../../../common/directory.js'; |
|
|
} |
|
|
} |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
queryBalance(result) { |
|
|
|
|
|
var params = { |
|
|
|
|
|
itemCode: result.package.itemCode, |
|
|
|
|
|
batch: result.label.batch, |
|
|
|
|
|
packingNumber: result.label.packingNumber, |
|
|
|
|
|
parentPackingNumber: result.package.parentNumber, |
|
|
|
|
|
inventoryStatus: this.jobContent.outInventoryStatuses.split(','), |
|
|
|
|
|
areaType: this.jobContent.fromAreaTypes.split(','), |
|
|
|
|
|
bussinessCode: this.jobContent.businessType |
|
|
|
|
|
} |
|
|
|
|
|
uni.showLoading({ |
|
|
|
|
|
title: '查询中', |
|
|
|
|
|
mask: true |
|
|
|
|
|
}) |
|
|
|
|
|
getBalanceByParams(params).then(res => { |
|
|
|
|
|
if (res.data.length == 0) { |
|
|
|
|
|
var status = getInventoryStatusDesc(params.inventoryStatus) |
|
|
|
|
|
var areaType = getListLocationAreaTypeDesc(params.areaType) |
|
|
|
|
|
var hint = |
|
|
|
|
|
"按物料号 [" + params.itemCode + "] <br>" + |
|
|
|
|
|
"包装号 [" + params.packingNumber + "] <br>" + |
|
|
|
|
|
"批次 [" + params.batch + "] <br>" + |
|
|
|
|
|
"状态 [" + status + "] <br>" + |
|
|
|
|
|
"库区 [" + areaType + "] <br>" + |
|
|
|
|
|
"未查找到库存余额" |
|
|
|
|
|
this.showErrorMessage(hint) |
|
|
|
|
|
} else if (res.data.length == 1) { |
|
|
|
|
|
|
|
|
|
|
|
result.balance = res.data[0] |
|
|
|
|
|
if (result.label.packingNumber != result.balance.packingNumber) { |
|
|
|
|
|
result.balance.lableQty = result.label.qty |
|
|
|
|
|
} |
|
|
|
|
|
this.afterGetBalance(result.label, result.balance, result.package); |
|
|
|
|
|
} else { |
|
|
|
|
|
//多条记录 |
|
|
|
|
|
this.$refs.balanceSelect.openPopup(res.data); |
|
|
|
|
|
} |
|
|
|
|
|
uni.hideLoading() |
|
|
|
|
|
}).catch(error => { |
|
|
|
|
|
uni.hideLoading() |
|
|
|
|
|
this.showErrorMessage(error) |
|
|
|
|
|
}) |
|
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
getBalance(label, packageInfo, callback) { |
|
|
getBalance(label, packageInfo, callback) { |
|
|
var filters = [] |
|
|
var filters = [] |
|
|
|
|
|
|
|
@ -448,8 +478,8 @@ import { getDirectoryItemArray } from '../../../common/directory.js'; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
onScan(result) { |
|
|
onScan(result) { |
|
|
if(!result.package){ |
|
|
if (!result.package) { |
|
|
this.showErrorMessage('扫描数据错误['+result.label.code+"]", |
|
|
this.showErrorMessage('扫描数据错误[' + result.label.code + "]", |
|
|
res => { |
|
|
res => { |
|
|
this.getfocus(); |
|
|
this.getfocus(); |
|
|
} |
|
|
} |
|
@ -527,7 +557,7 @@ import { getDirectoryItemArray } from '../../../common/directory.js'; |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
selectBalanceItem(balance) { |
|
|
selectBalanceItem(balance) { |
|
|
this.afterGetBalance(this.label, balance,this.packageInfo); |
|
|
this.afterGetBalance(this.label, balance, this.packageInfo); |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
afterGetBalance(label, balance, packageInfo) { |
|
|
afterGetBalance(label, balance, packageInfo) { |
|
@ -733,13 +763,13 @@ import { getDirectoryItemArray } from '../../../common/directory.js'; |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
packGetFocus() { |
|
|
packGetFocus() { |
|
|
if(this.$refs.comscan){ |
|
|
if (this.$refs.comscan) { |
|
|
this.$refs.comscan.getfocus(); |
|
|
this.$refs.comscan.getfocus(); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
}, |
|
|
}, |
|
|
packLoseFocus() { |
|
|
packLoseFocus() { |
|
|
if(this.$refs.comscan){ |
|
|
if (this.$refs.comscan) { |
|
|
this.$refs.comscan.losefocus(); |
|
|
this.$refs.comscan.losefocus(); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
@ -789,7 +819,8 @@ import { getDirectoryItemArray } from '../../../common/directory.js'; |
|
|
max-height: 300rpx; |
|
|
max-height: 300rpx; |
|
|
padding: 10rpx; |
|
|
padding: 10rpx; |
|
|
} |
|
|
} |
|
|
.my-combox{ |
|
|
|
|
|
|
|
|
.my-combox { |
|
|
font-size: 50px; |
|
|
font-size: 50px; |
|
|
} |
|
|
} |
|
|
</style> |
|
|
</style> |