张雄 3 years ago
parent 5023090b5d
commit 32681d8bf1

Binary file not shown.

@ -295,4 +295,49 @@ export function alipayUpdate(params) {
method: 'post',
data: params,
})
}
// 管理员账号-查询所有的超级管理员
export function getSuperUserList(params) {
return httpService({
url: `/user/superUserSetting/list`,
method: 'get',
params: params,
})
}
// 管理员账号-添加超级管理员信息
export function addSuperUser(params) {
return httpService({
url: `/user/superUserSetting/insert`,
method: 'post',
data: params,
})
}
// 管理员账号-根据后台用户主键id查询后台用户信息
export function findSuperUser(params) {
return httpService({
url: `/user/superUserSetting/findById`,
method: 'get',
params: params,
})
}
// 管理员账号-修改超级管理员信息
export function updateSuperUser(params) {
return httpService({
url: `/user/superUserSetting/update`,
method: 'post',
data: params,
})
}
// 管理员账号-正常/停用 超级管理员
export function enableSuperUser(params) {
return httpService({
url: `/user/superUserSetting/enable`,
method: 'get',
params: params,
})
}

@ -27,11 +27,11 @@ export default {
}
},
mounted() {
if(store.getters.getCity.length===0){
// if(store.getters.getCity.length===0){
allCity().then(res=>{
this.cityList = res.data
})
}
// }
}
};
</script>

