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