diff --git a/src/components/setting/managerlist.vue b/src/components/setting/managerlist.vue index d4c1269..c960605 100644 --- a/src/components/setting/managerlist.vue +++ b/src/components/setting/managerlist.vue @@ -8,6 +8,7 @@ icon="el-icon-plus" v-href="'/user/addmanager'" >添加子管理员 + 一键分配用户 - - @@ -137,7 +233,24 @@ export default { Data: [] }, currentManager: null, - multipleSelection: null + multipleSelection: null, + dialogSetManaget: false, + manager_list: [], + checkAll: false, + isIndeterminate: true, + select_manege_list: [], + innerVisible: false, + manager_user_list: [], + distribute_num: 1, + follow_all_status: [], + manager_jingli_list: [], + waifen_screen: { + money1: null, + money2: null, + jingli_id: null, + follow_status: 1 + }, + fenpei_title: '' } }, watch: { @@ -153,7 +266,6 @@ export default { window.localStorage.getItem('etorcurrentuser') ).Manager this.getmanagerlist() - this.getUser() }, methods: { handleSelectionChange (val) { @@ -163,22 +275,31 @@ export default { setUser (manage) { this.showUserDialog = true this.currentManager = manage + this.getUser() }, getUser () { - this.$api.get('baseinfo/v1/user/Search', this.searchUserModel).then(res => { - this.userRet = res + this.$api.get(this.$api.phpURL + 'manager/SetUser/getManagerUser', {manager_id: this.currentManager.Id, page: this.searchUserModel.PageIndex, search_info: this.searchUserModel.keyWord}).then(res => { + this.userRet.Data = res.data.list + this.userRet.TotalCount = parseInt(res.data.count) }) }, doSetUser () { - var data = { - ManagerId: this.currentManager.Id, - ManagerName: this.currentManager.RealName, - UserIds: this.multipleSelection.map(m => m.Id) - } - this.$api.post('baseinfo/v1/user/SetManager', data).then(res => { - this.getUser() - this.showUserDialog = false + this.fenpei_title = '向外分配用户-' + this.currentManager.RealName + this.innerVisible = true + this.$api.get(this.$api.phpURL + 'manager/SetUser/getAllManagerUserCount', {}).then(res => { + this.manager_user_list = res.data.list + this.follow_all_status = res.data.follow_status + this.manager_jingli_list = res.data.manager_jingli_list }) + // var data = { + // ManagerId: this.currentManager.Id, + // ManagerName: this.currentManager.RealName, + // UserIds: this.multipleSelection.map(m => m.Id) + // } + // this.$api.post('baseinfo/v1/user/SetManager', data).then(res => { + // this.getUser() + // this.showUserDialog = false + // }) }, geturl (data) { var that = this @@ -357,6 +478,35 @@ export default { ID: item.Id } }) + }, + autoSetUser () { + this.dialogSetManaget = true + this.$api.post(this.$api.phpURL + 'manager/SetUser/getManagerList', {}).then(res => { + this.manager_list = res.data + }) + }, + autoSetUserRequest () { + this.dialogSetManaget = false + this.$api.post(this.$api.phpURL + 'manager/SetUser/autoSet', {manager_list: this.select_manege_list}).then(res => { + + }) + }, + screen () { + this.$api.get(this.$api.phpURL + 'manager/SetUser/getAllManagerUserCount', {screen: this.waifen_screen}).then(res => { + this.manager_user_list = res.data.list + }) + }, + waifen () { + if (!this.waifen_screen.money1 || !this.waifen_screen.money2 || !this.waifen_screen.jingli_id) { + this.$message({ + message: '消费范围与接收管理员必须不为空', + type: 'warning' + }) + return + } + this.$api.get(this.$api.phpURL + 'manager/SetUser/waifen', {screen: this.waifen_screen, num: this.distribute_num, manager_id: this.currentManager.Id}).then(res => { + this.screen() + }) } } }