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,308 @@
<!--
- 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="请选择招生计划">
<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="search">
<el-input v-model="queryForm.search" clearable placeholder="唯一号/姓名/身份证号/学校名称" />
</el-form-item>
<el-form-item label="异动审核" prop="isMajorChange">
<el-select v-model="queryForm.isMajorChange" filterable clearable placeholder="请选择异动审核">
<el-option
v-for="item in majorChangeList"
: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>
<!-- 表格 -->
<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="type" label="异动类型" align="center" show-overflow-tooltip>
<template #default="scope">
{{ getTypeLabel(scope.row.type) }}
</template>
</el-table-column>
<el-table-column prop="name" label="姓名[唯一号]" align="center" show-overflow-tooltip />
<el-table-column prop="majorChangeInfo" label="专业变更情况" align="center" show-overflow-tooltip />
<el-table-column label="学费变更情况" align="center">
<el-table-column prop="dbName" label="费用类型" align="center" show-overflow-tooltip />
<el-table-column prop="dbOldValue" label="原费用" align="center" show-overflow-tooltip />
<el-table-column prop="dbNewValue" label="新费用" align="center" show-overflow-tooltip />
<el-table-column prop="dbType" label="变更类型" align="center" show-overflow-tooltip />
<el-table-column prop="dbChangeValue" label="变更金额" align="center" show-overflow-tooltip />
</el-table-column>
<el-table-column label="分数变更情况" align="center">
<el-table-column prop="scoreName" label="分数类型" align="center" show-overflow-tooltip />
<el-table-column prop="scoreOldValue" label="原分值" align="center" show-overflow-tooltip />
<el-table-column prop="scoreNewValue" label="新分值" align="center" show-overflow-tooltip />
</el-table-column>
<el-table-column prop="createBy" label="异动发起人" align="center" show-overflow-tooltip />
<el-table-column prop="createDate" label="异动时间" align="center" show-overflow-tooltip />
<el-table-column prop="remarks" label="备注信息" align="center" show-overflow-tooltip />
<el-table-column prop="isMajorChange" label="异动审核" align="center" show-overflow-tooltip>
<template #default="scope">
<span v-if="scope.row.isMajorChange == '0'" style="color: green">{{ getMajor(scope.row.isMajorChange) }}</span>
<span v-if="scope.row.isMajorChange != '0'" style="color: red">{{ getMajor(scope.row.isMajorChange) }}</span>
</template>
</el-table-column>
<el-table-column label="操作" width="100" align="center" fixed="right">
<template #default="scope">
<el-button
v-if="permissions.recruit_recruitstudentsignupturnover_edit && scope.row.isMajorChange == '1'"
type="primary"
link
icon="EditPen"
@click="majorchange(scope.row.id, scope.row.groupId)"
>
审核
</el-button>
</template>
</el-table-column>
</el-table>
<!-- 分页 -->
<pagination
v-bind="state.pagination"
@current-change="currentChangeHandle"
@size-change="sizeChangeHandle"
/>
<!-- 异动审核弹窗 -->
<el-dialog v-model="majorChangeVisible" title="异动审核">
<el-form :model="exarmForm" ref="exarmFormRef" label-width="80px" :rules="dataRule">
<el-form-item label="审核结果" prop="isMajorChange">
<el-select v-model="exarmForm.isMajorChange" filterable clearable placeholder="请选择审核结果" style="width: 100%">
<el-option
v-for="item in isMajorChangeList"
:key="item.value"
:label="item.label"
:value="item.value"
/>
</el-select>
</el-form-item>
<el-form-item label="审核意见" prop="remarks">
<el-input
type="textarea"
placeholder="请输入审核内容"
:autosize="{ minRows: 2, maxRows: 4 }"
style="width: 100%"
v-model="exarmForm.remarks"
maxlength="20"
/>
</el-form-item>
</el-form>
<template #footer>
<div class="dialog-footer">
<el-button type="primary" @click="update">保存</el-button>
<el-button @click="cancelPlace">关闭</el-button>
</div>
</template>
</el-dialog>
</div>
</div>
</template>
<script setup lang="ts" name="recruitstudentsignupturnover">
import { ref, reactive, computed, onMounted, 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 { fetchList, putObj } from '/@/api/recruit/recruitstudentsignupturnover'
import { list } from '/@/api/recruit/recruitstudentplangroup'
// 使用 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 exarmFormRef = ref()
// 弹窗状态
const majorChangeVisible = ref(false)
// 数据
const planList = ref<any[]>([])
const typeList = ref([{ label: '专业变更', value: '1' }, { label: '退学', value: '2' }])
const isMajorChangeList = ref([{ label: '通过', value: '3' }, { label: '驳回', value: '2' }])
const majorChangeList = ref([{ label: '通过', value: '3' }, { label: '驳回', value: '2' }, { label: '待审核', value: '1' }])
// 查询表单
const queryForm = reactive({
groupId: '',
search: '',
isMajorChange: ''
})
// 审核表单
const exarmForm = reactive({
id: '',
isMajorChange: '',
examRemark: '',
groupId: '',
remarks: ''
})
// 表单验证规则
const dataRule = {
isMajorChange: [
{ required: true, message: '请选择审核结果', trigger: 'change' }
]
}
// 获取异动类型标签
const getTypeLabel = (type: string) => {
const item = typeList.value.find(item => item.value === type)
return item ? item.label : ''
}
// 获取审核状态
const getMajor = (type: string) => {
if (type == '1') {
return '待审核'
} else if (type == '2') {
return '驳回'
} else if (type == '3') {
return '已通过'
}
return ''
}
// 表格状态
const state: BasicTableProps = reactive<BasicTableProps>({
queryForm: queryForm,
pageList: async (params: any) => {
const response = await fetchList(params)
return {
data: {
records: response.data.data.records,
total: response.data.data.total
}
}
},
createdIsNeed: false
})
// 使用 table hook
const { getDataList, currentChangeHandle, sizeChangeHandle, tableStyle } = useTable(state)
// 初始化
const init = async () => {
try {
const data = await list()
planList.value = data.data.data || []
if (planList.value.length > 0) {
queryForm.groupId = planList.value[0].id
}
getDataList()
} catch (error) {
console.error('初始化失败', error)
}
}
// 打开审核弹窗
const majorchange = (id: string, groupId: string) => {
exarmForm.id = id
exarmForm.groupId = groupId
exarmForm.isMajorChange = ''
exarmForm.remarks = ''
majorChangeVisible.value = true
}
// 取消审核
const cancelPlace = () => {
majorChangeVisible.value = false
}
// 保存审核
const update = async () => {
try {
const valid = await exarmFormRef.value?.validate().catch(() => {})
if (!valid) return
await putObj(exarmForm)
message.success('审核成功')
majorChangeVisible.value = false
getDataList()
} catch (error: any) {
message.error(error.msg || '审核失败')
}
}
// 重置查询
const resetQuery = () => {
searchFormRef.value?.resetFields()
Object.keys(queryForm).forEach(key => {
queryForm[key] = ''
})
if (planList.value.length > 0) {
queryForm.groupId = planList.value[0].id
}
getDataList()
}
onMounted(() => {
init()
})
</script>
<style lang="scss" scoped>
</style>

View File

@@ -0,0 +1,160 @@
<!--
- 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="execution">
<basic-container>
<avue-crud ref="crud"
:page="page"
:data="tableData"
:table-loading="tableLoading"
:option="tableOption"
@on-load="getList"
@search-change="handleFilter"
@refresh-change="refreshChange"
@row-update="handleUpdate"
@row-save="handleSave"
@row-del="rowDel">
</avue-crud>
</basic-container>
</div>
</template>
<script>
import {addObj, delObj, fetchList, putObj} from '@/api/recruit/recruitstudentsignupturnover'
import {tableOption} from '@/const/crud/recruit/recruitstudentsignupturnover'
import {mapGetters} from 'vuex'
export default {
name: 'recruitstudentsignupturnover',
data() {
return {
tableData: [],
page: {
total: 0, // 总页数
currentPage: 1, // 当前页数
pageSize: 10 // 每页显示多少条
},
tableLoading: false,
tableOption: tableOption,
params:{}
}
},
created() {
},
mounted: function() { },
computed: {
...mapGetters(['permissions'])
},
methods: {
getList(page) {
this.tableLoading = true
fetchList(Object.assign({
current: page.currentPage,
size: page.pageSize
}, this.params)).then(response => {
this.tableData = response.data.data.records
this.page.total = response.data.data.total
this.tableLoading = false
})
},
/**
* @title 打开新增窗口
* @detail 调用crud的handleadd方法即可
*
**/
handleAdd: function() {
this.$refs.crud.rowAdd()
},
handleEdit(row, index) {
this.$refs.crud.rowEdit(row, index)
},
handleDel(row, index) {
this.$refs.crud.rowDel(row, index)
},
rowDel: function(row, index) {
var _this = this
this.$confirm('是否确认删除ID为' + row.id, '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(function() {
return delObj(row.id)
}).then(data => {
_this.tableData.splice(index, 1)
_this.$message({
showClose: true,
message: '删除成功',
type: 'success'
})
this.getList(this.page)
}).catch(function(err) { })
},
/**
* @title 数据更新
* @param row 为当前的数据
* @param index 为当前更新数据的行数
* @param done 为表单关闭函数
*
**/
handleUpdate: function(row, index, done) {
putObj(row).then(data => {
this.tableData.splice(index, 1, Object.assign({}, row))
this.$message({
showClose: true,
message: '修改成功',
type: 'success'
})
done()
this.getList(this.page)
})
},
/**
* @title 数据添加
* @param row 为当前的数据
* @param done 为表单关闭函数
*
**/
handleSave: function(row, done) {
addObj(row).then(data => {
this.tableData.push(Object.assign({}, row))
this.$message({
showClose: true,
message: '添加成功',
type: 'success'
})
done()
this.getList(this.page)
})
},
/**
* 刷新回调
*/
refreshChange() {
this.getList(this.page)
},
handleFilter(param){
this.params = param;
this.page.currentPage = 1;
this.getList(this.page);
}
}
}
</script>
<style lang="scss" scoped>
</style>