小小儁爺
2025-02-18 9a4c8548e3bb761cec5fc508650b727a345f9009
1.大岛2.0看板重构
已添加4个文件
已修改10个文件
已删除1个文件
3121 ■■■■ 文件已修改
package.json 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/api/kanbanManager.js 24 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/icons/svg/cgdd.svg 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main.js 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/permission.js 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/router/index.js 16 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/utils/myEcharts.js 12 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/kanbanManager/bzcj.vue 258 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/kanbanManager/cgdd.vue 961 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/kanbanManager/cj.vue 458 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/kanbanManager/ckgl.vue 440 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/kanbanManager/dccj.vue 258 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/kanbanManager/zhkb.vue 427 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/kanbanManager/zpcj.vue 258 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
vue.config.js 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
package.json
@@ -14,6 +14,7 @@
    "test:ci": "npm run lint && npm run test:unit"
  },
  "dependencies": {
    "@jiaminghi/data-view": "^2.10.0",
    "@microsoft/signalr": "^7.0.9",
    "array-to-tree": "^3.3.2",
    "axios": "0.18.1",
src/api/kanbanManager.js
@@ -93,3 +93,27 @@
    method: 'get'
  })
}
// é‡‡è´­è®¢å•跟踪管理看板,左上本月采购订单数、本月采购进货单数、本月采购入库单数
export function PurchaseLeftTop() {
  return request({
    url: 'KanBanManagerent/PurchaseLeftTop',
    method: 'get'
  })
}
// é‡‡è´­è®¢å•跟踪管理看板,左下采购订单跟踪列表
export function PurchaseLeftBottom() {
  return request({
    url: 'KanBanManagerent/PurchaseLeftBottom',
    method: 'get'
  })
}
// é‡‡è´­è®¢å•跟踪管理看板,右侧Top
export function PurchaseRight() {
  return request({
    url: 'KanBanManagerent/PurchaseRight',
    method: 'get'
  })
}
src/icons/svg/cgdd.svg
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1 @@
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1715311316427" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="4301" xmlns:xlink="http://www.w3.org/1999/xlink" width="64" height="64"><path d="M808.71424 194.21184c-18.5344 48.41472-33.87392 81.87904-45.99808 100.41344 7.29088 0 21.79072-0.77824 43.56096-2.37568 6.4512 0 11.30496-0.4096 14.49984-1.24928a2503.2704 2503.2704 0 0 0-14.49984-37.4784c-3.19488-7.2704-1.18784-12.53376 6.0416-15.74912 7.2704-2.41664 12.4928-0.4096 15.74912 6.0416 1.59744 4.85376 3.19488 10.05568 4.85376 15.74912 8.88832 23.38816 15.33952 42.33216 19.3536 56.832 1.59744 8.88832-0.83968 14.56128-7.2704 16.93696-7.29088 0.8192-12.0832-2.78528-14.49984-10.83392-0.8192 0-2.00704-3.25632-3.66592-9.70752-12.9024 0.8192-28.59008 2.02752-47.18592 3.60448h-30.24896c-9.64608 0-15.68768-2.00704-18.1248-6.0416-1.59744-4.85376 0-11.30496 4.85376-19.3536 16.11776-24.9856 32.62464-60.49792 49.62304-106.45504 3.19488-8.11008 8.45824-10.89536 15.68768-8.45824 7.2704 4.03456 9.68704 10.07616 7.2704 18.1248zM341.27872 81.01888h24.59648a111.7184 111.7184 0 0 1 31.82592-51.63008 110.61248 110.61248 0 0 1 150.13888 0.02048 112.31232 112.31232 0 0 1 28.03712 40.50944 255.03744 255.03744 0 0 1 352.58368 8.47872 255.03744 255.03744 0 0 1-3.35872 364.70784v468.50048C925.0816 973.39392 874.496 1024 812.66688 1024H132.9152a112.06656 112.06656 0 0 1-79.42144-33.01376A112.10752 112.10752 0 0 1 20.48 911.5648V249.63072C20.50048 187.8016 71.08608 137.216 132.9152 137.216h132.56704c3.85024-12.51328 10.73152-23.7568 19.80416-32.82944l0.08192-0.08192-0.08192 0.08192 0.08192-0.08192a78.99136 78.99136 0 0 1 55.9104-23.28576z m197.24288 31.232l-0.55296-6.69696a65.26976 65.26976 0 0 0-20.86912-42.74176 65.18784 65.18784 0 0 0-44.31872-17.32608 65.37216 65.37216 0 0 0-65.20832 60.06784l-1.72032 20.97152h-64.59392c-9.3184 0-17.75616 3.76832-23.83872 9.85088l-0.08192 0.08192a33.60768 33.60768 0 0 0-9.85088 23.83872v72.31488c0 9.25696 3.80928 17.7152 9.9328 23.83872h-0.08192a33.792 33.792 0 0 0 23.92064 9.9328h150.77376a254.3616 254.3616 0 0 1 46.4896-154.13248z m-41.08288 199.59808h-156.16a79.0528 79.0528 0 0 1-55.9104-23.26528h-0.08192a79.03232 79.03232 0 0 1-23.26528-55.99232V182.70208H132.9152a67.11296 67.11296 0 0 0-66.92864 66.92864V911.5648c0 18.39104 7.53664 35.1232 19.68128 47.26784 12.14464 12.14464 28.8768 19.68128 47.26784 19.68128h679.75168a67.11296 67.11296 0 0 0 66.92864-66.92864V478.08512a253.99296 253.99296 0 0 1-131.87072 36.80256c-36.1472 0-70.57408-7.5776-101.7856-21.1968H225.44384c-32.39936 0-32.48128-45.48608 0-45.48608h350.33088a255.8976 255.8976 0 0 1-78.336-136.35584zM225.44384 775.2704h494.67392c32.41984 0 32.48128 45.48608 0 45.48608H225.44384c-32.39936 0-32.48128-45.48608 0-45.48608z m0-163.5328h494.67392c32.41984 0 32.48128 45.48608 0 45.48608H225.44384c-32.39936 0-32.48128-45.48608 0-45.48608zM747.7248 48.80384a209.63328 209.63328 0 0 0-148.56192 61.72672 209.63328 209.63328 0 0 0 0 297.14432 209.63328 209.63328 0 0 0 148.56192 61.72672c115.8144 0 210.28864-94.47424 210.28864-210.28864 0-57.89696-23.63392-110.46912-61.72672-148.56192a209.57184 209.57184 0 0 0-148.56192-61.7472z m38.01088 71.5776c-1.65888 7.2704-2.84672 12.53376-3.66592 15.74912h82.28864c14.49984 0 22.20032 7.2704 22.97856 21.79072v90.74688c0 17.75616-0.77824 33.44384-2.43712 47.18592a506.88 506.88 0 0 1-3.62496 39.91552c-4.03456 44.40064-30.24896 62.50496-78.62272 54.45632-8.11008-1.59744-12.12416-6.8608-12.12416-15.74912 1.65888-8.04864 6.4512-11.6736 14.56128-10.89536 32.27648 6.4512 49.60256-3.19488 51.97824-29.02016 4.07552-15.33952 6.4512-43.56096 7.2704-84.72576V169.984c0-7.22944-3.60448-10.89536-10.89536-10.89536h-78.62272a628.8384 628.8384 0 0 1-25.43616 52.03968c-6.4512 8.86784-13.27104 12.12416-20.54144 9.70752-6.4512-4.85376-6.8608-11.71456-1.18784-20.60288 12.0832-17.7152 24.1664-46.36672 36.29056-85.9136 2.43712-8.04864 7.22944-11.24352 14.49984-9.64608 6.47168 2.43712 8.88832 7.65952 7.29088 15.70816z m-107.68384 56.89344c0.77824 12.0832 1.18784 31.8464 1.18784 59.24864-0.8192 41.984-4.44416 72.64256-10.89536 91.99616-7.22944 22.54848-20.13184 42.33216-38.7072 59.26912-7.22944 5.67296-13.68064 5.67296-19.3536 0-4.03456-5.632-2.43712-11.6736 4.85376-18.1248 30.65856-29.06112 44.7488-73.80992 42.33216-134.32832v-13.312-43.56096c-0.77824-8.04864 2.00704-12.4928 8.47872-13.27104 7.24992 0.77824 11.28448 4.79232 12.10368 12.0832z m19.37408 147.59936c8.04864 7.2704 16.91648 17.34656 26.58304 30.24896l7.2704 7.2704c4.03456 6.4512 3.62496 12.0832-1.2288 16.93696-5.632 4.85376-10.83392 4.44416-15.68768-1.18784a264.704 264.704 0 0 0-25.3952-26.64448c-3.25632-3.19488-5.26336-6.0416-6.10304-8.45824-5.632-5.632-6.4512-11.30496-2.37568-16.93696 4.79232-4.85376 10.46528-5.26336 16.93696-1.2288z m6.02112-205.68064c11.30496-0.8192 16.93696 7.63904 16.93696 25.3952v152.43264c-0.83968 8.86784-4.85376 14.15168-12.0832 15.74912-7.2704-0.8192-10.87488-5.632-10.87488-14.49984v-145.2032c0-7.22944-3.25632-10.89536-9.70752-10.89536h-35.10272c-9.64608 0.83968-14.49984 4.85376-14.49984 12.14464v139.12064c-0.77824 8.88832-4.85376 14.09024-12.0832 15.74912-7.2704-0.83968-10.89536-5.67296-10.89536-14.56128V143.40096c-1.59744-16.91648 7.63904-25.02656 27.81184-24.20736h60.49792z" fill="#00ffff" p-id="4302"></path></svg>
src/main.js
@@ -70,6 +70,9 @@
// å¼•用修改过的gantt
Vue.use(vGanttChart)
import dataV from '@jiaminghi/data-view'
Vue.use(dataV)
new Vue({
  el: '#app',
  router,
src/permission.js
@@ -9,7 +9,7 @@
NProgress.configure({ showSpinner: false }) // NProgress Configuration
const whiteList = ['/login', '/zhkb', '/cj', '/ckgl'] // no redirect whitelist
const whiteList = ['/login', '/zhkb', '/zpcj', '/dccj', '/bzcj', '/ckgl', '/cgdd'] // no redirect whitelist
router.beforeEach(async(to, from, next) => {
  // start progress bar
src/router/index.js
@@ -40,8 +40,20 @@
    component: () => import('@/views/kanbanManager/zhkb'),
    hidden: true
  }, {
    path: '/cj',
    component: () => import('@/views/kanbanManager/cj'),
    path: '/cgdd',
    component: () => import('@/views/kanbanManager/cgdd'),
    hidden: true
  }, {
    path: '/zpcj',
    component: () => import('@/views/kanbanManager/zpcj'),
    hidden: true
  }, {
    path: '/dccj',
    component: () => import('@/views/kanbanManager/dccj'),
    hidden: true
  }, {
    path: '/bzcj',
    component: () => import('@/views/kanbanManager/bzcj'),
    hidden: true
  }, {
    path: '/ckgl',
src/utils/myEcharts.js
@@ -364,12 +364,12 @@
  const titlename = titlenameArr.filter((item, index) => index < 5)
  const length = titlename.length
  if (titlename.length < 5) {
    for (let i = 0; i < 5 - length; i++) {
      titlename.push('0')
    }
  }
  // const length = titlename.length
  // if (titlename.length < 5) {
  //   for (let i = 0; i < 5 - length; i++) {
  //     titlename.push('0')
  //   }
  // }
  console.log(titlename, 123)
src/views/kanbanManager/bzcj.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,258 @@
<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>浙江大岛电器有限公司</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, , 130, 130
        columnWidth: [200, 140, 350, 350, 130, 130, 130, 130, 130, 130, 130],
        align: ['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()
    setInterval(() => {
      this.getWorkShopProduceBottomLeftData()
    }, 20 * 1000)
    this.getWorkShopProduceBottomRightData()
    setInterval(() => {
      this.getWorkShopProduceBottomRightData()
    }, 30 * 1000)
  },
  methods: {
    getWorkShopProduceTopData() {
      WorkShopProduceTopData({ wkshopcode: 'CJ003' }).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>`,
              i.seq,
              i.step_code,
              i.step_name,
              parseFloat(i.schedule.toFixed(2))
            ]
          )
          // `<span style="color: red;">${i.laborbad_qty}</span>`,
          // `<span style="color: red;">${i.materielbad_qty}</span>`,
          this.$refs['scrollBoardTop'].updateRows(this.configTableTop.data)
        }
      })
    },
    async getWorkShopProduceBottomLeftData() {
      const res4 = await WorkShopProduceBottomLeftData({ wkshopcode: 'CJ003' })
      this.cjzl03_xData = res4.data['CJ003'].map(i => i.click_date)
      this.cjzl03_yData = res4.data['CJ003'].map(i => i.count)
      loadEcharts('cjzl03', cjzl03_2(this.cjzl03_xData, this.cjzl03_yData))
    },
    async getWorkShopProduceBottomRightData() {
      const res5 = await WorkShopProduceBottomRightData({ wkshopcode: 'CJ003' })
      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>
src/views/kanbanManager/cgdd.vue
@@ -1,517 +1,444 @@
<!--<template>-->
<!--  <div>-->
<!--    <div class="kb_dashboard">-->
<!--      &lt;!&ndash;    æ˜Ÿç©ºèƒŒæ™¯&ndash;&gt;-->
<!--      <div ref="starsRef" class="stars">-->
<!--        <div v-for="(item, index) in starsCount" :key="index" class="star" />-->
<!--      </div>-->
<!--      <div class="kb_header">-->
<!--        <div class="flex_c_c kb_header_text">-->
<!--          <div id="topBarLeft" style="width:600px;height:100%" />-->
<!--          é‡‡è´­è·Ÿè¸ªæ•°å­—化看板-->
<!--          <div id="topBarRight" style="width:600px;height:100%;transform:rotate(180deg);" />-->
<!--        </div>-->
<!--        <div class="kb_headTime" style="left: 85px">-->
<!--          <span>浙江新凯迪数字科技股份有限公司</span>-->
<!--        </div>-->
<!--        <div class="kb_headTime">-->
<!--          <span>{{ headTime }}</span>-->
<!--        </div>-->
<!--      </div>-->
<!--      <div style="display: flex;justify-content: space-between;padding:0 20px 20px 20px;height: 980px">-->
<!--        <div style="width: 1250px;" class="flex_c_b">-->
<!--          <div style="height: 380px;">-->
<!--            <div>-->
<!--              <div class="smallTitle">-->
<!--                <svg-icon icon-class="cggz" class="svg_class" />-->
<!--                é‡‡è´­è·Ÿè¸ª-->
<!--              </div>-->
<!--              <div class="lineContent horn" style="height: 345px">-->
<!--                <div id="cgddchart" class="flex_c_c" style="width: 100%;height:100%" />-->
<!--              </div>-->
<!--            </div>-->
<!--          </div>-->
<!--          <div style="height: 560px; ">-->
<!--            <div>-->
<!--              <div class="smallTitle">-->
<!--                <svg-icon icon-class="cggz" class="svg_class" />-->
<!--                é‡‡è´­åˆ°è´§è·Ÿè¸ª-->
<!--              </div>-->
<!--              <div class="lineContent horn" style="height: 525px">-->
<!--                <el-table-->
<!--                  ref="tableData"-->
<!--                  :data="tableData"-->
<!--                  class="tableData"-->
<!--                  style="width: 100%;"-->
<!--                  :header-cell-style="headerCellStyleCenter"-->
<!--                  :cell-style="cellStyleCenter"-->
<!--                  height="515"-->
<!--                >-->
<!--                  <el-table-column-->
<!--                    prop="PurchaseOrder"-->
<!--                    label="采购订单"-->
<!--                    width="225"-->
<!--                  >-->
<!--                    <template slot-scope="{row}">-->
<!--                      <div class="ellipsis">{{ row.PurchaseOrder }}</div>-->
<!--                    </template>-->
<!--                  </el-table-column>-->
<!--                  <el-table-column-->
<!--                    prop="suppername"-->
<!--                    label="供应商"-->
<!--                    width="183"-->
<!--                  >-->
<!--                    <template slot-scope="{row}">-->
<!--                      <div v-if="row.suppername" class="ellipsis">{{ row.suppername }}</div>-->
<!--                      <div v-else />-->
<!--                    </template>-->
<!--                  </el-table-column>-->
<!--                  &lt;!&ndash;                  <el-table-column&ndash;&gt;-->
<!--                  &lt;!&ndash;                    prop="username"&ndash;&gt;-->
<!--                  &lt;!&ndash;                    label="采购员"&ndash;&gt;-->
<!--                  &lt;!&ndash;                    width="78"&ndash;&gt;-->
<!--                  &lt;!&ndash;                  >&ndash;&gt;-->
<!--                  &lt;!&ndash;                    <template slot-scope="{row}">&ndash;&gt;-->
<!--                  &lt;!&ndash;                      <div v-if="row.username">{{ row.username }}</div>&ndash;&gt;-->
<!--                  &lt;!&ndash;                      <div v-else>/</div>&ndash;&gt;-->
<!--                  &lt;!&ndash;                    </template>&ndash;&gt;-->
<!--                  &lt;!&ndash;                  </el-table-column>&ndash;&gt;-->
<!--                  &lt;!&ndash;                  <el-table-column&ndash;&gt;-->
<!--                  &lt;!&ndash;                    prop="partcode"&ndash;&gt;-->
<!--                  &lt;!&ndash;                    label="产品编码"&ndash;&gt;-->
<!--                  &lt;!&ndash;                    width="108"&ndash;&gt;-->
<!--                  &lt;!&ndash;                  />&ndash;&gt;-->
<!--                  <el-table-column-->
<!--                    prop="partname"-->
<!--                    label="产品名称"-->
<!--                    width="215"-->
<!--                  >-->
<!--                    <template slot-scope="{row}">-->
<!--                      <div v-if="row.partname" class="ellipsis">{{ row.partname }}</div>-->
<!--                      <div v-else />-->
<!--                    </template>-->
<!--                  </el-table-column>-->
<!--                  &lt;!&ndash;                  <el-table-column&ndash;&gt;-->
<!--                  &lt;!&ndash;                    prop="partspec"&ndash;&gt;-->
<!--                  &lt;!&ndash;                    label="规格型号"&ndash;&gt;-->
<!--                  &lt;!&ndash;                    width="130"&ndash;&gt;-->
<!--                  &lt;!&ndash;                  >&ndash;&gt;-->
<!--                  &lt;!&ndash;                    <template slot-scope="{row}">&ndash;&gt;-->
<!--                  &lt;!&ndash;                      <div v-if="row.partspec" class="ellipsis">{{ row.partspec }}</div>&ndash;&gt;-->
<!--                  &lt;!&ndash;                      <div v-else>/</div>&ndash;&gt;-->
<!--                  &lt;!&ndash;                    </template>&ndash;&gt;-->
<!--                  &lt;!&ndash;                  </el-table-column>&ndash;&gt;-->
<!--                  <el-table-column-->
<!--                    prop="quantity"-->
<!--                    label="订单数量"-->
<!--                    width="114"-->
<!--                  >-->
<!--                    <template slot-scope="{row}">-->
<!--                      <div v-if="row.quantity">{{ parseFloat(row.quantity) }}</div>-->
<!--                      <div v-else>0</div>-->
<!--                    </template>-->
<!--                  </el-table-column>-->
<!--                  &lt;!&ndash;                  <el-table-column&ndash;&gt;-->
<!--                  &lt;!&ndash;                    prop="checktype"&ndash;&gt;-->
<!--                  &lt;!&ndash;                    label="检验状态"&ndash;&gt;-->
<!--                  &lt;!&ndash;                    width="104"&ndash;&gt;-->
<!--                  &lt;!&ndash;                  >&ndash;&gt;-->
<!--                  &lt;!&ndash;                    <template slot-scope="{row}">&ndash;&gt;-->
<!--                  &lt;!&ndash;                      <div v-if="row.checktype===null">未检验</div>&ndash;&gt;-->
<!--                  &lt;!&ndash;                      <div v-else>已检验</div>&ndash;&gt;-->
<!--                  &lt;!&ndash;                    </template>&ndash;&gt;-->
<!--                  &lt;!&ndash;                  </el-table-column>&ndash;&gt;-->
<!--                  &lt;!&ndash;                  <el-table-column&ndash;&gt;-->
<!--                  &lt;!&ndash;                    prop="checkuser"&ndash;&gt;-->
<!--                  &lt;!&ndash;                    label="检验人员"&ndash;&gt;-->
<!--                  &lt;!&ndash;                    width="94"&ndash;&gt;-->
<!--                  &lt;!&ndash;                  >&ndash;&gt;-->
<!--                  &lt;!&ndash;                    <template slot-scope="{row}">&ndash;&gt;-->
<!--                  &lt;!&ndash;                      <div v-if="row.checkuser===null">/</div>&ndash;&gt;-->
<!--                  &lt;!&ndash;                      <div v-else>{{ row.checkuser }}</div>&ndash;&gt;-->
<!--                  &lt;!&ndash;                    </template>&ndash;&gt;-->
<!--                  &lt;!&ndash;                  </el-table-column>&ndash;&gt;-->
<!--                  <el-table-column-->
<!--                    prop="quantity1"-->
<!--                    label="已收数量"-->
<!--                    width="114"-->
<!--                  >-->
<!--                    <template slot-scope="{row}">-->
<!--                      <div v-if="row.quantity1">{{ parseFloat(row.quantity1) }}</div>-->
<!--                      <div v-else>0</div>-->
<!--                    </template>-->
<!--                  </el-table-column>-->
<!--                  <el-table-column-->
<!--                    label="未收数量"-->
<!--                    width="114"-->
<!--                  >-->
<!--                    <template slot-scope="{row}">-->
<!--                      <div v-if="row.quantity- row.quantity1">{{ parseFloat(row.quantity - row.quantity1) }}</div>-->
<!--                      <div v-else>0</div>-->
<!--                    </template>-->
<!--                  </el-table-column>-->
<!--                  <el-table-column-->
<!--                    prop="acceptDate"-->
<!--                    label="预计交期"-->
<!--                    width="135"-->
<!--                  >-->
<!--                    <template slot-scope="{row}">-->
<!--                      <div v-if="row.acceptDate">{{ row.acceptDate.substring(0, 10) }}</div>-->
<!--                      <div v-else>/</div>-->
<!--                    </template>-->
<!--                  </el-table-column>-->
<!--                  <el-table-column-->
<!--                    prop="warning"-->
<!--                    label="延期天数"-->
<!--                    width="144"-->
<!--                  >-->
<!--                    <template slot-scope="{row}">-->
<!--                      <div v-if="parseFloat(row.warning)<0" style="color: red">{{-->
<!--                        Math.abs(parseFloat(row.warning))-->
<!--                      }}-->
<!--                      </div>-->
<!--                      <div v-else-if="row.warning===null||row.warning===''||row.warning>=0">0</div>-->
<!--                      &lt;!&ndash;                      <div v-else-if="parseFloat(row.warning)>3">{{ row.warning }}</div>&ndash;&gt;-->
<!--                      &lt;!&ndash;                      <div v-else-if="parseFloat(row.warning)>0&&parseFloat(row.warning)<=3" style="color:yellow;">&ndash;&gt;-->
<!--                      &lt;!&ndash;                        {{ row.warning }}&ndash;&gt;-->
<!--                      &lt;!&ndash;                      </div>&ndash;&gt;-->
<!--                    </template>-->
<!--                  </el-table-column>-->
<!--                </el-table>-->
<!--                &lt;!&ndash;                <div id="cgddchart" class="flex_c_c" style="width: 100%;height:100%" />&ndash;&gt;-->
<!--              </div>-->
<!--            </div>-->
<!--          </div>-->
<!--        </div>-->
<!--        <div style="width: 600px;">-->
<!--          <div>-->
<!--            <div class="smallTitle">-->
<!--              <svg-icon icon-class="yqjh" class="svg_class" />-->
<!--              ä¾›åº”商延期交货排行-->
<!--            </div>-->
<!--            <div class="lineContent horn" style="height: 925px">-->
<!--              <el-table-->
<!--                ref="tableDataRank"-->
<!--                :data="tableDataRank"-->
<!--                class="tableData"-->
<!--                style="width: 100%;"-->
<!--                :header-cell-style="headerCellStyleCenter"-->
<!--                :cell-style="cellStyleCenter"-->
<!--                :row-class-name="tableRowClassName"-->
<!--                height="920"-->
<!--              >-->
<!--                <el-table-column-->
<!--                  type="index"-->
<!--                  label="序号"-->
<!--                  width="80"-->
<!--                >-->
<!--                  <template slot-scope="{row}">-->
<!--                    <div>NO.{{ row.index }}</div>-->
<!--                    &lt;!&ndash;                      <div>NO.100</div>&ndash;&gt;-->
<!--                  </template>-->
<!--                </el-table-column>-->
<!--                &lt;!&ndash;                  <el-table-column&ndash;&gt;-->
<!--                &lt;!&ndash;                    prop="cj"&ndash;&gt;-->
<!--                &lt;!&ndash;                    label="车间"&ndash;&gt;-->
<!--                &lt;!&ndash;                    width="100"&ndash;&gt;-->
<!--                &lt;!&ndash;                  />&ndash;&gt;-->
<!--                <el-table-column-->
<!--                  prop="suppercode"-->
<!--                  label="供应商编码"-->
<!--                  width="140"-->
<!--                >-->
<!--                  <template slot-scope="{row}">-->
<!--                    <div v-if="row.suppercode" class="ellipsis">{{ row.suppercode }}</div>-->
<!--                    <div v-else />-->
<!--                  </template>-->
<!--                </el-table-column>-->
<!--                <el-table-column-->
<!--                  prop="suppername"-->
<!--                  width="293"-->
<!--                  label="供应商名称"-->
<!--                >-->
<!--                  <template slot-scope="{row}">-->
<!--                    <div class="ellipsis">{{ row.suppername }}</div>-->
<!--                  </template>-->
<!--                </el-table-column>-->
<!--                <el-table-column-->
<!--                  prop="cont"-->
<!--                  label="次数"-->
<!--                  width="81"-->
<!--                />-->
<!--              </el-table>-->
<!--            </div>-->
<!--          </div>-->
<!--        </div>-->
<!--      </div>-->
<!--    </div>-->
<!--  </div>-->
<!--</template>-->
<!--<script>-->
<!--import './kbCommon.css'-->
<!--import { cgddchart, kbTop, loadEcharts } from '@/utils/myEcharts'-->
<!--import { PurchaseLeftBottom, PurchaseLeftTop, PurchaseRight } from '@/api/kanbanManager'-->
<!--export default {-->
<!--  name: 'Index2',-->
<!--  data() {-->
<!--    return {-->
<!--      onLine: navigator.onLine, // ç›‘听网络是否在线-->
<!--      headTime: '',-->
<!--      purchaseLeftTopData: {},-->
<!--      tableData: [],-->
<!--      tableDataRank: [],-->
<!--      PurchaseRight: null,-->
<!--      PurchaseLeftBottom: null,-->
<!--      starsCount: 800, // æ˜Ÿæ˜Ÿæ•°é‡-->
<!--      distance: 900 // é—´è·-->
<!--    }-->
<!--  },-->
<!--  activated() {   window.addEventListener('resize', this.getHeight)   this.getHeight() }, created() {-->
<!--    setInterval(this.getNowTime, 1000)-->
<!--    // ä¸¤å°æ—¶çœ‹æ¿åˆ·æ–°ä¸€æ¬¡-->
<!--    setInterval(() => {-->
<!--      window.location.reload()-->
<!--    }, 1000 * 60 * 60 * 10)-->
<!--  },-->
<!--  mounted() {-->
<!--    // ç›‘听网络是否在线-->
<!--    window.addEventListener('online', this.updateOnlineStatus)-->
<!--    window.addEventListener('offline', this.updateOnlineStatus)-->
<!--    this.updateOnlineStatus({ type: this.onLine ? 'online' : 'offline', isFirst: true })-->
<!--    this.getTopBar()-->
<!--    this.getEcharts()-->
<!--    this.getPurchaseLeftBottom()-->
<!--    this.getPurchaseRight()-->
<!--    this.setStarsRef()-->
<!--  },-->
<!--  beforeDestroy() {-->
<!--    window.removeEventListener('online', this.updateOnlineStatus)-->
<!--    window.removeEventListener('offline', this.updateOnlineStatus)-->
<!--  },-->
<!--  methods: {-->
<!--    // æ›´æ–°ç½‘络状态-->
<!--    updateOnlineStatus(e) {-->
<!--      if (e.isFirst) {-->
<!--        // console.log('x')-->
<!--      } else {-->
<!--        const loading = this.$loading({-->
<!--          lock: true,-->
<!--          text: '断网了,正在拼命联网中,请检查网络是否正常...',-->
<!--          spinner: 'el-icon-loading',-->
<!--          customClass: 'osloading',-->
<!--          background: 'rgba(0, 0, 0, 0.7)'-->
<!--        })-->
<!--        const { type } = e-->
<!--        this.onLine = type === 'online'-->
<!--        if (this.onLine) {-->
<!--          loading.close()-->
<!--          this.$message.success('网络连接成功!')-->
<!--        } else {-->
<!--          this.$message.error('网络掉线,请关注网络状态!')-->
<!--        }-->
<!--      }-->
<!--    },-->
<!--    setStarsRef() {-->
<!--      const starNodes = Array.from(this.$refs.starsRef.children)-->
<!--      starNodes.forEach(item => {-->
<!--        const speed = 0.2 + Math.random() * 1-->
<!--        const thisDistance = this.distance + Math.random() * 300-->
<!--        item.style.transformOrigin = `0 0 ${thisDistance}px`-->
<!--        item.style.transform = `-->
<!--        translate3d(0,0,-${thisDistance}px)-->
<!--        rotateY(${Math.random() * 360}deg)-->
<!--        rotateX(${Math.random() * -50}deg)-->
<!--        scale(${speed},${speed})`-->
<!--      })-->
<!--    },-->
<!--    // èŽ·å–topEcharts-->
<!--    getTopBar() {-->
<!--      loadEcharts('topBarLeft', kbTop())-->
<!--      loadEcharts('topBarRight', kbTop())-->
<!--    },-->
<!--    // èŽ·å–echarts-->
<!--    async getEcharts() {-->
<!--      PurchaseLeftTop().then(res => {-->
<!--        this.purchaseLeftTopData = res.data[0]-->
<!--        loadEcharts('cgddchart', cgddchart(this.purchaseLeftTopData.ThisMonthPurchaseOrderCont, this.purchaseLeftTopData.ThisMonthPurchaseArrivalOrderCont, this.purchaseLeftTopData.ThisMonthWareHouseOrderCont))-->
<!--        // loadEcharts('cgddchart', cgddchart(30, 5, 10))-->
<!--      })-->
<!--      setInterval(() => {-->
<!--        PurchaseLeftTop().then(res => {-->
<!--          this.purchaseLeftTopData = res.data[0]-->
<!--          loadEcharts('cgddchart', cgddchart(this.purchaseLeftTopData.ThisMonthPurchaseOrderCont, this.purchaseLeftTopData.ThisMonthPurchaseArrivalOrderCont, this.purchaseLeftTopData.ThisMonthWareHouseOrderCont))-->
<!--        })-->
<!--      }, 1000 * 6)-->
<!--    },-->
<!--    getPurchaseLeftBottom() {-->
<!--      PurchaseLeftBottom().then(res => {-->
<!--        this.tableData = res.data.filter(i => !parseFloat(i.quantity1))// è¿‡æ»¤æŽ‰å·²æ”¶æ•°é‡å¤§äºŽé›¶çš„值-->
<!--        // this.number1 = this.tableData.length-->
<!--        const divData = this.$refs.tableData.bodyWrapper-->
<!--        // æ‹¿åˆ°å…ƒç´ åŽï¼Œå¯¹å…ƒç´ è¿›è¡Œå®šæ—¶å¢žåŠ è·ç¦»é¡¶éƒ¨è·ç¦»ï¼Œå®žçŽ°æ»šåŠ¨æ•ˆæžœ(此配置为每100毫秒移动1像素)-->
<!--        this.PurchaseLeftBottom = setInterval(() => {-->
<!--          // å…ƒç´ è‡ªå¢žè·ç¦»é¡¶éƒ¨1像素-->
<!--          divData.scrollTop += 1-->
<!--          // åˆ¤æ–­å…ƒç´ æ˜¯å¦æ»šåŠ¨åˆ°åº•éƒ¨(可视高度+距离顶部=整个高度)-->
<!--          if (divData.clientHeight + divData.scrollTop === divData.scrollHeight) {-->
<!--            // é‡ç½®table距离顶部距离-->
<!--            divData.scrollTop = 0-->
<!--            PurchaseLeftBottom().then(res => {-->
<!--              this.tableData = res.data.filter(i => !parseFloat(i.quantity1))// è¿‡æ»¤æŽ‰å·²æ”¶æ•°é‡å¤§äºŽé›¶çš„值-->
<!--              // this.number1 = this.tableData.length-->
<!--              if (this.tableData.length > 13) {-->
<!--                clearInterval(this.PurchaseLeftBottom)-->
<!--                this.getPurchaseLeftBottom()-->
<!--              }-->
<!--            })-->
<!--          }-->
<!--        }, this.tableData.length <= 13 ? 1000 * 3 : 100)-->
<!--      })-->
<!--    },-->
<!--    getPurchaseRight() {-->
<!--      PurchaseRight().then(res => {-->
<!--        this.tableDataRank = res.data-->
<!--        const divData = this.$refs.tableDataRank.bodyWrapper-->
<!--        // æ‹¿åˆ°å…ƒç´ åŽï¼Œå¯¹å…ƒç´ è¿›è¡Œå®šæ—¶å¢žåŠ è·ç¦»é¡¶éƒ¨è·ç¦»ï¼Œå®žçŽ°æ»šåŠ¨æ•ˆæžœ(此配置为每100毫秒移动1像素)-->
<!--        this.PurchaseRight = setInterval(() => {-->
<!--          // å…ƒç´ è‡ªå¢žè·ç¦»é¡¶éƒ¨1像素-->
<!--          divData.scrollTop += 1-->
<!--          // åˆ¤æ–­å…ƒç´ æ˜¯å¦æ»šåŠ¨åˆ°åº•éƒ¨(可视高度+距离顶部=整个高度)-->
<!--          if (divData.clientHeight + divData.scrollTop === divData.scrollHeight) {-->
<!--            // é‡ç½®table距离顶部距离-->
<!--            divData.scrollTop = 0-->
<!--            PurchaseRight().then(res => {-->
<!--              this.tableDataRank = res.data-->
<!--              if (this.tableDataRank.length > 23) {-->
<!--                clearInterval(this.PurchaseRight)-->
<!--                this.getPurchaseRight()-->
<!--              }-->
<!--            })-->
<!--          }-->
<!--        }, this.tableDataRank.length <= 23 ? 1000 * 3 : 100)-->
<!--      })-->
<!--    },-->
<!--    tableRowClassName({ row, rowIndex }) {-->
<!--      // æŠŠæ¯ä¸€è¡Œçš„索引放进row-->
<!--      row.index = rowIndex + 1-->
<!--    },-->
<!--    // èŽ·å–å½“å‰æ—¶é—´-->
<!--    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}`-->
<!--    },-->
<!--    headerCellStyleCenter() {-->
<!--      return {-->
<!--        // backgroundColor: 'rgb(30 ,33, 46)',-->
<!--        backgroundColor: '#000',-->
<!--        padding: '10px 0',-->
<!--        textAlign: 'center',-->
<!--        color: '#07acc2',-->
<!--        border: 'none',-->
<!--        fontSize: '18px'-->
<!--      }-->
<!--    },-->
<!--    cellStyleCenter() {-->
<!--      return {-->
<!--        padding: '7.5px 0',-->
<!--        textAlign: 'center',-->
<!--        backgroundColor: '#000',-->
<!--        color: '#fff',-->
<!--        border: 'none',-->
<!--        fontSize: '18px'-->
<!--      }-->
<!--    }-->
<!--  }-->
<!--}-->
<!--</script>-->
<!--<style scoped lang="scss">-->
<!--$main_color: #09d8f2;-->
<!--$color01: #00FFFF;-->
<!--.tableData {-->
<!--  background: #000;-->
<!--}-->
<!--.el-table__empty-text {-->
<!--  color: $main_color;-->
<!--}-->
<!--::v-deep .el-table::before {-->
<!--  height: 0;-->
<!--}-->
<!--::v-deep .el-table__body-wrapper::-webkit-scrollbar {-->
<!--  /* width: 0;宽度为0暗藏 */-->
<!--  width: 0;-->
<!--}-->
<!--::v-deep .cell {-->
<!--  padding: 0 !important;-->
<!--  font-size: 18px;-->
<!--}-->
<!--</style>-->
<!--&lt;!&ndash;星空&ndash;&gt;-->
<!--<style lang="css" scoped>-->
<!--@keyframes rotate {-->
<!--  0% {-->
<!--    transform: perspective(400px) rotateZ(20deg) rotateX(-40deg) rotateY(0);-->
<!--  }-->
<!--  100% {-->
<!--    transform: perspective(400px) rotateZ(20deg) rotateX(-40deg) rotateY(-360deg);-->
<!--  }-->
<!--}-->
<!--.stars {-->
<!--  transform: perspective(500px);-->
<!--  transform-style: preserve-3d;-->
<!--  position: absolute;-->
<!--  perspective-origin: 50% 100%;-->
<!--  left: 45%;-->
<!--  animation: rotate 90s infinite linear;-->
<!--  bottom: 0;-->
<!--  z-index: 102;-->
<!--}-->
<!--.star {-->
<!--  width: 2px;-->
<!--  height: 2px;-->
<!--  /*background: #f7f7b6;*/-->
<!--  background: #8edffc;-->
<!--  position: absolute;-->
<!--  left: 0;-->
<!--  top: 0;-->
<!--  backface-visibility: hidden;-->
<!--  z-index: 102;-->
<!--}-->
<!--</style>-->
<template>
  <div>
    <div class="kb_dashboard">
      <div class="kb_backgroundCustom" />
      <div class="kb_header">
        <div class="kb_headTime" style="top: 35px;left:  20px">
          <span>浙江大岛电器有限公司</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="display: flex;justify-content: space-between;padding:0 20px 20px 20px;height: 950px">
        <div style="width: 1250px;z-index: 2;margin-top: 50px;" class="flex_c_b">
          <div style="height: 380px;">
            <div class="smallTitle">
              <svg-icon icon-class="cggz" class="svg_class" />
              é‡‡è´­è·Ÿè¸ª
            </div>
            <div style="height: 345px">
              <dv-border-box-12>
                <div id="cgddchart" class="flex_c_c" style="width: 100%;height:100%" />
              </dv-border-box-12>
            </div>
          </div>
          <div style="height: 535px;margin-top:10px">
            <div>
              <div class="smallTitle">
                <svg-icon icon-class="cggz" class="svg_class" />
                é‡‡è´­åˆ°è´§è·Ÿè¸ª
              </div>
              <div style="height: 500px">
                <dv-border-box-12>
                  <dv-scroll-board
                    ref="scrollBoard"
                    :config="configTable"
                    style="width: 1226px;height: 96%;margin:0 auto;padding-top: 13px;"
                  />
                </dv-border-box-12>
              </div>
            </div>
          </div>
        </div>
        <div style="width: 600px;z-index: 2;margin-top: 50px;">
          <div>
            <div class="smallTitle">
              <svg-icon icon-class="yqjh" class="svg_class" />
              ä¾›åº”商延期交货排行
            </div>
            <div style="height: 890px">
              <dv-border-box-12>
                <dv-scroll-board
                  ref="scrollBoardRight"
                  :config="configTableRight"
                  style="width: 580px;height: 96%;margin:0 auto;padding-top: 13px;"
                />
              </dv-border-box-12>
            </div>
          </div>
        </div>
      </div>
    </div>
  </div>
</template>
<script>
import './kbCommon.css'
import { cgddchart, loadEcharts } from '@/utils/myEcharts'
import {
  PurchaseLeftTop, PurchaseLeftBottom, PurchaseRight
} from '@/api/kanbanManager'
export default {
  name: 'Index2',
  data() {
    return {
      onLine: navigator.onLine, // ç›‘听网络是否在线
      headTime: '',
      purchaseLeftTopData: {},
      configTable: {
        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>'
        ],
        data: [
          // ['<span style="color:#37a2da;">行1列1</span>', '行1列2', '行1列3'],
          // [1, 2, 3, 4, 5, 6, 8, 9],
          // [1, 2, 3, 4, 5, 6, 8, 9],
          // [1, 2, 3, 4, 5, 6, 8, 9],
          // [1, 2, 3, 4, 5, 6, 8, 9],
          // [1, 2, 3, 4, 5, 6, 8, 9],
          // [1, 2, 3, 4, 5, 6, 8, 9],
          // [1, 2, 3, 4, 5, 6, 8, 9],
          // [1, 2, 3, 4, 5, 6, 8, 9],
          // [1, 2, 3, 4, 5, 6, 8, 9],
          // [1, 2, 3, 4, 5, 6, 8, 9],
          // [1, 2, 3, 4, 5, 6, 8, 9],
          // [1, 2, 3, 4, 5, 6, 8, 9]
        ],
        index: true,
        columnWidth: [50, 180, 300, 150, 150, 120, 120, 120, 120],
        align: ['center', 'center', 'center', 'center', 'center', 'center', 'center', 'center', 'center']
        // carousel: 'page'
      },
      configTableRight: {
        headerBGC: 'rgba(38, 68 ,139, 0.2)', // è¡¨å¤´èƒŒæ™¯è‰²
        oddRowBGC: 'transparent', // å¥‡æ•°è¡ŒèƒŒæ™¯è‰²
        evenRowBGC: 'transparent', // å¶æ•°è¡ŒèƒŒæ™¯è‰²
        headerHeight: 45,
        waitTime: 3000,
        rowNum: 16,
        header: [
          '<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, 8, 9],
          // [1, 2, 3, 4, 5, 6, 8, 9],
          // [1, 2, 3, 4, 5, 6, 8, 9],
          // [1, 2, 3, 4, 5, 6, 8, 9],
          // [1, 2, 3, 4, 5, 6, 8, 9],
          // [1, 2, 3, 4, 5, 6, 8, 9],
          // [1, 2, 3, 4, 5, 6, 8, 9],
          // [1, 2, 3, 4, 5, 6, 8, 9],
          // [1, 2, 3, 4, 5, 6, 8, 9],
          // [1, 2, 3, 4, 5, 6, 8, 9],
          // [1, 2, 3, 4, 5, 6, 8, 9],
          // [1, 2, 3, 4, 5, 6, 8, 9]
        ],
        index: true,
        columnWidth: [50, 200, 200, 150],
        align: ['center', 'center', 'center', 'center']
        // carousel: 'page'
      }
    }
  },
  activated() {
    window.addEventListener('resize', this.getHeight)
    this.getHeight()
  },
  created() {
    setInterval(this.getNowTime, 1000)
    // ä¸¤å°æ—¶çœ‹æ¿åˆ·æ–°ä¸€æ¬¡
    setInterval(() => {
      window.location.reload()
    }, 1000 * 60 * 120)
  },
  mounted() {
    // ç›‘听网络是否在线
    window.addEventListener('online', this.updateOnlineStatus)
    window.addEventListener('offline', this.updateOnlineStatus)
    this.updateOnlineStatus({ type: this.onLine ? 'online' : 'offline', isFirst: true })
    this.getEcharts()
    this.getPurchaseLeftBottom()
    setInterval(() => {
      this.getPurchaseLeftBottom()
    }, 15 * 1000)
    this.getPurchaseRight()
    setInterval(() => {
      this.getPurchaseRight()
    }, 20 * 1000)
  },
  beforeDestroy() {
    window.removeEventListener('online', this.updateOnlineStatus)
    window.removeEventListener('offline', this.updateOnlineStatus)
  },
  methods: {
    // æ›´æ–°ç½‘络状态
    updateOnlineStatus(e) {
      if (e.isFirst) {
        // console.log('x')
      } else {
        const loading = this.$loading({
          lock: true,
          text: '断网了,正在拼命联网中,请检查网络是否正常...',
          spinner: 'el-icon-loading',
          customClass: 'osloading',
          background: 'rgba(0, 0, 0, 0.7)'
        })
        const { type } = e
        this.onLine = type === 'online'
        if (this.onLine) {
          loading.close()
          this.$message.success('网络连接成功!')
        } else {
          this.$message.error('网络掉线,请关注网络状态!')
        }
      }
    },
    getPurchaseLeftBottom() {
      PurchaseLeftBottom().then(res => {
        const flag = this.compareArrays(this.configTable.data, res.data)
        if (!flag) {
          this.configTable.data = res.data.map(i =>
            [
              i.PurchaseOrder,
              i.suppername,
              i.partname,
              i.quantity,
              i.quantity1,
              `<span> ${parseFloat(i.quantity - i.quantity1)}</span>`,
              i.acceptDate ? i.acceptDate.substring(0, 11) : i.acceptDate,
              parseFloat(i.warning) < 0 ? `<span style="color: red;">${Math.abs(parseFloat(i.warning))}</span>` : `0`
            ]
          )
          this.$refs['scrollBoard'].updateRows(this.configTable.data)
        }
      })
    },
    getPurchaseRight() {
      PurchaseRight().then(res => {
        const flag = this.compareArrays(this.configTableRight.data, res.data)
        if (!flag) {
          this.configTableRight.data = res.data.map(i =>
            [
              i.suppercode,
              i.suppername,
              i.cont
            ]
          )
          this.$refs['scrollBoardRight'].updateRows(this.configTableRight.data)
        }
      })
    },
    // ä¸¤ä¸ªæ•°ç»„做对比
    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
    },
    // èŽ·å–echarts
    getEcharts() {
      PurchaseLeftTop().then(res => {
        this.purchaseLeftTopData = res.data[0]
        loadEcharts('cgddchart', cgddchart(this.purchaseLeftTopData.ThisMonthPurchaseOrderCont, this.purchaseLeftTopData.ThisMonthPurchaseArrivalOrderCont, this.purchaseLeftTopData.ThisMonthWareHouseOrderCont))
        // loadEcharts('cgddchart', cgddchart(30, 5, 10))
      })
      setInterval(() => {
        PurchaseLeftTop().then(res => {
          this.purchaseLeftTopData = res.data[0]
          loadEcharts('cgddchart', cgddchart(this.purchaseLeftTopData.ThisMonthPurchaseOrderCont, this.purchaseLeftTopData.ThisMonthPurchaseArrivalOrderCont, this.purchaseLeftTopData.ThisMonthWareHouseOrderCont))
        })
      }, 1000 * 6)
    },
    // èŽ·å–å½“å‰æ—¶é—´
    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}`
    }
  }
}
</script>
<style lang="scss" scoped>
$main_color: #09d8f2;
$color01: #00FFFF;
.tableData {
  background: transparent;
}
.el-table::before {
  height: 0;
}
.el-table__empty-text {
  color: $main_color;
}
.tableDataCell {
  ::v-deep .cell {
    padding: 0 2px;
  }
}
::v-deep .el-table__body-wrapper::-webkit-scrollbar {
  /* width: 0;宽度为0暗藏 */
  width: 0;
  background: transparent;
}
::v-deep .el-table__body-wrapper {
  background: transparent;
}
::v-deep .el-table th,
::v-deep .el-table tr,
::v-deep .el-table td {
  background-color: transparent;
}
::v-deep .gutter {
  display: none;
}
.all_block01 {
  width: 237px;
  height: 180px;
}
.all_block02 {
  width: 100%;
  height: 49px;
  background: rgba(9, 216, 242, 0.1);
}
.all_block03 {
  width: 199px;
  height: 180px;
}
.all_block04 {
  width: 100%;
  height: 49px;
  background: rgba(9, 216, 242, 0.1);
}
.kb_center_block_children {
  height: 180px;
  //border: 1px solid $kbBorderColor;
  width: 240px;
  display: flex;
  z-index: 2;
  justify-content: space-around;
  align-items: center;
  flex-direction: column;
  margin: 10px;
  font-size: 22px;
  .box02 {
    background: url("../../assets/images/box02.png") no-repeat;
    transform: scale(1.5);
    width: 145px;
    height: 84px;
  }
}
.all_block05 {
  position: absolute;
  animation: upDown 3s ease-in-out infinite;
  left: 60px;
}
.all_block06 {
  position: absolute;
  animation: upDown2 3s ease-in-out infinite;
  left: 290px;
}
.all_block07 {
  position: absolute;
  animation: upDown 3s ease-in-out infinite;
  left: 520px;
}
@keyframes upDown {
  0% {
    top: 50px;
  }
  50% {
    top: 100px;
  }
  100% {
    top: 50px;
  }
}
@keyframes upDown2 {
  0% {
    top: 100px;
  }
  50% {
    top: 50px;
  }
  100% {
    top: 100px;
  }
}
</style>
src/views/kanbanManager/cj.vue
ÎļþÒÑɾ³ý
src/views/kanbanManager/ckgl.vue
@@ -24,134 +24,14 @@
              <svg-icon icon-class="cpdrk" class="svg_class" />
              ç”Ÿäº§å¾…入库
            </div>
            <div class="lineContent horn" style="height: 410px">
              <el-table
                ref="tableDataTopRef"
                :data="tableDataTop"
                style="width: 100%;"
                class="tableData"
                :header-cell-style="headerCellStyleCenter"
                :cell-style="cellStyleCenter"
                height="405"
              >
                <el-table-column
                  prop="voucherdate"
                  label="单据日期"
                  width="131"
                >
                  <template slot-scope="{row}">
                    <div v-if="row.voucherdate" class="ellipsis">{{ row.voucherdate.substring(0, 10) }}</div>
                    <div v-else />
                  </template>
                </el-table-column>
                <el-table-column
                  prop="wo"
                  label="单据编号"
                  width="189"
                >
                  <template slot-scope="{row}">
                    <div class="ellipsis">{{ row.wo }}</div>
                  </template>
                </el-table-column>
                <el-table-column
                  prop="wkshp_name"
                  label="生产车间"
                  width="105"
                >
                  <template slot-scope="{row}">
                    <div class="ellipsis">{{ row.wkshp_name }}</div>
                  </template>
                </el-table-column>
                <el-table-column
                  prop="saleOrderCode"
                  label="销售订单号"
                  width="200"
                >
                  <template slot-scope="{row}">
                    <div v-if="row.saleOrderCode" class="ellipsis">{{ row.saleOrderCode }}</div>
                    <div v-else>/</div>
                  </template>
                </el-table-column>
                <!--                <el-table-column-->
                <!--                  prop="materiel_code"-->
                <!--                  label="产品编号"-->
                <!--                  width="136"-->
                <!--                >-->
                <!--                  <template slot-scope="{row}">-->
                <!--                    <div class="ellipsis">{{ row.materiel_code }}</div>-->
                <!--                  </template>-->
                <!--                </el-table-column>-->
                <el-table-column
                  prop="materiel_name"
                  label="产品名称"
                  width="170"
                >
                  <template slot-scope="{row}">
                    <div class="ellipsis">{{ row.materiel_name }}</div>
                  </template>
                </el-table-column>
                <el-table-column
                  prop="specification"
                  label="规格型号"
                  width="136"
                >
                  <template slot-scope="{row}">
                    <div v-if="row.specification" class="ellipsis">{{ row.specification }}</div>
                    <div v-else>/</div>
                  </template>
                </el-table-column>
                <el-table-column
                  prop="stck_name"
                  label="预入仓库"
                  width="100"
                >
                  <template slot-scope="{row}">
                    <div v-if="row.stck_name" class="ellipsis">{{ row.stck_name }}</div>
                    <div v-else>/</div>
                  </template>
                </el-table-column>
                <el-table-column
                  prop="quantity"
                  label="数量"
                  width="63"
            <div style="height: 410px">
              <dv-border-box-12>
                <dv-scroll-board
                  ref="scrollBoardTop"
                  :config="configTableTop"
                  style="width: 1326px;height: 390px;margin:0 auto;padding-top: 13px;"
                />
                <el-table-column
                  prop="totalStockInQuantity"
                  label="已入库数量"
                  width="110"
                >
                  <template slot-scope="{row}">
                    <div v-if="row.totalStockInQuantity">{{ row.totalStockInQuantity }}</div>
                    <div v-else>0</div>
                  </template>
                </el-table-column>
                <!--                  <el-table-column-->
                <!--                    prop="uomname"-->
                <!--                    label="单位"-->
                <!--                    width="50"-->
                <!--                  />-->
                <!--                  <el-table-column-->
                <!--                    prop="preStartDate"-->
                <!--                    label="预计开工"-->
                <!--                    width="100"-->
                <!--                  >-->
                <!--                    <template slot-scope="{row}">-->
                <!--                      <div v-if="row.preStartDate">{{ row.preStartDate.substring(0, 10) }}</div>-->
                <!--                      <div v-else />-->
                <!--                    </template>-->
                <!--                  </el-table-column>-->
                <el-table-column
                  prop="preFinishDate"
                  label="预计入库"
                  width="140"
                >
                  <template slot-scope="{row}">
                    <div v-if="row.preFinishDate">{{ row.preFinishDate.substring(0, 10) }}</div>
                    <div v-else />
                  </template>
                </el-table-column>
              </el-table>
              </dv-border-box-12>
            </div>
          </div>
          <div style="height: 470px;margin-top: 30px;">
@@ -159,97 +39,14 @@
              <svg-icon icon-class="drk" class="svg_class" />
              å§”外待入库
            </div>
            <div class="lineContent horn" style="height: 410px">
              <el-table
                ref="tableDataBottomRef"
                :data="tableDataBottom"
                style="width: 100%;"
                class="tableData"
                :header-cell-style="headerCellStyleCenter"
                :cell-style="cellStyleCenter"
                height="405"
              >
                <el-table-column
                  prop="voucherdate"
                  label="单据日期"
                  width="151"
                >
                  <template slot-scope="{row}">
                    <div v-if="row.voucherdate" class="ellipsis">{{ row.voucherdate.substring(0, 10) }}</div>
                    <div v-else>/</div>
                  </template>
                </el-table-column>
                <el-table-column
                  prop="wo"
                  label="单据编号"
                  width="225"
                >
                  <template slot-scope="{row}">
                    <div class="ellipsis">{{ row.wo }}</div>
                  </template>
                </el-table-column>
                <el-table-column
                  prop="materiel_name"
                  label="产品名称"
                  width="278"
                >
                  <template slot-scope="{row}">
                    <div v-if="row.materiel_name" class="ellipsis">{{ row.materiel_name }}</div>
                  </template>
                </el-table-column>
                <el-table-column
                  prop="specification"
                  label="规格型号"
                  width="220"
                >
                  <template slot-scope="{row}">
                    <div v-if="row.specification" class="ellipsis">{{ row.specification }}</div>
                    <div v-else>/</div>
                  </template>
                </el-table-column>
                <el-table-column
                  prop="quantity"
                  label="数量"
                  width="120"
                >
                  <template slot-scope="{row}">
                    <div class="ellipsis">{{ row.quantity }}</div>
                  </template>
                </el-table-column>
                <el-table-column
                  prop="saleOutQuantity"
                  label="已发货数量"
                  width="140"
                >
                  <template slot-scope="{row}">
                    <div v-if="row.saleOutQuantity" class="ellipsis">{{ row.saleOutQuantity }}</div>
                    <div v-else>0</div>
                  </template>
                </el-table-column>
                <el-table-column
                  prop="deliveryDate"
                  label="预计交付日期"
                  width="200"
                >
                  <template slot-scope="{row}">
                    <div v-if="row.deliveryDate">{{ row.deliveryDate.substring(0, 10) }}</div>
                    <div v-else>/</div>
                  </template>
                </el-table-column>
                <!--                <el-table-column-->
                <!--                  prop="warning"-->
                <!--                  label="延期天数"-->
                <!--                  width="130"-->
                <!--                >-->
                <!--                  <template slot-scope="{row}">-->
                <!--                    <div v-if="row.warning">{{ row.warning }}</div>-->
                <!--                    <div v-else>/</div>-->
                <!--                  </template>-->
                <!--                </el-table-column>-->
              </el-table>
            <div style="height: 410px">
              <dv-border-box-12>
                <dv-scroll-board
                  ref="scrollBoardBottom"
                  :config="configTableBottom"
                  style="width: 1326px;height: 390px;margin:0 auto;padding-top: 13px;"
                />
              </dv-border-box-12>
            </div>
          </div>
@@ -260,9 +57,10 @@
              <svg-icon icon-class="ph" class="svg_class" />
              åŠæˆå“ã€äº§å“åº“存量排行Top5
            </div>
            <div class="lineContent horn" style="height: 410px">
              <div id="bar03" style="width: 100%;height:100%; " />
              <!--/*              <div id="bar03" style="width: 100%;height:100%;margin-left: -25px;margin-top: -10px" />*/-->
            <div style="height: 410px">
              <dv-border-box-12>
                <div id="bar03" key="bar03" style="width: 100%;height:100%; " />
              </dv-border-box-12>
            </div>
          </div>
          <div style="height: 470px;margin-top: 30px;">
@@ -270,9 +68,10 @@
              <svg-icon icon-class="ph" class="svg_class" />
              åŽŸææ–™åº“å­˜é‡æŽ’è¡ŒTop5
            </div>
            <div class="lineContent horn" style="height: 410px">
              <div id="bar04" style="width: 100%;height:100%;" />
              <!--              <div id="bar04" style="width: 100%;height:100%;margin-left: -25px;margin-top: -10px" />-->
            <div style="height: 410px">
              <dv-border-box-12>
                <div id="bar04" key="bar04" style="width: 100%;height:100%;" />
              </dv-border-box-12>
            </div>
          </div>
        </div>
@@ -300,8 +99,84 @@
      onLine: navigator.onLine, // ç›‘听网络是否在线
      headTime: '',
      tableDataTop: [],
      tableDataBottom: [],
      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>'
        ],
        data: [
          // ['<span style="color:#37a2da;">行1列1</span>', '行1列2', '行1列3'],
          // [1, 2, 3, 4, 5, 6, 8, 9],
          // [1, 2, 3, 4, 5, 6, 8, 9],
          // [1, 2, 3, 4, 5, 6, 8, 9],
          // [1, 2, 3, 4, 5, 6, 8, 9],
          // [1, 2, 3, 4, 5, 6, 8, 9],
          // [1, 2, 3, 4, 5, 6, 8, 9],
          // [1, 2, 3, 4, 5, 6, 8, 9],
          // [1, 2, 3, 4, 5, 6, 8, 9],
          // [1, 2, 3, 4, 5, 6, 8, 9],
          // [1, 2, 3, 4, 5, 6, 8, 9],
          // [1, 2, 3, 4, 5, 6, 8, 9],
          // [1, 2, 3, 4, 5, 6, 8, 9]
        ],
        index: true,
        columnWidth: [50, 130, 150, 300, 200, 120, 120, 120, 120],
        align: ['center', 'center', 'center', 'center', 'center', 'center', 'center', 'center', 'center']
        // carousel: 'page'
      },
      configTableBottom: {
        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>'
        ],
        data: [
          // ['<span style="color:#37a2da;">行1列1</span>', '行1列2', '行1列3'],
          // [1, 2, 3, 4, 5, 6, 8, 9],
          // [1, 2, 3, 4, 5, 6, 8, 9],
          // [1, 2, 3, 4, 5, 6, 8, 9],
          // [1, 2, 3, 4, 5, 6, 8, 9],
          // [1, 2, 3, 4, 5, 6, 8, 9],
          // [1, 2, 3, 4, 5, 6, 8, 9],
          // [1, 2, 3, 4, 5, 6, 8, 9],
          // [1, 2, 3, 4, 5, 6, 8, 9],
          // [1, 2, 3, 4, 5, 6, 8, 9],
          // [1, 2, 3, 4, 5, 6, 8, 9],
          // [1, 2, 3, 4, 5, 6, 8, 9],
          // [1, 2, 3, 4, 5, 6, 8, 9]
        ],
        index: true,
        columnWidth: [50, 130, 150, 300, 200, 120, 120, 120, 120],
        align: ['center', 'center', 'center', 'center', 'center', 'center', 'center', 'center', 'center']
        // carousel: 'page'
      },
      MarqueeTipsContent: '', // å…¬å‘Š
      speed: 100, // å…¬å‘Šæ’­æ”¾çš„速度
@@ -336,7 +211,15 @@
    this.updateOnlineStatus({ type: this.onLine ? 'online' : 'offline', isFirst: true })
    this.getWareHouseTopLeftData()
    setInterval(() => {
      this.getWareHouseTopLeftData()
    }, 15 * 1000)
    this.getWareHouseTopBottomData()
    setInterval(() => {
      this.getWareHouseTopBottomData()
    }, 20 * 1000)
    this.getEcharts()
  },
  beforeDestroy() {
@@ -369,78 +252,83 @@
    // èŽ·å–å·¦ä¸Štable数据
    getWareHouseTopLeftData() {
      WareHouseTopLeftData().then(res => {
        this.tableDataTop = res.data
        // this.number1 = this.tableDataTop.length
        const divData = this.$refs.tableDataTopRef.bodyWrapper
        // æ‹¿åˆ°å…ƒç´ åŽï¼Œå¯¹å…ƒç´ è¿›è¡Œå®šæ—¶å¢žåŠ è·ç¦»é¡¶éƒ¨è·ç¦»ï¼Œå®žçŽ°æ»šåŠ¨æ•ˆæžœ(此配置为每100毫秒移动1像素)
        this.tableTopTask = setInterval(() => {
          // å…ƒç´ è‡ªå¢žè·ç¦»é¡¶éƒ¨1像素
          divData.scrollTop += 1
          // divData.scrollTop += divData.scrollHeight / this.tableData.length
          // åˆ¤æ–­å…ƒç´ æ˜¯å¦æ»šåŠ¨åˆ°åº•éƒ¨(可视高度+距离顶部=整个高度)
          if (divData.clientHeight + divData.scrollTop === divData.scrollHeight) {
            // é‡ç½®table距离顶部距离
            divData.scrollTop = 0
            WareHouseTopLeftData().then(res => {
              this.tableDataTop = res.data
              // this.number1 = this.tableDataTop.length
              if (this.tableDataTop.length > 10) {
                clearInterval(this.tableTopTask)
                this.getWareHouseTopLeftData()
              }
            })
          }
        }, this.tableDataTop.length <= 10 ? 1000 * 30 : 200)
        const flag = this.compareArrays(this.configTableTop.data, res.data)
        if (!flag) {
          this.configTableTop.data = res.data.map(i =>
            [
              i.voucherdate.substring(0, 10),
              i.wo,
              i.saleOrderCode ? i.saleOrderCode : '/',
              i.materiel_name,
              i.specification ? i.specification : '/',
              i.quantity,
              i.totalStockInQuantity ? i.totalStockInQuantity : 0,
              `<span style="color: red;">${i.quantity - i.totalStockInQuantity}</span>`
            ]
          )
          this.$refs['scrollBoardTop'].updateRows(this.configTableTop.data)
        }
      })
    },
    // èŽ·å–å·¦ä¸‹table数据
    getWareHouseTopBottomData() {
      WareHouseTopBottomData().then(res => {
        this.tableDataBottom = res.data
        this.number2 = this.tableDataBottom.length
        const divData = this.$refs.tableDataBottomRef.bodyWrapper
        // æ‹¿åˆ°å…ƒç´ åŽï¼Œå¯¹å…ƒç´ è¿›è¡Œå®šæ—¶å¢žåŠ è·ç¦»é¡¶éƒ¨è·ç¦»ï¼Œå®žçŽ°æ»šåŠ¨æ•ˆæžœ(此配置为每100毫秒移动1像素)
        // const task = setInterval(() => {
        this.tableBottomTask = setInterval(() => {
          // å…ƒç´ è‡ªå¢žè·ç¦»é¡¶éƒ¨1像素
          divData.scrollTop += 1
          // divData.scrollTop += divData.scrollHeight / this.tableData.length
          // åˆ¤æ–­å…ƒç´ æ˜¯å¦æ»šåŠ¨åˆ°åº•éƒ¨(可视高度+距离顶部=整个高度)
          if (divData.clientHeight + divData.scrollTop === divData.scrollHeight) {
            // é‡ç½®table距离顶部距离
            divData.scrollTop = 0
            WareHouseTopBottomData().then(res => {
              this.tableDataBottom = res.data
              this.number2 = this.tableDataBottom.length
              if (this.tableDataBottom.length > 10) {
                clearInterval(this.tableBottomTask)
                this.getWareHouseTopBottomData()
              }
            })
          }
        }, this.tableDataBottom.length <= 10 ? 1000 * 20 : 100)
        const flag = this.compareArrays(this.configTableBottom.data, res.data)
        if (!flag) {
          this.configTableBottom.data = res.data.map(i =>
            [
              i.voucherdate.substring(0, 10),
              i.wo,
              i.saleOrderCode ? i.saleOrderCode : '/',
              i.materiel_name,
              i.specification ? i.specification : '/',
              i.quantity,
              i.totalStockInQuantity ? i.totalStockInQuantity : 0,
              `<span style="color: red;">${i.quantity - i.totalStockInQuantity}</span>`
            ]
          )
          this.$refs['scrollBoardBottom'].updateRows(this.configTableBottom.data)
        }
      })
    },
    // ä¸¤ä¸ªæ•°ç»„做对比
    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
    },
    // èŽ·å–echarts
    getEcharts() {
      WareHouseRightTopData().then(res => {
        loadEcharts('bar03', bar02(res.data.map(i => i.CanuseBaseQuantity), res.data.map(i => i.materiel_name)))
        loadEcharts('bar03', bar02(res.data.filter(i => i.CanuseBaseQuantity > 0).map(i => i.CanuseBaseQuantity), res.data.filter(i => i.CanuseBaseQuantity > 0).map(i => i.materiel_name)))
      })
      WareHouseRightBottomData().then(res => {
        loadEcharts('bar04', bar02(res.dat.map(i => i.CanuseBaseQuantity), res.data.map(i => i.materiel_name)))
        loadEcharts('bar04', bar02(res.data.filter(i => i.CanuseBaseQuantity > 0).map(i => i.CanuseBaseQuantity), res.data.filter(i => i.CanuseBaseQuantity > 0).map(i => i.materiel_name)))
      })
      this.echartsRightTop = setInterval(() => {
        WareHouseRightTopData().then(res => {
          loadEcharts('bar03', bar02(res.data.map(i => i.CanuseBaseQuantity), res.data.map(i => i.materiel_name)))
          loadEcharts('bar03', bar02(res.data.filter(i => i.CanuseBaseQuantity > 0).map(i => i.CanuseBaseQuantity), res.data.filter(i => i.CanuseBaseQuantity > 0).map(i => i.materiel_name)))
        })
      }, 1000 * 15)
      }, 1000 * 20)
      this.echartsRightBottom = setInterval(() => {
        WareHouseRightBottomData().then(res => {
          loadEcharts('bar04', bar02(res.data.map(i => i.CanuseBaseQuantity), res.data.map(i => i.materiel_name)))
          loadEcharts('bar04', bar02(res.data.filter(i => i.CanuseBaseQuantity > 0).map(i => i.CanuseBaseQuantity), res.data.filter(i => i.CanuseBaseQuantity > 0).map(i => i.materiel_name)))
        })
      }, 1000 * 15)
    },
src/views/kanbanManager/dccj.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,258 @@
<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>浙江大岛电器有限公司</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, , 130, 130
        columnWidth: [200, 140, 350, 350, 130, 130, 130, 130, 130, 130, 130],
        align: ['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()
    setInterval(() => {
      this.getWorkShopProduceBottomLeftData()
    }, 20 * 1000)
    this.getWorkShopProduceBottomRightData()
    setInterval(() => {
      this.getWorkShopProduceBottomRightData()
    }, 30 * 1000)
  },
  methods: {
    getWorkShopProduceTopData() {
      WorkShopProduceTopData({ wkshopcode: 'CJ002' }).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>`,
              i.seq,
              i.step_code,
              i.step_name,
              parseFloat(i.schedule.toFixed(2))
            ]
          )
          // `<span style="color: red;">${i.laborbad_qty}</span>`,
          // `<span style="color: red;">${i.materielbad_qty}</span>`,
          this.$refs['scrollBoardTop'].updateRows(this.configTableTop.data)
        }
      })
    },
    async getWorkShopProduceBottomLeftData() {
      const res4 = await WorkShopProduceBottomLeftData({ wkshopcode: 'CJ002' })
      this.cjzl03_xData = res4.data['CJ002'].map(i => i.click_date)
      this.cjzl03_yData = res4.data['CJ002'].map(i => i.count)
      loadEcharts('cjzl03', cjzl03_2(this.cjzl03_xData, this.cjzl03_yData))
    },
    async getWorkShopProduceBottomRightData() {
      const res5 = await WorkShopProduceBottomRightData({ wkshopcode: 'CJ002' })
      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>
src/views/kanbanManager/zhkb.vue
@@ -10,13 +10,14 @@
        </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">
          <span>{{ headTime }}</span>
        </div>
      </div>
      <div
        style=" padding:5px 20px 20px 20px;z-index:2;height: 940px;flex-direction: column;justify-content: space-between;"
      >
@@ -24,46 +25,56 @@
        <div style="display: flex;justify-content: space-between">
          <div style="width: 925px;">
            <div class="smallTitle">
              <svg-icon icon-class="blcs" class="svg_class" />
              é‡‡è´­è®¢å•(月/å­£)
              <svg-icon icon-class="cxjg" class="svg_class" />
              ç”Ÿäº§è®¢å•(月/å­£)
            </div>
            <div
              class="lineContent horn"
              style="height: 450px;display: flex;flex-direction: column;justify-content: space-between"
            >
              <div style="height: 180px;padding: 10px;display: flex;justify-content: space-between">
                <div v-for="i in LeftTopData01" :key="i.Quarter" class="flex_c_s">
            <dv-border-box-12 style="height: 415px;">
              <div style="height: 180px;padding: 10px;display: flex; justify-content: space-around;">
                <div v-for="i in LeftTopData01" :key="i.wkshp_code" class="flex_c_s">
                  <div class="all_block03 flex_c_s">
                    <div class="flex_c_c all_block04">{{ i.Quarter }}</div>
                    <div class="flex_c_c all_block04">{{ i.wkshp_name }}</div>
                    <div class="" style="display: flex;justify-content:space-between">
                      <div class="all_block04 flex_c_c" style="width: 49% ">任务数</div>
                      <div class="all_block04 flex_c_c" style="width: 49% ">{{ i.quantity }}</div>
                      <div class="all_block04 flex_c_c" style="width: 49% ">{{ i.plan_qty }}</div>
                    </div>
                    <div class="" style="display: flex;justify-content:space-between">
                      <div class="all_block04 flex_c_c" style="width: 49% ">入库数</div>
                      <div class="all_block04 flex_c_c" style="width: 49% ">{{ i.ouquantity }}</div>
                      <div class="all_block04 flex_c_c" style="width: 49% ">完工数</div>
                      <div class="all_block04 flex_c_c" style="width: 49% ">{{ i.good_qty }}</div>
                    </div>
                  </div>
                </div>
              </div>
              <div style="height: 180px;padding: 10px;display: flex; justify-content: space-around;margin-top: 20px;">
                <div v-for="i in LeftTopData02" :key="i.wkshp_code" class="flex_c_s">
                  <div class="all_block03 flex_c_s">
                    <div class="flex_c_c all_block04">{{ i.wkshp_name }}</div>
                    <div class="" style="display: flex;justify-content:space-between">
                      <div class="all_block04 flex_c_c" style="width: 49% ">任务数</div>
                      <div class="all_block04 flex_c_c" style="width: 49% ">{{ i.plan_qty }}</div>
                    </div>
                    <div class="" style="display: flex;justify-content:space-between">
                      <div class="all_block04 flex_c_c" style="width: 49% ">完工数</div>
                      <div class="all_block04 flex_c_c" style="width: 49% ">{{ i.quantity }}</div>
                    </div>
                  </div>
                </div>
              </div>
              <div style="height: 260px;">
                <div id="all02_1" class="flex_c_c" style="width: 100%;height:100%;" />
              </div>
            </div>
              <!--              <div style="height: 260px;">-->
              <!--                <div id="all01" class="flex_c_c" style="width: 100%;height:100%;" />-->
              <!--              </div>-->
            </dv-border-box-12>
          </div>
          <div style="width: 925px;">
            <div class="smallTitle">
              <svg-icon icon-class="cggz" class="svg_class" />
              é”€å”®è®¢å•(月/å­£)
            </div>
            <div
              class="lineContent horn"
              style="height: 450px;display: flex;flex-direction: column;justify-content: space-between"
            >
              <div style="height: 180px;padding: 10px;display: flex;justify-content: space-between">
            <dv-border-box-12 style="height: 415px;">
              <div style="height: 180px;padding: 10px;display: flex;    justify-content: space-around;">
                <div v-for="i in RightTopData01" :key="i.Quarter" class="flex_c_s">
                  <div class="all_block03 flex_c_s">
                    <div class="flex_c_c all_block04">{{ i.Quarter }}</div>
@@ -77,71 +88,72 @@
                    </div>
                  </div>
                </div>
              </div>
              <div style="height: 260px;">
              <div style="height: 220px;">
                <div id="all02" class="flex_c_c" style="width: 100%;height:100%;" />
              </div>
            </div>
            </dv-border-box-12>
          </div>
        </div>
        <!--        ä¸‹è¾¹-->
        <div style="display: flex;justify-content: space-between;margin-top: 15px;">
          <div style="width: 925px;">
            <div class="smallTitle">
              <svg-icon icon-class="cxjg" class="svg_class" />
              ç”Ÿäº§è®¢å•(当月)
              <svg-icon icon-class="cgdd" class="svg_class" />
              é‡‡è´­è®¢å•(月/å­£)
            </div>
            <div
              class="lineContent horn"
              style="height: 380px;display: flex;flex-direction: column;justify-content: space-between"
            >
              <div style="height: 180px;padding: 10px;display: flex;justify-content: space-evenly">
                <div v-for="i in LeftBottomData01" :key="i.wkshp_code" class="flex_c_s">
                  <div class="all_block01 flex_c_s" style="width: 275px;">
                    <div class="flex_c_c all_block02" style="">{{ i.wkshp_name }}</div>
            <dv-border-box-12 style="height: 415px;display:flex;">
              <div style="height: 180px;padding: 10px;display: flex;    justify-content: space-around;">
                <div v-for="i in LeftBottomData01" :key="i.Quarter" class="flex_c_s">
                  <div class="all_block03 flex_c_s">
                    <div class="flex_c_c all_block04">{{ i.Quarter }}</div>
                    <div class="" style="display: flex;justify-content:space-between">
                      <div class="all_block02 flex_c_c" style="width: 49% ">任务数</div>
                      <div class="all_block02 flex_c_c" style="width: 49% ">{{ i.plan_qty }}</div>
                      <div class="all_block04 flex_c_c" style="width: 49% ">任务数</div>
                      <div class="all_block04 flex_c_c" style="width: 49% ">{{ i.quantity }}</div>
                    </div>
                    <div class="" style="display: flex;justify-content:space-between">
                      <div class="all_block02 flex_c_c" style="width: 49% ">完工数</div>
                      <div class="all_block02 flex_c_c" style="width: 49% ">{{ i.good_qty }}</div>
                      <div class="all_block04 flex_c_c" style="width: 49% ">出库数</div>
                      <div class="all_block04 flex_c_c" style="width: 49% ">{{ i.ouquantity }}</div>
                    </div>
                  </div>
                </div>
              </div>
              <div style="height: 220px;">
                <div id="all03" class="flex_c_c" style="width: 100%;height:100%;" />
              </div>
              </div>
              <div style="height: 260px;">
                <div id="all01" class="flex_c_c" style="width: 100%;height:100%;" />
              </div>
            </div>
            </dv-border-box-12>
          </div>
          <div style="width: 925px;">
            <div class="smallTitle">
              <svg-icon icon-class="ckkc" class="svg_class" />
              ä»“库库存
            </div>
            <div class="lineContent horn" style="height: 380px;display: flex;justify-content: space-between">
            <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>
              </div>
            </div>
            </dv-border-box-12>
          </div>
        </div>
      </div>
@@ -151,9 +163,12 @@
<script>
import './kbCommon.css'
import { loadEcharts, all02, all03 } from '@/utils/myEcharts'
import { loadEcharts, all02 } from '@/utils/myEcharts'
import {
  WorkShopCompreLeftBottom, WorkShopCompreLeftTop, WorkShopCompreRightBottom, WorkShopCompreRightTop
  WorkShopCompreLeftTop,
  WorkShopCompreRightBottom,
  WorkShopCompreRightTop,
  WorkShopCompreLeftBottom
} from '@/api/kanbanManager'
export default {
@@ -161,9 +176,6 @@
  data() {
    return {
      headTime: '',
      tableDataRightTop: [],
      wkshopArr: [],
      legendData: [],
      LeftTopData01: [],
      LeftTopData02: [],
@@ -187,141 +199,75 @@
    }, 1000 * 60 * 120)
  },
  mounted() {
    this.getAllApi()
    this.getWorkShopCompreLeftTop()
    setInterval(() => {
      this.getWorkShopCompreLeftTop()
    }, 10 * 1000)
    this.getWorkShopCompreRightTop()
    setInterval(() => {
      this.getWorkShopCompreRightTop()
    }, 15 * 1000)
    this.getWorkShopCompreLeftBottom()
    setInterval(() => {
      this.getWorkShopCompreLeftBottom()
    }, 20 * 1000)
    this.getWorkShopCompreRightBottom()
    setInterval(() => {
      this.getWorkShopCompreRightBottom()
    }, 25 * 1000)
  },
  methods: {
    async getAllApi() {
      // const { data: res } = await ShopSearch()
    getWorkShopCompreLeftTop() {
      const res = [
        { org_code: '101', org_name: '发泡车间' },
        { org_code: '102', org_name: '挤出车间' }
        { org_code: 'CJ001', org_name: '装配车间' },
        { org_code: 'CJ002', org_name: '电池车间' },
        { org_code: 'CJ003', org_name: '包装车间' }
      ]
      this.wkshopArr = res
      const temp = this.wkshopArr.map(i => i.org_code)
      // const temp = this.wkshopArr.map(i => i.org_code)
      temp.forEach(i => {
        const aa = this.wkshopArr.find(j => j.org_code === i).org_name
        this.legendData.push(aa)
      })
      const temp = ['CJ001', 'CJ002', 'CJ003']
      // å·¦ä¸Š é‡‡è´­è®¢å•
      const res2 = await WorkShopCompreLeftBottom()
      res2.data.BottomLeftTop.forEach(i => {
        this.LeftTopData01.push({
          Quarter: i.Quarter,
          quantity: i.quantity,
          ouquantity: i.ouquantity
        })
      })
      res2.data.BottomLeftBottom.forEach(i => {
        this.LeftTopData02.push({
          Month: i.Month + '月',
          quantity: i.quantity,
          ouquantity: i.ouquantity
        })
      })
      loadEcharts('all02_1', all02(this.LeftTopData02, '每月采购数量/入库数量'))
      setInterval(() => {
      WorkShopCompreLeftTop({ wkshopcode: temp.join(',') }).then(res2 => {
        this.LeftTopData01 = []
        this.LeftTopData02 = []
        WorkShopCompreLeftBottom().then(res2 => {
          res2.data.BottomLeftTop.forEach(i => {
            this.LeftTopData01.push({
              Quarter: i.Quarter,
              quantity: i.quantity,
              ouquantity: i.ouquantity
            })
          })
          res2.data.BottomLeftBottom.forEach(i => {
            this.LeftTopData02.push({
              Month: i.Month + '月',
              quantity: i.quantity,
              ouquantity: i.ouquantity
            })
          })
          loadEcharts('all02_1', all02(this.LeftTopData02, '每月采购数量/入库数量'))
        })
      }, 1000 * 35)
      // å³ä¸Š é”€å”®è®¢å•
      const res3 = await WorkShopCompreRightTop()
      res3.data.RightTop.forEach(i => {
        this.RightTopData01.push({
          Quarter: i.Quarter,
          quantity: i.quantity,
          ouquantity: i.ouquantity
        })
        for (const res4Key in res2.data.LeftTop) {
          const data = {
            good_qty: 0,
            plan_qty: 0,
            wkshp_code: '',
            wkshp_name: ''
          }
          if (temp.includes(res4Key)) {
            data.good_qty = res2.data.LeftTop[res4Key][0].good_qty
            data.plan_qty = res2.data.LeftTop[res4Key][0].plan_qty
            data.wkshp_code = res2.data.LeftTop[res4Key][0].wkshp_code
            data.wkshp_name = res.find(i => i.org_code === data.wkshp_code).org_name
            this.LeftTopData01.push(data)
          }
        }
        for (const res4Key in res2.data.LeftBottom) {
          const data = {
            quantity: 0,
            wkshp_code: '',
            wkshp_name: ''
          }
          if (temp.includes(res4Key)) {
            data.quantity = res2.data.LeftBottom[res4Key][0].quantity
            data.plan_qty = res2.data.LeftBottom[res4Key][0].plan_qty
            data.wkshp_code = res2.data.LeftBottom[res4Key][0].wkshp_code
            data.wkshp_name = res.find(i => i.org_code === data.wkshp_code).org_name
            this.LeftTopData02.push(data)
          }
        }
      })
      res3.data.RightBottom.forEach(i => {
        this.RightTopData02.push({
          Month: i.Month + '月',
          quantity: i.quantity,
          ouquantity: i.ouquantity
        })
      })
      loadEcharts('all02', all02(this.RightTopData02, '每月订单数量/出库数量'))
      setInterval(() => {
        WorkShopCompreRightTop().then(res3 => {
          this.RightTopData01 = []
          this.RightTopData02 = []
          res3.data.RightTop.forEach(i => {
            this.RightTopData01.push({
              Quarter: i.Quarter,
              quantity: i.quantity,
              ouquantity: i.ouquantity
            })
          })
          res3.data.RightBottom.forEach(i => {
            this.RightTopData02.push({
              Month: i.Month + '月',
              quantity: i.quantity,
              ouquantity: i.ouquantity
            })
          })
          loadEcharts('all02', all02(this.RightTopData02, '每月订单数量/出库数量'))
        })
      }, 1000 * 40)
      // å·¦ä¸‹ ç”Ÿäº§è®¢å•
      const res4 = await WorkShopCompreLeftTop({ wkshopcode: temp.join(',') })
      for (const res4Key in res4.data.LeftTop) {
        const data = {
          good_qty: 0,
          plan_qty: 0,
          wkshp_code: '',
          wkshp_name: ''
        }
        if (temp.includes(res4Key)) {
          data.good_qty = res4.data.LeftTop[res4Key][0].good_qty
          data.plan_qty = res4.data.LeftTop[res4Key][0].plan_qty
          data.wkshp_code = res4.data.LeftTop[res4Key][0].wkshp_code
          data.wkshp_name = this.wkshopArr.find(i => i.org_code === data.wkshp_code).org_name
          this.LeftBottomData01.push(data)
        }
      }
      for (const res4Key in res4.data.LeftBottom) {
        const data = {
          quantity: 0,
          wkshp_code: '',
          wkshp_name: ''
        }
        if (temp.includes(res4Key)) {
          data.quantity = res4.data.LeftBottom[res4Key][0].quantity
          data.plan_qty = res4.data.LeftBottom[res4Key][0].plan_qty
          data.wkshp_code = res4.data.LeftBottom[res4Key][0].wkshp_code
          data.wkshp_name = this.wkshopArr.find(i => i.org_code === data.wkshp_code).org_name
          this.LeftBottomData02.push(data)
        }
      }
      loadEcharts('all01', all03(this.legendData, this.LeftBottomData02))
      setInterval(() => {
        WorkShopCompreLeftTop({ wkshopcode: temp.join(',') }).then(res2 => {
          this.LeftBottomData01 = []
          this.LeftBottomData02 = []
          for (const res4Key in res4.data.LeftTop) {
          this.LeftTopData01 = []
          this.LeftTopData02 = []
          for (const res4Key in res2.data.LeftTop) {
            const data = {
              good_qty: 0,
              plan_qty: 0,
@@ -332,8 +278,8 @@
              data.good_qty = res2.data.LeftTop[res4Key][0].good_qty
              data.plan_qty = res2.data.LeftTop[res4Key][0].plan_qty
              data.wkshp_code = res2.data.LeftTop[res4Key][0].wkshp_code
              data.wkshp_name = this.wkshopArr.find(i => i.org_code === data.wkshp_code).org_name
              this.LeftBottomData01.push(data)
              data.wkshp_name = res.find(i => i.org_code === data.wkshp_code).org_name
              this.LeftTopData01.push(data)
            }
          }
          for (const res4Key in res2.data.LeftBottom) {
@@ -346,37 +292,62 @@
              data.quantity = res2.data.LeftBottom[res4Key][0].quantity
              data.plan_qty = res2.data.LeftBottom[res4Key][0].plan_qty
              data.wkshp_code = res2.data.LeftBottom[res4Key][0].wkshp_code
              data.wkshp_name = this.wkshopArr.find(i => i.org_code === data.wkshp_code).org_name
              this.LeftBottomData02.push(data)
              data.wkshp_name = res.find(i => i.org_code === data.wkshp_code).org_name
              this.LeftTopData02.push(data)
            }
          }
          loadEcharts('all01', all03(this.legendData, this.LeftBottomData02))
        })
      }, 1000 * 30)
      // å³ä¸‹ ä»“库库存
      const res5 = await WorkShopCompreRightBottom()
      this.RightBottom = res5.data
      setInterval(() => {
        WorkShopCompreRightBottom().then(res5 => {
          this.RightBottom = res5.data
        })
      }, 1000 * 60)
    },
    // èŽ·å–Echarts
    getEcharts() {
      // loadEcharts('cjzl01', cjzl01(this.cjzl01Data))
    getWorkShopCompreRightTop() {
      WorkShopCompreRightTop().then(res3 => {
        this.RightTopData01 = []
        this.RightTopData02 = []
        res3.data.RightTop.forEach(i => {
          this.RightTopData01.push({
            Quarter: i.Quarter,
            quantity: i.quantity,
            ouquantity: i.ouquantity
          })
        })
        res3.data.RightBottom.forEach(i => {
          this.RightTopData02.push({
            Month: i.Month + '月',
            quantity: i.quantity,
            ouquantity: i.ouquantity
          })
        })
        loadEcharts('all02', all02(this.RightTopData02))
      })
    },
      // loadEcharts('cjzl02_1', cjzl02(this.cjzl02_1Title, this.cjzl02_1Data))
      // loadEcharts('cjzl02_2', cjzl02(this.cjzl02_2Title, this.cjzl02_2Data))
      // loadEcharts('cjzl02_3', cjzl02(this.cjzl02_3Title, this.cjzl02_3Data))
      // loadEcharts('cjzl02_4', cjzl02(this.cjzl02_4Title, this.cjzl02_4Data))
      // loadEcharts('cjzl02_5', cjzl02(this.cjzl02_5Title, this.cjzl02_5Data))
    getWorkShopCompreLeftBottom() {
      WorkShopCompreLeftBottom().then(res3 => {
        this.LeftBottomData01 = []
        this.LeftBottomData02 = []
        res3.data.BottomLeftTop.forEach(i => {
          this.LeftBottomData01.push({
            Quarter: i.Quarter,
            quantity: i.quantity,
            ouquantity: i.ouquantity
          })
        })
        res3.data.BottomLeftBottom.forEach(i => {
          this.LeftBottomData02.push({
            Month: i.Month + '月',
            quantity: i.quantity,
            ouquantity: i.ouquantity
          })
        })
        loadEcharts('all03', all02(this.LeftBottomData02))
      })
    },
      // loadEcharts('cjzl04', cjzl04(this.legendData, this.cjzl04Data[0], this.cjzl04Data[1], this.cjzl04Data[2]))// å³ä¾§
      // loadEcharts('cjzl03', cjzl03(this.cjzl03_xData, this.legendData, this.cjzl03_yData))// å·¦ä¾§
    getWorkShopCompreRightBottom() {
      WorkShopCompreRightBottom().then(res5 => {
        this.RightBottom = res5.data
      })
    },
    // èŽ·å–å½“å‰æ—¶é—´
@@ -394,26 +365,6 @@
      const week = weeks[wk]
      this.headTime = `${y}-${m}-${d}  ${hh}:${mm}:${ss}   ${week}`
    },
    headerCellStyle() {
      return {
        backgroundColor: 'transparent ',
        padding: '10px 0',
        textAlign: 'center',
        color: '#07acc2',
        border: 'none',
        fontSize: '20px'
      }
    },
    cellStyle() {
      return {
        padding: '7px 0',
        textAlign: 'center',
        backgroundColor: 'transparent ',
        color: '#c7e7ff',
        border: 'none',
        fontSize: '20px'
      }
    }
  }
@@ -455,7 +406,7 @@
}
.all_block01 {
  width: 187px;
  width: 237px;
  height: 180px;
}
@@ -466,7 +417,7 @@
}
.all_block03 {
  width: 199px;
  width: 220px;
  height: 180px;
}
@@ -499,43 +450,43 @@
.all_block05 {
  position: absolute;
  animation: upDown 3s ease-in-out infinite;
  left: 70px;
  animation: upDown 5s ease-in-out infinite;
  left: 80px;
}
.all_block06 {
  position: absolute;
  animation: upDown2 3s ease-in-out infinite;
  left: 320px;
  animation: upDown2 5s ease-in-out infinite;
  left: 330px;
}
.all_block07 {
  position: absolute;
  animation: upDown 3s ease-in-out infinite;
  left: 570px;
  animation: upDown 5s ease-in-out infinite;
  left: 580px;
}
@keyframes upDown {
  0% {
    top: 50px;
    top: 75px;
  }
  50% {
    top: 100px;
    top: 150px;
  }
  100% {
    top: 50px;
    top: 75px;
  }
}
@keyframes upDown2 {
  0% {
    top: 100px;
    top: 150px;
  }
  50% {
    top: 50px;
    top: 75px;
  }
  100% {
    top: 100px;
    top: 150px;
  }
}
</style>
src/views/kanbanManager/zpcj.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,258 @@
<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>浙江大岛电器有限公司</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, , 130, 130
        columnWidth: [200, 140, 350, 350, 130, 130, 130, 130, 130, 130, 130],
        align: ['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()
    setInterval(() => {
      this.getWorkShopProduceBottomLeftData()
    }, 20 * 1000)
    this.getWorkShopProduceBottomRightData()
    setInterval(() => {
      this.getWorkShopProduceBottomRightData()
    }, 30 * 1000)
  },
  methods: {
    getWorkShopProduceTopData() {
      WorkShopProduceTopData({ wkshopcode: 'CJ001' }).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>`,
              i.seq,
              i.step_code,
              i.step_name,
              parseFloat(i.schedule.toFixed(2))
            ]
          )
          // `<span style="color: red;">${i.laborbad_qty}</span>`,
          // `<span style="color: red;">${i.materielbad_qty}</span>`,
          this.$refs['scrollBoardTop'].updateRows(this.configTableTop.data)
        }
      })
    },
    async getWorkShopProduceBottomLeftData() {
      const res4 = await WorkShopProduceBottomLeftData({ wkshopcode: 'CJ001' })
      this.cjzl03_xData = res4.data['CJ001'].map(i => i.click_date)
      this.cjzl03_yData = res4.data['CJ001'].map(i => i.count)
      loadEcharts('cjzl03', cjzl03_2(this.cjzl03_xData, this.cjzl03_yData))
    },
    async getWorkShopProduceBottomRightData() {
      const res5 = await WorkShopProduceBottomRightData({ wkshopcode: 'CJ001' })
      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>
vue.config.js
@@ -53,7 +53,7 @@
    proxy: {
      [process.env.VUE_APP_BASE_API]: {
        target: 'http://121.196.36.24:8039', // æœ¬åœ°
        // target: 'http://192.168.0.99:8000', // å¤§å²›2.0
        // target: 'http://192.168.2.138:8080', // å¤§å²›2.0
        changeOrigin: true, // è¯·æ±‚跨域时,需 é…ç½®æ­¤é¡¹
        pathRewrite: { // è·¯å¾„重写,替换target中的请求地址
          ['^' + process.env.VUE_APP_BASE_API]: '/api/'