Commit 3104fa2e by 前端

Merge branch 'xuyl_dev_v2.11.0' into 'v2.11.0'

Xuyl dev v2.11.0

See merge request !20
2 parents 5f7b3e4e 1c148811
import { http, http2 } from '@/main' import { http, http2 } from '@/main'
const URL = 'rop-scrm-entmicro/router'
// 获取验证码
const getLoginQcCode = params => {
params.method = 'entmicro.api.wechatcloudcontrol.cloudconlogin.getLoginQcCode'
return http({
url: 'rop-scrm-entmicro/router',
method: 'POST',
data: params,
sign: true
})
}
// 验证二维码是否失效
const getQcCodeDetail = params => {
params.method = 'entmicro.api.wechatcloudcontrol.cloudconlogin.getQcCodeDetail'
return http({
url: 'rop-scrm-entmicro/router',
method: 'POST',
data: params,
sign: true
})
}
const wechatDepositList = params => {
params.method = 'entmicro.api.wechatcloudcontrol.cloudconlogin.wechatDepositList'
return http({
url: '/rop-scrm-entmicro/router',
method: 'POST',
data: params,
sign: true
})
}
export default { export default {
getLoginQcCode,
getQcCodeDetail,
wechatDepositList
} }
...@@ -33,7 +33,7 @@ const batchmessagingRecord = params => { ...@@ -33,7 +33,7 @@ const batchmessagingRecord = params => {
}) })
} }
// 企微群发查看预计群发人数 // 企微群发查看预计群发人数
const atchmessagingCustomercount = params => { const batchmessagingCustomercount = params => {
params.method = 'entmicro.api.wechatcloudcontrol.batchmessaging.customercount' params.method = 'entmicro.api.wechatcloudcontrol.batchmessaging.customercount'
return http({ return http({
url: URL, url: URL,
...@@ -49,14 +49,37 @@ const atchmessagingCreate = params => { ...@@ -49,14 +49,37 @@ const atchmessagingCreate = params => {
url: URL, url: URL,
method: 'POST', method: 'POST',
data: params, data: params,
sign: true,
returnAll:true
})
}
const getStoreList = params => {
params.method = 'entmicro.api.wechatcloudcontrol.batchmessaging.create.merchant'
return http({
url: URL,
method: 'POST',
data: params,
sign: true sign: true
}) })
} }
const recordSend = params => {
params.method = 'entmicro.api.wechatcloudcontrol.batchmessaging.record.send'
return http({
url: URL,
method: 'POST',
data: params,
sign: true
})
}
export default { export default {
querylabeltree, querylabeltree,
queryCrowdtree, queryCrowdtree,
batchmessagingRecord, batchmessagingRecord,
atchmessagingCustomercount, batchmessagingCustomercount,
atchmessagingCreate atchmessagingCreate,
getStoreList,
recordSend
} }
...@@ -7,14 +7,28 @@ ...@@ -7,14 +7,28 @@
<el-button class="table-btn" @click="handleqrCode" :size="size" type="primary" plain mode="el-button">企微接入授权</el-button> <el-button class="table-btn" @click="handleqrCode" :size="size" type="primary" plain mode="el-button">企微接入授权</el-button>
</div> </div>
</div> </div>
<GLTable ref="activeTable" :noDataImg="url" :getListApi="getListApi" :searchForm="searchForm" :tableParams="tableParams" :pageConf="pageConf" @setTableFinishFun="setTableFinishFun"></GLTable> <GLTable ref="activeTable" :noDataImg="url" :getListApi="getListApi" :searchForm="searchForm" :tableParams="tableParams" :pageConf="pageConf" @setTableFinishFun="setTableFinishFun">
<div slot="staffName" slot-scope="scope">
<div class="staffName">
<span>{{ scope.scope.staffName }}</span>
<span class="entmicroName" v-if="scope.scope.entmicroName">@{{ scope.scope.entmicroName }}</span>
</div>
</div>
<div slot="loginStatus" slot-scope="scope">
<div class="loginStatus" v-if="scope.scope.loginStatus">
<span class="cycle" :style="{ background: scope.scope.loginStatus == '1' ? '#2CCA74' : scope.scope.loginStatus == '0' ? '#999999' : '' }"></span>
{{ scope.scope.loginStatus == '1' ? '在线' : scope.scope.loginStatus == '0' ? '离线' : '' }}
</div>
<div v-else>--</div>
</div>
</GLTable>
<GLDialog :title="'授权登入二维码'" mode="small" :visible.sync="qrCodeVisible"> <GLDialog :title="'授权登入二维码'" mode="small" :visible.sync="qrCodeVisible">
<div class="qrIMGbox"> <div v-loading="addLoading" class="qrIMGbox">
<img class="qrIMG" :src="url" /> <img class="qrIMG" :src="qrcodeUrl" />
</div> </div>
<span slot="footer" class="dialog-footer"> <span slot="footer" class="dialog-footer">
<el-button type="primary" size="small" @click="refreshQrcode">刷新</el-button> <el-button type="primary" size="small" @click="refreshQrcode">刷新</el-button>
</span> </span>
</GLDialog> </GLDialog>
</div> </div>
</template> </template>
...@@ -26,17 +40,16 @@ export default { ...@@ -26,17 +40,16 @@ export default {
data() { data() {
return { return {
url, url,
verifyQRCodeFailsToOpen: false,
addLoading: false,
qrcodeUrl: '',
qrCodeVisible: false, qrCodeVisible: false,
searchForm: { qrcodeId: '',
belongWechat: '', searchForm: {},
staffName: '',
telphone: '',
status: ''
},
searchFormData: [ searchFormData: [
{ {
label: '所属企微', label: '所属企微',
name: 'belongWechat', name: 'entmicroName',
type: 'input', type: 'input',
isClear: true isClear: true
}, },
...@@ -48,13 +61,13 @@ export default { ...@@ -48,13 +61,13 @@ export default {
}, },
{ {
label: '手机号码', label: '手机号码',
name: 'telphone', name: 'staffPhone',
type: 'input', type: 'input',
isClear: true isClear: true
}, },
{ {
label: '状态', label: '状态',
name: 'status', name: 'loginStatus',
type: 'select', type: 'select',
optionList: [ optionList: [
{ {
...@@ -76,36 +89,34 @@ export default { ...@@ -76,36 +89,34 @@ export default {
} }
], ],
tableParams: { tableParams: {
listName: 'list', listName: 'data',
tableColumns: [ tableColumns: [
{ {
label: '员工企微', label: '员工企微',
prop: 'staffNum' prop: 'staffName',
addHtml: 'staffName'
}, },
{ {
label: '手机号码', label: '手机号码',
prop: 'telphone' prop: 'staffPhone'
}, },
{ {
label: '所属门店', label: '所属门店',
prop: 'belongStore' prop: 'merchantName'
},
{
label: '所属企微',
prop: 'belongWechat'
}, },
{ {
label: '最后同步时间', label: '最后同步时间',
prop: 'time' prop: 'lastLoginTime'
}, },
{ {
label: '状态', label: '状态',
prop: 'status' prop: 'loginStatus',
addHtml: 'loginStatus'
} }
] ]
}, },
pageConf: { pageSize: 'pageSize', pageNum: 'pageNum', totalCount: 'total' } pageConf: { pageSize: 'pageSize', pageNum: 'pageNum', totalCount: 'count' },
// getListApi: this.$apis.accountConfig.listCustomizedAgentWithPage, getListApi: this.$apis.collocation.wechatDepositList
} }
}, },
methods: { methods: {
...@@ -114,22 +125,59 @@ export default { ...@@ -114,22 +125,59 @@ export default {
}, },
// 重置搜索框搜索 // 重置搜索框搜索
handleReset() { handleReset() {
this.searchForm = { this.searchForm = {}
isBuyPermit: '',
merchantId: '',
merchantName: ''
}
this.handleSearch() this.handleSearch()
}, },
setTableFinishFun() { setTableFinishFun() {
//接收到的数据为空 //接收到的数据为空
this.$refs.activeTable.data.length ? (this.$refs.activeTable.tableHeightValues = '') : this.$refs.activeTable.setTableHeightFun() this.$refs.activeTable.data.length ? (this.$refs.activeTable.tableHeightValues = '') : this.$refs.activeTable.setTableHeightFun()
}, },
handleqrCode() { async handleqrCode() {
this.addLoading = true
this.qrCodeVisible = true this.qrCodeVisible = true
await this.$apis.collocation
.getLoginQcCode({})
.then(res => {
this.addLoading = false
;(this.verifyQRCodeFailsToOpen = true), (this.qrcodeUrl = `data:image/png;base64,${res.qcCodeUrl}`)
this.qrcodeId = res.id
})
.catch(err => {
this.qrCodeVisible = false
})
},
verifyQRCodeIsInvalid() {
this.qrCodeInterval = setInterval(() => {
this.$apis.collocation.getQcCodeDetail({ id: this.qrcodeId }).then(res => {
if (res == true) {
this.$message({
type: 'error',
message: '二维码已失效,请刷新'
})
this.verifyQRCodeFailsToOpen = false
clearInterval(this.qrCodeInterval)
return
}
})
}, 3000000)
}, },
refreshQrcode() { refreshQrcode() {
console.log('1111') this.handleqrCode()
}
},
computed: {
listenChange() {
const { verifyQRCodeFailsToOpen, qrCodeVisible } = this
return { verifyQRCodeFailsToOpen, qrCodeVisible }
}
},
watch: {
listenChange(val) {
if (val.qrCodeVisible == true && val.verifyQRCodeFailsToOpen == true) {
this.verifyQRCodeIsInvalid()
} else {
clearInterval(this.qrCodeInterval)
}
} }
} }
} }
...@@ -154,7 +202,7 @@ export default { ...@@ -154,7 +202,7 @@ export default {
color: #5850ff; color: #5850ff;
border: 1px solid #5850ff; border: 1px solid #5850ff;
} }
.qrIMGbox{ .qrIMGbox {
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: center; justify-content: center;
...@@ -163,6 +211,24 @@ export default { ...@@ -163,6 +211,24 @@ export default {
height: 150px; height: 150px;
} }
} }
/deep/.loginStatus {
display: flex;
align-items: center;
.cycle {
margin-right: 8px;
width: 6px;
height: 6px;
display: inline-block;
border-radius: 50%;
}
}
.staffName {
display: flex;
align-items: center;
.entmicroName {
font-size: 12px;
color: #fb8f28;
}
}
} }
</style> </style>
import { http } from '@/main'
const URL = 'rop-scrm-entmicro/router'
const getStoreList = params => {
params.method = 'entmicro.api.wechatcloudcontrol.batchmessaging.create.merchant'
return http({
url: URL,
method: 'POST',
data: params,
sign: true
})
}
export default {
getStoreList
}
<template>
<el-select ref="selectRef" clearable filterable remote :remote-method="remoteMethod" v-el-select-loadmore="loadmore" v-model="inputVal" placeholder="请选择门店" @change="selectChange">
<el-option v-for="(item, i) in dataItems" :key="i" :label="item[label]" :value="item[value]"></el-option>
</el-select>
</template>
<script>
import { getStoreList } from './api'
export default {
name: 'SearchDropDown',
props: ['inputBoxSearchValue', 'label', 'value'],
data() {
return {
searchContentStorage: '',
inputVal: '',
dataItems: [],
arrBack:[],
totalNum:'',
pageData: {
//懒加载相关参数,这里代表从第一条数据开始加载,一次加载40项
pageNum: 1,
pageSize: 10
}
}
},
directives: {
/** 下拉框懒加载 */
'el-select-loadmore': {
bind(el, binding) {
const SELECTWRAP_DOM = el.querySelector('.el-select-dropdown .el-select-dropdown__wrap')
SELECTWRAP_DOM.addEventListener('scroll', function() {
const condition = this.scrollHeight - this.scrollTop <= this.clientHeight
if (condition) {
binding.value()
}
})
}
}
},
mounted() {
this.loadUpData(this.pageData)
},
watch: {
// 'inputVal'(newVal, oldVal) {
// console.log(newVal,oldVal)
// // if (oldVal !== newVal) {
// // this.dataItems = []
// // this.loadUpData({
// // pageNum: 1,
// // pageSize: 10
// // },newVal)
// // }
// }
'inputVal': {
handler(val) {
console.log(val)
if (!val) {
this.dataItems = []
this.loadUpData({
pageNum: 1,
pageSize: 10
})
}
}
}
},
methods: {
async loadUpData(pageData, searchVal) {
let params = {
...pageData,
merchantName: searchVal
}
await this.$apis.wechatGroup.getStoreList(params).then(res => {
this.totalNum = res.count
this.arrBack = res.data
})
this.dataItems = [...this.dataItems,...this.arrBack]
},
loadmore() {
this.pageData.pageNum++
let acquireCount = this.pageData.pageNum * this.pageData.pageSize
if (acquireCount - this.totalNum >= this.pageData.pageSize){
return
}
if (this.searchContentStorage) {
this.loadUpData(this.pageData, this.searchContentStorage)
} else {
this.loadUpData(this.pageData, '') //类似于分页查询
}
},
// 远程搜索
async remoteMethod(searchValue) {
console.log(this.inputVal)
if (searchValue !== '') {
this.searchContentStorage = searchValue
this.dataItems = []
this.timer = setTimeout(() => {
this.loadUpData(this.pageData, searchValue)
}, 300)
} else {
this.dataItems = []
this.loadUpData({
pageNum: 1,
pageSize: 10
},'')
}
},
// 根据所选商户获取品牌和地址
async selectChange(label) {
if (label) {
let obj = this.dataItems.filter(el => {
return el['incomingDisplayLabel'] == label
})
}
}
}
}
</script>
<style scoped></style>
...@@ -7,14 +7,22 @@ ...@@ -7,14 +7,22 @@
</el-button> </el-button>
</div> </div>
<div class="container"> <div class="container">
<GLCombiForm :formObj="searchForm" :rowNumber="1" :formData="searchFormData" @handleOk="handleSearch" @handleRest="handleReset"> <GLCombiForm :formObj="searchForm" :rowNumber="1" :formData="searchFormData" @handleOk="handleSearch" @handleRest="handleReset"></GLCombiForm>
<div slot="optionBtns"> <GLTable ref="activeTable" :noDataImg="url" :getListApi="getListApi" :searchForm="searchFormTable" :tableParams="tableParams" :pageConf="pageConf" :beforeSearchFn="beforeSearchFn" @setTableFinishFun="setTableFinishFun">
<div class="sendRecord" @click="traceRecord">发送记录</div> <div slot="optionBtns" slot-scope="scope">
<div v-if="scope.scope.sendState == '1'">
<span class="sendRecord" @click="traceRecord(scope.scope)">发送记录</span>
</div>
</div>
<div slot="sendState" slot-scope="scope">
<div class="loginStatus">
<span class="cycle" :style="{ background: scope.scope.sendState == '1' ? '#2CCA74' : scope.scope.sendState == '2' ? '#EB4E4E' : scope.scope.sendState == '0' ? '#FDB757' : '' }"></span>
{{ scope.scope.sendState == '1' ? '已完成' : scope.scope.sendState == '2' ? '发送失败' : scope.scope.sendState == '0' ? '发送中' : '' }}
</div>
</div> </div>
</GLCombiForm> </GLTable>
<GLTable ref="groupTable" :noDataImg="url" :getListApi="getListApi" :searchForm="searchForm" :tableParams="tableParams" :pageConf="pageConf" @setTableFinishFun="setTableFinishFun"></GLTable>
</div> </div>
<el-drawer size="40%" title="发送记录" :visible.sync="sendRecordDrawer.isVisible" :direction="sendRecordDrawer.direction"> <el-drawer size="50%" title="发送记录" :visible.sync="sendRecordDrawer.isVisible" :direction="sendRecordDrawer.direction">
<div class="horizon"></div> <div class="horizon"></div>
<div class="sendRecordDrawerbox"> <div class="sendRecordDrawerbox">
<div v-for="(item, index) in sendRecordDrawer.traceFailandSuccess" :key="index" class="itemContent"> <div v-for="(item, index) in sendRecordDrawer.traceFailandSuccess" :key="index" class="itemContent">
...@@ -24,7 +32,14 @@ ...@@ -24,7 +32,14 @@
</div> </div>
</div> </div>
</div> </div>
<GLTable ref="sendRecordDrawer.ref" :noDataImg="url" :getListApi="sendRecordDrawer.getListApi" :searchForm="sendRecordDrawer.searchForm" :tableParams="sendRecordDrawer.tableParams" :pageConf="sendRecordDrawer.pageConf"></GLTable> <GLTable ref="sendRecordDrawerRef" :noDataImg="url" :getListApi="sendRecordDrawer.getListApi" :searchForm="sendRecordDrawer.searchForm" :tableParams="sendRecordDrawer.tableParams" :pageConf="sendRecordDrawer.pageConf">
<div slot="sendResult" slot-scope="scope">
<div class="loginStatus">
<span class="cycle" :style="{ background: scope.scope.sendResult == true ? '#2CCA74' : scope.scope.sendResult == false ? '#EB4E4E' : '' }"></span>
{{ scope.scope.sendResult == true ? '成功' : scope.scope.sendResult == false ? '失败' : '' }}
</div>
</div>
</GLTable>
</el-drawer> </el-drawer>
</div> </div>
</template> </template>
...@@ -43,73 +58,78 @@ export default { ...@@ -43,73 +58,78 @@ export default {
{ {
title: '发送成功', title: '发送成功',
id: '1', id: '1',
num: 22, num: '',
color: '#2CCA74' color: '#2CCA74'
}, },
{ {
title: '发送失败', title: '发送失败',
id: '2', id: '2',
num: 4, num: '',
color: '#EB4E4E ' color: '#EB4E4E '
} }
], ],
ref: 'sendRecordDrawerRef', searchForm: {
getListApi: '', msgId: ''
searchForm: '', },
tableParams: { tableParams: {
listName: 'list', listName: 'data',
tableColumns: [ tableColumns: [
{ {
label: '客户', label: '客户',
prop: 'sendName' prop: 'customerName'
}, },
{ {
label: '发送时间', label: '发送时间',
prop: 'senaStore' prop: 'sendTime'
}, },
{ {
label: '发送结果', label: '发送结果',
prop: 'customerNum' prop: 'sendResult',
addHtml: 'sendResult'
} }
] ]
}, },
pageConf: { pageSize: 'pageSize', pageNum: 'pageNum', totalCount: 'total' } getListApi: this.$apis.wechatGroup.recordSend,
}, pageConf: { pageSize: 'pageSize', pageNum: 'pageNum', totalCount: 'count' }
searchForm: {
sendName: '',
sendTime: '',
store: ''
}, },
searchForm: {},
searchFormData: [ searchFormData: [
{ {
label: '群发名称', label: '群发名称',
name: 'messagingName', name: 'msgName',
type: 'input', type: 'input',
isClear: true isClear: true
}, },
{ {
label: '群发时间', label: '群发时间',
name: 'sendTime', name: 'daterange',
type: 'datePicker', type: 'datePicker',
isClear: true isClear: true,
valueFormat: 'yyyy-MM-dd',
pickerOptions: {
disabledDate(time) {
return time.getTime() > Date.now() || time.getTime() < new Date('2017-12-31').getTime()
}
}
}, },
{ {
label: '群发门店', label: '群发门店',
name: 'merchantName', name: 'msgMerchantName',
type: 'input', type: 'input',
isClear: true isClear: true
} }
], ],
searchFormTable: {},
tableParams: { tableParams: {
listName: 'list', listName: 'data',
tableColumns: [ tableColumns: [
{ {
label: '群发名称', label: '群发名称',
prop: 'messagingName' prop: 'msgName'
}, },
{ {
label: '群发门店', label: '群发门店',
prop: 'messagingMerchant' prop: 'msgMerchant'
}, },
{ {
label: '客户数', label: '客户数',
...@@ -117,7 +137,10 @@ export default { ...@@ -117,7 +137,10 @@ export default {
}, },
{ {
label: '标签/人群', label: '标签/人群',
prop: 'labelCrowdName' prop: 'labelCrowdName',
width: 170,
// addHtml: 'labelCrowdName',
line: 1
}, },
{ {
label: '创建时间', label: '创建时间',
...@@ -125,7 +148,8 @@ export default { ...@@ -125,7 +148,8 @@ export default {
}, },
{ {
label: '发送状态', label: '发送状态',
prop: 'sendState' prop: 'sendState',
addHtml: 'sendState'
}, },
{ {
label: '发送成功', label: '发送成功',
...@@ -140,13 +164,13 @@ export default { ...@@ -140,13 +164,13 @@ export default {
{ {
label: '操作', label: '操作',
prop: 'optionBtns', prop: 'optionBtns',
width: '66px', width: '100px',
addHtml: 'optionBtns', addHtml: 'optionBtns',
fixed: 'right' fixed: 'right'
} }
] ]
}, },
pageConf: { pageSize: 'pageSize', pageNum: 'pageNum', totalCount: 'total' }, pageConf: { pageSize: 'pageSize', pageNum: 'pageNum', totalCount: 'count' },
getListApi: this.$apis.wechatGroup.batchmessagingRecord getListApi: this.$apis.wechatGroup.batchmessagingRecord
} }
}, },
...@@ -156,13 +180,26 @@ export default { ...@@ -156,13 +180,26 @@ export default {
}, },
// 重置搜索框搜索 // 重置搜索框搜索
handleReset() { handleReset() {
this.searchForm = { this.searchForm = {}
isBuyPermit: '',
merchantId: '',
merchantName: ''
}
this.handleSearch() this.handleSearch()
}, },
getParams() {
let params = JSON.parse(JSON.stringify(this.searchForm))
if (params.daterange) {
params.startTime = this.searchForm.daterange[0]
params.endTime = this.searchForm.daterange[1]
} else {
if (params.startTime) delete params.startTime && delete params.endTime
}
delete params.daterange
return params
},
beforeSearchFn() {
return new Promise(async resolve => {
this.searchFormTable = this.getParams()
resolve()
})
},
setTableFinishFun() { setTableFinishFun() {
//接收到的数据为空 //接收到的数据为空
this.$refs.activeTable.data.length ? (this.$refs.activeTable.tableHeightValues = '') : this.$refs.activeTable.setTableHeightFun() this.$refs.activeTable.data.length ? (this.$refs.activeTable.tableHeightValues = '') : this.$refs.activeTable.setTableHeightFun()
...@@ -171,14 +208,32 @@ export default { ...@@ -171,14 +208,32 @@ export default {
addSendGroup() { addSendGroup() {
this.$router.push('/wechatGroup/addWechatGroup') this.$router.push('/wechatGroup/addWechatGroup')
}, },
traceRecord() { async traceRecord(scope) {
const { msgId, successCompletion, failCompletion } = scope
this.sendRecordDrawer.traceFailandSuccess[0].num = successCompletion
this.sendRecordDrawer.traceFailandSuccess[1].num = failCompletion
this.sendRecordDrawer.searchForm.msgId = msgId
this.sendRecordDrawer.isVisible = true this.sendRecordDrawer.isVisible = true
this.$nextTick(() => {
this.$refs.sendRecordDrawerRef.refreshTable()
})
} }
} }
} }
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.loginStatus {
display: flex;
align-items: center;
.cycle {
margin-right: 8px;
width: 6px;
height: 6px;
display: inline-block;
border-radius: 50%;
}
}
.createANewGroupBtn { .createANewGroupBtn {
margin-bottom: 16px; margin-bottom: 16px;
} }
...@@ -202,6 +257,18 @@ export default { ...@@ -202,6 +257,18 @@ export default {
} }
.sendRecord { .sendRecord {
color: #5850ff; color: #5850ff;
cursor: pointer;
}
/deep/.loginStatus {
display: flex;
align-items: center;
.cycle {
margin-right: 8px;
width: 6px;
height: 6px;
display: inline-block;
border-radius: 50%;
}
} }
} }
.horizon { .horizon {
...@@ -212,9 +279,9 @@ export default { ...@@ -212,9 +279,9 @@ export default {
.sendRecordDrawerbox { .sendRecordDrawerbox {
padding: 20px; padding: 20px;
display: flex; display: flex;
justify-content: space-around; justify-content: space-between;
.itemContent { .itemContent {
width: 334px; width: 46%;
padding: 8px 0 8px 20px; padding: 8px 0 8px 20px;
border: 1px solid #e8e8ea; border: 1px solid #e8e8ea;
} }
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!