入伍保留学籍申请、外宿申请移动端审批(退回和驳回)流程完成

This commit is contained in:
2025-12-22 16:22:45 +08:00
parent 28b7d7af64
commit 2521638b19
3 changed files with 329 additions and 44 deletions

View File

@@ -21,7 +21,7 @@
<view class="progress" v-if="navIndex==1">
<FlowStep :procInsId="taskForm.procInsId" :deployId="taskForm.deployId" />
</view>
<!-- 审批同意弹窗 -->
<uni-popup class="popup" ref="approveDialog" type="dialog" background-color="#fff">
<view class="popup-content">
<view class="title">
@@ -40,6 +40,41 @@
</view>
</view>
</uni-popup>
<!-- 驳回弹窗 -->
<uni-popup ref="rejectDialog" type="dialog">
<uni-popup-dialog mode="input" title="驳回" v-model="inputReject" @confirm="rejectDialogConfirm"
placeholder="请输入驳回理由"></uni-popup-dialog>
</uni-popup>
<!-- 回退弹窗 -->
<uni-popup class="popup return-dialog" ref="returnDialog" type="dialog" background-color="#fff">
<view class="popup-content">
<view class="title">
退回流程
</view>
<view class="content">
<view class="form-item">
<label>退回节点</label>
<scroll-view scroll-y="true">
<view class="list">
<view class="item" @tap="taskDotChange(index,item)"
:class="index==taskDotIndex?'active':''" v-for="(item,index) in returnTaskList"
:key="index">
{{item.name}}
</view>
</view>
</scroll-view>
</view>
<view class="form-item">
<label><text class="required">*</text>退回意见</label>
<textarea v-model="taskForm.comment"></textarea>
</view>
</view>
<view class="btns">
<button type="default" @tap="onCancel">取消</button>
<button type="primary" @tap="returnDialogConfirm">确定</button>
</view>
</view>
</uni-popup>
</view>
</template>
@@ -70,6 +105,7 @@
getOutsideAccommodationApplyByProcessInstanceId,
updateOutsideAccommodationApply
} from "@/api/dms/outsideAccommodation/outsideAccommodationApply";
import { addOrUpdateAccommodationApproval } from "@/api/dms/outsideAccommodation/outsideAccommodationApproval";
import {
insertOrUpdateByStuAndApprover
} from "@/api/routine/enlistmentReserve/enlistmentReserveApproval";
@@ -141,13 +177,13 @@
this.getEnlistmentReserve(this.taskForm.procInsId);
// 页面标题修改
uni.setNavigationBarTitle({
title: '入伍保留学籍申请详情'
title: '入伍保留学籍申请详情'
});
} else if (this.category == 'outsideAccommodation') { // 外宿申请表单
this.getOutsideAccommodation(this.taskForm.procInsId);
// 页面标题修改
uni.setNavigationBarTitle({
title: '外宿申请详情'
title: '外宿申请详情'
});
}
getUserProfile().then(res => {
@@ -205,6 +241,9 @@
}
});
}
if (this.tag == 1) {
this.getReturnList();
}
} catch (error) {
// 错误捕获,避免接口调用失败导致页面异常
console.error("获取数据失败:", error);
@@ -237,6 +276,9 @@
}
});
}
if (this.tag == 1) {
this.getReturnList();
}
})
},
onComplete() {
@@ -253,6 +295,7 @@
this.$refs.approveDialog.close();
this.$refs.returnDialog.close();
},
// 审批(同意)
approveDialogConfirm() {
if (this.taskForm.variables.approvalOpinion == '') {
uni.showToast({
@@ -270,8 +313,7 @@
this.taskForm.variables.approvalResult = 1
complete(this.taskForm).then(res => {
if (res.code == 200) {
if (this.taskName ==
'教务处主管领导审批') { // (最后一个领导审核完成之后,修改学生学籍状态, status07是入伍保留学籍)
if (this.taskName == '教务处主管领导审批') { // (最后一个领导审核完成之后,修改学生学籍状态, status07是入伍保留学籍)
updateStudent({
stuId: this.form.studentId,
status: '07'
@@ -302,6 +344,148 @@
})
})
},
// 驳回
rejectDialogConfirm() {
if (this.inputReject == "") {
uni.showToast({
title: `请填写驳回理由`,
icon: "none"
})
return;
}
uni.showLoading({
title: "正在驳回"
});
let sData = {
taskId: this.taskForm.taskId,
comment: this.inputReject
}
reject(sData).then(res => {
if (res.code == 200) {
// 是应征入伍保留学籍申请,才执行
if (this.category == 'enlistmentReserve') {
this.taskReturnApproval("驳回")
} else if (this.category == 'outsideAccommodation') { // 是外宿申请,才执行
this.taskReturnAccommodationApproval("驳回")
}
uni.showToast({
title: "已驳回"
})
uni.hideLoading();
uni.navigateBack({
success: () => {
const pages = getCurrentPages();
if (pages && pages.length > 0) {
const prevPage = pages[pages.length - 2] || pages[pages.length -
1];
if (prevPage && typeof prevPage.handleChange === 'function') {
prevPage.handleChange(this.tag || 1);
console.log('刷新任务数据');
}
}
}
})
}
})
},
// 退回或驳回的时候生成入伍保留学籍申请审核
taskReturnApproval(text) {
let data = {
applyId: this.form.id,
processInstanceId: this.form.processInstanceId,
taskId: this.taskForm.taskId,
nodeName: this.taskName,
approverId: this.user.userId,
approverName: this.user.nickName,
approvalOpinion: text == '驳回' ? this.inputReject : this.taskForm.comment,
approvalResult: 2,
studentName: this.form.studentName,
studentNo: this.form.studentNo,
signature: this.user.signature
}
// 生成审核记录
insertOrUpdateByStuAndApprover(data).then(ress => {})
},
// 退回或驳回的时候生成外宿申请审核
taskReturnAccommodationApproval(text) {
let data = {
applyId: this.form.id,
processInstanceId: this.form.processInstanceId,
applyNo: this.form.applyNo,
approvalNode: this.taskName,
approverId: this.user.userId,
approverName: this.user.nickName,
approvalOpinion: text == '驳回' ? this.inputReject : this.taskForm.comment,
approvalResult: 0,
studentName: this.form.studentName,
studentNo: this.form.studentNo,
signature: this.user.signature
}
// 生成审核记录
addOrUpdateAccommodationApproval(data).then(ress => {
// 退回或者驳回生产审批记录之后,更新申请表里面的驳回信息
updateOutsideAccommodationApply({
id: this.form.id,
rejectReason: text == '驳回' ? this.inputReject : this.taskForm.comment
})
})
},
// 获取退回节点
getReturnList() {
returnList(this.taskForm).then((res) => {
this.returnTaskList = res.data
})
},
// 选择退回节点时候获取节点id
taskDotChange(index, item) {
this.taskDotIndex = index;
this.taskForm.targetKey = item.id;
},
// 回退确认
returnDialogConfirm() {
if (this.taskForm.targetKey == "") {
this.taskForm.targetKey = this.returnTaskList[0].id;
}
if (this.taskForm.comment == "") {
uni.showToast({
title: `请填写回退意见`,
icon: "none"
});
return;
}
uni.showLoading({
title: "正在回退"
});
returnTask(this.taskForm).then((res) => {
// 是应征入伍保留学籍申请,才执行
if (this.category == 'enlistmentReserve') {
this.taskReturnApproval("退回")
} else if (this.category == 'outsideAccommodation') { // 是外宿申请,才执行
this.taskReturnAccommodationApproval("退回")
}
uni.showToast({
title: "已退回"
})
uni.hideLoading();
uni.showToast({
title: res.msg
})
uni.navigateBack({
success: () => {
const pages = getCurrentPages();
if (pages && pages.length > 0) {
const prevPage = pages[pages.length - 2] || pages[pages.length - 1];
if (prevPage && typeof prevPage.handleChange === 'function') {
prevPage.handleChange(this.tag || 1);
}
}
}
})
})
this.$refs.returnDialog.close();
},
}
}
</script>