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()
},
}
}
......@@ -10,7 +10,8 @@
</el-form-item>
<el-form-item prop="taskMerchantId" label="选择门店:" size="small">
<el-select filterable v-model="basicForm.taskMerchantId" placeholder="请选择门店">
<el-option v-for="item in optionsMe" :key="item.msgMerchantId" :label="item.msgMerchantName" :value="item.msgMerchantId"></el-option>
<el-option v-for="item in optionsMe" :key="item.msgMerchantId" :label="item.msgMerchantName"
:value="item.msgMerchantId"></el-option>
</el-select>
</el-form-item>
<el-form-item prop="userList">
......@@ -19,9 +20,10 @@
<i class="el-icon-plus"></i>
选择员工
</el-button>
<div class="sale-select" v-show="basicForm.userList && basicForm.userList.length != 0">
<div class="sale-select" v-show="basicForm.staffUserList && basicForm.staffUserList.length != 0">
<div :key="key" class="el-input-tag input-tag-wrapper">
<el-tag effect="plain" type="info" v-for="(tag, idx) in basicForm.userList" :key="idx" closable :disable-transitions="false" @close="remove(tag, idx)">
<el-tag effect="plain" type="info" v-for="(tag, idx) in basicForm.staffUserList" :key="idx" closable
:disable-transitions="false" @close="remove(tag, idx)">
<i class="el-icon-user-solid"></i>
{{ tag.staffName }}
</el-tag>
......@@ -29,22 +31,93 @@
</div>
<div v-show="empErrorShow" class="el-form-item__error">请选择员工</div>
</el-form-item>
<el-form-item label="选择客户:" prop="selectType">
<el-radio-group @change="radioChange" v-model="basicForm.selectType">
<el-radio :label="0">全部客户</el-radio>
<el-radio :label="1">标签筛选</el-radio>
<el-radio :label="2">人群筛选</el-radio>
</el-radio-group>
<div v-show="basicForm.selectType == 1">
<div class="selectedLabel">
<el-button size="small" @click="openLabel('taskMerchantId')">
<i class="el-icon-plus"></i>
选择标签
</el-button>
<div class="selectLen" v-show="taggingList.length != 0">
(已选
<span class="num">{{ taggingList.length }}</span>
个标签)
</div>
</div>
<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>
<div v-show="basicForm.selectType == 2" style="line-height: 32px; padding-bottom: 10px">
<el-button :size="size" icon="el-icon-plus" @click="selectCrowd('taskMerchantId')">
{{ isSelectCrowd ? '继续选择' : '选择人群' }}
</el-button>
<div class="sale-select" v-show="basicForm.crowdList && basicForm.crowdList.length != 0">
<div class="el-input-tag input-tag-wrapper">
<el-tag effect="plain" type="info" v-for="(t, i) in basicForm.crowdList" :key="i" closable
:disable-transitions="false" @close="removeCrowd(t, i)">
{{ t.crowdName }}
</el-tag>
</div>
</div>
</div>
<div v-show="basicForm.selectType == 2" class="crowd-tips">
人群标签存在重复客户,群发人数会自动去重。若一个客户有多个成员添加,可手动在群发账号中删除多余成员。
</div>
<div class="filter-footer" v-show="basicForm.selectType !== 0">
<div class="filter-number">
预计群发人数
<el-button type="text" v-show="isUpdate" :loading="viewLoading" @click="viewMembers">查看</el-button>
<span v-show="!isUpdate">{{ groupNumber }}</span>
</div>
</div>
</el-form-item>
<el-form-item prop="attachmentList" class="attachment-panel">
<label slot="label" class="required">朋友圈内容:</label>
<GLEditor ref="welcome" :form="'customer'" :btnList="btnList" @previewWord="previewForm"></GLEditor>
<div v-show="attachmentShow" class="el-form-item__error">{{ attachmentText }}</div>
</el-form-item>
<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>
<GLDialog bigTitle="选择成员" mode="big" :visible.sync="membersVisible" @onOk="handleConfirm" @onCancel="membersVisible = !membersVisible">
<SelectMember ref="membersForm" v-if="membersVisible" :selectData="selectData" :taskMerchantId="basicForm.taskMerchantId"></SelectMember>
<GLDialog bigTitle="选择成员" mode="big" :visible.sync="membersVisible" @onOk="handleConfirm"
@onCancel="membersVisible = !membersVisible">
<SelectMember ref="membersForm" v-if="membersVisible" :selectData="selectData"
:taskMerchantId="basicForm.taskMerchantId"></SelectMember>
</GLDialog>
</div>
<GLFooter>
<el-button @click="handleCancel">取消</el-button>
<el-button @click="handleCancel('/friendGroup/index')">取消</el-button>
<el-button type="primary" v-loading="addLoading" @click="handleSubmit">提交</el-button>
</GLFooter>
<SelectLabel ref="selectLabel" @tagSelected="handleSelect" :resetMerchantId="basicForm.taskMerchantId"
:dialogVisible="dialogVisible"></SelectLabel>
<SelectCrowd ref="selectCrowd" @crowdData="getCrowdData" :resetMerchantId="basicForm.taskMerchantId"
:selectCrowdData="basicForm.crowdList"></SelectCrowd>
</div>
</template>
......@@ -58,18 +131,42 @@ const ATT_TYPE = {
FILE: 6,
ACTIVITY: 7
}
import { utils } from 'glsx-common'
import {utils} from 'glsx-common'
import department from '@/mixins/department'
import marketingGroup from '@/mixins/marketingGroup'
import SelectMember from './components/selectMember.vue'
import SelectCrowd from '@/components/selectCrowd/selectCrowd'
import SelectLabel from '@/components/SelectLabel/SelectLabel'
import * as dayjs from 'dayjs'
export default {
mixins: [department],
mixins: [department, marketingGroup],
components: {
SelectMember
SelectMember,
SelectLabel,
SelectCrowd
},
data() {
const validatorSendType = (rule, value, callback) => {
if (value) {
if (value == 2) {
if (!this.basicForm.sendTime) {
callback(new Error('请选择日期'))
}
if (!this.basicForm.sendDate) {
callback(new Error('请选择时间'))
}
if (this.basicForm.sendTime && this.basicForm.sendDate) {
callback()
}
} else {
callback()
}
}
}
return {
optionsMe: [],
msgMerchantName:'',
addLoading: false,
taggingList: [],
previewView: [],
......@@ -115,90 +212,52 @@ export default {
// templateDetailApi: this.$apis.welcomeword.templateDetail
// }
],
dialogVisible: false,
basicForm: {
userList: [],
staffUserList: [],
taskName: '',
taskMerchantId: ''
taskMerchantId: '',
sendType: 1,
sendTime: '',
sendDate: '',
selectType: 0,
crowdList: []
},
attachmentShow: false,
empErrorShow: false,
attachmentText: '请输入朋友圈内容',
basicRules: {
taskMerchantId: [{ required: true, message: '请选择门店', trigger: 'change' }],
taskName: [{ required: true, message: '请输入群发名称', trigger: 'blur' }]
taskMerchantId: [{required: true, message: '请选择门店', trigger: 'change'}],
taskName: [{required: true, message: '请输入群发名称', trigger: 'blur'}],
selectType: [{required: true, message: '请选择客户类型', trigger: 'change'}],
sendType: [
{required: true, message: '请选择发送时间', trigger: 'change'},
{validator: validatorSendType, trigger: 'change'}
]
},
membersVisible: false,
groupList: [],
key: new Date(),
dialogVisible: false,
previewFlag: false,
selectData: [],
// 是否有修改筛选成员
isUpdate: true,
tagging: [],
groupNumber: 0,
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'
},
editStatus: false,
firstFlag: true,
footerLeft: 40,
footerWidth: 500,
viewLoading: false
}
},
watch: {
basicForm: {
handler(val) {
if (this.firstFlag) {
this.firstFlag = false
} else {
this.editStatus = true
}
},
deep: true
},
'basicForm.userList'() {
'basicForm.staffUserList'() {
this.empErrorShow = false
}
},
async mounted() {
console.log(this.size)
// this.SET_TOKEN(888)
const merchantList = await this.merchantList()
this.optionsMe = merchantList ? merchantList : []
},
methods: {
// uploadFile(e) {
// const files = e.target.files
// var formData = new FormData()
// formData.append('file', files[0])
// // formData.append('picWidth', 1080)
// // formData.append('picHeight', 1920)
// // fetch('http://192.168.1.170:8086/rpc-scrm-entmicro-container/picture/compression/upload', {
// // method: 'post',
// // body: formData
// // })
// // window
// // .axios({
// // url: 'http://192.168.3.101:8186/rpc-scrm-entmicro-container/file/upload',
// // method: 'post',
// // data: formData
// // })
// // .then(res => {
// // console.log(res)
// // })
// this.$apis.friendGroup.compressionUpload({ file: files[0] }).then(res => {
// console.log(res)
// })
// },
previewForm(val) {
this.previewView = val
this.attachmentShow = false
......@@ -206,28 +265,12 @@ export default {
openMembers() {
this.membersVisible = !this.membersVisible
},
handleCancel() {
if (this.editStatus || this.$refs.welcome.previewList.length > 0) {
this.$confirm('当前有内容信息未保存,是否继续返回?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
})
.then(() => {
this.$router.push('/friendGroup/index')
})
.catch(() => {})
} else {
this.$router.push('/friendGroup/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.$set(this.basicForm, 'staffUserList', this.$refs.membersForm.innerTags)
this.selectData = this.basicForm.staffUserList
this.openMembers()
this.isUpdate = true
this.editStatus = true
......@@ -241,19 +284,33 @@ export default {
remove(val, idx) {
if (this.$refs.membersForm) {
this.$refs.membersForm.remove(val)
this.$set(this.basicForm, 'userList', this.$refs.membersForm.innerTags)
this.$set(this.basicForm, 'staffUserList', this.$refs.membersForm.innerTags)
this.key = new Date()
} else {
this.basicForm.userList.splice(idx, 1)
this.selectData = this.basicForm.userList
this.basicForm.staffUserList.splice(idx, 1)
this.selectData = this.basicForm.staffUserList
this.key = new Date()
}
this.isUpdate = true
},
handleSubmit: utils.debounce(function() {
this.$refs.groupForm.validate(valid => {
handleSubmit: utils.debounce( function () {
this.$refs.groupForm.validate( async valid => {
if (valid) {
if (this.basicForm.userList.length == 0) {
if (this.basicForm.selectType == '1' && !this.taggingList.length) {
this.$message({
type: 'error',
message: '请选择标签'
})
return
}
if (this.basicForm.selectType == 2 && !this.basicForm.crowdList.length) {
this.$message({
type: 'error',
message: '请选择人群'
})
return
}
if (this.basicForm.staffUserList.length == 0) {
this.empErrorShow = true
return
}
......@@ -266,7 +323,7 @@ export default {
if (previewList.length != 0) {
this.basicForm.attachmentList = previewList
}
let staffIds = this.basicForm.userList.map(item => {
let staffIds = this.basicForm.staffUserList.map(item => {
return item.staffId
})
let attachmentList = this.$refs.welcome.previewList
......@@ -288,16 +345,45 @@ export default {
if (material.length > 1) {
materialType = 2
}
const { taskName, taskMerchantId } = this.basicForm
const {taskName, taskMerchantId, sendType} = this.basicForm
const taskMerchantName = this.optionsMe.find(item => item.msgMerchantId == taskMerchantId).msgMerchantName
let peopleParams = this.getBaseInfo()
if (this.basicForm.selectType != 0){
await this.getTheNumberOfPeople(peopleParams)
}
if (this.basicForm.selectType != 0 && this.groupNumber == 0) {
this.$message({
type: 'error',
message: '群发人数为0!'
})
return
}
let params = {
materialType,
attachmentList,
staffIds,
taskName,
taskMerchantName,
taskMerchantId
taskMerchantId,
sendType
}
const combineType = {
label: 2,
crowd: 1
}
params.customerType = peopleParams.customerType
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
}
if (params.sendType == 2) {
params.sendTime = this.basicForm.sendTime + ' ' + this.basicForm.sendDate
}
this.addLoading = true
this.$apis.friendGroup.batchmomentSave(params).then(res => {
this.addLoading = false
......@@ -328,6 +414,7 @@ export default {
color: #333;
font-weight: 600;
border-bottom: 1px solid #d8d8d8;
> span {
font-size: 14px;
color: #999999;
......@@ -335,12 +422,14 @@ export default {
font-weight: 100;
}
}
.attachment-panel {
/deep/ .btn-group-panel {
height: 40px;
padding: 0px 0px 0px 20px;
}
}
.tips-text {
display: flex;
// align-items: center;
......@@ -357,12 +446,14 @@ export default {
max-width: 844px;
width: auto;
box-sizing: border-box;
.tips-icon {
width: 14px;
height: 14px;
margin: 6px 8px 0 0;
}
}
.info-box {
.basic-form {
padding: 32px 0 20px 20px;
......@@ -373,22 +464,27 @@ export default {
font-size: 12px;
color: #999;
}
.preview {
margin-right: 24px;
margin-bottom: 100px;
}
}
.label-text {
margin-left: 10px;
font-size: 14px;
span {
color: #5850ff;
}
}
.sale-select {
display: flex;
align-items: center;
}
.input-tag-wrapper {
max-height: 75px;
overflow: auto;
......@@ -410,12 +506,14 @@ export default {
align-items: center;
margin-top: 6px;
font-size: 14px;
i {
color: #75acff;
margin-right: 3px;
font-size: 14px;
}
}
.el-tag {
margin-right: 4px;
height: 26px;
......@@ -423,6 +521,7 @@ export default {
margin-bottom: 5px;
// background: #fff !important;
}
.tag-input {
background: transparent;
border: none !important;
......@@ -432,38 +531,74 @@ export default {
padding-left: 0;
width: 100px;
}
.form-error {
color: #f56c6c;
font-size: 12px;
margin-left: 186px;
margin-top: 10px;
}
/deep/ {
.el-form-item .el-form-item {
margin-bottom: 22px;
}
.required {
display: inline-block;
line-height: 40px;
}
.required::before {
content: '*';
color: #f56c6c;
margin-right: 4 px;
margin-right: 4px;
}
.el-loading-spinner {
transform: translateY(8px);
}
.el-scrollbar {
padding-bottom: 10px;
}
.welcome-box {
min-width: 488px;
max-width: 844px;
width: auto !important;
}
}
.group-content {
padding: 22px 0 20px;
}
.crowd-tips {
color: #999999;
font-size: 12px;
line-height: 16px;
}
.filter-footer {
display: flex;
justify-content: space-between;
align-items: center;
color: #999;
font-size: 14px;
.filter-number {
display: inline-block;
line-height: 20px;
padding: 7px 14px;
background-color: #e6e9ff;
color: #333;
margin-top: 8px;
span {
color: #5850ff;
cursor: pointer;
}
}
}
</style>
......@@ -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,9 +10,10 @@
<el-input size="small" v-model="basicForm.groupName" placeholder="请输入群发名称"></el-input>
</el-form-item>
<el-form-item label="选择门店:" prop="selectStore" class="settingSelect">
<!-- <SearchDropDown :label="'msgMerchantName'" :value="'msgMerchantId'"></SearchDropDown>-->
<el-select ref="selectLabel" clearable filterable v-model="basicForm.selectStore" placeholder="请选择门店" @change="selectChange">
<el-option v-for="(item, i) in dataItems" :key="i" :label="item.msgMerchantName" :value="item.msgMerchantId"></el-option>
<el-select ref="selectLabel" clearable filterable v-model="basicForm.selectStore"
placeholder="请选择门店" @change="selectChange">
<el-option v-for="(item, i) in dataItems" :key="i" :label="item.msgMerchantName"
:value="item.msgMerchantId"></el-option>
</el-select>
</el-form-item>
<el-form-item label="选择客户:" prop="selectType">
......@@ -22,7 +23,7 @@
</el-radio-group>
<div v-show="basicForm.selectType == 1">
<div class="selectedLabel">
<el-button size="small" @click="openLabel">
<el-button size="small" @click="openLabel('selectStore')">
<i class="el-icon-plus"></i>
选择标签
</el-button>
......@@ -34,17 +35,21 @@
</div>
<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>
<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>
<div v-show="basicForm.selectType == 2" style="line-height: 32px; padding-bottom: 10px">
<el-button :size="size" icon="el-icon-plus" @click="selectCrowd">
<el-button :size="size" icon="el-icon-plus" @click="selectCrowd('selectStore')">
{{ isSelectCrowd ? '继续选择' : '选择人群' }}
</el-button>
<div class="sale-select" v-show="basicForm.crowdList && basicForm.crowdList.length != 0">
<div class="el-input-tag input-tag-wrapper">
<el-tag effect="plain" type="info" v-for="(t, i) in basicForm.crowdList" :key="i" closable :disable-transitions="false" @close="removeCrowd(t, i)">
<el-tag effect="plain" type="info" v-for="(t, i) in basicForm.crowdList" :key="i" closable
:disable-transitions="false" @close="removeCrowd(t, i)">
{{ t.crowdName }}
</el-tag>
</div>
......@@ -56,7 +61,8 @@
<div class="filter-footer">
<div class="filter-number">
预计群发人数
<el-button type="text" v-show="isUpdate" :loading="viewLoading" @click="viewMembers">查看</el-button>
<el-button type="text" v-show="isUpdate" :loading="viewLoading" @click="viewMembers">查看
</el-button>
<span v-show="!isUpdate">{{ groupNumber }}</span>
</div>
</div>
......@@ -70,6 +76,21 @@
<GLEditor ref="welcome" :form="'customer'" style="line-height: 12px;" :btnList="btnList"></GLEditor>
<div v-show="attachmentShow" class="el-form-item__error">{{ attachmentText }}</div>
</el-form-item>
<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>
......@@ -77,11 +98,14 @@
</div>
</div>
<GLFooter>
<el-button @click="handleCancel">取消</el-button>
<el-button @click="handleCancel('/wechatGroup/index')">取消</el-button>
<el-button type="primary" v-loading="addLoading" @click="handleSubmit">提交</el-button>
</GLFooter>
<SelectLabel ref="selectLabel" @tagSelected="handleSelect" :resetMerchantId="resetMerchantId" :dialogVisible="dialogVisible"></SelectLabel>
<SelectCrowd ref="selectCrowd" @crowdData="getCrowdData" :resetMerchantId="resetMerchantId" :selectCrowdData="basicForm.crowdList"></SelectCrowd>
<SelectLabel ref="selectLabel" @tagSelected="handleSelect" :resetMerchantId="resetMerchantId"
:dialogVisible="dialogVisible"></SelectLabel>
<SelectCrowd ref="selectCrowd" @crowdData="getCrowdData" :resetMerchantId="resetMerchantId"
:selectCrowdData="basicForm.crowdList"></SelectCrowd>
</div>
</template>
<script>
......@@ -90,17 +114,37 @@ const combineType = {
crowd: 1
}
import emoji from '@/utils/emo'
import SelectCrowd from './components/selectCrowd.vue'
import SelectLabel from './components/SelectLabel.vue'
import SelectCrowd from '@/components/selectCrowd/selectCrowd'
import SelectLabel from '@/components/SelectLabel/SelectLabel'
import department from '@/mixins/department'
import marketingGroup from '@/mixins/marketingGroup'
// import SearchDropDown from './components/searchDropDown/index'
import * as dayjs from 'dayjs'
export default {
mixins: [department,marketingGroup],
components: {
SelectLabel,
SelectCrowd
// SearchDropDown
},
data() {
const validatorSendType = (rule, value, callback) => {
if (value) {
if (value == 2) {
if (!this.basicForm.sendTime) {
callback(new Error('请选择日期'))
}
if (!this.basicForm.sendDate) {
callback(new Error('请选择时间'))
}
if (this.basicForm.sendTime && this.basicForm.sendDate) {
callback()
}
} else {
callback()
}
}
}
return {
resetMerchantId: '',
msgMerchantName: '',
......@@ -218,15 +262,22 @@ export default {
attachmentShow: false,
attachmentText: '',
basicRules: {
groupName: [{ required: true, message: '请输入群发名称', trigger: 'blur' }],
selectStore: [{ required: true, message: '请选择门店', trigger: 'change' }],
selectType: [{ required: true, message: '请选择客户类型', trigger: 'change' }]
groupName: [{required: true, message: '请输入群发名称', trigger: 'blur'}],
selectStore: [{required: true, message: '请选择门店', trigger: 'change'}],
selectType: [{required: true, message: '请选择客户类型', trigger: 'change'}],
sendType: [
{required: true, message: '请选择发送时间', trigger: 'change'},
{validator: validatorSendType, trigger: 'change'}
]
},
basicForm: {
groupName: '',
selectStore: '',
selectType: 1,
crowdList: []
sendType:1,
crowdList: [],
sendDate:'',
sendTime:''
},
groupList: [],
selectData: [],
......@@ -240,119 +291,18 @@ export default {
footerWidth: 500,
viewLoading: false,
isSelectCrowd: false,
pageData: {
//懒加载相关参数,这里代表从第一条数据开始加载,一次加载40项
pageNum: 1,
pageSize: 40
},
dataItems: []
}
},
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 = []
}
}
},
mounted() {
let clientHeight = document.documentElement.clientHeight
async mounted() {
this.footerLeft = document.querySelector('.base-container-right').offsetLeft
this.footerWidth = document.documentElement.clientWidth - this.footerLeft
this.boxHeight = clientHeight - 200
this.loadUpData()
const merchantList = await this.merchantList()
this.dataItems = merchantList ? merchantList : []
},
methods: {
async loadUpData() {
const params = {
pageNum: 1,
pageSize: 10000
}
await this.$apis.wechatGroup.getStoreList(params).then(res => {
this.dataItems = res || []
})
},
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
},
// 返回
handleCancel() {
if (this.editStatus || this.$refs.welcome.previewList.length > 0) {
this.$confirm('当前有内容信息未保存,是否继续返回?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
})
.then(() => {
this.$router.push('/wechatGroup/index')
})
.catch(() => {})
} else {
this.$router.push('/wechatGroup/index')
}
},
// 打开标签筛选弹框
openLabel() {
if (!this.basicForm.selectStore) {
this.$message({
type: 'error',
message: '请先选择门店'
})
return
}
this.dialogVisible = !this.dialogVisible
this.$refs.selectLabel.init(this.tagging)
},
// 提交
async handleSubmit() {
const params = this.getBaseInfo()
// 统计群发人数
await this.$apis.wechatGroup
.batchmessagingCustomercount(params)
.then(res => {
if (res || res == 0) {
this.groupNumber = res
}
})
.catch(err => {
this.groupNumber = 0
})
this.$refs.basicForm.validate(valid => {
if (valid) {
if (this.basicForm.selectType == '1' && !this.taggingList.length) {
......@@ -384,23 +334,28 @@ export default {
} else {
return (this.attachmentText = '请输入群发内容')
}
if (this.groupNumber == '0') {
this.$message({
type: 'error',
message: '群发人数为0!'
})
return
}
this.$refs.groupForm.validate(async v => {
if (v) {
const params = this.getBaseInfo()
let params = this.getBaseInfo()
await this.getTheNumberOfPeople(params)
if (this.groupNumber == 0) {
this.$message({
type: 'error',
message: '群发人数为0!'
})
return
}
params.sendType = this.basicForm.sendType
if (params.sendType == 2) {
params.sendTime = this.basicForm.sendTime + ' ' + this.basicForm.sendDate
}
params.type = 1
const previewList = this.$common ? this.$common.utils.deepClone(this.$refs.welcome.previewList) : this.$refs.welcome.previewList
const contentList = previewList.map(item => {
if (item.attType == 1) {
const list = emoji.flat(Infinity)
const cutImg = item.attContent.replaceAll('<img src="https://img01.glsx.com.cn/weapp/resource/saas/scrm/emoji/', '')
const replaceImg = cutImg.replace(/(\d){3}.png">/g, function(str) {
const replaceImg = cutImg.replace(/(\d){3}.png">/g, function (str) {
let s = list[parseInt(str.split('.')[0]) - 1]
return `[${s}]`
})
......@@ -437,139 +392,6 @@ export default {
}
})
},
// 选择标签
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
},
// 删除人群筛选标签
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()
},
getBaseInfo() {
let params = {
customerType: this.basicForm.selectType,
msgName: this.basicForm.groupName,
msgMerchantId: this.basicForm.selectStore,
msgMerchantName: this.msgMerchantName
}
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
},
// 查看群发人数
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: '请选择人群'
})
}
const params = this.getBaseInfo()
this.viewLoading = true
this.$apis.wechatGroup
.batchmessagingCustomercount(params)
.then(res => {
if (res || res == 0) {
this.isUpdate = false
this.groupNumber = res
} else {
this.isUpdate = true
}
this.viewLoading = false
})
.catch(err => {
this.viewLoading = false
this.groupNumber = 0
this.isUpdate = false
})
},
// 选择客户change事件
radioChange(val) {
this.isSelectCrowd = false
this.isUpdate = true
this.tagging = []
this.taggingList = []
},
// 人群筛选弹窗
selectCrowd() {
if (!this.basicForm.selectStore) {
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()
}
}
}
}
</script>
......@@ -586,12 +408,14 @@ export default {
font-weight: 600;
border-bottom: 1px solid #d8d8d8;
}
.info-box {
display: inline-flex;
width: 100%;
padding-bottom: 30px;
align-items: flex-end;
justify-content: space-between;
.info-content {
// width: calc(100% - 360px);
width: 66%;
......@@ -618,6 +442,7 @@ export default {
align-items: center;
color: #999;
font-size: 14px;
.filter-number {
display: inline-block;
line-height: 20px;
......@@ -625,25 +450,31 @@ export default {
background-color: #e6e9ff;
color: #333;
margin-top: 8px;
span {
color: #5850ff;
cursor: pointer;
}
}
}
.basic-form {
padding: 32px 0 20px 20px;
.settingSelect {
/deep/ input {
height: 35px;
}
}
.selectedLabel {
display: flex;
.selectLen {
margin-left: 20px;
font-size: 14px;
color: #666666;
.num {
color: #5850ff;
}
......@@ -652,16 +483,19 @@ export default {
}
}
}
.form-tips {
font-size: 12px;
color: #999;
}
.preview {
flex: 1;
margin-right: 24px;
margin-bottom: 58px;
}
}
.footer-panel {
display: flex;
align-items: center;
......@@ -673,18 +507,22 @@ export default {
background: #ffffff;
box-shadow: 0px -1px 1px 0px rgba(88, 80, 255, 0.1);
}
.label-text {
margin-left: 10px;
font-size: 14px;
span {
color: #5850ff;
}
}
.sale-select {
display: flex;
align-items: center;
// width: 50%;
}
.input-tag-wrapper {
max-height: 75px;
min-width: 488px;
......@@ -709,12 +547,14 @@ export default {
align-items: center;
margin-top: 6px;
font-size: 14px;
i {
color: #75acff;
margin-right: 3px;
font-size: 14px;
}
}
.el-tag {
margin-right: 4px;
height: 26px;
......@@ -722,6 +562,7 @@ export default {
margin-bottom: 6px;
// background: #fff !important;
}
.tag-input {
background: transparent;
border: none !important;
......@@ -731,12 +572,14 @@ export default {
padding-left: 0;
width: 100px;
}
.form-error {
color: #f56c6c;
font-size: 12px;
margin-left: 186px;
margin-top: 10px;
}
/deep/ {
//.el-form-item .el-form-item {
// margin-bottom: 22px;
......@@ -745,26 +588,32 @@ export default {
display: inline-block;
line-height: 40px;
}
.required::before {
content: '*';
color: #f56c6c;
margin-right: 4px;
}
.el-loading-spinner {
transform: translateY(8px);
}
.el-scrollbar {
padding-bottom: 10px;
}
.gl-form-page .el-form .welcome-box {
min-width: 488px;
max-width: 844px;
width: auto;
}
}
.group-content {
padding: 0 0 20px 0;
}
.tips-text {
font-size: 12px;
color: #f56c6c;
......@@ -772,18 +621,22 @@ export default {
line-height: 20px;
padding-bottom: 4px;
}
.crowd-tips {
color: #999999;
font-size: 12px;
line-height: 16px;
}
/deep/ .content .btn-group {
line-height: 14px;
}
/deep/ .el-select {
.el-select__caret:first-child::before {
content: '\e6e1';
}
.is-focus {
.el-select__caret:first-child {
transform: rotateZ(0deg);
......
......@@ -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!