|
|
@ -5,8 +5,8 @@ |
|
|
|
<span v-if="type.prop==='information'"> |
|
|
|
<span v-if="type.prop==='information'"> |
|
|
|
<avue-form :option="information_option" |
|
|
|
<avue-form :option="information_option" |
|
|
|
v-model="information_form" |
|
|
|
v-model="information_form" |
|
|
|
ref="information_form" |
|
|
|
ref="information_crud" |
|
|
|
:class="frame_class"> |
|
|
|
:class="information_class"> |
|
|
|
</avue-form> |
|
|
|
</avue-form> |
|
|
|
</span> |
|
|
|
</span> |
|
|
|
<span v-else-if="type.prop==='results'"> |
|
|
|
<span v-else-if="type.prop==='results'"> |
|
|
@ -43,7 +43,7 @@ |
|
|
|
</template> |
|
|
|
</template> |
|
|
|
<script> |
|
|
|
<script> |
|
|
|
import {getList, getDetail, add, update, remove} from "@/api/inspection/inspectiontasks"; |
|
|
|
import {getList, getDetail, add, update, remove} from "@/api/inspection/inspectiontasks"; |
|
|
|
|
|
|
|
import {getListByTaskNo, result_update, result_remove} from "@/api/inspection/inspectionresult"; |
|
|
|
import {mapGetters} from "vuex"; |
|
|
|
import {mapGetters} from "vuex"; |
|
|
|
import website from "@/config/website"; |
|
|
|
import website from "@/config/website"; |
|
|
|
import {readonly} from "vue"; |
|
|
|
import {readonly} from "vue"; |
|
|
@ -52,8 +52,17 @@ import request from "@/router/axios"; |
|
|
|
export default { |
|
|
|
export default { |
|
|
|
name: "inspectiontasksDetail", |
|
|
|
name: "inspectiontasksDetail", |
|
|
|
data () { |
|
|
|
data () { |
|
|
|
|
|
|
|
var validateTime = (rule, value, callback) => { |
|
|
|
|
|
|
|
if (value === '') { |
|
|
|
|
|
|
|
callback(new Error('请输入任务完成日期')); |
|
|
|
|
|
|
|
} else if(this.information_form.taskStartDate > value) { |
|
|
|
|
|
|
|
callback(new Error('输入的任务开始日期大于任务完成日期')); |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
callback(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}; |
|
|
|
return { |
|
|
|
return { |
|
|
|
frame_class: '', |
|
|
|
information_class: '', |
|
|
|
type: {}, |
|
|
|
type: {}, |
|
|
|
shouldShowButton:{}, |
|
|
|
shouldShowButton:{}, |
|
|
|
addUpdateShowButton:{}, |
|
|
|
addUpdateShowButton:{}, |
|
|
@ -66,7 +75,8 @@ export default { |
|
|
|
} |
|
|
|
} |
|
|
|
] |
|
|
|
] |
|
|
|
}, |
|
|
|
}, |
|
|
|
information_form: {}, |
|
|
|
information_form: { |
|
|
|
|
|
|
|
}, |
|
|
|
information_option: { |
|
|
|
information_option: { |
|
|
|
submitBtn: false, |
|
|
|
submitBtn: false, |
|
|
|
emptyBtn: false, |
|
|
|
emptyBtn: false, |
|
|
@ -114,7 +124,7 @@ export default { |
|
|
|
}] |
|
|
|
}] |
|
|
|
}, |
|
|
|
}, |
|
|
|
{ |
|
|
|
{ |
|
|
|
label: "任务生成日期", |
|
|
|
label: "任务开始日期", |
|
|
|
prop: "taskStartDate", |
|
|
|
prop: "taskStartDate", |
|
|
|
type: "date", |
|
|
|
type: "date", |
|
|
|
span: 7, |
|
|
|
span: 7, |
|
|
@ -123,7 +133,7 @@ export default { |
|
|
|
valueFormat: "yyyyMMdd", |
|
|
|
valueFormat: "yyyyMMdd", |
|
|
|
rules: [{ |
|
|
|
rules: [{ |
|
|
|
required: true, |
|
|
|
required: true, |
|
|
|
message: "请输入任务生成日期", |
|
|
|
message: "请输入任务开始日期", |
|
|
|
trigger: "blur" |
|
|
|
trigger: "blur" |
|
|
|
}] |
|
|
|
}] |
|
|
|
}, |
|
|
|
}, |
|
|
@ -135,16 +145,35 @@ export default { |
|
|
|
labelWidth: 120, |
|
|
|
labelWidth: 120, |
|
|
|
format: 'yyyy年MM月dd日', |
|
|
|
format: 'yyyy年MM月dd日', |
|
|
|
valueFormat: "yyyyMMdd", |
|
|
|
valueFormat: "yyyyMMdd", |
|
|
|
rules: [{ |
|
|
|
rules: [{required: true, validator: validateTime, trigger: 'blur' }] |
|
|
|
required: true, |
|
|
|
|
|
|
|
message: "请输入任务完成日期", |
|
|
|
|
|
|
|
trigger: "blur" |
|
|
|
|
|
|
|
}] |
|
|
|
|
|
|
|
}, |
|
|
|
}, |
|
|
|
{ |
|
|
|
{ |
|
|
|
label: "对象编号", |
|
|
|
label: "对象编号", |
|
|
|
prop: "inspectionObjId", |
|
|
|
prop: "objectNo", |
|
|
|
span: 7, |
|
|
|
span: 7, |
|
|
|
|
|
|
|
type: "select", |
|
|
|
|
|
|
|
dicUrl: "/api/inspection/inspectionobject/getObjectList", |
|
|
|
|
|
|
|
props: { |
|
|
|
|
|
|
|
label: "objectNo", |
|
|
|
|
|
|
|
value: "objectNo", |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
event: { |
|
|
|
|
|
|
|
change: (val) => { |
|
|
|
|
|
|
|
if (!val) return |
|
|
|
|
|
|
|
if (val) { |
|
|
|
|
|
|
|
request({ |
|
|
|
|
|
|
|
url: '/api/inspection/inspectionobject/getDetailList', |
|
|
|
|
|
|
|
method: 'get', |
|
|
|
|
|
|
|
params: { |
|
|
|
|
|
|
|
objectNo: val |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}).then((res) => { |
|
|
|
|
|
|
|
this.information_form.objectName = res.data.data.objectName; |
|
|
|
|
|
|
|
this.information_form.objectType = res.data.data.objectType; |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
}, |
|
|
|
rules: [{ |
|
|
|
rules: [{ |
|
|
|
required: true, |
|
|
|
required: true, |
|
|
|
message: "请输入对象编号", |
|
|
|
message: "请输入对象编号", |
|
|
@ -165,10 +194,9 @@ export default { |
|
|
|
}, |
|
|
|
}, |
|
|
|
{ |
|
|
|
{ |
|
|
|
label: "路线编号", |
|
|
|
label: "路线编号", |
|
|
|
prop: "inspectionRouteId", |
|
|
|
prop: "routeNo", |
|
|
|
span: 7, |
|
|
|
span: 7, |
|
|
|
type: "select", |
|
|
|
type: "select", |
|
|
|
cascaderItem: ['routeName','routeType'], |
|
|
|
|
|
|
|
dicUrl: "/api/inspection/inspectionRoute/getRouteList", |
|
|
|
dicUrl: "/api/inspection/inspectionRoute/getRouteList", |
|
|
|
props: { |
|
|
|
props: { |
|
|
|
label: "routeNo", |
|
|
|
label: "routeNo", |
|
|
@ -185,8 +213,8 @@ export default { |
|
|
|
routeNo: val |
|
|
|
routeNo: val |
|
|
|
} |
|
|
|
} |
|
|
|
}).then((res) => { |
|
|
|
}).then((res) => { |
|
|
|
console.log(123) |
|
|
|
this.information_form.routeName = res.data.data.routeName; |
|
|
|
this.information_option.routeType = res.data.data.routeName; |
|
|
|
this.information_form.routeType = res.data.data.type; |
|
|
|
}) |
|
|
|
}) |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
}, |
|
|
@ -200,24 +228,43 @@ export default { |
|
|
|
{ |
|
|
|
{ |
|
|
|
label: "路线名称", |
|
|
|
label: "路线名称", |
|
|
|
prop: "routeName", |
|
|
|
prop: "routeName", |
|
|
|
// dicUrl: "/api/inspection/inspectionRoute/getDetailList?routeNo={{key}}", |
|
|
|
|
|
|
|
span: 7, |
|
|
|
span: 7, |
|
|
|
disabled: true, |
|
|
|
disabled: true, |
|
|
|
// cascaderIndex: 0, |
|
|
|
|
|
|
|
// props: { |
|
|
|
|
|
|
|
// value: "routeName", |
|
|
|
|
|
|
|
// }, |
|
|
|
|
|
|
|
}, |
|
|
|
}, |
|
|
|
{ |
|
|
|
{ |
|
|
|
label: "路线类型", |
|
|
|
label: "路线类型", |
|
|
|
prop: "routeType", |
|
|
|
prop: "routeType", |
|
|
|
span: 7, |
|
|
|
span: 7, |
|
|
|
// disabled: true, |
|
|
|
disabled: true, |
|
|
|
}, |
|
|
|
}, |
|
|
|
{ |
|
|
|
{ |
|
|
|
label: "计划编号", |
|
|
|
label: "计划编号", |
|
|
|
prop: "inspectionPlanId", |
|
|
|
prop: "planNo", |
|
|
|
span: 7, |
|
|
|
span: 7, |
|
|
|
|
|
|
|
type: "select", |
|
|
|
|
|
|
|
dicUrl: "/api/inspection/inspectionplan/getPlanList", |
|
|
|
|
|
|
|
props: { |
|
|
|
|
|
|
|
label: "planNo", |
|
|
|
|
|
|
|
value: "planNo", |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
event: { |
|
|
|
|
|
|
|
change: (val) => { |
|
|
|
|
|
|
|
if (!val) return |
|
|
|
|
|
|
|
if (val) { |
|
|
|
|
|
|
|
request({ |
|
|
|
|
|
|
|
url: '/api/inspection/inspectionplan/getDetail', |
|
|
|
|
|
|
|
method: 'get', |
|
|
|
|
|
|
|
params: { |
|
|
|
|
|
|
|
planNo: val |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}).then((res) => { |
|
|
|
|
|
|
|
this.information_form.planName = res.data.data.planName; |
|
|
|
|
|
|
|
this.information_form.planType = res.data.data.planType; |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
}, |
|
|
|
rules: [{ |
|
|
|
rules: [{ |
|
|
|
required: true, |
|
|
|
required: true, |
|
|
|
message: "请输入路线编号", |
|
|
|
message: "请输入路线编号", |
|
|
@ -268,15 +315,22 @@ export default { |
|
|
|
{ |
|
|
|
{ |
|
|
|
label: "结果编码", |
|
|
|
label: "结果编码", |
|
|
|
prop: "resultNo", |
|
|
|
prop: "resultNo", |
|
|
|
|
|
|
|
disabled:true, |
|
|
|
}, |
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
{ |
|
|
|
{ |
|
|
|
label: "任务执行开始时间", |
|
|
|
label: "任务执行开始时间", |
|
|
|
prop: "executeStartDate", |
|
|
|
prop: "executeStartDate", |
|
|
|
|
|
|
|
type: "datetime", |
|
|
|
|
|
|
|
format: 'yyyy年MM月dd日 HH时mm分', |
|
|
|
|
|
|
|
valueFormat: "yyyy年MM月dd日 HH时mm分", |
|
|
|
}, |
|
|
|
}, |
|
|
|
{ |
|
|
|
{ |
|
|
|
label: "任务执行结束时间", |
|
|
|
label: "任务执行结束时间", |
|
|
|
prop: "executeEndDate", |
|
|
|
prop: "executeEndDate", |
|
|
|
|
|
|
|
type: "datetime", |
|
|
|
|
|
|
|
format: 'yyyy年MM月dd日 HH时mm分', |
|
|
|
|
|
|
|
valueFormat: "yyyy年MM月dd日 HH时mm分", |
|
|
|
}, |
|
|
|
}, |
|
|
|
{ |
|
|
|
{ |
|
|
|
label: "巡检结果", |
|
|
|
label: "巡检结果", |
|
|
@ -308,33 +362,33 @@ export default { |
|
|
|
this.readonlyForm=true; |
|
|
|
this.readonlyForm=true; |
|
|
|
this.shouldShowButton=true; |
|
|
|
this.shouldShowButton=true; |
|
|
|
this.addUpdateShowButton=false; |
|
|
|
this.addUpdateShowButton=false; |
|
|
|
this.frame_class = 'frame_class1'; |
|
|
|
this.information_class = 'information_class'; |
|
|
|
|
|
|
|
this.SearchDetail(); |
|
|
|
}else{ |
|
|
|
}else{ |
|
|
|
const cancelReason = this.findObject(this.information_option.column, "cancelReason"); |
|
|
|
const cancelReason = this.findObject(this.information_option.column, "cancelReason"); |
|
|
|
const taskStatus = this.findObject(this.information_option.column, "taskStatus"); |
|
|
|
const taskStatus = this.findObject(this.information_option.column, "taskStatus"); |
|
|
|
|
|
|
|
const taskNo = this.findObject(this.information_option.column, "taskNo"); |
|
|
|
|
|
|
|
taskNo.value = ' '; |
|
|
|
cancelReason.display = false; |
|
|
|
cancelReason.display = false; |
|
|
|
taskStatus.display = false; |
|
|
|
taskStatus.display = false; |
|
|
|
this.readonlyForm=false; |
|
|
|
this.readonlyForm=false; |
|
|
|
this.shouldShowButton=false; |
|
|
|
this.shouldShowButton=false; |
|
|
|
this.addUpdateShowButton=true; |
|
|
|
this.addUpdateShowButton=true; |
|
|
|
this.frame_class = null; |
|
|
|
this.information_class = null; |
|
|
|
} |
|
|
|
} |
|
|
|
this.SearchDetail(); |
|
|
|
|
|
|
|
}, |
|
|
|
}, |
|
|
|
methods: { |
|
|
|
methods: { |
|
|
|
handleFormSubmit() { |
|
|
|
handleFormSubmit() { |
|
|
|
const form = this.$refs.information_form; |
|
|
|
this.$refs.information_crud.validate((valid, done, msg) => { |
|
|
|
form.validate((valid) => { |
|
|
|
|
|
|
|
if (valid) { |
|
|
|
if (valid) { |
|
|
|
|
|
|
|
done() |
|
|
|
this.Submit(); |
|
|
|
this.Submit(); |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
this.$message({ |
|
|
|
console.log('error submit!!'); |
|
|
|
type: "warning", |
|
|
|
return false; |
|
|
|
message: "请输入必要信息!" |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
}); |
|
|
|
}) |
|
|
|
}, |
|
|
|
}, |
|
|
|
// 处理表单提交 |
|
|
|
// 处理表单提交 |
|
|
|
Submit() { |
|
|
|
Submit() { |
|
|
@ -389,15 +443,16 @@ export default { |
|
|
|
this.shouldShowButton=false; |
|
|
|
this.shouldShowButton=false; |
|
|
|
this.addUpdateShowButton=true; |
|
|
|
this.addUpdateShowButton=true; |
|
|
|
this.readonlyForm=false; |
|
|
|
this.readonlyForm=false; |
|
|
|
this.frame_class = null; |
|
|
|
this.information_class = null; |
|
|
|
}, |
|
|
|
}, |
|
|
|
handleChange (column) { |
|
|
|
handleChange (column) { |
|
|
|
this.type = column |
|
|
|
this.type = column |
|
|
|
|
|
|
|
this.onLoad(); |
|
|
|
|
|
|
|
|
|
|
|
}, |
|
|
|
}, |
|
|
|
// 巡检结果 编辑按钮处理 |
|
|
|
// 巡检结果 编辑按钮处理 |
|
|
|
results_rowUpdate (form, index, done, loading) { |
|
|
|
results_rowUpdate (form, index, done, loading) { |
|
|
|
update(form).then(() => { |
|
|
|
result_update(form).then(() => { |
|
|
|
done(form); |
|
|
|
done(form); |
|
|
|
this.$message({ |
|
|
|
this.$message({ |
|
|
|
type: "success", |
|
|
|
type: "success", |
|
|
@ -417,7 +472,7 @@ export default { |
|
|
|
type: "warning" |
|
|
|
type: "warning" |
|
|
|
}) |
|
|
|
}) |
|
|
|
.then(() => { |
|
|
|
.then(() => { |
|
|
|
return remove(form.id); |
|
|
|
return result_remove(form.id); |
|
|
|
}) |
|
|
|
}) |
|
|
|
.then(() => { |
|
|
|
.then(() => { |
|
|
|
this.onLoad(this.page); |
|
|
|
this.onLoad(this.page); |
|
|
@ -430,7 +485,6 @@ export default { |
|
|
|
|
|
|
|
|
|
|
|
SearchDetail() { |
|
|
|
SearchDetail() { |
|
|
|
getDetail(this.$route.query.id).then(res => { |
|
|
|
getDetail(this.$route.query.id).then(res => { |
|
|
|
console.log(res); |
|
|
|
|
|
|
|
this.information_form = res.data.data; |
|
|
|
this.information_form = res.data.data; |
|
|
|
}); |
|
|
|
}); |
|
|
|
}, |
|
|
|
}, |
|
|
@ -440,8 +494,8 @@ export default { |
|
|
|
}, |
|
|
|
}, |
|
|
|
onLoad(row, params = {}) { |
|
|
|
onLoad(row, params = {}) { |
|
|
|
this.loading = true; |
|
|
|
this.loading = true; |
|
|
|
getListBylegerId(this.$route.query.id).then(res => { |
|
|
|
getListByTaskNo(this.$route.query.taskNo).then(res => { |
|
|
|
this.parameters_data = res.data.data; |
|
|
|
this.results_data = res.data.data; |
|
|
|
this.loading = false; |
|
|
|
this.loading = false; |
|
|
|
}); |
|
|
|
}); |
|
|
|
}, |
|
|
|
}, |
|
|
@ -453,18 +507,22 @@ export default { |
|
|
|
background-color: #3366cc !important; |
|
|
|
background-color: #3366cc !important; |
|
|
|
color: #FFFFFF !important; |
|
|
|
color: #FFFFFF !important; |
|
|
|
} |
|
|
|
} |
|
|
|
.frame_class1 input.el-input__inner { |
|
|
|
.information_class input.el-input__inner { |
|
|
|
border: none; |
|
|
|
border: none; |
|
|
|
box-shadow: none; |
|
|
|
box-shadow: none; |
|
|
|
outline: none; |
|
|
|
outline: none; |
|
|
|
pointer-events: none; |
|
|
|
pointer-events: none; |
|
|
|
} |
|
|
|
} |
|
|
|
.frame_class1 .el-input__icon { |
|
|
|
.information_class .el-input__icon { |
|
|
|
display: none; |
|
|
|
display: none; |
|
|
|
} |
|
|
|
} |
|
|
|
.frame_class1 .el-input--prefix .el-input__inner { |
|
|
|
.information_class .el-input--prefix .el-input__inner { |
|
|
|
padding-left: 15px; |
|
|
|
padding-left: 15px; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
.information_class input::placeholder { |
|
|
|
|
|
|
|
color: transparent; |
|
|
|
|
|
|
|
display: none; /* 默认隐藏 */ |
|
|
|
|
|
|
|
} |
|
|
|
.container { |
|
|
|
.container { |
|
|
|
display: flex; |
|
|
|
display: flex; |
|
|
|
justify-content: flex-end; /* 将子元素推到容器的末端 */ |
|
|
|
justify-content: flex-end; /* 将子元素推到容器的末端 */ |
|
|
|