loulijun2021
2023-03-01 9219fc482b055ef695d0b1377ee96d0c4d065a16
src/views/kb/cjsc.vue
@@ -15,7 +15,7 @@
        <div style="width: 380px;height: 969px;" class="flex_c_b">
          <div>
            <div class="smallTitle">
              <svg-icon icon-class="eqp_name" class="svg_class" />
              <svg-icon icon-class="cxmc" class="svg_class" />
              装配一线
            </div>
            <div class="lineContent horn">
@@ -29,7 +29,7 @@
                height="428"
              >
                <el-table-column
                  prop="xsdd"
                  prop="saleOrderCode"
                  label="销售单号"
                  width="165"
                />
@@ -40,7 +40,7 @@
                  label="产品名称"
                />
                <el-table-column
                  prop="sl"
                  prop="good_qty"
                  label="数量"
                  width="80"
                />
@@ -49,7 +49,7 @@
          </div>
          <div>
            <div class="smallTitle">
              <svg-icon icon-class="eqp_name" class="svg_class" />
              <svg-icon icon-class="cxmc" class="svg_class" />
              装配二线
            </div>
            <div class="lineContent horn">
@@ -63,7 +63,7 @@
                height="428"
              >
                <el-table-column
                  prop="xsdd"
                  prop="saleOrderCode"
                  label="销售单号"
                  width="165"
                />
@@ -74,7 +74,7 @@
                  label="产品名称"
                />
                <el-table-column
                  prop="sl"
                  prop="good_qty"
                  label="数量"
                  width="80"
                />
@@ -99,21 +99,21 @@
              height="927"
            >
              <el-table-column
                type="index"
                type="RowNum"
                label="序号"
                width="60"
              >
                <!--                <template slot-scope="{row}">-->
                <!--                  <div-->
                <!--                    :style="{color:row.eqp_name==='装配一线'?'#FFFF77':row.eqp_name==='装配二线'?'#FF8888':row.eqp_name==='装配三线'?'#D28EFF':'#66FFFF'}"-->
                <!--                  > {{ row.index }}-->
                <!--                  </div>-->
                <!--                </template>-->
                <template slot-scope="{row}">
                  <div
                    :style="{color:row.eqp_name==='装配一线'?'#FFFF77':row.eqp_name==='装配二线'?'#FF8888':row.eqp_name==='装配三线'?'#D28EFF':'#66FFFF'}"
                  > {{ row.RowNum }}
                  </div>
                </template>
              </el-table-column>
              <el-table-column
                prop="wo_code"
                label="加工单号"
                width="165"
                width="190"
              >
                <template slot-scope="{row}">
                  <div
@@ -165,9 +165,11 @@
              >
                <template slot-scope="{row}">
                  <div
                    v-if="row.plan_startdate"
                    :style="{color:row.eqp_name==='装配一线'?'#FFFF77':row.eqp_name==='装配二线'?'#FF8888':row.eqp_name==='装配三线'?'#D28EFF':'#66FFFF'}"
                  > {{ row.plan_startdate.substring(0, 11) }}
                  </div>
                  <div v-else />
                </template>
              </el-table-column>
              <el-table-column
@@ -177,9 +179,11 @@
              >
                <template slot-scope="{row}">
                  <div
                    v-if="row.plan_enddate"
                    :style="{color:row.eqp_name==='装配一线'?'#FFFF77':row.eqp_name==='装配二线'?'#FF8888':row.eqp_name==='装配三线'?'#D28EFF':'#66FFFF'}"
                  > {{ row.plan_enddate.substring(0, 11) }}
                  </div>
                  <div v-else />
                </template>
              </el-table-column>
              <el-table-column
@@ -200,11 +204,7 @@
                width="130"
              >
                <template slot-scope="{row}">
                  <!--                  <div-->
                  <!--                    :style="{color:row.eqp_name==='装配一线'?'#FFFF77':row.eqp_name==='装配二线'?'#FF8888':row.eqp_name==='装配三线'?'#D28EFF':'#66FFFF'}"-->
                  <!--                  > {{ row.scjdxxx }}-->
                  <!--                  </div>-->
                  <!--                  <div :id="'progress'+row.xh" style="width: 100%;height:30px" />-->
                  <div :id="'progress'+row.RowNum" style="width: 100%;height:30px" />
                </template>
              </el-table-column>
            </el-table>
@@ -213,7 +213,7 @@
        <div style="width: 380px;height: 969px;" class="flex_c_b">
          <div>
            <div class="smallTitle">
              <svg-icon icon-class="eqp_name" class="svg_class" />
              <svg-icon icon-class="cxmc" class="svg_class" />
              装配三线
            </div>
            <div class="lineContent horn">
@@ -227,7 +227,7 @@
                height="428"
              >
                <el-table-column
                  prop="xsdd"
                  prop="saleOrderCode"
                  label="销售单号"
                  width="165"
                />
