diff --git a/src/views/modules/heart/actinfo-add-or-update.vue b/src/views/modules/heart/actinfo-add-or-update.vue
index e6eab41..66d4b6f 100644
--- a/src/views/modules/heart/actinfo-add-or-update.vue
+++ b/src/views/modules/heart/actinfo-add-or-update.vue
@@ -77,7 +77,7 @@
-
+
+
@@ -145,6 +147,12 @@
placeholder="选择日期时间">
+
+ 人
+
@@ -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()
diff --git a/src/views/modules/heart/actinfo-detail-view.vue b/src/views/modules/heart/actinfo-detail-view.vue
index 2c846ac..db15eba 100644
--- a/src/views/modules/heart/actinfo-detail-view.vue
+++ b/src/views/modules/heart/actinfo-detail-view.vue
@@ -41,7 +41,7 @@
-
{{dataForm.actQuotaCategory != '0' ? dataForm.actQuota+'人':'不限名额'}}
@@ -81,6 +81,11 @@
prop="actPeriodEndTime">
{{period.actPeriodEndTime}}
+
+ {{period.actPeriodQuota}}
+ 人
+