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 => { ...@@ -56,10 +56,21 @@ const compressionUpload = params => {
sign: false 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 { export default {
merchantList, merchantList,
conditionPage, conditionPage,
batchmomentRecord, batchmomentRecord,
batchmomentSave, batchmomentSave,
compressionUpload compressionUpload,
sendStop
} }
...@@ -71,7 +71,16 @@ const recordSend = params => { ...@@ -71,7 +71,16 @@ const recordSend = params => {
sign: true 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 { export default {
...@@ -81,5 +90,6 @@ export default { ...@@ -81,5 +90,6 @@ export default {
batchmessagingCustomercount, batchmessagingCustomercount,
atchmessagingCreate, atchmessagingCreate,
getStoreList, getStoreList,
recordSend recordSend,
sendStop
} }
...@@ -195,6 +195,17 @@ export default { ...@@ -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() { handleClose() {
this.labelTreeRetSelect = [] this.labelTreeRetSelect = []
this.dialogVisible = false 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 @@ ...@@ -10,7 +10,8 @@
</el-form-item> </el-form-item>
<el-form-item prop="taskMerchantId" label="选择门店:" size="small"> <el-form-item prop="taskMerchantId" label="选择门店:" size="small">
<el-select filterable v-model="basicForm.taskMerchantId" placeholder="请选择门店"> <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-select>
</el-form-item> </el-form-item>
<el-form-item prop="userList"> <el-form-item prop="userList">
...@@ -19,9 +20,10 @@ ...@@ -19,9 +20,10 @@
<i class="el-icon-plus"></i> <i class="el-icon-plus"></i>
选择员工 选择员工
</el-button> </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"> <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> <i class="el-icon-user-solid"></i>
{{ tag.staffName }} {{ tag.staffName }}
</el-tag> </el-tag>
...@@ -29,22 +31,93 @@ ...@@ -29,22 +31,93 @@
</div> </div>
<div v-show="empErrorShow" class="el-form-item__error">请选择员工</div> <div v-show="empErrorShow" class="el-form-item__error">请选择员工</div>
</el-form-item> </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"> <el-form-item prop="attachmentList" class="attachment-panel">
<label slot="label" class="required">朋友圈内容:</label> <label slot="label" class="required">朋友圈内容:</label>
<GLEditor ref="welcome" :form="'customer'" :btnList="btnList" @previewWord="previewForm"></GLEditor> <GLEditor ref="welcome" :form="'customer'" :btnList="btnList" @previewWord="previewForm"></GLEditor>
<div v-show="attachmentShow" class="el-form-item__error">{{ attachmentText }}</div> <div v-show="attachmentShow" class="el-form-item__error">{{ attachmentText }}</div>
</el-form-item> </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> </el-form>
</div> </div>
</div> </div>
<GLDialog bigTitle="选择成员" mode="big" :visible.sync="membersVisible" @onOk="handleConfirm" @onCancel="membersVisible = !membersVisible"> <GLDialog bigTitle="选择成员" mode="big" :visible.sync="membersVisible" @onOk="handleConfirm"
<SelectMember ref="membersForm" v-if="membersVisible" :selectData="selectData" :taskMerchantId="basicForm.taskMerchantId"></SelectMember> @onCancel="membersVisible = !membersVisible">
<SelectMember ref="membersForm" v-if="membersVisible" :selectData="selectData"
:taskMerchantId="basicForm.taskMerchantId"></SelectMember>
</GLDialog> </GLDialog>
</div> </div>
<GLFooter> <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> <el-button type="primary" v-loading="addLoading" @click="handleSubmit">提交</el-button>
</GLFooter> </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> </div>
</template> </template>
...@@ -58,18 +131,42 @@ const ATT_TYPE = { ...@@ -58,18 +131,42 @@ const ATT_TYPE = {
FILE: 6, FILE: 6,
ACTIVITY: 7 ACTIVITY: 7
} }
import { utils } from 'glsx-common' import {utils} from 'glsx-common'
import department from '@/mixins/department' import department from '@/mixins/department'
import marketingGroup from '@/mixins/marketingGroup'
import SelectMember from './components/selectMember.vue' import SelectMember from './components/selectMember.vue'
import SelectCrowd from '@/components/selectCrowd/selectCrowd'
import SelectLabel from '@/components/SelectLabel/SelectLabel'
import * as dayjs from 'dayjs' import * as dayjs from 'dayjs'
export default { export default {
mixins: [department], mixins: [department, marketingGroup],
components: { components: {
SelectMember SelectMember,
SelectLabel,
SelectCrowd
}, },
data() { 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 { return {
optionsMe: [], optionsMe: [],
msgMerchantName:'',
addLoading: false, addLoading: false,
taggingList: [], taggingList: [],
previewView: [], previewView: [],
...@@ -115,90 +212,52 @@ export default { ...@@ -115,90 +212,52 @@ export default {
// templateDetailApi: this.$apis.welcomeword.templateDetail // templateDetailApi: this.$apis.welcomeword.templateDetail
// } // }
], ],
dialogVisible: false,
basicForm: { basicForm: {
userList: [], staffUserList: [],
taskName: '', taskName: '',
taskMerchantId: '' taskMerchantId: '',
sendType: 1,
sendTime: '',
sendDate: '',
selectType: 0,
crowdList: []
}, },
attachmentShow: false, attachmentShow: false,
empErrorShow: false, empErrorShow: false,
attachmentText: '请输入朋友圈内容', attachmentText: '请输入朋友圈内容',
basicRules: { basicRules: {
taskMerchantId: [{ required: true, message: '请选择门店', trigger: 'change' }], taskMerchantId: [{required: true, message: '请选择门店', trigger: 'change'}],
taskName: [{ required: true, message: '请输入群发名称', trigger: 'blur' }] taskName: [{required: true, message: '请输入群发名称', trigger: 'blur'}],
selectType: [{required: true, message: '请选择客户类型', trigger: 'change'}],
sendType: [
{required: true, message: '请选择发送时间', trigger: 'change'},
{validator: validatorSendType, trigger: 'change'}
]
}, },
membersVisible: false, membersVisible: false,
groupList: [], groupList: [],
key: new Date(), key: new Date(),
dialogVisible: false,
previewFlag: false, previewFlag: false,
selectData: [], selectData: [],
// 是否有修改筛选成员
isUpdate: true,
tagging: [], 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, editStatus: false,
firstFlag: true, firstFlag: true,
footerLeft: 40, footerLeft: 40,
footerWidth: 500, footerWidth: 500,
viewLoading: false
} }
}, },
watch: { watch: {
basicForm: { 'basicForm.staffUserList'() {
handler(val) {
if (this.firstFlag) {
this.firstFlag = false
} else {
this.editStatus = true
}
},
deep: true
},
'basicForm.userList'() {
this.empErrorShow = false this.empErrorShow = false
} }
}, },
async mounted() { async mounted() {
console.log(this.size)
// this.SET_TOKEN(888)
const merchantList = await this.merchantList() const merchantList = await this.merchantList()
this.optionsMe = merchantList ? merchantList : [] this.optionsMe = merchantList ? merchantList : []
}, },
methods: { 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) { previewForm(val) {
this.previewView = val this.previewView = val
this.attachmentShow = false this.attachmentShow = false
...@@ -206,28 +265,12 @@ export default { ...@@ -206,28 +265,12 @@ export default {
openMembers() { openMembers() {
this.membersVisible = !this.membersVisible 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() { handleConfirm() {
console.log(this.$refs.membersForm.innerTags)
if (this.$refs.membersForm.innerTags.length) { if (this.$refs.membersForm.innerTags.length) {
// this.basicForm.userList = this.$refs.membersForm.innerTags // this.basicForm.userList = this.$refs.membersForm.innerTags
this.$set(this.basicForm, 'userList', this.$refs.membersForm.innerTags) this.$set(this.basicForm, 'staffUserList', this.$refs.membersForm.innerTags)
this.selectData = this.basicForm.userList this.selectData = this.basicForm.staffUserList
this.openMembers() this.openMembers()
this.isUpdate = true this.isUpdate = true
this.editStatus = true this.editStatus = true
...@@ -241,19 +284,33 @@ export default { ...@@ -241,19 +284,33 @@ export default {
remove(val, idx) { remove(val, idx) {
if (this.$refs.membersForm) { if (this.$refs.membersForm) {
this.$refs.membersForm.remove(val) 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() this.key = new Date()
} else { } else {
this.basicForm.userList.splice(idx, 1) this.basicForm.staffUserList.splice(idx, 1)
this.selectData = this.basicForm.userList this.selectData = this.basicForm.staffUserList
this.key = new Date() this.key = new Date()
} }
this.isUpdate = true this.isUpdate = true
}, },
handleSubmit: utils.debounce(function() { handleSubmit: utils.debounce( function () {
this.$refs.groupForm.validate(valid => { this.$refs.groupForm.validate( async valid => {
if (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 this.empErrorShow = true
return return
} }
...@@ -266,7 +323,7 @@ export default { ...@@ -266,7 +323,7 @@ export default {
if (previewList.length != 0) { if (previewList.length != 0) {
this.basicForm.attachmentList = previewList this.basicForm.attachmentList = previewList
} }
let staffIds = this.basicForm.userList.map(item => { let staffIds = this.basicForm.staffUserList.map(item => {
return item.staffId return item.staffId
}) })
let attachmentList = this.$refs.welcome.previewList let attachmentList = this.$refs.welcome.previewList
...@@ -288,16 +345,45 @@ export default { ...@@ -288,16 +345,45 @@ export default {
if (material.length > 1) { if (material.length > 1) {
materialType = 2 materialType = 2
} }
const { taskName, taskMerchantId } = this.basicForm const {taskName, taskMerchantId, sendType} = this.basicForm
const taskMerchantName = this.optionsMe.find(item => item.msgMerchantId == taskMerchantId).msgMerchantName 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 = { let params = {
materialType, materialType,
attachmentList, attachmentList,
staffIds, staffIds,
taskName, taskName,
taskMerchantName, 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.addLoading = true
this.$apis.friendGroup.batchmomentSave(params).then(res => { this.$apis.friendGroup.batchmomentSave(params).then(res => {
this.addLoading = false this.addLoading = false
...@@ -328,6 +414,7 @@ export default { ...@@ -328,6 +414,7 @@ export default {
color: #333; color: #333;
font-weight: 600; font-weight: 600;
border-bottom: 1px solid #d8d8d8; border-bottom: 1px solid #d8d8d8;
> span { > span {
font-size: 14px; font-size: 14px;
color: #999999; color: #999999;
...@@ -335,12 +422,14 @@ export default { ...@@ -335,12 +422,14 @@ export default {
font-weight: 100; font-weight: 100;
} }
} }
.attachment-panel { .attachment-panel {
/deep/ .btn-group-panel { /deep/ .btn-group-panel {
height: 40px; height: 40px;
padding: 0px 0px 0px 20px; padding: 0px 0px 0px 20px;
} }
} }
.tips-text { .tips-text {
display: flex; display: flex;
// align-items: center; // align-items: center;
...@@ -357,12 +446,14 @@ export default { ...@@ -357,12 +446,14 @@ export default {
max-width: 844px; max-width: 844px;
width: auto; width: auto;
box-sizing: border-box; box-sizing: border-box;
.tips-icon { .tips-icon {
width: 14px; width: 14px;
height: 14px; height: 14px;
margin: 6px 8px 0 0; margin: 6px 8px 0 0;
} }
} }
.info-box { .info-box {
.basic-form { .basic-form {
padding: 32px 0 20px 20px; padding: 32px 0 20px 20px;
...@@ -373,22 +464,27 @@ export default { ...@@ -373,22 +464,27 @@ export default {
font-size: 12px; font-size: 12px;
color: #999; color: #999;
} }
.preview { .preview {
margin-right: 24px; margin-right: 24px;
margin-bottom: 100px; margin-bottom: 100px;
} }
} }
.label-text { .label-text {
margin-left: 10px; margin-left: 10px;
font-size: 14px; font-size: 14px;
span { span {
color: #5850ff; color: #5850ff;
} }
} }
.sale-select { .sale-select {
display: flex; display: flex;
align-items: center; align-items: center;
} }
.input-tag-wrapper { .input-tag-wrapper {
max-height: 75px; max-height: 75px;
overflow: auto; overflow: auto;
...@@ -410,12 +506,14 @@ export default { ...@@ -410,12 +506,14 @@ export default {
align-items: center; align-items: center;
margin-top: 6px; margin-top: 6px;
font-size: 14px; font-size: 14px;
i { i {
color: #75acff; color: #75acff;
margin-right: 3px; margin-right: 3px;
font-size: 14px; font-size: 14px;
} }
} }
.el-tag { .el-tag {
margin-right: 4px; margin-right: 4px;
height: 26px; height: 26px;
...@@ -423,6 +521,7 @@ export default { ...@@ -423,6 +521,7 @@ export default {
margin-bottom: 5px; margin-bottom: 5px;
// background: #fff !important; // background: #fff !important;
} }
.tag-input { .tag-input {
background: transparent; background: transparent;
border: none !important; border: none !important;
...@@ -432,38 +531,74 @@ export default { ...@@ -432,38 +531,74 @@ export default {
padding-left: 0; padding-left: 0;
width: 100px; width: 100px;
} }
.form-error { .form-error {
color: #f56c6c; color: #f56c6c;
font-size: 12px; font-size: 12px;
margin-left: 186px; margin-left: 186px;
margin-top: 10px; margin-top: 10px;
} }
/deep/ { /deep/ {
.el-form-item .el-form-item { .el-form-item .el-form-item {
margin-bottom: 22px; margin-bottom: 22px;
} }
.required { .required {
display: inline-block; display: inline-block;
line-height: 40px; line-height: 40px;
} }
.required::before { .required::before {
content: '*'; content: '*';
color: #f56c6c; color: #f56c6c;
margin-right: 4 px; margin-right: 4px;
} }
.el-loading-spinner { .el-loading-spinner {
transform: translateY(8px); transform: translateY(8px);
} }
.el-scrollbar { .el-scrollbar {
padding-bottom: 10px; padding-bottom: 10px;
} }
.welcome-box { .welcome-box {
min-width: 488px; min-width: 488px;
max-width: 844px; max-width: 844px;
width: auto !important; width: auto !important;
} }
} }
.group-content { .group-content {
padding: 22px 0 20px; 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> </style>
...@@ -3,18 +3,23 @@ ...@@ -3,18 +3,23 @@
<div class="marketing pro-group"> <div class="marketing pro-group">
<div class="m-b-20 friend-title"> <div class="m-b-20 friend-title">
<div> <div>
<GLButton :size="size" class="el-icon-plus" type="primary" fn="新建朋友圈群发" @click="handleEdit(1)">新建朋友圈群发</GLButton> <!-- <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> --> <el-button :size="size" type="primary" class="el-icon-plus" fn="新建朋友圈群发" @click="handleEdit(1)">
新建朋友圈群发
</el-button>
</div> </div>
</div> </div>
<div class="container"> <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"> <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> <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 == '2' ? '已完成' : scope.scope.sendStatus == '-1' ? '发送失败' : scope.scope.sendStatus == '1' ? '发送中' : scope.scope.sendStatus == '0'? '待发送' : '' }}
</div> </div>
<div class="table-btns" slot="auth-button" slot-scope="scope"> <div class="table-btns" slot="auth-button" slot-scope="scope">
<GLTableButton :buttonList="tableButtonList" :buttonItem="scope.scope" :buttonNum="3"></GLTableButton> <GLTableButton :buttonList="tableButtonList" :buttonItem="scope.scope" :buttonNum="3"></GLTableButton>
...@@ -22,6 +27,8 @@ ...@@ -22,6 +27,8 @@
</GLTable> </GLTable>
<!-- 表格区域 end --> <!-- 表格区域 end -->
</div> </div>
<GLDialog title="提示" @onOk="handleSure" @onCancel="popVisible = false" type="error" content="是否确认终止发送?"
:visible.sync="popVisible" mode="small"></GLDialog>
<draw-record ref="drawForm"></draw-record> <draw-record ref="drawForm"></draw-record>
</div> </div>
</template> </template>
...@@ -30,8 +37,9 @@ ...@@ -30,8 +37,9 @@
import * as dayjs from 'dayjs' import * as dayjs from 'dayjs'
import url from '@/assets/empty.png' import url from '@/assets/empty.png'
import drawRecord from './components/drawRecord' import drawRecord from './components/drawRecord'
import { utils } from 'glsx-common' import {utils} from 'glsx-common'
import department from '@/mixins/department' import department from '@/mixins/department'
export default { export default {
mixins: [department], mixins: [department],
name: 'friendGroup', name: 'friendGroup',
...@@ -40,6 +48,8 @@ export default { ...@@ -40,6 +48,8 @@ export default {
}, },
data() { data() {
return { return {
selectItem: {},
popVisible: false,
size: 'small', size: 'small',
loading: false, loading: false,
url: url, url: url,
...@@ -51,7 +61,7 @@ export default { ...@@ -51,7 +61,7 @@ export default {
goodsStatus: 0 goodsStatus: 0
}, },
downRules: { downRules: {
offReason: [{ required: true, message: '请输入下架备注', trigger: 'change' }] offReason: [{required: true, message: '请输入下架备注', trigger: 'change'}]
}, },
updatedTime: '', updatedTime: '',
// 分享 // 分享
...@@ -101,6 +111,19 @@ export default { ...@@ -101,6 +111,19 @@ export default {
listeners: { listeners: {
click: this.handleRecord 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 { ...@@ -130,6 +153,12 @@ export default {
minwidth: 180 minwidth: 180
}, },
{ {
label: '发送时间',
prop: 'sendTime',
width: 180,
line: 1
},
{
label: '发送状态', label: '发送状态',
name: 'sendStatus', name: 'sendStatus',
addHtml: 'sendStatus', addHtml: 'sendStatus',
...@@ -149,7 +178,7 @@ export default { ...@@ -149,7 +178,7 @@ export default {
}, },
layout: 'sizes, prev, pager, next, jumper, ->, total', layout: 'sizes, prev, pager, next, jumper, ->, total',
tableTotal: 0, tableTotal: 0,
pageConf: { pageSize: 'pageSize', pageNum: 'pageNum', totalCount: 'count' } pageConf: {pageSize: 'pageSize', pageNum: 'pageNum', totalCount: 'count'}
} }
}, },
...@@ -158,10 +187,29 @@ export default { ...@@ -158,10 +187,29 @@ export default {
const merchantList = await this.merchantList() const merchantList = await this.merchantList()
const index = this.searchFormData.findIndex(item => item.name == 'merchantName') const index = this.searchFormData.findIndex(item => item.name == 'merchantName')
this.searchFormData[index].optionList = merchantList ? merchantList.data : [] this.searchFormData[index].optionList = merchantList ? merchantList.data : []
this.searchFormData[index].optionList.unshift({ msgMerchantId: null, msgMerchantName: '全部' }) this.searchFormData[index].optionList.unshift({msgMerchantId: null, msgMerchantName: '全部'})
}, },
methods: { 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) { handleRecord(row) {
this.$refs.drawForm.init(row) this.$refs.drawForm.init(row)
}, },
...@@ -184,7 +232,8 @@ export default { ...@@ -184,7 +232,8 @@ export default {
} }
}) })
}, },
getParams() {}, getParams() {
},
beforeSearchFn() { beforeSearchFn() {
return new Promise(resolve => { return new Promise(resolve => {
resolve() resolve()
...@@ -252,17 +301,17 @@ export default { ...@@ -252,17 +301,17 @@ export default {
return return
} }
this.$apis.friendGroup this.$apis.friendGroup
.momentCancel({ .momentCancel({
id: row.id id: row.id
}) })
.then(res => { .then(res => {
this.getListData() this.getListData()
this.$message({ this.$message({
type: 'success', type: 'success',
message: '取消成功' message: '取消成功'
})
// this.$set(this.employeelist[index], 'remindStatus', true)
}) })
// this.$set(this.employeelist[index], 'remindStatus', true)
})
}, },
dwonVisibleChange() { dwonVisibleChange() {
this.$refs.downRef && this.$refs.downRef.clearValidate() this.$refs.downRef && this.$refs.downRef.clearValidate()
...@@ -300,18 +349,22 @@ export default { ...@@ -300,18 +349,22 @@ export default {
.el-table th > .cell { .el-table th > .cell {
padding: 0 16px; padding: 0 16px;
} }
.el-date-editor { .el-date-editor {
width: 210px !important; width: 210px !important;
} }
} }
.container { .container {
background: #fff; background: #fff;
padding: 20px; padding: 20px;
margin-top: 16px; margin-top: 16px;
} }
.loginStatus { .loginStatus {
display: flex; display: flex;
align-items: center; align-items: center;
.cycle { .cycle {
margin-right: 8px; margin-right: 8px;
width: 6px; width: 6px;
...@@ -320,37 +373,44 @@ export default { ...@@ -320,37 +373,44 @@ export default {
border-radius: 50%; border-radius: 50%;
} }
} }
.friend-title { .friend-title {
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
align-items: center; align-items: center;
color: #666666; color: #666666;
.title { .title {
.info-refresh { .info-refresh {
font-size: 14px; font-size: 14px;
color: #5850ff; color: #5850ff;
cursor: pointer; cursor: pointer;
margin-left: 20px; margin-left: 20px;
.wait-status { .wait-status {
transition: all ease-in 1s; transition: all ease-in 1s;
transform: rotate(360deg); transform: rotate(360deg);
} }
} }
.info-time { .info-time {
font-size: 14px; font-size: 14px;
color: #7d7d7d; color: #7d7d7d;
margin-left: 10px; margin-left: 10px;
} }
} }
span { span {
font-size: 14px; font-size: 14px;
margin-left: 10px; margin-left: 10px;
font-weight: 100; font-weight: 100;
} }
} }
.attachmentList-box { .attachmentList-box {
display: flex; display: flex;
align-items: center; align-items: center;
.attachmentList-image { .attachmentList-image {
width: 36px; width: 36px;
height: 36px; height: 36px;
...@@ -361,21 +421,25 @@ export default { ...@@ -361,21 +421,25 @@ export default {
align-items: center; align-items: center;
color: #fff; color: #fff;
font-size: 24px; font-size: 24px;
.image-num { .image-num {
font-size: 14px; font-size: 14px;
z-index: 10; z-index: 10;
} }
.image-panel { .image-panel {
position: absolute; position: absolute;
width: 36px; width: 36px;
height: 36px; height: 36px;
top: 0px; top: 0px;
left: 0px; left: 0px;
img { img {
width: 36px; width: 36px;
height: 36px; height: 36px;
} }
} }
.el-icon-reading { .el-icon-reading {
position: absolute; position: absolute;
font-size: 24px; font-size: 24px;
...@@ -383,9 +447,11 @@ export default { ...@@ -383,9 +447,11 @@ export default {
left: 5px; left: 5px;
color: #fff; color: #fff;
} }
&.attachmentList-video { &.attachmentList-video {
background: rgba($color: #000000, $alpha: 0.7); background: rgba($color: #000000, $alpha: 0.7);
position: relative; position: relative;
img { img {
position: absolute; position: absolute;
top: 6px; top: 6px;
...@@ -394,6 +460,7 @@ export default { ...@@ -394,6 +460,7 @@ export default {
height: 24px; height: 24px;
} }
} }
> img { > img {
position: absolute; position: absolute;
top: 0px; top: 0px;
...@@ -402,6 +469,7 @@ export default { ...@@ -402,6 +469,7 @@ export default {
height: 36px; height: 36px;
} }
} }
.attachmentList-text { .attachmentList-text {
font-size: 14px; font-size: 14px;
text-align: left; text-align: left;
......
...@@ -10,9 +10,10 @@ ...@@ -10,9 +10,10 @@
<el-input size="small" v-model="basicForm.groupName" placeholder="请输入群发名称"></el-input> <el-input size="small" v-model="basicForm.groupName" placeholder="请输入群发名称"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="选择门店:" prop="selectStore" class="settingSelect"> <el-form-item label="选择门店:" prop="selectStore" class="settingSelect">
<!-- <SearchDropDown :label="'msgMerchantName'" :value="'msgMerchantId'"></SearchDropDown>--> <el-select ref="selectLabel" clearable filterable v-model="basicForm.selectStore"
<el-select ref="selectLabel" clearable filterable v-model="basicForm.selectStore" placeholder="请选择门店" @change="selectChange"> placeholder="请选择门店" @change="selectChange">
<el-option v-for="(item, i) in dataItems" :key="i" :label="item.msgMerchantName" :value="item.msgMerchantId"></el-option> <el-option v-for="(item, i) in dataItems" :key="i" :label="item.msgMerchantName"
:value="item.msgMerchantId"></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="选择客户:" prop="selectType"> <el-form-item label="选择客户:" prop="selectType">
...@@ -22,7 +23,7 @@ ...@@ -22,7 +23,7 @@
</el-radio-group> </el-radio-group>
<div v-show="basicForm.selectType == 1"> <div v-show="basicForm.selectType == 1">
<div class="selectedLabel"> <div class="selectedLabel">
<el-button size="small" @click="openLabel"> <el-button size="small" @click="openLabel('selectStore')">
<i class="el-icon-plus"></i> <i class="el-icon-plus"></i>
选择标签 选择标签
</el-button> </el-button>
...@@ -34,17 +35,21 @@ ...@@ -34,17 +35,21 @@
</div> </div>
<div v-show="tagging.length != 0" :key="key" class="el-input-tag input-tag-wrapper"> <div v-show="tagging.length != 0" :key="key" class="el-input-tag input-tag-wrapper">
<span v-for="(tag, idx) in tagging" :key="idx"> <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> </span>
</div> </div>
</div> </div>
<div v-show="basicForm.selectType == 2" style="line-height: 32px; padding-bottom: 10px"> <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 ? '继续选择' : '选择人群' }} {{ isSelectCrowd ? '继续选择' : '选择人群' }}
</el-button> </el-button>
<div class="sale-select" v-show="basicForm.crowdList && basicForm.crowdList.length != 0"> <div class="sale-select" v-show="basicForm.crowdList && basicForm.crowdList.length != 0">
<div class="el-input-tag input-tag-wrapper"> <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 }} {{ t.crowdName }}
</el-tag> </el-tag>
</div> </div>
...@@ -56,7 +61,8 @@ ...@@ -56,7 +61,8 @@
<div class="filter-footer"> <div class="filter-footer">
<div class="filter-number"> <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> <span v-show="!isUpdate">{{ groupNumber }}</span>
</div> </div>
</div> </div>
...@@ -70,6 +76,21 @@ ...@@ -70,6 +76,21 @@
<GLEditor ref="welcome" :form="'customer'" style="line-height: 12px;" :btnList="btnList"></GLEditor> <GLEditor ref="welcome" :form="'customer'" style="line-height: 12px;" :btnList="btnList"></GLEditor>
<div v-show="attachmentShow" class="el-form-item__error">{{ attachmentText }}</div> <div v-show="attachmentShow" class="el-form-item__error">{{ attachmentText }}</div>
</el-form-item> </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> </el-form>
</div> </div>
</div> </div>
...@@ -77,11 +98,14 @@ ...@@ -77,11 +98,14 @@
</div> </div>
</div> </div>
<GLFooter> <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> <el-button type="primary" v-loading="addLoading" @click="handleSubmit">提交</el-button>
</GLFooter> </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> </div>
</template> </template>
<script> <script>
...@@ -90,17 +114,37 @@ const combineType = { ...@@ -90,17 +114,37 @@ const combineType = {
crowd: 1 crowd: 1
} }
import emoji from '@/utils/emo' import emoji from '@/utils/emo'
import SelectCrowd from './components/selectCrowd.vue' import SelectCrowd from '@/components/selectCrowd/selectCrowd'
import SelectLabel from './components/SelectLabel.vue' import SelectLabel from '@/components/SelectLabel/SelectLabel'
import department from '@/mixins/department'
import marketingGroup from '@/mixins/marketingGroup'
// import SearchDropDown from './components/searchDropDown/index' // import SearchDropDown from './components/searchDropDown/index'
import * as dayjs from 'dayjs' import * as dayjs from 'dayjs'
export default { export default {
mixins: [department,marketingGroup],
components: { components: {
SelectLabel, SelectLabel,
SelectCrowd SelectCrowd
// SearchDropDown
}, },
data() { 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 { return {
resetMerchantId: '', resetMerchantId: '',
msgMerchantName: '', msgMerchantName: '',
...@@ -218,15 +262,22 @@ export default { ...@@ -218,15 +262,22 @@ export default {
attachmentShow: false, attachmentShow: false,
attachmentText: '', attachmentText: '',
basicRules: { basicRules: {
groupName: [{ required: true, message: '请输入群发名称', trigger: 'blur' }], groupName: [{required: true, message: '请输入群发名称', trigger: 'blur'}],
selectStore: [{ required: true, message: '请选择门店', trigger: 'change' }], selectStore: [{required: true, message: '请选择门店', trigger: 'change'}],
selectType: [{ required: true, message: '请选择客户类型', trigger: 'change' }] selectType: [{required: true, message: '请选择客户类型', trigger: 'change'}],
sendType: [
{required: true, message: '请选择发送时间', trigger: 'change'},
{validator: validatorSendType, trigger: 'change'}
]
}, },
basicForm: { basicForm: {
groupName: '', groupName: '',
selectStore: '', selectStore: '',
selectType: 1, selectType: 1,
crowdList: [] sendType:1,
crowdList: [],
sendDate:'',
sendTime:''
}, },
groupList: [], groupList: [],
selectData: [], selectData: [],
...@@ -240,119 +291,18 @@ export default { ...@@ -240,119 +291,18 @@ export default {
footerWidth: 500, footerWidth: 500,
viewLoading: false, viewLoading: false,
isSelectCrowd: false, isSelectCrowd: false,
pageData: {
//懒加载相关参数,这里代表从第一条数据开始加载,一次加载40项
pageNum: 1,
pageSize: 40
},
dataItems: [] dataItems: []
} }
}, },
watch: { async mounted() {
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
this.footerLeft = document.querySelector('.base-container-right').offsetLeft this.footerLeft = document.querySelector('.base-container-right').offsetLeft
this.footerWidth = document.documentElement.clientWidth - this.footerLeft this.footerWidth = document.documentElement.clientWidth - this.footerLeft
this.boxHeight = clientHeight - 200 const merchantList = await this.merchantList()
this.loadUpData() this.dataItems = merchantList ? merchantList : []
}, },
methods: { 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() { 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 => { this.$refs.basicForm.validate(valid => {
if (valid) { if (valid) {
if (this.basicForm.selectType == '1' && !this.taggingList.length) { if (this.basicForm.selectType == '1' && !this.taggingList.length) {
...@@ -384,23 +334,28 @@ export default { ...@@ -384,23 +334,28 @@ export default {
} else { } else {
return (this.attachmentText = '请输入群发内容') return (this.attachmentText = '请输入群发内容')
} }
if (this.groupNumber == '0') {
this.$message({
type: 'error',
message: '群发人数为0!'
})
return
}
this.$refs.groupForm.validate(async v => { this.$refs.groupForm.validate(async v => {
if (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 params.type = 1
const previewList = this.$common ? this.$common.utils.deepClone(this.$refs.welcome.previewList) : this.$refs.welcome.previewList const previewList = this.$common ? this.$common.utils.deepClone(this.$refs.welcome.previewList) : this.$refs.welcome.previewList
const contentList = previewList.map(item => { const contentList = previewList.map(item => {
if (item.attType == 1) { if (item.attType == 1) {
const list = emoji.flat(Infinity) const list = emoji.flat(Infinity)
const cutImg = item.attContent.replaceAll('<img src="https://img01.glsx.com.cn/weapp/resource/saas/scrm/emoji/', '') 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] let s = list[parseInt(str.split('.')[0]) - 1]
return `[${s}]` return `[${s}]`
}) })
...@@ -437,139 +392,6 @@ export default { ...@@ -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> </script>
...@@ -586,12 +408,14 @@ export default { ...@@ -586,12 +408,14 @@ export default {
font-weight: 600; font-weight: 600;
border-bottom: 1px solid #d8d8d8; border-bottom: 1px solid #d8d8d8;
} }
.info-box { .info-box {
display: inline-flex; display: inline-flex;
width: 100%; width: 100%;
padding-bottom: 30px; padding-bottom: 30px;
align-items: flex-end; align-items: flex-end;
justify-content: space-between; justify-content: space-between;
.info-content { .info-content {
// width: calc(100% - 360px); // width: calc(100% - 360px);
width: 66%; width: 66%;
...@@ -618,6 +442,7 @@ export default { ...@@ -618,6 +442,7 @@ export default {
align-items: center; align-items: center;
color: #999; color: #999;
font-size: 14px; font-size: 14px;
.filter-number { .filter-number {
display: inline-block; display: inline-block;
line-height: 20px; line-height: 20px;
...@@ -625,25 +450,31 @@ export default { ...@@ -625,25 +450,31 @@ export default {
background-color: #e6e9ff; background-color: #e6e9ff;
color: #333; color: #333;
margin-top: 8px; margin-top: 8px;
span { span {
color: #5850ff; color: #5850ff;
cursor: pointer; cursor: pointer;
} }
} }
} }
.basic-form { .basic-form {
padding: 32px 0 20px 20px; padding: 32px 0 20px 20px;
.settingSelect { .settingSelect {
/deep/ input { /deep/ input {
height: 35px; height: 35px;
} }
} }
.selectedLabel { .selectedLabel {
display: flex; display: flex;
.selectLen { .selectLen {
margin-left: 20px; margin-left: 20px;
font-size: 14px; font-size: 14px;
color: #666666; color: #666666;
.num { .num {
color: #5850ff; color: #5850ff;
} }
...@@ -652,16 +483,19 @@ export default { ...@@ -652,16 +483,19 @@ export default {
} }
} }
} }
.form-tips { .form-tips {
font-size: 12px; font-size: 12px;
color: #999; color: #999;
} }
.preview { .preview {
flex: 1; flex: 1;
margin-right: 24px; margin-right: 24px;
margin-bottom: 58px; margin-bottom: 58px;
} }
} }
.footer-panel { .footer-panel {
display: flex; display: flex;
align-items: center; align-items: center;
...@@ -673,18 +507,22 @@ export default { ...@@ -673,18 +507,22 @@ export default {
background: #ffffff; background: #ffffff;
box-shadow: 0px -1px 1px 0px rgba(88, 80, 255, 0.1); box-shadow: 0px -1px 1px 0px rgba(88, 80, 255, 0.1);
} }
.label-text { .label-text {
margin-left: 10px; margin-left: 10px;
font-size: 14px; font-size: 14px;
span { span {
color: #5850ff; color: #5850ff;
} }
} }
.sale-select { .sale-select {
display: flex; display: flex;
align-items: center; align-items: center;
// width: 50%; // width: 50%;
} }
.input-tag-wrapper { .input-tag-wrapper {
max-height: 75px; max-height: 75px;
min-width: 488px; min-width: 488px;
...@@ -709,12 +547,14 @@ export default { ...@@ -709,12 +547,14 @@ export default {
align-items: center; align-items: center;
margin-top: 6px; margin-top: 6px;
font-size: 14px; font-size: 14px;
i { i {
color: #75acff; color: #75acff;
margin-right: 3px; margin-right: 3px;
font-size: 14px; font-size: 14px;
} }
} }
.el-tag { .el-tag {
margin-right: 4px; margin-right: 4px;
height: 26px; height: 26px;
...@@ -722,6 +562,7 @@ export default { ...@@ -722,6 +562,7 @@ export default {
margin-bottom: 6px; margin-bottom: 6px;
// background: #fff !important; // background: #fff !important;
} }
.tag-input { .tag-input {
background: transparent; background: transparent;
border: none !important; border: none !important;
...@@ -731,12 +572,14 @@ export default { ...@@ -731,12 +572,14 @@ export default {
padding-left: 0; padding-left: 0;
width: 100px; width: 100px;
} }
.form-error { .form-error {
color: #f56c6c; color: #f56c6c;
font-size: 12px; font-size: 12px;
margin-left: 186px; margin-left: 186px;
margin-top: 10px; margin-top: 10px;
} }
/deep/ { /deep/ {
//.el-form-item .el-form-item { //.el-form-item .el-form-item {
// margin-bottom: 22px; // margin-bottom: 22px;
...@@ -745,26 +588,32 @@ export default { ...@@ -745,26 +588,32 @@ export default {
display: inline-block; display: inline-block;
line-height: 40px; line-height: 40px;
} }
.required::before { .required::before {
content: '*'; content: '*';
color: #f56c6c; color: #f56c6c;
margin-right: 4px; margin-right: 4px;
} }
.el-loading-spinner { .el-loading-spinner {
transform: translateY(8px); transform: translateY(8px);
} }
.el-scrollbar { .el-scrollbar {
padding-bottom: 10px; padding-bottom: 10px;
} }
.gl-form-page .el-form .welcome-box { .gl-form-page .el-form .welcome-box {
min-width: 488px; min-width: 488px;
max-width: 844px; max-width: 844px;
width: auto; width: auto;
} }
} }
.group-content { .group-content {
padding: 0 0 20px 0; padding: 0 0 20px 0;
} }
.tips-text { .tips-text {
font-size: 12px; font-size: 12px;
color: #f56c6c; color: #f56c6c;
...@@ -772,18 +621,22 @@ export default { ...@@ -772,18 +621,22 @@ export default {
line-height: 20px; line-height: 20px;
padding-bottom: 4px; padding-bottom: 4px;
} }
.crowd-tips { .crowd-tips {
color: #999999; color: #999999;
font-size: 12px; font-size: 12px;
line-height: 16px; line-height: 16px;
} }
/deep/ .content .btn-group { /deep/ .content .btn-group {
line-height: 14px; line-height: 14px;
} }
/deep/ .el-select { /deep/ .el-select {
.el-select__caret:first-child::before { .el-select__caret:first-child::before {
content: '\e6e1'; content: '\e6e1';
} }
.is-focus { .is-focus {
.el-select__caret:first-child { .el-select__caret:first-child {
transform: rotateZ(0deg); transform: rotateZ(0deg);
......
...@@ -10,18 +10,22 @@ ...@@ -10,18 +10,22 @@
<GLCombiForm :formObj="searchForm" :rowNumber="1" :formData="searchFormData" @handleOk="handleSearch" @handleRest="handleReset"></GLCombiForm> <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"> <GLTable ref="activeTable" :noDataImg="url" :getListApi="getListApi" :searchForm="searchFormTable" :tableParams="tableParams" :pageConf="pageConf" :beforeSearchFn="beforeSearchFn" @setTableFinishFun="setTableFinishFun">
<div slot="optionBtns" slot-scope="scope"> <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> <span class="sendRecord" @click="traceRecord(scope.scope)">发送记录</span>
</div> </div>
<div v-if="scope.scope.sendState == 3">
<span class="sendRecord" @click="terminatePopup(scope.scope)">终止</span>
</div>
</div> </div>
<div slot="sendState" slot-scope="scope"> <div slot="sendState" slot-scope="scope">
<div class="loginStatus"> <div class="loginStatus">
<span class="cycle" :style="{ background: scope.scope.sendState == '1' ? '#2CCA74' : scope.scope.sendState == '2' ? '#EB4E4E' : scope.scope.sendState == '0' ? '#FDB757' : '' }"></span> <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 == '1' ? '已完成' : scope.scope.sendState == '2' ? '发送失败' : scope.scope.sendState == '0' ? '发送中' : scope.scope.sendState == '3' ? '待发送':'' }}
</div> </div>
</div> </div>
</GLTable> </GLTable>
</div> </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"> <el-drawer size="50%" title="发送记录" :visible.sync="sendRecordDrawer.isVisible" :direction="sendRecordDrawer.direction">
<div class="horizon"></div> <div class="horizon"></div>
<div class="sendRecordDrawerbox"> <div class="sendRecordDrawerbox">
...@@ -53,6 +57,8 @@ export default { ...@@ -53,6 +57,8 @@ export default {
data() { data() {
return { return {
url, url,
selectItem:{},
popVisible:false,
sendRecordDrawer: { sendRecordDrawer: {
isVisible: false, isVisible: false,
direction: 'rtl', direction: 'rtl',
...@@ -140,7 +146,7 @@ export default { ...@@ -140,7 +146,7 @@ export default {
{ {
label: '客户数', label: '客户数',
prop: 'customerCount', prop: 'customerCount',
width: 80 // width: 80
}, },
{ {
label: '标签/人群', label: '标签/人群',
...@@ -151,21 +157,30 @@ export default { ...@@ -151,21 +157,30 @@ export default {
{ {
label: '创建时间', label: '创建时间',
prop: 'createTime', prop: 'createTime',
width: 280, width: 250,
line: 1
},
{
label: '发送时间',
prop: 'sendTime',
width: 180,
line: 1 line: 1
}, },
{ {
label: '发送状态', label: '发送状态',
prop: 'sendState', prop: 'sendState',
addHtml: 'sendState', addHtml: 'sendState',
width: 150,
}, },
{ {
label: '发送成功', label: '发送成功',
prop: 'successCompletion' prop: 'successCompletion',
width: 150,
}, },
{ {
label: '发送失败', label: '发送失败',
prop: 'failCompletion' prop: 'failCompletion',
width: 150,
}, },
{ {
label: '操作', label: '操作',
...@@ -181,6 +196,21 @@ export default { ...@@ -181,6 +196,21 @@ export default {
} }
}, },
methods: { 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() { handleSearch() {
this.$refs.activeTable.refreshTable() 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!