@@ -238,7 +238,7 @@
                  label="产品名称"
                />
                <el-table-column
                  prop="sl"
                  prop="good_qty"
                  label="数量"
                  width="80"
                />
@@ -247,7 +247,7 @@
          </div>
          <div>
            <div class="smallTitle">
              <svg-icon icon-class="eqp_name" class="svg_class" />
              <svg-icon icon-class="cxmc" class="svg_class" />
              装配四线
            </div>
            <div class="lineContent horn">
@@ -261,7 +261,7 @@
                height="428"
              >
                <el-table-column
                  prop="xsdd"
                  prop="saleOrderCode"
                  label="销售单号"
                  width="165"
                />
@@ -272,7 +272,7 @@
                  label="产品名称"
                />
                <el-table-column
                  prop="sl"
                  prop="good_qty"
                  label="数量"
                  width="80"
                />
@@ -289,7 +289,8 @@
<script>
import './kbCommon.css'
import { kbTop, loadEcharts, progress } from '@/utils/myEcharts'
import { WkshpContentData } from '@/api/dzkb'
import { WkshpContentData, WkshpLineData } from '@/api/dzkb'
import clearAllChildren from '@/utils/global'
export default {
  name: 'Cjsc',
@@ -303,32 +304,7 @@
      tableDataRightTop: [],
      tableDataRightTopTemp: [],
      tableDataRightBottom: [],
      tableDataRightBottomTemp: [
        { xsdd: 'MO-2022111501', partname: '产品名称1', sl: '100' },
        { xsdd: 'MO-2022111502', partname: '产品名称2', sl: '100' },
        { xsdd: 'MO-2022111503', partname: '产品名称3', sl: '100' },
        { xsdd: 'MO-2022111504', partname: '产品名称4', sl: '100' },
        { xsdd: 'MO-2022111505', partname: '产品名称5', sl: '100' },
        { xsdd: 'MO-2022111506', partname: '产品名称6', sl: '100' },
        { xsdd: 'MO-2022111507', partname: '产品名称7', sl: '100' },
        { xsdd: 'MO-2022111508', partname: '产品名称8', sl: '100' },
        { xsdd: 'MO-2022111509', partname: '产品名称9', sl: '100' },
        { xsdd: 'MO-2022111510', partname: '产品名称10', sl: '100' },
        { xsdd: 'MO-2022111511', partname: '产品名称11', sl: '100' },
        { xsdd: 'MO-2022111512', partname: '产品名称12', sl: '100' },
        { xsdd: 'MO-2022111513', partname: '产品名称13', sl: '100' },
        { xsdd: 'MO-2022111514', partname: '产品名称14', sl: '100' },
        { xsdd: 'MO-2022111515', partname: '产品名称15', sl: '100' },
        { xsdd: 'MO-2022111516', partname: '产品名称16', sl: '100' },
        { xsdd: 'MO-2022111517', partname: '产品名称17', sl: '100' },
        { xsdd: 'MO-2022111518', partname: '产品名称18', sl: '100' },
        { xsdd: 'MO-2022111519', partname: '产品名称19', sl: '100' },
        { xsdd: 'MO-2022111520', partname: '产品名称20', sl: '100' },
        { xsdd: 'MO-2022111521', partname: '产品名称21', sl: '100' },
        { xsdd: 'MO-2022111522', partname: '产品名称22', sl: '100' },
        { xsdd: 'MO-2022111523', partname: '产品名称23', sl: '100' },
        { xsdd: 'MO-2022111524', partname: '产品名称24', sl: '100' }
      ],
      tableDataRightBottomTemp: [],
      tableDataCenterTop: [],
      tableDataCenterTopTemp: []
@@ -361,7 +337,6 @@
      WkshpContentData().then(res => {
        this.tableDataCenterTopTemp = res.data
        this.tableDataCenterTop = this.tableDataCenterTopTemp.slice(startValue, startValue + scale)
        const loop = Math.floor(this.tableDataCenterTopTemp.length / scale)// 需要循环的次数
@@ -377,14 +352,14 @@
          nowLoop++
          this.$nextTick(() => {
            this.tableDataCenterTop.forEach(i => {
              loadEcharts('progress' + i.xh, progress(i.good_qty, i.scjd2))
              loadEcharts('progress' + i.RowNum, progress(i.good_qty, i.plan_qty))
            })
          })
        }, 1000 * 10)
        this.$nextTick(() => {
          this.tableDataCenterTop.forEach(i => {
            loadEcharts('progress' + i.xh, progress(i.good_qty, i.scjd2))
            loadEcharts('progress' + i.RowNum, progress(i.good_qty, i.plan_qty))
          })
        })
      })
