From 52ebeafb1be1cd146baee8e0034c9e0e27c92c40 Mon Sep 17 00:00:00 2001
From: xiangpei <xiangpei@timesnew.cn>
Date: 星期三, 13 三月 2024 12:02:02 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/master'

---
 src/views/system/check-template/index.vue |   32 ++++++++++++++++----------------
 1 files changed, 16 insertions(+), 16 deletions(-)

diff --git a/src/views/system/check-template/index.vue b/src/views/system/check-template/index.vue
index 876c409..4ee886c 100644
--- a/src/views/system/check-template/index.vue
+++ b/src/views/system/check-template/index.vue
@@ -34,7 +34,6 @@
           icon="el-icon-plus"
           size="mini"
           @click="handleAdd"
-          v-hasPermi="['system:checkTemplate:add']"
         >鏂板</el-button>
       </el-col>
       <el-col :span="1.5">
@@ -45,7 +44,6 @@
           size="mini"
           :disabled="single"
           @click="handleUpdate"
-          v-hasPermi="['system:checkTemplate:edit']"
         >淇敼</el-button>
       </el-col>
       <el-col :span="1.5">
@@ -56,7 +54,6 @@
           size="mini"
           :disabled="multiple"
           @click="handleDelete"
-          v-hasPermi="['system:checkTemplate:remove']"
         >鍒犻櫎</el-button>
       </el-col>
       <el-col :span="1.5">
@@ -66,7 +63,6 @@
           icon="el-icon-download"
           size="mini"
           @click="handleExport"
-          v-hasPermi="['system:checkTemplate:export']"
         >瀵煎嚭</el-button>
       </el-col>
       <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
@@ -85,14 +81,12 @@
             type="text"
             icon="el-icon-edit"
             @click="handleUpdate(scope.row)"
-            v-hasPermi="['system:checkTemplate:edit']"
           >淇敼</el-button>
           <el-button
             size="mini"
             type="text"
             icon="el-icon-delete"
             @click="handleDelete(scope.row)"
-            v-hasPermi="['system:checkTemplate:remove']"
           >鍒犻櫎</el-button>
         </template>
       </el-table-column>
@@ -112,7 +106,7 @@
         <el-form-item label="妯℃澘鍚嶇О" prop="templateName">
           <el-input v-model="form.templateName" placeholder="璇疯緭鍏ユā鏉垮悕绉�" />
         </el-form-item>
-        <el-form-item label="鑰冩牳瑙勫垯">
+        <el-form-item label="鑰冩牳瑙勫垯" prop="tempRuleFormList">
           <div class="row-warp">
             <div class="row" v-for="(form) in tempRuleFormList">
               <div class="row-left">
@@ -217,6 +211,9 @@
       form: {},
       // 琛ㄥ崟鏍¢獙
       rules: {
+        templateName: [
+          { required: true, message: "妯℃澘鍚嶇О涓嶈兘涓虹┖", trigger: "blur" }
+        ],
         adjustCoefficient: [
           { required: true, message: "璋冩暣绯绘暟涓嶈兘涓虹┖", trigger: "blur" }
         ],
@@ -237,14 +234,14 @@
       this.tempRuleFormList = this.tempRuleFormList.filter(item => item !== form)
     },
     nextAdd() {
-      if (this.tempRuleFormList.length === 0) {
-        this.tempRuleFormList.push({"ruleId": null, "adjustCoefficient": null})
-      } else {
-        this.ruleFormList.push(this.tempRuleForm);
-        this.tempRuleFormList.push(this.tempRuleForm);
-        this.tempRuleForm = {};
-      }
-
+      // if (this.tempRuleFormList.length === 0) {
+      //   this.tempRuleFormList.push({"ruleId": null, "weight": null})
+      // } else {
+      //   this.ruleFormList.push(this.tempRuleForm);
+      //   this.tempRuleFormList.push(this.tempRuleForm);
+      //   this.tempRuleForm = {};
+      // }
+      this.tempRuleFormList.push({"ruleId": null, "weight": null})
     },
     // 鑰冩牳瑙勫垯涓嬫媺鏁版嵁
     selectCheckRule() {
@@ -313,6 +310,7 @@
       getCheckTemplate(id).then(response => {
         this.form = response.data;
         this.tempRuleFormList = this.form.ruleFormList;
+        this.ruleFormList = this.form.ruleFormList;
         this.open = true;
         this.title = "淇敼鑰冩牳妯℃澘";
       });
@@ -321,11 +319,13 @@
     submitForm() {
       this.$refs["form"].validate(valid => {
         if (valid) {
-          this.form.ruleFormList = this.ruleFormList;
+          this.form.ruleFormList = this.tempRuleFormList;
           if (this.form.id != null) {
             updateCheckTemplate(this.form).then(response => {
               this.$modal.msgSuccess("淇敼鎴愬姛");
               this.open = false;
+              this.tempRuleFormList = [];
+              this.form = {};
               this.getList();
             });
           } else {

--
Gitblit v1.8.0