Commit 559a486f by 匡雅琴

2.8.0

1 parent c80f7434
...@@ -71,11 +71,22 @@ const findNotActiveStaff = params => { ...@@ -71,11 +71,22 @@ const findNotActiveStaff = params => {
}) })
} }
const listDepartmentTree = params => {
params.method = 'entmicro.api.department.listDepartmentTree'
return http({
url: 'rop-scrm-entmicro/router',
method: 'GET',
data: params,
sign: true
})
}
export default { export default {
activeAccount, activeAccount,
transferLicenseAccount, transferLicenseAccount,
syncCorpAccountCode, syncCorpAccountCode,
listAccountCodeWithPage, listAccountCodeWithPage,
listCustomizedAgentWithPage, listCustomizedAgentWithPage,
findNotActiveStaff findNotActiveStaff,
listDepartmentTree
} }
<template>
<div>
<GLDialog :mode="'big'" bigTitle="选择激活员工" :visible.sync="dialogActivateVisible">
<!-- <GLCombiForm :rowNumber="2" :formObj="searchForm" :formData="searchFormData" @handleOk="handleSearch" @handleRest="handleReset"></GLCombiForm> -->
<el-form :inline="true" class="member-form" :model="searchForm" @submit.native.prevent>
<el-form-item label="员工姓名:">
<el-input v-model="searchForm.staffName" :size="size" placeholder="输入关键字搜索"></el-input>
</el-form-item>
<el-form-item label="部门:">
<el-select v-model="searchForm.department" placeholder="全部" :size="size">
<el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value"></el-option>
</el-select>
</el-form-item>
<el-form-item label="启用状态:">
<el-select v-model="searchForm.status" placeholder="全部" :size="size">
<el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value"></el-option>
</el-select>
</el-form-item>
<el-form-item>
<el-button type="primary" :size="size" class="gap8">查询</el-button>
<el-button plain :size="size" class="btn-three">重置</el-button>
</el-form-item>
</el-form>
<div class="member-wrapper">
<div class="member-left">
<div class="member-title">员工列表</div>
<div class="member-content">
<div class="table-content" style="max-height: 456px;">
<GLTable v-loading="loading" ref="empTable" :tableData="tableEmpData" :tableParams="tableParams" :noDataImg="url" @selectionTable="selectionTable" @row-click="rowClick">
<div slot="staffName" slot-scope="scope">
<span>{{ scope.scope.staffName }}</span>
<span class="staff-title" v-show="scope.scope.staffTitle">{{ scope.scope.staffTitle }}</span>
</div>
</GLTable>
</div>
</div>
</div>
<div class="member-right">
<div class="member-title">已选列表</div>
<div class="member-name">成员名称({{ innerTags.length }}项)</div>
<div class="input-tag-wrapper">
<div class="tag-box">
<el-tag v-for="(tag, idx) in innerTags" :key="idx" type="info" closable :disable-transitions="false" @close="remove(tag)">
<i class="el-icon-user-solid"></i>
{{ tag.staffName }}
</el-tag>
</div>
</div>
</div>
</div>
</GLDialog>
</div>
</template>
<script>
import url from '@/assets/empty.png'
export default {
name: 'ActivateDia',
props: ['selectData'],
data() {
return {
url: url,
searchForm: {},
checked: '',
treeData: [],
dialogActivateVisible: false,
defaultProps: {
children: 'children',
label: 'departmentName'
},
loading: false,
pageConf: { pageSize: 'pageSize', pageNum: 'pageNum', totalCount: 'total' },
// 表格参数
tableParams: {
checkSelectKey: 'id',
checkSelectVal: [],
listName: 'list',
// 行数据的key
mutiSelectUniqueKey: 'id',
// 多选ref的名称
mutiSelectName: 'salelist',
tableColumns: [
{
label: '姓名',
prop: 'staffName',
addHtml: 'staffName'
},
{
label: '所在门店/部门',
prop: 'departmentName'
},
{
label: '跟进专员类型',
prop: 'followerName',
formatter: cellValue => {
return cellValue.followerName ? cellValue.followerName : '-'
}
}
]
},
tableEmpData: [],
allTreeData: [],
currentTreeData: [],
innerTags: []
}
},
mounted() {
// this.listDepartmentTree(false)
},
methods: {
init() {
this.dialogActivateVisible = true
this.listDepartmentTree(false)
},
selectionTable(val) {
console.log(val)
this.innerTags = val
// this.$emit('selectTable', val)
},
// 清空搜索条件
resetSearch() {
this.searchForm = {}
this.tableEmpData = this.allTreeData
},
listDepartmentTree(isFollowerStaff) {
const params = { addChildrensFlag: true }
this.loading = true
params.isHavCustomer = true
params.isFollowerStaff = isFollowerStaff
this.$apis.accountConfig.listDepartmentTree(params).then(res => {
console.log(res)
this.loading = false
if (res) {
this.tableEmpData = this.getEmployee(res)
this.allTreeData = this.getEmployee(res)
this.currentTreeData = this.getEmployee(res)
this.treeData = res
this.$refs.empTable.tableHeightValues = this.tableEmpData.length ? '' : '230px'
if (this.selectData && this.selectData.length) {
this.selectData.forEach(item => {
this.$refs.empTable.$refs.salelistMutiTable.toggleRowSelection(item)
})
}
} else {
this.treeData = []
}
})
},
handleNodeClick(data) {
console.log(data)
this.searchForm.department = data.departmentName
this.currentTreeData = data
this.onHidePopover()
},
getEmployee(d, arr = []) {
d.reverse().forEach(i => {
if (i.entmicroStaffResponses) {
i.entmicroStaffResponses.forEach(j => {
const flag = arr.find(m => m.id == j.id)
if (!flag) {
arr.push(j)
}
})
}
if (i.children) {
this.getEmployee(i.children, arr)
}
})
return arr
},
search() {
this.tableEmpData = []
const data = this.currentTreeData
const keyword = this.searchForm.name
let arr = []
// this.loading = true
console.log(keyword, data, this.tableEmpData)
if (data instanceof Array) {
if (keyword) {
data.forEach(i => {
if (i.staffName.indexOf(keyword) != -1) {
this.tableEmpData.push(i)
}
})
} else {
console.log(this.allTreeData, '---')
this.tableEmpData = this.allTreeData
}
} else if (data instanceof Object) {
if (data.entmicroStaffResponses) {
if (keyword) {
data.entmicroStaffResponses.forEach(i => {
if (i.staffName.indexOf(keyword) != -1) {
this.tableEmpData.push(i)
}
})
} else {
this.tableEmpData = this.tableEmpData.concat(data.entmicroStaffResponses)
}
}
if (data.children) {
data.children.forEach(i => {
if (i.entmicroStaffResponses) {
i.entmicroStaffResponses.forEach(j => {
if (keyword) {
if (j.staffName.indexOf(keyword) != -1) {
const flag = this.tableEmpData.find(m => m.id == j.id)
if (!flag) {
this.tableEmpData.push(j)
}
}
} else {
const flag = this.tableEmpData.find(m => m.id == j.id)
if (!flag) {
this.tableEmpData.push(j)
}
}
})
}
})
}
}
},
remove(item) {
this.$refs.empTable.$refs.salelistMutiTable.toggleRowSelection(item)
},
rowClick(row) {
this.$refs.empTable.$refs.salelistMutiTable.toggleRowSelection(row)
},
checkChange(val) {
console.log(val)
this.searchForm = {}
this.listDepartmentTree(val)
}
}
}
</script>
<style lang="scss">
.el-input.el-input--suffix.rotate .el-input__suffix .el-icon-arrow-down {
transform: rotate(-180deg);
}
.select-tree {
max-height: 400px;
overflow-y: scroll;
}
.staff-title {
position: relative;
font-size: 12px;
padding: 0 10px;
line-height: 12px;
color: #999;
&::before {
content: '';
position: absolute;
top: 50%;
left: 5px;
transform: translateY(-50%);
display: inline-block;
width: 1px;
height: 12px;
background-color: #999;
}
}
.member-wrapper {
display: flex;
.member-title {
font-size: 16px;
font-weight: 600;
line-height: 22px;
margin-bottom: 6px;
span {
display: inline-block;
padding-left: 5px;
font-size: 12px;
color: #999;
font-size: 500;
}
}
.member-left {
width: 70%;
.member-content {
border: 1px solid #eee;
.member-form {
padding: 10px 20px;
}
.table-content {
max-height: 456px;
overflow: auto;
border-top: 1px solid #eee;
}
}
.member-checked {
text-align: right;
margin-top: 10px;
}
}
.member-right {
width: 30%;
margin-left: 14px;
.member-name {
font-size: 14px;
color: #333;
line-height: 20px;
padding: 18px;
border: 1px solid #eee;
}
}
}
.tag-box {
height: 100%;
}
.input-tag-wrapper {
position: relative;
font-size: 14px;
border: 1px solid #eee;
border-top: none;
box-sizing: border-box;
color: #606266;
display: inline-block;
padding: 8px 10px;
line-height: 32px;
transition: border-color 0.2s cubic-bezier(0.645, 0.045, 0.355, 1);
width: 100%;
height: calc(100% - 86px);
display: flex;
align-items: center;
max-height: 500px;
overflow: auto;
// margin-bottom: 10px;
i {
color: #75acff;
margin-right: 3px;
font-size: 14px;
}
/deep/ input {
/* input { */
/* background-color: red!important; 调试用的样式 */
outline: none !important;
border: none !important;
}
/deep/ .el-input {
min-width: 150px;
width: auto;
flex: 1;
}
}
.el-tag {
margin-right: 10px;
line-height: 22px;
margin-bottom: 5px;
height: 24px;
}
</style>
...@@ -30,10 +30,11 @@ ...@@ -30,10 +30,11 @@
</div> </div>
<template slot="auth-button" slot-scope="scope" :data="scope.scope" v-if="scope.scope.isBuyPermit"> <template slot="auth-button" slot-scope="scope" :data="scope.scope" v-if="scope.scope.isBuyPermit">
<GLTableButton :buttonList="buttonList" :buttonItem="scope.scope"></GLTableButton> <GLTableButton :buttonList="buttonList" :buttonItem="scope.scope"></GLTableButton>
<!-- <el-button type="text" @click="viewConfig(scope.scope)">查看</el-button> --> <el-button type="text" @click="viewConfig(scope.scope)">查看</el-button>
<!-- <el-button type="text" @click="handelActivate(scope.scope)" :loading="loading">一键激活许可</el-button> --> <!-- <el-button type="text" @click="handelActivate(scope.scope)" :loading="loading">一键激活许可</el-button> -->
</template> </template>
</GLTable> </GLTable>
<ActivateDia ref="activateDia" :dialogActivateVisible="dialogActivateVisible"></ActivateDia>
</div> </div>
</div> </div>
</template> </template>
...@@ -41,8 +42,12 @@ ...@@ -41,8 +42,12 @@
<script> <script>
import url from '@/assets/empty.png' import url from '@/assets/empty.png'
import Icon from '@/assets/empty.png' import Icon from '@/assets/empty.png'
import ActivateDia from './activateDia.vue'
export default { export default {
name: 'AccountInterface', name: 'AccountInterface',
components: {
ActivateDia
},
data() { data() {
return { return {
url, url,
...@@ -211,38 +216,40 @@ export default { ...@@ -211,38 +216,40 @@ export default {
}, },
// 一键激活许可 // 一键激活许可
handelActivate(scope) { handelActivate(scope) {
this.loading = true this.dialogActivateVisible = true
const { corpId, merchantId } = scope this.$refs.activateDia.init()
var params = { // this.loading = true
corpId, // const { corpId, merchantId } = scope
merchantId // var params = {
} // corpId,
this.$apis.accountConfig.activeAccount(params).then(res => { // merchantId
this.loading = false // }
if (res) { // this.$apis.accountConfig.activeAccount(params).then(res => {
// <i class="el-icon-success" style="color:#2CCA74;font-size:48px;"></i> // this.loading = false
var txt = '<p>已激活&nbsp;' + `${res.data ? res.data : 0}` + '&nbsp;个</p>' // if (res) {
this.$confirm(txt, '提示', { // // <i class="el-icon-success" style="color:#2CCA74;font-size:48px;"></i>
confirmButtonText: '我知道了', // var txt = '<p>已激活&nbsp;' + `${res.data ? res.data : 0}` + '&nbsp;个</p>'
dangerouslyUseHTMLString: true, // this.$confirm(txt, '提示', {
showCancelButton: false, // confirmButtonText: '我知道了',
confirmButtonClass: 'confirmbtn', // dangerouslyUseHTMLString: true,
type: 'success', // showCancelButton: false,
customClass: 'gl-message-box confirm-btn', // confirmButtonClass: 'confirmbtn',
callback: action => { // type: 'success',
if (res.data && res.data > 0) { // customClass: 'gl-message-box confirm-btn',
var pras = { // callback: action => {
pageSize: this.$refs.accountTable.page.pageSize, // if (res.data && res.data > 0) {
pageNum: this.$refs.accountTable.page.pageNum // var pras = {
} // pageSize: this.$refs.accountTable.page.pageSize,
this.$apis.accountConfig.listCustomizedAgentWithPage(pras).then(res => {}) // pageNum: this.$refs.accountTable.page.pageNum
} // }
} // this.$apis.accountConfig.listCustomizedAgentWithPage(pras).then(res => {})
}) // }
} else { // }
this.$message.error('激活失败') // })
} // } else {
}) // this.$message.error('激活失败')
// }
// })
}, },
// 同步购买订单 // 同步购买订单
handleSync() { handleSync() {
......
<template>
<div>
<GLDialog :mode="'big'" bigTitle="选择激活员工" :visible.sync="dialogTransferVisible">
<!-- <GLCombiForm :rowNumber="2" :formObj="searchForm" :formData="searchFormData" @handleOk="handleSearch" @handleRest="handleReset"></GLCombiForm> -->
<el-form :inline="true" class="member-form" :model="searchForm" @submit.native.prevent>
<el-form-item label="员工姓名:">
<el-input v-model="searchForm.staffName" :size="size" placeholder="输入关键字搜索"></el-input>
</el-form-item>
<el-form-item label="部门:">
<el-select v-model="searchForm.department" placeholder="全部" :size="size">
<el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value"></el-option>
</el-select>
</el-form-item>
<el-form-item label="启用状态:">
<el-select v-model="searchForm.status" placeholder="全部" :size="size">
<el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value"></el-option>
</el-select>
</el-form-item>
<el-form-item>
<el-button type="primary" :size="size" class="gap8" @click="handleSearch">查询</el-button>
<el-button plain :size="size" class="btn-three" @click="handleReset">重置</el-button>
</el-form-item>
</el-form>
<div>员工列表</div>
<GLTable :getListApi="getListApi" :pageConf="pageConf" :searchForm="searchForm" v-loading="loading" ref="transferTable" :tableParams="tableParams" :tableData="tableTransferData" :noDataImg="url">
<div slot="association" slot-scope="scope" class="association">
<el-radio :label="scope.scope.id" v-model="associationRadio" @change.native="getCouponInfo()"></el-radio>
</div>
</GLTable>
</GLDialog>
</div>
</template>
<script>
import url from '@/assets/empty.png'
export default {
name: 'TransferDia',
data() {
return {
url,
dialogTransferVisible: false,
associationRadio: '',
searchForm: {
isBuyPermit: '',
merchantId: '',
merchantName: ''
},
tableParams: {
listName: 'list',
tableColumns: [
{
prop: 'association',
addHtml: 'association',
width: '100'
},
{
label: '员工姓名',
prop: 'staffName'
},
{
label: '员工手机号',
prop: 'departmentName'
},
{
label: '部门',
prop: 'departmentName'
},
{
label: '启用状态',
prop: 'departmentName'
}
]
},
pageConf: { pageSize: 'pageSize', pageNum: 'pageNum', totalCount: 'total' },
tableTransferData: []
}
},
mounted() {},
methods: {
init() {
this.dialogTransferVisible = true
this.listDepartmentTree(false)
},
listDepartmentTree(isFollowerStaff) {
const params = { addChildrensFlag: true }
this.loading = true
params.isHavCustomer = true
params.isFollowerStaff = isFollowerStaff
this.$apis.accountConfig.listDepartmentTree(params).then(res => {
console.log(res)
this.loading = false
if (res) {
// this.tableEmpData = this.getEmployee(res)
// this.allTreeData = this.getEmployee(res)
// this.currentTreeData = this.getEmployee(res)
// this.treeData = res
// this.$refs.empTable.tableHeightValues = this.tableEmpData.length ? '' : '230px'
// if (this.selectData && this.selectData.length) {
// this.selectData.forEach(item => {
// this.$refs.empTable.$refs.salelistMutiTable.toggleRowSelection(item)
// })
// }
} else {
this.treeData = []
}
})
},
// 搜索框搜索
handleSearch() {
this.$refs.accountTable.refreshTable()
},
// 重置搜索框搜索
handleReset() {
this.searchForm = {
isBuyPermit: '',
merchantId: '',
merchantName: ''
}
this.handleSearch()
}
}
}
</script>
<style lang="scss" scoped></style>
...@@ -19,13 +19,13 @@ ...@@ -19,13 +19,13 @@
<span v-if="scope.scope.status == 4">待转移</span> <span v-if="scope.scope.status == 4">待转移</span>
<span v-if="scope.scope.status == 5">已合并</span> <span v-if="scope.scope.status == 5">已合并</span>
</div> </div>
<template slot="auth-button" slot-scope="scope" :data="scope.scope" v-if="scope.scope.staffName"> <template slot="auth-button" slot-scope="scope" :data="scope.scope" v-if="scope.scope.status == 2">
<el-button type="text" @click="handelTransfer(scope.scope)">转移</el-button> <el-button type="text" @click="handelTransfer(scope.scope)">转移</el-button>
</template> </template>
</GLTable> </GLTable>
</div> </div>
</div> </div>
<GLDialog class="trans-dia" title="帐号接口许可转移" :visible.sync="dialogTransferVisible"> <!-- <GLDialog class="trans-dia" title="帐号接口许可转移" :visible.sync="dialogTransferVisible">
<el-form :model="transferForm"> <el-form :model="transferForm">
<el-form-item label="转移员工:"> <el-form-item label="转移员工:">
<el-select @change="selectTransferStaff" v-model="transferForm.staff" filterable :size="size" placeholder="请选择或输入关键字搜索"> <el-select @change="selectTransferStaff" v-model="transferForm.staff" filterable :size="size" placeholder="请选择或输入关键字搜索">
...@@ -38,7 +38,8 @@ ...@@ -38,7 +38,8 @@
<el-button :size="size" @click="handleClose">取消</el-button> <el-button :size="size" @click="handleClose">取消</el-button>
<el-button :size="size" type="primary" @click="transferCount">提交</el-button> <el-button :size="size" type="primary" @click="transferCount">提交</el-button>
</span> </span>
</GLDialog> </GLDialog> -->
<TransferDia ref="TransferDia" :dialogTransferVisible="dialogTransferVisible"></TransferDia>
</div> </div>
</template> </template>
...@@ -51,8 +52,12 @@ const accountStatus = { ...@@ -51,8 +52,12 @@ const accountStatus = {
'5': 'normal' '5': 'normal'
} }
import url from '@/assets/empty.png' import url from '@/assets/empty.png'
import TransferDia from './transferDia'
export default { export default {
name: 'ConfigDetail', name: 'ConfigDetail',
components: {
TransferDia
},
data() { data() {
return { return {
url, url,
...@@ -174,30 +179,32 @@ export default { ...@@ -174,30 +179,32 @@ export default {
}, },
// 账号许可转移弹窗 // 账号许可转移弹窗
handelTransfer(scope) { handelTransfer(scope) {
const { merchantId, corpId } = this.routerInfo this.dialogTransferVisible = true
let params = { this.$refs.TransferDia.init()
merchantId, // const { merchantId, corpId } = this.routerInfo
corpId // let params = {
} // merchantId,
this.handoverUserid = scope.userid // corpId
this.expireTime = scope.expireTime // }
this.$apis.accountConfig.findNotActiveStaff(params).then(res => { // this.handoverUserid = scope.userid
if (res.data) { // this.expireTime = scope.expireTime
this.dialogTransferVisible = true // this.$apis.accountConfig.findNotActiveStaff(params).then(res => {
this.notActiveStaffList = res.data // if (res.data) {
} else { // this.dialogTransferVisible = true
// var txt = '<i class="el-icon-warning" style="color:#e6a23c;font-size:48px;"></i><p>无可用的用户转移</p>' // this.notActiveStaffList = res.data
this.$confirm('无可用的用户转移', '提示', { // } else {
confirmButtonText: '我知道了', // // var txt = '<i class="el-icon-warning" style="color:#e6a23c;font-size:48px;"></i><p>无可用的用户转移</p>'
dangerouslyUseHTMLString: true, // this.$confirm('无可用的用户转移', '提示', {
showClose: true, // confirmButtonText: '我知道了',
showCancelButton: false, // dangerouslyUseHTMLString: true,
confirmButtonClass: 'confirmbtn', // showClose: true,
type: 'warning', // showCancelButton: false,
customClass: 'gl-message-box confirm-btn' // confirmButtonClass: 'confirmbtn',
}) // type: 'warning',
} // customClass: 'gl-message-box confirm-btn'
}) // })
// }
// })
}, },
// 选择转移员工 // 选择转移员工
selectTransferStaff(id) { selectTransferStaff(id) {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!