|
@ -4,7 +4,13 @@ |
|
|
<div class="table-box"> |
|
|
<div class="table-box"> |
|
|
<div class="form-row-title">巡查路线</div> |
|
|
<div class="form-row-title">巡查路线</div> |
|
|
<div class="patrol-box"> |
|
|
<div class="patrol-box"> |
|
|
<el-form ref="form" :model="form" :rules="rules" label-width="120px" label-position="right"> |
|
|
<el-form |
|
|
|
|
|
ref="form" |
|
|
|
|
|
:model="form" |
|
|
|
|
|
:rules="rules" |
|
|
|
|
|
label-width="120px" |
|
|
|
|
|
label-position="right" |
|
|
|
|
|
> |
|
|
<el-form-item label="巡查人:" prop="createName"> |
|
|
<el-form-item label="巡查人:" prop="createName"> |
|
|
{{ form.createName }} |
|
|
{{ form.createName }} |
|
|
</el-form-item> |
|
|
</el-form-item> |
|
@ -40,7 +46,8 @@ |
|
|
maxlength="200" |
|
|
maxlength="200" |
|
|
show-word-limit |
|
|
show-word-limit |
|
|
resize="none" |
|
|
resize="none" |
|
|
v-model="form.scope"> |
|
|
v-model="form.scope" |
|
|
|
|
|
> |
|
|
</el-input> |
|
|
</el-input> |
|
|
</el-form-item> |
|
|
</el-form-item> |
|
|
</el-form> |
|
|
</el-form> |
|
@ -58,14 +65,17 @@ |
|
|
<el-table |
|
|
<el-table |
|
|
:height="tableHeight" |
|
|
:height="tableHeight" |
|
|
:data="tableData" |
|
|
:data="tableData" |
|
|
style="margin-bottom: 16px;" |
|
|
style="margin-bottom: 16px" |
|
|
border |
|
|
border |
|
|
> |
|
|
> |
|
|
<el-table-column prop="name" align="center" label="巡查部位" /> |
|
|
<el-table-column prop="name" align="center" label="巡查部位" /> |
|
|
<el-table-column prop="content" align="center" label="检查内容" /> |
|
|
<el-table-column prop="content" align="center" label="检查内容" /> |
|
|
</el-table> |
|
|
</el-table> |
|
|
<div class="form-row-title">缺陷问题列表</div> |
|
|
<div class="form-row-title">缺陷问题列表</div> |
|
|
<div class="flex-1 flex justify-end search-item" style="margin-bottom: 16px;"> |
|
|
<div |
|
|
|
|
|
class="flex-1 flex justify-end search-item" |
|
|
|
|
|
style="margin-bottom: 16px" |
|
|
|
|
|
> |
|
|
<el-button |
|
|
<el-button |
|
|
size="small" |
|
|
size="small" |
|
|
:disabled="$route.query.mode === 'check'" |
|
|
:disabled="$route.query.mode === 'check'" |
|
@ -90,22 +100,23 @@ |
|
|
border |
|
|
border |
|
|
> |
|
|
> |
|
|
<el-table-column type="selection" width="55"></el-table-column> |
|
|
<el-table-column type="selection" width="55"></el-table-column> |
|
|
<el-table-column prop="parts" label="巡查部位"> |
|
|
<el-table-column prop="itemId" label="巡查部位"> |
|
|
<template slot-scope="scope"> |
|
|
<template slot-scope="scope"> |
|
|
<el-select |
|
|
<el-select |
|
|
clearable |
|
|
clearable |
|
|
size="small" |
|
|
size="small" |
|
|
class="w-202 ml-10" |
|
|
class="w-202 ml-10" |
|
|
:disabled="$route.query.mode === 'check'" |
|
|
:disabled="$route.query.mode === 'check'" |
|
|
v-model="scope.row.parts" |
|
|
v-model="scope.row.itemId" |
|
|
filterable |
|
|
filterable |
|
|
|
|
|
@change="handleChangeSelectParts(scope.row)" |
|
|
placeholder="请选择" |
|
|
placeholder="请选择" |
|
|
> |
|
|
> |
|
|
<el-option |
|
|
<el-option |
|
|
v-for="item in tableData" |
|
|
v-for="item in tableData" |
|
|
:key="item.id" |
|
|
:key="item.id" |
|
|
:label="item.name" |
|
|
:label="item.name" |
|
|
:value="item.parts" |
|
|
:value="item.id" |
|
|
> |
|
|
> |
|
|
</el-option> |
|
|
</el-option> |
|
|
</el-select> |
|
|
</el-select> |
|
@ -153,16 +164,18 @@ |
|
|
<el-table-column align="center" label="缺陷照片"> |
|
|
<el-table-column align="center" label="缺陷照片"> |
|
|
<template slot-scope="scope"> |
|
|
<template slot-scope="scope"> |
|
|
<div class="imgBox"> |
|
|
<div class="imgBox"> |
|
|
<div |
|
|
<div class="imgList" v-for="item in scope.row.problemImages"> |
|
|
class="imgList" |
|
|
|
|
|
v-for="item in scope.row.problemImages" |
|
|
|
|
|
> |
|
|
|
|
|
<el-image |
|
|
<el-image |
|
|
style="width: 40px; height: 40px;" |
|
|
style="width: 40px; height: 40px" |
|
|
:src="item" |
|
|
:src="item" |
|
|
:preview-src-list="scope.row.problemImages"> |
|
|
:preview-src-list="scope.row.problemImages" |
|
|
|
|
|
> |
|
|
</el-image> |
|
|
</el-image> |
|
|
<div class="delImg" v-if="$route.query.mode !== 'check'" @click="delImage(item, scope.row.problemImages)"> |
|
|
<div |
|
|
|
|
|
class="delImg" |
|
|
|
|
|
v-if="$route.query.mode !== 'check'" |
|
|
|
|
|
@click="delImage(item, scope.row.problemImages)" |
|
|
|
|
|
> |
|
|
× |
|
|
× |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
@ -184,16 +197,30 @@ |
|
|
width="168" |
|
|
width="168" |
|
|
> |
|
|
> |
|
|
<template slot-scope="scope"> |
|
|
<template slot-scope="scope"> |
|
|
<div style="display:flex;"> |
|
|
<div style="display: flex"> |
|
|
<el-upload |
|
|
<el-upload |
|
|
class="" |
|
|
class="" |
|
|
action="#" |
|
|
action="#" |
|
|
:http-request="(e) => {handleUploadProject(e, scope.row)}" |
|
|
:http-request=" |
|
|
:before-upload="(e) => {beforeUploadProject(e, scope.row)}" |
|
|
(e) => { |
|
|
|
|
|
handleUploadProject(e, scope.row); |
|
|
|
|
|
} |
|
|
|
|
|
" |
|
|
|
|
|
:before-upload=" |
|
|
|
|
|
(e) => { |
|
|
|
|
|
beforeUploadProject(e, scope.row); |
|
|
|
|
|
} |
|
|
|
|
|
" |
|
|
:show-file-list="false" |
|
|
:show-file-list="false" |
|
|
accept=".png,.jpg,.jpeg" |
|
|
accept=".png,.jpg,.jpeg" |
|
|
> |
|
|
> |
|
|
<el-button :disabled="$route.query.mode === 'check'" size="small" style="margin-right: 10px;" type="text">上传图片</el-button> |
|
|
<el-button |
|
|
|
|
|
:disabled="$route.query.mode === 'check'" |
|
|
|
|
|
size="small" |
|
|
|
|
|
style="margin-right: 10px" |
|
|
|
|
|
type="text" |
|
|
|
|
|
>上传图片</el-button |
|
|
|
|
|
> |
|
|
</el-upload> |
|
|
</el-upload> |
|
|
<el-popconfirm |
|
|
<el-popconfirm |
|
|
confirm-button-text="确定" |
|
|
confirm-button-text="确定" |
|
@ -219,12 +246,8 @@ |
|
|
</el-table> |
|
|
</el-table> |
|
|
</div> |
|
|
</div> |
|
|
<div class="bottom-btns" v-if="$route.query.mode !== 'check'"> |
|
|
<div class="bottom-btns" v-if="$route.query.mode !== 'check'"> |
|
|
<el-button type="primary" @click="handleSave(true)" |
|
|
<el-button type="primary" @click="handleSave(true)">保存并提交</el-button> |
|
|
>保存并提交</el-button |
|
|
<el-button type="primary" @click="handleSave(false)">保存</el-button> |
|
|
> |
|
|
|
|
|
<el-button type="primary" @click="handleSave(false)" |
|
|
|
|
|
>保存</el-button |
|
|
|
|
|
> |
|
|
|
|
|
<el-button @click="$router.go(-1)">返回</el-button> |
|
|
<el-button @click="$router.go(-1)">返回</el-button> |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
@ -236,7 +259,7 @@ import SyMixMap from "@/views/components/SyMixMap.vue"; |
|
|
import { |
|
|
import { |
|
|
getRecordDetails, |
|
|
getRecordDetails, |
|
|
getRecordTraceList, |
|
|
getRecordTraceList, |
|
|
getV2PatrolChecking |
|
|
getV2PatrolChecking, |
|
|
} from "@/api/dike"; |
|
|
} from "@/api/dike"; |
|
|
import { gettV2Record, postV2Record } from "@/api/dike/patrolMaintenance"; |
|
|
import { gettV2Record, postV2Record } from "@/api/dike/patrolMaintenance"; |
|
|
import { uploadFileData } from "@/api/system/upload"; |
|
|
import { uploadFileData } from "@/api/system/upload"; |
|
@ -259,16 +282,16 @@ export default { |
|
|
problemsData: [], |
|
|
problemsData: [], |
|
|
tableData: [], |
|
|
tableData: [], |
|
|
form: { |
|
|
form: { |
|
|
createName: '', |
|
|
createName: "", |
|
|
name: '', |
|
|
name: "", |
|
|
dikeName: '', |
|
|
dikeName: "", |
|
|
category: '', |
|
|
category: "", |
|
|
createUid: '', |
|
|
createUid: "", |
|
|
dikeCode: '', |
|
|
dikeCode: "", |
|
|
dikeType: '', |
|
|
dikeType: "", |
|
|
type: '', |
|
|
type: "", |
|
|
time: [], |
|
|
time: [], |
|
|
scope: '', |
|
|
scope: "", |
|
|
}, |
|
|
}, |
|
|
rules: { |
|
|
rules: { |
|
|
createName: [{ required: true }], |
|
|
createName: [{ required: true }], |
|
@ -277,7 +300,7 @@ export default { |
|
|
category: [{ required: true }], |
|
|
category: [{ required: true }], |
|
|
time: [{ required: true }], |
|
|
time: [{ required: true }], |
|
|
scope: [{ required: true }], |
|
|
scope: [{ required: true }], |
|
|
} |
|
|
}, |
|
|
}; |
|
|
}; |
|
|
}, |
|
|
}, |
|
|
created() { |
|
|
created() { |
|
@ -292,45 +315,45 @@ export default { |
|
|
}); |
|
|
}); |
|
|
}, |
|
|
}, |
|
|
mounted() { |
|
|
mounted() { |
|
|
this.initData() |
|
|
this.initData(); |
|
|
}, |
|
|
}, |
|
|
methods: { |
|
|
methods: { |
|
|
async initData() { |
|
|
async initData() { |
|
|
this.getDetail() |
|
|
this.getDetail(); |
|
|
this.getMapData() |
|
|
this.getMapData(); |
|
|
}, |
|
|
}, |
|
|
async getDetail() { |
|
|
async getDetail() { |
|
|
if (this.$route.query.id) { |
|
|
if (this.$route.query.id) { |
|
|
const details = await gettV2Record(this.$route.query.id); |
|
|
const details = await gettV2Record(this.$route.query.id); |
|
|
this.form.time[0] = details.data.startDate |
|
|
this.form.time[0] = details.data.startDate; |
|
|
this.form.time[1] = details.data.endDate |
|
|
this.form.time[1] = details.data.endDate; |
|
|
this.form.scope = details.data.scope |
|
|
this.form.scope = details.data.scope; |
|
|
this.problemsData = details.data.problems |
|
|
this.problemsData = details.data.problems; |
|
|
this.form.time = [...this.form.time] |
|
|
this.form.time = [...this.form.time]; |
|
|
} |
|
|
} |
|
|
const checking = await getV2PatrolChecking(this.$route.query.checkingId); |
|
|
const checking = await getV2PatrolChecking(this.$route.query.checkingId); |
|
|
this.form.createName = checking.data.createName |
|
|
this.form.createName = checking.data.createName; |
|
|
this.form.name = checking.data.name |
|
|
this.form.name = checking.data.name; |
|
|
this.form.dikeName = checking.data.dikeName |
|
|
this.form.dikeName = checking.data.dikeName; |
|
|
this.form.category = checking.data.category |
|
|
this.form.category = checking.data.category; |
|
|
this.form.createUid = checking.data.createUid |
|
|
this.form.createUid = checking.data.createUid; |
|
|
this.form.dikeCode = checking.data.dikeCode |
|
|
this.form.dikeCode = checking.data.dikeCode; |
|
|
this.form.dikeType = checking.data.dikeType |
|
|
this.form.dikeType = checking.data.dikeType; |
|
|
this.form.type = checking.data.type |
|
|
this.form.type = checking.data.type; |
|
|
const items = checking.data.items |
|
|
const items = checking.data.items; |
|
|
getDictMapData("df_xs_c_classfy").then((res) => { |
|
|
getDictMapData("df_xs_c_classfy").then((res) => { |
|
|
items.forEach(item => { |
|
|
items.forEach((item) => { |
|
|
let parts = '' |
|
|
let parts = ""; |
|
|
item.parts.forEach((part) => { |
|
|
item.parts.forEach((part) => { |
|
|
if (parts) { |
|
|
if (parts) { |
|
|
parts = parts + ':' + part |
|
|
parts = parts + ":" + part; |
|
|
} else { |
|
|
} else { |
|
|
parts = part |
|
|
parts = part; |
|
|
} |
|
|
} |
|
|
}) |
|
|
}); |
|
|
item.name = res.data[parts] |
|
|
item.name = res.data[parts]; |
|
|
}) |
|
|
}); |
|
|
this.tableData = items |
|
|
this.tableData = items; |
|
|
}); |
|
|
}); |
|
|
}, |
|
|
}, |
|
|
async getMapData() { |
|
|
async getMapData() { |
|
@ -356,6 +379,10 @@ export default { |
|
|
?.reverse() || []; |
|
|
?.reverse() || []; |
|
|
}); |
|
|
}); |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
handleChangeSelectParts(row) { |
|
|
|
|
|
row.parts = this.tableData.find((v) => v.id === row.itemId)?.parts; |
|
|
|
|
|
}, |
|
|
// 图片上传后 |
|
|
// 图片上传后 |
|
|
handleUploadProject(e, row) { |
|
|
handleUploadProject(e, row) { |
|
|
const { file } = e; |
|
|
const { file } = e; |
|
@ -386,19 +413,19 @@ export default { |
|
|
return true; |
|
|
return true; |
|
|
}, |
|
|
}, |
|
|
delImage(img, problemImages) { |
|
|
delImage(img, problemImages) { |
|
|
const index = problemImages.indexOf(img) |
|
|
const index = problemImages.indexOf(img); |
|
|
problemImages.splice(index, 1) |
|
|
problemImages.splice(index, 1); |
|
|
problemImages |
|
|
problemImages; |
|
|
}, |
|
|
}, |
|
|
addProblems() { |
|
|
addProblems() { |
|
|
this.problemsData.push({ |
|
|
this.problemsData.push({ |
|
|
problemLevel: '1', |
|
|
problemLevel: "1", |
|
|
partsId: this.tableData[0].parts, |
|
|
partsId: this.tableData[0].parts, |
|
|
poistion: '', |
|
|
poistion: "", |
|
|
content: '', |
|
|
content: "", |
|
|
problemImages: [], |
|
|
problemImages: [], |
|
|
status: '4', |
|
|
status: "4", |
|
|
}) |
|
|
}); |
|
|
}, |
|
|
}, |
|
|
getDictLabelName(type, dictListName) { |
|
|
getDictLabelName(type, dictListName) { |
|
|
if (!this[dictListName]) return ""; |
|
|
if (!this[dictListName]) return ""; |
|
@ -418,17 +445,17 @@ export default { |
|
|
}) |
|
|
}) |
|
|
.then(() => { |
|
|
.then(() => { |
|
|
this.problemsCheckData.forEach((Check) => { |
|
|
this.problemsCheckData.forEach((Check) => { |
|
|
const index = this.problemsData.indexOf(Check) |
|
|
const index = this.problemsData.indexOf(Check); |
|
|
this.problemsData.splice(index, 1) |
|
|
this.problemsData.splice(index, 1); |
|
|
}) |
|
|
}); |
|
|
}) |
|
|
}) |
|
|
.catch(() => { |
|
|
.catch(() => { |
|
|
console.log("取消删除"); |
|
|
console.log("取消删除"); |
|
|
}); |
|
|
}); |
|
|
}, |
|
|
}, |
|
|
deleteTableItem(row) { |
|
|
deleteTableItem(row) { |
|
|
const index = this.problemsData.indexOf(row) |
|
|
const index = this.problemsData.indexOf(row); |
|
|
this.problemsData.splice(index, 1) |
|
|
this.problemsData.splice(index, 1); |
|
|
}, |
|
|
}, |
|
|
handleSave(commit) { |
|
|
handleSave(commit) { |
|
|
const data = { |
|
|
const data = { |
|
@ -442,19 +469,21 @@ export default { |
|
|
dikeType: this.form.dikeType, |
|
|
dikeType: this.form.dikeType, |
|
|
scope: this.form.scope, |
|
|
scope: this.form.scope, |
|
|
problems: this.problemsData, |
|
|
problems: this.problemsData, |
|
|
startDate: this.form.time && this.form.time.length > 1 ? this.form.time[0] : '', |
|
|
startDate: |
|
|
endDate: this.form.time && this.form.time.length > 1 ? this.form.time[1] : '', |
|
|
this.form.time && this.form.time.length > 1 ? this.form.time[0] : "", |
|
|
|
|
|
endDate: |
|
|
|
|
|
this.form.time && this.form.time.length > 1 ? this.form.time[1] : "", |
|
|
type: this.form.type, |
|
|
type: this.form.type, |
|
|
} |
|
|
}; |
|
|
if (this.$route.query.id) { |
|
|
if (this.$route.query.id) { |
|
|
data.id = this.$route.query.id |
|
|
data.id = this.$route.query.id; |
|
|
} |
|
|
} |
|
|
console.log(data); |
|
|
console.log(data); |
|
|
postV2Record(data,commit).then(res => { |
|
|
postV2Record(data, commit).then((res) => { |
|
|
this.$message.success('保存成功') |
|
|
this.$message.success("保存成功"); |
|
|
this.$router.go(-1) |
|
|
this.$router.go(-1); |
|
|
}) |
|
|
}); |
|
|
} |
|
|
}, |
|
|
}, |
|
|
}, |
|
|
}; |
|
|
}; |
|
|
</script> |
|
|
</script> |
|
|