外宿申请-流程表单
This commit is contained in:
@@ -111,7 +111,7 @@
|
||||
|
||||
<!-- 佐证附件 -->
|
||||
<el-descriptions-item label="佐证附件" required>
|
||||
<el-form-item prop="reasonFileList" class="no-label-form-item">
|
||||
<el-form-item prop="affixId" class="no-label-form-item">
|
||||
<Affix v-model="form.affixId" @input="handleAffix" @fileUploaded="handleAffix"
|
||||
@delete-file="handleDeleteFile" />
|
||||
<div class="el-upload__tip">
|
||||
@@ -407,13 +407,7 @@ export default {
|
||||
promiseDate: [{ required: true, message: '请选择签署日期', trigger: 'change' }],
|
||||
studentSignature: [{ required: true, message: '请完成电子签名', trigger: 'change' }],
|
||||
studentPromiseSign: [{ required: true, message: '请完成承诺签名', trigger: 'change' }],
|
||||
reasonFileList: [
|
||||
{
|
||||
required: true,
|
||||
validator: (r, v, c) =>
|
||||
this.reasonFileList.length ? c() : c(new Error('请上传佐证附件'))
|
||||
}
|
||||
],
|
||||
affixId: [{ required: true, message: '请上传佐证材料', trigger: 'blur' }],
|
||||
parentSignAttachment: [
|
||||
{
|
||||
required: true,
|
||||
@@ -462,32 +456,15 @@ export default {
|
||||
// 回显家长签字附件
|
||||
this.fileList = [{ name: fileName, url: this.baseUrl + this.form.parentSignAttachment }]
|
||||
// 处理审批意见列表,添加意见类型
|
||||
// if (this.form?.enlistmentReserveApprovalList) {
|
||||
// // 定义意见类型数组(与索引对应:0=辅导员,1=学务,2=二级学院,3=学籍管理科,4=教务处主管领导)
|
||||
// const opinionTypes = [
|
||||
// "辅导员意见",
|
||||
// "学务意见",
|
||||
// "二级学院意见",
|
||||
// "学籍管理科意见",
|
||||
// "教务处主管领导意见"
|
||||
// ];
|
||||
// // 遍历审批列表,为每条数据添加 opinionType 字段
|
||||
// this.formData.enlistmentReserveApprovalList.forEach((item, index) => {
|
||||
// // 只处理前5条数据(超出部分不添加,或可根据实际需求调整)
|
||||
// if (index < opinionTypes.length) {
|
||||
// item.opinionType = opinionTypes[index];
|
||||
// } else {
|
||||
// // 若超过5条,可设置默认值或不设置
|
||||
// item.opinionType = "其他意见";
|
||||
// }
|
||||
// });
|
||||
// }
|
||||
this.loading = false
|
||||
})
|
||||
} else {
|
||||
// 若 id 为空,可做清空处理
|
||||
this.currentId = null;
|
||||
this.resetForm()
|
||||
// 延迟执行重置,确保 formRef 已挂载
|
||||
this.$nextTick(() => {
|
||||
this.resetForm()
|
||||
})
|
||||
this.getUser()
|
||||
}
|
||||
}
|
||||
@@ -792,7 +769,10 @@ export default {
|
||||
|
||||
// 重置表单
|
||||
resetForm() {
|
||||
this.$refs.formRef.resetFields()
|
||||
// 先判断 formRef 是否存在,再调用 resetFields
|
||||
if (this.$refs.formRef) {
|
||||
this.$refs.formRef.resetFields()
|
||||
}
|
||||
this.reasonFileList = []
|
||||
this.fileList = []
|
||||
this.form.affixId = ""
|
||||
@@ -997,8 +977,8 @@ export default {
|
||||
const currentYear = now.getFullYear();
|
||||
// 计算次年(当前年+1)
|
||||
const nextYear = currentYear + 1;
|
||||
// 生成次年8月31日(月份从0开始,8月对应9)
|
||||
const endDate = new Date(nextYear, 8, 31);
|
||||
// 8月对应的索引是7(0=1月,1=2月...7=8月)
|
||||
const endDate = new Date(nextYear, 7, 31); // 次年8月31日
|
||||
// 格式化为 yyyy-MM-dd(适配 el-date-picker 的 value-format)
|
||||
return this.formatDate(endDate);
|
||||
},
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
<!-- 详细外宿申请表 -->
|
||||
<template>
|
||||
<div class="application-form-container" v-loading="loading">
|
||||
<div class="application-form-container" v-loading="loading" :style="isShwo ? 'width: 70%' : ''">
|
||||
<el-card class="box-card">
|
||||
<div slot="header" class="clearfix">
|
||||
<div slot="header" class="clearfix" v-if="isShwo">
|
||||
<span class="el-icon-document">外宿申请详情</span>
|
||||
<el-button style="float: right;margin-left: 10px;" size="mini" type="danger" @click="goBack">关闭</el-button>
|
||||
<el-button v-print="printobj" style="float: right" size="mini" type="success">打印</el-button>
|
||||
@@ -168,13 +168,36 @@
|
||||
</div>
|
||||
</div>
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item span="4">
|
||||
<template slot="label"> 辅导员意见 </template>
|
||||
{{ renderData.reserveNo }}
|
||||
<el-descriptions-item span="4" v-for="item in renderData.outsideAccommodationApprovals">
|
||||
<template slot="label"> {{ item.opinionType }} </template>
|
||||
<div>{{ item.approvalOpinion }}</div>
|
||||
<div style="padding: 0 20px;">
|
||||
<div style="display: flex;justify-content: flex-end;align-items: center;">
|
||||
<div style="margin-right: 10px;">
|
||||
<span>
|
||||
审批结果:
|
||||
<el-tag v-if="item.approvalResult == 1" type="success">通过</el-tag>
|
||||
<el-tag v-else type="danger">驳回</el-tag>
|
||||
</span>
|
||||
</div>
|
||||
<div
|
||||
style="display: flex;justify-content: center;align-items: center;min-width: 130px;text-align: left;">
|
||||
<div>审批人: </div>
|
||||
<div>
|
||||
<!-- <el-image style="width: 100px; height: 50px; margin-left: 10px; border: 1px solid #eee"
|
||||
:src="baseUrl + renderData.studentPromiseSign"
|
||||
:preview-src-list="[baseUrl + renderData.studentPromiseSign]">
|
||||
</el-image> -->
|
||||
{{ item.approverName }}
|
||||
</div>
|
||||
</div>
|
||||
<div style="margin-left: 10px;">日期: {{ item.approvalTime }}</div>
|
||||
</div>
|
||||
</div>
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item span="4">
|
||||
<template slot="label"> 保留学籍时间和编号 </template>
|
||||
{{ renderData.reserveNo }}
|
||||
<template slot="label"> 申请编号 </template>
|
||||
{{ renderData.applyNo }}
|
||||
</el-descriptions-item>
|
||||
</el-descriptions>
|
||||
</div>
|
||||
@@ -194,6 +217,10 @@ export default {
|
||||
formData: {
|
||||
type: Object, // 正确的对象类型声明
|
||||
default: () => ({}) // 函数返回空对象(避免所有实例共享同一个对象)
|
||||
},
|
||||
isShwo: {
|
||||
type: Boolean,
|
||||
default: true
|
||||
}
|
||||
},
|
||||
data() {
|
||||
@@ -228,9 +255,28 @@ export default {
|
||||
renderData() {
|
||||
// 规则:有接口数据(detailData有内容)则用detailData,否则用props的formData
|
||||
// Object.keys(this.detailData).length > 0 表示detailData非空
|
||||
return Object.keys(this.detailData).length > 0
|
||||
? this.detailData
|
||||
: this.formData;
|
||||
let data = Object.keys(this.detailData).length > 0 ? this.detailData : this.formData
|
||||
// 处理外宿审批意见列表,添加意见类型
|
||||
if (data?.outsideAccommodationApprovals) {
|
||||
// 定义外宿审批意见类型数组(与索引严格对应)
|
||||
const opinionTypes = [
|
||||
"辅导员意见",
|
||||
"学工处意见",
|
||||
"二级学院书记意见",
|
||||
"学校领导意见"
|
||||
];
|
||||
// 遍历审批列表,为每条数据添加 opinionType 字段
|
||||
data.outsideAccommodationApprovals.forEach((item, index) => {
|
||||
// 前4条数据按索引匹配意见类型,超出部分设为默认值
|
||||
if (index < opinionTypes.length) {
|
||||
item.opinionType = opinionTypes[index];
|
||||
} else {
|
||||
// 超出4条时的兜底值
|
||||
item.opinionType = "其他审批意见";
|
||||
}
|
||||
});
|
||||
}
|
||||
return data
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
@@ -281,7 +327,6 @@ export default {
|
||||
<style scoped>
|
||||
/* @import url(); 引入css类 */
|
||||
.application-form-container {
|
||||
width: 70%;
|
||||
margin: auto;
|
||||
padding: 30px;
|
||||
box-sizing: border-box;
|
||||
|
||||
Reference in New Issue
Block a user