Commit 3bf61401 by xinla

--no commit message

1 parent 410610f8
...@@ -8,29 +8,29 @@ export default { ...@@ -8,29 +8,29 @@ export default {
components: { components: {
ChartLine: () => import('@/components/ChartLine'), ChartLine: () => import('@/components/ChartLine'),
ChartBar: () => import('@/components/ChartBar'), ChartBar: () => import('@/components/ChartBar'),
SelectUser: () => import('@/components/SelectUser') SelectUser: () => import('@/components/SelectUser'),
}, },
props: { props: {
// 图表类型 // 图表类型
type: { type: {
type: String, type: String,
default: '' default: '',
}, },
// 图表图例; 单个图例可传字符串,多个图例传数组 // 图表图例; 单个图例可传字符串,多个图例传数组
legend: { legend: {
type: [Array, String], type: [Array, String],
default: null default: null,
}, },
// 接口请求 // 接口请求
request: { request: {
type: Function, type: Function,
default: () => {} default: () => {},
}, },
// 导出接口请求 // 导出接口请求
requestExport: { requestExport: {
type: Function, type: Function,
default: () => {} default: () => {},
} },
}, },
data() { data() {
return { return {
...@@ -44,7 +44,7 @@ export default { ...@@ -44,7 +44,7 @@ export default {
series: [], series: [],
legendDict: { legendDict: {
customerTotalChart: ['客群总数'], customerTotalChart: ['客群总数'],
customerTotalChart: ['客群总数'] customerTotalChart: ['客群总数'],
}, },
// 日期范围 // 日期范围
dateRange: [], dateRange: [],
...@@ -57,7 +57,7 @@ export default { ...@@ -57,7 +57,7 @@ export default {
chatIds: [], chatIds: [],
ownerIds: [], ownerIds: [],
beginTime: undefined, beginTime: undefined,
endTime: undefined endTime: undefined,
}, },
// 群聊 // 群聊
groupChats: [], groupChats: [],
...@@ -69,21 +69,21 @@ export default { ...@@ -69,21 +69,21 @@ export default {
{ prop: 'addCnt', label: '新增客户数' }, { prop: 'addCnt', label: '新增客户数' },
{ prop: 'lostCnt', label: '流失客户数' }, { prop: 'lostCnt', label: '流失客户数' },
{ prop: 'netCnt', label: '净增客户数' }, { prop: 'netCnt', label: '净增客户数' },
{ prop: 'applyCnt', label: '昨日发送申请数' } { prop: 'applyCnt', label: '昨日发送申请数' },
], ],
// 客群数据报表 // 客群数据报表
customerGroupTotalTable: [ customerGroupTotalTable: [
{ prop: 'xtime', label: '日期' }, { prop: 'xtime', label: '日期' },
{ prop: 'totalCnt', label: '客群总数' }, { prop: 'totalCnt', label: '客群总数' },
{ prop: 'addCnt', label: '新增客群数' }, { prop: 'addCnt', label: '新增客群数' },
{ prop: 'dissolveCnt', label: '解散客群数' } { prop: 'dissolveCnt', label: '解散客群数' },
], ],
// 客群成员数据报表 // 客群成员数据报表
customerGroupMemberTotalTable: [ customerGroupMemberTotalTable: [
{ prop: 'xtime', label: '日期' }, { prop: 'xtime', label: '日期' },
{ prop: 'totalCnt', label: '客群成员总数' }, { prop: 'totalCnt', label: '客群成员总数' },
{ prop: 'addCnt', label: '新增客群成员数' }, { prop: 'addCnt', label: '新增客群成员数' },
{ prop: 'quitCnt', label: '流失客群成员数' } { prop: 'quitCnt', label: '流失客群成员数' },
], ],
// 客户联系 // 客户联系
customerContactTable: [ customerContactTable: [
...@@ -91,25 +91,24 @@ export default { ...@@ -91,25 +91,24 @@ export default {
{ prop: 'chatCnt', label: '单聊总数' }, { prop: 'chatCnt', label: '单聊总数' },
{ prop: 'messageCnt', label: '发送消息数' }, { prop: 'messageCnt', label: '发送消息数' },
{ prop: 'replyPercentage', label: '已回复聊天占比' }, { prop: 'replyPercentage', label: '已回复聊天占比' },
{ prop: 'avgReplyTime', label: '平均回复时长(分)' } { prop: 'avgReplyTime', label: '平均回复时长(分)' },
], ],
// 客群联系 // 客群联系
customerGroupContactTable: [ customerGroupContactTable: [
{ prop: 'xtime', label: '日期' }, { prop: 'xtime', label: '日期' },
{ prop: 'chatTotal', label: '群聊总数' }, { prop: 'chatTotal', label: '群聊总数' },
{ prop: 'msgTotal', label: '群聊消息数' }, { prop: 'msgTotal', label: '群聊消息数' },
{ prop: 'memberHasMsg', label: '发送消息群成员数' } { prop: 'memberHasMsg', label: '发送消息群成员数' },
] ],
}, },
userArray: [], // 选择人员 userArray: [], // 选择人员
dialogVisible: false, dialogVisible: false,
dialogType: '_users' dialogType: '_users',
} }
}, },
computed: {}, computed: {},
watch: {}, watch: {},
created() { created() {
this.getGroupList()
this.setTime(7) this.setTime(7)
}, },
mounted() {}, mounted() {},
...@@ -182,7 +181,7 @@ export default { ...@@ -182,7 +181,7 @@ export default {
averageReplyDurationChart: 'avgReplyTime', // 平均首次回复时长 averageReplyDurationChart: 'avgReplyTime', // 平均首次回复时长
groupChatTotalChart: 'chatTotal', // 群聊总数 groupChatTotalChart: 'chatTotal', // 群聊总数
groupChatMessageNumChart: 'msgTotal', // 群聊消息数 groupChatMessageNumChart: 'msgTotal', // 群聊消息数
sendMessageGroupMemberChart: 'memberHasMsg' // 发送消息群成员数 sendMessageGroupMemberChart: 'memberHasMsg', // 发送消息群成员数
} }
this.series = data.map((e) => e[dict[this.type]]) this.series = data.map((e) => e[dict[this.type]])
} }
...@@ -204,8 +203,8 @@ export default { ...@@ -204,8 +203,8 @@ export default {
this.loading = false this.loading = false
}) })
}, },
getGroupList() { getGroupList(params) {
getGroupList() getGroupList(params)
.then(({ rows }) => { .then(({ rows }) => {
this.groupChats = rows this.groupChats = rows
}) })
...@@ -234,13 +233,20 @@ export default { ...@@ -234,13 +233,20 @@ export default {
getSelectUser(data) { getSelectUser(data) {
this.userArray = data this.userArray = data
this.query[this.dialogType] = data.map((e) => e.name).join(',') this.query[this.dialogType] = data.map((e) => e.name).join(',')
if (['customerGroupMemberTotalChart', 'customerGroupMemberTotalTable'].includes(this.type)) {
this.query.chatIds = ''
this.getGroupList({
groupLeaderName: this.query[this.dialogType],
})
} else {
this.getList() this.getList()
}
}, },
exprotTable() { exprotTable() {
this.$confirm('是否确认导出吗?', '警告', { this.$confirm('是否确认导出吗?', '警告', {
confirmButtonText: '确定', confirmButtonText: '确定',
cancelButtonText: '取消', cancelButtonText: '取消',
type: 'warning' type: 'warning',
}) })
.then(() => { .then(() => {
this.loading = true this.loading = true
...@@ -256,8 +262,8 @@ export default { ...@@ -256,8 +262,8 @@ export default {
.finally(() => { .finally(() => {
this.loading = false this.loading = false
}) })
} },
} },
} }
</script> </script>
...@@ -296,7 +302,8 @@ export default { ...@@ -296,7 +302,8 @@ export default {
v-if="['customerGroupMemberTotalChart', 'customerGroupMemberTotalTable'].includes(type)" v-if="['customerGroupMemberTotalChart', 'customerGroupMemberTotalTable'].includes(type)"
v-model="query.chatIds" v-model="query.chatIds"
placeholder="请选择群聊" placeholder="请选择群聊"
@change="getList(1)" clearable
@change="getList()"
> >
<el-option <el-option
v-for="item in groupChats" v-for="item in groupChats"
...@@ -312,7 +319,7 @@ export default { ...@@ -312,7 +319,7 @@ export default {
'customerTotalChart', 'customerTotalChart',
'customerTotalTable', 'customerTotalTable',
'realDataChart', 'realDataChart',
'customerContactTable' 'customerContactTable',
].includes(type) ].includes(type)
" "
style="width: 180px" style="width: 180px"
......
...@@ -52,7 +52,6 @@ export default { ...@@ -52,7 +52,6 @@ export default {
computed: {}, computed: {},
watch: {}, watch: {},
created() { created() {
this.getGroupList()
this.setTime(7) this.setTime(7)
}, },
mounted() {}, mounted() {},
...@@ -85,8 +84,8 @@ export default { ...@@ -85,8 +84,8 @@ export default {
this.loading[type] = false this.loading[type] = false
}) })
}, },
getGroupList() { getGroupList(params) {
getGroupList() getGroupList(params)
.then(({ rows }) => { .then(({ rows }) => {
this.groupChats = rows this.groupChats = rows
}) })
...@@ -118,7 +117,14 @@ export default { ...@@ -118,7 +117,14 @@ export default {
getSelectUser(data) { getSelectUser(data) {
this.selectUsers[this.dialogType] = data this.selectUsers[this.dialogType] = data
this.query[this.dialogType] = data.map((e) => e.name).join(',') this.query[this.dialogType] = data.map((e) => e.name).join(',')
if (this.dialogType === 'customerGroup') {
this.getList(this.dialogType) this.getList(this.dialogType)
} else {
this.query.chatIds = ''
this.getGroupList({
groupLeaderName: this.query[this.dialogType],
})
}
}, },
}, },
} }
...@@ -165,7 +171,6 @@ export default { ...@@ -165,7 +171,6 @@ export default {
readonly readonly
@focus="showDialog('customerGroup')" @focus="showDialog('customerGroup')"
placeholder="请选择群主" placeholder="请选择群主"
@change="getList(1)"
/> />
</div> </div>
<ChartLine <ChartLine
...@@ -187,6 +192,7 @@ export default { ...@@ -187,6 +192,7 @@ export default {
<el-select <el-select
v-model="query.chatIds" v-model="query.chatIds"
placeholder="请选择群聊" placeholder="请选择群聊"
clearable
@change="getList('customerGroupMember')" @change="getList('customerGroupMember')"
> >
<el-option <el-option
......
...@@ -11,7 +11,7 @@ export default { ...@@ -11,7 +11,7 @@ export default {
cardData: [], cardData: [],
activeTrend: 0, activeTrend: 0,
activeSheet: 0, activeSheet: 0,
api api,
} }
}, },
computed: {}, computed: {},
...@@ -36,43 +36,43 @@ export default { ...@@ -36,43 +36,43 @@ export default {
{ {
title: '客群总数', title: '客群总数',
tips: '企业员工全部客户群数量', tips: '企业员工全部客户群数量',
value: data.totalCnt value: data.totalCnt,
}, },
{ {
title: '今日新增客群', title: '今日新增客群',
tips: '今日新创建的客群数', tips: '今日新创建的客群数',
value: data.tdGroupAddCnt, value: data.tdGroupAddCnt,
title1: '较昨日', title1: '较昨日',
value1: data.ydGroupAddCnt value1: data.ydGroupAddCnt,
}, },
{ {
title: '今日解散客群', title: '今日解散客群',
tips: '今日解散的客户群数', tips: '今日解散的客户群数',
value: data.tdGroupDissolveCnt, value: data.tdGroupDissolveCnt,
title1: '较昨日', title1: '较昨日',
value1: data.ydGroupDissolveCnt value1: data.ydGroupDissolveCnt,
}, },
{ {
title: '客群成员总数', title: '客群成员总数',
tips: '全部客群成员的总数,包括企业员工', tips: '全部客群成员的总数,包括企业员工',
value: data.memberTotalCnt, value: data.memberTotalCnt,
title1: '含员工', title1: '含员工',
value1: data.memberUserCnt value1: data.memberUserCnt,
}, },
{ {
title: '今日新增客群成员', title: '今日新增客群成员',
tips: '今日进入群聊的成员数量,包括企业员工', tips: '今日进入群聊的成员数量,包括企业员工',
value: data.tdMemberAddCnt, value: data.tdMemberAddCnt,
title1: '较昨日', title1: '较昨日',
value1: data.ydMemberAddCnt value1: data.ydMemberAddCnt,
}, },
{ {
title: '今日新增客群成员', title: '今日退出客群成员',
tips: '今日退出群聊的成员数量,包括企业员工', tips: '今日退出群聊的成员数量,包括企业员工',
value: data.tdMemberQuitCnt, value: data.tdMemberQuitCnt,
title1: '较前日', title1: '较前日',
value1: data.ydMemberQuitCnt value1: data.ydMemberQuitCnt,
} },
] ]
}) })
.catch((e) => { .catch((e) => {
...@@ -81,8 +81,8 @@ export default { ...@@ -81,8 +81,8 @@ export default {
.finally(() => { .finally(() => {
this.loading = false this.loading = false
}) })
} },
} },
} }
</script> </script>
......
...@@ -139,7 +139,7 @@ ...@@ -139,7 +139,7 @@
></el-input> ></el-input>
</el-form-item> </el-form-item>
<el-form-item label="预览"> <el-form-item label="预览">
<div class="red-packet-message">红包名称</div> <div class="red-packet-message">{{ addForm.name || '红包名称' }}</div>
</el-form-item> </el-form-item>
</el-form> </el-form>
<span slot="footer" class="dialog-footer"> <span slot="footer" class="dialog-footer">
...@@ -256,16 +256,16 @@ export default { ...@@ -256,16 +256,16 @@ export default {
}, },
limitRules: { limitRules: {
singleDayPay: [ singleDayPay: [
// { required: true, message: '请输入金额', trigger: 'blur' }, { required: true, message: '请输入金额', trigger: 'change' },
{ validator: validateAmount, trigger: 'blur' }, { validator: validateAmount, trigger: 'change' },
], ],
singleCustomerReceiveNum: [ singleCustomerReceiveNum: [
// { required: true, message: '请输入次数', trigger: 'blur' }, { required: true, message: '请输入次数', trigger: 'blur' },
{ validator: validateClientReceiveNum, trigger: 'blur' }, { validator: validateClientReceiveNum, trigger: 'blur' },
], ],
singleCustomerReceiveMoney: [ singleCustomerReceiveMoney: [
{ required: true, message: '请输入金额', trigger: 'blur' }, { required: true, message: '请输入金额', trigger: 'change' },
{ validator: validateAmount, trigger: 'blur' }, { validator: validateAmount, trigger: 'change' },
], ],
}, },
addForm: { addForm: {
...@@ -275,7 +275,7 @@ export default { ...@@ -275,7 +275,7 @@ export default {
}, },
addRules: { addRules: {
name: [{ required: true, message: '必填项' }], name: [{ required: true, message: '必填项' }],
money: [{ validator: validateAmount, trigger: 'blur' }], money: [{ required: true, validator: validateAmount, trigger: 'blur' }],
sceneType: [{ required: true, message: '必填项', trigger: 'change' }], sceneType: [{ required: true, message: '必填项', trigger: 'change' }],
}, },
selectedIds: [], selectedIds: [],
...@@ -325,22 +325,12 @@ export default { ...@@ -325,22 +325,12 @@ export default {
handleSelectionChange(val) { handleSelectionChange(val) {
this.selectedIds = val.map((i) => i.id) this.selectedIds = val.map((i) => i.id)
}, },
getLimit() {
return getLimit({ pageSize: 10, pageNum: 1 }).then((res) => {
if (res.code == 200 && Array.isArray(res.rows)) {
return res.rows[0]
}
})
},
async initLimitData() {
const limitConfig = await this.getLimit()
if (limitConfig) {
this.$set(this.limitForm, 'id', limitConfig.id)
}
},
async showLimitConfig() { async showLimitConfig() {
await this.initLimitData() const { data } = await getLimit()
let { id, singleDayPay, singleCustomerReceiveNum, singleCustomerReceiveMoney } = data
this.limitForm = { id, singleDayPay, singleCustomerReceiveNum, singleCustomerReceiveMoney }
this.limitDialogVisible = true this.limitDialogVisible = true
this.$nextTick(() => this.$refs.limitForm.clearValidate())
}, },
setLimit() { setLimit() {
this.$refs.limitForm.validate((validate) => { this.$refs.limitForm.validate((validate) => {
...@@ -359,7 +349,7 @@ export default { ...@@ -359,7 +349,7 @@ export default {
id, //主键 id, //主键
status: { 0: '1', 1: '0' }[status], //0:启用;1:停用 status: { 0: '1', 1: '0' }[status], //0:启用;1:停用
}).then((res) => { }).then((res) => {
this.msgSuccess('删除成功') this.msgSuccess('操作成功')
this.getList() this.getList()
}) })
}) })
......
...@@ -17,11 +17,17 @@ ...@@ -17,11 +17,17 @@
<el-button type="success" @click="resetQuery">重置</el-button> <el-button type="success" @click="resetQuery">重置</el-button>
</el-form-item> </el-form-item>
</el-form> </el-form>
<el-button type="primary" @click="edit()">新建员工限额 </el-button> <el-button
type="primary"
@click="
batchUpdate = false
edit()
"
>新建员工限额
</el-button>
<el-button <el-button
type="primary" type="primary"
plain plain
size="mini"
@click=" @click="
batchUpdate = true batchUpdate = true
edit() edit()
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!