Commit 03c5a789 by 前端

Merge branch 'v3.4.0' into 'master'

合并V3.4.0

See merge request !56
2 parents 9e5157be e1805a59
......@@ -56,10 +56,21 @@ const compressionUpload = params => {
sign: false
})
}
const sendStop = params => {
params.method = 'entmicro.api.wechatcloudcontrol.batchmoment.send.stop'
return http({
url: '/rop-scrm-entmicro/router',
method: 'POST',
data: params,
sign: true,
returnAll:true
})
}
export default {
merchantList,
conditionPage,
batchmomentRecord,
batchmomentSave,
compressionUpload
compressionUpload,
sendStop
}
......@@ -71,7 +71,16 @@ const recordSend = params => {
sign: true
})
}
const sendStop = params => {
params.method = 'entmicro.api.wechatcloudcontrol.batchmessaging.send.stop'
return http({
url: URL,
method: 'POST',
data: params,
sign: true,
returnAll:true
})
}
export default {
......@@ -81,5 +90,6 @@ export default {
batchmessagingCustomercount,
atchmessagingCreate,
getStoreList,
recordSend
recordSend,
sendStop
}
......@@ -195,6 +195,17 @@ export default {
})
})
},
openLabel() {
if (!this.basicForm.selectStore) {
this.$message({
type: 'error',
message: '请先选择门店'
})
return
}
this.dialogVisible = !this.dialogVisible
this.$refs.selectLabel.init(this.tagging)
},
handleClose() {
this.labelTreeRetSelect = []
this.dialogVisible = false
......
import * as dayjs from "dayjs";
export default {
data() {
return {
groupNumber: 0,
viewLoading: false,
isUpdate: true,
dateOptions: {
disabledDate(time) {
let now = new Date()
now.setTime(now.getTime() - 3600 * 1000 * 24)
return time.getTime() < now
}
},
timeOptions: {
selectableRange: '00:00:00 - 23:59:59'
},
}
},
watch: {
basicForm: {
handler(val) {
if (this.firstFlag) {
this.firstFlag = false
} else {
this.editStatus = true
}
},
deep: true
},
'basicForm.selectType'(newVal, oldVal) {
if (oldVal == 2 || newVal == 2) {
this.basicForm.userList = []
this.selectData = []
this.basicForm.crowdList = []
this.$refs.selectLabel.labelTreeRetSelect = []
}
}
},
methods: {
// 返回
handleCancel(path) {
if (this.editStatus || this.$refs.welcome.previewList.length > 0) {
this.$confirm('当前有内容信息未保存,是否继续返回?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
})
.then(() => {
this.$router.push(path)
})
.catch(() => {
})
} else {
this.$router.push(path)
}
},
// 选择客户change事件
radioChange(val) {
this.isSelectCrowd = false
this.isUpdate = true
this.tagging = []
this.taggingList = []
},
// 打开标签筛选
openLabel(merchant) {
if (!this.basicForm[merchant]) {
this.$message({
type: 'error',
message: '请先选择门店'
})
return
}
this.dialogVisible = !this.dialogVisible
this.$refs.selectLabel.init(this.tagging)
},
selectChange(val) {
// 选择门店时,替换欢迎语组件当中的所有merchantId
this.btnList.forEach(item => {
if (item.params && item.params.hasOwnProperty('merchant')) {
item.params.merchant = val
}
if (item.funParams && Object.prototype.toString.call(item.funParams) === '[object Array]') {
item.funParams.forEach(funArr => {
if (funArr.params && funArr.params.hasOwnProperty('merchantId')) {
funArr.params.merchantId = val
}
if (funArr.merchantOpen && funArr.merchantOpen.params && funArr.merchantOpen.params.hasOwnProperty('merchantId')) {
funArr.merchantOpen.params.merchantId = val
}
})
}
})
this.tagging = []
this.taggingList = []
this.basicForm.crowdList = []
this.$refs.selectLabel.labelTreeRetSelect = []
this.isUpdate = true
this.resetMerchantId = val
this.msgMerchantName = val && this.dataItems.find(item => item.msgMerchantId == val).msgMerchantName
// this.optionsMe
},
handleSelect(val) {
this.isUpdate = true
this.tagging = val
let arr = []
this.tagging.forEach(item => {
item.labelList.forEach(tag => {
arr.push({
groupId: item.labelGroup.id,
groupName: item.labelGroup.name,
labelId: tag.id,
labelName: tag.name,
groupType: item.labelType
})
})
})
this.taggingList = arr
},
// 删除标签
removeTag(tag, idx1, idx) {
tag.labelList.splice(idx1, 1)
if (tag.labelList.length == 0) {
this.tagging.splice(idx, 1)
}
let arr = []
this.tagging.forEach(item => {
item.labelList.forEach(tag => {
arr.push({
groupId: item.labelGroup.id,
groupName: item.labelGroup.name,
labelId: tag.id,
labelName: tag.name,
groupType: item.labelType
})
})
})
this.taggingList = arr
this.isUpdate = true
},
async getTheNumberOfPeople(params) {
await this.$apis.wechatGroup
.batchmessagingCustomercount(params)
.then(res => {
this.groupNumber = res
})
.catch(err => {
this.viewLoading = false
this.groupNumber = 0
this.isUpdate = false
})
},
// 查看群发人数
async viewMembers() {
if (this.basicForm.selectType == '1' && !this.taggingList.length) {
return this.$message({
type: 'error',
message: '请选择标签'
})
}
if (this.basicForm.selectType == 2 && !this.basicForm.crowdList.length) {
return this.$message({
type: 'error',
message: '请选择人群'
})
}
let params = this.getBaseInfo()
this.viewLoading = true
await this.getTheNumberOfPeople(params)
this.isUpdate = false
this.viewLoading = false
},
// 发送时间change事件
changeValue(v) {
const date = new Date(v).getTime()
if (date < Date.now()) {
this.timeOptions = {
selectableRange: `${dayjs()
.add(1, 'm')
.format('HH:mm')}:00 - 23:59:59`
}
} else {
this.timeOptions = {
selectableRange: '00:00:00 - 23:59:59'
}
}
},
getBaseInfo() {
let params = {
customerType: this.basicForm.selectType,
msgName: this.basicForm.groupName,
msgMerchantId: this.basicForm.selectStore ? this.basicForm.selectStore : this.basicForm.taskMerchantId,
msgMerchantName: this.msgMerchantName
}
const combineType = {
label: 2,
crowd: 1
}
if (params.customerType == 1) {
params.combineType = combineType.label
params.labelList = this.taggingList
} else if (params.customerType == 2) {
params.crowdList = this.basicForm.crowdList
params.combineType = combineType.crowd
}
return params
},
// 人群筛选弹窗
selectCrowd(merchant) {
if (!this.basicForm[merchant]) {
this.$message({
type: 'error',
message: '请先选择门店'
})
return
}
this.$refs.selectCrowd.init(this.basicForm.crowdList)
},
// 获取人群数据(根据人群筛选获取群发账号人群数据)
getCrowdData(val) {
this.isUpdate = true
if (val.length) {
this.isSelectCrowd = true
this.basicForm.crowdList = val
} else {
this.basicForm.userList = []
this.basicForm.crowdList = []
this.selectData = []
this.isSelectCrowd = false
this.editStatus = true
this.key = new Date()
}
},
// 删除人群筛选标签
removeCrowd(item, index) {
this.basicForm.crowdList.splice(index, 1)
this.getCrowdData(this.basicForm.crowdList)
if (!this.basicForm.crowdList.length) {
this.basicForm.userList = []
this.selectData = this.basicForm.userList
this.isUpdate = true
this.isSelectCrowd = false
}
this.key = new Date()
},
}
}
......@@ -3,18 +3,23 @@
<div class="marketing pro-group">
<div class="m-b-20 friend-title">
<div>
<GLButton :size="size" class="el-icon-plus" type="primary" fn="新建朋友圈群发" @click="handleEdit(1)">新建朋友圈群发</GLButton>
<!-- <el-button :size="size" type="primary" class="el-icon-plus" fn="新建朋友圈群发" @click="handleEdit(1)">新建朋友圈群发</el-button> -->
<!-- <GLButton :size="size" class="el-icon-plus" type="primary" fn="新建朋友圈群发" @click="handleEdit(1)">新建朋友圈群发</GLButton>-->
<el-button :size="size" type="primary" class="el-icon-plus" fn="新建朋友圈群发" @click="handleEdit(1)">
新建朋友圈群发
</el-button>
</div>
</div>
<div class="container">
<GLCombiForm ref="showSearch" :rowNumber="1" :formObj="searchForm" :formData="searchFormData" @handleOk="handleSearch" @handleRest="handleReset"></GLCombiForm>
<GLCombiForm ref="showSearch" :rowNumber="1" :formObj="searchForm" :formData="searchFormData"
@handleOk="handleSearch" @handleRest="handleReset"></GLCombiForm>
<!-- 表格区域 开始 -->
<GLTable v-loading="loading" ref="proGroupRef" @refreshTable="handleSearch" :layout="layout" :tableData="tableData" :tableTotal="tableTotal" :searchForm="searchForm" :tableParams="tableParams" :pageConf="pageConf">
<GLTable v-loading="loading" ref="proGroupRef" @refreshTable="handleSearch" :layout="layout"
:tableData="tableData" :tableTotal="tableTotal" :searchForm="searchForm" :tableParams="tableParams"
:pageConf="pageConf">
<div class="loginStatus" slot="sendStatus" slot-scope="scope">
<span class="cycle" :style="{ background: scope.scope.sendStatus == '2' ? '#2CCA74' : scope.scope.sendStatus == '-1' ? '#EB4E4E' : scope.scope.sendStatus == '1' ? '#FDB757' : '' }"></span>
{{ scope.scope.sendStatus == '2' ? '已完成' : scope.scope.sendStatus == '-1' ? '发送失败' : scope.scope.sendStatus == '1' ? '发送中' : '' }}
<span class="cycle" :style="{ background: scope.scope.sendStatus == '2' ? '#2CCA74' : scope.scope.sendStatus == '-1' ? '#EB4E4E' : scope.scope.sendStatus == '1' ? '#FDB757' : scope.scope.sendStatus == '0'? '#E5E5E5' : '' }"></span>
{{ scope.scope.sendStatus == '2' ? '已完成' : scope.scope.sendStatus == '-1' ? '发送失败' : scope.scope.sendStatus == '1' ? '发送中' : scope.scope.sendStatus == '0'? '待发送' : '' }}
</div>
<div class="table-btns" slot="auth-button" slot-scope="scope">
<GLTableButton :buttonList="tableButtonList" :buttonItem="scope.scope" :buttonNum="3"></GLTableButton>
......@@ -22,6 +27,8 @@
</GLTable>
<!-- 表格区域 end -->
</div>
<GLDialog title="提示" @onOk="handleSure" @onCancel="popVisible = false" type="error" content="是否确认终止发送?"
:visible.sync="popVisible" mode="small"></GLDialog>
<draw-record ref="drawForm"></draw-record>
</div>
</template>
......@@ -30,8 +37,9 @@
import * as dayjs from 'dayjs'
import url from '@/assets/empty.png'
import drawRecord from './components/drawRecord'
import { utils } from 'glsx-common'
import {utils} from 'glsx-common'
import department from '@/mixins/department'
export default {
mixins: [department],
name: 'friendGroup',
......@@ -40,6 +48,8 @@ export default {
},
data() {
return {
selectItem: {},
popVisible: false,
size: 'small',
loading: false,
url: url,
......@@ -51,7 +61,7 @@ export default {
goodsStatus: 0
},
downRules: {
offReason: [{ required: true, message: '请输入下架备注', trigger: 'change' }]
offReason: [{required: true, message: '请输入下架备注', trigger: 'change'}]
},
updatedTime: '',
// 分享
......@@ -101,6 +111,19 @@ export default {
listeners: {
click: this.handleRecord
}
},
{
type: 'el-button',
name: '终止',
attrs: {
type: 'text'
},
condition: row => {
return row.sendStatus == 0
},
listeners: {
click: this.terminatePopup
}
}
],
// 表格
......@@ -130,6 +153,12 @@ export default {
minwidth: 180
},
{
label: '发送时间',
prop: 'sendTime',
width: 180,
line: 1
},
{
label: '发送状态',
name: 'sendStatus',
addHtml: 'sendStatus',
......@@ -149,7 +178,7 @@ export default {
},
layout: 'sizes, prev, pager, next, jumper, ->, total',
tableTotal: 0,
pageConf: { pageSize: 'pageSize', pageNum: 'pageNum', totalCount: 'count' }
pageConf: {pageSize: 'pageSize', pageNum: 'pageNum', totalCount: 'count'}
}
},
......@@ -158,10 +187,29 @@ export default {
const merchantList = await this.merchantList()
const index = this.searchFormData.findIndex(item => item.name == 'merchantName')
this.searchFormData[index].optionList = merchantList ? merchantList.data : []
this.searchFormData[index].optionList.unshift({ msgMerchantId: null, msgMerchantName: '全部' })
this.searchFormData[index].optionList.unshift({msgMerchantId: null, msgMerchantName: '全部'})
},
methods: {
async handleSure() {
const {id} = this.selectItem
await this.$apis.friendGroup
.sendStop({
id
}).then(res => {
this.$message({
message: res.code == '0' ? '终止成功' : res.message,
type: res.code == '0' ? 'success' : 'error'
})
})
this.popVisible = false
this.handleReset()
},
terminatePopup(scope) {
this.selectItem = scope
console.log(scope)
this.popVisible = true
},
handleRecord(row) {
this.$refs.drawForm.init(row)
},
......@@ -184,7 +232,8 @@ export default {
}
})
},
getParams() {},
getParams() {
},
beforeSearchFn() {
return new Promise(resolve => {
resolve()
......@@ -252,17 +301,17 @@ export default {
return
}
this.$apis.friendGroup
.momentCancel({
id: row.id
})
.then(res => {
this.getListData()
this.$message({
type: 'success',
message: '取消成功'
.momentCancel({
id: row.id
})
.then(res => {
this.getListData()
this.$message({
type: 'success',
message: '取消成功'
})
// this.$set(this.employeelist[index], 'remindStatus', true)
})
// this.$set(this.employeelist[index], 'remindStatus', true)
})
},
dwonVisibleChange() {
this.$refs.downRef && this.$refs.downRef.clearValidate()
......@@ -300,18 +349,22 @@ export default {
.el-table th > .cell {
padding: 0 16px;
}
.el-date-editor {
width: 210px !important;
}
}
.container {
background: #fff;
padding: 20px;
margin-top: 16px;
}
.loginStatus {
display: flex;
align-items: center;
.cycle {
margin-right: 8px;
width: 6px;
......@@ -320,37 +373,44 @@ export default {
border-radius: 50%;
}
}
.friend-title {
display: flex;
justify-content: space-between;
align-items: center;
color: #666666;
.title {
.info-refresh {
font-size: 14px;
color: #5850ff;
cursor: pointer;
margin-left: 20px;
.wait-status {
transition: all ease-in 1s;
transform: rotate(360deg);
}
}
.info-time {
font-size: 14px;
color: #7d7d7d;
margin-left: 10px;
}
}
span {
font-size: 14px;
margin-left: 10px;
font-weight: 100;
}
}
.attachmentList-box {
display: flex;
align-items: center;
.attachmentList-image {
width: 36px;
height: 36px;
......@@ -361,21 +421,25 @@ export default {
align-items: center;
color: #fff;
font-size: 24px;
.image-num {
font-size: 14px;
z-index: 10;
}
.image-panel {
position: absolute;
width: 36px;
height: 36px;
top: 0px;
left: 0px;
img {
width: 36px;
height: 36px;
}
}
.el-icon-reading {
position: absolute;
font-size: 24px;
......@@ -383,9 +447,11 @@ export default {
left: 5px;
color: #fff;
}
&.attachmentList-video {
background: rgba($color: #000000, $alpha: 0.7);
position: relative;
img {
position: absolute;
top: 6px;
......@@ -394,6 +460,7 @@ export default {
height: 24px;
}
}
> img {
position: absolute;
top: 0px;
......@@ -402,6 +469,7 @@ export default {
height: 36px;
}
}
.attachmentList-text {
font-size: 14px;
text-align: left;
......
......@@ -10,18 +10,22 @@
<GLCombiForm :formObj="searchForm" :rowNumber="1" :formData="searchFormData" @handleOk="handleSearch" @handleRest="handleReset"></GLCombiForm>
<GLTable ref="activeTable" :noDataImg="url" :getListApi="getListApi" :searchForm="searchFormTable" :tableParams="tableParams" :pageConf="pageConf" :beforeSearchFn="beforeSearchFn" @setTableFinishFun="setTableFinishFun">
<div slot="optionBtns" slot-scope="scope">
<div v-if="scope.scope.sendState == '1'">
<div v-if="scope.scope.sendState == 1">
<span class="sendRecord" @click="traceRecord(scope.scope)">发送记录</span>
</div>
<div v-if="scope.scope.sendState == 3">
<span class="sendRecord" @click="terminatePopup(scope.scope)">终止</span>
</div>
</div>
<div slot="sendState" slot-scope="scope">
<div class="loginStatus">
<span class="cycle" :style="{ background: scope.scope.sendState == '1' ? '#2CCA74' : scope.scope.sendState == '2' ? '#EB4E4E' : scope.scope.sendState == '0' ? '#FDB757' : '' }"></span>
{{ scope.scope.sendState == '1' ? '已完成' : scope.scope.sendState == '2' ? '发送失败' : scope.scope.sendState == '0' ? '发送中' : '' }}
<span class="cycle" :style="{ background: scope.scope.sendState == '1' ? '#2CCA74' : scope.scope.sendState == '2' ? '#EB4E4E' : scope.scope.sendState == '0' ? '#FDB757' : scope.scope.sendState == '3' ? '#E5E5E5':'' }"></span>
{{ scope.scope.sendState == '1' ? '已完成' : scope.scope.sendState == '2' ? '发送失败' : scope.scope.sendState == '0' ? '发送中' : scope.scope.sendState == '3' ? '待发送':'' }}
</div>
</div>
</GLTable>
</div>
<GLDialog title="提示" @onOk="handleSure" @onCancel="popVisible = false" type="error" content="是否确认终止发送?" :visible.sync="popVisible" mode="small"></GLDialog>
<el-drawer size="50%" title="发送记录" :visible.sync="sendRecordDrawer.isVisible" :direction="sendRecordDrawer.direction">
<div class="horizon"></div>
<div class="sendRecordDrawerbox">
......@@ -53,6 +57,8 @@ export default {
data() {
return {
url,
selectItem:{},
popVisible:false,
sendRecordDrawer: {
isVisible: false,
direction: 'rtl',
......@@ -140,7 +146,7 @@ export default {
{
label: '客户数',
prop: 'customerCount',
width: 80
// width: 80
},
{
label: '标签/人群',
......@@ -151,21 +157,30 @@ export default {
{
label: '创建时间',
prop: 'createTime',
width: 280,
width: 250,
line: 1
},
{
label: '发送时间',
prop: 'sendTime',
width: 180,
line: 1
},
{
label: '发送状态',
prop: 'sendState',
addHtml: 'sendState',
width: 150,
},
{
label: '发送成功',
prop: 'successCompletion'
prop: 'successCompletion',
width: 150,
},
{
label: '发送失败',
prop: 'failCompletion'
prop: 'failCompletion',
width: 150,
},
{
label: '操作',
......@@ -181,6 +196,21 @@ export default {
}
},
methods: {
async handleSure(){
const {msgId} = this.selectItem
await this.$apis.wechatGroup.sendStop({msgId}).then(res =>{
this.$message({
message: res.code == '0' ? '终止成功' : res.message,
type: res.code == '0' ? 'success' : 'error'
})
})
this.popVisible = false
this.handleReset()
},
terminatePopup(scope){
this.selectItem = scope
this.popVisible = true
},
handleSearch() {
this.$refs.activeTable.refreshTable()
},
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!