From 559ba5b4f27be7f8f4c73f4ab75386f126c3fed2 Mon Sep 17 00:00:00 2001
From: 小小儁爺 <1694218219@qq.com>
Date: 星期五, 26 七月 2024 14:46:15 +0800
Subject: [PATCH] 1.客户看板发布

---
 src/permission.js                |    2 
 vue.config.js                    |    4 
 src/views/kanbanManager/cj2.vue  |  252 ++++++++++++++++++++++++++++++++++++++++++++++++++
 src/views/kanbanManager/cj.vue   |    8 
 src/views/kanbanManager/zhkb.vue |    8 
 src/router/index.js              |    4 
 6 files changed, 267 insertions(+), 11 deletions(-)

diff --git a/src/permission.js b/src/permission.js
index ad087ea..11bea47 100644
--- a/src/permission.js
+++ b/src/permission.js
@@ -9,7 +9,7 @@
 
 NProgress.configure({ showSpinner: false }) // NProgress Configuration
 
-const whiteList = ['/login', '/zhkb', '/cj'] // no redirect whitelist
+const whiteList = ['/login', '/zhkb', '/cj', '/cj2', '/ckgl'] // no redirect whitelist
 
 router.beforeEach(async(to, from, next) => {
   // start progress bar
diff --git a/src/router/index.js b/src/router/index.js
index 1c2ddf5..7930f93 100644
--- a/src/router/index.js
+++ b/src/router/index.js
@@ -44,6 +44,10 @@
     component: () => import('@/views/kanbanManager/cj'),
     hidden: true
   }, {
+    path: '/cj2',
+    component: () => import('@/views/kanbanManager/cj2'),
+    hidden: true
+  }, {
     path: '/ckgl',
     component: () => import('@/views/kanbanManager/ckgl'),
     hidden: true
diff --git a/src/views/kanbanManager/cj.vue b/src/views/kanbanManager/cj.vue
index 7404a26..039d9f0 100644
--- a/src/views/kanbanManager/cj.vue
+++ b/src/views/kanbanManager/cj.vue
@@ -10,7 +10,7 @@
         </div>
 
         <div class="kb_headTime kb_header_text" style="top: 35px;left:  800px">
-          <span>瑁呴厤杞﹂棿鏁板瓧鍖栫湅鏉�</span>
+          <span>娉ㄥ杞﹂棿鏁板瓧鍖栫湅鏉�</span>
         </div>
 
         <div class="kb_headTime" style="top: 35px;right:  25px">
@@ -159,7 +159,7 @@
   },
   methods: {
     getWorkShopProduceTopData() {
-      WorkShopProduceTopData().then(res => {
+      WorkShopProduceTopData({ wkshopcode: '1501' }).then(res => {
         const flag = this.compareArrays(this.configTableTop.data, res.data)
         if (!flag) {
           this.configTableTop.data = res.data.map(i =>
@@ -184,7 +184,7 @@
       })
     },
     async getWorkShopProduceBottomLeftData() {
-      const res4 = await WorkShopProduceBottomLeftData()
+      const res4 = await WorkShopProduceBottomLeftData({ wkshopcode: '1501' })
       this.cjzl03_xData = res4.data.map(i => i.click_date)
       this.cjzl03_yData = res4.data.map(i => i.count)
 
@@ -192,7 +192,7 @@
     },
 
     async getWorkShopProduceBottomRightData() {
-      const res5 = await WorkShopProduceBottomRightData()
+      const res5 = await WorkShopProduceBottomRightData({ wkshopcode: '1501' })
       this.RightBottom = res5.data
       if (this.RightBottom.length > 0) {
         loadEcharts('cjzl04', cjzl04(this.RightBottom.map(i => i.name), this.RightBottom.map(i => i.cont)))
diff --git a/src/views/kanbanManager/cj2.vue b/src/views/kanbanManager/cj2.vue
new file mode 100644
index 0000000..0a9fe9c
--- /dev/null
+++ b/src/views/kanbanManager/cj2.vue
@@ -0,0 +1,252 @@
+<template>
+  <div>
+    <div class="kb_dashboard" style="display:flex;flex-direction: column;justify-content: space-between">
+
+      <div class="kb_backgroundCustom" />
+
+      <div class="kb_header">
+        <div class="kb_headTime" style="top: 35px;left:  20px">
+          <span>姘稿悍甯傚湥娌e浠跺姞宸ュ巶</span>
+        </div>
+
+        <div class="kb_headTime kb_header_text" style="top: 35px;left:  800px">
+          <span>瑁呴厤杞﹂棿鏁板瓧鍖栫湅鏉�</span>
+        </div>
+
+        <div class="kb_headTime" style="top: 35px;right:  25px">
+          <span>{{ headTime }}</span>
+        </div>
+      </div>
+
+      <div
+        style=" padding:5px 20px 20px 20px;z-index:2;height: 940px;flex-direction: column;justify-content: space-between;"
+      >
+        <!--        涓婅竟-->
+        <div style="display: flex;justify-content: space-between">
+          <div style="width:100%">
+            <div class="smallTitle">
+              <svg-icon icon-class="cxjg" class="svg_class" />
+              鐢熶骇淇℃伅
+            </div>
+
+            <div style="height: 450px">
+              <dv-border-box-12>
+                <dv-scroll-board
+                  ref="scrollBoardTop"
+                  :config="configTableTop"
+                  style="width: 99%;height: 430px;margin:0 auto;padding-top: 13px;"
+                />
+              </dv-border-box-12>
+            </div>
+
+          </div>
+        </div>
+
+        <!--        涓嬭竟-->
+        <div style="display: flex;justify-content: space-between;margin-top: 15px;">
+          <div style="width: 1000px;">
+            <div class="smallTitle">
+              <svg-icon icon-class="blcs" class="svg_class" />
+              璐ㄩ噺涓嶈壇(杩戜竴鍛�)
+            </div>
+
+            <div style="height: 380px;">
+              <dv-border-box-12>
+                <div id="cjzl03" class="flex_c_c" style="width: 100%;height:100%" />
+              </dv-border-box-12>
+            </div>
+
+          </div>
+          <div style="width: 850px;">
+            <div class="smallTitle">
+              <svg-icon icon-class="ckkc" class="svg_class" />
+              涓嶈壇缁熻(杩戜竴鏈�)
+            </div>
+            <div style="height: 380px;">
+              <dv-border-box-12>
+                <div id="cjzl04" class="flex_c_c" style="width: 100%;height:100%" />
+              </dv-border-box-12>
+            </div>
+          </div>
+        </div>
+      </div>
+    </div>
+  </div>
+</template>
+
+<script>
+import './kbCommon.css'
+import { loadEcharts, cjzl04, cjzl03_2 } from '@/utils/myEcharts'
+import {
+  WorkShopProduceBottomLeftData,
+  WorkShopProduceBottomRightData,
+  WorkShopProduceTopData
+} from '@/api/kanbanManager'
+
+export default {
+  name: 'Cjsc',
+  data() {
+    return {
+      headTime: '',
+
+      cjzl03_xData: [],
+      cjzl03_yData: [],
+      RightBottom: [],
+
+      configTableTop: {
+        headerBGC: 'rgba(38, 68 ,139, 0.2)', // 琛ㄥご鑳屾櫙鑹�
+        oddRowBGC: 'transparent', // 濂囨暟琛岃儗鏅壊
+        evenRowBGC: 'transparent', // 鍋舵暟琛岃儗鏅壊
+        headerHeight: 45,
+        waitTime: 3000,
+        rowNum: 8,
+
+        header: [
+          '<span style="color:#09d8f2;">宸ュ崟鍙�</span>',
+          '<span style="color:#09d8f2;">浜у搧缂栫爜</span>',
+          '<span style="color:#09d8f2;">浜у搧鍚嶇О</span>',
+          '<span style="color:#09d8f2;">浜у搧瑙勬牸</span>',
+          '<span style="color:#09d8f2;">浠诲姟鏁伴噺</span>',
+          '<span style="color:#09d8f2;">鍚堟牸鏁伴噺</span>',
+          '<span style="color:#09d8f2;">涓嶈壇鏁伴噺</span>',
+          '<span style="color:#09d8f2;">宸ュ簾鏁伴噺</span>',
+          '<span style="color:#09d8f2;">鏂欏簾鏁伴噺</span>',
+          '<span style="color:#09d8f2;">宸ュ簭椤哄簭</span>',
+          '<span style="color:#09d8f2;">宸ュ簭缂栫爜</span>',
+          '<span style="color:#09d8f2;">宸ュ簭鍚嶇О</span>',
+          '<span style="color:#09d8f2;">瀹屾垚杩涘害(%)</span>'
+        ],
+        data: [
+          // ['<span style="color:#37a2da;">琛�1鍒�1</span>', '琛�1鍒�2', '琛�1鍒�3'],
+          // [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12],
+          // [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12],
+          // [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12],
+          // [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12],
+          // [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12],
+          // [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12],
+          // [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12],
+          // [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12],
+          // [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12],
+          // [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12],
+          // [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12],
+          // [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12]
+
+        ],
+        // index: true,
+        columnWidth: [150, 150, 150, 150, 150, 150, 150, 150, 150, 150, 150, 150, 150],
+        align: ['center', 'center', 'center', 'center', 'center', 'center', 'center', 'center', 'center', 'center', 'center', 'center', 'center']
+        // carousel: 'page'
+      }
+
+    }
+  },
+  created() {
+    setInterval(this.getNowTime, 1000)
+
+    // 涓ゅ皬鏃剁湅鏉垮埛鏂颁竴娆�
+    setInterval(() => {
+      window.location.reload()
+    }, 1000 * 60 * 120)
+  },
+  mounted() {
+    this.getWorkShopProduceTopData()
+    setInterval(() => {
+      this.getWorkShopProduceTopData()
+    }, 10 * 1000)
+
+    this.getWorkShopProduceBottomLeftData()
+    this.getWorkShopProduceBottomRightData()
+  },
+  methods: {
+    getWorkShopProduceTopData() {
+      WorkShopProduceTopData({ wkshopcode: '1502' }).then(res => {
+        const flag = this.compareArrays(this.configTableTop.data, res.data)
+        if (!flag) {
+          this.configTableTop.data = res.data.map(i =>
+            [
+              i.wo_code,
+              i.partcode,
+              i.partname,
+              i.partspec ? i.partspec : '/',
+              i.plan_qty,
+              i.good_qty,
+              `<span style="color: red;">${i.ng_qty}</span>`,
+              `<span style="color: red;">${i.laborbad_qty}</span>`,
+              `<span style="color: red;">${i.materielbad_qty}</span>`,
+              i.seq,
+              i.step_code,
+              i.step_name,
+              parseFloat(i.schedule.toFixed(2))
+            ]
+          )
+          this.$refs['scrollBoardTop'].updateRows(this.configTableTop.data)
+        }
+      })
+    },
+    async getWorkShopProduceBottomLeftData() {
+      const res4 = await WorkShopProduceBottomLeftData({ wkshopcode: '1502' })
+      this.cjzl03_xData = res4.data.map(i => i.click_date)
+      this.cjzl03_yData = res4.data.map(i => i.count)
+
+      loadEcharts('cjzl03', cjzl03_2(this.cjzl03_xData, this.cjzl03_yData))
+    },
+
+    async getWorkShopProduceBottomRightData() {
+      const res5 = await WorkShopProduceBottomRightData({ wkshopcode: '1502' })
+      this.RightBottom = res5.data
+      if (this.RightBottom.length > 0) {
+        loadEcharts('cjzl04', cjzl04(this.RightBottom.map(i => i.name), this.RightBottom.map(i => i.cont)))
+      }
+    },
+
+    // 鑾峰彇褰撳墠鏃堕棿
+    getNowTime() {
+      const dt = new Date()
+      const wk = dt.getDay()
+      const y = dt.getFullYear()
+      const m = (dt.getMonth() + 1 + '').padStart(2, '0')
+      const d = (dt.getDate() + '').padStart(2, '0')
+
+      const hh = (dt.getHours() + '').padStart(2, '0')
+      const mm = (dt.getMinutes() + '').padStart(2, '0')
+      const ss = (dt.getSeconds() + '').padStart(2, '0')
+      const weeks = ['鏄熸湡鏃�', '鏄熸湡涓�', '鏄熸湡浜�', '鏄熸湡涓�', '鏄熸湡鍥�', '鏄熸湡浜�', '鏄熸湡鍏�']
+      const week = weeks[wk]
+
+      this.headTime = `${y}-${m}-${d}  ${hh}:${mm}:${ss}   ${week}`
+    },
+
+    // 涓や釜鏁扮粍鍋氬姣�
+    compareArrays(arr1, arr2) {
+      const set1 = new Set(arr1)
+      const set2 = new Set(arr2)
+
+      if (set1.size !== set2.size) {
+        return false
+      }
+
+      for (const value of set1) {
+        if (!set2.has(value)) {
+          return false
+        }
+      }
+
+      return true
+    }
+
+  }
+
+}
+</script>
+
+<style lang="scss" scoped>
+
+::v-deep .header-item {
+  font-size: 16px !important;
+}
+
+::v-deep .row-item {
+  font-size: 16px !important;
+}
+
+</style>
diff --git a/src/views/kanbanManager/zhkb.vue b/src/views/kanbanManager/zhkb.vue
index 17f2448..019e3d9 100644
--- a/src/views/kanbanManager/zhkb.vue
+++ b/src/views/kanbanManager/zhkb.vue
@@ -123,17 +123,17 @@
             <dv-border-box-12 style="height: 415px;">
               <div style="display: flex;justify-content: center;position: relative">
                 <div class="kb_center_block_children all_block05">
-                  <div style="font-size: 24px;">{{ parseFloat(RightBottom.Y) }}</div>
+                  <div style="font-size: 24px;">{{ RightBottom? parseFloat(RightBottom.Y):'NaN' }}</div>
                   <div class="box02" />
                   <div>鍘熸潗鏂�</div>
                 </div>
                 <div class="kb_center_block_children all_block06">
-                  <div style="font-size: 24px;">{{ parseFloat(RightBottom.B) }}</div>
+                  <div style="font-size: 24px;">{{ RightBottom? parseFloat(RightBottom.B):'NaN' }}</div>
                   <div class="box02" />
                   <div>鍗婃垚鍝�</div>
                 </div>
                 <div class="kb_center_block_children all_block07">
-                  <div style="font-size: 24px;">{{ parseFloat(RightBottom.C) }}</div>
+                  <div style="font-size: 24px;">{{ RightBottom? parseFloat(RightBottom.C):'NaN' }}</div>
                   <div class="box02" />
                   <div>浜ф垚鍝�</div>
                 </div>
@@ -207,7 +207,7 @@
   },
   methods: {
     getWorkShopCompreLeftTop() {
-      WorkShopCompreLeftTop().then(res2 => {
+      WorkShopCompreLeftTop({ wkshopcode: '1501,1502' }).then(res2 => {
         this.LeftTopData01 = []
         this.LeftTopData02 = []
         res2.data.LeftTop.forEach(i => {
diff --git a/vue.config.js b/vue.config.js
index 49ec1fc..3dbe53f 100644
--- a/vue.config.js
+++ b/vue.config.js
@@ -52,8 +52,8 @@
     },
     proxy: {
       [process.env.VUE_APP_BASE_API]: {
-        target: 'http://192.168.1.237:8000', // 璇锋眰鐨勭涓夆絽鎺モ紳鍦板潃    瀹㈡埛
-        // target: 'http://121.196.36.24:8032', // 璇锋眰鐨勭涓夆絽鎺モ紳鍦板潃       鏈湴寮�鍙戞湇鍔″櫒
+        // target: 'http://192.168.1.237:8000', // 璇锋眰鐨勭涓夆絽鎺モ紳鍦板潃    瀹㈡埛
+        target: 'http://192.168.2.254:8000', // 璇锋眰鐨勭涓夆絽鎺モ紳鍦板潃       鏈湴寮�鍙戞湇鍔″櫒  娌f玻
         changeOrigin: true, // 璇锋眰璺ㄥ煙鏃讹紝闇� 閰嶇疆姝ら」
         pathRewrite: { // 璺緞閲嶅啓,鏇挎崲target涓殑璇锋眰鍦板潃
           ['^' + process.env.VUE_APP_BASE_API]: '/api/'

--
Gitblit v1.9.3