应征入伍保留学籍申请表附件删除
This commit is contained in:
@@ -51,3 +51,12 @@ export function delEnlistmentReserveAttach(id) {
|
|||||||
method: 'post'
|
method: 'post'
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 删除保留学籍申请附件(入伍通知书等)
|
||||||
|
export function deleteRtEnlistmentReserveAttachByFileNameAndStuName(query) {
|
||||||
|
return request({
|
||||||
|
url: '/routine/enlistmentReserveAttach/deleteRtEnlistmentReserve',
|
||||||
|
method: 'post',
|
||||||
|
params: query
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|||||||
@@ -251,6 +251,10 @@ export default {
|
|||||||
if(this.fileList.length == 0){
|
if(this.fileList.length == 0){
|
||||||
this.affixId = ''
|
this.affixId = ''
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 关键:触发自定义事件,传递被删除的文件名
|
||||||
|
// 事件名建议:delete-file,参数:file.name(文件名)
|
||||||
|
this.$emit('delete-file', file.name);
|
||||||
} else {
|
} else {
|
||||||
this.$message.error(res.message)
|
this.$message.error(res.message)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -728,7 +728,8 @@ export default {
|
|||||||
variables: {
|
variables: {
|
||||||
variables: {},
|
variables: {},
|
||||||
approvalOpinion: '', // 必须初始化,避免 null 报错
|
approvalOpinion: '', // 必须初始化,避免 null 报错
|
||||||
approvalResult: ''
|
approvalResult: '',
|
||||||
|
targetNodeName: ''
|
||||||
},
|
},
|
||||||
penaltyNumber: '',
|
penaltyNumber: '',
|
||||||
letterServiceContent: '',
|
letterServiceContent: '',
|
||||||
@@ -1015,24 +1016,7 @@ export default {
|
|||||||
|
|
||||||
|
|
||||||
// 初始化或完善 variables 对象,确保 approvalOpinion(入伍保留学籍申请审核意见) 存在
|
// 初始化或完善 variables 对象,确保 approvalOpinion(入伍保留学籍申请审核意见) 存在
|
||||||
if (this.taskForm.variables == null) {
|
this.initApproval()
|
||||||
// 情况1:variables 为 null → 初始化完整结构(包含原有 variables 嵌套和 approvalOpinion)
|
|
||||||
this.taskForm.variables = {
|
|
||||||
variables: {}, // 保留原有的嵌套 variables 结构(后端可能依赖)
|
|
||||||
approvalOpinion: '', // 初始化审批意见为空白
|
|
||||||
approvalResult: ''
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
// 情况2:variables 已存在 → 保留原有字段,补充 approvalOpinion(无则添加,有则保留原值)
|
|
||||||
this.taskForm.variables = {
|
|
||||||
...this.taskForm.variables, // 展开原有所有字段(如 variables、其他自定义字段)
|
|
||||||
approvalOpinion: this.taskForm.variables.approvalOpinion || '', // 兜底:若原有未定义则设为空白
|
|
||||||
approvalResult: this.taskForm.variables.approvalOpinion || ''
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
this.formKeyExist = res.data.formKeyExist
|
this.formKeyExist = res.data.formKeyExist
|
||||||
})
|
})
|
||||||
@@ -1172,10 +1156,33 @@ export default {
|
|||||||
returnList(this.taskForm).then((res) => {
|
returnList(this.taskForm).then((res) => {
|
||||||
this.returnTaskList = res.data
|
this.returnTaskList = res.data
|
||||||
this.taskForm.variables = null
|
this.taskForm.variables = null
|
||||||
|
|
||||||
|
|
||||||
|
if (this.category == 'enlistmentReserve') {
|
||||||
|
// 过滤returnTaskList,保留documentation在flowRecordList的taskName中存在的项
|
||||||
|
this.returnTaskList = this.returnTaskList.filter(returnTask => {
|
||||||
|
// 检查flowRecordList中是否有项的taskName等于当前returnTask的documentation
|
||||||
|
return this.flowRecordList.some(record => record.taskName === returnTask.documentation)
|
||||||
|
})
|
||||||
|
console.log(this.flowRecordList);
|
||||||
|
|
||||||
|
}
|
||||||
|
this.initApproval()
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
/** 提交退回任务 */
|
/** 提交退回任务 */
|
||||||
taskReturn() {
|
taskReturn() {
|
||||||
|
// 入伍保留学籍审核状态和意见
|
||||||
|
if (this.category == 'enlistmentReserve') {
|
||||||
|
this.taskForm.variables.approvalResult = 3
|
||||||
|
this.taskForm.variables.approvalOpinion = this.taskForm.comment
|
||||||
|
this.returnTaskList.forEach(element => {
|
||||||
|
if (element.id == this.taskForm.targetKey) {
|
||||||
|
this.taskForm.variables.targetNodeName = element.documentation
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
this.$refs['taskForm'].validate((valid) => {
|
this.$refs['taskForm'].validate((valid) => {
|
||||||
if (valid) {
|
if (valid) {
|
||||||
returnTask(this.taskForm).then((res) => {
|
returnTask(this.taskForm).then((res) => {
|
||||||
@@ -1240,6 +1247,27 @@ export default {
|
|||||||
fileUpload() {
|
fileUpload() {
|
||||||
download.resource(this.pdfURL)
|
download.resource(this.pdfURL)
|
||||||
},
|
},
|
||||||
|
// 初始化入伍保留学籍申请审核意见参数
|
||||||
|
initApproval() {
|
||||||
|
// 初始化或完善 variables 对象,确保 approvalOpinion(入伍保留学籍申请审核意见) 存在
|
||||||
|
if (this.taskForm.variables == null) {
|
||||||
|
// 情况1:variables 为 null → 初始化完整结构(包含原有 variables 嵌套和 approvalOpinion)
|
||||||
|
this.taskForm.variables = {
|
||||||
|
variables: {}, // 保留原有的嵌套 variables 结构(后端可能依赖)
|
||||||
|
approvalOpinion: '', // 初始化审批意见为空白
|
||||||
|
approvalResult: '', // 审批状态
|
||||||
|
targetNodeName: '' // 审批节点
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
// 情况2:variables 已存在 → 保留原有字段,补充 approvalOpinion(无则添加,有则保留原值)
|
||||||
|
this.taskForm.variables = {
|
||||||
|
...this.taskForm.variables, // 展开原有所有字段(如 variables、其他自定义字段)
|
||||||
|
approvalOpinion: this.taskForm.variables.approvalOpinion || '', // 兜底:若原有未定义则设为空白
|
||||||
|
approvalResult: this.taskForm.variables.approvalResult || '',
|
||||||
|
targetNodeName: this.taskForm.variables.targetNodeName || ''
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -248,7 +248,7 @@
|
|||||||
<el-form-item prop="affixId">
|
<el-form-item prop="affixId">
|
||||||
<p class="attachment-tip">
|
<p class="attachment-tip">
|
||||||
<span style="color: red">请上传:入伍通知书等佐证材料.</span>
|
<span style="color: red">请上传:入伍通知书等佐证材料.</span>
|
||||||
<Affix v-model="formData.affixId" @input="handleAffix" @fileUploaded="handleAffix" />
|
<Affix v-model="formData.affixId" @input="handleAffix" @fileUploaded="handleAffix" @delete-file="handleDeleteFile"/>
|
||||||
</p>
|
</p>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
|
||||||
@@ -425,9 +425,9 @@
|
|||||||
<!-- 操作按钮 -->
|
<!-- 操作按钮 -->
|
||||||
<div class="form-btn-group">
|
<div class="form-btn-group">
|
||||||
<el-button type="primary" @click="submitForm(0)">保存</el-button>
|
<el-button type="primary" @click="submitForm(0)">保存</el-button>
|
||||||
<el-button type="primary" @click="submitForm(1)">提交申请</el-button>
|
<el-button type="primary" @click="submitForm(1)" v-if="formData.applyStatus == 0">提交申请</el-button>
|
||||||
<el-button @click="resetForm">重置表单</el-button>
|
<!-- <el-button @click="resetForm">重置表单</el-button> -->
|
||||||
<el-button type="text" @click="printForm">打印表单</el-button>
|
<!-- <el-button type="text" @click="printForm">打印表单</el-button> -->
|
||||||
</div>
|
</div>
|
||||||
</el-form>
|
</el-form>
|
||||||
</div>
|
</div>
|
||||||
@@ -435,7 +435,7 @@
|
|||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { getOwnInfo, getEnlistmentReserve, delEnlistmentReserve, addEnlistmentReserve, updateEnlistmentReserve } from "@/api/routine/enlistmentReserve/enlistmentReserve";
|
import { getOwnInfo, getEnlistmentReserve, delEnlistmentReserve, addEnlistmentReserve, updateEnlistmentReserve } from "@/api/routine/enlistmentReserve/enlistmentReserve";
|
||||||
import { batchAddEnlistmentReserveAttach } from "@/api/routine/enlistmentReserve/enlistmentReserveAttach";
|
import { batchAddEnlistmentReserveAttach, deleteRtEnlistmentReserveAttachByFileNameAndStuName } from "@/api/routine/enlistmentReserve/enlistmentReserveAttach";
|
||||||
import { getUserProfile } from '@/api/system/user' // 获取当前登录用户
|
import { getUserProfile } from '@/api/system/user' // 获取当前登录用户
|
||||||
import { flowRecord } from '@/api/flowable/finished'
|
import { flowRecord } from '@/api/flowable/finished'
|
||||||
export default {
|
export default {
|
||||||
@@ -603,6 +603,7 @@ export default {
|
|||||||
this.getFlowRecordList()
|
this.getFlowRecordList()
|
||||||
} else {
|
} else {
|
||||||
this.deployId = null
|
this.deployId = null
|
||||||
|
this.loading = false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -678,10 +679,9 @@ export default {
|
|||||||
if (!this.formData.applyNo) {
|
if (!this.formData.applyNo) {
|
||||||
const year = new Date().getFullYear();
|
const year = new Date().getFullYear();
|
||||||
const randomNo = Math.floor(Math.random() * 1000000).toString().padStart(6, '0');
|
const randomNo = Math.floor(Math.random() * 1000000).toString().padStart(6, '0');
|
||||||
this.formData.applyNo = `RY${year}${randomNo}`;
|
this.formData.applyNo = `RY${year}${randomNo}`; // 获取申请编号
|
||||||
this.formData.reserveNo = `RN${year}${randomNo}`;
|
this.formData.reserveNo = `RN${year}${randomNo}`; // 获取保留学籍编号
|
||||||
}
|
}
|
||||||
this.formData.applyStatus = applyStatus;
|
|
||||||
this.formData.updateTime = new Date().toISOString().split('T')[0];
|
this.formData.updateTime = new Date().toISOString().split('T')[0];
|
||||||
this.formData.applyReason = "本人应征入伍,申请保留学籍从 " + this.formData.reserveStartDate + " 至退役后两年。"
|
this.formData.applyReason = "本人应征入伍,申请保留学籍从 " + this.formData.reserveStartDate + " 至退役后两年。"
|
||||||
|
|
||||||
@@ -695,6 +695,8 @@ export default {
|
|||||||
this.loading = false;
|
this.loading = false;
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
|
// 新增的时候根据点击的按钮确定状态,点击保存按钮申请状态是草稿,点击提交按钮申请状态就是待审核
|
||||||
|
this.formData.applyStatus = applyStatus;
|
||||||
addEnlistmentReserve(submitData.formData).then(response => {
|
addEnlistmentReserve(submitData.formData).then(response => {
|
||||||
this.$modal.msgSuccess("新增成功");
|
this.$modal.msgSuccess("新增成功");
|
||||||
// 申请表新增成功之后,进行附件的添加
|
// 申请表新增成功之后,进行附件的添加
|
||||||
@@ -704,11 +706,13 @@ export default {
|
|||||||
element.applyNo = this.formData.applyNo
|
element.applyNo = this.formData.applyNo
|
||||||
element.applyId = response.data.id
|
element.applyId = response.data.id
|
||||||
})
|
})
|
||||||
batchAddEnlistmentReserveAttach(this.enlistmentReserveAttachList)
|
|
||||||
this.loading = false;
|
this.loading = false;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
// 批量新增材料附件
|
||||||
|
batchAddEnlistmentReserveAttach(this.enlistmentReserveAttachList)
|
||||||
|
this.goBack()
|
||||||
// this.$message.success('提交成功!');
|
// this.$message.success('提交成功!');
|
||||||
} else {
|
} else {
|
||||||
this.$message.error('表单填写不完整,请检查!');
|
this.$message.error('表单填写不完整,请检查!');
|
||||||
@@ -779,6 +783,15 @@ export default {
|
|||||||
}
|
}
|
||||||
console.log(this.enlistmentReserveAttachList);
|
console.log(this.enlistmentReserveAttachList);
|
||||||
|
|
||||||
|
},
|
||||||
|
// 处理子组件传递的删除文件事件
|
||||||
|
handleDeleteFile(fileName) {
|
||||||
|
// 接收文件名后,可执行后续逻辑,删除在数据库的数据
|
||||||
|
if (fileName) {
|
||||||
|
deleteRtEnlistmentReserveAttachByFileNameAndStuName({fileName:fileName, studentName: this.formData.studentName}).then(res => {
|
||||||
|
this.$message.success(`成功删除文件:${fileName}`);
|
||||||
|
})
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -454,7 +454,16 @@ export default {
|
|||||||
},
|
},
|
||||||
// 跳转申请表
|
// 跳转申请表
|
||||||
openForm() {
|
openForm() {
|
||||||
this.$router.push("/routine/enlistmentReserve/applicationForm")
|
// 利用some方法快速判断是否存在重复申请(找到匹配项后立即终止遍历)
|
||||||
|
const isDuplicate = this.enlistmentReserveList?.some(element =>
|
||||||
|
element.studentName === this.user?.nickName && element.studentNo === this.user?.userName
|
||||||
|
) || false;
|
||||||
|
|
||||||
|
if (isDuplicate) {
|
||||||
|
this.$message.error('您已经申请过了,请勿重新申请!');
|
||||||
|
} else {
|
||||||
|
this.$router.push("/routine/enlistmentReserve/applicationForm");
|
||||||
|
}
|
||||||
},
|
},
|
||||||
detail(row) {
|
detail(row) {
|
||||||
this.$router.push({
|
this.$router.push({
|
||||||
|
|||||||
Reference in New Issue
Block a user