|
@ -8,9 +8,9 @@ |
|
|
</com-count-scan-detail> |
|
|
</com-count-scan-detail> |
|
|
</view> |
|
|
</view> |
|
|
<view class="" style="margin: 20rpx;"> |
|
|
<view class="" style="margin: 20rpx;"> |
|
|
<button type="primary" @click="queryItemCode">ERP料号查询</button> |
|
|
<button type="primary" @click="queryItemCode">ERP料号查询</button> |
|
|
</view> |
|
|
</view> |
|
|
|
|
|
|
|
|
<scroll-view scroll-y="true" style="margin-bottom: 50rpx;"> |
|
|
<scroll-view scroll-y="true" style="margin-bottom: 50rpx;"> |
|
|
<view v-for="(item ,index) in showList" :key="index"> |
|
|
<view v-for="(item ,index) in showList" :key="index"> |
|
|
<view class="detail-content common_card"> |
|
|
<view class="detail-content common_card"> |
|
@ -42,8 +42,8 @@ |
|
|
<text class="text_black">{{item.inventoryQty}}</text> |
|
|
<text class="text_black">{{item.inventoryQty}}</text> |
|
|
</uni-th> |
|
|
</uni-th> |
|
|
<uni-th width="100" align="center"> |
|
|
<uni-th width="100" align="center"> |
|
|
<com-number-box v-model="item.countQty" :max="99999" |
|
|
<com-number-box v-model="item.countQty" :max="99999" :min="0" |
|
|
:min="0" @change="qtyChanged($event,item)" |
|
|
@change="qtyChanged($event,item)" |
|
|
style='margin-right: 10px;padding: 2px;'> |
|
|
style='margin-right: 10px;padding: 2px;'> |
|
|
</com-number-box> |
|
|
</com-number-box> |
|
|
|
|
|
|
|
@ -93,7 +93,7 @@ |
|
|
</view> |
|
|
</view> |
|
|
</picker> |
|
|
</picker> |
|
|
</view> --> |
|
|
</view> --> |
|
|
<text class="state_point" :class="item.status | statusStyle"> |
|
|
<text class="state_point" :class="item.status | statusStyle"> |
|
|
{{ item.status | statusColor}} |
|
|
{{ item.status | statusColor}} |
|
|
</text> |
|
|
</text> |
|
|
</view> |
|
|
</view> |
|
@ -102,7 +102,7 @@ |
|
|
|
|
|
|
|
|
</view> |
|
|
</view> |
|
|
|
|
|
|
|
|
<view class="uni-flex space-between" style="margin:0 20rpx 20rpx;" > |
|
|
<view class="uni-flex space-between" style="margin:0 20rpx 20rpx;"> |
|
|
<view class=""> |
|
|
<view class=""> |
|
|
<text class="font_xs" |
|
|
<text class="font_xs" |
|
|
style="padding: 5px 2px; text-overflow: ellipsis; overflow: hidden;">{{item.countDescription}}</text> |
|
|
style="padding: 5px 2px; text-overflow: ellipsis; overflow: hidden;">{{item.countDescription}}</text> |
|
@ -133,7 +133,7 @@ |
|
|
</view> |
|
|
</view> |
|
|
<!-- <com-count-items ref='comcountItems' @selectedItem='selectedCountItem'> </com-count-items> --> |
|
|
<!-- <com-count-items ref='comcountItems' @selectedItem='selectedCountItem'> </com-count-items> --> |
|
|
<win-scan-button @goScan='openScanPopup'></win-scan-button> |
|
|
<win-scan-button @goScan='openScanPopup'></win-scan-button> |
|
|
<winScanByProductCode ref="scanPopup" title="单件码" @getScanResult='getScanResult' ></winScanByProductCode> |
|
|
<winScanByProductCode ref="scanPopup" title="单件码" @getScanResult='getScanResult'></winScanByProductCode> |
|
|
<com-easy-input ref="descPopup" @confirm='closeEditCountDesc'></com-easy-input> |
|
|
<com-easy-input ref="descPopup" @confirm='closeEditCountDesc'></com-easy-input> |
|
|
<com-easy-input-count ref="countPopup" @confirm='closeEditCount'></com-easy-input-count> |
|
|
<com-easy-input-count ref="countPopup" @confirm='closeEditCount'></com-easy-input-count> |
|
|
<win-inventory-status ref="statusPopup"></win-inventory-status> |
|
|
<win-inventory-status ref="statusPopup"></win-inventory-status> |
|
@ -141,7 +141,7 @@ |
|
|
<wz-select-popup ref="wzSelectPopup" @select="selectCheckbox" /> |
|
|
<wz-select-popup ref="wzSelectPopup" @select="selectCheckbox" /> |
|
|
<com-message ref="comMessage" @afterCloseCommitMessage='closeCommitMessage()'></com-message> |
|
|
<com-message ref="comMessage" @afterCloseCommitMessage='closeCommitMessage()'></com-message> |
|
|
<!-- <uni-load-more :status="loadingType" v-if="details.length>0"></uni-load-more> --> |
|
|
<!-- <uni-load-more :status="loadingType" v-if="details.length>0"></uni-load-more> --> |
|
|
|
|
|
|
|
|
</view> |
|
|
</view> |
|
|
</template> |
|
|
</template> |
|
|
|
|
|
|
|
@ -178,7 +178,8 @@ |
|
|
getCurrDateTime, |
|
|
getCurrDateTime, |
|
|
navigateBack, |
|
|
navigateBack, |
|
|
scanSuccessAudio, |
|
|
scanSuccessAudio, |
|
|
scanFailedAudio |
|
|
scanFailedAudio, |
|
|
|
|
|
deepCopyData |
|
|
} from '@/common/basic.js'; |
|
|
} from '@/common/basic.js'; |
|
|
|
|
|
|
|
|
import { |
|
|
import { |
|
@ -249,7 +250,7 @@ |
|
|
names: [], |
|
|
names: [], |
|
|
values: [], |
|
|
values: [], |
|
|
origin: [] |
|
|
origin: [] |
|
|
} |
|
|
}, |
|
|
} |
|
|
} |
|
|
}, |
|
|
}, |
|
|
props: {}, |
|
|
props: {}, |
|
@ -345,14 +346,15 @@ |
|
|
}) |
|
|
}) |
|
|
}, |
|
|
}, |
|
|
methods: { |
|
|
methods: { |
|
|
|
|
|
|
|
|
initList() { |
|
|
initList() { |
|
|
this.index = 1; |
|
|
this.index = 1; |
|
|
this.showList = [] |
|
|
this.showList = [] |
|
|
this.loadingType = ""; |
|
|
this.loadingType = ""; |
|
|
this.showList = this.getDataPage(this.index, this.pageSize) |
|
|
this.showList = this.getDataPage(this.index, this.pageSize) |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
queryItemCode(){ |
|
|
queryItemCode() { |
|
|
this.$refs.wzSelectPopup.open({ |
|
|
this.$refs.wzSelectPopup.open({ |
|
|
mode: 'radio', //radio checkbox 单选、多选 |
|
|
mode: 'radio', //radio checkbox 单选、多选 |
|
|
// dataList:[], //如果dataList传入了数组则直接使用传入的数组渲染,无需再配置proxyConfig |
|
|
// dataList:[], //如果dataList传入了数组则直接使用传入的数组渲染,无需再配置proxyConfig |
|
@ -373,57 +375,25 @@ |
|
|
selectCheckbox(mode, resultData) { |
|
|
selectCheckbox(mode, resultData) { |
|
|
console.log(mode, resultData) |
|
|
console.log(mode, resultData) |
|
|
var result = resultData |
|
|
var result = resultData |
|
|
|
|
|
|
|
|
var itemCode = result.itemCode; |
|
|
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 => |
|
|
let items = this.originalDetails.filter(r => |
|
|
r.itemCode === itemCode&&r.inventoryStage==this.datacontent.inventoryStage) |
|
|
r.itemCode === itemCode && r.inventoryStage == this.datacontent.inventoryStage) |
|
|
//不在任务列表中,查询库存赋值 |
|
|
//不在任务列表中,查询库存赋值 |
|
|
if (items.length == 0) { |
|
|
if (items.length == 0) { |
|
|
this.addNewDetail(result) |
|
|
this.addNewDetail(result) |
|
|
} else if (items.length == 1) { |
|
|
} else if (items.length == 1) { |
|
|
var item = items[0]; |
|
|
var item = items[0]; |
|
|
item.isNew =true; |
|
|
item.isNew = true; |
|
|
this.setQty(item, item.inventoryQty, true); |
|
|
var addItem = deepCopyData(item) |
|
|
|
|
|
this.addItemExit(addItem, true); |
|
|
} else { |
|
|
} else { |
|
|
this.showMessage('盘点数量异常,ERP物料号【' + itemCode + '】的出现多条数据'); |
|
|
this.showMessage('盘点数量异常,ERP物料号【' + itemCode + '】的出现多条数据'); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
}, |
|
|
}, |
|
|
reqGetList(data) { |
|
|
reqGetList(data) { |
|
|
return getBalancesByItemCode(data.searchValue,data.pageIndex,data.pageSize); |
|
|
return getBalancesByItemCode(data.searchValue, data.pageIndex, data.pageSize); |
|
|
}, |
|
|
}, |
|
|
getDetail() { |
|
|
getDetail() { |
|
|
uni.showLoading({ |
|
|
uni.showLoading({ |
|
@ -443,11 +413,11 @@ |
|
|
|
|
|
|
|
|
that.scanAllDetails = res.depDetails.filter(r => r.inventoryStage == res.inventoryStage); |
|
|
that.scanAllDetails = res.depDetails.filter(r => r.inventoryStage == res.inventoryStage); |
|
|
that.scanCount = res.depDetails.length |
|
|
that.scanCount = res.depDetails.length |
|
|
that.scanAllDetails.forEach(res=>{ |
|
|
that.scanAllDetails.forEach(item => { |
|
|
res.isDelete = false; |
|
|
item.isDelete = false; |
|
|
res.modified=false; |
|
|
item.modified = false; |
|
|
}) |
|
|
}) |
|
|
|
|
|
|
|
|
this.initList() |
|
|
this.initList() |
|
|
|
|
|
|
|
|
//查询库位信息 |
|
|
//查询库位信息 |
|
@ -468,54 +438,55 @@ |
|
|
//当前页起始索引 |
|
|
//当前页起始索引 |
|
|
const start = (pageNo - 1) * pageSize; |
|
|
const start = (pageNo - 1) * pageSize; |
|
|
const end = start + pageSize; //当前页结束索引 |
|
|
const end = start + pageSize; //当前页结束索引 |
|
|
var list =this.scanAllDetails.filter((r=>r.isDelete==false)) |
|
|
var list = this.scanAllDetails.filter((r => r.isDelete == false)) |
|
|
return list.slice(start, end) |
|
|
return list.slice(start, end) |
|
|
|
|
|
|
|
|
}, |
|
|
}, |
|
|
getScanResult(result){ |
|
|
getScanResult(result) { |
|
|
var itemCode =result.itemCode; |
|
|
var itemCode = result.itemCode; |
|
|
this.getitem(itemCode,res=>{ |
|
|
this.getitem(itemCode, res => { |
|
|
var result = res; |
|
|
var result = res; |
|
|
result.itemCode = result.code; |
|
|
result.itemCode = result.code; |
|
|
result.itemName = result.name; |
|
|
result.itemName = result.name; |
|
|
result.itemDesc1 = result.desc1; |
|
|
result.itemDesc1 = result.desc1; |
|
|
result.itemDesc2 = result.desc2; |
|
|
result.itemDesc2 = result.desc2; |
|
|
result.uom =result.basicUom |
|
|
result.uom = result.basicUom |
|
|
var itemScan = this.scanAllDetails.filter(r => |
|
|
// var itemScan = this.scanAllDetails.filter(r => |
|
|
r.itemCode == itemCode&& |
|
|
// r.itemCode == itemCode&& |
|
|
r.inventoryStage==this.datacontent.inventoryStage&& |
|
|
// r.inventoryStage==this.datacontent.inventoryStage&& |
|
|
r.isDelete==false |
|
|
// r.isDelete==false |
|
|
) |
|
|
// ) |
|
|
if (itemScan.length > 0) { |
|
|
// if (itemScan.length > 0) { |
|
|
setTimeout(res => { |
|
|
// setTimeout(res => { |
|
|
scanFailedAudio() |
|
|
// scanFailedAudio() |
|
|
showConfirmMsg("物料【" + itemCode + "】已经扫描,是否覆盖已经扫描的信息", res => { |
|
|
// showConfirmMsg("物料【" + itemCode + "】已经扫描,是否覆盖已经扫描的信息", res => { |
|
|
if (res) { |
|
|
// if (res) { |
|
|
this.setQty(itemScan[0], itemScan[0].inventoryQty, false); |
|
|
// this.setQty(itemScan[0], itemScan[0].inventoryQty, false); |
|
|
} |
|
|
// } |
|
|
}) |
|
|
// }) |
|
|
}, 100) |
|
|
// }, 100) |
|
|
return; |
|
|
// return; |
|
|
} |
|
|
// } |
|
|
|
|
|
|
|
|
let items = this.originalDetails.filter(r => |
|
|
let items = this.originalDetails.filter(r => |
|
|
r.itemCode === itemCode&&r.inventoryStage==this.datacontent.inventoryStage) |
|
|
r.itemCode === itemCode && r.inventoryStage == this.datacontent.inventoryStage) |
|
|
//不在任务列表中,查询库存赋值 |
|
|
//不在任务列表中,查询库存赋值 |
|
|
if (items.length == 0) { |
|
|
if (items.length == 0) { |
|
|
this.addNewDetail(result) |
|
|
this.addNewDetail(result) |
|
|
} else if (items.length == 1) { |
|
|
} else if (items.length == 1) { |
|
|
scanSuccessAudio() |
|
|
scanSuccessAudio() |
|
|
var item = items[0]; |
|
|
var item = items[0]; |
|
|
item.isNew =true; |
|
|
item.isNew = true; |
|
|
this.setQty(item, item.inventoryQty, true); |
|
|
var addItem = deepCopyData(item) |
|
|
|
|
|
this.addItemExit(addItem, true); |
|
|
} else { |
|
|
} else { |
|
|
scanFailedAudio() |
|
|
scanFailedAudio() |
|
|
this.showMessage('盘点数量异常,箱码【' + packingCode + '】的出现多条数据'); |
|
|
this.showMessage('盘点数量异常,箱码【' + packingCode + '】的出现多条数据'); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
}) |
|
|
}) |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
getitem(itemCode, callback) { |
|
|
getitem(itemCode, callback) { |
|
|
getitems(itemCode).then((res) => { |
|
|
getitems(itemCode).then((res) => { |
|
|
if (res === null) { |
|
|
if (res === null) { |
|
@ -527,7 +498,7 @@ |
|
|
this.showMessage(err.message); |
|
|
this.showMessage(err.message); |
|
|
}) |
|
|
}) |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
async addNewDetail(result) { |
|
|
async addNewDetail(result) { |
|
|
if (this.location == null) { |
|
|
if (this.location == null) { |
|
@ -540,7 +511,7 @@ |
|
|
if (balanceItem == null || balanceItem == undefined) { |
|
|
if (balanceItem == null || balanceItem == undefined) { |
|
|
setTimeout(res => { |
|
|
setTimeout(res => { |
|
|
scanFailedAudio() |
|
|
scanFailedAudio() |
|
|
showConfirmMsg("扫描的物料["+result.code+"]在任务中不存在,是否要添加为任务明细?", async confirm => { |
|
|
showConfirmMsg("扫描的物料[" + result.code + "]在任务中不存在,是否要添加为任务明细?", async confirm => { |
|
|
if (confirm) { |
|
|
if (confirm) { |
|
|
this.setDetailNoBalance(detail, result) |
|
|
this.setDetailNoBalance(detail, result) |
|
|
this.scanAllDetails.unshift(detail); |
|
|
this.scanAllDetails.unshift(detail); |
|
@ -561,17 +532,18 @@ |
|
|
} else { |
|
|
} else { |
|
|
setTimeout(res => { |
|
|
setTimeout(res => { |
|
|
scanFailedAudio() |
|
|
scanFailedAudio() |
|
|
showConfirmMsg("扫描的物料["+result.itemCode+"]在任务中不存在,是否要添加为任务明细?", async confirm => { |
|
|
showConfirmMsg("扫描的物料[" + result.itemCode + "]在任务中不存在,是否要添加为任务明细?", |
|
|
if (confirm) { |
|
|
async confirm => { |
|
|
this.setDetailByBalance(detail, balanceItem); |
|
|
if (confirm) { |
|
|
this.scanAllDetails.unshift(detail); |
|
|
this.setDetailByBalance(detail, balanceItem); |
|
|
this.initList(); |
|
|
this.scanAllDetails.unshift(detail); |
|
|
this.calcScanCount(); |
|
|
this.initList(); |
|
|
this.$forceUpdate(); |
|
|
this.calcScanCount(); |
|
|
} else { |
|
|
this.$forceUpdate(); |
|
|
this.scanPopupGetfocus(); |
|
|
} else { |
|
|
} |
|
|
this.scanPopupGetfocus(); |
|
|
}); |
|
|
} |
|
|
|
|
|
}); |
|
|
}, 100) |
|
|
}, 100) |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
@ -604,14 +576,14 @@ |
|
|
creatDetail(result) { |
|
|
creatDetail(result) { |
|
|
let detail = { |
|
|
let detail = { |
|
|
isNew: true, |
|
|
isNew: true, |
|
|
isDelete:false, |
|
|
isDelete: false, |
|
|
modified:true, |
|
|
modified: true, |
|
|
countTime: new Date(), |
|
|
countTime: new Date(), |
|
|
masterID: this.id, |
|
|
masterID: this.id, |
|
|
countLabel: "", |
|
|
countLabel: "", |
|
|
number: this.datacontent.number, |
|
|
number: this.datacontent.number, |
|
|
inventoryStage:this.datacontent.inventoryStage, |
|
|
inventoryStage: this.datacontent.inventoryStage, |
|
|
|
|
|
|
|
|
inventoryQty: 0, |
|
|
inventoryQty: 0, |
|
|
uom: result.uom, |
|
|
uom: result.uom, |
|
|
|
|
|
|
|
@ -652,23 +624,41 @@ |
|
|
setDetailNoBalance(detail, result) { |
|
|
setDetailNoBalance(detail, result) { |
|
|
detail.InventoryLocationCode = ""; |
|
|
detail.InventoryLocationCode = ""; |
|
|
detail.inventoryQty = 0; |
|
|
detail.inventoryQty = 0; |
|
|
detail.countQty = 1; |
|
|
detail.countQty = 0; |
|
|
detail.status = 2; |
|
|
detail.status = 2; |
|
|
detail.uom =result.uom |
|
|
detail.uom = result.uom |
|
|
return detail; |
|
|
return detail; |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
setQty(item, qty, isAdd) { |
|
|
setQty(item, qty, isAdd) { |
|
|
|
|
|
|
|
|
item.countQty = Number(qty); |
|
|
item.countQty = 0; |
|
|
item.countTime = new Date(); |
|
|
item.countTime = new Date(); |
|
|
item.isDelete =false; |
|
|
item.isDelete = false; |
|
|
item.modified =true; |
|
|
item.modified = true; |
|
|
item.countOperator = localStorage.userId; |
|
|
item.countOperator = localStorage.userId; |
|
|
if (isAdd) { |
|
|
if (isAdd) { |
|
|
this.scanAllDetails.unshift(item) |
|
|
this.scanAllDetails.unshift(item) |
|
|
}else { |
|
|
} else { |
|
|
item.countDescription="" |
|
|
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; |
|
|
|
|
|
item.countOperator = localStorage.userId; |
|
|
|
|
|
if (isAdd) { |
|
|
|
|
|
this.scanAllDetails.unshift(item) |
|
|
|
|
|
} else { |
|
|
|
|
|
item.countDescription = "" |
|
|
} |
|
|
} |
|
|
this.initList(); |
|
|
this.initList(); |
|
|
this.scanPopupGetfocus(); |
|
|
this.scanPopupGetfocus(); |
|
@ -681,10 +671,10 @@ |
|
|
content: '是否移除选择的行?', |
|
|
content: '是否移除选择的行?', |
|
|
success: res => { |
|
|
success: res => { |
|
|
if (res.confirm) { |
|
|
if (res.confirm) { |
|
|
if(item.isNew){ |
|
|
if (item.isNew) { |
|
|
this.showList.splice(index, 1) |
|
|
this.showList.splice(index, 1) |
|
|
this.scanAllDetails.splice(index, 1) |
|
|
this.scanAllDetails.splice(index, 1) |
|
|
}else { |
|
|
} else { |
|
|
item.isDelete = true; |
|
|
item.isDelete = true; |
|
|
item.modified = true; |
|
|
item.modified = true; |
|
|
} |
|
|
} |
|
@ -716,27 +706,26 @@ |
|
|
this.showMessage("盘点数量为0,请先扫描") |
|
|
this.showMessage("盘点数量为0,请先扫描") |
|
|
return; |
|
|
return; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
var commitList=this.scanAllDetails.filter(r=>r.modified==true) |
|
|
var commitList = this.scanAllDetails.filter(r => r.modified == true) |
|
|
if (commitList.length == 0) { |
|
|
if (commitList.length == 0) { |
|
|
this.showMessage("没有修改的数据,请先扫描") |
|
|
this.showMessage("没有修改的数据,请先扫描") |
|
|
return; |
|
|
return; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var temp=""; |
|
|
var temp = ""; |
|
|
for (var i = 0; i < this.scanAllDetails.length; i++) { |
|
|
for (var i = 0; i < this.scanAllDetails.length; i++) { |
|
|
if(this.scanAllDetails[i].countQty==0){ |
|
|
if (this.scanAllDetails[i].countQty == 0) { |
|
|
temp=this.scanAllDetails[i]; |
|
|
temp = this.scanAllDetails[i]; |
|
|
break; |
|
|
break; |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
if(temp!=""){ |
|
|
if (temp != "") { |
|
|
this.showMessage("ERP料号:["+temp.itemCode+"]盘点数量为0,请输入盘点数量") |
|
|
this.showMessage("ERP料号:[" + temp.itemCode + "]盘点数量为0,请输入盘点数量") |
|
|
return; |
|
|
return; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
this.finishJob(); |
|
|
this.finishJob(); |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
@ -746,13 +735,7 @@ |
|
|
title: "提交中...", |
|
|
title: "提交中...", |
|
|
mask: true |
|
|
mask: true |
|
|
}); |
|
|
}); |
|
|
this.datacontent.depDetails =this.scanAllDetails.filter(r=>r.modified==true&&r.isDelete==false); |
|
|
var params =this.setParams(); |
|
|
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) |
|
|
|
|
|
finishCountJob(this.id, params) |
|
|
finishCountJob(this.id, params) |
|
|
.then(res => { |
|
|
.then(res => { |
|
|
uni.hideLoading(); |
|
|
uni.hideLoading(); |
|
@ -766,24 +749,50 @@ |
|
|
}); |
|
|
}); |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
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) { |
|
|
qtyChanged(value, item) { |
|
|
if (value > 0) { |
|
|
if (value > 0) { |
|
|
item.countTime = new Date(); |
|
|
item.countTime = new Date(); |
|
|
item.countOperator = localStorage.userId; |
|
|
item.countOperator = localStorage.userId; |
|
|
this.calcScanCount(); |
|
|
this.calcScanCount(); |
|
|
if(value==item.countQty){ |
|
|
if (value == item.countQty) { |
|
|
item.modified=false |
|
|
item.modified = false |
|
|
}else { |
|
|
} else { |
|
|
item.modified=true |
|
|
item.modified = true |
|
|
} |
|
|
} |
|
|
}else { |
|
|
} else { |
|
|
|
|
|
item.countTime = new Date(); |
|
|
|
|
|
item.modified = true |
|
|
this.showMessage("盘点数量必须大于0") |
|
|
this.showMessage("盘点数量必须大于0") |
|
|
} |
|
|
} |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
calcScanCount() { |
|
|
calcScanCount() { |
|
|
this.scanCount = this.scanAllDetails.filter(r=>r.isDelete==false).length; |
|
|
this.scanCount = this.scanAllDetails.filter(r => r.isDelete == false).length; |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
bindPickerChange(e, item) { |
|
|
bindPickerChange(e, item) { |
|
|