Commit 731e1df3 by 胡悦

群发接口联调

1 parent 310b7954
...@@ -356,20 +356,6 @@ export default { ...@@ -356,20 +356,6 @@ export default {
this.$refs.selectLabel.init(this.tagging) this.$refs.selectLabel.init(this.tagging)
}, },
handleSubmit() { handleSubmit() {
// let arr = []
// this.tagging.forEach(item => {
// item.labelList.forEach(tag => {
// arr.push({
// groupId: parseInt(item.labelGroup.id),
// groupName: item.labelGroup.name,
// labelId: parseInt(tag.id),
// labelName: tag.name,
// groupType: item.labelType
// })
// })
// })
// this.taggingList = arr
// console.log(this.taggingList)
this.$refs.basicForm.validate(valid => { this.$refs.basicForm.validate(valid => {
if (valid) { if (valid) {
this.attachmentShow = true this.attachmentShow = true
...@@ -388,7 +374,7 @@ export default { ...@@ -388,7 +374,7 @@ export default {
this.attachmentText = '请输入群发内容' this.attachmentText = '请输入群发内容'
return return
} }
this.$refs.groupForm.validate(v => { this.$refs.groupForm.validate(async(v) => {
if (v) { if (v) {
const params = this.getSiftMembers() const params = this.getSiftMembers()
params.type = 1 params.type = 1
...@@ -421,6 +407,10 @@ export default { ...@@ -421,6 +407,10 @@ export default {
if (params.sendType == 2) { if (params.sendType == 2) {
params.sendTimeStr = this.basicForm.sendTime + ' ' + this.basicForm.sendDate params.sendTimeStr = this.basicForm.sendTime + ' ' + this.basicForm.sendDate
} }
const countParams = this.getSiftMembers()
const count = await this.$apis.customerTransform.customerCount(countParams)
console.log(count)
if (count) {
this.addLoading = true this.addLoading = true
this.$apis.customerTransform.insert(params).then(res => { this.$apis.customerTransform.insert(params).then(res => {
if (res.code == '-1') { if (res.code == '-1') {
...@@ -442,6 +432,12 @@ export default { ...@@ -442,6 +432,12 @@ export default {
this.addLoading = false this.addLoading = false
this.$router.push('/customerTransform/index') this.$router.push('/customerTransform/index')
}) })
} else {
this.$message({
type: 'error',
message: '客户数不可为0!'
})
}
} }
}) })
} }
...@@ -449,15 +445,6 @@ export default { ...@@ -449,15 +445,6 @@ export default {
}, },
handleSelect(val) { handleSelect(val) {
this.isUpdate = true this.isUpdate = true
// const arr = []
// if (val.length != 0) {
// val.forEach(item => {
// if (item.labelList.length != 0) {
// item.labelList.map(i => arr.push(i))
// }
// // arr.push(item.labelList)
// })
// }
this.tagging = val this.tagging = val
let arr = [] let arr = []
this.tagging.forEach(item => { this.tagging.forEach(item => {
...@@ -532,7 +519,8 @@ export default { ...@@ -532,7 +519,8 @@ export default {
// tagId: tagFlag ? this.tagging.map(item => item.id).join(',') : '', // tagId: tagFlag ? this.tagging.map(item => item.id).join(',') : '',
// tagName: tagFlag ? this.tagging.map(item => item.name).join(',') : '' // tagName: tagFlag ? this.tagging.map(item => item.name).join(',') : ''
// tagId: JSON.stringify(this.tagging) // tagId: JSON.stringify(this.tagging)
labelList: this.taggingList labelList: this.taggingList,
combineType: 2
} }
} }
if (this.basicForm.condition.date) { if (this.basicForm.condition.date) {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!