loulijun2021
2023-05-06 605cf750cefa3a3dbd3069da5533ad7b89103753
src/views/kb/zhkbc.vue
@@ -2,9 +2,9 @@
  <div>
    <div class="kb_dashboard">
      <!--    星空背景-->
      <div ref="starsRef" class="stars">
        <div v-for="(item, index) in starsCount" :key="index" class="star"/>
      </div>
<!--      <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">
@@ -23,6 +23,23 @@
            <div class="smallTitle">
              <svg-icon icon-class="cxjg" class="svg_class"/>
              产线加工中任务
              <div style="display: flex;margin-left: 85px;">
                <div class="circle"   style="background-color: rgb(255 255 255)"></div>
                <div  style="margin-left: 10px" >未开始</div>
                <div class="circle"  style="margin-left: 10px;background-color: blue;"></div>
                <div  style="margin-left: 10px" >开工</div>
                <div class="circleYellow" style="margin-left: 10px"></div>
                <div  style="margin-left: 10px" >执行中</div>
                <div class="circle" style="margin-left: 10px"></div>
                <div  style="margin-left: 10px" >完工</div>
              </div>
            </div>
            <div class="lineContent horn">
              <div v-for="item in lineContent3" :key="item.workcode" class="kb_left_top_block">
@@ -132,7 +149,7 @@
                <el-table-column
                  prop="lm_date"
                  label="派发时间"
                  width="120"
                  width="140"
                >
                  <template slot-scope="{row}">
                    <div>{{ row.lm_date.substring(0, 10) }}</div>
@@ -141,7 +158,7 @@
                <el-table-column
                  prop="saleOrderCode"
                  label="销售订单号"
                  width="170"
                  width="190"
                >
                  <template slot-scope="{row}">
                    <div v-if="row.saleOrderCode">{{ row.saleOrderCode }}</div>
@@ -166,21 +183,21 @@
                <el-table-column
                  prop="plan_qty"
                  label="任务数量"
                  width="105"
                  width="125"
                />
                <el-table-column
                  prop="good_qty"
                  label="完工数量"
                  width="105"
                  width="125"
                />
                <el-table-column
                  prop="ng_qty"
                  label="不良数量"
                  width="105"
                />
<!--                <el-table-column-->
<!--                  prop="ng_qty"-->
<!--                  label="不良数量"-->
<!--                  width="105"-->
<!--                />-->
                <el-table-column
                  label="完成率"
                  width="105"
                  width="134"
                >
                  <template slot-scope="{row}">
                    <div>{{ parseFloat((row.good_qty * 100 / row.plan_qty).toFixed(2)) }}%</div>
@@ -317,7 +334,7 @@
    this.getTopBar()
    this.getShopSearch()
    this.setStarsRef()
    // this.setStarsRef()
  },
  methods: {
    setStarsRef() {
@@ -374,28 +391,55 @@
    // 获取右上数据 当日完工产品数量排行
    getRightRightData() {
      let startValue = 0 // 初始值
      const scale = 10// 刻度
      // let startValue = 0 // 初始值
      // const scale = 10// 刻度
      //
      // LineSearchTopRightData({ shopcode: this.ShopArr.join(',') }).then(res => {
      //   this.tableDataRightTopTemp = res.data
      //
      //   this.tableDataRightTop = this.tableDataRightTopTemp.slice(startValue, startValue + scale)
      //
      //   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.getRightRightData()
      //     }
      //
      //     nowLoop++
      //   }, 1000 * 10)
      // })
      LineSearchTopRightData({ shopcode: this.ShopArr.join(',') }).then(res => {
        this.tableDataRightTopTemp = res.data
        this.tableDataRightTop = res.data
        this.tableDataRightTop = this.tableDataRightTopTemp.slice(startValue, startValue + scale)
        const divData = this.$refs.tableDataRightTopRef.bodyWrapper
        // 拿到元素后,对元素进行定时增加距离顶部距离,实现滚动效果(此配置为每100毫秒移动1像素)
        const aaa = setInterval(() => {
          // 元素自增距离顶部1像素
          // divData.scrollTop += divData.scrollHeight / this.tableDataRank.length
          divData.scrollTop += 1
          // 判断元素是否滚动到底部(可视高度+距离顶部=整个高度)
          if (divData.clientHeight + divData.scrollTop === divData.scrollHeight) {
            // 重置table距离顶部距离
            divData.scrollTop = 0
            LineSearchTopRightData({ shopcode: this.ShopArr.join(',') }).then(res => {
              this.tableDataRightTop = res.data
        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.getRightRightData()
              if (this.tableDataRightTop.length > 10) {
                clearInterval(aaa)
                this.getRightRightData()
              }
            })
          }
          nowLoop++
        }, 1000 * 10)
        }, this.tableDataRightTop.length <= 10 ? 1000 * 15 : 100)
      })
    },
    // 产线加工任务  左下数据
    getLeftBottomData() {
@@ -444,7 +488,7 @@
              }
            })
          }
        }, this.tableDataLeftBottom.length <= 10 ? 1000 * 10 : 100)
        }, this.tableDataLeftBottom.length <= 10 ? 1000 * 15 : 100)
      })
    },
@@ -632,6 +676,17 @@
  overflow: hidden !important;
}
::v-deep .el-table th.gutter{
  display: none;
  width:0
}
.circle {
  width: 26px;
  height: 26px;
  background-color: #00ff8b;
  border-radius: 50%;
}
</style>
<!--星空-->