Commit 5e09a898 by jzou

'社区运营'

1 parent c9e5c2db
import request from '@/utils/request'
const service = window.CONFIG.services.wecom + '/communityGroupSop'
/**
* 获取群SOP列表
* @param {*} params
*
*/
export function getList(params) {
return request({
url: service + '/list',
method: 'get',
params,
})
}
/**
* 获取群SOP详情
* @param {*} params
*
*/
export function getDetail(id) {
return request({
url: service + '/' + id,
method: 'get',
})
}
/**
* 新增群SOP
* @param {Object} data
{
"ruleName": "string",
"groupIdList": [],
"title": "string",
"content": "string",
"materialIdList": [],
"startExeTime": "string",
"stopExeTime": "string",
}
*/
export function add(data) {
return request({
url: service + '/',
method: 'post',
data,
})
}
/**
* 修改群SOP
* @param {*} data
{
"ruleName": "string",
"groupIdList": [],
"title": "string",
"content": "string",
"materialIdList": [],
"startExeTime": "string",
"stopExeTime": "string",
}
*/
export function update(id, data) {
return request({
url: service + '/' + id,
method: 'put',
data,
})
}
/**
* 删除群SOP
* @param {*} ids
*/
export function remove(ids) {
return request({
url: service + '/' + ids,
method: 'DELETE',
})
}
import request from '@/utils/request'
const service = window.CONFIG.services.wecom + '/communityKeywordGroup'
/**
* 获取关键词拉群列表
* @param {*} params
*
*/
export function getList(params) {
return request({
url: service + '/list',
method: 'get',
params,
})
}
/**
* 获取关键词拉群详情
* @param {*} params
*
*/
export function getDetail(id) {
return request({
url: service + '/' + id,
method: 'get',
})
}
/**
* 新增关键词拉群
* @param {Object} data
{
"taskName": "string",
"groupCodeId": 0,
"welcomeMsg": "string",
"keywords": "string",
}
*/
export function add(data) {
return request({
url: service + '/',
method: 'post',
data,
})
}
/**
* 修改关键词拉群
* @param {*} data
{
"taskName": "string",
"groupCodeId": 0,
"welcomeMsg": "string",
"keywords": "string",
}
*/
export function update(id, data) {
return request({
url: service + '/' + id,
method: 'put',
data,
})
}
/**
* 删除关键词拉群
* @param {*} ids
*/
export function remove(ids) {
return request({
url: service + '/' + ids,
method: 'DELETE',
})
}
import request from '@/utils/request'
const service = window.CONFIG.services.wecom + '/communityPresTagGroup'
/**
* 获取老客标签建群列表
* @param {*} params
*
*/
export function getList(params) {
return request({
url: service + '/list',
method: 'get',
params,
})
}
/**
* 获取老客标签建群详情
* @param {*} params
* id: 老客标签建群任务ID
*/
export function getDetail(id) {
return request({
url: service + '/' + id,
method: 'get',
})
}
/**
* 新增老客标签建群
* @param {Object} data
{
"taskName": "string",
"welcomeMsg": "string",
"sendType": 0,
"groupCodeId": "string",
"weOldGroupTagList": [],
"weOldGroupUseScopeList": [],
"sendScope": 0,
"sendGender": 0,
"cusBeginTime": "string",
"cusEndTime": "string",
}
*/
export function add(data) {
return request({
url: service + '/',
method: 'post',
data,
})
}
/**
* 修改老客标签建群
* @param {*} data
{
"taskName": "string",
"welcomeMsg": "string",
"sendType": 0,
"groupCodeId": "string",
"weOldGroupTagList": [],
"weOldGroupUseScopeList": [],
"sendScope": 0,
"sendGender": 0,
"cusBeginTime": "string",
"cusEndTime": "string",
}
*/
export function update(id, data) {
return request({
url: service + '/' + id,
method: 'put',
data,
})
}
/**
* 删除老客标签建群
* @param {*} ids
*/
export function remove(ids) {
return request({
url: service + '/' + ids,
method: 'DELETE',
})
}
/**
* 客户统计
* @param {*} params
* id: 老客标签建群任务ID
*/
export function getStat(id, params) {
return request({
url: service + '/stat/' + id,
method: 'get',
params,
})
}
\ No newline at end of file
......@@ -10,6 +10,14 @@ export default {
type: Boolean,
default: false,
},
imageList: {
type: Array,
default: () => []
},
messageList: {
type: Array,
default: () => []
}
},
data() {
return {}
......@@ -46,6 +54,26 @@ export default {
<slot></slot>
</div>
</li>
<li class="flex msg-li" v-for="message in messageList" :key="message">
<el-avatar
shape="square"
size="small"
:src="require('@/assets/image/profile.jpg')"
></el-avatar>
<div class="msg">
<slot name="text" v-bind:text="message"></slot>
</div>
</li>
<li class="flex msg-li" v-for="image in imageList" :key="image">
<el-avatar
shape="square"
size="small"
:src="require('@/assets/image/profile.jpg')"
></el-avatar>
<div class="msg" style="line-height: 0; padding: 5px;">
<slot name="image" v-bind:image="image"></slot>
</div>
</li>
</ul>
</div>
</template>
......
<script>
import { getList } from '@/api/customer/group'
export default {
components: {},
props: {
// 选择客户群聊显隐
visible: {
type: Boolean,
default: false,
},
title: {
type: String,
default: '选择客户群聊',
},
// 多选
multiSelect: {
type: Boolean,
default: false
},
selected: {
type: Array,
default: () => [],
},
},
data() {
return {
loading: true, // 遮罩层
query: {
pageNum: 1,
pageSize: 10,
groupLeader: '',
groupName: '',
beginTime: '',
endTime: '',
},
list: [], // 列表
total: 0, // 总条数
selectedGroup: '',
multiSelectedGroups: [],
}
},
watch: {
selected (val) {
this.setSelected()
},
list (val) {
this.setSelected()
}
},
computed: {
Pvisible: {
get() {
return this.visible
},
set(val) {
this.$emit('update:visible', val)
},
},
},
created() {
this.getList()
},
mounted() {},
methods: {
// 获取列表
getList(page) {
page && (this.query.pageNum = page)
this.loading = true
getList(this.query)
.then(({ rows, total }) => {
this.list = rows
this.total = +total
this.loading = false
})
.catch(() => {
this.loading = false
})
},
submit() {
this.Pvisible = false
this.$emit('success', this.multiSelect ? this.multiSelectedGroups : this.selectedGroup)
},
setSelected () {
if (!this.selected.length) return
this.list.forEach((code) => {
if (code.id == this.selected[0].id) {
this.selectedGroup = code
}
})
},
handleSelectionChange (val) {
this.multiSelectedGroups = val
}
},
}
</script>
<template>
<el-dialog
:title="title"
:visible.sync="Pvisible"
width="650px"
append-to-body
>
<div>
<el-form ref="form" :model="query" label-width="">
<el-form-item label="">
<el-input
v-model="query.groupName"
class="ml10 mr10"
style="width: 150px;"
placeholder="请输入群名"
@keydown.enter="getList(1)"
clearable
@clear="getList(1)"
></el-input>
<el-button
v-hasPermi="['contacts:organization:query']"
icon="el-icon-search"
circle
@click="getList(1)"
></el-button>
<el-pagination
class="fr"
@current-change="getList"
:current-page="query.pageNum"
:page-size="query.pageSize"
layout="prev, pager, next"
:total="total"
></el-pagination>
</el-form-item>
</el-form>
<el-table :data="list" v-loading="loading" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="50" align="center" v-if="multiSelect"/>
<el-table-column width="30" v-else>
<template slot-scope="scope">
<el-radio v-model="selectedGroup" :label="scope.row">'</el-radio>
</template>
</el-table-column>
<el-table-column
prop="groupName"
label="群名"
align="center"
></el-table-column>
<el-table-column
prop="memberNum"
label="群人数"
align="center"
>
</el-table-column>
<el-table-column
prop="groupLeaderName"
label="群主"
align="center"
></el-table-column>
<el-table-column
prop="createTime"
label="创建时间"
align="center"
></el-table-column>
</el-table>
</div>
<div slot="footer">
<el-button @click="Pvisible = false">取 消</el-button>
<el-button type="primary" @click="submit">确 定</el-button>
</div>
</el-dialog>
</template>
<style lang="scss" scoped>
.code-image {
width: 200px;
height: 200px;
}
.code-image--small {
width: 50px;
height: 50px;
}
.expire-icon {
color: red;
}
</style>
......@@ -34,7 +34,14 @@ export default {
radio: '',
}
},
watch: {},
watch: {
selected (val) {
this.setSelected()
},
list (val) {
this.setSelected()
}
},
computed: {
Pvisible: {
get() {
......@@ -68,6 +75,15 @@ export default {
this.Pvisible = false
this.$emit('success', this.radio)
},
setSelected () {
if (!this.selected.length) return
this.list.forEach((code) => {
if (code.id == this.selected[0].id) {
this.radio = code
}
})
}
},
}
</script>
......
......@@ -51,6 +51,20 @@ export default {
}
// this.list = JSON.parse(JSON.stringify(this.list))
},
list (val) {
if (this.type === 'add') {
this.Pselected = []
this.selected.forEach((element) => {
let find = this.listOneArray.find((d) => {
return element.tagId === d.tagId
})
this.Pselected.push(find)
})
} else if (this.type === 'remove') {
this.removeTag = this.selected.slice()
this.Pselected = this.selected.slice()
}
}
},
computed: {
Pvisible: {
......
......@@ -231,7 +231,7 @@ export default {
methods: {
// 新增群活码
add () {
this.$refs.form.validate(async (valid) => {
this.$refs.form.validate((valid) => {
if (!valid) return
// 用来区分群活码,生成的二维码需要带有唯一区分信息,所以由前端生成
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!