基础功能

main
bibi 3 years ago
parent e98c23261a
commit 4a45b396f2

@ -1,3 +1,3 @@
NODE_ENV = 'development'
VUE_APP_URL = 'http://121.41.26.225:8004/'
VUE_APP_CDN = 'http://121.41.26.225:8004/'
VUE_APP_STATIC = 'http://121.41.26.225:8004/'

@ -1,3 +1,3 @@
NODE_ENV = 'production'
VUE_APP_URL = 'http://121.41.26.225:8004/'
VUE_APP_CDN = 'http://121.41.26.225:8004/'
VUE_APP_STATIC = 'http://121.41.26.225:8004/'

@ -0,0 +1,11 @@
import httpService from "@/request"
// 工单
export function name(params) {
return httpService({
url: ` `,
method: 'get/post',
data: params,
})
}

@ -0,0 +1,90 @@
import httpService from "@/request"
// 所有的组织架构
export function departmentList(params) {
return httpService({
url: `/user/department/list`,
method: 'get',
data: params,
})
}
// 添加组织
export function departmentInsert(params) {
return httpService({
url: `/user/department/insert`,
method: 'post',
data: params,
})
}
// 组织删除
export function departmentDel(params) {
return httpService({
url: `/user/department/delete`,
method: 'post',
data: params,
})
}
// 组织修改
export function departmentUpdate(params) {
return httpService({
url: `/user/department/update`,
method: 'post',
data: params,
})
}
// 组织员工
export function findToUser(params) {
return httpService({
url: `/user/department/findToUser`,
method: 'GET',
params: params,
})
}
// 新增员工
export function insertManageUser(params) {
return httpService({
url: `/user/manageUser/insertManageUser`,
method: 'post',
data: params,
})
}
// 上传身份证照片
export function uploadManageUserIdCard(params) {
return httpService({
url: `/user/upload/uploadManageUserIdCard`,
method: 'post',
data: params,
})
}
// 员工info
export function manageUserInfo(params) {
return httpService({
url: `/user/manageUser/findById`,
method: 'GET',
params: params,
})
}
// 员工edit
export function EditManageUser(params) {
return httpService({
url: `/user/manageUser/update`,
method: 'post',
data: params,
})
}
// 员工开启关闭
export function userEnable(params) {
return httpService({
url: `/user/manageUser/isEnable`,
method: 'GET',
params: params,
})
}
// 重置密码
export function rePassword(params) {
return httpService({
url: `/user/manageUser/rePassword`,
method: 'post',
data: params,
})
}

