| | |
| | | name: [ |
| | | { required: true, message: "预案名称不能为空", trigger: "change" }, |
| | | ], |
| | | // remark: [ |
| | | // { required: true, message: "备注不能为空", trigger: "blur" }, |
| | | // ], |
| | | }, |
| | | }; |
| | | }, |
| | |
| | | }); |
| | | 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; |
| | |
| | | this.form.fileList=this.fileList |
| | | } |
| | | if (this.form.fileType==1){ |
| | | let fileList = [] |
| | | if (this.fileUrl!=""){ |
| | | let file={ |
| | | fileUrl:this.fileUrl, |
| | | fileName:this.fileName |
| | | } |
| | | this.form.fileList=[file] |
| | | fileList.push(file) |
| | | } |
| | | this.form.fileList=fileList |
| | | } |
| | | if (this.title === "新增") { |
| | | emergencyPlanAdd(this.form).then((res) => { |
| | |
| | | message: "新增成功", |
| | | title: "成功", |
| | | }); |
| | | }else{ |
| | | this.$message.error(res.data.message); |
| | | } |
| | | }); |
| | | } |
| | |
| | | message: "编辑成功", |
| | | title: "成功", |
| | | }); |
| | | }else{ |
| | | this.$message.error(res.data.message); |
| | | } |
| | | }); |
| | | } |