From 5e2aafeede13d337380f736567caf74f49713be7 Mon Sep 17 00:00:00 2001
From: linwe <872216996@qq.com>
Date: Fri, 09 Aug 2024 14:38:32 +0800
Subject: [PATCH] 代码优化
---
src/views/publicSecurity/noExplosionManage.vue | 275 ++++++++++++++++++++++++++++++++++++++-----------------
1 files changed, 190 insertions(+), 85 deletions(-)
diff --git a/src/views/publicSecurity/noExplosionManage.vue b/src/views/publicSecurity/noExplosionManage.vue
index 9502dda..9857a15 100644
--- a/src/views/publicSecurity/noExplosionManage.vue
+++ b/src/views/publicSecurity/noExplosionManage.vue
@@ -40,9 +40,16 @@
<el-dialog :visible.sync="visible" append-to-body destroy-on-close title="审核" width="30%"
custom-class="flow-design-dialog" :before-close="handleClose">
- <audit-base @handleSubmit="submitAudit"></audit-base>
+ <audit-base ref="auditBase" @handleSubmit="submitAudit"></audit-base>
</el-dialog>
- <el-drawer title="无诈详情" :visible.sync="isDetail" :append-to-body="true" size="40%" direction="rtl">
+
+ <el-dialog :visible.sync="visibleWord" append-to-body destroy-on-close title="审核" width="50%"
+ custom-class="flow-design-dialog" :before-close="handleCloseWord">
+ <word ref="word"></word>
+ </el-dialog>
+
+
+ <el-drawer title="无诈申请" :visible.sync="isDetail" :append-to-body="true" size="40%" direction="rtl">
<div class="title">
<div class="icon">{{ refreshNum }}</div>
基础信息
@@ -52,22 +59,31 @@
<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.noExplosionCategoryName }}</div>
- </div> -->
<div class="info-item">
- <div class="info-name">检查人</div>
+ <div class="info-name">场所标准地址</div>
+ <div class="info-value">{{ rowDetail.addressName }}</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-name">上报时间</div>
<div class="info-value">{{ rowDetail.createTime }}</div>
+ </div>
+ <div class="info-item">
+ <div class="info-name">门牌二维码</div>
+ <div class="info-value">
+ <!-- <img style="width: 60px;height: 60px;" :src="rowDetail.qrImg" alt="" /> -->
+ <el-image v-if="rowDetail.qrImg" style="width: 60px; height: 60px" :src="rowDetail.qrImg"
+ @click="loockImag(rowDetail.qrImg)" :preview-src-list="srcList">
+ </el-image>
+ </div>
</div>
</div>
<div class="title">
<div class="icon"></div>
- 检查记录
+ 上报记录
</div>
<div class="question-list" v-for="(tItem, tIndex) in rowDetail.qTypeList" :key='tIndex' v-loading="drawerLoading">
@@ -87,12 +103,23 @@
</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 v-if="type === 1" class="pic-item" v-for="pic in item.imageUrlsList">
+ <el-image style="width: 100px; height: 100px" :src="pic" :fit="fit"
+ :preview-src-list="item.imageUrlsList"></el-image>
</div>
+
+ <div v-if="type === 2" style="line-height: 100px;" v-for="pic in item.imageUrlsList">
+ <el-button @click="lookFile(item.imageUrls)" type="primary">查看附件</el-button>
+ </div>
+
+ <div v-if="type === 2" style="line-height: 100px;" v-for="pic in item.imageUrlsList">
+ <el-button @click="downloadFile(item.imageUrls)" type="primary">下载附件</el-button>
+ </div>
+
</div>
</div>
</div>
@@ -110,6 +137,8 @@
applyTaskExamine
} from "@/api/task/task"
+ import auditBase from './components/auditBase'
+ import word from '../../components/offce/word'
import {
mapGetters
} from "vuex"
@@ -143,21 +172,22 @@
export default {
data() {
//手机号格式校验
- let validatorPhone = function(rule, value, callback) {
- if (value) {
- if (!/^1[3456789]\d{9}$/.test(value)) {
- callback(new Error('手机号格式有误!'))
- } else {
- callback()
- }
- }
- callback()
- }
+ // let validatorPhone = function(rule, value, callback) {
+ // if (value) {
+ // if (!/^1[3456789]\d{9}$/.test(value)) {
+ // callback(new Error('手机号格式有误!'))
+ // } else {
+ // callback()
+ // }
+ // }
+ // callback()
+ // }
return {
isDetail: false,
refreshNum: 1,
rowDetail: [],
+ srcList: [],
auditRules: {
status: [{
required: true,
@@ -169,6 +199,7 @@
}],
},
visible: false,
+ visibleWord: false,
taskType: 0,
curRow: {},
roleBox: false,
@@ -208,6 +239,20 @@
columnBtn: false,
dialogClickModal: false,
column: [{
+ label: "创建时间",
+ prop: "dateRange",
+ type: "daterange",
+ format: "yyyy-MM-dd",
+ valueFormat: "yyyy-MM-dd",
+ searchRange: true,
+ startPlaceholder: '开始日期',
+ endPlaceholder: '结束日期',
+ align: 'center',
+ search: true,
+ hide: true,
+ searchSpan: 5,
+ searchLabelWidth: 76,
+ }, {
label: "场所名称",
prop: "placeName",
span: 24,
@@ -226,7 +271,7 @@
overHidden: true,
align: 'center'
}, {
- label: "场所类别",
+ label: "无诈类别",
prop: "noExplosionCategory",
align: 'center',
dicUrl: "/api/blade-system/dict-biz/tree?code=noExplosionCategory",
@@ -238,38 +283,69 @@
search: true,
searchSpan: 4,
searchLabelWidth: 96,
- align: 'center'
- }, {
+ },
+
+ {
label: "所属街道",
prop: "streetName",
span: 24,
row: true,
searchSpan: 4,
- search: true,
+ // search: true,
align: 'center'
},
{
+ parent: false,
label: "所属社区",
prop: "communityName",
- span: 24,
- row: true,
- searchSpan: 4,
+ width: 150,
search: true,
- width: 160,
- overHidden: true,
- align: 'center'
+ type: "tree",
+ searchSpan: 4,
+ dicUrl: "/api/blade-system/region/treeToCommunity",
+ props: {
+ label: "name",
+ value: "name",
+ },
+ cascader: ["gridCode"],
+ rules: [{
+ required: true,
+ message: "请选择所属社区",
+ trigger: "blur",
+ }, ],
},
+
+ // {
+ // label: "派出所",
+ // prop: "pcsName",
+ // span: 24,
+ // row: true,
+ // searchSpan: 4,
+ // search: true,
+ // align: 'center'
+ // },
{
- label: "所属网格",
- prop: "gridName",
- span: 24,
- row: true,
- searchSpan: 4,
+ searchLabelWidth: 90,
+ label: "辖区派出所",
search: true,
- align: 'center'
+ searchSpan: 4,
+ // parent: false,
+ prop: "pcsName",
+ type: "tree",
+ dicUrl: "/api/blade-system/dept/treeByDept?deptId=1727974759086493697",
+ props: {
+ label: "title",
+ value: "title"
+ },
+ rules: [{
+ required: true,
+ message: "请选择辖区派出所",
+ trigger: "blur",
+ }, ],
},
{
+ searchLabelWidth: 90,
label: "场所负责人",
prop: "principal",
span: 24,
@@ -287,15 +363,7 @@
searchSpan: 4,
align: 'center'
},
- {
- label: "无诈上报数量",
- prop: "number",
- span: 24,
- row: true,
- slot: true,
- searchSpan: 4,
- align: 'center'
- },
+
{
width: 110,
label: "审核状态",
@@ -316,6 +384,7 @@
],
},
data: [],
+ type: '',
auditBasePopup: false,
questionTypeList: [],
@@ -327,11 +396,13 @@
provide() {
return {
- placeElement: this,
+ placeElement: this
}
},
components: {
+ auditBase,
+ word,
campusReporting,
hotelReporting,
labelReporting,
@@ -403,7 +474,23 @@
}
}
},
+
+
methods: {
+ loockImag(img) {
+ console.log("**************", img)
+ this.srcList = []
+ this.srcList.push(img)
+ },
+
+ lookFile(url) {
+ this.visibleWord = true
+ this.$refs.word.initWord(url)
+ },
+
+ downloadFile(url) {
+ window.location.href = url
+ },
// 点击展开收缩
flodQL(index) {
this.rowDetail.qTypeList[index].isShowQList = !this.rowDetail.qTypeList[index].isShowQList
@@ -441,6 +528,8 @@
},
getDetail(rowData) {
+ console.log("*************rowData**************" + JSON.stringify(rowData.type))
+ this.type = rowData.type
this.getPatrolGroupTree({
type: 2,
childType: rowData.noExplosionCategory
@@ -488,6 +577,8 @@
isShowQList: true
})
})
+ // console.log("999999999999999999999999" + JSON.stringify(newArr))
+
row.qTypeList = newArr
}
// 九小类型转换
@@ -530,6 +621,10 @@
this.cancelAudit()
},
+ handleCloseWord() {
+ this.visibleWord = false
+ },
+
// 取消审核
cancelAudit() {
this.visible = false
@@ -559,6 +654,10 @@
reportType: row.reportType
}
this.visible = true
+ var that = this
+ this.$nextTick(() => {
+ that.$refs.auditBase.init(row)
+ })
},
colseDetail() {
@@ -621,23 +720,23 @@
delete row.smallLabel
- add({
- ...row,
- label
- }).then(
- () => {
- this.onLoad(this.page)
- this.$message({
- type: "success",
- message: "操作成功!",
- })
- done()
- },
- (error) => {
- window.console.log(error)
- loading()
- }
- )
+ // add({
+ // ...row,
+ // label
+ // }).then(
+ // () => {
+ // this.onLoad(this.page)
+ // this.$message({
+ // type: "success",
+ // message: "操作成功!",
+ // })
+ // done()
+ // },
+ // (error) => {
+ // window.console.log(error)
+ // loading()
+ // }
+ // )
},
rowUpdate(row, index, done, loading) {
@@ -659,23 +758,23 @@
delete row.smallLabel
- update({
- ...row,
- label
- }).then(
- () => {
- this.onLoad(this.page)
- this.$message({
- type: "success",
- message: "操作成功!",
- })
- done()
- },
- (error) => {
- window.console.log(error)
- loading()
- }
- )
+ // update({
+ // ...row,
+ // label
+ // }).then(
+ // () => {
+ // this.onLoad(this.page)
+ // this.$message({
+ // type: "success",
+ // message: "操作成功!",
+ // })
+ // done()
+ // },
+ // (error) => {
+ // window.console.log(error)
+ // loading()
+ // }
+ // )
},
rowDel(row) {
@@ -705,6 +804,12 @@
searchChange(params, done) {
this.query = params
this.page.currentPage = 1
+ let dateRange = params.dateRange
+ if (params.dateRange) {
+ params.startTime = dateRange[0] + " 00:00:00"
+ params.endTime = dateRange[1] + " 23:59:59"
+ delete params.dateRange
+ }
this.onLoad(this.page, params)
done()
},
@@ -728,7 +833,7 @@
type: "warning",
})
.then(() => {
- return remove(this.ids)
+ // return remove(this.ids)
})
.then(() => {
this.onLoad(this.page)
@@ -778,7 +883,7 @@
this.onLoad(this.page, this.query)
},
onLoad(page, params = {}) {
- const {} = this.query
+ this.query = {}
let values = {
...params,
}
@@ -795,7 +900,7 @@
}
})
}
- data.records.forEach(item => {})
+ // data.records.forEach(item => {})
this.page.total = data.total
this.data = data.records
this.loading = false
--
Gitblit v1.9.3