From 82f2acbcbf8fa158ffcc63ad026a8764bd18bf7a Mon Sep 17 00:00:00 2001 From: lancer <1905818361@qq.com> Date: Wed, 8 Sep 2021 10:11:05 +0800 Subject: [PATCH] init --- src/api/modules/api.js | 32 ++++ src/router/page/index.js | 12 ++ src/router/views/index.js | 9 +- src/views/admin/user/index.vue | 311 ++++++++++++++++++++++++++++++++- src/views/building/chose.vue | 16 -- 5 files changed, 355 insertions(+), 25 deletions(-) delete mode 100644 src/views/building/chose.vue diff --git a/src/api/modules/api.js b/src/api/modules/api.js index 932d1b3..d96f883 100644 --- a/src/api/modules/api.js +++ b/src/api/modules/api.js @@ -251,3 +251,35 @@ export function addUser(data) { data }) } +// 获取用户 +export function houseListWhenAddUser(query) { + return request({ + url: '/autoSR/zkhouse/houseListWhenAddUser', + method:'get', + params:query + }) +} +// 楼盘绑定 +export function saveHouse(data) { + return request({ + url: '/admin/user/saveHouse', + method:'post', + data + }) +} +// 根据公司获取区域 +export function areamanagerList(query) { + return request({ + url: '/autoSR/areamanager/list', + method:'get', + params:query + }) +} +// 通过地区串获取省市 +export function getParentAndKidList(query) { + return request({ + url: '/autoSR/zksysarea/getParentAndKidList', + method:'get', + params:query + }) +} diff --git a/src/router/page/index.js b/src/router/page/index.js index 59a3b6f..90fe22e 100644 --- a/src/router/page/index.js +++ b/src/router/page/index.js @@ -79,6 +79,18 @@ export default [{ isAuth: false } }, + // { + // // 楼盘选择 + // path: '/building/chose', + // component: () => + // import(/* webpackChunkName: "page" */ '@/views/building/chose'), + // name: '楼盘选择', + // meta: { + // keepAlive: true, + // isTab: false, + // isAuth: false + // } + // }, { path: '/500', component: () => diff --git a/src/router/views/index.js b/src/router/views/index.js index b793242..3fb50dd 100644 --- a/src/router/views/index.js +++ b/src/router/views/index.js @@ -9,7 +9,14 @@ export default [{ name: '个人信息', component: () => import(/* webpackChunkName: "page" */ '@/views/admin/user/info') - }] + }, + // { + // path: '/building/chose', + // component: () => + // import(/* webpackChunkName: "page" */ '@/views/building/chose'), + // name: '楼盘选择', + // }, +] }, { path: '/activti', component: Layout, diff --git a/src/views/admin/user/index.vue b/src/views/admin/user/index.vue index a10fcaa..6ef1e78 100644 --- a/src/views/admin/user/index.vue +++ b/src/views/admin/user/index.vue @@ -6,7 +6,7 @@
- + @@ -33,7 +33,7 @@
- + @@ -206,7 +206,7 @@ background @size-change="handleSizeChange" @current-change="handleCurrentChange" - :current-page.sync="page.pageNum" + :current-page.sync="page.current" :page-size="page.pageSize" layout="total,prev, pager, next, jumper" :total="page.total" @@ -312,6 +312,150 @@ 确 定
+ + + +
+
绑定方式
+ + 指定楼盘绑定 + 按区域绑定 + +
+
+ + + + + + + + + + + + + + + + + + 查询 + 重置 + + + +
+ + + + + + + + + + + + + + + +
+ +
+
+ + +
+
+
选择大区
+ + + + + +
+
+
+ 选择城市 +
+
+
+ + + + + + + + + + +
X
+
+
+
+
+
+
+
+
+ 取 消 + 确 定 +
+
@@ -341,7 +485,13 @@ } }; return { - choseFlag:true, + managerStr:[], + choseFlag:false, + // 获取的区域列表 + arealist:[], + parentAndKidList:[], + managerList:[], + bindFlag:'0', treeClick: '',  //点击样式 keywork: '',       //搜索关键字 selectLabel: '',   //下拉框显示名称 @@ -355,6 +505,7 @@   label: "label" },   //下拉框显示ID searchForm: {}, + housedata:[], treeOption: { nodeKey: 'id', addBtn: false, @@ -386,6 +537,12 @@ pageSize: 10, // 每页显示多少条, isAsc: false// 是否倒序 }, + page1: { + total: 0, // 总页数 + current: 1, // 当前页数 + pageSize: 10, // 每页显示多少条, + isAsc: false// 是否倒序 + }, list: [], listLoading: true, role: [], @@ -421,6 +578,10 @@ queryOrgType:'',//组织类型 }, + searchhouseMsg:{ + orgName:'', + queryOrgType:'' + }, sign:'', //用户标示,0系统用户,1公司用户 2运营用户 roleNameList:[], editFlag:false, @@ -433,8 +594,10 @@ checkRole:[], formTitle:'新增', dialogFormVisible:false, + houseVisible:false, deptTreeList:[],//部门树 roelFlag:false, + accountId:'', passwordForm:{ password:"", userId:null @@ -516,8 +679,9 @@ this.sys_user_del = this.permissions['sys_user_del'] // return // 获取用户信息 - // let info=getStore({name:'userInfo'}) + let info=getStore({name:'userInfo'}) // this.sign=info.sign + this.orgCode=info.orgCode // console.log(info); this.roleList() //table 列表 // this.userDeptTree()// 获取部门树 @@ -525,6 +689,43 @@ this.getAgentList()//获取代理商列表 }, methods: { + // 区域改变 + managerChange(){ + console.log(this.managerStr) + this.getParentAndKidList() + }, + // 通过地区串获取省市 + getParentAndKidList(){ + this.$api.api.getParentAndKidList({ + areaIds:this.managerStr.join(',') + }) + .then(res=>{ + console.log(res) + res.data.map(item=>{ + item.str1='' + item.str2='' + item.disabled=false + }) + this.parentAndKidList=res.data + }) + }, + // 点击添加时的操作 + addArea(){ + // 先判断最后一项是否选择如果没选择则返回 + if(this.agentList[this.agentList.length-1].str1=''){ + this.$message.waring('请选择最后一项在说') + return + } + this.agentList.map(item=>{ + item.disabled=true + }) + // 在数组里面放入一个对象 + let obj={ + str1:'', + str2:[], + } + this.agentList.push(obj) + }, // 下一步 nextshow(){ this.$refs.phoneForm.validate(valid=>{ @@ -596,6 +797,38 @@ queryOrgType:'',//组织类型 } }, + // 绑定方式改变 + radioChange(e){ + console.log(e) + }, + // 查询楼盘 + searchHouse(){ + + }, + // /清空楼盘 + resetHouse(){ + + }, + // 绑定楼盘 + addHouse(){ + // 楼盘 + if(this.bindFlag==0){ + this.$api.api.saveHouse({ + accountId:this.accountId, + houseIds:this.checkHouse.join(',') + }) + .then(res=>{ + console.log(res) + }) + } + }, + // 楼盘绑定解绑 + // bindhouse(e){ + // // if(e.isSelected) + // this.$api.api.saveHouse() + // .then(res=>{ + // }) + // }, // 获取用户列表 roleList(){ if(this.choseFlag){ @@ -635,9 +868,39 @@ } }) }, - // 去楼盘选择 + // 去楼盘管理 gochosehouse(row){ console.log(row) + this.accountId=row.accountId + this.houseVisible=true + this.gethouseList() + // 获取区域列表 + this.areamanagerList() + }, + // 获取区域 + areamanagerList(){ + this.$api.api.areamanagerList({ + orgCode:this.orgCode, + }) + .then(res=>{ + // console.log(res) + this.managerList=res.data + }) + }, + // 获取楼盘列表 + gethouseList(){ + this.$api.api.houseListWhenAddUser({ + orgType:localStorage.getItem('orgType'), + accountId:this.accountId, + orgCode:this.orgCode, + current:this.page1.current, + pageSize:this.page1.pageSize + }) + .then(res=>{ + // console.log(res) + this.page1.total=res.data.total + this.housedata=res.data.records + }) }, // 获取用户信息 getUserMsg(userId){ @@ -654,6 +917,13 @@ this.checkRole.push(item.id) }) }, + handleSelectionChange1(e){ + this.checkHouse=[] + console.log(e); + e.map(item=>{ + this.checkHouse.push(item.id) + }) + }, delIds(){ console.log(this.checkRole); this.$api.api.userDelByIds({ids:this.checkRole.join(',')}) @@ -831,13 +1101,22 @@ console.log(`每页 ${val} 条`); }, handleCurrentChange(val) { - console.log(`当前页: ${val}`); this.page.current = val; this.roleList() + }, + //分页器 + handleSizeChange1(val) { + this.page1.pageSize = val; + this.gethouseList() + console.log(`每页 ${val} 条`); + }, + handleCurrentChange1(val) { + console.log(`当前页: ${val}`); + this.page1.current = val; + this.gethouseList() }, roleChange(e=''){ - this.roelFlag=true this.$api.api.roleList({ orgCode:e @@ -1117,5 +1396,21 @@ .input-with-select .el-input-group__prepend { background-color: #fff; } +.bindchoice{ + display: flex; + margin-top: 20px; +} + .con{ + margin-top: 20px; + } + .area{ + display: flex; + } + .province{ + display: flex; + .right{ + display: flex; + } + } diff --git a/src/views/building/chose.vue b/src/views/building/chose.vue deleted file mode 100644 index 65d2375..0000000 --- a/src/views/building/chose.vue +++ /dev/null @@ -1,16 +0,0 @@ - - - - -