Commit f9ff47b3 by jzou

群活码缺失逻辑调整

1 parent 616e0f18
...@@ -258,8 +258,8 @@ export default { ...@@ -258,8 +258,8 @@ export default {
getDetail(id) { getDetail(id) {
this.loading = true this.loading = true
getDetail(id).then(({ data }) => { getDetail(id).then(({ data }) => {
this.dateRange = [this.form.startExeTime, this.form.stopExeTime] this.dateRange = [data.startExeTime || '', data.stopExeTime || '']
this.customerGroups = data.groupList this.customerGroups = data.groupList || []
this.form.ruleName = data.ruleName || '' this.form.ruleName = data.ruleName || ''
this.form.title = data.title || '' this.form.title = data.title || ''
...@@ -268,7 +268,9 @@ export default { ...@@ -268,7 +268,9 @@ export default {
this.form.materialIdList = [] this.form.materialIdList = []
for (let material of data.materialList) { const materialList = data.materialList || []
for (let material of materialList) {
if (material.materialUrl) { if (material.materialUrl) {
this.imageMaterialList.push(material) this.imageMaterialList.push(material)
} else { } else {
......
...@@ -113,13 +113,19 @@ export default { ...@@ -113,13 +113,19 @@ export default {
this.form.taskName = data.taskName this.form.taskName = data.taskName
this.form.welcomeMsg = data.welcomeMsg this.form.welcomeMsg = data.welcomeMsg
const keywords = data.keywordList.map((k) => k.keyword) const keywordList = data.keywordList || []
const keywords = keywordList.map((k) => k.keyword)
this.form.keywords = keywords.join(',') this.form.keywords = keywords.join(',')
this.form.groupCodeId = data.groupCodeInfo.id if (data.groupCodeInfo && data.groupCodeInfo.id) {
this.form.groupCodeId = data.groupCodeInfo.id
this.codes = [ data.groupCodeInfo ] this.codes = [ data.groupCodeInfo ]
this.groupQrCode = data.groupCodeInfo this.groupQrCode = data.groupCodeInfo
} else {
this.form.groupCodeId = ''
this.codes = []
this.groupQrCode = {}
}
this.loading = false this.loading = false
}) })
......
...@@ -113,11 +113,11 @@ ...@@ -113,11 +113,11 @@
> >
<el-image <el-image
slot="reference" slot="reference"
:src="row.groupCodeInfo.codeUrl" :src="(row.groupCodeInfo && row.groupCodeInfo.codeUrl) || ''"
class="code-image--small" class="code-image--small"
></el-image> ></el-image>
<el-image <el-image
:src="row.groupCodeInfo.codeUrl" :src="(row.groupCodeInfo && row.groupCodeInfo.codeUrl ) || ''"
class="code-image" class="code-image"
> >
</el-image> </el-image>
......
...@@ -176,16 +176,22 @@ export default { ...@@ -176,16 +176,22 @@ export default {
getDetail(id) { getDetail(id) {
this.loading = true this.loading = true
getDetail(id).then(({ data }) => { getDetail(id).then(({ data }) => {
this.form.codeName = data.codeName this.form.codeName = data.codeName || ''
this.form.skipVerify = data.skipVerify this.form.skipVerify = data.skipVerify || 0
this.form.welcomeMsg = data.welcomeMsg this.form.welcomeMsg = data.welcomeMsg || ''
this.form.groupCodeId = data.groupCodeInfo.id
this.codes = [ data.groupCodeInfo ] if (data.groupCodeInfo && data.groupCodeInfo.id) {
this.groupQrCode = data.groupCodeInfo this.codes = [ data.groupCodeInfo ]
this.groupQrCode = data.groupCodeInfo
this.form.groupCodeId = data.groupCodeInfo.id
} else {
this.codes = []
this.groupQrCode = {}
this.form.groupCodeId = ''
}
this.tags = data.tagList this.tags = data.tagList || []
this.users = data.emplList this.users = data.emplList || []
this.loading = false this.loading = false
}) })
......
...@@ -233,14 +233,25 @@ export default { ...@@ -233,14 +233,25 @@ export default {
getDetail(id) { getDetail(id) {
this.loading = true this.loading = true
getDetail(id).then(({ data }) => { getDetail(id).then(({ data }) => {
this.form = data this.form.taskName = data.taskName || ''
this.tags = this.form.tagList this.form.welcomeMsg = data.welcomeMsg || ''
this.users = this.form.scopeList this.form.sendType = data.sendType || 0
this.groupQrCode = data.groupCodeInfo this.form.sendScope = data.sendScope || 0
this.form.groupCodeId = this.groupQrCode.id this.form.sendGender = data.sendGender || 0
this.dateRange = [this.form.cusBeginTime, this.form.cusEndTime]
this.tags = data.tagList || []
this.codes = [ data.groupCodeInfo ] 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
}) })
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!