Commit 0487be72 by xinla

新老客拉群修改

1 parent c2119f5b
...@@ -10,7 +10,7 @@ export default { ...@@ -10,7 +10,7 @@ export default {
newGroupId: '', newGroupId: '',
dialogVisibleSelectUser: false, // 选择员工会话 dialogVisibleSelectUser: false, // 选择员工会话
dialogVisibleSelectTag: false, // 选择客户标签会话 dialogVisibleSelectTag: false, // 选择客户标签会话
dialogVisibleSelectGroup: false, // 选择群活码会话 dialogVisibleSelectGroup: false, // 选择客群弹窗
loading: false, loading: false,
form: { form: {
codeName: '', // 活码名称 codeName: '', // 活码名称
...@@ -88,27 +88,15 @@ export default { ...@@ -88,27 +88,15 @@ export default {
this.$refs.form.validate((valid) => { this.$refs.form.validate((valid) => {
if (valid) { if (valid) {
this.loading = true this.loading = true
if (this.$route.query.id) { ;(this.$route.query.id ? update : add)(this.form)
update(this.form)
.then(() => { .then(() => {
this.msgSuccess('更新成功') this.msgSuccess()
this.loading = false this.loading = false
this.$router.back() this.$router.back()
}) })
.catch(() => { .catch(() => {
this.loading = false this.loading = false
}) })
} else {
add(this.form)
.then(() => {
this.msgSuccess('添加成功')
this.loading = false
this.$router.back()
})
.catch(() => {
this.loading = false
})
}
} }
}) })
}, },
......
...@@ -90,7 +90,11 @@ ...@@ -90,7 +90,11 @@
<div> <div>
<div class="preview-wrap g-card mt0 sticky-t"> <div class="preview-wrap g-card mt0 sticky-t">
<div class="g-card-title">预览</div> <div class="g-card-title">预览</div>
<PhoneDialog :list="[{ text: form.welcomeMsg || '请输入加群引导语' }, { image: groupQrCode.codeUrl }]" /> <PhoneDialog
:list="[
{ text: form.welcomeMsg || '请输入加群引导语' },
{ title: form.linkTitle, desc: form.linkDesc, image: form.linkCoverUrl },
]" />
</div> </div>
</div> </div>
</div> </div>
...@@ -122,7 +126,6 @@ export default { ...@@ -122,7 +126,6 @@ export default {
tags: [], tags: [],
users: [], users: [],
codes: [], codes: [],
groupQrCode: {}, // 选择的群活码链接
dateRange: [], dateRange: [],
// sendTypeOptions: [ // sendTypeOptions: [
// { label: '企业群发', value: 0 }, // { label: '企业群发', value: 0 },
...@@ -189,26 +192,7 @@ export default { ...@@ -189,26 +192,7 @@ export default {
getDetail(id) { getDetail(id) {
this.loading = true this.loading = true
getDetail(id).then(({ data }) => { getDetail(id).then(({ data }) => {
this.form.taskName = data.taskName || '' this.form = data
this.form.welcomeMsg = data.welcomeMsg || ''
this.form.sendType = data.sendType || 1
this.form.sendScope = data.sendScope || 0
this.form.sendGender = data.sendGender || 0
this.tags = data.tagList || []
this.users = data.scopeList || []
this.dateRange = [data.cusBeginTime || '', data.cusEndTime || '']
if (data.groupCodeInfo && data.groupCodeInfo.id) {
this.codes = [data.groupCodeInfo]
this.groupQrCode = data.groupCodeInfo
this.form.groupCodeId = this.groupQrCode.id
} else {
this.codes = []
this.groupQrCode = {}
this.form.groupCodeId = ''
}
this.loading = false this.loading = false
}) })
}, },
...@@ -259,18 +243,7 @@ export default { ...@@ -259,18 +243,7 @@ export default {
}) })
}, },
sendData() { sendData() {
if (this.id) { ;(this.id ? update : add)(this.form)
update(this.id, this.form)
.then(() => {
this.msgSuccess('更新成功')
this.loading = false
this.$router.back()
})
.catch(() => {
this.loading = false
})
} else {
add(this.form)
.then(() => { .then(() => {
this.msgSuccess('添加成功') this.msgSuccess('添加成功')
this.loading = false this.loading = false
...@@ -279,7 +252,6 @@ export default { ...@@ -279,7 +252,6 @@ export default {
.catch(() => { .catch(() => {
this.loading = false this.loading = false
}) })
}
}, },
}, },
} }
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!