From 92acee73cbe8d5a230cf45e1146bd594153dc364 Mon Sep 17 00:00:00 2001
From: guanqb <18720758508@163.com>
Date: Fri, 02 Feb 2024 19:14:29 +0800
Subject: [PATCH] 九小导出

---
 src/views/publicSecurity/ninePlaceManage/archivesManage.vue         |   41 ++++++++++++++++++++
 src/views/publicSecurity/ninePlaceManage/situationRectification.vue |    4 +-
 src/api/publicSecurity/ninePlaceManage.js                           |   10 +---
 src/views/publicSecurity/ninePlaceManage/hiddenDangerStatistics.vue |   17 ++++----
 4 files changed, 54 insertions(+), 18 deletions(-)

diff --git a/src/api/publicSecurity/ninePlaceManage.js b/src/api/publicSecurity/ninePlaceManage.js
index a6aea67..460ef4d 100644
--- a/src/api/publicSecurity/ninePlaceManage.js
+++ b/src/api/publicSecurity/ninePlaceManage.js
@@ -27,14 +27,10 @@
 }
 
 // 隐患统计
-export const getYHTJList = (current, size, params) => {
+export const getYHTJList = (params) => {
     return request({
         url: "/api/blade-taskPlaceRectification/taskPlaceRectification/rectificationStatistics",
-        method: "get",
-        params: {
-            current,
-            size,
-            ...params
-        },
+        method: "post",
+        params
     })
 }
diff --git a/src/views/publicSecurity/ninePlaceManage/archivesManage.vue b/src/views/publicSecurity/ninePlaceManage/archivesManage.vue
index b9a9fb9..7371744 100644
--- a/src/views/publicSecurity/ninePlaceManage/archivesManage.vue
+++ b/src/views/publicSecurity/ninePlaceManage/archivesManage.vue
@@ -14,6 +14,10 @@
                 <el-button :size="size" type="text" @click="showStringDispose(row, 'principalPhoneflag')"
                     v-text="textDispose(row, 'principalPhoneflag', 'principalPhone')"></el-button>
             </template>
+            <template slot="menuLeft">
+                <el-button type="warning" size="small" plain icon="el-icon-download" @click="handleExport">导出
+                </el-button>
+            </template>
         </avue-crud>
     </basic-container>
 </template>
@@ -25,6 +29,21 @@
 import {
     getDAGLList
 } from "@/api/publicSecurity/ninePlaceManage"
+import NProgress from 'nprogress'
+import 'nprogress/nprogress.css'
+import Qs from "qs"
+import {
+    exportBlob
+} from "@/api/common"
+import {
+    getToken
+} from '@/util/auth'
+import {
+    downloadXls
+} from "@/util/util"
+import {
+    dateNow
+} from "@/util/date"
 
 export default {
     data () {
@@ -48,7 +67,6 @@
                 searchShow: true,
                 searchMenuSpan: 3,
                 menu: false,
-                header: false,
                 border: true,
                 index: true,
                 editBtn: false,
@@ -169,6 +187,27 @@
         }
     },
     methods: {
+        handleExport () {
+            this.$confirm("是否导出档案管理数据?", "提示", {
+                confirmButtonText: "确定",
+                cancelButtonText: "取消",
+                type: "warning"
+            }).then(() => {
+                NProgress.start()
+                var data = {
+                    ...this.query
+                }
+                data = Qs.stringify(data)
+                exportBlob(
+                    `/api/blade-place/place/exportNineType?${this.website.tokenHeader}=${getToken()}&` + data
+                ).then(res => {
+                    console.log('exportBlob', res)
+                    downloadXls(res.data, `档案管理${dateNow()}.xlsx`)
+                    NProgress.done()
+                })
+            })
+        },
+
         showStringDispose (row, type) {
             row[type] = !row[type]
         },
diff --git a/src/views/publicSecurity/ninePlaceManage/hiddenDangerStatistics.vue b/src/views/publicSecurity/ninePlaceManage/hiddenDangerStatistics.vue
index ffc3542..b5ea678 100644
--- a/src/views/publicSecurity/ninePlaceManage/hiddenDangerStatistics.vue
+++ b/src/views/publicSecurity/ninePlaceManage/hiddenDangerStatistics.vue
@@ -245,7 +245,7 @@
                 label
             }).then(
                 () => {
-                    this.onLoad(this.page)
+                    this.onLoad()
                     this.$message({
                         type: "success",
                         message: "操作成功!",
@@ -283,7 +283,7 @@
                 label
             }).then(
                 () => {
-                    this.onLoad(this.page)
+                    this.onLoad()
                     this.$message({
                         type: "success",
                         message: "操作成功!",
@@ -308,7 +308,7 @@
                     return removeTask(row)
                 })
                 .then(() => {
-                    this.onLoad(this.page)
+                    this.onLoad()
 
                     this.$message({
                         type: "success",
@@ -319,7 +319,7 @@
 
         searchReset () {
             this.query = {}
-            this.onLoad(this.page)
+            this.onLoad()
         },
 
         searchChange (params, done) {
@@ -330,7 +330,7 @@
                 endTime: params.daterange[1],
             } : {}
             this.page.currentPage = 1
-            this.onLoad(this.page)
+            this.onLoad()
             done()
         },
 
@@ -359,7 +359,7 @@
                     return remove(this.ids)
                 })
                 .then(() => {
-                    this.onLoad(this.page)
+                    this.onLoad()
                     this.$message({
                         type: "success",
                         message: "操作成功!",
@@ -388,7 +388,7 @@
             // this.onLoad(this.page, this.query)
         },
 
-        onLoad (page, params = {}) {
+        onLoad () {
             this.loading = true
             if (!this.query.startTime) {
                 this.query = {
@@ -396,7 +396,8 @@
                     endTime: this.getLastMouth[0],
                 }
             }
-            getYHTJList(page.currentPage, page.pageSize, this.query).then(res => {
+            console.log('onLoad', this.query)
+            getYHTJList(this.query).then(res => {
                 console.log('getZGQKList', res.data.data)
                 const data = res.data.data
                 data.forEach(item => {
diff --git a/src/views/publicSecurity/ninePlaceManage/situationRectification.vue b/src/views/publicSecurity/ninePlaceManage/situationRectification.vue
index e081389..d37f2aa 100644
--- a/src/views/publicSecurity/ninePlaceManage/situationRectification.vue
+++ b/src/views/publicSecurity/ninePlaceManage/situationRectification.vue
@@ -18,7 +18,7 @@
     mapGetters
 } from "vuex"
 import {
-    getZGQKList, exportZGQKList
+    getZGQKList
 } from "@/api/publicSecurity/ninePlaceManage"
 import NProgress from 'nprogress'
 import 'nprogress/nprogress.css'
@@ -184,7 +184,7 @@
                     `/api/blade-taskPlaceRectification/taskPlaceRectification/exportRectificationStatistics?${this.website.tokenHeader}=${getToken()}&` + data
                 ).then(res => {
                     console.log('exportBlob', res)
-                    downloadXls(res.data, `房屋数据表${dateNow()}.xlsx`)
+                    downloadXls(res.data, `整改情况${dateNow()}.xlsx`)
                     NProgress.done()
                 })
             })

--
Gitblit v1.9.3