|
@@ -0,0 +1,294 @@
|
|
|
|
|
+<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">
|
|
|
|
|
+
|
|
|
|
|
+<el-select style="width: 100%;" v-model="queryParams.orgId" placeholder="请选择统计机构">
|
|
|
|
|
+ <el-option v-for="item in orgOptions" :key="item.id" :label="item.name"
|
|
|
|
|
+ :value="item.id"></el-option>
|
|
|
|
|
+</el-select>
|
|
|
|
|
+</el-form-item> -->
|
|
|
|
|
+
|
|
|
|
|
+<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="cycle">
|
|
|
|
|
+ <el-select v-model="queryParams.cycle" placeholder="请选择统计周期" @change="clean">
|
|
|
|
|
+ <el-option
|
|
|
|
|
+ v-for="item in options"
|
|
|
|
|
+ :key="item.value"
|
|
|
|
|
+ :label="item.label"
|
|
|
|
|
+ :value="item.value">
|
|
|
|
|
+ </el-option>
|
|
|
|
|
+ </el-select>
|
|
|
|
|
+ </el-form-item>
|
|
|
|
|
+
|
|
|
|
|
+ <el-form-item label="时间" prop="year" v-if="queryParams.cycle==1 || queryParams.cycle==null">
|
|
|
|
|
+ <el-date-picker value-format='yyyy-MM' v-model="queryParams.year"
|
|
|
|
|
+ align="right" type="month" placeholder="请选择查询时间">
|
|
|
|
|
+ </el-date-picker>
|
|
|
|
|
+ </el-form-item>
|
|
|
|
|
+
|
|
|
|
|
+<el-form-item label="年份" prop="year" v-if="queryParams.cycle==2">
|
|
|
|
|
+ <el-date-picker
|
|
|
|
|
+ value-format='yyyy'
|
|
|
|
|
+ v-model="queryParams.year"
|
|
|
|
|
+ type="year"
|
|
|
|
|
+ placeholder="选择年份">
|
|
|
|
|
+ </el-date-picker>
|
|
|
|
|
+ </el-form-item>
|
|
|
|
|
+
|
|
|
|
|
+ <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>
|
|
|
|
|
+
|
|
|
|
|
+ <el-row :gutter="10" class="mb8">
|
|
|
|
|
+ <el-col :span="1.5">
|
|
|
|
|
+ <el-button type="primary" icon="el-icon-download" size="mini" @click="handleExport"
|
|
|
|
|
+ v-hasPermi="['core:safetyInspectReport:export']">导出
|
|
|
|
|
+ </el-button>
|
|
|
|
|
+ </el-col>
|
|
|
|
|
+ <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
|
|
|
|
+ <h1 class="title" style="text-align:center;">{{ this.title}}</h1>
|
|
|
|
|
+ </el-row>
|
|
|
|
|
+ <el-table
|
|
|
|
|
+ border
|
|
|
|
|
+ height="800"
|
|
|
|
|
+ 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" />
|
|
|
|
|
+ <el-table-column label="网点数量" align="left" prop="planInspectOrg"/>
|
|
|
|
|
+
|
|
|
|
|
+ <el-table-column label="应检次数" align="center" prop="planInspectNumber"/>
|
|
|
|
|
+ <el-table-column label="已检次数" align="center" prop="realityInspectNumber"/>
|
|
|
|
|
+ <el-table-column label="检查完成率" align="center" prop="inspectRate"/>
|
|
|
|
|
+ <el-table-column label="隐患数量" align="center" prop="pitfallNumber"/>
|
|
|
|
|
+ <el-table-column label="已整改数量" align="center" prop="rectificationNumber"/>
|
|
|
|
|
+ <el-table-column label="整改完成率" align="center" prop="rectificationRate"/>
|
|
|
|
|
+ </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 {selectAllOrg,listSelfReport} from "@/api/core/reportForms/safetyInspectReport";
|
|
|
|
|
+ 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";
|
|
|
|
|
+ export default {
|
|
|
|
|
+ name: "Check",
|
|
|
|
|
+ /** 引入基础minxins*/
|
|
|
|
|
+ mixins: [tableList],
|
|
|
|
|
+ components: {treeselect,orgTree},
|
|
|
|
|
+ dicts: ['sys_normal_disable','sys_org_type'],
|
|
|
|
|
+ data() {
|
|
|
|
|
+ return {
|
|
|
|
|
+ options: [{
|
|
|
|
|
+ value: 1,
|
|
|
|
|
+ label: '月'
|
|
|
|
|
+ }, {
|
|
|
|
|
+ value: 2,
|
|
|
|
|
+ label: '年'
|
|
|
|
|
+ }],
|
|
|
|
|
+ // 遮罩层
|
|
|
|
|
+ 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,
|
|
|
|
|
+ orgId: null,
|
|
|
|
|
+ year:null,
|
|
|
|
|
+ cycle: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();
|
|
|
|
|
+ },
|
|
|
|
|
+ watch: {
|
|
|
|
|
+ // 根据名称筛选部门树
|
|
|
|
|
+ deptName(val) {
|
|
|
|
|
+ this.$refs.tree.filter(val);
|
|
|
|
|
+ }
|
|
|
|
|
+ },
|
|
|
|
|
+ methods: {
|
|
|
|
|
+
|
|
|
|
|
+ /** 查询机构树数据 */
|
|
|
|
|
+ getDeptTree() {
|
|
|
|
|
+ deptTreeSelect().then((response) => {
|
|
|
|
|
+ this.deptOptions = response.data;
|
|
|
|
|
+ this.queryParams.orgId=response.data[0].id;
|
|
|
|
|
+ });
|
|
|
|
|
+ },
|
|
|
|
|
+ /** 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;
|
|
|
|
|
+ listSelfReport(this.queryParams).then(response => {
|
|
|
|
|
+ this.orgName=response.orgName;
|
|
|
|
|
+ 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>
|