@ -1,10 +1,18 @@
import httpService from "@/request"
// 获取预报列表
export function functionName(params) {
// 楼栋列表
export function buildingList(params) {
return httpService({
url: `url`,
method: 'post',
data: params,
url: `/user/building/list`,
method: 'get',
params: params,
})
}
// 房屋列表
export function houseList(params) {
return httpService({
url: `/user/estate/list`,
method: 'get',
params: params,
})
}

@ -1,10 +0,0 @@
import httpService from "@/request"
// 获取预报列表
export function functionName(params) {
return httpService({
url: `url`,
method: 'post',
data: params,
})
}

@ -0,0 +1,33 @@
import httpService from "@/request"
/**
*
* 住户
* @param {*} params
* @returns
*
* 住户列表
*/
export function residentList(params) {
return httpService({
url: `/user/resident/list`,
method: 'get',
params: params,
})
}
// 审核列表
export function reviewList(params) {
return httpService({
url: `/user/review/list`,
method: 'get',
params: params,
})
}
// 审核通过 不通过
export function review(params) {
return httpService({
url: `/user/review/review`,
method: 'post',
data: params,
})
}

@ -0,0 +1,28 @@
import httpService from "@/request"
// 权限 角色
// 角色列表
export function rolelist(params) {
return httpService({
url: `/user/role/list`,
method: 'get',
data: params,
})
}
// 角色-----员工列表
export function listByRole(params) {
return httpService({
url: `/user/role/listByRole`,
method: 'GET',
params: params,
})
}
// 查询当前角色下的所有的菜单权限信息 roleId
export function FindAllMenus(params) {
return httpService({
url: `/user/jurisdiction/findAllMenus`,
method: 'GET',
params: params,
})
}

@ -10,6 +10,7 @@
style="width: 120px"
@change="Actions"
placeholder="请选择操作"
v-if="ActionsList.length!=0"
>
批量
<a-select-option v-for="item in ActionsList" :key="item.value">

@ -11,11 +11,15 @@ import App from './App.vue'
import './styles/index.less';
import mixins from "@/mixins"
import Antd from 'ant-design-vue';
import util from '@/utils/util.js'
import 'ant-design-vue/dist/antd.css';
Vue.use(util);
Vue.use(Antd);
Vue.use(mixins);
import store from "@/store";
import router from "@/permission";
Vue.prototype.$baseUrl = process.env.VUE_APP_URL+'123456/manage'
Vue.config.productionTip = false
import commonTable from './components/table'

@ -12,10 +12,10 @@ export default {
install(Vue) {
Vue.mixin({
computed: {
...mapGetters(['getToken','getSelectedKeys', 'getOpenKeys','getLoginStep'])
...mapGetters(['getToken','getSelectedKeys', 'getOpenKeys'])
},
methods: {
...mapActions(['setToken','setSelectedKeys', 'setOpenKeys','setLoginStep'])
...mapActions(['setToken','setSelectedKeys', 'setOpenKeys'])
}
})
}

@ -62,7 +62,7 @@ httpService.interceptors.response.use(response => {
// console.log(msg);
// console.log(data);
return res;
} else if(res.code == '超时') {
} else if(res.code == 10010) {
router.replace({
path: '/login'
});

@ -27,7 +27,7 @@
}
.search-box {
margin: 30px;
margin: 20px;
}
.add-btn{

@ -0,0 +1,31 @@
export default {
install: function (Vue) {
Vue.prototype.ImgUrl = (src) => {
return process.env.VUE_APP_CDN + src
}
Vue.prototype.formatDate = (time, fmt) => {
if (time > 0) {
let date = new Date(time * 1000)
if (/(y+)/.test(fmt)) {
fmt = fmt.replace(RegExp.$1, (date.getFullYear() + '').substr(4 - RegExp.$1.length))
}
let o = {
'M+': date.getMonth() + 1,
'd+': date.getDate(),
'h+': date.getHours(),
'm+': date.getMinutes(),
's+': date.getSeconds()
}
for (let k in o) {
if (new RegExp(`(${k})`).test(fmt)) {
let str = o[k] + ''
fmt = fmt.replace(RegExp.$1, (RegExp.$1.length === 1) ? str : ('00' + str).substr(str.length))
}
}
return fmt
} else {
return ''
}
}
}
}

@ -0,0 +1,51 @@
/**
* 配置
* 表格列
*/
export const columns = [
{
title: "真实姓名",
dataIndex: "actualName",
width: "20%",
},
{
title: "手机号",
dataIndex: "tel",
width: "20%",
},
{
title: "角色",
dataIndex: "roleNameList",
width: "20%",
customRender: function (roleNameList) {
return roleNameList.toString();
},
},
{
title: "备注",
dataIndex: "remake",
width: "20%",
},
{
title: "操作",
dataIndex: "action",
key: "action",
width: "180",
fixed: "right",
scopedSlots: { customRender: "action" },
},
]
// 搜索项
export const searchForm = {
roleId: null,
keyword: '',
}
// 分页
export const pagination = {
current: 1,
total: 0,
pageSize: 10,
showTotal: (total) => `${total}`,
showSizeChanger: true,
showQuickJumper: true,
}

@ -0,0 +1,375 @@
<template>
<div>
<a-form-model
title="1d2"
layout="vertical"
ref="ruleForm"
:model="form"
:rules="rules"
:wrapper-col="{ span: 18 }"
>
<div>基本信息</div>
<a-divider></a-divider>
<a-row>
<a-col :span="12">
<a-form-model-item label="真实姓名" prop="actualName">
<a-input v-model="form.actualName" placeholder="请输入真实姓名" />
</a-form-model-item>
</a-col>
<a-col :span="12">
<a-form-model-item label="性别" prop="sex">
<a-select v-model="form.sex" placeholder="请选择性别">
<a-select-option v-for="item in sexOption" :key="item.id">{{
item.name
}}</a-select-option>
</a-select>
</a-form-model-item>
</a-col>
<a-col :span="12">
<a-form-model-item label="身份证号" prop="idCard">
<a-input v-model="form.idCard" placeholder="请输入身份证号" />
</a-form-model-item>
</a-col>
<a-col :span="12">
<a-form-model-item ref="tel" label="手机号" prop="tel">
<a-input
v-model="form.tel"
placeholder="请输入手机号"
@blur="
() => {
$refs.tel.onFieldBlur();
}
"
/>
</a-form-model-item>
</a-col>
<a-col :span="12">
<a-form-model-item label="出生日期" prop="birthday">
<a-date-picker v-model="form.birthday" />
</a-form-model-item>
</a-col>
<a-col :span="12">
<a-form-model-item label="密码" prop="password">
<a-input
type="password"
placeholder="不输入默认为手机号后6位"
v-model="form.password"
/>
</a-form-model-item>
</a-col>
<a-col :span="12">
<a-form-model-item label="电子邮箱" prop="email">
<a-input placeholder="请输入电子邮箱" v-model="form.email" />
</a-form-model-item>
</a-col>
<a-col :span="12">
<a-form-model-item label="居住地址" prop="address">
<a-input placeholder="请输入居住地址" v-model="form.address" />
</a-form-model-item>
</a-col>
身份证照片
<a-upload
:action="`${$baseUrl}/user/upload/uploadManageUserIdCard`"
:headers="uploadHeaders"
list-type="picture-card"
:file-list="fileList"
@preview="handlePreview"
@change="handleChange"
>
<div v-if="fileList.length < 2">
<a-icon type="plus" />
<div class="ant-upload-text">点击上传</div>
</div>
</a-upload>
<span style="color: #00000073"
>单张最多不超过4M最多上传2张支持JPG,PNG格式</span
>
</a-row>
<div>入职信息</div>
<a-divider></a-divider>
<a-row>
<a-col :span="12">
<a-form-model-item label="岗位" prop='departmentIdPath'>
<a-cascader
:field-names="{
label: 'name',
value: 'id',
children: 'childList',
}"
:options="treeData"
placeholder="请选择"
change-on-select
@change="onChange"
v-model="cascVal"
/>
</a-form-model-item>
</a-col>
<a-col :span="12">
<a-form-model-item label="入职时间" prop="entryDate">
<a-date-picker
placeholder="请选择入职时间"
v-model="form.entryDate"
value-format="YYYY-MM-DD HH:mm:ss"
/>
</a-form-model-item>
</a-col>
<a-col :span="12">
<a-form-model-item label="薪资" prop="salary">
<a-input placeholder="请输入薪资" v-model="form.salary" />
</a-form-model-item>
</a-col>
<a-col :span="24">
<div>上传资料</div>
<a-upload
:action="`${$baseUrl}/user/upload/uploadManageUserData`"
:headers="uploadHeaders"
list-type="picture"
:default-file-list="fileList"
>
<a-button> <a-icon type="upload"/> 点击上传 </a-button>
</a-upload>
<span style="color: #00000073">支持上传PNGJPG,PDF文件</span>
</a-col>
</a-row>
<div style="margin-top: 20px">联系信息</div>
<a-divider></a-divider>
<a-row>
<a-col :span="12">
<a-form-model-item label="紧急联系人" prop="emergencyContact">
<a-input
placeholder="请输入紧急联系人"
v-model="form.emergencyContact"
/>
</a-form-model-item>
</a-col>
<a-col :span="12">
<a-form-model-item label="紧急联系电话" prop="emergencyContactNumber">
<a-input
placeholder="请输入紧急联系电话"
v-model="form.emergencyContactNumber"
/>
</a-form-model-item>
</a-col>
<a-col :span="24">
<a-form-model-item
label="紧急联系地址"
prop="emergencyContactAddress"
>
<a-input
placeholder="请输入紧急联系地址"
v-model="form.emergencyContactAddress"
/>
</a-form-model-item>
</a-col>
</a-row>
<div @click="u1pload"></div>
<a-divider></a-divider>
<a-row>
<a-col :span="12">
<a-form-model-item label="婚姻状态" prop="maritalStatus">
<a-select
placeholder="请选择婚姻状态"
v-model="form.maritalStatus"
/>
</a-form-model-item>
</a-col>
<a-col :span="12">
<a-form-model-item label="民族" prop="nation">
<a-select placeholder="请输入民族" v-model="form.nation" />
</a-form-model-item>
</a-col>
<a-col :span="12">
<a-form-model-item label="政治面貌" prop="politicalOutlook">
<a-select
placeholder="请选择政治面貌"
v-model="form.politicalOutlook"
/>
</a-form-model-item>
</a-col>
<a-col :span="12">
<a-form-model-item label="户口类型" prop="accountType">
<a-select placeholder="请选择类型" v-model="form.accountType" />
</a-form-model-item>
</a-col>
<a-col :span="24">
<a-form-model-item label="备注" prop="remake">
<a-textarea
v-model="form.remake"
placeholder="请输入备注"
></a-textarea>
</a-form-model-item>
</a-col>
</a-row>
</a-form-model>
</div>
</template>
<script>
import { insertManageUser,departmentList,uploadManageUserIdCard } from "@/api/basic/department";
import store from "@/store";
function getBase64(file) {
return new Promise((resolve, reject) => {
const reader = new FileReader();
reader.readAsDataURL(file);
reader.onload = () => resolve(reader.result);
reader.onerror = (error) => reject(error);
});
}
export default {
name: "Vueform",
props: {
type: {
type: String,
default: "add",
},
},
watch: {
type: {
handler(val) {
if (val === "edit") {
console.log(1);
}
},
immediate: true,
},
},
data() {
return {
previewVisible: false,
previewImage: "",
treeData:[],
cascVal:[],
uploadHeaders: {
"manage-login-token": store.getters.getToken,
'Content-Type': 'multipart/form-data'
},
sexOption: [
{
id: 1,
name: "男",
},
{
id: 2,
name: "女",
},
{
id: 3,
name: "保密",
},
],
form: {
actualName: "",
sex: null,
idCard: "",
tel: "",
birthday: "",
password: "",
email: "",
address: "",
idCardImgUrls: "",
departmentId: "",
departmentIdPath: "",
positionId: "",
entryDate: "",
salary: "",
dataImgUrls: "",
emergencyContact: "",
emergencyContactNumber: "",
emergencyContactAddress: "",
maritalStatus: "",
nation: "",
politicalOutlook: "",
accountType: "",
remake: "",
},
rules: {
actualName: [
{ required: true, message: "请输入真实姓名", trigger: "blur" },
],
sex: [{ required: true, message: "请选择性别", trigger: "change" }],
idCard: [
{ required: true, message: "请输入身份证号", trigger: "blur" },
],
tel: [
{ required: true, message: "请输入手机号", trigger: "blur" },
{ min: 11, max: 11, message: "手机号只能为11位", trigger: "blur" },
],
entryDate: [
{ required: true, message: "请选择入职时间", trigger: "change" },
],
},
fileList: [],
};
},
created() {
this.getData()
},
methods: {
getData(){
departmentList().then((res) => {
this.treeData = res.data;
});
},
//
submit() {
this.$refs.ruleForm.validate((valid) => {
if (!valid) {
return;
}
if (this.type === "add") {
insertManageUser(this.form).then((res) => {
if(res.code===200){
this.$message.success(res.msg)
this.success()
this.close()
}
});
} else {
console.log(1);
}
});
},
//
close() {
this.$refs.ruleForm.resetFields();
this.cascVal=[]
},
success(){
this.$emit('success')
},
async handlePreview(file) {
if (!file.url && !file.preview) {
file.preview = await getBase64(file.originFileObj);
}
this.previewImage = file.url || file.preview;
this.previewVisible = true;
},
onChange(data) {
// data [1,2,2]
// yyyy-mm-dd hh:mm:ss
let _data = JSON.parse(JSON.stringify(data))
this.form.positionId = _data.pop() //2
this.form.departmentId = _data[_data.length-1] //[1,2]==>2
let str = ''
// 1:2:
for (let i = 0; i < _data.length; i++) {
str += _data[i]+':'
}
// 0:1:2:
this.form.departmentIdPath = '0:'+ str
},
handleCancel() {
this.previewVisible = false;
},
handleChange({ fileList }) {
this.fileList = fileList;
},
u1pload(){
uploadManageUserIdCard().then((res) => {console.log(res);})
}
},
};
</script>
<style lang="less" scoped>
</style>

@ -0,0 +1,167 @@
<template>
<div>
<a-row>
<!-- 角色列表 -->
<a-col :span="5">
<div class="cardTitle">所有角色</div>
<a-collapse accordion @change="rolechange">
<a-collapse-panel
v-for="(item, index) in roleList"
:key="index"
:header="item.name"
>
<div
v-for="(rolechild, indexs) in item.childrenList"
class="role-card"
:key="indexs"
>
<div>
{{ rolechild.name }}
</div>
</div>
</a-collapse-panel>
</a-collapse>
</a-col>
<!-- 人员表格 -->
<a-col :span="19" class="tree-box">
<div v-for="menu,index in menus" :key="index" class='tree'>
<span>{{menu.name}}</span>
<a-tree
:title="menu.name"
v-model="checkedKeys"
checkable
:replace-fields="replaceFields"
:expanded-keys="expandedKeys"
:auto-expand-parent="autoExpandParent"
:selected-keys="selectedKeys"
:tree-data="menu.childrenList"
@expand="onExpand"
@select="onSelect"
@check="onCheck"
/>
</div>
</a-col>
</a-row>
</div>
</template>
<script>
import {columns,pagination,searchForm} from './config.js'
import { rolelist,FindAllMenus } from "@/api/basic/role";
export default {
data() {
return {
tableChoosed: [],
roleList: [],
//
pagination: pagination,
//
columns: columns,
searchForm:searchForm,
expandedKeys: [],
replaceFields: {
children: 'childrenList',
title: 'name',
key: 'id',
},
autoExpandParent: true,
checkedKeys: [],
selectedKeys: [],
//
tableData: [],
ActionsList: [ ],
menus:[]
};
},
mounted() {
this.getData();
},
methods: {
getData() {
rolelist().then((res) => {
this.roleList = res.data;
});
},
rolechange(data){
if(data){
this.searchForm.roleId = this.roleList[data].id
FindAllMenus({roleId:this.searchForm.roleId}).then(res=>{
this.menus = res.data
})
}else{
this.searchForm.roleId = null
}
},
onExpand(expandedKeys) {
console.log('onExpand', expandedKeys);
// if not set autoExpandParent to false, if children expanded, parent can not collapse.
// or, you can remove all expanded children keys.
this.expandedKeys = expandedKeys;
this.autoExpandParent = false;
},
onCheck(checkedKeys) {
console.log('onCheck', checkedKeys);
this.checkedKeys = checkedKeys;
},
onSelect(selectedKeys, info) {
console.log('onSelect', info);
this.selectedKeys = selectedKeys;
},
reset(){
this.searchForm.keyword =''
},
handleTableChange(pagination) {
console.log(pagination);
const pager = { ...this.pagination };
pager.current = pagination.current;
pager.pageSize = pagination.pageSize;
this.pagination = pager;
},
del(data) {
this.$confirm({
title: "是否删除",
// okText:'',
// cancelText:'',
icon: "",
onOk: function () {
console.log(data);
},
});
},
Actions(data) {
console.log(data);
},
selectionChoosed(data) {
console.log(data);
this.tableChoosed = data;
},
},
// watch:{
// checkedKeys(val) {
// console.log('onCheck', val);
// },
// }
};
</script>
<style lang="less" scoped>
.role-card {
line-height: 30px;
font-size: 16px;
cursor: pointer;
border-bottom: 1px solid #d9d9d9;
margin-bottom: 10px;
display: flex;
justify-content: space-between;
}
.tree-box{
padding-left: 50px;
display: flex;
.tree{
width:15%;
}
}
</style>

@ -0,0 +1,165 @@
<template>
<div>
<a-row>
<!-- 角色列表 -->
<a-col :span="5">
<div class="cardTitle">所有角色</div>
<a-button class='add-btn' style="margin:10px">新增角色</a-button>
<a-collapse accordion @change="rolechange">
<a-collapse-panel
v-for="(item, index) in roleList"
:key="index"
:header="item.name"
>
<div
v-for="(rolechild, indexs) in item.childrenList"
class="role-card"
:key="indexs"
>
<div>
{{ rolechild.name }}
</div>
</div>
</a-collapse-panel>
</a-collapse>
</a-col>
<!-- 人员表格 -->
<a-col :span="19">
<div class='treebox'>
<a-tree
class="tree"
v-model="checkedKeys"
checkable
:replace-fields="replaceFields"
:expanded-keys="expandedKeys"
:auto-expand-parent="autoExpandParent"
:selected-keys="selectedKeys"
:tree-data="menus"
@expand="onExpand"
@select="onSelect"
@check="onCheck"
/>
</div>
</a-col>
</a-row>
</div>
</template>
<script>
import {columns,pagination,searchForm} from './config.js'
import { rolelist,FindAllMenus } from "@/api/basic/role";
export default {
data() {
return {
tableChoosed: [],
roleList: [],
//
pagination: pagination,
//
columns: columns,
searchForm:searchForm,
expandedKeys: [],
replaceFields: {
children: 'childrenList',
title: 'name',
key: 'id',
},
autoExpandParent: true,
checkedKeys: [],
selectedKeys: [],
//
tableData: [],
ActionsList: [ ],
menus:[]
};
},
mounted() {
this.getData();
},
methods: {
getData() {
rolelist().then((res) => {
this.roleList = res.data;
});
},
rolechange(data){
if(data){
this.searchForm.roleId = this.roleList[data].id
FindAllMenus({roleId:this.searchForm.roleId}).then(res=>{
this.menus = res.data
})
}else{
this.searchForm.roleId = null
}
},
onExpand(expandedKeys) {
console.log('onExpand', expandedKeys);
// if not set autoExpandParent to false, if children expanded, parent can not collapse.
// or, you can remove all expanded children keys.
this.expandedKeys = expandedKeys;
this.autoExpandParent = false;
},
onCheck(checkedKeys) {
console.log('onCheck', checkedKeys);
this.checkedKeys = checkedKeys;
},
onSelect(selectedKeys, info) {
console.log('onSelect', info);
this.selectedKeys = selectedKeys;
},
reset(){
this.searchForm.keyword =''
},
handleTableChange(pagination) {
console.log(pagination);
const pager = { ...this.pagination };
pager.current = pagination.current;
pager.pageSize = pagination.pageSize;
this.pagination = pager;
},
del(data) {
this.$confirm({
title: "是否删除",
// okText:'',
// cancelText:'',
icon: "",
onOk: function () {
console.log(data);
},
});
},
Actions(data) {
console.log(data);
},
selectionChoosed(data) {
console.log(data);
this.tableChoosed = data;
},
},
watch:{
checkedKeys(val) {
console.log('onCheck', val);
},
}
};
</script>
<style lang="less" scoped>
.role-card {
line-height: 30px;
font-size: 16px;
cursor: pointer;
border-bottom: 1px solid #d9d9d9;
margin-bottom: 10px;
display: flex;
justify-content: space-between;
}
/deep/.ant-tree ul{
width: 200px;
}
.tree{
display: flex;
margin-left: 20px;
}
</style>

@ -1,20 +1,36 @@
<template>
<div>
<a-tabs default-active-key="1">
<a-tab-pane key="1" tab="人员角色分配">
<a-row>
<!-- 角色列表 -->
<a-col :span="5">
<div class="cardTitle">所有角色</div>
<a-collapse accordion>
<a-collapse-panel v-for="item,index in roleList" :key="index" :header="item.name">
<div v-for="rolechild,indexs in item.children" class='role-card' :key="indexs">
<span>{{rolechild.name}}</span>
<a-button type="link" icon="form"></a-button>
<a-collapse accordion @change="rolechange">
<a-collapse-panel
v-for="(item, index) in roleList"
:key="index"
:header="item.name"
>
<div
v-for="(rolechild, indexs) in item.childrenList"
class="role-card"
:key="indexs"
>
<span>{{ rolechild.name }}</span>
</div>
</a-collapse-panel>
</a-collapse>
</a-col>
<!-- 人员表格 -->
<a-col :span="19">
<div class="search-box">
<a-space size="large">
<a-input v-model="searchForm.keyword" placeholder="请输入申请人/公司名" />
<a-button type="primary" @click='getPeople'> </a-button>
<a-button @click='reset'> </a-button>
</a-space>
</div>
<commonTable
:columns="columns"
:tableData="tableData"
@ -25,79 +41,77 @@
>
<template v-slot:actionBox="data">
<a-space size="small">
<a class="ant-dropdown-link" @click='detail(data)'>分配角色</a>
<a class="ant-dropdown-link" @click='del(data)'>删除</a>
<a class="ant-dropdown-link" @click="detail(data)"
>分配角色</a
>
</a-space>
</template>
</commonTable>
</a-col>
</a-row>
</a-tab-pane>
<a-tab-pane key="2" tab="角色权限设置" force-render>
<role-permissions></role-permissions>
</a-tab-pane>
</a-tabs>
</div>
</template>
<script>
import {columns,pagination,searchForm} from './component/config.js'
import { rolelist,listByRole } from "@/api/basic/role";
import rolePermissions from './component/permissions.vue'
export default {
components:{
rolePermissions
},
data() {
return {
tableChoosed: [],
roleList: [{ name: "管理角色",children:[{ name: "管理员"},{name:'部门经理'}] }, { name: "安保部" }],
roleList: [],
//
pagination: {
current: 1,
total: 0,
pageSize: 10,
},
pagination: pagination,
//
columns: [
{
title: "真实姓名",
dataIndex: "actualName",
width: "20%",
},
{
title: "手机号",
dataIndex: "tel",
width: "20%",
},
{
title: "角色",
dataIndex: "roleNameList",
width: "20%",
customRender:function(roleNameList){
return roleNameList.toString();
}
},
{
title: "备注",
dataIndex: "remake",
width: "20%",
},
{
title: "操作",
dataIndex: "action",
key: "action",
width: "180",
fixed: "right",
scopedSlots: { customRender: "action" },
},
],
columns: columns,
searchForm:searchForm,
//
tableData: [
{ name: 1, roleNameList: ['点点3','212','点点'] },
],
tableData: [],
ActionsList: [
{
label: "批量删除",
value: 1,
},
{
label: "批量导出",
value: 2,
},
],
};
},
mounted() {
this.getData();
this.getPeople()
},
methods: {
getData() {
rolelist().then((res) => {
this.roleList = res.data;
});
},
getPeople(){
listByRole({
pageNum:this.pagination.current,
size:this.pagination.pageSize,
roleId:this.searchForm.roleId,
keyword:this.searchForm.keyword,
}).then((res) => {
this.tableData = res.data.rows;
});
},
rolechange(data){
if(data){
this.searchForm.roleId = this.roleList[data].id
}else{
this.searchForm.roleId = null
}
this.getPeople();
},
reset(){
this.searchForm.keyword =''
this.getPeople()
},
handleTableChange(pagination) {
console.log(pagination);
const pager = { ...this.pagination };
@ -128,7 +142,7 @@ export default {
</script>
<style lang="less" scoped>
.role-card{
.role-card {
line-height: 30px;
font-size: 16px;
cursor: pointer;

@ -0,0 +1,54 @@
/**
* 配置
* 表格列
*/
export const columns = [
{
title: "真实名称",
dataIndex: "actualName",
width: "16%",
},
{
title: "手机号",
dataIndex: "tel",
width: "16%",
},
{
title: "所属部门",
dataIndex: "departmentName",
width: "16%",
},
{
title: "岗位",
dataIndex: "positionName",
width: "16%",
},
{
title: "备注",
dataIndex: "remake",
width: "300",
},
{
title: "操作",
dataIndex: "action",
key: "action",
width: "180",
fixed: "right",
scopedSlots: { customRender: "action" },
},
]
// 搜索项
export const searchForm = {
keyword: "",
departmentId: null,
positionId: null,
}
// 分页
export const pagination = {
current: 1,
total: 0,
pageSize: 10,
showTotal: (total) => `${total}`,
showSizeChanger: true,
showQuickJumper: true,
}

@ -0,0 +1,421 @@
<template>
<div>
<a-form-model
title="1d2"
layout="vertical"
ref="ruleForm"
:model="form"
:rules="rules"
:wrapper-col="{ span: 18 }"
>
<div>基本信息</div>
<a-divider></a-divider>
<a-row>
<a-col :span="12">
<a-form-model-item label="真实姓名" prop="actualName">
<a-input v-model="form.actualName" placeholder="请输入真实姓名" />
</a-form-model-item>
</a-col>
<a-col :span="12">
<a-form-model-item label="性别" prop="sex">
<a-select v-model="form.sex" placeholder="请选择性别">
<a-select-option v-for="item in sexOption" :key="item.id">{{
item.name
}}</a-select-option>
</a-select>
</a-form-model-item>
</a-col>
<a-col :span="12">
<a-form-model-item label="身份证号" prop="idCard">
<a-input v-model="form.idCard" placeholder="请输入身份证号" />
</a-form-model-item>
</a-col>
<a-col :span="12">
<a-form-model-item ref="tel" label="手机号" prop="tel">
<a-input
v-model="form.tel"
placeholder="请输入手机号"
@blur="
() => {
$refs.tel.onFieldBlur();
}
"
/>
</a-form-model-item>
</a-col>
<a-col :span="12">
<a-form-model-item label="出生日期" prop="birthday">
<a-date-picker v-model="form.birthday" />
</a-form-model-item>
</a-col>
<a-col :span="12">
<a-form-model-item label="密码" prop="password">
<a-input
type="password"
placeholder="不输入默认为手机号后6位"
v-model="form.password"
/>
</a-form-model-item>
</a-col>
<a-col :span="12">
<a-form-model-item label="电子邮箱" prop="email">
<a-input placeholder="请输入电子邮箱" v-model="form.email" />
</a-form-model-item>
</a-col>
<a-col :span="12">
<a-form-model-item label="居住地址" prop="address">
<a-input placeholder="请输入居住地址" v-model="form.address" />
</a-form-model-item>
</a-col>
身份证照片
<a-upload
:action="`${$baseUrl}/user/upload/uploadManageUserIdCard`"
:headers="uploadHeaders"
list-type="picture-card"
:file-list="fileList"
@preview="handlePreview"
@change="handleChange"
>
<div v-if="fileList.length < 2">
<a-icon type="plus" />
<div class="ant-upload-text">点击上传</div>
</div>
</a-upload>
<span style="color: #00000073"
>单张最多不超过4M最多上传2张支持JPG,PNG格式</span
>
</a-row>
<div>入职信息</div>
<a-divider></a-divider>
<a-row>
<a-col :span="12">
<a-form-model-item label="岗位" prop='departmentIdPath'>
<a-cascader
:field-names="{
label: 'name',
value: 'id',
children: 'childList',
}"
:options="treeData"
placeholder="请选择"
change-on-select
@change="onChange"
v-model="cascVal"
/>
</a-form-model-item>
</a-col>
<a-col :span="12">
<a-form-model-item label="入职时间" prop="entryDate">
<a-date-picker
placeholder="请选择入职时间"
v-model="form.entryDate"
value-format="YYYY-MM-DD HH:mm:ss"
/>
</a-form-model-item>
</a-col>
<a-col :span="12">
<a-form-model-item label="薪资" prop="salary">
<a-input placeholder="请输入薪资" v-model="form.salary" />
</a-form-model-item>
</a-col>
<a-col :span="24">
<div>上传资料</div>
<a-upload
:action="`${$baseUrl}/user/upload/uploadManageUserData`"
:headers="uploadHeaders"
list-type="picture"
:default-file-list="fileList"
>
<a-button> <a-icon type="upload"/> 点击上传 </a-button>
</a-upload>
<span style="color: #00000073">支持上传PNGJPG,PDF文件</span>
</a-col>
</a-row>
<div style="margin-top: 20px">联系信息</div>
<a-divider></a-divider>
<a-row>
<a-col :span="12">
<a-form-model-item label="紧急联系人" prop="emergencyContact">
<a-input
placeholder="请输入紧急联系人"
v-model="form.emergencyContact"
/>
</a-form-model-item>
</a-col>
<a-col :span="12">
<a-form-model-item label="紧急联系电话" prop="emergencyContactNumber">
<a-input
placeholder="请输入紧急联系电话"
v-model="form.emergencyContactNumber"
/>
</a-form-model-item>
</a-col>
<a-col :span="24">
<a-form-model-item
label="紧急联系地址"
prop="emergencyContactAddress"
>
<a-input
placeholder="请输入紧急联系地址"
v-model="form.emergencyContactAddress"
/>
</a-form-model-item>
</a-col>
</a-row>
<div @click="u1pload"></div>
<a-divider></a-divider>
<a-row>
<a-col :span="12">
<a-form-model-item label="婚姻状态" prop="maritalStatus">
<a-select
placeholder="请选择婚姻状态"
v-model="form.maritalStatus"
/>
</a-form-model-item>
</a-col>
<a-col :span="12">
<a-form-model-item label="民族" prop="nation">
<a-select placeholder="请输入民族" v-model="form.nation" />
</a-form-model-item>
</a-col>
<a-col :span="12">
<a-form-model-item label="政治面貌" prop="politicalOutlook">
<a-select
placeholder="请选择政治面貌"
v-model="form.politicalOutlook"
/>
</a-form-model-item>
</a-col>
<a-col :span="12">
<a-form-model-item label="户口类型" prop="accountType">
<a-select placeholder="请选择类型" v-model="form.accountType" />
</a-form-model-item>
</a-col>
<a-col :span="24">
<a-form-model-item label="备注" prop="remake">
<a-textarea
v-model="form.remake"
placeholder="请输入备注"
></a-textarea>
</a-form-model-item>
</a-col>
</a-row>
</a-form-model>
</div>
</template>
<script>
import { insertManageUser,departmentList,uploadManageUserIdCard,manageUserInfo,EditManageUser } from "@/api/basic/department";
import store from "@/store";
function getBase64(file) {
return new Promise((resolve, reject) => {
const reader = new FileReader();
reader.readAsDataURL(file);
reader.onload = () => resolve(reader.result);
reader.onerror = (error) => reject(error);
});
}
export default {
name: "Vueform",
props: {
type: {
type: String,
default:'add'
},
editId:Number,
},
watch: {
editId: {
handler(val) {
if(val === null){
return
}
this.form.id =val;
manageUserInfo({id:this.form.id}).then(res=>{
let data = res.data
this.form.actualName = data.actualName
this.form.sex = data.sex
this.form.idCard = data.idCard
this.form.tel = data.tel
this.telephoneNum = data.tel
// this.form.birthday = this.formatDate(data.birthday/1000,'yyyy-MM-dd hh:mm:ss')
this.form.password = data.password
this.form.email = data.email
this.form.address = data.address
this.form.idCardImgUrls = data.idCardImgUrls
// this.form.entryDate = this.formatDate(data.entryDate/1000,'yyyy-MM-dd hh:mm:ss')
this.form.salary = data.salary
this.form.emergencyContact = data.emergencyContact
this.form.emergencyContactNumber = data.emergencyContactNumber
this.form.emergencyContactAddress = data.emergencyContactAddress
this.form.maritalStatus = data.maritalStatus
this.form.nation = data.nation
this.form.politicalOutlook = data.politicalOutlook
this.form.accountType = data.accountType
this.form.remake = data.remake
//
this.cascVal = []
let path = data.departmentIdPath.split(':')
path.pop()
path.splice(0,1)
path.push(data.positionId)
path.forEach(element => {
this.cascVal.push(Number(element))
});
//
})
},
immediate: true,
},
},
data() {
return {
previewVisible: false,
previewImage: "",
treeData:[],
cascVal:[],
telephoneNum:"",
uploadHeaders: {
"manage-login-token": store.getters.getToken,
'Content-Type': 'multipart/form-data'
},
sexOption: [
{
id: 1,
name: "男",
},
{
id: 2,
name: "女",
},
{
id: 3,
name: "保密",
},
],
form: {
id:null,
actualName: "",
sex: null,
idCard: "",
tel: "",
birthday: "",
password: "",
email: "",
address: "",
idCardImgUrls: "",
departmentId: "",
departmentIdPath: "",
positionId: "",
entryDate: "",
salary: "",
dataImgUrls: "",
emergencyContact: "",
emergencyContactNumber: "",
emergencyContactAddress: "",
maritalStatus: "",
nation: "",
politicalOutlook: "",
accountType: "",
remake: "",
},
rules: {
actualName: [
{ required: true, message: "请输入真实姓名", trigger: "blur" },
],
sex: [{ required: true, message: "请选择性别", trigger: "change" }],
idCard: [
{ required: true, message: "请输入身份证号", trigger: "blur" },
],
tel: [
{ required: true, message: "请输入手机号", trigger: "blur" },
{ min: 11, max: 11, message: "手机号只能为11位", trigger: "blur" },
],
entryDate: [
{ required: true, message: "请选择入职时间", trigger: "change" },
],
},
fileList: [],
};
},
created() {
this.getData()
},
methods: {
getData(){
departmentList().then((res) => {
this.treeData = res.data;
});
},
//
submit() {
this.$refs.ruleForm.validate((valid) => {
if (!valid) {
return;
}
if (this.type === "add") {
insertManageUser(this.form).then((res) => {
if(res.code===200){
this.$message.success(res.msg)
this.success()
this.close()
}
});
} else {
if(this.form.tel === this.telephoneNum){
this.form.tel = null
}
EditManageUser(this.form).then((res) => {
if(res.code===200){
this.$message.success(res.msg)
this.success()
this.close()
}
});
}
});
},
//
close() {
this.$refs.ruleForm.resetFields();
this.cascVal=[]
},
success(){
this.$emit('success')
},
async handlePreview(file) {
if (!file.url && !file.preview) {
file.preview = await getBase64(file.originFileObj);
}
this.previewImage = file.url || file.preview;
this.previewVisible = true;
},
onChange(data) {
// data [1,2,2]
// yyyy-mm-dd hh:mm:ss
let _data = JSON.parse(JSON.stringify(data))
this.form.positionId = _data.pop() //2
this.form.departmentId = _data[_data.length-1] //[1,2]==>2
let str = ''
// 1:2:
for (let i = 0; i < _data.length; i++) {
str += _data[i]+':'
}
// 0:1:2:
this.form.departmentIdPath = '0:'+ str
},
handleCancel() {
this.previewVisible = false;
},
handleChange({ fileList }) {
this.fileList = fileList;
},
u1pload(){
uploadManageUserIdCard().then((res) => {console.log(res);})
}
},
};
</script>
<style lang="less" scoped>
</style>

@ -6,15 +6,24 @@
<a-input-search
style="margin-bottom: 8px"
placeholder="请输入搜索信息"
@change="onChange"
v-model="searchStr"
@change="onSearch"
/>
<div>
<a-button type="link">+&nbsp;新建分组</a-button>
<a-button type="link" icon="form"> </a-button>
<a-button type="link" style="color:#FF4D4F" icon="delete" @click="del()"> </a-button>
<a-button type="link" @click="openDepartment(1)"
>+&nbsp;新建分组</a-button
>
<a-button type="link" icon="form" @click="openDepartment()">
</a-button>
<a-button
type="link"
style="color: #ff4d4f"
icon="delete"
@click="del()"
>
</a-button>
</div>
<a-tree
checkable
v-model="checkedKeys"
:expanded-keys="expandedKeys"
:auto-expand-parent="autoExpandParent"
@ -22,23 +31,34 @@
:tree-data="treeData"
@expand="onExpand"
@select="onSelect"
/>
:replaceFields="{ children: 'childList', title: 'name' }"
>
<template slot="title" slot-scope="{ name }">
<span
v-html="
name.replace(
new RegExp(searchValue, 'g'),
'<span style=color:#f50>' + searchValue + '</span>'
)
"
></span>
</template>
</a-tree>
</a-col>
<!-- right 员工 -->
<a-col :span="19">
<div class="search-box">
<a-space size="large">
<a-input placeholder="请输入申请人/公司名" />
<a-select style="width: 200px" placeholder="选择状态" />
<a-button type="primary"> </a-button>
<a-button> </a-button>
<a-input v-model="searchForm.keyword" placeholder="请输入申请人/公司名" />
<a-button type="primary" @click='getData'> </a-button>
<a-button @click='reset'> </a-button>
</a-space>
</div>
<!-- 表格 -->
<div id="commonTable">
<div style="margin-bottom: 16px">
<a-space size="large">
<a-button type="primary" :loading="loading" @click="addStaff()">
<a-button class='add-btn' :loading="loading" @click="addStaff()">
新增员工
</a-button>
<a-button :disabled="!hasSelected" :loading="loading">
@ -52,7 +72,6 @@
</span>
</div>
<a-table
:scroll="{ x: 1300 }"
:columns="columns"
:data-source="tableData"
:pagination="pagination"
@ -68,10 +87,10 @@
"
>
<!-- 操作 -->
<span slot="action" slot-scope="scope">
<span slot="action" slot-scope="text,scope">
<a-space size="small">
<a class="ant-dropdown-link" @click='detail(scope)'>详情</a>
<a class="ant-dropdown-link" @click='del(scope)'>重置密</a>
<a class="ant-dropdown-link" @click="edit(scope)"></a>
<a class="ant-dropdown-link" @click="resetPsw(scope.id)"></a>
</a-space>
</span>
<span slot="formatter" slot-scope="scope">{{
@ -81,393 +100,449 @@
</div>
</a-col>
</a-row>
<!-- 添加员工信息 -->
<a-drawer
title="添加员工信息"
:width="720"
:visible="show.addStaffShow"
:body-style="{ paddingBottom: '80px' }"
@close="addStaffClose"
<!-- 添加部门 -->
<a-modal
:title="show.depepartmentTitle"
:visible="show.addDepartment"
@ok="handleOk"
@cancel="handleCancel"
>
<div class="drawer-content">
<div>
<a-form-model
title='1d2'
layout='vertical'
layout="vertical"
ref="ruleForm"
:model="form"
:rules="rules"
:wrapper-col="{span:18}"
:wrapper-col="{ span: 18 }"
>
<div>基本信息</div>
<a-divider></a-divider>
<a-row>
<a-col :span='12'>
<a-form-model-item label="真实姓名" prop="actualName">
<a-input v-model="form.actualName" placeholder="请输入真实姓名"/>
</a-form-model-item>
</a-col>
<a-col :span='12'>
<a-form-model-item label="性别" prop="sex">
<a-select v-model="form.sex" placeholder="请选择性别"></a-select>
</a-form-model-item>
</a-col>
<a-col :span='12'>
<a-form-model-item label="身份证号" prop="idCard">
<a-input v-model="form.idCard" placeholder="请输入身份证号"/>
</a-form-model-item>
</a-col>
<a-col :span='12'>
<a-form-model-item ref="tel" label="手机号" prop="tel">
<a-input v-model="form.tel" placeholder="请输入身份证号" @blur="()=>{$refs.tel.onFieldBlur();}"/>
</a-form-model-item>
</a-col>
<a-col :span='12'>
<a-form-model-item label="出生日期" prop="birthday">
<a-date-picker v-model="form.birthday"/>
</a-form-model-item>
</a-col>
<a-col :span='12'>
<a-form-model-item label="密码" prop="password">
<a-input type="password" placeholder='不输入默认为手机号后6位' v-model="form.password"/>
<a-form-model-item
prop="parentId"
label="上级"
v-show="show.depepartmentTitle === '新增组织架构'"
>
<a-cascader
:field-names="{
label: 'name',
value: 'id',
children: 'childList',
}"
:options="treeData"
placeholder="无上级"
change-on-select
@change="onChange"
v-model="cascVal"
/>
</a-form-model-item>
</a-col>
<a-col :span='12'>
<a-form-model-item label="电子邮箱" prop="email">
<a-input placeholder='请输入电子邮箱' v-model="form.email"/>
<a-form-model-item prop="type" label="类型">
<a-select v-model="form.type">
<a-select-option
v-for="item in typeOption"
:key="item.id"
:value="item.id"
>{{ item.name }}</a-select-option
>
</a-select>
</a-form-model-item>
</a-col>
<a-col :span='12'>
<a-form-model-item label="居住地址" prop="address">
<a-input placeholder='请输入居住地址' v-model="form.address"/>
<a-form-model-item prop="name" label="部门/岗位名称">
<a-input v-model="form.name"></a-input>
</a-form-model-item>
</a-col>
<a-col>
<a-form-model-item label="">
<template>
上传身份证照片
<a-upload
action="https://www.mocky.io/v2/5cc8019d300000980a055e76"
list-type="picture-card"
:file-list="fileList"
@preview="handlePreview"
@change="handleChange"
</a-form-model>
</div>
</a-modal>
<!-- 添加员工信息 -->
<a-drawer
:title="show.addStaffTitle"
:width="720"
:visible="show.addStaffShow"
:body-style="{ paddingBottom: '80px' }"
@close="addStaffClose"
>
<div v-if="fileList.length < 2">
<a-icon type="plus" />
<div class="ant-upload-text">
点击上传
<div class="drawer-content">
<vue-form :type="type" ref="addform" @success="success" :editId='editId'></vue-form>
</div>
<div class="drawer-footer">
<a-button :style="{ marginRight: '8px' }" @click="addStaffClose">
关闭
</a-button>
<a-button type="primary" @click="addStaffSubmit"> </a-button>
</div>
</a-upload>
<span style='color:#00000073'>单张最多不超过4M最多上传2张支持JPG,PNG格式</span>
</template>
</a-form-model-item>
</a-col>
</a-row>
<div>入职信息</div>
<a-divider></a-divider>
<a-row>
<a-col :span='12'>
<a-form-model-item label="岗位" prop="address">
<a-select placeholder='请选择' v-model="form.address"/>
</a-form-model-item>
</a-col>
<a-col :span='12'>
<a-form-model-item label="入职时间" prop="entryDate">
<a-date-picker placeholder='请选择入职时间' v-model="form.entryDate"/>
</a-form-model-item>
</a-col>
<a-col :span='12'>
<a-form-model-item label="薪资" prop="salary">
<a-input placeholder='请输入薪资' v-model="form.salary"/>
</a-form-model-item>
</a-col>
<a-col :span='24'>
<div>上传资料</div>
<a-upload
action="https://www.mocky.io/v2/5cc8019d300000980a055e76"
list-type="picture"
:default-file-list="fileList"
</a-drawer>
<!-- 重置密码 -->
<a-drawer
title="重置密码"
:width="500"
:visible="show.resetPswShow"
:body-style="{ paddingBottom: '80px' }"
@close="repswClose"
>
<a-button> <a-icon type="upload" /> 点击上传 </a-button>
</a-upload>
<span style='color:#00000073'>支持上传PNGJPG,PDF文件</span>
</a-col>
</a-row>
<div style='margin-top:20px'>联系信息</div>
<a-divider></a-divider>
<a-row>
<a-col :span='12'>
<a-form-model-item label="紧急联系人" prop="emergencyContact">
<a-input placeholder='请输入紧急联系人' v-model="form.emergencyContact"/>
</a-form-model-item>
</a-col>
<a-col :span='12'>
<a-form-model-item label="紧急联系电话" prop="emergencyContactNumber">
<a-input placeholder='请输入紧急联系电话' v-model="form.emergencyContactNumber"/>
</a-form-model-item>
</a-col>
<a-col :span='24'>
<a-form-model-item label="紧急联系地址" prop="emergencyContactAddress">
<a-input placeholder='请输入紧急联系地址' v-model="form.emergencyContactAddress"/>
</a-form-model-item>
</a-col>
</a-row>
<div>其他信息</div>
<a-divider></a-divider>
<div class="drawer-content">
<a-row>
<a-col :span='12'>
<a-form-model-item label="婚姻状态" prop="maritalStatus">
<a-select placeholder='请选择婚姻状态' v-model="form.maritalStatus"/>
</a-form-model-item>
<a-col :span="8">
新密码
</a-col>
<a-col :span='12'>
<a-form-model-item label="民族" prop="nation">
<a-select placeholder='请输入民族' v-model="form.nation"/>
</a-form-model-item>
<a-col :span="16">
<a-input style='width:90%' v-model="password.newPassword" type='password'/>
</a-col>
<a-col :span='12'>
<a-form-model-item label="政治面貌" prop="politicalOutlook">
<a-select placeholder='请选择政治面貌' v-model="form.politicalOutlook"/>
</a-form-model-item>
<a-col :span="8" style='margin-top:20px'>
确认密码
</a-col>
<a-col :span='12'>
<a-form-model-item label="户口类型" prop="accountType">
<a-select placeholder='请选择类型' v-model="form.accountType"/>
</a-form-model-item>
</a-col>
<a-col :span='24'>
<a-form-model-item label="备注" prop="remake">
<a-textarea v-model="form.remake" placeholder="请输入备注"></a-textarea>
</a-form-model-item>
<a-col :span="16" style='margin-top:20px'>
<a-input style='width:90%' v-model="password.confirmpsw" type='password'/>
</a-col>
</a-row>
</a-form-model>
</div>
<div class="drawer-footer">
<a-button :style="{ marginRight: '8px' }" @click="addStaffClose">
<a-button :style="{ marginRight: '8px' }" @click="repswClose">
关闭
</a-button>
<a-button type="primary" @click="addStaffClose"> </a-button>
<a-button type="primary" @click="rePswSubmit"> </a-button>
</div>
</a-drawer>
</div>
</template>
<script>
function getBase64(file) {
return new Promise((resolve, reject) => {
const reader = new FileReader();
reader.readAsDataURL(file);
reader.onload = () => resolve(reader.result);
reader.onerror = error => reject(error);
});
}
const treeData = [
{
title: "0-0",
key: "0-0",
children: [
{
title: "0-0-0",
key: "0-0-0",
children: [
{ title: "0-0-0-0", key: "0-0-0-0" },
{ title: "0-0-0-1", key: "0-0-0-1" },
{ title: "0-0-0-2", key: "0-0-0-2" },
],
},
{
title: "0-0-1",
key: "0-0-1",
children: [
{ title: "0-0-1-0", key: "0-0-1-0" },
{ title: "0-0-1-1", key: "0-0-1-1" },
{ title: "0-0-1-2", key: "0-0-1-2" },
],
},
{
title: "0-0-2",
key: "0-0-2",
import { columns, pagination, searchForm } from "./component/config.js";
import vueForm from "./component/form.vue";
import {
departmentList,
departmentInsert,
departmentUpdate,
departmentDel,
findToUser,
rePassword
} from "@/api/basic/department";
export default {
components: {
vueForm,
},
],
data() {
return {
columns: columns,
pagination: pagination,
searchForm: searchForm,
searchStr: "",
searchValue: "",
rules: {
type: [{ required: true, message: "请选择类型", trigger: "change" }],
name: [{ required: true, message: "请输入名称", trigger: "blur" }],
},
cascVal: [],
typeOption: [
{
title: "0-1",
key: "0-1",
children: [
{ title: "0-1-0-0", key: "0-1-0-0" },
{ title: "0-1-0-1", key: "0-1-0-1" },
{ title: "0-1-0-2", key: "0-1-0-2" },
],
id: 1,
name: "公司/部门",
},
{
title: "0-2",
key: "0-2",
id: 2,
name: "岗位",
},
];
export default {
data() {
return {
previewVisible: false,
previewImage: '',
fileList: [
],
form: {
actualName: "",
sex: null,
idCard: "",
tel: "",
parentId: 0,
type: null,
name: "",
},
rules: {
actualName: [{ required: true, message: "请输入真实姓名", trigger: "blur" }],
sex: [{ required: true, message: "请选择性别", trigger: "change" }],
idCard: [{ required: true, message: "请输入身份证号", trigger: "blur" }],
tel: [
{ required: true, message: "请输入手机号", trigger: "blur" },
{ min: 11, max: 11, message: "手机号只能为11位", trigger: "blur" },
],
editId:null,
password:{
id:null,
newPassword:'',
confirmpsw:''
},
choose: {
id: undefined,
},
show: {
addStaffShow: false,
addDepartment: false,
resetPswShow:false,
addStaffTitle:'添加员工信息',
depepartmentTitle: "",
},
expandedKeys: [],
autoExpandParent: true,
backupsExpandedKeys: [],
checkedKeys: [],
selectedKeys: [],
treeData,
//
searchForm: {
name: "",
code: "",
},
//
columns: [
{
title: "真实名称",
dataIndex: "actualName",
width: "20%",
},
{
title: "手机号",
dataIndex: "tel",
width: "20%",
},
{
title: "所属部门",
dataIndex: "departmentName",
width: "20%",
},
{
title: "岗位",
dataIndex: "positionName",
width: "20%",
},
{
title: "备注",
dataIndex: "remake",
width: "300",
},
{
title: "操作",
dataIndex: "action",
key: "action",
width: "180",
fixed: "right",
scopedSlots: { customRender: "action" },
},
],
treeData: [],
//
tableData: [{},],
tableData: [],
//
pagination: {
current: 1,
total: 0,
pageSize: 10,
showTotal: (total) => `${total}`,
showSizeChanger: true,
showQuickJumper: true,
},
loading: false,
selectedRowKeys: [],
type: "add",
};
},
mounted() {
this.getData();
},
methods: {
getData() {
departmentList().then((res) => {
this.treeData = res.data;
});
findToUser({
pageNum: this.pagination.current,
size: this.pagination.pageSize,
keyword:this.searchForm.keyword,
departmentId:this.searchForm.departmentId,
positionId:this.searchForm.positionId,
}).then((res) => {
this.tableData = res.data.rows;
});
},
openDepartment(type) {
if (type === 1) {
this.show.depepartmentTitle = "新增组织架构";
this.show.addDepartment = true;
} else {
if (this.choose.id !== undefined) {
this.show.depepartmentTitle = "修改组织架构";
this.show.addDepartment = true;
this.form.id = this.choose.id;
this.form.name = this.choose.name;
this.form.type = this.choose.type;
} else {
this.$message.error("请选择组织架构");
}
}
},
edit(row){
this.show.addStaffShow = true;
this.type = 'edit'
this.editId = row.id
this.show.addStaffTitle = "修改员工信息"
},
//
handleOk() {
if (this.depepartmentTitle === "新增组织架构") {
departmentInsert(this.form).then((res) => {
if (res.code === 200) {
this.$message.success(res.msg);
this.getData();
this.handleCancel();
} else {
this.$message.error(res.msg);
}
});
} else {
departmentUpdate({
id: this.form.id,
type: this.form.type,
name: this.form.name,
}).then((res) => {
if (res.code === 200) {
this.$message.success(res.msg);
this.getData();
this.handleCancel();
} else {
this.$message.error(res.msg);
}
});
}
},
del() {
if (this.choose.id === undefined) {
this.$message.error("请选择组织架构");
} else {
this.$confirm({
title: "是否删除",
// okText:'',
// cancelText:'',
icon: "",
onOk: function () {
console.log(1);
onOk: () => {
departmentDel({ id: this.choose.id, type: this.choose.type }).then(
(res) => {
if (res.code === 200) {
this.$message.success(res.msg);
this.getData();
} else {
this.$message.error(res.msg);
}
}
);
},
});
}
},
handleCancel() {
this.show.addDepartment = false;
this.$refs.ruleForm.resetFields();
this.cascVal = [];
},
success() {
this.addStaffClose();
this.getData();
},
reset(){
this.searchForm.keyword=''
this.getData();
},
//
addStaff() {
this.show.addStaffShow = true;
},
onSubmit() {
this.$refs.ruleForm.validate((valid) => {
if (valid) {
alert("submit!");
} else {
console.log("error submit!!");
return false;
}
});
},
resetForm() {
this.$refs.ruleForm.resetFields();
addStaffSubmit() {
this.$refs.addform.submit();
},
addStaffClose() {
this.$refs.addform.close();
this.show.addStaffShow = false;
this.editId =null
},
resetPsw(id){
this.show.resetPswShow = true
this.password.id = id
},
rePswSubmit() {
if(this.password.newPassword !== this.password.confirmpsw){
this.$message.error('两次输入密码不同')
return
}
rePassword(this.password).then(res=>{
if(res.code === 200){
this.$message.success(res.msg)
this.repswClose()
}else{
this.$message.error(res.msg)
}
})
},
repswClose(){
this.show.resetPswShow = false
this.password = {
id:null,
newPassword:'',
confirmpsw:''
}
},
onExpand(expandedKeys) {
console.log("onExpand", expandedKeys);
// if not set autoExpandParent to false, if children expanded, parent can not collapse.
// or, you can remove all expanded children keys.
this.expandedKeys = expandedKeys;
this.autoExpandParent = false;
},
onCheck(checkedKeys) {
console.log("onCheck", checkedKeys);
this.checkedKeys = checkedKeys;
},
onSelect(selectedKeys, info) {
console.log("onSelect", info);
this.selectedKeys = selectedKeys;
this.searchForm.departmentId = null
this.searchForm.positionId = null
if (info.selectedNodes.length !== 0) {
this.choose.id = info.selectedNodes[0].data.props.id;
this.choose.name = info.selectedNodes[0].data.props.name;
this.choose.type = info.selectedNodes[0].data.props.type;
if(this.choose.type === 1){
this.searchForm.departmentId = this.choose.id
this.getData()
}else if(this.choose.type === 2){
this.searchForm.positionId = this.choose.id
this.getData()
}
} else {
this.choose = {};
this.getData()
}
},
detail(data) {
console.log(data);
detail() {
this.$router.push({ name: "settle_detail" });
},
// selection
onSelectChange(selectedRowKeys) {
console.log("selectedRowKeys changed: ", selectedRowKeys);
this.selectedRowKeys = selectedRowKeys;
},
handleTableChange(pagination) {
console.log(pagination);
const pager = { ...this.pagination };
pager.current = pagination.current;
pager.pageSize = pagination.pageSize;
this.pagination = pager;
},
onChange() {},
handleCancel() {
this.previewVisible = false;
},
async handlePreview(file) {
if (!file.url && !file.preview) {
file.preview = await getBase64(file.originFileObj);
this.getData();
},
//
onChange(data) {
let thatId = data.slice(-1);
this.form.parentId = thatId[0];
},
onSearch() {
var vm = this;
//
vm.searchValue = vm.searchStr;
//expandedKeys
//expandedKeys
if (vm.searchValue === "") {
vm.expandedKeys = [];
} else {
//
vm.expandedKeys = [];
vm.backupsExpandedKeys = [];
//searchValue
let candidateKeysList = vm.getkeyList(vm.searchValue, vm.treeData, []);
//
candidateKeysList.map((item) => {
//
var key = vm.getParentKey(item, vm.treeData);
//itemkeyundefined
//
if (key && !vm.backupsExpandedKeys.some((item) => item === key))
vm.backupsExpandedKeys.push(key);
});
let length = this.backupsExpandedKeys.length;
for (let i = 0; i < length; i++) {
vm.getAllParentKey(vm.backupsExpandedKeys[i], vm.treeData);
}
vm.expandedKeys = vm.backupsExpandedKeys.slice();
}
this.previewImage = file.url || file.preview;
this.previewVisible = true;
},
handleChange({ fileList }) {
this.fileList = fileList;
//valuekey
getkeyList(value, tree, keyList) {
//
for (let i = 0; i < tree.length; i++) {
let node = tree[i];
//valuepush
if (node.name.indexOf(value) > -1) {
keyList.push(node.key);
}
//
if (node.childList) {
this.getkeyList(value, node.childList, keyList);
}
}
//
return keyList;
},
//keykey
getParentKey(key, tree) {
let parentKey, temp;
//
for (let i = 0; i < tree.length; i++) {
const node = tree[i];
if (node.childList) {
//key
//
if (node.childList.some((item) => item.key === key)) {
parentKey = node.key;
} else if ((temp = this.getParentKey(key, node.childList))) {
//parentKey = this.getParentKey(key,node.children)
//
parentKey = temp;
}
}
}
return parentKey;
},
//
getAllParentKey(key, tree) {
var parentKey;
if (key) {
//
parentKey = this.getParentKey(key, tree);
if (parentKey) {
//push
if (!this.backupsExpandedKeys.some((item) => item === parentKey)) {
this.backupsExpandedKeys.push(parentKey);
}
//
this.getAllParentKey(parentKey, tree);
}
}
},
},
computed: {

@ -0,0 +1,55 @@
/**
* 配置
* 表格列
*/
export const columns = [
{
title: "楼栋名称",
dataIndex: "name",
width: "20%",
},
{
title: "房屋总数",
dataIndex: "estateTotals",
width: "20%",
},
{
title: "租赁房屋数",
dataIndex: "leaseEstateNums",
width: "20%"
},
{
title: "租赁率",
dataIndex: "leaseRate",
width: "20%",
customRender:function(leaseRate){
return leaseRate+'%'
}
},
{
title: "入住率",
dataIndex: "occupancyRate",
width: "20%",
customRender:function(occupancyRate){
return occupancyRate+'%'
}
},
{
title: "操作",
dataIndex: "action",
key: "action",
width: "180",
fixed: "right",
scopedSlots: { customRender: "action" },
},
]
// 搜索项
export const searchForm = {
name: "",
}
// 分页
export const pagination = {
current: 1,
total: 0,
pageSize: 10,
}

@ -6,8 +6,8 @@
<a-col :span='20'>
<a-space size="large">
<a-input placeholder="请输入楼栋名称" />
<a-button type="primary"> </a-button>
<a-button> </a-button>
<a-button type="primary" @click='getData()'> </a-button>
<a-button @click='reset()'> </a-button>
</a-space>
</a-col>
<a-col :span='4'>
@ -123,19 +123,20 @@
<a-button type="primary" @click="drawerConfig.editNow=true" v-else> </a-button>
</div>
</a-drawer>
<a-modal
<!-- <a-modal
title="新增单元"
:visible="addUnitShow"
:confirm-loading="confirmLoading"
@ok="handleOk"
@cancel="handleCancel"
@ok="addSubmit"
@cancel="addClose"
>
<div></div>
</a-modal>
</a-modal> -->
</div>
</template>
<script>
import { columns,pagination,searchForm} from "./component/config"
import { buildingList } from "@/api/basic/estate"
export default {
data() {
return {
@ -169,53 +170,10 @@ export default {
],
tableChoosed: [],
//
pagination: {
current: 1,
total: 0,
pageSize: 10,
},
pagination: pagination,
//
columns: [
{
title: "楼栋名称",
dataIndex: "name",
width: "20%",
},
{
title: "房屋总数",
dataIndex: "estateTotals",
width: "20%",
},
{
title: "租赁房屋数",
dataIndex: "leaseEstateNums",
width: "20%"
},
{
title: "租赁率",
dataIndex: "leaseRate",
width: "20%",
customRender:function(leaseRate){
return leaseRate+'%'
}
},
{
title: "入住率",
dataIndex: "occupancyRate",
width: "20%",
customRender:function(occupancyRate){
return occupancyRate+'%'
}
},
{
title: "操作",
dataIndex: "action",
key: "action",
width: "180",
fixed: "right",
scopedSlots: { customRender: "action" },
},
],
columns:columns,
searchForm:searchForm,
unitData:[],
unitColumns: [
{
@ -258,9 +216,7 @@ export default {
},
],
//
tableData: [
{ name: 1, roleNameList: ['点点3','212','点点'] },
],
tableData: [],
ActionsList: [
{
label: "批量删除",
@ -273,7 +229,20 @@ export default {
],
};
},
created() {
this.getData()
},
methods: {
async getData() {
const res = await buildingList(
{
pageNum:this.pagination.current,
size:this.pagination.pageSize,
name:this.searchForm.name
}
)
this.tableData = res.data.rows
},
addBuilding(){
this.drawerConfig.addShow = true
},

@ -0,0 +1,92 @@
/**
* 配置
* 表格列
*/
export const columns = [
{
title: "申请人姓名",
dataIndex:"name",
width:'14%'
},
{
title: "申请人身份",
key: "tags",
width: "14%",
dataIndex: "identity",
scopedSlots: { customRender: "tags" },
},
{
title: "房屋名称",
dataIndex: "manageBuildingName",
scopedSlots: { customRender: "name" },
width: "20%",
},
{
title: "申请人手机号",
dataIndex:"tel",
width:'14%'
},
{
title: "申请人身份证号",
dataIndex:"idCard",
width:'14%'
},
{
title: "状态",
dataIndex:"status",
width:'14%',
customRender:function(status){
switch (status) {
case 1:
return '审核中'
case 2:
return '驳回'
case 3:
return '通过'
default:
break;
}
}
},
{
title: "房屋类型",
dataIndex:"estateTypeName",
width:'14%'
},
{
title: "操作",
dataIndex: "action",
key: "action",
width: "100",
fixed: "right",
scopedSlots: { customRender: "action" },
},
]
// 搜索项
export const searchForm = {
status:null,
identity: null
}
export function reset() {
this.searchForm = {
status:null,
identity:null,
}
this.getData()
}
export function handleTableChange(pagination) {
const pager = { ...this.pagination };
pager.current = pagination.current;
pager.pageSize = pagination.pageSize;
this.pagination = pager;
this.getData()
}
// 分页
export const pagination = {
current: 1,
total: 0,
pageSize: 10,
showTotal: (total) => `${total}`,
showSizeChanger: true,
showQuickJumper: true,
}

@ -3,19 +3,15 @@
<div class="cardTitle">
<a-space size="large">
<span>住户审核</span>
<a-radio-group default-value="1" button-style="solid" @change="tabsChange">
<a-radio-button value="1">
待审核
</a-radio-button>
<a-radio-button value="3">
已通过
</a-radio-button>
<a-radio-button value="2">
已驳回
</a-radio-button>
<a-radio-button value="0">
全部
</a-radio-button>
<a-radio-group
default-value="1"
button-style="solid"
@change="tabsChange"
>
<a-radio-button value="1"> 待审核 </a-radio-button>
<a-radio-button value="3"> 已通过 </a-radio-button>
<a-radio-button value="2"> 已驳回 </a-radio-button>
<a-radio-button value="0"> 全部 </a-radio-button>
</a-radio-group>
</a-space>
</div>
@ -23,9 +19,9 @@
<a-row>
<a-col :span="20">
<a-space size="large">
<a-select placeholder="请选择用户身份" style="width:200px"/>
<a-button type="primary"> </a-button>
<a-button> </a-button>
<a-select placeholder="请选择用户身份" style="width: 200px" />
<a-button type="primary" @click="getData()"> </a-button>
<a-button @click="reset"> </a-button>
</a-space>
</a-col>
</a-row>
@ -71,27 +67,47 @@
>
<span slot="name" slot-scope="text, row">
{{
row.manageBuildingName +
row.buildingName +
"栋/" +
row.manageUnitName +
row.unitName +
"单元/" +
row.floorLocation +
"层-" +
row.name +
row.estateName +
"室"
}}
</span>
<span slot="action" slot-scope="text, row">
<a-space>
<a class="ant-dropdown-link" @click='audit(row.estateReviewId,1)'>通过</a>
<a class="ant-dropdown-link" @click='audit(row.estateReviewId,2)'>驳回</a>
<a class="ant-dropdown-link" @click="audit(row.estateReviewId, 1)"
>通过</a
>
<a class="ant-dropdown-link" @click="audit(row.estateReviewId, 2)"
>驳回</a
>
</a-space>
</span>
<span slot="tags" slot-scope="tag">
<a-tag
:color="tag === 1 ? 'volcano' : tag === 2 ? 'geekblue' : tag === 3 ? 'geekblue' : 'red'"
:color="
tag === 1
? 'volcano'
: tag === 2
? 'geekblue'
: tag === 3
? 'geekblue'
: 'red'
"
>
{{ tag === 1 ? "业主" : tag === 2 ? "业主亲属" :tag === 3 ? "租户":tag === 4 ? "租户亲属":'-' }}
{{
tag === 1
? "业主"
: tag === 2
? "业主亲属"
: tag === 3
? "租户"
: tag === 4
? "租户亲属"
: "-"
}}
</a-tag>
</span>
</a-table>
@ -100,151 +116,71 @@
</template>
<script>
import {
columns,
pagination,
searchForm,
reset,
handleTableChange,
} from "./component/config";
import { reviewList, review } from "@/api/basic/resident";
export default {
data() {
return {
pagination: {
current: 1,
total: 0,
pageSize: 10,
showTotal: (total) => `${total}`,
showSizeChanger: true,
showQuickJumper: true,
},
searchForm:{
status:null,
identity:null
},
pagination: pagination,
searchForm: searchForm,
columns: columns,
activeAction: undefined,
loading: false,
// index
selectedRowKeys: [],
tableChoosed: [],
//
//
columns: [
{
title: "申请人姓名",
dataIndex:"name",
width:'14%'
},
{
title: "申请人身份",
key: "tags",
width: "14%",
dataIndex: "identity",
scopedSlots: { customRender: "tags" },
},
{
title: "房屋名称",
dataIndex: "manageBuildingName",
scopedSlots: { customRender: "name" },
width: "20%",
},
{
title: "申请人手机号",
dataIndex:"tel",
width:'14%'
},
{
title: "申请人身份证号",
dataIndex:"idCard",
width:'14%'
},
{
title: "状态",
dataIndex:"status",
width:'14%',
customRender:function(status){
switch (status) {
case 1:
return '审核中'
case 2:
return '驳回'
case 3:
return '通过'
default:
break;
}
}
},
{
title: "房屋类型",
dataIndex:"estateTypeName",
width:'14%'
},
{
title: "操作",
dataIndex: "action",
key: "action",
width: "100",
fixed: "right",
scopedSlots: { customRender: "action" },
},
],
//
tableData: [
{
manageBuildingName: "1",
manageUnitName: "2",
floorLocation: "4",
name: "502",
roleNameList: ["点点3", "212", "点点"],
status: 1,
},
{
name: 1,
roleNameList: ["点点3", "212", "点点"],
status: 2,
isEnableLease: 1,
},
],
ActionsList: [
{
label: "批量删除",
value: 1,
},
{
label: "批量导出",
value: 2,
},
],
tableData: [],
ActionsList: [],
};
},
mounted(){
this.getData()
mounted() {
this.getData();
},
methods: {
getData(){},
tabsChange(e){
this.searchForm.status = e.target.value
this.getData()
async getData() {
const res = await reviewList({
pageNum: this.pagination.current,
size: this.pagination.pageSize,
status: this.searchForm.status,
identity: this.searchForm.identity,
});
this.tableData = res.data.rows;
},
tabsChange(e) {
if (e.target.value === "0") {
this.searchForm.status = null;
} else {
this.searchForm.status = e.target.value;
}
this.getData();
},
// 1 2
audit(estateReviewId,operate){
audit(estateReviewId, operate) {
this.$confirm({
title: "是否" + (operate===1?'通过':'驳回'),
title: "是否" + (operate === 1 ? "通过" : "驳回"),
// okText:'',
// cancelText:'',
icon: "",
onOk:async function () {
let res = await this.api({
estateReviewId:estateReviewId,
operate:operate
})
if(res.code===0){
this.$message()
onOk: async function () {
const res = await review({
estateReviewId: estateReviewId,
operate: operate,
});
if (res.code === 0) {
this.$message.success(res.msg);
} else {
this.$message.error(res.msg);
}
},
})
},
handleTableChange(pagination) {
console.log(pagination);
const pager = { ...this.pagination };
pager.current = pagination.current;
pager.pageSize = pagination.pageSize;
this.pagination = pager;
});
},
handleTableChange:handleTableChange,
Actions(data) {
console.log(data);
this.activeAction = undefined;
@ -253,6 +189,7 @@ export default {
console.log(data);
this.tableChoosed = data;
},
reset: reset,
},
computed: {
// selection

@ -0,0 +1,226 @@
<template>
<div>
<!-- add -->
<a-drawer
title="新增住户"
:width="720"
:visible="drawer.add.show"
:body-style="{ paddingBottom: '80px' }"
@close="addClose"
>
<div class="drawer-content">
基本信息
<a-divider></a-divider>
<a-form-model
ref="ruleForm"
:model="form"
:rules="rules"
layout="vertical"
>
<a-row>
<a-col :span="8">
<a-form-model-item label="关联房屋" prop="manageEstateId">
<a-cascader
:options="options"
placeholder="Please select"
@change="onChange"
style="width: 90%"
/>
</a-form-model-item>
</a-col>
<a-col :span="8">
<a-form-model-item label="房屋类型">
<a-input
placeholder="请先选择关联房屋"
disabled
style="width: 90%"
/>
</a-form-model-item>
</a-col>
<a-col :span="8">
<a-form-model-item label="住户身份" prop="identity">
<a-select placeholder="请选择住户身份" style="width: 90%" />
</a-form-model-item>
</a-col>
<a-col :span="12">
<a-form-model-item label="姓名" prop="name">
<a-input placeholder="请输入姓名" style="width: 90%" />
</a-form-model-item>
</a-col>
<a-col :span="12">
<a-form-model-item label="手机号" prop="tel">
<a-input placeholder="请输入手机号" style="width: 90%" />
</a-form-model-item>
</a-col>
<a-col :span="12">
<a-form-model-item label="性别" prop="sex">
<a-input placeholder="请选择性别" style="width: 90%" />
</a-form-model-item>
</a-col>
<a-col :span="12">
<a-form-model-item label="身份证号" prop="idCard">
<a-input placeholder="请输入身份证号" style="width: 90%" />
</a-form-model-item>
</a-col>
<a-col :span="12">
<a-form-model-item label="入住时间" prop="checkTime">
<a-date-picker @change="onChange" />
</a-form-model-item>
</a-col>
<a-col :span="12">
<a-form-model-item label="户籍所在地" prop="domicile">
<a-input placeholder="户籍所在地" style="width: 90%" />
</a-form-model-item>
</a-col>
<a-col :span="12">
身份证徽面照
<a-upload
name="avatar"
list-type="picture-card"
class="avatar-uploader"
:show-upload-list="false"
action="https://www.mocky.io/v2/5cc8019d300000980a055e76"
:before-upload="beforeUpload"
@change="handleChange"
>
<img v-if="imageUrl" :src="imageUrl" alt="avatar" />
<div v-else>
<a-icon :type="loading ? 'loading' : 'plus'" />
<div class="ant-upload-text"></div>
</div>
</a-upload>
</a-col>
<a-col :span="12">
身份证头像照
<a-upload
name="avatar"
list-type="picture-card"
class="avatar-uploader"
:show-upload-list="false"
action="https://www.mocky.io/v2/5cc8019d300000980a055e76"
:before-upload="beforeUpload"
@change="handleChange"
>
<img v-if="imageUrl" :src="imageUrl" alt="avatar" />
<div v-else>
<a-icon :type="loading ? 'loading' : 'plus'" />
<div class="ant-upload-text"></div>
</div>
</a-upload>
</a-col>
<div v-show="form.identity === 2 || form.identity === 4">
关联信息
<a-divider></a-divider>
</div>
<div v-if="form.identity === 2">
<a-col :span="12">
<a-form-model-item label="业主姓名" prop="ownerName">
<a-input placeholder="请输入业主姓名" style="width: 90%" />
</a-form-model-item>
</a-col>
<a-col :span="12">
<a-form-model-item label="业主电话" prop="ownerTel">
<a-input placeholder="请输入业主电话" style="width: 90%" />
</a-form-model-item>
</a-col>
</div>
<div v-else-if="form.identity === 4">
<a-col :span="12">
<a-form-model-item label="租户姓名" prop="tenantName">
<a-input placeholder="请输入租户姓名" style="width: 90%" />
</a-form-model-item>
</a-col>
<a-col :span="12">
<a-form-model-item label="租户电话" prop="tenantTel">
<a-input placeholder="请输入租户电话" style="width: 90%" />
</a-form-model-item>
</a-col>
</div>
联系信息
<a-divider></a-divider>
<a-col :span="12">
<a-form-model-item label="紧急联系人" prop="emergencyContact">
<a-input placeholder="请输入紧急联系人" style="width: 90%" />
</a-form-model-item>
</a-col>
<a-col :span="12">
<a-form-model-item
label="紧急联系人电话"
prop="emergencyContactNumber"
>
<a-input
placeholder="请输入紧急联系人电话"
style="width: 90%"
/>
</a-form-model-item>
</a-col>
其他信息
<a-divider></a-divider>
<a-col :span="12">
<a-form-model-item label="婚姻状况" prop="maritalStatus">
<a-select placeholder="请选择婚姻状况" style="width: 90%" />
</a-form-model-item>
</a-col>
<a-col :span="12">
<a-form-model-item label="民族" prop="nation">
<a-input placeholder="请输入民族" style="width: 90%" />
</a-form-model-item>
</a-col>
<a-col :span="12">
<a-form-model-item label="政治面貌" prop="politicalOutlook">
<a-select placeholder="请选择婚姻状况" style="width: 90%" />
</a-form-model-item>
</a-col>
<a-col :span="12">
<a-form-model-item label="户口类型" prop="accountType">
<a-select placeholder="请选择户口类型" style="width: 90%" />
</a-form-model-item>
</a-col>
<a-col :span="12">
<a-form-model-item label="从事职业" prop="occupation">
<a-input placeholder="请输入从事职业" style="width: 90%" />
</a-form-model-item>
</a-col>
<a-col :span="12">
<a-form-model-item label="工作单位" prop="employer">
<a-input placeholder="请输入工作单位" style="width: 90%" />
</a-form-model-item>
</a-col>
<a-col :span="24">
<a-form-model-item label="工作单位地址" prop="employerAddress">
<a-input placeholder="请输入工作单位地址" style="width: 90%" />
</a-form-model-item>
</a-col>
<a-col :span="24">
<a-form-model-item label="备注" prop="remarks">
<a-textarea placeholder="请输入备注" style="width: 90%" />
</a-form-model-item>
</a-col>
</a-row>
</a-form-model>
</div>
<div class="drawer-footer">
<a-button
:style="{ marginRight: '8px' }"
@click="drawer.add.show = false"
>
关闭
</a-button>
<a-button type="primary" @click="addClose"> </a-button>
</div>
</a-drawer>
</div>
</template>
<script>
export default {
data() {
return {
}
}
};
</script>
<style>
</style>

@ -0,0 +1,77 @@
/**
* 配置
* 表格列
*/
export const columns = [
{
title: "住户姓名",
dataIndex: "name",
width: "10%",
},
{
title: "住户手机号",
dataIndex: "tel",
width: "10%",
},
{
title: "住户性别",
dataIndex: "sex",
width: "8%",
customRender:function(sex){
switch (sex) {
case 1:
return '男'
case 2:
return '女'
case 3:
return '保密'
default:
break;
}
}
},
{
title: "住户身份证号",
dataIndex: "idCard",
width: "10%",
},
{
title: "房屋名称",
dataIndex: "manageBuildingName",
scopedSlots: { customRender: "name" },
width: "20%",
},
{
title: "房屋类型",
dataIndex: "manageEstateTypeName",
width: "10%",
},
{
title: "用户身份",
key: "tags",
dataIndex: "identity",
scopedSlots: { customRender: "tags" },
},
{
title: "操作",
dataIndex: "action",
key: "action",
width: "180",
fixed: "right",
scopedSlots: { customRender: "action" },
},
]
// 搜索项
export const searchForm = {
keyword: "",
sex: null
}
// 分页
export const pagination = {
current: 1,
total: 0,
pageSize: 10,
showTotal: (total) => `${total}`,
showSizeChanger: true,
showQuickJumper: true,
}

@ -90,203 +90,12 @@
</span>
</a-table>
</div>
<!-- add -->
<a-drawer
title="新增住户"
:width="720"
:visible="drawer.add.show"
:body-style="{ paddingBottom: '80px' }"
@close="addClose"
>
<div class="drawer-content">
基本信息
<a-divider></a-divider>
<a-form-model
ref="ruleForm"
:model="form"
:rules="rules"
layout="vertical"
>
<a-row>
<a-col :span='8'>
<a-form-model-item label="关联房屋" prop="manageEstateId">
<a-cascader :options="options" placeholder="Please select" @change="onChange" style='width:90%'/>
</a-form-model-item>
</a-col>
<a-col :span='8'>
<a-form-model-item label="房屋类型">
<a-input placeholder='请先选择关联房屋' disabled style='width:90%'/>
</a-form-model-item>
</a-col>
<a-col :span='8'>
<a-form-model-item label="住户身份" prop="identity">
<a-select placeholder='请选择住户身份' style='width:90%'/>
</a-form-model-item>
</a-col>
<a-col :span='12'>
<a-form-model-item label="姓名" prop="name">
<a-input placeholder='请输入姓名' style='width:90%'/>
</a-form-model-item>
</a-col>
<a-col :span='12'>
<a-form-model-item label="手机号" prop="tel">
<a-input placeholder='请输入手机号' style='width:90%'/>
</a-form-model-item>
</a-col>
<a-col :span='12'>
<a-form-model-item label="性别" prop="sex">
<a-input placeholder='请选择性别' style='width:90%'/>
</a-form-model-item>
</a-col>
<a-col :span='12'>
<a-form-model-item label="身份证号" prop="idCard">
<a-input placeholder='请输入身份证号' style='width:90%'/>
</a-form-model-item>
</a-col>
<a-col :span='12'>
<a-form-model-item label="入住时间" prop="checkTime">
<a-date-picker @change="onChange" />
</a-form-model-item>
</a-col>
<a-col :span='12'>
<a-form-model-item label="户籍所在地" prop="domicile">
<a-input placeholder='户籍所在地' style='width:90%'/>
</a-form-model-item>
</a-col>
<a-col :span='12'>
身份证徽面照
<a-upload
name="avatar"
list-type="picture-card"
class="avatar-uploader"
:show-upload-list="false"
action="https://www.mocky.io/v2/5cc8019d300000980a055e76"
:before-upload="beforeUpload"
@change="handleChange"
>
<img v-if="imageUrl" :src="imageUrl" alt="avatar" />
<div v-else>
<a-icon :type="loading ? 'loading' : 'plus'" />
<div class="ant-upload-text">
</div>
</div>
</a-upload>
</a-col>
<a-col :span='12'>
身份证头像照
<a-upload
name="avatar"
list-type="picture-card"
class="avatar-uploader"
:show-upload-list="false"
action="https://www.mocky.io/v2/5cc8019d300000980a055e76"
:before-upload="beforeUpload"
@change="handleChange"
>
<img v-if="imageUrl" :src="imageUrl" alt="avatar" />
<div v-else>
<a-icon :type="loading ? 'loading' : 'plus'" />
<div class="ant-upload-text">
</div>
</div>
</a-upload>
</a-col>
<div v-show='form.identity===2||form.identity===4'>
关联信息
<a-divider></a-divider>
</div>
<div v-if="form.identity===2">
<a-col :span="12">
<a-form-model-item label="业主姓名" prop="ownerName">
<a-input placeholder='请输入业主姓名' style='width:90%'/>
</a-form-model-item>
</a-col>
<a-col :span="12">
<a-form-model-item label="业主电话" prop="ownerTel">
<a-input placeholder='请输入业主电话' style='width:90%'/>
</a-form-model-item>
</a-col>
</div>
<div v-else-if="form.identity===4">
<a-col :span="12">
<a-form-model-item label="租户姓名" prop="tenantName">
<a-input placeholder='请输入租户姓名' style='width:90%'/>
</a-form-model-item>
</a-col>
<a-col :span="12">
<a-form-model-item label="租户电话" prop="tenantTel">
<a-input placeholder='请输入租户电话' style='width:90%'/>
</a-form-model-item>
</a-col>
</div>
联系信息
<a-divider></a-divider>
<a-col :span="12">
<a-form-model-item label="紧急联系人" prop="emergencyContact">
<a-input placeholder='请输入紧急联系人' style='width:90%'/>
</a-form-model-item>
</a-col>
<a-col :span="12">
<a-form-model-item label="紧急联系人电话" prop="emergencyContactNumber">
<a-input placeholder='请输入紧急联系人电话' style='width:90%'/>
</a-form-model-item>
</a-col>
其他信息
<a-divider></a-divider>
<a-col :span="12">
<a-form-model-item label="婚姻状况" prop="maritalStatus">
<a-select placeholder='请选择婚姻状况' style='width:90%'/>
</a-form-model-item>
</a-col>
<a-col :span="12">
<a-form-model-item label="民族" prop="nation">
<a-input placeholder='请输入民族' style='width:90%'/>
</a-form-model-item>
</a-col>
<a-col :span="12">
<a-form-model-item label="政治面貌" prop="politicalOutlook">
<a-select placeholder='请选择婚姻状况' style='width:90%'/>
</a-form-model-item>
</a-col>
<a-col :span="12">
<a-form-model-item label="户口类型" prop="accountType">
<a-select placeholder='请选择户口类型' style='width:90%'/>
</a-form-model-item>
</a-col>
<a-col :span="12">
<a-form-model-item label="从事职业" prop="occupation">
<a-input placeholder='请输入从事职业' style='width:90%'/>
</a-form-model-item>
</a-col>
<a-col :span="12">
<a-form-model-item label="工作单位" prop="employer">
<a-input placeholder='请输入工作单位' style='width:90%'/>
</a-form-model-item>
</a-col>
<a-col :span="24">
<a-form-model-item label="工作单位地址" prop="employerAddress">
<a-input placeholder='请输入工作单位地址' style='width:90%'/>
</a-form-model-item>
</a-col>
<a-col :span="24">
<a-form-model-item label="备注" prop="remarks">
<a-textarea placeholder='请输入备注' style='width:90%'/>
</a-form-model-item>
</a-col>
</a-row>
</a-form-model>
</div>
<div class="drawer-footer">
<a-button :style="{ marginRight: '8px' }" @click="drawer.add.show = false">
关闭
</a-button>
<a-button type="primary" @click="addClose"> </a-button>
</div>
</a-drawer>
</div>
</template>
<script>
import { columns,pagination,searchForm } from './component/config.js'
import { residentList } from '@/api/basic/resident'
export default {
data() {
return {
@ -301,14 +110,8 @@ export default {
detail:{}
},
changeId:null,
pagination: {
current: 1,
total: 0,
pageSize: 10,
showTotal: (total) => `${total}`,
showSizeChanger: true,
showQuickJumper: true,
},
pagination: pagination,
searchForm:searchForm,
activeAction: undefined,
loading: false,
// index
@ -316,121 +119,10 @@ export default {
tableChoosed: [],
//
//
columns: [
{
title: "住户姓名",
dataIndex: "name",
width: "10%",
},
{
title: "住户手机号",
dataIndex: "tel",
width: "10%",
},
{
title: "住户性别",
dataIndex: "sex",
width: "8%",
customRender:function(sex){
switch (sex) {
case 1:
return '男'
case 2:
return '女'
case 3:
return '保密'
default:
break;
}
}
},
{
title: "住户身份证号",
dataIndex: "idCard",
width: "10%",
},
{
title: "房屋名称",
dataIndex: "manageBuildingName",
scopedSlots: { customRender: "name" },
width: "20%",
},
{
title: "房屋类型",
dataIndex: "manageEstateTypeName",
width: "10%",
},
{
title: "用户身份",
key: "tags",
dataIndex: "identity",
scopedSlots: { customRender: "tags" },
},
{
title: "操作",
dataIndex: "action",
key: "action",
width: "180",
fixed: "right",
scopedSlots: { customRender: "action" },
},
],newData:[],
columns: columns,
newData:[],
//
tableData: [
{
"id": 1,
"name": "张三",
"tel": "13738611462",
"sex": 1,
"idCard": "331022199711273812",
"residentListEstateVoList": [
{
"id": 1,
"manageBuildingName": "1",
"manageUnitName": "单元1",
"floorLocation": 1,
"manageEstateName": "1室",
"manageEstateTypeName": "住宅",
"identity": 1
},
{
"id": 2,
"manageBuildingName": "2",
"manageUnitName": "单元2",
"floorLocation": 3,
"manageEstateName": "3室",
"manageEstateTypeName": "住宅",
"identity": 2
}
]
},
{
"id": 1,
"name": "张的三",
"tel": "13738611462",
"sex": 1,
"idCard": "331022199711273812",
"residentListEstateVoList": [
{
"id": 3,
"manageBuildingName": "3",
"manageUnitName": "单元3",
"floorLocation": 3,
"manageEstateName": "3室",
"manageEstateTypeName": "住宅",
"identity": 3
},{
"id": 4,
"manageBuildingName": "4",
"manageUnitName": "单元4",
"floorLocation": 4,
"manageEstateName": "4室",
"manageEstateTypeName": "住宅",
"identity": 4
}
]
},
],
tableData:[],
ActionsList: [
{
label: "批量删除",
@ -444,9 +136,19 @@ export default {
};
},
mounted(){
this.newData = this.tableData
this.getData()
},
methods: {
async getData() {
const res = await residentList({
pageNum: this.pagination.current,
size :this.pagination.pageSize,
sex:this.searchForm.sex,
keyword:this.searchForm.keyword,
})
this.tableData = res.data.rows
this.newData = this.tableData
},
addClose(){
this.drawer.add.show = false;
},

@ -0,0 +1,72 @@
/**
* 配置
* 表格列
*/
export const columns = [
{
title: "房屋名称",
dataIndex: "manageBuildingName",
scopedSlots: { customRender: "name" },
width: "20%",
},
{
title: "室内面积",
dataIndex: "indoorArea",
width: "15%",
},
{
title: "建筑面积",
dataIndex: "constructionArea",
width: "15%",
},
{
title: "房屋类型",
dataIndex: "manageEstateTypeName",
width: "15%",
},
{
title: "居住状态",
key: "tags",
dataIndex: "residenceStatus",
scopedSlots: { customRender: "tags" },
},
{
title: "是否开启租赁",
dataIndex: "isEnableLease",
scopedSlots: { customRender: "switch" },
},
{
title: "操作",
dataIndex: "action",
key: "action",
width: "180",
fixed: "right",
scopedSlots: { customRender: "action" },
},
]
// 搜索项
export const searchForm = {
name: "",
isEnableLease: null,
manageEstateTypeId:null
}
// 分页
export const pagination = {
current: 1,
total: 0,
pageSize: 10,
showTotal: (total) => `${total}`,
showSizeChanger: true,
showQuickJumper: true,
}
export function del(data) {
this.$confirm({
title: "是否删除",
// okText:'删除',
// cancelText:'取消',
icon: "",
onOk: function () {
console.log(data);
},
});
}

@ -8,7 +8,7 @@
<a-input placeholder="请输入房屋名称" />
<a-select style="width: 200px" placeholder="请选择房屋类型" />
<a-select style="width: 200px" placeholder="请选择是否开启租赁" />
<a-button type="primary"> </a-button>
<a-button type="primary" @click='getData'> </a-button>
<a-button> </a-button>
</a-space>
</a-col>
@ -250,6 +250,8 @@ function getBase64(file) {
reader.onerror = error => reject(error);
});
}
import { columns,pagination,searchForm, del } from "./component/config"
import { houseList } from '@/api/basic/estate'
export default {
data() {
return {
@ -305,14 +307,9 @@ export default {
remarks:undefined,
},
rules:{},
pagination: {
current: 1,
total: 0,
pageSize: 10,
showTotal: (total) => `${total}`,
showSizeChanger: true,
showQuickJumper: true,
},
pagination:pagination ,
searchForm:searchForm,
columns:columns ,
activeAction: undefined,
loading: false,
// index
@ -320,92 +317,8 @@ export default {
tableChoosed: [],
//
//
columns: [
{
title: "房屋名称",
dataIndex: "manageBuildingName",
scopedSlots: { customRender: "name" },
width: "20%",
},
{
title: "室内面积",
dataIndex: "indoorArea",
width: "15%",
},
{
title: "建筑面积",
dataIndex: "constructionArea",
width: "15%",
},
{
title: "房屋类型",
dataIndex: "manageEstateTypeName",
width: "15%",
},
{
title: "居住状态",
key: "tags",
dataIndex: "status",
scopedSlots: { customRender: "tags" },
},
{
title: "是否开启租赁",
dataIndex: "isEnableLease",
scopedSlots: { customRender: "switch" },
},
{
title: "操作",
dataIndex: "action",
key: "action",
width: "180",
fixed: "right",
scopedSlots: { customRender: "action" },
},
],
//
tableData: [
{
manageBuildingName: "1",
manageUnitName: "2",
floorLocation: "4",
name: "502",
roleNameList: ["点点3", "212", "点点"],
status: 1,
},
{
name: 1,
roleNameList: ["点点3", "212", "点点"],
status: 2,
isEnableLease: 1,
},
{
name: 1,
roleNameList: ["点点3", "212", "点点"],
status: 3,
isEnableLease: 0,
},
{},
{ isEnableLease: 1 },
{},
{},
{},
{},
{},
{},
{},
{},
{},
{},
{},
{},
{},
{},
{},
{},
{},
{},
{},
],
tableData:[],
ActionsList: [
{
label: "批量删除",
@ -418,7 +331,22 @@ export default {
],
};
},
created() {
this.getData()
},
methods: {
async getData() {
const res = await houseList(
{
pageNum:this.pagination.current,
size:this.pagination.pageSize,
name:this.searchForm.name,
isEnableLease:this.searchForm.isEnableLease,
manageEstateTypeId:this.searchForm.manageEstateTypeId,
}
)
this.tableData = res.data.rows
},
addHouse() {},
handleCancel() {
this.previewVisible = false;
@ -443,17 +371,10 @@ export default {
pager.pageSize = pagination.pageSize;
this.pagination = pager;
},
del(data) {
this.$confirm({
title: "是否删除",
// okText:'',
// cancelText:'',
icon: "",
onOk: function () {
console.log(data);
},
});
},
// del(data) {
// },
del:del,
Actions(data) {
console.log(data);
this.activeAction = undefined;

Loading…
Cancel
Save