This commit is contained in:
zhoutianchi
2026-01-14 10:52:06 +08:00
parent 8c1f4ec05e
commit d0c8ea0223
140 changed files with 16969 additions and 11469 deletions

View File

@@ -0,0 +1,511 @@
<!--
- Copyright (c) 2018-2025, cyweb All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
- Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
- Neither the name of the pig4cloud.com developer nor the names of its
- contributors may be used to endorse or promote products derived from
- this software without specific prior written permission.
-
-->
<template>
<div class="layout-padding">
<div class="layout-padding-auto layout-padding-view">
<!-- 搜索表单 -->
<el-form :model="queryForm" inline class="mb-4" ref="searchFormRef">
<el-form-item label="招生计划" prop="groupId">
<el-select v-model="queryForm.groupId" filterable clearable placeholder="请选择招生计划" style="width: 150px;">
<el-option
v-for="item in planList"
:key="item.id"
:label="item.groupName"
:value="item.id"
/>
</el-select>
</el-form-item>
<el-form-item label="学院" prop="xy">
<el-select v-model="queryForm.xy" filterable clearable placeholder="请选择学院" style="width: 130px;">
<el-option
v-for="item in deptList"
:key="item.deptCode"
:label="item.deptName"
:value="item.deptCode"
/>
</el-select>
</el-form-item>
<el-form-item label="录取专业" prop="confirmedMajor">
<el-select v-model="queryForm.confirmedMajor" filterable clearable placeholder="请选择录取专业">
<el-option
v-for="item in planMajorList"
:key="item.zydm"
:label="item.zymc + '(' + item.xz + '年制)'"
:value="item.zydm"
/>
</el-select>
</el-form-item>
<el-form-item label="唯一号/姓名/身份证号" prop="search">
<el-input v-model="queryForm.search" clearable placeholder="唯一号/姓名/身份证号" />
</el-form-item>
<el-form-item label="住宿范围" prop="isOutFw">
<el-select v-model="queryForm.isOutFw" filterable clearable placeholder="请选择住宿范围" style="width: 100px;">
<el-option
v-for="item in isOutFwList"
:key="item.value"
:label="item.label"
:value="item.value"
/>
</el-select>
</el-form-item>
<el-form-item label="是否发送短信" prop="isSend">
<el-select v-model="queryForm.isSend" filterable clearable placeholder="请选择是否发送短信" style="width: 100px;">
<el-option
v-for="item in isSendList"
:key="item.value"
:label="item.label"
:value="item.value"
/>
</el-select>
</el-form-item>
<el-form-item label="性别" prop="gender">
<el-select v-model="queryForm.gender" filterable clearable placeholder="请选择性别" style="width: 120px;">
<el-option
v-for="item in genderList"
:key="item.value"
:label="item.label"
:value="item.value"
/>
</el-select>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="Search" @click="getDataList">查询</el-button>
<el-button type="primary" plain icon="Refresh" class="ml10" @click="resetQuery">重置</el-button>
</el-form-item>
</el-form>
<!-- 操作按钮 -->
<div class="mb15">
<el-button
v-if="permissions.recruitStuDorm"
type="primary"
icon="Setting"
@click="setDormFW"
>
住宿范围
</el-button>
<el-button
v-if="permissions.recruitStuDorm"
type="danger"
plain
icon="Location"
class="ml10"
@click="yjOut"
>
一键判断住宿范围
</el-button>
<el-button
v-if="permissions.recruitStuDormMess"
type="danger"
plain
icon="Message"
class="ml10"
@click="yjSend"
>
批量发送短信
</el-button>
<el-button
type="warning"
plain
icon="Download"
class="ml10"
@click="handleExport"
>
名单导出
</el-button>
</div>
<!-- 表格 -->
<el-table
ref="tableRef"
:data="state.dataList"
v-loading="state.loading"
border
stripe
:cell-style="tableStyle.cellStyle"
:header-cell-style="tableStyle.headerCellStyle"
>
<el-table-column type="index" label="序号" width="60" align="center" />
<el-table-column prop="serialNumber" label="唯一号" width="100" align="center" show-overflow-tooltip />
<el-table-column prop="name" label="姓名" width="100" align="center" show-overflow-tooltip />
<el-table-column prop="gender" label="性别" width="80" align="center" show-overflow-tooltip>
<template #default="scope">
{{ getGender(scope.row.gender) }}
</template>
</el-table-column>
<el-table-column prop="idNumber" label="身份证号" width="180" align="center" show-overflow-tooltip />
<el-table-column prop="xy" label="学院" width="120" align="center" show-overflow-tooltip>
<template #default="scope">
{{ getDeptName(scope.row.xy) }}
</template>
</el-table-column>
<el-table-column prop="homeAddressDetail" label="家庭地址" align="center" show-overflow-tooltip />
<el-table-column prop="isOutFw" label="范围" width="100" align="center" show-overflow-tooltip>
<template #default="scope">
<span v-if="scope.row.isOutFw == 0">待确认</span>
<span v-if="scope.row.isOutFw == 1">范围内</span>
<span v-if="scope.row.isOutFw == 2">范围外</span>
</template>
</el-table-column>
<el-table-column prop="isSd" label="手动设置" width="100" align="center" show-overflow-tooltip>
<template #default="scope">
<span v-if="scope.row.isSd == 0">未设置</span>
<span v-if="scope.row.isSd == 1">已设置</span>
</template>
</el-table-column>
<el-table-column prop="isSend" label="发送短信" width="100" align="center" show-overflow-tooltip>
<template #default="scope">
<span v-if="scope.row.isSend == 0">未发送</span>
<span v-if="scope.row.isSend == 1">已发送</span>
</template>
</el-table-column>
<el-table-column label="操作" width="300" align="center" fixed="right">
<template #default="scope">
<el-button
v-if="permissions.recruitStuDormSd && scope.row.isOutFw != '1'"
type="success"
link
icon="CircleCheck"
@click="setFw(scope.row, 1)"
>
设为范围内
</el-button>
<el-button
v-if="permissions.recruitStuDormSd && scope.row.isOutFw != '2'"
type="warning"
link
icon="Close"
@click="setFw(scope.row, 2)"
>
设为范围外
</el-button>
<el-button
type="primary"
link
icon="Location"
@click="baiduMap(scope.row)"
>
家庭地址
</el-button>
<el-button
v-if="permissions.recruitStuDormDel"
type="danger"
link
icon="Delete"
@click="deleteHandle(scope.row.id)"
>
删除
</el-button>
</template>
</el-table-column>
</el-table>
<!-- 分页 -->
<pagination
v-bind="state.pagination"
@current-change="currentChangeHandle"
@size-change="sizeChangeHandle"
/>
<!-- 支付二维码弹窗 -->
<el-dialog v-model="dialogFormVisible" title="支付二维码" width="800px" @close="dialogFormVisible = false">
<el-table :data="tableData" border>
<el-table-column label="唯一号" prop="serialNumber" align="center" />
<el-table-column label="姓名" prop="name" align="center" />
<el-table-column label="家长手机号" prop="parentTelOne" align="center" />
<el-table-column label="操作" align="center">
<template #default="scope">
<el-button type="danger" icon="Search" @click="updateFS">立即查询</el-button>
</template>
</el-table-column>
</el-table>
<div style="padding-top: 20px;">
<div id="payQrcode1" style="display: inline-block;">
{{ payQrcode1Msg }}
</div>
<!-- <vue-qr :text="payQrcode1" :size="200" v-if="showPrise1" style="display: inline-block"></vue-qr> -->
<div id="payQrcode2" style="display: inline-block">
{{ payQrcode2Msg }}
</div>
<!-- <vue-qr :text="payQrcode2" :size="200" v-if="showPrise2" style="display: inline-block"></vue-qr> -->
<div id="payQrcode3" style="display: inline-block">
{{ payQrcode3Msg }}
</div>
<!-- <vue-qr :text="payQrcode3" :size="200" v-if="showPrise3" style="display: inline-block"></vue-qr> -->
</div>
<span style="color: red;padding-top: 20px;">** 此界面为查询学生缴款二维码如有收不到微信推送或手机号填错的可直接在此扫码支付支付成功后请手动点击"立即查询"按钮查询该生的缴费情况;因财政收费系统有一定的滞后性如点击"立即查询"后任显示未交费请稍后再继续查询或重新点击"立即查询"按钮 **</span>
</el-dialog>
<dorm-f-w v-if="dormFWRefVisible" ref="dormFWRef" />
<show-map v-if="baiduMapVisible" ref="baiduMapRef" />
</div>
</div>
</template>
<script setup lang="ts" name="recruitstudentsignupList">
import { ref, reactive, computed, onMounted, nextTick, defineAsyncComponent } from 'vue'
import { storeToRefs } from 'pinia'
import { useUserInfo } from '/@/stores/userInfo'
import { BasicTableProps, useTable } from '/@/hooks/table'
import { useMessage, useMessageBox } from '/@/hooks/message'
import { list } from '/@/api/recruit/recruitstudentplangroup'
import { fetchListStuDorm, yjOut, setFw, delFw, yjSend } from '/@/api/recruit/recruitstudentsignup'
import { getDeptList } from '/@/api/basic/basicclass'
import { list as planMajor } from '/@/api/recruit/recruitplanmajor'
// @ts-ignore
import global from '@/components/tools/commondict'
const DormFW = defineAsyncComponent(() => import('./dormFW.vue'))
const ShowMap = defineAsyncComponent(() => import('./showMap.vue'))
// 使用 Pinia store
const userInfoStore = useUserInfo()
const { userInfos } = storeToRefs(userInfoStore)
// 创建权限对象
const permissions = computed(() => {
const perms: Record<string, boolean> = {}
userInfos.value.authBtnList.forEach((perm: string) => {
perms[perm] = true
})
return perms
})
// 消息提示 hooks
const message = useMessage()
const messageBox = useMessageBox()
// 表格引用
const tableRef = ref()
const searchFormRef = ref()
const dormFWRef = ref()
const baiduMapRef = ref()
// 数据
const planList = ref<any[]>([])
const planMajorList = ref<any[]>([])
const deptList = ref<any[]>([])
const genderList = ref([{ label: '男', value: '1' }, { label: '女', value: '2' }])
const isOutFwList = ref([{ label: '待确认', value: '0' }, { label: '范围内', value: '1' }, { label: '范围外', value: '2' }])
const isSendList = ref([{ label: '未发送', value: 0 }, { label: '已发送', value: 1 }])
// 查询表单
const queryForm = reactive({
groupId: '',
xy: '',
confirmedMajor: '',
search: '',
isOutFw: '',
isSend: null,
gender: ''
})
// 弹窗状态
const dialogFormVisible = ref(false)
const dormFWRefVisible = ref(false)
const baiduMapVisible = ref(false)
const tableData = ref<any[]>([])
const payQrcode1 = ref('')
const showPrise1 = ref(false)
const payQrcode1Msg = ref('')
const payQrcode2 = ref('')
const payQrcode2Msg = ref('')
const showPrise2 = ref(false)
const payQrcode3 = ref('')
const payQrcode3Msg = ref('')
const showPrise3 = ref(false)
// 获取学院名称
const getDeptName = (deptCode: string) => {
const item = deptList.value.find(item => item.deptCode === deptCode)
return item ? item.deptName : ''
}
// 获取性别
const getGender = (gender: string) => {
if (gender == '2') {
return '女'
}
if (gender == '1') {
return '男'
}
return ''
}
// 表格状态
const state: BasicTableProps = reactive<BasicTableProps>({
queryForm: queryForm,
pageList: async (params: any) => {
const response = await fetchListStuDorm(params)
return {
data: {
records: response.data.data.records,
total: response.data.data.total
}
}
},
createdIsNeed: false
})
// 使用 table hook
const { getDataList, currentChangeHandle, sizeChangeHandle, tableStyle, downBlobFile } = useTable(state)
// 初始化
const init = async () => {
try {
// 查询二级学院信息
const deptData = await getDeptList()
deptList.value = deptData.data.data || []
// 获取招生计划列表
const planData = await list()
planList.value = planData.data.data || []
if (planList.value.length > 0) {
queryForm.groupId = planList.value[0].id
}
getDataList()
} catch (error) {
console.error('初始化失败', error)
}
}
// 设置住宿范围
const setFw = async (row: any, type: number) => {
const title = type == 1 ? '范围内' : '范围外'
try {
await messageBox.confirm(`是否确认设置${title}?请谨慎操作`)
await setFw({ id: row.id, isOutFw: type })
message.success('操作成功')
getDataList()
} catch {
// 用户取消
}
}
// 设置住宿范围窗口
const setDormFW = () => {
dormFWRefVisible.value = true
nextTick(() => {
dormFWRef.value?.init()
})
}
// 一键判断住宿范围
const yjOut = async () => {
if (!queryForm.groupId) {
message.warning('招生计划不能为空')
return
}
try {
await messageBox.confirm('是否确认一键判断是否超出住宿范围?请谨慎操作')
await yjOut({ groupId: queryForm.groupId })
message.success('操作成功')
getDataList()
} catch {
// 用户取消
}
}
// 批量发送短信
const yjSend = async () => {
if (!queryForm.groupId) {
message.warning('招生计划不能为空')
return
}
try {
await messageBox.confirm('是否确认批量发送短信通知?请谨慎操作')
await yjSend({ groupId: queryForm.groupId })
message.success('操作成功')
getDataList()
} catch {
// 用户取消
}
}
// 百度地图
const baiduMap = (row: any) => {
baiduMapVisible.value = true
nextTick(() => {
baiduMapRef.value?.init(row)
})
}
// 导出
const handleExport = async () => {
if (!queryForm.groupId) {
message.warning('招生计划不能为空')
return
}
try {
await downBlobFile(
'/recruit/recruitstudentsignup/stuDormExport',
queryForm,
'新生住宿名单导出.xls'
)
} catch (error: any) {
message.error(error.msg || '导出失败')
}
}
// 立即查询
const updateFS = async () => {
// 这个方法需要根据实际API调整
message.info('功能待实现')
}
// 重置查询
const resetQuery = () => {
searchFormRef.value?.resetFields()
queryForm.groupId = ''
queryForm.xy = ''
queryForm.confirmedMajor = ''
queryForm.search = ''
queryForm.isOutFw = ''
queryForm.isSend = null
queryForm.gender = ''
if (planList.value.length > 0) {
queryForm.groupId = planList.value[0].id
}
getDataList()
}
// 删除
const deleteHandle = async (id: string) => {
try {
await messageBox.confirm('是否确认删除本条数据?请谨慎操作')
await delFw(id)
message.success('删除成功')
getDataList()
} catch {
// 用户取消
}
}
onMounted(() => {
init()
})
</script>
<style lang="scss" scoped>
</style>