Commit 731e1df3 by 胡悦

群发接口联调

1 parent 310b7954
......@@ -356,20 +356,6 @@ export default {
this.$refs.selectLabel.init(this.tagging)
},
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 => {
if (valid) {
this.attachmentShow = true
......@@ -388,7 +374,7 @@ export default {
this.attachmentText = '请输入群发内容'
return
}
this.$refs.groupForm.validate(v => {
this.$refs.groupForm.validate(async(v) => {
if (v) {
const params = this.getSiftMembers()
params.type = 1
......@@ -421,27 +407,37 @@ export default {
if (params.sendType == 2) {
params.sendTimeStr = this.basicForm.sendTime + ' ' + this.basicForm.sendDate
}
this.addLoading = true
this.$apis.customerTransform.insert(params).then(res => {
if (res.code == '-1') {
this.$message({
type: 'error',
message: res.message
})
} else if (res.code == 0) {
this.$message({
type: 'success',
message: '操作成功!'
})
} else {
this.$message({
type: 'error',
message: res.message
})
}
this.addLoading = false
this.$router.push('/customerTransform/index')
})
const countParams = this.getSiftMembers()
const count = await this.$apis.customerTransform.customerCount(countParams)
console.log(count)
if (count) {
this.addLoading = true
this.$apis.customerTransform.insert(params).then(res => {
if (res.code == '-1') {
this.$message({
type: 'error',
message: res.message
})
} else if (res.code == 0) {
this.$message({
type: 'success',
message: '操作成功!'
})
} else {
this.$message({
type: 'error',
message: res.message
})
}
this.addLoading = false
this.$router.push('/customerTransform/index')
})
} else {
this.$message({
type: 'error',
message: '客户数不可为0!'
})
}
}
})
}
......@@ -449,15 +445,6 @@ export default {
},
handleSelect(val) {
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
let arr = []
this.tagging.forEach(item => {
......@@ -532,7 +519,8 @@ export default {
// tagId: tagFlag ? this.tagging.map(item => item.id).join(',') : '',
// tagName: tagFlag ? this.tagging.map(item => item.name).join(',') : ''
// tagId: JSON.stringify(this.tagging)
labelList: this.taggingList
labelList: this.taggingList,
combineType: 2
}
}
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!