zhangjingyuan 3 лет назад
Родитель
Сommit
6ba327b3b8
1 измененных файлов с 301 добавлено и 0 удалено
  1. 301 0
      src/views/system/jbdHome/board/equipmentBoard.vue

+ 301 - 0
src/views/system/jbdHome/board/equipmentBoard.vue

@@ -0,0 +1,301 @@
+<template>
+  <div :class="$style.content">
+    <dv-full-screen-container>
+      <!-- 头部内容 -->
+      <div :class="$style.header">
+        <div :class="$style.title">{{ titleName }}</div>
+        <dv-decoration-8 :class="$style.left" />
+        <dv-decoration-5 :class="$style.center" />
+        <dv-decoration-8 :class="$style.right" :reverse="true" />
+
+        <div :class="$style.time">
+          <span>月份:</span>
+          <el-date-picker v-model="month" type="month" value-format="yyyy-MM" format="yyyy-MM" placeholder="日期选择" style="width: 120px" :readonly="false" :editable="true" :clearable="false" @change="updateAll" />
+        </div>
+        <div :class="$style.back" @click.prevent="goBack()">
+          <dv-border-box-8>返回</dv-border-box-8>
+        </div>
+      </div>
+      <dv-border-box-4>
+        <!-- topBar -->
+        <!-- <top-bar v-if="topBarData.length" :info="topBarData" /> -->
+        <!-- middleCard -->
+        <!-- <middle-card v-if="middleCardData.flag" :info="middleCardData" /> -->
+        <!-- bottomCard -->
+        <!-- <bottom-card v-if="bottomCardData.flag" :info="bottomCardData" /> -->
+      </dv-border-box-4>
+    </dv-full-screen-container>
+  </div>
+</template>
+<script>
+import screenfull from "screenfull";
+import repostCurd from "@/business/platform/form/utils/custom/joinCURD.js";
+export default {
+  name: "checkBoard",
+  components: {
+    topBar: () => import("./component/topBar"),
+    middleCard: () => import("./component/middleCard"),
+    bottomCard: () => import("./component/bottomCard"),
+  },
+  data() {
+    const d = new Date();
+    return {
+      titleName: "设备管理信息查询",
+      year: d.toJSON().slice(0, 4),
+      month: d.toJSON().slice(0, 7),
+      today: d.toJSON().slice(0, 10),
+      label: ["设备信息一览",],
+      topBarData: [],
+      middleCardData: {
+        tableData: {
+          header: ["检测项目", "检测类型", "计划完成时间", "当前状态", "人员"],
+          data: [],
+          rowNum: 7,
+          columnWidth: ["300", "100", "150", "150", "100"],
+        },
+        acceptData: [],
+        taskData: [],
+        flag: false,
+      },
+      bottomCardData: {
+        flag: false,
+      },
+      timer: null,
+    };
+  },
+  mounted() {
+    if (screenfull.isEnabled && !screenfull.isFullscreen) {
+      this.allView();
+    }
+
+    this.updateAll();
+
+    if (this.timer) {
+      clearInterval(this.timer);
+    }
+
+    this.timer = setInterval(() => {
+      this.updateAll();
+    }, 600000);
+  },
+  beforeDestroy() {
+    if (screenfull.isFullscreen) {
+      screenfull.toggle();
+    }
+    clearInterval(this.timer);
+  },
+  methods: {
+    allView() {
+      // 默认显示全屏
+      screenfull.request();
+    },
+    goBack() {
+      this.$router.back(-1);
+    },
+    updateAll(e) {
+      this.getTopBarData();
+      this.getMiddleData();
+      this.getBottomData();
+    },
+    // 获取topBar数据
+    async getTopBarData() {
+      // let quarter = this.getDateRange("quarter");
+      // let week = this.getDateRange("week");
+      let this_ = this;
+      // let sql1 = `select a.Equipments as a1,b.addEquipments as b1,c.testEquipments as c1,d.checkEquipments as d1,e.goodEquipments as e1,f.scrapEquipments as f1,g.limitedEquipments as g1 
+      //              from 
+      //              (select count(id_) as Equipments from t_sbdj) as a,
+      //              (select count(id_) as addEquipments  from t_sbdj WHERE gou_jin_ri_qi_ like '%2022-12%') as b,
+      //              (select count(id_) as testEquipments from t_sbjdxzqr) as c,
+      //              (select count(id_) as checkEquipments from t_sbhcjlb WHERE create_time_ like '%2022-12%') as d,
+      //              (select count(id_) as goodEquipments  from t_sbdj WHERE she_bei_zhuang_ta ="正常") as e,
+      //              (select count(id_) as scrapEquipments  from t_sbdj WHERE she_bei_zhuang_ta ="停用" or she_bei_zhuang_ta ="报废/停用") as f,
+      //              (select count(id_) as limitedEquipments  from t_sbdj WHERE she_bei_zhuang_ta ="限制使用" ) as g`;
+                   let sql1 = `select *  FROM t_sbjdxzqr`
+        await repostCurd("sql", sql1).then((res) => {
+          // const data = res.variables.data;
+          console.log(res.variables.data)
+          // if (data && data.length) {
+          //   const {
+          //     Equipments,
+          //     mogoodEquipmentsnth,
+          //     addEquipments,
+          //     testEquipments,
+          //     checkEquipments,
+          //     limitedEquipments,
+          //     scrapEquipments,
+          //   } = data[0];
+          //   // this.middleCardData.taskData = [month, jcTotal, task, report];
+          //   let result = [
+          //     {
+          //       title: "设备状况一览",
+          //       children: [
+          //         {
+          //           label: "设备总数",
+          //           value: Equipments,
+          //         },
+          //         {
+          //           label: "设备良好总数",
+          //           value: mogoodEquipmentsnth,
+          //         },
+          //         {
+          //           label: "本月新增设备数量",
+          //           value: addEquipments,
+          //         },
+          //         {
+          //           label: "本月检定/校准设备总数",
+          //           value: testEquipments,
+          //         },
+          //         {
+          //           label: "本月期间核查设备总数",
+          //           value: checkEquipments,
+          //         },
+          //         {
+          //           label: "受限设备数量",
+          //           value: limitedEquipments,
+          //         },
+          //         {
+          //           label: "本月报废设备数量",
+          //           value: scrapEquipments,
+          //         },
+          //       ],
+          //     },
+          //   ];
+
+          //   this_.topBarData = result;
+          // }
+        })
+        .catch((error) => {
+          console.log(error,sql1);
+        });
+    },
+    // 获取中间图表数据
+    getMiddleData() {
+      // 获取检测数据
+      // const sql1 = `select tm.jian_ce_xiang_mu_, tm.jian_ce_lei_bie_, IFNULL(rw.qi_wang_wan_cheng, '') as qi_wang_wan_cheng, rw.zhuang_tai_, ipe.NAME_ from t_rwfpb rw, ibps_party_employee ipe, t_mjjcnlfw tm where rw.jian_ce_yuan_ = ipe.ID_ and rw.jian_ce_xiang_mu_ = tm.id_ and rw.create_time_ like '${this.month}%'`
+      const sql1 = `select tm.jian_ce_xiang_mu_, tm.jian_ce_lei_bie_, IFNULL(rwz.create_time_, '') as qi_wang_wan_cheng, rw.zhuang_tai_, ipe.NAME_ from t_lhrwfpb rw, ibps_party_employee ipe, t_mjjcnlfw tm, t_mjrwfpzb rwz where rwz.jian_ce_yuan_ = ipe.ID_ and rwz.jian_ce_xiang_mu_ = tm.id_ and rw.id_ = rwz.wai_jian_ and rw.create_time_ like '${this.month}%'`;
+      // 获取检测受理类型数据
+      const sql2 = `select count(tm.jian_ce_lei_bie_ = '理化' or null) as lh, count(tm.jian_ce_lei_bie_ = '微生物' or null) as wsw, count(tm.jian_ce_lei_bie_ = '细胞活率' or null) as xbhl, count(tm.jian_ce_lei_bie_ = '残留检测' or null) as cljc, count(tm.jian_ce_lei_bie_ = '细胞鉴别' or null) as xbjb from t_lhjczb tj, t_mjjcnlfw tm where tj.jian_ce_xiang_mu_ = tm.id_ and tj.create_time_ like '${this.month}%'`;
+
+      // Promise.all([repostCurd("sql", sql1), repostCurd("sql", sql2)])
+      //   .then(([res1, res2]) => {
+      //     const data1 = res1.variables.data;
+      //     const data2 = res2.variables.data;
+      //     // console.log(data1, data2)
+
+      //     this.middleCardData.tableData.data = [];
+      //     data1.forEach((item) => {
+      //       this.middleCardData.tableData.data.push(Object.values(item));
+      //     });
+
+      //     this.middleCardData.acceptData = Object.values(data2[0]);
+      //     this.middleCardData.flag = true;
+      //   })
+      //   .catch((error) => {
+      //     console.log(error);
+      //   });
+    },
+    // 获取底部图表数据
+    getBottomData() {
+      console.log(1)
+    },
+    // 获取本周和本季度的开始和结束日期,以对象形式返回
+    getDateRange(type) {
+      console.log(2)
+    }
+  },
+};
+</script>
+<style lang="scss" module>
+.content {
+  width: 100%;
+  height: 100%;
+  background-color: #030409;
+  position: absolute;
+  color: #fff;
+  z-index: 999;
+  :global {
+    #dv-full-screen-container {
+      background-image: url("./img/bg.png");
+      background-size: 100% 100%;
+      box-shadow: 0 0 3px blue;
+      display: flex;
+      flex-direction: column;
+    }
+    .main-content {
+      flex: 1;
+      display: flex;
+      flex-direction: column;
+    }
+
+    .block-left-right-content {
+      flex: 1;
+      display: flex;
+      margin-top: 0.8%;
+    }
+
+    .block-top-bottom-content {
+      flex: 1;
+      display: flex;
+      flex-direction: column;
+      box-sizing: border-box;
+      padding-left: 0.8%;
+    }
+
+    .block-top-content {
+      height: 55%;
+      display: flex;
+      flex-grow: 0;
+      box-sizing: border-box;
+      padding-bottom: 0.8%;
+    }
+  }
+  .header {
+    position: relative;
+    width: 100%;
+    height: 100px;
+    display: flex;
+    justify-content: space-between;
+    flex-shrink: 0;
+    .left,
+    .right {
+      width: 25%;
+      height: 60px;
+    }
+    .center {
+      width: 40%;
+      height: 60px;
+      margin-top: 30px;
+    }
+    .title {
+      position: absolute;
+      font-size: 30px;
+      font-weight: bold;
+      left: 50%;
+      top: 15px;
+      transform: translateX(-50%);
+    }
+    .time,
+    .back {
+      width: 8%;
+      cursor: pointer;
+      height: 2.825rem;
+      line-height: 2.825rem;
+      text-align: center;
+      margin-top: 2.5%;
+      flex: 1;
+      position: absolute;
+      color: #ffffff;
+    }
+    .time {
+      display: flex;
+      justify-content: flex-end;
+      width: 20%;
+      right: 75%;
+    }
+    .back {
+      left: 75%;
+    }
+  }
+}
+</style>