From a49ae63a6f96d10b8ec9fa479a0c28c5df4537e7 Mon Sep 17 00:00:00 2001
From: songhuangfeng123 <shf18767906695@163.com>
Date: 星期四, 31 三月 2022 16:45:59 +0800
Subject: [PATCH] fix
---
src/views/safetyproduction/feature.vue | 1 +
src/views/contingencyplan/index.vue | 29 ++++++++++++++++-------------
2 files changed, 17 insertions(+), 13 deletions(-)
diff --git a/src/views/contingencyplan/index.vue b/src/views/contingencyplan/index.vue
index ff3fd23..8caf0b3 100644
--- a/src/views/contingencyplan/index.vue
+++ b/src/views/contingencyplan/index.vue
@@ -126,9 +126,6 @@
name: [
{ required: true, message: "预案名称不能为空", trigger: "change" },
],
- // remark: [
- // { required: true, message: "备注不能为空", trigger: "blur" },
- // ],
},
};
},
@@ -176,12 +173,10 @@
});
if (type === "新增") {
this.title = "新增";
- this.form = {
- name: "",
- fileType: 0,
- fileList: [],
- remark: "",
- };
+ this.form = {};
+ this.fileUrl="";
+ this.fileName="";
+ this.fileList=[]
} else {
this.title = "编辑";
this.form = value;
@@ -200,11 +195,15 @@
this.form.fileList=this.fileList
}
if (this.form.fileType==1){
- let file={
- fileUrl:this.fileUrl,
- fileName:this.fileName
+ let fileList = []
+ if (this.fileUrl!=""){
+ let file={
+ fileUrl:this.fileUrl,
+ fileName:this.fileName
+ }
+ fileList.push(file)
}
- this.form.fileList=[file]
+ this.form.fileList=fileList
}
if (this.title === "新增") {
emergencyPlanAdd(this.form).then((res) => {
@@ -217,6 +216,8 @@
message: "新增成功",
title: "成功",
});
+ }else{
+ this.$message.error(res.data.message);
}
});
}
@@ -231,6 +232,8 @@
message: "编辑成功",
title: "成功",
});
+ }else{
+ this.$message.error(res.data.message);
}
});
}
diff --git a/src/views/safetyproduction/feature.vue b/src/views/safetyproduction/feature.vue
index 6dbb6e0..a435c47 100644
--- a/src/views/safetyproduction/feature.vue
+++ b/src/views/safetyproduction/feature.vue
@@ -110,6 +110,7 @@
v-model="form.parentId"
placeholder="请选择"
style="width: 100%"
+ :disabled="title=='编辑'?true:false"
>
<el-option
v-for="item in parent"
--
Gitblit v1.9.2