|
|
@ -20,9 +20,12 @@ |
|
|
|
</el-form-item> |
|
|
|
|
|
|
|
<el-form-item label="活动时间" prop="startTime" label-width="130px"> |
|
|
|
<el-date-picker v-model.trim="timeRange" size="small" style="width: 260px;" type="daterange" |
|
|
|
<!-- <el-date-picker v-model.trim="timeRange" size="small" style="width: 260px;" type="daterange" |
|
|
|
value-format="yyyy-MM-dd HH:mm:ss" @change="handleTimeChange" range-separator="至" |
|
|
|
start-placeholder="开始时间" end-placeholder="结束时间"> |
|
|
|
</el-date-picker> --> |
|
|
|
<el-date-picker v-model.trim="timeRange" type="datetimerange" range-separator="至" |
|
|
|
start-placeholder="开始日期" end-placeholder="结束日期" @change="handleTimeChange"> |
|
|
|
</el-date-picker> |
|
|
|
</el-form-item> |
|
|
|
|
|
|
@ -42,8 +45,8 @@ |
|
|
|
|
|
|
|
<el-form-item label="活动封面图" label-width="140px" prop="coverPic"> |
|
|
|
<template> |
|
|
|
<upload-image :defaultFileList="fileList" :limit="1" |
|
|
|
@change="onChangeFileList" @file-removed="removedImg"></upload-image> |
|
|
|
<upload-image :defaultFileList="fileList" :limit="1" @change="onChangeFileList" |
|
|
|
@file-removed="removedImg"></upload-image> |
|
|
|
</template> |
|
|
|
</el-form-item> |
|
|
|
|
|
|
@ -64,20 +67,24 @@ |
|
|
|
:reserve-keyword="true" placeholder="请输入关键词" :remote-method="remoteMethod" |
|
|
|
:loading="loading"> |
|
|
|
<el-option v-for="(item, index) in searchOptions" @click.native="handleClickKey(index)" |
|
|
|
:key="item.value||index" :label="item.label" :value="item.value"> |
|
|
|
:key="item.value || index" :label="item.label" :value="item.value"> |
|
|
|
</el-option> |
|
|
|
</el-select> |
|
|
|
<div id="app_activity" class="div_map"></div> |
|
|
|
</div> |
|
|
|
</el-form-item> |
|
|
|
|
|
|
|
<el-form-item label="线上报名" style="display: block" prop="peopleCount" label-width="150px"> |
|
|
|
<el-form-item v-if="formType!=='records'" label="线上报名" style="display: block" prop="peopleCount" label-width="150px"> |
|
|
|
<el-switch v-model="online" @change="handleOnlineRegistration"></el-switch> |
|
|
|
</el-form-item> |
|
|
|
</div> |
|
|
|
|
|
|
|
<div v-if="records"> |
|
|
|
<div v-if="!online"> |
|
|
|
<el-form-item label="活动人数" label-width="140px"> |
|
|
|
<el-input-number v-model="formData.participants" @change="handleChange" :min="1" :max="10" |
|
|
|
label="描述文字"></el-input-number> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item label="活动总结" prop="sumUp" label-width="150px" style="display: block"> |
|
|
|
<div class="item_width_1"> |
|
|
|
<!-- <el-input type="textarea" autosize placeholder="请输入内容" v-model.trim="formData.sumUp"> |
|
|
@ -198,9 +205,9 @@ export default { |
|
|
|
} |
|
|
|
return { |
|
|
|
fileList: [],//封面图片 |
|
|
|
activityImgs:[],//活动照片 |
|
|
|
activityImgs: [],//活动照片 |
|
|
|
formType: 'add', //表单操作类型 add新增,edit编辑,records记录 |
|
|
|
records:false, |
|
|
|
records: false, |
|
|
|
searchOptions: [], |
|
|
|
searchValue: '', |
|
|
|
resultList: [], |
|
|
@ -208,7 +215,7 @@ export default { |
|
|
|
loading: false, |
|
|
|
timeRange: [], |
|
|
|
online: false, |
|
|
|
summary:true, |
|
|
|
summary: true, |
|
|
|
|
|
|
|
btnDisable: false, |
|
|
|
|
|
|
@ -254,7 +261,7 @@ export default { |
|
|
|
// }); |
|
|
|
// console.log('this.formData.activityImgs',res.data.url) |
|
|
|
this.formData.activityImgs.push(res.data.url); |
|
|
|
|
|
|
|
|
|
|
|
} else { |
|
|
|
this.$message.error(res.msg); |
|
|
|
} |
|
|
@ -353,11 +360,11 @@ export default { |
|
|
|
// this.formData.coverPic = ob.fileUrl; |
|
|
|
// } |
|
|
|
// }, |
|
|
|
removedImg(){ |
|
|
|
removedImg() { |
|
|
|
this.formData.coverPic = '' |
|
|
|
}, |
|
|
|
onChangeFileList(e) { |
|
|
|
console.log(e,'sssssb'); |
|
|
|
console.log(e, 'sssssb'); |
|
|
|
this.fileList = e.length > 0 ? e.map(item => ({ |
|
|
|
fileType: '0', |
|
|
|
fileUrl: item.response.data.url |
|
|
@ -402,9 +409,11 @@ export default { |
|
|
|
}, |
|
|
|
handleTimeChange(time) { |
|
|
|
if (time) { |
|
|
|
const startTimeArray = util.dateFormatter(time[0], 'date').split('-') |
|
|
|
const endTimeArray = util.dateFormatter(time[1], 'date').split('-') |
|
|
|
|
|
|
|
console.log(time); |
|
|
|
const startTimeArray = util.dateFormatter(time[0], 'time').split('-') |
|
|
|
console.log(startTimeArray); |
|
|
|
const endTimeArray = util.dateFormatter(time[1], 'time').split('-') |
|
|
|
console.log(endTimeArray); |
|
|
|
this.formData.startTime = startTimeArray[0] + '-' + startTimeArray[1] + '-' + startTimeArray[2] + ' 00:00:00' |
|
|
|
this.formData.endTime = endTimeArray[0] + '-' + endTimeArray[1] + '-' + endTimeArray[2] + ' 23:59:59' |
|
|
|
// this.startTimeShow = startTimeArray[0] + '年' + startTimeArray[1] + '月' + startTimeArray[2] + '日' |
|
|
@ -429,10 +438,10 @@ export default { |
|
|
|
} |
|
|
|
}) |
|
|
|
this.formType = type |
|
|
|
if (type === 'edit' ) { |
|
|
|
if(activityId.activityImgs || activityId.sumUp){ |
|
|
|
if (type === 'edit') { |
|
|
|
if (activityId.activityImgs || activityId.sumUp) { |
|
|
|
this.records = true |
|
|
|
}else{ |
|
|
|
} else { |
|
|
|
this.records = false |
|
|
|
} |
|
|
|
this.formData = activityId |
|
|
@ -444,19 +453,19 @@ export default { |
|
|
|
}; |
|
|
|
this.fileList = [ob]; |
|
|
|
this.formData.coverPic = ob.fileUrl; |
|
|
|
if(this.formData.online == 1){ |
|
|
|
if (this.formData.online == 1) { |
|
|
|
this.online = true |
|
|
|
} |
|
|
|
} |
|
|
|
}else if (type === 'records') { |
|
|
|
} else if (type === 'records') { |
|
|
|
this.records = true |
|
|
|
}else if(type === 'summary'){ |
|
|
|
} else if (type === 'summary') { |
|
|
|
this.formData = activityId |
|
|
|
this.formData.activityImgs = [] |
|
|
|
console.log("this.formData",this.formData) |
|
|
|
console.log("this.formData", this.formData) |
|
|
|
this.records = true |
|
|
|
this.summary = false |
|
|
|
}else{ |
|
|
|
} else { |
|
|
|
this.records = false |
|
|
|
} |
|
|
|
this.endLoading() |
|
|
@ -555,16 +564,16 @@ export default { |
|
|
|
}, 10000) |
|
|
|
// console.log("data/actual/base/communityActivity/save",this.formData) |
|
|
|
this.$refs['ref_form'].validate((valid, messageObj) => { |
|
|
|
this.formData.sendMessage = this.formData.sendMessage ? 1 : 0; |
|
|
|
console.log(this.formData,"2234323424") |
|
|
|
this.formData.sendMessage = this.formData.sendMessage ? 1 : 0; |
|
|
|
console.log(this.formData, "2234323424") |
|
|
|
const dateObj = this.formData.startTime.split(' '); |
|
|
|
const formattedDate = dateObj[0]; // 获取日期部分,即 '2424-10-22' |
|
|
|
if(this.formData.cutOffTime != '' && formattedDate <= this.formData.cutOffTime){ |
|
|
|
if (this.formData.cutOffTime != '' && formattedDate <= this.formData.cutOffTime) { |
|
|
|
this.$message.error('报名截止时间要小于活动开始时间') |
|
|
|
}else if (!valid) { |
|
|
|
} else if (!valid) { |
|
|
|
app.util.validateRule(messageObj) |
|
|
|
this.btnDisable = false |
|
|
|
} else{ |
|
|
|
} else { |
|
|
|
this.addActivity() |
|
|
|
} |
|
|
|
}) |
|
|
@ -585,7 +594,7 @@ export default { |
|
|
|
this.btnDisable = false |
|
|
|
this.$message.error(msg) |
|
|
|
} |
|
|
|
}else{ |
|
|
|
} else { |
|
|
|
let url = '/actual/base/communityActivity/save' |
|
|
|
const { data, code, msg } = await requestPost(url, this.formData) |
|
|
|
if (code === 0) { |
|
|
@ -601,7 +610,7 @@ export default { |
|
|
|
this.$message.error(msg) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
@ -652,13 +661,13 @@ export default { |
|
|
|
this.formData.address = data.address |
|
|
|
this.searchValue = data.address |
|
|
|
this.searchOptions = [] |
|
|
|
console.log('data,this.searchValue ',this.searchValue ) |
|
|
|
console.log('data,this.searchValue ', this.searchValue) |
|
|
|
|
|
|
|
} |
|
|
|
}, |
|
|
|
|
|
|
|
async remoteMethod(query) { |
|
|
|
console.log(query,"sfsvsdv"); |
|
|
|
console.log(query, "sfsvsdv"); |
|
|
|
if (query !== '') { |
|
|
|
this.loading = true; |
|
|
|
const { msg, data } = await map.searchNearby(query); |
|
|
@ -669,12 +678,12 @@ export default { |
|
|
|
|
|
|
|
if (data.resultList && data.resultList.length > 0) { |
|
|
|
this.resultList = data.resultList |
|
|
|
console.log(this.resultList,"this.resultList"); |
|
|
|
console.log(this.resultList, "this.resultList"); |
|
|
|
this.searchOptions = this.resultList.map(item => { |
|
|
|
return { value: `${item.id}`, label: `${item.address + item.name}` }; |
|
|
|
|
|
|
|
}); |
|
|
|
console.log(this.searchOptions,"this.searchOptions"); |
|
|
|
console.log(this.searchOptions, "this.searchOptions"); |
|
|
|
} |
|
|
|
} else { |
|
|
|
this.searchOptions = [ |
|
|
@ -708,8 +717,8 @@ export default { |
|
|
|
this.activityId = '' |
|
|
|
this.keyWords = '' |
|
|
|
this.online = false |
|
|
|
this.formType='' |
|
|
|
this.summary=true |
|
|
|
this.formType = '' |
|
|
|
this.summary = true |
|
|
|
this.formData = { |
|
|
|
id: "", |
|
|
|
typeId: "", |
|
|
@ -757,13 +766,13 @@ export default { |
|
|
|
activityName: [ |
|
|
|
{ required: true, message: '活动名称不能为空', trigger: 'blur' } |
|
|
|
], |
|
|
|
typeId:[ |
|
|
|
typeId: [ |
|
|
|
{ required: true, message: '请选择活动类型', trigger: 'blur' } |
|
|
|
], |
|
|
|
startTime:[ |
|
|
|
startTime: [ |
|
|
|
{ required: true, message: '请选择活动时间', trigger: 'blur' } |
|
|
|
], |
|
|
|
coverPic:[ |
|
|
|
coverPic: [ |
|
|
|
{ required: true, message: '请选择活动封面图', trigger: 'blur' } |
|
|
|
], |
|
|
|
content: [ |
|
|
|