Commit 505e782b by wuwx

群发助手接口联调

1 parent c4d20a30
......@@ -378,6 +378,28 @@ const getMaterialListApi = params => {
sign: true
})
}
// 更新客户群发客户列表
const renewDetailList = params => {
params.method = `${path}update.merchant`
return http({
url: URL,
method: 'POST',
data: params,
sign: true,
returnAll: true
})
}
// 客户群发统计
const renewStatistic = params => {
params.method = `${path}update.group.detail`
return http({
url: URL,
method: 'POST',
data: params,
sign: true,
returnAll: true
})
}
export default {
customerList,
......@@ -416,5 +438,7 @@ export default {
queryCrowdtree,
followerEcho,
getGroupListApi,
getMaterialListApi
getMaterialListApi,
renewDetailList,
renewStatistic
}
......@@ -123,11 +123,11 @@
</div>
<div class="data">
<div class="titles">数据统计</div>
<div>
<div style="cursor:pointer;" @click="refreshData">
<i class="el-icon-refresh-right"></i>
<span style="margin-right: 8px;">更新数据</span>
</div>
<span style="color: #999;">更新于 2022-8-4 10:24:44</span>
<span style="color: #999;" v-if="time">更新于 {{time}}</span>
</div>
<div class="statistics-info">
<div class="statistics-ul">
......@@ -208,7 +208,9 @@ export default {
condition: {}
},
statistic: {},
limitUserList: []
limitUserList: [],
time: '',
timeId: Function
}
},
watch: {
......@@ -223,6 +225,7 @@ export default {
mounted() {
this.getCustomerDetail(this.id)
this.getStatistic()
this.refreshData()
// console.log(this.basicInfo.condition, '----')
},
computed: {
......@@ -249,6 +252,20 @@ export default {
this.eventBus.$emit('update', previewList)
})
},
refreshData() {
clearTimeout(this.timeId)
this.timeId = setTimeout(() => {
const { id } = this
this.$apis.customerTransform.renewStatistic({ id }).then(res => {
if (res.code == 0) {
this.getStatistic()
this.time = res.data.createdTime
this.$emit('getStaffList')
this.$emit('getCustomerList')
}
})
}, 1500)
},
getStatistic() {
const { id, form } = this
if (form == 'customer') {
......
<template>
<div>
<BasicInof :eventBus="eventBus" :id="$route.params.id" :form="'customer'"></BasicInof>
<BasicInof :eventBus="eventBus" :id="$route.params.id" :form="'customer'" @getStaffList="getStaffList" @getCustomerList="getCustomerList"></BasicInof>
<div class="detail-container">
<div class="detail-modular">
<div class="title">员工详情</div>
......
......@@ -15,11 +15,11 @@
<GLButton type="primary" :size="size" icon="el-icon-plus" fn="新建客户群发" @click="btnClick('create', 1)">新建群发</GLButton>
<div class="text">企业统一选择要发送的客户,由添加客户的成员确认后发送给客户,消息内容仅管理员和负责人可创建。</div>
<div class="renew">
<div>
<div style="cursor:pointer;" @click="refreshData('1')">
<i class="el-icon-refresh-right"></i>
<span style="margin-right: 8px;">更新数据</span>
</div>
<span style="color: #999;">更新于 2022-8-4 10:24:44</span>
<span style="color: #999;" v-if="time">更新于 {{time}}</span>
</div>
</div>
<!-- 表格区域 开始 -->
......@@ -54,11 +54,11 @@
<GLButton type="primary" :size="size" fn="新建客户群群发" icon="el-icon-plus" @click="btnClick('create', 2)">新建群发</GLButton>
<div class="text">管理员或负责人统一创建内容,群主收到通知后,可选择他管理的客户群并群发。</div>
<div class="renews">
<div>
<div style="cursor:pointer;" @click="refreshData('2')">
<i class="el-icon-refresh-right"></i>
<span style="margin-right: 8px;">更新数据</span>
</div>
<span style="color: #999;">更新于 2022-8-4 10:24:44</span>
<span style="color: #999;" v-if="times">更新于 {{times}}</span>
</div>
</div>
<!-- 表格区域 开始 -->
......@@ -96,6 +96,9 @@ export default {
5: '链接'
}
return {
timeId: Function,
time:'',
times:'',
ATT_TYPE,
activeIndex: 1,
// 表格按钮
......@@ -328,20 +331,39 @@ export default {
},
mounted() {
// this.wxTips()
this.refreshData('1')
},
beforeDestroy() {
this.$message.closeAll()
},
methods: {
refreshData(type) {
clearTimeout(this.timeId)
this.timeId = setTimeout(() => {
this.$apis.customerTransform.renewDetailList({}).then(res => {
if(res.code == '0'){
if(type == 1) {
this.time = res.data.createdTime
this.$refs.customer.refreshTable()
} else if(type == 2) {
this.times = res.data.createdTime
this.$refs.customerGroup.refreshTable()
}
}
})
}, 1500)
},
switchMenu(val) {
this.$nextTick(() => {
this.activeIndex = val
if (val == 1) {
this.key = new Date()
if (this.$refs.customer) this.$refs.customer.refreshTable()
this.refreshData('1')
} else {
this.groupKey = new Date()
if (this.$refs.customerGroup) this.$refs.customerGroup.refreshTable()
this.refreshData('2')
}
})
},
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!