疗休养
This commit is contained in:
+3
-3
@@ -176,12 +176,12 @@ public class TheRapyRecuperationEnrollController {
|
||||
if (Lang.isNotEmpty(enrollInfo.getCompanionList())) {
|
||||
for (TheRapyRecuperationEnrollCompanion companion : enrollInfo.getCompanionList()) {
|
||||
if (StrUtil.isBlank(companion.getIdCard())) {
|
||||
return Result.error("随行人身份证信息不能为空");
|
||||
return Result.error("随行人【" + companion.getUserName() + "】身份证信息不能为空");
|
||||
} else if (!IdcardUtil.isValidCard(companion.getIdCard())) {
|
||||
return Result.error("随行人身份证信息有误");
|
||||
return Result.error("随行人【" + companion.getUserName() + "】身份证信息有误");
|
||||
}
|
||||
if (companion.getAge() < 1 || companion.getAge() > 70) {
|
||||
return Result.error("随行人年龄超过限制,请上传其他随行人");
|
||||
return Result.error("随行人【" + companion.getUserName() + "】年龄超过限制,请上传其他随行人");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+13
-2
@@ -1072,6 +1072,17 @@ public class TheRapyRecuperationEnrollServiceImpl extends ViServiceImpl<TheRapyR
|
||||
// 去判断当前报名的记录,名额有没有超出限制,包含家属
|
||||
List<TheRapyRecuperationEnrollCompanion> companionList = enrollInfo.getCompanionList();
|
||||
int applyNum = StrUtil.isNotBlank(enrollInfo.getId()) ? 0 : 1;
|
||||
|
||||
if (StrUtil.isNotBlank(enrollInfo.getEditOther())) {
|
||||
applyNum = applyNum + 1;
|
||||
}
|
||||
|
||||
// 电脑有的特殊情况,在我的里面修改报名信息,可以直接修改多个时间段的信息,那就要判断数据库报名的Id和,修改的线路的Id是不是一致的
|
||||
TheRapyRecuperationEnroll enroll = dao().fetch(TheRapyRecuperationEnroll.class, Cnd.where("id", "=", enrollInfo.getId()));
|
||||
if (Lang.isNotEmpty(enroll) && !Objects.equals(enroll.getTakePartInLineId(), enrollInfo.getTakePartInLineId())) {
|
||||
applyNum = applyNum + 1;
|
||||
}
|
||||
|
||||
if (Lang.isNotEmpty(companionList)) {
|
||||
applyNum = applyNum + companionList.size();
|
||||
}
|
||||
@@ -1081,7 +1092,7 @@ public class TheRapyRecuperationEnrollServiceImpl extends ViServiceImpl<TheRapyR
|
||||
if (canApplyNum == 0) {
|
||||
return Map.of(false, "此线路报名人数已满,请选择其他线路报名");
|
||||
} else {
|
||||
return Map.of(false, "此线路剩余可报名人数为:【" + canApplyNum + "人】,您当前报名人数为:【" + (StrUtil.isNotBlank(enrollInfo.getId()) ? applyNum + 1 : applyNum) + "人】,请减少随行人或选择其他线路报名");
|
||||
return Map.of(false, "此线路剩余可报名人数为:【" + canApplyNum + "人】,本人及家属超过名额限制,请减少随行人或选择其他线路报名");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1338,7 +1349,7 @@ public class TheRapyRecuperationEnrollServiceImpl extends ViServiceImpl<TheRapyR
|
||||
// } else if (hotelCount > 0) {
|
||||
// str = "酒店";
|
||||
// }
|
||||
return Map.of(false, "您已报过其他线路,如有疑问请联系分工会主席!");
|
||||
return Map.of(false, "您已报过其他线路,如有疑问请联系校工会!");
|
||||
}
|
||||
return Map.of(true, "成功");
|
||||
}
|
||||
|
||||
@@ -781,7 +781,7 @@ layout("/mobile/platform.html"){
|
||||
if (!this.validateIdCard(companion.idCard)) {
|
||||
vant.Dialog.alert({
|
||||
title: '提示',
|
||||
message: '【随行人'+ (i+1) +'】的身份证不正确',
|
||||
message: '随行人【'+ companion.userName +'】的身份证不正确',
|
||||
});
|
||||
return
|
||||
} else {
|
||||
@@ -789,7 +789,7 @@ layout("/mobile/platform.html"){
|
||||
if (companion.age < 1 || companion.age > 70) {
|
||||
vant.Dialog.alert({
|
||||
title: '提示',
|
||||
message: '【随行人'+ (i+1) +'】的年龄超出限制,请添加其他联系人',
|
||||
message: '随行人【'+ companion.userName +'】的年龄超出限制,请添加其他联系人',
|
||||
});
|
||||
return
|
||||
}
|
||||
|
||||
@@ -53,12 +53,12 @@ layout("/layouts/platform.html"){
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" header-align="center"
|
||||
:label="pageForm.theRapyRecuperationType===3?'名称':'线路名称'">
|
||||
:label="pageForm.theRapyRecuperationType==3?'名称':'线路名称'">
|
||||
<template scope="{row}">
|
||||
{{pageForm.theRapyRecuperationType===3?row.baseName:row.lineName}}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<template v-if="pageForm.theRapyRecuperationType===3">
|
||||
<template v-if="pageForm.theRapyRecuperationType==3">
|
||||
<el-table-column align="center" header-align="center"
|
||||
label="联系人" prop="baseContactPerson">
|
||||
</el-table-column>
|
||||
@@ -69,14 +69,14 @@ layout("/layouts/platform.html"){
|
||||
label="已报人数" prop="signUpUserNum">
|
||||
</el-table-column>
|
||||
</template>
|
||||
<template v-if="pageForm.theRapyRecuperationType!==3">
|
||||
<template v-if="pageForm.theRapyRecuperationType!=3">
|
||||
<el-table-column align="center" header-align="center"
|
||||
label="时间标段" prop="lotName">
|
||||
</el-table-column>
|
||||
<el-table-column align="center" header-align="center"
|
||||
label="组织形式" prop="signUpMode">
|
||||
<template scope="{row}">
|
||||
<span>{{row.signUpMode === 1 ? '校工会组织' : '分工会组织'}}</span>
|
||||
<span>{{'校工会组织'}}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" header-align="center"
|
||||
@@ -123,11 +123,41 @@ layout("/layouts/platform.html"){
|
||||
</span>
|
||||
</el-dialog>
|
||||
|
||||
<line-sign-up ref="lineSignUpRef"></line-sign-up>
|
||||
<line-sign-up ref="lineSignUpRef" @view-line="openLine" @view-user="viewSignUpUser"></line-sign-up>
|
||||
|
||||
<el-dialog :title="baseName + '报名'" width="60%" :visible.sync="baseVisible" :close-on-click-modal="false" :close-on-press-escape="false">
|
||||
<base-sign-up ref="baseRef" :config_data="configData" @success="baseSuccess"></base-sign-up>
|
||||
</el-dialog>
|
||||
|
||||
<el-dialog
|
||||
title="详情"
|
||||
:visible.sync="lineDialogVisible"
|
||||
width="50%">
|
||||
<info ref="lineRef" :index="pageForm.theRapyRecuperationType"></info>
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button type="primary" @click="lineDialogVisible = false">关 闭</el-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
|
||||
<el-dialog title="报名人员" :visible.sync="signUpUserVisible" :close-on-click-modal="false"
|
||||
:close-on-press-escape="false" append-to-body>
|
||||
|
||||
<div style="width: 300px">
|
||||
<el-input placeholder="请输入姓名查询" v-model="signUpUserPageForm.searchKeyWord">
|
||||
<el-button slot="append" icon="el-icon-search" @click="getSignUpUserData"></el-button>
|
||||
</el-input>
|
||||
</div>
|
||||
|
||||
<el-table :data="signUpUserTableData" max-height="70vh">
|
||||
<el-table-column type="index" label="序号"></el-table-column>
|
||||
<el-table-column prop="userName" label="姓名"></el-table-column>
|
||||
<el-table-column prop="loginName" label="工号"></el-table-column>
|
||||
<el-table-column prop="mobile" label="手机号"></el-table-column>
|
||||
<el-table-column prop="unitName" label="单位"></el-table-column>
|
||||
<el-table-column prop="unionName" label="分工会"></el-table-column>
|
||||
</el-table>
|
||||
</el-dialog>
|
||||
|
||||
</div>
|
||||
|
||||
<script>
|
||||
@@ -147,9 +177,17 @@ layout("/layouts/platform.html"){
|
||||
},
|
||||
chooseButton: [],
|
||||
configData: {},
|
||||
lineDialogVisible: false,
|
||||
baseVisible:false,
|
||||
baseName:""
|
||||
baseName:"",
|
||||
|
||||
// 查看详情
|
||||
lineDialogVisible: false,
|
||||
|
||||
// 报名人员
|
||||
signUpUserPageForm: {},
|
||||
signUpUserVisible: false,
|
||||
signUpUserTableData: []
|
||||
|
||||
}
|
||||
},
|
||||
components: {
|
||||
@@ -164,13 +202,13 @@ layout("/layouts/platform.html"){
|
||||
this.pageData();
|
||||
},
|
||||
edit(o) {
|
||||
if ([0, 1].includes(this.pageForm.theRapyRecuperationType)) {
|
||||
if (this.pageForm.theRapyRecuperationType == 0 || this.pageForm.theRapyRecuperationType == 1) {
|
||||
// 线路
|
||||
this.$refs.lineSignUpRef.onOpen({
|
||||
lineId: o.lineId,
|
||||
usId: o.takePartInLineId
|
||||
}, this.pageForm, this.configData, o.id);
|
||||
} else if (this.pageForm.theRapyRecuperationType === 3) {
|
||||
} else if (this.pageForm.theRapyRecuperationType == 3) {
|
||||
// 定点疗休养
|
||||
const data = {
|
||||
id: o.takePartInBaseManagementId,
|
||||
@@ -184,6 +222,8 @@ layout("/layouts/platform.html"){
|
||||
}
|
||||
},
|
||||
editOther(o) {
|
||||
debugger
|
||||
sublime.jumpPagePjax("/platform/theRapyRecuperation/signUp?editOther=" + o.id)
|
||||
},
|
||||
openLine(row) {
|
||||
this.lineDialogVisible = true
|
||||
@@ -240,11 +280,46 @@ layout("/layouts/platform.html"){
|
||||
const resp = await $.get('/platform/theRapyRecuperation/TheRapyConfig/findOne')
|
||||
this.configData = resp.data
|
||||
},
|
||||
|
||||
// // 查看线路详情
|
||||
// openLine(row) {
|
||||
// this.lineDialogVisible = true
|
||||
// this.$nextTick(() => {
|
||||
// this.$refs.lineRef.openInit(row.usId, row.id)
|
||||
// })
|
||||
// },
|
||||
|
||||
// 查看报名人员
|
||||
viewSignUpUser(row) {
|
||||
this.signUpUserVisible = true
|
||||
this.signUpUserPageForm = {
|
||||
baseId: row.id,
|
||||
usId: row.usId,
|
||||
searchKeyWord: null
|
||||
}
|
||||
this.getSignUpUserData()
|
||||
},
|
||||
|
||||
getSignUpUserData() {
|
||||
$.post('/platform/theRapyRecuperation/line/enroll/openSignUser', this.signUpUserPageForm).then(res => {
|
||||
if (res.code === 0) {
|
||||
if (jQuery.isEmptyObject(res.data)) {
|
||||
this.signUpUserTableData = []
|
||||
} else {
|
||||
this.signUpUserTableData = Object.values(res.data).flatMap(v => v)
|
||||
}
|
||||
} else {
|
||||
this.$message.error(res.msg)
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
},
|
||||
async created() {
|
||||
this.chooseButton = await getEnumOptions('TheRapyRecuperationType')
|
||||
this.chooseButton = this.chooseButton.filter(o => o.value !== 2)
|
||||
await this.getConfigData()
|
||||
this.pageForm.theRapyRecuperationType = GetQueryString("index") ? GetQueryString("index") : 0
|
||||
this.pageData()
|
||||
}
|
||||
})
|
||||
@@ -254,4 +329,4 @@ layout("/layouts/platform.html"){
|
||||
|
||||
<!--#
|
||||
}
|
||||
#-->
|
||||
#-->
|
||||
|
||||
@@ -381,8 +381,6 @@ const BASE = {
|
||||
this.enrollId = data.enrollId
|
||||
this.editOther = data.editOther
|
||||
|
||||
|
||||
|
||||
if (this.enrollId || this.editOther) {
|
||||
await this.findSignUpInfoById()
|
||||
}
|
||||
|
||||
@@ -283,7 +283,7 @@ layout("/layouts/platform.html"){
|
||||
type="primary"
|
||||
size="mini"
|
||||
@click="handleSignUp(item)">
|
||||
立即报名
|
||||
{{ editOther ? '修改报名' : '立即报名' }}
|
||||
</el-button>
|
||||
</div>
|
||||
</div>
|
||||
@@ -337,7 +337,7 @@ layout("/layouts/platform.html"){
|
||||
type="primary"
|
||||
size="mini"
|
||||
@click="handleSignUp(item)">
|
||||
立即报名
|
||||
{{ editOther ? '修改报名' : '立即报名' }}
|
||||
</el-button>
|
||||
</div>
|
||||
</div>
|
||||
@@ -364,7 +364,6 @@ layout("/layouts/platform.html"){
|
||||
</span>
|
||||
</el-dialog>
|
||||
|
||||
|
||||
<el-dialog title="报名人员" :visible.sync="signUpUserVisible" :close-on-click-modal="false"
|
||||
:close-on-press-escape="false" append-to-body>
|
||||
|
||||
@@ -424,14 +423,17 @@ layout("/layouts/platform.html"){
|
||||
// 报名人员
|
||||
signUpUserPageForm: {},
|
||||
signUpUserVisible: false,
|
||||
signUpUserTableData: []
|
||||
signUpUserTableData: [],
|
||||
|
||||
// 修改其他线路
|
||||
editOther: '',
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
// 获取数据
|
||||
pageData() {
|
||||
this.loading = true;
|
||||
this.pageForm.editOther = this.editOther ? this.editOther : ''
|
||||
const params = {...this.pageForm};
|
||||
params.theRapyRecuperationType = parseInt(params.theRapyRecuperationType);
|
||||
|
||||
@@ -492,6 +494,7 @@ layout("/layouts/platform.html"){
|
||||
isNormal: true,
|
||||
takePartInLineId: row.usId,
|
||||
takePartInUnionId: row.takePartInUnionId,
|
||||
editOther: this.editOther
|
||||
}),
|
||||
})
|
||||
if (code !== 0) {
|
||||
@@ -506,6 +509,7 @@ layout("/layouts/platform.html"){
|
||||
enroll: JSON.stringify({
|
||||
takePartInBaseManagementId: row.id,
|
||||
isNormal: true,
|
||||
editOther: this.editOther
|
||||
}),
|
||||
})
|
||||
if (resp.code !== 0) {
|
||||
@@ -515,6 +519,7 @@ layout("/layouts/platform.html"){
|
||||
const data = {
|
||||
id: row.id,
|
||||
enrollId: '',
|
||||
editOther: this.editOther,
|
||||
}
|
||||
this.baseName = row.baseName
|
||||
this.baseVisible = true
|
||||
@@ -528,6 +533,7 @@ layout("/layouts/platform.html"){
|
||||
baseSuccess() {
|
||||
this.baseVisible = false
|
||||
this.pageData();
|
||||
sublime.jumpPagePjax('/platform/theRapyRecuperation/mineEnroll?index=3')
|
||||
},
|
||||
|
||||
// 查看线路详情
|
||||
@@ -565,9 +571,11 @@ layout("/layouts/platform.html"){
|
||||
|
||||
},
|
||||
created() {
|
||||
this.editOther = GetQueryString("editOther") ? GetQueryString("editOther") : '';
|
||||
this.pageData();
|
||||
this.getConfig();
|
||||
this.getCategory();
|
||||
console.log(this.editOther)
|
||||
}
|
||||
});
|
||||
</script>
|
||||
|
||||
@@ -10,38 +10,38 @@ const LineSignUp = {
|
||||
border
|
||||
class="time-table" :row-class-name="tableRowClassName">
|
||||
<el-table-column
|
||||
label="序号"
|
||||
width="70"
|
||||
align="center">
|
||||
label="序号"
|
||||
width="70"
|
||||
align="center">
|
||||
<template slot-scope="scope">
|
||||
<div class="sequence-number">{{ scope.$index + 1 }}</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
label="出行时间"
|
||||
prop="playStartTime"
|
||||
min-width="120">
|
||||
label="出行时间"
|
||||
prop="playStartTime"
|
||||
min-width="120">
|
||||
<template slot-scope="scope">
|
||||
{{ moment(scope.row.playStartTime).format('YYYY-MM-DD') }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
label="报名截止时间"
|
||||
prop="signUpEndTime"
|
||||
min-width="150">
|
||||
label="报名截止时间"
|
||||
prop="signUpEndTime"
|
||||
min-width="150">
|
||||
<template slot-scope="scope">
|
||||
{{ moment(scope.row.signUpEndTime).format('YYYY-MM-DD HH:mm') }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
label="报名限制人数"
|
||||
prop="maxApplyNum"
|
||||
width="120"
|
||||
align="center">
|
||||
label="报名限制人数"
|
||||
prop="maxApplyNum"
|
||||
width="120"
|
||||
align="center">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
label="已报人数"
|
||||
min-width="150">
|
||||
label="已报人数"
|
||||
min-width="150">
|
||||
<template slot-scope="scope">
|
||||
<template v-if="config.familyInfo == 2">
|
||||
{{ (scope.row.signUpUserNum + scope.row.signUpUserFamilyNum) }}人
|
||||
@@ -54,18 +54,18 @@ const LineSignUp = {
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
label="剩余名额"
|
||||
width="100"
|
||||
align="center">
|
||||
label="剩余名额"
|
||||
width="100"
|
||||
align="center">
|
||||
<template slot-scope="scope">
|
||||
{{ Math.max(0, scope.row.maxApplyNum - (scope.row.signUpUserNum +
|
||||
scope.row.signUpUserFamilyNum)) }}人
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
label="状态"
|
||||
width="100"
|
||||
align="center">
|
||||
label="状态"
|
||||
width="100"
|
||||
align="center">
|
||||
<template slot-scope="scope">
|
||||
<el-tag size="small" type="danger"
|
||||
v-if="(scope.row.signUpUserNum + scope.row.signUpUserFamilyNum) >= scope.row.maxApplyNum">
|
||||
@@ -287,10 +287,10 @@ const LineSignUp = {
|
||||
<el-dialog title="安全告知书" :visible.sync="readVisibleSafe" :close-on-click-modal="false"
|
||||
:close-on-press-escape="false" append-to-body>
|
||||
<iframe
|
||||
:src="readSafeUrl + '#toolbar=0'"
|
||||
width="100%"
|
||||
height="550px"
|
||||
frameborder="0"
|
||||
:src="readSafeUrl + '#toolbar=0'"
|
||||
width="100%"
|
||||
height="550px"
|
||||
frameborder="0"
|
||||
></iframe>
|
||||
<el-row justify="end" type="flex" class="mt10">
|
||||
<el-button @click="onReadSafe" type="primary">我已阅读确认</el-button>
|
||||
@@ -311,28 +311,29 @@ const LineSignUp = {
|
||||
unionName: "${@shiro.getPrincipalProperty('union').getUnionname()}",
|
||||
idCard: "${@shiro.getPrincipalProperty('idcard')}",
|
||||
mobile: "${@shiro.getPrincipalProperty('mobile')}",
|
||||
lineName: '',
|
||||
takePartInLineId: '',
|
||||
takePartInUnionId: '',
|
||||
lineName: "",
|
||||
takePartInLineId: "",
|
||||
takePartInUnionId: "",
|
||||
companionList: [],
|
||||
bedInfo: {},
|
||||
roomCount: null,
|
||||
intentionLineId: '',
|
||||
},
|
||||
|
||||
rules: {},
|
||||
|
||||
basicRoomColumns: [{label: '0.5间(一张床)', value: 0.5}, {
|
||||
label: '1间(两张床)',
|
||||
basicRoomColumns: [{ label: "0.5间(一张床)", value: 0.5 }, {
|
||||
label: "1间(两张床)",
|
||||
value: 1
|
||||
}, {label: '1.5间(三张床)', value: 1.5}, {label: '2间(四张床)', value: 2},],
|
||||
}, { label: "1.5间(三张床)", value: 1.5 }, { label: "2间(四张床)", value: 2 }],
|
||||
roomColumns: [],
|
||||
basicRoomRemarkColumns: [{label: '携带家属,1间房', value: 1}, {
|
||||
label: '已与其他老师自由组合共住1间房',
|
||||
basicRoomRemarkColumns: [{ label: "携带家属,1间房", value: 1 }, {
|
||||
label: "已与其他老师自由组合共住1间房",
|
||||
value: 2
|
||||
}, {label: '1间房,额外支付单房差', value: 3}, {label: '正常报名', value: 4}, {
|
||||
label: '随机拼房',
|
||||
}, { label: "1间房,额外支付单房差", value: 3 }, { label: "正常报名", value: 4 }, {
|
||||
label: "随机拼房",
|
||||
value: 5
|
||||
}, {label: '2间房,额外支付单房差', value: 6},],
|
||||
}, { label: "2间房,额外支付单房差", value: 6 }],
|
||||
roomRemarkColumns: [],
|
||||
|
||||
// 第二意向线路
|
||||
@@ -343,64 +344,74 @@ const LineSignUp = {
|
||||
readVisibleSafe: false,
|
||||
clickReadSafe: false,
|
||||
hasReadSafe: false,
|
||||
readSafeUrl: '',
|
||||
readSafeUrl: "",
|
||||
|
||||
// 报名id
|
||||
enrollId: null,
|
||||
editOther: ''
|
||||
}
|
||||
},
|
||||
|
||||
watch: {
|
||||
'signupForm.companionList': {
|
||||
"signupForm.companionList": {
|
||||
handler(newVal) {
|
||||
const {companionList = []} = this.signupForm;
|
||||
const companionCount = companionList.length;
|
||||
const bedCount = 0.5 + (companionCount * 0.5);
|
||||
const { companionList = [] } = this.signupForm
|
||||
const companionCount = companionList.length
|
||||
const bedCount = 0.5 + (companionCount * 0.5)
|
||||
const bedCountStrategies = {
|
||||
0.5: () => this.basicRoomColumns.filter(o => o.value <= 1),
|
||||
1: () => this.basicRoomColumns.filter(o => o.value === 1),
|
||||
1.5: () => this.basicRoomColumns.filter(o => [1, 2].includes(o.value)),
|
||||
2: () => this.basicRoomColumns.filter(o => o.value === 2)
|
||||
};
|
||||
this.roomColumns = bedCountStrategies[bedCount]?.() || [];
|
||||
}
|
||||
this.roomColumns = bedCountStrategies[bedCount]?.() || []
|
||||
this.signupForm.carryFamilyNum = companionCount
|
||||
}, deep: true, immediate: true
|
||||
}, 'signupForm.roomCount'(oldVal, newVal) {
|
||||
}, "signupForm.roomCount"(oldVal, newVal) {
|
||||
if (newVal && oldVal !== newVal) {
|
||||
this.$set(this.signupForm, 'roomRemark', '')
|
||||
this.$set(this.signupForm, 'roomRemarkName', '')
|
||||
this.$set(this.signupForm, "roomRemark", "")
|
||||
this.$set(this.signupForm, "roomRemarkName", "")
|
||||
}
|
||||
this.updateRoomRemarkColumns()
|
||||
}, 'signupForm.roomRemark'(val) {
|
||||
}, "signupForm.roomRemark"(val) {
|
||||
if (val) {
|
||||
this.$set(this.signupForm, 'roomRemarkName', this.roomRemarkColumns.find(o => o.value === val)?.label)
|
||||
this.$set(this.signupForm, "roomRemarkName", this.roomRemarkColumns.find(o => o.value === val)?.label)
|
||||
} else {
|
||||
this.$set(this.signupForm, 'roomRemarkName', '')
|
||||
this.$set(this.signupForm, "roomRemarkName", "")
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
methods: {
|
||||
async onOpen(row, pageForm, config, enrollId = null) {
|
||||
this.visible = true;
|
||||
this.line = row;
|
||||
this.pageForm = pageForm;
|
||||
this.config = config;
|
||||
this.selectedTime = null;
|
||||
this.enrollId = enrollId;
|
||||
this.loadSecondChoiceOptions();
|
||||
this.visible = true
|
||||
this.line = row
|
||||
this.pageForm = pageForm
|
||||
this.config = config
|
||||
this.selectedTime = null
|
||||
this.enrollId = enrollId
|
||||
this.editOther = pageForm.editOther
|
||||
await this.getPlayTimes()
|
||||
if (this.enrollId) {
|
||||
if (this.enrollId || this.editOther) {
|
||||
this.loadSecondChoiceOptions(row.usId)
|
||||
await this.getEnrollInfo()
|
||||
}
|
||||
|
||||
},
|
||||
|
||||
// 获取报名信息
|
||||
async getEnrollInfo() {
|
||||
$.post('/platform/theRapyRecuperation/line/enroll/findSignUpInfoById', {id: this.enrollId}).then(res => {
|
||||
$.post("/platform/theRapyRecuperation/line/enroll/findSignUpInfoById", {
|
||||
id: this.enrollId,
|
||||
editOther: this.editOther
|
||||
}).then(res => {
|
||||
if (res.code === 0) {
|
||||
this.signupForm = res.data
|
||||
if (this.enrollId) {
|
||||
const selectTime = this.playTimes.find(v => v.usId === res.data.takePartInLineId)
|
||||
if (selectTime) {
|
||||
this.selectedTime = selectTime
|
||||
}
|
||||
}
|
||||
} else {
|
||||
this.$message.error(res.msg)
|
||||
}
|
||||
@@ -409,11 +420,11 @@ const LineSignUp = {
|
||||
|
||||
// 获取出行时间
|
||||
async getPlayTimes() {
|
||||
const {code, data, msg} = await $.post('/platform/theRapyRecuperation/line/enroll/getSelectLineById', {
|
||||
const { code, data, msg } = await $.post("/platform/theRapyRecuperation/line/enroll/getSelectLineById", {
|
||||
lineId: this.line.lineId,
|
||||
unionId: this.pageForm.unionId,
|
||||
theRapyRecuperationType: this.pageForm.theRapyRecuperationType,
|
||||
lineUnionType: this.pageForm.lineUnionType,
|
||||
lineUnionType: this.pageForm.lineUnionType
|
||||
})
|
||||
if (code === 0) {
|
||||
this.playTimes = data
|
||||
@@ -422,122 +433,130 @@ const LineSignUp = {
|
||||
|
||||
// 查看报名人员
|
||||
viewSignUpUser(row) {
|
||||
this.$emit('view-user', row)
|
||||
this.$emit("view-user", row)
|
||||
},
|
||||
|
||||
// 选择出行时间
|
||||
handleCurrentChange(row) {
|
||||
if (!row) return;
|
||||
if (!row) return
|
||||
|
||||
if ((row.signUpUserNum + row.signUpUserFamilyNum) >= row.maxApplyNum) {
|
||||
this.$message.warning('报名人数已满')
|
||||
this.$message.warning("报名人数已满")
|
||||
return
|
||||
}
|
||||
|
||||
if (new Date(row.signUpEndTime) < new Date()) {
|
||||
this.$message.warning('报名已截止')
|
||||
this.$message.warning("报名已截止")
|
||||
return
|
||||
}
|
||||
|
||||
this.selectedTime = row;
|
||||
// 清空
|
||||
this.signupForm.intentionLineId = null
|
||||
// 再次查询其他出行时间段的意向线路
|
||||
this.loadSecondChoiceOptions(row.usId)
|
||||
|
||||
this.signupForm.takePartInLineId = row.usId
|
||||
this.signupForm.takePartInUnionId = row.takePartInUnionId
|
||||
|
||||
this.selectedTime = row
|
||||
},
|
||||
|
||||
// 表格行样式
|
||||
tableRowClassName({row, rowIndex}) {
|
||||
tableRowClassName({ row, rowIndex }) {
|
||||
if (this.selectedTime && row.usId === this.selectedTime.usId) {
|
||||
return 'selected-row';
|
||||
return "selected-row"
|
||||
}
|
||||
|
||||
// 人数已满的行显示灰色
|
||||
if ((row.signUpUserNum + row.signUpUserFamilyNum) >= row.maxApplyNum) {
|
||||
return 'full-row';
|
||||
return "full-row"
|
||||
}
|
||||
|
||||
// 已截止的行显示灰色
|
||||
if (new Date(row.signUpEndTime) < new Date()) {
|
||||
return 'expired-row';
|
||||
return "expired-row"
|
||||
}
|
||||
|
||||
return '';
|
||||
return ""
|
||||
},
|
||||
|
||||
// 添加随行人
|
||||
addAccompanyingPerson() {
|
||||
if (this.signupForm.companionList.length === 3) {
|
||||
this.$message.warning('最多添加3个随行人')
|
||||
this.$message.warning("最多添加3个随行人")
|
||||
return
|
||||
}
|
||||
this.signupForm.companionList.push({});
|
||||
this.$set(this.signupForm, 'roomCount', '')
|
||||
this.$set(this.signupForm, 'roomCountName', '')
|
||||
this.$set(this.signupForm, 'roomRemark', '')
|
||||
this.$set(this.signupForm, 'roomRemarkName', '')
|
||||
this.signupForm.companionList.push({})
|
||||
this.$set(this.signupForm, "roomCount", "")
|
||||
this.$set(this.signupForm, "roomCountName", "")
|
||||
this.$set(this.signupForm, "roomRemark", "")
|
||||
this.$set(this.signupForm, "roomRemarkName", "")
|
||||
},
|
||||
|
||||
// 移除随行人
|
||||
removeAccompanyingPerson(index) {
|
||||
this.signupForm.companionList.splice(index, 1);
|
||||
this.$set(this.signupForm, 'roomCount', '')
|
||||
this.$set(this.signupForm, 'roomCountName', '')
|
||||
this.$set(this.signupForm, 'roomRemark', '')
|
||||
this.$set(this.signupForm, 'roomRemarkName', '')
|
||||
this.signupForm.companionList.splice(index, 1)
|
||||
this.$set(this.signupForm, "roomCount", "")
|
||||
this.$set(this.signupForm, "roomCountName", "")
|
||||
this.$set(this.signupForm, "roomRemark", "")
|
||||
this.$set(this.signupForm, "roomRemarkName", "")
|
||||
},
|
||||
|
||||
// 根据身份证解析年龄和性别
|
||||
parseIdCard(index) {
|
||||
let idCard = this.signupForm.companionList[index].idCard;
|
||||
if (!idCard || idCard.length < 15) return;
|
||||
let idCard = this.signupForm.companionList[index].idCard
|
||||
if (!idCard || idCard.length < 15) return
|
||||
|
||||
// 解析性别 (第17位,奇数为男,偶数为女)
|
||||
if (idCard.length >= 17) {
|
||||
const genderBit = parseInt(idCard.substr(16, 1));
|
||||
this.$set(this.signupForm.companionList[index], 'sex', genderBit % 2 === 1 ? "男" : "女")
|
||||
const genderBit = parseInt(idCard.substr(16, 1))
|
||||
this.$set(this.signupForm.companionList[index], "sex", genderBit % 2 === 1 ? "男" : "女")
|
||||
// this.signupForm.companionList[index].sex = genderBit % 2 === 1 ? "男" : "女"; // 1-男, 2-女
|
||||
}
|
||||
|
||||
// 解析年龄
|
||||
const birthYear = idCard.length === 18 ? idCard.substr(6, 4) : '19' + idCard.substr(6, 2);
|
||||
const birthMonth = idCard.length === 18 ? idCard.substr(10, 2) : idCard.substr(8, 2);
|
||||
const birthDay = idCard.length === 18 ? idCard.substr(12, 2) : idCard.substr(10, 2);
|
||||
const birthYear = idCard.length === 18 ? idCard.substr(6, 4) : "19" + idCard.substr(6, 2)
|
||||
const birthMonth = idCard.length === 18 ? idCard.substr(10, 2) : idCard.substr(8, 2)
|
||||
const birthDay = idCard.length === 18 ? idCard.substr(12, 2) : idCard.substr(10, 2)
|
||||
|
||||
const birthDate = new Date(birthYear + '-' + birthMonth + '-' + birthDay)
|
||||
const today = new Date();
|
||||
let age = today.getFullYear() - birthDate.getFullYear();
|
||||
const birthDate = new Date(birthYear + "-" + birthMonth + "-" + birthDay)
|
||||
const today = new Date()
|
||||
let age = today.getFullYear() - birthDate.getFullYear()
|
||||
|
||||
if (today.getMonth() < birthDate.getMonth() || (today.getMonth() === birthDate.getMonth() && today.getDate() < birthDate.getDate())) {
|
||||
age--;
|
||||
age--
|
||||
}
|
||||
|
||||
// this.signupForm.companionList[index].age = age;
|
||||
this.$set(this.signupForm.companionList[index], 'age', age)
|
||||
this.$set(this.signupForm.companionList[index], "age", age)
|
||||
},
|
||||
|
||||
// 根据房间数量更新用房备注
|
||||
updateRoomRemarkColumns() {
|
||||
const {roomCount, companionList = []} = this.signupForm;
|
||||
const companionCount = companionList.length;
|
||||
const { roomCount, companionList = [] } = this.signupForm
|
||||
const companionCount = companionList.length
|
||||
|
||||
const roomCountStrategies = {
|
||||
0.5: () => [2, 5], 1: () => {
|
||||
if (companionCount === 0) return [3];
|
||||
if (companionCount === 1) return [4];
|
||||
return [1];
|
||||
if (companionCount === 0) return [3]
|
||||
if (companionCount === 1) return [4]
|
||||
return [1]
|
||||
}, 1.5: () => [1, 3], 2: () => companionCount < 3 ? [6] : [4]
|
||||
};
|
||||
}
|
||||
|
||||
const matchedValues = roomCountStrategies[roomCount]?.();
|
||||
this.roomRemarkColumns = matchedValues !== undefined ? this.basicRoomRemarkColumns.filter(o => matchedValues.includes(o.value)) : [...this.basicRoomRemarkColumns]; // 默认处理:恢复基础列
|
||||
const matchedValues = roomCountStrategies[roomCount]?.()
|
||||
this.roomRemarkColumns = matchedValues !== undefined ? this.basicRoomRemarkColumns.filter(o => matchedValues.includes(o.value)) : [...this.basicRoomRemarkColumns] // 默认处理:恢复基础列
|
||||
|
||||
// 如果最后的roomRemarkColumns的length只有1,直接默认第一个元素显示
|
||||
if (this.roomRemarkColumns.length === 1) {
|
||||
this.$set(this.signupForm, 'roomRemark', this.roomRemarkColumns[0].value)
|
||||
this.$set(this.signupForm, 'roomRemarkName', this.roomRemarkColumns[0].label)
|
||||
this.$set(this.signupForm, "roomRemark", this.roomRemarkColumns[0].value)
|
||||
this.$set(this.signupForm, "roomRemarkName", this.roomRemarkColumns[0].label)
|
||||
}
|
||||
},
|
||||
|
||||
// 加载第二意向线路选项
|
||||
loadSecondChoiceOptions() {
|
||||
$.post('/platform/mobile/theRapyRecuperation/getOpenLineList', {id: this.line?.usId}).then(res => {
|
||||
loadSecondChoiceOptions(usId) {
|
||||
$.post("/platform/mobile/theRapyRecuperation/getOpenLineList", { id: usId }).then(res => {
|
||||
if (res.code === 0) {
|
||||
this.intentionLineColumns = res.data
|
||||
}
|
||||
@@ -548,7 +567,7 @@ const LineSignUp = {
|
||||
// 展示安全告知书
|
||||
async openReadSafe() {
|
||||
let pdfStreamUrl = encodeURIComponent(CREATE_PREVIEW_URL(this.config.files[0].id)) //将路径转码
|
||||
this.readSafeUrl = '/assets/platform/plugins/pdfJs/web/viewer.html?file=' + pdfStreamUrl
|
||||
this.readSafeUrl = "/assets/platform/plugins/pdfJs/web/viewer.html?file=" + pdfStreamUrl
|
||||
this.readVisibleSafe = true
|
||||
},
|
||||
|
||||
@@ -571,14 +590,20 @@ const LineSignUp = {
|
||||
|
||||
// 提交报名
|
||||
async submitSignup() {
|
||||
if (this.hasReadSafe === false) {
|
||||
this.$message.error('请先阅读《安全告知书》')
|
||||
return
|
||||
}
|
||||
this.$refs.signupFormRef.validate(valid => {
|
||||
if (valid) {
|
||||
this.$confirm("您确定要提交吗?", "提示", {type: "warning"})
|
||||
this.$confirm("您确定要提交吗?", "提示", { type: "warning" })
|
||||
.then(() => {
|
||||
$.post('/platform/theRapyRecuperation/line/enroll/doSignUpForLine', {enroll: JSON.stringify(this.signupForm)}).then(res => {
|
||||
this.signupForm.editOther = this.editOther ? this.editOther : ''
|
||||
$.post("/platform/theRapyRecuperation/line/enroll/doSignUpForLine", { enroll: JSON.stringify(this.signupForm) }).then(res => {
|
||||
if (res.code === 0) {
|
||||
this.visible = false
|
||||
this.$message.success(res.msg)
|
||||
sublime.jumpPagePjax("/platform/theRapyRecuperation/mineEnroll?index=" + this.pageForm.theRapyRecuperationType)
|
||||
} else {
|
||||
this.$message.error(res.msg)
|
||||
}
|
||||
@@ -586,7 +611,7 @@ const LineSignUp = {
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
}
|
||||
|
||||
}, style: /*language=CSS*/ `
|
||||
.line-sign-up-dialog .el-dialog__body {
|
||||
@@ -757,4 +782,4 @@ const LineSignUp = {
|
||||
}
|
||||
}
|
||||
`
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user