Commit a88298ae authored by Z's avatar Z

Merge branch 'master' of gitlabz:xulili/ybf

parents 5d230127 06684ed3
...@@ -5,7 +5,7 @@ import request from '@/utils/request' ...@@ -5,7 +5,7 @@ import request from '@/utils/request'
//通讯录管理---表格---获取全部人员 //通讯录管理---表格---获取全部人员
export function getAllMemberList(data) { export function getAllMemberList(data) {
return request({ return request({
url: '/admin/auth/addressbook/getUserAll', url: '/admin/auth/addressbook/clerk/getAll',
method: 'get', method: 'get',
params: data params: data
}) })
...@@ -13,7 +13,7 @@ export function getAllMemberList(data) { ...@@ -13,7 +13,7 @@ export function getAllMemberList(data) {
// 获取未分组人员 // 获取未分组人员
export function getNoGroupMember(data) { export function getNoGroupMember(data) {
return request({ return request({
url: '/admin/auth/addressbook/getUserUnselected', url: '/admin/auth/addressbook/clerk/getArrangeNot',
method: 'get', method: 'get',
params: data params: data
}) })
...@@ -21,7 +21,7 @@ export function getNoGroupMember(data) { ...@@ -21,7 +21,7 @@ export function getNoGroupMember(data) {
// 获取柜组用户 // 获取柜组用户
export function getGroupById(data) { export function getGroupById(data) {
return request({ return request({
url: '/admin/auth/addressbook/getUserByShopId', url: '/admin/auth/addressbook/orgnization/getClerkById',
method: 'get', method: 'get',
params: data params: data
}) })
...@@ -37,13 +37,13 @@ export function getMemberById(data) { ...@@ -37,13 +37,13 @@ export function getMemberById(data) {
//通讯录管理---组织架构 //通讯录管理---组织架构
export function getOrgTree() { export function getOrgTree() {
return request({ return request({
url: '/admin/auth/addressbook/addressBookPage', url: '/admin/auth/addressbook/orgnization/getAll',
method: 'get', method: 'get',
}) })
} }
export function getHistoryList(data) { export function getHistoryList(data) {
return request({ return request({
url: 'admin/auth/addressbook/synchronization', url: 'admin/auth/addressbook/clerk/synchronization',
method: 'get', method: 'get',
params:data params:data
}) })
...@@ -57,7 +57,6 @@ export function getHistoryList(data) { ...@@ -57,7 +57,6 @@ export function getHistoryList(data) {
} }
// 获取移动分组 // 获取移动分组
// /admin/auth/addressbook/synchronization
export function getGroup() { export function getGroup() {
return request({ return request({
url: '/admin/auth/addressbook/selectGroupPage', url: '/admin/auth/addressbook/selectGroupPage',
...@@ -77,7 +76,16 @@ export function getHistoryList(data) { ...@@ -77,7 +76,16 @@ export function getHistoryList(data) {
// 移动人员 // 移动人员
export function moveMember(data) { export function moveMember(data) {
return request({ return request({
url: 'admin/auth/addressbook/updateStallClerkByUserId', url: 'admin/auth/addressbook/clerk/moveTo',
method: 'put',
params:data
})
}
// 设置管理员||取消管理员
export function changeRole(data) {
return request({
url: 'admin/auth/addressbook/clerk/configManagerById',
method: 'put', method: 'put',
params:data params:data
}) })
...@@ -86,8 +94,26 @@ export function getHistoryList(data) { ...@@ -86,8 +94,26 @@ export function getHistoryList(data) {
// 模糊查询 // 模糊查询
export function search(data) { export function search(data) {
return request({ return request({
url: '/admin/auth/addressbook/getUserByKeyWords', url: '/admin/auth/addressbook/clerk/getByUserIdOrUserName',
method: 'get', method: 'get',
params:data params:data
}) })
}
// 添加子部门
export function addGroup(data) {
return request({
url: '/admin/auth/addressbook/orgnization/save',
method: 'post',
params:data
})
}
// 删除子部门
export function deleteGroup(data) {
return request({
url: '/admin/auth/addressbook/orgnization/deleteById',
method: 'delete',
params:data
})
} }
\ No newline at end of file
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
<!-- 顶栏 --> <!-- 顶栏 -->
<div <div
class="d2-theme-header" class="d2-theme-header"
:style="{ opacity: this.searchActive ? 0.5 : 1 }" :style="{ opacity: this.searchActive ? 0.5 : 1 }"
flex-box="0" flex-box="0"
flex flex
> >
...@@ -33,7 +33,7 @@ ...@@ -33,7 +33,7 @@
</div> </div>
</div> </div>
<!-- 下面 主体 --> <!-- 下面 主体 -->
<div class="d2-theme-container" flex-box="1" flex flex="dir:top"> <div class="d2-theme-container" flex-box="1" flex="dir:top">
<!-- 主体 侧边栏 --> <!-- 主体 侧边栏 -->
<!-- <div <!-- <div
flex-box="0" flex-box="0"
...@@ -101,17 +101,17 @@ export default { ...@@ -101,17 +101,17 @@ export default {
name: 'd2-layout-header-aside', name: 'd2-layout-header-aside',
mixins: [mixinSearch], mixins: [mixinSearch],
components: { components: {
d2MenuSide, // d2MenuSide,
d2MenuHeader, d2MenuHeader,
d2Tabs, // d2Tabs,
d2HeaderFullscreen, d2HeaderFullscreen,
d2HeaderLocales, // d2HeaderLocales,
d2HeaderSearch, // d2HeaderSearch,
d2HeaderSize, // d2HeaderSize,
d2HeaderTheme, // d2HeaderTheme,
d2HeaderUser, d2HeaderUser,
d2HeaderLog, // d2HeaderLog,
d2HeaderColor, // d2HeaderColor,
d2HeaderAlarmNotify d2HeaderAlarmNotify
}, },
data () { data () {
......
<template>
<div class="ct">
<el-dialog
title="创建子部门"
:visible.sync="addDialog"
width="30%"
:show-close="false"
:close-on-click-modal="false"
>
<div class="config_item">
<label class="config_name">部门名称</label>
<el-input class="config_value" v-model="params.d_name" placeholder="请输入部门名称" />
</div>
<div class="config_item">
<span class="config_name">上级部门</span>
<div>
<div @click="showTreeData" class="config_value father_group">
<span class="father_name_text">{{ paramsForShow.father_name }}</span>
<span :class="showTree ? 'arrow_up' : 'arrow_down'"></span>
</div>
</div>
</div>
<div class="tree_data" v-if="showTree">
<el-tree
ref="tree"
class="tree"
:check-strictly="true"
:data="treeData"
node-key="id"
@node-click="handleNodeClick"
@check-change="checkChange"
>
</el-tree>
</div>
<div class="config_item">
<label class="config_name">店铺编号</label>
<el-input class="config_value" v-model="params.code" placeholder="请输入店铺编号" />
</div>
<div class="tips" v-if="checked">请将表单填写完整</div>
<span slot="footer" class="dialog-footer">
<el-button @click="handleAddCancel" size="small">取 消</el-button>
<el-button type="primary" @click="handleAddFinish" size="small"
>确 定</el-button
>
</span>
</el-dialog>
<div></div>
</div>
</template>
<script>
import { addGroup, getOrgTree } from "@/api/in/mail";
import { log } from "util";
export default {
props: {
addDialog: {
type: Boolean,
default: false
}
},
data() {
return {
treeData: [],
group_name: '',
shop_code: '',
showTree: false,
paramsForShow: {
name: '',
father_name: '',
code: ''
},
params: {
d_name: '',
d_parentId: '',
code: ''
},
checked: false
};
},
created() {
this.getList()
},
methods: {
handleAddCancel() {
this.$emit("handleAddCancel");
},
handleAddFinish() {
if(!this.params.d_name || !this.params.d_parentId || !this.params.code) {
this.checked = true
return
}
addGroup(this.params).then(res=> {
// console.log(res)
})
// console.log(addGroup)
this.$emit("handleAddFinish");
},
handleNodeClick(item, node, self) {
// console.log(item,node,self)
this.params.d_parentId = item.id;
this.paramsForShow.father_name = item.label
},
checkChange(item, node, self) {
},
showTreeData() {
this.showTree = !this.showTree
},
getList() {
getOrgTree().then(res => {
console.log(res.data.organizations)
this.treeData = [res.data.organizations];
}).catch(err => {
console.log(err)
});
}
}
};
</script>
<style scoped>
.tree >>> .is-leaf + .el-checkbox .el-checkbox__inner {
display: inline-block;
}
.tree >>> .el-checkbox .el-checkbox__inner {
display: none;
}
.choose {
padding: 16px;
font-size: 16px;
font-weight: bold;
color: rgba(56, 56, 56, 1);
box-sizing: border-box;
}
.title {
display: flex;
align-items: center;
justify-content: space-between;
/* border-bottom: 1px solid #f8f8f8; */
padding-bottom: 10px;
}
.transfer-footer {
margin-left: 20px;
padding: 6px 5px;
}
.ct >>> .el-dialog__header {
border-bottom: 1px solid #f8f8f8;
}
.ct >>> .el-dialog__body {
padding: 20px 40px;
}
.ct >>> .el-transfer-panel {
width: 250px;
}
.circle {
width: 30px;
height: 30px;
line-height: 30px;
border-radius: 50%;
border: 1px solid rgba(208, 2, 27, 1);
position: relative;
}
.circle >>> .icon {
width: 28px;
height: 28px;
position: absolute;
left: 50%;
top: 50%;
transform: translate(-50%, -50%);
}
.br {
border-top: 1px solid #f8f8f8;
border-bottom: 1px solid #f8f8f8;
padding: 24px 0;
}
.config_item {
display: flex;
flex-direction: row;
align-items: center;
}
.config_name:before {
content: '* ';
color: red;
}
.config_name {
width: 80px;
text-align: center;
margin-right: 10px;
}
.config_value {
width: 230px;
}
.father_group {
margin: 10px 0;
width: 228px;
height: 38px;
border-radius: 4px;
border: 1px solid #DCDFE6;
position: relative;
}
.arrow_down {
width: 0;
height: 0;
border-width: 5px;
border-style: solid;
border-color: #ccc transparent transparent transparent;
position: absolute;
right: 10px;
top: 20px;
}
.arrow_up {
width: 0;
height: 0;
border-width: 5px;
border-style: solid;
border-color: transparent transparent #ccc transparent;
position: absolute;
right: 10px;
top: 15px;
}
.tree_data {
margin-left: 90px;
}
.father_name_text {
line-height: 38px;
padding-left: 15px;
}
.tips {
width: 100%;
text-align: center;
color: red;
margin: 5px 0;
}
</style>
<template>
<div class="ct">
<el-dialog
title="删除子部门"
:visible.sync="deleteDialog"
width="30%"
:show-close="false"
:close-on-click-modal="false"
>
<div v-if="nowNode.children.length > 0 ? true : false">删除"{{nowNode.label}}"请先删除其下所有子部门</div>
<div v-else>部门"{{nowNode.label}}"删除后,该部门下的用户会被分配至“未分组列表”,是否删除?</div>
<span slot="footer" class="dialog-footer">
<el-button @click="handleDeleteCancel" size="small">取 消</el-button>
<el-button v-if="nowNode.children.length > 0 ? false : true" type="primary" @click="handleDeleteFinish" size="small"
>确 定</el-button
>
</span>
</el-dialog>
<div></div>
</div>
</template>
<script>
import { deleteGroup } from "@/api/in/mail";
import { log } from "util";
export default {
props: {
deleteDialog: {
type: Boolean,
default: true
},
nowNode: {
type: Object,
default: {}
}
},
data() {
return {
};
},
created() {
console.log(this.nowNode)
},
methods: {
handleDeleteCancel() {
this.$emit('handleDeleteCancel')
},
handleDeleteFinish() {
deleteGroup({id: this.nowNode.id}).then(res => {
console.log(res)
})
this.$emit('handleDeleteFinish')
}
}
};
</script>
<style scoped>
.tree >>> .is-leaf + .el-checkbox .el-checkbox__inner {
display: inline-block;
}
.tree >>> .el-checkbox .el-checkbox__inner {
display: none;
}
.choose {
padding: 16px;
font-size: 16px;
font-weight: bold;
color: rgba(56, 56, 56, 1);
box-sizing: border-box;
}
.title {
display: flex;
align-items: center;
justify-content: space-between;
/* border-bottom: 1px solid #f8f8f8; */
padding-bottom: 10px;
}
.transfer-footer {
margin-left: 20px;
padding: 6px 5px;
}
.ct >>> .el-dialog__header {
border-bottom: 1px solid #f8f8f8;
}
.ct >>> .el-dialog__body {
padding: 20px 40px;
}
.ct >>> .el-transfer-panel {
width: 250px;
}
.circle {
width: 30px;
height: 30px;
line-height: 30px;
border-radius: 50%;
border: 1px solid rgba(208, 2, 27, 1);
position: relative;
}
.circle >>> .icon {
width: 28px;
height: 28px;
position: absolute;
left: 50%;
top: 50%;
transform: translate(-50%, -50%);
}
.br {
border-top: 1px solid #f8f8f8;
border-bottom: 1px solid #f8f8f8;
padding: 24px 0;
}
</style>
...@@ -102,7 +102,7 @@ export default { ...@@ -102,7 +102,7 @@ export default {
page: { page: {
currentPage: 1, currentPage: 1,
size: 20, size: 20,
total: 100 total: 0
}, },
}; };
}, },
...@@ -115,9 +115,9 @@ export default { ...@@ -115,9 +115,9 @@ export default {
pageNum: 1 pageNum: 1
} }
getHistoryList(params).then(res => { getHistoryList(params).then(res => {
console.log(res,"res"); // console.log(res,"res");
this.main = res.data.list this.main = res.data.pageInfo.list
this.page.total = Number(res.data.total) this.page.total = Number(res.data.pageInfo.total)
}) })
}, },
setListsHeadStyle({ row, column, rowIndex, columnIndex }) { setListsHeadStyle({ row, column, rowIndex, columnIndex }) {
......
...@@ -59,7 +59,6 @@ ...@@ -59,7 +59,6 @@
show-checkbox show-checkbox
:check-strictly="true" :check-strictly="true"
:data="treeData" :data="treeData"
:props="orgData"
node-key="id" node-key="id"
@node-click="handleNodeClick" @node-click="handleNodeClick"
@check-change="checkChange" @check-change="checkChange"
...@@ -78,7 +77,7 @@ ...@@ -78,7 +77,7 @@
</template> </template>
<script> <script>
import { getGroup, moveMember } from "@/api/in/mail"; import { getOrgTree, moveMember } from "@/api/in/mail";
import { log } from "util"; import { log } from "util";
export default { export default {
...@@ -94,11 +93,6 @@ export default { ...@@ -94,11 +93,6 @@ export default {
}, },
data() { data() {
return { return {
orgData: {
label: "name",
children: "adminStallList",
id: "id"
},
treeData: [] treeData: []
}; };
}, },
...@@ -110,10 +104,11 @@ export default { ...@@ -110,10 +104,11 @@ export default {
this.$emit("handleCancel"); this.$emit("handleCancel");
}, },
handleFinish() { handleFinish() {
console.log(this.idList)
let groupId = this.$refs.tree.getCheckedKeys()[0] let groupId = this.$refs.tree.getCheckedKeys()[0]
let data = { let data = {
stallIds: groupId, departmentId: groupId,
userIds: this.idList+',' id: this.idList[0]
} }
moveMember(data).then(res=> { moveMember(data).then(res=> {
this.$emit("handleFinish", false); this.$emit("handleFinish", false);
...@@ -162,14 +157,9 @@ export default { ...@@ -162,14 +157,9 @@ export default {
}, },
getList() { getList() {
getGroup().then(res => { getOrgTree().then(res => {
console.log(res, "移动的数据获取"); console.log(res.data.organizations)
let obj = { this.treeData = [res.data.organizations];
name: "未分组",
id: 0
};
res.data = [obj, ...res.data];
this.treeData = res.data;
}); });
} }
} }
......
...@@ -19,7 +19,6 @@ ...@@ -19,7 +19,6 @@
<div class="tree"> <div class="tree">
<el-tree <el-tree
class="trees" class="trees"
:props="orgData"
:data="data1" :data="data1"
node-key="id" node-key="id"
default-expand-all default-expand-all
...@@ -32,9 +31,11 @@ ...@@ -32,9 +31,11 @@
</div> </div>
</div> </div>
<div class="right"> <div class="right">
<div class="top"><span>{{title}}</span> 共(<span>{{totalNumber}}</span>)人 </div> <div class="top"><span>{{groupName}} {{title}}</span> 共(<span>{{totalNumber}}</span>)人 </div>
<div class="searchs"> <div class="searchs">
<div class="buttons"> <div class="buttons">
<el-button class="button button_group" size="small" @click="addChild">添加子部门</el-button
>
<el-button class="button buttondark" size="small" @click="handleMove" :disabled="idList.length>0? false:true " <el-button class="button buttondark" size="small" @click="handleMove" :disabled="idList.length>0? false:true "
>移动</el-button >移动</el-button
> >
...@@ -44,6 +45,8 @@ ...@@ -44,6 +45,8 @@
@click="synchronismMember" @click="synchronismMember"
>同步记录</el-button >同步记录</el-button
> >
<el-button class="button buttondark" :disabled="groupId ? false : true" size="small" @click="deleteChild">删除子部门</el-button
>
</div> </div>
<!-- 搜索区 --> <!-- 搜索区 -->
<el-form <el-form
...@@ -85,15 +88,14 @@ ...@@ -85,15 +88,14 @@
align="center" align="center"
></el-table-column> ></el-table-column>
<el-table-column <el-table-column
prop="dept" prop="stall"
label="部门" label="部门"
align="center" align="center"
></el-table-column> ></el-table-column>
<el-table-column prop="role" label="角色" align="center"> <el-table-column prop="isManager" label="角色" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
<span v-if="scope.row.managerType == 0">店员</span> <span v-if="scope.row.isManager == 0">普通用户</span>
<span v-if="scope.row.managerType == 1">店长</span> <span v-if="scope.row.isManager == 1">管理员</span>
<span v-if="scope.row.managerType == 2">柜组负责人</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column <el-table-column
...@@ -107,6 +109,16 @@ ...@@ -107,6 +109,16 @@
align="center" align="center"
prop="synchronization" prop="synchronization"
/> />
<el-table-column
prop="isManager"
label="操作"
align="center"
>
<template slot-scope="scope">
<span @click="setAdmin(scope.row)" class="setAdmin" v-if="scope.row.isManager == 0">设为管理员</span>
<span @click="cancelAdmin(scope.row)" class="cancelAdmin" v-if="scope.row.isManager == 1">取消管理员</span>
</template>
</el-table-column>
</el-table> </el-table>
<div class="fy"> <div class="fy">
<el-pagination <el-pagination
...@@ -126,11 +138,26 @@ ...@@ -126,11 +138,26 @@
@handleFinish="removeFinish" @handleFinish="removeFinish"
:idList="idList" :idList="idList"
></move-dialog> ></move-dialog>
<add-dialog
v-if="addDialogShow"
:addDialog="addDialogShow"
@handleAddCancel="addDialogShow = false"
@handleAddFinish="addFinish"
></add-dialog>
<delete-dialog
v-if="deleteDialogShow"
:daleteDialog="deleteDialogShow"
@handleDeleteCancel="deleteDialogShow = false"
@handleDeleteFinish="deleteFinish"
:nowNode="nowNode"
></delete-dialog>
</div> </div>
</template> </template>
<script> <script>
import MoveDialog from "./components/move"; import MoveDialog from "./components/move";
import AddDialog from "./components/addGroup";
import DeleteDialog from "./components/deleteGroup";
import { import {
getOrgTree, getOrgTree,
getAllMemberList, getAllMemberList,
...@@ -138,391 +165,15 @@ import { ...@@ -138,391 +165,15 @@ import {
getMemberById, getMemberById,
storeNameChange, storeNameChange,
getGroupById, getGroupById,
changeRole,
search search
} from "@/api/in/mail"; } from "@/api/in/mail";
export default { export default {
data() { data() {
const data1 = [
{
id: 1,
label: "亿百分科技",
children: [
{
id: 2,
label: "一号柜组",
children: [
{
id: 5,
label: "Nike门店",
type: "门店"
},
{
id: 6,
label: "阿迪达斯",
type: "门店"
}
]
},
{
id: 3,
label: "二号柜组",
children: [
{
id: 7,
label: "vans门店",
type: "门店"
}
]
}
/* {
id: 4,
label: "三号柜组",
children: [
{
id: 9,
label: "匡威门店"
}
]
} */
]
}
];
return { return {
data1: JSON.parse(JSON.stringify(data1)), data1: [],
list1: { groupName: '',
main1: [
{
id: "1",
name: "李振华",
wxId: "lizhenhua",
dept: "销售部",
role: "店长",
mobile: "1588171558",
time: "2020/01/20"
},
{
id: "1",
name: "唐珊翰",
wxId: "tangshanyu",
dept: "销售部",
role: "店员",
mobile: "15655447788",
time: "2020/01/20"
},
{
id: "1",
name: "苏聪",
wxId: "sucong",
dept: "销售部",
role: "店员",
mobile: "1887767865",
time: "2020/01/20"
}
],
main2: [
{
id: "2",
name: "胡鑫",
wxId: "huxin",
dept: "销售部",
role: "店长",
mobile: "15881715583",
time: "2020/01/20"
},
{
id: "2",
name: "刘燕",
wxId: "liuyan",
dept: "销售部",
role: "店员",
mobile: "15655447788",
time: "2020/01/20"
},
{
id: "2",
name: "张梦瑶",
wxId: "zhangmengyao",
dept: "销售部",
role: "店员",
mobile: "18877678653",
time: "2020/01/20"
}
],
main3: [
{
id: "2",
name: "吴倩",
wxId: "wuqian",
dept: "销售部",
role: "店长",
mobile: "15881715583",
time: "2020/01/20"
},
{
id: "2",
name: "吕思思",
wxId: "lvsisi",
dept: "销售部",
role: "店员",
mobile: "15655443243",
time: "2020/01/20"
},
{
id: "2",
name: "张君",
wxId: "zhangjun",
dept: "销售部",
role: "店员",
mobile: "18877678790",
time: "2020/01/20"
}
],
main4: [
{
id: "1",
name: "李振华",
wxId: "lizhenhua",
dept: "销售部",
role: "店长",
mobile: "1588171558",
time: "2020/01/20"
},
{
id: "1",
name: "唐珊翰",
wxId: "tangshanyu",
dept: "销售部",
role: "店员",
mobile: "15655447788",
time: "2020/01/20"
},
{
id: "1",
name: "苏聪",
wxId: "sucong",
dept: "销售部",
role: "店员",
mobile: "1887767865",
time: "2020/01/20"
},
{
id: "2",
name: "胡鑫",
wxId: "huxin",
dept: "销售部",
role: "店长",
mobile: "15881715583",
time: "2020/01/20"
},
{
id: "2",
name: "刘燕",
wxId: "liuyan",
dept: "销售部",
role: "店员",
mobile: "15655447788",
time: "2020/01/20"
},
{
id: "2",
name: "张梦瑶",
wxId: "zhangmengyao",
dept: "销售部",
role: "店员",
mobile: "18877678653",
time: "2020/01/20"
},
{
id: "2",
name: "吴倩",
wxId: "wuqian",
dept: "销售部",
role: "店长",
mobile: "15881715583",
time: "2020/01/20"
},
{
id: "2",
name: "吕思思",
wxId: "lvsisi",
dept: "销售部",
role: "店员",
mobile: "15655443243",
time: "2020/01/20"
},
{
id: "2",
name: "张君",
wxId: "zhangjun",
dept: "销售部",
role: "店员",
mobile: "18877678790",
time: "2020/01/20"
}
],
main5: [
{
id: "1",
name: "李振华",
wxId: "lizhenhua",
dept: "销售部",
role: "店长",
mobile: "1588171558",
time: "2020/01/20"
},
{
id: "1",
name: "唐珊翰",
wxId: "tangshanyu",
dept: "销售部",
role: "店员",
mobile: "15655447788",
time: "2020/01/20"
},
{
id: "1",
name: "苏聪",
wxId: "sucong",
dept: "销售部",
role: "店员",
mobile: "1887767865",
time: "2020/01/20"
},
{
id: "2",
name: "胡鑫",
wxId: "huxin",
dept: "销售部",
role: "店长",
mobile: "15881715583",
time: "2020/01/20"
},
{
id: "2",
name: "刘燕",
wxId: "liuyan",
dept: "销售部",
role: "店员",
mobile: "15655447788",
time: "2020/01/20"
},
{
id: "2",
name: "张梦瑶",
wxId: "zhangmengyao",
dept: "销售部",
role: "店员",
mobile: "18877678653",
time: "2020/01/20"
}
],
main6: [
{
id: "1",
name: "李振华",
wxId: "lizhenhua",
dept: "销售部",
role: "店长",
mobile: "1588171558",
time: "2020/01/20"
},
{
id: "1",
name: "唐珊翰",
wxId: "tangshanyu",
dept: "销售部",
role: "店员",
mobile: "15655447788",
time: "2020/01/20"
},
{
id: "1",
name: "苏聪",
wxId: "sucong",
dept: "销售部",
role: "店员",
mobile: "1887767865",
time: "2020/01/20"
},
{
id: "2",
name: "胡鑫",
wxId: "huxin",
dept: "销售部",
role: "店长",
mobile: "15881715583",
time: "2020/01/20"
},
{
id: "2",
name: "刘燕",
wxId: "liuyan",
dept: "销售部",
role: "店员",
mobile: "15655447788",
time: "2020/01/20"
},
{
id: "2",
name: "张梦瑶",
wxId: "zhangmengyao",
dept: "销售部",
role: "店员",
mobile: "18877678653",
time: "2020/01/20"
},
{
id: "2",
name: "吴倩",
wxId: "wuqian",
dept: "销售部",
role: "店长",
mobile: "15881715583",
time: "2020/01/20"
},
{
id: "2",
name: "吕思思",
wxId: "lvsisi",
dept: "销售部",
role: "店员",
mobile: "15655443243",
time: "2020/01/20"
},
{
id: "2",
name: "张君",
wxId: "zhangjun",
dept: "销售部",
role: "店员",
mobile: "18877678790",
time: "2020/01/20"
}
],
search: {
bar: [
{
id: "1",
name: "全部"
},
{
id: "2",
name: "测试"
}
],
taskType: [
{
id: "1",
name: "全部"
},
{
id: "2",
name: "测试"
}
]
}
},
tableData: [], tableData: [],
isShow: false, isShow: false,
formData: { formData: {
...@@ -535,6 +186,8 @@ export default { ...@@ -535,6 +186,8 @@ export default {
total: 0 total: 0
}, },
moveDialogShow: false, moveDialogShow: false,
addDialogShow: false,
deleteDialogShow: false,
counterDialog: false, counterDialog: false,
storeDialog: false, storeDialog: false,
nameDialog: false, nameDialog: false,
...@@ -552,11 +205,14 @@ export default { ...@@ -552,11 +205,14 @@ export default {
groupId: "", groupId: "",
counterId: 0, counterId: 0,
title: "全部", title: "全部",
totalNumber: "" totalNumber: "",
nowNode: {}
}; };
}, },
components: { components: {
MoveDialog MoveDialog,
AddDialog,
DeleteDialog
}, },
created() { created() {
this.getOrgTree(); this.getOrgTree();
...@@ -566,35 +222,30 @@ export default { ...@@ -566,35 +222,30 @@ export default {
getOrgTree() { getOrgTree() {
getOrgTree().then(res => { getOrgTree().then(res => {
let data = res.data; let data = res.data;
this.allNumber = data["用户的总数"]; this.allNumber = data.numOfClerks;
this.wNumber = data["未分组用户的总数"]; this.wNumber = data.numOfClerksArrangeNot
this.data1 = data["所有的柜组"]; this.data1 = [data.organizations];
}); });
}, },
handleTreeClick(data) { handleTreeClick(data) {
this.formData.keywords = '' this.nowNode = data
this.title = data.name this.groupName = data.label
if(data.shopId) { this.groupId = data.id
this.groupId = data.shopId this.getGroupMember(1,1)
}
if(data.type){
this.storeId = data.id
this.getStoreMember(1,1)
}else {
this.groupId = data.id
this.getGroupMember(1,1)
}
}, },
getGroupMember(page,ctPage) { getGroupMember(page,ctPage) {
this.page.currentPage = ctPage this.page.currentPage = ctPage
this.type = this.sType = 3 this.type = this.sType = 3
let params = { let params = {
pageNum: page, pageNum: page,
shopId: this.groupId id: this.groupId
}; };
getGroupById(params).then(res => { getGroupById(params).then(res => {
this.tableData = res.data.list; this.tableData = res.data.pageInfo.list;
this.page.total = this.totalNumber = Number(res.data.total); this.page.total = this.totalNumber = Number(res.data.pageInfo.total);
}); });
}, },
getStoreMember(page,ctPage) { getStoreMember(page,ctPage) {
...@@ -626,36 +277,38 @@ export default { ...@@ -626,36 +277,38 @@ export default {
this.handleTypeChange(val,ctPage) this.handleTypeChange(val,ctPage)
}, },
getMailList(page,ctPage) { getMailList(page,ctPage) {
this.groupName = ''
this.formData.keywords = '' this.formData.keywords = ''
this.title = "全部" this.title = "全部"
this.type = this.sType = 1; this.type = this.sType = 1;
this.page.currentPage = ctPage this.page.currentPage = ctPage
this.groupId = ''
let params = { let params = {
pageNum: page pageNum: page
}; };
getAllMemberList(params).then(res => { getAllMemberList(params).then(res => {
console.log(res, "res"); this.tableData = res.data.pageInfo.list;
this.tableData = res.data.list; this.page.total = this.totalNumber = this.allNumber = Number(res.data.pageInfo.total);
this.page.total = this.totalNumber = this.allNumber = Number(res.data.total);
}); });
}, },
handleShopowner() {}, handleShopowner() {},
getNoGroupMember(page,ctPage) { getNoGroupMember(page,ctPage) {
this.groupName = ''
this.formData.keywords = '' this.formData.keywords = ''
this.page.currentPage = ctPage this.page.currentPage = ctPage
this.title = "未分组" this.title = "未分组"
this.type = this.sType = 2; this.type = this.sType = 2;
this.groupId = ''
let params = { let params = {
pageNum: page pageNum: page
}; };
getNoGroupMember(params).then(res => { getNoGroupMember(params).then(res => {
this.tableData = res.data.list; console.log(res.data)
this.page.total = this.totalNumber = this.wNumber = Number(res.data.total); this.tableData = res.data.pageInfo.list;
this.page.total = this.totalNumber = this.wNumber = Number(res.data.pageInfo.total);
}); });
}, },
handleMemberChange(val) { handleMemberChange(val) {
console.log(val,"val");
let ids = [] let ids = []
val.map(function(item) { val.map(function(item) {
ids.push(item.id) ids.push(item.id)
...@@ -695,14 +348,56 @@ export default { ...@@ -695,14 +348,56 @@ export default {
this.counterId = this.groupId; this.counterId = this.groupId;
} }
let params = { let params = {
keyWords: this.formData.keywords, param: this.formData.keywords
stallId: this.counterId,
pageNum: page
} }
search(params).then(res=>{ search(params).then(res=>{
this.tableData = res.data.list console.log(res)
this.page.total = Number(res.data.total); this.tableData = res.data
// this.page.total = Number(res.data.total);
})
},
setAdmin(user) {
this.changeRole(1, user.d_id, user.id)
},
cancelAdmin(user) {
this.changeRole(0, user.d_id, user.id)
},
changeRole(state, departmentId, id) {
let params = {
departmentId,
flag: state,
id
}
changeRole(params).then(res => {
if(this.groupId) {
this.getGroupMember(1,1);
}else if(this.title === '未分组') {
this.getNoGroupMember(1,1)
}else if(this.formData.keywords){
this.handleSearch(1,1)
}else {
this.getOrgTree();
this.getMailList(1,1);
}
}) })
},
addChild() {
this.addDialogShow = true
},
addFinish() {
this.addDialogShow = false
this.getOrgTree();
this.getMailList(1,1);
},
deleteChild() {
this.deleteDialogShow = true
},
deleteFinish() {
this.deleteDialogShow = false
this.getOrgTree();
this.getMailList(1,1);
} }
} }
}; };
...@@ -874,4 +569,23 @@ export default { ...@@ -874,4 +569,23 @@ export default {
.el-icon-edit { .el-icon-edit {
font-weight: bold; font-weight: bold;
} }
.setAdmin {
color: blue;
text-decoration: underline;
cursor: pointer;
}
.cancelAdmin {
color: #aaa;
text-decoration: underline;
cursor: pointer;
}
.button_group {
height: 32px;
background-color: #e8e9fe;
color: #4e59c7;
border: 1px solid #4e59c7;
-webkit-box-sizing: border-box;
box-sizing: border-box;
margin-top: 4px;
}
</style> </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