소스 검색

[Mod 0000] 瓦斯日报页面修改表格表头及表单

houzekong 1 개월 전
부모
커밋
f2fc31529d
2개의 변경된 파일207개의 추가작업 그리고 207개의 파일을 삭제
  1. 11 12
      src/views/vent/gas/gasReport/gas-report.data.ts
  2. 196 195
      src/views/vent/gas/gasReport/index.vue

+ 11 - 12
src/views/vent/gas/gasReport/gas-report.data.ts

@@ -10,11 +10,18 @@ export const columns: BasicColumn[] = [
           {
             title: '第一次',
             children: [
+              // {
+              //   title: '煤层',
+              //   dataIndex: 'coalseam_dictText',
+              //   key: 'coalseam_dictText',
+              //   width: 100,
+              //   align: 'center',
+              // },
               {
-                title: '煤层',
-                dataIndex: 'coalseam_dictText',
-                key: 'coalseam_dictText',
-                width: 100,
+                title: '检测区域',
+                dataIndex: 'checkReg',
+                key: 'checkReg',
+                width: 120,
                 align: 'center',
               },
               {
@@ -25,13 +32,6 @@ export const columns: BasicColumn[] = [
                 align: 'center',
               },
               {
-                title: '检测区域',
-                dataIndex: 'checkReg',
-                key: 'checkReg',
-                width: 120,
-                align: 'center',
-              },
-              {
                 title: '检查工',
                 dataIndex: 'checkPersonNight',
                 key: 'checkPersonNight',
@@ -89,7 +89,6 @@ export const columns: BasicColumn[] = [
                 width: 100,
                 align: 'center',
               },
-
             ],
           },
           {

+ 196 - 195
src/views/vent/gas/gasReport/index.vue

@@ -7,8 +7,14 @@
           <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="请选择填报日期" @change="onChange" />
+              <a-date-picker
+                style="width: 220px"
+                :showTime="false"
+                valueFormat="YYYY-MM-DD"
+                v-model:value="searchData.reportTime"
+                placeholder="请选择填报日期"
+                @change="onChange"
+              />
             </div>
           </a-col>
           <!-- <a-col :span="4">
@@ -22,7 +28,7 @@
           </a-col> -->
           <a-col :span="4">
             <div class="area-item">
-              <div class="item-text">上报人:</div>
+              <div class="item-text">检查工:</div>
               <a-input style="width: 220px" v-model:value="searchData.sbr" placeholder="请输入上报人" />
             </div>
           </a-col>
@@ -30,21 +36,17 @@
             <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-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" style="margin-right:10px"
-            @click="getPassSh">审核通过</a-button>
+          <a-button type="primary" preIcon="ant-design:check-circle-outlined" style="margin-right: 10px" @click="getPassSh">审核通过</a-button>
           <a-button type="primary" preIcon="ant-design:download-outlined" @click="getExport">导出日报表</a-button>
-          <a-button type="primary" preIcon="ant-design:download-outlined" @click="getExport1"
-            style="margin: 0px 10px">导出瓦斯三对照报表</a-button>
-          <a-button type="primary" preIcon="ant-design:download-outlined" @click="getExport2"
-            style="margin-right:10px">导出瓦斯检查小票</a-button>
+          <a-button type="primary" preIcon="ant-design:download-outlined" @click="getExport1" style="margin: 0px 10px">导出瓦斯三对照报表</a-button>
+          <a-button type="primary" preIcon="ant-design:download-outlined" @click="getExport2" style="margin-right: 10px">导出瓦斯检查小票</a-button>
           <a-button type="primary" preIcon="ant-design:download-outlined" @click="handleMenuClick">导出班报表</a-button>
           <!-- <a-dropdown>
             <template #overlay>
@@ -72,8 +74,15 @@
 </a-dropdown> -->
         </a-row>
       </div>
-      <a-table :columns="columns" :data-source="tableData" size="small" :scroll="{ y: 500 }" class="tableW"
-        :pagination="pagination" @change="pageChange">
+      <a-table
+        :columns="columns"
+        :data-source="tableData"
+        size="small"
+        :scroll="{ y: 500 }"
+        class="tableW"
+        :pagination="pagination"
+        @change="pageChange"
+      >
         <template #bodyCell="{ column, text }"></template>
       </a-table>
     </div>
@@ -81,215 +90,207 @@
 </template>
 
 <script setup lang="ts">
-import { ref, onMounted, computed, reactive } from 'vue';
-import { columns } from './gas-report.data';
-import { getGasAddressList, getList, expComReportByParam, reviewPass, getIsReviewPass } from './gas-report.api';
-import customHeader from '/@/components/vent/customHeader.vue';
-import { message } from 'ant-design-vue';
-import dayjs from 'dayjs';
+  import { ref, onMounted, computed, reactive } from 'vue';
+  import { columns } from './gas-report.data';
+  import { getGasAddressList, getList, expComReportByParam, reviewPass, getIsReviewPass } from './gas-report.api';
+  import customHeader from '/@/components/vent/customHeader.vue';
+  import { message } from 'ant-design-vue';
+  import dayjs from 'dayjs';
 
-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[]>([]);
-
-function onChange(val, time) {
-  searchData.reportTime = time;
-}
-//获取日报列表数据
-async function getTableList() {
-  let res = await getList({ pageNo: pagination.current, pageSize: pagination.pageSize, ...searchData });
-  console.log(res, '瓦斯日报列表数据-----------');
-  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;
+  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'], // 可选的每页显示条数
   });
-}
-//获取安装位置下拉选项
-async function getSelectList() {
-  let res = await getGasAddressList({ coalseam: '', devicekind: 'gasDayReport' });
-  console.log(res, '区队下拉选项--------');
-  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 });
+  let tableData = ref<any[]>([]);
+
+  function onChange(val, time) {
+    searchData.reportTime = time;
+  }
+  //获取日报列表数据
+  async function getTableList() {
+    let res = await getList({ pageNo: pagination.current, pageSize: pagination.pageSize, ...searchData });
+    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;
     });
