|
|
@ -50,8 +50,8 @@ |
|
|
|
<win-scan-button @goScan='openScanPopup'></win-scan-button> |
|
|
|
<win-scan-pack-and-location ref="scanPopup" :noShowBalanceMessage="true" @getCountScanResult='getScanResult'> |
|
|
|
</win-scan-pack-and-location> |
|
|
|
<count-qty-edit ref="countQtyEdit" @confirm="editConfirm" :isShowStatus="true" :allowEditStatus="false" |
|
|
|
:isShowBalance="jobContent.isOpenCount=='TRUE'"> |
|
|
|
<count-qty-edit ref="countQtyEdit" @confirm="editConfirm" :isShowStatus="true" |
|
|
|
:allowEditStatus="editInventoryStatus" :isShowBalance="jobContent.isOpenCount=='TRUE'"> |
|
|
|
</count-qty-edit> |
|
|
|
<com-message ref="comMessage"></com-message> |
|
|
|
</view> |
|
|
@ -111,7 +111,10 @@ |
|
|
|
subList: [], //接口返回的任务subList |
|
|
|
detailSource: [], //绑定在页面上的数据源 |
|
|
|
itemEditInfo: {}, |
|
|
|
balance: {} //库存余额 |
|
|
|
balance: {}, //库存余额 |
|
|
|
editInventoryStatus: false, |
|
|
|
package: {}, //包装 |
|
|
|
label: {} //标签 |
|
|
|
}; |
|
|
|
}, |
|
|
|
onLoad(option) { |
|
|
@ -148,7 +151,6 @@ |
|
|
|
} else { |
|
|
|
uni.navigateBack(); |
|
|
|
} |
|
|
|
|
|
|
|
return true; |
|
|
|
} |
|
|
|
}, |
|
|
@ -268,11 +270,10 @@ |
|
|
|
updateData() { |
|
|
|
this.calcHandleQty(); |
|
|
|
}, |
|
|
|
|
|
|
|
editConfirm() { |
|
|
|
this.calcHandleQty(); |
|
|
|
this.scanPopupGetFocus(); |
|
|
|
}, |
|
|
|
// editConfirm() { |
|
|
|
// this.calcHandleQty(); |
|
|
|
// this.scanPopupGetFocus(); |
|
|
|
// }, |
|
|
|
|
|
|
|
openScanPopup() { |
|
|
|
let fromlocationCode = ''; |
|
|
@ -295,6 +296,7 @@ |
|
|
|
} |
|
|
|
this.$refs.scanPopup.openScanPopupForJob(fromlocationCode, fromlocationList, this.jobContent); |
|
|
|
}, |
|
|
|
|
|
|
|
closeScanPopup() { |
|
|
|
if (this.$refs.scanPopup != undefined) { |
|
|
|
this.$refs.scanPopup.closeScanPopup(); |
|
|
@ -307,40 +309,156 @@ |
|
|
|
} |
|
|
|
}, |
|
|
|
|
|
|
|
scanPopupLoseFocus() { |
|
|
|
if (this.$refs.scanPopup != undefined) { |
|
|
|
this.$refs.scanPopup.packLoseFocus(); |
|
|
|
} |
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
//明盘 |
|
|
|
getOpenScanResult(result) { |
|
|
|
getScanResult(result) { |
|
|
|
try { |
|
|
|
let label = result.label; |
|
|
|
this.balance = result.balance[0]; |
|
|
|
let that = this; |
|
|
|
that.package = result.package; |
|
|
|
that.label = result.label; |
|
|
|
|
|
|
|
//盘点了没有库存余额的数据,直接编辑盘点数量和盘点状态 |
|
|
|
if (result.balance.length == 0) { |
|
|
|
var item = this.detailSource.find(r => r.itemCode == that.package.itemCode); |
|
|
|
let subItem = item.subList.find(item => { |
|
|
|
if (item.packingNumber == that.label.packingNumber && |
|
|
|
item.batch == that.label.batch) { |
|
|
|
return item; |
|
|
|
} |
|
|
|
}) |
|
|
|
|
|
|
|
return; |
|
|
|
if (subItem != undefined && subItem.scaned) { |
|
|
|
this.$refs.comMessage.showQuestionMessage("箱码【" + packingNumber + |
|
|
|
"】已经完成盘点,是否要编辑数量", |
|
|
|
res => { |
|
|
|
if (res) { |
|
|
|
this.$refs.countQtyEdit.openEditPopup(subItem, |
|
|
|
item.subList); |
|
|
|
} else { |
|
|
|
|
|
|
|
this.scanPopupGetFocus(); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
}) |
|
|
|
} else { |
|
|
|
if (result.balance.length == 0) { |
|
|
|
that.scanPopupLoseFocus() |
|
|
|
that.$refs.comMessage.showQuestionMessage("该包装在来源库位[" + that.fromLocationCode + |
|
|
|
"],未查找到库存,是否继续盘点?", |
|
|
|
res => { |
|
|
|
if (res) { |
|
|
|
that.editInventoryStatus = true; |
|
|
|
let item = that.package; |
|
|
|
item.packingNumber = that.label.packingNumber; |
|
|
|
item.qty = Number(that.label.qty); |
|
|
|
item.handleQty = Number(that.label.qty); |
|
|
|
item.balanceQty = 0; |
|
|
|
item.inventoryStatus = "OK"; |
|
|
|
this.balance = item; |
|
|
|
that.$refs.countQtyEdit.openEditPopup(item, |
|
|
|
null); |
|
|
|
} else { |
|
|
|
//继续扫描 |
|
|
|
that.scanPopupGetFocus(); |
|
|
|
} |
|
|
|
}) |
|
|
|
} else if (result.balance.length == 1) { |
|
|
|
this.balance = result.balance[0]; |
|
|
|
that.$refs.countQtyEdit.openEditPopup(this.balance, |
|
|
|
null); |
|
|
|
} |
|
|
|
} |
|
|
|
return; |
|
|
|
// var packingNumber = that.label.packingNumber; |
|
|
|
// var batch = that.label.batch; |
|
|
|
// var itemCode = that.label.itemCode; |
|
|
|
// var balanceQty = 0; |
|
|
|
// var inventoryStatus = "OK" |
|
|
|
|
|
|
|
// var detail = this.detailSource.find(r => r.itemCode == itemCode); |
|
|
|
// var itemEditInfo; |
|
|
|
// //检查物料号是否存在 |
|
|
|
// if (detail == undefined) { |
|
|
|
// //物料号不存在,创建物料号数据添加到列表。设置为已经扫描 |
|
|
|
// this.addNewItemCodeToList(result) |
|
|
|
// } else { |
|
|
|
// if (result.balance.length == 0) { |
|
|
|
// this.balance = label; |
|
|
|
// this.balanceQty = 0; |
|
|
|
// this.inventoryStatus = "OK"; |
|
|
|
// this.editInventoryStatus = true; |
|
|
|
|
|
|
|
// //物料号存在,查询是否在任务列表中 |
|
|
|
// itemEditInfo = detail.subList.find(item => { |
|
|
|
// if (item.packingNumber == packingNumber && |
|
|
|
// item.batch == batch) { |
|
|
|
// return item; |
|
|
|
// } |
|
|
|
// }) |
|
|
|
// } else { |
|
|
|
// this.balance = result.balance[0]; |
|
|
|
// balanceQty = this.balance.qty; |
|
|
|
// inventoryStatus = this.balance.inventoryStatus; |
|
|
|
// //物料号存在,查询是否在任务列表中 |
|
|
|
// itemEditInfo = detail.subList.find(item => { |
|
|
|
// if (item.packingNumber == packingNumber && |
|
|
|
// item.batch == batch && |
|
|
|
// item.inventoryStatus == inventoryStatus) { |
|
|
|
// return item; |
|
|
|
// } |
|
|
|
// }) |
|
|
|
// } |
|
|
|
|
|
|
|
// if (itemEditInfo == undefined) { |
|
|
|
// //不在任务列表中,提示是否添加到列表 |
|
|
|
// this.addExistItemCodeToList(detail, result); |
|
|
|
|
|
|
|
// } else { |
|
|
|
// //在列表中,更新已扫描状态, |
|
|
|
// if (itemEditInfo.scaned) { |
|
|
|
// this.$refs.comMessage.showQuestionMessage("箱码【" + packingNumber + |
|
|
|
// "】已经完成盘点,是否要编辑数量", |
|
|
|
// res => { |
|
|
|
// if (res) { |
|
|
|
// this.$refs.countQtyEdit.openEditPopup(itemEditInfo, |
|
|
|
// detail.subList); |
|
|
|
// } else { |
|
|
|
// this.scanPopupGetFocus(); |
|
|
|
// } |
|
|
|
// }) |
|
|
|
|
|
|
|
// } else { |
|
|
|
// itemEditInfo.scaned = true; |
|
|
|
// itemEditInfo.handleQty = balanceQty; |
|
|
|
// itemEditInfo.balanceQty = balanceQty; |
|
|
|
// itemEditInfo.stdPackQty = result.package.stdPackQty; |
|
|
|
// itemEditInfo.stdPackUnit = result.package.stdPackUnit; |
|
|
|
// this.$refs.countQtyEdit.openEditPopupShowSeconds(itemEditInfo, detail |
|
|
|
// .subList); |
|
|
|
// this.updateData() |
|
|
|
// } |
|
|
|
// } |
|
|
|
// } |
|
|
|
} catch (e) { |
|
|
|
this.showErrorMessage(e.message) |
|
|
|
} |
|
|
|
}, |
|
|
|
|
|
|
|
var packingNumber = label.packingNumber; |
|
|
|
var batch = label.batch; |
|
|
|
var itemCode = label.itemCode; |
|
|
|
|
|
|
|
var balanceQty = this.balance.qty; |
|
|
|
var inventoryStatus = this.balance.inventoryStatus; |
|
|
|
editConfirm(qty, inventoryStatus) { |
|
|
|
let that = this; |
|
|
|
var detail = this.detailSource.find(r => r.itemCode == that.package.itemCode); |
|
|
|
|
|
|
|
var detail = this.detailSource.find(r => r.itemCode == itemCode); |
|
|
|
var itemEditInfo; |
|
|
|
//检查物料号是否存在 |
|
|
|
if (detail == undefined) { |
|
|
|
//物料号不存在,创建物料号数据添加到列表。设置为已经扫描 |
|
|
|
this.addNewItemCodeToList(result) |
|
|
|
} else { |
|
|
|
//物料号存在,查询是否在任务列表中 |
|
|
|
itemEditInfo = detail.subList.find(item => { |
|
|
|
if (item.packingNumber == packingNumber && |
|
|
|
item.batch == batch && |
|
|
|
var itemEditInfo = detail.subList.find(item => { |
|
|
|
if (item.packingNumber == that.package.number && |
|
|
|
item.batch == that.package.batch && |
|
|
|
item.inventoryStatus == inventoryStatus) { |
|
|
|
return item; |
|
|
|
} |
|
|
@ -348,43 +466,26 @@ |
|
|
|
|
|
|
|
if (itemEditInfo == undefined) { |
|
|
|
//不在任务列表中,提示是否添加到列表 |
|
|
|
this.addExistItemCodeToList(detail, result); |
|
|
|
|
|
|
|
} else { |
|
|
|
//在列表中,更新已扫描状态, |
|
|
|
if (itemEditInfo.scaned) { |
|
|
|
this.$refs.comMessage.showSelectMessageModal("箱码【" + packingNumber + |
|
|
|
"】已经完成盘点,是否要编辑数量", |
|
|
|
res => { |
|
|
|
if (res) { |
|
|
|
this.$refs.countQtyEdit.openEditPopup(itemEditInfo, |
|
|
|
detail.subList); |
|
|
|
} else { |
|
|
|
this.scanPopupGetFocus(); |
|
|
|
} |
|
|
|
}) |
|
|
|
|
|
|
|
this.addExistItemCodeToList(detail); |
|
|
|
} else { |
|
|
|
itemEditInfo.scaned = true; |
|
|
|
itemEditInfo.handleQty = balanceQty; |
|
|
|
itemEditInfo.balanceQty = balanceQty; |
|
|
|
itemEditInfo.stdPackQty = result.package.stdPackQty; |
|
|
|
itemEditInfo.stdPackUnit = result.package.stdPackUnit; |
|
|
|
itemEditInfo.handleQty = qty; |
|
|
|
itemEditInfo.balanceQty = this.balance.qty; |
|
|
|
itemEditInfo.stdPackQty = this.package.stdPackQty; |
|
|
|
itemEditInfo.stdPackUnit = this.package.stdPackUnit; |
|
|
|
this.$refs.countQtyEdit.openEditPopupShowSeconds(itemEditInfo, detail |
|
|
|
.subList); |
|
|
|
this.updateData() |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} catch (e) { |
|
|
|
this.showErrorMessage(e.message) |
|
|
|
|
|
|
|
this.calcHandleQty(); |
|
|
|
this.scanPopupGetFocus(); |
|
|
|
} |
|
|
|
}, |
|
|
|
|
|
|
|
//盲盘 |
|
|
|
getUnOpenScanResult(result) { |
|
|
|
try { |
|
|
|
debugger; |
|
|
|
//盘点了没有库存余额的数据 |
|
|
|
if (result.balance.length == 0) { |
|
|
|
|
|
|
@ -422,7 +523,7 @@ |
|
|
|
} else { |
|
|
|
//在列表中,更新已扫描状态, |
|
|
|
if (itemEditInfo.scaned) { |
|
|
|
this.$refs.comMessage.showSelectMessageModal("箱码【" + packingNumber + |
|
|
|
this.$refs.comMessage.showQuestionMessage("箱码【" + packingNumber + |
|
|
|
"】已经完成盘点,是否要编辑数量", |
|
|
|
res => { |
|
|
|
if (res) { |
|
|
@ -450,15 +551,12 @@ |
|
|
|
} |
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
addNewItemCodeToList(result) { |
|
|
|
this.$refs.comMessage.showSelectMessageModal("物料[" + this.balance.itemCode + "]不在列表中,是否添加到列表?", |
|
|
|
addNewItemCodeToList() { |
|
|
|
this.$refs.comMessage.showQuestionMessage("物料[" + this.package.itemCode + "]不在列表中,是否添加到列表?", |
|
|
|
res => { |
|
|
|
if (res) { |
|
|
|
var item = this.createAddItemInfo(this.balance, result.package); |
|
|
|
let newDetail = this.createAddDetailInfo(this.balance, result.package); // |
|
|
|
var item = this.createAddItemInfo(this.balance, this.package); |
|
|
|
let newDetail = this.createAddDetailInfo(this.balance, this.package); // |
|
|
|
item.subList.push(newDetail); |
|
|
|
this.detailSource.push(item) |
|
|
|
this.updateData() |
|
|
@ -467,13 +565,12 @@ |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
addExistItemCodeToList(detail, result) { |
|
|
|
this.$refs.comMessage.showSelectMessageModal("箱码[" + this.balance.packingNumber + |
|
|
|
"]不在列表中,是否添加到列表?", |
|
|
|
addExistItemCodeToList(detail) { |
|
|
|
this.$refs.comMessage.showQuestionMessage("盘点明细不在列表中,是否添加到列表?", |
|
|
|
res => { |
|
|
|
if (res) { |
|
|
|
detail.qty = calc.add(detail.qty, detail.qty) |
|
|
|
let newDetail = this.createAddDetailInfo(this.balance, result.package); // |
|
|
|
let newDetail = this.createAddDetailInfo(this.balance, this.package); // |
|
|
|
detail.subList.push(newDetail); |
|
|
|
this.updateData() |
|
|
|
|
|
|
@ -483,7 +580,7 @@ |
|
|
|
|
|
|
|
createAddItemInfo(balance, pack) { |
|
|
|
let item = { |
|
|
|
itemCode: balance.itemCode, |
|
|
|
itemCode: pack.itemCode, |
|
|
|
itemName: pack.itemName, |
|
|
|
stdPackQty: pack.stdPackQty, |
|
|
|
stdPackUnit: pack.stdPackUnit, |
|
|
@ -502,9 +599,9 @@ |
|
|
|
scaned: true, |
|
|
|
countDetailNumber: "", |
|
|
|
ownerCode: balance.ownerCode, |
|
|
|
packingNumber: balance.packingNumber, |
|
|
|
containerNumber: pack.containerNumber, |
|
|
|
batch: balance.batch, |
|
|
|
packingNumber: pack.packingNumber, |
|
|
|
containerNumber: balance.containerNumber, |
|
|
|
batch: pack.batch, |
|
|
|
inventoryStatus: balance.inventoryStatus, |
|
|
|
itemCode: pack.itemCode, |
|
|
|
itemName: pack.itemName, |
|
|
@ -523,7 +620,7 @@ |
|
|
|
stdPackUnit: pack.stdPackUnit, |
|
|
|
creator: this.$store.state.user.id |
|
|
|
} |
|
|
|
|
|
|
|
debugger; |
|
|
|
return detail; |
|
|
|
}, |
|
|
|
|
|
|
|