|
|
@@ -52,6 +52,60 @@
|
|
|
<a-date-picker v-model:value="formData.birthday" value-format="YYYY-MM-DD" style="width: 100%" />
|
|
|
</a-form-item>
|
|
|
</a-col>
|
|
|
+ <a-col :span="12">
|
|
|
+ <a-form-item label="学号:" name="studentNum">
|
|
|
+ <a-input v-model:value="formData.studentNum" placeholder="请输入学号" allow-clear />
|
|
|
+ </a-form-item>
|
|
|
+ </a-col>
|
|
|
+ </a-row>
|
|
|
+ <a-row :gutter="16">
|
|
|
+ <a-col :span="8">
|
|
|
+ <a-form-item label="所属院系:" name="collegeId">
|
|
|
+ <a-select
|
|
|
+ v-model:value="formData.collegeId"
|
|
|
+ placeholder="请选择所属院系"
|
|
|
+ :options="collegeList"
|
|
|
+ :field-names="{ label: 'name', value: 'id' }"
|
|
|
+ @change="handleCollegeChange"
|
|
|
+ allow-clear
|
|
|
+ />
|
|
|
+ </a-form-item>
|
|
|
+ </a-col>
|
|
|
+ <a-col :span="8">
|
|
|
+ <a-form-item label="专业:" name="majorId">
|
|
|
+ <a-select
|
|
|
+ v-model:value="formData.majorId"
|
|
|
+ placeholder="请选择专业"
|
|
|
+ :options="majorList"
|
|
|
+ :field-names="{ label: 'majorName', value: 'id' }"
|
|
|
+ @change="handleMajorChange"
|
|
|
+ allow-clear
|
|
|
+ />
|
|
|
+ </a-form-item>
|
|
|
+ </a-col>
|
|
|
+ <a-col :span="8">
|
|
|
+ <a-form-item label="班级:" name="gradesId">
|
|
|
+ <a-select
|
|
|
+ v-model:value="formData.gradesId"
|
|
|
+ placeholder="请选择班级"
|
|
|
+ :options="gradesList"
|
|
|
+ :field-names="{ label: 'gradesName', value: 'gradesId' }"
|
|
|
+ allow-clear
|
|
|
+ />
|
|
|
+ </a-form-item>
|
|
|
+ </a-col>
|
|
|
+ </a-row>
|
|
|
+ <a-row :gutter="16">
|
|
|
+ <a-col :span="8">
|
|
|
+ <a-form-item label="学届:" name="fallDue">
|
|
|
+ <a-select
|
|
|
+ v-model:value="formData.fallDue"
|
|
|
+ placeholder="请选择学届"
|
|
|
+ :options="fallDueOptions"
|
|
|
+ allow-clear
|
|
|
+ />
|
|
|
+ </a-form-item>
|
|
|
+ </a-col>
|
|
|
</a-row>
|
|
|
<a-row :gutter="16">
|
|
|
<a-col :span="8">
|
|
|
@@ -137,7 +191,7 @@
|
|
|
<a-col :span="7" class="form-row-con"> 主管 </a-col>
|
|
|
<a-col :span="3" class="form-row-con"> 操作 </a-col>
|
|
|
</a-row>
|
|
|
- <div v-for="(positionInfo, index) in formData.positionJson" class="form-div">
|
|
|
+ <div v-for="(positionInfo, index) in formData.positionJson" :key="index" class="form-div">
|
|
|
<a-row :gutter="10">
|
|
|
<a-col :span="7">
|
|
|
<a-form-item
|
|
|
@@ -336,6 +390,7 @@
|
|
|
<script setup>
|
|
|
import userApi from '@/api/sys/userApi'
|
|
|
import userCenterApi from '@/api/sys/userCenterApi'
|
|
|
+ import resourceAuditApi from '@/api/resourceAudit'
|
|
|
import { required } from '@/utils/formRules'
|
|
|
import tool from '@/utils/tool'
|
|
|
// 默认是关闭状态
|
|
|
@@ -347,6 +402,9 @@
|
|
|
const treeData = ref([])
|
|
|
const treeDefaultExpandedKeys = ref([])
|
|
|
const eduIdentityOptions = tool.dictList('SYS_USER_EDU_IDENTITY')
|
|
|
+ const collegeList = ref([])
|
|
|
+ const majorList = ref([])
|
|
|
+ const gradesList = ref([])
|
|
|
console.log(eduIdentityOptions, 'eduIdentityOptions')
|
|
|
|
|
|
// 分页select组件dom定义
|
|
|
@@ -356,14 +414,67 @@
|
|
|
const xnChildUserPageSelectRef = ref()
|
|
|
// 表单数据
|
|
|
const formData = ref({})
|
|
|
+ const fallDueOptions = tool.dictList('FALL_TYPE')
|
|
|
+ // 加载院系列表
|
|
|
+ const loadCollegeList = () => {
|
|
|
+ resourceAuditApi.orgList().then((res) => {
|
|
|
+ if (res) {
|
|
|
+ collegeList.value = res.data
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+
|
|
|
+ // 处理院系变化
|
|
|
+ const handleCollegeChange = (value) => {
|
|
|
+ formData.value.majorId = undefined
|
|
|
+ formData.value.gradesId = undefined
|
|
|
+ majorList.value = []
|
|
|
+ gradesList.value = []
|
|
|
+
|
|
|
+ if (value) {
|
|
|
+ // 加载专业列表
|
|
|
+ resourceAuditApi.zyselect({ collegeId: value }).then((res) => {
|
|
|
+ if (res) {
|
|
|
+ majorList.value = res.data
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ // 处理专业变化
|
|
|
+ const handleMajorChange = (value) => {
|
|
|
+ formData.value.gradesId = undefined
|
|
|
+ gradesList.value = []
|
|
|
+ if (value && formData.value.collegeId) {
|
|
|
+ // 加载班级列表
|
|
|
+ resourceAuditApi
|
|
|
+ .gradeByZyAndOrgId({
|
|
|
+ collegeId: formData.value.collegeId,
|
|
|
+ majorId: value
|
|
|
+ })
|
|
|
+ .then((res) => {
|
|
|
+ if (res) {
|
|
|
+ gradesList.value = res.data
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+ }
|
|
|
|
|
|
// 打开抽屉
|
|
|
const onOpen = (record, orgId) => {
|
|
|
visible.value = true
|
|
|
formData.value = {
|
|
|
gender: '男',
|
|
|
- positionJson: []
|
|
|
+ positionJson: [],
|
|
|
+ collegeId: undefined,
|
|
|
+ majorId: undefined,
|
|
|
+ gradesId: undefined,
|
|
|
+ studentNum: '',
|
|
|
+ fallDue: undefined
|
|
|
}
|
|
|
+
|
|
|
+ // 加载院系列表
|
|
|
+ loadCollegeList()
|
|
|
if (orgId) {
|
|
|
formData.value.orgId = orgId
|
|
|
// 通过机构再查询职位、主管
|
|
|
@@ -423,6 +534,30 @@
|
|
|
})
|
|
|
}
|
|
|
selePositionData(formData.value.orgId)
|
|
|
+
|
|
|
+ // 如果有院系ID,加载专业列表并回显
|
|
|
+ if (formData.value.collegeId) {
|
|
|
+ resourceAuditApi.zyselect({ collegeId: formData.value.collegeId }).then((res) => {
|
|
|
+ if (res) {
|
|
|
+ majorList.value = res.data
|
|
|
+
|
|
|
+ // 如果有专业ID,加载班级列表并回显
|
|
|
+ if (formData.value.majorId) {
|
|
|
+ resourceAuditApi
|
|
|
+ .gradeByZyAndOrgId({
|
|
|
+ collegeId: formData.value.collegeId,
|
|
|
+ majorId: formData.value.majorId
|
|
|
+ })
|
|
|
+ .then((gradeRes) => {
|
|
|
+ if (gradeRes) {
|
|
|
+ formData.value.gradesId = Number(formData.value.gradesId)
|
|
|
+ gradesList.value = gradeRes.data
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
})
|
|
|
}
|
|
|
|
|
|
@@ -433,7 +568,12 @@
|
|
|
sex: [required('请选择性别')],
|
|
|
orgId: [required('请选择组织')],
|
|
|
positionId: [required('请选择职位')],
|
|
|
- eduIdentity: [required('请选择教育身份')]
|
|
|
+ eduIdentity: [required('请选择教育身份')],
|
|
|
+ collegeId: [required('请选择所属院系')],
|
|
|
+ majorId: [required('请选择专业')],
|
|
|
+ gradesId: [required('请选择班级')],
|
|
|
+ studentNum: [required('请输入学号')],
|
|
|
+ fallDue: [required('请选择学届')]
|
|
|
}
|
|
|
// 机构选择后查询对应的职位
|
|
|
const selePositionData = (orgId, type) => {
|