From 4de7f9af0fad2a90ba8cbe3e133fe6d5e261ed36 Mon Sep 17 00:00:00 2001
From: guanqb <18720758508@163.com>
Date: Sun, 04 Feb 2024 11:48:00 +0800
Subject: [PATCH] 场所检查

---
 src/views/publicSecurity/ninePlaceManage/patrolRecord.vue |  760 ++++++++++++++++++++++++++++++++-------------------------
 1 files changed, 428 insertions(+), 332 deletions(-)

diff --git a/src/views/publicSecurity/ninePlaceManage/patrolRecord.vue b/src/views/publicSecurity/ninePlaceManage/patrolRecord.vue
index 6cdee2b..1a5ce18 100644
--- a/src/views/publicSecurity/ninePlaceManage/patrolRecord.vue
+++ b/src/views/publicSecurity/ninePlaceManage/patrolRecord.vue
@@ -1,377 +1,473 @@
 <template>
-  <basic-container>
-    <avue-crud :option="option" :table-loading="loading" :data="data" :page.sync="page" ref="crud" @row-del="rowDel"
-      v-model="form" :permission="permissionList" @row-update="rowUpdate" @row-save="rowSave" :before-open="beforeOpen"
-      @search-change="searchChange" @search-reset="searchReset" @selection-change="selectionChange"
-      @current-change="currentChange" @size-change="sizeChange" @refresh-change="refreshChange" @on-load="onLoad">
-      <template slot-scope="{type,size,row }" slot="menu">
-        <el-button icon="el-icon-detail" :size="size" :type="type" @click.stop="getDetail(row)">
-          详情
-        </el-button>
-      </template>
-    </avue-crud>
+    <basic-container>
+        <avue-crud :option="option" :table-loading="loading" :data="data" :page.sync="page" ref="crud" @row-del="rowDel"
+            v-model="form" :permission="permissionList" @row-update="rowUpdate" @row-save="rowSave"
+            :before-open="beforeOpen" @search-change="searchChange" @search-reset="searchReset"
+            @selection-change="selectionChange" @current-change="currentChange" @size-change="sizeChange"
+            @refresh-change="refreshChange" @on-load="onLoad">
+            <template slot-scope="{type,size,row }" slot="menu">
+                <el-button icon="el-icon-detail" :size="size" :type="type" @click.stop="getDetail(row)">
+                    详情
+                </el-button>
+            </template>
+        </avue-crud>
 
 
-    <el-drawer title="巡查详情" :visible.sync="isDetail" :append-to-body="true" size="60%" direction="rtl">
+        <el-drawer title="巡查详情" :visible.sync="isDetail" :append-to-body="true" size="60%" direction="rtl">
+            <div class="question-list">
+                <div class="question-item" v-for="(item, index) in rowDetail" :key='index'>
+                    <div class="question-name">
+                        <div class="key">{{ index + 1 }}、{{ item.itemsName }}</div>
+                        <div class="value">存在</div>
+                    </div>
+                    <div class="yh-pic-box">
+                        <div class="yh-pic-name">
+                            隐患图片
+                        </div>
+                        <div class="yh-pic-list">
+                            <div class="pic-item" v-for="pic in item.imageUrlsList">
+                                <el-image style="width: 100px; height: 100px" :src="pic" :fit="fit"></el-image>
+                            </div>
+                        </div>
+                    </div>
+                    <div class="yh-remark">
+                        <div class="yh-remark-name">
+                            隐患描述
+                        </div>
+                        <div class="yh-remark-value">
+                            {{ item.remark }}
+                        </div>
+                    </div>
+                    <div class="yh-pic-box">
+                        <div class="yh-pic-name">
+                            整改后图片
+                        </div>
+                        <div class="yh-pic-list">
+                            <div class="pic-item" v-for="pic in item.rectificationImageUrlsList">
+                                <el-image style="width: 100px; height: 100px" :src="pic" :fit="fit"></el-image>
+                            </div>
+                        </div>
+                    </div>
+                    <div class="yh-remark">
+                        <div class="yh-remark-name">
+                            整改后描述
+                        </div>
+                        <div class="yh-remark-value">
+                            {{ item.rectificationRemark }}
+                        </div>
+                    </div>
+                </div>
+            </div>
+        </el-drawer>
 
