|
|
@ -42,8 +42,8 @@ |
|
|
|
<text class="text_black">{{item.inventoryQty}}</text> |
|
|
|
</uni-th> |
|
|
|
<uni-th width="100" align="center"> |
|
|
|
<com-number-box v-model="item.countQty" :max="99999" |
|
|
|
:min="0" @change="qtyChanged($event,item)" |
|
|
|
<com-number-box v-model="item.countQty" :max="99999" :min="0" |
|
|
|
@change="qtyChanged($event,item)" |
|
|
|
style='margin-right: 10px;padding: 2px;'> |
|
|
|
</com-number-box> |
|
|
|
|
|
|
@ -178,7 +178,8 @@ |
|
|
|
getCurrDateTime, |
|
|
|
navigateBack, |
|
|
|
scanSuccessAudio, |
|
|
|
scanFailedAudio |
|
|
|
scanFailedAudio, |
|
|
|
deepCopyData |
|
|
|
} from '@/common/basic.js'; |
|
|
|
|
|
|
|
import { |
|
|
@ -249,7 +250,7 @@ |
|
|
|
names: [], |
|
|
|
values: [], |
|
|
|
origin: [] |
|
|
|
} |
|
|
|
}, |
|
|
|
} |
|
|
|
}, |
|
|
|
props: {}, |
|
|
@ -345,6 +346,7 @@ |
|
|
|
}) |
|
|
|
}, |
|
|
|
methods: { |
|
|
|
|
|
|
|
initList() { |
|
|
|
this.index = 1; |
|
|
|
this.showList = [] |
|
|
@ -373,40 +375,7 @@ |
|
|
|
selectCheckbox(mode, resultData) { |
|
|
|
console.log(mode, resultData) |
|
|
|
var result = resultData |
|
|
|
|
|
|
|
var itemCode = result.itemCode; |
|
|
|
var itemScan = this.scanAllDetails.filter(r => |
|
|
|
r.itemCode == itemCode&& |
|
|
|
r.inventoryStage==this.datacontent.inventoryStage&& |
|
|
|
r.isDelete==false) |
|
|
|
// if(itemScan.length == 0){ |
|
|
|
// let detail = this.creatDetail(result); |
|
|
|
// this.setDetailNoBalance(detail, result) |
|
|
|
// detail.inventoryQty=result.qty |
|
|
|
// detail.countQty =result.qty |
|
|
|
// this.scanAllDetails.unshift(detail); |
|
|
|
// this.initList(); |
|
|
|
// this.calcScanCount(); |
|
|
|
// this.$forceUpdate(); |
|
|
|
// }else if (itemScan.length == 1){ |
|
|
|
// setTimeout(res => { |
|
|
|
// showConfirmMsg("物料【" + itemCode + "】已经扫描,是否覆盖已经扫描的信息", res => { |
|
|
|
// if (res) { |
|
|
|
// this.setQty(itemScan[0], itemScan[0].inventoryQty, false); |
|
|
|
// } |
|
|
|
// }) |
|
|
|
// }, 100) |
|
|
|
// } |
|
|
|
if (itemScan.length > 0) { |
|
|
|
setTimeout(res => { |
|
|
|
showConfirmMsg("物料【" + itemCode + "】已经扫描,是否覆盖已经扫描的信息", res => { |
|
|
|
if (res) { |
|
|
|
this.setQty(itemScan[0], itemScan[0].inventoryQty, false); |
|
|
|
} |
|
|
|
}) |
|
|
|
}, 100) |
|
|
|
return; |
|
|
|
} |
|
|
|
|
|
|
|
let items = this.originalDetails.filter(r => |
|
|
|
r.itemCode === itemCode && r.inventoryStage == this.datacontent.inventoryStage) |
|
|
@ -416,7 +385,8 @@ |
|
|
|
} else if (items.length == 1) { |
|
|
|
var item = items[0]; |
|
|
|
item.isNew = true; |
|
|
|
this.setQty(item, item.inventoryQty, true); |
|
|
|
var addItem = deepCopyData(item) |
|
|
|
this.addItemExit(addItem, true); |
|
|
|
} else { |
|
|
|
this.showMessage('盘点数量异常,ERP物料号【' + itemCode + '】的出现多条数据'); |
|
|
|
} |
|
|
@ -443,9 +413,9 @@ |
|
|
|
|
|
|
|
that.scanAllDetails = res.depDetails.filter(r => r.inventoryStage == res.inventoryStage); |
|
|
|
that.scanCount = res.depDetails.length |
|
|
|
that.scanAllDetails.forEach(res=>{ |
|
|
|
res.isDelete = false; |
|
|
|
res.modified=false; |
|
|
|
that.scanAllDetails.forEach(item => { |
|
|
|
item.isDelete = false; |
|
|
|
item.modified = false; |
|
|
|
}) |
|
|
|
|
|
|
|
this.initList() |
|
|
@ -481,22 +451,22 @@ |
|
|
|
result.itemDesc1 = result.desc1; |
|
|
|
result.itemDesc2 = result.desc2; |
|
|
|
result.uom = result.basicUom |
|
|
|
var itemScan = this.scanAllDetails.filter(r => |
|
|
|
r.itemCode == itemCode&& |
|
|
|
r.inventoryStage==this.datacontent.inventoryStage&& |
|
|
|
r.isDelete==false |
|
|
|
) |
|
|
|
if (itemScan.length > 0) { |
|
|
|
setTimeout(res => { |
|
|
|
scanFailedAudio() |
|
|
|
showConfirmMsg("物料【" + itemCode + "】已经扫描,是否覆盖已经扫描的信息", res => { |
|
|
|
if (res) { |
|
|
|
this.setQty(itemScan[0], itemScan[0].inventoryQty, false); |
|
|
|
} |
|
|
|
}) |
|
|
|
}, 100) |
|
|
|
return; |
|
|
|
} |
|
|
|
// var itemScan = this.scanAllDetails.filter(r => |
|
|
|
// r.itemCode == itemCode&& |
|
|
|
// r.inventoryStage==this.datacontent.inventoryStage&& |
|
|
|
// r.isDelete==false |
|
|
|
// ) |
|
|
|
// if (itemScan.length > 0) { |
|
|
|
// setTimeout(res => { |
|
|
|
// scanFailedAudio() |
|
|
|
// showConfirmMsg("物料【" + itemCode + "】已经扫描,是否覆盖已经扫描的信息", res => { |
|
|
|
// if (res) { |
|
|
|
// this.setQty(itemScan[0], itemScan[0].inventoryQty, false); |
|
|
|
// } |
|
|
|
// }) |
|
|
|
// }, 100) |
|
|
|
// return; |
|
|
|
// } |
|
|
|
|
|
|
|
let items = this.originalDetails.filter(r => |
|
|
|
r.itemCode === itemCode && r.inventoryStage == this.datacontent.inventoryStage) |
|
|
@ -507,7 +477,8 @@ |
|
|
|
scanSuccessAudio() |
|
|
|
var item = items[0]; |
|
|
|
item.isNew = true; |
|
|
|
this.setQty(item, item.inventoryQty, true); |
|
|
|
var addItem = deepCopyData(item) |
|
|
|
this.addItemExit(addItem, true); |
|
|
|
} else { |
|
|
|
scanFailedAudio() |
|
|
|
this.showMessage('盘点数量异常,箱码【' + packingCode + '】的出现多条数据'); |
|
|
@ -561,7 +532,8 @@ |
|
|
|
} else { |
|
|
|
setTimeout(res => { |
|
|
|
scanFailedAudio() |
|
|
|
showConfirmMsg("扫描的物料["+result.itemCode+"]在任务中不存在,是否要添加为任务明细?", async confirm => { |
|
|
|
showConfirmMsg("扫描的物料[" + result.itemCode + "]在任务中不存在,是否要添加为任务明细?", |
|
|
|
async confirm => { |
|
|
|
if (confirm) { |
|
|
|
this.setDetailByBalance(detail, balanceItem); |
|
|
|
this.scanAllDetails.unshift(detail); |
|
|
@ -652,7 +624,7 @@ |
|
|
|
setDetailNoBalance(detail, result) { |
|
|
|
detail.InventoryLocationCode = ""; |
|
|
|
detail.inventoryQty = 0; |
|
|
|
detail.countQty = 1; |
|
|
|
detail.countQty = 0; |
|
|
|
detail.status = 2; |
|
|
|
detail.uom = result.uom |
|
|
|
return detail; |
|
|
@ -660,7 +632,25 @@ |
|
|
|
|
|
|
|
setQty(item, qty, isAdd) { |
|
|
|
|
|
|
|
item.countQty = Number(qty); |
|
|
|
item.countQty = 0; |
|
|
|
item.countTime = new Date(); |
|
|
|
item.isDelete = false; |
|
|
|
item.modified = true; |
|
|
|
item.countOperator = localStorage.userId; |
|
|
|
if (isAdd) { |
|
|
|
this.scanAllDetails.unshift(item) |
|
|
|
} else { |
|
|
|
item.countDescription = "" |
|
|
|
} |
|
|
|
this.initList(); |
|
|
|
this.scanPopupGetfocus(); |
|
|
|
this.calcScanCount(); |
|
|
|
this.$forceUpdate(); |
|
|
|
}, |
|
|
|
|
|
|
|
addItemExit(item, isAdd) { |
|
|
|
|
|
|
|
item.countQty = 0; |
|
|
|
item.countTime = new Date(); |
|
|
|
item.isDelete = false; |
|
|
|
item.modified = true; |
|
|
@ -736,7 +726,6 @@ |
|
|
|
this.showMessage("ERP料号:[" + temp.itemCode + "]盘点数量为0,请输入盘点数量") |
|
|
|
return; |
|
|
|
} |
|
|
|
|
|
|
|
this.finishJob(); |
|
|
|
}, |
|
|
|
|
|
|
@ -746,13 +735,7 @@ |
|
|
|
title: "提交中...", |
|
|
|
mask: true |
|
|
|
}); |
|
|
|
this.datacontent.depDetails =this.scanAllDetails.filter(r=>r.modified==true&&r.isDelete==false); |
|
|
|
this.datacontent.details =[]; |
|
|
|
that.datacontent.completeUserId = localStorage.getItem('userId') |
|
|
|
that.datacontent.completeUserName = localStorage.getItem('userName_CN') |
|
|
|
that.datacontent.completeTime = getCurrDateTime() |
|
|
|
let params = JSON.stringify(this.datacontent); |
|
|
|
console.log("提交参数",params) |
|
|
|
var params =this.setParams(); |
|
|
|
finishCountJob(this.id, params) |
|
|
|
.then(res => { |
|
|
|
uni.hideLoading(); |
|
|
@ -766,6 +749,30 @@ |
|
|
|
}); |
|
|
|
}, |
|
|
|
|
|
|
|
setParams() { |
|
|
|
var filterList = this.scanAllDetails.filter(r => r.modified == true && r.isDelete == false) |
|
|
|
|
|
|
|
let submitList = []; //定义空数组,用于装载去重之后的数组, |
|
|
|
filterList.forEach(item => { |
|
|
|
//可以用indexOf()数组去重 如果检索的结果匹配到,则返回 1. 如果检索的结果没有匹配值,则返回 -1. |
|
|
|
var findItem = submitList.find(r => r.itemCode == item.itemCode) |
|
|
|
if (findItem) { |
|
|
|
findItem.countQty += item.countQty |
|
|
|
} else { |
|
|
|
submitList.push(item); |
|
|
|
} |
|
|
|
}) |
|
|
|
|
|
|
|
|
|
|
|
this.datacontent.depDetails = submitList; |
|
|
|
this.datacontent.details = []; |
|
|
|
this.datacontent.completeUserId = localStorage.getItem('userId') |
|
|
|
this.datacontent.completeUserName = localStorage.getItem('userName_CN') |
|
|
|
this.datacontent.completeTime = getCurrDateTime() |
|
|
|
var params = JSON.stringify(this.datacontent); |
|
|
|
return params; |
|
|
|
}, |
|
|
|
|
|
|
|
qtyChanged(value, item) { |
|
|
|
if (value > 0) { |
|
|
|
item.countTime = new Date(); |
|
|
@ -777,6 +784,8 @@ |
|
|
|
item.modified = true |
|
|
|
} |
|
|
|
} else { |
|
|
|
item.countTime = new Date(); |
|
|
|
item.modified = true |
|
|
|
this.showMessage("盘点数量必须大于0") |
|
|
|
} |
|
|
|
}, |
|
|
|