|
@@ -0,0 +1,450 @@
|
|
|
+<template>
|
|
|
+ <div class="gasReport">
|
|
|
+ <customHeader>通风瓦斯日报管理</customHeader>
|
|
|
+ <div class="report-container">
|
|
|
+ <div class="search-area">
|
|
|
+ <a-row>
|
|
|
+ <a-col :span="4">
|
|
|
+ <div class="area-item">
|
|
|
+ <div class="item-text">日期区间:</div>
|
|
|
+ <a-date-picker style="width: 220px" :showTime="false" valueFormat="YYYY-MM-DD"
|
|
|
+ v-model:value="searchData.reportTime" placeholder="请选择填报日期" />
|
|
|
+ </div>
|
|
|
+ </a-col>
|
|
|
+
|
|
|
+ <a-col :span="4">
|
|
|
+ <div class="area-item">
|
|
|
+ <div class="item-text">检查工:</div>
|
|
|
+ <a-input style="width: 220px" v-model:value="searchData.sbr" placeholder="请输入检查工" />
|
|
|
+ </div>
|
|
|
+ </a-col>
|
|
|
+ <a-col :span="4">
|
|
|
+ <div class="area-item">
|
|
|
+ <div class="item-text">上报地点:</div>
|
|
|
+ <a-select v-model:value="searchData.strInstallPos" style="width: 220px"
|
|
|
+ placeholder="请选择上报地点">
|
|
|
+ <a-select-option v-for="item in addressList" :key="item" :value="item.value">{{
|
|
|
+ item.label
|
|
|
+ }}</a-select-option>
|
|
|
+ </a-select>
|
|
|
+ </div>
|
|
|
+ </a-col>
|
|
|
+
|
|
|
+ <a-button type="primary" preIcon="ant-design:search-outlined" @click="getSearch">查询</a-button>
|
|
|
+ <a-button preIcon="ant-design:sync-outlined" style="margin: 0px 10px" @click="onReset">重置</a-button>
|
|
|
+ <a-button type="primary" preIcon="ant-design:check-circle-outlined"
|
|
|
+ @click="getPassSh">审核通过</a-button>
|
|
|
+ <a-button style="margin:0px 10px" type="primary" preIcon="ant-design:download-outlined" @click="getExport">导出日报表</a-button>
|
|
|
+ <a-button type="primary" preIcon="ant-design:download-outlined"
|
|
|
+ @click="handleMenuClick">导出班报表</a-button>
|
|
|
+
|
|
|
+ </a-row>
|
|
|
+ </div>
|
|
|
+ <a-table :columns="columnsDhz" :data-source="tableData" size="small" :scroll="{ y: 500 }" class="tableW"
|
|
|
+ :pagination="pagination" @change="pageChange">
|
|
|
+ <template #bodyCell="{ column, text }">
|
|
|
+ <template v-if="
|
|
|
+ column.dataIndex == 'o2Night1' ||
|
|
|
+ column.dataIndex == 'o2Night2' ||
|
|
|
+ column.dataIndex == 'o2Early1' ||
|
|
|
+ column.dataIndex == 'o2Early2' ||
|
|
|
+ column.dataIndex == 'o2Noon1' ||
|
|
|
+ column.dataIndex == 'o2Noon2'
|
|
|
+ ">
|
|
|
+ <div :style="{ color: Number(text) >= 18 && Number(text) <= 20.9 ? '#0ae715' : '#ff2313' }">{{
|
|
|
+ text }}
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+ <template v-if="
|
|
|
+ column.dataIndex == 'coNight1' ||
|
|
|
+ column.dataIndex == 'coNight2' ||
|
|
|
+ column.dataIndex == 'coEarly1' ||
|
|
|
+ column.dataIndex == 'coEarly2' ||
|
|
|
+ column.dataIndex == 'coNoon1' ||
|
|
|
+ column.dataIndex == 'coNoon2'
|
|
|
+ ">
|
|
|
+ <div :style="{ color: Number(text) >= 0 && Number(text) <= 23 ? '#0ae715' : '#ff2313' }">{{ text
|
|
|
+ }}</div>
|
|
|
+ </template>
|
|
|
+ <template v-if="
|
|
|
+ column.dataIndex == 'tnight1' ||
|
|
|
+ column.dataIndex == 'tnight2' ||
|
|
|
+ column.dataIndex == 'tearly1' ||
|
|
|
+ column.dataIndex == 'tearly2' ||
|
|
|
+ column.dataIndex == 'tnoon1' ||
|
|
|
+ column.dataIndex == 'tnoon2'
|
|
|
+ ">
|
|
|
+ <div :style="{ color: Number(text) >= 3 && Number(text) <= 25 ? '#0ae715' : '#ff2313' }">{{ text
|
|
|
+ }}</div>
|
|
|
+ </template>
|
|
|
+ <template v-if="
|
|
|
+ column.dataIndex == 'co2Night1' ||
|
|
|
+ column.dataIndex == 'co2Night2' ||
|
|
|
+ column.dataIndex == 'co2Early1' ||
|
|
|
+ column.dataIndex == 'co2Early2' ||
|
|
|
+ column.dataIndex == 'co2Noon1' ||
|
|
|
+ column.dataIndex == 'co2Noon2'
|
|
|
+ ">
|
|
|
+ <div :style="{ color: Number(text) >= 0.04 && Number(text) <= 0.1 ? '#0ae715' : '#ff2313' }">{{
|
|
|
+ text }}
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+ <template v-if="
|
|
|
+ column.dataIndex == 'ch4Night1' ||
|
|
|
+ column.dataIndex == 'ch4Night2' ||
|
|
|
+ column.dataIndex == 'ch4Early1' ||
|
|
|
+ column.dataIndex == 'ch4Early2' ||
|
|
|
+ column.dataIndex == 'ch4Noon1' ||
|
|
|
+ column.dataIndex == 'ch4Noon2'
|
|
|
+ ">
|
|
|
+ <div :style="{ color: Number(text) >= 0 && Number(text) <= 0.1 ? '#0ae715' : '#ff2313' }">{{
|
|
|
+ text }}</div>
|
|
|
+ </template>
|
|
|
+ </template>
|
|
|
+ </a-table>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ </div>
|
|
|
+</template>
|
|
|
+
|
|
|
+<script setup lang="ts">
|
|
|
+import { ref, onMounted, reactive } from 'vue';
|
|
|
+import { columnsDhz } from './gas-report.data';
|
|
|
+import { getGasAddressList, getList, expComReportByParam, reviewPass, getIsReviewPass, getAllUserInfo, exportReportByPoi, queryUserByRoleCode } from './gas-report.api';
|
|
|
+import customHeader from '/@/components/vent/customHeader.vue';
|
|
|
+import { message } from 'ant-design-vue';
|
|
|
+import dayjs from 'dayjs';
|
|
|
+import { BasicForm, useForm } from '/@/components/Form';
|
|
|
+
|
|
|
+let searchData = reactive({
|
|
|
+ reportTime: dayjs().format('YYYY-MM-DD'),
|
|
|
+ districtTeam: '',
|
|
|
+ sbr: '',
|
|
|
+ strInstallPos: '',
|
|
|
+});
|
|
|
+let qdList = reactive<any[]>([]); //区队下拉列表
|
|
|
+let addressList = reactive<any[]>([]); //上报地点下拉列表
|
|
|
+let pagination = reactive({
|
|
|
+ current: 1, // 当前页码
|
|
|
+ pageSize: 10, // 每页显示条数
|
|
|
+ total: 0, // 总条目数,后端返回
|
|
|
+ // showTotal: (total, range) => `${range[0]}-${range[1]} 条,总共 ${total} 条`, // 分页右下角显示信息
|
|
|
+ showSizeChanger: true, // 是否可改变每页显示条数
|
|
|
+ pageSizeOptions: ['10', '20', '50'], // 可选的每页显示条数
|
|
|
+});
|
|
|
+let tableData = ref<any[]>([]);
|
|
|
+
|
|
|
+//获取日报列表数据
|
|
|
+async function getTableList() {
|
|
|
+ let res = await getList({ pageNo: pagination.current, pageSize: pagination.pageSize, ...searchData });
|
|
|
+ res.records.forEach((el) => {
|
|
|
+ el.jwSdzNight1 = el.jwSdzNight1 != null ? el.jwSdzNight1 : '-';
|
|
|
+ el.jwSdzNight2 = el.jwSdzNight2 != null ? el.jwSdzNight2 : '-';
|
|
|
+ el.jwSdzEarly1 = el.jwSdzEarly1 != null ? el.jwSdzEarly1 : '-';
|
|
|
+ el.jwSdzEarly2 = el.jwSdzEarly2 != null ? el.jwSdzEarly2 : '-';
|
|
|
+ el.jwSdzNoon1 = el.jwSdzNoon1 != null ? el.jwSdzNoon1 : '-';
|
|
|
+ el.jwSdzNoon2 = el.jwSdzNoon2 != null ? el.jwSdzNoon2 : '-';
|
|
|
+ });
|
|
|
+ tableData.value = res.records;
|
|
|
+ pagination.total = res.total;
|
|
|
+}
|
|
|
+//查询
|
|
|
+function getSearch() {
|
|
|
+ pagination.current = 1;
|
|
|
+ getTableList();
|
|
|
+}
|
|
|
+//重置
|
|
|
+function onReset() {
|
|
|
+ pagination.current = 1;
|
|
|
+ searchData.districtTeam = '';
|
|
|
+ searchData.reportTime = '';
|
|
|
+ searchData.strInstallPos = '';
|
|
|
+ searchData.sbr = '';
|
|
|
+ getTableList();
|
|
|
+}
|
|
|
+//分页切换
|
|
|
+function pageChange(val) {
|
|
|
+ pagination.current = val.current;
|
|
|
+ pagination.pageSize = val.pageSize;
|
|
|
+ getTableList();
|
|
|
+}
|
|
|
+function uniqueObjectsArray(arr) {
|
|
|
+ const map = new Map();
|
|
|
+ return arr.filter((item) => {
|
|
|
+ const key = JSON.stringify(item);
|
|
|
+ const isNew = !map.has(key);
|
|
|
+ map.set(key, item);
|
|
|
+ return isNew;
|
|
|
+ });
|
|
|
+}
|
|
|
+//获取安装位置下拉选项
|
|
|
+async function getSelectList() {
|
|
|
+ let res = await getGasAddressList({ coalseam: '', devicekind: 'gasDayReport' });
|
|
|
+ qdList.length = 0;
|
|
|
+ addressList.length = 0;
|
|
|
+ if (res.length != 0) {
|
|
|
+ res.forEach((el) => {
|
|
|
+ qdList.push({ label: el.devgroup_dictText, value: el.devgroup_dictText });
|
|
|
+ addressList.push({ label: el.strinstallpos, value: el.strinstallpos });
|
|
|
+ });
|
|
|
+ qdList = uniqueObjectsArray(qdList);
|
|
|
+ }
|
|
|
+}
|
|
|
+//导出报表
|
|
|
+async function getExport() {
|
|
|
+ if (getTs()) {
|
|
|
+ message.warning('数据异常!');
|
|
|
+ } else {
|
|
|
+ if (searchData.reportTime) {
|
|
|
+ let data = await getIsReviewPass({ reportTime: searchData.reportTime });
|
|
|
+ if (data == '已审核通过!') {
|
|
|
+ let res = await expComReportByParam({ tempName: 'wsrb', reportTime: searchData.reportTime });
|
|
|
+ let filename = searchData.reportTime + '.xlsx';
|
|
|
+ downFilePublic(res, filename);
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ message.warning('请选择需要导出数据的填报日期!');
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|
|
|
+function getTs() {
|
|
|
+ let param = true;
|
|
|
+ tableData.value.forEach((el) => {
|
|
|
+ if (
|
|
|
+ Number(el.o2Night1) >= 18 &&
|
|
|
+ Number(el.o2Night1) <= 20.9 &&
|
|
|
+ Number(el.o2Night2) >= 18 &&
|
|
|
+ Number(el.o2Night2) <= 20.9 &&
|
|
|
+ Number(el.o2Early1) >= 18 &&
|
|
|
+ Number(el.o2Early1) <= 20.9 &&
|
|
|
+ Number(el.o2Early2) >= 18 &&
|
|
|
+ Number(el.o2Early2) <= 20.9 &&
|
|
|
+ Number(el.o2Noon1) >= 18 &&
|
|
|
+ Number(el.o2Noon1) <= 20.9 &&
|
|
|
+ Number(el.o2Noon2) >= 18 &&
|
|
|
+ Number(el.o2Noon2) <= 20.9
|
|
|
+ ) {
|
|
|
+ param = false;
|
|
|
+ } else if (
|
|
|
+ Number(el.coNight1) >= 0 &&
|
|
|
+ Number(el.coNight1) <= 23 &&
|
|
|
+ Number(el.coNight2) >= 0 &&
|
|
|
+ Number(el.coNight2) <= 23 &&
|
|
|
+ Number(el.coEarly1) >= 0 &&
|
|
|
+ Number(el.coEarly1) <= 23 &&
|
|
|
+ Number(el.coEarly2) >= 0 &&
|
|
|
+ Number(el.coEarly2) <= 23 &&
|
|
|
+ Number(el.coNoon1) >= 0 &&
|
|
|
+ Number(el.coNoon1) <= 23 &&
|
|
|
+ Number(el.coNoon2) >= 0 &&
|
|
|
+ Number(el.coNoon2) <= 23
|
|
|
+ ) {
|
|
|
+ param = false;
|
|
|
+ } else if (
|
|
|
+ Number(el.co2Night1) >= 0.04 &&
|
|
|
+ Number(el.co2Night1) <= 0.1 &&
|
|
|
+ Number(el.co2Night2) >= 0.04 &&
|
|
|
+ Number(el.co2Night2) <= 0.1 &&
|
|
|
+ Number(el.co2Early1) >= 0.04 &&
|
|
|
+ Number(el.co2Early1) <= 0.1 &&
|
|
|
+ Number(el.co2Early2) >= 0.04 &&
|
|
|
+ Number(el.co2Early2) <= 0.1 &&
|
|
|
+ Number(el.co2Noon1) >= 0.04 &&
|
|
|
+ Number(el.co2Noon1) <= 0.1 &&
|
|
|
+ Number(el.co2Noon2) >= 0.04 &&
|
|
|
+ Number(el.co2Noon2) <= 0.1
|
|
|
+ ) {
|
|
|
+ param = false;
|
|
|
+ } else if (
|
|
|
+ Number(el.tnight1) >= 3 &&
|
|
|
+ Number(el.tnight1) <= 25 &&
|
|
|
+ Number(el.tnight2) >= 3 &&
|
|
|
+ Number(el.tnight2) <= 25 &&
|
|
|
+ Number(el.tearly1) >= 3 &&
|
|
|
+ Number(el.tearly1) <= 25 &&
|
|
|
+ Number(el.tearly2) >= 3 &&
|
|
|
+ Number(el.tearly2) <= 25 &&
|
|
|
+ Number(el.tnoon1) >= 3 &&
|
|
|
+ Number(el.tnoon1) <= 25 &&
|
|
|
+ Number(el.tnoon2) >= 3 &&
|
|
|
+ Number(el.tnoon2) <= 25
|
|
|
+ ) {
|
|
|
+ param = false;
|
|
|
+ } else if (
|
|
|
+ Number(el.ch4Night1) >= 0 &&
|
|
|
+ Number(el.ch4Night1) <= 0.1 &&
|
|
|
+ Number(el.ch4Night2) >= 0 &&
|
|
|
+ Number(el.ch4Night2) <= 0.1 &&
|
|
|
+ Number(el.ch4Early1) >= 0 &&
|
|
|
+ Number(el.ch4Early1) <= 0.1 &&
|
|
|
+ Number(el.ch4Early2) >= 0 &&
|
|
|
+ Number(el.ch4Early2) <= 0.1 &&
|
|
|
+ Number(el.ch4Noon1) >= 0 &&
|
|
|
+ Number(el.ch4Noon1) <= 0.1 &&
|
|
|
+ Number(el.ch4Noon2) >= 0 &&
|
|
|
+ Number(el.ch4Noon2) <= 0.1
|
|
|
+ ) {
|
|
|
+ param = false;
|
|
|
+ } else {
|
|
|
+ param = true;
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ });
|
|
|
+ return param;
|
|
|
+}
|
|
|
+
|
|
|
+//审核通过
|
|
|
+async function getPassSh() {
|
|
|
+ if (getTs()) {
|
|
|
+ message.warning('数据异常!');
|
|
|
+ } else {
|
|
|
+ let res = await reviewPass({ reportTime: searchData.reportTime });
|
|
|
+ if (res) {
|
|
|
+ getTableList();
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+// 下载公用方法
|
|
|
+function downFilePublic(content, fileName) {
|
|
|
+ const blob = new Blob([content], { type: 'application/xlsx;charset=UTF-8' }); // 构造一个blob对象来处理数据
|
|
|
+ // 对于<a>标签,只有 Firefox 和 Chrome(内核) 支持 download 属性
|
|
|
+ // IE10以上支持blob但是依然不支持download
|
|
|
+ if ('download' in document.createElement('a')) {
|
|
|
+ // 支持a标签download的浏览器
|
|
|
+ const link = document.createElement('a'); // 创建a标签
|
|
|
+ link.download = fileName; // a标签添加属性
|
|
|
+ link.style.display = 'none';
|
|
|
+ link.href = URL.createObjectURL(blob);
|
|
|
+ document.body.appendChild(link);
|
|
|
+ link.click(); // 执行下载
|
|
|
+ URL.revokeObjectURL(link.href); // 释放url
|
|
|
+ document.body.removeChild(link); // 释放标签
|
|
|
+ } else {
|
|
|
+ // 其他浏览器
|
|
|
+ navigator.msSaveBlob(blob, fileName);
|
|
|
+ }
|
|
|
+}
|
|
|
+//导出瓦斯班报表
|
|
|
+async function handleMenuClick(val) {
|
|
|
+ if (searchData.reportTime) {
|
|
|
+ let res = await expComReportByParam({ tempName: 'wsrbshb', reportTime: searchData.reportTime });
|
|
|
+ let filename = searchData.reportTime + '.xlsx';
|
|
|
+ downFilePublic(res, filename);
|
|
|
+ } else {
|
|
|
+ message.warning('请选择需要导出数据的填报日期!');
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+const [registerForm, { validate, setFieldsValue }] = useForm({
|
|
|
+ schemas: [
|
|
|
+ {
|
|
|
+ label: '检查工',
|
|
|
+ field: 'checkName',
|
|
|
+ component: 'ApiSelect',
|
|
|
+ required: true,
|
|
|
+ show: false,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: '交班瓦检员',
|
|
|
+ field: 'agoCheckPerson',
|
|
|
+ component: 'ApiSelect',
|
|
|
+ required: true,
|
|
|
+ componentProps: {
|
|
|
+ api: queryUserByRoleCode,
|
|
|
+ params: { roleCode: 'gasCheck' },
|
|
|
+ labelField: 'realname',
|
|
|
+ valueField: 'username',
|
|
|
+ showSearch: true,
|
|
|
+ },
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: '当班瓦检员',
|
|
|
+ field: 'nowCheckPerson',
|
|
|
+ component: 'ApiSelect',
|
|
|
+ required: true,
|
|
|
+ componentProps: {
|
|
|
+ api: queryUserByRoleCode,
|
|
|
+ params: { roleCode: 'gasCheck' },
|
|
|
+ labelField: 'realname',
|
|
|
+ valueField: 'username',
|
|
|
+ showSearch: true,
|
|
|
+ onChange(__, { label }) {
|
|
|
+ setFieldsValue({
|
|
|
+ checkName: label,
|
|
|
+ });
|
|
|
+ },
|
|
|
+ },
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: '接班瓦检员',
|
|
|
+ field: 'nextCheckPerson',
|
|
|
+ component: 'ApiSelect',
|
|
|
+ required: true,
|
|
|
+ componentProps: {
|
|
|
+ api: queryUserByRoleCode,
|
|
|
+ params: { roleCode: 'gasCheck' },
|
|
|
+ labelField: 'realname',
|
|
|
+ valueField: 'username',
|
|
|
+ showSearch: true,
|
|
|
+ },
|
|
|
+ },
|
|
|
+ ],
|
|
|
+ labelWidth: 100,
|
|
|
+ showActionButtonGroup: false,
|
|
|
+});
|
|
|
+
|
|
|
+onMounted(() => {
|
|
|
+ getSelectList();
|
|
|
+ getTableList();
|
|
|
+});
|
|
|
+</script>
|
|
|
+
|
|
|
+<style lang="less" scoped>
|
|
|
+@import '/@/design/theme.less';
|
|
|
+
|
|
|
+.gasReport {
|
|
|
+ width: 100%;
|
|
|
+ height: 100%;
|
|
|
+ padding: 80px 10px 15px 10px;
|
|
|
+ box-sizing: border-box;
|
|
|
+ position: relative;
|
|
|
+
|
|
|
+ .search-area {
|
|
|
+ margin: 20px 0px;
|
|
|
+
|
|
|
+ .area-item {
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+
|
|
|
+ .item-text {
|
|
|
+ color: #fff;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ .zxm-picker,
|
|
|
+ .zxm-input {
|
|
|
+ border: 1px solid var(--vent-form-item-border) !important;
|
|
|
+ background-color: #ffffff00 !important;
|
|
|
+ color: #fff !important;
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+:deep(.zxm-table-thead > tr > th:last-child) {
|
|
|
+ border-right: 1px solid #91e9fe !important;
|
|
|
+}
|
|
|
+
|
|
|
+:deep(.zxm-picker-input > input) {
|
|
|
+ color: #fff;
|
|
|
+}
|
|
|
+
|
|
|
+:deep(.zxm-select:not(.zxm-select-customize-input) .zxm-select-selector) {
|
|
|
+ border: 1px solid var(--vent-form-item-border) !important;
|
|
|
+ background-color: #ffffff00 !important;
|
|
|
+}
|
|
|
+
|
|
|
+:deep(.zxm-select-selection-item) {
|
|
|
+ color: #fff !important;
|
|
|
+}
|
|
|
+</style>
|