-      <el-card class="trackClass" style="overflow-y: auto">
-        <el-form :model="form" label-position="right" size="mini" class="taskinfoForm" label-width="70px">
-          <el-row>
-            <el-col :span="24">
-              <el-form-item label="巡检状态">
-                <el-input :disabled="true" v-model="form.$status" autocomplete="off"></el-input>
-              </el-form-item>
-            </el-col>
-          </el-row>
-          <el-row>
-            <el-col :span="24">
-              <el-form-item label="巡查内容">
-                <el-input :disabled="true" v-model="form.content" autocomplete="off"></el-input>
-              </el-form-item>
-            </el-col>
-          </el-row>
-          <el-row>
-            <el-col :span="24">
-              <el-form-item label="巡查图片">
-                <el-upload action="" :disabled="true" list-type="picture-card" :file-list="form.elUploadImageArr">
-                </el-upload>
-              </el-form-item>
-
-            </el-col>
-          </el-row>
-        </el-form>
-      </el-card>
-
-      <!-- <DcMap v-if="isDetail" :is-detail="isDetail" :range="form.taskRoute" :patrolRoute="form.patrolRoute">
-      </DcMap> -->
-
-    </el-drawer>
-
-  </basic-container>
+    </basic-container>
 </template>
 
 <script>
-  import {
+import {
     getList,
     remove,
     update,
     add,
     getNotice,
     upcomment
-  } from "@/api/patrol/placeChek"
+} from "@/api/patrol/placeChek"
 
-  import {
+import {
     addPd,
-  } from "@/api/discuss/publicDiscuss"
+} from "@/api/discuss/publicDiscuss"
 
-  import website from '@/config/website'
+import website from '@/config/website'
 
 
-  import {
+import {
     getDistrictTree
-  } from "@/api/district/index"
+} from "@/api/district/index"
 
-  import {
+import {
     mapGetters
-  } from "vuex"
+} from "vuex"
 
