|
@@ -59,10 +59,13 @@
|
|
|
<el-option v-for="item in channelOptions" :key="item.id" :label="item.channelName" :value="item.id"></el-option>
|
|
<el-option v-for="item in channelOptions" :key="item.id" :label="item.channelName" :value="item.id"></el-option>
|
|
|
</el-select>
|
|
</el-select>
|
|
|
</el-form-item>
|
|
</el-form-item>
|
|
|
- <el-form-item label="举办方" prop="organizerId">
|
|
|
|
|
|
|
+ <!-- <el-form-item label="举办方" prop="organizerId">
|
|
|
<el-select v-model="basicForm.organizerId" placeholder="请选择举办方" class="select-box" style="width: 440px;">
|
|
<el-select v-model="basicForm.organizerId" placeholder="请选择举办方" class="select-box" style="width: 440px;">
|
|
|
<el-option v-for="item in organizerOptions" :key="item.id" :label="item.channelName" :value="item.id"></el-option>
|
|
<el-option v-for="item in organizerOptions" :key="item.id" :label="item.channelName" :value="item.id"></el-option>
|
|
|
</el-select>
|
|
</el-select>
|
|
|
|
|
+ </el-form-item> -->
|
|
|
|
|
+ <el-form-item label="举办方" prop="organizerName">
|
|
|
|
|
+ <el-input v-model="basicForm.organizerName" placeholder="请输入举办方名称"></el-input>
|
|
|
</el-form-item>
|
|
</el-form-item>
|
|
|
<el-form-item label="活动列表图片" prop="coverFile" class="redLabel">
|
|
<el-form-item label="活动列表图片" prop="coverFile" class="redLabel">
|
|
|
<el-upload
|
|
<el-upload
|
|
@@ -100,7 +103,8 @@
|
|
|
</el-form>
|
|
</el-form>
|
|
|
<div class="btns adfac">
|
|
<div class="btns adfac">
|
|
|
<el-button type="primary" @click="handleNext">下一步</el-button>
|
|
<el-button type="primary" @click="handleNext">下一步</el-button>
|
|
|
- <el-button type="default" @click="handleBack" style="margin-left: 16px;">返回</el-button>
|
|
|
|
|
|
|
+ <el-button type="default" @click="handleTempSave" style="margin-left: 16px;">暂存</el-button>
|
|
|
|
|
+ <!-- <el-button type="default" @click="handleBack" style="margin-left: 16px;">返回</el-button> -->
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
|
<div class="form" v-else-if="tidx===2">
|
|
<div class="form" v-else-if="tidx===2">
|
|
@@ -196,6 +200,7 @@
|
|
|
</el-form>
|
|
</el-form>
|
|
|
<div class="btns adfac">
|
|
<div class="btns adfac">
|
|
|
<el-button type="default" @click="handlePrevious">上一步</el-button>
|
|
<el-button type="default" @click="handlePrevious">上一步</el-button>
|
|
|
|
|
+ <el-button type="default" @click="handleTempSave" style="margin-left: 16px;">暂存</el-button>
|
|
|
<el-button type="primary" @click="handleSave" style="margin-left: 16px;">发布</el-button>
|
|
<el-button type="primary" @click="handleSave" style="margin-left: 16px;">发布</el-button>
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
@@ -240,6 +245,7 @@ const getInitialBasicForm = () => ({
|
|
|
address: '',
|
|
address: '',
|
|
|
channelId: '',
|
|
channelId: '',
|
|
|
organizerId: '',
|
|
organizerId: '',
|
|
|
|
|
+ organizerName: '',
|
|
|
coverFile: '',
|
|
coverFile: '',
|
|
|
imageFiles: '',
|
|
imageFiles: '',
|
|
|
activityDetails: ''
|
|
activityDetails: ''
|
|
@@ -313,8 +319,11 @@ export default {
|
|
|
channelId: [
|
|
channelId: [
|
|
|
{ required: true, message: '请选择渠道方', trigger: 'change' }
|
|
{ required: true, message: '请选择渠道方', trigger: 'change' }
|
|
|
],
|
|
],
|
|
|
- organizerId: [
|
|
|
|
|
- { required: true, message: '请选择举办方', trigger: 'change' }
|
|
|
|
|
|
|
+ // organizerId: [
|
|
|
|
|
+ // { required: true, message: '请选择举办方', trigger: 'change' }
|
|
|
|
|
+ // ],
|
|
|
|
|
+ organizerName: [
|
|
|
|
|
+ { required: true, message: '请输入举办方名称', trigger: 'blur' }
|
|
|
]
|
|
]
|
|
|
},
|
|
},
|
|
|
url: `${window.SITE_CONFIG['apiURL']}/sys/oss/upload?token=${Cookies.get('token')}`,
|
|
url: `${window.SITE_CONFIG['apiURL']}/sys/oss/upload?token=${Cookies.get('token')}`,
|
|
@@ -401,8 +410,9 @@ export default {
|
|
|
this.basicForm.activityStartEnd = [this.basicForm.activityStartTime, this.basicForm.activityEndTime]
|
|
this.basicForm.activityStartEnd = [this.basicForm.activityStartTime, this.basicForm.activityEndTime]
|
|
|
this.basicForm.channelId = this.basicForm.channelId
|
|
this.basicForm.channelId = this.basicForm.channelId
|
|
|
this.basicForm.organizerId = this.basicForm.organizerId
|
|
this.basicForm.organizerId = this.basicForm.organizerId
|
|
|
- this.fileListCover = [{ name: '', url: res.data.coverFile }]
|
|
|
|
|
- this.fileListBanner = res.data.imageFiles.split(',').map(item => ({ name: '', url: item }))
|
|
|
|
|
|
|
+ this.basicForm.organizerName = this.basicForm.organizerName
|
|
|
|
|
+ if (res.data.coverFile) this.fileListCover = [{ name: '', url: res.data.coverFile }]
|
|
|
|
|
+ if (res.data.imageFiles) this.fileListBanner = res.data.imageFiles.split(',').map(item => ({ name: '', url: item }))
|
|
|
if (this.basicForm.cityId) {
|
|
if (this.basicForm.cityId) {
|
|
|
this.cityAreaDetailInfoList(this.basicForm.provinceId)
|
|
this.cityAreaDetailInfoList(this.basicForm.provinceId)
|
|
|
}
|
|
}
|
|
@@ -414,6 +424,15 @@ export default {
|
|
|
this.moreForm.userLevelFlag = +this.moreForm.userLevel === 0 ? 0 : 1
|
|
this.moreForm.userLevelFlag = +this.moreForm.userLevel === 0 ? 0 : 1
|
|
|
this.moreForm.userAgeFlag = +this.moreForm.userAgeMax === 0 ? 2 : 1
|
|
this.moreForm.userAgeFlag = +this.moreForm.userAgeMax === 0 ? 2 : 1
|
|
|
this.moreForm.state = !!res.data.state
|
|
this.moreForm.state = !!res.data.state
|
|
|
|
|
+
|
|
|
|
|
+ this.$nextTick(() => {
|
|
|
|
|
+ if (this.$refs.basicRef) {
|
|
|
|
|
+ this.$refs.basicRef.clearValidate()
|
|
|
|
|
+ }
|
|
|
|
|
+ if (this.$refs.moreRef) {
|
|
|
|
|
+ this.$refs.moreRef.clearValidate()
|
|
|
|
|
+ }
|
|
|
|
|
+ })
|
|
|
})
|
|
})
|
|
|
},
|
|
},
|
|
|
updateObjectFromSource (target, source) {
|
|
updateObjectFromSource (target, source) {
|
|
@@ -555,6 +574,19 @@ export default {
|
|
|
}
|
|
}
|
|
|
})
|
|
})
|
|
|
},
|
|
},
|
|
|
|
|
+ handleTempSave () {
|
|
|
|
|
+ let { signupStartEnd, activityStartEnd, ...newBasic } = JSON.parse(JSON.stringify(this.basicForm))
|
|
|
|
|
+ let { recruitmentFlag, userAgeFlag, userLevelFlag, ...newMore } = JSON.parse(JSON.stringify(this.moreForm))
|
|
|
|
|
+ let dto = { ...newBasic, ...newMore }
|
|
|
|
|
+ dto.activeState = -2
|
|
|
|
|
+ dto.state = 0
|
|
|
|
|
+
|
|
|
|
|
+ this.$http[dto.id ? 'put' : 'post']('/core/activity', dto).then(res => {
|
|
|
|
|
+ if (res.data.code !== 0) return this.$message.error(res.data.msg)
|
|
|
|
|
+ this.$message.success(dto.id ? '编辑' : '新增' + '草稿成功')
|
|
|
|
|
+ this.$router.push('/activity-list')
|
|
|
|
|
+ })
|
|
|
|
|
+ },
|
|
|
handlePrevious () {
|
|
handlePrevious () {
|
|
|
this.tidx = 1
|
|
this.tidx = 1
|
|
|
this.$nextTick(() => {
|
|
this.$nextTick(() => {
|