loulijun2021
2023-05-06 7bfa4e0bbad8d1cbff5b60605b4d46c71138a3f3
src/views/kb/zhkb.vue
@@ -24,7 +24,7 @@
              <svg-icon icon-class="cxjg" class="svg_class" />
              产线加工中任务
            </div>
            <div class="lineContent horn">
            <div class="lineContent horn" style="height: 434px;">
              <div v-for="item in lineContent3" :key="item.workcode" class="kb_left_top_block">
                <div class="kb_block02 kb_pd10">
                  <div>
@@ -132,7 +132,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 +141,7 @@
                <el-table-column
                  prop="saleOrderCode"
                  label="销售订单号"
                  width="170"
                  width="190"
                >
                  <template slot-scope="{row}">
                    <div v-if="row.saleOrderCode">{{ row.saleOrderCode }}</div>
@@ -151,7 +151,7 @@
                <el-table-column
                  prop="wo_code"
                  label="加工单号"
                  width="190"
                  width="194"
                />
                <el-table-column
                  prop="partname"
@@ -166,21 +166,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="130"
                >
                  <template slot-scope="{row}">
                    <div>{{ parseFloat((row.good_qty * 100 / row.plan_qty).toFixed(2)) }}%</div>
@@ -420,26 +420,51 @@
    },
    // 产线加工任务  左下数据
    getLeftBottomData() {
      let startValue = 0 // 初始值
      const scale = 10// 刻度
      // let startValue = 0 // 初始值
      // const scale = 10// 刻度
      //
      // LineSearchBottomLeftData({ shopcode: this.ShopArr.join(',') }).then(res => {
      //   this.tableDataLeftBottomTemp = res.data
      //   this.tableDataLeftBottom = this.tableDataLeftBottomTemp.slice(startValue, startValue + scale)
      //
      //   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.getLeftBottomData()
      //     }
      //
      //     nowLoop++
      //   }, 1000 * 10)
      // })
      LineSearchBottomLeftData({ shopcode: this.ShopArr.join(',') }).then(res => {
        this.tableDataLeftBottomTemp = res.data
        this.tableDataLeftBottom = this.tableDataLeftBottomTemp.slice(startValue, startValue + scale)
        this.tableDataLeftBottom = res.data
        const loop = Math.floor(this.tableDataLeftBottomTemp.length / scale)// 需要循环的次数
        let nowLoop = 0// 当前循环的次数
        const divData = this.$refs.tableDataLeftBottomRef.bodyWrapper
        // 拿到元素后,对元素进行定时增加距离顶部距离,实现滚动效果(此配置为每100毫秒移动1像素)
        const aaa = setInterval(() => {
          // 元素自增距离顶部1像素
          divData.scrollTop += 1
          // divData.scrollTop += divData.scrollHeight / this.tableData.length
          // 判断元素是否滚动到底部(可视高度+距离顶部=整个高度)
          if (divData.clientHeight + divData.scrollTop === divData.scrollHeight) {
            // 重置table距离顶部距离
            divData.scrollTop = 0
            LineSearchBottomLeftData({ shopcode: this.ShopArr.join(',') }).then(res => {
              this.tableDataLeftBottom = res.data
        const timer = setInterval(() => {
          startValue = startValue + scale
          this.tableDataLeftBottom = this.tableDataLeftBottomTemp.slice(startValue, startValue + scale)
          if (nowLoop === loop) {
            clearInterval(timer)
            this.getLeftBottomData()
              if (this.tableDataLeftBottom.length > 10) {
                clearInterval(aaa)
                this.getLeftBottomData()
              }
            })
          }
          nowLoop++
        }, 1000 * 10)
        }, this.tableDataLeftBottom.length <= 10 ? 1000 * 15 : 100)
      })
    },
@@ -622,6 +647,10 @@
  border-radius: 50%;
}
::v-deep .el-table__body-wrapper{
  overflow: hidden !important;
}
</style>
<!--星空-->