|
@@ -11,7 +11,7 @@
|
|
|
|
|
|
<!-- 循环分组 -->
|
|
<!-- 循环分组 -->
|
|
<el-col :span="24" style="padding-right: 0;" v-loading="rule_trees_load">
|
|
<el-col :span="24" style="padding-right: 0;" v-loading="rule_trees_load">
|
|
- <el-menu :default-active='default_active' class="rule_name" :unique-opened="true" :default-openeds="openeds">
|
|
|
|
|
|
+ <el-menu :default-active='default_active' class="rule_name" :unique-opened="true">
|
|
<el-submenu :index="index.toString()" v-for="(item, index) in rule_list" :key="index" >
|
|
<el-submenu :index="index.toString()" v-for="(item, index) in rule_list" :key="index" >
|
|
<template slot="title">
|
|
<template slot="title">
|
|
<div style="width: 80%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap; height: 47px;line-height: 47px;" >
|
|
<div style="width: 80%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap; height: 47px;line-height: 47px;" >
|
|
@@ -187,6 +187,8 @@ import noData from '@/components/noData';
|
|
export default {
|
|
export default {
|
|
data() {
|
|
data() {
|
|
return {
|
|
return {
|
|
|
|
+ pd_tianjia:false,
|
|
|
|
+ dianji:{},
|
|
openeds:['1'],
|
|
openeds:['1'],
|
|
default_active:'',
|
|
default_active:'',
|
|
diyige:false,
|
|
diyige:false,
|
|
@@ -383,8 +385,25 @@ export default {
|
|
// self.err_open_right();
|
|
// self.err_open_right();
|
|
|
|
|
|
// self.open_right();
|
|
// self.open_right();
|
|
-
|
|
|
|
|
|
+
|
|
self.get_role_lists();
|
|
self.get_role_lists();
|
|
|
|
+ if(this.pd_tianjia == true){
|
|
|
|
+ let user_FH = JSON.parse(localStorage.getItem("user_FH"))
|
|
|
|
+ for (const key in user_FH) {
|
|
|
|
+ for (let i = 0; i < user_FH[key].length; i++) {
|
|
|
|
+ if (i == 0) {
|
|
|
|
+ this.default_active = '0'
|
|
|
|
+ this.open_right(user_FH[key][i]);
|
|
|
|
+ setTimeout(()=>{
|
|
|
|
+ this.default_active = ''
|
|
|
|
+ this.pd_tianjia = false
|
|
|
|
+ },500)
|
|
|
|
+ return false
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
} else {
|
|
} else {
|
|
self.$message.error(res.data.msg);
|
|
self.$message.error(res.data.msg);
|
|
}
|
|
}
|
|
@@ -427,7 +446,7 @@ export default {
|
|
this.page = this.page - 1;
|
|
this.page = this.page - 1;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- self.open_right();
|
|
|
|
|
|
+ self.get_role_lists();
|
|
} else {
|
|
} else {
|
|
self.$message.error(res.data.msg);
|
|
self.$message.error(res.data.msg);
|
|
}
|
|
}
|
|
@@ -471,7 +490,7 @@ export default {
|
|
} else {
|
|
} else {
|
|
self.rules_detail_form.is_attendance = 0;
|
|
self.rules_detail_form.is_attendance = 0;
|
|
}
|
|
}
|
|
- var usl=this.rules_detail_title ? 'api/integral/rule/items/edit' : '/api/integral/rule/items';
|
|
|
|
|
|
+ var url=this.rules_detail_title ? 'api/integral/rule/items/edit' : '/api/integral/rule/items';
|
|
self.$axios('post',url,data).then(res => {
|
|
self.$axios('post',url,data).then(res => {
|
|
this.disabled = false;
|
|
this.disabled = false;
|
|
this.dialogFormVisible = false;
|
|
this.dialogFormVisible = false;
|
|
@@ -541,6 +560,7 @@ export default {
|
|
// self.jieguoId = res.data.data.item_id;
|
|
// self.jieguoId = res.data.data.item_id;
|
|
self.add_employee_id = res.data.data.item_id;
|
|
self.add_employee_id = res.data.data.item_id;
|
|
self.add_rulse_id = self.rules_detail_form.rule_id;
|
|
self.add_rulse_id = self.rules_detail_form.rule_id;
|
|
|
|
+ // this.get_role_lists()
|
|
if (this.rules_detail_title == false) {
|
|
if (this.rules_detail_title == false) {
|
|
setTimeout(() => {
|
|
setTimeout(() => {
|
|
self.add_employee_show = true;
|
|
self.add_employee_show = true;
|
|
@@ -558,6 +578,9 @@ export default {
|
|
})
|
|
})
|
|
.finally(() => {
|
|
.finally(() => {
|
|
self.loading = false;
|
|
self.loading = false;
|
|
|
|
+ setTimeout(() => {
|
|
|
|
+ this.pd_tianjia = true
|
|
|
|
+ }, 600);
|
|
});
|
|
});
|
|
} else {
|
|
} else {
|
|
return false;
|
|
return false;
|
|
@@ -571,9 +594,8 @@ export default {
|
|
this.$refs[form].resetFields();
|
|
this.$refs[form].resetFields();
|
|
},
|
|
},
|
|
open_right(data) {
|
|
open_right(data) {
|
|
- // console.log(data)
|
|
|
|
|
|
+ this.dianji = data
|
|
this.diyige = false
|
|
this.diyige = false
|
|
- // console.log(data)
|
|
|
|
let self = this;
|
|
let self = this;
|
|
self.table_loading = true;
|
|
self.table_loading = true;
|
|
if (data) {
|
|
if (data) {
|
|
@@ -588,16 +610,19 @@ export default {
|
|
page_size: Number(this.pagesize)
|
|
page_size: Number(this.pagesize)
|
|
};
|
|
};
|
|
self.$axios('get','/api/integral/auto/list', params).then(res => {
|
|
self.$axios('get','/api/integral/auto/list', params).then(res => {
|
|
- self.table_loading = false;
|
|
|
|
if (res.data.code == 1) {
|
|
if (res.data.code == 1) {
|
|
self.table_list = res.data.data.list || [];
|
|
self.table_list = res.data.data.list || [];
|
|
self.total = res.data.data.total;
|
|
self.total = res.data.data.total;
|
|
|
|
+ this.rule_trees_load = false;
|
|
|
|
+ this.table_loading = false;
|
|
} else {
|
|
} else {
|
|
self.$message.error(res.data.msg);
|
|
self.$message.error(res.data.msg);
|
|
}
|
|
}
|
|
})
|
|
})
|
|
.finally(() => {
|
|
.finally(() => {
|
|
- self.table_loading = false;
|
|
|
|
|
|
+ setTimeout(()=>{
|
|
|
|
+ self.table_loading = false;
|
|
|
|
+ },500)
|
|
});
|
|
});
|
|
},
|
|
},
|
|
|
|
|
|
@@ -623,7 +648,7 @@ export default {
|
|
if (res.data.code == 1) {
|
|
if (res.data.code == 1) {
|
|
this.$message.success(res.data.msg);
|
|
this.$message.success(res.data.msg);
|
|
this.rules_detail_show = false;
|
|
this.rules_detail_show = false;
|
|
- this.get_role_lists();
|
|
|
|
|
|
+ this.get_role_lists('a');
|
|
} else {
|
|
} else {
|
|
this.dialogFormVisible = false;
|
|
this.dialogFormVisible = false;
|
|
this.disabled = false;
|
|
this.disabled = false;
|
|
@@ -636,7 +661,7 @@ export default {
|
|
this.disabled = false;
|
|
this.disabled = false;
|
|
})
|
|
})
|
|
.finally(() => {
|
|
.finally(() => {
|
|
- this.loading = false;
|
|
|
|
|
|
+ this.loading = false;
|
|
});
|
|
});
|
|
});
|
|
});
|
|
},
|
|
},
|
|
@@ -716,37 +741,46 @@ export default {
|
|
});
|
|
});
|
|
},
|
|
},
|
|
// 获取分组
|
|
// 获取分组
|
|
- get_role_lists() {
|
|
|
|
|
|
+ get_role_lists(index) {
|
|
this.table_loading = true;
|
|
this.table_loading = true;
|
|
this.rule_trees_load = true;
|
|
this.rule_trees_load = true;
|
|
- this.openeds = ['0'];//修改后 修改高亮选中项
|
|
|
|
|
|
+ // this.openeds = ['0'];//修改后 修改高亮选中项
|
|
this.$axios('get','/api/integral/rule/trees', {cycle_type: '2'}).then(res => {
|
|
this.$axios('get','/api/integral/rule/trees', {cycle_type: '2'}).then(res => {
|
|
|
|
+ localStorage.setItem("user_FH",JSON.stringify(res.data.data.item_list));
|
|
this.is_attendance = this.rules_detail_form.is_attendance == '0' ? false : true;
|
|
this.is_attendance = this.rules_detail_form.is_attendance == '0' ? false : true;
|
|
this.rule_list = res.data.data.rule_tree;
|
|
this.rule_list = res.data.data.rule_tree;
|
|
this.item_list = res.data.data.item_list;
|
|
this.item_list = res.data.data.item_list;
|
|
|
|
+ this.rule_trees_load = false;
|
|
if (this.item_list !== null) {
|
|
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) {
|
|
|
|
- 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]);
|
|
|
|
|
|
+ for(let i in this.item_list){
|
|
|
|
+ for(let a in this.item_list[i]){
|
|
|
|
+ if(index == 'a'){
|
|
|
|
+ for (const key in this.item_list) {
|
|
|
|
+ for (let arr = 0; arr < this.item_list[key].length; arr++) {
|
|
|
|
+ if (arr == 0) {
|
|
|
|
+ this.default_active = '0'
|
|
|
|
+ this.open_right(this.item_list[key][arr]);
|
|
|
|
+ setTimeout(()=>{
|
|
|
|
+ this.default_active = ''
|
|
|
|
+ },500)
|
|
|
|
+ return false;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
}else{
|
|
}else{
|
|
- this.diyige = true
|
|
|
|
- // console.log('这是第一个为空时执行的方法')
|
|
|
|
- this.staff_loading = false;
|
|
|
|
- this.rule_trees_load = false;
|
|
|
|
- this.table_loading = false;
|
|
|
|
|
|
+ if(this.dianji.id == this.item_list[i][a].id){
|
|
|
|
+ this.open_right(this.item_list[i][a]);
|
|
|
|
+ return false;
|
|
|
|
+ }
|
|
}
|
|
}
|
|
- return false;
|
|
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- }
|
|
|
|
}
|
|
}
|
|
}).finally(err=>{
|
|
}).finally(err=>{
|
|
- this.rule_trees_load = false;
|
|
|
|
- this.table_loading = false;
|
|
|
|
|
|
+ setTimeout(()=>{
|
|
|
|
+ this.rule_trees_load = false;
|
|
|
|
+ this.table_loading = false;
|
|
|
|
+ },700)
|
|
});
|
|
});
|
|
}
|
|
}
|
|
}
|
|
}
|