|
@@ -11,8 +11,8 @@
|
|
|
|
|
|
<!-- 循环分组 -->
|
|
|
<el-col :span="24" style="padding-right: 0;" v-loading="rule_trees_load">
|
|
|
- <el-menu class="rule_name" :unique-opened="true">
|
|
|
- <el-submenu :index="index.toString()" v-for="(item, index) in rule_list" :key="index">
|
|
|
+ <el-menu :default-active='default_active' class="rule_name" :unique-opened="true" :default-openeds="openeds">
|
|
|
+ <el-submenu :index="index.toString()" v-for="(item, index) in rule_list" :key="index" >
|
|
|
<template slot="title">
|
|
|
<div style="width: 80%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap; height: 47px;line-height: 47px;" >
|
|
|
<i class="el-icon-edit-outline title_top" @click.stop="edit_grouping(item)"></i>
|
|
@@ -33,7 +33,7 @@
|
|
|
</div>
|
|
|
|
|
|
<div class="terr-right border-right flex-1" v-loading="table_loading">
|
|
|
- <el-col :span="24" v-show="rule_list.length == 0 || item_list.length == 0" style="text-align: center;margin: 0 auto;position: relative;top: 30%;">
|
|
|
+ <el-col :span="24" v-show="rule_list.length == 0 || item_list.length == 0 || diyige == true" style="text-align: center;margin: 0 auto;position: relative;top: 30%;">
|
|
|
<p><img src="@/assets/image/nodata_default.png" width="200px" alt="" /></p>
|
|
|
<p style="color: #909399;">
|
|
|
还没有
|
|
@@ -49,7 +49,7 @@
|
|
|
<span style="color: #26A2FF;cursor:pointer" @click="add_rules_detail">【添加加分项】</span>
|
|
|
</p>
|
|
|
</el-col>
|
|
|
- <el-col v-if="item_list.length != 0">
|
|
|
+ <el-col v-if="item_list.length != 0 && diyige == false" >
|
|
|
<el-row>
|
|
|
<!-- 移除隐藏 -->
|
|
|
<!-- <el-col :span="24" style="font-size:20px;color:#303133;line-height:36px;display:flex;flex-wrap: wrap;">
|
|
@@ -148,7 +148,7 @@
|
|
|
></el-input>
|
|
|
<span data-v-a17f1960 style="display: block; font-size: 12px; color: rgb(96, 98, 102);text-align: left;">固定加分加B分</span>
|
|
|
</el-form-item>
|
|
|
- <el-form-item label="是否与考勤挂钩" prop="is_attendance"><el-switch v-model="is_attendance"></el-switch></el-form-item>
|
|
|
+ <!-- <el-form-item label="是否与考勤挂钩" prop="is_attendance"><el-switch v-model="is_attendance"></el-switch></el-form-item> -->
|
|
|
<div style="overflow: hidden;">
|
|
|
<el-button type="danger" v-show="rules_detail_title" class="fl" @click="del_rules_detail(rules_detail_form)" style="float:left" :disabled="disabled">
|
|
|
删除
|
|
@@ -195,6 +195,9 @@ import noData from '@/components/noData';
|
|
|
export default {
|
|
|
data() {
|
|
|
return {
|
|
|
+ openeds:['1'],
|
|
|
+ default_active:'',
|
|
|
+ diyige:false,
|
|
|
// grouping_Json:[],
|
|
|
jieguoId: '',
|
|
|
table_list: [],
|
|
@@ -308,13 +311,20 @@ export default {
|
|
|
EmployeeSelector1,
|
|
|
noData
|
|
|
},
|
|
|
+ watch:{
|
|
|
+ // right_rules_detail(newVal, oldVal){
|
|
|
+ // console.log(this.default_active)
|
|
|
+ // this.default_active = '0'
|
|
|
+ // console.log(newVal, oldVal)
|
|
|
+ // }
|
|
|
+ },
|
|
|
created() {},
|
|
|
mounted() {
|
|
|
- if (localStorage.getItem('voluntarilyPoint')) {
|
|
|
- this.tips_show = false;
|
|
|
- } else {
|
|
|
- this.tips_show = true;
|
|
|
- }
|
|
|
+ // if (localStorage.getItem('voluntarilyPoint')) {
|
|
|
+ // this.tips_show = false;
|
|
|
+ // } else {
|
|
|
+ // this.tips_show = true;
|
|
|
+ // }
|
|
|
this.get_role_lists();
|
|
|
},
|
|
|
methods: {
|
|
@@ -445,7 +455,7 @@ export default {
|
|
|
this.page = this.page - 1;
|
|
|
}
|
|
|
}
|
|
|
- self.open_right();
|
|
|
+ self.open_right();
|
|
|
} else {
|
|
|
self.$message.error(res.data.msg);
|
|
|
}
|
|
@@ -597,6 +607,9 @@ export default {
|
|
|
this.$refs[form].resetFields();
|
|
|
},
|
|
|
open_right(data) {
|
|
|
+ console.log(data)
|
|
|
+ this.diyige = false
|
|
|
+ console.log(data)
|
|
|
let self = this;
|
|
|
self.table_loading = true;
|
|
|
if (data) {
|
|
@@ -655,14 +668,14 @@ export default {
|
|
|
this.dialogFormVisible = false;
|
|
|
this.disabled = false;
|
|
|
if (res.data.code == 1) {
|
|
|
- this.get_role_lists();
|
|
|
this.$message.success(res.data.msg);
|
|
|
this.rules_detail_show = false;
|
|
|
- this.get_rule_trees();
|
|
|
+ this.get_role_lists();
|
|
|
} else {
|
|
|
this.dialogFormVisible = false;
|
|
|
this.disabled = false;
|
|
|
this.$message.error(res.data.msg);
|
|
|
+ this.get_role_lists();
|
|
|
}
|
|
|
})
|
|
|
.catch(err => {
|
|
@@ -767,6 +780,7 @@ export default {
|
|
|
get_role_lists() {
|
|
|
this.table_loading = true;
|
|
|
this.rule_trees_load = true;
|
|
|
+ this.openeds = ['0'];//修改后 修改高亮选中项
|
|
|
this.$axios.get('/api/integral/rule/trees', {
|
|
|
params: {
|
|
|
cycle_type: '2'
|
|
@@ -777,16 +791,47 @@ export default {
|
|
|
this.rule_list = res.data.data.rule_tree;
|
|
|
this.item_list = res.data.data.item_list;
|
|
|
this.rule_trees_load = false;
|
|
|
+ // if (this.item_list !== null) {
|
|
|
+ // for (const key in this.item_list) {
|
|
|
+ // for (let i = 0; i < this.item_list[key].length; i++) {
|
|
|
+ // if (i == 0) {
|
|
|
+ // this.open_right(this.item_list[key][i]);
|
|
|
+ // return false;
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+ // }
|
|
|
if (this.item_list !== null) {
|
|
|
for (const key in this.item_list) {
|
|
|
for (let i = 0; i < this.item_list[key].length; i++) {
|
|
|
if (i == 0) {
|
|
|
- this.open_right(this.item_list[key][i]);
|
|
|
+ if(this.rule_list[0].id == this.item_list[key][0].rule_id){
|
|
|
+ this.diyige = false
|
|
|
+ console.log('不为空')
|
|
|
+ this.open_right(this.item_list[key][i]);
|
|
|
+ }else{
|
|
|
+ this.diyige = true
|
|
|
+ console.log('这是第一个为空时执行的方法')
|
|
|
+ this.staff_loading = false;
|
|
|
+ this.rule_trees_load = false;
|
|
|
+ this.table_loading = false;
|
|
|
+ }
|
|
|
+ // if(this.item_list[key] == undefined){
|
|
|
+ // console.log('这是第一个为空时执行的方法')
|
|
|
+
|
|
|
+ // }else{
|
|
|
+ // this.open_right(this.item_list[key][i]);
|
|
|
+ // }
|
|
|
return false;
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+ // console.log(this.item_list[0])
|
|
|
+ // if(this.item_list['rule_108'] == undefined){
|
|
|
+ // console.log('ccccccccc')
|
|
|
+ // }else{
|
|
|
+ // }
|
|
|
this.table_loading = false;
|
|
|
});
|
|
|
}
|