@ -52,6 +52,14 @@ export default [
component: resolve => require(['@/views/Manage/AdminSet/PaymentSet'], resolve),
meta: { title: '支付设置' },
},
{
path: '/Manage/AdminSet/AccountSet',
name: "AccountSet",
title: "管理员账号",
hide: false,
component: resolve => require(['@/views/Manage/AdminSet/AccountSet'], resolve),
meta: { title: '管理员账号' },
},
]
},
{

@ -11,6 +11,10 @@ export default {
Vue.prototype.$ImgUrl = (src) => {
return process.env.VUE_APP_STATIC + '/' + src
}
// 小区识别码
Vue.prototype.$VillageUrl = (src, code) => {
return 'https://saas.kaidalai.cn/resource/' + code + '/' + src
}
// 时间格式化
Vue.prototype.formatDate = (time, fmt) => {
if (time > 0) {

@ -0,0 +1,90 @@
export const columns = [
{
title: "用户名",
width: "8%",
dataIndex: "userName",
},
{
title: "姓名",
width: "6%",
dataIndex: "actualName",
},
{
title: "密码",
width: "10%",
dataIndex: "password",
},
{
title: "手机号",
width: "10%",
dataIndex: "tel",
},
{
title: "性别",
width: "6%",
dataIndex: "sex",
customRender: function(status) {
switch(status) {
case 1: return '男';
case 2: return '女';
case 3: return '保密';
}
}
},
{
title: "员工编号",
width: "10%",
dataIndex: "userCode",
},
{
title: "是否启用",
width: "6%",
dataIndex: "status",
scopedSlots: { customRender: "status" },
},
{
title: "创建时间",
width: "10%",
dataIndex: "createDate",
customRender: function(createDate) {
let date = new Date(createDate).toLocaleString();
return date
}
},
{
title: "最后登录ip",
width: "12%",
dataIndex: "lastLoginIp",
},
{
title: "最后登录时间",
width: "10%",
dataIndex: "lastLoginDate",
},
{
title: "操作",
dataIndex: "action",
key: "action",
width: "180",
fixed: "right",
scopedSlots: { customRender: "action" },
},
]
export const pagination= {
current: 1,
total: 0,
pageSize: 10,
showTotal: (total) => `${total}`,
showSizeChanger: true,
showQuickJumper: true,
};
export const rules = {
communityId: [{ required: true, message: "请选择小区", trigger: "change" }],
userName: [{ required: true, message: "请输入用户名", trigger: "blur" }],
password: [{ required: true, message: "请输入密码", trigger: "blur" }],
actualName: [{ required: true, message: "请输入姓名", trigger: "blur" }],
tel: [{ required: true, message: "请输入手机号", trigger: "blur" }],
sex: [{ required: true, message: "请选择性别", trigger: "change" }],
}

@ -0,0 +1,251 @@
<template>
<div class="main">
<div class="cardTitle">管理员账号</div>
<div class="search-box">
<a-space size="large">
<a-form-model layout="inline">
<a-form-model-item label="真实姓名">
<a-input v-model="form.actualName" placeholder="请输入真实姓名"></a-input>
</a-form-model-item>
<a-form-model-item label="用户名">
<a-input v-model="form.userName" placeholder="请输入用户名"></a-input>
</a-form-model-item>
<a-form-model-item label="手机号">
<a-input v-model="form.tel" placeholder="请输入手机号"></a-input>
</a-form-model-item>
</a-form-model>
<a-button type="primary" @click="handlerSearch"> </a-button>
<a-button @click="handlerReset"> </a-button>
</a-space>
</div>
<div id="commonTable">
<div style="margin-bottom: 16px">
<a-button icon="plus" @click="hanlderAdd" type="primary" ghost>
新增管理员
</a-button>
</div>
<a-table :columns="columns" :data-source="tableData" :scroll="{ x: 2200 }" :pagination="pagination" @change="pageChange" :row-key="(record) => {return record.id}">
<template slot="status" slot-scope="text,record">
<a-switch :checked="record.status==2 ? false : true" checked-children="" un-checked-children="" @change="onChange(record)" />
</template>
<template slot="action" slot-scope="text,record">
<a @click="alipayEdit(record)"></a>
</template>
</a-table>
</div>
<a-drawer :title="activeMode == 1 ? '新增管理员':'编辑'" :visible="drawerVisible" @close="drawerClose" width="512">
<div class="drawer-content">
<a-form-model :rules="rules" :model="alipayForm">
<a-row>
<a-col :span="24">
<a-form-model-item label="绑定小区" prop="communityId">
<a-select v-model="alipayForm.communityId" placeholder="请选择小区">
<a-select-option v-for="(item) in comList" :key="item.id" :value="item.id">{{item.name}}</a-select-option>
</a-select>
</a-form-model-item>
<a-form-model-item label="用户名" prop="userName">
<a-input v-model="alipayForm.userName" placeholder="请输入用户名"></a-input>
</a-form-model-item>
<a-form-model-item label="密码" prop="password">
<a-input v-model="alipayForm.password" placeholder="请输入密码"></a-input>
</a-form-model-item>
<a-form-model-item label="真实姓名" prop="actualName">
<a-input v-model="alipayForm.actualName" placeholder="请输入姓名"></a-input>
</a-form-model-item>
<a-form-model-item label="手机号" prop="tel">
<a-input v-model="alipayForm.tel" placeholder="请输入手机号"></a-input>
</a-form-model-item>
<a-form-model-item label="性别" prop="sex">
<a-select v-model="alipayForm.sex" placeholder="请选择性别">
<a-select-option :value="1"></a-select-option>
<a-select-option :value="2"></a-select-option>
<a-select-option :value="3">保密</a-select-option>
</a-select>
</a-form-model-item>
<a-form-model-item label="生日">
<a-date-picker v-model="selTime" @change="timeChange" value-format="YYYY-MM-DD HH:mm:ss"></a-date-picker>
</a-form-model-item>
<a-form-model-item label="电子邮箱">
<a-input v-model="alipayForm.email" placeholder="请输入邮箱"></a-input>
</a-form-model-item>
<a-form-model-item label="身份证号">
<a-input v-model="alipayForm.idCard" placeholder="请输入身份证号"></a-input>
</a-form-model-item>
</a-col>
</a-row>
</a-form-model>
</div>
<div class="drawer-footer">
<a-button @click="drawerClose"></a-button>
<a-button style="margin-left: 8px" v-if="activeMode == 1" @click="addComfirm" type="primary"></a-button>
<a-button style="margin-left: 8px" v-else-if="activeMode == 2" @click="editConfirm" type="primary">确定</a-button>
</div>
</a-drawer>
</div>
</template>
<script>
import {getAllCommunityInfo} from "@/api/basic/console"
import {getSuperUserList, addSuperUser, findSuperUser,updateSuperUser, enableSuperUser} from "@/api/manage"
import {columns,pagination, rules} from "./config"
export default {
name: 'PaymentSet',
data() {
return {
form: {
actualName: '',
userName: '',
tel: ''
},
alipayForm: {
communityId: undefined,
userName: '',
password: '',
actualName: '',
tel: '',
sex: undefined,
birthday: undefined,
email: '',
idCard: ''
},
selTime: '',
boundForm: {
alipaySettingId: undefined,
communityIds: []
},
tableData: [],
columns: columns,
pagination: pagination,
rules: rules,
//
activeMode: 1, //1 2
activeId: undefined,
drawerVisible: false,
//
comList: [],
boundVisible: false,
}
},
mounted() {
this.getApi();
this.getData()
},
methods: {
getApi() {
getAllCommunityInfo().then(res => {
let data = res.data;
this.comList = data;
})
},
getData() {
let obj = Object.assign(this.form, {pageNum:this.pagination.current,size:this.pagination.pageSize});
getSuperUserList(obj).then(res => {
let data = res.data.rows;
this.pagination.total = res.data.total;
this.tableData = data;
})
},
handlerSearch() {
this.getData()
},
handlerReset() {
this.form= {
actualName: '',
userName: '',
tel: ''
},
this.getData()
},
hanlderAdd() {
this.activeMode = 1;
this.drawerVisible = true;
},
//
addComfirm() {
addSuperUser(this.alipayForm).then(res => {
if (res.code === 200) {
this.$message.success(res.msg);
this.getData();
this.drawerClose();
} else {
this.$message.error(res.msg);
}
})
},
//
alipayEdit(record) {
this.activeMode = 2;
findSuperUser({manageUserId: record.id}).then(res => {
let data = res.data;
this.activeId = data.id;
this.alipayForm.communityId = data.communityId;
this.alipayForm.userName = data.userName;
this.alipayForm.password = data.password;
this.alipayForm.actualName = data.actualName;
this.alipayForm.tel = data.tel;
this.alipayForm.sex = data.sex;
this.alipayForm.birthday = data.birthday;
this.alipayForm.email = data.email;
this.alipayForm.idCard = data.idCard;
this.selTime = new Date(data.birthday).toLocaleString()
})
this.drawerVisible = true;
},
//
pageChange(val) {
this.pagination.pageSize = val.pageSize;
this.pagination.current = val.current;
this.getData()
},
//
onChange(record) {
let obj = {manageUserId: record.id}
enableSuperUser(obj).then(res => {
if (res.code === 200) {
this.$message.success(res.msg);
this.getData();
} else {
this.$message.error(res.msg);
}
})
},
//
drawerClose() {
this.drawerVisible = false;
this.alipayForm = {
communityId: undefined,
userName: '',
password: '',
actualName: '',
tel: '',
sex: undefined,
birthday: '',
email: '',
idCard: ''
}
},
boundClose() {this.boundVisible = false},
//
editConfirm() {
let obj = Object.assign(this.alipayForm, {id: this.activeId})
updateSuperUser(obj).then(res => {
if (res.code === 200) {
this.$message.success(res.msg);
this.getData();
this.drawerVisible = false;
} else {
this.$message.error(res.msg);
}
})
},
//
timeChange(val) {
this.alipayForm.birthday = val
},
}
}
</script>
<style>
</style>

@ -167,6 +167,8 @@ export default {
},
//
handleTableChange(pagination) {
this.pagination.current = pagination.current;
this.pagination.pageSize = pagination.pageSize
this.form.size = pagination.pageSize;
this.form.pageNum = pagination.current;
this.getData();

@ -124,6 +124,7 @@ export default {
let obj = {pageNum: this.pagination.current,size: this.pagination.pageSize}
getBalanceList(obj).then(res => {
let data = res.data;
console.log(data)
this.tableData = data.rows;
this.pagination.total = data.total
})

@ -32,7 +32,6 @@
>
<span slot="pics" slot-scope="text,record">
<img style="width: 40px;height: 40px" v-for="(item, index) in record.communityImgList" :src="$ImgUrl(item.url)" :key="index">
<!-- {{record.communityImgList}} -->
</span>
<span slot="action" slot-scope="text,record">
<a @click="detail(record)"></a>
@ -207,23 +206,22 @@ export default {
this.addForm.address = data.countyId //
//
this.addForm.communityUrls = [];
if (res.data.imgList.length > 0) {
const pic = [];
this.addForm.communityUrls.push(res.data.imgList[0].url)
for (let item of res.data.imgList) {
let obj = {
name: item.url.split("_")[0] + "." + item.url.split(".")[1],
url: this.$ImgUrl(item.url),
uid: item.url.split("_")[1],
status: "done",
thumbUrl: this.$ImgUrl(item.url),
};
pic.push(obj);
}
this.fileList = pic;
}else{
this.addForm.communityUrls=[]
}
console.log(res.data)
if (res.data.imgList.length > 0) {
const pic = [];
this.addForm.communityUrls.push(res.data.imgList[0].url)
for (let item of res.data.imgList) {
let obj = {
name: item.url.split("_")[0] + "." + item.url.split(".")[1],
url: this.$ImgUrl(item.url),
uid: item.url.split("_")[1],
status: "done",
thumbUrl: this.$ImgUrl(item.url),
};
pic.push(obj);
}
this.fileList = pic;
}
})
this.chosenId = record.id; //id
this.visible = true;
@ -302,7 +300,7 @@ export default {
if(ele.status == 'done') {
this.addForm.communityUrls.push(ele.response.data)
}
})
});
}
},
};

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff
Loading…
Cancel
Save