-  export default {
-    data() {
-      return {
-        isDetail: false,
-        form: {},
-        query: {},
-        loading: true,
-        page: {
-          pageSize: 10,
-          currentPage: 1,
-          total: 0,
-        },
-        datetime: "",
-        selectionList: [],
-        option: {
-          labelWidth: 120,
-          searchLabelWidth: 96,
-          searchShow: true,
-          searchMenuSpan: 3,
-          // menuWidth: 450,
-          // menu: false,
-          height: "auto",
-          calcHeight: 54,
-          dialogWidth: 950,
-          tip: false,
-          border: true,
-          addBtn: false,
-          delBtn: false,
-          //stripe:true,
-          index: true,
-          editBtn: false,
-          viewBtn: false,
-          // selection: true,
-          excelBtn: true,
-          dialogClickModal: false,
-          column: [{
-              label: "所属街道",
-              prop: "streetName",
-              span: 24,
-              row: true,
-              searchSpan: 4,
-              search: true,
+export default {
+    data () {
+        return {
+            isDetail: false,
+            form: {},
+            query: {},
+            loading: true,
+            page: {
+                pageSize: 10,
+                currentPage: 1,
+                total: 0,
             },
-            {
-              label: "所属社区",
-              prop: "communityName",
-              span: 24,
-              row: true,
-              searchSpan: 4,
-              search: true,
-            },
-            {
-              label: "所属网格",
-              prop: "gridName",
-              span: 24,
-              row: true,
-              searchSpan: 4,
-              search: true,
-            },
-            {
-              label: "场所名称",
-              prop: "placeName",
-              span: 24,
-              row: true,
-              searchSpan: 4,
-              search: true,
-            },
-            {
-              label: "场所隐患",
-              prop: "remark",
-              span: 24,
-              row: true,
-              searchSpan: 4,
-            },
+            datetime: "",
+            selectionList: [],
+            option: {
+                labelWidth: 120,
+                searchLabelWidth: 96,
+                searchShow: true,
+                searchMenuSpan: 3,
+                // menuWidth: 450,
+                // menu: false,
+                height: "auto",
+                calcHeight: 54,
+                dialogWidth: 950,
+                tip: false,
+                border: true,
+                addBtn: false,
+                delBtn: false,
+                //stripe:true,
+                index: true,
+                editBtn: false,
+                viewBtn: false,
+                // selection: true,
+                excelBtn: true,
+                dialogClickModal: false,
+                column: [{
+                    label: "所属街道",
+                    prop: "streetName",
+                    span: 24,
+                    row: true,
+                    searchSpan: 4,
+                    search: true,
+                },
+                {
+                    label: "所属社区",
+                    prop: "communityName",
+                    span: 24,
+                    row: true,
+                    searchSpan: 4,
+                    search: true,
+                },
+                {
+                    label: "所属网格",
+                    prop: "gridName",
+                    span: 24,
+                    row: true,
+                    searchSpan: 4,
+                    search: true,
+                },
+                {
+                    label: "场所名称",
+                    prop: "placeName",
+                    span: 24,
+                    row: true,
+                    searchSpan: 4,
+                    search: true,
+                },
+                {
+                    label: "场所隐患",
+                    prop: "remark",
+                    span: 24,
+                    row: true,
+                    searchSpan: 4,
+                },
 
-            {
-              label: "场所负责人",
-              prop: "principal",
-              span: 24,
-              row: true,
-              searchSpan: 4,
-              search: true,
-            },
+                {
+                    label: "场所负责人",
+                    prop: "principal",
+                    span: 24,
+                    row: true,
+                    searchSpan: 4,
+                    search: true,
+                },
 
-            {
-              label: "场所负责人电话",
-              prop: "principalPhone",
-              span: 24,
-              row: true,
-              searchSpan: 4,
+                {
+                    label: "场所负责人电话",
+                    prop: "principalPhone",
+                    span: 24,
+                    row: true,
+                    searchSpan: 4,
+                },
+                {
+                    label: "场所地址",
+                    prop: "location",
+                    span: 24,
+                    row: true,
+                    searchSpan: 4,
+                    searchLabelWidth: 46,
+                },
+                {
+                    width: 110,
+                    label: "签名",
+                    prop: "signaturePath",
+                    type: "upload",
+                    listType: "picture-img",
+                    span: 24,
+                },
+                {
+                    label: "创建时间",
+                    prop: "createTime",
+                    span: 24,
+                    row: true,
+                    searchSpan: 4,
+                    searchLabelWidth: 46,
+                },
+                ],
             },
-            {
-              label: "场所地址",
-              prop: "location",
-              span: 24,
-              row: true,
-              searchSpan: 4,
-              searchLabelWidth: 46,
-            },
-            {
-              width: 110,
-              label: "签名",
-              prop: "signaturePath",
-              type: "upload",
-              listType: "picture-img",
-              span: 24,
-            },
-            {
-              label: "创建时间",
-              prop: "createTime",
-              span: 24,
-              row: true,
-              searchSpan: 4,
-              searchLabelWidth: 46,
-            },
-          ],
-        },
-        data: [],
+            data: [],
 
-        districtTree: [],
-      }
+            districtTree: [],
+            rowDetail: []
+        }
     },
     watch: {
-      "form.articleType": {
-        handler(val) {
-          if (val) {
-            var videoUrl = this.findObject(this.option.column, "videoUrl")
-            var content = this.findObject(this.option.column, "content")
-            if (val.indexOf('ksp') != -1) {
-              videoUrl.display = true
-              content.display = false
-              videoUrl.rules = [{
-                required: false,
-                message: "请选择视频",
-                trigger: "blur",
-              }, ]
-            } else {
-              videoUrl.display = false
-              content.display = true
-              videoUrl.rules = ""
-            }
-          }
-        },
-        immediate: true,
-      }
+        "form.articleType": {
+            handler (val) {
+                if (val) {
+                    var videoUrl = this.findObject(this.option.column, "videoUrl")
+                    var content = this.findObject(this.option.column, "content")
+                    if (val.indexOf('ksp') != -1) {
+                        videoUrl.display = true
+                        content.display = false
+                        videoUrl.rules = [{
+                            required: false,
+                            message: "请选择视频",
+                            trigger: "blur",
+                        },]
+                    } else {
+                        videoUrl.display = false
+                        content.display = true
+                        videoUrl.rules = ""
+                    }
+                }
+            },
+            immediate: true,
+        }
     },
     computed: {
-      ...mapGetters(["permission", "userInfo"]),
-      permissionList() {
-        return {
-          addBtn: this.vaildData(this.permission.article_add, true),
-          viewBtn: this.vaildData(this.permission.article_view, true),
-          delBtn: this.vaildData(this.permission.article_delete, true),
-          editBtn: this.vaildData(this.permission.article_edit, true),
-        }
-      },
+        ...mapGetters(["permission", "userInfo"]),
+        permissionList () {
+            return {
+                addBtn: this.vaildData(this.permission.article_add, true),
+                viewBtn: this.vaildData(this.permission.article_view, true),
+                delBtn: this.vaildData(this.permission.article_delete, true),
+                editBtn: this.vaildData(this.permission.article_edit, true),
+            }
+        },
 
     },
     methods: {
+        getDetail (row) {
+            console.log('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
+                        })
 
-      getDetail(row) {
-        this.isDetail = true
-      },
-      searchReset() {
-        this.query = {}
-        this.onLoad(this.page)
-      },
-      searchChange(params, done) {
-        this.query = params
-        this.page.currentPage = 1
-        this.onLoad(this.page, params)
-        done()
-      },
-      selectionChange(list) {
-        this.selectionList = list
-      },
-      selectionClear() {
-        this.selectionList = []
-        this.$refs.crud.toggleSelection()
-      },
-      handleDelete() {
-        if (this.selectionList.length === 0) {
-          this.$message.warning("请选择至少一条数据")
-          return
-        }
-        this.$confirm("确定将选择数据删除?", {
-            confirmButtonText: "确定",
-            cancelButtonText: "取消",
-            type: "warning",
-          })
-          .then(() => {
-            return remove(this.ids)
-          })
-          .then(() => {
-            this.onLoad(this.page)
-            this.$message({
-              type: "success",
-              message: "操作成功!",
-            })
-            this.$refs.crud.toggleSelection()
-          })
-      },
-      beforeOpen(done, type) {
-        if (["edit", "view"].includes(type)) {
-          getNotice(this.form.id).then((res) => {
-            let data = res.data.data
-            // data.forEach(item=>{
-            if (data.url.length > 0) {
-              var urls = []
-              var names = data.url.split(",")
-              names.forEach(name => {
-                urls.push(website.minioUrl + name)
-              })
-              data.url = urls.join(",")
+                    }
+                    if (item.rectificationImageUrls) {
+                        item.rectificationImageUrlsList = item.rectificationImageUrls.split(',').map(ele => {
+                            return website.minioUrl + ele
+                        })
+                    }
+                })
             }
-            data.articleList = JSON.parse(data.articleRange)
-            this.form = data
-          })
-        }
-        // con
-        done()
-      },
-      currentChange(currentPage) {
-        this.page.currentPage = currentPage
-      },
-      sizeChange(pageSize) {
-        this.page.pageSize = pageSize
-      },
-      refreshChange() {
-        this.onLoad(this.page, this.query)
-      },
-      onLoad(page, params = {}) {
-        this.loading = true
-        getList(page.currentPage, page.pageSize, Object.assign(params, this.query)).then((res) => {
-          const data = res.data.data
-          this.page.total = data.total
-          this.data = data.records
-          this.data.forEach(item => {
-            if (item.signaturePath.length > 0) {
-              var urls = []
-              var names = item.signaturePath.split(",")
-              names.forEach(name => {
-                urls.push(website.minioUrl + name)
-              })
-              item.signaturePath = urls.join(",")
-            }
-          })
-          this.loading = false
-          this.selectionClear()
-        })
-        getDistrictTree({
-          filterFlag: 1
-        }).then((res) => {
-          const data = res.data.data
-          this.districtTree = data
-          const column = this.findObject(this.option.column, "articleList")
-          column.dicData = res.data.data
-          this.loading = false
-        })
-      },
-      updateFb(row) {
-        if (row.publish == "0") {
-          row.publish = "1"
-        } else {
-          row.publish = "0"
-        }
-        if (row.url.length > 0) {
-          var urls = []
-          var split = row.url.split(",")
-          split.forEach(url => {
-            var names = url.split("jczz/")
-            urls.push(names[1])
-          })
-          row.url = urls.join(",")
-        }
-        update(row).then(
-          () => {
+            this.rowDetail = row.patrolRecordVOList
+            this.isDetail = true
+        },
+        searchReset () {
+            this.query = {}
             this.onLoad(this.page)
-            this.$message({
-              type: "success",
-              message: "操作成功!",
-            })
+        },
+        searchChange (params, done) {
+            this.query = params
+            this.page.currentPage = 1
+            this.onLoad(this.page, params)
             done()
-          },
-          (error) => {
-            window.console.log(error)
-            loading()
-          }
-        )
-      },
+        },
+        selectionChange (list) {
+            this.selectionList = list
+        },
+        selectionClear () {
+            this.selectionList = []
+            this.$refs.crud.toggleSelection()
+        },
+        handleDelete () {
+            if (this.selectionList.length === 0) {
+                this.$message.warning("请选择至少一条数据")
+                return
+            }
+            this.$confirm("确定将选择数据删除?", {
+                confirmButtonText: "确定",
+                cancelButtonText: "取消",
+                type: "warning",
+            })
+                .then(() => {
+                    return remove(this.ids)
+                })
+                .then(() => {
+                    this.onLoad(this.page)
+                    this.$message({
+                        type: "success",
+                        message: "操作成功!",
+                    })
+                    this.$refs.crud.toggleSelection()
+                })
+        },
+        beforeOpen (done, type) {
+            if (["edit", "view"].includes(type)) {
+                getNotice(this.form.id).then((res) => {
+                    let data = res.data.data
+                    // data.forEach(item=>{
+                    if (data.url.length > 0) {
+                        var urls = []
+                        var names = data.url.split(",")
+                        names.forEach(name => {
+                            urls.push(website.minioUrl + name)
+                        })
+                        data.url = urls.join(",")
+                    }
+                    data.articleList = JSON.parse(data.articleRange)
+                    this.form = data
+                })
+            }
+            // con
+            done()
+        },
+        currentChange (currentPage) {
+            this.page.currentPage = currentPage
+        },
+        sizeChange (pageSize) {
+            this.page.pageSize = pageSize
+        },
+        refreshChange () {
+            this.onLoad(this.page, this.query)
+        },
+        onLoad (page, params = {}) {
+            this.loading = true
+            getList(page.currentPage, page.pageSize, Object.assign(params, this.query)).then((res) => {
+                const data = res.data.data
+                this.page.total = data.total
+                this.data = data.records
+                this.data.forEach(item => {
+                    if (item.signaturePath.length > 0) {
+                        var urls = []
+                        var names = item.signaturePath.split(",")
+                        names.forEach(name => {
+                            urls.push(website.minioUrl + name)
+                        })
+                        item.signaturePath = urls.join(",")
+                    }
+                })
+                this.loading = false
+                this.selectionClear()
+            })
+            getDistrictTree({
+                filterFlag: 1
+            }).then((res) => {
+                const data = res.data.data
+                this.districtTree = data
+                const column = this.findObject(this.option.column, "articleList")
+                column.dicData = res.data.data
+                this.loading = false
+            })
+        },
+        updateFb (row) {
+            if (row.publish == "0") {
+                row.publish = "1"
+            } else {
+                row.publish = "0"
+            }
+            if (row.url.length > 0) {
+                var urls = []
+                var split = row.url.split(",")
+                split.forEach(url => {
+                    var names = url.split("jczz/")
+                    urls.push(names[1])
+                })
+                row.url = urls.join(",")
+            }
+            update(row).then(
+                () => {
+                    this.onLoad(this.page)
+                    this.$message({
+                        type: "success",
+                        message: "操作成功!",
+                    })
+                    done()
+                },
+                (error) => {
+                    window.console.log(error)
+                    loading()
+                }
+            )
+        },
 
     },
-  }
+}
 </script>
 
 <style>
