From a163c7a770b2dba17c8829fc7ede49a17a9176db Mon Sep 17 00:00:00 2001
From: whycq <913841844@qq.com>
Date: 星期五, 26 四月 2024 11:06:44 +0800
Subject: [PATCH] #
---
pages/tzsk/pakin/pakin3.vue | 86 +++++++++++++++++++++++++++++++------------
1 files changed, 62 insertions(+), 24 deletions(-)
diff --git a/pages/tzsk/pakin/pakin3.vue b/pages/tzsk/pakin/pakin3.vue
index c9b2a15..36d11b6 100644
--- a/pages/tzsk/pakin/pakin3.vue
+++ b/pages/tzsk/pakin/pakin3.vue
@@ -343,8 +343,8 @@
// 涓烘寚瀹氫簨浠舵坊鍔犱竴涓洃鍚櫒锛岃幏鍙栬鎵撳紑椤甸潰浼犻�佸埌褰撳墠椤甸潰鐨勬暟鎹�
events: {
matList: function(data) {
- that.dataList.push(data.data)
- // that.checkMat(data.data)
+ // that.dataList.push(data.data)
+ that.checkMat(data.data)
that.focuss()
},
},
@@ -395,36 +395,74 @@
that.matnr = ''
},
checkMat(mat) {
- var len = this.dataList.length
- var add = true ,sameItem = false
- for (var i = 0; i < len; i++) {
+ let num = 0;
+ let index = 0;
+ mat.containerCode = ''
+ mat.csocode = ''
+ mat.isoseq = ''
+ for (let i = 0; i < this.dataList.length; i++) {
if (mat.matnr == this.dataList[i].matnr) {
- for (var j = 0; j < len; j++) {
- if (mat.batch == this.dataList[j].batch) {
- sameItem = true
- }
- }
- // 鐩稿悓鐗╂枡 涓嶅悓鎵瑰彿 鏂板姞鍒楄〃
- if (mat.batch != this.dataList[i].batch) {
- this.$forceUpdate() // 寮哄埗鍒锋柊
- if (sameItem) {
- add = false
+ if (mat.batch == this.dataList[i].batch) {
+ index = i;
+ num++;
+ if (mat.containerCode != this.dataList[i].containerCode
+ || mat.csocode != this.dataList[i].csocode
+ || mat.isoseq != this.dataList[i].isoseq) {
+ num = 0;
} else {
- add = true
+ num++;
+ break;
}
-
- } else {
- // 鐩稿悓鐗╂枡鐩稿悓鎵瑰彿 鏁伴噺绱姞
- this.dataList[i].anfme += mat.anfme
- this.$forceUpdate() // 寮哄埗鍒锋柊
- add = false
}
- }
+
+ }
}
- if (add) {
+ if (num == 0) {
this.dataList.unshift(mat)
+ } else {
+ this.dataList[index].anfme += mat.anfme
+ this.$forceUpdate() // 寮哄埗鍒锋柊
}
},
+ // var len = this.dataList.length
+ // var add = true ,sameItem = false
+ // for (var i = 0; i < len; i++) {
+ // if (mat.matnr == this.dataList[i].matnr) {
+ // // for (var j = 0; j < len; j++) {
+ // // if (mat.batch == this.dataList[j].batch) {
+ // // sameItem = true
+ // // }
+ // // }
+ // // 鐩稿悓鐗╂枡 涓嶅悓鎵瑰彿 鏂板姞鍒楄〃
+
+ // if (mat.batch != this.dataList[i].batch) {
+ // this.$forceUpdate() // 寮哄埗鍒锋柊
+ // if (sameItem) {
+ // add = false
+ // } else {
+ // add = true
+ // }
+
+ // } else {
+ // // 鐩稿悓鐗╂枡鐩稿悓鎵瑰彿 鏁伴噺绱姞
+ // console.log(mat.containerCode);
+ // console.log(this.dataList[i].containerCode);
+ // if (this.dataList[i].containerCode != mat.containerCode
+ // || this.dataList[i].csocode != mat.csocode
+ // || this.dataList[i].isoseq != mat.isoseq) {
+ // add = true
+ // } else {
+ // this.dataList[i].anfme += mat.anfme
+ // this.$forceUpdate() // 寮哄埗鍒锋柊
+ // add = false
+ // }
+
+ // }
+ // }
+ // }
+ // if (add) {
+ // this.dataList.unshift(mat)
+ // }
// 淇敼鎵瑰彿
revise(item, i) {
this.matnr = this.dataList[i].matnr
--
Gitblit v1.9.1