linwei
2024-02-05 a7b63a313cb26c3c8a959fa858eca086ac057710
Merge remote-tracking branch 'origin/master'
3 files modified
1369 ■■■■ changed files
src/api/publicSecurity/ninePlaceManage.js 27 ●●●●● patch | view | raw | blame | history
src/views/publicSecurity/ninePlaceManage/patrolRecord.vue 930 ●●●●● patch | view | raw | blame | history
src/views/publicSecurity/ninePlaceManage/situationRectification.vue 412 ●●●●● patch | view | raw | blame | history
src/api/publicSecurity/ninePlaceManage.js
@@ -34,3 +34,30 @@
        data
    })
}
// 问题类型字典
export const getPatrolGroupTree = (params) => {
    return request({
        url: "/api/patrol/patrolGroup/getPatrolGroupTree",
        method: "get",
        params
    })
}
// 九小类型字典
export const getDictBizTree = (params) => {
    return request({
        url: "/api/blade-system/dict-biz/tree",
        method: "get",
        params
    })
}
// 民警审核接口
export const applyRectification = (data) => {
    return request({
        url: "/api/blade-taskPlaceRectification/taskPlaceRectification/applyRectification",
        method: "post",
        data
    })
}
src/views/publicSecurity/ninePlaceManage/patrolRecord.vue
@@ -1,377 +1,641 @@
<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="46%" direction="rtl">
            <div class="title">
                <div class="icon">{{ refreshNum }}</div>
                基础信息
            </div>
            <div class="basic-info">
                <div class="info-item">
                    <div class="info-name">场所名称</div>
                    <div class="info-value">{{ rowDetail.placeName }}</div>
                </div>
                <div class="info-item">
                    <div class="info-name">场所类型</div>
                    <div class="info-value">{{ rowDetail.nineTypeName }}</div>
                </div>
                <div class="info-item">
                    <div class="info-name">检查人</div>
                    <div class="info-value">{{ rowDetail.name }}</div>
                </div>
                <div class="info-item">
                    <div class="info-name">检查时间</div>
                    <div class="info-value">{{ rowDetail.createTime }}</div>
                </div>
            </div>
            <div class="title">
                <div class="icon"></div>
                检查记录
            </div>
      <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>
            <div class="question-list" v-for="(tItem, tIndex) in rowDetail.qTypeList" :key='tIndex'>
                <div class="question-type" @click="flodQL(tIndex)">
                    <div class="type-name">
                        {{ CNNum[tIndex] }}、{{ tItem.questionName }}
                    </div>
                    <div class="icon-box"><i class="el-icon-arrow-down" v-show="tItem.isShowQList"></i><i
                            class="el-icon-arrow-up" v-show="!tItem.isShowQList"></i></div>
                </div>
                <div class="question-item" v-for="(item, index) in tItem.questionList" :key='index'
                    v-show="tItem.isShowQList">
                    <div class="question-name">
                        <div class="key">{{ index + 1 }}、{{ item.itemsName }}</div>
                        <div class="value"><el-radio v-model="radio" label="1" disabled>存在</el-radio>
                            <el-radio v-model="radio" label="2" disabled>不存在</el-radio>
                        </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-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 {
    addPd,
  } from "@/api/discuss/publicDiscuss"
