学工发布通知前端页面的修改,用于管理通知,对整个年级发送的通知修改和删除;给学生证提交流程添加完成制作功能的前端的修改

This commit is contained in:
MDSMO
2025-08-12 17:36:08 +08:00
parent 2f6e3503ae
commit ad477813f3
9 changed files with 485 additions and 137 deletions

View File

@@ -6,6 +6,7 @@
<el-step title="辅导员审核" :description="changeActive(form.inspectionProgress)"></el-step>
<el-step title="学工处理"
:description="`${form.isPay === 0 ? '未缴费:' : '已缴费,备注:'}` + `${$route.query.jwcCmt ? $route.query.jwcCmt : '等待缴费,记录缴费金额'}`"></el-step>
<el-step title="完成制作" :description="getCompletionDescription()"></el-step>
</el-steps>
</el-card>
<el-card class="box-card" style="margin-top: 20px;">
@@ -65,6 +66,14 @@
</el-card>
<el-card class="box-card" style="margin-top: 20px;">
<div class="titleNav">办理状态</div>
<div style="margin-bottom: 20px;">
<el-tag v-if="form.inspectionProgress >= 3" type="success">已完成制作</el-tag>
<el-tag v-else-if="form.inspectionProgress >= 2" type="warning">学工处理中</el-tag>
<el-tag v-else-if="form.inspectionProgress >= 1" type="primary">辅导员审核中</el-tag>
<el-tag v-else-if="form.inspectionProgress === 0" type="info">待审核</el-tag>
<el-tag v-else type="danger">申请被驳回</el-tag>
</div>
<div class="titleNav">办理信息</div>
<el-form ref="form" :model="form" :rules="rules" label-width="90px">
<div class="formItem">
@@ -109,20 +118,33 @@
</el-form>
</el-card>
<div slot="footer" class="dialog-footer" style="text-align: right; margin-top: 20px;">
<el-button v-if="active === 0" type="primary" @click="submitForm(1)">提交申请</el-button>
<el-button v-if="finishStatus !== 'success' || form.inspectionProgress === 0" type="primary"
<!-- 新申请时显示提交申请按钮 -->
<el-button v-if="!form.id" type="primary" @click="submitForm(1)">提交申请</el-button>
<!-- 已有申请但未完成制作时显示修改提交申请按钮 -->
<el-button v-if="form.id && form.inspectionProgress < 3" type="primary"
@click="submitForm(1)">修改提交申请</el-button>
<!-- 已完成制作时显示继续提交申请按钮 -->
<el-button v-if="form.id && form.inspectionProgress >= 3" type="primary"
@click="submitNewApplication">继续提交申请</el-button>
<!-- 未完成制作时显示取消申请按钮 -->
<el-button v-if="form.id && form.inspectionProgress < 3"
type="danger" @click="cancelApplication">取消申请</el-button>
<!-- 已完成制作时显示取消申请按钮不可点击 -->
<el-button v-if="form.id && form.inspectionProgress >= 3"
type="info" disabled @click="showCompletedMessage">当前审核已完成不可取消</el-button>
<el-button type="primary" @click="printing">打印学生证申请表</el-button>
<!-- <el-button v-if="active === 1 && showRole <= 3" type="primary"
@click="auditInformation(2, '辅导员')">审核信息</el-button>
<el-button v-if="active === 2 && showRole <= 2" type="primary" @click="payment(3, '学工')">登记缴费金额</el-button> -->
<el-button @click="$router.push('/routine/sicr/stuIdReissueLIst')"> </el-button>
</div>
</div>
</template>
<script>
import { getStuIdReissue, addStuIdReissue, updateStuIdReissue, getStudentInfoByStuId } from "@/api/routine/stuIdReissue";
import { getStuIdReissue, addStuIdReissue, updateStuIdReissue, getStudentInfoByStuId, getStuIdReissueStatus, delStuIdReissue } from "@/api/routine/stuIdReissue";
import { listClass } from "@/api/stuCQS/basedata/class";
import {
pcaTextArr, // 省市区联动数据,纯汉字
@@ -176,7 +198,7 @@ export default {
]
},
// 申请进展
active: 0,
active: 1,
showRole: 0,
// 查询到的审核信息
stuMultiLevelReview: {},
@@ -196,7 +218,7 @@ export default {
immediate: true,
handler() {
this.form = {}
this.active = 0
this.active = 1
this.finishStatus = 'success'
if (this.$route.query.id !== undefined) {
this.handleUpdate()
@@ -214,6 +236,7 @@ export default {
this.isDisabled = false
this.isDisabledStuNo = false
this.finishStatus = 'success'
this.active = 1
}
}
}
@@ -258,19 +281,61 @@ export default {
className: this.form.className
}).then(response => {
// this.classList = response.rows;
this.form.counsellorName = response.rows[0].teacher.name
this.form.counsellorId = response.rows[0].teacher.teacherId
if (response.rows && response.rows.length > 0 && response.rows[0].teacher) {
this.form.counsellorName = response.rows[0].teacher.name
this.form.counsellorId = response.rows[0].teacher.teacherId
} else {
console.warn('未找到班级信息或辅导员信息');
}
}).catch(error => {
console.error('查询班级信息失败:', error);
});
});
},
// 进度变化时改变文字提示
changeActive(active) {
if (active === -1) {
return '申请被驳回,备注:申请不通过,' + this.$route.query.fdyCmt
} else if (active >= 1) {
return '申请通过,备注:' + this.$route.query.fdyCmt
const progress = Number(this.form.inspectionProgress);
if (progress === -1) {
return '申请被驳回,备注:申请不通过,' + this.$route.query.fdyCmt;
} else if (progress === 0) {
return '辅导员审核学生补办请求通不通过';
} else if (progress === 1) {
return '申请通过,备注:' + this.$route.query.fdyCmt;
} else if (progress === 2) {
return '学工处理中,备注:' + (this.$route.query.jwcCmt || '等待缴费,记录缴费金额');
} else if (progress >= 3) {
return '已完成制作,备注:学生证制作完成';
} else {
return '辅导员审核学生补办请求通不通过'
return '辅导员审核学生补办请求通不通过';
}
},
// 根据inspectionProgress确定当前步骤
calculateActive() {
const progress = Number(this.form.inspectionProgress);
console.log('调试信息 - calculateActive中的progress:', progress, '类型:', typeof progress);
if (progress >= 3) {
console.log('调试信息 - 返回步骤4 (完成制作)');
return 4; // 完成制作时返回4对应步骤条的最后一个步骤
} else if (progress >= 2) {
console.log('调试信息 - 返回步骤3 (学工处理)');
return 3; // 学工处理
} else if (progress >= 1) {
console.log('调试信息 - 返回步骤2 (辅导员审核)');
return 2; // 辅导员审核
} else {
console.log('调试信息 - 返回步骤1 (学生申请)');
return 1; // 学生申请
}
},
// 获取完成制作步骤的动态描述
getCompletionDescription() {
const progress = Number(this.form.inspectionProgress);
if (progress >= 3) {
return '学生证制作已完成,请及时领取';
} else if (progress >= 2) {
return '等待学工完成学生证制作';
} else {
return '学工完成学生证制作';
}
},
// 取消按钮
@@ -291,7 +356,7 @@ export default {
jg: null,
hksz2: null
};
this.active = 0
this.active = 1
this.resetForm("form");
},
/** 重置按钮操作 */
@@ -307,12 +372,27 @@ export default {
this.form = response.data;
this.form.studentName = this.form.stuName
// this.form.stuName = this.form.studentName
console.log('调试信息 - inspectionProgress:', response.data.inspectionProgress, '类型:', typeof response.data.inspectionProgress);
console.log('调试信息 - calculateActive():', this.calculateActive());
if (response.data.inspectionProgress === -1) {
this.active = 2
this.active = 1; // 驳回时显示学生申请步骤
this.finishStatus = 'error'
} else {
this.active = +response.data.inspectionProgress + 1
// console.log(this.active);
this.active = this.calculateActive();
// 根据审核进度设置完成状态
if (Number(response.data.inspectionProgress) >= 3) {
this.finishStatus = 'success'
} else if (Number(response.data.inspectionProgress) >= 0) {
this.finishStatus = 'success'
} else {
this.finishStatus = 'error'
}
}
console.log('调试信息 - active:', this.active, '类型:', typeof this.active);
console.log('调试信息 - finishStatus:', this.finishStatus);
console.log('调试信息 - 步骤条配置检查 - active值应为3时:', this.active === 3, 'finishStatus:', this.finishStatus);
// 地区转换
this.form.nativePlace = this.form.jg !== null ? this.parseSelectedPath(this.form.jg) : '暂无填写'
// 地区转换
@@ -328,29 +408,100 @@ export default {
if (valid) {
if (this.form.id != null) {
updateStuIdReissue(this.form).then(response => {
this.$modal.msgSuccess("修改成功");
this.active = active
this.finishStatus = 'success'
this.isDisabled = true
// this.$router.replace({ inspectionProgress: this.form.inspectionProgress });
// 修改成功后修改路上参数
this.$router.push({ path: this.$route.path, query: { id: this.form.id, stuNo: this.form.stuNo, inspectionProgress: this.form.inspectionProgress } });
this.$modal.closeLoading()
console.log('修改响应:', response);
if (response.code === 200) {
this.$modal.msgSuccess("修改成功");
this.active = active
this.finishStatus = 'success'
this.isDisabled = true
// 修改成功后修改路由参数
this.$router.push({ path: this.$route.path, query: { id: this.form.id, stuNo: this.form.stuNo, inspectionProgress: this.form.inspectionProgress } });
}
// 移除else分支让全局拦截器处理所有非200的情况
}).catch(error => {
this.$modal.closeLoading()
console.log('修改捕获到错误 - error:', error);
// 如果error是字符串'error'说明是全局拦截器返回的Promise.reject('error')
// 这种情况下,全局拦截器已经显示了错误信息,这里不再重复显示
if (error === 'error') {
console.log('修改业务错误已由全局拦截器处理');
return;
}
// 忽略由于路由跳转/刷新导致的请求取消错误,避免误报网络错误
const isCanceled = error && (
error.code === 'ERR_CANCELED' ||
error.message === 'canceled' ||
error.message === 'Cancel' ||
error.__CANCEL__ === true ||
(typeof error.message === 'string' && /cancel/i.test(error.message))
);
if (isCanceled) {
console.log('请求被取消,已忽略该错误提示');
return;
}
// 只处理真正的网络错误
if (!error.response) {
this.$modal.msgError("网络连接失败,请检查网络");
}
});
} else {
addStuIdReissue(this.form).then(response => {
if (response.code === 500) {
this.$modal.closeLoading()
return
}
else {
this.$modal.closeLoading()
console.log('提交响应:', response);
if (response.code === 200) {
this.$modal.msgSuccess("提交申请成功");
this.active = active
// this.reset()
this.$modal.closeLoading()
this.finishStatus = 'success'
this.isDisabled = true
// 新增成功后跳转到详情页面
console.log('提交成功,更新表单状态');
this.form.inspectionProgress = 0;
// 设置表单ID如果后端返回了ID
if (response.data && response.data.id) {
this.form.id = response.data.id;
}
// 更新路由参数,不刷新页面
setTimeout(() => {
this.$message.info('申请提交成功');
// 使用replace更新路由避免强制刷新
if (this.form.id) {
this.$router.replace({
path: this.$route.path,
query: {
id: this.form.id,
stuNo: this.form.stuNo,
inspectionProgress: this.form.inspectionProgress
}
});
}
}, 1000);
}
}).catch(error => {
this.$modal.closeLoading()
console.log('提交捕获到错误 - error:', error);
// 如果error是字符串'error'说明是全局拦截器返回的Promise.reject('error')
// 这种情况下,全局拦截器已经显示了错误信息,这里不再重复显示
if (error === 'error') {
console.log('提交业务错误已由全局拦截器处理');
return;
}
// 忽略由于路由跳转/刷新导致的请求取消错误
const isCanceled = error && (
error.code === 'ERR_CANCELED' ||
error.message === 'canceled' ||
error.message === 'Cancel' ||
error.__CANCEL__ === true ||
(typeof error.message === 'string' && /cancel/i.test(error.message))
);
if (!error.response) {
this.$modal.msgError("网络连接失败,请检查网络");
}
});
}
} else {
this.$modal.closeLoading()
this.$modal.msgError("请完善必填信息");
}
});
},
@@ -388,6 +539,51 @@ export default {
listId: this.form.id || null,
},
})
},
// 继续提交申请(已完成制作后可重新申请)
submitNewApplication() {
this.$confirm('您已完成制作,是否要重新提交新的申请?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
// 重置表单为新申请状态
this.reset();
this.isDisabled = false;
this.isDisabledStuNo = false;
this.finishStatus = 'success';
this.active = 1;
// 清除路由参数,进入新申请模式
this.$router.push({ path: this.$route.path });
this.$message.success('已重置为新申请状态,请填写申请信息');
}).catch(() => {
this.$message.info('已取消操作');
});
},
// 取消申请
cancelApplication() {
this.$confirm('确认要取消此申请吗?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
// 调用删除接口
this.$modal.loading('正在取消申请...');
delStuIdReissue(this.form.id).then(response => {
this.$modal.closeLoading();
this.$modal.msgSuccess('申请已取消');
// 返回列表页面
this.$router.push('/routine/sicr/stuIdReissueLIst');
}).catch(() => {
this.$modal.closeLoading();
});
}).catch(() => {
this.$message.info('已取消操作');
});
},
// 显示已完成消息
showCompletedMessage() {
this.$message.info('当前审核已完成,不可取消');
}
}
};