|
@ -117,7 +117,7 @@ |
|
|
package: {}, //包装 |
|
|
package: {}, //包装 |
|
|
label: {}, //标签 |
|
|
label: {}, //标签 |
|
|
currentEditItem: {}, |
|
|
currentEditItem: {}, |
|
|
jobStatus:"" |
|
|
jobStatus: "" |
|
|
}; |
|
|
}; |
|
|
}, |
|
|
}, |
|
|
onLoad(option) { |
|
|
onLoad(option) { |
|
@ -143,7 +143,7 @@ |
|
|
onBackPress(e) { |
|
|
onBackPress(e) { |
|
|
//已经接收但是没提交任务 |
|
|
//已经接收但是没提交任务 |
|
|
if (e.from === 'backbutton') { |
|
|
if (e.from === 'backbutton') { |
|
|
if (this.jobStatus=="2") { |
|
|
if (this.jobStatus == "2") { |
|
|
//取消承接任务 |
|
|
//取消承接任务 |
|
|
cancleTakeCountJob(this.id).then(res => { |
|
|
cancleTakeCountJob(this.id).then(res => { |
|
|
uni.navigateBack(); |
|
|
uni.navigateBack(); |
|
@ -331,24 +331,63 @@ |
|
|
that.label = result.label; |
|
|
that.label = result.label; |
|
|
var item = this.detailSource.find(r => r.itemCode == that.package.itemCode); |
|
|
var item = this.detailSource.find(r => r.itemCode == that.package.itemCode); |
|
|
if (item == undefined) { |
|
|
if (item == undefined) { |
|
|
// this.$refs.comMessage.showQuestionMessage("没有物料【" + that.package.itemCode + |
|
|
that.scanByBalance(result); |
|
|
// "】的盘点明细,是否继续盘点?", |
|
|
} else { |
|
|
|
|
|
// let subItem = item.subList.find(item => { |
|
|
|
|
|
// if (item.packingNumber == that.label.packingNumber && |
|
|
|
|
|
// item.batch == that.label.batch && item.scaned == true) { |
|
|
|
|
|
// return item; |
|
|
|
|
|
// } |
|
|
|
|
|
// }) |
|
|
|
|
|
let subItems = item.subList.filter(item => { |
|
|
|
|
|
if (item.packingNumber == that.label.packingNumber && |
|
|
|
|
|
item.batch == that.label.batch) { |
|
|
|
|
|
return item; |
|
|
|
|
|
} |
|
|
|
|
|
}) |
|
|
|
|
|
//有多条:同箱码同批次,但是状态不同 |
|
|
|
|
|
if (subItems.length > 1) { |
|
|
|
|
|
let subItem = subItems.find(r => r.scaned == false) |
|
|
|
|
|
if (subItem == undefined) { |
|
|
|
|
|
subItem = subItems[0]; |
|
|
|
|
|
that.editCountResult(item, subItem); |
|
|
|
|
|
} else { |
|
|
|
|
|
that.scanByBalance(result); |
|
|
|
|
|
} |
|
|
|
|
|
} else if (subItems.length == 1) { |
|
|
|
|
|
let subItem = subItems[0]; |
|
|
|
|
|
if (subItem.scaned) { |
|
|
|
|
|
if (subItem != undefined) { |
|
|
|
|
|
|
|
|
|
|
|
that.editCountResult(item, subItem); |
|
|
|
|
|
|
|
|
|
|
|
// this.$refs.comMessage.showQuestionMessage("箱码【" + that.label.packingNumber + |
|
|
|
|
|
// "】已经完成盘点,是否要编辑盘点结果?", |
|
|
// res => { |
|
|
// res => { |
|
|
// if (res) { |
|
|
// if (res) { |
|
|
that.scanByBalance(result); |
|
|
// this.currentEditItem = subItem; |
|
|
|
|
|
// this.$refs.countQtyEdit.openEditPopup(subItem, |
|
|
|
|
|
// item.subList); |
|
|
|
|
|
// // this.$refs.countQtyEdit.openEditPopupShowSeconds(subItem, |
|
|
|
|
|
// // item.subList); |
|
|
// } else { |
|
|
// } else { |
|
|
// this.scanPopupGetFocus(); |
|
|
// this.scanPopupGetFocus(); |
|
|
// } |
|
|
// } |
|
|
// }) |
|
|
// }) |
|
|
} else { |
|
|
} else { |
|
|
let subItem = item.subList.find(item => { |
|
|
that.scanByBalance(result); |
|
|
if (item.packingNumber == that.label.packingNumber && |
|
|
|
|
|
item.batch == that.label.batch && item.scaned == true) { |
|
|
|
|
|
return item; |
|
|
|
|
|
} |
|
|
} |
|
|
}) |
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
} catch (e) { |
|
|
|
|
|
this.showErrorMessage(e.message) |
|
|
|
|
|
} |
|
|
|
|
|
}, |
|
|
|
|
|
|
|
|
if (subItem != undefined) { |
|
|
//编辑盘点结果 |
|
|
|
|
|
editCountResult(item, subItem) { |
|
|
|
|
|
let that = this; |
|
|
this.$refs.comMessage.showQuestionMessage("箱码【" + that.label.packingNumber + |
|
|
this.$refs.comMessage.showQuestionMessage("箱码【" + that.label.packingNumber + |
|
|
"】已经完成盘点,是否要编辑盘点结果?", |
|
|
"】已经完成盘点,是否要编辑盘点结果?", |
|
|
res => { |
|
|
res => { |
|
@ -362,13 +401,6 @@ |
|
|
this.scanPopupGetFocus(); |
|
|
this.scanPopupGetFocus(); |
|
|
} |
|
|
} |
|
|
}) |
|
|
}) |
|
|
} else { |
|
|
|
|
|
that.scanByBalance(result); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
} catch (e) { |
|
|
|
|
|
this.showErrorMessage(e.message) |
|
|
|
|
|
} |
|
|
|
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
getUnOpenCountResult(result) { |
|
|
getUnOpenCountResult(result) { |
|
@ -487,14 +519,14 @@ |
|
|
} else { |
|
|
} else { |
|
|
//新增盘点 |
|
|
//新增盘点 |
|
|
//检查物料号是否存在 |
|
|
//检查物料号是否存在 |
|
|
var detail = that.detailSource.find(r => r.itemCode == that.package.itemCode); |
|
|
var detail = that.detailSource.find(r => r.itemCode == that.label.itemCode); |
|
|
if (detail == undefined) { |
|
|
if (detail == undefined) { |
|
|
//物料号不存在,创建物料号数据添加到列表。设置为已经扫描 |
|
|
//物料号不存在,创建物料号数据添加到列表。设置为已经扫描 |
|
|
that.addNewItemCodeToList(qty, inventoryStatus) |
|
|
that.addNewItemCodeToList(qty, inventoryStatus) |
|
|
} else { |
|
|
} else { |
|
|
var itemEditInfo = detail.subList.find(item => { |
|
|
var itemEditInfo = detail.subList.find(item => { |
|
|
if (item.packingNumber == that.package.number && |
|
|
if (item.packingNumber == that.label.packingNumber && |
|
|
item.batch == that.package.batch && |
|
|
item.batch == that.label.batch && |
|
|
item.inventoryStatus == inventoryStatus) { |
|
|
item.inventoryStatus == inventoryStatus) { |
|
|
return item; |
|
|
return item; |
|
|
} |
|
|
} |
|
|