From ea20ca083f7e5a5d2ed7521f3a75209d4516f6c7 Mon Sep 17 00:00:00 2001 From: shj <1790240199@qq.com> Date: 星期五, 01 四月 2022 16:09:33 +0800 Subject: [PATCH] 自查清单 --- src/views/contingencyplan/index.vue | 34 +++++++++++++++++++--------------- 1 files changed, 19 insertions(+), 15 deletions(-) diff --git a/src/views/contingencyplan/index.vue b/src/views/contingencyplan/index.vue index 95fafe5..8caf0b3 100644 --- a/src/views/contingencyplan/index.vue +++ b/src/views/contingencyplan/index.vue @@ -57,7 +57,7 @@ style="text-align: right;margin-top: 20px;" > </el-pagination> - <el-dialog :title="title" :visible.sync="dialogVisible" width="40%"> + <el-dialog :title="title" :visible.sync="dialogVisible":close-on-click-modal="false" width="40%"> <el-form ref="form" :model="form" :rules="rules" label-width="80px"> <el-form-item label="预案名称" prop="name"> <el-input v-model="form.name"></el-input> @@ -126,9 +126,6 @@ name: [ { required: true, message: "预案名称不能为空", trigger: "change" }, ], - // remark: [ - // { required: true, message: "备注不能为空", trigger: "blur" }, - // ], }, }; }, @@ -150,7 +147,8 @@ uploadImgSuccess(res){ let file = { fileUrl : res.fileUrl, - fileName : res.fileName + fileName : res.fileName, + url:res.url } this.fileList.push(file) }, @@ -175,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; @@ -199,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) => { @@ -216,6 +216,8 @@ message: "新增成功", title: "成功", }); + }else{ + this.$message.error(res.data.message); } }); } @@ -230,6 +232,8 @@ message: "编辑成功", title: "成功", }); + }else{ + this.$message.error(res.data.message); } }); } -- Gitblit v1.9.2