外宿申请-审批生成审批记录
This commit is contained in:
@@ -26,6 +26,15 @@ export function addOutsideAccommodationApproval(data) {
|
||||
})
|
||||
}
|
||||
|
||||
// 新增或修改外宿申请审批记录
|
||||
export function addOrUpdateAccommodationApproval(data) {
|
||||
return request({
|
||||
url: '/dormitory/outsideAccommodationApproval/addOrUpdate',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 修改外宿申请审批记录
|
||||
export function updateOutsideAccommodationApproval(data) {
|
||||
return request({
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -353,7 +353,7 @@
|
||||
<template slot="label"> 申请原因 </template>
|
||||
<div style="padding-top: 10px;">
|
||||
{{ form.applyReason }}
|
||||
</div>
|
||||
</div>
|
||||
<div style="padding: 20px;">
|
||||
<div style="display: flex;justify-content: flex-end;align-items: center;">
|
||||
<div style="padding: 0 10px;">申请人: {{ form.studentName }}</div>
|
||||
@@ -362,7 +362,7 @@
|
||||
</div>
|
||||
</el-descriptions-item>
|
||||
|
||||
<el-descriptions-item span="4" v-for="item in form.enlistmentReserveApprovalList" >
|
||||
<el-descriptions-item span="4" v-for="item in form.enlistmentReserveApprovalList" >
|
||||
<template slot="label"> {{ item.opinionType }} </template>
|
||||
<div style="padding-top: 10px;">
|
||||
{{ item.approvalOpinion || "暂无意见" }}
|
||||
@@ -390,7 +390,8 @@
|
||||
{{ form.reserveNo }}
|
||||
</el-descriptions-item>
|
||||
</el-descriptions>
|
||||
|
||||
<!-- 外宿申请表单 -->
|
||||
<div v-if="outsideAccommodationForm"><detailApply :formData="form" :isShwo="false"></detailApply></div>
|
||||
</div>
|
||||
</el-col>
|
||||
</el-tab-pane>
|
||||
@@ -455,6 +456,8 @@ import Parser from '@/components/parser/Parser'
|
||||
import flow from '@/views/flowable/task/myProcess/detail/flow'
|
||||
import '@riophae/vue-treeselect/dist/vue-treeselect.css'
|
||||
import { getEnlistmentReserveByProcessInstanceId} from "@/api/routine/enlistmentReserve/enlistmentReserve";
|
||||
import { getOutsideAccommodationApplyByProcessInstanceId } from "@/api/dormitory/outsideAccommodation/outsideAccommodationApply";
|
||||
import detailApply from "@/views/dormitory/outsideAccommodation/outsideAccommodationApply/components/detailApply" // 外宿申请表详细
|
||||
|
||||
export default {
|
||||
name: 'Record',
|
||||
@@ -462,6 +465,7 @@ export default {
|
||||
components: {
|
||||
Parser,
|
||||
flow,
|
||||
detailApply
|
||||
},
|
||||
props: {},
|
||||
data() {
|
||||
@@ -492,6 +496,7 @@ export default {
|
||||
relieveForm: false, // 解除处分表单
|
||||
quitSchoolForm: false, // 休学申请表单
|
||||
enlistmentReserveForm: false, // 入伍保留学籍表单
|
||||
outsideAccommodationForm: false, // 外宿申请表单
|
||||
form: {},
|
||||
// 学生基础信息
|
||||
stuInfo: {},
|
||||
@@ -520,7 +525,10 @@ export default {
|
||||
} else if (this.category == 'enlistmentReserve') { // 应征入伍表单
|
||||
this.enlistmentReserveForm = true
|
||||
this.getEnlistmentReserve(this.taskForm.procInsId)
|
||||
}
|
||||
} else if (this.category == 'outsideAccommodation') {
|
||||
this.outsideAccommodationForm = true
|
||||
this.getOutsideAccommodation(this.taskForm.procInsId)
|
||||
}
|
||||
// 回显流程记录
|
||||
// 流程任务重获取变量表单
|
||||
this.processVariables(this.taskForm.taskId)
|
||||
@@ -589,6 +597,12 @@ export default {
|
||||
}
|
||||
})
|
||||
},
|
||||
// 请求 外宿申请表单数据
|
||||
getOutsideAccommodation(procInsId) {
|
||||
getOutsideAccommodationApplyByProcessInstanceId(procInsId.toString()).then((res) => {
|
||||
this.form = res.data
|
||||
})
|
||||
},
|
||||
getStuInfo(stuNo) {
|
||||
getStuInfo(stuNo).then((res) => {
|
||||
if (res.code == 200) {
|
||||
|
||||
@@ -906,6 +906,7 @@ import { updateStudent } from '@/api/stuCQS/basedata/student'
|
||||
import { getOutsideAccommodationApplyByProcessInstanceId } from "@/api/dormitory/outsideAccommodation/outsideAccommodationApply";
|
||||
import { listBasic, getBasic, delBasic, addBasic, updateBasic, getStname, getProcessId } from "@/api/routine/basic";
|
||||
import detailApply from "@/views/dormitory/outsideAccommodation/outsideAccommodationApply/components/detailApply" // 外宿申请表详细
|
||||
import { addOrUpdateAccommodationApproval } from "@/api/dormitory/outsideAccommodation/outsideAccommodationApproval";
|
||||
|
||||
export default {
|
||||
name: 'Record',
|
||||
@@ -1545,6 +1546,8 @@ export default {
|
||||
// 是应征入伍保留学籍申请,才执行
|
||||
if (this.category == 'enlistmentReserve') {
|
||||
this.taskReturnApproval("驳回")
|
||||
} else if (this.category == 'outsideAccommodation') { // 是外宿申请,才执行
|
||||
this.taskReturnAccommodationApproval()
|
||||
}
|
||||
else if (this.category == "退伍复学") {
|
||||
// updateBasic({stuId:this.form.stuId,fdStatus:"1",fdIdea:this.taskForm.comment}).then(response => {})
|
||||
@@ -1799,6 +1802,8 @@ export default {
|
||||
// 是应征入伍保留学籍申请,才执行
|
||||
if (this.category == 'enlistmentReserve') {
|
||||
this.taskReturnApproval("退回")
|
||||
} else if (this.category == 'outsideAccommodation') { // 是外宿申请,才执行
|
||||
this.taskReturnAccommodationApproval()
|
||||
}
|
||||
else if (this.category == "退伍复学") {
|
||||
// updateBasic({stuId:this.form.stuId,fdStatus:"1",fdIdea:this.taskForm.comment}).then(response => {})
|
||||
@@ -2029,6 +2034,27 @@ export default {
|
||||
}
|
||||
})
|
||||
})
|
||||
},
|
||||
// 退回或驳回的时候生成外宿申请审核
|
||||
taskReturnAccommodationApproval() {
|
||||
getUserProfile().then(res => {
|
||||
let data = {
|
||||
applyId: this.form.id,
|
||||
processInstanceId: this.form.processInstanceId,
|
||||
applyNo: this.form.applyNo,
|
||||
approvalNode: this.taskName,
|
||||
approverId: res.data.userId,
|
||||
approverName: res.data.nickName,
|
||||
approvalOpinion: this.taskForm.comment,
|
||||
approvalResult: 0,
|
||||
studentName: this.form.studentName,
|
||||
studentNo: this.form.studentNo
|
||||
}
|
||||
// 生成审核记录
|
||||
addOrUpdateAccommodationApproval(data).then(ress => {
|
||||
|
||||
})
|
||||
})
|
||||
}
|
||||
},
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user