Commit a75b5f50 by 匡雅琴

弹框调整

1 parent 3e11ecaa
import { http } from '@/main'
const defaultPath = 'scrm.api.work.wechat.account.'
// 批量激活
const activeAccount = params => {
params.method = `${defaultPath}activeAccount`
return http({
url: 'rop-scrm-wechat/router',
method: 'post',
data: params,
sign: true,
returnAll: true
})
}
// 获取企业的激活列表
const listAccountCodeWithPage = params => {
params.method = `${defaultPath}listAccountCodeWithPage`
return http({
url: 'rop-scrm-wechat/router',
method: 'post',
data: params,
sign: true
})
}
// 获取企业的许可列表
const listCustomizedAgentWithPage = params => {
params.method = `${defaultPath}listCustomizedAgentWithPage`
return http({
url: 'rop-scrm-wechat/router',
method: 'post',
data: params,
sign: true
})
}
// 同步许可信息
const syncCorpAccountCode = params => {
params.method = `${defaultPath}syncCorpAccountCode`
return http({
url: 'rop-scrm-wechat/router',
method: 'post',
data: params,
sign: true
})
}
// 账号转移
const transferLicenseAccount = params => {
params.method = `${defaultPath}transferLicenseAccount`
return http({
url: 'rop-scrm-wechat/router',
method: 'post',
data: params,
sign: true
})
}
// 查询未激活员工账号
const findNotActiveStaff = params => {
params.method = `${defaultPath}findNotActiveStaff`
return http({
url: 'rop-scrm-wechat/router',
method: 'post',
data: params,
sign: true
})
}
export default {
activeAccount,
transferLicenseAccount,
syncCorpAccountCode,
listAccountCodeWithPage,
listCustomizedAgentWithPage,
findNotActiveStaff
}
...@@ -26,3 +26,48 @@ $base-color: '#5850FF'; ...@@ -26,3 +26,48 @@ $base-color: '#5850FF';
border-radius: 4px; border-radius: 4px;
background-color: rgba(144, 147, 153, .3); background-color: rgba(144, 147, 153, .3);
} }
.dot {
display: inline-flex;
align-items: center;
div {
display: inline-block;
width: 6px;
height: 6px;
border-radius: 50%;
margin-right: 8px;
}
.normal {
background-color: #2cca74;
}
.draft {
background-color: #fdb757;
}
.dot1 {
background-color: #fdb757;
}
.dot2 {
background-color: #2cca74;
}
.dot3 {
background-color: #999999;
}
.dot4 {
background-color: #eb4e4e;
}
.dot5 {
background-color: #fdb757;
}
.dot6 {
background-color: #5850FF;
}
}
\ No newline at end of file \ No newline at end of file
...@@ -11,16 +11,28 @@ ...@@ -11,16 +11,28 @@
<div class="container-header"> <div class="container-header">
<span>帐号接口许可</span> <span>帐号接口许可</span>
<el-popover placement="bottom" width="280" trigger="hover" content="企微代开发应用的帐号接口许可管理。"> <el-popover placement="bottom" width="280" trigger="hover" content="企微代开发应用的帐号接口许可管理。">
<img src="@/assets/question.png" slot="reference" class="count-item-question" /> <img src="@/assets/icon-tip.png" slot="reference" class="count-item-question" />
</el-popover> </el-popover>
</div> </div>
<div class="table-box"> <div class="table-box">
<GLCombiForm :formObj="searchForm.condition" :formData="searchFormData" @handleOk="handleSearch" @handleRest="handleReset"></GLCombiForm> <GLCombiForm :formObj="searchForm" :rowNumber="1" :formData="searchFormData" @handleOk="handleSearch" @handleRest="handleReset"></GLCombiForm>
<div class="table-header">
<div class="header-text">帐号接口许可列表</div>
<div>
<el-button class="table-btn" @click="handleSync" :loading="syncLoad" :size="size" type="primary" plain mode="el-button">同步购买订单</el-button>
<!-- <GLButton @click="handleExport" fn="导出" :size="size" type="primary" plain mode="el-button">导出</GLButton> -->
</div>
</div>
<GLTable ref="accountTable" :noDataImg="url" :getListApi="getListApi" :searchForm="searchForm" :tableParams="tableParams" :pageConf="pageConf" @setTableFinishFun="setTableFinishFun"> <GLTable ref="accountTable" :noDataImg="url" :getListApi="getListApi" :searchForm="searchForm" :tableParams="tableParams" :pageConf="pageConf" @setTableFinishFun="setTableFinishFun">
<template slot="auth-button" slot-scope="scope" :data="scope.scope"> <!-- 是否已购许可 -->
<GLTableButton :buttonList="buttonList" :buttonItem="scope.scope"></GLTableButton> <div slot="isBuyPermit" slot-scope="scope">
<!-- <el-button type="text" @click="viewConfig(scope.scope)">查看配置</el-button> --> <span v-if="scope.scope.isBuyPermit == 1">是</span>
<!-- <GLButton type="text" @click="viewConfig(scope.scope)" fn="查看配置">查看配置</GLButton> --> <span v-if="scope.scope.isBuyPermit == 0">否</span>
</div>
<template slot="auth-button" slot-scope="scope" :data="scope.scope" v-if="scope.scope.isBuyPermit">
<!-- <GLTableButton :buttonList="buttonList" :buttonItem="scope.scope"></GLTableButton> -->
<el-button type="text" @click="viewConfig(scope.scope)">查看</el-button>
<el-button type="text" @click="handelActivate(scope.scope)" :loading="loading">一键激活许可</el-button>
</template> </template>
</GLTable> </GLTable>
</div> </div>
...@@ -29,18 +41,24 @@ ...@@ -29,18 +41,24 @@
<script> <script>
import url from '@/assets/empty.png' import url from '@/assets/empty.png'
import Icon from '@/assets/empty.png'
export default { export default {
name: 'AccountInterface', name: 'AccountInterface',
data() { data() {
return { return {
url, url,
Icon,
loading: false,
syncLoad: false,
searchForm: { searchForm: {
condition: {} isBuyPermit: '',
merchantId: '',
merchantName: ''
}, },
searchFormData: [ searchFormData: [
{ {
label: '是否已购买许可', label: '是否已购许可',
name: 'merchantModel', name: 'isBuyPermit',
type: 'select', type: 'select',
optionList: [ optionList: [
{ {
...@@ -49,11 +67,11 @@ export default { ...@@ -49,11 +67,11 @@ export default {
}, },
{ {
label: '是', label: '是',
value: 2 value: 1
}, },
{ {
label: '否', label: '否',
value: 1 value: 0
} }
], ],
optionId: 'value', optionId: 'value',
...@@ -64,13 +82,15 @@ export default { ...@@ -64,13 +82,15 @@ export default {
label: '商户名称', label: '商户名称',
name: 'merchantName', name: 'merchantName',
type: 'input', type: 'input',
isClear: true isClear: true,
placeholder: '输入关键字搜索'
}, },
{ {
label: '商户号', label: '商户号',
name: 'merchantId', name: 'merchantId',
type: 'input', type: 'input',
isClear: true, isClear: true,
placeholder: '输入关键字搜索',
listeners: { listeners: {
input: value => { input: value => {
this.searchForm.condition.merchantId = value.replace(/[^\d]/g, '') this.searchForm.condition.merchantId = value.replace(/[^\d]/g, '')
...@@ -80,7 +100,6 @@ export default { ...@@ -80,7 +100,6 @@ export default {
], ],
tableParams: { tableParams: {
listName: 'list', listName: 'list',
tableOption: true,
tableColumns: [ tableColumns: [
{ {
label: '商户号', label: '商户号',
...@@ -88,67 +107,69 @@ export default { ...@@ -88,67 +107,69 @@ export default {
}, },
{ {
label: '商户名称', label: '商户名称',
prop: 'merchantName' prop: 'merchantName',
width: '300'
}, },
{ {
label: '关联的企业微信', label: '关联企业微信名称',
prop: 'corpAlias' prop: 'corpFullName'
}, },
{ {
label: '是否已购许可', label: '是否已购许可',
prop: 'corpAlias' prop: 'isBuyPermit',
addHtml: 'isBuyPermit'
}, },
{ {
label: '许可数量', label: '许可数量',
prop: 'corpAlias' prop: 'permitCount',
formatter: cellValue => {
return cellValue.permitCount || '-'
}
}, },
{ {
label: '已激活数量', label: '已激活数量',
prop: 'corpAlias' prop: 'activeCount',
formatter: cellValue => {
return cellValue.activeCount || '-'
}
},
{
label: '操作',
prop: 'auth-button',
// width: '220',
addHtml: 'auth-button',
fixed: 'right'
} }
] ]
}, },
pageConf: { pageSize: 'pageSize', pageNum: 'pageNum', totalCount: 'total' }, pageConf: { pageSize: 'pageSize', pageNum: 'pageNum', totalCount: 'total' },
tableData: [ getListApi: this.$apis.accountConfig.listCustomizedAgentWithPage,
buttonList: [
{ {
id: 1, type: 'GLButton',
merchantId: 10000, name: row => {
merchantName: '嘀加A门店', return '查看'
merchantModel: 1,
corpAlias: '嘀加云科技'
}, },
{ attrs: {
id: 2, type: 'text',
merchantId: 10001, fn: '查看配置'
merchantName: '嘀加b门店',
merchantModel: 2,
corpAlias: '嘀加云科技'
}, },
{ condition: row => {
id: 3, return true
merchantId: 10002,
merchantName: '嘀加C门店',
merchantModel: 1,
corpAlias: ''
}, },
{ listeners: {
id: 4, click: this.handleLook
merchantId: 10003,
merchantName: '嘀加D门店',
merchantModel: 1,
corpAlias: '嘀加云科技'
} }
], },
getListApi: this.$apis.appConfig.agentList,
buttonList: [
{ {
type: 'GLButton', type: 'GLButton',
name: row => { name: row => {
return '查看配置' return '一键激活许可'
}, },
attrs: { attrs: {
type: 'text', type: 'text',
fn: '查看配置' fn: '一键激活许可',
loading: this.loading
}, },
condition: row => { condition: row => {
return true return true
...@@ -162,20 +183,71 @@ export default { ...@@ -162,20 +183,71 @@ export default {
}, },
mounted() {}, mounted() {},
methods: { methods: {
// 查看配置
viewConfig(row) { viewConfig(row) {
this.$router.push('/appConfig/viewConfig/' + row.appId) console.log(row)
const { merchantId, corpId, merchantName } = row
this.$router.push({
path: '/accountInterface/viewConfig',
query: {
merchantId,
corpId,
merchantName
}
})
}, },
// 搜索框搜索
handleSearch() { handleSearch() {
this.$refs.accountTable.refreshTable() this.$refs.accountTable.refreshTable()
}, },
// 重置搜索框搜索
handleReset() { handleReset() {
this.searchForm.condition = {} this.searchForm = {
isBuyPermit: '',
merchantId: '',
merchantName: ''
}
this.handleSearch() this.handleSearch()
}, },
setTableFinishFun() { setTableFinishFun() {
console.log(this.$refs.accountTable.data, '---')
//接收到的数据为空 //接收到的数据为空
this.$refs.accountTable.data.length ? (this.$refs.accountTable.tableHeightValues = '') : this.$refs.accountTable.setTableHeightFun() this.$refs.accountTable.data.length ? (this.$refs.accountTable.tableHeightValues = '') : this.$refs.accountTable.setTableHeightFun()
},
// 一键激活许可
handelActivate(scope) {
console.log(scope)
this.loading = true
const { corpId, merchantId } = scope
var params = {
corpId,
merchantId
}
console.log(params)
this.$apis.accountConfig.activeAccount(params).then(res => {
this.loading = false
if (res.code == -1) {
var txt = '<i class="el-icon-success" style="color:#2CCA74;font-size:32px;"></i><p>已激活&nbsp;' + `${res.data ? res.data : 0}` + '&nbsp;个</p>'
this.$confirm(txt, '提示', {
confirmButtonText: '我知道了',
dangerouslyUseHTMLString: true,
showClose: true,
showCancelButton: false
})
}
})
},
// 同步购买订单
handleSync() {
this.syncLoad = true
this.$apis.accountConfig.syncCorpAccountCode({}).then(res => {
if (res) {
this.syncLoad = false
this.$message({
message: '同步成功',
type: 'success'
})
}
})
} }
} }
} }
...@@ -191,6 +263,21 @@ export default { ...@@ -191,6 +263,21 @@ export default {
.footer-btns { .footer-btns {
float: right; float: right;
} }
.table-header {
display: flex;
align-items: center;
justify-content: space-between;
margin-bottom: 10px;
.header-text {
font-size: 16px;
color: #333333;
font-weight: 600;
}
}
.table-btn {
color: #5850ff;
border: 1px solid #5850ff;
}
} }
/deep/.el-table th > .cell { /deep/.el-table th > .cell {
padding: 0 16px; padding: 0 16px;
......
<template>
<div>
<div class="container">
<div class="title">{{ routerInfo.merchantName }}</div>
<GLCombiForm :formObj="searchForm" :rowNumber="1" :formData="searchFormData" @handleOk="getListApi" @handleRest="handleReset"></GLCombiForm>
<div class="tableBox">
<GLTable ref="accountCodeTable" @refreshTable="getListApi" :noDataImg="url" :layout="layout" :tableData="accountTableData" :searchForm="searchForm" :tableParams="tableParams" :pageConf="pageConf" :tableTotal="tableTotal" @setTableFinishFun="setTableFinishFun">
<!-- 账号许可类型 -->
<div slot="type" slot-scope="scope">
<span v-if="scope.scope.type == 1">基础帐号</span>
<span v-else>互通帐号</span>
</div>
<!-- 账号激活状态 -->
<div slot="status" class="dot" slot-scope="scope">
<div :class="accountStatus[scope.scope.status]"></div>
<span v-if="scope.scope.status == 1">未绑定</span>
<span v-if="scope.scope.status == 2">已绑定</span>
<span v-if="scope.scope.status == 3">已过期</span>
<span v-if="scope.scope.status == 4">待转移</span>
<span v-if="scope.scope.status == 5">已合并</span>
</div>
<template slot="auth-button" slot-scope="scope" :data="scope.scope" v-if="scope.scope.staffName">
<!-- <GLTableButton :buttonList="buttonList" :buttonItem="scope.scope"></GLTableButton> -->
<el-button type="text" @click="handelTransfer(scope.scope)">转移</el-button>
</template>
</GLTable>
</div>
</div>
<el-dialog class="trans-dia" title="帐号接口许可转移" :visible.sync="dialogTransferVisible" width="50%">
<el-form :model="transferForm">
<el-form-item label="转移员工:">
<el-select @change="selectTransferStaff" v-model="transferForm.staff" filterable :size="size" placeholder="请选择或输入关键字搜索">
<el-option v-for="item in notActiveStaffList" :key="item.userId" :label="item.staffName" :value="item.userId"></el-option>
</el-select>
</el-form-item>
<el-form-item label="接口有效期至:">{{ expireTime }}</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button :size="size" @click="handleClose">取消</el-button>
<el-button :size="size" type="primary" @click="transferCount">提交</el-button>
</span>
</el-dialog>
</div>
</template>
<script>
const accountStatus = {
'1': 'dot1',
'2': 'normal',
'3': 'dot3',
'4': 'dot6',
'5': 'normal'
}
import url from '@/assets/empty.png'
export default {
name: 'ConfigDetail',
data() {
return {
url,
accountStatus,
searchForm: {
status: '',
staffName: ''
},
transferForm: {
staff: ''
},
routerInfo: '',
dialogTransferVisible: false,
accountTableData: [],
tableTotal: 0,
notActiveStaffList: [],
expireTime: '',
takeoverUserid: '',
handoverUserid: '',
searchFormData: [
{
label: '激活状态',
name: 'status',
type: 'select',
optionList: [
{
label: '全部',
value: ''
},
{
label: '未绑定',
value: 1
},
{
label: '已绑定',
value: 2
},
{
label: '已过期',
value: 3
},
{
label: '待转移',
value: 4
},
{
label: '已合并',
value: 5
}
],
optionId: 'value',
optionLabel: 'label',
isClear: true
},
{
label: '员工姓名',
name: 'staffName',
type: 'input',
isClear: true,
placeholder: '输入关键字搜索'
}
],
tableParams: {
listName: 'list',
tableOption: true,
tableColumns: [
{
label: '帐号许可类型',
prop: 'type',
addHtml: 'type'
},
{
label: '激活状态',
prop: 'status',
addHtml: 'status'
},
{
label: '绑定员工',
prop: 'staffName'
},
{
label: '手机号码',
prop: 'staffPhone'
},
{
label: '激活时间',
prop: 'activeTime'
},
{
label: '有效期',
prop: 'expireTime'
}
]
},
pageConf: { pageSize: 'pageSize', pageNum: 'pageNum', totalCount: 'total' },
layout: 'sizes, prev, pager, next, jumper, ->, total',
// getListApi: this.$apis.accountConfig.listAccountCodeWithPage,
buttonList: [
{
type: 'GLButton',
name: row => {
return '转移'
},
attrs: {
type: 'text',
fn: '许可转移'
},
condition: row => {
return true
},
listeners: {
click: this.handelTransfer
}
}
]
}
},
mounted() {
this.routerInfo = this.$route.query
this.getListApi()
},
methods: {
getListApi() {
console.log(this.searchForm)
const { status, staffName } = this.searchForm
const { merchantId, corpId } = this.routerInfo
let params = {
merchantId,
corpId,
status,
staffName
}
params.pageSize = this.$refs.accountCodeTable.page.pageSize
params.pageNum = this.$refs.accountCodeTable.page.pageNum
this.$apis.accountConfig.listAccountCodeWithPage(params).then(res => {
console.log(res)
this.accountTableData = res.list
this.tableTotal = res.total
})
},
// 账号许可转移弹窗
handelTransfer(scope) {
console.log(scope)
const { merchantId, corpId } = this.routerInfo
let params = {
merchantId,
corpId
}
this.handoverUserid = scope.userid
this.dialogTransferVisible = true
this.expireTime = scope.expireTime
this.$apis.accountConfig.findNotActiveStaff(params).then(res => {
console.log(res)
this.notActiveStaffList = res
})
},
// 选择转移员工
selectTransferStaff(id) {
this.takeoverUserid = id
},
// 账号许可转移
transferCount() {
const { merchantId, corpId } = this.routerInfo
let params = {
merchantId,
corpId
}
params.handoverUserid = this.handoverUserid
params.takeoverUserid = this.takeoverUserid
console.log(params)
this.$apis.accountConfig.transferLicenseAccount(params).then(res => {
if (res) {
this.$message({
message: '账号转移成功',
type: 'success'
})
this.getListApi()
this.dialogTransferVisible = false
this.transferForm.staff = ''
}
})
},
// 关闭弹窗
handleClose() {
this.dialogTransferVisible = false
this.transferForm.staff = ''
},
// 搜索框搜索
handleSearch() {
this.$refs.accountCodeTable.refreshTable()
},
// 重置搜索框搜索
handleReset() {
this.searchForm = {
status: '',
staffName: ''
}
this.getListApi()
},
setTableFinishFun() {
//接收到的数据为空
this.$refs.accountCodeTable.data.length ? (this.$refs.accountCodeTable.tableHeightValues = '') : this.$refs.accountCodeTable.setTableHeightFun()
}
}
}
</script>
<style lang="scss" scoped>
.container {
background-color: #fff;
.title {
height: 58px;
margin-bottom: 20px;
padding-left: 20px;
font-size: 16px;
font-family: PingFangSC-Medium, PingFang SC;
font-weight: 600;
color: #333333;
line-height: 58px;
border-bottom: 1px solid #e5e5e5;
}
.tableBox {
padding: 0 20px 60px 20px;
}
}
.trans-dia {
/deep/ .el-form-item__label {
width: 154px;
}
/deep/ .el-select {
width: 474px;
}
}
/deep/ .el-dialog__title {
font-weight: 600;
}
</style>
...@@ -87,9 +87,9 @@ ...@@ -87,9 +87,9 @@
</div> --> </div> -->
</div> </div>
</div> </div>
<GLFooter> <!-- <GLFooter>
<el-button type="primary" @click="handleCancel">返回</el-button> <el-button type="primary" @click="handleCancel">返回</el-button>
</GLFooter> </GLFooter> -->
</div> </div>
</template> </template>
...@@ -210,5 +210,4 @@ export default { ...@@ -210,5 +210,4 @@ export default {
} }
</style> </style>
<style lang="scss">
</style>
\ No newline at end of file \ No newline at end of file
<style lang="scss"></style>
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!