|
|
|
@ -1,6 +1,6 @@ |
|
|
|
|
<template> |
|
|
|
|
<!-- 大赛详情 --> |
|
|
|
|
<div style="padding: 24px" @click="test"> |
|
|
|
|
<div style="padding: 24px"> |
|
|
|
|
<div class="page-content"> |
|
|
|
|
<el-form label-width="170px" label-suffix=":" size="small"> |
|
|
|
|
<el-form-item label="竞赛封面(选填)"> |
|
|
|
@ -17,7 +17,7 @@ |
|
|
|
|
:headers="headers" |
|
|
|
|
name="file" |
|
|
|
|
> |
|
|
|
|
<img v-if="coverUrl" :src="coverUrl" class="avatar"> |
|
|
|
|
<img v-if="form.coverUrl" :src="form.coverUrl" class="avatar"> |
|
|
|
|
<div class="uploader-default" v-else> |
|
|
|
|
<i class="el-icon-plus"></i> |
|
|
|
|
<p>上传封面</p> |
|
|
|
@ -41,7 +41,7 @@ |
|
|
|
|
:headers="headers" |
|
|
|
|
name="file" |
|
|
|
|
> |
|
|
|
|
<img v-if="carouselUrl" :src="carouselUrl" class="avatar-lg"> |
|
|
|
|
<img v-if="form.carouselUrl" :src="form.carouselUrl" class="avatar-lg"> |
|
|
|
|
<div class="uploader-default" v-else> |
|
|
|
|
<i class="el-icon-plus"></i> |
|
|
|
|
<p>上传封面</p> |
|
|
|
@ -53,14 +53,14 @@ |
|
|
|
|
</el-form-item> |
|
|
|
|
<el-form-item label="竞赛名称"> |
|
|
|
|
<div class="d-inline-block"> |
|
|
|
|
<el-input placeholder="请输入竞赛名称" v-model="name" clearable></el-input> |
|
|
|
|
<el-input placeholder="请输入竞赛名称" v-model="form.name" clearable></el-input> |
|
|
|
|
</div> |
|
|
|
|
</el-form-item> |
|
|
|
|
<el-form-item label="主办方"> |
|
|
|
|
<div class="inline-input"> |
|
|
|
|
<div class="input-wrap" v-for="(item,index) in sponsorList" :key="index"> |
|
|
|
|
<el-input placeholder="主办方名称" v-model="sponsorList[index]"></el-input> |
|
|
|
|
<i v-if="sponsorList.length > 1" class="remove" @click="delSponsor(index)"></i> |
|
|
|
|
<div class="input-wrap" v-for="(item,index) in form.sponsorList" :key="index"> |
|
|
|
|
<el-input placeholder="主办方名称" v-model="form.sponsorList[index]"></el-input> |
|
|
|
|
<i v-if="form.sponsorList.length > 1" class="remove" @click="delSponsor(index)"></i> |
|
|
|
|
<button v-if="index == 0" class="add-btn" @click="addSponsor"> |
|
|
|
|
<i class="el-icon-plus"></i> |
|
|
|
|
<span>添加</span> |
|
|
|
@ -70,32 +70,32 @@ |
|
|
|
|
</el-form-item> |
|
|
|
|
<el-form-item label="承办方(选填)"> |
|
|
|
|
<div class="inline-input"> |
|
|
|
|
<div class="input-wrap" v-for="(item,index) in undertakerList" :key="index"> |
|
|
|
|
<el-input placeholder="承办方名称" v-model="undertakerList[index]"></el-input> |
|
|
|
|
<i v-if="undertakerList.length > 1" class="remove" @click="delOrganizer(index)"></i> |
|
|
|
|
<div class="input-wrap" v-for="(item,index) in form.undertakerList" :key="index"> |
|
|
|
|
<el-input placeholder="承办方名称" v-model="form.undertakerList[index]"></el-input> |
|
|
|
|
<i v-if="form.undertakerList.length > 1" class="remove" @click="delOrganizer(index)"></i> |
|
|
|
|
<button v-if="index == 0" class="add-btn" @click="addOrganizer"> |
|
|
|
|
<i class="el-icon-plus"></i> |
|
|
|
|
<span>添加</span> |
|
|
|
|
</button> |
|
|
|
|
</div> |
|
|
|
|
</div> |
|
|
|
|
<button v-if="!undertakerList.length" class="add-btn" @click="addOrganizer"> |
|
|
|
|
<button v-if="!form.undertakerList.length" class="add-btn" @click="addOrganizer"> |
|
|
|
|
<i class="el-icon-plus"></i> |
|
|
|
|
<span>添加</span> |
|
|
|
|
</button> |
|
|
|
|
</el-form-item> |
|
|
|
|
<el-form-item label="报名时间"> |
|
|
|
|
<el-date-picker v-model="signupTime" value-format="yyyy-MM-dd HH:mm:ss" type="datetimerange" range-separator="-" start-placeholder="开始日期" end-placeholder="结束日期"></el-date-picker> |
|
|
|
|
<el-date-picker v-model="form.signupTime" value-format="yyyy-MM-dd HH:mm:ss" type="datetimerange" range-separator="-" start-placeholder="开始日期" end-placeholder="结束日期"></el-date-picker> |
|
|
|
|
</el-form-item> |
|
|
|
|
<el-form-item label="竞赛时间"> |
|
|
|
|
<el-date-picker v-model="playTime" value-format="yyyy-MM-dd HH:mm:ss" type="datetimerange" range-separator="-" start-placeholder="开始日期" end-placeholder="结束日期"></el-date-picker> |
|
|
|
|
<el-date-picker v-model="form.playTime" value-format="yyyy-MM-dd HH:mm:ss" type="datetimerange" range-separator="-" start-placeholder="开始日期" end-placeholder="结束日期"></el-date-picker> |
|
|
|
|
</el-form-item> |
|
|
|
|
<el-form-item label="竞赛详情"> |
|
|
|
|
<quill :border="true" v-model="description" :height="400" /> |
|
|
|
|
<quill :border="true" v-model="form.description" :height="400" /> |
|
|
|
|
</el-form-item> |
|
|
|
|
<el-form-item> |
|
|
|
|
<el-button v-throttle @click="save(1)">保存</el-button> |
|
|
|
|
<el-button type="primary" v-if="publishStatus == 1" v-throttle @click="save(0)">发布</el-button> |
|
|
|
|
<el-button type="primary" v-if="form.publishStatus == 1" v-throttle @click="save(0)">发布</el-button> |
|
|
|
|
</el-form-item> |
|
|
|
|
</el-form> |
|
|
|
|
</div> |
|
|
|
@ -117,33 +117,46 @@ export default { |
|
|
|
|
token: util.local.get(Setting.tokenKey) |
|
|
|
|
}, |
|
|
|
|
id: this.$route.query.id, |
|
|
|
|
coverUrl: "", |
|
|
|
|
carouselUrl: "", |
|
|
|
|
publishStatus: 0, |
|
|
|
|
uploadList: [], |
|
|
|
|
uploadDataList: [], |
|
|
|
|
name: "", |
|
|
|
|
sponsor: "", |
|
|
|
|
sponsorList: [""], |
|
|
|
|
undertaker: "", |
|
|
|
|
undertakerList: [], |
|
|
|
|
signUpStartTime: "", |
|
|
|
|
signUpEndTime: "", |
|
|
|
|
signupTime: "", |
|
|
|
|
playTime: "", |
|
|
|
|
playStartTime: "", |
|
|
|
|
playEndTime: "", |
|
|
|
|
description: "", |
|
|
|
|
touchTime:0, |
|
|
|
|
form: { |
|
|
|
|
coverUrl: '', |
|
|
|
|
carouselUrl: '', |
|
|
|
|
publishStatus: 0, |
|
|
|
|
uploadList: [], |
|
|
|
|
uploadDataList: [], |
|
|
|
|
name: '', |
|
|
|
|
sponsor: '', |
|
|
|
|
sponsorList: [''], |
|
|
|
|
undertaker: '', |
|
|
|
|
undertakerList: [], |
|
|
|
|
signUpStartTime: '', |
|
|
|
|
signUpEndTime: '', |
|
|
|
|
signupTime: '', |
|
|
|
|
playTime: '', |
|
|
|
|
playStartTime: '', |
|
|
|
|
playEndTime: '', |
|
|
|
|
description: '' |
|
|
|
|
}, |
|
|
|
|
updateTime: 0 |
|
|
|
|
}; |
|
|
|
|
}, |
|
|
|
|
created() { |
|
|
|
|
}, |
|
|
|
|
components: { |
|
|
|
|
quill |
|
|
|
|
}, |
|
|
|
|
computed: { |
|
|
|
|
wait() { |
|
|
|
|
return this.$store.state.match.wait |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
watch: { |
|
|
|
|
signupTime: function(val) { |
|
|
|
|
// 监听信息是否有更改,有的话页面离开的时候要询问是否要保存 |
|
|
|
|
form: { |
|
|
|
|
handler(){ |
|
|
|
|
this.updateTime++ |
|
|
|
|
if(this.updateTime > 1) this.$store.commit('match/setWait', 0) |
|
|
|
|
}, |
|
|
|
|
deep:true |
|
|
|
|
}, |
|
|
|
|
'form.signupTime': function(val) { |
|
|
|
|
if (val) { |
|
|
|
|
this.signUpStartTime = val[0]; |
|
|
|
|
this.signUpEndTime = val[1]; |
|
|
|
@ -152,7 +165,7 @@ export default { |
|
|
|
|
this.signUpEndTime = ""; |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
playTime: function(val) { |
|
|
|
|
'form.playTime': function(val) { |
|
|
|
|
if (val) { |
|
|
|
|
this.playStartTime = val[0]; |
|
|
|
|
this.playEndTime = val[1]; |
|
|
|
@ -168,10 +181,6 @@ export default { |
|
|
|
|
EventBus.$on("tabClickWait0", () => this.waitSave()); |
|
|
|
|
}, |
|
|
|
|
methods: { |
|
|
|
|
test() { |
|
|
|
|
this.$store.commit("match/setWait", 0); |
|
|
|
|
// console.log(this.$store.state.match.waitIndex) |
|
|
|
|
}, |
|
|
|
|
...mapActions("match", [ |
|
|
|
|
"setMatchId" |
|
|
|
|
]), |
|
|
|
@ -192,107 +201,87 @@ export default { |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
}, |
|
|
|
|
save(status, judge=true) { |
|
|
|
|
this.touchTime = 0 |
|
|
|
|
this.sponsor = this.sponsorList.filter(d => d).join(); |
|
|
|
|
this.undertaker = this.undertakerList.filter(d => d).join(); |
|
|
|
|
if (!this.name) return util.warningMsg("请填写竞赛名称"); |
|
|
|
|
save(status, back = 1) { |
|
|
|
|
const form = this.form |
|
|
|
|
const sponsor = form.sponsorList.filter(d => d).join(); |
|
|
|
|
if (!form.name) return util.warningMsg("请填写竞赛名称"); |
|
|
|
|
if (status == 0) { |
|
|
|
|
if (!this.sponsor) return util.warningMsg("请填写主办方"); |
|
|
|
|
if (!this.signUpStartTime) return util.warningMsg("请选择报名时间"); |
|
|
|
|
if (!sponsor) return util.warningMsg("请填写主办方"); |
|
|
|
|
if (!form.signUpStartTime) return util.warningMsg("请选择报名时间"); |
|
|
|
|
} |
|
|
|
|
let now = new Date().getTime(); |
|
|
|
|
let signUpStartTime = new Date(this.signUpStartTime).getTime(); |
|
|
|
|
let signUpEndTime = new Date(this.signUpEndTime).getTime(); |
|
|
|
|
let playStartTime = new Date(this.playStartTime).getTime(); |
|
|
|
|
let signUpStartTime = new Date(form.signUpStartTime).getTime(); |
|
|
|
|
let signUpEndTime = new Date(form.signUpEndTime).getTime(); |
|
|
|
|
let playStartTime = new Date(form.playStartTime).getTime(); |
|
|
|
|
// if(signUpStartTime && now > signUpStartTime) return this.$$message.warning('报名时间不能早于当前时间') |
|
|
|
|
if (!this.playStartTime && status == 0) return util.warningMsg("请选择竞赛时间"); |
|
|
|
|
if (!form.playStartTime && status == 0) return util.warningMsg("请选择竞赛时间"); |
|
|
|
|
if (playStartTime && playStartTime < signUpEndTime) return util.warningMsg("竞赛时间不能早于报名结束时间"); |
|
|
|
|
if (!this.description && status == 0) return util.warningMsg("请填写竞赛详情"); |
|
|
|
|
if (!form.description && status == 0) return util.warningMsg("请填写竞赛详情"); |
|
|
|
|
let data = { |
|
|
|
|
id: this.id, |
|
|
|
|
coverUrl: this.coverUrl, |
|
|
|
|
carouselUrl: this.carouselUrl, |
|
|
|
|
description: this.description, |
|
|
|
|
coverUrl: form.coverUrl, |
|
|
|
|
carouselUrl: form.carouselUrl, |
|
|
|
|
description: form.description, |
|
|
|
|
founderId: 1, |
|
|
|
|
name: this.name, |
|
|
|
|
playEndTime: this.playEndTime, |
|
|
|
|
playStartTime: this.playStartTime, |
|
|
|
|
publishStatus: status ? this.publishStatus : 0, |
|
|
|
|
signUpEndTime: this.signUpEndTime, |
|
|
|
|
signUpStartTime: this.signUpStartTime, |
|
|
|
|
sponsor: this.sponsor, |
|
|
|
|
undertaker: this.undertaker |
|
|
|
|
name: form.name, |
|
|
|
|
playEndTime: form.playEndTime, |
|
|
|
|
playStartTime: form.playStartTime, |
|
|
|
|
publishStatus: status ? form.publishStatus : 0, |
|
|
|
|
signUpEndTime: form.signUpEndTime, |
|
|
|
|
signUpStartTime: form.signUpStartTime, |
|
|
|
|
sponsor, |
|
|
|
|
undertaker: form.undertakerList.filter(d => d).join() |
|
|
|
|
}; |
|
|
|
|
this.$store.commit("match/setWait", 999); |
|
|
|
|
if (this.id) { |
|
|
|
|
this.$put(this.api.editContest, data).then(res => { |
|
|
|
|
util.successMsg("修改成功"); |
|
|
|
|
if(judge) { |
|
|
|
|
this.$router.back(); |
|
|
|
|
} |
|
|
|
|
util.successMsg("修改成功") |
|
|
|
|
back && this.$router.back() |
|
|
|
|
}).catch(err => { |
|
|
|
|
}); |
|
|
|
|
} else { |
|
|
|
|
this.$post(this.api.addContest, data).then(res => { |
|
|
|
|
util.successMsg("创建成功"); |
|
|
|
|
if(judge) { |
|
|
|
|
this.$router.back(); |
|
|
|
|
} |
|
|
|
|
util.successMsg("创建成功") |
|
|
|
|
back && this.$router.back() |
|
|
|
|
}).catch(err => { |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
getData() { |
|
|
|
|
this.$get(this.api.getContest + "/" + this.id).then(res => { |
|
|
|
|
let data = res.contest; |
|
|
|
|
this.coverUrl = data.coverUrl; |
|
|
|
|
this.carouselUrl = data.carouselUrl; |
|
|
|
|
this.description = data.description; |
|
|
|
|
this.name = data.name; |
|
|
|
|
this.playEndTime = data.playEndTime; |
|
|
|
|
this.playStartTime = data.playStartTime; |
|
|
|
|
this.publishStatus = data.publishStatus; |
|
|
|
|
this.signUpEndTime = data.signUpEndTime; |
|
|
|
|
this.signUpStartTime = data.signUpStartTime; |
|
|
|
|
this.sponsor = data.sponsor; |
|
|
|
|
this.undertaker = data.undertaker; |
|
|
|
|
this.signupTime = [data.signUpStartTime, data.signUpEndTime]; |
|
|
|
|
this.playTime = [data.playStartTime, data.playEndTime]; |
|
|
|
|
this.sponsorList = data.sponsor.split(","); |
|
|
|
|
this.undertakerList = data.undertaker.split(","); |
|
|
|
|
}).catch(err => { |
|
|
|
|
}); |
|
|
|
|
const data = res.contest |
|
|
|
|
data.signupTime = [data.signUpStartTime, data.signUpEndTime] |
|
|
|
|
data.playTime = [data.playStartTime, data.playEndTime] |
|
|
|
|
data.sponsorList = data.sponsor.split(",") |
|
|
|
|
data.undertakerList = data.undertaker.split(",") |
|
|
|
|
this.form = data |
|
|
|
|
}).catch(err => {}) |
|
|
|
|
}, |
|
|
|
|
commitId() { |
|
|
|
|
this.setMatchId(this.id); |
|
|
|
|
// this.$store.commit("setMatchId", { matchId: this.id }); |
|
|
|
|
}, |
|
|
|
|
handleExceed(files, fileList) { |
|
|
|
|
this.touchTime = this.touchTime+1 |
|
|
|
|
util.warningMsg(`当前限制选择 1 个文件,如需更换,请删除上一个文件再重新选择!`); |
|
|
|
|
}, |
|
|
|
|
uploadSuccess(res, file, fileList) { |
|
|
|
|
this.touchTime = this.touchTime+1 |
|
|
|
|
if (this.coverUrl) { |
|
|
|
|
let fileName = this.coverUrl.replace("https://liuwanr.oss-cn-shenzhen.aliyuncs.com/", ""); |
|
|
|
|
let fileName = this.form.coverUrl.replace("https://liuwanr.oss-cn-shenzhen.aliyuncs.com/", ""); |
|
|
|
|
this.$del(`${this.api.fileDeletion}?keys=${fileName}`).then(res => { |
|
|
|
|
}).catch(res => { |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
this.coverUrl = res.data.filesResult.fileUrl; |
|
|
|
|
this.form.coverUrl = res.data.filesResult.fileUrl; |
|
|
|
|
}, |
|
|
|
|
uploadLgSuccess(res, file, fileList) { |
|
|
|
|
this.touchTime = this.touchTime+1 |
|
|
|
|
if (this.carouselUrl) { |
|
|
|
|
let fileName = this.carouselUrl.replace("https://liuwanr.oss-cn-shenzhen.aliyuncs.com/", ""); |
|
|
|
|
if (this.form.carouselUrl) { |
|
|
|
|
let fileName = this.form.carouselUrl.replace("https://liuwanr.oss-cn-shenzhen.aliyuncs.com/", ""); |
|
|
|
|
this.$del(`${this.api.fileDeletion}?keys=${fileName}`).then(res => { |
|
|
|
|
}).catch(res => { |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
this.carouselUrl = res.data.filesResult.fileUrl; |
|
|
|
|
this.form.carouselUrl = res.data.filesResult.fileUrl; |
|
|
|
|
}, |
|
|
|
|
uploadError(err, file, fileList) { |
|
|
|
|
this.touchTime = this.touchTime+1 |
|
|
|
|
this.$message({ |
|
|
|
|
message: "上传出错,请重试!", |
|
|
|
|
type: "error", |
|
|
|
@ -300,27 +289,23 @@ export default { |
|
|
|
|
}); |
|
|
|
|
}, |
|
|
|
|
beforeRemove(file, fileList) { |
|
|
|
|
this.touchTime = this.touchTime+1 |
|
|
|
|
return this.$confirm(`确定移除 ${file.name}?`); |
|
|
|
|
}, |
|
|
|
|
handleRemove(file, fileList) { |
|
|
|
|
this.touchTime = this.touchTime+1 |
|
|
|
|
let fileName = this.coverUrl.replace("https://liuwanr.oss-cn-shenzhen.aliyuncs.com/", ""); |
|
|
|
|
let fileName = this.form.coverUrl.replace("https://liuwanr.oss-cn-shenzhen.aliyuncs.com/", ""); |
|
|
|
|
this.$del(`${this.api.fileDeletion}?keys=${fileName}`).then(res => { |
|
|
|
|
this.coverUrl = ""; |
|
|
|
|
this.form.coverUrl = ""; |
|
|
|
|
}).catch(res => { |
|
|
|
|
}); |
|
|
|
|
}, |
|
|
|
|
handleLgRemove(file, fileList) { |
|
|
|
|
this.touchTime = this.touchTime+1 |
|
|
|
|
let fileName = this.carouselUrl.replace("https://liuwanr.oss-cn-shenzhen.aliyuncs.com/", ""); |
|
|
|
|
let fileName = this.form.carouselUrl.replace("https://liuwanr.oss-cn-shenzhen.aliyuncs.com/", ""); |
|
|
|
|
this.$del(`${this.api.fileDeletion}?keys=${fileName}`).then(res => { |
|
|
|
|
this.carouselUrl = ""; |
|
|
|
|
this.form.carouselUrl = ""; |
|
|
|
|
}).catch(res => { |
|
|
|
|
}); |
|
|
|
|
}, |
|
|
|
|
uploadSure() { |
|
|
|
|
this.touchTime = this.touchTime+1 |
|
|
|
|
this.BatchUpload = false; |
|
|
|
|
this.pageNo = 1; |
|
|
|
|
this.keyword = ""; |
|
|
|
@ -335,80 +320,18 @@ export default { |
|
|
|
|
}); |
|
|
|
|
}, |
|
|
|
|
addSponsor() { |
|
|
|
|
this.touchTime = this.touchTime+1 |
|
|
|
|
this.sponsorList.push(""); |
|
|
|
|
this.form.sponsorList.push(""); |
|
|
|
|
}, |
|
|
|
|
delSponsor(index) { |
|
|
|
|
this.touchTime = this.touchTime+1 |
|
|
|
|
this.sponsorList.splice(index, 1); |
|
|
|
|
this.form.sponsorList.splice(index, 1); |
|
|
|
|
}, |
|
|
|
|
addOrganizer() { |
|
|
|
|
this.touchTime = this.touchTime+1 |
|
|
|
|
this.undertakerList.push(""); |
|
|
|
|
this.form.undertakerList.push(""); |
|
|
|
|
}, |
|
|
|
|
delOrganizer(index) { |
|
|
|
|
this.touchTime = this.touchTime+1 |
|
|
|
|
this.undertakerList.splice(index, 1); |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
beforeDestroy() { |
|
|
|
|
if (this.touchTime>0){ |
|
|
|
|
this.$confirm('暂未保存,是否保存本次编辑?', '提示', { |
|
|
|
|
confirmButtonText: '确定', |
|
|
|
|
cancelButtonText: '取消', |
|
|
|
|
type: 'warning' |
|
|
|
|
}).then(() => { |
|
|
|
|
this.sponsor = this.sponsorList.filter(d => d).join(); |
|
|
|
|
this.undertaker = this.undertakerList.filter(d => d).join(); |
|
|
|
|
if (!this.name) return util.warningMsg("请填写竞赛名称"); |
|
|
|
|
if (status == 0) { |
|
|
|
|
if (!this.sponsor) return util.warningMsg("请填写主办方"); |
|
|
|
|
if (!this.signUpStartTime) return util.warningMsg("请选择报名时间"); |
|
|
|
|
} |
|
|
|
|
let now = new Date().getTime(); |
|
|
|
|
let signUpStartTime = new Date(this.signUpStartTime).getTime(); |
|
|
|
|
let signUpEndTime = new Date(this.signUpEndTime).getTime(); |
|
|
|
|
let playStartTime = new Date(this.playStartTime).getTime(); |
|
|
|
|
// if(signUpStartTime && now > signUpStartTime) return this.$$message.warning('报名时间不能早于当前时间') |
|
|
|
|
if (!this.playStartTime && status == 0) return util.warningMsg("请选择竞赛时间"); |
|
|
|
|
if (playStartTime && playStartTime < signUpEndTime) return util.warningMsg("竞赛时间不能早于报名结束时间"); |
|
|
|
|
if (!this.description && status == 0) return util.warningMsg("请填写竞赛详情"); |
|
|
|
|
let data = { |
|
|
|
|
id: this.id, |
|
|
|
|
coverUrl: this.coverUrl, |
|
|
|
|
carouselUrl: this.carouselUrl, |
|
|
|
|
description: this.description, |
|
|
|
|
founderId: 1, |
|
|
|
|
name: this.name, |
|
|
|
|
playEndTime: this.playEndTime, |
|
|
|
|
playStartTime: this.playStartTime, |
|
|
|
|
publishStatus: status ? this.publishStatus : 0, |
|
|
|
|
signUpEndTime: this.signUpEndTime, |
|
|
|
|
signUpStartTime: this.signUpStartTime, |
|
|
|
|
sponsor: this.sponsor, |
|
|
|
|
undertaker: this.undertaker |
|
|
|
|
}; |
|
|
|
|
if (this.id) { |
|
|
|
|
this.$put(this.api.editContest, data).then(res => { |
|
|
|
|
util.successMsg("修改成功"); |
|
|
|
|
this.$router.back(); |
|
|
|
|
}).catch(err => { |
|
|
|
|
}); |
|
|
|
|
} else { |
|
|
|
|
this.$post(this.api.addContest, data).then(res => { |
|
|
|
|
util.successMsg("创建成功"); |
|
|
|
|
this.$router.back(); |
|
|
|
|
}).catch(err => { |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
}).catch(() => { |
|
|
|
|
this.$message({ |
|
|
|
|
type: 'info', |
|
|
|
|
message: '已取消保存' |
|
|
|
|
}); |
|
|
|
|
}); |
|
|
|
|
this.form.undertakerList.splice(index, 1); |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
} |
|
|
|
|
}; |
|
|
|
|
</script> |
|
|
|
|
|
|
|
|
|