commit
This commit is contained in:
@@ -0,0 +1,90 @@
|
||||
<!--#
|
||||
layout("/layouts/platform.html"){
|
||||
#-->
|
||||
|
||||
<style>
|
||||
.page-tip {
|
||||
color: #c64120;
|
||||
line-height: 24px;
|
||||
}
|
||||
</style>
|
||||
|
||||
<div id="app" v-cloak>
|
||||
<el-card shadow="never">
|
||||
<div class="left-span-label">活动类型年度报名次数配置</div>
|
||||
<div class="page-tip mt10">
|
||||
注:这里配置的是“同一活动类型在同一年度内最多可报名多少次”。未单独配置过的活动类型默认按 2 次处理。
|
||||
</div>
|
||||
</el-card>
|
||||
|
||||
<el-card class="mt10" shadow="never">
|
||||
<table-tool label="配置列表"></table-tool>
|
||||
<el-form ref="formRef" :model="formData">
|
||||
<el-table :data="formData.configList">
|
||||
<el-table-column label="序号" type="index" width="80"></el-table-column>
|
||||
<el-table-column label="活动类型" prop="trainTypeName"></el-table-column>
|
||||
<el-table-column label="活动类型编码" prop="trainType"></el-table-column>
|
||||
<el-table-column label="每年可报名次数" prop="annualLimitCount" width="220">
|
||||
<template v-slot="{row}">
|
||||
<el-input-number v-model="row.annualLimitCount" :min="1" :precision="0" :step="1"></el-input-number>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</el-form>
|
||||
|
||||
<div style="margin-top: 20px; text-align: right">
|
||||
<el-button type="primary" @click="onSave">保 存</el-button>
|
||||
</div>
|
||||
</el-card>
|
||||
</div>
|
||||
|
||||
<script nonce="${cspNonce!}">
|
||||
new Vue({
|
||||
el: '#app',
|
||||
data: function () {
|
||||
return {
|
||||
formData: {
|
||||
configList: []
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
fetchData: function () {
|
||||
this.$axios.post('/platform/trainSignUp/annualLimit/listData').then((res) => {
|
||||
if (res.code === 0) {
|
||||
this.formData.configList = res.data
|
||||
} else {
|
||||
this.$message.warning(res.msg)
|
||||
}
|
||||
})
|
||||
},
|
||||
onSave: function () {
|
||||
var hasInvalidData = this.formData.configList.some(function (item) {
|
||||
return !item.annualLimitCount || item.annualLimitCount <= 0
|
||||
})
|
||||
if (hasInvalidData) {
|
||||
this.$message.warning('每年可报名次数必须大于0')
|
||||
return
|
||||
}
|
||||
// 页面直接按活动类型整表提交,后端会按活动类型编码进行新增或更新。
|
||||
this.$axios.post('/platform/trainSignUp/annualLimit/save', {
|
||||
configList: JSON.stringify(this.formData.configList)
|
||||
}).then((res) => {
|
||||
if (res.code === 0) {
|
||||
this.$message.success(res.msg)
|
||||
this.fetchData()
|
||||
} else {
|
||||
this.$message.warning(res.msg)
|
||||
}
|
||||
})
|
||||
}
|
||||
},
|
||||
created: function () {
|
||||
this.fetchData()
|
||||
}
|
||||
})
|
||||
</script>
|
||||
|
||||
<!--#
|
||||
}
|
||||
#-->
|
||||
Reference in New Issue
Block a user