From ba172cbde8be8d70d02e97216a81ef0ccd5de709 Mon Sep 17 00:00:00 2001 From: lancer <1905818361@qq.com> Date: Mon, 1 Nov 2021 11:17:31 +0800 Subject: [PATCH] init --- src/api/admin/menu.js | 4 +- src/api/modules/api.js | 16 ++ src/page/index/index.vue | 1 + src/page/index/top/top-setting.vue | 5 +- src/views/Customer/AgentManagement.vue | 10 +- src/views/Customer/Companymanagement.vue | 52 +++++-- src/views/Template/PinspeakwordsList.vue | 8 +- src/views/admin/role/index.vue | 2 +- src/views/admin/user/index.vue | 178 +++++++++++++++++++++-- src/views/building/index.vue | 52 ++++--- 10 files changed, 269 insertions(+), 59 deletions(-) diff --git a/src/api/admin/menu.js b/src/api/admin/menu.js index 5ab5193..070cf9c 100644 --- a/src/api/admin/menu.js +++ b/src/api/admin/menu.js @@ -4,7 +4,7 @@ import request from '@/router/axios' export function getMenu(id) { return request({ url: '/admin/menu', - params: {parentId: id,orgType:localStorage.getItem('orgType')}, + params: {parentId: id,orgType:localStorage.getItem('orgType'),agentId:localStorage.getItem('agentId'),orgType:localStorage.getItem('orgType')}, method: 'get' }) } @@ -12,7 +12,7 @@ export function getMenu(id) { export function getTopMenu() { return request({ url: '/admin/menu', - params: {type: 'top',orgType:localStorage.getItem('orgType')}, + params: {type: 'top',orgType:localStorage.getItem('orgType'),agentId:localStorage.getItem('agentId'),orgType:localStorage.getItem('orgType')}, method: 'get' }) } diff --git a/src/api/modules/api.js b/src/api/modules/api.js index 58a05fe..217d6f2 100644 --- a/src/api/modules/api.js +++ b/src/api/modules/api.js @@ -804,3 +804,19 @@ export function saveAgent(data) { }) } +// 验证登陆人信息 +export function userVerify(data) { + return request({ + url: 'admin/user/verify', + method:'post', + data + }) +} +// 注册用户修改 +export function editRoleAndDept(data) { + return request({ + url: '/admin/user/editRoleAndDept', + method:'put', + data + }) +} diff --git a/src/page/index/index.vue b/src/page/index/index.vue index de6df0f..8ca868e 100644 --- a/src/page/index/index.vue +++ b/src/page/index/index.vue @@ -95,6 +95,7 @@ export default { }, openMenu(item = {}) { this.$store.dispatch("GetMenu", {type: true, id: item.id}).then(data => { + // console.log(data,'这里是data'); if (data.length !== 0) { this.$router.$avueRouter.formatRoutes(data, true); } diff --git a/src/page/index/top/top-setting.vue b/src/page/index/top/top-setting.vue index fd76081..e2edbc8 100644 --- a/src/page/index/top/top-setting.vue +++ b/src/page/index/top/top-setting.vue @@ -9,8 +9,9 @@ class="setting__content">
版权信息
-

Version:PigX 4.0

-

Copyright: Pig4Cloud ©2018-2025

+ +

name: 智控管家

+

Copyright: 京ICP备2021005217号-1

