From ab69394079e9a7d94cd29e64cb966ded334a9d43 Mon Sep 17 00:00:00 2001
From: niexiting <85552560@qq.com>
Date: Wed, 27 Mar 2024 11:52:41 +0800
Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E8=A3=85=E9=85=8D=E6=94=B6?=
=?UTF-8?q?=E8=B4=A7?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/mycomponents/scan/winComScanFG.vue | 5 +-
src/mycomponents/scan/winScanFGLabel.vue | 4 -
.../coms/comProductDetailCard.vue | 11 +-
.../job/FgProductReceiptDetail.vue | 115 ++++++++++--------
4 files changed, 76 insertions(+), 59 deletions(-)
diff --git a/src/mycomponents/scan/winComScanFG.vue b/src/mycomponents/scan/winComScanFG.vue
index d6e2628e..e23070b9 100644
--- a/src/mycomponents/scan/winComScanFG.vue
+++ b/src/mycomponents/scan/winComScanFG.vue
@@ -166,7 +166,6 @@
}
try {
-
let itemCode = content.substr(0, 10);
let productDate = content.substr(10, 8);
let batch = content.substr(18, 3);
@@ -177,9 +176,9 @@
productDate: productDate,
batch: batch,
order: order,
+ qty: 1,
content: content,
-
- success: true
+ success: true,
};
that.clear();
that.$emit("getResult", scanResult);
diff --git a/src/mycomponents/scan/winScanFGLabel.vue b/src/mycomponents/scan/winScanFGLabel.vue
index 30ba9746..99c9720b 100644
--- a/src/mycomponents/scan/winScanFGLabel.vue
+++ b/src/mycomponents/scan/winScanFGLabel.vue
@@ -41,10 +41,6 @@
isShowHistory: {
type: Boolean,
default: true
- },
- headerType: {
- type: String,
- default: 'HPQ'
}
},
data() {
diff --git a/src/pages/productReceipt/coms/comProductDetailCard.vue b/src/pages/productReceipt/coms/comProductDetailCard.vue
index b9ca0dc1..1203277c 100644
--- a/src/pages/productReceipt/coms/comProductDetailCard.vue
+++ b/src/pages/productReceipt/coms/comProductDetailCard.vue
@@ -12,6 +12,11 @@
:right-options="item.scaned?scanOptions:detailOptions">
+
+
+
@@ -34,7 +39,7 @@
import jobDetailPopup from '@/mycomponents/detail/jobDetailPopup.vue'
import productDetailInfoPopup from '@/pages/productReceipt/coms/productDetailInfoPopup.vue'
import winScanLocation from "@/mycomponents/scan/winScanLocation.vue"
-
+ import comFgCard from "@/pages/productReceipt/coms/comFgCard.vue"
import {
getDetailOption,
getPurchaseReceiptOption
@@ -47,7 +52,9 @@
recommendQtyEdit,
jobDetailPopup,
productDetailInfoPopup,
- winScanLocation
+ winScanLocation,
+ comFgCard
+
},
props: {
dataContent: {
diff --git a/src/pages/productReceipt/job/FgProductReceiptDetail.vue b/src/pages/productReceipt/job/FgProductReceiptDetail.vue
index 230afd1e..221820dc 100644
--- a/src/pages/productReceipt/job/FgProductReceiptDetail.vue
+++ b/src/pages/productReceipt/job/FgProductReceiptDetail.vue
@@ -17,12 +17,7 @@
-
-
-
-
@@ -76,6 +71,13 @@
getScanCount
} from '@/common/detail.js';
+ import {
+ Decimal
+ } from 'decimal.js'; //引入
+
+ import {
+ calc
+ } from '@/common/calc'
import winScanButton from '@/mycomponents/scan/winScanButton.vue'
import locationCompare from '@/mycomponents/location/locationCompare.vue'
@@ -83,7 +85,7 @@
import comDetailCard from "@/mycomponents/detail/comDetailCard.vue"
import jobTop from '@/mycomponents/job/jobTop.vue'
import comProductDetailCard from "@/pages/productReceipt/coms/comProductDetailCard.vue"
- import comFgCard from "@/pages/productReceipt/coms/comFgCard.vue"
+
export default {
name: 'receipt_detail',
@@ -94,7 +96,6 @@
winScanFgLabel,
jobTop,
comProductDetailCard,
- comFgCard
},
data() {
return {
@@ -202,26 +203,45 @@
},
getScanResult(result) {
- let source = that.detailSource;
- this.fgList.push(result);
- },
-
- //继续扫描
- continueScan() {
- this.scanCount = getScanCount(this.subList);
- if (this.scanCount == this.subList.length) {
- this.closeScanPopup();
- } else {
- this.scanPopupGetFocus();
+ //TODO缺少零件号的对应关系
+ let that = this;
+ if (that.detailSource.length > 0) {
+ let item = that.detailSource[0]; //应该按零件号查找
+ result.uom = item.uom;
+ if (item.subList.length > 0) {
+ let subItem = item.subList[0];
+ if (subItem.fgList == undefined) {
+ subItem.fgList = [];
+ }
+ subItem.fgList.push(result);
+ that.calcFgQty(this.detailSource);
+ setTimeout(r => {
+ this.scanPopupGetFocus();
+ }, 500)
+ }
}
},
+ calcFgQty() {
+ let that = this;
+ that.detailSource.forEach(item => {
+ item.subList.forEach(pack => {
+ pack.handleQty = new Decimal(0).toNumber();
+ pack.fgList.forEach(fg => {
+ if (fg != null) {
+ fg.qty = new Decimal(fg.qty).toNumber();
+ pack.handleQty = calc.add(pack.handleQty, fg.qty);
+ // item.qty = calc.add(item.qty, detail.qty);
+ }
+ })
+ })
+ })
+ },
updateData() {
calcHandleQty(this.detailSource);
},
-
openScanPopup() {
this.$refs.scanPopup.openScanPopup();
},
@@ -230,16 +250,15 @@
this.$refs.scanPopup.closeScanPopup();
},
-
scanLocationCode(location, code) {
- this.$refs.comMessage.showQuestionMessage("是否把所有的目标库位都变成默认库位[" + code + "]", res => {
- this.toLocationCode = code
- this.detailSource.forEach(item => {
- item.subList.forEach(detail => {
- detail.toLocationCode = code
- })
+ // this.$refs.comMessage.showQuestionMessage("是否把所有的目标库位都变成默认库位[" + code + "]", res => {
+ this.toLocationCode = code
+ this.detailSource.forEach(item => {
+ item.subList.forEach(detail => {
+ detail.toLocationCode = code
})
})
+ // })
},
checkLocation() {
@@ -248,7 +267,6 @@
this.showMessageHint('请扫描收货库位', callback => {
this.$refs.comScanLocation.showLocation();
})
-
return isPass = false;
}
return isPass;
@@ -263,33 +281,30 @@
},
commit() {
- this.scanCount = getScanCount(this.subList);
- if (this.scanCount == 0) {
- this.showErrorMessage("扫描数为0,请先扫描")
- return;
- }
+ // this.scanCount = getScanCount(this.subList);
+ // if (this.scanCount == 0) {
+ // this.showErrorMessage("扫描数为0,请先扫描")
+ // return;
+ // }
//校验库位、
if (!this.checkLocation()) {
return
}
-
-
- //扫描数量和任务数量相等,直接提交
- if (this.scanCount == this.subList.length) {
- this.submitJob();
- } else if (this.scanCount < this.subList.length) {
- //扫描数量小于任务数量,判断是否允许部分提交
- if (this.jobContent.allowPartialComplete == "TRUE") {
- //提交
- this.submitJob();
- } else {
- //不允许部分提交,提示
- this.showMessage('请完成扫描后,再进行提交
' + "已经扫描[" + this.scanCount + "]总共[" + this.subList
- .length +
- "]");
- }
- }
-
+ this.detailSource.forEach(item => {
+ item.subList.forEach(subitem => {
+ if (subitem.handleQty == undefined) {
+ this.showMessage("还没扫码成品不能提交")
+ } else {
+ if (subitem.handleQty != subitem.packQty) {
+ this.showQuestionMessage('制品数量不等于包装数量,是否继续提交?', res => {
+ if (res) {
+ this.submitJob();
+ }
+ });
+ }
+ }
+ })
+ })
},
submitJob() {