-  .avue-upload__icon {
+.avue-upload__icon {
     line-height: 6;
-  }
+}
+
+.question-list {
+    padding: 0 20px;
+
+    .question-item {
+        margin-bottom: 20px;
+        padding: 10px;
+        background: #eee;
+        border-radius: 8px;
+
+        &>div {
+            margin: 14px 0;
+        }
+
+        .question-name {
+            display: flex;
+
+            .key {
+                width: 80%;
+                word-break: break-all;
+            }
+
+            .value {
+                width: 20%;
+                display: flex;
+                align-items: center;
+                justify-content: center;
+            }
+        }
+
+        .yh-pic-box {
+            display: flex;
+            height: 100px;
+
+            .yh-pic-name {
+                width: 100px;
+                display: flex;
+                align-items: center;
+                justify-content: left;
+            }
+
+            .yh-pic-list {
+                width: 0;
+                flex: 1;
+                display: flex;
+            }
+        }
+
+        .yh-remark {
+            display: flex;
+
+            .yh-remark-name {
+                width: 100px;
+                display: flex;
+                align-items: center;
+                justify-content: left;
+            }
+
+            .yh-remark-value {
+                word-break: break-all;
+            }
+        }
+    }
+}
 </style>
\ No newline at end of file

--
Gitblit v1.9.3