Browse Source

增加校验

hella_online_20240829
niexiting 2 months ago
parent
commit
ae70a4e6d5
  1. 389
      src/pages/count/job/fuzzyCountDetail.vue

389
src/pages/count/job/fuzzyCountDetail.vue

@ -51,7 +51,7 @@
<view class="card_packing_code" style="padding: 5px; font-weight: bold ; font-size: 40rpx;">
{{detailSource.length}}
</view>
<view >
<view>
()
</view>
</view>
@ -64,8 +64,8 @@
<win-scan-button v-if="fromLocationCode!=''" @goScan='openScanPopup'></win-scan-button>
<win-scan-pack ref="scanPopup" @getResult='getScanResult'></win-scan-pack>
<win-scan-location ref="scanLocationCode" title="盘点库位" @getLocation='getLocation'></win-scan-location>
<count-qty-edit ref="countQtyEdit" @confirm="editConfirm" @close="editClose" :isShowStatus="true" :isShowDesc="false"
:allowEditStatus="editInventoryStatus" :isShowBalance="jobContent.isOpenCount=='TRUE'">
<count-qty-edit ref="countQtyEdit" @confirm="editConfirm" @close="editClose" :isShowStatus="true"
:isShowDesc="false" :allowEditStatus="editInventoryStatus" :isShowBalance="jobContent.isOpenCount=='TRUE'">
</count-qty-edit>
<comMessage ref="comMessage"></comMessage>
</view>
@ -326,218 +326,221 @@
if (this.itemRangeValue != '') {
let index = this.itemRangeValue.indexOf(packInfo.itemCode)
if (index < 0) {
this.afterScanLocation("物料代码【" + packInfo.itemCode + "】,不在盘点范围【" + this.itemRangeValue + "】内");
return;
this.showErrorMessage("物料代码【"+ packInfo.itemCode + "】,不在盘点范围【" + this.itemRangeValue + "】内")
return;
}
else {
this.onScan(packInfo);
}
} else {
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");
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 => {
},
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 => {
if (res) {
this.closeScanPopup();
this.edit(detail);
} else {
this.scanPopupGetFocus();
this.detailSource.splice(index, 1)
}
});
}
}
},
},
//
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) {
this.detailSource.splice(index, 1)
}
});
},
detail(item) {
this.showItem = item;
this.$refs.detailInfoPopup.openPopup(item);
},
detail(item) {
this.showItem = item;
this.$refs.detailInfoPopup.openPopup(item);
},
commit() {
if (this.detailSource.length == 0) {
this.$refs.comMessage.showMessage('还未扫描,是否要继续提交', res => {
if (res) {
commit() {
if (this.detailSource.length == 0) {
this.$refs.comMessage.showMessage('还未扫描,是否要继续提交', res => {
if (res) {
this.commitJob();
}
});
} else {
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)
})
},
},
setParams() {
var creator = this.$store.state.user.id
this.jobContent.subList = this.detailSource
// this.jobContent.creator = creator;
return this.jobContent;
},
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)
})
},
showMessage(message) {
this.$refs.comMessage.showMessage(message, res => {
if (res) {
this.afterCloseMessage()
}
});
},
showErrorMessage(message) {
this.$refs.comMessage.showErrorMessage(message, res => {
if (res) {
this.afterCloseMessage()
}
});
},
setParams() {
var creator = this.$store.state.user.id
this.jobContent.subList = this.detailSource
// this.jobContent.creator = creator;
return this.jobContent;
},
showScanMessage(message) {
this.$refs.comMessage.showScanMessage(message);
},
afterCloseMessage() {
this.scanPopupGetFocus();
},
showMessage(message) {
this.$refs.comMessage.showMessage(message, res => {
if (res) {
this.afterCloseMessage()
}
});
},
showErrorMessage(message) {
this.$refs.comMessage.showErrorMessage(message, res => {
if (res) {
this.afterCloseMessage()
}
});
},
closeScanMessage() {
this.scanPopupGetFocus();
},
showScanMessage(message) {
this.$refs.comMessage.showScanMessage(message);
},
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" ? "明盘" : "盲盘"
},
afterCloseMessage() {
this.scanPopupGetFocus();
},
getCountScopeName(value) {
let item = getCountScopeType(value);
return item.label;
},
closeScanMessage() {
this.scanPopupGetFocus();
},
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">

Loading…
Cancel
Save