From ae70a4e6d536fff5b812c1d003c407b37f0ec133 Mon Sep 17 00:00:00 2001
From: niexiting <85552560@qq.com>
Date: Mon, 22 Jul 2024 09:46:37 +0800
Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E6=A0=A1=E9=AA=8C?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/pages/count/job/fuzzyCountDetail.vue | 389 ++++++++++++-----------
1 file changed, 196 insertions(+), 193 deletions(-)
diff --git a/src/pages/count/job/fuzzyCountDetail.vue b/src/pages/count/job/fuzzyCountDetail.vue
index f7d13e5b..3b44b2ca 100644
--- a/src/pages/count/job/fuzzyCountDetail.vue
+++ b/src/pages/count/job/fuzzyCountDetail.vue
@@ -51,7 +51,7 @@
{{detailSource.length}}
-
+
(箱)
@@ -64,8 +64,8 @@
-
+
@@ -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);
+ });
+ },
+ }
}
- }