From 2ef9fc6d545b03dcd493a1b94ecfc852c51a6f79 Mon Sep 17 00:00:00 2001
From: xiangpei <xiangpei@timesnew.cn>
Date: 星期三, 20 三月 2024 17:18:06 +0800
Subject: [PATCH] 优化
---
src/views/system/check-template/index.vue | 104 ++++++++++++++++++++++++++++++++++++++++++++--------
1 files changed, 88 insertions(+), 16 deletions(-)
diff --git a/src/views/system/check-template/index.vue b/src/views/system/check-template/index.vue
index 876c409..52dc255 100644
--- a/src/views/system/check-template/index.vue
+++ b/src/views/system/check-template/index.vue
@@ -9,6 +9,14 @@
@keyup.enter.native="handleQuery"
/>
</el-form-item>
+ <el-form-item label="鑰冩牳瀵硅薄" prop="unitName">
+ <el-input
+ v-model="queryParams.status"
+ placeholder="璇疯緭鍏ヨ�冩牳瀵硅薄"
+ clearable
+ @keyup.enter.native="handleQuery"
+ />
+ </el-form-item>
<el-form-item label="鍒涘缓鏃堕棿">
<el-date-picker
v-model="daterangeCreateTime"
@@ -34,7 +42,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 +52,6 @@
size="mini"
:disabled="single"
@click="handleUpdate"
- v-hasPermi="['system:checkTemplate:edit']"
>淇敼</el-button>
</el-col>
<el-col :span="1.5">
@@ -56,7 +62,6 @@
size="mini"
:disabled="multiple"
@click="handleDelete"
- v-hasPermi="['system:checkTemplate:remove']"
>鍒犻櫎</el-button>
</el-col>
<el-col :span="1.5">
@@ -66,7 +71,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>
@@ -75,6 +79,7 @@
<el-table v-loading="loading" :data="checkTemplateList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" />
<el-table-column label="妯℃澘鍚嶇О" align="center" prop="templateName" />
+ <el-table-column label="鑰冩牳瀵硅薄" align="center" prop="unitName" />
<el-table-column label="璋冩暣绯绘暟" align="center" prop="adjustCoefficient" />
<el-table-column label="璋冩暣绯绘暟璁$畻鏂瑰紡" align="center" prop="adjustWay" />
<el-table-column label="鐘舵��" align="center" prop="status" />
@@ -85,14 +90,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 +115,18 @@
<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="unitName">
+ <div class="block">
+ <span class="demonstration"></span>
+ <el-cascader
+ v-model="value"
+ :options="options"
+ :props = "props"
+ @change="handleChange"></el-cascader>
+ </div>
+
+ </el-form-item>
+ <el-form-item label="鑰冩牳瑙勫垯" prop="tempRuleFormList">
<div class="row-warp">
<div class="row" v-for="(form) in tempRuleFormList">
<div class="row-left">
@@ -174,12 +188,54 @@
<script>
import { listCheckTemplate, getCheckTemplate, delCheckTemplate, addCheckTemplate, updateCheckTemplate } from "@/api/platform/check-template";
import { ruleSelect } from '../../../api/platform/check-rule'
+import { unitSelect } from '../../../api/platform/unit'
export default {
name: "CheckTemplate",
data() {
return {
+ props: { multiple: true },
+ value: [],
+ options: [{
+ value: 'city',
+ label: '鍖哄幙',
+ children: [{
+ value: 'fushun',
+ label: '瀵岄『鍘�',
+ }, {
+ value: 'rong',
+ label: '鑽e幙',
+ },{
+ value: 'gaoxin',
+ label: '楂樻柊鍖�',
+ },{
+ value: 'ziliujing',
+ label: '鑷祦浜曞尯',
+ },{
+ value: 'gongjing',
+ label: '璐′簳鍖�',
+ },{
+ value: 'daan',
+ label: '澶у畨鍖�',
+ },{
+ value: 'yantan',
+ label: '娌挎哗鍖�',
+ },
+ ]
+ }, {
+ value: 'company',
+ label: '鍏徃',
+ children: [{
+ value: 'yunwei',
+ label: '鎴愰兘x杩愮淮',
+ }, {
+ value: 'yunwei2',
+ label: '鑷础x杩愮淮',
+ }, ]
+ },
+ ],
ruleList: [],
+ unitList: [],
// 涓存椂瑙勫垯琛ㄥ崟
tempRuleForm: {},
// 涓存椂瑙勫垯琛ㄥ崟鍒楄〃
@@ -217,6 +273,9 @@
form: {},
// 琛ㄥ崟鏍¢獙
rules: {
+ templateName: [
+ { required: true, message: "妯℃澘鍚嶇О涓嶈兘涓虹┖", trigger: "blur" }
+ ],
adjustCoefficient: [
{ required: true, message: "璋冩暣绯绘暟涓嶈兘涓虹┖", trigger: "blur" }
],
@@ -229,27 +288,37 @@
created() {
this.getList();
this.selectCheckRule();
+ this.selectUnit();
},
methods: {
+ handleChange(value) {
+ console.log(value);
+ },
removeRule(form) {
console.log(form)
this.ruleFormList = this.ruleFormList.filter(item => item !== form);
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() {
ruleSelect().then(res => {
this.ruleList = res.data;
+ })
+ },
+ // 杩愮淮鍏徃涓嬫媺鏁版嵁
+ selectUnit() {
+ unitSelect().then(res => {
+ this.unitList = res.data;
})
},
/** 鏌ヨ鑰冩牳妯℃澘鍒楄〃 */
@@ -313,6 +382,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 +391,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