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