From a5058f8422c6c1696e7ab16692bc610dcb92c628 Mon Sep 17 00:00:00 2001
From: loulijun2021 <1694218219@qq.com>
Date: 星期四, 01 九月 2022 17:34:23 +0800
Subject: [PATCH] 1.提交
---
src/views/kb/zhkb.vue | 143 +++++++++++++++++++++++++++++------------------
1 files changed, 89 insertions(+), 54 deletions(-)
diff --git a/src/views/kb/zhkb.vue b/src/views/kb/zhkb.vue
index a12f33e..d24b679 100644
--- a/src/views/kb/zhkb.vue
+++ b/src/views/kb/zhkb.vue
@@ -415,7 +415,12 @@
prop="saleOrderCode"
label="閿�鍞鍗曞彿"
width="158"
- />
+ >
+ <template slot-scope="{row}">
+ <div v-if="row.saleOrderCode">{{ row.saleOrderCode }}</div>
+ <div v-else>/</div>
+ </template>
+ </el-table-column>
<el-table-column
prop="wo_code"
label="鍔犲伐鍗曞彿"
@@ -607,7 +612,8 @@
leftTopData: [],
tableData: [],
- tableDataRank: []
+ tableDataRank: [],
+ lineCodeArr: []
}
},
@@ -635,26 +641,27 @@
getLineSearchTopLeftData() {
this.lineArr.forEach((item, index) => {
- // if (index === 0) {
- this.handleEveryLine(item, index)
- // }
+ if (index <= 3) {
+ this.handleEveryLine(item, index)
+ this.lineCodeArr.push(item.code)
+ }
})
},
// 澶勭悊姣忎竴鏉′骇绾�
async handleEveryLine(item, index) {
const res = await LineSearchTopLeftData([item])
- console.log(res, 7)
+
let res1, res2, res3, res4
- if (res.data[0].linecode === 'CXSB001') {
+ if (res.data[0].linecode === this.lineCodeArr[0]) {
res1 = res
}
- if (res.data[0].linecode === 'CXSB002') {
+ if (res.data[0].linecode === this.lineCodeArr[1]) {
res2 = res
}
- if (res.data[0].linecode === 'CXSB003') {
+ if (res.data[0].linecode === this.lineCodeArr[2]) {
res3 = res
}
- if (res.data[0].linecode === 'CXSB004') {
+ if (res.data[0].linecode === this.lineCodeArr[3]) {
res4 = res
}
@@ -669,7 +676,6 @@
linename: res1.data[0].linename,
lineworkcont: res1.data[0].lineworkcont,
children: res1.data[0].children ? res.data[0].children[count] : []
- // children: res1.data[0].children[count]
}
flag1 = false
}
@@ -681,21 +687,24 @@
children: res1.data[0].children ? res1.data[0].children[count] : []
}
}
- // console.log(res1.data[0].children.length, 9999)
- // console.log(res1.data[0].children, 8888)
- if (res1.data[0].children.length > 0 && res1.data[0].children.length === count++) {
- count = 0
+ console.log(res1.data[0].children === null, 999)
+ if (res1.data[0].children === null) {
+ res1.data[0].children = []
+ }
+ if (this.lineContent01.children === undefined || res1.data[0].children.length >= 0) {
LineSearchTopLeftData([item]).then(res => {
res1 = res
- this.lineContent01 = {
- linename: res1.data[0].linename,
- lineworkcont: res1.data[0].lineworkcont,
- children: res1.data[0].children ? res1.data[0].children[count] : []
- }
})
- // this.handleEveryLine(item, index)
}
- }, res1.data[0].children && res1.data[0].children.length > 0 ? 1000 * 3 : 1000 * 10)
+ if (res1.data[0].children.length === count++) {
+ count = 0
+ this.lineContent01 = {
+ linename: res1.data[0].linename,
+ lineworkcont: res1.data[0].lineworkcont,
+ children: res1.data[0].children ? res1.data[0].children[count] : []
+ }
+ }
+ }, 1000 * 3)
} else if (index === 1) {
let count = 0
if (flag2) {
@@ -714,20 +723,23 @@
children: res2.data[0].children ? res2.data[0].children[count] : []
}
}
- if (res2.data[0].children.length > 0 && res2.data[0].children.length === count++) {
- count = 0
+ if (res2.data[0].children === null) {
+ res2.data[0].children = []
+ }
+ if (this.lineContent02.children === undefined || res2.data[0].children.length >= 0) {
LineSearchTopLeftData([item]).then(res => {
res2 = res
- this.lineContent02 = {
- linename: res2.data[0].linename,
- lineworkcont: res2.data[0].lineworkcont,
- children: res2.data[0].children ? res2.data[0].children[count] : []
- }
})
-
- // this.handleEveryLine(item, index)
}
- }, res2.data[0].children && res2.data[0].children.length > 0 ? 1000 * 3 : 1000 * 10)
+ if (res2.data[0].children.length === count++) {
+ count = 0
+ this.lineContent02 = {
+ linename: res2.data[0].linename,
+ lineworkcont: res2.data[0].lineworkcont,
+ children: res2.data[0].children ? res2.data[0].children[count] : []
+ }
+ }
+ }, 1000 * 3)
} else if (index === 2) {
let count = 0
if (flag3) {
@@ -746,19 +758,26 @@
children: res3.data[0].children ? res3.data[0].children[count] : []
}
}
- if (res3.data[0].children.length > 0 && res3.data[0].children.length === count++) {
- count = 0
+
+ if (res3.data[0].children === null) {
+ res3.data[0].children = []
+ }
+
+ if (this.lineContent03.children === undefined || res3.data[0].children.length >= 0) {
LineSearchTopLeftData([item]).then(res => {
res3 = res
- this.lineContent03 = {
- linename: res3.data[0].linename,
- lineworkcont: res3.data[0].lineworkcont,
- children: res3.data[0].children ? res3.data[0].children[count] : []
- }
})
- // this.handleEveryLine(item, index)
}
- }, res3.data[0].children && res3.data[0].children.length > 0 ? 1000 * 3 : 1000 * 10)
+
+ if (res3.data[0].children.length === count++) {
+ count = 0
+ this.lineContent03 = {
+ linename: res3.data[0].linename,
+ lineworkcont: res3.data[0].lineworkcont,
+ children: res3.data[0].children ? res3.data[0].children[count] : []
+ }
+ }
+ }, 1000 * 3)
} else if (index === 3) {
let count = 0
if (flag4) {
@@ -777,19 +796,26 @@
children: res4.data[0].children ? res4.data[0].children[count] : []
}
}
- if (res4.data[0].children > 0 && res4.data[0].children.length === count++) {
- count = 0
+
+ if (res4.data[0].children === null) {
+ res4.data[0].children = []
+ }
+
+ if (res4.data[0].children.length === count || this.lineContent04.children === undefined) {
LineSearchTopLeftData([item]).then(res => {
res4 = res
- this.lineContent04 = {
- linename: res4.data[0].linename,
- lineworkcont: res4.data[0].lineworkcont,
- children: res4.data[0].children ? res4.data[0].children[count] : []
- }
})
- // this.handleEveryLine(item, index)
}
- }, res4.data[0].children && res4.data[0].children.length > 0 ? 1000 * 3 : 1000 * 10)
+
+ if (res4.data[0].children.length === count++) {
+ count = 0
+ this.lineContent04 = {
+ linename: res4.data[0].linename,
+ lineworkcont: res4.data[0].lineworkcont,
+ children: res4.data[0].children ? res4.data[0].children[count] : []
+ }
+ }
+ }, 1000 * 3)
}
},
@@ -800,7 +826,7 @@
const divData = this.$refs.tableData.bodyWrapper
// 鎷垮埌鍏冪礌鍚庯紝瀵瑰厓绱犺繘琛屽畾鏃跺鍔犺窛绂婚《閮ㄨ窛绂伙紝瀹炵幇婊氬姩鏁堟灉(姝ら厤缃负姣�100姣绉诲姩1鍍忕礌)
- setInterval(() => {
+ const task = setInterval(() => {
// 鍏冪礌鑷璺濈椤堕儴1鍍忕礌
divData.scrollTop += 1
// divData.scrollTop += divData.scrollHeight / this.tableData.length
@@ -810,9 +836,13 @@
divData.scrollTop = 0
LineSearchBottomLeftData().then(res => {
this.tableData = res.data
+ if (this.tableData.length > 10) {
+ clearInterval(task)
+ this.getTableDataRoll()
+ }
})
}
- }, this.tableData.length <= 10 ? 1000 * 6 : 100)
+ }, this.tableData.length <= 10 ? 1000 * 3 : 100)
})
},
// 褰撴棩瀹屽伐浜у搧鏁伴噺鎺掕
@@ -822,7 +852,7 @@
const divData = this.$refs.tableDataRank.bodyWrapper
// 鎷垮埌鍏冪礌鍚庯紝瀵瑰厓绱犺繘琛屽畾鏃跺鍔犺窛绂婚《閮ㄨ窛绂伙紝瀹炵幇婊氬姩鏁堟灉(姝ら厤缃负姣�100姣绉诲姩1鍍忕礌)
- setInterval(() => {
+ const task = setInterval(() => {
// 鍏冪礌鑷璺濈椤堕儴1鍍忕礌
// divData.scrollTop += divData.scrollHeight / this.tableDataRank.length
divData.scrollTop += 1
@@ -832,9 +862,14 @@
divData.scrollTop = 0
LineSearchTopRightData().then(res => {
this.tableDataRank = res.data
+
+ if (this.tableDataRank.length > 10) {
+ clearInterval(task)
+ this.getTableDataRankRoll()
+ }
})
}
- }, this.tableDataRank.length <= 10 ? 1000 * 6 : 100)
+ }, this.tableDataRank.length <= 10 ? 1000 * 3 : 100)
})
},
// 鑾峰彇echarts
--
Gitblit v1.9.3