diff --git a/src/views/modules/heart/actinfo-add-or-update.vue b/src/views/modules/heart/actinfo-add-or-update.vue index ccfa747..e6eab41 100644 --- a/src/views/modules/heart/actinfo-add-or-update.vue +++ b/src/views/modules/heart/actinfo-add-or-update.vue @@ -52,6 +52,19 @@ + + + + + + @@ -110,6 +123,31 @@ placeholder="选择日期时间"> + + + + + + + + + + + + + - - - - - - @@ -325,7 +350,8 @@ export default { reward: '', actUserDefaultState: '1', isConReview: false, - kindnessTime: '' + kindnessTime: '', + periods: [] }, isImgRequired: true, mapSelectVisible: false, @@ -535,41 +561,6 @@ export default { this.dataForm.signinLongitude = position.longitude } }, - // 富文本编辑器 - // quillEditorHandle () { - // this.quillEditor = new Quill('#J_quillEditor', { - // modules: { - // toolbar: this.quillEditorToolbarOptions - // }, - // theme: 'snow' - // }) - // this.quillEditor.container.style.height = `${300}px` - // // // 自定义上传图片功能 (使用element upload组件) - // this.quillEditor.getModule('toolbar').addHandler('image', () => { - // this.$refs.uploadBtn.$el.click() - // }) - // // 监听内容变化,动态赋值 - // this.quillEditor.on('text-change', () => { - // this.dataForm.actContent = this.quillEditor.root.innerHTML - // if ((this.dataForm.actContent).length > 10000) { - // return this.$message.error('您输入的的内容已超过字数') - // } - // }) - // }, - // // 上传图片之前 (富文本) - // uploadBeforeUploadHandle (file) { - // if (file.type !== 'image/jpg' && file.type !== 'image/jpeg' && file.type !== 'image/png' && file.type !== 'image/gif') { - // this.$message.error(this.$t('upload.tip', { 'format': 'jpg、png、gif' })) - // return false - // } - // }, - // // 上传图片成功 (富文本) - // uploadSuccessHandle (res, file, fileList) { - // if (res.code !== 0) { - // return this.$message.error(res.msg) - // } - // this.quillEditor.insertEmbed(this.quillEditor.getSelection().index, 'image', res.data.url) - // }, setRegistTime () { this.dataForm.newsReleaseStartTime = this.time[0] this.dataForm.newsReleaseEndTime = this.time[1] @@ -601,6 +592,11 @@ export default { if (!valid) { return false } + for (let i = 0; i < this.dataForm.periods.length; i++) { + if (this.dataForm.periods[i].actPeriodStartTime === null || this.dataForm.periods[i].actPeriodStartTime === '' || this.dataForm.periods[i].actPeriodEndTime === null || this.dataForm.periods[i].actPeriodEndTime === '') { + return this.$message.error('请将活动时间段填写完整') + } + } this.isAble = true this.$http[!this.dataForm.id ? 'post' : 'put']('/heart/actinfo/', this.dataForm).then(({ data: res }) => { if (!this.isFirst && res.code === 533) { @@ -656,6 +652,12 @@ export default { this.$nextTick(() => { this.$refs.mapSelect.init(type, this.dataForm.clockRadius) }) + }, + plusPeriod () { + this.dataForm.periods.push({ 'actPeriodStartTime': '', 'actPeriodEndTime': '' }) + }, + minusPeriod () { + this.dataForm.periods.pop() } }, components: { diff --git a/src/views/modules/heart/actinfo-detail-view.vue b/src/views/modules/heart/actinfo-detail-view.vue index 53708c9..2c846ac 100644 --- a/src/views/modules/heart/actinfo-detail-view.vue +++ b/src/views/modules/heart/actinfo-detail-view.vue @@ -28,6 +28,12 @@ {{dataForm.requirement}} + + + {{dataForm.sponsor}} + + @@ -65,6 +71,17 @@ {{dataForm.actEndTime}} + + + {{period.actPeriodStartTime}} + + + {{period.actPeriodEndTime}} + + @@ -116,12 +133,6 @@ {{dataForm.tel}} - - - {{dataForm.sponsor}} - - @@ -195,7 +206,8 @@ export default { punishmentPoints: '', actUserDefaultState: '1', reward: '', - kindnessTime: '' + kindnessTime: '', + periods: [] }, loading: false } diff --git a/src/views/modules/heart/actuserrelation-detail.vue b/src/views/modules/heart/actuserrelation-detail.vue index a22d042..88de777 100644 --- a/src/views/modules/heart/actuserrelation-detail.vue +++ b/src/views/modules/heart/actuserrelation-detail.vue @@ -18,6 +18,13 @@ {{dataForm.identityNo}} + + + + + {{ period.actPeriodStartTime }} 至 {{ period.actPeriodEndTime }} + + {{formatState(dataForm.status)}} diff --git a/src/views/modules/heart/actuserrelation.vue b/src/views/modules/heart/actuserrelation.vue index 224ce70..550db15 100644 --- a/src/views/modules/heart/actuserrelation.vue +++ b/src/views/modules/heart/actuserrelation.vue @@ -46,34 +46,42 @@ @selection-change="dataListSelectionChangeHandle" style="width: 100%;" > - - + - - - - + + + + + + + + {{ period.actPeriodStartTime }} 至 {{ period.actPeriodEndTime }} + + + + - - +