Ver código fonte

init

newStyle
lancer 3 anos atrás
pai
commit
ce0155b284
9 arquivos alterados com 467 adições e 289 exclusões
  1. +0
    -17
      src/api/admin/dept.js
  2. +8
    -1
      src/api/admin/user.js
  3. +26
    -0
      src/api/modules/api.js
  4. +5
    -5
      src/page/check/chose.vue
  5. +9
    -4
      src/page/check/index.vue
  6. +43
    -8
      src/page/index/top/index.vue
  7. +34
    -4
      src/page/login/userlogin.vue
  8. +340
    -248
      src/views/admin/user/index.vue
  9. +2
    -2
      vue.config.js

+ 0
- 17
src/api/admin/dept.js Ver arquivo

@@ -1,20 +1,3 @@
/*
* Copyright (c) 2018-2025, lengleng All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* Neither the name of the pig4cloud.com developer nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
* Author: lengleng (wangiegie@gmail.com)
*/

import request from '@/router/axios'

export function fetchTree(query) {


+ 8
- 1
src/api/admin/user.js Ver arquivo

@@ -42,10 +42,17 @@ export function getObj(id) {

export function delObj(id) {
return request({
url: '/admin/user/' + id,
url: '/admin/user/registerDel/' + id,
method: 'delete'
})
}
export function delObj1(query) {
return request({
url: '/admin/user/orgDel',
method: 'delete',
params:query
})
}

export function putObj(obj) {
return request({


+ 26
- 0
src/api/modules/api.js Ver arquivo

@@ -193,3 +193,29 @@ export function zkorg(query) {
params: query
})
}


// 获取注册用户列表
export function registerUserList(query) {
return request({
url: '/admin/user/registerUserList',
method: 'get',
params: query
})
}

// 获取组织用户列表
export function orgUserList(query) {
return request({
url: '/admin/user/orgUserList',
method: 'get',
params: query
})
}
// 验证电话号码是否存在
export function verPhone(username) {
return request({
url: 'admin/user/info/'+username,
method: 'get',
})
}

+ 5
- 5
src/page/check/chose.vue Ver arquivo

@@ -86,8 +86,8 @@
>
</div>
<div class="con">
<div v-for="item in list" :key="item.id" class="tab" @click="chose(item)">
<div class="text-1">{{ item.agentName }}</div>
<div v-for="item in list" :key="item.id" class="tab" style="height:78px;" @click="chose(item)">
<div class="text-1">{{ item.name }}</div>
<!-- <div class="text-2">
服务状态:
<span
@@ -96,7 +96,7 @@
>{{ item.residueTime > 0 ? "服务中" : "已过期" }}</span
>
</div> -->
<div class="text-3">{{ item.address }}</div>
<div class="text-3">区域位置:{{ item.address||'暂无' }}</div>
</div>
</div>
</div>
@@ -108,7 +108,6 @@
@current-change="handleCurrentChange"
:current-page="currentPage"
:page-size="10"
layout="total, sizes, prev, pager, next, jumper"
:total="total"
>
</el-pagination>
@@ -163,7 +162,7 @@ export default {
this.$api.api
.zkorg({
current: this.currentPage,
pageSize: 10,
size: 10,
name: this.companyName,
orgType:localStorage.getItem('orgType')
})
@@ -191,6 +190,7 @@ export default {
this.getAgentList();
} else if (this.flag == 2) {
// 获取公司
this.getCompanyList()
} else {
// 获取楼盘
}


+ 9
- 4
src/page/check/index.vue Ver arquivo

@@ -9,19 +9,19 @@
<div class="hid">选择后台</div>
<div class="content">
<!-- 质控后台 -->
<div class="tab" @click="goindex(0)">
<div class="tab" @click="goindex(0)" v-if="tabFlag1">
<div><img src="/img/checktab1.png" alt="" /></div>
<div class="text">质控管家后台</div>
</div>
<div class="tab" @click="goindex(1)">
<div class="tab" @click="goindex(1)" v-if="tabFlag2">
<div><img src="/img/checktab2.png" alt="" /></div>
<div class="text">代理商后台</div>
</div>
<div class="tab" @click="goindex(2)">
<div class="tab" @click="goindex(2)" v-if="tabFlag3">
<div><img src="/img/checktab3.png" alt="" /></div>
<div class="text">公司后台</div>
</div>
<div class="tab" @click="goindex(3)">
<div class="tab" @click="goindex(3)" v-if="tabFlag4">
<div><img src="/img/checktab4.png" alt="" /></div>
<div class="text">楼盘后台</div>
</div>
@@ -58,6 +58,11 @@ export default {
this.$api.api.getTab().then((res) => {
// console.log(res)
// 循环数组,给定各种标志
this.tabFlag1 = true;
this.tabFlag2 = true;
this.tabFlag3 = true;
this.tabFlag4 = true;
return
res.data.map((item) => {
if (item.orgType == 0) {
this.tabFlag1 = true;


+ 43
- 8
src/page/index/top/index.vue Ver arquivo

@@ -12,9 +12,19 @@
<div class="top-bar__title">
<div v-if="showMenu" class="top-bar__item top-bar__item--show">
<top-menu />
<div style="margin-top: 15px; display: flex;line-height:30px; cursor:pointer;" @click="goChange">
<div
style="
margin-top: 15px;
display: flex;
line-height: 30px;
cursor: pointer;
"
@click="goChange"
>
<div class="daili">代理商</div>
<span style="font-size: 16px; margin-left: 20px;">{{companyName}}</span>
<span style="font-size: 16px; margin-left: 20px">{{
companyName
}}</span>
<span class="change">切换</span>
<!-- <span style="color:#fff; margin-right:10px;">楼盘选择:</span>
<el-select v-model="value" placeholder="请选择" @change="selectChange">
@@ -139,7 +149,7 @@ export default {
return {
options: [],
value: "",
companyName:'齐横三'
companyName: "齐横三",
};
},
computed: {
@@ -188,8 +198,34 @@ export default {
// localStorage.setItem('houseId',this.value)
// })
// },
goChange(){
this.$router.push({ path: '/check',query:{backFlag:true}});
goChange() {
this.$api.api.getTab().then((res) => {
// console.log(res)
// 循环数组,给定各种标志
if (res.data.length == 0) {
let idx = res.data[0].orgType;
// localStorage.setItem("orgType", idx);
if (idx == 0) {
// 质控管家后台
// this.$router.push({ path: "/wel" });
this.$message('不能选择')
}
if (idx == 1) {
// 代理商
this.$router.push({ path: "/chose", query: { flag: 1 } });
}
if (idx == 2) {
// 公司后台
this.$router.push({ path: "/chose", query: { flag: 2 } });
}
if (idx == 3) {
// 楼盘后台
this.$router.push({ path: "/chose", query: { flag: 3 } });
}
} else {
this.$router.push({ path: "/check", query: { backFlag: true } });
}
});
},
setCollapse() {
this.$store.commit("SET_COLLAPSE");
@@ -220,11 +256,10 @@ export default {
border-radius: 4px;
line-height: 30px;
text-align: center;
color: #FFFFFF;
color: #ffffff;
font-size: 14px;

}
.change{
.change {
font-size: 16px;
color: #2671e2;
margin-left: 10px;


+ 34
- 4
src/page/login/userlogin.vue Ver arquivo

@@ -27,7 +27,11 @@
placeholder="请输入密码"
@keyup.enter.native="handleLogin"
>
<i slot="suffix" class="el-icon-view el-input__icon" @click="showPassword" />
<i
slot="suffix"
class="el-icon-view el-input__icon"
@click="showPassword"
/>
<i slot="prefix" class="icon-mima"></i>
</el-input>
</el-form-item>
@@ -46,7 +50,8 @@
size="small"
class="login-submit"
@click.native.prevent="handleLogin"
>登录</el-button>
>登录</el-button
>
</el-form-item>
</el-form>
</template>
@@ -108,11 +113,36 @@ export default {
});
},
verifySuccess(params) {
let that=this
this.loginForm.code = params.captchaVerification;

this.$store.dispatch("LoginByUsername", this.loginForm).then(() => {
// this.$router.push({ path: this.tagWel.value });
this.$router.push({ path: '/check' });
that.$api.api.getTab().then((res) => {
// console.log(res)
// 循环数组,给定各种标志
if (res.data.length == 0) {
let idx = res.data[0].orgType;
localStorage.setItem("orgType", idx);
if (idx == 0) {
// 质控管家后台
that.$router.push({ path: "/wel" });
}
if (idx == 1) {
// 代理商
that.$router.push({ path: "/chose", query: { flag: 1 } });
}
if (idx == 2) {
// 公司后台
that.$router.push({ path: "/chose", query: { flag: 2 } });
}
if (idx == 3) {
// 楼盘后台
that.$router.push({ path: "/chose", query: { flag: 3 } });
}
} else {
that.$router.push({ path: "/check" });
}
});
});
},
},


+ 340
- 248
src/views/admin/user/index.vue Ver arquivo

@@ -1,176 +1,94 @@
<template>
<div class="user">
<!-- <basic-container>
<el-row :span="24">
<el-col
:xs="24"
:sm="24"
:md="5"
class="user__tree">
<avue-tree
:option="treeOption"
:data="treeData"
@node-click="nodeClick">
<span class="el-tree-node__label" slot-scope="{ node, data }">
<el-tooltip class="item" effect="dark" content="无数据权限" placement="right-start" v-if="data.isLock">
<span>{{node.label}} <i class="el-icon-lock"></i></span>
</el-tooltip>
<span v-if="!data.isLock">{{node.label}}</span>
</span>
</avue-tree>
</el-col>
<el-col
:xs="24"
:sm="24"
:md="19"
class="user__main">
<avue-crud
ref="crud"
:option="option"
v-model="form"
:page.sync="page"
:table-loading="listLoading"
:before-open="handleOpenBefore"
:data="list"
@on-load="getList"
@search-change="searchChange"
@refresh-change="refreshChange"
@size-change="sizeChange"
@current-change="currentChange"
@row-update="update"
@row-save="create">
<template slot="menuLeft">
<el-button
v-if="sys_user_add"
class="filter-item"
type="primary"
size="small"
icon="el-icon-edit"
@click="$refs.crud.rowAdd()">添加
</el-button>
</template>
<template
slot="username"
slot-scope="scope">
<span>{{ scope.row.username }}</span>
</template>
<template
slot="role"
slot-scope="scope">
<span
v-for="(role,index) in scope.row.roleList"
:key="index">
<el-tag>{{ role.roleName }} </el-tag>&nbsp;&nbsp;
</span>
</template>
<template
slot="deptId"
slot-scope="scope">
{{ scope.row.deptName }}
</template>
<template
slot="lockFlag"
slot-scope="scope">
<el-tag>{{ scope.label }}</el-tag>
</template>
<template
slot="menu"
slot-scope="scope">
<el-button
v-if="sys_user_edit"
type="text"
size="small"
icon="el-icon-edit"
@click="handleUpdate(scope.row,scope.index)">编辑
</el-button>
<el-button
v-if="sys_user_del"
type="text"
size="small"
icon="el-icon-delete"
@click="deletes(scope.row,scope.index)">删除
</el-button>
</template>
<template
slot="deptIdForm"
slot-scope="scope">
<avue-input-tree
v-model="form.deptId"
:node-click="getNodeData"
:dic="treeDeptData"
:props="defaultProps"
placeholder="请选择所属部门"/>
</template>
<template
slot="roleForm"
slot-scope="scope">
<avue-select
v-model="role"
:dic="rolesOptions"
:props="roleProps"
multiple
placeholder="请选择角色"/>
</template>
</avue-crud>
</el-col>
</el-row>
</basic-container> -->
<div class="top" style="margin-left:10px">
<div class="chose">
<div :class="choseFlag?'ch1':'ch2'" style="border-right:1px solid #ccc" @click="choseFlag=true">注册用户</div>
<div :class="!choseFlag?'ch1':'ch2'" @click="choseFlag=false">组织用户</div>
</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-item label="用户名" prop="name">
<el-input v-model="searchMsg.name" clearable placeholder="请输入用户名"></el-input>
<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">
<el-option label="登陆账号" value="1"></el-option>
<el-option label="用户名" value="2"></el-option>
</el-select>
</el-input>
<el-input v-else v-model="searchMsg.name" clearable placeholder="请输入">
<el-select v-model="searchMsg.flag" slot="prepend" class="input-with-select" style="width:140px;" placeholder="请选择" @change="flagchange">
<el-option label="登陆账号" value="1"></el-option>
<el-option label="用户名" value="2"></el-option>
</el-select>
</el-input>
</el-form-item>
<el-form-item label="登录名" prop="username">
<el-input v-model="searchMsg.username" clearable placeholder="请输入登录名"></el-input>
<el-form-item label="所属组织" prop="orgName">
<el-input v-model="searchMsg.orgName" clearable placeholder="请输入所属组织名称"></el-input>
</el-form-item>
<el-form-item label="身份" prop="value" v-if="form.sign!=1">
<el-select v-model="searchMsg.value" clearable placeholder="请选择">
<el-option
v-for="item in rolesOptions"
:key="item.value"
:label="item.desc"
:value="item.value"
>
</el-option>
<el-form-item>
<el-button type="primary" @click="search">查询</el-button>
<el-button type="primary" @click="reset">重置</el-button>
</el-form-item>
</el-form>
</div>

<!-- 当他为组织用户的时候 -->
<div class="top" style="margin-left:10px" v-else>
<el-form :inline="true" :model="searchMsg1" class="demo-form-inline" ref="searchForm1">
<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">
<el-option label="登陆账号" value="1"></el-option>
<el-option label="用户名" value="2"></el-option>
</el-select>
</el-input>
<el-input v-else v-model="searchMsg1.name" clearable placeholder="请输入">
<el-select v-model="searchMsg1.flag" slot="prepend" class="input-with-select" style="width:140px;" placeholder="请选择" @change="flagchange1">
<el-option label="登陆账号" value="1"></el-option>
<el-option label="用户名" value="2"></el-option>
</el-select>
</el-input>
</el-form-item>
<el-form-item label="组织类型" prop="queryOrgType">
<el-select v-model="searchMsg1.queryOrgType" clearable placeholder="请选择">
<el-option label="平台用户" value="0"></el-option>
<el-option label="代理商用户" value="1"></el-option>
<el-option label="公司用户" value="2"></el-option>
<el-option label="楼盘用户" value="3"></el-option>
</el-select>
</el-form-item>
<el-form-item label="楼盘" prop="houseId">
<el-select v-model="searchMsg.houseId" clearable placeholder="请选择">
<el-option
v-for="item in houseNameList"
:key="item.id"
:label="item.propertyName"
:value="item.id"
>
</el-option>
<el-form-item label="用户身份" prop="userRoleType">
<el-select v-model="searchMsg1.userRoleType" clearable placeholder="请选择">
<el-option label="项目总" value="2"></el-option>
<el-option label="客服" value="3"></el-option>
<el-option label="策划" value="4"></el-option>
<el-option label="经理" value="5"></el-option>
<el-option label="置业顾问" value="6"></el-option>
</el-select>
</el-form-item>
<el-form-item label="公司" prop="orgCode" v-if="form.sign!=1">
<el-select v-model="searchMsg.orgCode" clearable placeholder="请选择">
<el-option
v-for="item in orgList"
:key="item.orgCode"
:label="item.name"
:value="item.orgCode"
>
</el-option>
<el-form-item label="状态" prop="lockFlag">
<el-select v-model="searchMsg1.lockFlag" 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="search">查询</el-button>
<el-button type="primary" @click="$refs.searchForm.resetFields()">重置</el-button>
<el-button type="primary" @click="search1">查询</el-button>
<el-button type="primary" @click="reset1">重置</el-button>
</el-form-item>
</el-form>
</div>



<div style="margin: 0 0 10px 10px">
<el-button type="primary" :disabled='checkRole.length==0' @click="delIds">批量删除</el-button>
<!-- <el-button type="primary" :disabled='checkRole.length==0' @click="delIds">批量删除</el-button> -->
<el-button type="primary" @click="addRole">添加</el-button>
</div>
<!-- 表格 -->
<div class="con" style="margin-left:10px;">
<el-table
:data="tableData"
v-if="choseFlag"
border
@selection-change="handleSelectionChange"
style="width: 100%;"
@@ -183,63 +101,86 @@
>
</el-table-column>
<el-table-column
type="index"
label="序号"
width="50">
</el-table-column>
<el-table-column
prop="houseName"
label="楼盘"
width="180">
prop="name"
label="用户名">
</el-table-column>
<el-table-column
label="登录手机"
prop="username"
label="登录名"
width="180">
>
</el-table-column>
<el-table-column
prop="name"
label="用户名">
prop="userRoleTypeName"
label="性别">
<template slot-scope="{row}">
{{row.sex==0?'男':'女'}}
</template>
</el-table-column>
<el-table-column
label="用户角色"
prop="roleName"
>
<!-- <template slot-scope="scope">
{{scope.row.roleList[0].roleName}}
</template> -->
prop="orgName"
label="所属组织">
</el-table-column>
<el-table-column
prop="userRoleTypeName"
label="身份">
prop="createTime"
label="注册时间">
</el-table-column>
<el-table-column
prop="lockFlag"
label="状态">
prop="address"
label="操作">
<template slot-scope="scope">
<el-tag
:type="scope.row.lockFlag === '0' ? 'success' : 'danger'"
disable-transitions>{{scope.row.lockFlag==0?'启用':'禁用'}}</el-tag>
<el-tooltip style="font-size:18px" effect="dark" content="密码重置" placement="top-start">
<i class="el-icon-unlock" style="color:#ff892a;" @click="resetPwd(scope.row)"></i>
</el-tooltip>
<el-tooltip style="font-size:18px" effect="dark" content="查看" placement="top-start">
<i class="el-icon-zoom-in" style="color:#008EF2;" @click="editRole(scope.row,true)"></i>
</el-tooltip>
<el-tooltip style="font-size:18px" effect="dark" content="编辑" placement="top-start">
<i class="el-icon-edit" style="color:red" @click="editRole(scope.row,false)"></i>
</el-tooltip>
<el-tooltip style="font-size:18px" effect="dark" content="删除" placement="top-start">
<i class="el-icon-close" style="color:#428bca" @click="deletes(scope.row)"></i>
</el-tooltip>
<el-tooltip style="font-size:18px" effect="dark" content="修改客户信息状态" placement="top-start">
<i class="el-icon-view" style="color:#428bca" @click="editStatus(scope.row)"></i>
</el-tooltip>
</template>
</el-table-column>
</el-table>

<el-table
:data="tableData1"
v-else
border
@selection-change="handleSelectionChange"
style="width: 100%;"
:header-cell-style="{textAlign: 'center'}"
:cell-style="{ textAlign: 'center' }"
>
<el-table-column
prop="orgName"
label="公司">
type="selection"
width="55"
>
</el-table-column>
<el-table-column
prop="name"
label="用户名">
</el-table-column>
<el-table-column
prop="createTime"
label="创建时间">
label="登录手机"
prop="username"
>
</el-table-column>
<!-- <el-table-column
prop="address"
label="账号状态">
</el-table-column> -->
<el-table-column
prop="showPhoneStatus"
label="客户号码显示">
<template slot-scope="scope">
{{scope.row.showPhoneStatus==0?'是':'否'}}
</template>
prop="userRoleTypeName"
label="性别">
</el-table-column>
<el-table-column
prop="所属组织"
label="公司">
</el-table-column>
<el-table-column
prop="createTime"
label="注册时间">
</el-table-column>
<el-table-column
prop="address"
@@ -297,13 +238,11 @@
</el-form-item>
<el-form-item label="身份:" prop="userRoleType" v-if="sign==1||form.sign==1">
<el-select v-model="form.userRoleType" placeholder="请选择用户身份">
<el-option
v-for="item in rolesOptions"
:key="item.value"
:label="item.desc"
:value="item.value"
>
</el-option>
<el-option label="项目总" value="2"></el-option>
<el-option label="客服" value="3"></el-option>
<el-option label="策划" value="4"></el-option>
<el-option label="经理" value="5"></el-option>
<el-option label="置业顾问" value="6"></el-option>
</el-select>
</el-form-item>
<el-form-item label="登录名:" prop="username">
@@ -375,10 +314,20 @@
</div>
</el-dialog>


<el-dialog title="手机号验证" :visible.sync="phoneVisible" @close='$refs.phoneForm.resetFields()' width="400px">
<el-form :model="phoneForm" label-width="100px" ref="phoneForm" :rules="phoneRules">
<el-form-item label="登陆手机:" prop="phone">
<el-input style="width:200px" type="tel" maxlength="11" v-model.number="phoneForm.phone" onkeypress="return (/[\d]/.test(String.fromCharCode(event.keyCode)));" ></el-input>
</el-form-item>
</el-form>
<div style="display:flex; justify-content: space-around;" >
<el-button @click="phoneVisible = false">取 消</el-button>
<el-button type="primary" @click="nextshow">确 定</el-button>
</div>
</el-dialog>

<el-dialog title="密码重置" :visible.sync="passwordVisible" @close='$refs.passwordForm.resetFields()' width="400px">
<el-form :model="passwordForm" label-width="120px" ref="passwordForm" :rules="passwordRules">
<el-form :model="passwordForm" label-width="100px" ref="passwordForm" :rules="passwordRules">
<el-form-item label="重置密码:" prop="password">
<el-input v-model="passwordForm.password" show-password></el-input>
</el-form-item>
@@ -393,7 +342,7 @@
</template>

<script>
import {addObj, delObj, fetchList, putObj} from '@/api/admin/user'
import {addObj, delObj, del1Obj,fetchList, putObj} from '@/api/admin/user'
import { getStore, setStore } from '@/util/store'
import {deptRoleList} from '@/api/admin/role'
import {fetchTree} from '@/api/admin/dept'
@@ -403,7 +352,21 @@
export default {
name: 'SysUser',
data() {
var validatePass = (rule, value, callback) => {
if (value === '') {
callback(new Error('请输入手机号'));
} else {
if (value) {
if(!(/^1[3456789]\d{9}$/.test(value))){
// alert("手机号码不合法,请重新输入");
callback(new Error('手机号码不合法,请重新输入'));
}
}
callback();
}
};
return {
choseFlag:true,
treeClick: '',  //点击样式
keywork: '',       //搜索关键字
selectLabel: '',   //下拉框显示名称
@@ -466,11 +429,20 @@
},
rolesOptions: [],
searchMsg:{
flag:'1',
name:'', //用户名
username:'',//登录名
orgName:'',//所属组织
},
searchMsg1:{
flag:'1',
name:'', //用户名
username:'',//登录名
value:'',//身份
houseId:'',//楼盘
orgCode:''//公司
orgName:'',//所属组织
userRoleType:'',//用户身份
lockFlag:'',//状态
queryOrgType:'',//组织类型

},
sign:'', //用户标示,0系统用户,1公司用户 2运营用户
roleNameList:[],
@@ -480,6 +452,7 @@
orgNameList:[],
RoleByOrgCodeList:[],
tableData:[],
tableData1:[],
checkRole:[],
formTitle:'新增',
dialogFormVisible:false,
@@ -489,9 +462,19 @@
password:"",
userId:null
},
phoneForm:{
phone:''
},
phoneVisible:false,//验证手机号
userRoleFlag:true,
passwordVisible:false,
orgList:[],
phoneRules:{
phone: [
{ required: true, message: '请填写手机号', trigger: 'blur' },
{ validator: validatePass, trigger: 'blur' }
]
},
passwordRules:{
password: [
{ required: true, message: '请填写密码', trigger: 'blur' },
@@ -532,6 +515,16 @@
...mapGetters(['permissions'])
},
watch: {
choseFlag(newval,oldval){
console.log(newval,oldval)
this.page.current=1
this.roleList()
if(newval){
// 注册用户
}else{
//组织用户
}
},
role() {
this.form.role = this.role
},
@@ -545,34 +538,117 @@
this.sys_user_add = this.permissions['sys_user_add']
this.sys_user_edit = this.permissions['sys_user_edit']
this.sys_user_del = this.permissions['sys_user_del']
// return
// 获取用户信息
let info=getStore({name:'userInfo'})
this.sign=info.sign
console.log(info);
this.init()
// let info=getStore({name:'userInfo'})
// this.sign=info.sign
// console.log(info);
// this.init()
this.roleList() //table 列表
this.getHouseList() //楼盘名称
this.userDeptTree()// 获取部门树
this.getNodeData()
this.deptGetOrgList()//获取公司列表
// this.userDeptTree()// 获取部门树
// this.deptGetOrgList()//获取公司列表
},
methods: {
// 下一步
nextshow(){
this.$refs.phoneForm.validate(valid=>{
if(valid){
// 验证电话号码
this.$api.api.verPhone(this.phoneForm.phone)
.then(res=>{
console.log(res)
// 判断数据是否已经有了
if(res.data){
// 没有用户
console.log(res.data.sysUser);
}else{
console.log('没有用户');
}
})
// return
this.phoneVisible=false
this.dialogFormVisible=true
}
})

},
search(){
console.log(this.searchMsg,'搜索内容');
return
this.roleList()
},
search1(){
console.log(this.searchMsg1,'搜索内容');
return
this.roleList()
},
flagchange(val){
// if(val==1){

// }
this.searchMsg.name=''
this.searchMsg.username=''
},
flagchange1(){
this.searchMsg1.name=''
this.searchMsg1.username=''
},
reset(){
this.searchMsg={
flag:'1',
name:'', //用户名
username:'',//登录名
orgName:'',//所属组织
}
},
reset1(){
this.searchMsg1={
flag:'1',
name:'', //用户名
username:'',//登录名
orgName:'',//所属组织
userRoleType:'',//用户身份
lockFlag:'',//状态
queryOrgType:'',//组织类型
}
},
// 获取用户列表
roleList(){
fetchList({...this.page,...this.searchMsg})
.then(res=>{
// console.log(res);
if(res.code==0){
this.tableData=res.data.records
this.page.total=res.data.total
}else{
this.$message.waring(res.msg)
}
})
if(this.choseFlag){
// 注册用户列表
this.$api.api.registerUserList({...this.page,...this.searchMsg,orgType:localStorage.getItem('orgType')})
.then(res=>{
// console.log(res);
if(res.code==0){
this.tableData=res.data.records
this.page.total=res.data.total
}else{
this.$message.waring(res.msg)
}
})
}else{
// 组织用户列表
this.$api.api.orgUserList({...this.page,...this.searchMsg,orgType:localStorage.getItem('orgType')})
.then(res=>{
// console.log(res);
if(res.code==0){
this.tableData1=res.data.records
this.page.total=res.data.total
}else{
this.$message.waring(res.msg)
}
})
}
// fetchList({...this.page,...this.searchMsg})
// .then(res=>{
// // console.log(res);
// if(res.code==0){
// this.tableData=res.data.records
// this.page.total=res.data.total
// }else{
// this.$message.waring(res.msg)
// }
// })
},
// 获取部门树
userDeptTree(){
@@ -615,7 +691,8 @@
})
},
addRole(){
this.dialogFormVisible=true
this.phoneVisible=true
// this.dialogFormVisible=true
this.addFlag=true
this.editFlag=false
this.formTitle='添加'
@@ -696,13 +773,6 @@
}

},
// 获取楼盘列表
getHouseList(){
this.$api.api.queryHouseByUsername()
.then(res=>{
this.houseNameList=res.data
})
},
resetForm(){
this.$refs.form.resetFields()
this.form.deptName=''
@@ -714,7 +784,7 @@
// 重置用户密码
resetPwd(row){
// console.log(row);
this.passwordForm.userId=row.id
this.passwordForm.userId=row.userId
this.passwordVisible=true
},
editpwd(){
@@ -878,18 +948,6 @@
this.RoleByOrgCodeList=[]
}
},
init() {
fetchTree().then(response => {
this.treeData = response.data
})
},
// nodeClick(data) {
// console.log(data);
// this.form.roleName=data.name
// this.form.roleId=data.id
// // this.page.page = 1
// // this.getList(this.page, {deptId: data.id})
// },
getList(page, params) {
this.listLoading = true
fetchList(Object.assign({
@@ -902,12 +960,6 @@
this.listLoading = false
})
},
getNodeData() {
this.$api.api.getAllUserRoleType().then(response => {
console.log(response);
this.rolesOptions = response.data
})
},
searchChange(param, done) {
this.searchForm = param
this.page.currentPage = 1
@@ -982,11 +1034,20 @@
type: 'warning'
}
).then(() => {
delObj(row.id)
if(this.choseFlag){
delObj(row.userId)
.then(() => {
this.roleList()
this.$notify.success('删除成功')
})
}else{
delObj1({id:row.userId,orgType:localStorage.getItem('orgType'),accountId:row.accountId})
.then(() => {
this.roleList()
this.$notify.success('删除成功')
})
}

// .catch(() => {
// this.$notify.error('删除失败')
// })
@@ -995,7 +1056,7 @@
}
}
</script>
<style lang="scss">
<style lang="scss" scoped>
.user {
height: 100%;

@@ -1014,5 +1075,36 @@
color: #4D74D6;
font-weight: 600;
}
.chose{
display: flex;
height: 40px;
border: 1px solid #ccc;
text-align: center;
width: 140px;
margin: 10px;
div{
text-align: center;
line-height: 40px;
// width: 100px;
width: 70px;
}
.ch1{
background: cornflowerblue;
color:#fff;
}
.ch2{

color:#ccc;
}

}
// .top{
// /deep/ .el-form-item__content{
// display: inline-flex ;
// }
// }
.input-with-select .el-input-group__prepend {
background-color: #fff;
}
</style>


+ 2
- 2
vue.config.js Ver arquivo

@@ -3,8 +3,8 @@
* https://cli.vuejs.org/zh/config/
*/
// const url = 'http://pigx-gateway'
const url = 'http://39.97.167.65:9999' //测试
// const url = 'http://192.168.31.161:9999' //长龙
// const url = 'http://39.97.167.65:9999' //测试
const url = 'http://192.168.31.161:9999' //长龙
// const url = 'http://192.168.31.128:9999' //嘉豪

const CompressionWebpackPlugin = require('compression-webpack-plugin')


Carregando…
Cancelar
Salvar