Browse Source

init

newStyle
lancer 3 years ago
parent
commit
82f2acbcbf
5 changed files with 355 additions and 25 deletions
  1. +32
    -0
      src/api/modules/api.js
  2. +12
    -0
      src/router/page/index.js
  3. +8
    -1
      src/router/views/index.js
  4. +303
    -8
      src/views/admin/user/index.vue
  5. +0
    -16
      src/views/building/chose.vue

+ 32
- 0
src/api/modules/api.js View File

@@ -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
})
}

+ 12
- 0
src/router/page/index.js View File

@@ -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: () =>


+ 8
- 1
src/router/views/index.js View File

@@ -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,


+ 303
- 8
src/views/admin/user/index.vue View File

@@ -6,7 +6,7 @@
</div>
<!-- 当他为注册用户的时候 -->
<div class="top" style="margin-left:10px" v-if="choseFlag">
<el-form :inline="true" :model="searchMsg" class="demo-form-inline" ref="searchForm">
<el-form :inline="true" :model="searchMsg" class="demo-form-inline" ref="searchMsg">
<el-form-item label="身份" prop="flag">
<el-input v-if="searchMsg.flag==1" v-model="searchMsg.username" clearable placeholder="请输入">
<el-select v-model="searchMsg.flag" slot="prepend" class="input-with-select" style="width:140px;" placeholder="请选择" @change="flagchange">
@@ -33,7 +33,7 @@

<!-- 当他为组织用户的时候 -->
<div class="top" style="margin-left:10px" v-else>
<el-form :inline="true" :model="searchMsg1" class="demo-form-inline" ref="searchForm1">
<el-form :inline="true" :model="searchMsg1" class="demo-form-inline" ref="searchMsg1">
<el-form-item label="身份" prop="flag">
<el-input v-if="searchMsg1.flag==1" v-model="searchMsg1.username" clearable placeholder="请输入">
<el-select v-model="searchMsg1.flag" slot="prepend" class="input-with-select" style="width:140px;" placeholder="请选择" @change="flagchange1">
@@ -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 @@
<el-button type="primary" @click="editpwd">确 定</el-button>
</div>
</el-dialog>

<el-dialog title="绑定楼盘" :visible.sync="houseVisible" width="800px">

<div class="bindchoice">
<div style="line-height: 15px; margin-right:10px">绑定方式</div>
<el-radio-group v-model="bindFlag" @change="radioChange">
<el-radio label="0">指定楼盘绑定</el-radio>
<el-radio label="1">按区域绑定</el-radio>
</el-radio-group>
</div>
<div v-if="bindFlag==0" class="con">
<!-- 指定楼盘绑定 -->
<el-form :inline="true" :model="searchhouseMsg" class="demo-form-inline" ref="searchhouseMsg">
<el-form-item label="楼盘名称" prop="orgName">
<el-input v-model="searchhouseMsg.orgName" clearable placeholder="请输入楼盘名称"></el-input>
</el-form-item>
<el-form-item label="省市" prop="">
<el-select v-model="searchhouseMsg.queryOrgType" clearable placeholder="请选择">
<el-option label="省" value="0"></el-option>
</el-select>
</el-form-item>
<el-form-item label="绑定状态" prop="">
<el-select v-model="searchhouseMsg.queryOrgType" clearable placeholder="请选择">
<el-option label="未绑定" value="0"></el-option>
<el-option label="已绑定" value="1"></el-option>
</el-select>
</el-form-item>
<el-form-item>
<el-button type="primary" @click="searchHouse">查询</el-button>
<el-button type="primary" @click="resetHouse">重置</el-button>
</el-form-item>
</el-form>
<!-- table -->
<div>
<el-table
:data="housedata"
@selection-change="handleSelectionChange1"
border
style="width: 100%;"
:header-cell-style="{textAlign: 'center'}"
:cell-style="{ textAlign: 'center' }"
>
<el-table-column
type="selection"
width="55"
>
</el-table-column>
<el-table-column
prop="propertyName"
label="楼盘">
</el-table-column>
<el-table-column
label="省市"
>
<template slot-scope="{row}">
{{row.provinceName||'--'}}-{{row.cityName||'--'}}
</template>
</el-table-column>
<el-table-column
label="绑定">
<template slot-scope="{row}">
{{row.isSelected==0?'已绑定':'未绑定'}}
</template>
</el-table-column>
<!-- <el-table-column
prop="address"
label="操作">
<template slot-scope="scope">
<el-button @click="bindhouse(scope.row)" type="text" size="small">{{scope.row.isSelected==0?'解绑':'绑定'}}</el-button>
</template>
</el-table-column> -->
</el-table>
<el-pagination
style="text-align:center;"
background
@size-change="handleSizeChange1"
@current-change="handleCurrentChange1"
:current-page.sync="page.current"
:page-size="page1.pageSize"
layout="total,prev, pager, next, jumper"
:total="page1.total"
>
</el-pagination>
</div>

</div>
<div v-else class="con">
<!--区域楼盘绑定 -->
<!-- 2 -->
<div>
<div class="area">
<div>选择大区</div>
<el-select v-model="managerStr" clearable collapse-tags multiple placeholder="请选择" @change="managerChange">
<!-- 选择大区 -->
<el-option
v-for="item1 in managerList"
:key="item1.id"
:label="item1.areaName"
:value="item1.provinceItem"
:disabled="item1.disabled"
>
</el-option>
</el-select>
</div>
<div class="province">
<div class="left">
选择城市
</div>
<div class="right">
<div v-for="(item,index) in parentAndKidList" :key="index">
<el-select v-model="item.str1" clearable :disabled='item.disabled' placeholder="请选择" style="width:200px; margin-right: 20px;">
<!-- 省 -->
<el-option
v-for="item1 in parentAndKidList"
:key="item1.id"
:label="item1.name"
:value="item1.id"
:disabled="item1.disabled"
>
</el-option>
</el-select>
<!-- 市 -->
<el-select v-model="item.str2" clearable multiple placeholder="请选择" style="width:400px;">
<el-option
v-for="item1 in parentAndKidList"
:key="item1.id"
:label="item1.name"
:value="item1.id"
:disabled="item1.disabled"
>
</el-option>
</el-select>
<div>X</div>
</div>
<div @click="addArea">+</div>
</div>
</div>
</div>
</div>
<div style="display:flex; justify-content: space-around;" >
<el-button @click="houseVisible = false">取 消</el-button>
<el-button type="primary" @click="addHouse">确 定</el-button>
</div>
</el-dialog>
</div>

</template>
@@ -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;
}
}
</style>


+ 0
- 16
src/views/building/chose.vue View File

@@ -1,16 +0,0 @@
<template>
<div>
选择
</div>
</template>

<script>
export default {

}
</script>

<style lang="" scoped >


</style>

Loading…
Cancel
Save