小小儁爺
2026-05-15 df418a35e80167ae120e5840d6ff8d19676ee399
src/views/kanbanManager/jghjcj.vue
@@ -9,7 +9,7 @@
          <span>浙江阿鲁克健身器材有限公司</span>
        </div>
        <div class="kb_headTime kb_header_text" style="top: 35px;left:  772px">
        <div class="kb_headTime kb_header_text" style="top: 35px;left:  768px">
          <span>金工焊接车间数字化看板</span>
        </div>
@@ -17,55 +17,134 @@
          <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 style="width: 925px;">
            <div class="smallTitle">
              <svg-icon icon-class="blcs" 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 style="height: 380px;">
              <dv-border-box-12>
                <div id="cjzl03" class="flex_c_c" style="width: 100%;height:100%" />
              </dv-border-box-12>
                <div v-for="i in LeftTopData01" :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_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_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: 260px;">
                <div id="all02_1" class="flex_c_c" style="width: 100%;height:100%;" />
              </div>
            </div>
          </div>
          <div style="width: 850px;">
          <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">
                <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>
                    <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 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>
                  </div>
                </div>
              </div>
              <div style="height: 260px;">
                <div id="all02" class="flex_c_c" style="width: 100%;height:100%;" />
              </div>
            </div>
          </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" />
              生产完工(当月)
            </div>
            <div
              class="lineContent horn"
              style="height: 380px;display: flex;flex-direction: column;justify-content: space-between"
            >
              <div
                style="padding: 10px;
                display: flex;justify-content: flex-start;
                flex-wrap: wrap;"
              >
                <div v-for="i in LeftBottomData01" :key="i.wkshp_code" style="margin:0 18px" class="flex_c_s">
                  <div class="all_block01 flex_c_s">
                    <div class="flex_c_c all_block02" style="">{{ i.wkshp_name }}</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>
                    <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>
                  </div>
                </div>
              </div>
              <!--              <div style="height: 260px;">-->
              <!--                <div id="all01" class="flex_c_c" style="width: 100%;height:100%;" />-->
              <!--              </div>-->
            </div>
          </div>
          <div style="width: 925px;">
            <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 class="lineContent horn" style="height: 380px;display: flex;justify-content: space-between">
              <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 class="box02" />
                  <div>原材料</div>
                </div>
                <!--                <div class="kb_center_block_children all_block06">-->
                <!--                  <div style="font-size: 24px;">{{ parseFloat(RightBottom.B) }}</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 class="box02" />
                  <div>产成品</div>
                </div>
              </div>
            </div>
          </div>
        </div>