设置 (滑动鼠标下面还有更多设置) diff --git a/src/views/Customer/AgentManagement.vue b/src/views/Customer/AgentManagement.vue index dc8dc21..6f21fab 100644 --- a/src/views/Customer/AgentManagement.vue +++ b/src/views/Customer/AgentManagement.vue @@ -132,7 +132,7 @@ 编辑 更换账号 删除 - 管理运营人员 + 管理系统运营 {{scope.row.lockFlag==0?'禁用':'启用'}} @@ -501,7 +501,7 @@ export default { // 获取运营人员列表 this.operaForm.orgId=row.id this.getAllOperationsStaff() - this.operaVisible=true + this.zkoperationrecordFindByOrg(row.id) }, zkoperationrecordFindByOrg(orgId){ @@ -522,6 +522,7 @@ export default { }) this.operaForm.operationalPeople=arr } + this.operaVisible=true }) }, confirmtime3(){ @@ -587,7 +588,7 @@ export default { }); }, - //获取运营人员 + //获取系统运营人员 getAllOperationsStaff(){ this.optionsoperationalPeople=[]; this.$api.http.getAllOperationsStaff().then((res) => { @@ -750,7 +751,8 @@ export default { contractEndDate:this.contractEndDate, serviceStatus:this.serviceStatus, agentName:this.agentName, - operationalName:this.operationalName + operationalName:this.operationalName, + }).then((res) => { console.log(res.data); this.tableData=res.data.records; diff --git a/src/views/Customer/Companymanagement.vue b/src/views/Customer/Companymanagement.vue index a6cf5da..f18b175 100644 --- a/src/views/Customer/Companymanagement.vue +++ b/src/views/Customer/Companymanagement.vue @@ -94,7 +94,8 @@ 编辑 更换账号 删除 - 管理运营人员 + 管理系统运营 + 管理代理商运营 绑定代理商 @@ -246,7 +247,7 @@
- + @@ -356,6 +357,7 @@ export default { pageNum:1, pageSize:7, orgType:'', + sysFlag:'0', replaceagentobj:{ id:'', managerPhone:'', @@ -380,6 +382,7 @@ export default { address:'',// 详细地址 // operationStaff:'',// 运营人员id }, + idx:'0', operaForm:{ operationalPeople:'' }, @@ -457,7 +460,7 @@ export default { if(valid){ // console.log(valid,this.operaForm); this.$api.api.zkoperationrecordSaveCompany({ - orgType:2, + orgType:this.idx==0?'1':'2', accountIds:this.operaForm.operationalPeople.join(','), orgId: this.operaForm.orgId }) @@ -469,17 +472,23 @@ export default { } }) }, - editOpera(row){ - console.log(row); + editOpera(row,idx){ + console.log(row,idx); // 获取运营人员列表 this.operaForm.orgId=row.orgCode - this.getAllOperationsStaff() - this.operaVisible=true - this.zkoperationrecordFindByOrg(row.orgCode) + this.sysFlag=idx + // 获取所有代理商运营 + this.getAllOperationsStaff(idx) + this.idx=idx + this.zkoperationrecordFindByOrg(row.orgCode,idx) + // this.operaVisible=true + }, - zkoperationrecordFindByOrg(orgId){ + zkoperationrecordFindByOrg(orgId,idx){ + // console.log(idx,orgId); + // return this.$api.api.zkoperationrecordFindByOrg({ - orgType:'2', + orgType:idx==0?'1':'2', orgId }) .then(res=>{ @@ -495,6 +504,7 @@ export default { }) this.operaForm.operationalPeople=arr } + }) }, //编辑 @@ -625,13 +635,22 @@ export default { this.dialogVisible=true; }, //获取运营人员 - getAllOperationsStaff(){ + getAllOperationsStaff(idx){ this.optionsoperationStaff=[]; - this.$api.http.getAllOperationsStaffByAgent({ - agentId:localStorage.getItem('agentId') - }).then((res) => { - this.optionsoperationStaff= res.data - }); + if(idx==1){ + this.$api.http.getAllOperationsStaffByAgent({ + agentId:localStorage.getItem('agentId') + }).then((res) => { + this.optionsoperationStaff= res.data + this.operaVisible=true + }); + }else{ + this.$api.http.getAllOperationsStaff().then((res) => { + this.optionsoperationStaff= res.data + this.operaVisible=true + }); + } + }, //选择代理商获取运营人员列表并清空运营人员选择 clickagentId(){ @@ -732,6 +751,7 @@ export default { operatorName:this.operatorName, operationStaffName:this.operationStaffName, name:this.name, + agentId:localStorage.getItem('agentId') } this.$api.http.getcompanyList(parmest).then((res) => { console.log(res.data); diff --git a/src/views/Template/PinspeakwordsList.vue b/src/views/Template/PinspeakwordsList.vue index 44fae8b..8ebb81e 100644 --- a/src/views/Template/PinspeakwordsList.vue +++ b/src/views/Template/PinspeakwordsList.vue @@ -84,10 +84,10 @@ diff --git a/src/views/admin/role/index.vue b/src/views/admin/role/index.vue index 54857e6..de48914 100644 --- a/src/views/admin/role/index.vue +++ b/src/views/admin/role/index.vue @@ -8,7 +8,7 @@ 代理商角色 系统角色 - 运营角色 + + + + + + + + + + + + + + + + + + + + + + + + + + + + { if (valid) { // 验证电话号码 @@ -1279,19 +1364,33 @@ export default { // 判断数据是否已经有了 if (res.data) { // 由用户 + this.$api.api.userVerify({ + orgType:localStorage.getItem('orgType'), + accountId:res.data.sysUser.accountId, + username:res.data.sysUser.username, + }) + .then(res1=>{ + // console.log(res1); this.phoneFlag = true; - console.log(res.data.sysUser); + // console.log(res.data.sysUser); this.form.name = res.data.sysUser.name; this.form.username = res.data.sysUser.username; this.form.sex = res.data.sysUser.sex; + this.phoneVisible=false + this.dialogFormVisible = true; + }) + .catch(err=>{ + console.log(err) + }) + } else { // 没有用户 console.log("没有用户"); this.form.username = this.phoneForm.phone; this.phoneFlag = false; + this.phoneVisible=false + this.dialogFormVisible = true; } - this.phoneVisible = false; - this.dialogFormVisible = true; }); // return } @@ -1752,7 +1851,7 @@ export default { this.form = { name: "", //用户名 username: "", //手机号 - sex: "0", //性别 + sex: '0', //性别 password: "", //密码 orgType: "", //组织类型 houseId:"", @@ -1760,7 +1859,8 @@ export default { agentId: "", //代理商id orgCode: "", //公司标识 userRoleType: "", //身份 - deptId:'' + deptId:'', + showPhoneStatus:0 }; this.roelFlag = false; this.houseIdList = []; @@ -1987,18 +2087,70 @@ export default { this.$forceUpdate(); }, editTwo(row){ - console.log('这里是代理商'); - this.editVisible=true - + this.formTwo.username=row.username + this.formTwo.showPhoneStatus=row.showPhoneStatus + this.formTwo.roleId=row.roleId + this.formTwo.accountId=row.accountId + this.formTwo.orgType=row.orgType + this.formTwo.houseId=row.houseId + this.formTwo.newRoleId=row.roleId + this.formTwo.deptId=row.deptId + console.log(this.formTwo); + // 获取角色列表 + this.typeChange1(row) + // 获取部门列表 + this.dialogFormVisibleTwo=true + }, + editSureTwo(){ + this.$refs.formTwo.validate(valid=>{ + if(valid){ + console.log(this.formTwo); + this.$api.api.editRoleAndDept(this.formTwo) + .then(res=>{ + this.$message.success('修改成功') + this.dialogFormVisibleTwo=false + }) + } + }) }, - getDeptList(){ + getDeptList(houseId){ this.$api.api .deptFindList({ - houseId: localStorage.getItem('houseId') + houseId }) .then(res=>{ this.deptList=res.data }) + }, + typeChange1(row) { + console.log(row); + this.userList = []; + this.identityList = []; + if (row.orgType == 0) { + // 平台 只显示角色 + this.orgFlag = false; + this.$api.api + .findRoleByOrgCode({ + orgCode: null, + agentId: null, + }) + .then((res) => { + this.userList = res.data; + }); + } else if (row.orgType == 1) { + // 代理商 选择代理商和角色 + this.orgFlag = false; + this.orgCodeChange(row.agentId, 1); + } else if (row.orgType == 2) { + // 公司 选择公司和角色 + this.orgFlag = true; + this.orgCodeChange(row.orgCode, 0); + } else { + // 楼盘 选择公司 角色 角色身份 + this.orgFlag = true; + this.orgCodeChange(row.orgCode, 0); + this.getDeptList(row.houseId) + } }, typeChange(e) { console.log(e); @@ -2043,7 +2195,7 @@ export default { // this.agentFlag = false; this.form.houseId=localStorage.getItem("houseId") this.orgCodeChange(localStorage.getItem("orgCode"), 0); - this.getDeptList() + this.getDeptList(localStorage.getItem('houseId')) } // 字典表接口 this.userDict( diff --git a/src/views/building/index.vue b/src/views/building/index.vue index c17d184..4453cc4 100644 --- a/src/views/building/index.vue +++ b/src/views/building/index.vue @@ -226,9 +226,8 @@ >更换账号 添加员工 - 管理运营人员 + 管理系统运营人员 + 管理代理商运营 绑定代理商 删除 @@ -442,7 +441,7 @@ --> - + { @@ -752,12 +754,26 @@ export default { }); }, //获取运营人员 - AllOperationsStaff(agentId) { - console.log(agentId); + AllOperationsStaff(idx) { + console.log(idx); this.optionsoperationalPeople = []; - this.$api.api.getAllOperationsStaffByAgent({agentId}).then((res) => { - this.optionsoperationalPeople = res.data; - }); + if(idx==1){ + this.$api.http.getAllOperationsStaffByAgent({ + agentId:localStorage.getItem('agentId') + }).then((res) => { + this.optionsoperationalPeople= res.data + this.operaVisible = true; + }); + }else{ + this.$api.http.getAllOperationsStaff().then((res) => { + this.optionsoperationalPeople= res.data + this.operaVisible = true; + }); + } + + // this.$api.api.getAllOperationsStaffByAgent({agentId}).then((res) => { + // this.optionsoperationalPeople = res.data; + // }); }, addSurequxiao() { this.dialogVisible = false; @@ -913,6 +929,8 @@ export default { current: this.currentPage, size: this.size, orgType: localStorage.getItem("orgType"), + agentId: localStorage.getItem("agentId"), + orgCode: localStorage.getItem("orgCode"), ...this.searchForm, }; if (this.orgType == 0) {