This commit is contained in:
@jyuhsin
2025-05-29 13:46:57 +08:00
parent 554a7b9b67
commit f976085cc0
7 changed files with 192 additions and 165 deletions
@@ -85,8 +85,8 @@ public class TheRapyRecuperationEnrollController {
@POST
@ViReturn
@RequiresAuthentication
public Object pageData(PageForm pageForm, Integer year, String unionId, int theRapyRecuperationType, Integer lineUnionType) {
return enrollService.enrollPageData(pageForm, year, unionId, theRapyRecuperationType, lineUnionType);
public Object pageData(PageForm pageForm, Integer year, String unionId, int theRapyRecuperationType, Integer lineUnionType, String routeName, String lotId) {
return enrollService.enrollPageData(pageForm, year, unionId, theRapyRecuperationType, lineUnionType, routeName, lotId);
}
@At
@@ -27,7 +27,7 @@ public interface TheRapyRecuperationEnrollService extends ViService<TheRapyRecup
* @param trrt trrt
* @return {@link Pagination}
*/
Pagination enrollPageData(PageForm pageForm, Integer year, String unionId, int trrt, Integer lineUnionType);
Pagination enrollPageData(PageForm pageForm, Integer year, String unionId, int trrt, Integer lineUnionType, String routeName, String lotId);
List<NutMap> getSelectLineById(String lineId, String unionId, int trrt, Integer lineUnionType);
@@ -65,7 +65,7 @@ public class TheRapyRecuperationEnrollServiceImpl extends ViServiceImpl<TheRapyR
private TheRapyRecuperationLineService lineService;
@Override
public Pagination enrollPageData(PageForm pageForm, Integer year, String unionId, int trrt, Integer lineUnionType) {
public Pagination enrollPageData(PageForm pageForm, Integer year, String unionId, int trrt, Integer lineUnionType, String routeName, String lotId) {
Cnd cnd = Cnd.NEW();
if (List.of(TheRapyRecuperationType.provinceInLine.getValue(), TheRapyRecuperationType.provinceOutLine.getValue()).contains(trrt)) {
Sql lineSql = Sqls.create("""
@@ -171,18 +171,26 @@ public class TheRapyRecuperationEnrollServiceImpl extends ViServiceImpl<TheRapyR
} else if (TheRapyRecuperationType.provinceInHotel.getValue() == trrt) {
cnd.andEX("b.year", "=", year != null ? year : DateUtil.thisYear());
cnd.and("b.isDisabled", "=", false);
if (StrUtil.isNotBlank(routeName)) {
cnd.and(Cnd.likeEX("b.baseName", routeName));
}
cnd.andEX("b.lotId", "=", lotId);
Sql taSql = Sqls.create("""
select
b.*,
cast(b.files ->> '$[0].id' as char) as fileId,
b.files as fileId,
l.lotName,
t.travelAgencyName
t.travelAgencyName,
( SELECT COUNT( 1 ) FROM the_rapy_recuperation_enroll WHERE b.id = takePartInBaseManagementId and isNormal=true $yearCnd) agencyNum
from
the_rapy_recuperation_base_management b
left join the_rapy_recuperation_lot l on l.id = b.lotId
left join the_rapy_recuperation_travel_agency t on t.id = b.travelAgencyId
$condition
""");
if (year != null) {
taSql.setVar("yearCnd", "AND YEAR(signingUptime) = '%s' ".formatted(year));
}
cnd.asc("sortNumber");
taSql.setCondition(cnd);
return listPageMap(pageForm.getPageNumber(), pageForm.getPageSize(), taSql);
@@ -490,39 +498,52 @@ public class TheRapyRecuperationEnrollServiceImpl extends ViServiceImpl<TheRapyR
//活动范围
Integer activityGroupId = config.getActivityGroupId();
//线路信息
TheRapyRecuperationLineUnionSelect lineUnionSelect = dao().fetch(TheRapyRecuperationLineUnionSelect.class, enrollInfo.getTakePartInLineId());
TheRapyRecuperationLine lineInfo = dao().fetch(TheRapyRecuperationLine.class, lineUnionSelect.getLineId());
Date signUpStartTime = lineUnionSelect.getSignUpStartTime();
Date signUpEndTime = lineUnionSelect.getSignUpEndTime();
Date changeEndTime = lineUnionSelect.getChangeEndTime();
if (DateUtil.compare(new Date(), signUpStartTime) < 0) {
return Map.of(false, "报名未开始,请耐心等待");
}
if (DateUtil.compare(new Date(), changeEndTime) > 0 && enrollInfo.isNormal()) {
return Map.of(false, "报名时间已过,抱歉不能报名");
}
TheRapyRecuperationType trrt = regionTypeLineMap.get(lineInfo.getRegionalNature());
if (StrUtil.isBlank(enrollInfo.getId()) && StrUtil.isNotBlank(enrollInfo.getTakePartInLineId())) {
//获取标段中的最大费用
List<TheRapyRecuperationLot> lotList = dao().query(TheRapyRecuperationLot.class, Cnd.NEW());
//最大费用
OptionalInt optionalInt = lotList.stream().mapToInt(TheRapyRecuperationLot::getActivityCost).max();
int maxCost = optionalInt.isPresent() ? optionalInt.getAsInt() : 0;
//获取当前报名线路对应的标段的费用
Integer currentLineCost = dao().fetch(TheRapyRecuperationLot.class, lineInfo.getLotId()).getActivityCost();
//如果报酒店
if (StrUtil.isNotBlank(enrollInfo.getTakePartInBaseManagementId()) && StrUtil.isBlank(enrollInfo.getId()) && enrollInfo.isNormal()) {
Map<Boolean, String> oneYear = this.validCountOneYear(loginName, travelFrequency);
if (oneYear != null && oneYear.containsKey(false)) {
if (oneYear != null) {
return oneYear;
}
}
//获取起始年份到当前时间,是否报名
Sql sql = Sqls.create("""
Date signUpStartTime = null;
Date signUpEndTime = null;
Date changeEndTime = null;
if (StrUtil.isNotBlank(enrollInfo.getTakePartInLineId())) {
//线路信息
TheRapyRecuperationLineUnionSelect lineUnionSelect = dao().fetch(TheRapyRecuperationLineUnionSelect.class, enrollInfo.getTakePartInLineId());
TheRapyRecuperationLine lineInfo = dao().fetch(TheRapyRecuperationLine.class, lineUnionSelect.getLineId());
signUpStartTime = lineUnionSelect.getSignUpStartTime();
signUpEndTime = lineUnionSelect.getSignUpEndTime();
changeEndTime = lineUnionSelect.getChangeEndTime();
if (DateUtil.compare(new Date(), signUpStartTime) < 0) {
return Map.of(false, "报名未开始,请耐心等待");
}
if (DateUtil.compare(new Date(), changeEndTime) > 0 && enrollInfo.isNormal()) {
return Map.of(false, "报名时间已过,抱歉不能报名");
}
TheRapyRecuperationType trrt = regionTypeLineMap.get(lineInfo.getRegionalNature());
if (StrUtil.isBlank(enrollInfo.getId()) && StrUtil.isNotBlank(enrollInfo.getTakePartInLineId())) {
//获取标段中的最大费用
List<TheRapyRecuperationLot> lotList = dao().query(TheRapyRecuperationLot.class, Cnd.NEW());
//最大费用
OptionalInt optionalInt = lotList.stream().mapToInt(TheRapyRecuperationLot::getActivityCost).max();
int maxCost = optionalInt.isPresent() ? optionalInt.getAsInt() : 0;
//获取当前报名线路对应的标段的费用
Integer currentLineCost = dao().fetch(TheRapyRecuperationLot.class, lineInfo.getLotId()).getActivityCost();
Map<Boolean, String> oneYear = this.validCountOneYear(loginName, travelFrequency);
if (oneYear != null && oneYear.containsKey(false)) {
return oneYear;
}
//获取起始年份到当前时间,是否报名
Sql sql = Sqls.create("""
SELECT
r.*,
l.regionalNature,
@@ -533,69 +554,70 @@ public class TheRapyRecuperationEnrollServiceImpl extends ViServiceImpl<TheRapyR
LEFT JOIN the_rapy_recuperation_line l ON l.id = us.lineId
$condition
""");
Sql twoYearInSql = sql;
Sql threeYearOutSql = sql;
Sql nowYearSql = sql;
Sql twoYearInSql = sql;
Sql threeYearOutSql = sql;
Sql nowYearSql = sql;
Cnd commonCnd = Cnd.NEW();
commonCnd.and("r.takePartInLineId", "is not", null);
commonCnd.and("loginName", "=", ShiroUtil.getPrincipalProperty("loginname"));
commonCnd.and("r.isNormal", "=", true);
commonCnd.and("stateId", "not in", Lang.array(TheRapyRecuperationState.UNITFAIL, TheRapyRecuperationState.LINEUNITFAIL, TheRapyRecuperationState.SCHOOLFAIL));
commonCnd.and("signingUptime", "<=", DateUtil.now());
Cnd commonCnd = Cnd.NEW();
commonCnd.and("r.takePartInLineId", "is not", null);
commonCnd.and("loginName", "=", ShiroUtil.getPrincipalProperty("loginname"));
commonCnd.and("r.isNormal", "=", true);
commonCnd.and("stateId", "not in", Lang.array(TheRapyRecuperationState.UNITFAIL, TheRapyRecuperationState.LINEUNITFAIL, TheRapyRecuperationState.SCHOOLFAIL));
commonCnd.and("signingUptime", "<=", DateUtil.now());
//两年参加省内
Cnd twoYearInCnd = commonCnd.clone();
twoYearInCnd.and("signingUptime", ">=", provinceStartYear + "-01-01");
twoYearInCnd.and("regionalNature", "=", "省内");
twoYearInCnd.and("isTakePartIn", "=", true);
twoYearInSql.setCondition(twoYearInCnd);
List<NutMap> twoYearInMapList = listMap(twoYearInSql);
//两年参加省内
Cnd twoYearInCnd = commonCnd.clone();
twoYearInCnd.and("signingUptime", ">=", provinceStartYear + "-01-01");
twoYearInCnd.and("regionalNature", "=", "省内");
twoYearInCnd.and("isTakePartIn", "=", true);
twoYearInSql.setCondition(twoYearInCnd);
List<NutMap> twoYearInMapList = listMap(twoYearInSql);
//今年是否报名,不管省内省外
Cnd nowYearCnd = commonCnd.clone();
nowYearCnd.and("signingUptime", ">=", DateUtil.thisYear() + "-01-01");
nowYearSql.setCondition(nowYearCnd);
List<NutMap> nowYearMapList = listMap(nowYearSql);
//今年是否报名,不管省内省外
Cnd nowYearCnd = commonCnd.clone();
nowYearCnd.and("signingUptime", ">=", DateUtil.thisYear() + "-01-01");
nowYearSql.setCondition(nowYearCnd);
List<NutMap> nowYearMapList = listMap(nowYearSql);
//三年参加省外
Cnd threeYearOutCnd = commonCnd.clone();
threeYearOutCnd.and("signingUptime", ">=", (DateUtil.thisYear() - 3) + "-01-01");
threeYearOutCnd.and("regionalNature", "=", "省外");
threeYearOutCnd.and("isTakePartIn", "=", true);
threeYearOutSql.setCondition(threeYearOutCnd);
List<NutMap> threeYearOutMapList = listMap(threeYearOutSql);
//三年参加省外
Cnd threeYearOutCnd = commonCnd.clone();
threeYearOutCnd.and("signingUptime", ">=", (DateUtil.thisYear() - 3) + "-01-01");
threeYearOutCnd.and("regionalNature", "=", "省外");
threeYearOutCnd.and("isTakePartIn", "=", true);
threeYearOutSql.setCondition(threeYearOutCnd);
List<NutMap> threeYearOutMapList = listMap(threeYearOutSql);
//今年是否报名,不管报省内还是省外
if (Lang.isNotEmpty(nowYearMapList)) {
NutMap nowYearMap = nowYearMapList.get(0);
//判断当前报名的线路是否和今年第一次报名的线路重复
if (nowYearMap.getString("takePartInLineId").equals(lineUnionSelect.getId())) {
return Map.of(false, "您已报名过当前线路,请选择其他线路");
}
//获取第一次报名线路对应的标段的费用
int lastLineCost = nowYearMap.getInt("activityCost");
if ((lastLineCost + currentLineCost) > maxCost) {
return Map.of(false, "您已报名过省内线路");
}
}
//省内线路判断
if (trrt.getValue() == TheRapyRecuperationType.provinceInLine.getValue()) {
if (Lang.isEmpty(twoYearInMapList)) {
return Map.of(true, "验证成功");
}
if (Lang.isNotEmpty(twoYearInMapList)) {
int hasCost = twoYearInMapList.get(0).getInt("activityCost");
if ((hasCost + currentLineCost) > maxCost) {
return Map.of(false, "您已参加过省内线路");
//今年是否报名,不管报省内还是省外
if (Lang.isNotEmpty(nowYearMapList)) {
NutMap nowYearMap = nowYearMapList.get(0);
//判断当前报名的线路是否和今年第一次报名的线路重复
if (nowYearMap.getString("takePartInLineId").equals(lineUnionSelect.getId())) {
return Map.of(false, "您已报名过当前线路,请选择其他线路");
}
//获取第一次报名线路对应的标段的费用
int lastLineCost = nowYearMap.getInt("activityCost");
if ((lastLineCost + currentLineCost) > maxCost) {
return Map.of(false, "您已报名过省内线路");
}
}
}
//省外线路判断
if (trrt.getValue() == TheRapyRecuperationType.provinceOutLine.getValue()) {
//三年内有没有参加过省外
if (Lang.isNotEmpty(threeYearOutMapList)) {
return Map.of(false, "近三年内您已参加过省外线路,不能再次报名");
//省内线路判断
if (trrt.getValue() == TheRapyRecuperationType.provinceInLine.getValue()) {
if (Lang.isEmpty(twoYearInMapList)) {
return Map.of(true, "验证成功");
}
if (Lang.isNotEmpty(twoYearInMapList)) {
int hasCost = twoYearInMapList.get(0).getInt("activityCost");
if ((hasCost + currentLineCost) > maxCost) {
return Map.of(false, "您已参加过省内线路");
}
}
}
//省外线路判断
if (trrt.getValue() == TheRapyRecuperationType.provinceOutLine.getValue()) {
//三年内有没有参加过省外
if (Lang.isNotEmpty(threeYearOutMapList)) {
return Map.of(false, "近三年内您已参加过省外线路,不能再次报名");
}
}
}
}
@@ -651,29 +673,33 @@ public class TheRapyRecuperationEnrollServiceImpl extends ViServiceImpl<TheRapyR
public Map<Boolean, String> validCountOneYear(String loginName, int travelFrequency) {
Cnd cnd = Cnd.NEW();
cnd.and("loginName", "=", loginName);
cnd.and("isNormal", "=", true);
cnd.and("YEAR(signingUptime)", "=", io.v.nutz.base.utils.DateUtil.getYear());
int joinCount = dao().count(TheRapyRecuperationEnroll.class, cnd);
if (joinCount >= travelFrequency) {
List<TheRapyRecuperationLine> inList = dao().query(TheRapyRecuperationLine.class, Cnd.where("regionalNature", "=", "省内"));
List<TheRapyRecuperationLineUnionSelect> unionInSelects = dao().query(TheRapyRecuperationLineUnionSelect.class, Cnd.where("lineId", "in", inList.stream().map(TheRapyRecuperationLine::getId).collect(Collectors.toList())));
List<TheRapyRecuperationLine> outList = dao().query(TheRapyRecuperationLine.class, Cnd.where("regionalNature", "=", "省外"));
List<TheRapyRecuperationLineUnionSelect> unionOutSelects = dao().query(TheRapyRecuperationLineUnionSelect.class, Cnd.where("lineId", "in", outList.stream().map(TheRapyRecuperationLine::getId).collect(Collectors.toList())));
//是否选择省外
int inCount = dao().count("the_rapy_recuperation_enroll", Cnd.where("loginName", "=", ShiroUtil.getPrincipalProperty("loginname"))
.and("takePartInLineId", "in", inList.stream().map(TheRapyRecuperationLine::getId).collect(Collectors.toList()))
int inCount = dao().count("the_rapy_recuperation_enroll", Cnd.where("loginName", "=", io.v.nutz.web.commons.utils.ShiroUtil.getPrincipalProperty("loginname"))
.and("takePartInLineId", "in", unionInSelects.stream().map(TheRapyRecuperationLineUnionSelect::getId).collect(Collectors.toList()))
.and("isNormal", "=", true)
.and("YEAR(signingUptime)", "=", io.v.nutz.base.utils.DateUtil.getYear()));
//是否报省外
int outCount = dao().count("the_rapy_recuperation_enroll", Cnd.where("loginName", "=", ShiroUtil.getPrincipalProperty("loginname"))
.and("takePartInLineId", "in", outList.stream().map(TheRapyRecuperationLine::getId).collect(Collectors.toList()))
int outCount = dao().count("the_rapy_recuperation_enroll", Cnd.where("loginName", "=", io.v.nutz.web.commons.utils.ShiroUtil.getPrincipalProperty("loginname"))
.and("takePartInLineId", "in", unionOutSelects.stream().map(TheRapyRecuperationLineUnionSelect::getId).collect(Collectors.toList()))
.and("isNormal", "=", true)
.and("YEAR(signingUptime)", "=", io.v.nutz.base.utils.DateUtil.getYear()));
//是否报旅行社
int travelCount = dao().count("the_rapy_recuperation_enroll", Cnd.where("loginName", "=", ShiroUtil.getPrincipalProperty("loginname"))
.and("takePartInLineId", "is", null).and("isNormal", "=", true)
int travelCount = dao().count("the_rapy_recuperation_enroll", Cnd.where("loginName", "=", io.v.nutz.web.commons.utils.ShiroUtil.getPrincipalProperty("loginname"))
.and(Cnd.exps("takePartInLineId", "is", null).or("takePartInLineId", "=", ""))
.and("isNormal", "=", true)
.and("takePartInTravelAgencyId", "is not", null)
.and("YEAR(signingUptime)", "=", io.v.nutz.base.utils.DateUtil.getYear()));
//是否报酒店
int hotelCount = dao().count("the_rapy_recuperation_enroll", Cnd.where("loginName", "=", ShiroUtil.getPrincipalProperty("loginname"))
int hotelCount = dao().count("the_rapy_recuperation_enroll", Cnd.where("loginName", "=", io.v.nutz.web.commons.utils.ShiroUtil.getPrincipalProperty("loginname"))
.and("takePartInLineId", "is", null).and("isNormal", "=", true)
.and("takePartInBaseManagementId", "is not", null)
.and("YEAR(signingUptime)", "=", io.v.nutz.base.utils.DateUtil.getYear()));
@@ -687,7 +713,7 @@ public class TheRapyRecuperationEnrollServiceImpl extends ViServiceImpl<TheRapyR
} else if (hotelCount > 0) {
str = "酒店";
}
return Map.of(false, "一年只能报" + travelFrequency + "次,您已报" + str + ",请先在我的疗休养中删除,报名!");
return Map.of(false, "一年只能报" + travelFrequency + "次,您已报" + str + ",请先在我的疗休养中删除,方可报名!");
}
return Map.of(true, "成功");
}
@@ -56,18 +56,21 @@ layout("/mobile/platform.html"){
}
.footer {
background-color: white;
position: fixed;
bottom: 0;
width: 100%;
height: 60px;
display: flex;
justify-content: space-evenly;
align-items: center;
left: 0;
}
.footer .van-button {
height: 34px;
border-radius: 6px;
width: 90% !important;
margin: 0 10px;
}
.submitButton .van-button {
@@ -316,10 +319,10 @@ layout("/mobile/platform.html"){
<template v-else>
<van-button v-if="moment().unix() <= moment(baseData.signUpEndTime).unix()" @click="join" class="join">我要报名
</van-button>
<van-button
<!--<van-button
v-if="moment().unix() <= moment(baseData.signUpEndTime).unix() && ${@shiro.hasRole('sysadmin')||@shiro.hasRole('A06')||@shiro.hasRole('H03')}"
@click="helpJoin" class="join">替他人报名
</van-button>
</van-button>-->
<van-button v-if="moment().unix() > moment(baseData.signUpEndTime).unix()" class="join">报名结束</van-button>
</template>
</div>
@@ -359,7 +362,7 @@ layout("/mobile/platform.html"){
</div>
<!--床位信息-->
<div class="van-doc-card" style="margin-bottom: 16px">
<!--<div class="van-doc-card" style="margin-bottom: 16px">
<div></div>
<div class="van-card-header">
床位信息(一位教职工一间)
@@ -369,7 +372,7 @@ layout("/mobile/platform.html"){
label="房间" name="bedType"
placeholder="请选择房间" v-model="formData.bedInfo.bedType"
:rules="[{ required: true }]"></van-field>
<!--<van-field v-if="formData.bedInfo.bedType == '标准间'" @click="self = true; bedVisible = true"
&lt;!&ndash;<van-field v-if="formData.bedInfo.bedType == '标准间'" @click="self = true; bedVisible = true"
readonly is-link label="床位"
name="bedNum" placeholder="请选择床位" v-model="formData.bedInfo.bedNum"
:rules="[{ required: true }]"></van-field>
@@ -381,16 +384,16 @@ layout("/mobile/platform.html"){
<van-radio :name="false" shape="square">否</van-radio>
</van-radio-group>
</template>
</van-field>-->
<!--<van-field v-if="formData.bedInfo.bedType == '标准间' && formData.bedInfo.isSleepTogether == true"
</van-field>&ndash;&gt;
&lt;!&ndash;<van-field v-if="formData.bedInfo.bedType == '标准间' && formData.bedInfo.isSleepTogether == true"
label="意向拼房人" name="otherSleepUser" placeholder="若无拼房人,填写“无”即可"
v-model="formData.bedInfo.otherSleepUser"
:rules="[{ required: true }]"></van-field>-->
:rules="[{ required: true }]"></van-field>&ndash;&gt;
</div>
</div>
</div>-->
<!--随行人信息-->
<div class="van-doc-card" style="margin-bottom: 16px">
<!--<div class="van-doc-card" style="margin-bottom: 16px">
<div></div>
<div class="van-card-header"
style="display: flex; justify-content: space-between; align-items: center">
@@ -405,7 +408,7 @@ layout("/mobile/platform.html"){
<van-tab v-for="item, index in formData.companionList" :title="'随行人' + (index + 1)">
<van-field label="姓名" name="userName" placeholder="请填写姓名" v-model="item.userName"
:rules="[{ required: true }]"></van-field>
<!--<van-field label="工号" name="loginName" placeholder="若没有工号,请忽略此项" v-model="item.loginName"></van-field>-->
&lt;!&ndash;<van-field label="工号" name="loginName" placeholder="若没有工号,请忽略此项" v-model="item.loginName"></van-field>&ndash;&gt;
<van-field label="年龄" name="age" placeholder="请填写年龄" v-model="item.age" type="digit"
:rules="[{ required: true }]"></van-field>
<van-field :rules="[{ required: true, message: '请选择性别' }]" label="性别" name="validator">
@@ -459,7 +462,7 @@ layout("/mobile/platform.html"){
如有随行人出行,请添加随行人
</span>
</div>
</div>
</div>-->
<div v-if="fromUrlByMy != 'find'" class="submitButton">
<van-button class="join join_submit">提交报名</van-button>
</div>
@@ -533,15 +536,6 @@ layout("/mobile/platform.html"){
</van-cell-group>
</van-popup>
<div>
<van-tabbar v-model="tarBarActive">
<van-tabbar-item icon="home-o" replace url="/platform/mobile/theRapyRecuperation/index">疗休养报名
</van-tabbar-item>
<van-tabbar-item icon="manager-o" replace url="/platform/mobile/theRapyRecuperation/myRecuperation">我的疗休养
</van-tabbar-item>
</van-tabbar>
</div>
</div>
<script>
function getQueryString(name) {
@@ -97,7 +97,7 @@ layout("/mobile/platform.html"){
},
async created() {
this.chooseButton = await getEnumOptions('TheRapyRecuperationType')
this.chooseButton = this.chooseButton.filter(o => o.value !== 2 && o.value !== 3)
this.chooseButton = this.chooseButton.filter(o => o.value !== 2)
await this.getConfigData()
}
})
@@ -233,7 +233,7 @@ layout("/mobile/platform.html"){
<div id="app" v-cloak>
<van-sticky>
<van-nav-bar @click-left="history.go(-1)" fixed left-arrow placeholder
<van-nav-bar @click-left="pageBack" fixed left-arrow placeholder
title="职工疗休养-线路介绍"></van-nav-bar>
</van-sticky>
@@ -321,9 +321,7 @@ layout("/mobile/platform.html"){
<!--底部报名按钮-->
<div class="footer" v-if="fromUrlByMy != 'edit'">
<template v-if="lineData.isNormal==0&&lineData.isNormalFalse>0">
<van-button @click="join"
class="join">我要报名
</van-button>
<van-button @click="join" class="join">我要报名</van-button>
</template>
<template v-else>
<van-button v-if="moment().unix() <= moment(lineData.changeEndTime).unix()" @click="join"
@@ -592,6 +590,10 @@ layout("/mobile/platform.html"){
'mobile-sign': httpVueLoader('/components/sign/mobileSign.vue?v=' + new Date().getTime()),
},
methods: {
pageBack(){
pjaxReplace('/platform/mobile/theRapyRecuperation/mobileLineListPage')
},
openRead() {
this.readVisible = true
this.$nextTick(() => {
@@ -788,6 +790,18 @@ layout("/mobile/platform.html"){
const resp = await $.get('/platform/theRapyRecuperation/TheRapyConfig/findOne')
this.configData = resp.data
},
handleClick(event, classArray = []) {
if (event.target.tagName === 'IMG' && event.target.className !== 'top_icon') {
const index = classArray.indexOf(event.target.className)
if(index !== -1) {
vant.ImagePreview({
images: array,
startPosition: index,
closeable: true,
})
}
}
},
readPDFPicture(pdf) {
if(pdf != null) {
pdf.on("complete", function () {
@@ -800,19 +814,7 @@ layout("/mobile/platform.html"){
array.push(o.getAttribute('src'))
}
})
document.addEventListener('click', function (event) {
// 打印被点击的元素标签名和 class
if (event.target.tagName === 'IMG' && event.target.className !== 'top_icon') {
const index = classArray.indexOf(event.target.className)
if(index !== -1) {
vant.ImagePreview({
images: array,
startPosition: index,
closeable: true,
})
}
}
})
document.addEventListener('click', (event) => this.handleClick(event, classArray))
})
}
},
@@ -839,19 +841,11 @@ layout("/mobile/platform.html"){
this.$nextTick(() => {
pdfh5 = new Pdfh5('#demo', {
pdfurl: href,
});
})
})
}catch (e) {
this.isPdf = true
document.addEventListener('click', function (event) {
// 打印被点击的元素标签名和 class
if (event.target.tagName === 'IMG' && event.target.className !== 'top_icon') {
vant.ImagePreview({
images: [event.target.src],
closeable: true,
})
}
})
document.addEventListener('click', (event) => this.handleClick(event))
}
this.$nextTick(() => {
this.readPDFPicture(pdfh5)
@@ -862,6 +856,7 @@ layout("/mobile/platform.html"){
},
destroyed() {
window.removeEventListener('scroll', this.scrollToTop)
document.removeEventListener('click', (event) => this.handleClick(event))
},
})
</script>
@@ -128,12 +128,12 @@ layout("/mobile/platform.html"){
}
.sign_button .van-button {
width: 74px;
height: 28px;
width: 72px;
height: 26px;
color: white;
background: rgb(24, 103, 176);
border-color: rgb(24, 103, 176);
font-size: 12px;
font-size: 11px;
border-radius: 6px;
}
@@ -145,7 +145,7 @@ layout("/mobile/platform.html"){
<div id="app" v-cloak>
<van-sticky>
<van-nav-bar @click-left="history.back()" fixed left-arrow placeholder title="疗休养线路"></van-nav-bar>
<van-nav-bar @click-left="pjaxReplace('/platform/mobile/theRapyRecuperation/index')" fixed left-arrow placeholder title="疗休养线路"></van-nav-bar>
</van-sticky>
<!--<van-dropdown-menu>
@@ -197,10 +197,10 @@ layout("/mobile/platform.html"){
<div @click.stop="clickLineRow(o)" class="list-card" v-for="o in tableData">
<div class="content">
<van-image
height="100"
height="92"
radius="8"
:src="CREATE_PREVIEW_URL(o.fileId)"
width="150">
width="130">
</van-image>
<div v-if="pageForm.theRapyRecuperationType != '2' && pageForm.theRapyRecuperationType != '3'"
class="content-right">
@@ -282,6 +282,12 @@ layout("/mobile/platform.html"){
</div>
</div>
<div v-if="pageForm.theRapyRecuperationType == '3'" style="text-align: right; padding-right: 10px; padding-bottom: 10px" class="sign_button">
<van-button @click.stop="openSignUser(o, 'baseManage')" size="mini"
type="info" color="#1867B0">查看人员</van-button>
</div>
<div v-if="pageForm.theRapyRecuperationType == '2'">
<van-row gutter="20">
<van-col @click="" span="12" style="border-right: 1px lightgrey solid"></van-col>
@@ -316,16 +322,18 @@ layout("/mobile/platform.html"){
<div class="van-action-sheet__subname">{{item.subname}}</div>
</div>
<div class="sign_button">
<van-button @click.stop="onSelect(item)" size="mini" type="info"
style="margin-right: 8px">
点击报名
</van-button>
</div>
<div style="margin-top: 4px">
<van-button @click.stop="openSignUser(item, 'line')" size="mini" type="info"
style="margin-right: 8px">
查看人员
</van-button>
<div>
<van-button @click.stop="onSelect(item)" size="mini" type="info"
style="margin-right: 8px">
点击报名
</van-button>
</div>
<div style="margin-top: 4px">
<van-button @click.stop="openSignUser(item, 'line')" size="mini" type="info"
style="margin-right: 8px">
查看人员
</van-button>
</div>
</div>
</div>
</button>
@@ -374,6 +382,10 @@ layout("/mobile/platform.html"){
},
async clickLineRow(o) {
this.clickRow = o
if(Number(this.pageForm.theRapyRecuperationType) === 3) {
await this.findOne(o)
return
}
const resp = await $.post('/platform/theRapyRecuperation/line/enroll/getSelectLineById',
{
lineId: o.lineId,
@@ -463,7 +475,7 @@ layout("/mobile/platform.html"){
pjaxReplace('/platform/mobile/theRapyRecuperation/lineInfo?id=' + o.usId + '&index=' + this.pageForm.theRapyRecuperationType
+ '&takePartInUnionId=' + o.takePartInUnionId)
} else if (type === 3) {
pjaxReplace('/platform/mobile/theRapyRecuperation/baseInfo?id=' + o.usId + '&index=' + this.pageForm.theRapyRecuperationType)
pjaxReplace('/platform/mobile/theRapyRecuperation/baseInfo?id=' + o.id + '&index=' + this.pageForm.theRapyRecuperationType)
}
},
async getData() {