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

群发消息同步

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