Commit 3bf61401 by xinla

--no commit message

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