Merge branch 'main' of https://dd3skj.picp.vip/zhaoxinyu/hmc_gbhd
# Conflicts: # backend/src/main/resources/views/platform/activity/user/index.html
This commit is contained in:
+22
@@ -142,6 +142,28 @@ public class ActGroupController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@At
|
||||||
|
@SaCheckPermission("activity.group")
|
||||||
|
public Result queryGroupUser(String activityId, String groupId){
|
||||||
|
Sql sql = Sqls.create("""
|
||||||
|
SELECT
|
||||||
|
u.*,
|
||||||
|
agu.isLeader
|
||||||
|
FROM
|
||||||
|
act_group_user agu
|
||||||
|
LEFT JOIN act_user u ON u.userId = agu.userId
|
||||||
|
WHERE
|
||||||
|
agu.groupId = @groupId AND agu.activityId = @activityId
|
||||||
|
ORDER BY
|
||||||
|
agu.isLeader DESC
|
||||||
|
""").setParam("groupId", groupId).setParam("activityId", activityId);
|
||||||
|
sql.setCallback(Sqls.callback.maps());
|
||||||
|
dao.execute(sql);
|
||||||
|
List<NutMap> list = (List<NutMap>) sql.getResult();
|
||||||
|
return Result.success(list);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
@At
|
@At
|
||||||
@SaCheckPermission("activity.group")
|
@SaCheckPermission("activity.group")
|
||||||
@SLog(tag = "活动分组", msg = "随机分组")
|
@SLog(tag = "活动分组", msg = "随机分组")
|
||||||
|
|||||||
+1
-1
@@ -215,7 +215,7 @@ public class ActUserController {
|
|||||||
Sql sql = actUserService.getSignUpSql(pageForm);
|
Sql sql = actUserService.getSignUpSql(pageForm);
|
||||||
List<NutMap> nutMaps = actUserService.listMap(sql);
|
List<NutMap> nutMaps = actUserService.listMap(sql);
|
||||||
List<ExcelExportEntity> entityList = new ArrayList<>() {{
|
List<ExcelExportEntity> entityList = new ArrayList<>() {{
|
||||||
add(new ExcelExportEntity("报名号", "actUserNo", 20));
|
// add(new ExcelExportEntity("报名号", "actUserNo", 20));
|
||||||
add(new ExcelExportEntity("姓名", "userName", 20));
|
add(new ExcelExportEntity("姓名", "userName", 20));
|
||||||
add(new ExcelExportEntity("性别", "sex", 20));
|
add(new ExcelExportEntity("性别", "sex", 20));
|
||||||
add(new ExcelExportEntity("身份证号码", "idCard", 20));
|
add(new ExcelExportEntity("身份证号码", "idCard", 20));
|
||||||
|
|||||||
@@ -90,7 +90,7 @@ layout("/layouts/platform_1.html"){
|
|||||||
<el-table-column label="操作" fixed="right" width="250">
|
<el-table-column label="操作" fixed="right" width="250">
|
||||||
<template #default="scope">
|
<template #default="scope">
|
||||||
<el-button type="primary" size="mini" @click="openView(scope.row)">查看</el-button>
|
<el-button type="primary" size="mini" @click="openView(scope.row)">查看</el-button>
|
||||||
<el-button type="primary" size="mini" @click="openAdjustGroup(scope.row)">调整</el-button>
|
<!-- <el-button type="primary" size="mini" @click="openAdjustGroup(scope.row)">调整</el-button>-->
|
||||||
<el-button type="danger" size="mini" @click="doRemove(scope.row)">删除</el-button>
|
<el-button type="danger" size="mini" @click="doRemove(scope.row)">删除</el-button>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
@@ -100,16 +100,20 @@ layout("/layouts/platform_1.html"){
|
|||||||
<group-setting ref="groupSettingRef" @success="successGroup"></group-setting>
|
<group-setting ref="groupSettingRef" @success="successGroup"></group-setting>
|
||||||
|
|
||||||
<un-group-user ref="unGroupUserRef" @success="successGroup"></un-group-user>
|
<un-group-user ref="unGroupUserRef" @success="successGroup"></un-group-user>
|
||||||
|
|
||||||
|
<view-info ref="viewInfoRef"></view-info>
|
||||||
</div>
|
</div>
|
||||||
<script>
|
<script>
|
||||||
<!--#include('groupSetting.js'){}#-->
|
<!--#include('groupSetting.js'){}#-->
|
||||||
<!--#include('unGroupUser.js'){}#-->
|
<!--#include('unGroupUser.js'){}#-->
|
||||||
|
<!--#include('viewInfo.js'){}#-->
|
||||||
new Vue({
|
new Vue({
|
||||||
el: "#app",
|
el: "#app",
|
||||||
mixins: [initTableMixins],
|
mixins: [initTableMixins],
|
||||||
components: {
|
components: {
|
||||||
"group-setting": GROUP_SETTING,
|
"group-setting": GROUP_SETTING,
|
||||||
"un-group-user": UN_GROUP_USER
|
"un-group-user": UN_GROUP_USER,
|
||||||
|
"view-info": VIEW_INFO
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
@@ -122,11 +126,11 @@ layout("/layouts/platform_1.html"){
|
|||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
openView(row){
|
openView(row){
|
||||||
|
this.$refs.viewInfoRef.onOpen(this.pageForm.activityId, row.id)
|
||||||
},
|
|
||||||
openAdjustGroup(row){
|
|
||||||
|
|
||||||
},
|
},
|
||||||
|
// openAdjustGroup(row){
|
||||||
|
//
|
||||||
|
// },
|
||||||
async doRemove(row) {
|
async doRemove(row) {
|
||||||
this.$confirm('此操作将会删除与该小队相关的所有信息,确定要删除吗?', '提示', {
|
this.$confirm('此操作将会删除与该小队相关的所有信息,确定要删除吗?', '提示', {
|
||||||
type: 'warning',
|
type: 'warning',
|
||||||
|
|||||||
@@ -0,0 +1,43 @@
|
|||||||
|
const VIEW_INFO = {
|
||||||
|
template: /*language=HTML*/ `
|
||||||
|
<el-dialog title="查看小队人员" :visible.sync="viewUserDialog" width="60%">
|
||||||
|
<el-table show-overflow-tooltip :data="groupUserData" style="max-height: 600px;overflow-y: auto">
|
||||||
|
<el-table-column label="序号" type="index" header-align="center" align="center"
|
||||||
|
width="50"></el-table-column>
|
||||||
|
<el-table-column label="姓名" prop="userName"></el-table-column>
|
||||||
|
<el-table-column label="性别" prop="sex"></el-table-column>
|
||||||
|
<el-table-column label="身份" prop="isLeader">
|
||||||
|
<template #default="{row}">
|
||||||
|
<el-tag size="small" v-if="row.isLeader">{{ '队长' }}</el-tag>
|
||||||
|
<el-tag type="warning" size="small" v-else>{{ '运动员' }}</el-tag>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="联系方式" prop="phone"></el-table-column>
|
||||||
|
<el-table-column label="所属单位" prop="unitName"></el-table-column>
|
||||||
|
</el-table>
|
||||||
|
<div slot="footer" class="dialog-footer">
|
||||||
|
<el-button @click="viewUserDialog = false">关 闭</el-button>
|
||||||
|
</div>
|
||||||
|
</el-dialog>
|
||||||
|
`,
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
viewUserDialog: false,
|
||||||
|
groupUserData: [],
|
||||||
|
}
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
async onOpen(activityId, groupId){
|
||||||
|
const resp = await $.post('/platform/activity/group/queryGroupUser', {
|
||||||
|
activityId,
|
||||||
|
groupId
|
||||||
|
})
|
||||||
|
if (resp.code === 0) {
|
||||||
|
this.groupUserData = resp.data
|
||||||
|
this.viewUserDialog = true
|
||||||
|
} else {
|
||||||
|
this.$message.error('查询失败')
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -2,481 +2,411 @@
|
|||||||
layout("/layouts/platform_1.html"){
|
layout("/layouts/platform_1.html"){
|
||||||
#-->
|
#-->
|
||||||
<div id="app">
|
<div id="app">
|
||||||
<el-card shadow="never">
|
<el-card shadow="never">
|
||||||
<div class="search">
|
<div class="search">
|
||||||
<div class="search-item">
|
<div class="search-item">
|
||||||
<div class="search-item-label">年度</div>
|
<div class="search-item-label">年度</div>
|
||||||
<div class="search-item-option">
|
<div class="search-item-option">
|
||||||
<el-date-picker
|
<el-date-picker
|
||||||
:clearable="false"
|
:clearable="false"
|
||||||
placeholder="选择年"
|
placeholder="选择年"
|
||||||
style="width: 100%"
|
style="width: 100%"
|
||||||
type="year"
|
type="year"
|
||||||
@change="getActivityList"
|
@change="getActivityList"
|
||||||
v-model="pageForm.year"
|
v-model="pageForm.year"
|
||||||
value-format="yyyy"
|
value-format="yyyy"
|
||||||
></el-date-picker>
|
></el-date-picker>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="search-item">
|
<div class="search-item">
|
||||||
<div class="search-item-label">所属活动</div>
|
<div class="search-item-label">所属活动</div>
|
||||||
<div class="search-item-option">
|
<div class="search-item-option">
|
||||||
<el-select @change="doSearch"
|
<el-select @change="doSearch"
|
||||||
placeholder="请选择活动查询"
|
placeholder="请选择活动查询"
|
||||||
style="width: 100%;"
|
style="width: 100%;"
|
||||||
v-model="pageForm.activityId">
|
v-model="pageForm.activityId">
|
||||||
<el-option :label="item.title" :value="item.id"
|
<el-option :label="item.title" :value="item.id"
|
||||||
v-for="item in activityList"></el-option>
|
v-for="item in activityList"></el-option>
|
||||||
</el-select>
|
</el-select>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="search-item">
|
<div class="search-item">
|
||||||
<div class="search-item-label">姓名/电话</div>
|
<div class="search-item-label">姓名/电话</div>
|
||||||
<div class="search-item-option">
|
<div class="search-item-option">
|
||||||
<el-input v-model="pageForm.searchKeyword" placeholder="请输入姓名"
|
<el-input v-model="pageForm.searchKeyword" placeholder="请输入姓名"
|
||||||
clearable @keyup.enter.native="doSearch"></el-input>
|
clearable @keyup.enter.native="doSearch"></el-input>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="search-item">
|
|
||||||
<div class="search-item-label">签到状态</div>
|
<div class="search-query">
|
||||||
<div class="search-item-option">
|
<el-button type="primary" icon="el-icon-search" @click="doSearch">搜索</el-button>
|
||||||
<el-select v-model="pageForm.isSignIn" placeholder="请选择发放状态" clearable>
|
</div>
|
||||||
<el-option label="已签到" :value="1"></el-option>
|
</div>
|
||||||
<el-option label="未签到" :value="0"></el-option>
|
</el-card>
|
||||||
</el-select>
|
|
||||||
</div>
|
<el-card shadow="never" class="mt-3">
|
||||||
</div>
|
<el-row type="flex" style="justify-content: flex-end" class="mb-3">
|
||||||
|
<el-button type="primary" size="small" @click="openAddUser">添加报名人员</el-button>
|
||||||
<div class="search-item">
|
<el-button type="primary" size="small" @click="doExport">导出</el-button>
|
||||||
<div class="search-item-label">所属单位</div>
|
<el-radio-group v-model="pageForm.isSignIn" type="primary" class="ml-3"@change="doSearch">
|
||||||
<div class="search-item-option">
|
<el-radio-button :label="1">全部</el-radio-button>
|
||||||
<el-select placeholder="请选择所属单位"
|
<el-radio-button :label="2">已签到</el-radio-button>
|
||||||
style="width: 100%;" clearable
|
<el-radio-button :label="3">未签到</el-radio-button>
|
||||||
filterable
|
</el-radio-group>
|
||||||
@change="setModifyFormUnit"
|
|
||||||
v-model="pageForm.unitId">
|
|
||||||
<el-option :label="item.name" :value="item.id"
|
|
||||||
v-for="item in units"></el-option>
|
|
||||||
</el-select>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
|
|
||||||
<div class="search-query">
|
|
||||||
<el-button type="primary" icon="el-icon-search" @click="doSearch">搜索</el-button>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</el-card>
|
|
||||||
|
|
||||||
<el-card shadow="never" class="mt-3">
|
|
||||||
<el-row type="flex" style="justify-content: flex-end" class="mb-3">
|
|
||||||
<el-button icon="el-icon-plus" type="primary" size="small" @click="openAddUser">添加报名人员</el-button>
|
|
||||||
<el-button icon="el-icon-plus" type="primary" size="small" @click="doExport">导出</el-button>
|
|
||||||
</el-row>
|
</el-row>
|
||||||
<el-table v-loading="tableLoading" show-overflow-tooltip :data="tableData">
|
<el-table v-loading="tableLoading" show-overflow-tooltip :data="tableData">
|
||||||
<el-table-column label="序号" type="index" header-align="center" align="center"
|
<el-table-column label="序号" type="index" header-align="center" align="center"
|
||||||
width="50"></el-table-column>
|
width="50"></el-table-column>
|
||||||
<el-table-column label="姓名" prop="userName"></el-table-column>
|
<el-table-column label="姓名" prop="userName"></el-table-column>
|
||||||
<el-table-column label="性别" prop="sex"></el-table-column>
|
<el-table-column label="性别" prop="sex"></el-table-column>
|
||||||
<el-table-column label="联系方式" prop="phone"></el-table-column>
|
<el-table-column label="联系方式" prop="phone"></el-table-column>
|
||||||
<el-table-column label="身份证件号" prop="idCard"></el-table-column>
|
<el-table-column label="身份证件号" prop="idCard"></el-table-column>
|
||||||
<el-table-column label="职务" prop="position"></el-table-column>
|
<el-table-column label="职务" prop="position"></el-table-column>
|
||||||
<el-table-column label="所属单位" prop="unitName"></el-table-column>
|
<el-table-column label="所属单位" prop="unitName"></el-table-column>
|
||||||
<el-table-column label="报名时间" prop="signUpTime"></el-table-column>
|
<el-table-column label="报名时间" prop="signUpTime"></el-table-column>
|
||||||
<el-table-column label="是否签到" prop="isSignIn">
|
<el-table-column label="是否签到" prop="isSignIn">
|
||||||
<template slot-scope="{row}">
|
<template slot-scope="{row}">
|
||||||
{{row.isSignIn?'已签到':'未签到'}}
|
{{row.isSignIn?'已签到':'未签到'}}
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="操作" fixed="right" width="250">
|
<el-table-column label="操作" fixed="right" width="250">
|
||||||
<template #default="scope">
|
<template #default="scope">
|
||||||
<el-button type="primary" size="mini" @click="openModify(scope.row)">修改</el-button>
|
<el-button type="text" @click="openModify">修改</el-button>
|
||||||
<el-button type="danger" size="mini" @click="doRemove(scope.row.id)">删除</el-button>
|
<el-button type="text" class="text-danger" @click="onTableRowDelete(scope.row.id)">删除</el-button>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
</el-table>
|
</el-table>
|
||||||
<!--#include("/layouts/pagination.html"){}#-->
|
<!--#include("/layouts/pagination.html"){}#-->
|
||||||
</el-card>
|
</el-card>
|
||||||
|
|
||||||
<el-dialog title="添加报名人员" :visible.sync="addDialog" width="60%">
|
<el-dialog title="添加报名人员" :visible.sync="addDialog" width="60%">
|
||||||
<el-form :model="formData" :rules="formRules" ref="formRef" label-width="100px">
|
<el-form :model="formData" :rules="formRules" ref="formRef" label-width="100px">
|
||||||
<el-form-item label="活动名称" prop="activityName">
|
<el-form-item label="活动名称" prop="activityName">
|
||||||
<el-input v-model="formData.activityName" readonly></el-input>
|
<el-input v-model="formData.activityName" readonly></el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="参加单位" prop="unitName">
|
<el-form-item label="参加单位" prop="unitName">
|
||||||
<el-select placeholder="请选择所属单位"
|
<el-input v-model="formData.unitName" placeholder="请输入参加单位"></el-input>
|
||||||
style="width: 100%;" clearable
|
</el-form-item>
|
||||||
@change="setFormDataUnit"
|
<el-form-item label="联系人" prop="contactName">
|
||||||
v-model="formData.unitId">
|
<el-input v-model="formData.contactName" placeholder="请输入联系人"></el-input>
|
||||||
<el-option :label="item.name" :value="item.id"
|
</el-form-item>
|
||||||
v-for="item in units"></el-option>
|
<el-form-item label="联系方式" prop="contactPhone">
|
||||||
</el-select>
|
<el-input v-model="formData.contactPhone" placeholder="请输入联系方式" maxlength="11" type="text" show-word-limit></el-input>
|
||||||
<!-- <el-input v-model="formData.unitName" placeholder="请输入参加单位"></el-input>-->
|
</el-form-item>
|
||||||
</el-form-item>
|
<el-form-item label="报名人员" prop="userList">
|
||||||
<el-form-item label="联系人" prop="contactName">
|
<el-table :data="formData.userList" border size="small" width="100%">
|
||||||
<el-input v-model="formData.contactName" placeholder="请输入联系人"></el-input>
|
<el-table-column label="姓名" prop="userName" fixed width="200">
|
||||||
</el-form-item>
|
<template slot-scope="{row}">
|
||||||
<el-form-item label="联系方式" prop="contactPhone">
|
<el-autocomplete style="width: 100%"
|
||||||
<el-input v-model="formData.contactPhone" placeholder="请输入联系方式" maxlength="11" type="text" show-word-limit></el-input>
|
v-model="row.userName"
|
||||||
</el-form-item>
|
:fetch-suggestions="queryUserAsync"
|
||||||
<el-form-item label="报名人员" prop="userList">
|
placeholder="请输入内容"
|
||||||
<el-table :data="formData.userList" border size="small" width="100%">
|
@select="handleSelect($event, row)"
|
||||||
<el-table-column label="姓名" prop="userName" fixed width="200">
|
></el-autocomplete>
|
||||||
<template slot-scope="{row}">
|
<!-- <el-input v-model="row.userName" maxlength="50"-->
|
||||||
<el-autocomplete style="width: 100%"
|
<!-- placeholder="请输入姓名"></el-input>-->
|
||||||
v-model="row.userName"
|
</template>
|
||||||
:fetch-suggestions="queryUserAsync"
|
</el-table-column>
|
||||||
placeholder="请输入内容"
|
<el-table-column label="性别" prop="sex" width="200">
|
||||||
@select="handleSelect($event, row)"
|
<template slot-scope="{row}">
|
||||||
></el-autocomplete>
|
<el-radio-group v-model="row.sex">
|
||||||
<!-- <el-input v-model="row.userName" maxlength="50"-->
|
<el-radio label="男"></el-radio>
|
||||||
<!-- placeholder="请输入姓名"></el-input>-->
|
<el-radio label="女"></el-radio>
|
||||||
</template>
|
</el-radio-group>
|
||||||
</el-table-column>
|
</template>
|
||||||
<el-table-column label="性别" prop="sex" width="200">
|
</el-table-column>
|
||||||
<template slot-scope="{row}">
|
<el-table-column label="联系方式" prop="phone" width="200">
|
||||||
<el-radio-group v-model="row.sex">
|
<template slot-scope="{row}">
|
||||||
<el-radio label="男"></el-radio>
|
<el-input v-model="row.phone" maxlength="11" type="text"
|
||||||
<el-radio label="女"></el-radio>
|
show-word-limit placeholder="请输入联系方式"></el-input>
|
||||||
</el-radio-group>
|
</template>
|
||||||
</template>
|
</el-table-column>
|
||||||
</el-table-column>
|
<el-table-column label="身份证件号" prop="idCard" width="250">
|
||||||
<el-table-column label="联系方式" prop="phone" width="200">
|
<template slot-scope="{row}">
|
||||||
<template slot-scope="{row}">
|
<el-input v-model="row.idCard" maxlength="18" type="text"
|
||||||
<el-input v-model="row.phone" maxlength="11" type="text"
|
show-word-limit placeholder="请输入身份证件号"></el-input>
|
||||||
show-word-limit placeholder="请输入联系方式"></el-input>
|
</template>
|
||||||
</template>
|
</el-table-column>
|
||||||
</el-table-column>
|
<el-table-column label="职务" prop="position" width="200">
|
||||||
<el-table-column label="身份证件号" prop="idCard" width="250">
|
<template slot-scope="{row}">
|
||||||
<template slot-scope="{row}">
|
<el-input v-model="row.position" maxlength="100"
|
||||||
<el-input v-model="row.idCard" maxlength="18" type="text"
|
placeholder="请输入职务"></el-input>
|
||||||
show-word-limit placeholder="请输入身份证件号"></el-input>
|
</template>
|
||||||
</template>
|
</el-table-column>
|
||||||
</el-table-column>
|
<!--<el-table-column label="所属单位" prop="unitName" width="250">
|
||||||
<el-table-column label="职务" prop="position" width="200">
|
<template slot-scope="{row}">
|
||||||
<template slot-scope="{row}">
|
<el-input v-model="row.unitName" maxlength="100" placeholder="请输所属单位"></el-input>
|
||||||
<el-input v-model="row.position" maxlength="100"
|
</template>
|
||||||
placeholder="请输入职务"></el-input>
|
</el-table-column>-->
|
||||||
</template>
|
<el-table-column width="100px" fixed="right">
|
||||||
</el-table-column>
|
<template slot="header" slot-scope="scope">
|
||||||
<!--<el-table-column label="所属单位" prop="unitName" width="250">
|
<el-button type="primary" size="mini"
|
||||||
<template slot-scope="{row}">
|
@click="formData.userList.push({})">添加
|
||||||
<el-input v-model="row.unitName" maxlength="100" placeholder="请输所属单位"></el-input>
|
</el-button>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>-->
|
<template slot-scope="scope">
|
||||||
<el-table-column width="100px" fixed="right">
|
<el-button
|
||||||
<template slot="header" slot-scope="scope">
|
type="danger"
|
||||||
<el-button type="primary" size="mini"
|
icon="el-icon-delete"
|
||||||
@click="formData.userList.push({})">添加
|
size="mini"
|
||||||
</el-button>
|
:disabled="formData.userList.length===0"
|
||||||
</template>
|
@click="formData.userList.splice(scope.$index,1)"
|
||||||
<template slot-scope="scope">
|
></el-button>
|
||||||
<el-button
|
</template>
|
||||||
type="danger"
|
</el-table-column>
|
||||||
icon="el-icon-delete"
|
</el-table>
|
||||||
size="mini"
|
</el-form-item>
|
||||||
:disabled="formData.userList.length===0"
|
</el-form>
|
||||||
@click="formData.userList.splice(scope.$index,1)"
|
<div slot="footer" class="dialog-footer">
|
||||||
></el-button>
|
<el-button @click="addDialog = false">取 消</el-button>
|
||||||
</template>
|
<el-button type="primary" @click="onAddUserSubmit">确 定</el-button>
|
||||||
</el-table-column>
|
</div>
|
||||||
</el-table>
|
</el-dialog>
|
||||||
</el-form-item>
|
|
||||||
</el-form>
|
<el-dialog title="修改报名信息" :visible.sync="modifyDialog" width="40%">
|
||||||
<div slot="footer" class="dialog-footer">
|
<el-form :model="modifyForm" :rules="modifyRules" ref="modifyFormRef" label-width="100px">
|
||||||
<el-button @click="addDialog = false">取 消</el-button>
|
<el-form-item label="姓名" prop="userName">
|
||||||
<el-button type="primary" @click="onAddUserSubmit">确 定</el-button>
|
<el-input v-model="modifyForm.userName"></el-input>
|
||||||
</div>
|
</el-form-item>
|
||||||
</el-dialog>
|
<el-form-item label="性别" prop="sex">
|
||||||
|
<el-radio-group v-model="modifyForm.sex">
|
||||||
<el-dialog title="修改报名信息" :visible.sync="modifyDialog" width="40%">
|
<el-radio label="男"></el-radio>
|
||||||
<el-form :model="modifyForm" :rules="modifyRules" ref="modifyFormRef" label-width="100px">
|
<el-radio label="女"></el-radio>
|
||||||
<el-form-item label="姓名" prop="userName">
|
</el-radio-group>
|
||||||
<el-input v-model="modifyForm.userName"></el-input>
|
</el-form-item>
|
||||||
</el-form-item>
|
<el-form-item label="联系方式" prop="phone">
|
||||||
<el-form-item label="性别" prop="sex">
|
<el-input v-model="modifyForm.phone"></el-input>
|
||||||
<el-radio-group v-model="modifyForm.sex">
|
</el-form-item>
|
||||||
<el-radio label="男"></el-radio>
|
<el-form-item label="身份证件号" prop="idCard">
|
||||||
<el-radio label="女"></el-radio>
|
<el-input v-model="modifyForm.idCard"></el-input>
|
||||||
</el-radio-group>
|
</el-form-item>
|
||||||
</el-form-item>
|
<el-form-item label="职务" prop="position">
|
||||||
<el-form-item label="联系方式" prop="phone">
|
<el-input v-model="modifyForm.position"></el-input>
|
||||||
<el-input v-model="modifyForm.phone"></el-input>
|
</el-form-item>
|
||||||
</el-form-item>
|
<el-form-item label="所属单位" prop="unitName">
|
||||||
<el-form-item label="身份证件号" prop="idCard">
|
<el-input v-model="modifyForm.unitName"></el-input>
|
||||||
<el-input v-model="modifyForm.idCard"></el-input>
|
</el-form-item>
|
||||||
</el-form-item>
|
</el-form>
|
||||||
<el-form-item label="职务" prop="position">
|
<span slot="footer" class="dialog-footer">
|
||||||
<el-input v-model="modifyForm.position"></el-input>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="所属单位" prop="unitName">
|
|
||||||
<el-select placeholder="请选择所属单位"
|
|
||||||
style="width: 100%;" clearable
|
|
||||||
@change="setModifyFormUnit"
|
|
||||||
v-model="modifyForm.unitId">
|
|
||||||
<el-option :label="item.name" :value="item.id"
|
|
||||||
v-for="item in units"></el-option>
|
|
||||||
</el-select>
|
|
||||||
<!-- <el-input v-model="modifyForm.unitName"></el-input>-->
|
|
||||||
</el-form-item>
|
|
||||||
</el-form>
|
|
||||||
<span slot="footer" class="dialog-footer">
|
|
||||||
<el-button @click="modifyDialog = false">取消</el-button>
|
<el-button @click="modifyDialog = false">取消</el-button>
|
||||||
<el-button type="primary" @click="onModifySubmit">提交</el-button>
|
<el-button type="primary" @click="onModifySubmit">提交</el-button>
|
||||||
</span>
|
</span>
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
const vue = new Vue({
|
const vue = new Vue({
|
||||||
el: "#app",
|
el: "#app",
|
||||||
mixins: [initTableMixins],
|
mixins: [initTableMixins],
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
pageForm: {
|
pageForm: {
|
||||||
year: new Date().getFullYear() + '',
|
isSignIn: 1,
|
||||||
},
|
year: new Date().getFullYear() + '',
|
||||||
activityList: [],
|
},
|
||||||
// 修改表单
|
activityList: [],
|
||||||
modifyDialog: false,
|
// 修改表单
|
||||||
modifyForm: {},
|
modifyDialog: false,
|
||||||
modifyRules: {
|
modifyForm: {},
|
||||||
userName: [{required: true, message: '请输入姓名', trigger: ['blur', 'change']}],
|
modifyRules: {
|
||||||
sex: [{required: true, message: '请选择性别', trigger: ['blur', 'change']}],
|
userName: [{required: true, message: '请输入姓名', trigger: ['blur', 'change']}],
|
||||||
phone: [{
|
sex: [{required: true, message: '请选择性别', trigger: ['blur', 'change']}],
|
||||||
required: true,
|
phone: [{
|
||||||
validator: (rule, value, callback) => {
|
required: true,
|
||||||
if (!value) {
|
validator: (rule, value, callback) => {
|
||||||
// 如果值为空,直接通过校验
|
if (!value) {
|
||||||
callback();
|
// 如果值为空,直接通过校验
|
||||||
} else if (/^[1][345789][0-9]{9}$/.test(value)) {
|
callback();
|
||||||
// 手机号格式正确
|
} else if (/^[1][345789][0-9]{9}$/.test(value)) {
|
||||||
callback();
|
// 手机号格式正确
|
||||||
} else if (/^\d+-\d+$/.test(value) && value.length <= 16) {
|
callback();
|
||||||
// 座机号格式正确
|
} else if (/^\d+-\d+$/.test(value) && value.length <= 16) {
|
||||||
callback();
|
// 座机号格式正确
|
||||||
} else {
|
callback();
|
||||||
// 格式错误,返回错误信息
|
} else {
|
||||||
callback(new Error(value.includes('-') ? '座机号码格式错误' : '手机号码格式错误'));
|
// 格式错误,返回错误信息
|
||||||
}
|
callback(new Error(value.includes('-') ? '座机号码格式错误' : '手机号码格式错误'));
|
||||||
},
|
}
|
||||||
trigger: ["change", "blur"]
|
},
|
||||||
}],
|
trigger: ["change", "blur"]
|
||||||
idCard: [
|
}],
|
||||||
{
|
idCard: [
|
||||||
required: true,
|
{
|
||||||
validator: (rule, value, callback) => {
|
required: true,
|
||||||
if (!value) {
|
validator: (rule, value, callback) => {
|
||||||
// 如果值为空,直接通过校验
|
if (!value) {
|
||||||
callback();
|
// 如果值为空,直接通过校验
|
||||||
} else if (/^[1-9]\d{5}(18|19|20)?\d{2}((0[1-9])|(10|11|12))(([0|1|2][0-9])|10|20|30|31)\d{3}(\d|[Xx])$/.test(value)) {
|
callback();
|
||||||
// 18位身份证号码格式正确
|
} else if (/^[1-9]\d{5}(18|19|20)?\d{2}((0[1-9])|(10|11|12))(([0|1|2][0-9])|10|20|30|31)\d{3}(\d|[Xx])$/.test(value)) {
|
||||||
callback();
|
// 18位身份证号码格式正确
|
||||||
} else if (/^[1-9]\d{7}((0[1-9])|(10|11|12))(([0|1|2][0-9])|10|20|30|31)\d{3}$/.test(value)) {
|
callback();
|
||||||
// 15位身份证号码格式正确
|
} else if (/^[1-9]\d{7}((0[1-9])|(10|11|12))(([0|1|2][0-9])|10|20|30|31)\d{3}$/.test(value)) {
|
||||||
callback();
|
// 15位身份证号码格式正确
|
||||||
} else if (/^[1-9]\d{5}(18|19|20)?\d{2}((0[1-9])|(10|11|12))(([0|1|2][0-9])|10|20|30|31)\d{3}$/.test(value)) {
|
callback();
|
||||||
// 外国人身份证号码格式正确(18位)
|
} else if (/^[1-9]\d{5}(18|19|20)?\d{2}((0[1-9])|(10|11|12))(([0|1|2][0-9])|10|20|30|31)\d{3}$/.test(value)) {
|
||||||
callback();
|
// 外国人身份证号码格式正确(18位)
|
||||||
} else if (/^[1-9]\d{7}((0[1-9])|(10|11|12))(([0|1|2][0-9])|10|20|30|31)\d{3}$/.test(value)) {
|
callback();
|
||||||
// 外国人身份证号码格式正确(15位)
|
} else if (/^[1-9]\d{7}((0[1-9])|(10|11|12))(([0|1|2][0-9])|10|20|30|31)\d{3}$/.test(value)) {
|
||||||
callback();
|
// 外国人身份证号码格式正确(15位)
|
||||||
} else {
|
callback();
|
||||||
// 格式错误,返回错误信息
|
} else {
|
||||||
callback(new Error("身份证号码格式错误"));
|
// 格式错误,返回错误信息
|
||||||
}
|
callback(new Error("身份证号码格式错误"));
|
||||||
},
|
}
|
||||||
trigger: ["change", "blur"]
|
},
|
||||||
}
|
trigger: ["change", "blur"]
|
||||||
],
|
}
|
||||||
position: [{required: true, message: '请输入职务', trigger: ['blur', 'change']}],
|
],
|
||||||
unitName: [{required: true, message: '请输入所属单位', trigger: ['blur', 'change']}],
|
position: [{required: true, message: '请输入职务', trigger: ['blur', 'change']}],
|
||||||
},
|
unitName: [{required: true, message: '请输入所属单位', trigger: ['blur', 'change']}],
|
||||||
|
},
|
||||||
// 添加报名人员相关
|
|
||||||
addDialog: false,
|
// 添加报名人员相关
|
||||||
formData: {
|
addDialog: false,
|
||||||
activityId: '',
|
formData: {
|
||||||
userList: []
|
activityId: '',
|
||||||
},
|
userList: []
|
||||||
formRules: {
|
},
|
||||||
activityId: [{required: true, message: '请选择活动', trigger: ['blur', 'change']}],
|
formRules: {
|
||||||
unitName: [{required: true, message: '请填写参加单位', trigger: ['blur', 'change']}],
|
activityId: [{required: true, message: '请选择活动', trigger: ['blur', 'change']}],
|
||||||
contactName: [{required: true, message: '请填写联系人', trigger: ['blur', 'change']}],
|
unitName: [{required: true, message: '请填写参加单位', trigger: ['blur', 'change']}],
|
||||||
contactPhone: [{required: true, message: '请填写联系电话', trigger: ['blur', 'change']}],
|
contactName: [{required: true, message: '请填写联系人', trigger: ['blur', 'change']}],
|
||||||
userList: [{required: true, message: '请添加报名人员', trigger: ['blur', 'change']}]
|
contactPhone: [{required: true, message: '请填写联系电话', trigger: ['blur', 'change']}],
|
||||||
},
|
userList: [{required: true, message: '请添加报名人员', trigger: ['blur', 'change']}]
|
||||||
|
},
|
||||||
units: [],
|
}
|
||||||
}
|
},
|
||||||
},
|
methods: {
|
||||||
methods: {
|
doExport() {
|
||||||
setFormDataUnit(val) {
|
window.open("/platform/activity/user/doExport?activityId=" + this.pageForm.activityId + "&searchKeyword=" + this.pageForm.searchKeyword)
|
||||||
if (!val) {
|
},
|
||||||
this.formData.unitName = ''
|
openAddUser(){
|
||||||
return
|
if (!this.pageForm.activityId) {
|
||||||
}
|
this.$message.warning('请先选择活动')
|
||||||
this.formData.unitName = this.units.find(item => item.id === this.formData.unitId).name
|
return
|
||||||
},
|
}
|
||||||
setModifyFormUnit(val) {
|
this.formData.userList = []
|
||||||
if (!val) {
|
this.addDialog = true
|
||||||
this.modifyForm.unitName = ''
|
this.formData.activityId = this.pageForm.activityId
|
||||||
return
|
this.formData.activityName = this.activityList.find(item => item.id === this.formData.activityId).title
|
||||||
}
|
},
|
||||||
this.modifyForm.unitName = this.units.find(item => item.id === this.modifyForm.unitId).name
|
async queryUserAsync(query, cb){
|
||||||
},
|
const resp = await $.post('/platform/activity/user/queryUser', {
|
||||||
doRemove(id) {
|
query,
|
||||||
this.$confirm('您确定要删除吗?', '提示', {
|
activityId: this.formData.activityId
|
||||||
confirmButtonText: '确定',
|
})
|
||||||
cancelButtonText: '取消',
|
if (resp.code === 0) {
|
||||||
type: 'warning'
|
if (resp.data.list && resp.data.list.length > 0) {
|
||||||
}).then(async () => {
|
cb(resp.data.list.map(v => {
|
||||||
const resp = await $.post('/platform/activity/user/doDeleteActUser', {id})
|
return {value: v.username + '(' + (v.phone ? v.phone : '未填写联系方式') + ')', ...v}
|
||||||
if (resp.code === 0) {
|
}))
|
||||||
this.doSearch()
|
} else {
|
||||||
this.$message.success(resp.msg)
|
cb([])
|
||||||
} else {
|
}
|
||||||
this.$message.warning('操作失败')
|
} else {
|
||||||
}
|
cb([])
|
||||||
})
|
}
|
||||||
},
|
},
|
||||||
doExport() {
|
handleSelect(item, row){
|
||||||
window.open("/platform/activity/user/doExport?activityId=" + this.pageForm.activityId + "&searchKeyword=" + this.pageForm.searchKeyword)
|
this.$set(row, 'userId', item.id)
|
||||||
},
|
this.$set(row, 'userName', item.username)
|
||||||
openAddUser(){
|
this.$set(row, 'sex', item.sex)
|
||||||
if (!this.pageForm.activityId) {
|
this.$set(row, 'phone', item.phone ? item.phone : '')
|
||||||
this.$message.warning('请先选择活动')
|
},
|
||||||
return
|
async onAddUserSubmit(){
|
||||||
}
|
const userList = this.formData.userList;
|
||||||
this.formData.userList = []
|
if (!userList || userList === []) {
|
||||||
this.addDialog = true
|
this.$message.warning("请添加报名人员")
|
||||||
this.formData.activityId = this.pageForm.activityId
|
return
|
||||||
this.formData.activityName = this.activityList.find(item => item.id === this.formData.activityId).title
|
}
|
||||||
},
|
|
||||||
async queryUserAsync(query, cb){
|
let errorMessages = [];
|
||||||
const resp = await $.post('/platform/activity/user/queryUser', {
|
const requiredFields = [
|
||||||
query,
|
{ key: 'userName', message: '姓名不能为空' },
|
||||||
activityId: this.formData.activityId
|
{ key: 'sex', message: '性别不能为空' },
|
||||||
})
|
{ key: 'phone', message: '联系方式不能为空' },
|
||||||
if (resp.code === 0) {
|
{ key: 'idCard', message: '身份证件号不能为空' },
|
||||||
if (resp.data.list && resp.data.list.length > 0) {
|
{ key: 'position', message: '职务不能为空' }
|
||||||
cb(resp.data.list.map(v => {
|
];
|
||||||
return {value: v.username + '(' + (v.phone ? v.phone : '未填写联系方式') + ')', ...v}
|
|
||||||
}))
|
userList.forEach((user, index) => {
|
||||||
} else {
|
requiredFields.forEach(field => {
|
||||||
cb([])
|
if (user[field.key] == null || user[field.key] === "") {
|
||||||
}
|
errorMessages.push('第' + (index + 1) + '行:' + field.message);
|
||||||
} else {
|
}
|
||||||
cb([])
|
});
|
||||||
}
|
});
|
||||||
},
|
|
||||||
handleSelect(item, row){
|
if (errorMessages.length > 0) {
|
||||||
this.$set(row, 'userId', item.id)
|
// 将错误信息转换为 HTML 格式,使用 <br> 实现换行
|
||||||
this.$set(row, 'userName', item.username)
|
const errorSummary = errorMessages.join("<br>");
|
||||||
this.$set(row, 'sex', item.sex)
|
this.$message.warning({
|
||||||
this.$set(row, 'phone', item.phone ? item.phone : '')
|
message: errorSummary,
|
||||||
},
|
dangerouslyUseHTMLString: true
|
||||||
async onAddUserSubmit(){
|
});
|
||||||
const userList = this.formData.userList;
|
return
|
||||||
if (!userList || userList === []) {
|
}
|
||||||
this.$message.warning("请添加报名人员")
|
const formData = JSON.parse(JSON.stringify(this.formData));
|
||||||
return
|
formData.userList = JSON.stringify(this.formData.userList)
|
||||||
}
|
const resp = await $.post('/platform/activity/user/doAddActUser', formData)
|
||||||
|
if (resp.code === 0) {
|
||||||
let errorMessages = [];
|
this.$message.success(resp.msg)
|
||||||
const requiredFields = [
|
this.addDialog = false
|
||||||
{ key: 'userName', message: '姓名不能为空' },
|
this.formData = {
|
||||||
{ key: 'sex', message: '性别不能为空' },
|
activityId: '',
|
||||||
{ key: 'phone', message: '联系方式不能为空' },
|
userList: []
|
||||||
{ key: 'idCard', message: '身份证件号不能为空' },
|
}
|
||||||
{ key: 'position', message: '职务不能为空' }
|
this.doSearch()
|
||||||
];
|
} else {
|
||||||
|
this.$message.warning('操作失败')
|
||||||
userList.forEach((user, index) => {
|
console.log(resp.msg)
|
||||||
requiredFields.forEach(field => {
|
}
|
||||||
if (user[field.key] == null || user[field.key] === "") {
|
},
|
||||||
errorMessages.push('第' + (index + 1) + '行:' + field.message);
|
async openModify(row) {
|
||||||
}
|
const resp = await $.post('/platform/activity/user/findSignUserInfo', {id: row.id})
|
||||||
});
|
if (resp.code === 0) {
|
||||||
});
|
this.modifyForm = resp.data
|
||||||
|
this.modifyDialog = true
|
||||||
if (errorMessages.length > 0) {
|
} else {
|
||||||
// 将错误信息转换为 HTML 格式,使用 <br> 实现换行
|
this.$message.warning('查询异常')
|
||||||
const errorSummary = errorMessages.join("<br>");
|
console.log(resp.msg)
|
||||||
this.$message.warning({
|
}
|
||||||
message: errorSummary,
|
},
|
||||||
dangerouslyUseHTMLString: true
|
onModifySubmit() {
|
||||||
});
|
this.$refs.modifyFormRef.validate(async valid => {
|
||||||
return
|
if (valid) {
|
||||||
}
|
const resp = await $.post('/platform/activity/user/doModifyActUser', this.modifyForm)
|
||||||
const formData = JSON.parse(JSON.stringify(this.formData));
|
if (resp.code === 0) {
|
||||||
formData.userList = JSON.stringify(this.formData.userList)
|
this.$message.success(resp.msg)
|
||||||
const resp = await $.post('/platform/activity/user/doAddActUser', formData)
|
this.modifyDialog = false
|
||||||
if (resp.code === 0) {
|
this.$refs.modifyFormRef.resetFields()
|
||||||
this.$message.success(resp.msg)
|
this.doSearch()
|
||||||
this.addDialog = false
|
} else {
|
||||||
this.formData = {
|
this.$message.warning('操作失败')
|
||||||
activityId: '',
|
console.log(resp.msg)
|
||||||
userList: []
|
}
|
||||||
}
|
}
|
||||||
this.doSearch()
|
})
|
||||||
} else {
|
},
|
||||||
this.$message.warning('操作失败')
|
async getActivityList(){
|
||||||
console.log(resp.msg)
|
const resp = await $.post('/platform/activity/user/getActivityList', {
|
||||||
}
|
year: this.pageForm.year
|
||||||
},
|
})
|
||||||
async openModify(row) {
|
if (resp.code === 0 && resp.data && resp.data.length > 0) {
|
||||||
const resp = await $.post('/platform/activity/user/findSignUserInfo', {id: row.id})
|
this.activityList = resp.data
|
||||||
if (resp.code === 0) {
|
this.$set(this.pageForm, 'activityId', this.activityList[0].id)
|
||||||
this.modifyForm = resp.data
|
} else {
|
||||||
this.modifyDialog = true
|
this.$set(this.pageForm, 'activityId', '')
|
||||||
} else {
|
}
|
||||||
this.$message.warning('查询异常')
|
this.pageData()
|
||||||
console.log(resp.msg)
|
}
|
||||||
}
|
},
|
||||||
},
|
created() {
|
||||||
onModifySubmit() {
|
this.getActivityList()
|
||||||
this.$refs.modifyFormRef.validate(async valid => {
|
}
|
||||||
if (valid) {
|
})
|
||||||
const resp = await $.post('/platform/activity/user/doModifyActUser', this.modifyForm)
|
|
||||||
if (resp.code === 0) {
|
|
||||||
this.$message.success(resp.msg)
|
|
||||||
this.modifyDialog = false
|
|
||||||
this.$refs.modifyFormRef.resetFields()
|
|
||||||
this.doSearch()
|
|
||||||
} else {
|
|
||||||
this.$message.warning('操作失败')
|
|
||||||
console.log(resp.msg)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
})
|
|
||||||
},
|
|
||||||
async getActivityList(){
|
|
||||||
const resp = await $.post('/platform/activity/user/getActivityList', {
|
|
||||||
year: this.pageForm.year
|
|
||||||
})
|
|
||||||
if (resp.code === 0 && resp.data && resp.data.length > 0) {
|
|
||||||
this.activityList = resp.data
|
|
||||||
this.$set(this.pageForm, 'activityId', this.activityList[0].id)
|
|
||||||
} else {
|
|
||||||
this.$set(this.pageForm, 'activityId', '')
|
|
||||||
}
|
|
||||||
this.pageData()
|
|
||||||
},
|
|
||||||
async getUnits(){
|
|
||||||
const resp = await $.post('/open/common/units')
|
|
||||||
if (resp.code === 0) {
|
|
||||||
this.units = resp.data
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
created() {
|
|
||||||
this.getActivityList()
|
|
||||||
this.getUnits()
|
|
||||||
}
|
|
||||||
})
|
|
||||||
</script>
|
</script>
|
||||||
<!--#
|
<!--#
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user