luowei vor 1 Jahr
Ursprung
Commit
83e9938b34

+ 8 - 14
src/api/core/reportForms/resumptionReport.js

@@ -1,5 +1,5 @@
 import request from '@/utils/request'
-// import { defineComponent } from 'vue';
+
 
 
 export function listReport(query) {
@@ -17,16 +17,10 @@ export function listIntrusionTestReport(query) {
     params: query
   })
 }
-// export default defineComponent({
-//   data() {
-//     return{
-//       value: null,
-//       quarterOptions:{
-//       disabledDate:(time)=>{
-//         const currentQuarter=Math.floor((time.getMonth()+3)/3)
-//         return currentQuarter !==1&& currentQuarter !==2 && currentQuarter !==3&& currentQuarter !==4
-//       }
-//     }
-//     }
-//   }
-// })
+export function listStandbyPowerReport(query) {
+  return request({
+    url: '/core/resumptionReport/standbyPower',
+    method: 'get',
+    params: query
+  })
+}

+ 623 - 0
src/views/core/reportForms/Quarter.vue

@@ -0,0 +1,623 @@
+<!-- <template>
+    <div style="display: inline-block;">
+      <mark
+        style="position: fixed;top: 0;bottom: 0;left: 0;right: 0;background: rgba(0,0,0,0);z-index: 999;"
+        v-show="showSeason"
+        @click.stop="showSeason=false"
+      ></mark>
+      <el-input :placeholder="placeholder" v-model="showValue" v-bind="$attrs" @focus="clickInput" ref="inputText">
+        <i slot="prefix" class="el-input__icon el-icon-date"></i>
+      </el-input>
+      <el-card
+        class="box-card"
+        style="width: 322px;padding: 0 30px 20px;margin-top: 10px;position: fixed;z-index: 9999"
+        :style="{top:divTop + 'px'}"
+        v-show="showSeason"
+        ref="card"
+      >
+        <div class="clearfix" style="text-align: center;padding: 0;" slot="header">
+          <button
+            class="el-picker-panel__icon-btn el-date-picker__prev-btn el-icon-d-arrow-left"
+            type="button"
+            aria-label="前一年"
+            @click="prev"
+          ></button>
+          <span class="el-date-picker__header-label">{{ year }}年</span>
+          <button
+            class="el-picker-panel__icon-btn el-date-picker__next-btn el-icon-d-arrow-right"
+            type="button"
+            aria-label="后一年"
+            @click="next"
+          ></button>
+        </div>
+        <div class="text item" style="text-align: center;">
+          <el-button
+            style="width: 40%;color: #606266;float: left;"
+            type="text"
+            size="medium"
+            @click="selectSeason(0)"
+          >第一季度
+          </el-button>
+          <el-button
+            style="width: 40%;color: #606266;float: right;"
+            type="text"
+            size="medium"
+            @click="selectSeason(1)"
+          >第二季度
+          </el-button>
+        </div>
+        <div class="text item" style="text-align: center;">
+          <el-button
+            style="width: 40%;color: #606266;float: left;"
+            type="text"
+            size="medium"
+            @click="selectSeason(2)"
+          >第三季度
+          </el-button>
+          <el-button
+            style="width: 40%;color: #606266;float: right;"
+            type="text"
+            size="medium"
+            @click="selectSeason(3)"
+          >第四季度
+          </el-button>
+        </div>
+      </el-card>
+    </div>
+  </template>
+  
+  <script>
+  export default {
+    name: "quarter-picker",
+    model: {
+      prop: 'inputValue',
+      event: 'inputValue'
+    },
+    props: {
+      valueArr: {
+        type: Array,
+        default: () => {
+          return ['01-01,03-31', '04-01,06-30', '07-01,09-30', '10-01,12-31'];
+        }
+      },
+      placeholder: {
+        type: String,
+        default: '请选择季度'
+      },
+      inputValue: {
+        type: Array,
+        default: function() {
+          return [];
+        }
+      },
+      changeValue: {
+        type: Function,
+        default: () => {}
+      },
+      otherData: {
+        type: Object,
+        default: () => {
+          return {};
+        }
+      }
+    },
+    mounted() {
+      if (this.inputValue != null && this.inputValue.length > 0) {
+        this.showText(this.inputValue);
+      }
+      window.addEventListener('scroll', this.handleScroll, true);
+    },
+    watch: {
+      inputValue(newValue) {
+        if (newValue.length > 0) {
+          this.showText(newValue);
+        } else {
+          this.showValue = "";
+        }
+      }
+    },
+    data() {
+      return {
+        showSeason: false,
+        showValue: '',
+        year: new Date().getFullYear(),
+        season: '',
+        divTop: 0
+      };
+    },
+    methods: {
+      handleScroll() {
+        let inputText = this.$refs.inputText.$el;
+        if (inputText.getBoundingClientRect().top + 220 > document.body.offsetHeight) {
+          this.divTop = inputText.getBoundingClientRect().top - 215;
+        } else {
+          this.divTop = inputText.getBoundingClientRect().top + 30;
+        }
+      },
+      clickInput() {
+        this.handleScroll();
+        this.showSeason = true;
+      },
+      prev() {
+        this.year = this.year * 1 - 1;
+      },
+      next() {
+        this.year = this.year * 1 + 1;
+      },
+      selectSeason(i) {
+        let that = this;
+        that.season = i + 1; // 得到当前季度
+        let arr = that.valueArr[i].split(',');
+        let value = [];
+        let start = that.year + '-' + arr[0]; // 得到当前季度的开始日期
+        let end = that.year + '-' + arr[1]; // 得到当前季度的结束日期
+        value.push(start); // 将季度开始日期和季度结束日期存入数组中
+        value.push(end);
+        if (this.inputValue != null && this.inputValue[0] != value[0]) {
+          this.changeValue(value, this.otherData);
+        }
+        this.$emit('inputValue', value);
+        that.showSeason = false;
+        this.showText(value);
+      },
+      showText(value) { // value为数组,数组索引为0的值为季度开始时间
+        let arr = value[0].split('-'); // 将季度开始时间用-进行分割
+        this.year = arr[0];
+        let month = arr[1];
+        this.season = Math.ceil(month / 3); // 向上取整
+        this.showValue = `${this.year}年${this.season}季度`; // 设置显示格式
+      }
+    }
+  }
+  </script>
+  
+  <style scoped>
+  ._mark {
+    position: fixed;
+    top: 0;
+    bottom: 0;
+    left: 0;
+    right: 0;
+    background: rgba(0, 0, 0, 0);
+    z-index: 999;
+  }
+  
+  .yearBtn {
+    text-align: center;
+    padding: 0
+  }
+  
+  .box-card {
+    width: 322px;
+    padding: 0 3px 20px;
+    margin-top: 10px;
+    position: fixed;
+    z-index: 9999
+  }
+  
+  .text.item {
+    text-align: center;
+  }
+  
+  .text.item >>> .el-button {
+    width: 40%;
+    color: #606266;
+  }
+  
+  .text.item ._left {
+    float: left;
+  }
+  
+  .text.item ._right {
+    float: right;
+  }
+  </style> -->
+
+
+  <template>
+
+    <el-form>
+  
+      <el-form-item>
+  
+        <mark
+  
+          class="_mark"
+  
+          v-show="showSeason"
+  
+          @click.stop="showSeason = false"
+  
+        ></mark>
+  
+        <el-input
+  
+          placeholder="请选择季度"
+  
+          v-model="showValue"
+  
+          size="small"
+  
+          style="width:12.7rem;"
+  
+          @focus="showSeason = true"
+  
+        >
+  
+          <i slot="prefix" class="el-input__icon el-icon-date"></i>
+  
+        </el-input>
+  
+        <el-card class="box-card" v-show="showSeason">
+  
+          <div slot="header" class="clearfix yearBtn">
+  
+            <button
+  
+              type="button"
+  
+              aria-label="前一年"
+  
+              class="el-picker-panel__icon-btn el-date-picker__prev-btn el-icon-d-arrow-left"
+  
+              @click="prev"
+  
+            ></button>
+  
+            <span role="button" class="el-date-picker__header-label"
+  
+              >{{ year }}年</span
+  
+            >
+  
+            <button
+  
+              type="button"
+  
+              aria-label="后一年"
+  
+              @click="next"
+  
+              class="el-picker-panel__icon-btn el-date-picker__next-btn el-icon-d-arrow-right"
+  
+            ></button>
+  
+          </div>
+  
+          <div class="text item">
+  
+            <el-button
+  
+              type="text"
+  
+              size="medium"
+  
+              class="_left"
+  
+              @click="selectSeason(0)"
+  
+              >第一季度</el-button
+  
+            >
+  
+            <el-button
+  
+              type="text"
+  
+              size="medium"
+  
+              class="_right"
+  
+              @click="selectSeason(1)"
+  
+              >第二季度</el-button
+  
+            >
+  
+          </div>
+  
+          <div class="text item">
+  
+            <el-button
+  
+              type="text"
+  
+              size="medium"
+  
+              class="_left"
+  
+              @click="selectSeason(2)"
+  
+              >第三季度</el-button
+  
+            >
+  
+            <el-button
+  
+              type="text"
+  
+              size="medium"
+  
+              class="_right"
+  
+              @click="selectSeason(3)"
+  
+              >第四季度</el-button
+  
+            >
+  
+          </div>
+  
+        </el-card>
+  
+      </el-form-item>
+  
+    </el-form>
+  
+  </template>
+  
+  <script>
+  
+  export default {
+  
+    props: {
+  
+      valueArr: {
+  
+        default: () => {
+  
+          return ["01-03", "04-06", "07-09", "10-12"];
+  
+        },
+  
+        type: Array,
+  
+      },
+  
+      getValue: {
+  
+        default: () => {},
+  
+        type: Function,
+  
+      },
+  
+      defaultValue: {
+  
+        default: "",
+  
+        type: String,
+  
+      },
+  
+    },
+  
+    data() {
+  
+      return {
+  
+        showSeason: false,
+  
+        season: "",
+  
+        year: new Date().getFullYear(),
+  
+        showValue: "",
+  
+      };
+  
+    },
+  
+    created() {
+  
+      if (this.defaultValue) {
+  
+        let value = this.defaultValue;
+  
+        let arr = value.split("-");
+  
+        this.year = arr[0].slice(0, 4);
+  
+        let str = arr[0].slice(4, 6) + "-" + arr[1].slice(4, 6);
+  
+        let arrAll = this.valueArr;
+  
+        this.showValue = `${this.year}年${arrAll.indexOf(str) + 1}季度`;
+  
+      }
+  
+    },
+  
+    watch: {
+  
+      defaultValue: function(value) {
+  
+        let arr = value.split("-");
+  
+        this.year = arr[0].slice(0, 4);
+  
+        let str = arr[0].slice(4, 6) + "-" + arr[1].slice(4, 6);
+  
+        let arrAll = this.valueArr;
+  
+        // if(arrAll.indexOf(str)==0){
+  
+        //   this.showValue  = `${this.year}年第一季度`;
+  
+        // }
+  
+        this.showValue = `${this.year}年${arrAll.indexOf(str) + 1}季度`;
+  
+        
+  
+      },
+  
+    },
+  
+    methods: {
+  
+      one() {
+  
+        this.showSeason = false;
+  
+      },
+  
+      prev() {
+  
+        this.year = this.year * 1 - 1;
+  
+      },
+  
+      next() {
+  
+        this.year = this.year * 1 + 1;
+  
+      },
+  
+      reast(){
+  
+        this.showValue = ''
+  
+      },
+  
+      selectSeason(i) {
+  
+        let that = this;
+  
+        that.season = i + 1;
+  
+        let arr = that.valueArr[i].split("-");
+  
+        that.getValue(that.year + arr[0] + "-" + that.year + arr[1]);
+  
+        that.showSeason = false;
+  
+        if(this.season == 1){
+  
+          this.showValue = `${this.year}年第一季度`;
+  
+        }else if(this.season == 2){
+  
+           this.showValue = `${this.year}年第二季度`;
+  
+        }
+  
+        else if(this.season == 3){
+  
+           this.showValue = `${this.year}年第三季度`;
+  
+        }
+  
+        else if(this.season == 4){
+  
+           this.showValue = `${this.year}年第四季度`;
+  
+        }
+  
+        // this.showValue = `${this.year}年${this.season}季度`;
+  
+        that.sendMsg()
+  
+      },
+  
+      getLastDay(year, month) {
+  
+        var new_year = year; //取当前的年份
+  
+        var new_month = month++; //取下一个月的第一天,方便计算(最后一天不固定)
+  
+        if (month > 12) {
+  
+          new_month -= 12; //月份减
+  
+          new_year++; //年份增
+  
+        }
+  
+        var new_date = new Date(new_year, new_month, 1); //取当年当月中的第一天
+  
+        return new Date(new_date.getTime() - 1000 * 60 * 60 * 24).getDate(); //获取当月最后一天日期
+  
+      },
+  
+      sendMsg() {
+  
+        this.$emit("func", this.showValue);
+  
+      },
+  
+    },
+  
+  };
+  
+  </script>
+  
+  <style scoped>
+  
+  ._mark {
+  
+    position: fixed;
+  
+    top: 0;
+  
+    bottom: 0;
+  
+    left: 0;
+  
+    right: 0;
+  
+    background: rgba(0, 0, 0, 0);
+  
+    z-index: 999;
+  
+  }
+  
+  .yearBtn {
+  
+    text-align: center;
+  
+    padding: 0;
+  
+  }
+  
+  .box-card {
+  
+    width: 322px;
+  
+    padding: 0 3px 20px;
+  
+    margin-top: 10px;
+  
+    position: fixed;
+  
+    z-index: 9999;
+  
+  }
+  
+  .text.item {
+  
+    text-align: center;
+  
+  }
+  
+  .text.item >>> .el-button {
+  
+    width: 40%;
+  
+    color: #606266;
+  
+  }
+  
+  .text.item ._left {
+  
+    float: left;
+  
+  }
+  
+  .text.item ._right {
+  
+    float: right;
+  
+  }
+  
+  </style>

