1290 lines
49 KiB
Vue
1290 lines
49 KiB
Vue
<template>
|
||
<div>
|
||
<el-steps :active="active" finish-status="success" simple>
|
||
<el-step title="活动信息"></el-step>
|
||
<el-step title="项目信息"></el-step>
|
||
</el-steps>
|
||
|
||
<div v-if="active===0" style="margin-top: 20px">
|
||
<el-form ref="activityForm" :model="form" :rules="formRules" label-position="top"
|
||
label-width="120px"
|
||
label-suffix=":">
|
||
<vi-title title="填写活动信息"></vi-title>
|
||
|
||
<el-row gutter="40">
|
||
<el-col :span="8">
|
||
<el-form-item prop="activityLevel" label="活动级别">
|
||
<el-radio-group v-model="form.activityLevel" @change="activityLevelChange">
|
||
<template v-if="is_sysadmin">
|
||
<el-radio :label="40001" border>校级</el-radio>
|
||
<el-radio :label="40002" border>分工会</el-radio>
|
||
<el-radio :label="40003" border>社团或社团</el-radio>
|
||
</template>
|
||
<template v-if="!is_sysadmin">
|
||
<el-radio :label="40001" border v-if="is_a06">校级</el-radio>
|
||
<el-radio v-if="is_union" :label="40002" border>分工会</el-radio>
|
||
<el-radio :label="40003" border v-if="is_club">社团或社团</el-radio>
|
||
</template>
|
||
|
||
</el-radio-group>
|
||
</el-form-item>
|
||
</el-col>
|
||
<!-- <el-col :span="8">
|
||
<el-form-item prop="planId" label="活动计划">
|
||
<el-select v-model="form.planId" placeholder="请选择活动计划" clearable style="width: 100%">
|
||
<el-option
|
||
v-for="item in planList"
|
||
:key="item.id"
|
||
:label="item.name"
|
||
:value="item.id">
|
||
</el-option>
|
||
</el-select>
|
||
</el-form-item>
|
||
</el-col>-->
|
||
<el-col :span="8">
|
||
<el-form-item prop="name" label="活动名称">
|
||
<el-input maxlength="50" placeholder="请填写活动名称" v-model="form.name"
|
||
type="text"></el-input>
|
||
</el-form-item>
|
||
</el-col>
|
||
<el-col :span="8">
|
||
<el-form-item prop="activityCode" label="活动编号">
|
||
<el-input maxlength="50" disabled v-model="form.activityCode"
|
||
type="text"></el-input>
|
||
</el-form-item>
|
||
</el-col>
|
||
</el-row>
|
||
<el-row gutter="40">
|
||
|
||
|
||
<el-col :span="8">
|
||
<el-form-item prop="unitSponsor" label="主办单位">
|
||
<el-select v-model="form.unitSponsor" clearable filterable multiple
|
||
placeholder="请选择主办单位"
|
||
style="width: 100%">
|
||
<el-option
|
||
v-for="item in unitOptions"
|
||
:key="item.id"
|
||
:label="item.name"
|
||
:value="item.id">
|
||
</el-option>
|
||
</el-select>
|
||
</el-form-item>
|
||
</el-col>
|
||
<el-col :span="8">
|
||
<el-form-item prop="undertakeUnit" label="承办单位">
|
||
<el-select v-model="form.undertakeUnit" clearable filterable multiple
|
||
placeholder="请选择承办单位"
|
||
style="width: 100%">
|
||
<el-option
|
||
v-for="item in unitOptions"
|
||
:key="item.id"
|
||
:label="item.name"
|
||
:value="item.id">
|
||
</el-option>
|
||
</el-select>
|
||
</el-form-item>
|
||
</el-col>
|
||
<el-col :span="8">
|
||
<el-form-item prop="unitJointly" label="协办单位">
|
||
<el-select v-model="form.unitJointly" multiple placeholder="请选择协办单位" filterable
|
||
clearable
|
||
style="width: 100%">
|
||
<el-option
|
||
v-for="item in unitOptions"
|
||
:key="item.id"
|
||
:label="item.name"
|
||
:value="item.id">
|
||
</el-option>
|
||
</el-select>
|
||
</el-form-item>
|
||
</el-col>
|
||
|
||
<el-col :span="8">
|
||
<el-form-item prop="address" label="活动地址">
|
||
<el-input maxlength="100" placeholder="请填写活动地址" v-model="form.address"
|
||
type="text"></el-input>
|
||
</el-form-item>
|
||
</el-col>
|
||
<el-col :span="8">
|
||
<el-form-item prop="applyTime" label="报名日期">
|
||
<el-date-picker
|
||
style="width: 100%"
|
||
v-model="form.applyTime"
|
||
type="datetimerange"
|
||
value-format="yyyy-MM-dd HH:mm"
|
||
range-separator="-"
|
||
start-placeholder="开始时间"
|
||
end-placeholder="结束时间">
|
||
</el-date-picker>
|
||
</el-form-item>
|
||
</el-col>
|
||
|
||
|
||
<el-col :span="8">
|
||
<el-form-item prop="time" label="活动时间">
|
||
<el-date-picker
|
||
style="width: 100%"
|
||
v-model="form.time"
|
||
type="datetimerange"
|
||
value-format="yyyy-MM-dd HH:mm"
|
||
range-separator="-"
|
||
start-placeholder="开始时间"
|
||
end-placeholder="结束时间">
|
||
</el-date-picker>
|
||
</el-form-item>
|
||
</el-col>
|
||
|
||
<el-col :span="8">
|
||
<el-form-item prop="activityGroupId" label="可报名人员范围">
|
||
<div style="display: flex; justify-content: space-between">
|
||
<div style="width: 99%">
|
||
<el-select prop="groupId" placeholder="参加人员范围"
|
||
v-model="form.activityGroupId"
|
||
style="width: 99%;"
|
||
clearable
|
||
filterable>
|
||
<el-option v-for="item in activityGroupList"
|
||
:label="item.groupName"
|
||
:value="item.groupId"></el-option>
|
||
</el-select>
|
||
</div>
|
||
<div>
|
||
<el-button
|
||
@click="$refs.drawerUserScope.userScopeDialog = true"
|
||
type="primary">设置
|
||
</el-button>
|
||
</div>
|
||
</div>
|
||
</el-form-item>
|
||
</el-col>
|
||
|
||
<el-col :span="8">
|
||
<el-form-item prop="funding" label="经费预算">
|
||
<el-input-number style="width: 100%" v-model="form.funding"
|
||
placeholder="请填写活动经费预算" controls-position="right" precision="2"
|
||
:max="1000000000"></el-input-number>
|
||
</el-form-item>
|
||
</el-col>
|
||
<el-col :span="8">
|
||
<el-form-item prop="xlFlag" label="活动提醒">
|
||
<el-switch
|
||
v-model="form.xlFlag"
|
||
active-color="#13ce66"
|
||
inactive-color="#ff4949">
|
||
</el-switch>
|
||
</el-form-item>
|
||
</el-col>
|
||
<el-col v-if="form.activityLevel===40003||(form.activityLevel===40001&&is_club)"
|
||
:span="8">
|
||
<el-form-item prop="belongClubId" label="活动所属社团">
|
||
<el-select v-model="form.belongClubId" placeholder="请选择活动所属社团" filterable clearable
|
||
style="width: 100%">
|
||
<el-option
|
||
v-for="item in clubOptions"
|
||
:key="item.stid"
|
||
:label="item.name"
|
||
:value="item.stid">
|
||
</el-option>
|
||
</el-select>
|
||
</el-form-item>
|
||
</el-col>
|
||
</el-row>
|
||
|
||
|
||
<el-row gutter="40">
|
||
<el-col :span="8">
|
||
<el-form-item prop="applyType" label="活动类型">
|
||
<el-radio-group v-model="form.applyType" @change="applyTypeChange">
|
||
<el-radio :label="1" border>单一团体赛</el-radio>
|
||
<el-radio :label="2" border :disabled="form.activityLevel!==40001">综合赛</el-radio>
|
||
<el-radio :label="3" border>个人赛</el-radio>
|
||
</el-radio-group>
|
||
</el-form-item>
|
||
</el-col>
|
||
<el-col :span="8">
|
||
<el-form-item prop="applyWay" label="报名方式">
|
||
<el-checkbox-group v-model="form.applyWay" @change="applyWayChange">
|
||
<el-checkbox :disabled="form.activityLevel!==40001" :label="2" border>分工会报名
|
||
</el-checkbox>
|
||
<el-checkbox :label="1" border>个人报名</el-checkbox>
|
||
<!-- <el-checkbox :label="3" border>小程序报名</el-checkbox>-->
|
||
</el-checkbox-group>
|
||
</el-form-item>
|
||
</el-col>
|
||
|
||
</el-row>
|
||
|
||
<el-row>
|
||
|
||
<el-col :span="24">
|
||
<el-transfer
|
||
@right-check-change="rightCheckChange"
|
||
@change="rightChange"
|
||
ref="transfer"
|
||
:titles="['可选择项目', '当前选择']"
|
||
filterable
|
||
:props="{key: 'id',label: 'allName'}"
|
||
:filter-method="filterMethod"
|
||
:right-default-checked="rightChecked"
|
||
v-model="form.eventsIds"
|
||
:data="events">
|
||
</el-transfer>
|
||
</el-col>
|
||
|
||
|
||
</el-row>
|
||
|
||
|
||
<el-row gutter="40" v-if="form.gameStyle===1&&!form.applyWay.includes(3)">
|
||
<el-col :span="24">
|
||
<el-form-item :prop="form.gameStyle===1?'athleteQualification':'-'" label="运动员资格">
|
||
<div id="athleteQualification"></div>
|
||
</el-form-item>
|
||
</el-col>
|
||
<el-col :span="24">
|
||
<el-form-item :prop="form.gameStyle===1?'registrationMethod':'-'" label="报名方法">
|
||
<div id="registrationMethod"></div>
|
||
</el-form-item>
|
||
</el-col>
|
||
<el-col :span="24">
|
||
<el-form-item :prop="form.gameStyle===1?'competitionMethod':'-'" label="竞赛方法">
|
||
<div id="competitionMethod"></div>
|
||
</el-form-item>
|
||
</el-col>
|
||
<el-col :span="24">
|
||
<el-form-item :prop="form.gameStyle===1?'rewardMethod':'-'" label="奖励方法">
|
||
<div id="rewardMethod"></div>
|
||
</el-form-item>
|
||
</el-col>
|
||
<el-col :span="24">
|
||
<el-form-item :prop="form.gameStyle===1?'precautions':'-'" label="注意事项">
|
||
<div id="precautions"></div>
|
||
</el-form-item>
|
||
</el-col>
|
||
</el-row>
|
||
|
||
<el-row gutter="40" v-if="form.gameStyle===2||form.applyWay.includes(3)">
|
||
<el-col :span="24">
|
||
<el-form-item :prop="form.gameStyle===2?'eventNotification':'-'" label="活动通知">
|
||
<div id="eventNotification"></div>
|
||
</el-form-item>
|
||
</el-col>
|
||
</el-row>
|
||
|
||
<el-form-item prop="files" label="封面图" v-if="form.applyWay.includes(1)">
|
||
<file-upload :files.sync="form.image" :max="1" :type="['jpg', 'jpeg', 'png']"
|
||
card></file-upload>
|
||
</el-form-item>
|
||
</el-form>
|
||
</div>
|
||
|
||
<div v-if="active===1" style="margin-top: 20px">
|
||
<el-form ref="eventForm" :model="eventForm" :rules="formRules" label-position="top"
|
||
label-width="120px"
|
||
label-suffix=":" :key="new Date().getTime()">
|
||
<template v-if="projectType==='2'">
|
||
<vi-title title="领队、教练信息"></vi-title>
|
||
<el-row gutter="40">
|
||
<el-col :span="12">
|
||
<el-form-item prop="leanderNum" label="领队人数(可兼运动员)">
|
||
|
||
<el-input-number style="width: 100%" v-model="eventForm.leanderNum"
|
||
placeholder="请填写领队人数" controls-position="right" precision="0"
|
||
:max="100000" :min="0"></el-input-number>
|
||
</el-form-item>
|
||
</el-col>
|
||
|
||
<el-col :span="12">
|
||
<el-form-item prop="coachNum" label="教练人数(可兼运动员)">
|
||
<el-input-number style="width: 100%" v-model="eventForm.coachNum"
|
||
placeholder="请填写教练人数" controls-position="right" precision="0"
|
||
:max="100000" :min="0"></el-input-number>
|
||
</el-form-item>
|
||
</el-col>
|
||
</el-row>
|
||
</template>
|
||
|
||
<template>
|
||
<vi-title title="项目报名信息"></vi-title>
|
||
<span style="position: relative;left: 65px;top: 33px;color: red">每设置一个项目,需要保存项目信息</span>
|
||
|
||
<el-row gutter="40">
|
||
<el-col :span="12">
|
||
|
||
<el-form-item label="比赛项目">
|
||
<el-select v-model="eventForm.checkedEventId" filterable
|
||
placeholder="请选择活动项目" @change="eventChange"
|
||
clearable
|
||
style="width: 100%">
|
||
<el-option
|
||
v-for="item in checkedEvents"
|
||
:key="item.id"
|
||
:label="item.allName"
|
||
:value="item.id">
|
||
</el-option>
|
||
</el-select>
|
||
</el-form-item>
|
||
</el-col>
|
||
|
||
<el-col v-if="eventForm.checkedEventId==='allItems'||projectType==='1'" :span="6">
|
||
<el-form-item label="年龄限制功能">
|
||
<el-button type="primary" @click="doAssignmentDate">根据比赛项目基础表统赋</el-button>
|
||
</el-form-item>
|
||
</el-col>
|
||
|
||
<el-col v-if="projectType==='2'&&form.applyType===2" :span="6">
|
||
<el-form-item label="是否只需报领队" class="isLeaderColor">
|
||
<el-checkbox v-model="eventForm.isLeader" @change="isLeaderChange">是否只需报领队
|
||
</el-checkbox>
|
||
</el-form-item>
|
||
</el-col>
|
||
|
||
<el-col
|
||
v-if="eventForm.checkedEventId==='allItems'||projectType==='1'&&form.activityLevel===40001"
|
||
:span="6">
|
||
<el-form-item label="运动员数量限制模式">
|
||
<el-radio-group v-model="eventForm.applyUserModel" @input="applyUserModelInput">
|
||
<el-radio-button :label="1">固定</el-radio-button>
|
||
<el-radio-button :label="2">分配模式</el-radio-button>
|
||
</el-radio-group>
|
||
</el-form-item>
|
||
</el-col>
|
||
|
||
</el-row>
|
||
|
||
<el-row v-show="eventForm.applyUserModel!==2" gutter="40">
|
||
<el-col :span="8">
|
||
<el-form-item :label="projectType==='1'?'每队(项)运动员最多人数':'每队(项)运动员人数'"
|
||
prop="athletesMaxNum">
|
||
<el-input-number style="width: 100%" v-model="eventForm.athletesMaxNum"
|
||
placeholder="请填写每队运动员人数" controls-position="right" precision="0"
|
||
:max="1000000000" :min="0"></el-input-number>
|
||
</el-form-item>
|
||
</el-col>
|
||
|
||
<el-col :span="8" v-if="form.applyType===2&&projectType==='1'">
|
||
<el-form-item prop="restrictRegNumber" label="每人限报项目">
|
||
<el-input-number style="width: 100%" v-model="eventForm.restrictRegNumber"
|
||
placeholder="请填写每人限报项目数" controls-position="right" precision="0"
|
||
:max="1000000000" :min="0"></el-input-number>
|
||
</el-form-item>
|
||
</el-col>
|
||
|
||
<el-col :span="8"
|
||
v-if="form.applyType===3||form.applyType===2&&projectType==='1'&&eventForm.checkedEventId!='allItems'">
|
||
<el-form-item prop="ageDate" label="年龄限制范围">
|
||
<el-date-picker
|
||
@change="ageDateChange"
|
||
style="width: 100%;z-index: 1"
|
||
v-model="eventForm.ageDate"
|
||
type="daterange"
|
||
range-separator="-"
|
||
start-placeholder="开始日期"
|
||
end-placeholder="结束日期"
|
||
format="yyyy 年 MM 月 dd 日"
|
||
value-format="yyyy-MM-dd">
|
||
</el-date-picker>
|
||
</el-form-item>
|
||
</el-col>
|
||
|
||
<el-col v-if="form.applyType===1||(form.applyType===2&&projectType==='2')" :span="12">
|
||
<el-form-item label="替补最多人数" prop="substituteNum">
|
||
<el-input-number style="width: 100%" v-model="eventForm.substituteNum"
|
||
controls-position="right" placeholder="请填写替补最多人数" precision="0"
|
||
:max="100000" :min="0"></el-input-number>
|
||
</el-form-item>
|
||
</el-col>
|
||
|
||
<el-col v-if="form.applyType===1||(form.applyType===2&&projectType==='2')" :span="8">
|
||
<el-form-item prop="restrictMaxNum" label="每队最多人数">
|
||
<el-input-number style="width: 100%"
|
||
:value="eventForm.leanderNum+eventForm.coachNum+eventForm.athletesMaxNum+(eventForm.substituteNum?eventForm.substituteNum:0)"
|
||
placeholder="请填写每队最多人数" controls-position="right" precision="0"
|
||
:max="100000" :min="0" disabled></el-input-number>
|
||
</el-form-item>
|
||
</el-col>
|
||
|
||
<el-col v-if="form.applyType===1||(form.applyType===2&&projectType==='2')" :span="8">
|
||
<el-form-item prop="restrictMinNum" label="每队最少人数">
|
||
<el-input-number :value="eventForm.athletesMaxNum"
|
||
controls-position="right"
|
||
disabled placeholder="请填写每队最少人数" precision="0"
|
||
style="width: 100%"
|
||
:max="100000" :min="0"></el-input-number>
|
||
</el-form-item>
|
||
</el-col>
|
||
|
||
<el-col :span="8" v-if="form.applyType===1||(form.applyType===2&&projectType==='2')">
|
||
<el-form-item label="最多创建几队(如需修改,请先删掉项目,在重新添加项目后,再修改队数)" prop="restrictTotalTeam"
|
||
class="restrictTotalTeam">
|
||
<el-input-number style="width: 100%" v-model="eventForm.restrictTotalTeam"
|
||
placeholder="请填写最多创建几队" controls-position="right" precision="0"
|
||
:max="100000" :min="1"></el-input-number>
|
||
</el-form-item>
|
||
</el-col>
|
||
|
||
<el-col
|
||
v-if="form.applyType===1||(form.applyType===2&&projectType==='2'&&!eventForm.isLeader)"
|
||
:span="8">
|
||
<el-form-item
|
||
label="每队男运动员最少人数(若不填值,报名数量不限;如为0,表示不允许报名)"
|
||
prop="restrictBoyNum">
|
||
<el-input v-model="eventForm.restrictBoyNum" placeholder="请填写男运动员人数"
|
||
style="width: 100%" type="number"></el-input>
|
||
</el-form-item>
|
||
</el-col>
|
||
|
||
<el-col
|
||
v-if="form.applyType===1||(form.applyType===2&&projectType==='2'&&!eventForm.isLeader)"
|
||
:span="8">
|
||
<el-form-item
|
||
label="每队女运动员最少人数(若不填值,报名数量不限;如为0,表示不允许报名)"
|
||
prop="restrictGirlNum">
|
||
<el-input v-model="eventForm.restrictGirlNum" placeholder="请填写女运动员人数"
|
||
style="width: 100%"
|
||
type="number"></el-input>
|
||
</el-form-item>
|
||
</el-col>
|
||
|
||
<el-col :span="8" v-if="form.applyType===1">
|
||
<el-form-item prop="deputyDirectorNum" label="每队副处长(级)以上最少人数">
|
||
<el-input-number style="width: 100%" v-model="eventForm.deputyDirectorNum"
|
||
controls-position="right" placeholder="请填写每队副处长(级)以上最少人数"
|
||
precision="0"
|
||
:max="100000" :min="0"></el-input-number>
|
||
</el-form-item>
|
||
</el-col>
|
||
</el-row>
|
||
|
||
<el-row v-show="eventForm.applyUserModel===2" gutter="40">
|
||
<el-card style="margin-left: 20px;margin-right: 60px">
|
||
|
||
|
||
<vi-title2 title="分段设置">
|
||
<template #func>
|
||
<el-button size="small" type="primary" @click="unionLimitQuickSetting">
|
||
应用分段设置
|
||
</el-button>
|
||
</template>
|
||
</vi-title2>
|
||
<el-row v-for="(item,index) in unionUserNumCalc" :gutter="20" class="mb5">
|
||
<el-col :span="7">
|
||
<el-input-number v-model="item.startNum" :min="1" :precision="0" :step="1"
|
||
controls-position="right" placeholder="请输入最小人数"
|
||
style="width: 100%"></el-input-number>
|
||
</el-col>
|
||
<el-col :span="7">
|
||
<el-input-number v-model="item.endNum" :min="1" :precision="0" :step="1"
|
||
controls-position="right" placeholder="请输入最大人数"
|
||
style="width: 100%"></el-input-number>
|
||
</el-col>
|
||
<el-col :span="6">
|
||
<el-input-number v-model="item.resultNum" :min="1" :precision="0" :step="1"
|
||
controls-position="right" placeholder="请输入限制人数"
|
||
style="width: 100%"></el-input-number>
|
||
</el-col>
|
||
<el-col :span="4" class="text-right">
|
||
<el-button icon="el-icon-plus"
|
||
@click="unionUserNumCalc.push({startNum:1,endNum:1,resultNum:1})"></el-button>
|
||
<el-button :disabled="unionUserNumCalc.length===1" icon="el-icon-minus"
|
||
@click="unionUserNumCalc.splice(index,1)"></el-button>
|
||
</el-col>
|
||
</el-row>
|
||
<el-row class="mt10">
|
||
<div v-for="(item,index) in unionUserNumCalcTips" class="text-danger">
|
||
<span class="mr10">({{ index + 1 }}).</span> {{ item }}
|
||
</div>
|
||
</el-row>
|
||
|
||
<vi-title2 class="mt20" title="比例设置">
|
||
<template #func>
|
||
一键比例:
|
||
<el-input-number v-model="unionUserNumOneKeyRatio" :max="100" :min="0"
|
||
:precision="0"
|
||
:step="1"
|
||
placeholder="请输入一键比例"
|
||
size="small"></el-input-number>
|
||
<el-button class="ml5" size="small" type="primary" @click="applyScaleSettings">
|
||
应用比例设置
|
||
</el-button>
|
||
</template>
|
||
</vi-title2>
|
||
<el-table :data="eventForm.unionLimit" max-height="500px">
|
||
<el-table-column label="分工会" prop="unionname"></el-table-column>
|
||
<el-table-column label="人数" prop="teacherCount"></el-table-column>
|
||
<el-table-column label="比例(%)" prop="ratio">
|
||
<template scope="{row}">
|
||
<el-input-number v-model="row.ratio" :max="100" :min="0" :precision="0"
|
||
:step="1"
|
||
controls-position="right"></el-input-number>
|
||
</template>
|
||
</el-table-column>
|
||
<el-table-column label="限制人数" prop="limitCount">
|
||
<template scope="{row}">
|
||
<el-input-number v-model="row.limitCount" :max="row.teacherCount" :min="0"
|
||
:precision="0"
|
||
:step="1" controls-position="right"
|
||
@change="calSummaryCount"></el-input-number>
|
||
</template>
|
||
</el-table-column>
|
||
</el-table>
|
||
|
||
<el-row class="mt20" justify="end" type="flex">
|
||
<div class="text-danger"
|
||
style="width: 100%;font-size: 18px;display: flex;align-items: center;font-weight: bold">
|
||
限制总人数:{{ summaryCount }}人
|
||
</div>
|
||
<el-button type="danger" @click="clearUnionLimit">清空分工会人数限制</el-button>
|
||
</el-row>
|
||
</el-card>
|
||
</el-row>
|
||
|
||
</template>
|
||
</el-form>
|
||
</div>
|
||
|
||
<el-row style="margin: 40px 0;text-align: right" v-if="!form.applyWay.includes(3)">
|
||
<el-button type="primary" @click="prev" :disabled="active===0">上一步</el-button>
|
||
<el-button type="primary" @click="next" v-if="active <= 0">下一步</el-button>
|
||
<el-button type="primary" @click="saveEvent" v-else> 保存项目信息</el-button>
|
||
</el-row>
|
||
|
||
<drawer-user-scope
|
||
@group_change="getActivityGroup"
|
||
ref="drawerUserScope"
|
||
:group_id.sync="form.activityGroupId"
|
||
></drawer-user-scope>
|
||
|
||
</div>
|
||
|
||
</template>
|
||
|
||
<script>
|
||
let E = window.wangEditor
|
||
const editors = {}
|
||
module.exports = {
|
||
props: {
|
||
form: {
|
||
type: Object,
|
||
default: {},
|
||
},
|
||
is_club: {type: Boolean, default: false,},
|
||
is_union: {type: Boolean, default: false,},
|
||
is_sysadmin: {type: Boolean, default: false,},
|
||
is_a06: {type: Boolean, default: false,}
|
||
},
|
||
components: {
|
||
'file-upload': httpVueLoader('/components/plugins/FileUpload.vue'),
|
||
'drawer-user-scope': httpVueLoader('/components/plugins/DrawerUserScope.vue'),
|
||
|
||
},
|
||
computed: {
|
||
unionUserNumCalcTips() {
|
||
return this.unionUserNumCalc.map(v => {
|
||
return (v.startNum ? v.startNum : '?') + '-' + (v.endNum ? v.endNum : '?') + '人的分工会,限报' + (v.resultNum ? v.resultNum : '?') + '人'
|
||
})
|
||
},
|
||
},
|
||
data() {
|
||
return {
|
||
unionUserNumOneKeyRatio: null,
|
||
summaryCount: 0,
|
||
unionUserNumCalc: [{startNum: 1, endNum: 1, resultNum: 1}],
|
||
activityGroupList: [],
|
||
active: 0,
|
||
eventForm: {
|
||
isLeader: false,
|
||
},
|
||
eventsIds: [],
|
||
rightChecked: [],
|
||
checkedEventInfo: [],
|
||
checkedEventInfo2: [],
|
||
checkedEvents: [],
|
||
unitOptions: [],
|
||
clubOptions: [],
|
||
planList: [],
|
||
events: [],
|
||
projectType: "",
|
||
formRules: {
|
||
name: [{required: true, message: '必填', trigger: ['blur', 'change']}],
|
||
address: [{required: true, message: '必填', trigger: ['blur', 'change']}],
|
||
typeId: [{required: true, message: '必填', trigger: ['blur', 'change']}],
|
||
eventsIds: [{required: true, message: '必填', trigger: ['blur', 'change']}],
|
||
applyTime: [{required: true, message: '必填', trigger: ['blur', 'change']}],
|
||
unitSponsor: [{required: true, message: '必填', trigger: ['blur', 'change']}],
|
||
undertakeUnit: [{required: true, message: '必填', trigger: ['blur', 'change']}],
|
||
// unitJointly: [{required: true, message: '必填', trigger: ['blur', 'change']}],
|
||
time: [{required: true, message: '必填', trigger: ['blur', 'change']}],
|
||
activityGroupId: [{required: true, message: '必填', trigger: ['blur', 'change']}],
|
||
gameStyle: [{required: true, message: '必填', trigger: ['blur', 'change']}],
|
||
applyWay: [{required: true, message: '必填', trigger: ['blur', 'change']}],
|
||
restrictTotalPeople: [{required: true, message: '必填', trigger: ['blur', 'change']}],
|
||
restrictTotalTeam: [{required: true, message: '必填', trigger: ['blur', 'change']}],
|
||
// registrationMethod: [{required: true, message: '必填', trigger: ['blur', 'change']}],
|
||
// competitionMethod: [{required: true, message: '必填', trigger: ['blur', 'change']}],
|
||
// rewardMethod: [{required: true, message: '必填', trigger: ['blur', 'change']}],
|
||
// precautions: [{required: true, message: '必填', trigger: ['blur', 'change']}],
|
||
// eventNotification: [{required: true, message: '必填', trigger: ['blur', 'change']}],
|
||
personType: [{required: true, message: '必填', trigger: ['blur', 'change']}],
|
||
// athleteQualification: [{required: true, message: '必填', trigger: ['blur', 'change']}],
|
||
activityLevel: [{required: true, message: '必填', trigger: ['blur', 'change']}],
|
||
// belongClubId: [{required: true, message: '必填', trigger: ['blur', 'change']}],
|
||
applyType: [{required: true, message: '必填', trigger: ['blur', 'change']}],
|
||
athletesMaxNum: [{required: true, message: '必填', trigger: ['blur', 'change']}],
|
||
restrictRegNumber: [{required: true, message: '必填', trigger: ['blur', 'change']}],
|
||
}
|
||
}
|
||
},
|
||
methods: {
|
||
|
||
async applyUserModelInput(val) {
|
||
if (val === 2) {
|
||
if (!this.eventForm.unionLimit || this.eventForm.unionLimit.length === 0) {
|
||
const resp = await $.get(loc() + '/getUnionLimit', {activityScopeId: this.eventForm.activityGroupId})
|
||
if (resp.code === 0) {
|
||
this.$set(this.eventForm, 'unionLimit', resp.data)
|
||
}
|
||
}
|
||
this.summaryCount = this.eventForm.unionLimit.reduce((prev, curr) => {
|
||
const value = Number(curr.limitCount);
|
||
if (!isNaN(value)) {
|
||
return prev + curr.limitCount;
|
||
} else {
|
||
return prev;
|
||
}
|
||
}, 0)
|
||
}
|
||
},
|
||
calSummaryCount() {
|
||
const array = this.eventForm.unionLimit
|
||
if (array) {
|
||
this.summaryCount = array.reduce((prev, curr) => {
|
||
const value = Number(curr.limitCount);
|
||
if (!isNaN(value)) {
|
||
return prev + curr.limitCount;
|
||
} else {
|
||
return prev;
|
||
}
|
||
}, 0)
|
||
}
|
||
},
|
||
//应用比例设置
|
||
applyScaleSettings() {
|
||
this.eventForm.unionLimit.forEach(v => {
|
||
v.limitCount = parseFloat((v.teacherCount * this.unionUserNumOneKeyRatio / 100).toFixed(0))
|
||
if (v.ratio) {
|
||
v.limitCount = parseFloat((v.teacherCount * v.ratio / 100).toFixed(0))
|
||
}
|
||
})
|
||
this.calSummaryCount()
|
||
},
|
||
unionLimitQuickSetting() {
|
||
this.unionUserNumCalc.forEach((v, i) => {
|
||
const startNum = v.startNum
|
||
const endNum = v.endNum
|
||
const resultNum = v.resultNum
|
||
if (startNum > endNum) {
|
||
this.$message.warning('第' + (i + 1) + '行设置错误')
|
||
} else {
|
||
this.eventForm.unionLimit.forEach(x => {
|
||
if (x.teacherCount >= startNum && x.teacherCount <= endNum) {
|
||
x.limitCount = resultNum
|
||
}
|
||
})
|
||
this.calSummaryCount()
|
||
}
|
||
})
|
||
},
|
||
async clearUnionLimit() {
|
||
const confirm = await this.$confirm('确定要清空分工会人数限制吗, 是否继续?', '提示', {
|
||
confirmButtonText: '确定',
|
||
cancelButtonText: '取消',
|
||
type: 'warning'
|
||
})
|
||
if ('confirm' === confirm) {
|
||
this.eventForm.unionLimit = []
|
||
this.unionUserNumOneKeyRatio = null
|
||
this.unionUserNumCalc = [{}]
|
||
await this.applyUserModelInput(2)
|
||
}
|
||
},
|
||
ageDateChange() {
|
||
this.$set(this.eventForm, "startAgeDate", null)
|
||
this.$set(this.eventForm, "endAgeDate", null)
|
||
},
|
||
async doAssignmentDate() {
|
||
|
||
await this.saveEvent()
|
||
const form = clone(this.form)
|
||
|
||
const loading = this.$loading({
|
||
lock: true,
|
||
text: '正在提交...',
|
||
spinner: 'el-icon-loading',
|
||
background: COVER_LAYER_COLOR
|
||
});
|
||
const resp = await $.post(loc() + "/doAssignmentDate", {
|
||
eventIds: JSON.stringify(this.checkedEventInfo.map(v => v.id)),
|
||
events: JSON.stringify(this.checkedEventInfo)
|
||
})
|
||
if (resp.code === 0) {
|
||
await this.openEdit(this.form, false)
|
||
} else {
|
||
this.$message.error(resp.msg);
|
||
}
|
||
loading.close()
|
||
|
||
|
||
},
|
||
filterMethod(query, item) {
|
||
return item.allName.indexOf(query) > -1;
|
||
},
|
||
rightChange(v) {
|
||
},
|
||
rightCheckChange(v, v2) {
|
||
this.rightChecked = v
|
||
},
|
||
/* async eventRemoveTag(val) {
|
||
this.$confirm('确定要删除该活动吗?', '提示', {
|
||
type: 'warning'
|
||
}).then(async () => {
|
||
const {data} = await $.get(loc() + "/getEventApply", {activityId: this.form.id, eventId: val})
|
||
if (data > 0) {
|
||
|
||
}
|
||
}).catch(() => {
|
||
this.form.eventsIds.push(val)
|
||
console.log(this.form.eventsIds)
|
||
});
|
||
|
||
|
||
},*/
|
||
async applyTypeChange(applyType) {
|
||
this.form.eventsIds = []
|
||
if (applyType === 1) {
|
||
this.events = await activity.getEvents(1)
|
||
} else if (applyType === 2) {
|
||
this.events = await activity.getEvents(2)
|
||
} else {
|
||
this.events = await activity.getEvents(3)
|
||
|
||
}
|
||
},
|
||
initCheckedEventInfo() {
|
||
this.checkedEventInfo = this.checkedEvents.map(v => {
|
||
v.eventId = v.id
|
||
if (v.projectType === '1') {
|
||
v.athletesMaxNum = 3
|
||
v.restrictRegNumber = 2
|
||
v.leanderNum = 0
|
||
v.coachNum = 0
|
||
v.applyUserModel = 1
|
||
} else if (v.projectType === '2') {
|
||
v.leanderNum = 0
|
||
v.coachNum = 0
|
||
v.restrictTotalTeam = 1
|
||
}
|
||
return v
|
||
})
|
||
},
|
||
applyWayChange() {
|
||
this.$nextTick(() => {
|
||
this.initEditor()
|
||
})
|
||
},
|
||
async eventChange(val) {
|
||
const data = this.checkedEventInfo.find(v => v.eventId === val)
|
||
const resp = await $.get("/platform/activity/school/info/mange/getEventData", {id: val})
|
||
await this.$nextTick()
|
||
if (data) {
|
||
data.applyUserModel = data.applyUserModel ? data.applyUserModel : 1
|
||
this.eventForm = clone(data)
|
||
this.projectType = data.projectType
|
||
} else {
|
||
this.eventForm = {
|
||
projectType: resp.data.projectType,
|
||
leanderNum: 0,
|
||
coachNum: 0,
|
||
athletesMaxNum: resp.data.projectType == 1 ? 3 : null,
|
||
restrictTotalTeam: 1,
|
||
substituteNum: 0,
|
||
restrictRegNumber: resp.data.projectType == 1 ? 2 : null,
|
||
isLeader: false,
|
||
applyUserModel: 1
|
||
}
|
||
|
||
this.projectType = resp.data.projectType
|
||
}
|
||
this.$set(this.eventForm, "checkedEventId", val)
|
||
},
|
||
async saveEvent() {
|
||
const data = clone(this.eventForm)
|
||
if (data.checkedEventId === 'allItems') {
|
||
this.checkedEventInfo.forEach(v => {
|
||
if (v.projectType === '1') {
|
||
v.applyUserModel = this.eventForm.applyUserModel
|
||
v.athletesMaxNum = data.athletesMaxNum
|
||
v.restrictRegNumber = data.restrictRegNumber
|
||
v.unionLimit = data.unionLimit
|
||
}
|
||
})
|
||
} else {
|
||
const info = this.checkedEventInfo.find(v => v.eventId === data.checkedEventId)
|
||
if (info != null) {
|
||
const index = this.checkedEventInfo.findIndex(v => v.eventId === data.checkedEventId)
|
||
this.checkedEventInfo.splice(index, 1)
|
||
if (info.projectType === '1') {
|
||
this.$set(this.eventForm, "athletesMaxNum", data.athletesMaxNum)
|
||
this.$set(this.eventForm, "restrictRegNumber", data.restrictRegNumber)
|
||
}
|
||
this.$set(this.eventForm, "checkedEventId", info.eventId)
|
||
}
|
||
data.eventId = data.checkedEventId
|
||
this.checkedEventInfo.push(data)
|
||
}
|
||
await this.doSave()
|
||
}
|
||
,
|
||
prev() {
|
||
this.active--
|
||
this.$nextTick(() => {
|
||
this.initEditor()
|
||
})
|
||
},
|
||
getArrDifference(arr1, arr2) {
|
||
return arr1.concat(arr2).filter(function (v, i, arr) {
|
||
return arr.indexOf(v) === arr.lastIndexOf(v);
|
||
});
|
||
},
|
||
next() {
|
||
this.$refs["activityForm"].validate(async (valid) => {
|
||
const form = clone(this.form)
|
||
if (!valid) {
|
||
this.$notify.warning({title: '警告', message: '存在未填的必填项'});
|
||
return
|
||
}
|
||
const arrDifference = this.getArrDifference(this.form.unitJointly, this.form.unitSponsor);
|
||
if (arrDifference.length === 0) {
|
||
this.$notify.error({title: '错误', message: '协办单位里存在主办单位'});
|
||
return
|
||
}
|
||
|
||
if (moment(this.form.time[0]).valueOf() <= moment(this.form.applyTime[0]).valueOf()) {
|
||
this.$notify.error({title: '错误', message: '活动时间必须晚于报名时间'});
|
||
return
|
||
}
|
||
|
||
if (form.applyWay.includes(3) && !form.image) {
|
||
this.$notify.error({title: '错误', message: '请上传小程序活动封面图'});
|
||
return
|
||
}
|
||
if (this.form.eventsIds.length === 0) {
|
||
this.$notify.error({title: '错误', message: '请选择项目'});
|
||
return
|
||
}
|
||
|
||
this.checkedEvents = this.events.filter(v => this.form.eventsIds.some(x => x === v.id))
|
||
|
||
if (this.form.applyType === 2 && !this.checkedEvents.find(v => v.id === "allItems")) {
|
||
const data = this.checkedEventInfo2.find(v => v.projectType === '1')
|
||
const item = {
|
||
id: "allItems",
|
||
eventId: "allItems",
|
||
allName: "所有单项",
|
||
projectType: "1",
|
||
applyUserModel: 1,
|
||
athletesMaxNum: data ? data.athletesMaxNum : 3,
|
||
restrictRegNumber: data ? data.restrictRegNumber : 2,
|
||
}
|
||
this.checkedEventInfo.unshift(item)
|
||
this.checkedEvents.unshift(item)
|
||
}
|
||
|
||
this.eventForm.checkedEventId = this.checkedEvents[0].id
|
||
this.projectType = this.checkedEvents[0].projectType
|
||
|
||
if (!form.id || this.checkedEventInfo2.length <= 0) {
|
||
this.eventForm = {
|
||
checkedEventId: this.checkedEvents[0].id,
|
||
leanderNum: 0,
|
||
coachNum: 0,
|
||
athletesMaxNum: 3,
|
||
substituteNum: 0
|
||
}
|
||
this.initCheckedEventInfo()
|
||
}
|
||
|
||
this.eventChange(this.checkedEvents[0].id)
|
||
|
||
this.active++
|
||
})
|
||
}
|
||
,
|
||
async activityLevelChange() {
|
||
this.form.planId = null
|
||
this.planList = await activity.getSchoolActivityPlan(this.form.activityLevel)
|
||
const data = await this.getActivityCode(this.form.activityLevel)
|
||
this.$set(this.form, "activityCode", data)
|
||
if (this.form.activityLevel !== 40001) {
|
||
this.$set(this.form, "applyWay", [1])
|
||
this.$set(this.form, "applyType", 1)
|
||
} else {
|
||
this.$set(this.form, "applyWay", [2])
|
||
}
|
||
if (this.form.activityLevel === 40003 || (this.form.activityLevel === 40001 && this.is_club)) {
|
||
this.clubOptions = await getClubsByRole()
|
||
if (this.clubOptions && this.clubOptions.length > 0) {
|
||
this.$set(this.form, "belongClubId", this.clubOptions[0].stid)
|
||
}
|
||
|
||
}
|
||
|
||
await this.applyTypeChange(this.form.applyType)
|
||
this.$forceUpdate();
|
||
|
||
}
|
||
,
|
||
async openAdd() {
|
||
this.events = await activity.getEvents(2)
|
||
this.planList = await activity.getSchoolActivityPlan(this.form.activityLevel)
|
||
await this.getActivityGroup()
|
||
this.active = 0
|
||
this.eventForm = {}
|
||
|
||
this.$nextTick(async () => {
|
||
if (this.$refs['activityForm']) {
|
||
this.$refs['activityForm'].resetFields()
|
||
}
|
||
this.initEditor()
|
||
const data = await this.getActivityCode(40001)
|
||
this.form = {
|
||
planId: '',
|
||
gameStyle: 1,
|
||
applyWay: [2],
|
||
eventsIds: [],
|
||
unitJointly: [],
|
||
applyType: 2,
|
||
activityCode: data,
|
||
activityLevel: 40001,
|
||
}
|
||
await this.activityLevelChange()
|
||
})
|
||
},
|
||
async getActivityCode(activity_type) {
|
||
const {data} = await $.get('/platform/activity/apply/generateActivityCode', {activity_type: activity_type})
|
||
return data;
|
||
},
|
||
async openEdit(row, flag) {
|
||
this.active = flag ? 0 : this.active
|
||
await this.applyTypeChange(row.applyType)
|
||
this.planList = await activity.getSchoolActivityPlan(1)
|
||
await this.getActivityGroup()
|
||
const {id} = row
|
||
this.$set(row, "loading", true)
|
||
|
||
const resp = await $.get("/platform/activity/school/info/mange/findOne", {id})
|
||
if (resp.code === 0) {
|
||
const v = resp.data
|
||
|
||
this.$set(row, "loading", false)
|
||
this.clubOptions = await getClubsByRole()
|
||
this.eventsIds = clone(JSON.parse(v.eventsIds))
|
||
v.applyTime = [v.applyStartTime, v.applyEndTime]
|
||
v.time = [v.startTime, v.endTime]
|
||
v.eventsIds = JSON.parse(v.eventsIds)
|
||
v.applyWay = JSON.parse(v.applyWay)
|
||
v.unitSponsor = JSON.parse(v.unitSponsor)
|
||
v.undertakeUnit = JSON.parse(v.undertakeUnit)
|
||
v.unitJointly = JSON.parse(v.unitJointly)
|
||
v.activityGroupId = parseInt(v.activityGroupId)
|
||
v.activityLevel = parseInt(v.activityLevel)
|
||
if (v.image && v.image.length > 0) v.image = JSON.parse(v.image)
|
||
this.form = clone(v)
|
||
this.checkedEventInfo = clone(v.schoolEvents)
|
||
this.checkedEventInfo2 = v.schoolEvents
|
||
this.checkedEventInfo.map(v => {
|
||
if (v.unionLimit) {
|
||
v.unionLimit = JSON.parse(v.unionLimit)
|
||
}
|
||
if (v.startAgeDate) {
|
||
this.$set(v, "ageDate", [v.startAgeDate, v.endAgeDate])
|
||
this.$set(this.eventForm, "ageDate", [v.startAgeDate, v.endAgeDate])
|
||
}
|
||
})
|
||
const data = v.schoolEvents.find(v => v.projectType === '1')
|
||
|
||
if (this.form.applyType === 2 && !v.schoolEvents.some(v => v.eventId === "allItems")) {
|
||
const item = {
|
||
id: "allItems",
|
||
eventId: "allItems",
|
||
allName: "所有单项",
|
||
projectType: "1",
|
||
athletesMaxNum: data ? data.athletesMaxNum : 3,
|
||
restrictRegNumber: data ? data.restrictRegNumber : 2,
|
||
}
|
||
this.checkedEventInfo.unshift(item)
|
||
}
|
||
|
||
this.$nextTick(async () => {
|
||
this.initEditor()
|
||
|
||
})
|
||
}
|
||
}
|
||
,
|
||
async doOperate() {
|
||
const method = this.form.id ? "/doEdit" : "/doAdd"
|
||
const form = clone(this.form)
|
||
const events = clone(this.checkedEventInfo)
|
||
|
||
form.restrictMaxNum = form.leanderNum + form.coachNum + form.athletesMaxNum + form.substituteNum
|
||
form.restrictMinNum = form.athletesMaxNum
|
||
form.isSave = false
|
||
|
||
this.examineTrans(form)
|
||
|
||
const loading = this.$loading({
|
||
lock: true,
|
||
text: '正在提交...',
|
||
spinner: 'el-icon-loading',
|
||
background: COVER_LAYER_COLOR
|
||
});
|
||
const resp = await $.post(base + "/platform/activity/school/info/mange" + method, {
|
||
data: JSON.stringify(form),
|
||
events: JSON.stringify(events)
|
||
})
|
||
if (resp.code === 0) {
|
||
this.$emit('flip')
|
||
window.location.reload();
|
||
} else {
|
||
this.$notify.error({title: '错误', message: resp.msg});
|
||
}
|
||
loading.close()
|
||
|
||
|
||
},
|
||
async operate() {
|
||
|
||
const deleteEventIds = this.eventsIds.filter(v => !this.form.eventsIds.includes(v))
|
||
const {data} = await $.get(loc() + "/getEventApply", {
|
||
activityId: this.form.id,
|
||
eventId: JSON.stringify(deleteEventIds)
|
||
})
|
||
if (data.length > 0) {
|
||
this.$confirm(data.map(v => v.allname).join(",") + '项目下有报名人员是否要删除?', '提示', {
|
||
type: 'warning'
|
||
}).then(async () => {
|
||
await this.doOperate()
|
||
}).catch(() => {
|
||
|
||
});
|
||
} else {
|
||
await this.doOperate()
|
||
}
|
||
}
|
||
,
|
||
async doSave() {
|
||
let url = this.form.id ? "/doEdit" : "/doAdd"
|
||
|
||
this.checkedEventInfo.forEach(v => {
|
||
if (this.eventForm.projectType === '1' && this.eventForm.eventId === 'eventId') {
|
||
v.athletesMaxNum = this.checkedEventInfo[0].athletesMaxNum
|
||
v.restrictRegNumber = this.checkedEventInfo[0].restrictRegNumber
|
||
}
|
||
if (v.ageDate && v.ageDate.length > 0) {
|
||
v.startAgeDate = v.ageDate[0]
|
||
v.endAgeDate = v.ageDate[1]
|
||
} else {
|
||
v.startAgeDate = null
|
||
v.endAgeDate = null
|
||
}
|
||
})
|
||
|
||
let events = clone(this.checkedEventInfo)
|
||
|
||
const form = clone(this.form)
|
||
form.restrictMaxNum = form.leanderNum + form.coachNum + form.athletesMaxNum + form.substituteNum
|
||
form.restrictMinNum = form.athletesMaxNum
|
||
form.isSave = true
|
||
|
||
const {time, applyTime} = form
|
||
if (applyTime && applyTime.length) {
|
||
form.applyStartTime = applyTime[0]
|
||
form.applyEndTime = applyTime[1]
|
||
form.applyTime = undefined
|
||
}
|
||
|
||
if (time && time.length) {
|
||
form.startTime = time[0]
|
||
form.endTime = time[1]
|
||
form.time = undefined
|
||
}
|
||
|
||
if (this.eventForm.checkedEventId == "allItems") {
|
||
events = events.filter(v => v.projectType == 1 && v.id != "allItems")
|
||
|
||
} else {
|
||
this.$set(this.eventForm, "activityId", this.form.id)
|
||
this.$set(this.eventForm, "eventId", this.eventForm.checkedEventId)
|
||
if (this.eventForm.ageDate && this.eventForm.ageDate.length > 0) {
|
||
this.$set(this.eventForm, "startAgeDate", this.eventForm.ageDate[0])
|
||
this.$set(this.eventForm, "endAgeDate", this.eventForm.ageDate[1])
|
||
}
|
||
events = this.eventForm
|
||
}
|
||
const loading = this.$loading({
|
||
lock: true,
|
||
text: '正在提交...',
|
||
spinner: 'el-icon-loading',
|
||
background: COVER_LAYER_COLOR
|
||
});
|
||
|
||
const resp = await $.post("/platform/activity/school/info/mange" + url, {
|
||
data: JSON.stringify(form),
|
||
events: JSON.stringify(events)
|
||
})
|
||
if (resp.code === 0) {
|
||
this.$emit('flush')
|
||
if (!this.form.id) form.id = resp.data
|
||
await this.openEdit(form, false)
|
||
this.$message.success(resp.msg);
|
||
} else {
|
||
this.$message.error(resp.msg);
|
||
}
|
||
loading.close()
|
||
|
||
},
|
||
examineTrans(form) {
|
||
const {unitJointly, unitSponsor, time, applyTime, applyWay, image} = form
|
||
|
||
const arrDifference = this.getArrDifference(unitJointly, unitSponsor);
|
||
if (arrDifference.length === 0) {
|
||
this.$notify.error({title: '错误', message: '协办单位里存在主办单位'});
|
||
return
|
||
}
|
||
|
||
if (moment(time[0]).valueOf() <= moment(applyTime[0]).valueOf()) {
|
||
this.$notify.error({title: '错误', message: '活动时间必须晚于报名时间'});
|
||
return
|
||
}
|
||
|
||
if (applyWay.includes(3) && !image) {
|
||
this.$notify.error({title: '错误', message: '请上传小程序活动封面图'});
|
||
return
|
||
}
|
||
|
||
if (applyTime && applyTime.length) {
|
||
form.applyStartTime = applyTime[0]
|
||
form.applyEndTime = applyTime[1]
|
||
form.applyTime = undefined
|
||
}
|
||
|
||
if (time && time.length) {
|
||
form.startTime = time[0]
|
||
form.endTime = time[1]
|
||
form.time = undefined
|
||
}
|
||
},
|
||
initEditor() {
|
||
let keys = ['athleteQualification', 'registrationMethod', 'competitionMethod', 'rewardMethod', 'precautions', 'eventNotification']
|
||
keys.forEach(key => {
|
||
$("#" + key).html("")
|
||
editors[key] = new E('#' + key)
|
||
editors[key].config.onchange = (html) => {
|
||
this.form[key] = html
|
||
}
|
||
editors[key].create()
|
||
if (this.form[key]) {
|
||
editors[key].txt.html(this.form[key])
|
||
}
|
||
})
|
||
},
|
||
isLeaderChange() {
|
||
this.$set(this.eventForm, "leanderNum", 1)
|
||
this.$set(this.eventForm, "coachNum", 0)
|
||
this.$set(this.eventForm, "substituteNum", 0)
|
||
this.$set(this.eventForm, "athletesMaxNum", 0)
|
||
this.$set(this.eventForm, "restrictBoyNum", 0)
|
||
this.$set(this.eventForm, "restrictGirlNum", 0)
|
||
},
|
||
async getActivityGroup() {
|
||
const {data} = await $.get('/platform/activity/basic/scope/getActivityUserScopeGroup')
|
||
this.activityGroupList = data
|
||
},
|
||
async initCnd() {
|
||
const userState = await getDictByCode('userState')
|
||
const personType = await getDictByCode('personType')
|
||
|
||
const userStateOptions = userState.map(v => {
|
||
return {label: v.name, value: v.name}
|
||
})
|
||
|
||
const personTypeOptions = personType.map(v => {
|
||
return {label: v.name, value: v.name}
|
||
})
|
||
|
||
|
||
this.fields = [
|
||
{
|
||
label: '性别',
|
||
value: 'sex',
|
||
type: "select",
|
||
options: [{label: '男', value: '男'}, {label: '女', value: '女'}]
|
||
},
|
||
{label: '在职状态', value: 'userState', type: "select", options: userStateOptions},
|
||
{label: '人员类型', value: 'personType', type: "select", options: personTypeOptions},
|
||
]
|
||
}
|
||
,
|
||
},
|
||
async created() {
|
||
await this.initCnd()
|
||
const clubs = await getClubs()
|
||
const units = await getUnits(null)
|
||
this.unitOptions = clubs.concat(units)
|
||
}
|
||
}
|
||
</script>
|
||
|
||
<style>
|
||
.el-transfer {
|
||
display: flex;
|
||
align-items: center;
|
||
}
|
||
|
||
.el-transfer-panel {
|
||
width: unset !important;
|
||
flex: 2 !important;
|
||
}
|
||
|
||
.el-transfer-panel__body {
|
||
|
||
}
|
||
|
||
.el-transfer__buttons {
|
||
flex: 1 !important;
|
||
text-align: center;
|
||
}
|
||
|
||
#athleteQualification > div {
|
||
z-index: 1 !important;
|
||
}
|
||
|
||
.act_event .el-select__tags .el-tag {
|
||
color: #409eff;
|
||
}
|
||
|
||
.act_event .el-select__tags .el-tag.el-tag--info .el-tag__close {
|
||
color: red;
|
||
background-color: #ffffff;
|
||
}
|
||
|
||
.isLeaderColor .el-form-item__label {
|
||
color: white;
|
||
}
|
||
|
||
.restrictTotalTeam .el-form-item__label {
|
||
color: red;
|
||
}
|
||
</style> |