-    qdList = uniqueObjectsArray(qdList);
   }
-}
-//导出报表
-async function getExport() {
-  if (searchData.reportTime) {
-    let data = await getIsReviewPass({ reportTime: searchData.reportTime })
-    if (data == '已审核通过!') {
-      let res = await expComReportByParam({ tempName: 'wsrb', reportTime: searchData.reportTime });
-      console.log(res, '导出------------');
+  //获取安装位置下拉选项
+  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 (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('请选择需要导出数据的填报日期!');
+    }
+  }
+  //导出三对照报表
+  async function getExport1() {
+    if (searchData.reportTime) {
+      let res = await expComReportByParam({ tempName: 'wssdz', reportTime: searchData.reportTime });
       let filename = searchData.reportTime + '.xlsx';
       downFilePublic(res, filename);
+    } else {
+      message.warning('请选择需要导出数据的填报日期!');
     }
-  } else {
-    message.warning('请选择需要导出数据的填报日期!');
-  }
-}
-//导出三对照报表
-async function getExport1() {
-  if (searchData.reportTime) {
-    let res = await expComReportByParam({ tempName: 'wssdz', reportTime: searchData.reportTime });
-    console.log(res, '导出------------');
-    let filename = searchData.reportTime + '.xlsx';
-    downFilePublic(res, filename);
-  } else {
-    message.warning('请选择需要导出数据的填报日期!');
   }
-}
-//导出瓦斯检查小票
-async function getExport2() {
-  if (searchData.reportTime && searchData.sbr) {
-    let res = await expComReportByParam({ tempName: 'wsjcxp', reportTime: searchData.reportTime, checkName: searchData.sbr });
-    console.log(res, '导出------------');
-    let filename = searchData.reportTime + '.xlsx';
-    downFilePublic(res, filename);
-  } else if (!searchData.reportTime) {
-    message.warning('请选择需要导出数据的填报日期!');
-  } else if (!searchData.sbr) {
-    message.warning('请输入上报人名称!');
+  //导出瓦斯检查小票
+  async function getExport2() {
+    if (searchData.reportTime && searchData.sbr) {
+      let res = await expComReportByParam({ tempName: 'wsjcxp', reportTime: searchData.reportTime, checkName: searchData.sbr });
+      let filename = searchData.reportTime + '.xlsx';
+      downFilePublic(res, filename);
+    } else if (!searchData.reportTime) {
+      message.warning('请选择需要导出数据的填报日期!');
+    } else if (!searchData.sbr) {
+      message.warning('请输入上报人名称!');
+    }
   }
-}
 
-// 下载公用方法
-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);
+  // 下载公用方法
+  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) {
-  console.log(val, 'val--------');
-  if (searchData.reportTime) {
-    let res = await expComReportByParam({ tempName: 'wsrbshb', reportTime: searchData.reportTime });
-    console.log(res, '导出------------');
-    let filename = searchData.reportTime + '.xlsx';
-    downFilePublic(res, filename);
-  } else {
-    message.warning('请选择需要导出数据的填报日期!');
+  //导出瓦斯班报表
+  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('请选择需要导出数据的填报日期!');
+    }
   }
-}
-//审核通过
-async function getPassSh() {
-  let res = await reviewPass({ reportTime: searchData.reportTime })
-  console.log(res, '审核通过')
-  if (res) {
-    getTableList();
+  //审核通过
+  async function getPassSh() {
+    let res = await reviewPass({ reportTime: searchData.reportTime });
+    if (res) {
+      getTableList();
+    }
   }
-}
 
-onMounted(() => {
-  getSelectList();
-  getTableList();
-});
+  onMounted(() => {
+    getSelectList();
+    getTableList();
+  });
 </script>
 
 <style lang="less" scoped>
-@import '/@/design/theme.less';
+  @import '/@/design/theme.less';
 
-.gasReport {
-  width: 100%;
-  height: 100%;
-  padding: 80px 10px 15px 10px;
-  box-sizing: border-box;
-  position: relative;
+  .gasReport {
+    width: 100%;
+    height: 100%;
+    padding: 80px 10px 15px 10px;
+    box-sizing: border-box;
+    position: relative;
 
-  .search-area {
-    margin: 20px 0px;
+    .search-area {
+      margin: 20px 0px;
 
-    .area-item {
-      display: flex;
-      align-items: center;
+      .area-item {
+        display: flex;
+        align-items: center;
 
-      .item-text {
-        color: #fff;
+        .item-text {
+          color: #fff;
+        }
       }
     }
-  }
 
-  .zxm-picker,
-  .zxm-input {
-    border: 1px solid var(--vent-form-item-border) !important;
-    background-color: #ffffff00 !important;
-    color: #fff !important;
+    .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-table-thead > tr > th:last-child) {
+    border-right: 1px solid #91e9fe !important;
+  }
 
-:deep(.zxm-picker-input > input) {
-  color: #fff;
-}
+  :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: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;
-}
+  :deep(.zxm-select-selection-item) {
+    color: #fff !important;
+  }
 </style>