tianxinyu 11 hónapja
szülő
commit
aa793be735
1 módosított fájl, 15 hozzáadás és 5 törlés
  1. 15 5
      src/views/system/jbdScan/goods/neishenzhuangtai.vue

+ 15 - 5
src/views/system/jbdScan/goods/neishenzhuangtai.vue

@@ -850,6 +850,12 @@ export default {
             const firstArr = []
             const firstArr = []
             let secondArr = []
             let secondArr = []
             arr.forEach((it) => {
             arr.forEach((it) => {
+                if(it.tiao_kuan_bian_ha.includes("CL02-A001")){
+                    it.tiao_kuan_bian_ha = it.tiao_kuan_bian_ha.split('\n')[1]
+                    console.log('it.tiao_kuan_bian_ha',it.tiao_kuan_bian_ha)
+                } 
+ 
+                const newBianhao = it.tiao_kuan_bian_ha.split('.')[0]
                 if (firstArr.length == 0) {
                 if (firstArr.length == 0) {
                     secondArr.push('score')
                     secondArr.push('score')
                     secondArr.push('不符合项')
                     secondArr.push('不符合项')
@@ -858,21 +864,19 @@ export default {
                     secondArr = []
                     secondArr = []
                     secondArr.push(1)
                     secondArr.push(1)
                     secondArr.push(1)
                     secondArr.push(1)
-                    secondArr.push(it.tiao_kuan_bian_ha)
+                    secondArr.push(newBianhao)
                     firstArr.push(secondArr)
                     firstArr.push(secondArr)
                     secondArr = []
                     secondArr = []
                 } else {
                 } else {
                     for (var i in firstArr) {
                     for (var i in firstArr) {
-                        const a = firstArr[i][2]
-                        const b = it.tiao_kuan_bian_ha
-                        if (firstArr[i][2] == it.tiao_kuan_bian_ha) {
+                        if (firstArr[i][2] == newBianhao) {
                             firstArr[i][0] = firstArr[i][0] + 1
                             firstArr[i][0] = firstArr[i][0] + 1
                             firstArr[i][1] = firstArr[i][1] + 1
                             firstArr[i][1] = firstArr[i][1] + 1
                             break
                             break
                         } else if (i == firstArr.length - 1) {
                         } else if (i == firstArr.length - 1) {
                             secondArr.push(1)
                             secondArr.push(1)
                             secondArr.push(1)
                             secondArr.push(1)
-                            secondArr.push(it.tiao_kuan_bian_ha)
+                            secondArr.push(newBianhao)
                             firstArr.push(secondArr)
                             firstArr.push(secondArr)
                             secondArr = []
                             secondArr = []
                             break
                             break
@@ -880,6 +884,12 @@ export default {
                     }
                     }
                 }
                 }
             })
             })
+
+            firstArr.sort((a, b) => {
+                // 将字符串转换为数字后比较
+                return Number(a[2]) - Number(b[2]);
+            });
+           
             type === 'CMA' ? (this.cmaSuorce = firstArr) : (this.source = firstArr)
             type === 'CMA' ? (this.cmaSuorce = firstArr) : (this.source = firstArr)
             callBlack()
             callBlack()
         },
         },