This commit is contained in:
那些花儿
2025-06-19 04:48:01 +08:00
parent 03d32dbbc6
commit 72547e2632
2 changed files with 93 additions and 82 deletions
@@ -318,7 +318,7 @@ layout("/layouts/platform.html"){
</div> </div>
<div class="route-info-item"> <div class="route-info-item">
<span class="route-info-label">已报名人数</span> <span class="route-info-label">已报名人数</span>
<span class="route-info-value"> <span class="route-info-value" @click="viewSignUpUser(item)">
<span class="badge badge-primary">{{ item.signUpUserNum }}</span> <span class="badge badge-primary">{{ item.signUpUserNum }}</span>
</span> </span>
</div> </div>
@@ -350,7 +350,7 @@ layout("/layouts/platform.html"){
</div> </div>
</guava> </guava>
<line-sign-up ref="lineSignUpRef" @view-line="openLine"></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"> <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="config" @success="baseSuccess"></base-sign-up> <base-sign-up ref="baseRef" :config_data="config" @success="baseSuccess"></base-sign-up>
@@ -365,6 +365,27 @@ layout("/layouts/platform.html"){
<el-button type="primary" @click="lineDialogVisible = false">关 闭</el-button> <el-button type="primary" @click="lineDialogVisible = false">关 闭</el-button>
</span> </span>
</el-dialog> </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> </div>
<script> <script>
@@ -401,6 +422,12 @@ layout("/layouts/platform.html"){
// 查看详情 // 查看详情
lineDialogVisible: false, lineDialogVisible: false,
// 报名人员
signUpUserPageForm: {},
signUpUserVisible: false,
signUpUserTableData: []
} }
}, },
methods: { methods: {
@@ -512,6 +539,32 @@ layout("/layouts/platform.html"){
this.$refs.lineRef.openInit(row.usId, row.id) 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)
}
})
},
}, },
created() { created() {
this.pageData(); this.pageData();
@@ -121,7 +121,7 @@ const LineSignUp = {
<el-input v-model="signupForm.idCard" placeholder="请输入身份证号"></el-input> <el-input v-model="signupForm.idCard" placeholder="请输入身份证号"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="手机号" prop="mobile" <el-form-item label="手机号" prop="mobile"
:rules="[{required: true, message: '请输入手机号', trigger: 'blur'},{pattern: /^1[3-9]\d{8}$/, message: '请输入正确的手机号', trigger: ['change','blur']}]"> :rules="[{required: true, message: '请输入手机号', trigger: 'blur'},{pattern: /^1[3-9]\\d{9}$/, message: '请输入正确的手机号', trigger: ['change','blur']}]">
<el-input v-model="signupForm.mobile" placeholder="请输入手机号"></el-input> <el-input v-model="signupForm.mobile" placeholder="请输入手机号"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="所属工会" prop="unionName"> <el-form-item label="所属工会" prop="unionName">
@@ -186,7 +186,7 @@ const LineSignUp = {
</el-form-item> </el-form-item>
<el-form-item :label="'手机号'" :prop="'companionList.' + index + '.mobile'" <el-form-item :label="'手机号'" :prop="'companionList.' + index + '.mobile'"
:rules="[{required: true, message: '请输入手机号', trigger: 'blur'},{pattern: /^1[3-9]\d{8}$/, message: '请输入正确的手机号', trigger: ['change','blur']}]"> :rules="[{required: true, message: '请输入手机号', trigger: 'blur'},{pattern: /^1[3-9]\\d{9}$/, message: '请输入正确的手机号', trigger: ['change','blur']}]">
<el-input v-model="person.mobile" placeholder="请输入手机号"></el-input> <el-input v-model="person.mobile" placeholder="请输入手机号"></el-input>
</el-form-item> </el-form-item>
@@ -296,18 +296,8 @@ const LineSignUp = {
<el-button @click="onReadSafe" type="primary">我已阅读确认</el-button> <el-button @click="onReadSafe" type="primary">我已阅读确认</el-button>
</el-row> </el-row>
</el-dialog> </el-dialog>
<el-dialog title="报名人员" :visible.sync="signUpUserVisible" :close-on-click-modal="false"
:close-on-press-escape="false" append-to-body>
<el-table :data="signUpUserTableData">
</el-table>
</el-dialog>
</el-dialog> </el-dialog>
`, `, data() {
data() {
return { return {
visible: false, visible: false,
line: {}, line: {},
@@ -331,21 +321,18 @@ const LineSignUp = {
rules: {}, rules: {},
basicRoomColumns: [ basicRoomColumns: [{label: '0.5间(一张床)', value: 0.5}, {
{label: '0.5间(张床)', value: 0.5}, label: '1间(张床)',
{label: '1间(两张床)', value: 1}, value: 1
{label: '1.5间(三张床)', value: 1.5}, }, {label: '1.5间(三张床)', value: 1.5}, {label: '2间(四张床)', value: 2},],
{label: '2间(四张床)', value: 2},
],
roomColumns: [], roomColumns: [],
basicRoomRemarkColumns: [ basicRoomRemarkColumns: [{label: '携带家属,1间房', value: 1}, {
{label: '携带家属,1间房', value: 1}, label: '已与其他老师自由组合共住1间房',
{label: '已与其他老师自由组合共住1间房', value: 2}, value: 2
{label: '1间房,额外支付单房差', value: 3}, }, {label: '1间房,额外支付单房差', value: 3}, {label: '正常报名', value: 4}, {
{label: '正常报名', value: 4}, label: '随机拼房',
{label: '随机拼房', value: 5}, value: 5
{label: '2间房,额外支付单房差', value: 6}, }, {label: '2间房,额外支付单房差', value: 6},],
],
roomRemarkColumns: [], roomRemarkColumns: [],
// 第二意向线路 // 第二意向线路
@@ -360,12 +347,6 @@ const LineSignUp = {
// 报名id // 报名id
enrollId: null, enrollId: null,
// 报名人员
signUpUserVisible: false,
signUpUserTableData: [],
signUpUserSearchKeyWord: null
} }
}, },
@@ -383,18 +364,14 @@ const LineSignUp = {
}; };
this.roomColumns = bedCountStrategies[bedCount]?.() || []; this.roomColumns = bedCountStrategies[bedCount]?.() || [];
this.signupForm.carryFamilyNum = companionCount this.signupForm.carryFamilyNum = companionCount
}, }, deep: true, immediate: true
deep: true, }, 'signupForm.roomCount'(oldVal, newVal) {
immediate: true
},
'signupForm.roomCount'(oldVal, newVal) {
if (newVal && oldVal !== newVal) { if (newVal && oldVal !== newVal) {
this.$set(this.signupForm, 'roomRemark', '') this.$set(this.signupForm, 'roomRemark', '')
this.$set(this.signupForm, 'roomRemarkName', '') this.$set(this.signupForm, 'roomRemarkName', '')
} }
this.updateRoomRemarkColumns() this.updateRoomRemarkColumns()
}, }, 'signupForm.roomRemark'(val) {
'signupForm.roomRemark'(val) {
if (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 { } else {
@@ -432,14 +409,12 @@ const LineSignUp = {
// 获取出行时间 // 获取出行时间
async getPlayTimes() { 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,
lineId: this.line.lineId, unionId: this.pageForm.unionId,
unionId: this.pageForm.unionId, theRapyRecuperationType: this.pageForm.theRapyRecuperationType,
theRapyRecuperationType: this.pageForm.theRapyRecuperationType, lineUnionType: this.pageForm.lineUnionType,
lineUnionType: this.pageForm.lineUnionType, })
}
)
if (code === 0) { if (code === 0) {
this.playTimes = data this.playTimes = data
} }
@@ -447,17 +422,7 @@ const LineSignUp = {
// 查看报名人员 // 查看报名人员
viewSignUpUser(row) { viewSignUpUser(row) {
$.post('/platform/theRapyRecuperation/line/enroll/openSignUser', { this.$emit('view-user', row)
usId: row.usId,
searchKeyWord: this.signUpUserSearchKeyWord
}).then(res => {
if (res.code === 0) {
this.signUpUserTableData = res.data
this.signUpUserVisible = true
} else {
this.$message.error(res.msg)
}
})
}, },
// 选择出行时间 // 选择出行时间
@@ -539,8 +504,7 @@ const LineSignUp = {
const today = new Date(); const today = new Date();
let age = today.getFullYear() - birthDate.getFullYear(); let age = today.getFullYear() - birthDate.getFullYear();
if (today.getMonth() < birthDate.getMonth() || if (today.getMonth() < birthDate.getMonth() || (today.getMonth() === birthDate.getMonth() && today.getDate() < birthDate.getDate())) {
(today.getMonth() === birthDate.getMonth() && today.getDate() < birthDate.getDate())) {
age--; age--;
} }
@@ -554,20 +518,15 @@ const LineSignUp = {
const companionCount = companionList.length; const companionCount = companionList.length;
const roomCountStrategies = { const roomCountStrategies = {
0.5: () => [2, 5], 0.5: () => [2, 5], 1: () => {
1: () => {
if (companionCount === 0) return [3]; if (companionCount === 0) return [3];
if (companionCount === 1) return [4]; if (companionCount === 1) return [4];
return [1]; return [1];
}, }, 1.5: () => [1, 3], 2: () => companionCount < 3 ? [6] : [4]
1.5: () => [1, 3],
2: () => companionCount < 3 ? [6] : [4]
}; };
const matchedValues = roomCountStrategies[roomCount]?.(); const matchedValues = roomCountStrategies[roomCount]?.();
this.roomRemarkColumns = matchedValues !== undefined this.roomRemarkColumns = matchedValues !== undefined ? this.basicRoomRemarkColumns.filter(o => matchedValues.includes(o.value)) : [...this.basicRoomRemarkColumns]; // 默认处理:恢复基础列
? this.basicRoomRemarkColumns.filter(o => matchedValues.includes(o.value))
: [...this.basicRoomRemarkColumns]; // 默认处理:恢复基础列
// 如果最后的roomRemarkColumns的length只有1,直接默认第一个元素显示 // 如果最后的roomRemarkColumns的length只有1,直接默认第一个元素显示
if (this.roomRemarkColumns.length === 1) { if (this.roomRemarkColumns.length === 1) {
@@ -629,8 +588,7 @@ const LineSignUp = {
}) })
}, },
}, }, style: /*language=CSS*/ `
style: /*language=CSS*/ `
.line-sign-up-dialog .el-dialog__body { .line-sign-up-dialog .el-dialog__body {
padding: 0 20px 20px 20px; padding: 0 20px 20px 20px;
max-height: 70vh; max-height: 70vh;
@@ -682,7 +640,7 @@ const LineSignUp = {
} }
.time-table .selected-row { .time-table .selected-row {
background-color: #c1dbf7!important; background-color: #c1dbf7 !important;
font-weight: 500; font-weight: 500;
position: relative; position: relative;
transition: all 0.3s ease; transition: all 0.3s ease;