Commit c089cc15 authored by 王向前's avatar 王向前

通讯录、管理设置、部门列表

parent 46600559
...@@ -156,6 +156,13 @@ const routes = [ ...@@ -156,6 +156,13 @@ const routes = [
title: '公司信息', title: '公司信息',
}, },
}, },
{
path: '/pages/user/details',
name: 'updateuser',
meta: {
title: '编辑成员',
},
},
] ]
export default routes export default routes
...@@ -146,13 +146,14 @@ ...@@ -146,13 +146,14 @@
{ {
"navigationBarTitleText" : "" "navigationBarTitleText" : ""
} }
},
{
"path" : "pages/user/details",
"style" :
{
"navigationBarTitleText" : ""
}
} }
], ],
"globalStyle": { "globalStyle": {
......
...@@ -197,7 +197,7 @@ ...@@ -197,7 +197,7 @@
type: null, type: null,
defaultHeadList: [], defaultHeadList: [],
dataList: [], dataList: [],
departmentPic: "/static/xmtb/folder-fill.png", departmentPic: "/static/icon/folder-fill.png",
modalName: null, modalName: null,
isMoreSetting: true, isMoreSetting: true,
isDeleteBm: true, isDeleteBm: true,
...@@ -289,11 +289,11 @@ ...@@ -289,11 +289,11 @@
} else { } else {
this.isDeleteBm = true this.isDeleteBm = true
} }
this.$http.post(_this.API.bmApi, { this.$http.post("kzzx/bm/query", {
id: this.currentBmData.id id: this.currentBmData.id
}).then(res => { }).then(res => {
if (res.data.success) { if (res.data.success) {
_this.currentBmData = res.data.data.records[0]; _this.currentBmData = res.data.records[0];
_this.$forceUpdate(); _this.$forceUpdate();
} }
}); });
...@@ -401,11 +401,13 @@ ...@@ -401,11 +401,13 @@
let nodes = []; let nodes = [];
_that.userList = []; _that.userList = [];
_that.nodeIds = []; _that.nodeIds = [];
this.$http.post("kzzx/user/query", { this.$http.post("kzzx/user/query", {
choosebmid: value.id choosebmid: value.id
}).then(res => { }).then(res => {
if (res.data.success) {
let _res = res.data.data.records; if (res.data) {
let _res = res.data.records;
if (_res.length > 0) { if (_res.length > 0) {
_that.parseTreeJson([value]); _that.parseTreeJson([value]);
nodes = [...new Set(_that.nodeIds)]; nodes = [...new Set(_that.nodeIds)];
...@@ -463,8 +465,8 @@ ...@@ -463,8 +465,8 @@
this.$http.post("kzzx/user/query", { this.$http.post("kzzx/user/query", {
choosebmid: value choosebmid: value
}).then(res => { }).then(res => {
if (res.data.success) { if (res.data) {
let _res = res.data.data.records; let _res = res.data.records;
_that.parseTreeJson(_that.dataList); _that.parseTreeJson(_that.dataList);
nodes = [...new Set(_that.nodeIds)] nodes = [...new Set(_that.nodeIds)]
_res.forEach(item => { _res.forEach(item => {
...@@ -515,15 +517,16 @@ ...@@ -515,15 +517,16 @@
getQyInfo() { getQyInfo() {
let _that = this; let _that = this;
this.$http.post("kzzx/bm/query", {}).then(res => { this.$http.post("kzzx/bm/query", {}).then(res => {
if (res.data.success) { if (res.data) {
_that.bmList = res.data.data.records; _that.bmList = res.data.records;
let _res = res.data.data; let _res = res.data;
let newBmdata = _that.transDataGUI(_that.bmList, "id", "pid", "children"); let newBmdata = _that.transDataGUI(_that.bmList, "id", "pid", "children");
let headData = {}; let headData = {};
if (_res) { if (_res) {
headData = { headData = {
name: _res.name, bmmc: _res.name,
id: _res.id id: _res.id,
children:newBmdata
} }
} }
...@@ -540,11 +543,11 @@ ...@@ -540,11 +543,11 @@
fzrid: headData.fzrid fzrid: headData.fzrid
} }
_that.currentBmData = headData; _that.currentBmData = headData;
if (Object.keys(this.defaultHeadList).length > 0) { if (Object.keys(_that.defaultHeadList).length > 0) {
this.$refs.refUniMallHead.addTab(this.defaultHeadList); _that.$refs.refUniMallHead.addTab(this.defaultHeadList);
} }
_that.dataList = headData["children"] || [] _that.dataList = headData["children"] || []
_that.postUserList(this.defaultHeadList.id); _that.postUserList(_that.defaultHeadList.id);
this.hackReset = false; this.hackReset = false;
this.$nextTick(() => { this.$nextTick(() => {
this.hackReset = true; this.hackReset = true;
...@@ -559,9 +562,9 @@ ...@@ -559,9 +562,9 @@
this.$http.post("kzzx/bm/query", { this.$http.post("kzzx/bm/query", {
pid: pid pid: pid
}).then(res => { }).then(res => {
if (res.data.success) { if (res.data) {
_that.bmList = res.data.data.records; _that.bmList = res.data.records;
let _res = res.data.data; let _res = res.data;
let newBmdata = _that.transDataGUI(_that.bmList, "id", "pid", "children"); let newBmdata = _that.transDataGUI(_that.bmList, "id", "pid", "children");
_that.dataList = newBmdata; _that.dataList = newBmdata;
_that.postUserList(pid); _that.postUserList(pid);
...@@ -641,7 +644,7 @@ ...@@ -641,7 +644,7 @@
this.$http.post('/kzzx/bm/update',{ this.$http.post('/kzzx/bm/update',{
master: formData master: formData
}).then(res => { }).then(res => {
if (res.data.success) { if (res.data) {
_that.modalName = null; _that.modalName = null;
_that.editBmData.bmmc = ""; _that.editBmData.bmmc = "";
_that.$tip.success("更新部门成功"); _that.$tip.success("更新部门成功");
...@@ -668,7 +671,7 @@ ...@@ -668,7 +671,7 @@
this.$http.post('/kzzx/bm/update',{ this.$http.post('/kzzx/bm/update',{
master: formData master: formData
}).then(res => { }).then(res => {
if (res.data.success) { if (res.data) {
_that.$tip.success("操作成功"); _that.$tip.success("操作成功");
_that.$forceUpdate(); _that.$forceUpdate();
} else { } else {
...@@ -687,7 +690,7 @@ ...@@ -687,7 +690,7 @@
this.$http.post('/kzzx/bm/delete',{ this.$http.post('/kzzx/bm/delete',{
id: key id: key
}).then(res => { }).then(res => {
if (res.data.success) { if (res.data) {
_that.$tip.success("操作成功"); _that.$tip.success("操作成功");
_that.postBm(_that.$refs.refUniMallHead.tabs[_that.$refs.refUniMallHead _that.postBm(_that.$refs.refUniMallHead.tabs[_that.$refs.refUniMallHead
.tabs.length - 2].id); .tabs.length - 2].id);
...@@ -727,7 +730,7 @@ ...@@ -727,7 +730,7 @@
this.$http.post('/kzzx/bm/add',{ this.$http.post('/kzzx/bm/add',{
master: formData master: formData
}).then(res => { }).then(res => {
if (res.data.success) { if (res.data) {
_that.modalName = null; _that.modalName = null;
_that.resetBm(); _that.resetBm();
_that.$tip.success("新建部门成功"); _that.$tip.success("新建部门成功");
...@@ -772,7 +775,7 @@ ...@@ -772,7 +775,7 @@
this.$http.post('/kzzx/user/add',{ this.$http.post('/kzzx/user/add',{
master: formData master: formData
}).then(res => { }).then(res => {
if (res.data.success) { if (res.data) {
_that.modalName = null; _that.modalName = null;
_that.resetUser(); _that.resetUser();
_that.$tip.success("新建成员成功"); _that.$tip.success("新建成员成功");
......
<template> <template>
<view class=""> <view class="">
<cu-header bgColor="bg-blue" isBack="true"> <cu-custom bgColor="bg-blue" isBack="true">
<block slot="content"> <block slot="content">
{{title}}</text> {{title}}</text>
</block> </block>
<block slot="right"> </cu-custom>
</block>
</cu-header>
<view :style="[{top:CustomBar + 'px'}]"> <view :style="[{top:CustomBar + 'px'}]">
<view class="cu-bar bg-white solid-bottom"> <view class="cu-bar bg-white solid-bottom">
<view class="action"> <view class="action">
...@@ -95,9 +92,9 @@ ...@@ -95,9 +92,9 @@
}, },
queryUser(){ queryUser(){
let _that=this; let _that=this;
_that.$http.post(_that.API.userApi,{superFlag:"Y"}).then(res => { _that.$http.post("kzzx/user/query",{superFlag:"Y"}).then(res => {
if (res.data.success) { if (res.data) {
_that.myList=res.data.data.records; _that.myList=res.data.records;
_that.options.status="noMore" _that.options.status="noMore"
} else { } else {
_that.myList=[]; _that.myList=[];
...@@ -121,14 +118,14 @@ ...@@ -121,14 +118,14 @@
let _that=this; let _that=this;
this.$tip.confirm("是否确认不通过?").then(r=>{ this.$tip.confirm("是否确认不通过?").then(r=>{
if(r.confirm){ if(r.confirm){
_that.$http.post(_that.API.userFailApi,{id:item.id}).then(res => { _that.$http.post("/kzzx/user/auditfail",{id:item.id}).then(res => {
if (res.data.success) { if (res.data) {
_that.queryUser(); _that.queryUser();
_that.$tip.success("操作成功"); _that.$tip.success("操作成功");
} else { } else {
_that.$tip.toast(res.data.message||"操作失败"); _that.$tip.toast(res.message||"操作失败");
} }
_that.modalName=null; _that.modalName=null;
_that.$forceUpdate() _that.$forceUpdate()
...@@ -145,12 +142,12 @@ ...@@ -145,12 +142,12 @@
} }
this.$tip.confirm("是否移除该管理员?").then(r=>{ this.$tip.confirm("是否移除该管理员?").then(r=>{
if(r.confirm){ if(r.confirm){
apiService.removeGlySetting({id:user.id}).then(res => { _that.$http.post("/kzzx/user/cancel/super",{id:user.id}).then(res => {
if (res.data.success) { if (res.data) {
_that.$tip.success("操作成功"); _that.$tip.success("操作成功");
_that.queryUser(); _that.queryUser();
} else { } else {
_that.$tip.toast(res.data.message||"操作失败"); _that.$tip.toast(res.message||"操作失败");
} }
_that.$forceUpdate() _that.$forceUpdate()
...@@ -161,7 +158,7 @@ ...@@ -161,7 +158,7 @@
}, },
addGly(user){ addGly(user){
let _that=this; let _that=this;
apiService.addGlySetting({id:user.userid}).then(res => { _that.$http.post("/kzzx/user/set/super",{id:user.userid}).then(res => {
if (res.data.success) { if (res.data.success) {
_that.$tip.success("操作成功"); _that.$tip.success("操作成功");
_that.queryUser(); _that.queryUser();
......
<template> <template>
<view class="bg-white"> <view class="bg-white">
<cu-header bgColor="bg-blue" isBack="true"> <cu-custom bgColor="bg-blue" isBack="true">
<block slot="content"> <block slot="content">
{{title}}</text> {{title}}</text>
</block> </block>
<block slot="right"> </cu-custom>
</block>
</cu-header>
<view class="bg-white"> <view class="bg-white">
<city-select <city-select
placeholder="搜索" placeholder="搜索"
...@@ -22,11 +19,9 @@ ...@@ -22,11 +19,9 @@
<script> <script>
import citySelect from '@/components/city-select/city-select.vue'; import citySelect from '@/components/city-select/city-select.vue';
import apiService from '@/api/api.js';
export default { export default {
data() { data() {
return { return {
API:apiService.API,
title:"通讯录", title:"通讯录",
formatName: 'username', formatName: 'username',
//显示的城市数据 //显示的城市数据
...@@ -39,10 +34,10 @@ ...@@ -39,10 +34,10 @@
methods: { methods: {
queryUser(){ queryUser(){
let _that=this; let _that=this;
_that.$http.post(_that.API.userApi,{}).then(res => { _that.$http.post("/kzzx/user/query",{}).then(res => {
if (res.data.success) { if (res.data) {
_that.obtainCitys=res.data.data.records; _that.obtainCitys=res.data.records;
_that.options.status="noMore" _that.options.status="noMore"
} else { } else {
_that.obtainCitys=[]; _that.obtainCitys=[];
......
<template>
<view>
<cu-custom :isBack="true" bgColor="bg-blue" >
<block slot="content">
{{title}}
</block>
</cu-custom>
<form @submit="formSubmit" @reset="formReset">
<view class="cu-list menu margin-top-sm">
<view class="cu-item animation-slide-bottom">
<view class="content">
<text class="text-grey">姓名</text>
</view>
<view class="action">
<uni-easyinput :inputBorder="false" v-model="userinfo.username" placeholder="" />
</view>
</view>
<view class="cu-item animation-slide-bottom">
<view class="content">
<text class="text-grey">手机号</text>
</view>
<view class="action">
<uni-easyinput :inputBorder="false" v-model="userinfo.phone" placeholder="" />
</view>
</view>
<view class="cu-item animation-slide-bottom">
<view class="content">
<text class="text-grey">邮箱</text>
</view>
<view class="action">
<uni-easyinput :inputBorder="false" v-model="userinfo.email" placeholder="" />
</view>
</view>
<view class="cu-item animation-slide-bottom">
<view class="content">
<text class="text-grey">部门</text>
</view>
<view class="action">
<text class="text-grey" @tap="tzBm">{{userinfo.bmmc||"未设置"}}</text>
</view>
</view>
<!-- <view class="cu-item animation-slide-bottom">
<view class="content">
<text class="text-grey">部门负责人</text>
</view>
<view class="action">
<view class="text-grey"><switch :checked="checked" @change="switch2Change" /></view>
</view>
</view> -->
</view>
<view class="text-center text-red padding-top-xl">
{{errorMsg}}
</view>
<view class="text-center margin-bottom-sm padding" v-show="isSuperuser">
<button style="display: flex;" class="cu-btn bg-blue lg margin-top-lg"
@tap="saveUser"><view space="emsp">保存</view>
</button>
<!-- <button style="display: flex;" class="cu-btn bg-blue lg margin-top-lg"
@tap="tzBm"><view space="emsp">调整部门</view>
</button> -->
<button style="display: flex;" class="cu-btn text-red bg-white lg margin-top-lg"
@tap="deleteUser"><view space="emsp">删除成员</view>
</button>
</view>
</form>
</view>
</template>
<script>
import apiService from '@/api/api.js'
var graceChecker = require("@/common/util/graceChecker.js");
export default {
data() {
return {
title:"编辑成员",
checked:false,
userinfo:{
username:"",
phone:"",
email:"",
bmmc:"",
bmid:"",
id:""
},
errorMsg:null
};
},
computed:{
isSuperuser() {
return this.$store.state.isSuperuser
}
},
methods: {
handleClick() {
uni.makePhoneCall({
phoneNumber: '18512542135' //仅为示例
});
},
formSubmit(){
},
formReset(){
},
getUserinfo(key){
let _that=this;
_that.$http.post("/kzzx/user/query",{id:key}).then(res => {
if (res.data) {
_that.userinfo=res.data.records[0]
} else {
_that.$tip.toast(res.message||"操作失败");
}
_that.$forceUpdate()
});
},
switch2Change(){
},
saveUser(){
let formData=this.userinfo;
let _that=this;
let rule=[
{name:"username", checkType: "notnull", checkRule: "", errorMsg: "姓名不能为空" },
{name:"bmmc", checkType: "notnull", checkRule: "", errorMsg: "部门中文名称不能为空" },
{name:"phone", checkType: "notnull", checkRule: "", errorMsg: "手机号码不能为空" },
]
var checkRes = graceChecker.check(formData,rule);
formData["flag"]="U";
if(!checkRes){
this.errorMsg=graceChecker.error;
}else{
this.errorMsg=null;
_that.$http.post("/kzzx/user/update",{master:formData}).then(res => {
if (res.data) {
_that.$tip.success("操作成功");
_that.$eventHub.$emit("refreshbm");
_that.$Router.back(1);
} else {
_that.$tip.toast(res.data.message||"操作失败");
}
_that.$forceUpdate()
});
}
},
deleteUser(){
let _that=this;
let key=this.userinfo.id;
this.$tip.confirm("是否删除成员?").then(r=>{
if(r.confirm){
_that.$http.post("/kzzx/user/delete",{id:key}).then(res => {
if (res.data) {
_that.$tip.success("操作成功");
_that.$eventHub.$emit("refreshbm");
_that.$Router.back(1);
} else {
_that.$tip.toast(res.data.message||"操作失败");
}
_that.$forceUpdate()
});
}
})
},
tzBm(){
this.$Router.push({name:"bm",params:{id:"tz"}})
}
},
onLoad() {
let _this=this;
this.userinfo.id=this.$Route.query.userid;
this.getUserinfo(this.$Route.query.userid);
this.$eventHub.$on("updateBmids",function(value){
_this.userinfo.bmid=value.bmid;
_this.userinfo.bmmc=value.bmmc;
_this.$forceUpdate();
})
},
onUnload() {
this.$eventHub.$off('updateBmid');
}
};
</script>
<style scoped lang="scss">
.user-info {
background: #ffffff;
display: flex;
align-items: center;
margin-bottom: 10px;
padding: 14px 18px;
box-sizing: border-box;
.user-info-pic {
width: 60px;
height: 60px;
background: #377fff;
border-radius: 10px;
display: flex;
align-items: center;
justify-content: center;
margin-right: 20px;
overflow: hidden;
image {
width: 60px;
height: 60px;
}
}
.user-info-text {
.user-info-text-top {
font-weight: 500;
font-size: 20px;
line-height: 23px;
color: #333333;
margin-bottom: 10px;
}
.user-info-text-bottom {
text {
font-size: 14px;
line-height: 18px;
color: #666666;
margin-right: 10px;
}
}
}
}
.list {
.list-item {
background: #ffffff;
height: 48px;
display: flex;
align-items: center;
margin-bottom: 1px;
padding: 0 15px;
box-sizing: border-box;
position: relative;
&:last-child {
margin-bottom: 0px;
}
&:active {
background: #f2f3f4;
}
&.show-icon {
&::after {
content: '';
position: absolute;
width: 5px;
height: 10px;
top: 20px;
right: 15px;
background: url(../../static/icon/more.png) no-repeat;
}
}
.list-item-left {
font-size: 16px;
color: #666666;
width: 100px;
}
.list-item-right {
font-size: 14px;
color: #000000;
flex: 1;
}
}
}
.list-btn {
padding: 0 20px;
box-sizing: border-box;
margin-top: 30px;
button {
height: 48px;
background: linear-gradient(270deg, #55bafe -0.03%, #3072ff 100%);
box-shadow: 0px 4px 4px rgba(0, 0, 0, 0.1);
border-radius: 24px;
color: #ffffff;
font-weight: bold;
font-size: 18px;
outline: none;
border: none;
&:active {
opacity: 0.9;
}
}
}
</style>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment