|
|
|
@ -77,7 +77,7 @@ |
|
|
|
</el-form-item> |
|
|
|
</el-row> |
|
|
|
<el-row> |
|
|
|
<el-form-item label="活动名额:" |
|
|
|
<el-form-item label="活动总名额:" |
|
|
|
prop="actQuota"> |
|
|
|
<template> |
|
|
|
<el-radio v-model="dataForm.actQuotaCategory" |
|
|
|
@ -124,6 +124,8 @@ |
|
|
|
</el-date-picker> |
|
|
|
</el-form-item> |
|
|
|
<el-button v-if="dataForm.periods.length === 0" @click="plusPeriod" icon="el-icon-plus" circle></el-button> |
|
|
|
</el-row> |
|
|
|
<el-row> |
|
|
|
<el-form-item v-for="(period, index) in dataForm.periods" :key="index"> |
|
|
|
<el-form-item label="活动时间段:" |
|
|
|
prop="actPeriodStartTime"> |
|
|
|
@ -145,6 +147,12 @@ |
|
|
|
placeholder="选择日期时间"> |
|
|
|
</el-date-picker> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item label="活动名额" label-width="80px" prop="actPeriodQuota"> |
|
|
|
<el-input-number type="number" |
|
|
|
:min="1" |
|
|
|
v-model="period.actPeriodQuota" |
|
|
|
style="width:150px"></el-input-number>  人   |
|
|
|
</el-form-item> |
|
|
|
<el-button v-if="dataForm.periods.length-1 === index" @click="plusPeriod" icon="el-icon-plus" circle></el-button> |
|
|
|
<el-button v-if="dataForm.periods.length-1 === index" @click="minusPeriod" icon="el-icon-minus" circle></el-button> |
|
|
|
</el-form-item> |
|
|
|
@ -581,7 +589,6 @@ export default { |
|
|
|
}, |
|
|
|
// 表单提交 |
|
|
|
dataFormSubmitHandle: debounce(function () { |
|
|
|
// console.log(this.dataForm.actContent) |
|
|
|
if ((this.dataForm.actContent).length > 10000) { |
|
|
|
return this.$message.error('您输入的的内容已超过字数') |
|
|
|
} |
|
|
|
@ -597,6 +604,15 @@ export default { |
|
|
|
return this.$message.error('请将活动时间段填写完整') |
|
|
|
} |
|
|
|
} |
|
|
|
let checkActQuota = 0 |
|
|
|
for (let i = 0; i < this.dataForm.periods.length; i++) { |
|
|
|
// 汇总各个时间段的 活动名额 |
|
|
|
checkActQuota += this.dataForm.periods[i].actPeriodQuota |
|
|
|
} |
|
|
|
if (1 === this.dataForm.actQuotaCategory && checkActQuota > this.dataForm.actQuota) { |
|
|
|
// 如果是 固定名额,则判断... |
|
|
|
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) { |
|
|
|
@ -654,7 +670,7 @@ export default { |
|
|
|
}) |
|
|
|
}, |
|
|
|
plusPeriod () { |
|
|
|
this.dataForm.periods.push({ 'actPeriodStartTime': '', 'actPeriodEndTime': '' }) |
|
|
|
this.dataForm.periods.push({ 'actPeriodStartTime': '', 'actPeriodEndTime': '', 'actPeriodQuota': '' }) |
|
|
|
}, |
|
|
|
minusPeriod () { |
|
|
|
this.dataForm.periods.pop() |
|
|
|
|