|
@ -7,6 +7,7 @@ |
|
|
:newCount="newCount" :location="location" :countOrder="datacontent.inventoryStage"> |
|
|
:newCount="newCount" :location="location" :countOrder="datacontent.inventoryStage"> |
|
|
</com-count-scan-detail> |
|
|
</com-count-scan-detail> |
|
|
</view> |
|
|
</view> |
|
|
|
|
|
<!-- <button @click="open">打开</button> --> |
|
|
<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"> |
|
@ -144,6 +145,7 @@ |
|
|
<!-- com-message必须放在最下层 --> |
|
|
<!-- com-message必须放在最下层 --> |
|
|
<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> --> |
|
|
|
|
|
<wz-select-popup ref="wzSelectPopup" @select="selectCheckbox" /> |
|
|
</view> |
|
|
</view> |
|
|
</template> |
|
|
</template> |
|
|
|
|
|
|
|
@ -242,7 +244,12 @@ |
|
|
pageSize: 20, |
|
|
pageSize: 20, |
|
|
jobStatus: "", |
|
|
jobStatus: "", |
|
|
index: 0, |
|
|
index: 0, |
|
|
showList: [] |
|
|
showList: [], |
|
|
|
|
|
userForm: { |
|
|
|
|
|
names: [], |
|
|
|
|
|
values: [], |
|
|
|
|
|
origin: [] |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
}, |
|
|
}, |
|
|
props: {}, |
|
|
props: {}, |
|
@ -338,6 +345,43 @@ |
|
|
}) |
|
|
}) |
|
|
}, |
|
|
}, |
|
|
methods: { |
|
|
methods: { |
|
|
|
|
|
open() { |
|
|
|
|
|
this.$refs.wzSelectPopup.open({ |
|
|
|
|
|
mode: 'radio', //radio checkbox 单选、多选 |
|
|
|
|
|
// dataList:[], //如果dataList传入了数组则直接使用传入的数组渲染,无需再配置proxyConfig |
|
|
|
|
|
selected: this.userForm.values, //已选中的数据 |
|
|
|
|
|
proxyConfig: { //组件内部代理请求数据配置 |
|
|
|
|
|
reqFun: this.reqGetList, //请求方法,在方法中请返回Promise.resolve([]) |
|
|
|
|
|
localPaging: false //前端本地分页 |
|
|
|
|
|
}, |
|
|
|
|
|
search: { |
|
|
|
|
|
type: 'remote', //local本地数据搜索 | remote请求接口 |
|
|
|
|
|
}, |
|
|
|
|
|
fields: { |
|
|
|
|
|
label: 'name', |
|
|
|
|
|
value: 'code' |
|
|
|
|
|
} |
|
|
|
|
|
}) |
|
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
selectCheckbox(mode, data) { |
|
|
|
|
|
console.log(mode, data) |
|
|
|
|
|
}, |
|
|
|
|
|
reqGetList(data) { |
|
|
|
|
|
|
|
|
|
|
|
let params = { |
|
|
|
|
|
pageSize: data.pageSize, |
|
|
|
|
|
pageIndex: data.pageIndex, |
|
|
|
|
|
itemCode:data.searchValue |
|
|
|
|
|
}; |
|
|
|
|
|
return getBalancesByFilterAsync(params); |
|
|
|
|
|
// return simulationReqGetList({ |
|
|
|
|
|
// pageIndex: data.pageIndex, |
|
|
|
|
|
// pageSize: data.pageSize, |
|
|
|
|
|
// name: data.searchValue |
|
|
|
|
|
// }) |
|
|
|
|
|
}, |
|
|
|
|
|
|
|
|
initList() { |
|
|
initList() { |
|
|
this.index = 1; |
|
|
this.index = 1; |
|
|
this.showList = [] |
|
|
this.showList = [] |
|
@ -360,12 +404,12 @@ |
|
|
that.originalDetails = res.details; |
|
|
that.originalDetails = res.details; |
|
|
that.allCount = res.details.length |
|
|
that.allCount = res.details.length |
|
|
|
|
|
|
|
|
that.scanAllDetails = res.depDetails.filter(r=>r.inventoryStage==res.inventoryStage); |
|
|
that.scanAllDetails = res.depDetails.filter(r => r.inventoryStage == res.inventoryStage); |
|
|
that.scanCount = that.scanAllDetails.length |
|
|
that.scanCount = that.scanAllDetails.length |
|
|
|
|
|
|
|
|
that.scanAllDetails.forEach(res=>{ |
|
|
that.scanAllDetails.forEach(res => { |
|
|
res.IsDelete = false; |
|
|
res.IsDelete = false; |
|
|
res.modified=false; |
|
|
res.modified = false; |
|
|
}) |
|
|
}) |
|
|
|
|
|
|
|
|
this.initList() |
|
|
this.initList() |
|
@ -388,7 +432,7 @@ |
|
|
//当前页起始索引 |
|
|
//当前页起始索引 |
|
|
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) |
|
|
|
|
|
|
|
|
}, |
|
|
}, |
|
@ -398,7 +442,7 @@ |
|
|
let itemCode = result.data.itemCode; |
|
|
let itemCode = result.data.itemCode; |
|
|
let packingCode = result.data.code === null ? '' : result.data.code; |
|
|
let packingCode = result.data.code === null ? '' : result.data.code; |
|
|
var itemScan = this.scanAllDetails.filter(r => |
|
|
var itemScan = this.scanAllDetails.filter(r => |
|
|
r.packingCode == packingCode&&r.inventoryStage==this.datacontent.inventoryStage) |
|
|
r.packingCode == packingCode && r.inventoryStage == this.datacontent.inventoryStage) |
|
|
if (itemScan.length > 0) { |
|
|
if (itemScan.length > 0) { |
|
|
setTimeout(res => { |
|
|
setTimeout(res => { |
|
|
showConfirmMsg("箱码【" + packingCode + "】已经扫描,是否覆盖已经扫描的信息", res => { |
|
|
showConfirmMsg("箱码【" + packingCode + "】已经扫描,是否覆盖已经扫描的信息", res => { |
|
@ -413,12 +457,13 @@ |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
let items = this.originalDetails.filter(r => |
|
|
let items = this.originalDetails.filter(r => |
|
|
r.packingCode === packingCode&&r.inventoryStage==this.datacontent.inventoryStage) |
|
|
r.packingCode === packingCode && 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; |
|
|
this.setQty(item, item.inventoryQty, true); |
|
|
this.setQty(item, item.inventoryQty, true); |
|
|
} else { |
|
|
} else { |
|
|
this.showMessage('盘点数量异常,箱码【' + packingCode + '】的出现多条数据'); |
|
|
this.showMessage('盘点数量异常,箱码【' + packingCode + '】的出现多条数据'); |
|
@ -497,13 +542,13 @@ |
|
|
creatDetail(result, balanceItem) { |
|
|
creatDetail(result, balanceItem) { |
|
|
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.data.uom, |
|
|
uom: result.data.uom, |
|
@ -539,7 +584,7 @@ |
|
|
detail.inventoryQty = balanceItem.qty; |
|
|
detail.inventoryQty = balanceItem.qty; |
|
|
detail.countQty = balanceItem.qty; |
|
|
detail.countQty = balanceItem.qty; |
|
|
detail.status = balanceItem.status; |
|
|
detail.status = balanceItem.status; |
|
|
|
|
|
|
|
|
return detail; |
|
|
return detail; |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
@ -554,13 +599,13 @@ |
|
|
setQty(item, qty, isAdd) { |
|
|
setQty(item, qty, isAdd) { |
|
|
item.countQty = Number(qty); |
|
|
item.countQty = Number(qty); |
|
|
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.initList(); |
|
|
this.scanPopupGetfocus(); |
|
|
this.scanPopupGetfocus(); |
|
@ -573,8 +618,13 @@ |
|
|
content: '是否移除选择的行?', |
|
|
content: '是否移除选择的行?', |
|
|
success: res => { |
|
|
success: res => { |
|
|
if (res.confirm) { |
|
|
if (res.confirm) { |
|
|
item.IsDelete = true; |
|
|
if(item.isNew){ |
|
|
item.modified =true; |
|
|
this.showList.splice(index, 1) |
|
|
|
|
|
this.scanAllDetails.splice(index, 1) |
|
|
|
|
|
}else { |
|
|
|
|
|
item.IsDelete = true; |
|
|
|
|
|
item.modified = true; |
|
|
|
|
|
} |
|
|
// this.scanAllDetails.splice(index, 1); |
|
|
// this.scanAllDetails.splice(index, 1); |
|
|
this.initList(); |
|
|
this.initList(); |
|
|
this.scanPopupGetfocus(); |
|
|
this.scanPopupGetfocus(); |
|
@ -600,33 +650,33 @@ |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
submit() { |
|
|
submit() { |
|
|
|
|
|
|
|
|
if (this.scanAllDetails.length == 0) { |
|
|
if (this.scanAllDetails.length == 0) { |
|
|
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("箱码:["+temp.packingCode+"]盘点数量为0,请输入盘点数量") |
|
|
this.showMessage("箱码:[" + temp.packingCode + "]盘点数量为0,请输入盘点数量") |
|
|
return; |
|
|
return; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
this.finishJob(); |
|
|
this.finishJob(); |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
@ -636,13 +686,13 @@ |
|
|
title: "提交中...", |
|
|
title: "提交中...", |
|
|
mask: true |
|
|
mask: true |
|
|
}); |
|
|
}); |
|
|
this.datacontent.depDetails = this.scanAllDetails.filter(r=>r.modified==true); |
|
|
this.datacontent.depDetails = this.scanAllDetails.filter(r => r.modified == true); |
|
|
this.datacontent.details =[]; |
|
|
this.datacontent.details = []; |
|
|
that.datacontent.completeUserId = localStorage.getItem('userId') |
|
|
that.datacontent.completeUserId = localStorage.getItem('userId') |
|
|
that.datacontent.completeUserName = localStorage.getItem('userName_CN') |
|
|
that.datacontent.completeUserName = localStorage.getItem('userName_CN') |
|
|
that.datacontent.completeTime = getCurrDateTime() |
|
|
that.datacontent.completeTime = getCurrDateTime() |
|
|
let params = JSON.stringify(this.datacontent); |
|
|
let params = JSON.stringify(this.datacontent); |
|
|
console.log("提交参数",params) |
|
|
console.log("提交参数", params) |
|
|
finishCountJob(this.id, params) |
|
|
finishCountJob(this.id, params) |
|
|
.then(res => { |
|
|
.then(res => { |
|
|
uni.hideLoading(); |
|
|
uni.hideLoading(); |
|
@ -661,19 +711,19 @@ |
|
|
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 { |
|
|
this.showMessage("盘点数量必须大于0") |
|
|
this.showMessage("盘点数量必须大于0") |
|
|
} |
|
|
} |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
calcScanCount() { |
|
|
calcScanCount() { |
|
|
this.scanCount = this.scanAllDetails.length; |
|
|
this.scanCount = this.scanAllDetails.filter(r=>r.IsDelete==false).length; |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
bindPickerChange(e, item) { |
|
|
bindPickerChange(e, item) { |
|
|