From fe2617a36f52c16f83e7d3cb19d911bb91a3b79f Mon Sep 17 00:00:00 2001 From: lyfO_o <764716047@qq.com> Date: 星期一, 13 六月 2022 09:00:28 +0800 Subject: [PATCH] 删除固定菜单 --- src/views/safetyproduction/reviewXG.vue | 49 +++++++++++++++++++++++++++++++++++++++---------- 1 files changed, 39 insertions(+), 10 deletions(-) diff --git a/src/views/safetyproduction/reviewXG.vue b/src/views/safetyproduction/reviewXG.vue index 190f272..4598c5f 100644 --- a/src/views/safetyproduction/reviewXG.vue +++ b/src/views/safetyproduction/reviewXG.vue @@ -150,9 +150,9 @@ </div> </div> - <el-dialog title="扣分详情" :visible.sync="dialogVisible" width="30%"> - <el-form ref="form" :model="formInline" label-width="54px"> - <el-form-item label="说明"> + <el-dialog title="扣分详情" :visible.sync="dialogVisible" :close-on-click-modal="false" width="30%"> + <el-form ref="form" :rules="rules" :model="formInline" label-width="54px"> + <el-form-item label="说明" prop="name"> <el-input v-model="formInline.name"></el-input> </el-form-item> <el-form-item label="备注"> @@ -171,7 +171,7 @@ <el-button type="primary" class="btns" @click="listAdd" >确 定</el-button > - <el-button @click="dialogVisible = false">取 消</el-button> + <el-button @click="bacQx">取 消</el-button> </span> </el-dialog> </div> @@ -192,10 +192,18 @@ name: "", remark: "", }, + name:"", + typeid:'', + rules: { + name: [ + { required: true, message: "说明不能为空", trigger: "change" }, + ],} }; }, created() { - this.id = this.$route.query.id.id; + this.id = this.$route.query.idX; + this.typeid=this.$route.query.id; + this.name = this.$route.query.name this.safeT(this.id); }, methods: { @@ -207,6 +215,9 @@ }); }, coAdd(val, type) { + this.$nextTick(() => { + this.$refs["form"].clearValidate(); + }); this.titleN = type; if (type == "新增") { this.dialogVisible = true; @@ -219,10 +230,13 @@ this.index = this.form.deductionList.findIndex( (item) => item.name == val.name ); - this.formInline = val; + // this.formInline = val; + this.formInline=JSON.parse(JSON.stringify(val)); } }, listAdd() { + this.$refs["form"].validate((valid) => { + if (valid) { if (this.titleN == "新增") { this.form.deductionList.push(this.formInline); this.dialogVisible = false; @@ -231,6 +245,8 @@ this.form.deductionList[this.index].space = this.formInline.space; this.dialogVisible = false; } + } + }); }, listDel(val) { var i = this.form.deductionList.findIndex( @@ -240,7 +256,6 @@ }, safetyInspectionItemA() { safetyInspectionItemMod(this.form).then((res) => { - console.log(res) if (res.data.code == 200) { this.$notify({ type: "success", @@ -249,7 +264,11 @@ title: "成功", }); this.$router.push({ - path:"/new" + path:"/new", + query:{ + name:this.name, + id:this.typeid + } }) } else { this.$message({ @@ -261,8 +280,16 @@ }, back(){ this.$router.push({ - path:"/new" + path:"/new", + query:{ + name:this.name, + id:this.typeid + } }) + }, + bacQx(){ + this.dialogVisible = false; + this.safeT(this.id); }, handleClick() { this.dialogVisible = true; @@ -293,6 +320,8 @@ width: 100%; background-color: white; border-radius: 5px; + height: 850px; + overflow-y:overlay; } .box-right-content { padding: 15px 0; @@ -301,4 +330,4 @@ background-color: #034ea2; border: 1px solid #034ea2; } -</style> \ No newline at end of file +</style> -- Gitblit v1.9.2