Commit cfa587ef by 胡悦

提交

1 parent d2b11524
...@@ -352,9 +352,10 @@ export default { ...@@ -352,9 +352,10 @@ export default {
params.sendType = this.basicForm.sendType params.sendType = this.basicForm.sendType
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 attachmentList = previewList.map(item => { const attachmentList = previewList.map(item => {
// const attachmentList = this.$common.utils.deepClone(this.$refs.welcome.previewList).map(item => {
if (item.attType == 1) { if (item.attType == 1) {
item.attContent = item.attContent.replace('@昵称', '[@昵称]') item.attContent = item.attContent.replace('@昵称', '[@昵称]')
} else if (item.attType == 7) {
item.attContent = JSON.stringify(item.attContent)
} }
return item return item
}) })
......
...@@ -225,10 +225,20 @@ export default { ...@@ -225,10 +225,20 @@ export default {
this.$refs.groupForm.validate(v => { this.$refs.groupForm.validate(v => {
const params = { const params = {
type: 2, type: 2,
attachmentList: this.basicForm.attachmentList, // attachmentList: this.basicForm.attachmentList,
sendType: this.basicForm.sendType, sendType: this.basicForm.sendType,
massName: this.basicForm.massName massName: this.basicForm.massName
} }
const previewList = this.$common ? this.$common.utils.deepClone(this.$refs.welcome.previewList) : this.$refs.welcome.previewList
const attachmentList = previewList.map(item => {
if (item.attType == 1) {
item.attContent = item.attContent.replace('@昵称', '[@昵称]')
} else if (item.attType == 7) {
item.attContent = JSON.stringify(item.attContent)
}
return item
})
params.attachmentList = attachmentList
params.userList = this.basicForm.userList.map(item => { params.userList = this.basicForm.userList.map(item => {
return { return {
staffId: item.staffId, staffId: item.staffId,
......
...@@ -117,7 +117,11 @@ export default { ...@@ -117,7 +117,11 @@ export default {
this.$apis.customerTransform.customerDetail({ id }).then(res => { this.$apis.customerTransform.customerDetail({ id }).then(res => {
console.log(res) console.log(res)
this.basicInfo = res this.basicInfo = res
this.eventBus.$emit('update', this.basicInfo.attachmentList) const previewList = res.attachmentList.map(item => {
if (item.attType == 7) item.attContent = JSON.parse(item.attContent)
return item
})
this.eventBus.$emit('update', previewList)
}) })
}, },
getStatistic() { getStatistic() {
......
...@@ -263,11 +263,25 @@ export default { ...@@ -263,11 +263,25 @@ export default {
}, },
selectActivity(val) { selectActivity(val) {
console.log(val) console.log(val)
let idx
const hasActivity = this.previewList.some((item, index) => {
if (item.attType == 7) {
idx = index
return item
}
})
if (val) { if (val) {
this.previewList.push({ if (hasActivity) {
attContent: val, this.$set(this.previewList, idx, {
attType: ATT_TYPE.ACTIVITY attContent: val,
}) attType: ATT_TYPE.ACTIVITY
})
} else {
this.previewList.push({
attContent: val,
attType: ATT_TYPE.ACTIVITY
})
}
} }
}, },
insertHtmlAtCaret(html) { insertHtmlAtCaret(html) {
......
...@@ -348,11 +348,12 @@ export default { ...@@ -348,11 +348,12 @@ export default {
this.equityStatistical() this.equityStatistical()
this.merchantStatistical() this.merchantStatistical()
}, },
dateChange(val) { dateChange(val, pointUnit = 1) {
console.log(val) console.log(val)
const params = { const params = {
dataStartDateStr: dayjs(val[0]).format('YYYY-MM-DD'), dataStartDateStr: dayjs(val[0]).format('YYYY-MM-DD'),
dataEndDateStr: dayjs(val[1]).format('YYYY-MM-DD') dataEndDateStr: dayjs(val[1]).format('YYYY-MM-DD'),
pointUnit
} }
this.timePeriodStatistics(params) this.timePeriodStatistics(params)
}, },
...@@ -386,7 +387,7 @@ export default { ...@@ -386,7 +387,7 @@ export default {
// endTime = new Date(nowYear, 11, 31) // endTime = new Date(nowYear, 11, 31)
this.$set(this.date, 0, startTime) this.$set(this.date, 0, startTime)
this.$set(this.date, 1, endTime) this.$set(this.date, 1, endTime)
this.dateChange(this.date) this.dateChange(this.date, 2)
break break
} }
}, },
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!