import {
    getPatrolGroupTree, getDictBizTree
} from "@/api/publicSecurity/ninePlaceManage"
  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: [],
            refreshNum: 1,
            radio: '1',
            questionTypeList: [],
            CNNum: ['一', '二', '三', '四', '五', '六', '七', '八', '九', '十', '十一', '十二', '十三', '十四', '十五'],
            nineTypeList: []
        }
    },
    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),
            }
        },
    },
    created () {
        this.getPatrolGroupTree()
        this.getDictBizTree()
    },
    methods: {
        // 点击展开收缩
        flodQL (index) {
            this.rowDetail.qTypeList[index].isShowQList = !this.rowDetail.qTypeList[index].isShowQList
            this.refreshNum += 1
        },
      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: "操作成功!",
        // 对数组按属性分组
        groupBy (arr, key) {
            return arr.reduce((acc, curr) => {
                (acc[curr[key]] = acc[curr[key]] || []).push(curr)
                return acc
            }, {})
        },
        // 九小类型字典接口
        getDictBizTree () {
            getDictBizTree({ code: 'nineType' }).then(res => {
                this.nineTypeList = res.data.data
            })
            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: "操作成功!",
        },
        // 九小类型转换
        switchNineType (type) {
            return this.nineTypeList.find(item => item.key === type).title
        },
        // 获取问题类型
        getPatrolGroupTree () {
            getPatrolGroupTree().then(res => {
                this.questionTypeList = res.data.data
            })
        },
        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
                        })
                    }
                    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
                            }
                        })
                    })
                })
            }
            // 把相同类型问题分组
            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
        },
        searchReset () {
            this.query = {}
            this.onLoad(this.page)
        },
        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 {
<style lang="scss" scoped>
.avue-upload__icon {
    line-height: 6;
  }
}
:deep(.el-drawer__header) {
    margin-bottom: 10px;
}
:deep(.el-radio__input.is-disabled+span.el-radio__label) {
    color: #000;
}
:deep(.el-radio__input.is-checked+.el-radio__label) {
    color: #409EFF !important;
}
:deep(.el-radio__input.is-checked .el-radio__inner::after) {
    background-color: #FFF;
}
:deep(.el-radio__input.is-checked .el-radio__inner) {
    background-color: #409EFF;
}
.title {
    margin: 10px;
    height: 40px;
    background-color: #eee;
    display: flex;
    align-items: center;
    .icon {
        width: 4px;
        height: 18px;
        background-color: #409dfe;
        margin: 0 10px;
        color: transparent;
    }
}
.basic-info {
    padding: 0 20px;
    .info-item {
        display: flex;
        padding: 10px;
        .info-name {
            width: 100px;
            display: flex;
            align-items: center;
        }
        .info-value {
            display: flex;
            align-items: center;
        }
    }
}
.question-list {
    padding: 0 20px;
    .question-type {
        height: 60px;
        display: flex;
        align-items: center;
        cursor: pointer;
        justify-content: space-between;
        padding-right: 20px;
        .type-name {}
        .icon-box {}
    }
    .question-item {
        margin-bottom: 20px;
        padding: 10px;
        background: #f5f7fa;
        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>
src/views/publicSecurity/ninePlaceManage/situationRectification.vue
@@ -6,10 +6,124 @@
            @selection-change="selectionChange" @current-change="currentChange" @size-change="sizeChange"
            @refresh-change="refreshChange" @on-load="onLoad">
            <template slot="menuLeft">
                <div class="tab-list">
                    <div :class="{ 'choose': typeStatus == 3 }" @click="changeType(3)">全部</div>
                    <div :class="{ 'choose': typeStatus == 1 }" @click="changeType(1)">待审核</div>
                    <div :class="{ 'choose': typeStatus == 2 }" @click="changeType(2)">已审核</div>
                </div>
                <el-button type="warning" size="small" plain icon="el-icon-download" @click="handleExport">导出
                </el-button>
            </template>
            <template slot-scope="{type,size,row }" slot="menu">
                <el-button icon="el-icon-detail" :size="size" :type="type" @click.stop="getDetail(row)">
                    详情
                </el-button>
                <el-button icon="el-icon-detail" :size="size" :type="type" @click.stop="goAudit(row)"
                    v-show="row.status == 1">审核</el-button>
            </template>
        </avue-crud>
        <el-drawer title="整改情况详情" :visible.sync="isDetail" :append-to-body="true" size="46%" direction="rtl">
            <div class="title">
                <div class="icon">{{ refreshNum }}</div>
                基础信息
            </div>
            <div class="basic-info">
                <div class="info-item">
                    <div class="info-name">场所名称</div>
                    <div class="info-value">{{ rowDetail.placeName }}</div>
                </div>
                <div class="info-item">
                    <div class="info-name">场所类型</div>
                    <div class="info-value">{{ rowDetail.$nineType }}</div>
                </div>
                <div class="info-item">
                    <div class="info-name">检查人</div>
                    <div class="info-value">{{ rowDetail.name }}</div>
                </div>
                <div class="info-item">
                    <div class="info-name">检查时间</div>
                    <div class="info-value">{{ rowDetail.createTime }}</div>
                </div>
            </div>
            <div class="title">
                <div class="icon"></div>
                检查记录
            </div>
            <div class="question-list" v-for="(tItem, tIndex) in rowDetail.qTypeList" :key='tIndex'>
                <div class="question-type" @click="flodQL(tIndex)">
                    <div class="type-name">
                        {{ CNNum[tIndex] }}、{{ tItem.questionName }}
                    </div>
                    <div class="icon-box"><i class="el-icon-arrow-down" v-show="tItem.isShowQList"></i><i
                            class="el-icon-arrow-up" v-show="!tItem.isShowQList"></i></div>
                </div>
                <div class="question-item" v-for="(item, index) in tItem.questionList" :key='index'
                    v-show="tItem.isShowQList">
                    <div class="question-name">
                        <div class="key">{{ index + 1 }}、{{ item.itemsName }}</div>
                        <div class="value"><el-radio v-model="radio" label="1" disabled>存在</el-radio>
                            <el-radio v-model="radio" label="2" disabled>不存在</el-radio>
                        </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-dialog :visible.sync="visible" append-to-body destroy-on-close title="审核" width="30%"
            custom-class="flow-design-dialog" :before-close="handleClose">
            <el-form ref="auditForm" :model="auditForm" :rules="auditRules">
                <el-form-item label="审核结论:" prop="status">
                    <el-radio-group v-model="auditForm.status">
                        <el-radio :label="2">通过</el-radio>
                        <el-radio :label="3">不通过</el-radio>
                    </el-radio-group>
                </el-form-item>
                <el-form-item label="不通过原因:" prop="reasonFailure" v-if="auditForm.status == 3">
                    <el-input type="textarea" v-model="auditForm.reasonFailure"></el-input>
                </el-form-item>
            </el-form>
            <div style="display:flex;justify-content:center">
                <el-button @click="submitAudit" size="small" type="primary">保 存</el-button>
                <el-button @click="cancelAudit" size="small">取 消</el-button>
            </div>
        </el-dialog>
    </basic-container>
</template>
@@ -18,7 +132,7 @@
    mapGetters
} from "vuex"
import {
    getZGQKList
    getZGQKList, getPatrolGroupTree, applyRectification
} from "@/api/publicSecurity/ninePlaceManage"
import NProgress from 'nprogress'
import 'nprogress/nprogress.css'
@@ -35,10 +149,20 @@
import {
    dateNow
} from "@/util/date"
import website from '@/config/website'
export default {
    data () {
        return {
            auditRules: {
                status: [{ required: true, message: "必填" }],
                reasonFailure: [{ required: true, message: "必填" }],
            },
            auditForm: {},
            visible: false,
            typeStatus: 1,
            isDetail: false,
            rowDetail: [],
            form: {},
            query: {},
            loading: true,
@@ -57,7 +181,7 @@
                tip: false,
                searchShow: true,
                searchMenuSpan: 3,
                menu: false,
                menu: true,
                border: true,
                index: true,
                editBtn: false,
@@ -150,7 +274,11 @@
                    searchLabelWidth: 106,
                }],
            },
            data: []
            data: [],
            refreshNum: 1,
            radio: '1',
            questionTypeList: [],
            CNNum: ['一', '二', '三', '四', '五', '六', '七', '八', '九', '十', '十一', '十二', '十三', '十四', '十五']
        }
    },