+ 2 - 9
src/views/core/reportForms/intrusionTestReport.vue

@@ -20,16 +20,9 @@
             />
           </el-form-item>
               <el-form-item label="时间" prop="searchTime">
-                <!-- <el-date-picker   value-format='yyyy-MM' v-model="queryParams.searchTime"
+              <el-date-picker   value-format='yyyy-MM' v-model="queryParams.searchTime"
                                 align="right" type="month" placeholder="请选择查询时间">
-                </el-date-picker>  -->
-                <el-date-picker
-      v-model="queryParams.searchTime"
-      type="quarter"
-      placeholder="选择季度"
-      :piker-options="quarterOptions"
-      >
-    </el-date-picker>
+                </el-date-picker>  
               </el-form-item>
 
               <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>

+ 291 - 0
src/views/core/reportForms/standbyPowerReport.vue

@@ -0,0 +1,291 @@
+<template>
+    <div class="app-container">
+
+          <el-form :model="queryParams" ref="queryForm" size="small"  :inline="true"
+          v-show="showSearch"
+          label-width="100px">
+
+            <el-form-item label="组织机构" prop="orgId" class="formTreeItem">
+            <tree-select
+              v-model="queryParams.orgId"
+              :options="deptOptions"
+              :show-count="true"
+              :normalizer="tenantIdnormalizer"
+              :props="{ checkStrictly: true, label: 'name' }"
+              placeholder="请选择归属机构"
+              clearValueText="清除"
+              :noChildrenText="''"
+              noOptionsText="没有数据"
+              noResultsText="没有搜索结果"
+            />
+          </el-form-item>
+              <el-form-item label="时间" prop="searchTime">
+              <!-- <el-date-picker   value-format='yyyy-MM' v-model="queryParams.searchTime"
+                                align="right" type="month" placeholder="请选择查询时间">
+                </el-date-picker>   -->
+                <Quarter @func="getMsgFormSon"></Quarter>
+              </el-form-item> 
+
+              <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
+              <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
+            </el-form-item>
+          </el-form>
+          <h3 class="title">{{ this.title}}</h3>
+          <el-row :gutter="10" class="mb8">
+            <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
+          </el-row>
+          <el-table
+            border
+            height="700"
+            size="small"
+            v-loading="loading" :data="checkList" @selection-change="handleSelectionChange">
+       
+            <el-table-column label="序号" align="center" min-width="50">
+              <template v-slot:default="scope">
+                <span v-text="getPageIndex(scope.$index)"> </span>
+              </template>
+            </el-table-column>
+            <el-table-column label="地区" align="center" prop="city" />
+            <el-table-column label="单位名称" align="center" prop="orgName" width="100"/>
+            <el-table-column label="网点数量" align="left" prop="networkNumber" width="100"/>
+            <el-table-column label="应履职次数" align="center" prop="planNumber"/>
+            <el-table-column label="已履职次数" align="center" prop="realityNumber"/>
+            <el-table-column label="履职完成率" align="center" prop="realityRate"/>
+            <el-table-column label="隐患数量" align="center" prop="abnormalNumber"/>
+            <el-table-column label="已整改数量" align="center" prop="realityRectificationNumber"/>
+            <el-table-column label="整改完成率" align="center" prop="realityRectificationRate"/>
+          </el-table>
+          <pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNum"
+                      :limit.sync="queryParams.pageSize"
+                      @pagination="getList"/>
+  
+    </div>
+  </template>
+  
+  <script>
+    import tableList from '@/mixins/tableList'
+    import {listStandbyPowerReport} from "@/api/core/reportForms/resumptionReport";
+    import treeselect from '@riophae/vue-treeselect'
+    import "@riophae/vue-treeselect/dist/vue-treeselect.css";
+    import {deptTreeSelect,businessTreeSelect} from "@/api/system/public";
+    import orgTree from "@/components/orgTree";
+    import Quarter from '@/views/core/reportForms/Quarter.vue';
+
+    export default {
+      name: "Check",
+      /** 引入基础minxins*/
+      mixins: [tableList],
+      components: {treeselect,orgTree,Quarter},
+      dicts: ['sys_normal_disable','sys_org_type','repot_cycle'],
+      data() {
+        return {
+            startDatepickerOptions: {
+        disabledDate(time) {
+          const date = new Date();
+          date.setTime(date.getTime());
+          return time.getTime() < date;
+        },
+      },
+          // 遮罩层
+          loading: true,
+          // 选中数组
+          ids: [],
+          names: [],
+          // 非单个禁用
+          single: true,
+          //搜索tree
+          deptName: null,
+          // 非多个禁用
+          multiple: true,
+          // 显示搜索条件
+          showSearch: true,
+          //区域
+          roleOptions: [],
+           //全部检查机构
+      orgOptions: [],
+          //搜索tree
+          deptName: null,
+          // 部门树选项
+          deptOptions: [],
+          // 总条数
+          total: 0,
+          //区域集合
+          areaList: [],
+          // 区域采集点表格数据
+          checkList: [],
+          // 弹出层标题
+          title: "",
+          // 是否显示弹出层
+          open: false,
+          // 查询参数
+          queryParams: {
+            pageNum: 1,
+            pageSize: 10,
+            checkName: null,
+            areaId: null,
+            orgId: null,
+            searchTime:null
+          },
+          // 表单参数
+          form: {},
+          // 表单校验
+          checkList: [],
+          roleOptions: [],
+          defaultKeys: [],
+          //是否关联下级
+          checked: false,
+          defaultProps: {
+            children: "children",
+            label: "name"
+          },
+  
+          rules: {
+            areaId: [
+              {required: true, message: '请选择区域', trigger: 'blur'},
+            ],
+            orgType: [
+              {required: true, message: '请选择机构类型', trigger: 'blur'},
+            ],
+            checkName: [
+              {required: true, message: '请输入NFC点位名称', trigger: 'change'}
+            ],
+          },
+          defaultKeys: []
+  
+        };
+      },
+      created() {
+        this.getDeptTree();
+      this. getList();
+
+      if (this.defaultValue) {
+        let value = this.defaultValue
+        let arr = value.split('-')
+        this.year = arr[0].slice(0, 4)
+        let str = arr[0].slice(4, 6) + '-' + arr[1].slice(4, 6)
+        let arrAll = this.valueArr
+        this.showValue = `${this.year}年${arrAll.indexOf(str) + 1}季度`
+      };
+      },
+      watch: {
+        // 根据名称筛选部门树
+        deptName(val) {
+          this.$refs.tree.filter(val);
+        }
+      },
+      methods: {
+        prev () {
+        this.year = this.year * 1 - 1
+      },
+      next () {
+        this.year = this.year * 1 + 1
+      },
+      selectSeason (i) {
+        for (let j in $('.season-item')) {
+          $('.season-item').eq(j).css('color', '#fff')
+        }
+        $('.season-item').eq(i).css('color', '#249bff')
+        this.season = i + 1
+        let arr = this.valueArr[i].split('-')
+        this.getValue(this.year + arr[0] + '-' + this.year + arr[1])
+        this.showSeason = false
+        this.showValue = `${this.year}年${this.season}季度`
+        this.$emit('getQuarter', this.year, this.season)
+      },
+
+
+
+  /** 查询机构树数据 */
+  getDeptTree() {
+      deptTreeSelect().then((response) => {
+        this.deptOptions = response.data;
+      });
+    },
+        /** treeSelect组件自定义数据*/
+        tenantIdnormalizer(node, instanceId) {
+      if (node.children && !node.children.length) {
+        delete node.children;
+      }
+      return {
+        id: node.id,
+        label: node.shortName,
+        children: node.children,
+      };
+    },
+        getPageIndex($index) {
+          //表格序号
+          return (
+            (this.queryParams.pageNum - 1) * this.queryParams.pageSize + $index + 1
+          );
+        },
+        handleExport() {
+      this.download('core/safetyInspectReport/export', {
+        ...this.queryParams
+      }, `${'【'+this.orgName+'】'+'-检查统计报表-'+this.formatTime(new Date(),'YYYYMMDD')}.xlsx`)
+    },
+    
+     
+        getList() {
+          this.loading = true;
+          listStandbyPowerReport(this.queryParams).then(response => {
+            this.checkList = response.data;
+            this.title=response.title;
+            this.loading = false;
+          });
+        },
+        getAllOrg() {
+          selectAllOrg().then(response => {
+        this.orgOptions = response.data;
+      })
+    },
+ 
+    
+        // 取消按钮
+        cancel() {
+          this.open = false;
+          this.reset();
+        },
+        // 表单重置
+        reset() {
+          this.form = {
+            id: null,
+            checkName: null,
+            areaId: null,
+            orgId: null,
+            createTime: null,
+            updateTime: null,
+            updateId: null,
+            createBy: null,
+            delFlag: null,
+            updateBy: null
+          };
+          this.resetForm("form");
+        },
+        /** 搜索按钮操作 */
+        handleQuery() {
+          this.queryParams.pageNum = 1;
+          this.getList();
+        },
+        /** 重置按钮操作 */
+        resetQuery() {
+          this.resetForm("queryForm");
+          this.handleQuery();
+        },
+        // 多选框选中数据
+        handleSelectionChange(selection) {
+          this.ids = selection.map(item => item.id)
+          this.names = selection.map(item => item.checkName)
+          this.single = selection.length !== 1
+          this.multiple = !selection.length
+        },
+  
+      }
+    };
+  </script>
+  <style lang="scss" scoped>
+  ::v-deep.formTreeItem {
+    .el-form-item__content {
+      width: 264px;
+    }
+  }
+  </style>