@@ -395,76 +370,90 @@
      let startValue = 0 // 初始值
      const scale = 10// 刻度
      this.tableDataLeftTop = this.tableDataLeftTopTemp.slice(startValue, startValue + scale)
      const loop = Math.floor(this.tableDataLeftTopTemp.length / scale)// 需要循环的次数
      let nowLoop = 0// 当前循环的次数
      setInterval(() => {
        startValue = startValue + scale
      WkshpLineData({ LineCode: '001' }).then(res => {
        this.tableDataLeftTopTemp = res.data
        this.tableDataLeftTop = this.tableDataLeftTopTemp.slice(startValue, startValue + scale)
        if (nowLoop === loop) {
          this.getLeftTopTableDataSetInterval()
        }
        nowLoop++
      }, 1000 * 5)
        const loop = Math.floor(this.tableDataLeftTopTemp.length / scale)// 需要循环的次数
        let nowLoop = 0// 当前循环的次数
        const timer = setInterval(() => {
          startValue = startValue + scale
          this.tableDataLeftTop = this.tableDataLeftTopTemp.slice(startValue, startValue + scale)
          if (nowLoop === loop) {
            clearInterval(timer)
            this.getLeftTopTableDataSetInterval()
          }
          nowLoop++
        }, 1000 * 10)
      })
    },
    // 获取左下数据并定时刷新
    getLeftBottomTableDataSetInterval() {
      let startValue = 0 // 初始值
      const scale = 10// 刻度
      this.tableDataLeftBottom = this.tableDataLeftBottomTemp.slice(startValue, startValue + scale)
      const loop = Math.floor(this.tableDataLeftBottomTemp.length / scale)// 需要循环的次数
      let nowLoop = 0// 当前循环的次数
      setInterval(() => {
        startValue = startValue + scale
      WkshpLineData({ LineCode: '002' }).then(res => {
        this.tableDataLeftBottomTemp = res.data
        this.tableDataLeftBottom = this.tableDataLeftBottomTemp.slice(startValue, startValue + scale)
        if (nowLoop === loop) {
          this.getLeftBottomTableDataSetInterval()
        }
        nowLoop++
      }, 1000 * 5)
        const loop = Math.floor(this.tableDataLeftBottomTemp.length / scale)// 需要循环的次数
        let nowLoop = 0// 当前循环的次数
        const timer = setInterval(() => {
          startValue = startValue + scale
          this.tableDataLeftBottom = this.tableDataLeftBottomTemp.slice(startValue, startValue + scale)
          if (nowLoop === loop) {
            clearInterval(timer)
            this.getLeftBottomTableDataSetInterval()
          }
          nowLoop++
        }, 1000 * 10)
      })
    },
    // 获取右上数据并定时刷新
    getRightTopTableDataSetInterval() {
      let startValue = 0 // 初始值
      const scale = 10// 刻度
      this.tableDataRightTop = this.tableDataRightTopTemp.slice(startValue, startValue + scale)
      const loop = Math.floor(this.tableDataRightTopTemp.length / scale)// 需要循环的次数
      let nowLoop = 0// 当前循环的次数
      setInterval(() => {
        startValue = startValue + scale
      WkshpLineData({ LineCode: '003' }).then(res => {
        this.tableDataRightTop = this.tableDataRightTopTemp.slice(startValue, startValue + scale)
        if (nowLoop === loop) {
          this.getRightTopTableDataSetInterval()
        }
        nowLoop++
      }, 1000 * 5)
        const loop = Math.floor(this.tableDataRightTopTemp.length / scale)// 需要循环的次数
        let nowLoop = 0// 当前循环的次数
        const timer = setInterval(() => {
          startValue = startValue + scale
          this.tableDataRightTop = this.tableDataRightTopTemp.slice(startValue, startValue + scale)
          if (nowLoop === loop) {
            clearInterval(timer)
            this.getRightTopTableDataSetInterval()
          }
          nowLoop++
        }, 1000 * 10)
      })
    },
    // 获取右下数据并定时刷新
    getRightBottomTableDataSetInterval() {
      let startValue = 0 // 初始值
      const scale = 10// 刻度
      this.tableDataRightBottom = this.tableDataRightBottomTemp.slice(startValue, startValue + scale)
      const loop = Math.floor(this.tableDataRightBottomTemp.length / scale)// 需要循环的次数
      let nowLoop = 0// 当前循环的次数
      setInterval(() => {
        startValue = startValue + scale
      WkshpLineData({ LineCode: '004' }).then(res => {
        this.tableDataRightBottom = this.tableDataRightBottomTemp.slice(startValue, startValue + scale)
        if (nowLoop === loop) {
          this.getRightBottomTableDataSetInterval()
        }
        nowLoop++
      }, 1000 * 5)
        const loop = Math.floor(this.tableDataRightBottomTemp.length / scale)// 需要循环的次数
        let nowLoop = 0// 当前循环的次数
        const timer = setInterval(() => {
          startValue = startValue + scale
          this.tableDataRightBottom = this.tableDataRightBottomTemp.slice(startValue, startValue + scale)
          if (nowLoop === loop) {
            clearInterval(timer)
            this.getRightBottomTableDataSetInterval()
          }
          nowLoop++
        }, 1000 * 10)
      })
    },
    // 获取topEcharts