品牌活动
This commit is contained in:
+13
-5
@@ -6,6 +6,7 @@ import io.v.nutz.base.dao.CndPlus;
|
||||
import io.v.nutz.base.query.PageForm;
|
||||
import io.v.nutz.sys.models.Sys_dict;
|
||||
import io.v.nutz.sys.services.SysDictService;
|
||||
import io.v.nutz.web.commons.utils.ShiroUtil;
|
||||
import io.v.nutz.zhgh.trainSignUp.models.TrainSignUpActivity;
|
||||
import io.v.nutz.zhgh.trainSignUp.models.TrainSignUpActivityCourse;
|
||||
import io.v.nutz.zhgh.trainSignUp.models.TrainSignUpType;
|
||||
@@ -83,6 +84,7 @@ public class TrainSignUpActivityApplyController {
|
||||
Sql sql = Sqls.create("""
|
||||
SELECT
|
||||
tsuc.id,
|
||||
tsuc.assort,
|
||||
tsuc.activityId,
|
||||
tsuc.courseName,
|
||||
tsuc.coursePeopleNumber,
|
||||
@@ -99,6 +101,7 @@ public class TrainSignUpActivityApplyController {
|
||||
tsuc.isReceiveGift,
|
||||
tsuc.giftType,
|
||||
tsuc.reserveMode,
|
||||
tsuc.remarks,
|
||||
type.lxname
|
||||
FROM
|
||||
`train_sign_up_course` tsuc
|
||||
@@ -108,22 +111,27 @@ public class TrainSignUpActivityApplyController {
|
||||
CndPlus cnd = CndPlus.create();
|
||||
cnd.andEX("type.id","=",courseTypeId);
|
||||
cnd.and("tsuc.activityId","=",activityId);
|
||||
cnd.asc("type.code");
|
||||
cnd.asc("tsuc.orderNum");
|
||||
sql.setCondition(cnd);
|
||||
|
||||
Pagination pagination = trainSignUpActivityService.listPageMap(pageForm.getPageNumber(), pageForm.getPageSize(), sql);
|
||||
List<NutMap> courseList = pagination.getList();
|
||||
|
||||
List<TrainSignUpActivityCourse> activityCourseList = trainSignUpActivityService.dao().query(TrainSignUpActivityCourse.class, Cnd.where("activityId", "=", activityId));
|
||||
|
||||
Map<String, List<TrainSignUpActivityCourse>> map = activityCourseList.stream().collect(Collectors.groupingBy(TrainSignUpActivityCourse::getCourseId));
|
||||
|
||||
courseList.forEach(c -> {
|
||||
List<TrainSignUpActivityCourse> list = map.get(c.getString("id"));
|
||||
c.put("courseList", list);
|
||||
|
||||
TrainSignUpType type = trainSignUpActivityService.dao().fetch(TrainSignUpType.class, c.getString("courseType"));
|
||||
// trainSignUpActivityService.dao().fetchLinks(c, "^(courseTimeList)$", Cnd.NEW().asc("courseStartTime"));
|
||||
//已报人数
|
||||
AtomicInteger hasRegisterNum = new AtomicInteger();
|
||||
List<TrainSignUpUser> signUpUsers = trainSignUpActivityService.dao().query(TrainSignUpUser.class, Cnd.where("courseId", "=", c.getString("id")));
|
||||
signUpUsers.forEach(item -> {
|
||||
if(type.getSelfAddFamily()) {
|
||||
hasRegisterNum.getAndIncrement();
|
||||
}
|
||||
hasRegisterNum.getAndIncrement();
|
||||
if(type.getIsBringFamily() && type.getIsAddFamily()) {
|
||||
List<NutMap> mapList = item.getMobileColumnsValue();
|
||||
if(Lang.isNotEmpty(mapList)) {
|
||||
@@ -136,7 +144,7 @@ public class TrainSignUpActivityApplyController {
|
||||
});
|
||||
c.put("hasRegisterNum",hasRegisterNum.get());
|
||||
//当前用户是否报过
|
||||
c.put("isSign",trainSignUpActivityService.isSignCourseByUser(c.getString("id"), (String) io.v.nutz.web.commons.utils.ShiroUtil.getPrincipalProperty("id")));
|
||||
c.put("isSign",trainSignUpActivityService.isSignCourseByUser(c.getString("id"), (String) ShiroUtil.getPrincipalProperty("id")));
|
||||
});
|
||||
return pagination;
|
||||
}
|
||||
|
||||
+2
-2
@@ -98,7 +98,7 @@ public class MTrainSignUpActivityController {
|
||||
@Ok("json:full")
|
||||
@POST
|
||||
@RequiresAuthentication
|
||||
public Object doSignUp(TrainSignUpUser trainSignUpUser) {
|
||||
public synchronized Object doSignUp(TrainSignUpUser trainSignUpUser) {
|
||||
try {
|
||||
lock.lock();
|
||||
boolean courseByUser = trainSignUpActivityService.isSignCourseByUser(trainSignUpUser.getCourseId(), ShiroUtil.getPlatformUid());
|
||||
@@ -216,7 +216,7 @@ public class MTrainSignUpActivityController {
|
||||
@POST
|
||||
@ViReturn
|
||||
@RequiresAuthentication
|
||||
public Object validateSignUp(String courseId,
|
||||
public synchronized Object validateSignUp(String courseId,
|
||||
@Param(value = "cndId", required = false) String cndId,
|
||||
@Param(value = "currentFamilyNumber", required = false) Integer currentFamilyNumber) {
|
||||
try {
|
||||
|
||||
@@ -137,4 +137,11 @@ public class TrainSignUpCourse extends BaseModel implements Serializable {
|
||||
@Comment("分类标识")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 30)
|
||||
private String assort;
|
||||
|
||||
@Column
|
||||
@Comment("详细内容备注")
|
||||
@ColDefine(type = ColType.TEXT)
|
||||
private String remarks;
|
||||
|
||||
private String courseTimeName;
|
||||
}
|
||||
|
||||
@@ -125,7 +125,7 @@ layout("/mobile/platform.html"){
|
||||
}
|
||||
|
||||
.van-card-body {
|
||||
padding: 0px 10px 0px 10px
|
||||
padding: 0px 10px 0px 10px;
|
||||
}
|
||||
|
||||
.van-doc-card-two {
|
||||
@@ -136,7 +136,6 @@ layout("/mobile/platform.html"){
|
||||
font-size: 12px;
|
||||
}
|
||||
|
||||
|
||||
.footer .van-button {
|
||||
border-radius: 6px;
|
||||
}
|
||||
@@ -152,27 +151,32 @@ layout("/mobile/platform.html"){
|
||||
.van-tabs__nav--complete {
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
</style>
|
||||
<div id="app" v-cloak>
|
||||
<van-sticky>
|
||||
<van-nav-bar :title="trainType + '列表'" left-arrow
|
||||
@click-left="location.replace('/platform/mobile/trainSignUpActivity/trainList?type=' + type)"></van-nav-bar>
|
||||
<van-nav-bar
|
||||
:title="trainType + '列表'"
|
||||
left-arrow
|
||||
@click-left="location.replace('/platform/mobile/trainSignUpActivity/trainList?type=' + type)"
|
||||
></van-nav-bar>
|
||||
</van-sticky>
|
||||
|
||||
<van-sticky>
|
||||
<van-dropdown-menu active-color="#1867b0">
|
||||
<van-dropdown-item @change="tabChange" v-model="activityStatus"
|
||||
:options="activityOptions"></van-dropdown-item>
|
||||
<van-dropdown-item @change="tabChange" v-model="activityStatus" :options="activityOptions"></van-dropdown-item>
|
||||
<van-dropdown-item @change="courseChange" v-model="courseType" :options="courseOptions"></van-dropdown-item>
|
||||
</van-dropdown-menu>
|
||||
</van-sticky>
|
||||
|
||||
<van-tabs v-if="activityStatus != '1' && assortList.length > 0" v-model="assort" type="card" color="#1867B0"
|
||||
style="margin-top: 10px" @click="tabClick">
|
||||
<van-tab v-for="item in assortList" :name="item" :title="item">
|
||||
|
||||
</van-tab>
|
||||
<van-tabs
|
||||
v-if="activityStatus != '1' && assortList.length > 0"
|
||||
v-model="assort"
|
||||
type="card"
|
||||
color="#1867B0"
|
||||
style="margin-top: 10px"
|
||||
@click="tabClick"
|
||||
>
|
||||
<van-tab v-for="item in assortList" :name="item" :title="item"></van-tab>
|
||||
</van-tabs>
|
||||
|
||||
<!--<van-notice-bar
|
||||
@@ -182,14 +186,10 @@ layout("/mobile/platform.html"){
|
||||
|
||||
<template>
|
||||
<div id="parentDiv" v-model="loading" v-if="tableData.courseList && tableData.courseList.length>0">
|
||||
|
||||
<template v-for="o in tableData.courseList">
|
||||
<div style="position: relative"
|
||||
:class="activityStatus !== '1' ? 'van-doc-card' : 'van-doc-card-my'">
|
||||
<div style="position: relative" :class="activityStatus !== '1' ? 'van-doc-card' : 'van-doc-card-my'">
|
||||
<div>
|
||||
<van-tag type="primary" size="medium">
|
||||
{{getCourseTypeName(o)}}
|
||||
</van-tag>
|
||||
<van-tag type="primary" size="medium">{{getCourseTypeName(o)}}</van-tag>
|
||||
<span style="font-weight: bold; font-size: 14px">
|
||||
{{o.courseName}}
|
||||
<span v-if="activityStatus !== '1'">
|
||||
@@ -211,39 +211,68 @@ layout("/mobile/platform.html"){
|
||||
</div>
|
||||
<div>
|
||||
<span class="train-title">活动时间:</span>
|
||||
<span v-if="o.courseTimeList && o.courseTimeList.length > 1" @click="trainClick(o)"
|
||||
style="color: #1867b0">点我查看</span>
|
||||
<span @click="trainClick(o)" v-if="o.courseTimeList && o.courseTimeList.length === 1"
|
||||
style="color: #1867b0">
|
||||
<span v-if="o.courseTimeList && o.courseTimeList.length > 1" @click="trainClick(o)" style="color: #1867b0">点我查看</span>
|
||||
<span @click="trainClick(o)" v-if="o.courseTimeList && o.courseTimeList.length === 1" style="color: #1867b0">
|
||||
{{o.courseTimeList[0].courseStartTime.substring(11, 19) + ' ~ ' + o.courseTimeList[0].courseEndTime.substring(11, 19)}}
|
||||
</span>
|
||||
</div>
|
||||
<div>
|
||||
<span @click.stop="showPic(FILE_DOMAIN + '/fileStreamPreview?id=' + tableData.wechat.id)"
|
||||
v-if="o.isSign === true && tableData.wechat"
|
||||
style="color: #dd6363">点我查看微信群二维码</span>
|
||||
<span
|
||||
@click.stop="showPic(FILE_DOMAIN + '/fileStreamPreview?id=' + tableData.wechat.id)"
|
||||
v-if="o.isSign === true && tableData.wechat"
|
||||
style="color: #dd6363"
|
||||
>
|
||||
点我查看微信群二维码
|
||||
</span>
|
||||
</div>
|
||||
<van-button type="primary" color="#1867b0" round size="mini"
|
||||
v-if="activityStatus !== '1' && o.isSign === false"
|
||||
style="position: absolute; left: 74%; bottom: 10%; width: 74px; height: 28px"
|
||||
@click.stop="signUp(o)">
|
||||
<van-button
|
||||
type="primary"
|
||||
color="#1867b0"
|
||||
round
|
||||
size="mini"
|
||||
v-if="activityStatus !== '1' && o.isSign === false"
|
||||
style="position: absolute; left: 74%; bottom: 10%; width: 74px; height: 28px"
|
||||
@click.stop="signUp(o)"
|
||||
>
|
||||
我要报名
|
||||
</van-button>
|
||||
|
||||
<van-button type="primary" color="#dd6363" round size="mini"
|
||||
v-if="o.isSign === true && moment().valueOf() < moment(activity.activitySignUpEndTime).valueOf()"
|
||||
style="position: absolute; left: 74%; bottom: 10%; width: 74px; height: 28px"
|
||||
@click.stop="cancel(o)">
|
||||
<van-button
|
||||
type="primary"
|
||||
color="#dd6363"
|
||||
round
|
||||
size="mini"
|
||||
v-if="o.isSign === true && moment().valueOf() < moment(activity.activitySignUpEndTime).valueOf()"
|
||||
style="position: absolute; left: 74%; bottom: 10%; width: 74px; height: 28px"
|
||||
@click.stop="cancel(o)"
|
||||
>
|
||||
取消报名
|
||||
</van-button>
|
||||
|
||||
<image v-if="activityStatus !== '1' && o.isSign === true && moment().valueOf() >= moment(activity.activitySignUpEndTime).valueOf()"
|
||||
style="position: absolute; left: 77%; top: 58%;"
|
||||
src="/assets/mobile/svg/train/sign_up.svg"></image>
|
||||
<image
|
||||
v-if="activityStatus !== '1' && o.isSign === true && moment().valueOf() >= moment(activity.activitySignUpEndTime).valueOf()"
|
||||
style="position: absolute; left: 77%; top: 58%"
|
||||
src="/assets/mobile/svg/train/sign_up.svg"
|
||||
></image>
|
||||
|
||||
<div @click="trainClick(o)" v-if="activityStatus === '1' && o.isMobileSign"
|
||||
style="text-align: center; line-height: 40px; width: 40px; height: 40px;display: inline-block; font-size: 14px;
|
||||
position: absolute; right: -10px; top: 8%; background-color: #00c698; border-radius: 7px; color: white">
|
||||
<div
|
||||
@click="trainClick(o)"
|
||||
v-if="activityStatus === '1' && o.isMobileSign"
|
||||
style="
|
||||
text-align: center;
|
||||
line-height: 40px;
|
||||
width: 40px;
|
||||
height: 40px;
|
||||
display: inline-block;
|
||||
font-size: 14px;
|
||||
position: absolute;
|
||||
right: -10px;
|
||||
top: 8%;
|
||||
background-color: #00c698;
|
||||
border-radius: 7px;
|
||||
color: white;
|
||||
"
|
||||
>
|
||||
签到
|
||||
</div>
|
||||
</div>
|
||||
@@ -256,47 +285,66 @@ layout("/mobile/platform.html"){
|
||||
<!--<div @click="vant.Dialog.alert({message: '上课前30分钟,下课前30分钟。',theme: 'round-button',confirmButtonColor: '#1867b0'})"
|
||||
style="font-size: 12px; color: grey; text-align: right; position: relative; top: 8px; right: 6px; z-index: 2;">签到规则 ></div>-->
|
||||
|
||||
<div id="map" v-if="course.isMobileSign === true && course.signType === 3"
|
||||
style="width: 100%; height: 250px"></div>
|
||||
<div id="map" v-if="course.isMobileSign === true && course.signType === 3" style="width: 100%; height: 250px"></div>
|
||||
|
||||
<van-card
|
||||
:title="item.courseStartTime.substring(0, 10) + '(' +
|
||||
getWeek(item.courseStartTime.substring(0, 10)) + ')'" v-for="(item,index) in qdArray"
|
||||
thumb="/assets/mobile/svg/train/qd1.svg">
|
||||
:title="item.courseStartTime.substring(0, 10) + '(' +
|
||||
getWeek(item.courseStartTime.substring(0, 10)) + ')'"
|
||||
v-for="(item,index) in qdArray"
|
||||
thumb="/assets/mobile/svg/train/qd1.svg"
|
||||
>
|
||||
<template #desc>
|
||||
<div style="margin-top: 7px">
|
||||
{{item.courseStartTime.substring(11, 19) + ' ~ ' + item.courseEndTime.substring(11, 19)}}
|
||||
</div>
|
||||
<div style="margin-top: 7px">{{item.courseStartTime.substring(11, 19) + ' ~ ' + item.courseEndTime.substring(11, 19)}}</div>
|
||||
<div v-if="item.courseLocationCoordinates && item.isMobileSign === true && activityStatus === '1'">
|
||||
<van-button type="primary" color="#1867b0" round size="mini" @click.stop="showQRCode(item, 2)"
|
||||
v-if="(item.isAttend === true && course.giftType === 1 && item.state === 1)
|
||||
<van-button
|
||||
type="primary"
|
||||
color="#1867b0"
|
||||
round
|
||||
size="mini"
|
||||
@click.stop="showQRCode(item, 2)"
|
||||
v-if="(item.isAttend === true && course.giftType === 1 && item.state === 1)
|
||||
|| (moment().unix() > moment(item.courseEndTime).unix() && item.state === 3 && item.isAttend === true && course.giftType === 1)"
|
||||
style="position: absolute; right: 65px; top: 25%; width: 60px; height: 25px">
|
||||
style="position: absolute; right: 65px; top: 25%; width: 60px; height: 25px"
|
||||
>
|
||||
礼品码
|
||||
</van-button>
|
||||
<van-button type="primary" color="#e1e1e1" round size="mini"
|
||||
v-if="(item.isAttend === false && findTime(item) === false && item.state === 1)
|
||||
<van-button
|
||||
type="primary"
|
||||
color="#e1e1e1"
|
||||
round
|
||||
size="mini"
|
||||
v-if="(item.isAttend === false && findTime(item) === false && item.state === 1)
|
||||
|| (moment().unix() > moment(item.courseEndTime).unix() && item.state === 3 && item.isAttend === false)"
|
||||
style="position: absolute; right: 0; top: 25%; width: 60px; height: 25px">
|
||||
style="position: absolute; right: 0; top: 25%; width: 60px; height: 25px"
|
||||
>
|
||||
未签到
|
||||
</van-button>
|
||||
<van-button type="primary" color="#1867b0" round size="mini"
|
||||
v-if="(item.isAttend === false && findTime(item) === true && item.state === 1)
|
||||
<van-button
|
||||
type="primary"
|
||||
color="#1867b0"
|
||||
round
|
||||
size="mini"
|
||||
v-if="(item.isAttend === false && findTime(item) === true && item.state === 1)
|
||||
|| (moment().unix() > moment(item.courseEndTime).unix() && item.state === 3 && item.isAttend === false)"
|
||||
style="position: absolute; right: 0; top: 25%; width: 60px; height: 25px"
|
||||
@click.stop="signIn(item)">
|
||||
style="position: absolute; right: 0; top: 25%; width: 60px; height: 25px"
|
||||
@click.stop="signIn(item)"
|
||||
>
|
||||
签 到
|
||||
</van-button>
|
||||
<van-button type="primary" color="#61ce98" round size="mini"
|
||||
v-if="(item.isAttend === true && item.state === 1)
|
||||
<van-button
|
||||
type="primary"
|
||||
color="#61ce98"
|
||||
round
|
||||
size="mini"
|
||||
v-if="(item.isAttend === true && item.state === 1)
|
||||
|| (moment().unix() > moment(item.courseEndTime).unix() && item.state === 3 && item.isAttend === true)"
|
||||
style="position: absolute; right: 0; top: 25%; width: 60px; height: 25px">
|
||||
style="position: absolute; right: 0; top: 25%; width: 60px; height: 25px"
|
||||
>
|
||||
已签到
|
||||
</van-button>
|
||||
</div>
|
||||
</template>
|
||||
</van-card>
|
||||
|
||||
</van-popup>
|
||||
|
||||
<van-popup class="joinPopup" position="right" v-model:show="joinPopup">
|
||||
@@ -305,17 +353,20 @@ layout("/mobile/platform.html"){
|
||||
<van-form @submit="joinSubmit" :show-error-message="false">
|
||||
<div class="van-doc-card-two" style="margin-bottom: 16px">
|
||||
<div></div>
|
||||
<div class="van-card-header">
|
||||
基础信息
|
||||
</div>
|
||||
<div class="van-card-header">基础信息</div>
|
||||
<div class="van-card-body">
|
||||
<van-field label="姓名" readonly v-model="formData.userName"></van-field>
|
||||
<van-field label="工号" readonly v-model="formData.loginName"></van-field>
|
||||
<van-field label="所在单位" readonly v-model="formData.unitName"></van-field>
|
||||
<van-field label="所属工会" readonly v-model="formData.unionName"></van-field>
|
||||
<van-field label="性别" readonly v-model="formData.sex"></van-field>
|
||||
<van-field label="联系方式" required :rules="[{ required: true, message: '请填写联系方式' }]"
|
||||
placeholder="请填写联系方式" v-model="formData.mobile"></van-field>
|
||||
<van-field
|
||||
label="联系方式"
|
||||
required
|
||||
:rules="[{ required: true, message: '请填写联系方式' }]"
|
||||
placeholder="请填写联系方式"
|
||||
v-model="formData.mobile"
|
||||
></van-field>
|
||||
<train-dynamic-form v-model="dynamicColumnsData" ref="trainDynamicForm"></train-dynamic-form>
|
||||
</div>
|
||||
</div>
|
||||
@@ -328,75 +379,85 @@ layout("/mobile/platform.html"){
|
||||
</div>
|
||||
|
||||
<script>
|
||||
|
||||
|
||||
let pointArray = []
|
||||
let locations = null
|
||||
let map = null
|
||||
let geolocation = null
|
||||
const vue = new Vue({
|
||||
el: '#app',
|
||||
el: "#app",
|
||||
mixins: [mobileMixins],
|
||||
data() {
|
||||
return {
|
||||
assort: '',
|
||||
assort: "",
|
||||
assortList: [],
|
||||
allColumnsData: [],
|
||||
dynamicColumnsData: [],
|
||||
trainType: '培训班',
|
||||
trainType: "培训班",
|
||||
trainTypeList: [],
|
||||
actionShow: false,
|
||||
timeList: [],
|
||||
activityId: '',
|
||||
activityStatus: '0',
|
||||
activityId: "",
|
||||
activityStatus: "0",
|
||||
joinPopup: false,
|
||||
popupShow: false,
|
||||
courseText: '',
|
||||
courseText: "",
|
||||
qdInfoList: [],
|
||||
course: [],
|
||||
qdArray: [],
|
||||
activityOptions: [{text: '全部', value: '0'}, {text: '我报名的', value: '1'}],
|
||||
activityOptions: [
|
||||
{ text: "全部", value: "0" },
|
||||
{ text: "我报名的", value: "1" }
|
||||
],
|
||||
courseOptions: [],
|
||||
courseType: '0',
|
||||
courseType: "0",
|
||||
tempArray: [],
|
||||
activitySignUpStartTime: null,
|
||||
choose: {},
|
||||
activity: '',
|
||||
activity: ""
|
||||
}
|
||||
},
|
||||
components: {
|
||||
'train-dynamic-form': httpVueLoader('/components/mobile/common/TrainDynamicForm.vue')
|
||||
"train-dynamic-form": httpVueLoader("/components/mobile/common/TrainDynamicForm.vue")
|
||||
},
|
||||
methods: {
|
||||
tabClick(name, title) {
|
||||
if(this.courseType === '0' && this.activityStatus !== '1') {
|
||||
this.tableData.courseList = this.tempArray.courseList.filter(o => o.assort === title)
|
||||
if (this.courseType === "0" && this.activityStatus !== "1") {
|
||||
this.tableData.courseList = this.tempArray.courseList.filter((o) => o.assort === title)
|
||||
} else {
|
||||
this.tableData.courseList = this.tempArray.courseList.filter(o => o.assort === title && o.courseType === this.courseType)
|
||||
this.tableData.courseList = this.tempArray.courseList.filter((o) => o.assort === title && o.courseType === this.courseType)
|
||||
}
|
||||
},
|
||||
calcSignUpCount(o) {
|
||||
if(o.reserveMode === 2) {
|
||||
if (o.reserveMode === 2) {
|
||||
let lave = 0
|
||||
let lave2 = 0
|
||||
if(o.hasRegisterNum < o.coursePeopleNumber) {
|
||||
if (o.hasRegisterNum < o.coursePeopleNumber) {
|
||||
lave = o.coursePeopleNumber - o.hasRegisterNum
|
||||
lave2 = o.courseReservedNumber
|
||||
} else {
|
||||
lave = 0
|
||||
lave2 = (o.coursePeopleNumber + o.courseReservedNumber) - o.hasRegisterNum
|
||||
lave2 = o.coursePeopleNumber + o.courseReservedNumber - o.hasRegisterNum
|
||||
}
|
||||
let str = "(<span style='color: red'>余" + lave +"</span>/" + o.coursePeopleNumber + "人"
|
||||
+ ",<span style='color: red'>候补余" + lave2 + "</span>/" + o.courseReservedNumber + "人)"
|
||||
let str =
|
||||
"(<span style='color: red'>余" +
|
||||
lave +
|
||||
"</span>/" +
|
||||
o.coursePeopleNumber +
|
||||
"人" +
|
||||
",<span style='color: red'>候补余" +
|
||||
lave2 +
|
||||
"</span>/" +
|
||||
o.courseReservedNumber +
|
||||
"人)"
|
||||
return str
|
||||
} else {
|
||||
let lave = o.coursePeopleNumber - (o.hasRegisterNum + o.courseReservedNumber)
|
||||
return "(<span style='color: red'>余" + lave +"</span>/" + o.coursePeopleNumber + "人)"
|
||||
return "(<span style='color: red'>余" + lave + "</span>/" + o.coursePeopleNumber + "人)"
|
||||
}
|
||||
},
|
||||
getCourseTypeName(o) {
|
||||
const b = this.courseOptions.find(item => item.value === o.courseType)
|
||||
return b ? b.text : ''
|
||||
const b = this.courseOptions.find((item) => item.value === o.courseType)
|
||||
return b ? b.text : ""
|
||||
},
|
||||
//二维码
|
||||
showQRCode(item, type) {
|
||||
@@ -409,7 +470,7 @@ layout("/mobile/platform.html"){
|
||||
signType: item.signType,
|
||||
isReceiveGift: item.isReceiveGift,
|
||||
giftType: item.giftType,
|
||||
type: type,
|
||||
type: type
|
||||
}
|
||||
// 生成二维码的 base64 编码
|
||||
const content = jrQrcode.getQrBase64(JSON.stringify(o))
|
||||
@@ -419,12 +480,12 @@ layout("/mobile/platform.html"){
|
||||
vant.ImagePreview([url])
|
||||
},
|
||||
findTime(o) {
|
||||
const today = moment().format('YYYY-MM-DD')
|
||||
const today = moment().format("YYYY-MM-DD")
|
||||
return o.courseStartTime.substr(0, 10) === today
|
||||
},
|
||||
findQd() {
|
||||
const today = moment().format('YYYY-MM-DD')
|
||||
const day = this.qdInfoList.find(item => {
|
||||
const today = moment().format("YYYY-MM-DD")
|
||||
const day = this.qdInfoList.find((item) => {
|
||||
return item.courseStartTime.substr(0, 10) === today
|
||||
})
|
||||
if (day === undefined) {
|
||||
@@ -435,28 +496,31 @@ layout("/mobile/platform.html"){
|
||||
},
|
||||
async signIn(o) {
|
||||
if (o.signType === 1) {
|
||||
vant.Dialog.alert({message: '功能马上推出,敬请期待!'})
|
||||
vant.Dialog.alert({ message: "功能马上推出,敬请期待!" })
|
||||
return
|
||||
//调相机扫一扫
|
||||
wxScannerQrCode.scanner().then(async res => {
|
||||
if (res) {
|
||||
const course = JSON.parse(res)
|
||||
const resp = await $.post('/platform/mobile/trainSignUpActivity/codeSign', {
|
||||
codeCourseId: course.courseId,
|
||||
clickCourseId: o.courseId,
|
||||
id: o.id,
|
||||
})
|
||||
if(resp.code === 0) {
|
||||
vant.Dialog.alert({message: '签到成功'})
|
||||
await this.pageData()
|
||||
o.isAttend = true
|
||||
} else {
|
||||
vant.Dialog.alert({message: resp.msg})
|
||||
wxScannerQrCode
|
||||
.scanner()
|
||||
.then(async (res) => {
|
||||
if (res) {
|
||||
const course = JSON.parse(res)
|
||||
const resp = await $.post("/platform/mobile/trainSignUpActivity/codeSign", {
|
||||
codeCourseId: course.courseId,
|
||||
clickCourseId: o.courseId,
|
||||
id: o.id
|
||||
})
|
||||
if (resp.code === 0) {
|
||||
vant.Dialog.alert({ message: "签到成功" })
|
||||
await this.pageData()
|
||||
o.isAttend = true
|
||||
} else {
|
||||
vant.Dialog.alert({ message: resp.msg })
|
||||
}
|
||||
}
|
||||
}
|
||||
}).catch(err => {
|
||||
vant.Dialog.alert({message: err})
|
||||
})
|
||||
})
|
||||
.catch((err) => {
|
||||
vant.Dialog.alert({ message: err })
|
||||
})
|
||||
}
|
||||
if (o.signType === 2) {
|
||||
this.showQRCode(o, 1)
|
||||
@@ -464,8 +528,8 @@ layout("/mobile/platform.html"){
|
||||
if (o.signType === 3) {
|
||||
//获取当前时间,年月日
|
||||
const date = new Date()
|
||||
const today = moment().format('YYYY-MM-DD')
|
||||
const time = moment().format('YYYY-MM-DD hh:mm:ss')
|
||||
const today = moment().format("YYYY-MM-DD")
|
||||
const time = moment().format("YYYY-MM-DD hh:mm:ss")
|
||||
|
||||
const start = new Date(o.courseStartTime).getTime() - 1000 * 60 * 30
|
||||
//const end = new Date(o.courseStartTime).getTime() + 1000 * 60 * 30
|
||||
@@ -473,12 +537,12 @@ layout("/mobile/platform.html"){
|
||||
|
||||
const now = new Date().getTime()
|
||||
if (now < start || now > end) {
|
||||
vant.Toast('请在规定时间签到')
|
||||
vant.Toast("请在规定时间签到")
|
||||
return
|
||||
}
|
||||
const that = this
|
||||
geolocation.getCurrentPosition(async function (status, result) {
|
||||
if (status === 'complete') {
|
||||
if (status === "complete") {
|
||||
locations = [result.position.getLng(), result.position.getLat()]
|
||||
//用户当前位置
|
||||
const userPoint = new AMap.LngLat(result.position.getLng(), result.position.getLat())
|
||||
@@ -486,14 +550,14 @@ layout("/mobile/platform.html"){
|
||||
const coursePoint = new AMap.LngLat(that.course.courseLocationCoordinates[0], that.course.courseLocationCoordinates[1])
|
||||
const distance = Math.round(userPoint.distance(coursePoint))
|
||||
if (distance > 250) {
|
||||
vant.Toast('请在250米内签到')
|
||||
vant.Toast("请在250米内签到")
|
||||
return
|
||||
}
|
||||
const array = [result.position.getLng(), result.position.getLat()]
|
||||
const resp = await $.post('/platform/mobile/trainSignUpActivity/doQd', {
|
||||
const resp = await $.post("/platform/mobile/trainSignUpActivity/doQd", {
|
||||
id: o.id,
|
||||
courseId: that.course.id,
|
||||
point: JSON.stringify(array),
|
||||
point: JSON.stringify(array)
|
||||
})
|
||||
if (resp.code === 0) {
|
||||
await that.pageData()
|
||||
@@ -502,7 +566,7 @@ layout("/mobile/platform.html"){
|
||||
that.popupShow = false
|
||||
} else {
|
||||
}
|
||||
});
|
||||
})
|
||||
}
|
||||
},
|
||||
//获取当前坐标点
|
||||
@@ -517,45 +581,46 @@ layout("/mobile/platform.html"){
|
||||
reject([])
|
||||
})
|
||||
})*/
|
||||
geolocation.getCurrentPosition(function(status,result){
|
||||
if(status === 'complete'){
|
||||
geolocation.getCurrentPosition(function (status, result) {
|
||||
if (status === "complete") {
|
||||
//alert(result.position)
|
||||
locations = result.position
|
||||
}else{
|
||||
} else {
|
||||
}
|
||||
});
|
||||
})
|
||||
},
|
||||
cancel(o) {
|
||||
vant.Dialog.confirm({
|
||||
title: '温馨提示',
|
||||
title: "温馨提示",
|
||||
message: "您确定要<span style='color: red'>取消【" + o.courseName + "】</span>吗?\n一旦确认,可不能反悔了哟!",
|
||||
confirmButtonColor: '#1867b0',
|
||||
}).then(async () => {
|
||||
const resp = await $.post('/platform/mobile/trainSignUpActivity/cancelSignUp', {
|
||||
activityId: o.activityId,
|
||||
courseId: o.id
|
||||
confirmButtonColor: "#1867b0"
|
||||
})
|
||||
.then(async () => {
|
||||
const resp = await $.post("/platform/mobile/trainSignUpActivity/cancelSignUp", {
|
||||
activityId: o.activityId,
|
||||
courseId: o.id
|
||||
})
|
||||
vant.Toast(resp.msg)
|
||||
if (resp.code === 0) {
|
||||
this.pageData()
|
||||
}
|
||||
})
|
||||
vant.Toast(resp.msg)
|
||||
if (resp.code === 0) {
|
||||
this.pageData()
|
||||
}
|
||||
}).catch(() => {
|
||||
});
|
||||
.catch(() => {})
|
||||
},
|
||||
async signUp(o) {
|
||||
this.choose = o
|
||||
|
||||
const res = await $.post('/platform/mobile/trainSignUpActivity/validateSignUp', {
|
||||
const res = await $.post("/platform/mobile/trainSignUpActivity/validateSignUp", {
|
||||
cndId: o.conditionStructureId,
|
||||
courseId: o.id,
|
||||
courseId: o.id
|
||||
})
|
||||
if(res.code !== 0) {
|
||||
if (res.code !== 0) {
|
||||
vant.Dialog.alert({
|
||||
title: '提示',
|
||||
title: "提示",
|
||||
message: res.msg,
|
||||
confirmButtonColor: '#1867b0'
|
||||
confirmButtonColor: "#1867b0"
|
||||
})
|
||||
if(res.code !== 3) {
|
||||
if (res.code !== 3) {
|
||||
return
|
||||
}
|
||||
}
|
||||
@@ -567,15 +632,15 @@ layout("/mobile/platform.html"){
|
||||
sex: "${@shiro.getPrincipalProperty('sex')}",
|
||||
birthday: "${@shiro.getPrincipalProperty('birthday')}",
|
||||
unionName: "${@shiro.getPrincipalProperty('union').getUnionname()}",
|
||||
unitName: "${@shiro.getPrincipalProperty('unit').getName()}",
|
||||
unitName: "${@shiro.getPrincipalProperty('unit').getName()}"
|
||||
}
|
||||
this.$set(this.formData, "activityId", o.activityId)
|
||||
this.$set(this.formData, "courseId", o.id)
|
||||
|
||||
const column = this.allColumnsData.find(x => x.id === o.courseType)
|
||||
const column = this.allColumnsData.find((x) => x.id === o.courseType)
|
||||
this.dynamicColumnsData = column ? column.trainMobileSignColumnList : []
|
||||
this.dynamicColumnsData.forEach(item => {
|
||||
item.columnValue = ''
|
||||
this.dynamicColumnsData.forEach((item) => {
|
||||
item.columnValue = ""
|
||||
})
|
||||
this.joinPopup = true
|
||||
},
|
||||
@@ -590,61 +655,65 @@ layout("/mobile/platform.html"){
|
||||
if (!valid) return
|
||||
//获取家属是多少人
|
||||
let per = 0
|
||||
this.dynamicColumnsData.forEach(item => {
|
||||
if(item.columnCode === 'xdqsrs') {
|
||||
this.dynamicColumnsData.forEach((item) => {
|
||||
if (item.columnCode === "xdqsrs") {
|
||||
per += Number(item.columnValue)
|
||||
}
|
||||
})
|
||||
const res = await $.post('/platform/mobile/trainSignUpActivity/validateSignUp', {
|
||||
const res = await $.post("/platform/mobile/trainSignUpActivity/validateSignUp", {
|
||||
cndId: this.choose.conditionStructureId,
|
||||
courseId: this.choose.id,
|
||||
currentFamilyNumber: per,
|
||||
currentFamilyNumber: per
|
||||
})
|
||||
if(res.code !== 0) {
|
||||
if (res.code !== 0) {
|
||||
vant.Dialog.alert({
|
||||
title: '提示',
|
||||
title: "提示",
|
||||
message: res.msg,
|
||||
confirmButtonColor: '#1867b0'
|
||||
confirmButtonColor: "#1867b0"
|
||||
})
|
||||
return
|
||||
}
|
||||
|
||||
vant.Dialog.confirm({
|
||||
title: '温馨提示',
|
||||
message: '您选择了【' + this.choose.courseName + '】\n一旦确认,可不能反悔了哟',
|
||||
confirmButtonColor: '#1867b0',
|
||||
}).then(async () => {
|
||||
const toast = vant.Toast.loading({
|
||||
duration: 0,
|
||||
forbidClick: true,
|
||||
overlay: true,
|
||||
message: '努力提交中',
|
||||
})
|
||||
const mobileColumnsValue = this.dynamicColumnsData.map(v => {
|
||||
return {
|
||||
columnName: v.columnName,
|
||||
columnValue: v.columnValue,
|
||||
columnCode: v.columnCode,
|
||||
columnFormType: v.columnFormType
|
||||
title: "温馨提示",
|
||||
message: "您选择了【" + this.choose.courseName + "】\n一旦确认,可不能反悔了哟",
|
||||
confirmButtonColor: "#1867b0"
|
||||
})
|
||||
.then(async () => {
|
||||
const toast = vant.Toast.loading({
|
||||
duration: 0,
|
||||
forbidClick: true,
|
||||
overlay: true,
|
||||
message: "努力提交中"
|
||||
})
|
||||
const mobileColumnsValue = this.dynamicColumnsData.map((v) => {
|
||||
return {
|
||||
columnName: v.columnName,
|
||||
columnValue: v.columnValue,
|
||||
columnCode: v.columnCode,
|
||||
columnFormType: v.columnFormType
|
||||
}
|
||||
})
|
||||
this.formData.mobileColumnsValue = JSON.stringify(mobileColumnsValue)
|
||||
const resp = await $.post("/platform/mobile/trainSignUpActivity/doSignUp", this.formData)
|
||||
vant.Toast(resp.msg)
|
||||
if (resp.code === 0) {
|
||||
await this.pageData()
|
||||
this.joinPopup = false
|
||||
}
|
||||
toast.clear()
|
||||
})
|
||||
this.formData.mobileColumnsValue = JSON.stringify(mobileColumnsValue)
|
||||
const resp = await $.post('/platform/mobile/trainSignUpActivity/doSignUp', this.formData)
|
||||
vant.Toast(resp.msg)
|
||||
if (resp.code === 0) {
|
||||
await this.pageData()
|
||||
this.joinPopup = false
|
||||
}
|
||||
toast.clear()
|
||||
}).catch(() => {
|
||||
});
|
||||
.catch(() => {})
|
||||
},
|
||||
trainClick(o) {
|
||||
this.timeList = o.courseTimeList
|
||||
this.course = o
|
||||
this.qdArray = this.activityStatus === '0' ? o.courseTimeList : this.qdInfoList.filter(item => {
|
||||
return item.courseId === o.id
|
||||
})
|
||||
this.qdArray =
|
||||
this.activityStatus === "0"
|
||||
? o.courseTimeList
|
||||
: this.qdInfoList.filter((item) => {
|
||||
return item.courseId === o.id
|
||||
})
|
||||
if (o.signType === 3) {
|
||||
this.initMap(o)
|
||||
}
|
||||
@@ -656,14 +725,14 @@ layout("/mobile/platform.html"){
|
||||
}
|
||||
this.$nextTick(async () => {
|
||||
// 地图初始化应该在地图容器div已经添加到DOM树之后
|
||||
map = new AMap.Map('map', {
|
||||
map = new AMap.Map("map", {
|
||||
zoom: 12,
|
||||
center: o.courseLocationCoordinates,
|
||||
resizeEnable: true,
|
||||
scrollWheel: true,
|
||||
scrollWheel: true
|
||||
})
|
||||
|
||||
AMap.plugin('AMap.Geolocation', function() {
|
||||
AMap.plugin("AMap.Geolocation", function () {
|
||||
geolocation = new AMap.Geolocation({
|
||||
// 是否使用高精度定位,默认:true
|
||||
enableHighAccuracy: true,
|
||||
@@ -674,73 +743,73 @@ layout("/mobile/platform.html"){
|
||||
// 定位成功后调整地图视野范围使定位位置及精度范围视野内可见,默认:false
|
||||
//zoomToAccuracy: true,
|
||||
// 定位按钮的排放位置, RB表示右下
|
||||
buttonPosition: 'RB',
|
||||
showCircle: false,
|
||||
buttonPosition: "RB",
|
||||
showCircle: false
|
||||
//showButton: false,
|
||||
})
|
||||
map.addControl(geolocation);
|
||||
map.addControl(geolocation)
|
||||
})
|
||||
|
||||
// 创建一个 Marker 实例:
|
||||
var marker = new AMap.Marker({
|
||||
position: new AMap.LngLat(o.courseLocationCoordinates[0], o.courseLocationCoordinates[1]), // 经纬度对象,也可以是经纬度构成的一维数组[116.39, 39.9]
|
||||
title: '签到点'
|
||||
});
|
||||
position: new AMap.LngLat(o.courseLocationCoordinates[0], o.courseLocationCoordinates[1]), // 经纬度对象,也可以是经纬度构成的一维数组[116.39, 39.9]
|
||||
title: "签到点"
|
||||
})
|
||||
|
||||
//获取当前坐标点
|
||||
await this.getPoint()
|
||||
|
||||
var circle = new AMap.Circle({
|
||||
center: new AMap.LngLat(o.courseLocationCoordinates[0], o.courseLocationCoordinates[1]), // 圆心位置
|
||||
center: new AMap.LngLat(o.courseLocationCoordinates[0], o.courseLocationCoordinates[1]), // 圆心位置
|
||||
radius: 250, // 圆半径
|
||||
borderWeight: 1,
|
||||
strokeOpacity: 1,
|
||||
fillOpacity: 0.4,
|
||||
});
|
||||
fillOpacity: 0.4
|
||||
})
|
||||
|
||||
map.add(circle);
|
||||
map.add(circle)
|
||||
// 缩放地图到合适的视野级别
|
||||
map.setFitView([circle])
|
||||
|
||||
// 多个点实例组成的数组
|
||||
var markerList = [marker];
|
||||
map.add(markerList);
|
||||
var markerList = [marker]
|
||||
map.add(markerList)
|
||||
})
|
||||
},
|
||||
async pageData() {
|
||||
const resp = await $.get('/platform/mobile/trainSignUpActivity/findOne', {
|
||||
const resp = await $.get("/platform/mobile/trainSignUpActivity/findOne", {
|
||||
id: this.activityId,
|
||||
tabIndex: this.activityStatus
|
||||
})
|
||||
if (resp.code === 0) {
|
||||
this.tableData = resp.data
|
||||
this.assortList = Array.from(new Set(this.tableData.courseList.map(o => o.assort).filter(o => o !== '' && o !== undefined)))
|
||||
this.assortList = Array.from(new Set(this.tableData.courseList.map((o) => o.assort).filter((o) => o !== "" && o !== undefined)))
|
||||
this.tempArray = clone(this.tableData)
|
||||
if(this.assortList.length > 0 && this.activityStatus !== '1') {
|
||||
this.tableData.courseList = this.tableData.courseList.filter(o => o.assort === this.assortList[0])
|
||||
if (this.assortList.length > 0 && this.activityStatus !== "1") {
|
||||
this.tableData.courseList = this.tableData.courseList.filter((o) => o.assort === this.assortList[0])
|
||||
}
|
||||
const type = this.trainTypeList.find(o => o.code === this.tableData.trainType)
|
||||
this.trainType = type ? type.name : '培训班'
|
||||
const type = this.trainTypeList.find((o) => o.code === this.tableData.trainType)
|
||||
this.trainType = type ? type.name : "培训班"
|
||||
} else {
|
||||
this.tableData = []
|
||||
this.loading = false
|
||||
}
|
||||
await this.getQdInfoList()
|
||||
this.courseChange(this.courseType, 1)
|
||||
this.loading = false;
|
||||
this.loading = false
|
||||
},
|
||||
async getQdInfoList() {
|
||||
const resp = await $.get('/platform/mobile/trainSignUpActivity/getQdInfoList', {
|
||||
activityId: this.activityId,
|
||||
const resp = await $.get("/platform/mobile/trainSignUpActivity/getQdInfoList", {
|
||||
activityId: this.activityId
|
||||
})
|
||||
if (resp.code === 0) {
|
||||
this.qdInfoList = resp.data
|
||||
}
|
||||
},
|
||||
getWeek(dateString) {
|
||||
var dateArray = dateString.split("-");
|
||||
const date = new Date(dateArray[0], parseInt(dateArray[1] - 1), dateArray[2]);
|
||||
return "周" + "日一二三四五六".charAt(date.getDay());
|
||||
var dateArray = dateString.split("-")
|
||||
const date = new Date(dateArray[0], parseInt(dateArray[1] - 1), dateArray[2])
|
||||
return "周" + "日一二三四五六".charAt(date.getDay())
|
||||
},
|
||||
tabChange(val) {
|
||||
this.tabName = val
|
||||
@@ -750,19 +819,19 @@ layout("/mobile/platform.html"){
|
||||
this.closeLoading()
|
||||
},
|
||||
async getAllType() {
|
||||
const resp = await $.post('/platform/trainSingUp/manage/type/getAllType', {})
|
||||
const resp = await $.post("/platform/trainSingUp/manage/type/getAllType", {})
|
||||
this.allColumnsData = resp.data
|
||||
return resp.data
|
||||
},
|
||||
async getCourseText() {
|
||||
const courseArray = await this.getAllType()
|
||||
this.courseOptions = []
|
||||
this.courseOptions.push({text: '全部类型', value: '0'})
|
||||
this.courseOptions.push({ text: "全部类型", value: "0" })
|
||||
for (const item of courseArray) {
|
||||
if (item.personMaxRegisterNum > 0) {
|
||||
this.courseText += item.value + '报名最多选' + item.personMaxRegisterNum + '项,'
|
||||
this.courseText += item.value + "报名最多选" + item.personMaxRegisterNum + "项,"
|
||||
}
|
||||
this.courseOptions.push({text: item.lxname, value: item.id})
|
||||
this.courseOptions.push({ text: item.lxname, value: item.id })
|
||||
}
|
||||
this.courseText = this.courseText.substr(0, this.courseText.length - 1)
|
||||
},
|
||||
@@ -771,19 +840,22 @@ layout("/mobile/platform.html"){
|
||||
this.tableData.courseList = []
|
||||
this.startLoading()
|
||||
}
|
||||
if(this.assortList.length > 0 && this.activityStatus !== '1') {
|
||||
if(value === '0') {
|
||||
this.tableData.courseList = this.tempArray.courseList.filter(o => o.assort === this.assort)
|
||||
if (this.assortList.length > 0 && this.activityStatus !== "1") {
|
||||
if (value === "0") {
|
||||
this.tableData.courseList = this.tempArray.courseList.filter((o) => o.assort === this.assort)
|
||||
} else {
|
||||
this.tableData.courseList = this.tempArray.courseList.filter(item => item.courseType === value && item.assort === this.assort)
|
||||
this.tableData.courseList = this.tempArray.courseList.filter(
|
||||
(item) => item.courseType === value && item.assort === this.assort
|
||||
)
|
||||
}
|
||||
} else {
|
||||
this.tableData.courseList = value === '0' ? this.tempArray.courseList : this.tempArray.courseList.filter(item => item.courseType === value)
|
||||
this.tableData.courseList =
|
||||
value === "0" ? this.tempArray.courseList : this.tempArray.courseList.filter((item) => item.courseType === value)
|
||||
}
|
||||
this.closeLoading()
|
||||
},
|
||||
async getActivity() {
|
||||
const resp = await $.get('/platform/mobile/trainSignUpActivity/findOne', {
|
||||
const resp = await $.get("/platform/mobile/trainSignUpActivity/findOne", {
|
||||
id: this.activityId,
|
||||
tabIndex: 0
|
||||
})
|
||||
@@ -794,26 +866,27 @@ layout("/mobile/platform.html"){
|
||||
},
|
||||
async created() {
|
||||
this.trainTypeList = await getDictOptions("trainSignUpType")
|
||||
this.activityId = GetQueryString('activityId')
|
||||
this.type = GetQueryString('type')
|
||||
const time = GetQueryString('endTime')
|
||||
if (this.type === 'my') {
|
||||
this.activityOptions = [{text: '我报名的', value: '1'}]
|
||||
this.activityStatus = '1'
|
||||
this.activityId = GetQueryString("activityId")
|
||||
this.type = GetQueryString("type")
|
||||
const time = GetQueryString("endTime")
|
||||
if (this.type === "my") {
|
||||
this.activityOptions = [{ text: "我报名的", value: "1" }]
|
||||
this.activityStatus = "1"
|
||||
} else {
|
||||
this.activityOptions = [{text: '全部', value: '0'}, {text: '我报名的', value: '1'}]
|
||||
this.activityStatus = new Date().getTime() > new Date(time).getTime() ? '1' : '0'
|
||||
this.activityOptions = [
|
||||
{ text: "全部", value: "0" },
|
||||
{ text: "我报名的", value: "1" }
|
||||
]
|
||||
this.activityStatus = new Date().getTime() > new Date(time).getTime() ? "1" : "0"
|
||||
}
|
||||
this.activitySignUpStartTime = GetQueryString('activitySignUpStartTime')
|
||||
vant.Toast.setDefaultOptions({duration: 2000});
|
||||
this.activitySignUpStartTime = GetQueryString("activitySignUpStartTime")
|
||||
vant.Toast.setDefaultOptions({ duration: 2000 })
|
||||
this.startLoading()
|
||||
this.pageData()
|
||||
this.getCourseText()
|
||||
this.getActivity()
|
||||
this.closeLoading()
|
||||
|
||||
//await wxScannerQrCode.initWxConfig(window.location.href)
|
||||
},
|
||||
}
|
||||
})
|
||||
</script>
|
||||
<!--#
|
||||
|
||||
@@ -166,6 +166,15 @@ layout("/mobile/platform.html"){
|
||||
</van-list>
|
||||
<van-empty v-else description="暂无数据"></van-empty>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<van-tabbar v-model="tarBarActive">
|
||||
<van-tabbar-item icon="home-o" replace @click="pjaxReplace('/platform/mobile/trainSignUpActivity/trainList')">活动报名</van-tabbar-item>
|
||||
<van-tabbar-item icon="manager-o" replace @click="pjaxReplace('/platform/mobile/trainSignUpActivity/trainList?type=my')">
|
||||
我的活动
|
||||
</van-tabbar-item>
|
||||
</van-tabbar>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
@@ -208,18 +217,38 @@ layout("/mobile/platform.html"){
|
||||
return
|
||||
}
|
||||
if (this.type === "my") {
|
||||
window.location.href =
|
||||
// window.location.href =
|
||||
// "/platform/mobile/trainSignUpActivity/trainInfo" +
|
||||
// "?activityId=" +
|
||||
// o.id +
|
||||
// "&endTime=" +
|
||||
// o.activitySignUpEndTime +
|
||||
// "&type=my" +
|
||||
// "&startTime=" +
|
||||
// o.activitySignUpStartTime
|
||||
pjaxReplace(
|
||||
"/platform/mobile/trainSignUpActivity/trainInfo" +
|
||||
"?activityId=" +
|
||||
o.id +
|
||||
"&endTime=" +
|
||||
o.activitySignUpEndTime +
|
||||
"&type=my" +
|
||||
"&startTime=" +
|
||||
o.activitySignUpStartTime
|
||||
"?activityId=" +
|
||||
o.id +
|
||||
"&endTime=" +
|
||||
o.activitySignUpEndTime +
|
||||
"&type=my" +
|
||||
"&startTime=" +
|
||||
o.activitySignUpStartTime
|
||||
)
|
||||
} else {
|
||||
window.location.href =
|
||||
"/platform/mobile/trainSignUpActivity/activityInfo?activityId=" + o.id + "&endTime=" + o.activitySignUpEndTime
|
||||
const scopeUser = await getScopeUser(o.activityGroupId)
|
||||
if (scopeUser === 0) {
|
||||
vant.Dialog.alert({
|
||||
title: "提示",
|
||||
message: "您不在报名人员范围内",
|
||||
confirmButtonColor: "#1867b0"
|
||||
})
|
||||
return
|
||||
}
|
||||
// window.location.href =
|
||||
// "/platform/mobile/trainSignUpActivity/activityInfo?activityId=" + o.id + "&endTime=" + o.activitySignUpEndTime
|
||||
pjaxReplace("/platform/mobile/trainSignUpActivity/trainInfo?activityId=" + o.id + "&endTime=" + o.activitySignUpEndTime)
|
||||
}
|
||||
},
|
||||
async pageData() {
|
||||
|
||||
@@ -182,18 +182,17 @@ layout("/layouts/platform.html"){
|
||||
<el-col v-for="item in activityList.slice((index-1)*4,index*4)" :span="6">
|
||||
<el-card :class="'box-card '+(item.id===pageForm.activityId?'activeCard':'')" style="border-radius: 10px">
|
||||
<div slot="header" class="clearfix" style="font-size: 16px; padding: 5px 0" @click="openApply(item)">
|
||||
<div
|
||||
style="width: 88%; white-space: nowrap; overflow: hidden; display: inline-block; text-overflow: ellipsis"
|
||||
>
|
||||
{{item.activityName}}
|
||||
</div>
|
||||
<el-button @click="openApply(item)" class="reserve_btn" type="text">报名</el-button>
|
||||
<el-tooltip class="item" effect="dark" :content="item.activityName" placement="top-start">
|
||||
<span v-if="item.activityName.length<=10">{{item.activityName}}</span>
|
||||
<span v-else>{{item.activityName.substr(0,10)}}...</span>
|
||||
</el-tooltip>
|
||||
<el-button @click="openApply(item)" class="reserve_btn" type="text">请选择活动报名</el-button>
|
||||
</div>
|
||||
<div @click="openApply(item)">
|
||||
<div class="text e-item">
|
||||
<span style="color: gray">活动类型:</span>
|
||||
|
||||
<span>{{item.activityMode == 1 ? '校工会' : '基层工会'}}</span>
|
||||
<span>{{item.activityMode == 1 ? '校工会' : '分工会'}}</span>
|
||||
<el-tag
|
||||
type="danger"
|
||||
effect="dark"
|
||||
@@ -225,13 +224,15 @@ layout("/layouts/platform.html"){
|
||||
</div>
|
||||
<div class="text e-item">
|
||||
<span style="color: gray">报名时间:</span>
|
||||
{{moment(item.activitySignUpStartTime).format('YYYY/MM/DD HH:mm')}} 至
|
||||
{{moment(item.activitySignUpEndTime).format('YYYY/MM/DD HH:mm')}}
|
||||
{{moment(item.activitySignUpStartTime).format('MM/DD HH:mm')}} 至
|
||||
{{moment(item.activitySignUpEndTime).format('MM/DD HH:mm')}}
|
||||
</div>
|
||||
<div class="text item">
|
||||
<span style="color: gray">活动时间:</span>
|
||||
{{moment(item.activityStartTime).format('YYYY/MM/DD HH:mm')}} 至
|
||||
{{moment(item.activityEndTime).format('YYYY/MM/DD HH:mm')}}
|
||||
<span>
|
||||
{{moment(item.activityStartTime).format('MM/DD HH:mm')}} 至
|
||||
{{moment(item.activityEndTime).format('MM/DD HH:mm')}}
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</el-card>
|
||||
@@ -239,7 +240,7 @@ layout("/layouts/platform.html"){
|
||||
</el-row>
|
||||
</el-carousel-item>
|
||||
</el-carousel>
|
||||
<el-empty description="暂无数据" v-else></el-empty>
|
||||
<el-empty v-else description="暂无数据"></el-empty>
|
||||
</el-row>
|
||||
|
||||
<el-card shadow="never" class="mt10">
|
||||
@@ -248,7 +249,7 @@ layout("/layouts/platform.html"){
|
||||
<div class="search-item-option">
|
||||
<el-select
|
||||
v-model="pageForm.courseTypeId"
|
||||
:placeholder="'请选择' + trainType"
|
||||
:placeholder="'请选择' + trainType + '类型'"
|
||||
filterable
|
||||
clearable
|
||||
style="width: 100%; margin-bottom: 5px; margin-left: 10px"
|
||||
@@ -277,6 +278,7 @@ layout("/layouts/platform.html"){
|
||||
:key="column.prop"
|
||||
:label="column.label"
|
||||
:prop="column.prop"
|
||||
:width="column.width"
|
||||
:sortable="column.sortable"
|
||||
show-overflow-tooltip
|
||||
>
|
||||
@@ -287,7 +289,20 @@ layout("/layouts/platform.html"){
|
||||
</template>
|
||||
|
||||
<template scope="{row}" v-else-if="column.prop=='courseTime'">
|
||||
<el-button style="padding: 0" @click="openViewCourseTime(row.id)" type="text">点击查看{{trainType}}时间</el-button>
|
||||
<template v-if="row.courseName.includes('时间待定')">
|
||||
<span style="color: #e5a15e">活动时间另行通知</span>
|
||||
</template>
|
||||
<template v-else>
|
||||
<el-button v-if="row.courseList && row.courseList.length == 1" type="text" style="padding: 0">
|
||||
<span>
|
||||
{{moment(row.courseList[0].courseStartTime).format('MM-DD HH:mm')}}
|
||||
至{{moment(row.courseList[0].courseEndTime).format('MM-DD HH:mm')}}
|
||||
</span>
|
||||
</el-button>
|
||||
<el-button v-else style="padding: 0" @click="openViewCourseTime(row)" type="text">
|
||||
点击查看{{trainType}}时间
|
||||
</el-button>
|
||||
</template>
|
||||
</template>
|
||||
|
||||
<template scope="{row}" v-else-if="column.prop=='applyNum'">
|
||||
@@ -295,6 +310,12 @@ layout("/layouts/platform.html"){
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column label="详细信息" prop="remarks">
|
||||
<template scope="{row}">
|
||||
<el-button type="text" @click="openViewRemark(row)">点我查看详情</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column align="center" label="操作" width="150px">
|
||||
<template slot-scope="scope">
|
||||
<!-- <el-button type="primary" size="small">查看信息</el-button>-->
|
||||
@@ -307,94 +328,6 @@ layout("/layouts/platform.html"){
|
||||
</el-card>
|
||||
</template>
|
||||
|
||||
<template #edit>
|
||||
<el-form :model="formData" ref="form" label-width="120px">
|
||||
<el-row>
|
||||
<el-col span="24">
|
||||
<el-form-item label="姓名" prop="username">
|
||||
<el-input readonly v-model="formData.username"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col span="24">
|
||||
<el-form-item label="工号" prop="loginname">
|
||||
<el-input readonly v-model="formData.loginname"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col span="24">
|
||||
<el-form-item label="所在单位" prop="unitName">
|
||||
<el-input readonly v-model="formData.unitName"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col span="24">
|
||||
<el-form-item label="所属工会" prop="unionName">
|
||||
<el-input readonly v-model="formData.unionName"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col span="24">
|
||||
<el-form-item label="性别" prop="sex">
|
||||
<el-input readonly v-model="formData.sex"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col span="24">
|
||||
<el-form-item label="联系方式" prop="mobile">
|
||||
<el-input v-model="formData.mobile"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-row>
|
||||
<el-col span="24">
|
||||
<el-form-item
|
||||
v-for="(column, index) in formData.trainMobileSignColumnList"
|
||||
:prop="'trainMobileSignColumnList.' + index + '.columnValue'"
|
||||
:label="column.columnName"
|
||||
:key="column.columnCode"
|
||||
:rules="{ required: column.isRequired,
|
||||
message: (['SELECT', 'FILE'].includes(column.columnFormType) ? '请选择' : '请填写') + column.columnName,
|
||||
trigger: 'blur'}"
|
||||
>
|
||||
<!--文本框-->
|
||||
<template v-if="!['SELECT'].includes(column.columnFormType) && ['VARCHAR','TEXT','INT'].includes(column.columnType)">
|
||||
<el-input
|
||||
v-model="column.columnValue"
|
||||
:placeholder="'请填写' + column.columnName"
|
||||
:type="['INT'].includes(column.columnType) ? 'number' : ''"
|
||||
></el-input>
|
||||
</template>
|
||||
<!--选择框-->
|
||||
<template v-else-if="['SELECT'].includes(column.columnFormType) && ['VARCHAR','TEXT','INT'].includes(column.columnType)">
|
||||
<el-select v-model="column.columnValue" clearable :placeholder="'请选择' + column.columnName" style="width: 100%">
|
||||
<el-option v-for="item in column.selectValues" :key="item" :label="item" :value="item"></el-option>
|
||||
</el-select>
|
||||
</template>
|
||||
<!--时间框-->
|
||||
<template v-else-if="['DATE', 'DATETIME'].includes(column.columnType)">
|
||||
<el-date-picker
|
||||
style="width: 100%"
|
||||
v-model="column.columnValue"
|
||||
:type="column.columnType === 'DATE' ? 'date' : 'datetime'"
|
||||
:placeholder="'请选择' + column.columnName"
|
||||
:value-format="column.columnType === 'DATE' ? 'yyyy-MM-dd' : 'yyyy-MM-dd HH:mm:ss'"
|
||||
></el-date-picker>
|
||||
</template>
|
||||
<!--文件-->
|
||||
<template v-else-if="['JSON'].includes(column.columnType)">
|
||||
<file-upload :files.sync="column.columnValue" :max="column.fileNumber" :type="column.fileType"></file-upload>
|
||||
</template>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
|
||||
<el-row type="flex" justify="end">
|
||||
<el-button type="primary" @click="doSubmit">提交</el-button>
|
||||
</el-row>
|
||||
</template>
|
||||
|
||||
<el-dialog :visible.sync="courseTimeListDialog" :title="trainType + '时间'" width="60%" append-to-body>
|
||||
<el-table :data="courseTimeList">
|
||||
<el-table-column label="日期" prop="courseDate">
|
||||
@@ -413,6 +346,129 @@ layout("/layouts/platform.html"){
|
||||
<div id="viewMap" style="width: 100%; height: 500px"></div>
|
||||
</el-dialog>
|
||||
</guava>
|
||||
|
||||
<el-dialog :visible.sync="applyDialog" :title="trainType + '报名'" width="50%" append-to-body>
|
||||
<el-form :model="formData" ref="form" label-width="90px">
|
||||
<el-row>
|
||||
<el-col span="24">
|
||||
<el-form-item label="姓名" prop="username">
|
||||
<el-input readonly v-model="formData.username"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col span="24">
|
||||
<el-form-item label="工号" prop="loginname">
|
||||
<el-input readonly v-model="formData.loginname"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col span="24">
|
||||
<el-form-item label="所在单位" prop="unitName">
|
||||
<el-input readonly v-model="formData.unitName"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col span="24">
|
||||
<el-form-item label="所属工会" prop="unionName">
|
||||
<el-input readonly v-model="formData.unionName"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col span="24">
|
||||
<el-form-item label="性别" prop="sex">
|
||||
<el-input readonly v-model="formData.sex"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col span="24">
|
||||
<el-form-item label="联系方式" prop="mobile">
|
||||
<el-input v-model="formData.mobile"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-row>
|
||||
<el-col span="24">
|
||||
<el-form-item
|
||||
v-for="(column, index) in formData.trainMobileSignColumnList"
|
||||
:prop="'trainMobileSignColumnList.' + index + '.columnValue'"
|
||||
:label="column.columnName"
|
||||
:key="column.columnCode"
|
||||
:rules="{ required: column.isRequired,
|
||||
message: (['SELECT', 'FILE'].includes(column.columnFormType) ? '请选择' : '请填写') + column.columnName,
|
||||
trigger: 'blur'}"
|
||||
>
|
||||
<!--文本框-->
|
||||
<template v-if="!['SELECT'].includes(column.columnFormType) && ['VARCHAR','TEXT','INT'].includes(column.columnType)">
|
||||
<el-input
|
||||
v-model="column.columnValue"
|
||||
:placeholder="'请填写' + column.columnName"
|
||||
:type="['INT'].includes(column.columnType) ? 'number' : ''"
|
||||
></el-input>
|
||||
</template>
|
||||
<!--选择框-->
|
||||
<template v-else-if="['SELECT'].includes(column.columnFormType) && ['VARCHAR','TEXT','INT'].includes(column.columnType)">
|
||||
<el-select v-model="column.columnValue" :placeholder="'请选择' + column.columnName" style="width: 100%">
|
||||
<el-option v-for="item in column.selectValues" :key="item" :label="item" :value="item"></el-option>
|
||||
</el-select>
|
||||
</template>
|
||||
<!--时间框-->
|
||||
<template v-else-if="['DATE', 'DATETIME'].includes(column.columnType)">
|
||||
<el-date-picker
|
||||
style="width: 100%"
|
||||
v-model="column.columnValue"
|
||||
:type="column.columnType === 'DATE' ? 'date' : 'datetime'"
|
||||
:placeholder="'请选择' + column.columnName"
|
||||
:value-format="column.columnType === 'DATE' ? 'yyyy-MM-dd' : 'yyyy-MM-dd HH:mm:ss'"
|
||||
></el-date-picker>
|
||||
</template>
|
||||
<!--文件-->
|
||||
<template v-else-if="['JSON'].includes(column.columnType)">
|
||||
<file-upload :files.sync="column.columnValue" :max="column.fileNumber" :type="column.fileType"></file-upload>
|
||||
</template>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
|
||||
<el-row type="flex" justify="end">
|
||||
<el-button type="primary" @click="doSubmit">提 交</el-button>
|
||||
</el-row>
|
||||
</el-dialog>
|
||||
|
||||
<el-dialog :visible.sync="remarkShow" :title="courseRemark.courseName" width="50%" append-to-body top="2%">
|
||||
<el-tabs v-model="remarkActive" type="border-card" @tab-click="remarkActiveClick">
|
||||
<el-tab-pane label="详细信息" name="first">
|
||||
<div class="text-center" v-html="courseRemark.remarks" style="height: 600px; overflow-y: auto"></div>
|
||||
</el-tab-pane>
|
||||
<el-tab-pane label="报名人员" name="second">
|
||||
<div class="btn-group tool-button mt5">
|
||||
<el-input v-model="registerForm.searchKeyword" placeholder="请输入姓名查询" size="small"></el-input>
|
||||
</div>
|
||||
<div class="btn-group tool-button mt5">
|
||||
<el-select v-model="registerForm.unionId" clearable filterable placeholder="请选择院级工会" size="small">
|
||||
<el-option v-for="item in unionList" :key="item.id" :label="item.unionname" :value="item.id"></el-option>
|
||||
</el-select>
|
||||
</div>
|
||||
<div class="btn-group tool-button mt5">
|
||||
<el-select v-model="registerForm.sex" clearable filterable placeholder="请选择性别" size="small">
|
||||
<el-option label="男" value="男"></el-option>
|
||||
<el-option label="女" value="女"></el-option>
|
||||
</el-select>
|
||||
</div>
|
||||
<div class="btn-group tool-button mt5">
|
||||
<el-button icon="el-icon-search" type="primary" @click="getSignUsers" size="small"></el-button>
|
||||
</div>
|
||||
<el-table :data="signUsers" max-height="500" size="small">
|
||||
<el-table-column prop="username" label="姓名" header-align="center" align="center"></el-table-column>
|
||||
<el-table-column prop="sex" label="性别" header-align="center" align="center"></el-table-column>
|
||||
<el-table-column prop="unionname" label="所属工会" header-align="center" align="center"></el-table-column>
|
||||
</el-table>
|
||||
</el-tab-pane>
|
||||
</el-tabs>
|
||||
<el-row type="flex" justify="end" style="margin-top: 20px">
|
||||
<el-button type="primary" @click="remarkShow = false">关 闭</el-button>
|
||||
</el-row>
|
||||
</el-dialog>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
@@ -423,6 +479,8 @@ layout("/layouts/platform.html"){
|
||||
data() {
|
||||
const self = this
|
||||
return {
|
||||
remarkActive: "first",
|
||||
signUsers: [],
|
||||
trainSignUpActivity: {},
|
||||
pageForm: {
|
||||
year: moment().format("YYYY"),
|
||||
@@ -431,7 +489,6 @@ layout("/layouts/platform.html"){
|
||||
activityList: [],
|
||||
courseTypeList: [],
|
||||
tableColumns: [
|
||||
/* {prop: 'name', label: '活动名称'},*/
|
||||
{ prop: "courseName", label: "名称" },
|
||||
{ prop: "lxname", label: "类型" },
|
||||
{ prop: "coursePeopleNumber", label: "总人数" },
|
||||
@@ -448,22 +505,62 @@ layout("/layouts/platform.html"){
|
||||
mobile: [{ required: true, message: "必填", trigger: ["blur", "change"] }]
|
||||
},
|
||||
choose: {},
|
||||
trainType: "培训班"
|
||||
trainType: "培训班",
|
||||
|
||||
applyDialog: false,
|
||||
|
||||
remarkShow: false,
|
||||
courseRemark: {},
|
||||
|
||||
registerForm: {
|
||||
searchKeyword: "",
|
||||
searchName: "u.username",
|
||||
unionId: ""
|
||||
},
|
||||
unionList: []
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
async doCancel(row) {
|
||||
const resp = await $.post("/platform/mobile/trainSignUpActivity/cancelSignUp", {
|
||||
activityId: row.activityId,
|
||||
courseId: row.id
|
||||
})
|
||||
if (resp.code === 0) {
|
||||
await this.pageData()
|
||||
this.$message.success(resp.msg)
|
||||
} else {
|
||||
this.$message.warning(resp.msg)
|
||||
async remarkActiveClick(tab) {
|
||||
if (tab.name === "second") {
|
||||
//获取报名人员
|
||||
await this.getSignUsers()
|
||||
}
|
||||
},
|
||||
async getSignUsers() {
|
||||
this.registerForm.courseId = this.courseRemark.id
|
||||
const { data } = await $.get("/platform/trainSingUp/manage/userAdjust/registerUserList", this.registerForm)
|
||||
this.signUsers = data
|
||||
},
|
||||
openViewRemark(row) {
|
||||
this.remarkActive = "first"
|
||||
this.signUsers = []
|
||||
if (!row.remarks) {
|
||||
this.$message.warning("暂无详细信息")
|
||||
return
|
||||
}
|
||||
this.courseRemark = row
|
||||
this.remarkShow = true
|
||||
},
|
||||
async doCancel(row) {
|
||||
const msg = "您确认要取消" + row.courseName + "的报名吗?"
|
||||
this.$confirm(msg, "提示", {
|
||||
confirmButtonText: "确定",
|
||||
cancelButtonText: "取消",
|
||||
type: "warning"
|
||||
}).then(async () => {
|
||||
const resp = await $.post("/platform/mobile/trainSignUpActivity/cancelSignUp", {
|
||||
activityId: row.activityId,
|
||||
courseId: row.id
|
||||
})
|
||||
if (resp.code === 0) {
|
||||
await this.pageData()
|
||||
this.$message.success(resp.msg)
|
||||
} else {
|
||||
this.$message.warning(resp.msg)
|
||||
}
|
||||
})
|
||||
},
|
||||
calcSignUpCount(o) {
|
||||
if (o.reserveMode === 2) {
|
||||
let lave = 0
|
||||
@@ -488,8 +585,12 @@ layout("/layouts/platform.html"){
|
||||
"人)"
|
||||
return str
|
||||
} else {
|
||||
let lave = o.coursePeopleNumber - (o.hasRegisterNum + o.courseReservedNumber)
|
||||
return "(<span style='color: red'>余" + lave + "</span>/" + o.coursePeopleNumber + "人)"
|
||||
if (Number(o.coursePeopleNumber) >= 1000) {
|
||||
return "(<span style='color: #ff8400'>无名额限制</span>/已报<span style='color: red'>" + o.hasRegisterNum + "</span>人)"
|
||||
} else {
|
||||
let lave = o.coursePeopleNumber - (o.hasRegisterNum + o.courseReservedNumber)
|
||||
return "(<span style='color: red'>余" + lave + "</span>/" + o.coursePeopleNumber + "人)"
|
||||
}
|
||||
}
|
||||
},
|
||||
async doSubmit() {
|
||||
@@ -511,7 +612,8 @@ layout("/layouts/platform.html"){
|
||||
}
|
||||
this.$refs["form"].validate((valid) => {
|
||||
if (valid) {
|
||||
this.$confirm("您确定要提交吗?", "提示", {
|
||||
const msg = "您确认要提交" + this.choose.courseName + "的报名吗?"
|
||||
this.$confirm(msg, "提示", {
|
||||
confirmButtonText: "确定",
|
||||
cancelButtonText: "取消",
|
||||
type: "warning"
|
||||
@@ -529,7 +631,7 @@ layout("/layouts/platform.html"){
|
||||
if (resp.code === 0) {
|
||||
await this.pageData()
|
||||
this.$message.success(resp.msg)
|
||||
this.$refs.guava.index()
|
||||
this.applyDialog = false
|
||||
} else {
|
||||
this.$message.warning(resp.msg)
|
||||
}
|
||||
@@ -538,17 +640,22 @@ layout("/layouts/platform.html"){
|
||||
})
|
||||
},
|
||||
async doApply(row) {
|
||||
if (row.courseName.includes("时间待定")) {
|
||||
this.$message.warning("活动报名尚未开始哦,请报名其他活动吧")
|
||||
return
|
||||
}
|
||||
|
||||
this.choose = row
|
||||
const o = this.courseTypeList.find((v) => v.id === row.courseType)
|
||||
const data = this.trainSignUpActivity
|
||||
const now = moment().valueOf()
|
||||
if (now < moment(data.activitySignUpStartTime).valueOf() || now > moment(data.activitySignUpEndTime).valueOf()) {
|
||||
this.$message.warning("报名已结束,请致电校工会咨询,联系电话:85913629")
|
||||
this.$message.warning("此活动不在报名时间内")
|
||||
return
|
||||
}
|
||||
const scopeUser = await getScopeUser(data.activityGroupId)
|
||||
if (scopeUser === 0) {
|
||||
this.$message.warning("您不在活动报名范围内")
|
||||
this.$message.warning("您不在报名人员范围内")
|
||||
return
|
||||
}
|
||||
const res = await $.post("/platform/mobile/trainSignUpActivity/validateSignUp", {
|
||||
@@ -575,9 +682,9 @@ layout("/layouts/platform.html"){
|
||||
this.formData.trainMobileSignColumnList.forEach((item) => {
|
||||
item.columnValue = ""
|
||||
})
|
||||
this.$refs.form.clearValidate()
|
||||
this.$nextTick(() => {
|
||||
this.$refs.guava.edit()
|
||||
this.applyDialog = true
|
||||
// this.$refs.guava.edit()
|
||||
})
|
||||
},
|
||||
openViewMap(point) {
|
||||
@@ -636,13 +743,18 @@ layout("/layouts/platform.html"){
|
||||
this.$message.warning(resp.msg)
|
||||
}
|
||||
},
|
||||
async openViewCourseTime(id) {
|
||||
const resp = await $.get(loc() + "/getCourseTime", { id: id })
|
||||
this.courseTimeList = resp.data
|
||||
async openViewCourseTime(row) {
|
||||
if (row.courseList && row.courseList.length > 0) {
|
||||
this.courseTimeList = row.courseList
|
||||
} else {
|
||||
const resp = await $.get(loc() + "/getCourseTime", { id: row.id })
|
||||
this.courseTimeList = resp.data
|
||||
}
|
||||
this.courseTimeListDialog = true
|
||||
}
|
||||
},
|
||||
async created() {
|
||||
this.unionList = await getUnion()
|
||||
await this.activityData()
|
||||
await this.getCourseTypeList()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user