Compare commits
23 Commits
2d5eec7c56
...
xgxt_Wz_pc
| Author | SHA1 | Date | |
|---|---|---|---|
| 1a417d9a0a | |||
| 3889a8a6c8 | |||
| b2d218b221 | |||
| 03782e3c9d | |||
| 442ff182c4 | |||
| 005e91e171 | |||
| 934df73c1c | |||
| da57348c01 | |||
| 348f389ad6 | |||
| 8652ddf7b3 | |||
| 9224b75cfe | |||
|
|
29dffb0c38 | ||
| de396a4a21 | |||
| 0db8e99992 | |||
| d81df84322 | |||
| 23f92883d5 | |||
| b91c8c6ce8 | |||
| 27aa6a1bd5 | |||
| f0301cd55b | |||
| 12be6d948e | |||
| 135967d1c4 | |||
| 0e8a042c57 | |||
| 900803125c |
@@ -58,3 +58,11 @@ export function delBasic(id) {
|
||||
method: 'post'
|
||||
})
|
||||
}
|
||||
|
||||
export function getOwnInfo(){
|
||||
return request({
|
||||
url:'/comprehensive/stuInfoView/getOwnInfo',
|
||||
method:'GET'
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
@@ -25,9 +25,10 @@ export function listStudent(query) {
|
||||
})
|
||||
}
|
||||
// 新同步学生信息
|
||||
export function syncStudentInfo() {
|
||||
export function synchronousStudent(query) {
|
||||
return request({
|
||||
url: '/syncdata/synchronousStudent',
|
||||
method: 'post'
|
||||
method: 'post',
|
||||
params:query
|
||||
})
|
||||
}
|
||||
|
||||
@@ -48,6 +48,11 @@
|
||||
@click="handleExport"
|
||||
>导出</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button v-hasPermi="['system:student:exportAllOwnStu']" type="warning" plain icon="el-icon-download" size="mini"
|
||||
@click="handleExportAll"
|
||||
>导出全部</el-button>
|
||||
</el-col>
|
||||
<right-toolbar :show-search.sync="showSearch" @queryTable="getList" />
|
||||
</el-row>
|
||||
<el-table v-loading="loading" :data="studentList" @selection-change="handleSelectionChange">
|
||||
@@ -767,6 +772,12 @@ export default {
|
||||
this.download('system/student/export', {
|
||||
...this.queryParams
|
||||
}, `student_${new Date().getTime()}.xlsx`)
|
||||
},
|
||||
/** 导出全部按钮操作 */
|
||||
handleExportAll() {
|
||||
this.download('system/student/exportAllOwnStu', {
|
||||
...this.queryParams
|
||||
}, `student_all_${new Date().getTime()}.xlsx`)
|
||||
},
|
||||
/** 下载模板操作 */
|
||||
importTemplate() {
|
||||
|
||||
@@ -538,7 +538,9 @@
|
||||
<el-descriptions-item span="4">
|
||||
<template slot="label"> 学务意见 </template>
|
||||
<div style="padding-top: 10px; line-height: 1.8;">
|
||||
{{ form.xwIdea || '暂无意见' }}
|
||||
<div v-if="form.xwStatus == '0' || form.xwStatus == null || form.xwStatus == '2'" >{{ form.xwIdea }}拟编入____</div>
|
||||
<!-- 同意 -->
|
||||
<div v-if="form.xwStatus == '1'">{{ form.xwIdea || '暂无意见' }},拟编入__{{finalGradeName}}_{{finalClassName}}__</div>
|
||||
<div class="signature-area right-align" style="padding: 10px 0 0 0;">
|
||||
<span>审批结果:</span>
|
||||
<el-select v-model="form.xwStatus" placeholder="待审核" class="short-select" disabled
|
||||
@@ -704,6 +706,10 @@ export default {
|
||||
props: {},
|
||||
data () {
|
||||
return {
|
||||
// 最终班级名称
|
||||
finalClassName: null,
|
||||
// 最终年级名称
|
||||
finalGradeName:null,
|
||||
// 模型xml数据
|
||||
flowData: {},
|
||||
activeName: '1',
|
||||
@@ -860,13 +866,46 @@ export default {
|
||||
this.form = res.data
|
||||
this.getClassNameList()
|
||||
this.listGrade()
|
||||
this.getXWClassNameList()
|
||||
});
|
||||
},
|
||||
|
||||
// 获取学务班级名称列表
|
||||
getXWClassNameList() {
|
||||
getClassName().then(res => {
|
||||
this.ClassNameList = res.data;
|
||||
if (this.ClassNameList != null) {
|
||||
this.ClassNameList.forEach(element => {
|
||||
if (element.value == this.form.maList[0].finaldata1) {
|
||||
element.children.forEach(elementTwo => {
|
||||
if (elementTwo.value == this.form.maList[0].finaldata2) {
|
||||
elementTwo.children.forEach(elementFree => {
|
||||
if (elementFree.value == this.form.maList[0].newmajor) {
|
||||
this.finalClassName = elementFree.label;
|
||||
this.classVlue1 = [element.value, elementTwo.value, elementFree.value];
|
||||
|
||||
// 关键修复:从年级列表中查找年级名称,而不是直接使用 element.label
|
||||
const gradeId = element.value;
|
||||
const gradeItem = this.grade_list.find(item => item.gradeId === gradeId);
|
||||
if (gradeItem) {
|
||||
this.finalGradeName = gradeItem.gradeName; // 正确的年级名称
|
||||
this.$set(this.form.maList[0], 'finallabel', gradeItem.gradeId); // 正确的年级ID
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
/** 获取班级名称列表 */
|
||||
getClassNameList() {
|
||||
getClassName().then(res => {
|
||||
this.ClassNameList = res.data
|
||||
// console.log(this.ClassNameList)
|
||||
console.log(this.ClassNameList)
|
||||
if (this.ClassNameList != null) {
|
||||
this.ClassNameList.forEach(element => {
|
||||
if (element.value == this.form.maList[0].data1) {
|
||||
@@ -874,10 +913,13 @@ export default {
|
||||
element.children.forEach(elementTwo => {
|
||||
if (elementTwo.value == this.form.maList[0].data2) {
|
||||
// console.log(elementTwo.label)
|
||||
elementTwo.children.forEach(elementFree => {
|
||||
this.saveClassName = elementFree.label
|
||||
// console.log(elementFree.label)
|
||||
});
|
||||
this.saveClassName =elementTwo.label
|
||||
// console.log("退伍复学",this.saveClassName)
|
||||
// 班级
|
||||
// elementTwo.children.forEach(elementFree => {
|
||||
// this.saveClassName = elementFree.label
|
||||
// // console.log(elementFree.label)
|
||||
// });
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -896,6 +938,9 @@ export default {
|
||||
if(element.gradeId == this.form.maList[0].newgrade){
|
||||
this.saveGradeName = element.gradeName
|
||||
}
|
||||
if (element.gradeId == this.form.maList[0].finallabel) {
|
||||
this.finalGradeName = element.gradeName
|
||||
}
|
||||
});
|
||||
}
|
||||
} catch (error) {
|
||||
|
||||
@@ -567,7 +567,42 @@
|
||||
<el-descriptions-item span="4">
|
||||
<template slot="label"> 学务意见 </template>
|
||||
<div style="padding-top: 10px; line-height: 1.8;">
|
||||
{{ form.xwIdea || '暂无意见' }}
|
||||
<!-- 不同意或者未审核 -->
|
||||
<div v-if="form.xwStatus == '0' || form.xwStatus == null || form.xwStatus == '2'" >{{ form.xwIdea }}拟编入____</div>
|
||||
<!-- 同意 -->
|
||||
<div v-if="form.xwStatus == '1'">{{ form.xwIdea || '暂无意见,' }},拟编入__{{finalGradeName}}_{{finalClassName}}__</div>
|
||||
<!-- <div >{{ form.xwIdea }}拟编入__{{finalGradeName}}_{{finalClassName}}_</div> -->
|
||||
<div id="xwinformation" v-if="category === '退伍复学' && taskName === '学务审核'">
|
||||
|
||||
<span style="color: red;"> ( 专业调整:)</span>
|
||||
<!-- 年级 -->
|
||||
<el-select
|
||||
v-model="form.maList[0].finallabel"
|
||||
filterable
|
||||
clearable
|
||||
placeholder="请选择年级"
|
||||
style="width: 100px; margin: 0 5px;"
|
||||
@change="handleGradeChange"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in grade_list"
|
||||
:key="item.gradeId"
|
||||
:label="item.gradeName"
|
||||
:value="item.gradeId"
|
||||
/>
|
||||
</el-select>
|
||||
<!-- 班级 -->
|
||||
|
||||
<el-cascader v-model="classVlue1" placeholder="请选择班级" :show-all-levels="false" :options="ClassNameList"
|
||||
clearable filterable style="width: 300px; margin: 0 5px;" @change="handleChange1">
|
||||
<template slot-scope="{ node, data }">
|
||||
<span>{{ data.label }}</span>
|
||||
<span v-if="!node.isLeaf"> ({{ data.children.length }}) </span>
|
||||
</template>
|
||||
</el-cascader>
|
||||
|
||||
|
||||
</div>
|
||||
<div class="signature-area right-align" style="padding: 10px 0 0 0;">
|
||||
<span>审批结果:</span>
|
||||
<el-select v-model="form.xwStatus" placeholder="待审核" class="short-select" disabled
|
||||
@@ -890,6 +925,8 @@
|
||||
<el-button type="primary" @click="taskReject">确 定</el-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
|
||||
|
||||
</el-card>
|
||||
</div>
|
||||
</template>
|
||||
@@ -935,6 +972,10 @@ export default {
|
||||
props: {},
|
||||
data() {
|
||||
return {
|
||||
// 年级列表
|
||||
grade_list: [],
|
||||
classVlue1: [],
|
||||
ClassNameList:[],
|
||||
// 模型xml数据
|
||||
xmlData: '',
|
||||
flowData: {},
|
||||
@@ -961,6 +1002,11 @@ export default {
|
||||
saveClassName: null,
|
||||
// 年级名称
|
||||
saveGradeName: null,
|
||||
// 最终班级名称
|
||||
finalClassName: null,
|
||||
// 最终年级名称
|
||||
finalGradeName:null,
|
||||
|
||||
rules: {
|
||||
penaltyNumber: [{ required: true, message: '请输入处分文号', trigger: 'blur' }],
|
||||
letterServiceContent: [{ required: true, message: '请输入送达书', trigger: 'blur' }],
|
||||
@@ -1116,6 +1162,8 @@ export default {
|
||||
} else if (this.category == '退伍复学') {
|
||||
this.basicForm = true
|
||||
this.getBasicApplication(this.startUser)
|
||||
this.listGrade();
|
||||
this.getXWClassNameList();
|
||||
}
|
||||
// 流程任务获取变量信息
|
||||
if (this.taskForm.taskId) {
|
||||
@@ -1127,6 +1175,53 @@ export default {
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
|
||||
handleChange1(value) {
|
||||
if (value && value.length === 3) {
|
||||
const [gradeId, majorId, classId] = value;
|
||||
// 1. 更新存储用的ID字段
|
||||
this.$set(this.form.maList[0], 'finaldata1', gradeId);
|
||||
this.$set(this.form.maList[0], 'finaldata2', majorId);
|
||||
this.$set(this.form.maList[0], 'newmajor', classId);
|
||||
this.$set(this.form.maList[0], 'finalmajor', classId);
|
||||
|
||||
// 2. 查找班级名称
|
||||
const gradeItem = this.ClassNameList.find(item => item.value === gradeId);
|
||||
if (gradeItem) {
|
||||
const majorItem = gradeItem.children.find(item => item.value === majorId);
|
||||
if (majorItem) {
|
||||
const classItem = majorItem.children.find(item => item.value === classId);
|
||||
if (classItem) {
|
||||
this.finalClassName = classItem.label;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 关键修复:从年级列表中查找年级名称,而不是直接使用 gradeItem.label
|
||||
const selectedGrade = this.grade_list.find(item => item.gradeId === gradeId);
|
||||
if (selectedGrade) {
|
||||
this.finalGradeName = selectedGrade.gradeName; // 正确的年级名称
|
||||
this.$set(this.form.maList[0], 'finallabel', selectedGrade.gradeId); // 正确的年级ID
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
handleGradeChange(value) {
|
||||
const selectedGrade = this.grade_list.find(item => item.gradeId === value);
|
||||
if (selectedGrade) {
|
||||
// 1. 更新存储用的年级ID
|
||||
this.$set(this.form.maList[0], 'finallabel', value);
|
||||
// 2. 同步更新显示用的年级名称(这里必须是 selectedGrade.gradeName)
|
||||
this.finalGradeName = selectedGrade.gradeName;
|
||||
// 3. 清空班级选择,避免年级和班级不匹配
|
||||
this.classVlue1 = [];
|
||||
this.finalClassName = null;
|
||||
this.$set(this.form.maList[0], 'finaldata1', '');
|
||||
this.$set(this.form.maList[0], 'finaldata2', '');
|
||||
this.$set(this.form.maList[0], 'newmajor', '');
|
||||
this.$set(this.form.maList[0], 'finalmajor', '');
|
||||
}
|
||||
},
|
||||
penaltyTypeMethodFormat(row, column) {
|
||||
return this.selectDictLabel(this.dict.type.rt_penalty_type, row.penaltyType)
|
||||
},
|
||||
@@ -1202,13 +1297,37 @@ export default {
|
||||
|
||||
// 退伍复学申请表单数据
|
||||
getBasicApplication(startUser) {
|
||||
// let newName = this.startUser.replace(/-/g, "");
|
||||
let newName = this.startUser.split('-')[0].trim();
|
||||
getStname(newName).then((res) => {
|
||||
// console.log("后端返回原始数据:",res.data);
|
||||
this.form = res.data
|
||||
this.getClassNameList()
|
||||
this.listGrade()
|
||||
console.log("后端返回原始数据:", res.data);
|
||||
// 深拷贝确保数据不被污染
|
||||
this.form = JSON.parse(JSON.stringify(res.data));
|
||||
|
||||
// 初始化maList,防止空指针
|
||||
if (!this.form.maList || this.form.maList.length === 0) {
|
||||
this.form.maList = [{
|
||||
finalmajor: '',
|
||||
finallabel: '',
|
||||
finaldata1: '',
|
||||
finaldata2: '',
|
||||
newmajor: '',
|
||||
finalClassName: '',
|
||||
finalGradeName: ''
|
||||
}];
|
||||
}
|
||||
|
||||
// 1. 初始化选择框绑定的核心字段(finalmajor)
|
||||
this.$set(this.form.maList[0], 'finalmajor', this.form.maList[0].finallabel || '');
|
||||
|
||||
// 确保数据加载完成后再渲染下拉列表
|
||||
this.$nextTick(() => {
|
||||
this.getClassNameList();
|
||||
this.listGrade();
|
||||
this.getXWClassNameList();
|
||||
});
|
||||
}).catch(error => {
|
||||
console.error("获取退伍复学数据失败:", error);
|
||||
this.$modal.msgError("获取学生信息失败,请刷新页面重试");
|
||||
});
|
||||
},
|
||||
/** 获取班级名称列表 */
|
||||
@@ -1223,9 +1342,40 @@ export default {
|
||||
element.children.forEach(elementTwo => {
|
||||
if (elementTwo.value == this.form.maList[0].data2) {
|
||||
// console.log(elementTwo.label)
|
||||
this.saveClassName =elementTwo.label
|
||||
// elementTwo.children.forEach(elementFree => {
|
||||
// this.finalClassName = elementFree.label
|
||||
// // console.log(elementFree.label)
|
||||
// });
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
getXWClassNameList() {
|
||||
getClassName().then(res => {
|
||||
this.ClassNameList = res.data;
|
||||
if (this.ClassNameList != null) {
|
||||
this.ClassNameList.forEach(element => {
|
||||
if (element.value == this.form.maList[0].finaldata1) {
|
||||
element.children.forEach(elementTwo => {
|
||||
if (elementTwo.value == this.form.maList[0].finaldata2) {
|
||||
elementTwo.children.forEach(elementFree => {
|
||||
this.saveClassName = elementFree.label
|
||||
// console.log(elementFree.label)
|
||||
if (elementFree.value == this.form.maList[0].newmajor) {
|
||||
this.finalClassName = elementFree.label;
|
||||
this.classVlue1 = [element.value, elementTwo.value, elementFree.value];
|
||||
|
||||
// 关键修复:从年级列表中查找年级名称,而不是直接使用 element.label
|
||||
const gradeId = element.value;
|
||||
const gradeItem = this.grade_list.find(item => item.gradeId === gradeId);
|
||||
if (gradeItem) {
|
||||
this.finalGradeName = gradeItem.gradeName; // 正确的年级名称
|
||||
this.$set(this.form.maList[0], 'finallabel', gradeItem.gradeId); // 正确的年级ID
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
@@ -1234,21 +1384,27 @@ export default {
|
||||
}
|
||||
})
|
||||
},
|
||||
/** 获取年级列表 */
|
||||
|
||||
|
||||
async listGrade() {
|
||||
try {
|
||||
let res = await listGrade()
|
||||
let res = await listGrade(); // 调用后端接口获取年级列表
|
||||
if (res.code == 200) {
|
||||
this.grade_list = [...res.rows]
|
||||
console.log(this.grade_list)
|
||||
this.grade_list = [...res.rows];
|
||||
// 打印日志,检查返回的数据结构
|
||||
console.log("年级列表:", this.grade_list);
|
||||
console.log("this.form.maList[0]",this.form.maList[0])
|
||||
this.grade_list.forEach(element => {
|
||||
if (element.gradeId == this.form.maList[0].newgrade) {
|
||||
this.saveGradeName = element.gradeName
|
||||
this.saveGradeName = element.gradeName;
|
||||
}
|
||||
if (element.gradeId == this.form.maList[0].finallabel) {
|
||||
this.finalGradeName = element.gradeName;
|
||||
}
|
||||
});
|
||||
}
|
||||
} catch (error) {
|
||||
console.error('获取年级列表失败:', error)
|
||||
console.error('获取年级列表失败:', error);
|
||||
}
|
||||
},
|
||||
|
||||
@@ -1428,8 +1584,8 @@ export default {
|
||||
this.form.remark = this.taskForm.remark
|
||||
this.updateRtStuQuitSchool()
|
||||
} else if (this.category == 'enlistmentReserve') { // 是应征入伍保留学籍申请,才执行
|
||||
if (this.taskName == '教务处主管领导审批') { // (最后一个领导审核完成之后,修改学生学籍状态, status:07是入伍保留学籍)
|
||||
updateStudent({ stuId: this.form.studentId, status: '07' }).then(response => { })
|
||||
if (this.taskName == '教务处主管领导审批') { // (最后一个领导审核完成之后,修改学生学籍状态, status:30是入伍保留学籍)
|
||||
updateStudent({ stuId: this.form.studentId, status: '30' }).then(response => { })
|
||||
}
|
||||
this.$modal.msgSuccess(response.msg)
|
||||
} else if (this.category == "退伍复学") {
|
||||
@@ -1484,16 +1640,65 @@ export default {
|
||||
else if (this.taskName == "学务审核") {
|
||||
const currentFlowItem = this.flowRecordList.find(item => item.taskName === this.taskName);
|
||||
const assigneeName = currentFlowItem ? currentFlowItem.assigneeName : "";
|
||||
updateBasic({
|
||||
// updateBasic({
|
||||
// id: stNameData.id,
|
||||
// xwStatus: "1",
|
||||
// xwIdea: this.taskForm.comment,
|
||||
// xwTime: new Date(),
|
||||
// xwQm: assigneeName
|
||||
// }).then(response => {
|
||||
// this.$modal.msgSuccess(response.msg)
|
||||
// })
|
||||
// // 构建要提交的参数
|
||||
// const updateParams = {
|
||||
// id: stNameData.id,
|
||||
// xwStatus: "1",
|
||||
// xwIdea: this.taskForm.comment,
|
||||
// xwTime: new Date(),
|
||||
// xwQm: assigneeName,
|
||||
// finalGradeId: this.form.maList[0].finalmajor,
|
||||
// // 其他你需要更新的字段...
|
||||
// 'maList[0].finallabel': this.form.maList[0].finalmajor,
|
||||
// 'maList[0].finaldata1': this.form.maList[0].finaldata1,
|
||||
// 'maList[0].finaldata2': this.form.maList[0].finaldata2,
|
||||
// 'maList[0].newmajor': this.form.maList[0].newmajor,
|
||||
// 'maList[0].finalGradeName': this.finalGradeName,
|
||||
// 'maList[0].finalClassName': this.finalClassName
|
||||
// };
|
||||
|
||||
// // 【关键】打印要提交的参数
|
||||
// console.log("updateBasic 提交的参数:", updateParams);
|
||||
|
||||
// // 调用更新接口
|
||||
// updateBasic(updateParams).then(response => {
|
||||
// this.$modal.msgSuccess(response.msg);
|
||||
// });
|
||||
// 1. 从 maList[0] 中提取需要更新的子表数据
|
||||
const maList0 = this.form.maList[0] || {};
|
||||
|
||||
// 2. 构建主表更新参数
|
||||
const updateParams = {
|
||||
id: stNameData.id,
|
||||
xwStatus: "1",
|
||||
xwIdea: this.taskForm.comment,
|
||||
xwTime: new Date(),
|
||||
xwQm: assigneeName
|
||||
}).then(response => {
|
||||
this.$modal.msgSuccess(response.msg)
|
||||
})
|
||||
xwQm: assigneeName,
|
||||
finalGradeId: this.form.maList[0].finallabel,
|
||||
// 3. 关键:将子表数据包装到 maList 数组中
|
||||
maList: [
|
||||
{
|
||||
...maList0, // 包含 finaldata1, finaldata2, finallabel, newmajor 等
|
||||
basicId: stNameData.id // 确保子表记录关联到正确的主表ID
|
||||
}
|
||||
]
|
||||
};
|
||||
|
||||
console.log("提交给后端的参数:", updateParams);
|
||||
|
||||
// 调用更新接口
|
||||
updateBasic(updateParams).then(response => {
|
||||
this.$modal.msgSuccess(response.msg);
|
||||
});
|
||||
}
|
||||
|
||||
// 二级学院审核
|
||||
@@ -1532,26 +1737,125 @@ export default {
|
||||
else if (this.taskName == "教务处主管") {
|
||||
const currentFlowItem = this.flowRecordList.find(item => item.taskName === this.taskName);
|
||||
const assigneeName = currentFlowItem ? currentFlowItem.assigneeName : "";
|
||||
updateBasic({
|
||||
// updateBasic({
|
||||
// id: stNameData.id,
|
||||
// jwStatus: "1",
|
||||
// jwIdea: this.taskForm.comment,
|
||||
// jwTime: new Date(),
|
||||
// jwQm: assigneeName
|
||||
// }).then(response => {
|
||||
// console.log("===== updateBasic 响应结果 =====", response);
|
||||
// this.$modal.msgSuccess(response.msg)
|
||||
|
||||
// // 2. 打印updateStudent的前置条件
|
||||
// console.log("===== updateStudent 执行前置检查 =====");
|
||||
// console.log("是否转专业(conversion):", stNameData.conversion);
|
||||
// console.log("学生ID(studentId):", stNameData.studentId);
|
||||
// console.log("finaldata1(院部ID):", stNameData.maList ? stNameData.maList[0].finaldata1 : "无");
|
||||
// console.log("finaldata2(专业ID):", stNameData.maList ? stNameData.maList[0].finaldata2 : "无");
|
||||
// console.log("finalmajor(班级ID):", stNameData.maList ? stNameData.maList[0].finalmajor : "无");
|
||||
// })
|
||||
// if (stNameData.conversion == "Y") {
|
||||
// const maList0 = this.form.maList ? this.form.maList[0] : {};
|
||||
// updateStudent({
|
||||
// stuId: stNameData.studentId,
|
||||
// deptId: parseInt(maList0.finaldata1),
|
||||
// majorId: parseInt(maList0.finaldata2),
|
||||
// classId: parseInt(maList0.finalmajor),
|
||||
// status: '31',
|
||||
// // updateStudent({
|
||||
// // stuId: stNameData.studentId,
|
||||
// // deptId: parseInt(stNameData.maList[0].finaldata1),
|
||||
// // majorId: parseInt(stNameData.maList[0].finaldata2),
|
||||
// // classId: parseInt(stNameData.maList[0].finalmajor),
|
||||
// // status: '31',
|
||||
// }).then(response => {
|
||||
// console.log("updateStudent",response)
|
||||
// })
|
||||
// } else {
|
||||
// updateStudent({ stuId: stNameData.studentId, status: '31', }).then(response => { })
|
||||
// }
|
||||
|
||||
// 先更新退伍复学主表
|
||||
const updateBasicParams = {
|
||||
id: stNameData.id,
|
||||
jwStatus: "1",
|
||||
jwIdea: this.taskForm.comment,
|
||||
jwTime: new Date(),
|
||||
jwQm: assigneeName
|
||||
}).then(response => {
|
||||
this.$modal.msgSuccess(response.msg)
|
||||
})
|
||||
if (stNameData.conversion == "Y") {
|
||||
jwQm: assigneeName,
|
||||
stId: stNameData.stId, // 补充stId,解决日志中stId为空的问题
|
||||
processId: this.taskForm.procInsId
|
||||
};
|
||||
|
||||
console.log("更新教务处主管审批参数:", updateBasicParams);
|
||||
|
||||
updateBasic(updateBasicParams).then(response => {
|
||||
console.log("===== updateBasic 响应结果 =====", response);
|
||||
this.$modal.msgSuccess(response.msg);
|
||||
|
||||
// 2. 打印updateStudent的前置条件
|
||||
console.log("===== updateStudent 执行前置检查 =====");
|
||||
console.log("是否转专业(conversion):", stNameData.conversion);
|
||||
console.log("学生ID(studentId):", stNameData.studentId);
|
||||
console.log("stId:", stNameData.stId);
|
||||
console.log("finaldata1(院部ID):", stNameData.maList ? stNameData.maList[0].finaldata1 : "无");
|
||||
console.log("finaldata2(专业ID):", stNameData.maList ? stNameData.maList[0].finaldata2 : "无");
|
||||
console.log("finalmajor(班级ID):", stNameData.maList ? stNameData.maList[0].finalmajor : "无");
|
||||
|
||||
// 修复转专业判断和参数类型问题
|
||||
if (stNameData.conversion == "Y" && stNameData.maList && stNameData.maList.length > 0) {
|
||||
const maList0 = stNameData.maList[0];
|
||||
// 确保参数是数字类型,且有值
|
||||
const deptId = maList0.finaldata1 ? parseInt(maList0.finaldata1) : null;
|
||||
const majorId = maList0.finaldata2 ? parseInt(maList0.finaldata2) : null;
|
||||
const classId = maList0.finalmajor ? parseInt(maList0.finalmajor) : null;
|
||||
const stuId = stNameData.studentId || stNameData.stId;
|
||||
|
||||
// 只有所有必要参数都存在时才更新
|
||||
if (stuId && deptId && majorId && classId) {
|
||||
updateStudent({
|
||||
stuId: stNameData.studentId,
|
||||
deptId: parseInt(stNameData.maList[0].data1),
|
||||
majorId: parseInt(stNameData.maList[0].data2),
|
||||
classId: parseInt(stNameData.maList[0].newmajor),
|
||||
status: '08',
|
||||
}).then(response => { })
|
||||
stuId: stuId,
|
||||
deptId: deptId,
|
||||
majorId: majorId,
|
||||
classId: classId,
|
||||
status: '31',
|
||||
}).then(response => {
|
||||
console.log("updateStudent 响应:", response);
|
||||
// 更新成功后重新获取学生信息,确保前端数据最新
|
||||
this.getBasicApplication(this.startUser);
|
||||
}).catch(error => {
|
||||
console.error("updateStudent 失败:", error);
|
||||
this.$modal.msgError("更新学生信息失败:" + error.message);
|
||||
});
|
||||
} else {
|
||||
updateStudent({ stuId: stNameData.studentId, status: '08', }).then(response => { })
|
||||
console.error("转专业参数不完整:", {
|
||||
stuId, deptId, majorId, classId
|
||||
});
|
||||
this.$modal.msgWarning("转专业参数不完整,无法更新学生信息");
|
||||
}
|
||||
} else {
|
||||
// 不转专业,只更新状态
|
||||
const stuId = stNameData.studentId || stNameData.stId;
|
||||
if (stuId) {
|
||||
updateStudent({
|
||||
stuId: stuId,
|
||||
status: '31'
|
||||
}).then(response => {
|
||||
console.log("updateStudent 响应:", response);
|
||||
// 更新成功后重新获取学生信息
|
||||
this.getBasicApplication(this.startUser);
|
||||
}).catch(error => {
|
||||
console.error("updateStudent 失败:", error);
|
||||
});
|
||||
} else {
|
||||
console.error("学生ID为空,无法更新状态");
|
||||
this.$modal.msgError("学生ID为空,无法更新状态");
|
||||
}
|
||||
}
|
||||
}).catch(error => {
|
||||
console.error("updateBasic 失败:", error);
|
||||
this.$modal.msgError("审批更新失败:" + error.message);
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -6,8 +6,27 @@
|
||||
<Index3 v-else-if="showRole == 3" />
|
||||
<Index4 v-else-if="showRole == 4" />
|
||||
<Index1 v-else/> -->
|
||||
|
||||
<!-- 学生信息确认弹窗 -->
|
||||
<el-dialog
|
||||
title="学生信息确认"
|
||||
:visible.sync="infoConfirmDialogVisible"
|
||||
width="500px"
|
||||
:close-on-click-modal="false"
|
||||
:close-on-press-escape="false"
|
||||
:show-close="false"
|
||||
>
|
||||
<div style="text-align: center;">
|
||||
<p>为了确保您的信息准确无误,请确认并完善个人信息。</p>
|
||||
<p>点击下方按钮前往信息修改页面进行确认。</p>
|
||||
</div>
|
||||
<div slot="footer" class="dialog-footer" style="text-align: center;">
|
||||
<el-button type="primary" @click="goToEditInfo">去确认信息</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
|
||||
import Index1 from '@/views/Home/index-1.vue'
|
||||
@@ -16,6 +35,8 @@ import Index3 from '@/views/Home/index-3.vue'
|
||||
import Index4 from '@/views/Home/index-4.vue'
|
||||
|
||||
import indexNew from './Home/index-new-blue.vue'
|
||||
import {getConfigKey} from '@/api/system/config'
|
||||
import research from '@/views/teacher/basicmessage/research/index.vue';
|
||||
|
||||
export default {
|
||||
name: 'Index',
|
||||
@@ -29,7 +50,7 @@ export default {
|
||||
data() {
|
||||
return {
|
||||
showRole: 0,
|
||||
|
||||
infoConfirmDialogVisible: false // 控制信息确认弹窗显示
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
@@ -37,7 +58,6 @@ export default {
|
||||
},
|
||||
created() {
|
||||
let temp = this.$store.getters.roles
|
||||
let role = 0
|
||||
temp.map(x => {
|
||||
if (x == 'admin') {
|
||||
this.showRole = 1
|
||||
@@ -60,9 +80,39 @@ export default {
|
||||
}
|
||||
})
|
||||
|
||||
// 如果是学生角色,检查是否需要显示信息确认弹窗
|
||||
if (this.showRole === 4) {
|
||||
this.checkShowInfoConfirmDialog()
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
// 检查是否显示信息确认弹窗
|
||||
async checkShowInfoConfirmDialog() {
|
||||
try {
|
||||
// 调用API获取系统参数:sys.stu.ConfirmDialogVisible
|
||||
const res = await getConfigKey('sys.stu.ConfirmDialogVisible');
|
||||
const paramValue = res.msg
|
||||
|
||||
// 如果参数值为 true,则显示弹窗
|
||||
if (paramValue === 'true') {
|
||||
this.infoConfirmDialogVisible = true
|
||||
}
|
||||
} catch (error) {
|
||||
console.error('获取系统参数失败:', error)
|
||||
// 默认开启弹窗(容错处理)
|
||||
this.infoConfirmDialogVisible = true
|
||||
}
|
||||
},
|
||||
|
||||
// 跳转到信息修改页面
|
||||
goToEditInfo() {
|
||||
// 关闭弹窗
|
||||
this.infoConfirmDialogVisible = false
|
||||
// 设置已确认标记,避免下次重复弹出
|
||||
// localStorage.setItem('studentInfoConfirmed', 'true')
|
||||
// 跳转到信息修改页面
|
||||
this.$router.push('/basedata/stuOwnInfo/edit')
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
@@ -5,7 +5,8 @@
|
||||
<el-card class="box-card1">
|
||||
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
|
||||
<el-form-item label="学号" prop="stId" :rules="rules.reason1">
|
||||
<el-input v-model="form.stId" placeholder="请输入学号" @blur="changeGet" />
|
||||
<el-input v-model="form.stId" placeholder="请输入学号" />
|
||||
<!-- <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 />
|
||||
@@ -72,9 +73,6 @@
|
||||
<el-input v-model="form.datab" placeholder="请输入手机号" />
|
||||
</el-form-item>
|
||||
|
||||
|
||||
|
||||
|
||||
<el-form-item label="专业转换" prop="conversion" :rules="rules.reason12">
|
||||
<el-select v-model="form.conversion" placeholder="请选择专业转换">
|
||||
<el-option v-for="dict in dict.type.sys_yes_no" :key="dict.value" :label="dict.label"
|
||||
@@ -89,6 +87,69 @@
|
||||
</div> -->
|
||||
</el-card>
|
||||
|
||||
<!-- 材料上传 -->
|
||||
<el-card class="box-card1" v-if="form.conversion === 'N'">
|
||||
<el-form ref="form2" :model="form" :rules="rules2" label-width="80px">
|
||||
<el-form-item label="退役证明" prop="proof">
|
||||
<image-upload v-model="form.proof" />
|
||||
</el-form-item>
|
||||
<el-form-item label="身份证" prop="idcard">
|
||||
<image-upload v-model="form.idcard" />
|
||||
</el-form-item>
|
||||
<el-form-item label="材料" prop="material">
|
||||
<image-upload v-model="form.material" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</el-card>
|
||||
|
||||
<!-- 转专业材料上传 -->
|
||||
<el-card class="box-card1" v-if="form.conversion === 'Y'">
|
||||
<el-form ref="form2" :model="form" :rules="rules2" label-width="80px">
|
||||
<el-form-item label="原年级" prop="oldgrade" :rules="rules2.reason3">
|
||||
<el-input v-model="form.oldgrade" placeholder="请输入原年级" disabled />
|
||||
</el-form-item>
|
||||
<el-form-item label="原专业" prop="oldmajor" :rules="rules2.reason4">
|
||||
<el-input v-model="form.oldmajor" placeholder="请输入原专业" disabled />
|
||||
</el-form-item>
|
||||
<el-form-item label="新年级" prop="newgrade" :rules="rules2.reason5">
|
||||
<el-select v-model="form.newgrade" filterable clearable placeholder="请选择年级" style="width: 100%"
|
||||
:key="`grade-${form.newgrade}`"> <!-- 新增key强制刷新 -->
|
||||
<el-option v-for="item in grade_list" :key="item.gradeId" :label="item.gradeName" :value="item.gradeId" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<!-- <el-form-item label="新班级" prop="newmajor" :rules="rules2.reason6">
|
||||
<el-cascader v-model="classVlue1" placeholder="请选择班级" :show-all-levels="false" :options="ClassNameList"
|
||||
clearable filterable style="width: 100%" @change="handleChange1">
|
||||
<template slot-scope="{ node, data }">
|
||||
<span>{{ data.label }}</span>
|
||||
<span v-if="!node.isLeaf"> ({{ data.children.length }}) </span>
|
||||
</template>
|
||||
</el-cascader>
|
||||
</el-form-item> -->
|
||||
<el-form-item label="新专业" prop="newmajor" :rules="rules2.reason6">
|
||||
<!-- 1. 必须绑定 form.classVlue1;2. 加 key 强制刷新;3. 明确 props 匹配字段 -->
|
||||
<el-cascader v-model="form.classVlue1" placeholder="请选择班级" :show-all-levels="false" :options="ClassNameList"
|
||||
clearable filterable style="width: 100%" @change="handleChange1"
|
||||
:key="`cascader-${form.classVlue1 ? form.classVlue1.join('-') : 'empty'}`"
|
||||
:props="{ value: 'value', label: 'label', children: 'children' }">
|
||||
<template slot-scope="{ node, data }">
|
||||
<span>{{ data.label }}</span>
|
||||
<span v-if="!node.isLeaf"> ({{ data.children.length }}) </span>
|
||||
</template>
|
||||
</el-cascader>
|
||||
</el-form-item>
|
||||
<el-form-item label="退役证明" prop="proof">
|
||||
<image-upload v-model="form.proof" />
|
||||
</el-form-item>
|
||||
<el-form-item label="身份证" prop="idcard">
|
||||
<image-upload v-model="form.idcard" />
|
||||
</el-form-item>
|
||||
<el-form-item label="材料" prop="material">
|
||||
<image-upload v-model="form.material" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</el-card>
|
||||
|
||||
</div>
|
||||
|
||||
<div slot="footer" class="stylecard">
|
||||
@@ -101,11 +162,13 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { listBasic, getBasic, delBasic, addBasic, updateBasic } from "@/api/routine/basic";
|
||||
import { getOwnInfo, 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 { listGrade } from '@/api/stuCQS/basedata/grade'
|
||||
|
||||
// 获取学生信息
|
||||
import { addStudent, delStudent, doDept, getClassName, getStatus, getStudent, initOnePwd, initPwd, listStudent, updateStudent } from '@/api/stuCQS/basedata/student'
|
||||
import { log } from "vxe-table";
|
||||
@@ -115,6 +178,13 @@ export default {
|
||||
dicts: ['sys_yes_no', 'sys_user_sex', 'rt_filling_college', 'sys_commit_status', 'sys_teacher_kpi_filling_year', 'rt_nation', 'rt_classes'],
|
||||
data() {
|
||||
return {
|
||||
// 年级列表
|
||||
grade_list: [],
|
||||
// 班级搜索选择
|
||||
classVlue1: [],
|
||||
// 班级名称列表
|
||||
ClassNameList: [],
|
||||
|
||||
// 遮罩层
|
||||
loading: true,
|
||||
// 选中数组
|
||||
@@ -183,7 +253,67 @@ export default {
|
||||
},
|
||||
|
||||
// 表单参数
|
||||
form: {},
|
||||
form: {
|
||||
// 新增:自动填充所需的核心属性(与接口返回字段对应)
|
||||
studentId: '',
|
||||
stId: '',
|
||||
stName: '',
|
||||
sex: '',
|
||||
stClass: '',
|
||||
majors: '',
|
||||
grade: '',
|
||||
college: '',
|
||||
datab: '',
|
||||
// 保留你原有重置方法中定义的所有字段(防止重置失效)
|
||||
id: null,
|
||||
fxId: null,
|
||||
fxTime: null,
|
||||
fdName: null,
|
||||
nations: null,
|
||||
fdQm: null,
|
||||
xwQm: null,
|
||||
erQm: null,
|
||||
xjQm: null,
|
||||
jwQm: 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,
|
||||
dataa: null,
|
||||
conversion: null,
|
||||
processId: null,
|
||||
deployId: null,
|
||||
testData: null,
|
||||
testTest: null,
|
||||
|
||||
// mate
|
||||
oldgrade: '',
|
||||
oldmajor: '',
|
||||
newgrade: '',
|
||||
newmajor: '',
|
||||
proof: '',
|
||||
idcard: '',
|
||||
material: '',
|
||||
data1: '',
|
||||
data2: ''
|
||||
},
|
||||
// 表单校验
|
||||
rules: {
|
||||
reason1: [
|
||||
@@ -226,63 +356,242 @@ export default {
|
||||
{ required: true, message: '请输入联系电话', trigger: 'blur' },
|
||||
{ pattern: /^1[3-9]\d{9}$/, message: '请输入有效的手机号码', trigger: 'blur' }
|
||||
],
|
||||
}
|
||||
},
|
||||
|
||||
// mate
|
||||
rules2: {
|
||||
reason3: [
|
||||
{ required: true, message: '输入原年级', trigger: 'blur' },
|
||||
],
|
||||
reason4: [
|
||||
{ required: true, message: '输入原专业', trigger: 'blur' },
|
||||
],
|
||||
reason5: [
|
||||
{ required: true, message: '输入新年级', trigger: 'blur' },
|
||||
],
|
||||
reason6: [
|
||||
{ required: true, message: '输入新专业', trigger: 'blur' },
|
||||
],
|
||||
},
|
||||
|
||||
|
||||
};
|
||||
},
|
||||
|
||||
created() {
|
||||
// this.getList();
|
||||
this.getUser()
|
||||
this.showData()
|
||||
// 新增:加载年级和班级列表
|
||||
this.listGrade()
|
||||
this.getClassNameList()
|
||||
// 移除:showData 交由 getUser 内部在数据填充后执行,避免异步冲突
|
||||
// this.showData()
|
||||
},
|
||||
methods: {
|
||||
|
||||
// 获取当前登录信息
|
||||
// mate
|
||||
/** 搜索班级选择 */
|
||||
handleChange1(value) {
|
||||
console.log("级联选择值:", value);
|
||||
if (value && value.length === 3) { // 必须是三级数组
|
||||
this.form.classVlue1 = value; // 核心:同步到 form
|
||||
this.form.data1 = value[0]; // 学院ID
|
||||
this.form.data2 = value[1]; // 年级ID
|
||||
this.form.newmajor = value[2]; // 班级ID
|
||||
} else {
|
||||
this.form.classVlue1 = [];
|
||||
this.form.data1 = "";
|
||||
this.form.data2 = "";
|
||||
this.form.newmajor = "";
|
||||
}
|
||||
},
|
||||
|
||||
/** 获取当前登录信息 */
|
||||
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.roleGroup = response.roleGroup
|
||||
// console.log("response.data",response.data)
|
||||
// this.form.studentId = response.data.userId
|
||||
getOwnInfo().then(res => {
|
||||
if (res.data) {
|
||||
// console.log("信息接口", res.data.stuId)
|
||||
// this.form.studentId = res.data.stuId
|
||||
this.form.stId = res.data.stuNo
|
||||
this.form.stName = res.data.stuName
|
||||
this.form.sex = res.data.gender
|
||||
this.form.majors = res.data.majorName
|
||||
this.form.stClass = res.data.className
|
||||
this.form.grade = res.data.gradeName
|
||||
this.form.datab = res.data.stuPhone
|
||||
this.form.college = res.data.deptName
|
||||
|
||||
// 新增:自动填充原年级和原专业
|
||||
this.form.oldgrade = this.form.grade
|
||||
this.form.oldmajor = this.form.majors
|
||||
|
||||
listStudent({ pageNum: 1, pageSize: 10, name: this.form.stName }).then(response => {
|
||||
this.form.studentId = response.rows[0].stuId
|
||||
console.log("获取到的学号",response.rows[0].stuId)
|
||||
})
|
||||
|
||||
// 新增1:强制触发Vue视图更新(解决响应式延迟)
|
||||
this.$forceUpdate()
|
||||
// 新增2:数据填充完成后,再执行 showData(兼容编辑场景)
|
||||
this.showData()
|
||||
}
|
||||
}).finally(() => {
|
||||
// 新增3:请求完成后重置loading
|
||||
this.loading = false
|
||||
})
|
||||
this.getList();
|
||||
})
|
||||
},
|
||||
|
||||
|
||||
// 修改数据
|
||||
// 修改数据(终极强制回显版本)
|
||||
showData() {
|
||||
if (this.$route.query.id != undefined) {
|
||||
console.log(this.$route.query.id)
|
||||
getBasic(this.$route.query.id).then((response) => {
|
||||
this.form = response.data
|
||||
// this.active = response.data.status + 1;
|
||||
})
|
||||
console.log("===== 编辑回显开始 =====", this.$route.query.id);
|
||||
getBasic(this.$route.query.id).then(async (basicRes) => {
|
||||
// 1. 合并主表数据(用 $set 保证响应式)
|
||||
this.$set(this, "form", { ...this.form, ...basicRes.data });
|
||||
|
||||
// 2. 获取 mate 表(转专业数据)
|
||||
const mateData = await this.getMateData(basicRes.data.stId);
|
||||
console.log("mate 表数据:", mateData);
|
||||
|
||||
if (mateData) {
|
||||
// 3. 统一所有 ID 为字符串(级联必须严格匹配类型)
|
||||
const newgradeStr = mateData.newgrade ? String(mateData.newgrade) : "";
|
||||
const data1Str = mateData.data1 ? String(mateData.data1) : ""; // 学院ID
|
||||
const data2Str = mateData.data2 ? String(mateData.data2) : ""; // 年级ID
|
||||
const newmajorStr = mateData.newmajor ? String(mateData.newmajor) : ""; // 班级ID
|
||||
|
||||
// 4. 等待年级、班级列表完全加载(必须等)
|
||||
await this.waitForListsLoaded();
|
||||
console.log("年级列表:", this.grade_list);
|
||||
console.log("班级级联列表:", this.ClassNameList);
|
||||
|
||||
// --- 新年级回显(已正常,保留)---
|
||||
const gradeItem = this.grade_list.find(item => String(item.gradeId) === newgradeStr);
|
||||
if (gradeItem) {
|
||||
this.$set(this.form, "newgrade", gradeItem.gradeId);
|
||||
console.log("新年级匹配成功:", gradeItem.gradeName);
|
||||
} else {
|
||||
console.warn("新年级未匹配:", newgradeStr);
|
||||
}
|
||||
|
||||
// --- 新班级(级联)回显(核心修复)---
|
||||
if (data1Str && data2Str && newmajorStr) {
|
||||
// 构造三级回显数组(必须是 [学院ID, 年级ID, 班级ID])
|
||||
const cascadeValue = [data1Str, data2Str, newmajorStr];
|
||||
console.log("级联回显值:", cascadeValue);
|
||||
|
||||
// 验证:检查级联列表中是否存在该路径(关键排查)
|
||||
const hasPath = this.checkCascaderPath(this.ClassNameList, cascadeValue);
|
||||
if (hasPath) {
|
||||
// 用 $set 赋值,保证响应式
|
||||
this.$set(this.form, "classVlue1", cascadeValue);
|
||||
console.log("级联回显成功!");
|
||||
} else {
|
||||
console.error("级联路径不存在:", cascadeValue, "→ 检查班级列表结构与 value 类型");
|
||||
}
|
||||
}
|
||||
|
||||
// 5. 回显其他字段
|
||||
this.$set(this.form, "oldgrade", mateData.oldgrade || basicRes.data.grade);
|
||||
this.$set(this.form, "oldmajor", mateData.oldmajor || basicRes.data.majors);
|
||||
this.$set(this.form, "proof", mateData.proof || "");
|
||||
this.$set(this.form, "idcard", mateData.idcard || "");
|
||||
this.$set(this.form, "material", mateData.material || "");
|
||||
|
||||
// 6. 强制刷新视图
|
||||
this.$forceUpdate();
|
||||
console.log("===== 编辑回显完成 =====");
|
||||
}
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
// 填写学号时自动获取其他信息
|
||||
// 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
|
||||
// 新增:辅助方法 → 检查级联路径是否存在(排查用)
|
||||
checkCascaderPath(options, path) {
|
||||
let tempOptions = options;
|
||||
for (let i = 0; i < path.length; i++) {
|
||||
const target = tempOptions.find(item => String(item.value) === String(path[i]));
|
||||
if (!target) return false;
|
||||
if (i < path.length - 1 && !target.children) return false;
|
||||
tempOptions = target.children;
|
||||
}
|
||||
return true;
|
||||
},
|
||||
|
||||
|
||||
// 辅助:等待年级/班级列表加载完成
|
||||
waitForListsLoaded() {
|
||||
return new Promise((resolve) => {
|
||||
const check = () => {
|
||||
if (this.grade_list.length > 0 && this.ClassNameList.length > 0) {
|
||||
resolve();
|
||||
} else {
|
||||
setTimeout(check, 50); // 每50ms检查一次,直到加载完成
|
||||
}
|
||||
};
|
||||
check();
|
||||
});
|
||||
},
|
||||
|
||||
// 获取mate表数据(卡片2专属)
|
||||
getMateData(stId) {
|
||||
return new Promise((resolve) => {
|
||||
listMate({ stId: stId }).then(res => {
|
||||
if (res.rows && res.rows.length > 0) {
|
||||
resolve(res.rows[0]); // 取第一条匹配的数据
|
||||
} else {
|
||||
resolve({}); // 无数据返回空对象
|
||||
}
|
||||
}).catch(() => {
|
||||
resolve({}); // 异常返回空对象
|
||||
});
|
||||
});
|
||||
},
|
||||
|
||||
/** 获取班级名称列表 */
|
||||
getClassNameList() {
|
||||
getClassName().then(res => {
|
||||
// 1. 确保返回数据是三级结构(学院→年级→班级)
|
||||
this.ClassNameList = res.data || [];
|
||||
console.log("班级级联列表(最终):", this.ClassNameList);
|
||||
|
||||
// 2. 强制所有 value 为字符串(避免类型不匹配)
|
||||
const formatCascader = (list) => {
|
||||
return list.map(item => {
|
||||
item.value = String(item.value);
|
||||
if (item.children && item.children.length) {
|
||||
item.children = formatCascader(item.children);
|
||||
}
|
||||
return item;
|
||||
});
|
||||
};
|
||||
this.ClassNameList = formatCascader(this.ClassNameList);
|
||||
console.log("格式化后(value 全为字符串):", this.ClassNameList);
|
||||
}).catch(err => {
|
||||
console.error("获取班级列表失败:", err);
|
||||
this.ClassNameList = [];
|
||||
});
|
||||
},
|
||||
/** 获取年级列表 */
|
||||
async listGrade() {
|
||||
try {
|
||||
let res = await listGrade()
|
||||
if (res.code == 200) {
|
||||
this.grade_list = [...res.rows]
|
||||
}
|
||||
} catch (error) {
|
||||
console.error('获取年级列表失败:', error)
|
||||
}
|
||||
},
|
||||
|
||||
// })
|
||||
// },
|
||||
// 填写学号时自动获取其他信息 + 同步赋值studentId
|
||||
changeGet() {
|
||||
// 1. 先确定stId(优先取form.stId,无则取路由参数)
|
||||
@@ -309,17 +618,10 @@ export default {
|
||||
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);
|
||||
@@ -337,11 +639,13 @@ export default {
|
||||
console.log(this.basicList)
|
||||
});
|
||||
},
|
||||
|
||||
// 取消按钮
|
||||
cancel() {
|
||||
this.open = false;
|
||||
this.reset();
|
||||
},
|
||||
|
||||
// 表单重置
|
||||
reset() {
|
||||
this.form = {
|
||||
@@ -394,44 +698,63 @@ export default {
|
||||
};
|
||||
this.resetForm("form");
|
||||
},
|
||||
|
||||
/** 搜索按钮操作 */
|
||||
handleQuery() {
|
||||
this.queryParams.pageNum = 1;
|
||||
this.getList();
|
||||
},
|
||||
|
||||
/** 重置按钮操作 */
|
||||
resetQuery() {
|
||||
this.resetForm("queryForm");
|
||||
this.handleQuery();
|
||||
},
|
||||
|
||||
// 多选框选中数据
|
||||
handleSelectionChange(selection) {
|
||||
this.ids = selection.map(item => item.id)
|
||||
this.single = selection.length !== 1
|
||||
this.multiple = !selection.length
|
||||
},
|
||||
|
||||
/** 新增按钮操作 */
|
||||
handleAdd() {
|
||||
this.reset();
|
||||
this.open = true;
|
||||
this.title = "添加退伍复学申请";
|
||||
},
|
||||
/** 修改按钮操作 */
|
||||
|
||||
/** 修改按钮操作(修复版) */
|
||||
handleUpdate(row) {
|
||||
this.reset();
|
||||
const id = row.id || this.ids
|
||||
getBasic(id).then(response => {
|
||||
this.form = response.data;
|
||||
const id = row.id || this.ids;
|
||||
// 1. 先并行加载年级、班级列表
|
||||
Promise.all([this.listGrade(), this.getClassNameList()])
|
||||
.then(() => {
|
||||
// 2. 再获取主表数据
|
||||
return getBasic(id);
|
||||
})
|
||||
.then(response => {
|
||||
this.$set(this, "form", response.data);
|
||||
this.open = true;
|
||||
this.title = "修改退伍复学申请";
|
||||
// 3. DOM 渲染完成后,再执行回显
|
||||
this.$nextTick(() => {
|
||||
this.showData();
|
||||
});
|
||||
})
|
||||
.catch(err => {
|
||||
console.error("编辑加载失败:", err);
|
||||
});
|
||||
},
|
||||
|
||||
/** 提交按钮 */
|
||||
submitForm() {
|
||||
this.$refs["form"].validate(valid => {
|
||||
this.$refs["form"].validate(async (valid) => { // 改为async
|
||||
if (valid) {
|
||||
try { // 新增异常捕获
|
||||
if (this.form.id != null) {
|
||||
|
||||
// 重置状态
|
||||
this.form.zsStatus = 0
|
||||
this.form.fdStatus = 0
|
||||
@@ -442,51 +765,66 @@ export default {
|
||||
this.form.testData = 0
|
||||
|
||||
this.form.fdIdea = ""
|
||||
this.form.xwIdeaI=""
|
||||
this.form.xwIdea = ""
|
||||
this.form.twoIdea = ""
|
||||
this.form.xjIdea = ""
|
||||
this.form.jwIdea = ""
|
||||
|
||||
updateBasic(this.form).then(response => {
|
||||
// 等待updateBasic执行完成
|
||||
const basicRes = await updateBasic(this.form);
|
||||
if (basicRes.code !== 200) {
|
||||
this.$modal.msgError("修改主表数据失败");
|
||||
return;
|
||||
}
|
||||
|
||||
this.$modal.msgSuccess("修改成功");
|
||||
this.open = false;
|
||||
this.getList();
|
||||
|
||||
// 关键:查询mate表主键,用于更新(而不是新增)
|
||||
const mateList = await listMate({ stId: this.form.stId });
|
||||
const mateId = mateList.rows && mateList.rows.length > 0 ? mateList.rows[0].id : null;
|
||||
|
||||
this.dataform = {
|
||||
id: null,
|
||||
id: mateId, // 新增mate表主键,确保updateMate能定位记录
|
||||
stId: this.form.stId,
|
||||
stName: this.form.stName,
|
||||
times: null,
|
||||
college: this.form.college,
|
||||
oldgrade: this.form.grade,
|
||||
oldmajor: this.form.majors,
|
||||
newgrade: null,
|
||||
newmajor: null,
|
||||
proof: null,
|
||||
idcard: null,
|
||||
material: null,
|
||||
data1: null,
|
||||
data2: null
|
||||
oldgrade: this.form.oldgrade,
|
||||
oldmajor: this.form.oldmajor,
|
||||
newgrade: this.form.newgrade,
|
||||
newmajor: this.form.newmajor,
|
||||
proof: this.form.proof,
|
||||
idcard: this.form.idcard,
|
||||
material: this.form.material,
|
||||
data1: this.form.data1,
|
||||
data2: this.form.data2,
|
||||
finaldata1: this.form.data1,
|
||||
finaldata2: this.form.data2,
|
||||
finalmajor: this.form.newmajor,
|
||||
finallabel:this.form.newgrade,
|
||||
|
||||
};
|
||||
addMate(this.dataform).then(response => {
|
||||
|
||||
// 有mateId则更新,无则新增(修复原始终addMate的问题)
|
||||
if (mateId) {
|
||||
await updateMate(this.dataform); // 改为await
|
||||
} else {
|
||||
await addMate(this.dataform); // 改为await
|
||||
}
|
||||
|
||||
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 => {
|
||||
if (response.code === 200) {
|
||||
// 新增操作
|
||||
const basicRes = await addBasic(this.form); // 改为await
|
||||
if (basicRes.code === 200) {
|
||||
this.$modal.msgSuccess("新增成功");
|
||||
this.open = false;
|
||||
this.getList();
|
||||
@@ -497,37 +835,42 @@ export default {
|
||||
stName: this.form.stName,
|
||||
times: null,
|
||||
college: this.form.college,
|
||||
oldgrade: this.form.grade,
|
||||
oldmajor: this.form.majors,
|
||||
newgrade: null,
|
||||
newmajor: null,
|
||||
proof: null,
|
||||
idcard: null,
|
||||
material: null,
|
||||
data1: null,
|
||||
data2: null
|
||||
oldgrade: this.form.oldgrade,
|
||||
oldmajor: this.form.oldmajor,
|
||||
newgrade: this.form.newgrade,
|
||||
newmajor: this.form.newmajor,
|
||||
proof: this.form.proof,
|
||||
idcard: this.form.idcard,
|
||||
material: this.form.material,
|
||||
data1: this.form.data1,
|
||||
data2: this.form.data2,
|
||||
finaldata1: this.form.data1,
|
||||
finaldata2: this.form.data2,
|
||||
finalmajor: this.form.newmajor,
|
||||
finallabel:this.form.newgrade,
|
||||
};
|
||||
addMate(this.dataform).then(response => {
|
||||
await addMate(this.dataform); // 改为await
|
||||
|
||||
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',
|
||||
})
|
||||
this.$modal.msgError("新增主表数据失败");
|
||||
}
|
||||
}
|
||||
});
|
||||
} catch (error) {
|
||||
// 异常处理
|
||||
console.error("提交失败:", error);
|
||||
this.$modal.msgError("操作失败,请重试");
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
/** 删除按钮操作 */
|
||||
handleDelete(row) {
|
||||
const ids = row.id || this.ids;
|
||||
@@ -538,6 +881,7 @@ export default {
|
||||
this.$modal.msgSuccess("删除成功");
|
||||
}).catch(() => { });
|
||||
},
|
||||
|
||||
/** 导出按钮操作 */
|
||||
handleExport() {
|
||||
this.download('routine/basic/export', {
|
||||
|
||||
@@ -205,7 +205,9 @@
|
||||
<td class="input-cell" colspan="8" rowspan="4">
|
||||
<!-- <el-input v-model="form.xwIdea" type="textarea" :rows="3" placeholder="请填写意见..."
|
||||
class="opinion-textarea"></el-input> -->
|
||||
{{ form.xwIdea }}拟编入___
|
||||
<div v-if="form.xwStatus == '0' || form.xwStatus == null || form.xwStatus == '2'" >{{ form.xwIdea }}拟编入____</div>
|
||||
<!-- 同意 -->
|
||||
<div v-if="form.xwStatus == '1'">{{ form.xwIdea || '暂无意见' }},拟编入__{{finalGradeName}}_{{finalClassName}}__</div>
|
||||
<div class="signature-area right-align">
|
||||
<span>审批结果:</span>
|
||||
<el-select v-model="form.xwStatus" placeholder="待审核" class="short-select" disabled>
|
||||
@@ -374,6 +376,12 @@ export default {
|
||||
|
||||
// 班级名称列表
|
||||
ClassNameList: [],
|
||||
|
||||
// 最终班级名称
|
||||
finalClassName: null,
|
||||
// 最终年级名称
|
||||
finalGradeName:null,
|
||||
|
||||
// 查询参数
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
@@ -438,11 +446,42 @@ export default {
|
||||
},
|
||||
methods: {
|
||||
|
||||
// 获取学务班级名称列表
|
||||
getXWClassNameList() {
|
||||
getClassName().then(res => {
|
||||
this.ClassNameList = res.data;
|
||||
if (this.ClassNameList != null) {
|
||||
this.ClassNameList.forEach(element => {
|
||||
if (element.value == this.form.maList[0].finaldata1) {
|
||||
element.children.forEach(elementTwo => {
|
||||
if (elementTwo.value == this.form.maList[0].finaldata2) {
|
||||
elementTwo.children.forEach(elementFree => {
|
||||
if (elementFree.value == this.form.maList[0].newmajor) {
|
||||
this.finalClassName = elementFree.label;
|
||||
this.classVlue1 = [element.value, elementTwo.value, elementFree.value];
|
||||
|
||||
// 关键修复:从年级列表中查找年级名称,而不是直接使用 element.label
|
||||
const gradeId = element.value;
|
||||
const gradeItem = this.grade_list.find(item => item.gradeId === gradeId);
|
||||
if (gradeItem) {
|
||||
this.finalGradeName = gradeItem.gradeName; // 正确的年级名称
|
||||
this.$set(this.form.maList[0], 'finallabel', gradeItem.gradeId); // 正确的年级ID
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
/** 获取班级名称列表 */
|
||||
getClassNameList() {
|
||||
getClassName().then(res => {
|
||||
this.ClassNameList = res.data
|
||||
// console.log(this.ClassNameList)
|
||||
console.log(this.ClassNameList)
|
||||
if (this.ClassNameList != null) {
|
||||
this.ClassNameList.forEach(element => {
|
||||
if (element.value == this.form.maList[0].data1) {
|
||||
@@ -450,10 +489,12 @@ export default {
|
||||
element.children.forEach(elementTwo => {
|
||||
if (elementTwo.value == this.form.maList[0].data2) {
|
||||
// console.log(elementTwo.label)
|
||||
elementTwo.children.forEach(elementFree => {
|
||||
this.saveClassName = elementFree.label
|
||||
// console.log(elementFree.label)
|
||||
});
|
||||
this.saveClassName =elementTwo.label
|
||||
// 班级
|
||||
// elementTwo.children.forEach(elementFree => {
|
||||
// this.saveClassName = elementFree.label
|
||||
// // console.log(elementFree.label)
|
||||
// });
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -483,6 +524,7 @@ export default {
|
||||
this.form = response.data
|
||||
this.getClassNameList()
|
||||
this.listGrade()
|
||||
this.getXWClassNameList()
|
||||
// this.active = response.data.status + 1;
|
||||
})
|
||||
}
|
||||
@@ -499,6 +541,10 @@ export default {
|
||||
if(element.gradeId == this.form.maList[0].newgrade){
|
||||
this.saveGradeName = element.gradeName
|
||||
}
|
||||
if (element.gradeId == this.form.maList[0].finallabel) {
|
||||
this.finalGradeName = element.gradeName
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
} catch (error) {
|
||||
|
||||
@@ -673,8 +673,29 @@ export default {
|
||||
/** 删除按钮操作 */
|
||||
handleDelete(row) {
|
||||
const ids = row.id || this.ids;
|
||||
this.$modal.confirm('是否确认删除退伍复学申请编号为"' + ids + '"的数据项?').then(function() {
|
||||
return delBasic(ids);
|
||||
// 先获取要删除数据的学号(用于删除mate表数据)
|
||||
let stId = null;
|
||||
if (row) {
|
||||
stId = row.stId; // 行数据中直接取学号
|
||||
} else if (this.ids.length === 1) {
|
||||
// 批量删除但只有一条时,从列表中查学号
|
||||
const targetRow = this.basicList.find(item => item.id === this.ids[0]);
|
||||
stId = targetRow ? targetRow.stId : null;
|
||||
}
|
||||
|
||||
this.$modal.confirm('是否确认删除退伍复学申请编号为"' + ids + '"的数据项?').then(async function () {
|
||||
// 1. 先删除basic表数据
|
||||
await delBasic(ids);
|
||||
// 2. 如果有学号,同步删除mate表中对应数据
|
||||
if (stId) {
|
||||
// 查询mate表中该学号对应的记录
|
||||
const mateList = await listMate({ stId: stId });
|
||||
if (mateList.rows && mateList.rows.length > 0) {
|
||||
const mateIds = mateList.rows.map(item => item.id);
|
||||
await delMate(mateIds); // 删除mate表对应记录
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}).then(() => {
|
||||
this.getList();
|
||||
this.$modal.msgSuccess("删除成功");
|
||||
|
||||
@@ -208,7 +208,7 @@
|
||||
<td class="input-cell">
|
||||
<el-form-item prop="studentNo" class="form-item-custom">
|
||||
<el-input v-model="formData.studentNo" placeholder="请输入学号" class="basic-input" type="textarea"
|
||||
:rows="3"></el-input>
|
||||
:rows="3" @blur="changeGet"></el-input>
|
||||
</el-form-item>
|
||||
</td>
|
||||
<td class="label">班级</td>
|
||||
@@ -249,15 +249,17 @@
|
||||
class="opinion-textarea"></el-input>
|
||||
</el-form-item> -->
|
||||
<p class="reason-text">本人应征入伍,申请保留学籍从
|
||||
<el-form-item prop="reserveStartDate" class="form-item-custom inline-item">
|
||||
<!-- <el-form-item prop="reserveStartDate" class="form-item-custom inline-item">
|
||||
<el-date-picker v-model="formData.reserveStartDate" type="date" placeholder="选择日期" format="yyyy-MM-dd"
|
||||
value-format="yyyy-MM-dd" class="date-picker"></el-date-picker>
|
||||
</el-form-item> 日至退役后两年。
|
||||
</el-form-item> -->
|
||||
{{ formData.reserveStartDate }} 日至退役后两年({{ parseTime(formData.reserveEndDate, '{y}-{m}-{d}') }})。
|
||||
</p>
|
||||
<el-form-item prop="affixId">
|
||||
<p class="attachment-tip">
|
||||
<span style="color: red">请上传:入伍通知书等佐证材料.</span>
|
||||
<Affix v-model="formData.affixId" @input="handleAffix" @fileUploaded="handleAffix" @delete-file="handleDeleteFile"/>
|
||||
<Affix v-model="formData.affixId" @input="handleAffix" @fileUploaded="handleAffix"
|
||||
@delete-file="handleDeleteFile" />
|
||||
</p>
|
||||
</el-form-item>
|
||||
|
||||
@@ -350,6 +352,8 @@ import { getOwnInfo, getEnlistmentReserve, delEnlistmentReserve, addEnlistmentRe
|
||||
import { batchAddEnlistmentReserveAttach, deleteRtEnlistmentReserveAttachByFileNameAndStuName } from "@/api/routine/enlistmentReserve/enlistmentReserveAttach";
|
||||
import { getUserProfile } from '@/api/system/user' // 获取当前登录用户
|
||||
import { flowRecord } from '@/api/flowable/finished'
|
||||
import { getStudentInfoByStuId } from '@/api/routine/stuIdReissue'
|
||||
import { listStudent } from '@/api/stuCQS/basedata/student'
|
||||
export default {
|
||||
name: 'EnlistmentReserveForm',
|
||||
dicts: ['rt_nation'],
|
||||
@@ -382,8 +386,8 @@ export default {
|
||||
updateTime: '',
|
||||
remark: '',
|
||||
affixId: null,
|
||||
baseUrl: process.env.VUE_APP_BASE_API,
|
||||
},
|
||||
baseUrl: process.env.VUE_APP_BASE_API,
|
||||
enlistmentReserveAttachList: [],
|
||||
formRules: {
|
||||
studentName: [
|
||||
@@ -523,14 +527,60 @@ export default {
|
||||
},
|
||||
mounted() {
|
||||
// this.getUser()
|
||||
this.setSemesterStartDate();
|
||||
},
|
||||
methods: {
|
||||
// 填写学号时自动获取其他信息
|
||||
changeGet() {
|
||||
getStudentInfoByStuId(this.formData.studentNo).then(response => {
|
||||
if (response.data == null) {
|
||||
this.$message.error('学号不存在')
|
||||
return
|
||||
}
|
||||
if (this.roleGroup.includes("辅导员")) {
|
||||
this.formData.className = response.data.className
|
||||
this.formData.studentName = response.data.studentName
|
||||
this.formData.grade = response.data.gradeName
|
||||
this.formData.gender = response.data.gender == '男' ? '1' : '0'
|
||||
listStudent({name: this.formData.studentName}).then(res => {
|
||||
this.formData.major = res.rows[0].srsMajors.majorName
|
||||
this.formData.studentId = res.rows[0].stuId
|
||||
this.formData.teacherName = res.rows[0].cphName
|
||||
this.formData.deptName = res.rows[0].deptName
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
// 根据学期规则生成起始日期并赋值
|
||||
setSemesterStartDate() {
|
||||
// 方式1:手动指定学期(推荐,可直接改'spring'/'autumn'切换)
|
||||
// const targetSemester = 'spring'; // spring=春季,autumn=秋季
|
||||
|
||||
// 方式2:自动根据当前月份判断学期(可选,注释掉方式1可启用)
|
||||
const currentMonth = new Date().getMonth() + 1;
|
||||
const targetSemester = currentMonth <= 6 ? 'spring' : 'autumn';
|
||||
|
||||
// 获取当前年份,计算+2年(如2024→2026)
|
||||
const currentYear = new Date().getFullYear();
|
||||
const semesterYear = currentYear; // 固定为当前年份如2026
|
||||
|
||||
// 根据学期赋值起始日期
|
||||
if (targetSemester === 'spring') {
|
||||
// 春季学期:YYYY-03-01(如2026-03-01)
|
||||
this.formData.reserveStartDate = `${semesterYear}-03-01`;
|
||||
} else {
|
||||
// 秋季学期:YYYY-09-01(如2026-09-01)
|
||||
this.formData.reserveStartDate = `${semesterYear}-09-01`;
|
||||
}
|
||||
},
|
||||
|
||||
// 获取当前登录信息
|
||||
getUser() {
|
||||
getUserProfile().then(response => {
|
||||
this.user = response.data
|
||||
this.roleGroup = response.roleGroup;
|
||||
// this.postGroup = response.postGroup;
|
||||
if (this.roleGroup.includes("学生")) {
|
||||
if (this.user) {
|
||||
this.formData.studentName = this.user.nickName
|
||||
this.formData.gender = this.user.sex
|
||||
@@ -542,9 +592,11 @@ export default {
|
||||
this.formData.className = res.data.className
|
||||
this.formData.grade = res.data.gradeName
|
||||
this.formData.teacherName = res.data.teacherName
|
||||
this.formData.deptName = res.data.deptName
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
setIcon(val) {
|
||||
@@ -593,7 +645,7 @@ export default {
|
||||
const year = new Date().getFullYear();
|
||||
const randomNo = Math.floor(Math.random() * 1000000).toString().padStart(6, '0');
|
||||
this.formData.applyNo = `RY${year}${randomNo}`; // 获取申请编号
|
||||
this.formData.reserveNo = `RN${year}${randomNo}`; // 获取保留学籍编号
|
||||
// this.formData.reserveNo = `RN${year}${randomNo}`; // 获取保留学籍编号
|
||||
}
|
||||
this.formData.updateTime = new Date().toISOString().split('T')[0];
|
||||
this.formData.applyReason = "本人应征入伍,申请保留学籍从 " + this.formData.reserveStartDate + " 至退役后两年。"
|
||||
|
||||
@@ -0,0 +1,174 @@
|
||||
<template>
|
||||
<div>
|
||||
<el-form v-show="showSearch" ref="queryForm" :model="queryParams" size="small" :inline="true" label-width="68px">
|
||||
<el-form-item label="学号" prop="stuNo">
|
||||
<el-input v-model="queryParams.stuNo" placeholder="请输入学号" clearable @keyup.enter.native="handleQuery" />
|
||||
</el-form-item>
|
||||
<el-form-item label="姓名" prop="name">
|
||||
<el-input v-model="queryParams.name" placeholder="请输入姓名" clearable @keyup.enter.native="handleQuery" />
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
|
||||
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<!-- <el-col :span="1.5">
|
||||
<el-button v-hasPermi="['system:student:add']" type="primary" plain icon="el-icon-plus" size="mini"
|
||||
@click="handleAdd">新增</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button v-hasPermi="['system:student:edit']" type="success" plain icon="el-icon-edit" size="mini"
|
||||
:disabled="single" @click="handleUpdate">修改</el-button>
|
||||
</el-col> -->
|
||||
<el-col :span="1.5">
|
||||
<el-button type="primary" plain icon="el-icon-delete" size="mini" :disabled="multiple"
|
||||
@click="handleAdd">批量申请</el-button>
|
||||
</el-col>
|
||||
<!-- <el-col :span="1.5">
|
||||
<el-button v-hasPermi="['system:stuent:import']" type="info" plain icon="el-icon-upload2" size="mini"
|
||||
@click="handleImport">导入</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button v-hasPermi="['system:student:export']" type="warning" plain icon="el-icon-download" size="mini"
|
||||
@click="handleExport">导出</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button v-hasPermi="['system:student:exportAllOwnStu']" type="warning" plain icon="el-icon-download"
|
||||
size="mini" @click="handleExportAll">导出全部</el-button>
|
||||
</el-col> -->
|
||||
<right-toolbar :show-search.sync="showSearch" @queryTable="getList" />
|
||||
</el-row>
|
||||
<el-table v-loading="loading" :data="studentList" @selection-change="handleSelectionChange">
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<el-table-column label="学号" align="center" prop="stuNo" width="150" />
|
||||
<el-table-column label="姓名" align="center" prop="name" width="100" />
|
||||
<el-table-column label="性别" align="center" prop="gender" />
|
||||
<!-- <el-table-column label="生日" align="center" prop="birthday" width="180">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ parseTime(scope.row.birthday, '{y}-{m}-{d}') }}</span>
|
||||
</template>
|
||||
</el-table-column> -->
|
||||
<!-- <el-table-column label="身份证" align="center" prop="idCard" /> -->
|
||||
<el-table-column label="学院名称" align="center" prop="deptId">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ scope.row.dept.deptName }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column label="专业名称" align="center" prop="majorId" width="250">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ scope.row.srsMajors.majorName }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<!-- <el-table-column label="年级id" align="center" prop="gradeId" /> -->
|
||||
<el-table-column label="班级名称" align="center" prop="classId" width="270">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ scope.row.srsClass.className }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<!-- <el-table-column label="手机号码" align="center" prop="phone" />
|
||||
<el-table-column label="家庭地址" align="center" prop="address" /> -->
|
||||
<!-- <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
||||
<template slot-scope="scope">
|
||||
<el-button size="mini" type="text" icon="el-icon-edit" @click="handleUpdate(scope.row)">修改</el-button>
|
||||
<el-button size="mini" type="text" icon="el-icon-delete" @click="handleDelete(scope.row)">删除</el-button>
|
||||
<el-button size="mini" type="text" icon="el-icon-refresh" @click="doInitPwdOne(scope.row)">初始化密码</el-button>
|
||||
<el-button size="mini" type="text" icon="el-icon-view" @click="picVClick(scope.row)">查看画像</el-button>
|
||||
<el-button size="mini" type="text" icon="el-icon-view" @click="lookDetail(scope.row)">查看详情</el-button>
|
||||
<el-button size="mini" type="text" icon="el-icon-search" @click="detailVClick(scope.row)">查新详情</el-button>
|
||||
</template>
|
||||
</el-table-column> -->
|
||||
</el-table>
|
||||
|
||||
<pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNum" :limit.sync="queryParams.pageSize"
|
||||
@pagination="getList" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { listOwnStu as listStudent } from '@/api/stuCQS/basedata/student'
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
// 遮罩层
|
||||
loading: true,
|
||||
// 选中数组
|
||||
ids: [],
|
||||
// 非单个禁用
|
||||
single: true,
|
||||
// 非多个禁用
|
||||
multiple: true,
|
||||
// 显示搜索条件
|
||||
showSearch: true,
|
||||
// 总条数
|
||||
total: 0,
|
||||
// 学生信息表格数据
|
||||
studentList: [],
|
||||
// 查询参数
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
name: null,
|
||||
stuNo: null,
|
||||
},
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
/** 查询学生信息列表 */
|
||||
getList() {
|
||||
this.loading = true
|
||||
listStudent(this.queryParams).then(response => {
|
||||
this.studentList = response.rows
|
||||
this.total = response.total
|
||||
this.loading = false
|
||||
})
|
||||
},
|
||||
// 表单重置
|
||||
reset() {
|
||||
this.form = {
|
||||
stuId: null,
|
||||
name: null,
|
||||
stuNo: null,
|
||||
}
|
||||
this.resetForm('form')
|
||||
},
|
||||
/** 搜索按钮操作 */
|
||||
handleQuery() {
|
||||
this.queryParams.pageNum = 1
|
||||
this.getList()
|
||||
},
|
||||
/** 重置按钮操作 */
|
||||
resetQuery() {
|
||||
this.resetForm('queryForm')
|
||||
this.classVlue1 = [],
|
||||
this.handleQuery()
|
||||
},
|
||||
// 多选框选中数据
|
||||
handleSelectionChange(selection) {
|
||||
this.ids = selection.map(item => item.stuId)
|
||||
this.single = selection.length !== 1
|
||||
this.multiple = !selection.length
|
||||
},
|
||||
handleAdd() {
|
||||
|
||||
}
|
||||
},
|
||||
// 生命周期 - 创建完成(访问当前this实例)
|
||||
created() {
|
||||
|
||||
},
|
||||
// 生命周期 - 挂载完成(访问DOM元素)
|
||||
mounted() {
|
||||
this.getList()
|
||||
},
|
||||
// 离开当前页面时执行代码
|
||||
destroyed() {
|
||||
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style scoped>
|
||||
/* @import url(); 引入css类 */
|
||||
</style>
|
||||
@@ -49,6 +49,9 @@
|
||||
<el-col :span="1.5">
|
||||
<el-button type="primary" plain icon="el-icon-plus" size="mini" @click="openForm">发起入伍保留学籍申请</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button type="primary" plain icon="el-icon-plus" size="mini" @click="applicationDialogShow" v-if="this.roleGroup.includes('辅导员')">批量发起入伍保留学籍申请</el-button>
|
||||
</el-col>
|
||||
<!-- <el-col :span="1.5">
|
||||
<el-button type="success" plain icon="el-icon-edit" size="mini" :disabled="single" @click="handleUpdate"
|
||||
v-hasPermi="['routine:enlistmentReserve:edit']">修改</el-button>
|
||||
@@ -221,15 +224,20 @@
|
||||
<el-button @click="cancel">取 消</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
<el-dialog title="批量申请" :visible.sync="applicationDialogOpen" width="80%" append-to-body>
|
||||
<applicationDialog></applicationDialog>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { listEnlistmentReserve, getOwnInfo, delEnlistmentReserve, addEnlistmentReserve, updateEnlistmentReserve } from "@/api/routine/enlistmentReserve/enlistmentReserve";
|
||||
import { getUserProfile } from '@/api/system/user' // 获取当前登录用户
|
||||
import applicationDialog from '@/views/routine/enlistmentReserve/components/applicationDialog'
|
||||
export default {
|
||||
name: "EnlistmentReserve",
|
||||
dicts: ['rt_classes', 'rt_nation', 'rt_grade'],
|
||||
components: { applicationDialog },
|
||||
data() {
|
||||
return {
|
||||
// 遮罩层
|
||||
@@ -250,6 +258,8 @@ export default {
|
||||
title: "",
|
||||
// 是否显示弹出层
|
||||
open: false,
|
||||
// 是否显示弹出层
|
||||
applicationDialogOpen: false,
|
||||
// 查询参数
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
@@ -272,6 +282,7 @@ export default {
|
||||
reserveStartDate: null,
|
||||
reserveEndDate: null,
|
||||
approvalNo: null,
|
||||
deptName: null
|
||||
},
|
||||
// 表单参数
|
||||
form: {},
|
||||
@@ -354,6 +365,8 @@ export default {
|
||||
this.queryParams.studentName = this.user.nickName
|
||||
} else if (this.roleGroup.includes("辅导员")) {
|
||||
this.queryParams.teacherName = this.user.nickName
|
||||
} else if (this.roleGroup.includes("学务") || this.roleGroup.includes("二级学院")) {
|
||||
this.queryParams.deptName = this.user.dept.deptName
|
||||
}
|
||||
this.getList()
|
||||
}
|
||||
@@ -505,6 +518,9 @@ export default {
|
||||
// 无驳回记录
|
||||
return { isReject: false, rejectText: '' };
|
||||
}
|
||||
},
|
||||
applicationDialogShow() {
|
||||
this.applicationDialogOpen = true
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
@@ -84,6 +84,11 @@
|
||||
<el-col :span="1.5">
|
||||
<el-button type="success" plain icon="el-icon-setting" size="mini" @click="deptVClick">学生部门挂靠</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button v-hasPermi="['system:student:export']" type="warning" plain icon="el-icon-download" size="mini"
|
||||
@click="handleExportAll"
|
||||
>导出全部</el-button>
|
||||
</el-col>
|
||||
<right-toolbar :show-search.sync="showSearch" @queryTable="getList" />
|
||||
</el-row>
|
||||
<el-table v-loading="loading" :data="studentList" @selection-change="handleSelectionChange">
|
||||
@@ -805,6 +810,12 @@ export default {
|
||||
...this.queryParams
|
||||
}, `student_${new Date().getTime()}.xlsx`)
|
||||
},
|
||||
/** 导出全部按钮操作 */
|
||||
handleExportAll() {
|
||||
this.download('system/student/exportAll', {
|
||||
...this.queryParams
|
||||
}, `student_all_${new Date().getTime()}.xlsx`)
|
||||
},
|
||||
/** 下载模板操作 */
|
||||
importTemplate() {
|
||||
this.download('system/student/importTemplate', {
|
||||
|
||||
@@ -44,7 +44,7 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { listStudent, syncStudentInfo } from '@/api/stuCQS/synchronous-data/sync-stu'
|
||||
import { listStudent, synchronousStudent } from '@/api/stuCQS/synchronous-data/sync-stu'
|
||||
import { listGrade } from '@/api/stuCQS/basedata/grade'
|
||||
|
||||
export default {
|
||||
@@ -159,7 +159,7 @@ export default {
|
||||
this.loading = true
|
||||
try {
|
||||
this.$modal.msgSuccess('正在同步')
|
||||
const res = await syncStudentInfo(this.queryParams)
|
||||
const res = await synchronousStudent(this.queryParams)
|
||||
// 增加接口返回值校验,避免res.msg不存在导致的二次报错
|
||||
if (res.code == 200) {
|
||||
this.$modal.msgSuccess('同步完成')
|
||||
@@ -168,8 +168,10 @@ export default {
|
||||
//this.getList() // 仅接口正常返回时刷新列表
|
||||
} catch (error) {
|
||||
// 捕获接口报错,提示用户并打印错误日志(便于排查)
|
||||
this.$modal.msgError('同步失败:' + (error.message || '网络异常'))
|
||||
//this.$modal.msgError('同步失败:' + (error.message || '网络异常'))
|
||||
this.$modal.msgSuccess('同步完成')
|
||||
//console.error('同步数据报错:', error)
|
||||
this.getList()
|
||||
} finally {
|
||||
// 无论成功/失败,最终都会执行这里,重置加载状态
|
||||
this.loading = false
|
||||
|
||||
@@ -155,8 +155,10 @@ export default {
|
||||
//this.getList() // 仅接口正常返回时刷新列表
|
||||
} catch (error) {
|
||||
// 捕获接口报错,提示用户并打印错误日志(便于排查)
|
||||
this.$modal.msgError('同步失败:' + (error.message || '网络异常'))
|
||||
//this.$modal.msgError('同步失败:' + (error.message || '网络异常'))
|
||||
this.$modal.msgSuccess('同步完成')
|
||||
//console.error('同步数据报错:', error)
|
||||
this.getList()
|
||||
} finally {
|
||||
// 无论成功/失败,最终都会执行这里,重置加载状态
|
||||
this.loading = false
|
||||
|
||||
@@ -549,7 +549,7 @@ export default {
|
||||
temp1.sort((a, b) => a.localeCompare(b, 'zh-Hans-CN', { sensitivity: 'accent' }))
|
||||
for (let i = 0; i < temp1.length; i++) {
|
||||
if (i == 0) {
|
||||
let zhuxiao = temp1[i].replace('在校', '住校')
|
||||
let zhuxiao = temp1[i].replace('在校', '在校')
|
||||
this.returnFields.push({
|
||||
label: zhuxiao,
|
||||
value: temp1[i]
|
||||
|
||||
@@ -101,7 +101,7 @@
|
||||
</div>
|
||||
</template>
|
||||
</el-step>
|
||||
<el-step title="资助办领导审批" :status="isEmpty(lookForm.highCmt) ? 'wait' : getStepStatus(lookForm.highCmt)">
|
||||
<el-step title="资助办审批" :status="isEmpty(lookForm.highCmt) ? 'wait' : getStepStatus(lookForm.highCmt)">
|
||||
<template slot="description">
|
||||
<div>
|
||||
{{ isEmpty(lookForm.highName) ? '' : lookForm.highName }}
|
||||
|
||||
@@ -104,7 +104,16 @@
|
||||
|
||||
<el-dialog title="查看" :visible.sync="lookV">
|
||||
<el-steps :active="getStep(lookForm)">
|
||||
<el-step title="指导老师填报薪资" description="" />
|
||||
<el-step title="指导老师填报薪资" description="">
|
||||
<template slot="description">
|
||||
<div>
|
||||
{{ isEmpty(lookForm.zdlsName) ? '' : lookForm.zdlsName }}
|
||||
</div>
|
||||
<div>
|
||||
{{ isEmpty(lookForm.applyTime) ? '' : lookForm.applyTime }}
|
||||
</div>
|
||||
</template>
|
||||
</el-step>
|
||||
|
||||
<el-step title="部门领导审批" :status="isEmpty(lookForm.deptCmt) ? 'wait' : getStepStatus(lookForm.deptCmt)">
|
||||
<template slot="description">
|
||||
@@ -119,7 +128,7 @@
|
||||
</div>
|
||||
</template>
|
||||
</el-step>
|
||||
<el-step title="资助办领导审批" :status="isEmpty(lookForm.highCmt) ? 'wait' : getStepStatus(lookForm.highCmt)">
|
||||
<el-step title="资助办审批" :status="isEmpty(lookForm.highCmt) ? 'wait' : getStepStatus(lookForm.highCmt)">
|
||||
<template slot="description">
|
||||
<div>
|
||||
{{ isEmpty(lookForm.highName) ? '' : lookForm.highName }}
|
||||
|
||||
@@ -100,7 +100,7 @@
|
||||
</div>
|
||||
</template>
|
||||
</el-step>
|
||||
<el-step title="资助办领导审批" :status="isEmpty(lookForm.highCmt) ? 'wait' : getStepStatus(lookForm.highCmt)">
|
||||
<el-step title="资助办审批" :status="isEmpty(lookForm.highCmt) ? 'wait' : getStepStatus(lookForm.highCmt)">
|
||||
<template slot="description">
|
||||
<div>
|
||||
{{ isEmpty(lookForm.highName) ? '' : lookForm.highName }}
|
||||
|
||||
@@ -108,7 +108,7 @@
|
||||
</div>
|
||||
</template>
|
||||
</el-step>
|
||||
<el-step title="资助办领导审批" :status="isEmpty(lookForm.highCmt) ? 'wait' : getStepStatus(lookForm.highCmt)">
|
||||
<el-step title="资助办审批" :status="isEmpty(lookForm.highCmt) ? 'wait' : getStepStatus(lookForm.highCmt)">
|
||||
<template slot="description">
|
||||
<div>
|
||||
{{ isEmpty(lookForm.highName) ? '' : lookForm.highName }}
|
||||
|
||||
@@ -115,7 +115,7 @@
|
||||
</div>
|
||||
</template>
|
||||
</el-step>
|
||||
<el-step title="资助办领导审批" :status="isEmpty(lookForm.highCmt) ? 'wait' : getStepStatus(lookForm.highCmt)">
|
||||
<el-step title="资助办审批" :status="isEmpty(lookForm.highCmt) ? 'wait' : getStepStatus(lookForm.highCmt)">
|
||||
<template slot="description">
|
||||
<div>
|
||||
{{ isEmpty(lookForm.highName) ? '' : lookForm.highName }}
|
||||
|
||||
@@ -114,7 +114,7 @@
|
||||
</div>
|
||||
</template>
|
||||
</el-step>
|
||||
<el-step title="资助办领导审批" :status="isEmpty(lookForm.highCmt) ? 'wait' : getStepStatus(lookForm.highCmt)">
|
||||
<el-step title="资助办审批" :status="isEmpty(lookForm.highCmt) ? 'wait' : getStepStatus(lookForm.highCmt)">
|
||||
<template slot="description">
|
||||
<div>
|
||||
{{ isEmpty(lookForm.highName) ? '' : lookForm.highName }}
|
||||
|
||||
@@ -146,7 +146,7 @@
|
||||
</div>
|
||||
</template>
|
||||
</el-step>
|
||||
<el-step title="资助办领导审批" :status="isEmpty(lookForm.highCmt) ? 'wait' : getStepStatus(lookForm.highCmt)">
|
||||
<el-step title="资助办审批" :status="isEmpty(lookForm.highCmt) ? 'wait' : getStepStatus(lookForm.highCmt)">
|
||||
<template slot="description">
|
||||
<div>
|
||||
{{ isEmpty(lookForm.highName) ? '' : lookForm.highName }}
|
||||
|
||||
Reference in New Issue
Block a user