7 changed files with 898 additions and 169 deletions
@ -0,0 +1,396 @@ |
|||
<template> |
|||
<div class="slider-right"> |
|||
<!-- <div class="top-title">{{ $router.currentRoute.meta.title }}</div> --> |
|||
<TopBackTitle></TopBackTitle> |
|||
<div class="table-box"> |
|||
<div class="form-row-title">缺陷信息</div> |
|||
<div class="defectInformation"> |
|||
<el-row> |
|||
<el-col :span="8"> |
|||
<div class="tc-text2">堤防名称:</div> |
|||
<div class="tc-text1">{{ form.dikeName }}</div> |
|||
</el-col> |
|||
<el-col :span="8"> |
|||
<div class="tc-text2">堤防巡查责任人:</div> |
|||
<div class="tc-text1">{{ form.createName }}</div> |
|||
</el-col> |
|||
<el-col :span="8"> |
|||
<div class="tc-text2">巡查类别:</div> |
|||
<div class="tc-text1"> |
|||
{{getDictLabelName(form.category, "maintenanceCategory") }} |
|||
</div> |
|||
</el-col> |
|||
<el-col :span="8"> |
|||
<div class="tc-text2">堤防巡查开始/结束时间:</div> |
|||
<div class="tc-text1">{{ form.startDate }}/{{ form.endDate }}</div> |
|||
</el-col> |
|||
<el-col :span="8"> |
|||
<div class="tc-text2">巡查部位:</div> |
|||
<div class="tc-text1">{{ form.partsName }}</div> |
|||
</el-col> |
|||
<el-col :span="8"> |
|||
<div class="tc-text2">问题位置:</div> |
|||
<div class="tc-text1">{{ form.position }}</div> |
|||
</el-col> |
|||
<el-col :span="8"> |
|||
<div class="tc-text2">问题等级:</div> |
|||
<div class="tc-text1"> |
|||
{{getDictLabelName(form.problemLevel, "maintenanceLevel") }} |
|||
</div> |
|||
</el-col> |
|||
<el-col :span="8"> |
|||
<div class="tc-text2">具体描述:</div> |
|||
<div class="tc-text1">{{ form.content }}</div> |
|||
</el-col> |
|||
<el-col :span="24"> |
|||
<div class="tc-text2">缺陷图片:</div> |
|||
<div class="tc-text1"> |
|||
<el-image |
|||
v-for="item in form.problemImages" |
|||
style="width: 240px; height: 135px;margin-right: 16px;" |
|||
:src="item" |
|||
:preview-src-list="form.problemImages"> |
|||
</el-image> |
|||
</div> |
|||
</el-col> |
|||
</el-row> |
|||
</div> |
|||
<div class="form-row-title">养护记录</div> |
|||
<el-form ref="form" :model="form" :rules="rules" label-width="120px" label-position="top"> |
|||
<el-row :gutter="48"> |
|||
<el-col :span="8"> |
|||
<el-form-item label="维养责任人:" prop="userName"> |
|||
<el-input |
|||
disabled |
|||
placeholder="请输入内容" |
|||
v-model="form.userName"> |
|||
</el-input> |
|||
</el-form-item> |
|||
</el-col> |
|||
<el-col :span="8"> |
|||
<el-form-item label="维养开始/结束时间:" prop="time"> |
|||
<el-date-picker |
|||
size="small" |
|||
class="ml-10" |
|||
style="width: 100%;" |
|||
v-model="form.time" |
|||
type="daterange" |
|||
value-format="yyyy-MM-dd HH:mm:ss" |
|||
range-separator="至" |
|||
start-placeholder="开始日期" |
|||
end-placeholder="结束日期" |
|||
> |
|||
</el-date-picker> |
|||
</el-form-item> |
|||
</el-col> |
|||
</el-row> |
|||
<el-row> |
|||
<el-col :span="16"> |
|||
<el-form-item label="维养详情:" prop="describe"> |
|||
<el-input |
|||
type="textarea" |
|||
:rows="4" |
|||
placeholder="请输入内容" |
|||
maxlength="200" |
|||
show-word-limit |
|||
v-model="form.describe"> |
|||
</el-input> |
|||
</el-form-item> |
|||
</el-col> |
|||
</el-row> |
|||
<el-form-item label="附件:" prop="describe"> |
|||
<el-image |
|||
v-for="item in form.images" |
|||
style="width: 240px; height: 135px;margin-right: 16px;" |
|||
:src="item.url" |
|||
:preview-src-list="form.images"> |
|||
</el-image> |
|||
</el-form-item> |
|||
</el-form> |
|||
<el-table |
|||
:height="tableHeight" |
|||
:data="fileData" |
|||
style="margin-bottom: 16px;" |
|||
border |
|||
> |
|||
<el-table-column type="index" align="center" label="序号" /> |
|||
<el-table-column prop="name" align="center" label="附件名称" /> |
|||
<el-table-column prop="url" align="center" label="附件详情" /> |
|||
<el-table-column align="center" label="操作" fixed="right" width="168"> |
|||
<template slot-scope="scope"> |
|||
<div style="display:flex;"> |
|||
<el-button disabled size="small" style="margin-right: 10px;" type="text">上传</el-button> |
|||
<el-button |
|||
style="color: red" |
|||
type="text" |
|||
size="small" |
|||
disabled |
|||
slot="reference" |
|||
v-hasPermi="['df:run:checking:item:delete']" |
|||
>删除</el-button |
|||
> |
|||
</div> |
|||
</template> |
|||
</el-table-column> |
|||
</el-table> |
|||
<div class="form-row-title">验收意见</div> |
|||
<el-form ref="form" :model="form" :rules="rules" label-width="120px" label-position="right"> |
|||
<el-row gutter="48"> |
|||
<el-col span="8"> |
|||
<el-form-item label="复核人:" prop="operator"> |
|||
<el-input |
|||
placeholder="请输入内容" |
|||
v-model="form.operator"> |
|||
</el-input> |
|||
</el-form-item> |
|||
</el-col> |
|||
<el-col span="8"> |
|||
<el-form-item label="复核时间:" prop="approvalTime"> |
|||
<el-date-picker |
|||
size="small" |
|||
class="ml-10" |
|||
style="width: 100%;" |
|||
v-model="form.approvalTime" |
|||
type="date" |
|||
value-format="yyyy-MM-dd HH:mm:ss" |
|||
> |
|||
</el-date-picker> |
|||
</el-form-item> |
|||
</el-col> |
|||
</el-row> |
|||
<el-row> |
|||
<el-col span="16"> |
|||
<el-form-item label="复核意见:" prop="comment"> |
|||
<el-input |
|||
type="textarea" |
|||
:rows="4" |
|||
placeholder="请输入内容" |
|||
maxlength="200" |
|||
show-word-limit |
|||
v-model="form.comment"> |
|||
</el-input> |
|||
</el-form-item> |
|||
</el-col> |
|||
</el-row> |
|||
</el-form> |
|||
<el-table |
|||
:height="tableHeight" |
|||
:data="tableData" |
|||
style="margin-bottom: 16px;" |
|||
border |
|||
> |
|||
<el-table-column prop="nspectionLocation" align="center" label="巡查部位" /> |
|||
<el-table-column prop="inspectionContent" align="center" label="检查内容" /> |
|||
</el-table> |
|||
</div> |
|||
<div class="bottom-btns" v-if="$route.query.mode !== 'check'"> |
|||
<el-button type="primary" @click="handleAccept(true)" |
|||
>通过</el-button |
|||
> |
|||
<el-button type="danger" @click="handleAccept(false)" |
|||
>驳回</el-button |
|||
> |
|||
</div> |
|||
</div> |
|||
</template> |
|||
<script> |
|||
import TopBackTitle from "@/components/TopBackTitle/index.vue"; |
|||
import {calcTableHeight} from "@/mixins/calcTableHeight"; |
|||
import SyMixMap from "@/views/components/SyMixMap.vue"; |
|||
import {getRecordDetails, getRecordTraceList} from "@/api/dike"; |
|||
import {getV2Yh, postV2Yh, getV2ApprovalComment, gettV2Record, postV2ApprovalPassed, postV2ApprovalRejected} from "@/api/dike/patrolMaintenance"; |
|||
import {getDictMapData} from "@/api/system/dict/data"; |
|||
import {mapGetters} from "vuex"; |
|||
|
|||
export default { |
|||
components: { |
|||
SyMixMap, |
|||
TopBackTitle, |
|||
}, |
|||
mixins: [calcTableHeight], |
|||
data() { |
|||
return { |
|||
entries: {}, |
|||
traceList: [], |
|||
fileData: [], |
|||
maintenanceCategory: [], |
|||
maintenanceLevel: [], |
|||
tableData: [{ |
|||
nspectionLocation: '堤坡与戗台', |
|||
inspectionContent: '是否坚实平整', |
|||
}], |
|||
form: { |
|||
images: '', |
|||
createName: '', |
|||
userName: '', |
|||
dikeName: '', |
|||
category: '', |
|||
parts: '', |
|||
partsName: '', |
|||
content: '', |
|||
describe: '', |
|||
position: '', |
|||
problemImages: '', |
|||
problemLevel: '', |
|||
createUid: '', |
|||
dikeCode: '', |
|||
dikeType: '', |
|||
type: '', |
|||
time: [], |
|||
scope: '', |
|||
}, |
|||
rules: { |
|||
userName: [{required: true}], |
|||
projectName: [{required: true}], |
|||
dikeName: [{required: true}], |
|||
inspectionCategory: [{required: true}], |
|||
time: [{required: true}], |
|||
describe: [{required: true}], |
|||
} |
|||
}; |
|||
}, |
|||
created() { |
|||
this.getDicts("patrol_maintenance_category").then((response) => { |
|||
this.maintenanceCategory = response.data; |
|||
}); |
|||
this.getDicts("patrol_maintenance_level").then((response) => { |
|||
this.maintenanceLevel = response.data; |
|||
}); |
|||
}, |
|||
mounted() { |
|||
this.initData() |
|||
}, |
|||
computed: { |
|||
...mapGetters({ |
|||
userId: "uid", |
|||
userName: "name", |
|||
}), |
|||
}, |
|||
methods: { |
|||
async initData() { |
|||
const checking = await gettV2Record(this.$route.query.recordId) |
|||
console.log('checking',checking) |
|||
console.log('checking',this.userName) |
|||
this.form.createName = checking.data.createName |
|||
this.form.userName = this.userName |
|||
this.form.userId = this.userId |
|||
this.form.dikeName = checking.data.dikeName |
|||
this.form.checkingId = checking.data.checkingId |
|||
this.form.checkingName = checking.data.checkingName |
|||
this.form.status = checking.data.status |
|||
this.form.problems = checking.data.problems |
|||
this.form.category = checking.data.category |
|||
this.form.createUid = checking.data.createUid |
|||
this.form.dikeCode = checking.data.dikeCode |
|||
this.form.dikeType = checking.data.dikeType |
|||
this.form.type = checking.data.type |
|||
this.form.startDate = checking.data.startDate |
|||
this.form.endDate = checking.data.endDate |
|||
console.log(checking) |
|||
checking.data.problems.forEach(item => { |
|||
if(item.id === this.$route.query.defectId) { |
|||
this.form.content = item.content |
|||
this.form.position = item.position |
|||
this.form.parts = item.parts |
|||
getDictMapData("df_xs_c_classfy").then((res) => { |
|||
let parts = '' |
|||
item.parts.forEach((part) => { |
|||
if (parts) { |
|||
parts = parts + ':' + part |
|||
} else { |
|||
parts = part |
|||
} |
|||
}) |
|||
this.form.partsName = res.data[parts] |
|||
}) |
|||
this.form.problemLevel = item.problemLevel |
|||
this.form.problemImages = item.problemImages |
|||
} |
|||
}) |
|||
const Yh = await getV2Yh(this.$route.query.id) |
|||
console.log(ApprovalComment) |
|||
this.form.time[0] = Yh.data.startDate |
|||
this.form.time[1] = Yh.data.endDate |
|||
this.form.describe = Yh.data.content |
|||
this.form.time = [...this.form.time] |
|||
this.form.images = Yh.data.doc.images |
|||
this.fileData = Yh.data.doc.docs |
|||
if (this.$route.query.id) { |
|||
const ApprovalComment = await getV2ApprovalComment(this.$route.query.fromId) |
|||
this.form.approvalTime = ApprovalComment.data.approvalTime |
|||
this.form.comment = ApprovalComment.data.comment |
|||
} |
|||
}, |
|||
|
|||
getDictLabelName(type, dictListName) { |
|||
if (!this[dictListName]) return ""; |
|||
return ( |
|||
this[dictListName].find((item) => item.dictValue === type)?.dictLabel || |
|||
"" |
|||
); |
|||
}, |
|||
handleAccept(type) { |
|||
const data = { |
|||
approvalTime: this.form.approvalTime, |
|||
comment: this.form.comment, |
|||
formId: this.form.formId, |
|||
id: this.form.id, |
|||
status: this.form.status, |
|||
submitTime: this.form.submitTime, |
|||
detail: { |
|||
|
|||
} |
|||
|
|||
} |
|||
console.log(data) |
|||
// if (type) { |
|||
// postV2ApprovalPassed(data, id).then(res => { |
|||
// this.$message.success('通过成功') |
|||
// this.$router.go(-1) |
|||
// }) |
|||
// } else { |
|||
// postV2ApprovalRejected(data, id).then(res => { |
|||
// this.$message.success('驳回成功') |
|||
// this.$router.go(-1) |
|||
// }) |
|||
// } |
|||
}, |
|||
}, |
|||
}; |
|||
</script> |
|||
<style lang="scss"> |
|||
.table-box { |
|||
width: 100%; |
|||
height: calc(100% - 50px - 24px); |
|||
margin-top: 24px; |
|||
padding: 16px; |
|||
padding-bottom: 80px; |
|||
background-color: white; |
|||
overflow: auto; |
|||
} |
|||
.form-row-title { |
|||
font-size: 16px; |
|||
font-weight: bold; |
|||
margin-bottom: 16px; |
|||
border-left: 4px solid #36b29e; |
|||
padding-left: 8px; |
|||
} |
|||
.row-item { |
|||
display: flex; |
|||
font-size: 14px; |
|||
line-height: 22px; |
|||
margin-bottom: 16px; |
|||
& > div { |
|||
width: 50%; |
|||
} |
|||
} |
|||
.defectInformation { |
|||
.el-row { |
|||
margin-bottom: 16px; |
|||
.el-col { |
|||
margin-bottom: 16px; |
|||
} |
|||
} |
|||
|
|||
} |
|||
</style> |
@ -0,0 +1,446 @@ |
|||
<template> |
|||
<div class="slider-right"> |
|||
<!-- <div class="top-title">{{ $router.currentRoute.meta.title }}</div> --> |
|||
<TopBackTitle></TopBackTitle> |
|||
<div class="table-box"> |
|||
<div class="form-row-title">缺陷信息</div> |
|||
<div class="defectInformation"> |
|||
<el-row> |
|||
<el-col :span="8"> |
|||
<div class="tc-text2">堤防名称:</div> |
|||
<div class="tc-text1">{{ form.dikeName }}</div> |
|||
</el-col> |
|||
<el-col :span="8"> |
|||
<div class="tc-text2">堤防巡查责任人:</div> |
|||
<div class="tc-text1">{{ form.createName }}</div> |
|||
</el-col> |
|||
<el-col :span="8"> |
|||
<div class="tc-text2">巡查类别:</div> |
|||
<div class="tc-text1"> |
|||
{{getDictLabelName(form.category, "maintenanceCategory") }} |
|||
</div> |
|||
</el-col> |
|||
<el-col :span="8"> |
|||
<div class="tc-text2">堤防巡查开始/结束时间:</div> |
|||
<div class="tc-text1">{{ form.startDate }}/{{ form.endDate }}</div> |
|||
</el-col> |
|||
<el-col :span="8"> |
|||
<div class="tc-text2">巡查部位:</div> |
|||
<div class="tc-text1">{{ form.partsName }}</div> |
|||
</el-col> |
|||
<el-col :span="8"> |
|||
<div class="tc-text2">问题位置:</div> |
|||
<div class="tc-text1">{{ form.position }}</div> |
|||
</el-col> |
|||
<el-col :span="8"> |
|||
<div class="tc-text2">问题等级:</div> |
|||
<div class="tc-text1"> |
|||
{{getDictLabelName(form.problemLevel, "maintenanceLevel") }} |
|||
</div> |
|||
</el-col> |
|||
<el-col :span="8"> |
|||
<div class="tc-text2">具体描述:</div> |
|||
<div class="tc-text1">{{ form.content }}</div> |
|||
</el-col> |
|||
<el-col :span="24"> |
|||
<div class="tc-text2">缺陷图片:</div> |
|||
<div class="tc-text1"> |
|||
<el-image |
|||
v-for="item in form.problemImages" |
|||
style="width: 240px; height: 135px;margin-right: 16px;" |
|||
:src="item" |
|||
:preview-src-list="form.problemImages"> |
|||
</el-image> |
|||
</div> |
|||
</el-col> |
|||
</el-row> |
|||
</div> |
|||
<div class="form-row-title">养护记录</div> |
|||
<el-form ref="form" :model="form" :rules="rules" label-width="120px" label-position="top"> |
|||
<el-row :gutter="48"> |
|||
<el-col :span="8"> |
|||
<el-form-item label="维养责任人:" prop="userName"> |
|||
<el-input |
|||
disabled |
|||
placeholder="请输入内容" |
|||
v-model="form.userName"> |
|||
</el-input> |
|||
</el-form-item> |
|||
</el-col> |
|||
<el-col :span="8"> |
|||
<el-form-item label="维养开始/结束时间:" prop="time"> |
|||
<el-date-picker |
|||
size="small" |
|||
class="ml-10" |
|||
style="width: 100%;" |
|||
v-model="form.time" |
|||
type="daterange" |
|||
:disabled="$route.query.mode === 'check'" |
|||
value-format="yyyy-MM-dd HH:mm:ss" |
|||
range-separator="至" |
|||
start-placeholder="开始日期" |
|||
end-placeholder="结束日期" |
|||
> |
|||
</el-date-picker> |
|||
</el-form-item> |
|||
</el-col> |
|||
</el-row> |
|||
<el-row> |
|||
<el-col :span="16"> |
|||
<el-form-item label="维养详情:" prop="describe"> |
|||
<el-input |
|||
type="textarea" |
|||
:rows="4" |
|||
:disabled="$route.query.mode === 'check'" |
|||
placeholder="请输入内容" |
|||
maxlength="200" |
|||
show-word-limit |
|||
v-model="form.describe"> |
|||
</el-input> |
|||
</el-form-item> |
|||
</el-col> |
|||
</el-row> |
|||
<el-form-item label="附件:" prop="images"> |
|||
<el-upload |
|||
class="" |
|||
action="#" |
|||
:http-request="handleUploadProject1" |
|||
:before-upload="beforeUploadProject1" |
|||
:show-file-list="false" |
|||
accept=".png,.jpg,.jpeg" |
|||
> |
|||
<el-button :disabled="$route.query.mode === 'check'" size="small" style="margin-bottom: 16px;" type="primary">上传</el-button> |
|||
</el-upload> |
|||
<el-image |
|||
v-for="item in form.images" |
|||
style="width: 240px; height: 135px;margin-right: 16px;" |
|||
:src="item.url" |
|||
:preview-src-list="form.images"> |
|||
</el-image> |
|||
</el-form-item> |
|||
</el-form> |
|||
|
|||
<el-table |
|||
:height="tableHeight" |
|||
:data="fileData" |
|||
style="margin-bottom: 16px;" |
|||
border |
|||
> |
|||
<el-table-column type="index" align="center" label="序号" /> |
|||
<el-table-column prop="name" align="center" label="附件名称" /> |
|||
<el-table-column prop="url" align="center" label="附件详情" /> |
|||
<el-table-column align="center" label="操作" fixed="right" width="168"> |
|||
<template slot-scope="scope"> |
|||
<div style="display:flex;"> |
|||
<el-upload |
|||
class="" |
|||
action="#" |
|||
:http-request="(e) => {handleUploadProject(e, scope.row)}" |
|||
:before-upload="(e) => {beforeUploadProject(e, scope.row)}" |
|||
:show-file-list="false" |
|||
accept=".png,.jpg,.jpeg" |
|||
> |
|||
<el-button :disabled="$route.query.mode === 'check'" size="small" style="margin-right: 10px;" type="text">上传</el-button> |
|||
</el-upload> |
|||
<el-popconfirm |
|||
confirm-button-text="确定" |
|||
cancel-button-text="取消" |
|||
icon="el-icon-info" |
|||
icon-color="red" |
|||
title="确定删除吗?" |
|||
@confirm="deleteTableItem(scope.row)" |
|||
> |
|||
<el-button |
|||
style="color: red" |
|||
type="text" |
|||
size="small" |
|||
:disabled="$route.query.mode === 'check'" |
|||
slot="reference" |
|||
v-hasPermi="['df:run:checking:item:delete']" |
|||
>删除</el-button |
|||
> |
|||
</el-popconfirm> |
|||
</div> |
|||
</template> |
|||
</el-table-column> |
|||
</el-table> |
|||
</div> |
|||
<div class="bottom-btns" v-if="$route.query.mode !== 'check'"> |
|||
<el-button type="primary" @click="handleSave(true)" |
|||
>保存并提交</el-button |
|||
> |
|||
<el-button type="primary" @click="handleSave(false)" |
|||
>保存</el-button |
|||
> |
|||
<el-button @click="$router.go(-1)">返回</el-button> |
|||
</div> |
|||
</div> |
|||
</template> |
|||
<script> |
|||
import TopBackTitle from "@/components/TopBackTitle/index.vue"; |
|||
import { calcTableHeight } from "@/mixins/calcTableHeight"; |
|||
import SyMixMap from "@/views/components/SyMixMap.vue"; |
|||
import { uploadFileData } from "@/api/system/upload"; |
|||
import { getV2Yh, postV2Yh, gettV2Record } from "@/api/dike/patrolMaintenance"; |
|||
import { getDictMapData } from "@/api/system/dict/data"; |
|||
import { mapGetters } from "vuex"; |
|||
|
|||
export default { |
|||
components: { |
|||
SyMixMap, |
|||
TopBackTitle, |
|||
}, |
|||
mixins: [calcTableHeight], |
|||
data() { |
|||
return { |
|||
entries: {}, |
|||
traceList: [], |
|||
fileData: [ |
|||
{ |
|||
name: '工作票', |
|||
url: '' |
|||
}, |
|||
{ |
|||
name: '操作票', |
|||
url: '' |
|||
} |
|||
], |
|||
maintenanceCategory: [], |
|||
maintenanceLevel: [], |
|||
tableData: [{ |
|||
nspectionLocation: '堤坡与戗台', |
|||
inspectionContent: '是否坚实平整', |
|||
}], |
|||
form: { |
|||
images: [], |
|||
createName: '', |
|||
userName: '', |
|||
dikeName: '', |
|||
category: '', |
|||
parts: '', |
|||
partsName: '', |
|||
content: '', |
|||
describe: '', |
|||
position: '', |
|||
problemImages: '', |
|||
problemLevel: '', |
|||
createUid: '', |
|||
dikeCode: '', |
|||
dikeType: '', |
|||
type: '', |
|||
time: [], |
|||
scope: '', |
|||
}, |
|||
rules: { |
|||
userName: [{required: true}], |
|||
projectName: [{required: true}], |
|||
dikeName: [{required: true}], |
|||
inspectionCategory: [{required: true}], |
|||
time: [{required: true}], |
|||
describe: [{required: true}], |
|||
} |
|||
}; |
|||
}, |
|||
created() { |
|||
this.getDicts("patrol_maintenance_category").then((response) => { |
|||
this.maintenanceCategory = response.data; |
|||
}); |
|||
this.getDicts("patrol_maintenance_level").then((response) => { |
|||
this.maintenanceLevel = response.data; |
|||
}); |
|||
}, |
|||
mounted() { |
|||
this.initData() |
|||
}, |
|||
computed: { |
|||
...mapGetters({ |
|||
userId: "uid", |
|||
userName: "name", |
|||
}), |
|||
}, |
|||
methods: { |
|||
async initData() { |
|||
const checking = await gettV2Record(this.$route.query.recordId) |
|||
this.form.createName = checking.data.createName |
|||
this.form.userName = this.userName |
|||
this.form.userId = this.userId |
|||
this.form.dikeName = checking.data.dikeName |
|||
this.form.checkingId = checking.data.checkingId |
|||
this.form.checkingName = checking.data.checkingName |
|||
this.form.status = checking.data.status |
|||
this.form.problems = checking.data.problems |
|||
this.form.category = checking.data.category |
|||
this.form.createUid = checking.data.createUid |
|||
this.form.dikeCode = checking.data.dikeCode |
|||
this.form.dikeType = checking.data.dikeType |
|||
this.form.type = checking.data.type |
|||
this.form.startDate = checking.data.startDate |
|||
this.form.endDate = checking.data.endDate |
|||
checking.data.problems.forEach(item => { |
|||
if(item.id === this.$route.query.defectId) { |
|||
this.form.content = item.content |
|||
this.form.position = item.position |
|||
this.form.parts = item.parts |
|||
getDictMapData("df_xs_c_classfy").then((res) => { |
|||
let parts = '' |
|||
item.parts.forEach((part) => { |
|||
if (parts) { |
|||
parts = parts + ':' + part |
|||
} else { |
|||
parts = part |
|||
} |
|||
}) |
|||
this.form.partsName = res.data[parts] |
|||
}) |
|||
this.form.problemLevel = item.problemLevel |
|||
this.form.problemImages = item.problemImages |
|||
} |
|||
}) |
|||
if (this.$route.query.id) { |
|||
const ApprovalComment = await getV2Yh(this.$route.query.id) |
|||
console.log(ApprovalComment) |
|||
this.form.time[0] = ApprovalComment.data.startDate |
|||
this.form.time[1] = ApprovalComment.data.endDate |
|||
this.form.describe = ApprovalComment.data.content |
|||
this.form.time = [...this.form.time] |
|||
this.form.images = ApprovalComment.data.doc.images |
|||
this.fileData = ApprovalComment.data.doc.docs |
|||
} |
|||
}, |
|||
|
|||
getDictLabelName(type, dictListName) { |
|||
if (!this[dictListName]) return ""; |
|||
return ( |
|||
this[dictListName].find((item) => item.dictValue === type)?.dictLabel || |
|||
"" |
|||
); |
|||
}, |
|||
// 图片上传后 |
|||
handleUploadProject(e, row) { |
|||
const { file } = e; |
|||
let fData = new FormData(); |
|||
fData.append("file", file); |
|||
uploadFileData(fData) |
|||
.then((res) => { |
|||
row.url = res.url; |
|||
}) |
|||
.catch((err) => { |
|||
console.log("err >>>>> ", err); |
|||
}); |
|||
}, |
|||
// 图片上传前 |
|||
beforeUploadProject(e, row) { |
|||
const { name, size } = e; |
|||
if (!/\.(jpg|png|jpeg)$/.test(name)) { |
|||
this.$message.warning("文件格式不正确"); |
|||
return false; |
|||
} |
|||
if (row.problemImages?.length >= 3) { |
|||
this.$message({ |
|||
message: "最多上传3份", |
|||
type: "warning", |
|||
}); |
|||
return false; |
|||
} |
|||
return true; |
|||
}, |
|||
// 图片上传后 |
|||
handleUploadProject1(e, row) { |
|||
const { file } = e; |
|||
let fData = new FormData(); |
|||
fData.append("file", file); |
|||
uploadFileData(fData) |
|||
.then((res) => { |
|||
this.form.images.push({ |
|||
name: res.name, |
|||
url: res.url |
|||
}); |
|||
}) |
|||
.catch((err) => { |
|||
console.log("err >>>>> ", err); |
|||
}); |
|||
}, |
|||
// 图片上传前 |
|||
beforeUploadProject1(e, row) { |
|||
const { name, size } = e; |
|||
if (!/\.(jpg|png|jpeg)$/.test(name)) { |
|||
this.$message.warning("文件格式不正确"); |
|||
return false; |
|||
} |
|||
if (this.form.images?.length >= 3) { |
|||
this.$message({ |
|||
message: "最多上传3份", |
|||
type: "warning", |
|||
}); |
|||
return false; |
|||
} |
|||
return true; |
|||
}, |
|||
deleteTableItem(row) { |
|||
row.url = '' |
|||
}, |
|||
handleSave(commit) { |
|||
const data = { |
|||
name: this.form.checkingName, |
|||
checkingId: this.form.checkingId, |
|||
content: this.form.describe, |
|||
dutyHolderId: this.form.userId, |
|||
dutyHolderName: this.form.userName, |
|||
issueLevel: this.form.problemLevel, |
|||
problemId: this.$route.query.defectId, |
|||
recordId: this.$route.query.recordId, |
|||
doc: { |
|||
images: this.form.images, |
|||
docs: this.fileData, |
|||
}, |
|||
startDate: 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] : '', |
|||
} |
|||
console.log(data) |
|||
if (this.$route.query.id) { |
|||
data.id = this.$route.query.id |
|||
} |
|||
postV2Yh(data, commit).then(res => { |
|||
this.$message.success('保存成功') |
|||
this.$router.go(-1) |
|||
}) |
|||
} |
|||
}, |
|||
}; |
|||
</script> |
|||
<style lang="scss"> |
|||
.table-box { |
|||
width: 100%; |
|||
height: calc(100% - 50px - 24px); |
|||
margin-top: 24px; |
|||
padding: 16px; |
|||
padding-bottom: 80px; |
|||
background-color: white; |
|||
overflow: auto; |
|||
} |
|||
.form-row-title { |
|||
font-size: 16px; |
|||
font-weight: bold; |
|||
margin-bottom: 16px; |
|||
border-left: 4px solid #36b29e; |
|||
padding-left: 8px; |
|||
} |
|||
.row-item { |
|||
display: flex; |
|||
font-size: 14px; |
|||
line-height: 22px; |
|||
margin-bottom: 16px; |
|||
& > div { |
|||
width: 50%; |
|||
} |
|||
} |
|||
.defectInformation { |
|||
.el-row { |
|||
margin-bottom: 16px; |
|||
.el-col { |
|||
margin-bottom: 16px; |
|||
} |
|||
} |
|||
|
|||
} |
|||
</style> |
Loading…
Reference in new issue