|
|
@ -2,22 +2,24 @@ |
|
|
|
<view class="page-wraper"> |
|
|
|
<view class="page-header"> |
|
|
|
<view class="header_job_top"> |
|
|
|
<job-top :dataContent="jobContent"></job-top> |
|
|
|
<uni-collapse ref="collapse"> |
|
|
|
<uni-collapse-item :open="true"> |
|
|
|
<template v-slot:title> |
|
|
|
<view class="card_itemName" style="padding: 3px 5px; font-size: 28rpx;"> |
|
|
|
盘点范围 |
|
|
|
<view class="header-view"> |
|
|
|
<job-top :dataContent="jobContent"></job-top> |
|
|
|
<uni-collapse ref="collapse"> |
|
|
|
<uni-collapse-item :open="true"> |
|
|
|
<template v-slot:title> |
|
|
|
<view class="card_itemName" style="padding: 3px 5px; font-size: 28rpx;"> |
|
|
|
盘点范围 |
|
|
|
</view> |
|
|
|
</template> |
|
|
|
<view v-for="(range, index) in jobContent.countRange" :key="index"> |
|
|
|
<view class="card_view"> |
|
|
|
<text class="card_packing_code ">{{getCountScopeName(range.type)}}</text> |
|
|
|
<text class="card_content ">{{range.value}}</text> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
</template> |
|
|
|
<view v-for="(range, index) in jobContent.countRange" :key="index"> |
|
|
|
<view class="card_view"> |
|
|
|
<text class="card_packing_code ">{{getCountScopeName(range.type)}}</text> |
|
|
|
<text class="card_content ">{{range.value}}</text> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
</uni-collapse-item> |
|
|
|
</uni-collapse> |
|
|
|
</uni-collapse-item> |
|
|
|
</uni-collapse> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
<view class="card_view" v-if="fromLocationCode!=''"> |
|
|
|
<text class="card_location">盘点库位</text> |
|
|
@ -326,221 +328,220 @@ |
|
|
|
if (this.itemRangeValue != '') { |
|
|
|
let index = this.itemRangeValue.indexOf(packInfo.itemCode) |
|
|
|
if (index < 0) { |
|
|
|
this.showErrorMessage("物料代码【"+ packInfo.itemCode + "】,不在盘点范围【" + this.itemRangeValue + "】内") |
|
|
|
return; |
|
|
|
} |
|
|
|
else { |
|
|
|
this.onScan(packInfo); |
|
|
|
} |
|
|
|
this.showErrorMessage("物料代码【" + packInfo.itemCode + "】,不在盘点范围【" + this.itemRangeValue + "】内") |
|
|
|
return; |
|
|
|
} else { |
|
|
|
this.onScan(packInfo); |
|
|
|
} |
|
|
|
}, |
|
|
|
|
|
|
|
onScan(packInfo) { |
|
|
|
let detail = this.detailSource.find(r => r.itemCode == packInfo.itemCode && r.packingNumber == |
|
|
|
packInfo |
|
|
|
.number && r.batch == packInfo.batch && r.inventoryStatus == "OK"); |
|
|
|
if (detail == undefined) { |
|
|
|
detail = this.createDetailInfo(packInfo); |
|
|
|
this.detailSource.unshift(detail) |
|
|
|
this.scanPopupGetFocus(); |
|
|
|
} else { |
|
|
|
let index = this.detailSource.findIndex(r => r.itemCode == packInfo.itemCode && r |
|
|
|
.packingNumber == |
|
|
|
packInfo |
|
|
|
.number && r.batch == packInfo.batch && r.inventoryStatus == "OK"); |
|
|
|
if (index >= 0) { |
|
|
|
this.detailSource.unshift(this.detailSource.splice(index, 1)[0]); //置顶 |
|
|
|
//提交 |
|
|
|
this.$refs.comMessage.showQuestionMessage('该箱码已经扫描,是否要编辑盘点明细?', res => { |
|
|
|
if (res) { |
|
|
|
this.closeScanPopup(); |
|
|
|
this.edit(detail); |
|
|
|
} else { |
|
|
|
this.scanPopupGetFocus(); |
|
|
|
} |
|
|
|
}); |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
|
|
|
|
//创建盘盈的明细 |
|
|
|
createDetailInfo(packInfo) { |
|
|
|
var detail = { |
|
|
|
scaned: true, |
|
|
|
// countDetailNumber: "", |
|
|
|
number: this.jobContent.number, |
|
|
|
packingNumber: packInfo.number, |
|
|
|
batch: packInfo.batch, |
|
|
|
inventoryStatus: "OK", |
|
|
|
itemCode: packInfo.itemCode, |
|
|
|
itemName: packInfo.itemName, |
|
|
|
itemDesc1: packInfo.itemDesc1, |
|
|
|
itemDesc2: packInfo.itemDesc2, |
|
|
|
projectCode: "", |
|
|
|
qty: packInfo.qty, |
|
|
|
packUnit: packInfo.packUnit, |
|
|
|
packQty: packInfo.packQty, |
|
|
|
packUom: packInfo.packUom, |
|
|
|
uom: packInfo.uom, |
|
|
|
remark: "", |
|
|
|
locationCode: this.fromLocationCode, |
|
|
|
creator: this.$store.state.user.id, |
|
|
|
warehouseCode: this.fromLocation.warehouseCode, |
|
|
|
areaCode: this.fromLocation.areaCode, |
|
|
|
locationGroupCode: this.fromLocation.locationGroupCode, |
|
|
|
createTime: new Date().getTime(), |
|
|
|
countTime: new Date().getTime(), |
|
|
|
countUser: this.$store.state.user.id, |
|
|
|
countDescription: '', |
|
|
|
countQty: packInfo.qty |
|
|
|
} |
|
|
|
return detail; |
|
|
|
}, |
|
|
|
|
|
|
|
editClose() { |
|
|
|
this.$refs.countQtyEdit.closeEditPopup(); |
|
|
|
}, |
|
|
|
|
|
|
|
swipeClick(e, item, index) { |
|
|
|
if (e.content.text == "编辑") { |
|
|
|
this.edit(item) |
|
|
|
} else if (e.content.text == "移除") { |
|
|
|
this.remove(item) |
|
|
|
} |
|
|
|
}, |
|
|
|
|
|
|
|
//编辑盘点结果 |
|
|
|
edit(item) { |
|
|
|
let that = this; |
|
|
|
this.currentEditItem = item; |
|
|
|
item.handleQty = item.qty; |
|
|
|
this.$refs.countQtyEdit.openEditPopup(item, null); |
|
|
|
}, |
|
|
|
|
|
|
|
editConfirm(qty, inventoryStatus, mode) { |
|
|
|
let that = this; |
|
|
|
this.currentEditItem.countQty = qty; |
|
|
|
this.currentEditItem.qty = qty; |
|
|
|
this.currentEditItem.inventoryStatus = inventoryStatus; |
|
|
|
this.openScanPopup(); |
|
|
|
}, |
|
|
|
|
|
|
|
editClose() { |
|
|
|
this.scanPopupGetFocus(); |
|
|
|
}, |
|
|
|
|
|
|
|
remove(item, index) { |
|
|
|
this.showQuestionMessage("是否要移除扫描信息?", res => { |
|
|
|
} else { |
|
|
|
this.onScan(packInfo); |
|
|
|
} |
|
|
|
}, |
|
|
|
|
|
|
|
onScan(packInfo) { |
|
|
|
let detail = this.detailSource.find(r => r.itemCode == packInfo.itemCode && r.packingNumber == |
|
|
|
packInfo |
|
|
|
.number && r.batch == packInfo.batch && r.inventoryStatus == "OK"); |
|
|
|
if (detail == undefined) { |
|
|
|
detail = this.createDetailInfo(packInfo); |
|
|
|
this.detailSource.unshift(detail) |
|
|
|
this.scanPopupGetFocus(); |
|
|
|
} else { |
|
|
|
let index = this.detailSource.findIndex(r => r.itemCode == packInfo.itemCode && r |
|
|
|
.packingNumber == |
|
|
|
packInfo |
|
|
|
.number && r.batch == packInfo.batch && r.inventoryStatus == "OK"); |
|
|
|
if (index >= 0) { |
|
|
|
this.detailSource.unshift(this.detailSource.splice(index, 1)[0]); //置顶 |
|
|
|
//提交 |
|
|
|
this.$refs.comMessage.showQuestionMessage('该箱码已经扫描,是否要编辑盘点明细?', res => { |
|
|
|
if (res) { |
|
|
|
this.detailSource.splice(index, 1) |
|
|
|
this.closeScanPopup(); |
|
|
|
this.edit(detail); |
|
|
|
} else { |
|
|
|
this.scanPopupGetFocus(); |
|
|
|
} |
|
|
|
}); |
|
|
|
}, |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
|
|
|
|
//创建盘盈的明细 |
|
|
|
createDetailInfo(packInfo) { |
|
|
|
var detail = { |
|
|
|
scaned: true, |
|
|
|
// countDetailNumber: "", |
|
|
|
number: this.jobContent.number, |
|
|
|
packingNumber: packInfo.number, |
|
|
|
batch: packInfo.batch, |
|
|
|
inventoryStatus: "OK", |
|
|
|
itemCode: packInfo.itemCode, |
|
|
|
itemName: packInfo.itemName, |
|
|
|
itemDesc1: packInfo.itemDesc1, |
|
|
|
itemDesc2: packInfo.itemDesc2, |
|
|
|
projectCode: "", |
|
|
|
qty: packInfo.qty, |
|
|
|
packUnit: packInfo.packUnit, |
|
|
|
packQty: packInfo.packQty, |
|
|
|
packUom: packInfo.packUom, |
|
|
|
uom: packInfo.uom, |
|
|
|
remark: "", |
|
|
|
locationCode: this.fromLocationCode, |
|
|
|
creator: this.$store.state.user.id, |
|
|
|
warehouseCode: this.fromLocation.warehouseCode, |
|
|
|
areaCode: this.fromLocation.areaCode, |
|
|
|
locationGroupCode: this.fromLocation.locationGroupCode, |
|
|
|
createTime: new Date().getTime(), |
|
|
|
countTime: new Date().getTime(), |
|
|
|
countUser: this.$store.state.user.id, |
|
|
|
countDescription: '', |
|
|
|
countQty: packInfo.qty |
|
|
|
} |
|
|
|
return detail; |
|
|
|
}, |
|
|
|
|
|
|
|
editClose() { |
|
|
|
this.$refs.countQtyEdit.closeEditPopup(); |
|
|
|
}, |
|
|
|
|
|
|
|
detail(item) { |
|
|
|
this.showItem = item; |
|
|
|
this.$refs.detailInfoPopup.openPopup(item); |
|
|
|
}, |
|
|
|
swipeClick(e, item, index) { |
|
|
|
if (e.content.text == "编辑") { |
|
|
|
this.edit(item) |
|
|
|
} else if (e.content.text == "移除") { |
|
|
|
this.remove(item) |
|
|
|
} |
|
|
|
}, |
|
|
|
|
|
|
|
commit() { |
|
|
|
if (this.detailSource.length == 0) { |
|
|
|
this.$refs.comMessage.showMessage('还未扫描,是否要继续提交', res => { |
|
|
|
if (res) { |
|
|
|
this.commitJob(); |
|
|
|
} |
|
|
|
}); |
|
|
|
} else { |
|
|
|
//编辑盘点结果 |
|
|
|
edit(item) { |
|
|
|
let that = this; |
|
|
|
this.currentEditItem = item; |
|
|
|
item.handleQty = item.qty; |
|
|
|
this.$refs.countQtyEdit.openEditPopup(item, null); |
|
|
|
}, |
|
|
|
|
|
|
|
editConfirm(qty, inventoryStatus, mode) { |
|
|
|
let that = this; |
|
|
|
this.currentEditItem.countQty = qty; |
|
|
|
this.currentEditItem.qty = qty; |
|
|
|
this.currentEditItem.inventoryStatus = inventoryStatus; |
|
|
|
this.openScanPopup(); |
|
|
|
}, |
|
|
|
|
|
|
|
editClose() { |
|
|
|
this.scanPopupGetFocus(); |
|
|
|
}, |
|
|
|
|
|
|
|
remove(item, index) { |
|
|
|
this.showQuestionMessage("是否要移除扫描信息?", res => { |
|
|
|
if (res) { |
|
|
|
this.detailSource.splice(index, 1) |
|
|
|
} |
|
|
|
}); |
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
detail(item) { |
|
|
|
this.showItem = item; |
|
|
|
this.$refs.detailInfoPopup.openPopup(item); |
|
|
|
}, |
|
|
|
|
|
|
|
commit() { |
|
|
|
if (this.detailSource.length == 0) { |
|
|
|
this.$refs.comMessage.showMessage('还未扫描,是否要继续提交', res => { |
|
|
|
if (res) { |
|
|
|
this.commitJob(); |
|
|
|
} |
|
|
|
}, |
|
|
|
}); |
|
|
|
} else { |
|
|
|
this.commitJob(); |
|
|
|
} |
|
|
|
}, |
|
|
|
|
|
|
|
commitJob() { |
|
|
|
uni.showLoading({ |
|
|
|
title: "提交中....", |
|
|
|
mask: true |
|
|
|
}); |
|
|
|
var params = this.setParams() |
|
|
|
console.log("提交参数", JSON.stringify(params)); |
|
|
|
countJobSubmit(params).then(res => { |
|
|
|
uni.hideLoading() |
|
|
|
if (res.data == null) { |
|
|
|
this.showCommitSuccessMessage("提交成功") |
|
|
|
} else { |
|
|
|
this.showErrorMessage("提交失败[" + res.msg + "]") |
|
|
|
} |
|
|
|
}).catch(error => { |
|
|
|
uni.hideLoading() |
|
|
|
this.showErrorMessage(error) |
|
|
|
}) |
|
|
|
}, |
|
|
|
commitJob() { |
|
|
|
uni.showLoading({ |
|
|
|
title: "提交中....", |
|
|
|
mask: true |
|
|
|
}); |
|
|
|
var params = this.setParams() |
|
|
|
console.log("提交参数", JSON.stringify(params)); |
|
|
|
countJobSubmit(params).then(res => { |
|
|
|
uni.hideLoading() |
|
|
|
if (res.data == null) { |
|
|
|
this.showCommitSuccessMessage("提交成功") |
|
|
|
} else { |
|
|
|
this.showErrorMessage("提交失败[" + res.msg + "]") |
|
|
|
} |
|
|
|
}).catch(error => { |
|
|
|
uni.hideLoading() |
|
|
|
this.showErrorMessage(error) |
|
|
|
}) |
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
setParams() { |
|
|
|
var creator = this.$store.state.user.id |
|
|
|
this.jobContent.subList = this.detailSource |
|
|
|
// this.jobContent.creator = creator; |
|
|
|
return this.jobContent; |
|
|
|
}, |
|
|
|
setParams() { |
|
|
|
var creator = this.$store.state.user.id |
|
|
|
this.jobContent.subList = this.detailSource |
|
|
|
// this.jobContent.creator = creator; |
|
|
|
return this.jobContent; |
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
showMessage(message) { |
|
|
|
this.$refs.comMessage.showMessage(message, res => { |
|
|
|
if (res) { |
|
|
|
this.afterCloseMessage() |
|
|
|
} |
|
|
|
}); |
|
|
|
}, |
|
|
|
showErrorMessage(message) { |
|
|
|
this.$refs.comMessage.showErrorMessage(message, res => { |
|
|
|
if (res) { |
|
|
|
this.afterCloseMessage() |
|
|
|
} |
|
|
|
}); |
|
|
|
}, |
|
|
|
showMessage(message) { |
|
|
|
this.$refs.comMessage.showMessage(message, res => { |
|
|
|
if (res) { |
|
|
|
this.afterCloseMessage() |
|
|
|
} |
|
|
|
}); |
|
|
|
}, |
|
|
|
showErrorMessage(message) { |
|
|
|
this.$refs.comMessage.showErrorMessage(message, res => { |
|
|
|
if (res) { |
|
|
|
this.afterCloseMessage() |
|
|
|
} |
|
|
|
}); |
|
|
|
}, |
|
|
|
|
|
|
|
showScanMessage(message) { |
|
|
|
this.$refs.comMessage.showScanMessage(message); |
|
|
|
}, |
|
|
|
showScanMessage(message) { |
|
|
|
this.$refs.comMessage.showScanMessage(message); |
|
|
|
}, |
|
|
|
|
|
|
|
afterCloseMessage() { |
|
|
|
this.scanPopupGetFocus(); |
|
|
|
}, |
|
|
|
afterCloseMessage() { |
|
|
|
this.scanPopupGetFocus(); |
|
|
|
}, |
|
|
|
|
|
|
|
closeScanMessage() { |
|
|
|
this.scanPopupGetFocus(); |
|
|
|
}, |
|
|
|
closeScanMessage() { |
|
|
|
this.scanPopupGetFocus(); |
|
|
|
}, |
|
|
|
|
|
|
|
showCommitSuccessMessage(hint) { |
|
|
|
this.$refs.comMessage.showSuccessMessage(hint, res => { |
|
|
|
this.fromLocationCode = ''; |
|
|
|
this.fromLocation = {}; |
|
|
|
this.detailSource = []; |
|
|
|
this.showFromLocationPopup(); |
|
|
|
}) |
|
|
|
}, |
|
|
|
getCountStageName(value) { |
|
|
|
return getCountStageName(value) |
|
|
|
}, |
|
|
|
isOpenCount(value) { |
|
|
|
return value == "TRUE" ? "明盘" : "盲盘" |
|
|
|
}, |
|
|
|
|
|
|
|
getCountScopeName(value) { |
|
|
|
let item = getCountScopeType(value); |
|
|
|
return item.label; |
|
|
|
}, |
|
|
|
|
|
|
|
showQuestionMessage(message, callback) { |
|
|
|
this.$refs.comMessage.showQuestionMessage(message, res => { |
|
|
|
callback(res); |
|
|
|
}); |
|
|
|
}, |
|
|
|
} |
|
|
|
showCommitSuccessMessage(hint) { |
|
|
|
this.$refs.comMessage.showSuccessMessage(hint, res => { |
|
|
|
this.fromLocationCode = ''; |
|
|
|
this.fromLocation = {}; |
|
|
|
this.detailSource = []; |
|
|
|
this.showFromLocationPopup(); |
|
|
|
}) |
|
|
|
}, |
|
|
|
getCountStageName(value) { |
|
|
|
return getCountStageName(value) |
|
|
|
}, |
|
|
|
isOpenCount(value) { |
|
|
|
return value == "TRUE" ? "明盘" : "盲盘" |
|
|
|
}, |
|
|
|
|
|
|
|
getCountScopeName(value) { |
|
|
|
let item = getCountScopeType(value); |
|
|
|
return item.label; |
|
|
|
}, |
|
|
|
|
|
|
|
showQuestionMessage(message, callback) { |
|
|
|
this.$refs.comMessage.showQuestionMessage(message, res => { |
|
|
|
callback(res); |
|
|
|
}); |
|
|
|
}, |
|
|
|
} |
|
|
|
} |
|
|
|
</script> |
|
|
|
|
|
|
|
<style scoped lang="scss"> |
|
|
|