From 5c628344a3f0cd4fd6a7ce48696e22b7fb7314f8 Mon Sep 17 00:00:00 2001
From: xiangpei <xiangpei@timesnew.cn>
Date: 星期二, 12 三月 2024 17:54:17 +0800
Subject: [PATCH] 点位批量添加优化
---
src/views/system/check-template/index.vue | 38 ++++++++++++++++++++------------------
1 files changed, 20 insertions(+), 18 deletions(-)
diff --git a/src/views/system/check-template/index.vue b/src/views/system/check-template/index.vue
index 7449a69..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>
@@ -76,7 +72,7 @@
<el-table-column type="selection" width="55" align="center" />
<el-table-column label="妯℃澘鍚嶇О" align="center" prop="templateName" />
<el-table-column label="璋冩暣绯绘暟" align="center" prop="adjustCoefficient" />
- <el-table-column label="璋冩暣璁$畻鏂瑰紡" align="center" prop="adjustWay" />
+ <el-table-column label="璋冩暣绯绘暟璁$畻鏂瑰紡" align="center" prop="adjustWay" />
<el-table-column label="鐘舵��" align="center" prop="status" />
<el-table-column label="鎿嶄綔" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope">
@@ -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>
@@ -109,10 +103,10 @@
<!-- 娣诲姞鎴栦慨鏀硅�冩牳妯℃澘瀵硅瘽妗� -->
<el-dialog :title="title" :visible.sync="open" width="700px" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
- <el-form-item label="妯℃澘鍚嶇О" prop="adjustCoefficient">
- <el-input v-model="form.tempalteName" placeholder="璇疯緭鍏ユā鏉垮悕绉�" />
+ <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() {
@@ -312,6 +309,8 @@
const id = row.id || this.ids
getCheckTemplate(id).then(response => {
this.form = response.data;
+ this.tempRuleFormList = this.form.ruleFormList;
+ this.ruleFormList = this.form.ruleFormList;
this.open = true;
this.title = "淇敼鑰冩牳妯℃澘";
});
@@ -320,10 +319,13 @@
submitForm() {
this.$refs["form"].validate(valid => {
if (valid) {
+ 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