@@ -173,7 +301,113 @@
        },
    },
    created () {
        this.getPatrolGroupTree()
    },
    methods: {
        // 弹窗关闭回调
        handleClose () {
            this.cancelAudit()
        },
        // 取消审核
        cancelAudit () {
            this.visible = false
            this.auditForm = {}
            this.$refs.auditForm.resetFields()
        },
        // 确认提交审核
        submitAudit () {
            this.$refs.auditForm.validate((valid) => {
                if (valid) {
                    applyRectification(Object.assign(this.auditParams, this.auditForm)).then(res => {
                        if (res.data.code == 200) {
                            this.$message.warning("审核成功")
                            this.onLoad(this.page)
                            this.cancelAudit()
                        }
                    })
                } else {
                    return false
                }
            })
        },
        // 审核按钮
        goAudit (row) {
            this.auditParams = {
                id: row.id,
                taskId: row.taskId
            }
            this.visible = true
        },
        flodQL (index) {
            this.rowDetail.qTypeList[index].isShowQList = !this.rowDetail.qTypeList[index].isShowQList
            this.refreshNum += 1
        },
        // 对数组按属性分组
        groupBy (arr, key) {
            return arr.reduce((acc, curr) => {
                (acc[curr[key]] = acc[curr[key]] || []).push(curr)
                return acc
            }, {})
        },
        // 获取问题类型
        getPatrolGroupTree () {
            getPatrolGroupTree().then(res => {
                this.questionTypeList = res.data.data
            })
        },
        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
                        })
                    }
                    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
                            }
                        })
                    })
                })
            }
            // 把相同类型问题分组
            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
            this.rowDetail = row
            this.isDetail = true
        },
        changeType (type) {
            this.typeStatus = type
            this.onLoad(this.page)
        },
        handleExport () {
            this.$confirm("是否导出整改情况数据?", "提示", {
                confirmButtonText: "确定",
@@ -188,7 +422,6 @@
                exportBlob(
                    `/api/blade-taskPlaceRectification/taskPlaceRectification/exportRectificationStatistics?${this.website.tokenHeader}=${getToken()}&` + data
                ).then(res => {
                    console.log('exportBlob', res)
                    downloadXls(res.data, `整改情况${dateNow()}.xlsx`)
                    NProgress.done()
                })
@@ -359,6 +592,11 @@
        onLoad (page, params = {}) {
            this.loading = true
            if (this.typeStatus == 3) {
                this.query.status = ''
            } else {
                this.query.status = this.typeStatus
            }
            getZGQKList(page.currentPage, page.pageSize, Object.assign(params, this.query)).then(res => {
                console.log('getZGQKList', res.data.data)
                const data = res.data.data
@@ -380,4 +618,170 @@
.avue-upload__icon {
    line-height: 6;
}
.tab-list {
    display: flex;
    margin-right: 6px;
    border: 1px solid #dcdfe6;
    color: #606266;
    border-radius: 4px;
    height: 34px;
    &>div {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 60px;
        cursor: pointer;
        font-size: 12px;
    }
    &>div:nth-child(2) {
        border-left: 1px solid #dcdfe6;
        border-right: 1px solid #dcdfe6;
    }
    .choose {
        color: #FFF;
        background-color: #409dfe;
    }
}
:deep(.avue-crud__left) {
    display: flex;
    align-items: center;
}
:deep(.el-drawer__header) {
    margin-bottom: 10px;
}
:deep(.el-radio__input.is-disabled+span.el-radio__label) {
    color: #000;
}
:deep(.el-radio__input.is-checked+.el-radio__label) {
    color: #409EFF !important;
}
:deep(.el-radio__input.is-checked .el-radio__inner::after) {
    background-color: #FFF;
}
:deep(.el-radio__input.is-checked .el-radio__inner) {
    background-color: #409EFF;
}
.title {
    margin: 10px;
    height: 40px;
    background-color: #eee;
    display: flex;
    align-items: center;
    .icon {
        width: 4px;
        height: 18px;
        background-color: #409dfe;
        margin: 0 10px;
        color: transparent;
    }
}
.basic-info {
    padding: 0 20px;
    .info-item {
        display: flex;
        padding: 10px;
        .info-name {
            width: 100px;
            display: flex;
            align-items: center;
        }
        .info-value {
            display: flex;
            align-items: center;
        }
    }
}
.question-list {
    padding: 0 20px;
    .question-type {
        height: 60px;
        display: flex;
        align-items: center;
        cursor: pointer;
        justify-content: space-between;
        padding-right: 20px;
        .type-name {}
        .icon-box {}
    }
    .question-item {
        margin-bottom: 20px;
        padding: 10px;
        background: #f5f7fa;
        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>