Commit 9a67f44a by 匡雅琴

群发、人群

1 parent 5e6e087b
import { http, http_common, http2, http_merchant } from '@/main'
const defaultPath = 'scrm.api.carlife.'
const getMerchantGoodsListApi = params => {
params.method = 'scrm.api.shopmall.goods.page.curMerchant'
return http({
url: 'rop-scrm-shopmall/router',
method: 'GET',
data: params,
sign: true
})
}
const getGoodsListApi = params => {
// scrm.api.shopmall.goods.getGoodsList
params.method = 'scrm.api.shopmall.goods.getGoodsList'
return http({
url: 'rop-scrm-shopmall/router',
method: 'GET',
data: params,
sign: true
})
}
const uploadImgApi = params => {
params.method = `${defaultPath}common.uploadImg`
return http({
url: 'rop-scrm-carlife/router',
method: 'POST',
data: params,
sign: true,
noSignAttr: ['file']
})
}
const uploadMusicApi = params => {
params.method = 'scrm.api.carlife.common.uploadMusic'
return http({
url: 'rop-scrm-carlife/router',
method: 'POST',
data: params,
sign: true,
noSignAttr: ['file']
})
}
const uploadVideoApi = params => {
params.method = `${defaultPath}common.uploadVideo`
return http({
url: 'rop-scrm-carlife/router',
method: 'POST',
data: params,
sign: true,
noSignAttr: ['file']
})
}
const uploadFundingVideoApi = params => {
params.method = 'scrm.api.carlife.crowd.funding.uploadVideo'
return http({
url: 'rop-scrm-carlife/router',
method: 'POST',
data: params,
sign: true,
noSignAttr: ['file']
})
}
const getMerchantList = params => {
params.method = `${defaultPath}merchant.listWithPageByCurMerchant`
return http({
url: 'rop-scrm-carlife/router',
method: 'POST',
data: params,
sign: true
})
}
const getSimpleMerchantList = params => {
params.method = 'scrm.api.carlife.merchant.listWithPageSimpleByCurMerchant'
return http({
url: 'rop-scrm-carlife/router',
method: 'POST',
data: params,
sign: true
})
}
const getZoneListApi = params => {
params.method = 'scrm.api.shopmall.zoneInfo.listCurMerchantId'
return http({
url: 'rop-scrm-shopmall/router',
method: 'POST',
data: params,
sign: true
})
}
const getClassifyListApi = params => {
params.method = 'scrm.api.shopmall.classify.list.curMerchant'
return http({
url: 'rop-scrm-shopmall/router',
method: 'POST',
data: params,
sign: true
})
}
const pictureUpload = params => {
params.method = 'glsx.accounts.biz.common.pictureUpload'
return http_common({
url: '/router?method=glsx.accounts.biz.common.pictureUpload',
method: 'POST',
data: params,
sign: true,
noSignAttr: ['file']
})
}
const querylabeltree = params => {
params.method = 'scrm.api.datahub.labelgroup.queryLabelTree'
// params.sessionId = session
return http2({
url: '/rop-scrm-datahub/router',
method: 'POST',
data: params,
sign: true
})
}
// 人群列表
const getCrowdTreeListApi = params => {
params.method = 'scrm.api.datahub.user.queryCrowdTree'
return http2({
url: '/rop-scrm-datahub/router',
method: 'POST',
data: params,
sign: true
})
}
// 跟进员工类型
const getStaffFollowerListApi = params => {
params.method = 'entmicro.api.staff.listEntFollowerType'
return http({
url: '/rop-scrm-entmicro/router',
method: 'POST',
data: params,
sign: true
})
}
// 获取商户信息
const getMerchantInfoApi = params => {
params.method = 'merchants.api.merchant.findMerchantBaseInfo'
return http_merchant({
url: '/rop-merchants/router',
method: 'POST',
data: params,
sign: true
})
}
export default { getMerchantGoodsListApi, getGoodsListApi, uploadImgApi, uploadMusicApi, uploadVideoApi, uploadFundingVideoApi, getMerchantList, getSimpleMerchantList, getZoneListApi, getClassifyListApi, pictureUpload, querylabeltree, getCrowdTreeListApi, getStaffFollowerListApi, getMerchantInfoApi }
import { http, http2 } from '@/main'
const path = 'entmicro.api.mass.'
const URL = 'rop-scrm-entmicro/router'
const querylabeltree = params => {
params.method = 'scrm.api.datahub.labelgroup.queryLabelTree'
return http({
url: '/rop-scrm-datahub/router',
method: 'POST',
data: params,
sign: true
})
}
const queryCrowdtree = params => {
params.method = 'scrm.api.datahub.user.queryCrowdTree'
return http({
url: 'rop-scrm-datahub/router',
method: 'POST',
data: params,
sign: true
})
}
const customerCount = params => {
params.method = 'entmicro.api.mass.detail.customer.filter.count'
// return http({
return http({
url: URL,
method: 'POST',
data: params,
sign: true
})
}
export default {
querylabeltree,
queryCrowdtree,
customerCount
}
......@@ -18,8 +18,8 @@ export const fetchConfig = function(isEnv = true) {
// return Promise.resolve(cfg)
// }
//return window.fetch('https://', {}).then(res => res.json())
// return new Http().get('https://oss-config.test.glsx.com.cn/mock/6215f98e60f415276f6dfe56/authorize/config')
return new Http().get('https://oss-config.dev.glsx.com.cn/mock/6215f98e60f415276f6dfe56/authorize/config')
return new Http().get('https://oss-config.test.glsx.com.cn/mock/6215f98e60f415276f6dfe56/authorize/config')
// return new Http().get('https://oss-config.dev.glsx.com.cn/mock/6215f98e60f415276f6dfe56/authorize/config')
}
export const config = {
install(vue, cfg) {
......
......@@ -16,6 +16,9 @@
<i class="el-icon-plus"></i>
选择门店
</el-button>
<div v-show="basicForm.selectStore" class="el-input-tag input-tag-wrapper">
<el-tag :size="size" type="info" closable :disable-transitions="false">{{ basicForm.selectStore }}</el-tag>
</div>
</el-form-item>
<el-form-item label="选择客户:" prop="selectType">
<el-radio-group @change="radioChange" v-model="basicForm.selectType">
......@@ -24,20 +27,41 @@
</el-radio-group>
<div class="filter-box" v-show="basicForm.selectType == 1">
<div class="filter-memeber">
<el-button size="small" @click="openLabel">
<i class="el-icon-plus"></i>
标签
</el-button>
<div v-show="tagging.length != 0" class="el-input-tag input-tag-wrapper">
<span v-for="(tag, idx) in tagging" :key="idx">
<el-tag v-for="(tagItem, idx1) in tag.labelList" :key="idx1" :size="size" type="info" closable :disable-transitions="false" @close="removeTag(tag, idx1, idx)">{{ tagItem.name }}</el-tag>
</span>
</div>
<div>
查看预计群发人数
<el-button type="text" v-show="isUpdate" :loading="viewLoading" @click="viewMembers">查看</el-button>
<span v-show="!isUpdate">{{ groupNumber }}</span>
</div>
<el-form :model="basicForm.condition" label-width="154px">
<el-form-item label="性别:">
<el-radio-group v-model="basicForm.condition.sex" @change="valueChange">
<el-radio label>全部</el-radio>
<el-radio :label="1">男性</el-radio>
<el-radio :label="2">女性</el-radio>
<el-radio :label="0">未知性别</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item label="所在群聊:">
<el-select v-model="basicForm.condition.chat" @change="valueChange" @focus="groupFocus" :size="size" value-key="id" multiple collapse-tags placeholder="请选择">
<el-option v-for="item in groupList" :key="item.id" :label="item.groupName" :value="item"></el-option>
</el-select>
</el-form-item>
<el-form-item label="添加客户时间:">
<el-date-picker v-model="basicForm.condition.date" @change="valueChange" type="daterange" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" :size="size" style="width: 320px"></el-date-picker>
</el-form-item>
<el-form-item label="标签筛选:">
<el-button size="small" @click="openLabel">
<i class="el-icon-plus"></i>
标签筛选
</el-button>
<div v-show="tagging.length != 0" :key="key" class="el-input-tag input-tag-wrapper">
<span v-for="(tag, idx) in tagging" :key="idx">
<el-tag v-for="(tagItem, idx1) in tag.labelList" :key="idx1" :size="size" type="info" closable :disable-transitions="false" @close="removeTag(tag, idx1, idx)">{{ tagItem.name }}</el-tag>
</span>
</div>
<!-- <div class="sale-select" v-show="basicForm.condition.labelList">
<div :key="key" class="el-input-tag input-tag-wrapper">
<el-tag v-for="(tag, idx) in basicForm.condition.labelList" :key="idx" :size="size" type="info" closable :disable-transitions="false" @close="remove(tag)">{{ tag.staffName }}</el-tag>
<el-input size="small" style="outline: none; border: none"></el-input>
</div>
</div> -->
</el-form-item>
</el-form>
</div>
</div>
<div v-show="basicForm.selectType == 2" style="line-height: 32px; padding-bottom: 10px">
......@@ -50,7 +74,7 @@
</div>
</div>
</div>
<div v-show="basicForm.selectType == 3" class="crowd-tips">人群标签存在重复客户,群发人数会自动去重。若一个客户有多个成员添加,可手动在群发账号中删除多余成员。</div>
<div v-show="basicForm.selectType == 2" class="crowd-tips">人群标签存在重复客户,群发人数会自动去重。若一个客户有多个成员添加,可手动在群发账号中删除多余成员。</div>
<div class="filter-footer">
<div class="filter-number">
查看预计群发人数
......@@ -74,17 +98,6 @@
<span>每位客户每天可接收1条群发消息,超过接收上限的客户将无法再收到群发消息。</span>
<!-- <span v-if="form == 'customerGroup'">每个客户群每天可接收1条群发消息,超过接收上限的客户群将无法再收到群发消息。</span> -->
</div>
<el-form-item label="发送时间:" prop="sendType">
<el-radio-group v-model="basicForm.sendType">
<el-radio :label="1">立即发送</el-radio>
<el-radio :label="2">定时发送</el-radio>
</el-radio-group>
<div v-show="basicForm.sendType == 2" class="date-picker">
<el-date-picker v-model="basicForm.sendTime" size="small" type="date" value-format="yyyy-MM-dd" placeholder="选择日期" :picker-options="dateOptions" @change="changeValue"></el-date-picker>
-
<el-time-picker v-model="basicForm.sendDate" size="small" value-format="HH:mm:ss" placeholder="选择时间" :picker-options="timeOptions"></el-time-picker>
</div>
</el-form-item>
</el-form>
</div>
</div>
......@@ -93,12 +106,12 @@
</div>
</div>
</div>
<GLDialog :bigTitle="'选择成员'" mode="big" :visible.sync="membersVisible" @onOk="handleConfirm" @onCancel="membersVisible = !membersVisible">
<!-- <GLDialog :bigTitle="'选择成员'" mode="big" :visible.sync="membersVisible" @onOk="handleConfirm" @onCancel="membersVisible = !membersVisible">
<SelectMember ref="membersForm" v-if="membersVisible" :selectData="selectData"></SelectMember>
</GLDialog>
</GLDialog> -->
</div>
<GLFooter>
<el-button type="primary" v-loading="addLoading" @click="handleSubmit">确定</el-button>
<el-button type="primary" v-loading="addLoading" @click="handleSubmit">发送</el-button>
<el-button @click="handleCancel">取消</el-button>
</GLFooter>
<SelectStore ref="SelectStore" @crowdData="getCrowdData" :storeDiaVisible="storeDiaVisible"></SelectStore>
......@@ -112,7 +125,6 @@ const combineType = {
label: 2,
crowd: 1
}
import Vue from 'vue'
import emoji from '@/utils/emo'
import SelectCrowd from './components/selectCrowd.vue'
import SelectLabel from './components/SelectLabel.vue'
......@@ -166,8 +178,9 @@ export default {
}
}
return {
// 新建按钮加载
addLoading: false,
eventBus: new Vue(),
// 标签/人群筛选数组
taggingList: [],
btnList: [
{
......@@ -280,6 +293,7 @@ export default {
],
basicForm: {
sendName: '',
selectStore: '',
selectType: 1,
condition: {
sex: '',
......@@ -301,7 +315,7 @@ export default {
{ validator: validatorSendType, trigger: 'change' }
]
},
membersVisible: false,
// membersVisible: false,
groupList: [],
// key: new Date(),
dialogVisible: false,
......@@ -342,7 +356,7 @@ export default {
deep: true
},
'basicForm.selectType'(newVal, oldVal) {
if (oldVal == 3 || newVal == 3) {
if (oldVal == 2 || newVal == 2) {
this.basicForm.userList = []
this.selectData = []
this.basicForm.crowdList = []
......@@ -356,9 +370,9 @@ export default {
this.boxHeight = clientHeight - 200
},
methods: {
openMembers() {
this.membersVisible = !this.membersVisible
},
// openMembers() {
// this.membersVisible = !this.membersVisible
// },
// 预览回显事件
previewForm(val) {
console.log(val)
......@@ -366,6 +380,7 @@ export default {
if (value[0] && !value[0].attContent) value.splice(0, 1)
this.previewVal = value
},
// 返回
handleCancel() {
if (this.editStatus || this.$refs.welcome.previewList.length > 0) {
this.$confirm('当前有内容信息未保存,是否继续返回?', '提示', {
......@@ -374,52 +389,62 @@ export default {
type: 'warning'
})
.then(() => {
this.$router.push('/customerTransform/index')
this.$router.push('/wechatGroup/index')
})
.catch(() => {})
} else {
this.$router.push('/customerTransform/index')
this.$router.push('/wechatGroup/index')
}
},
// 成员弹窗
handleConfirm() {
console.log(this.$refs.membersForm.innerTags)
if (this.$refs.membersForm.innerTags.length) {
// this.basicForm.userList = this.$refs.membersForm.innerTags
this.$set(this.basicForm, 'userList', this.$refs.membersForm.innerTags)
this.selectData = this.basicForm.userList
this.openMembers()
this.isUpdate = true
this.editStatus = true
} else {
// handleConfirm() {
// console.log(this.$refs.membersForm.innerTags)
// if (this.$refs.membersForm.innerTags.length) {
// // this.basicForm.userList = this.$refs.membersForm.innerTags
// this.$set(this.basicForm, 'userList', this.$refs.membersForm.innerTags)
// this.selectData = this.basicForm.userList
// this.openMembers()
// this.isUpdate = true
// this.editStatus = true
// } else {
// this.$message({
// type: 'error',
// message: '请选择成员'
// })
// }
// },
// 移除成员tag标签
// remove(val, idx) {
// if (this.$refs.membersForm) {
// this.$refs.membersForm.remove(val)
// this.$set(this.basicForm, 'userList', this.$refs.membersForm.innerTags)
// // this.key = new Date()
// } else {
// this.basicForm.userList.splice(idx, 1)
// this.selectData = this.basicForm.userList
// // this.key = new Date()
// }
// if (this.basicForm.selectType == 2) {
// if (!this.basicForm.userList.length) {
// this.basicForm.crowdList = []
// this.isSelectCrowd = false
// }
// }
// this.isUpdate = true
// },
// 打开标签筛选弹框
openLabel() {
if (!this.basicForm.selectStore) {
this.$message({
type: 'error',
message: '请选择成员'
message: '请先选择门店'
})
return
}
},
remove(val, idx) {
if (this.$refs.membersForm) {
this.$refs.membersForm.remove(val)
this.$set(this.basicForm, 'userList', this.$refs.membersForm.innerTags)
// this.key = new Date()
} else {
this.basicForm.userList.splice(idx, 1)
this.selectData = this.basicForm.userList
// this.key = new Date()
}
if (this.basicForm.selectType == 3) {
if (!this.basicForm.userList.length) {
this.basicForm.crowdList = []
this.isSelectCrowd = false
}
}
this.isUpdate = true
},
openLabel() {
this.dialogVisible = !this.dialogVisible
this.$refs.selectLabel.init(this.tagging)
},
// 提交
handleSubmit() {
this.$refs.basicForm.validate(valid => {
if (valid) {
......@@ -439,7 +464,7 @@ export default {
return (this.attachmentText = '请输入群发内容')
}
console.log(this.basicForm)
if (this.basicForm.selectType == 3 && !this.basicForm.crowdList.length) {
if (this.basicForm.selectType == 2 && !this.basicForm.crowdList.length) {
return this.$message({
type: 'error',
message: '请选择人群'
......@@ -497,7 +522,7 @@ export default {
})
}
this.addLoading = false
this.$router.push('/customerTransform/index')
this.$router.push('/wechatGroup/index')
})
} else {
this.$message({
......@@ -510,6 +535,7 @@ export default {
}
})
},
// 选择标签
handleSelect(val) {
this.isUpdate = true
this.tagging = val
......@@ -530,7 +556,7 @@ export default {
console.log(val, '1')
console.log(this.tagging, '2')
},
// 删除标签
// 删除标签筛选标签
removeTag(tag, idx1, idx) {
console.log(tag, 'tag')
tag.labelList.splice(idx1, 1)
......@@ -552,10 +578,10 @@ export default {
this.taggingList = arr
this.isUpdate = true
},
// 删除人群
// 删除人群筛选标签
removeCrowd(item, index) {
this.basicForm.crowdList.splice(index, 1)
this.getCrowdData(this.basicForm.crowdList)
// this.getCrowdData(this.basicForm.crowdList)
if (!this.basicForm.crowdList.length) {
this.basicForm.userList = []
this.selectData = this.basicForm.userList
......@@ -564,9 +590,11 @@ export default {
}
this.key = new Date()
},
// 标签筛选选择切换
valueChange(val) {
this.isUpdate = true
},
// 获取所在群聊信息
getGroupList() {
if (this.basicForm.userList && this.basicForm.userList.length != 0) {
const staffIds = this.basicForm.userList.map(item => item.staffId)
......@@ -580,11 +608,12 @@ export default {
})
}
},
// 获取选择客户筛选信息
getSiftMembers() {
const params = {
selectType: this.basicForm.selectType
}
if (params.selectType == 2) {
if (params.selectType == 1) {
const chatFlag = this.basicForm.condition.chat && this.basicForm.condition.chat.length
params.condition = {
sex: this.basicForm.condition.sex,
......@@ -599,7 +628,7 @@ export default {
params.condition.sTime = dayjs(this.basicForm.condition.date[0]).format('YYYY-MM-DD')
params.condition.eTime = dayjs(endTime).format('YYYY-MM-DD')
}
} else if (params.selectType == 3) {
} else if (params.selectType == 2) {
params.crowdCondition = this.basicForm.crowdList
params.combineType = combineType.crowd
}
......@@ -615,7 +644,7 @@ export default {
// 查看群发人数
viewMembers() {
if (!this.basicForm.userList || this.basicForm.userList.length == 0) {
if (this.basicForm.selectType == 3) {
if (this.basicForm.selectType == 2) {
this.$message({
type: 'error',
message: '请选择人群'
......@@ -637,7 +666,7 @@ export default {
}
const params = this.getSiftMembers()
this.viewLoading = true
this.$apis.customerTransform
this.$apis.wechatGroup
.customerCount(params)
.then(res => {
console.log(res)
......@@ -691,36 +720,42 @@ export default {
},
// 人群筛选弹窗
selectCrowd() {
console.log(1)
this.$refs.selectCrowd.init(this.basicForm.crowdList)
},
// 获取人群数据
getCrowdData(val) {
if (val.length) {
this.isSelectCrowd = true
this.basicForm.crowdList = val
const params = {
combineType: combineType.crowd,
crowdCondition: val
}
this.$apis.customerTransform.followerEcho(params).then(res => {
console.log(res)
this.$set(this.basicForm, 'userList', res)
this.selectData = this.basicForm.userList
this.key = new Date()
this.isUpdate = true
this.editStatus = true
if (!this.basicForm.selectStore) {
this.$message({
type: 'error',
message: '请先选择门店'
})
} else {
this.basicForm.userList = []
this.basicForm.crowdList = []
this.selectData = []
this.isSelectCrowd = false
this.isUpdate = true
this.editStatus = true
this.key = new Date()
return
}
this.$refs.selectCrowd.init(this.basicForm.crowdList)
},
// 获取人群数据(根据人群筛选获取群发账号人群数据)
// getCrowdData(val) {
// if (val.length) {
// this.isSelectCrowd = true
// this.basicForm.crowdList = val
// const params = {
// combineType: combineType.crowd,
// crowdCondition: val
// }
// this.$apis.customerTransform.followerEcho(params).then(res => {
// console.log(res)
// this.$set(this.basicForm, 'userList', res)
// this.selectData = this.basicForm.userList
// this.key = new Date()
// this.isUpdate = true
// this.editStatus = true
// })
// } else {
// this.basicForm.userList = []
// this.basicForm.crowdList = []
// this.selectData = []
// this.isSelectCrowd = false
// this.isUpdate = true
// this.editStatus = true
// this.key = new Date()
// }
// },
// 打开选择门店弹框
openStore() {
this.storeDiaVisible = !this.storeDiaVisible
......
......@@ -97,7 +97,7 @@ export default {
},
querylabeltree(selectItem) {
this.loading = true
this.$apis.customerTransform
this.$apis.wechatGroup
.querylabeltree({
labelTreeReq: {
pageNum: 1,
......
......@@ -94,9 +94,7 @@ export default {
this.innerTags = this.$common.utils.deepClone(val)
this.crowdVisible = true
this.searchForm.keyword = ''
console.log(this.$refs.crowdTable, '==')
this.$nextTick(() => {
console.log(this.$refs.crowdTable, '==')
this.$refs.crowdTable.$refs.crowdlistMutiTable.clearSelection()
this.$refs.crowdTable.page.pageNum = 1
this.getCrowdList()
......@@ -114,7 +112,7 @@ export default {
pageNum: page.pageNum
}
}
this.$apis.customerTransform.queryCrowdtree(params).then(res => {
this.$apis.wechatGroup.queryCrowdtree(params).then(res => {
this.tableData = res.crowdUnitList
this.tableTotal = res.total
// console.log(this.inner)
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!