loulijun2021
2023-05-11 12ef895481038a7bec06a2c6cb47748a6353e848
src/views/kb/zhkbc.vue
@@ -3,7 +3,7 @@
    <div class="kb_dashboard">
      <div class="kb_header">
        <div class="flex_c_c kb_header_text">
          下料车间看板
          {{ ShopArr[0] == 21 ? '下料金工看板' : ShopArr[0] == 22 ? '金工车间看板' : ShopArr[0] == 23 ? '抛光车间看板' : '装配车间看板' }}
        </div>
        <div class="kb_headerPic" />
        <div class="kb_headTime">
@@ -24,6 +24,21 @@
            <!--            <svg-icon icon-class="sccx" />-->
            产线加工中任务
            <div style="margin-left: 30px">{{ number1 }} 单</div>
            <div style="display: flex;margin-left: 25px;">
              <div class="circle" style="background-color: rgb(255 255 255)" />
              <div style="margin-left: 10px">未开始</div>
              <!--              <div class="circle" style="margin-left: 10px;background-color: blue;" />-->
              <!--              <div style="margin-left: 10px">开工</div>-->
              <div class="circleYellow" style="margin-left: 10px" />
              <div style="margin-left: 10px">执行中</div>
              <div class="circle" style="margin-left: 10px" />
              <div style="margin-left: 10px">完工</div>
            </div>
          </div>
          <div class="kb_left_top kb_pd10">
@@ -76,13 +91,13 @@
                      class="kb_block03_02_content flex_c_c"
                    >
                      <div class="flex_c_c content01">
                        <!--                        <div-->
                        <!--                          v-if="it.status==='START'&&(parseFloat(it.ngqty)===0||it.ngqty==='')&&(parseFloat(it.goodqty)===0||it.goodqty==='')"-->
                        <!--                          class="circle"-->
                        <!--                          style="background-color: blue;"-->
                        <!--                        />-->
                        <div
                          v-if="it.status==='START'&&(parseFloat(it.ngqty)===0||it.ngqty==='')&&(parseFloat(it.goodqty)===0||it.goodqty==='')"
                          class="circle"
                          style="background-color: blue;"
                        />
                        <div
                          v-else-if="it.status==='ALLO'&&(parseFloat(it.ngqty)===0||it.ngqty==='')&&(parseFloat(it.goodqty)===0||it.goodqty==='')"
                          v-if="it.status==='ALLO'&&(parseFloat(it.ngqty)===0||it.ngqty==='')&&(parseFloat(it.goodqty)===0||it.goodqty==='')"
                          class="circle"
                          style="background-color: rgb(255 255 255)"
                        />
@@ -163,7 +178,7 @@
                  <el-table-column
                    prop="partname"
                    label="产品名称"
                    width="150"
                    width="295"
                  >
                    <template slot-scope="{row}">
                      <div v-if="row.partname" class="ellipsis">{{ row.partname }}</div>
@@ -195,20 +210,20 @@
                    label="完工数量"
                    width="85"
                  />
                  <el-table-column
                    prop="ng_qty"
                    label="不良数量"
                    width="85"
                  />
                  <el-table-column
                    prop="wcl"
                    label="完成率"
                    width="60"
                  >
                    <template slot-scope="{row}">
                      <div>{{ parseFloat((row.good_qty * 100 / row.plan_qty).toFixed(2)) }}%</div>
                    </template>
                  </el-table-column>
                  <!--                  <el-table-column-->
                  <!--                    prop="ng_qty"-->
                  <!--                    label="不良数量"-->
                  <!--                    width="85"-->
                  <!--                  />-->
                  <!--                  <el-table-column-->
                  <!--                    prop="wcl"-->
                  <!--                    label="完成率"-->
                  <!--                    width="60"-->
                  <!--                  >-->
                  <!--                    <template slot-scope="{row}">-->
                  <!--                      <div>{{ parseFloat((row.good_qty * 100 / row.plan_qty).toFixed(2)) }}%</div>-->
                  <!--                    </template>-->
                  <!--                  </el-table-column>-->
                  <el-table-column
                    prop="planstartdate"
                    label="预计开始"
