外宿申请-审批生成审批记录
This commit is contained in:
@@ -261,8 +261,8 @@ export default {
|
||||
// 定义外宿审批意见类型数组(与索引严格对应)
|
||||
const opinionTypes = [
|
||||
"辅导员意见",
|
||||
"学工处意见",
|
||||
"二级学院书记意见",
|
||||
"学工处意见",
|
||||
"学校领导意见"
|
||||
];
|
||||
// 遍历审批列表,为每条数据添加 opinionType 字段
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px" :label-position="`left`">
|
||||
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px"
|
||||
:label-position="`left`">
|
||||
<el-form-item label="学号" prop="studentNo">
|
||||
<el-input v-model="queryParams.studentNo" placeholder="请输入学号" clearable @keyup.enter.native="handleQuery" />
|
||||
</el-form-item>
|
||||
@@ -107,30 +108,36 @@
|
||||
</el-table-column>
|
||||
<el-table-column label="外宿详细地址" align="center" prop="outsideAddress">
|
||||
<template slot-scope="scope">
|
||||
<el-tooltip class="item" effect="dark" :content="scope.row.address + ' ' + scope.row.outsideAddress" placement="top">
|
||||
<el-tooltip class="item" effect="dark" :content="scope.row.address + ' ' + scope.row.outsideAddress"
|
||||
placement="top">
|
||||
<div class="text-ellipsis">{{ scope.row.address + " " + scope.row.outsideAddress }}</div>
|
||||
</el-tooltip>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="外宿开始时间" align="center" prop="startDate" width="100px">
|
||||
<el-table-column label="外宿开始时间" align="center" prop="startDate" width="100px">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ parseTime(scope.row.startDate, '{y}-{m}-{d}') }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="外宿结束时间" align="center" prop="endDate" width="100px">
|
||||
<el-table-column label="外宿结束时间" align="center" prop="endDate" width="100px">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ parseTime(scope.row.endDate, '{y}-{m}-{d}') }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="申请状态" align="center" prop="status" width="110px">
|
||||
<template slot-scope="scope">
|
||||
<el-tag v-if="scope.row.status == 0 && scope.row.status == ''" type="info">待提交</el-tag>
|
||||
<el-tag v-if="scope.row.status == 6" type="info">审批驳回</el-tag>
|
||||
<el-tag v-if="scope.row.status == 1">待辅导员审批</el-tag>
|
||||
<el-tag v-if="scope.row.status == 2">待学院书记审批</el-tag>
|
||||
<el-tag v-if="scope.row.status == 3">待学工处审批</el-tag>
|
||||
<el-tag v-if="scope.row.status == 4">待学校领导审批</el-tag>
|
||||
<el-tag v-if="scope.row.status == 5" type="success">审核通过</el-tag>
|
||||
<!-- 优先判断是否驳回:只要有一条审批结果为0,就显示驳回 -->
|
||||
<!-- 动态显示驳回节点 + 驳回文字 -->
|
||||
<el-tag v-if="getRejectInfo(scope.row.outsideAccommodationApprovals).isReject" type="danger">
|
||||
{{ getRejectInfo(scope.row.outsideAccommodationApprovals).rejectText }}
|
||||
</el-tag>
|
||||
<!-- (调整顺序,驳回优先级最高) -->
|
||||
<el-tag v-else-if="scope.row.status == 0 || scope.row.status == ''" type="info">待提交</el-tag>
|
||||
<el-tag v-else-if="scope.row.status == 1">待辅导员审批</el-tag>
|
||||
<el-tag v-else-if="scope.row.status == 2">待学院书记审批</el-tag>
|
||||
<el-tag v-else-if="scope.row.status == 3">待学工处审批</el-tag>
|
||||
<el-tag v-else-if="scope.row.status == 4">待学校领导审批</el-tag>
|
||||
<el-tag v-else-if="scope.row.status == 5" type="success">审核通过</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="是否有效" align="center" prop="isValid">
|
||||
@@ -142,10 +149,11 @@
|
||||
<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)"
|
||||
v-hasPermi="['dormitory:outsideAccommodationApply:edit']" v-if="scope.row.status == 0 || scope.row.status == 6">修改</el-button>
|
||||
v-hasPermi="['dormitory:outsideAccommodationApply:edit']"
|
||||
v-if="scope.row.status == 0 || getRejectInfo(scope.row.outsideAccommodationApprovals).isReject">修改</el-button>
|
||||
<el-button size="mini" type="text" icon="el-icon-delete" @click="handleDelete(scope.row)"
|
||||
v-hasPermi="['dormitory:outsideAccommodationApply:remove']" v-if="scope.row.status == 0">删除</el-button>
|
||||
<el-button v-if="scope.row.applyStatus != 0" size="mini" type="text" icon="el-icon-info"
|
||||
<el-button v-if="scope.row.applyStatus != 0" size="mini" type="text" icon="el-icon-info"
|
||||
@click="detail(scope.row)">详情</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
@@ -470,7 +478,14 @@ export default {
|
||||
};
|
||||
},
|
||||
created() {
|
||||
this.getList();
|
||||
// this.getList();
|
||||
},
|
||||
// 路由守卫:当路由进入该组件时触发(解决返回后不刷新问题)
|
||||
beforeRouteEnter(to, from, next) {
|
||||
next(vm => {
|
||||
// vm 是组件实例,这里调用数据加载方法
|
||||
vm.getList();
|
||||
});
|
||||
},
|
||||
methods: {
|
||||
/** 查询外宿申请列表 */
|
||||
@@ -611,13 +626,35 @@ export default {
|
||||
},
|
||||
// 跳转申请表
|
||||
openForm() {
|
||||
this.$router.push("/dormitory/outsideAccommodation/applicationForm");
|
||||
this.$router.push("/dormitory/outsideAccommodation/applicationForm");
|
||||
},
|
||||
detail(row) {
|
||||
this.$router.push({
|
||||
path: "/dormitory/outsideAccommodation/detailApply",
|
||||
query: { id: row.id } // 将 row.id 放在 query 中
|
||||
});
|
||||
},
|
||||
/**
|
||||
* 获取驳回信息(是否驳回 + 驳回文字)
|
||||
* @param {Array} approvalList 审批意见列表
|
||||
* @returns {Object} { isReject: 布尔值, rejectText: 驳回文字 }
|
||||
*/
|
||||
getRejectInfo(approvalList) {
|
||||
// 空值保护:列表不存在/非数组/为空时,返回未驳回
|
||||
if (!approvalList || !Array.isArray(approvalList) || approvalList.length === 0) {
|
||||
return { isReject: false, rejectText: '' };
|
||||
}
|
||||
// 找到第一个审批结果为0(驳回)的记录
|
||||
const rejectItem = approvalList.find(item => item.approvalResult === 0);
|
||||
if (rejectItem) {
|
||||
// 提取审批节点名称(如「辅导员审批」→ 截取「辅导员」)
|
||||
const nodeName = rejectItem.approvalNode.replace('审批', '');
|
||||
// 拼接驳回文字(如「辅导员驳回」)
|
||||
return { isReject: true, rejectText: `${nodeName}驳回` };
|
||||
} else {
|
||||
// 无驳回记录
|
||||
return { isReject: false, rejectText: '' };
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
@@ -30,7 +30,7 @@
|
||||
</el-form>
|
||||
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<!-- <el-col :span="1.5">
|
||||
<el-button type="primary" plain icon="el-icon-plus" size="mini" @click="handleAdd"
|
||||
v-hasPermi="['dormitory:outsideAccommodationApproval:add']">新增</el-button>
|
||||
</el-col>
|
||||
@@ -45,7 +45,7 @@
|
||||
<el-col :span="1.5">
|
||||
<el-button type="warning" plain icon="el-icon-download" size="mini" @click="handleExport"
|
||||
v-hasPermi="['dormitory:outsideAccommodationApproval:export']">导出</el-button>
|
||||
</el-col>
|
||||
</el-col> -->
|
||||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
|
||||
@@ -89,18 +89,18 @@
|
||||
<!-- 添加或修改外宿申请审批记录对话框 -->
|
||||
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
|
||||
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
|
||||
<el-form-item label="外宿申请ID" prop="applyId">
|
||||
<!-- <el-form-item label="外宿申请ID" prop="applyId">
|
||||
<el-input v-model="form.applyId" placeholder="请输入外宿申请ID" />
|
||||
</el-form-item>
|
||||
<el-form-item label="申请编号" prop="applyNo">
|
||||
</el-form-item> -->
|
||||
<!-- <el-form-item label="申请编号" prop="applyNo">
|
||||
<el-input v-model="form.applyNo" placeholder="请输入申请编号" />
|
||||
</el-form-item>
|
||||
</el-form-item> -->
|
||||
<el-form-item label="审批节点" prop="approvalNode">
|
||||
<el-input v-model="form.approvalNode" placeholder="请输入审批节点" />
|
||||
</el-form-item>
|
||||
<el-form-item label="审批人ID" prop="approverId">
|
||||
<!-- <el-form-item label="审批人ID" prop="approverId">
|
||||
<el-input v-model="form.approverId" placeholder="请输入审批人ID" />
|
||||
</el-form-item>
|
||||
</el-form-item> -->
|
||||
<el-form-item label="审批人姓名" prop="approverName">
|
||||
<el-input v-model="form.approverName" placeholder="请输入审批人姓名" />
|
||||
</el-form-item>
|
||||
@@ -118,9 +118,9 @@
|
||||
placeholder="请选择审批时间">
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
<el-form-item label="流程实例ID" prop="processInstanceId">
|
||||
<!-- <el-form-item label="流程实例ID" prop="processInstanceId">
|
||||
<el-input v-model="form.processInstanceId" placeholder="请输入流程实例ID" />
|
||||
</el-form-item>
|
||||
</el-form-item> -->
|
||||
<el-form-item label="学生姓名" prop="studentName">
|
||||
<el-input v-model="form.studentName" placeholder="请输入学生姓名" />
|
||||
</el-form-item>
|
||||
|
||||
@@ -18,22 +18,22 @@
|
||||
</el-form>
|
||||
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<!-- <el-col :span="1.5">
|
||||
<el-button type="primary" plain icon="el-icon-plus" size="mini" @click="handleAdd"
|
||||
v-hasPermi="['dormitory:outsideAccommodationAttachment:add']">新增</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
</el-col> -->
|
||||
<!-- <el-col :span="1.5">
|
||||
<el-button type="success" plain icon="el-icon-edit" size="mini" :disabled="single" @click="handleUpdate"
|
||||
v-hasPermi="['dormitory:outsideAccommodationAttachment:edit']">修改</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
</el-col> -->
|
||||
<!-- <el-col :span="1.5">
|
||||
<el-button type="danger" plain icon="el-icon-delete" size="mini" :disabled="multiple" @click="handleDelete"
|
||||
v-hasPermi="['dormitory:outsideAccommodationAttachment:remove']">删除</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
</el-col> -->
|
||||
<!-- <el-col :span="1.5">
|
||||
<el-button type="warning" plain icon="el-icon-download" size="mini" @click="handleExport"
|
||||
v-hasPermi="['dormitory:outsideAccommodationAttachment:export']">导出</el-button>
|
||||
</el-col>
|
||||
</el-col> -->
|
||||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
|
||||
@@ -43,12 +43,33 @@
|
||||
<!-- <el-table-column label="外宿申请ID" align="center" prop="applyId" /> -->
|
||||
<el-table-column label="学生姓名" align="center" prop="studentName" />
|
||||
<el-table-column label="学生学号" align="center" prop="studentNo" />
|
||||
<el-table-column label="附件名称" align="center" prop="attachmentName" />
|
||||
<el-table-column label="附件存储URL" align="center" prop="attachmentUrl" />
|
||||
<el-table-column label="附件类型" align="center" prop="attachmentType" />
|
||||
<el-table-column label="附件名称" align="center" prop="attachmentName">
|
||||
<template slot-scope="scope">
|
||||
<el-tooltip class="item" effect="dark" :content="scope.row.attachmentName" placement="top">
|
||||
<div class="text-ellipsis">{{ scope.row.attachmentName }}</div>
|
||||
</el-tooltip>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="附件路径" align="center" prop="attachmentUrl">
|
||||
<template slot-scope="scope">
|
||||
<el-tooltip class="item" effect="dark" :content="`点击可下载文件`" placement="top">
|
||||
<div class="text-ellipsis">
|
||||
<el-link :href="`${baseUrl}${scope.row.attachmentUrl}`" :underline="false" target="_blank">
|
||||
<span style="color: #007AFF;">{{ scope.row.attachmentUrl }}</span>
|
||||
</el-link>
|
||||
</div>
|
||||
</el-tooltip>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<!-- <el-table-column label="附件类型" align="center" prop="attachmentType" /> -->
|
||||
<el-table-column label="附件大小" align="center" prop="fileSize" />
|
||||
<el-table-column label="附件后缀" align="center" prop="fileSuffix" />
|
||||
<el-table-column label="流程实例ID" align="center" prop="processInstanceId" />
|
||||
<el-table-column label="上传时间" align="center" prop="createTime" width="100px">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ parseTime(scope.row.createTime, '{y}-{m}-{d}') }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<!-- <el-table-column label="流程实例ID" align="center" prop="processInstanceId" /> -->
|
||||
<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)"
|
||||
@@ -105,6 +126,7 @@ export default {
|
||||
name: "OutsideAccommodationAttachment",
|
||||
data() {
|
||||
return {
|
||||
baseUrl:process.env.VUE_APP_BASE_API,
|
||||
// 遮罩层
|
||||
loading: true,
|
||||
// 选中数组
|
||||
@@ -268,3 +290,10 @@ export default {
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<style scoped>
|
||||
.text-ellipsis {
|
||||
white-space: nowrap; /* 防止文本换行 */
|
||||
overflow: hidden; /* 隐藏溢出的内容 */
|
||||
text-overflow: ellipsis; /* 显示省略号 */
|
||||
}
|
||||
</style>
|
||||
|
||||
Reference in New Issue
Block a user