|
|
|
|
@ -292,24 +292,24 @@ export default {
|
|
|
|
|
form: {},
|
|
|
|
|
// 表单校验
|
|
|
|
|
rules: {
|
|
|
|
|
inspectRouteId: [
|
|
|
|
|
/* inspectRouteId: [
|
|
|
|
|
{ required: true, message: "线路ID,关联dms_base_inspect_route的inspect_route_id不能为空", trigger: "blur" }
|
|
|
|
|
],
|
|
|
|
|
deviceId: [
|
|
|
|
|
],*/
|
|
|
|
|
/* deviceId: [
|
|
|
|
|
{ required: true, message: "巡检设备ID,关联dms_base_device_ledger的device_id不能为空", trigger: "blur" }
|
|
|
|
|
],
|
|
|
|
|
isFlag: [
|
|
|
|
|
],*/
|
|
|
|
|
/* isFlag: [
|
|
|
|
|
{ required: true, message: "是否标识:1-是;0-否不能为空", trigger: "blur" }
|
|
|
|
|
],
|
|
|
|
|
],*/
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
},
|
|
|
|
|
created() {
|
|
|
|
|
const inspectRouteid = this.$route.params && this.$route.params.routeCode;
|
|
|
|
|
console.log(inspectRouteid)
|
|
|
|
|
this.inspectRouteIdCheck = inspectRouteid;
|
|
|
|
|
this.queryParams.inspectRouteId = inspectRouteid;
|
|
|
|
|
this.form.inspectRouteId = inspectRouteid;
|
|
|
|
|
const inspectRouteId = this.$route.params && this.$route.params.inspectRouteId;
|
|
|
|
|
console.log(inspectRouteId)
|
|
|
|
|
this.inspectRouteIdCheck = inspectRouteId;
|
|
|
|
|
this.queryParams.inspectRouteId = inspectRouteId;
|
|
|
|
|
this.reset();
|
|
|
|
|
this.getList();
|
|
|
|
|
this.getRoute();
|
|
|
|
|
this.getDevice();
|
|
|
|
|
@ -364,9 +364,10 @@ export default {
|
|
|
|
|
reset() {
|
|
|
|
|
this.form = {
|
|
|
|
|
routeDetailId: null,
|
|
|
|
|
inspectRouteId: null,
|
|
|
|
|
inspectRouteId: this.inspectRouteIdCheck,
|
|
|
|
|
lineStep: null,
|
|
|
|
|
deviceId: null,
|
|
|
|
|
machineId: null,
|
|
|
|
|
inspectStandard: null,
|
|
|
|
|
isFlag: null,
|
|
|
|
|
remark: null
|
|
|
|
|
@ -393,7 +394,6 @@ export default {
|
|
|
|
|
handleAdd() {
|
|
|
|
|
this.reset();
|
|
|
|
|
this.open = true;
|
|
|
|
|
this.form.inspectRouteId = this.inspectRouteIdCheck;
|
|
|
|
|
this.title = "添加巡检线路明细";
|
|
|
|
|
},
|
|
|
|
|
/** 修改按钮操作 */
|
|
|
|
|
@ -401,7 +401,8 @@ export default {
|
|
|
|
|
this.reset();
|
|
|
|
|
const routeDetailId = row.routeDetailId || this.ids
|
|
|
|
|
getDmsInspectRouteDetail(routeDetailId).then(response => {
|
|
|
|
|
this.form = response.data;
|
|
|
|
|
// 使用 Object.assign 保持响应式引用,并确保所有字段完整
|
|
|
|
|
Object.assign(this.form, response.data);
|
|
|
|
|
this.open = true;
|
|
|
|
|
this.title = "修改巡检线路明细";
|
|
|
|
|
});
|
|
|
|
|
@ -410,6 +411,11 @@ export default {
|
|
|
|
|
submitForm() {
|
|
|
|
|
this.$refs["form"].validate(valid => {
|
|
|
|
|
if (valid) {
|
|
|
|
|
// 前置校验:deviceId 不能为空
|
|
|
|
|
if (!this.form.deviceId) {
|
|
|
|
|
this.$modal.msgWarning("请选择巡检设备");
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
if (this.form.routeDetailId != null) {
|
|
|
|
|
updateDmsInspectRouteDetail(this.form).then(response => {
|
|
|
|
|
this.$modal.msgSuccess("修改成功");
|
|
|
|
|
|