From d9aa51e1787a155da7cd0ded5dfb4ff3982d2be5 Mon Sep 17 00:00:00 2001
From: guanqb <18720758508@163.com>
Date: Thu, 22 Feb 2024 17:54:46 +0800
Subject: [PATCH] 消防自查详情对接

---
 src/views/publicSecurity/keynotePlaceManage.vue |  107 +++++++++++++++++++++++++++++++++--------------------
 src/api/publicSecurity/keynoteManage.js         |    9 ++++
 2 files changed, 76 insertions(+), 40 deletions(-)

diff --git a/src/api/publicSecurity/keynoteManage.js b/src/api/publicSecurity/keynoteManage.js
index 735e2af..18a2f32 100644
--- a/src/api/publicSecurity/keynoteManage.js
+++ b/src/api/publicSecurity/keynoteManage.js
@@ -6,4 +6,13 @@
         method: "post",
         data
     })
+}
+
+// 列表详情
+export const getTaskPlaceSelfCheckInfo = (params) => {
+    return request({
+        url: "/api/blade-taskPlaceSelfCheck/taskPlaceSelfCheck/getInfo",
+        method: "get",
+        params
+    })
 }
\ No newline at end of file
diff --git a/src/views/publicSecurity/keynotePlaceManage.vue b/src/views/publicSecurity/keynotePlaceManage.vue
index 6737da4..59de07c 100644
--- a/src/views/publicSecurity/keynotePlaceManage.vue
+++ b/src/views/publicSecurity/keynotePlaceManage.vue
@@ -49,7 +49,7 @@
             custom-class="flow-design-dialog" :before-close="handleClose">
             <audit-base @handleSubmit="submitAudit"></audit-base>
         </el-dialog>
-        <el-drawer title="巡查详情" :visible.sync="isDetail" :append-to-body="true" size="40%" direction="rtl">
+        <el-drawer title="消防自查详情" :visible.sync="isDetail" :append-to-body="true" size="40%" direction="rtl">
             <div class="title">
                 <div class="icon">{{ refreshNum }}</div>
                 基础信息
@@ -147,8 +147,12 @@
     mapGetters
 } from "vuex"
 import {
-    applyTaskExamine
+    applyTaskExamine,
+    getTaskPlaceSelfCheckInfo
 } from "@/api/publicSecurity/keynoteManage"
+import {
+    getPatrolGroupTree, getDictBizTree
+} from "@/api/publicSecurity/ninePlaceManage"
 import website from '@/config/website'
 import NProgress from 'nprogress'
 import 'nprogress/nprogress.css'
@@ -355,6 +359,11 @@
 
     watch: {},
 
+    created () {
+        this.getPatrolGroupTree()
+        this.getDictBizTree()
+    },
+
     computed: {
         ...mapGetters(["permission", "userInfo"]),
         permissionList () {
@@ -430,52 +439,70 @@
             }, {})
         },
 
+        // 九小类型字典接口
+        getDictBizTree () {
+            getDictBizTree({ code: 'nineType' }).then(res => {
+                this.nineTypeList = res.data.data
+            })
+        },
+
         // 九小类型转换
         switchNineType (type) {
             return this.nineTypeList.find(item => item.key === type) ? this.nineTypeList.find(item => item.key === type).title : ''
         },
 
-        getDetail (row) {
-            if (row.patrolRecordVOList) {
-                row.patrolRecordVOList.forEach(item => {
-                    item.imageUrlsList = []
-                    item.rectificationImageUrlsList = []
-                    if (item.imageUrls) {
-                        item.imageUrlsList = item.imageUrls.split(',').map(ele => {
-                            return website.minioUrl + ele
-                        })
+        // 获取问题类型
+        getPatrolGroupTree () {
+            getPatrolGroupTree().then(res => {
+                this.questionTypeList = res.data.data
+            })
+        },
 
-                    }
-                    if (item.rectificationImageUrls) {
-                        item.rectificationImageUrlsList = item.rectificationImageUrls.split(',').map(ele => {
-                            return website.minioUrl + ele
-                        })
-                    }
-                    // 查询问题类型
-                    this.questionTypeList.forEach(qItem => {
-                        qItem.children.forEach(qChild => {
-                            if (qChild.id == item.itemId) {
-                                item.qType = qItem.title
-                                item.itemsNameTitle = qChild.title
-                            }
+        getDetail (rowData) {
+            getTaskPlaceSelfCheckInfo({ taskId: rowData.taskId }).then(res => {
+                let row = res.data.data
+                if (row.taskPlaceRecordVOList) {
+                    row.taskPlaceRecordVOList.forEach(item => {
+                        item.imageUrlsList = []
+                        item.rectificationImageUrlsList = []
+                        if (item.imageUrls) {
+                            item.imageUrlsList = item.imageUrls.split(',').map(ele => {
+                                return website.minioUrl + ele
+                            })
+
+                        }
+                        if (item.rectificationImageUrls) {
+                            item.rectificationImageUrlsList = item.rectificationImageUrls.split(',').map(ele => {
+                                return website.minioUrl + ele
+                            })
+                        }
+                        // 查询问题类型
+                        this.questionTypeList.forEach(qItem => {
+                            qItem.children.forEach(qChild => {
+                                if (qChild.id == item.itemId) {
+                                    item.qType = qItem.title
+                                    item.itemsNameTitle = qChild.title
+                                }
+                            })
                         })
                     })
-                })
-            }
-            if (row.patrolRecordVOList) {
-                // 把相同类型问题分组
-                let obj = this.groupBy(row.patrolRecordVOList, 'qType')
-                let arr = Object.entries(obj)
-                let newArr = []
-                arr.forEach(part => {
-                    newArr.push({ questionName: part[0], questionList: part[1], isShowQList: true })
-                })
-                row.qTypeList = newArr
-            }
-            // 九小类型转换
-            row.nineTypeName = this.switchNineType(row.nineType)
-            this.rowDetail = row
-            this.isDetail = true
+                }
+                if (row.taskPlaceRecordVOList) {
+                    // 把相同类型问题分组
+                    let obj = this.groupBy(row.taskPlaceRecordVOList, 'qType')
+                    let arr = Object.entries(obj)
+                    let newArr = []
+                    arr.forEach(part => {
+                        newArr.push({ questionName: part[0], questionList: part[1], isShowQList: true })
+                    })
+                    row.qTypeList = newArr
+                }
+                // 九小类型转换
+                row.nineTypeName = this.switchNineType(row.nineType)
+                this.rowDetail = row
+                this.isDetail = true
+            })
+
         },
 
         handleExport () {

--
Gitblit v1.9.3