提交 2c2a3679 编写于 作者: X xinla

群发消息同步

上级 5a82af68
import request from "@/utils/request"; import request from '@/utils/request'
const service = window.CONFIG.services.wecom + "/customerMessagePush"; const service = window.CONFIG.services.wecom + '/customerMessagePush'
/** /**
* 新增企业id * 新增企业id
...@@ -35,10 +35,10 @@ const service = window.CONFIG.services.wecom + "/customerMessagePush"; ...@@ -35,10 +35,10 @@ const service = window.CONFIG.services.wecom + "/customerMessagePush";
*/ */
export function add(data) { export function add(data) {
return request({ return request({
url: service + "/add", url: service + '/add',
method: "post", method: 'post',
data data,
}); })
} }
/** /**
...@@ -53,9 +53,9 @@ endTime:结束时间} ...@@ -53,9 +53,9 @@ endTime:结束时间}
*/ */
export function getList(params) { export function getList(params) {
return request({ return request({
url: service + "/list", url: service + '/list',
params params,
}); })
} }
/** /**
...@@ -64,9 +64,9 @@ export function getList(params) { ...@@ -64,9 +64,9 @@ export function getList(params) {
*/ */
export function getDetail(messageId) { export function getDetail(messageId) {
return request({ return request({
url: service + "/getInfo", url: service + '/getInfo',
params: { messageId } params: { messageId },
}); })
} }
/** /**
...@@ -77,7 +77,21 @@ status:发送状态 0-未发送 1-已发送 2-因客户不是好友导致发送 ...@@ -77,7 +77,21 @@ status:发送状态 0-未发送 1-已发送 2-因客户不是好友导致发送
*/ */
export function getPushResult(params) { export function getPushResult(params) {
return request({ return request({
url: service + "/pushResults", url: service + '/pushResults',
params params,
}); })
}
/**
* 同步消息发送结果
* @param {*} data
* msgid:列表msgid
messageId:消息id
*/
export function syncMsg(data) {
return request({
url: service + '/asyncResult',
method: 'post',
data,
})
} }
<script> <script>
import { getList } from "@/api/groupMessage"; import { getList, syncMsg } from '@/api/groupMessage'
export default { export default {
name: "Operlog", name: 'Operlog',
filters: { filters: {
sendInfo(data) { sendInfo(data) {
if (data.timedTask == 1) { if (data.timedTask == 1) {
return "定时任务 发送时间:" + data.settingTime; return '定时任务 发送时间:' + data.settingTime
} else { } else {
let unit = data.expectSend == 1 ? "个群" : ""; let unit = data.expectSend == 1 ? '个群' : ''
return `预计发送${data.expectSend}${unit},已成功发送${data.actualSend}${unit}`; return `预计发送${data.expectSend}${unit},已成功发送${data.actualSend}${unit}`
} }
} },
}, },
data() { data() {
return { return {
...@@ -32,78 +32,91 @@ export default { ...@@ -32,78 +32,91 @@ export default {
content: undefined, content: undefined,
pushType: undefined, pushType: undefined,
beginTime: undefined, beginTime: undefined,
endTime: undefined endTime: undefined,
}, },
pushType: { pushType: {
0: "发给客户", 0: '发给客户',
1: "发给客户群" 1: '发给客户群',
}, },
pickerOptions: { pickerOptions: {
disabledDate(time) { disabledDate(time) {
return time.getTime() > Date.now(); // 选当前时间之前的时间 return time.getTime() > Date.now() // 选当前时间之前的时间
} },
} },
}; }
}, },
created() { created() {
this.getList(); this.getList()
}, },
methods: { methods: {
getList(page) { getList(page) {
if (this.dateRange[0]) { if (this.dateRange[0]) {
this.query.beginTime = this.dateRange[0]; this.query.beginTime = this.dateRange[0]
this.query.endTime = this.dateRange[1]; this.query.endTime = this.dateRange[1]
} else { } else {
this.query.beginTime = ""; this.query.beginTime = ''
this.query.endTime = ""; this.query.endTime = ''
} }
page && (this.query.pageNum = page); page && (this.query.pageNum = page)
this.loading = true; this.loading = true
getList(this.query) getList(this.query)
.then(({ rows, total }) => { .then(({ rows, total }) => {
this.list = rows; this.list = rows
this.total = +total; this.total = +total
this.loading = false; this.loading = false
this.ids = []; this.ids = []
}) })
.catch(() => { .catch(() => {
this.loading = false; this.loading = false
}); })
}, },
/** 重置按钮操作 */ /** 重置按钮操作 */
resetQuery() { resetQuery() {
this.dateRange = []; this.dateRange = []
this.$refs["queryForm"].resetFields(); this.$refs['queryForm'].resetFields()
this.getList(1); this.getList(1)
}, },
// 多选框选中数据 // 多选框选中数据
handleSelectionChange(selection) { handleSelectionChange(selection) {
this.ids = selection.map(item => item.id); this.ids = selection.map((item) => item.id)
}, },
/** 删除按钮操作 */ /** 删除按钮操作 */
handleDelete(row) { handleDelete(row) {
const operIds = row.operId || this.ids; const operIds = row.operId || this.ids
this.$confirm( this.$confirm(
'是否确认删除日志编号为"' + operIds + '"的数据项?', '是否确认删除日志编号为"' + operIds + '"的数据项?',
"警告", '警告',
{ {
confirmButtonText: "确定", confirmButtonText: '确定',
cancelButtonText: "取消", cancelButtonText: '取消',
type: "warning" type: 'warning',
} }
) )
.then(function() {}) .then(function() {})
.then(() => { .then(() => {
this.getList(); this.getList()
this.msgSuccess("删除成功"); this.msgSuccess('删除成功')
}) })
.catch(function() {}); .catch(function() {})
}, },
goRoute(id, path) { goRoute(id, path) {
this.$router.push({ path: "/groupMessage/" + path, query: { id } }); this.$router.push({ path: '/groupMessage/' + path, query: { id } })
} },
} syncMsg(data) {
}; let { msgid, messageId } = data
syncMsg({ msgid, messageId })
.then(({ data }) => {
// this.list = rows
// this.total = +total
// this.loading = false
// this.ids = []
})
.catch(() => {
this.loading = false
})
},
},
}
</script> </script>
<template> <template>
<div> <div>
...@@ -188,7 +201,6 @@ export default { ...@@ -188,7 +201,6 @@ export default {
v-hasPermi="['enterpriseWechat:view']" v-hasPermi="['enterpriseWechat:view']"
size="mini" size="mini"
type="text" type="text"
icon="el-icon-view"
@click="goRoute(scope.row.messageId, 'detail')" @click="goRoute(scope.row.messageId, 'detail')"
>查看</el-button >查看</el-button
> >
...@@ -196,11 +208,17 @@ export default { ...@@ -196,11 +208,17 @@ export default {
v-hasPermi="['enterpriseWechat:edit']" v-hasPermi="['enterpriseWechat:edit']"
size="mini" size="mini"
type="text" type="text"
icon="el-icon-edit"
disabled="" disabled=""
@click="goRoute(scope.row, 1)" @click="goRoute(scope.row, 1)"
>编辑</el-button >编辑</el-button
> >
<el-button
v-hasPermi="['enterpriseWechat:edit']"
size="mini"
type="text"
@click="syncMsg(scope.row)"
>同步</el-button
>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册