退伍复学
This commit is contained in:
@@ -7,12 +7,15 @@
|
||||
<el-form-item label="学号" prop="stId" :rules="rules.reason1">
|
||||
<el-input v-model="form.stId" placeholder="请输入学号" @blur="changeGet" />
|
||||
</el-form-item>
|
||||
<!-- <el-form-item label="学生编号" prop="studentId" >
|
||||
<el-input v-model="form.studentId" placeholder="" disabled />
|
||||
</el-form-item> -->
|
||||
<el-form-item label="姓名" prop="stName" :rules="rules.reason2">
|
||||
<el-input v-model="form.stName" placeholder="请输入姓名" />
|
||||
</el-form-item>
|
||||
<el-form-item label="辅导员名字" prop="fdName" :rules="rules.reason3">
|
||||
<!-- <el-form-item label="辅导员名字" prop="fdName" :rules="rules.reason3">
|
||||
<el-input v-model="form.fdName" placeholder="请输入辅导员名字" />
|
||||
</el-form-item>
|
||||
</el-form-item> -->
|
||||
<el-form-item label="性别" prop="sex" :rules="rules.reason4">
|
||||
<el-select v-model="form.sex" placeholder="请选择性别">
|
||||
<el-option v-for="dict in dict.type.sys_user_sex" :key="dict.value" :label="dict.label"
|
||||
@@ -101,6 +104,11 @@
|
||||
import { listBasic, getBasic, delBasic, addBasic, updateBasic } from "@/api/routine/basic";
|
||||
import { listMate, getMate, delMate, addMate, updateMate } from "@/api/routine/mate";
|
||||
import { getStudentInfoByStuId } from '@/api/routine/stuIdReissue'
|
||||
import { getUserProfile } from '@/api/system/user' // 获取
|
||||
|
||||
// 获取学生信息
|
||||
import { addStudent, delStudent, doDept, getClassName, getStatus, getStudent, initOnePwd, initPwd, listStudent, updateStudent } from '@/api/stuCQS/basedata/student'
|
||||
import { log } from "vxe-table";
|
||||
|
||||
export default {
|
||||
name: "Basic",
|
||||
@@ -129,6 +137,7 @@ export default {
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
studentId:null,
|
||||
fxId: null,
|
||||
fxTime: null,
|
||||
stId: null,
|
||||
@@ -222,11 +231,28 @@ export default {
|
||||
};
|
||||
},
|
||||
created() {
|
||||
this.getList();
|
||||
// this.getList();
|
||||
this.getUser()
|
||||
this.showData()
|
||||
},
|
||||
methods: {
|
||||
|
||||
// 获取当前登录信息
|
||||
getUser() {
|
||||
this.loading = true
|
||||
getUserProfile().then(response => {
|
||||
// this.user = response.data;
|
||||
this.roleGroup = response.roleGroup
|
||||
// this.postGroup = response.postGroup;
|
||||
// console.log(response);
|
||||
console.log(response.data)
|
||||
this.form.studentId = response.data.userId
|
||||
// this.loading = false
|
||||
this.getList();
|
||||
})
|
||||
},
|
||||
|
||||
|
||||
// 修改数据
|
||||
showData() {
|
||||
if (this.$route.query.id != undefined) {
|
||||
@@ -239,24 +265,66 @@ export default {
|
||||
},
|
||||
|
||||
// 填写学号时自动获取其他信息
|
||||
changeGet() {
|
||||
this.form.stuId = this.form.stId ? this.form.stId : this.$route.query.stId
|
||||
getStudentInfoByStuId(this.form.stuId).then(response => {
|
||||
if (response.data == null) {
|
||||
this.$message.error('学号不存在')
|
||||
return
|
||||
}
|
||||
this.form = response.data
|
||||
console.log(this.form)
|
||||
this.form.stId = response.data.stuNo
|
||||
this.form.stName = response.data.studentName
|
||||
this.form.college = response.data.departmentName
|
||||
this.majors = response.data.className
|
||||
this.form.sex = response.data.gender
|
||||
this.form.grade = response.data.gradeName
|
||||
// changeGet() {
|
||||
// this.form.stuId = this.form.stId ? this.form.stId : this.$route.query.stId
|
||||
// getStudentInfoByStuId(this.form.stuId).then(response => {
|
||||
// if (response.data == null) {
|
||||
// this.$message.error('学号不存在')
|
||||
// return
|
||||
// }
|
||||
// this.form = response.data
|
||||
// console.log(this.form)
|
||||
// this.form.stId = response.data.stuNo
|
||||
// this.form.stName = response.data.studentName
|
||||
// this.form.college = response.data.departmentName
|
||||
// this.majors = response.data.className
|
||||
// this.form.sex = response.data.gender
|
||||
// this.form.grade = response.data.gradeName
|
||||
|
||||
})
|
||||
},
|
||||
// })
|
||||
// },
|
||||
// 填写学号时自动获取其他信息 + 同步赋值studentId
|
||||
changeGet() {
|
||||
// 1. 先确定stId(优先取form.stId,无则取路由参数)
|
||||
this.form.stuId = this.form.stId ? this.form.stId : this.$route.query.stId;
|
||||
|
||||
// 2. 并行请求:同时获取学生信息和登录用户信息(提升效率)
|
||||
Promise.all([
|
||||
// 请求1:根据stuId获取学生信息
|
||||
getStudentInfoByStuId(this.form.stuId),
|
||||
// 请求2:获取登录用户信息(用于赋值studentId)
|
||||
getUserProfile()
|
||||
]).then(([studentRes, userRes]) => {
|
||||
// 处理学生信息请求的结果
|
||||
if (studentRes.data == null) {
|
||||
this.$message.error('学号不存在');
|
||||
return;
|
||||
}
|
||||
// 赋值学生信息到form
|
||||
this.form = studentRes.data;
|
||||
this.form.stId = studentRes.data.stuNo;
|
||||
this.form.stName = studentRes.data.studentName;
|
||||
this.form.college = studentRes.data.departmentName;
|
||||
this.majors = studentRes.data.className;
|
||||
this.form.sex = studentRes.data.gender;
|
||||
this.form.grade = studentRes.data.gradeName;
|
||||
|
||||
listStudent({pageNum:1,pageSize:10,name:this.form.stName}).then(response => {
|
||||
this.form.studentId = response.rows[0].stuId
|
||||
// console.log(this.form.studentId)
|
||||
|
||||
})
|
||||
|
||||
// 处理登录用户信息请求的结果:赋值studentId
|
||||
// this.form.studentId = userRes.data.userId; // 核心:把userId赋值给studentId
|
||||
// console.log("学生信息+studentId已完成赋值:", this.form);
|
||||
|
||||
}).catch(err => {
|
||||
// 捕获请求异常
|
||||
console.error("请求失败:", err);
|
||||
this.$message.error('数据获取失败,请重试');
|
||||
});
|
||||
},
|
||||
|
||||
/** 查询退伍复学申请列表 */
|
||||
getList() {
|
||||
@@ -276,26 +344,52 @@ export default {
|
||||
// 表单重置
|
||||
reset() {
|
||||
this.form = {
|
||||
id: null,
|
||||
id: null,
|
||||
fxId: null,
|
||||
fxTime: null,
|
||||
stId: null,
|
||||
stName: null,
|
||||
fdName: null,
|
||||
sex: null,
|
||||
nations: null,
|
||||
fdQm: null,
|
||||
xwQm: null,
|
||||
erQm: null,
|
||||
xjQm: null,
|
||||
jwQm: null,
|
||||
stClass: null,
|
||||
majors: null,
|
||||
grade: null,
|
||||
college: null,
|
||||
reasons: null,
|
||||
fdIdea: null,
|
||||
twoIdea: null,
|
||||
xwIdea: null,
|
||||
xjIdea: null,
|
||||
jwIdea: null,
|
||||
zsIdea: null,
|
||||
zsStatus: null,
|
||||
times: null,
|
||||
fdStatus: null,
|
||||
xwStatus: null,
|
||||
twoStatus: null,
|
||||
xjglStatus: null,
|
||||
jwStatus: null,
|
||||
rwTime: null,
|
||||
zsTime: null,
|
||||
fdTime: null,
|
||||
xwTime: null,
|
||||
twoTime: null,
|
||||
xjTime: null,
|
||||
jwTime: null,
|
||||
datab: null,
|
||||
dataa: null,
|
||||
conversion: null,
|
||||
jwcStatus: null
|
||||
processId: null,
|
||||
deployId: null,
|
||||
studentId: null,
|
||||
testData: null,
|
||||
testTest: null
|
||||
};
|
||||
this.resetForm("form");
|
||||
},
|
||||
@@ -336,11 +430,25 @@ export default {
|
||||
this.$refs["form"].validate(valid => {
|
||||
if (valid) {
|
||||
if (this.form.id != null) {
|
||||
|
||||
// 重置状态
|
||||
this.form.zsStatus=0
|
||||
this.form.fdStatus=0
|
||||
this.form.xwStatus=0
|
||||
this.form.twoStatus=0
|
||||
this.form.Status=0
|
||||
this.form.jwStatus=0
|
||||
|
||||
this.form.fdIdea=""
|
||||
this.form.xwIdeaI=""
|
||||
this.form.twoIdea=""
|
||||
this.form.xjIdea=""
|
||||
this.form.jwIdea=""
|
||||
|
||||
updateBasic(this.form).then(response => {
|
||||
this.$modal.msgSuccess("修改成功");
|
||||
this.open = false;
|
||||
this.getList();
|
||||
// this.form.stId
|
||||
this.dataform = {
|
||||
id: null,
|
||||
stId: this.form.stId,
|
||||
@@ -362,6 +470,17 @@ export default {
|
||||
this.open = false;
|
||||
this.getList();
|
||||
});
|
||||
|
||||
|
||||
if (this.form.conversion == "N") {
|
||||
this.$router.push({
|
||||
path: '/routine/dis/appli',
|
||||
})
|
||||
} else {
|
||||
this.$router.push({
|
||||
path: '/routine/dis/disma',
|
||||
})
|
||||
}
|
||||
});
|
||||
} else {
|
||||
addBasic(this.form).then(response => {
|
||||
|
||||
Reference in New Issue
Block a user