Jelajahi Sumber

新增消防档案统计数据

“yueshang” 1 tahun lalu
induk
melakukan
07fa97495a
2 mengubah file dengan 284 tambahan dan 1 penghapusan
  1. 19 1
      src/api/backend/street.js
  2. 265 0
      src/views/backend/archivalStat/index.vue

+ 19 - 1
src/api/backend/street.js

@@ -59,4 +59,22 @@ export function exportStreetExcel(query) {
     responseType: 'blob'
   })
 }
-
+//获取消防 档案统计的列表
+export function getLvitongji(data) {
+  return request({
+    url: '/backend/street/getLv1tongji',
+    method: 'post',
+    data: data
+  })
+}
+//获取消防 档案统计的列表二级
+export function getLv2tongji(data) {
+  return request({
+    url: '/backend/street/getLv2tongji',
+    method: 'post',
+    header: {
+      "content-type": "application/x-www-form-urlencoded",
+  },
+  params: data,
+  })
+}

+ 265 - 0
src/views/backend/archivalStat/index.vue

@@ -0,0 +1,265 @@
+<template>
+  <div class="app-container">
+    <!-- 搜索工作栏 -->
+    <el-form
+      :model="queryParams"
+      ref="queryForm"
+      size="small"
+      :inline="true"
+      v-show="showSearch"
+      label-width="60px"
+    >
+      <el-form-item label="日期" prop="detdate">
+        <el-date-picker
+          unlink-panels
+          v-model="queryParams.detdate"
+          style="width: 240px"
+          value-format="yyyy-MM-dd"
+          type="daterange"
+          range-separator="-"
+          start-placeholder="开始日期"
+          end-placeholder="结束日期"
+        />
+      </el-form-item>
+      <el-form-item>
+        <el-button type="primary" icon="el-icon-search" @click="handleQuery"
+          >搜索</el-button
+        >
+        <el-button icon="el-icon-refresh" @click="resetQuery">重置</el-button>
+      </el-form-item>
+    </el-form>
+
+    <!-- 操作工具栏 -->
+    <el-row :gutter="10" class="mb8">
+      <!-- <el-col :span="1.5">
+          <el-button type="primary" plain icon="el-icon-plus" size="mini" @click="handleAdd"
+                     v-hasPermi="['backend:fpd-detection:create']">新增</el-button>
+        </el-col> -->
+      <el-col :span="1.5">
+        <el-button
+          type="warning"
+          plain
+          icon="el-icon-download"
+          size="mini"
+          @click="handleExport"
+          :loading="exportLoading"
+          v-hasPermi="['backend:fpd-detection:export']"
+          >导出</el-button
+        >
+      </el-col>
+      <el-col :span="1.5">
+        <el-button
+          type="primary"
+          plain
+          icon="el-icon-back"
+          size="mini"
+          @click="backLevelOne"
+          >返回</el-button
+        >
+      </el-col>
+      <right-toolbar
+        :showSearch.sync="showSearch"
+        @queryTable="getList"
+      ></right-toolbar>
+    </el-row>
+
+    <!-- 列表 -->
+    <el-table v-loading="loading" :data="list">
+      <el-table-column label="地域" align="center" prop="ddid">
+        <template v-slot="scope">
+          <span
+            style="color: forestgreen; cursor: pointer"
+            @click="clickLevelOne(scope.row.ids)"
+            >{{ scope.row.ddid }}</span
+          >
+        </template>
+      </el-table-column>
+      <el-table-column
+        label="居民住宅区物业服务企业消防工作基本情况"
+        align="center"
+        prop="a2"
+      >
+        <template v-slot="scope">
+          <span class="texts" @click="opentabs = true">{{ scope.row.a2 }}</span>
+        </template>
+      </el-table-column>
+      <el-table-column
+        label="居(村)民委员会消防工作基本情况"
+        align="center"
+        prop="a3"
+        width="180"
+      >
+        <template v-slot="scope">
+          <span class="texts" @click="opentabs = true">{{ scope.row.a3 }}</span>
+        </template>
+      </el-table-column>
+      <el-table-column
+        label="乡镇(街道)监督管理单位(场所)消防安全基本情况"
+        align="center"
+        prop="a4"
+      >
+        <template v-slot="scope">
+          <span class="texts" @click="opentabs = true">{{ scope.row.a4 }}</span>
+        </template>
+      </el-table-column>
+      <el-table-column label="乡镇(街道)火灾事故情况" align="center" prop="a5">
+        <template v-slot="scope">
+          <span class="texts" @click="opentabs = true">{{ scope.row.a5 }}</span>
+        </template>
+      </el-table-column>
+      <el-table-column
+        label="乡镇(街道)消防工作办公室消防安全检查台账"
+        align="center"
+        prop="a6"
+      >
+        <template v-slot="scope">
+          <span class="texts" @click="opentabs = true">{{ scope.row.a6 }}</span>
+        </template>
+      </el-table-column>
+      <el-table-column
+        label="乡镇(街道)消防宣传教育台账"
+        align="center"
+        prop="a7"
+      >
+        <template v-slot="scope">
+          <span class="texts" @click="opentabs = true">{{ scope.row.a7 }}</span>
+        </template>
+      </el-table-column>
+    </el-table>
+    <!-- 对话框(添加 / 修改) -->
+  </div>
+</template>
+  
+  <script>
+import {
+  getFpdDetectionPage,
+  exportFpdDetectionExcel,
+} from "@/api/backend/fpdDetection";
+import { getLvitongji, getLv2tongji } from "@/api/backend/street";
+import FileUpload from "@/components/FileUpload";
+import { getDdlist } from "@/api/backend/statistics";
+export default {
+  name: "archivalStat",
+  components: { FileUpload },
+  data() {
+    return {
+      // 遮罩层
+      loading: true,
+      // 导出遮罩层
+      exportLoading: false,
+      // 显示搜索条件
+      showSearch: true,
+      // 消防设备维护和检测台账列表
+      list: [],
+      // 查询参数
+      queryParams: {
+        detdate: [],
+        detinspect: null,
+      },
+      deptData: [], //所有大队
+    };
+  },
+  async created() {
+    const res = await getDdlist();
+    this.deptData = res ? res.data : [];
+    if (res) {
+      this.getList();
+    }
+  },
+  methods: {
+    /** 查询列表 */
+    async getList() {
+      this.loading = true;
+      this.list = [];
+      const begin = this.queryParams.detresult
+        ? this.queryParams.detresult
+        : null;
+      // 执行查询
+      getLvitongji({
+        beginDate: "",
+        endDate: "",
+        sjxfjg: "",
+      })
+        .then((response) => {
+          if (response.data) {
+            response.data.forEach((item) => {
+              const foundDept = this.deptData.find(
+                (dept) => item.ddid === dept.deptName
+              );
+              if (foundDept) {
+                item.ddid = item.ddid.replace("消防救援大队", "");
+                item.ids = foundDept.id;
+              }
+            });
+            this.list = response.data;
+            console.log("this.list ", this.list);
+          } else {
+            this.list = [];
+          }
+          this.loading = false;
+        })
+        .catch((err) => {
+          this.loading = false;
+        });
+    },
+    //点击返回上一级
+    backLevelOne(){
+      this.getList()
+    },
+    //点击一级地域名称
+    clickLevelOne(ids) {
+      this.list = [];
+      getLv2tongji({ sjxfjg: ids })
+        .then((response) => {
+          if (response.data) {
+            response.data.forEach((item) => {
+              item.ddid = item.streetName;
+              item.ids = ids;
+            });
+            this.list = response.data;
+            console.log("this.list=======", this.list);
+          } else {
+            this.list = [];
+          }
+        })
+        .catch((err) => {
+          this.loading = false;
+        });
+    },
+    /** 搜索按钮操作 */
+    handleQuery() {
+      this.getList();
+    },
+    /** 重置按钮操作 */
+    resetQuery() {
+      this.resetForm("queryForm");
+      this.handleQuery();
+    },
+    /** 导出按钮操作 */
+    handleExport() {
+      // 处理查询参数
+      let params = { ...this.queryParams };
+      params.pageNo = undefined;
+      params.pageSize = undefined;
+      this.$modal
+        .confirm("是否确认导出所有消防设备维护和检测台账数据项?")
+        .then(() => {
+          this.exportLoading = true;
+          return exportFpdDetectionExcel(params);
+        })
+        .then((response) => {
+          this.$download.excel(response, "消防设备维护和检测台账.xls");
+          this.exportLoading = false;
+        })
+        .catch(() => {});
+    },
+  },
+};
+</script>
+<style scoped lang="scss">
+.texts {
+  color: rgb(64, 158, 255);
+  cursor: pointer;
+}
+</style>
+