From 17f529afef9f804f228857f6b47d0a446e55a707 Mon Sep 17 00:00:00 2001
From: loulijun2021 <1694218219@qq.com>
Date: 星期一, 12 十二月 2022 15:30:12 +0800
Subject: [PATCH] 1.综合看板兼容八道工序样式排版

---
 src/views/kb/zhkbc.vue |  101 +++++++++++++++++++++++++++++++++++++++++++++++---
 1 files changed, 94 insertions(+), 7 deletions(-)

diff --git a/src/views/kb/zhkbc.vue b/src/views/kb/zhkbc.vue
index 2a19c79..77be60b 100644
--- a/src/views/kb/zhkbc.vue
+++ b/src/views/kb/zhkbc.vue
@@ -3,7 +3,7 @@
     <div class="kb_dashboard">
       <div class="kb_header">
         <div class="flex_c_c kb_header_text">
-          涓嬫枡杞﹂棿鐪嬫澘
+          {{ ShopArr[0] == 21 ? '涓嬫枡杞﹂棿鐪嬫澘' : ShopArr[0] == 22 ? '閲戝伐杞﹂棿鐪嬫澘' : ShopArr[0] == 23 ? '鎶涘厜杞﹂棿鐪嬫澘' : '瑁呴厤杞﹂棿鐪嬫澘' }}
         </div>
         <div class="kb_headerPic" />
         <div class="kb_headTime">
@@ -455,15 +455,59 @@
       }, 1000 * 30)
     },
     // 浜х嚎鍔犲伐涓换鍔�
+    // 浜х嚎鍔犲伐涓换鍔�
     getShopSearchLine() {
       let length, count
       LineSearchTopLeftData({ shopcode: this.ShopArr.join(',') }).then(res => {
-        this.lineContent = res.data
+        this.lineContent = res.data // 璋冪敤鎺ュ彛杩斿洖鐨勬暟鎹�
+        this.number1 = this.lineContent.length // 浜х嚎鍔犲伐涓换鍔�  鍗曟暟
+
+        const newData = []
+        if (this.lineContent.length > 0) {
+          this.lineContent.forEach(item => {
+            if (item.children.length > 5) {
+              newData.push({
+                workcode: item.workcode,
+                partname: item.partname,
+                partnumber: item.partnumber,
+                partspec: item.partspec,
+                qty: item.qty,
+                saleordercode: item.saleordercode,
+                uom: item.uom,
+                children: item.children.slice(0, 5)
+              })
+
+              newData.push({
+                workcode: item.workcode,
+                partname: item.partname,
+                partnumber: item.partnumber,
+                partspec: item.partspec,
+                qty: item.qty,
+                saleordercode: item.saleordercode,
+                uom: item.uom,
+                children: item.children.slice(5, 8)
+              })
+            } else {
+              newData.push({
+                workcode: item.workcode,
+                partname: item.partname,
+                partnumber: item.partnumber,
+                partspec: item.partspec,
+                qty: item.qty,
+                saleordercode: item.saleordercode,
+                uom: item.uom,
+                children: item.children
+              })
+            }
+          })
+
+          console.log(newData.length, 9777)
+        }
+
+        this.lineContent = newData
         length = this.lineContent.length
         count = Math.ceil(length / 3) // 闇�瑕佽疆鎾殑缁勬暟   3涓负涓�缁�
         this.lineContent3 = this.lineContent.slice(0, 3)
-
-        this.number1 = this.lineContent.length
       })
 
       let start = 0
@@ -471,17 +515,60 @@
         if (Math.floor(start / 3) === count && count !== 0) {
           start = 0
           LineSearchTopLeftData({ shopcode: this.ShopArr.join(',') }).then(res => {
-            this.lineContent = res.data
+            this.lineContent = res.data // 璋冪敤鎺ュ彛杩斿洖鐨勬暟鎹�
+            this.number1 = this.lineContent.length // 浜х嚎鍔犲伐涓换鍔�  鍗曟暟
+
+            const newData = []
+            if (this.lineContent.length > 0) {
+              this.lineContent.forEach(item => {
+                if (item.children.length > 5) {
+                  newData.push({
+                    workcode: item.workcode,
+                    partname: item.partname,
+                    partnumber: item.partnumber,
+                    partspec: item.partspec,
+                    qty: item.qty,
+                    saleordercode: item.saleordercode,
+                    uom: item.uom,
+                    children: item.children.slice(0, 5)
+                  }
+                  )
+
+                  newData.push({
+                    workcode: item.workcode,
+                    partname: item.partname,
+                    partnumber: item.partnumber,
+                    partspec: item.partspec,
+                    qty: item.qty,
+                    saleordercode: item.saleordercode,
+                    uom: item.uom,
+                    children: item.children.slice(5, 8)
+                  })
+                } else {
+                  newData.push({
+                    workcode: item.workcode,
+                    partname: item.partname,
+                    partnumber: item.partnumber,
+                    partspec: item.partspec,
+                    qty: item.qty,
+                    saleordercode: item.saleordercode,
+                    uom: item.uom,
+                    children: item.children
+                  })
+                }
+              })
+            }
+
+            this.lineContent = newData
             length = this.lineContent.length
             count = Math.ceil(length / 3) // 闇�瑕佽疆鎾殑缁勬暟   3涓负涓�缁�
             this.lineContent3 = this.lineContent.slice(0, 3)
-
-            this.number1 = this.lineContent.length
           })
         } else if (count === 0) {
           clearInterval(this.ShopSearchLineTask)
           this.getShopSearchLine()
         }
+
         this.lineContent3 = this.lineContent.slice(start, start + 3)
         start = start + 3
       }, 1000 * 3)

--
Gitblit v1.9.3