@@ -458,12 +473,55 @@
    getShopSearchLine() {
      let length, count
      LineSearchTopLeftData({ shopcode: this.ShopArr.join(',') }).then(res => {
        this.lineContent = res.data
        this.lineContent = res.data // 调用接口返回的数据
        this.number1 = this.lineContent.length // 产线加工中任务  单数
        const newData = []
        if (this.lineContent.length > 0) {
          this.lineContent.forEach(item => {
            if (item.children.length > 5) {
              newData.push({
                workcode: item.workcode,
                partname: item.partname,
                partnumber: item.partnumber,
                partspec: item.partspec,
                qty: item.qty,
                saleordercode: item.saleordercode,
                uom: item.uom,
                children: item.children.slice(0, 5)
              })
              newData.push({
                workcode: item.workcode,
                partname: item.partname,
                partnumber: item.partnumber,
                partspec: item.partspec,
                qty: item.qty,
                saleordercode: item.saleordercode,
                uom: item.uom,
                children: item.children.slice(5, 8)
              })
            } else {
              newData.push({
                workcode: item.workcode,
                partname: item.partname,
                partnumber: item.partnumber,
                partspec: item.partspec,
                qty: item.qty,
                saleordercode: item.saleordercode,
                uom: item.uom,
                children: item.children
              })
            }
          })
          console.log(newData.length, 9777)
        }
        this.lineContent = newData
        length = this.lineContent.length
        count = Math.ceil(length / 3) // 需要轮播的组数   3个为一组
        this.lineContent3 = this.lineContent.slice(0, 3)
        this.number1 = this.lineContent.length
      })
      let start = 0
@@ -471,17 +529,60 @@
        if (Math.floor(start / 3) === count && count !== 0) {
          start = 0
          LineSearchTopLeftData({ shopcode: this.ShopArr.join(',') }).then(res => {
            this.lineContent = res.data
            this.lineContent = res.data // 调用接口返回的数据
            this.number1 = this.lineContent.length // 产线加工中任务  单数
            const newData = []
            if (this.lineContent.length > 0) {
              this.lineContent.forEach(item => {
                if (item.children.length > 5) {
                  newData.push({
                    workcode: item.workcode,
                    partname: item.partname,
                    partnumber: item.partnumber,
                    partspec: item.partspec,
                    qty: item.qty,
                    saleordercode: item.saleordercode,
                    uom: item.uom,
                    children: item.children.slice(0, 5)
                  }
                  )
                  newData.push({
                    workcode: item.workcode,
                    partname: item.partname,
                    partnumber: item.partnumber,
                    partspec: item.partspec,
                    qty: item.qty,
                    saleordercode: item.saleordercode,
                    uom: item.uom,
                    children: item.children.slice(5, 8)
                  })
                } else {
                  newData.push({
                    workcode: item.workcode,
                    partname: item.partname,
                    partnumber: item.partnumber,
                    partspec: item.partspec,
                    qty: item.qty,
                    saleordercode: item.saleordercode,
                    uom: item.uom,
                    children: item.children
                  })
                }
              })
            }
            this.lineContent = newData
            length = this.lineContent.length
            count = Math.ceil(length / 3) // 需要轮播的组数   3个为一组
            this.lineContent3 = this.lineContent.slice(0, 3)
            this.number1 = this.lineContent.length
          })
        } else if (count === 0) {
          clearInterval(this.ShopSearchLineTask)
          this.getShopSearchLine()
        }
        this.lineContent3 = this.lineContent.slice(start, start + 3)
        start = start + 3
      }, 1000 * 3)
@@ -512,7 +613,7 @@
              }
            })
          }
        }, this.tableData.length <= 10 ? 1000 * 3 : 100)
        }, this.tableData.length <= 10 ? 1000 * 15 : 100)
      })
    },
    // 当日完工产品数量排行
@@ -533,13 +634,13 @@
            LineSearchTopRightData({ shopcode: this.ShopArr.join(',') }).then(res => {
              this.tableDataRank = res.data
              if (this.tableDataRank.length > 9) {
              if (this.tableDataRank.length > 10) {
                clearInterval(this.TableDataRankRollTask)
                this.getTableDataRankRoll()
              }
            })
          }
        }, this.tableDataRank.length <= 9 ? 1000 * 3 : 100)
        }, this.tableDataRank.length <= 10 ? 1000 * 3 : 100)
      })
    },
    // 获取echarts
@@ -840,4 +941,15 @@
  background-color: rgb(255 255 0);
  border-radius: 50%;
}
::v-deep .el-table__body-wrapper{
  overflow: hidden !important;
}
.circle {
  width: 26px;
  height: 26px;
  background-color: #00ff8b;
  border-radius: 50%;
}
</style>