@@ -76,11 +155,9 @@
<script>
import './kbCommon.css'
import { loadEcharts, cjzl04, cjzl03_2, cjzl03 } from '@/utils/myEcharts'
import { loadEcharts, all02, all03 } from '@/utils/myEcharts'
import {
  WorkShopProduceBottomLeftData,
  WorkShopProduceBottomRightData,
  WorkShopProduceTopData
  WorkShopCompreLeftBottom, WorkShopCompreLeftTop, WorkShopCompreRightBottom, WorkShopCompreRightTop
} from '@/api/kanbanManager'
export default {
@@ -88,152 +165,164 @@
  data() {
    return {
      headTime: '',
      tableDataRightTop: [],
      cjzl03_xData: [],
      cjzl03_yData: [],
      RightBottom: [],
      LeftTopData01: [],
      LeftTopData02: [],
      configTableTop: {
        headerBGC: 'rgba(38, 68 ,139, 0.2)', // 表头背景色
        oddRowBGC: 'transparent', // 奇数行背景色
        evenRowBGC: 'transparent', // 偶数行背景色
        headerHeight: 45,
        waitTime: 3000,
        rowNum: 8,
      RightTopData01: [],
      RightTopData02: [],
        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>',
      LeftBottomData01: [],
      LeftBottomData02: [],
          '<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'],
        ],
        // 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'
      }
      RightBottom: {}
    }
  },
  created() {
    setInterval(this.getNowTime, 1000)
    // 两小时看板刷新一次
    // // 两小时看板刷新一次
    setInterval(() => {
      window.location.reload()
    }, 1000 * 60 * 120)
  },
  async mounted() {
    await this.getWorkShopProduceTopData()
    setInterval(() => {
      this.getWorkShopProduceTopData()
    }, 10 * 1000)
    await this.getWorkShopProduceBottomLeftData()
    setInterval(() => {
      this.getWorkShopProduceBottomLeftData()
    }, 20 * 1000)
    await this.getWorkShopProduceBottomRightData()
    setInterval(() => {
      this.getWorkShopProduceBottomRightData()
    }, 30 * 1000)
  mounted() {
    this.getAllApi()
  },
  methods: {
    async getWorkShopProduceTopData() {
      WorkShopProduceTopData({ wkshopcode: '02,03' }).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 getAllApi() {
      // 左上 采购订单
      const res2 = await WorkShopCompreLeftBottom()
      res2.data.BottomLeftTop.forEach(i => {
        this.LeftTopData01.push({
          Quarter: i.Quarter,
          quantity: i.quantity,
          ouquantity: i.ouquantity
        })
      })
    },
    async getWorkShopProduceBottomLeftData() {
      const temp = [
        // { code: '101', name: '发泡车间' },
        // { code: '102', name: '挤出车间' },
        // { code: '103', name: '包装车间' },
        // { code: '001', name: '测试车间' }
      res2.data.BottomLeftBottom.forEach(i => {
        this.LeftTopData02.push({
          Month: i.Month + '月',
          quantity: i.quantity,
          ouquantity: i.ouquantity
        })
      })
      loadEcharts('all02_1', all02(this.LeftTopData02, '每月采购数量/入库数量'))
      setInterval(() => {
        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)
        // { code: '01', name: '金工车间' },
        // { code: '02', name: '铝修' },
        // { code: '03', name: '台钻' },
        // { code: '04', name: '喷漆' },
        // { code: '05', name: '组装成品' }
      // 右上 销售订单
      const res3 = await WorkShopCompreRightTop()
      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, '每月订单数量/出库数量'))
      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)
        { code: '02', name: '金工车间' },
        { code: '03', name: '焊接车间' }
      const temp2 = [
        { wkshp_code: '02', wkshp_name: '金工车间' },
        { wkshp_code: '03', wkshp_name: '焊接车间' }
      ]
      const res4 = await WorkShopProduceBottomLeftData({ wkshopcode: temp.map(i => i.code).join(',') })
      // this.cjzl03_xData = res4.data['101,001'].map(i => i.click_date)
      // this.cjzl03_yData = res4.data['101,001'].map(i => i.count)
      const a = res4.data['004'].map(i => i.click_date) // echarts横坐标
      const b = temp.map(i => i.name)// legendData值
      const c = [
        // res4.data['01'].map(i => i.count),
        // res4.data['02'].map(i => i.count),
        // res4.data['03'].map(i => i.count),
        // res4.data['04'].map(i => i.count),
        // res4.data['05'].map(i => i.count)
        res4.data['004'].map(i => i.count)
      ]// 纵坐标值
      loadEcharts('cjzl03', cjzl03(a, b, c))
    },
    async getWorkShopProduceBottomRightData() {
      const temp = [
        // { code: '101', name: '发泡车间' },
        // { code: '102', name: '挤出车间' },
        // { code: '103', name: '包装车间' },
        // { code: '001', name: '测试车间' }
        // { code: '01', name: '金工车间' },
        // { code: '02', name: '铝修' },
        // { code: '03', name: '台钻' },
        // { code: '04', name: '喷漆' },
        // { code: '05', name: '组装成品' }
        { code: '02', name: '金工车间' },
        { code: '03', name: '焊接车间' }
      ]
      const res5 = await WorkShopProduceBottomRightData({ wkshopcode: temp.map(i => i.code).join(',') })
      this.RightBottom = res5.data
      if (this.RightBottom.length > 0) {
        loadEcharts('cjzl04', cjzl04(this.RightBottom.map(i => i.name), this.RightBottom.map(i => i.cont)))
      // 左下 生产订单
      const res4 = await WorkShopCompreLeftTop({ wkshopcode: temp2.map(i => i.wkshp_code).join(',') })
      for (const res4Key in res4.data.LeftTop) {
        const data = {
          good_qty: 0,
          plan_qty: 0,
          wkshp_code: '',
          wkshp_name: ''
        }
        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 = temp2.find(i => i.wkshp_code === data.wkshp_code).wkshp_name
        this.LeftBottomData01.push(data)
      }
    },
      setInterval(() => {
        WorkShopCompreLeftTop({ wkshopcode: temp2.map(i => i.wkshp_code).join(',') }).then(res2 => {
          this.LeftBottomData01 = []
          this.LeftBottomData02 = []
          for (const res4Key in res4.data.LeftTop) {
            const data = {
              good_qty: 0,
              plan_qty: 0,
              wkshp_code: '',
              wkshp_name: ''
            }
            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 = temp2.find(i => i.wkshp_code === data.wkshp_code).wkshp_name
            this.LeftBottomData01.push(data)
          }
        })
      }, 1000 * 30)
      // 右下 仓库库存
      const res5 = await WorkShopCompreRightBottom()
      this.RightBottom = res5.data
      setInterval(() => {
        WorkShopCompreRightBottom().then(res5 => {
          this.RightBottom = res5.data
        })
      }, 1000 * 60)
    },
    // 获取当前时间
    getNowTime() {
      const dt = new Date()
@@ -250,23 +339,25 @@
      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
    headerCellStyle() {
      return {
        backgroundColor: 'transparent ',
        padding: '10px 0',
        textAlign: 'center',
        color: '#07acc2',
        border: 'none',
        fontSize: '20px'
      }
      for (const value of set1) {
        if (!set2.has(value)) {
          return false
        }
    },
    cellStyle() {
      return {
        padding: '7px 0',
        textAlign: 'center',
        backgroundColor: 'transparent ',
        color: '#c7e7ff',
        border: 'none',
        fontSize: '20px'
      }
      return true
    }
  }
@@ -275,13 +366,120 @@
</script>
<style lang="scss" scoped>
::v-deep .header-item {
  font-size: 16px !important;
$main_color: #09d8f2;
$color01: #00FFFF;
.tableData {
  background: transparent;
}
::v-deep .row-item {
  font-size: 16px !important;
.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 th,
::v-deep .el-table tr,
::v-deep .el-table td {
  background-color: transparent;
}
.all_block01 {
  width: 187px;
  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: 170px;
}
//.all_block06 {
//  position: absolute;
//  animation: upDown2 3s ease-in-out infinite;
//  left: 320px;
//}
.all_block07 {
  position: absolute;
  animation: upDown2 3s ease-in-out infinite;
  left: 470px;
}
@keyframes upDown {
  0% {
    top: 50px;
  }
  50% {
    top: 100px;
  }
  100% {
    top: 50px;
  }
}
@keyframes upDown2 {
  0% {
    top: 100px;
  }
  50% {
    top: 50px;
  }
  100% {
    top: 100px;
  }
}
</style>