From 31c8d5e4acaebbe4d7d20247239235100057a306 Mon Sep 17 00:00:00 2001 From: x_z Date: Thu, 13 Oct 2022 21:31:47 +0800 Subject: [PATCH] =?UTF-8?q?1.=E4=BF=AE=E5=A4=8D=E9=83=A8=E5=88=86bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/sys/stackRules.vue | 45 +++++++++++++++++++++++++----------- 1 file changed, 31 insertions(+), 14 deletions(-) diff --git a/src/views/sys/stackRules.vue b/src/views/sys/stackRules.vue index ab2f25a..339f10d 100644 --- a/src/views/sys/stackRules.vue +++ b/src/views/sys/stackRules.vue @@ -3,7 +3,7 @@ - + @@ -78,7 +78,7 @@ :close-on-press-escape="false" width="40%" > - + @@ -138,7 +138,7 @@ - + import {getStackRulesList, saveStackRules, deleteStackRules} from "@/api/basic/stackRules"; +import {isBlank} from "@/utils/strUtil"; export default { data() { return { query: { - name: "", + key: "", customerId: this.$store.getters.customerId, status: null, page: 1, @@ -211,7 +212,7 @@ export default { path: "" }); this.query = { - name: "", + key: "", customerId: this.$store.getters.customerId, status: null, page: 1, @@ -221,12 +222,11 @@ export default { }, resetForm() { this.$nextTick(() => { - this.$refs['formData'].resetFields(); - this.$refs["formData"].clearValidate(); + this.$refs['dataForm'].resetFields(); + this.$refs["dataForm"].clearValidate(); }); }, search() { - console.log(this.$store.getters.customerId); this.query.page = 1; this.getList(); }, @@ -246,25 +246,42 @@ export default { }, cancelDialog() { this.editRulesVisible = false; + this.getList(); }, handleModifyClick(row) { this.editRulesVisible = true; this.formData = row; + this.formName = 'edit'; }, handleAddClick() { this.editRulesVisible = true; this.formName = 'add'; - this.resetForm(); - }, - change() { + this.formData = { + id: null, + name: null, + prefix: null, + startNum: null, + step: 1, + serialNum: null, + status: 1, + remark: null, + customerId: this.$store.getters.customerId + } }, - //新建规则 + //新建、修改规则 submit() { - console.log(this.$store.getters.customerId); + if (isBlank(this.formData.name)) { + this.$message.error("请输入规则信息"); + return; + } saveStackRules(this.formName, this.formData).then((res) => { if (res.code === 20000) { this.editRulesVisible = false; - this.$message.success(res.message); + if (this.formName === 'add') { + this.$message.success("添加成功"); + } else { + this.$message.success("修改成功"); + } this.getList(); } else { this.$message.error(res.message);