|
@@ -51,6 +51,13 @@
|
|
|
<el-button @click="detail(scope.row)" :type="$dictUtils.getDictLabel('human_status_info', scope.row.type, '')" effect="dark" >{{$dictUtils.getDictLabel("human_status", scope.row.type, '未开始')}} </el-button>
|
|
|
</template>
|
|
|
</vxe-column>
|
|
|
+ <vxe-column min-width="100" title="交接状态" fixed="right" align="center" field="handoverType">
|
|
|
+ <template #default="scope">
|
|
|
+ <el-button @click="handoverDetail(scope.row)"
|
|
|
+ :type="$dictUtils.getDictLabel('cw_status_flag', scope.row.handoverType, '')" effect="dark" >
|
|
|
+ {{$dictUtils.getDictLabel("cw_status", scope.row.handoverType, '未开始')}} </el-button>
|
|
|
+ </template>
|
|
|
+ </vxe-column>
|
|
|
|
|
|
<vxe-column title="操作" width="200px" fixed="right" align="center">
|
|
|
<template #default="scope">
|
|
@@ -68,7 +75,10 @@
|
|
|
<el-button v-if="scope.row.type==='2'&& checkIsAudit(scope.row)" text type="primary" @click="examine(scope.row)">审核</el-button>
|
|
|
<!-- 被驳回后当前申请人重新调整-->
|
|
|
<el-button v-if="scope.row.createById === $store.state.user.id&&scope.row.type === '4'" text type="primary" @click="adjust(scope.row)">驳回调整</el-button>
|
|
|
- <el-button v-if="(scope.row.createById === $store.state.user.id) && haveComplete" text type="primary" @click="handover(scope.row)">离职交接</el-button>
|
|
|
+ <el-button v-if="(scope.row.createById === $store.state.user.id) && haveComplete && (scope.row.handoverType === undefined || scope.row.handoverType === '0' || scope.row.handoverType === '1' || scope.row.handoverType === '3')" text type="primary" @click="handover(scope.row)">离职交接</el-button>
|
|
|
+ <!--借用撤回-->
|
|
|
+ <el-button v-if="haveComplete && scope.row.handoverType === '2' && (scope.row.createById === $store.state.user.id)" text type="primary" @click="rebackHandover(scope.row)">撤回离职交接</el-button>
|
|
|
+ <el-button v-if="scope.row.createById === $store.state.user.id&&haveComplete&& scope.row.handoverType === '4'" text type="primary" @click="adjustHandover(scope.row)">驳回调整</el-button>
|
|
|
</div>
|
|
|
</template>
|
|
|
</vxe-column>
|
|
@@ -89,6 +99,7 @@
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
+ import handoverService from '@/api/human/depart/HandoverService'
|
|
|
import departRegistrationService from '@/api/human/depart/DepartRegistrationService'
|
|
|
import processService from '@/api/flowable/ProcessService'
|
|
|
import userService from '@/api/sys/UserService'
|
|
@@ -184,7 +195,7 @@
|
|
|
this.procDefAuditKey = data.key
|
|
|
}
|
|
|
})
|
|
|
- processService.getByName('离职交接').then((data) => {
|
|
|
+ processService.getByName('离职交接申请').then((data) => {
|
|
|
if (!this.commonJS.isEmpty(data.id)) {
|
|
|
this.handoverDefId = data.id
|
|
|
this.handoverDefAuditKey = data.key
|
|
@@ -238,7 +249,7 @@
|
|
|
},
|
|
|
// 查看离职申请流程结果
|
|
|
detail (row) {
|
|
|
- if (row.reviewStatus !== '0' && row.reviewStatus !== '1') {
|
|
|
+ if (row.type !== '0' && row.type !== '1') {
|
|
|
// eslint-disable-next-line eqeqeq
|
|
|
taskService.getTaskDef({
|
|
|
procInsId: row.procInsId,
|
|
@@ -259,6 +270,29 @@
|
|
|
})
|
|
|
}
|
|
|
},
|
|
|
+ // 查看离职交接流程结果
|
|
|
+ handoverDetail (row) {
|
|
|
+ if (row.handoverType !== '0' && row.handoverType !== '1') {
|
|
|
+ // eslint-disable-next-line eqeqeq
|
|
|
+ taskService.getTaskDef({
|
|
|
+ procInsId: row.handoverProcInsId,
|
|
|
+ procDefId: this.handoverDefId
|
|
|
+ }).then((data) => {
|
|
|
+ this.$router.push({
|
|
|
+ path: '/flowable/task/TaskFormDetail',
|
|
|
+ query: {
|
|
|
+ ...pick(data, 'formType', 'formUrl', 'procDefKey', 'taskDefKey', 'procInsId', 'procDefId', 'taskId', 'status', 'title'),
|
|
|
+ isShow: 'false',
|
|
|
+ readOnly: true,
|
|
|
+ title: '离职申请' + '流程详情',
|
|
|
+ formTitle: '离职申请' + '流程详情',
|
|
|
+ businessId: row.handoverId,
|
|
|
+ status: 'reback'
|
|
|
+ }
|
|
|
+ })
|
|
|
+ })
|
|
|
+ }
|
|
|
+ },
|
|
|
// 自定义服务端导出
|
|
|
exportMethod ({ options }) {
|
|
|
// 传给服务端的参数
|
|
@@ -376,6 +410,12 @@
|
|
|
// 读取流程表单
|
|
|
let tabTitle = `发起流程【离职交接】`
|
|
|
let processTitle = `${this.userName} 在 ${this.moment(new Date()).format('YYYY-MM-DD HH:mm')} 发起了 [离职交接]`
|
|
|
+ let businessId = ''
|
|
|
+ if (this.commonJS.isNotEmpty(row.handoverId)) {
|
|
|
+ businessId = row.handoverId
|
|
|
+ } else {
|
|
|
+ businessId = row.id
|
|
|
+ }
|
|
|
taskService.getTaskDef({ procDefId: this.handoverDefId,
|
|
|
status: 'startAndHold'}).then((data) => {
|
|
|
this.$router.push({
|
|
@@ -389,13 +429,46 @@
|
|
|
formType: data.formType,
|
|
|
formUrl: data.formUrl,
|
|
|
formTitle: processTitle,
|
|
|
- businessId: row.id,
|
|
|
+ businessId: businessId,
|
|
|
isShow: false,
|
|
|
routePath: '/human/depart/registration/DepartRegistrationList'
|
|
|
}
|
|
|
})
|
|
|
})
|
|
|
},
|
|
|
+ // 撤回离职交接
|
|
|
+ rebackHandover (row) {
|
|
|
+ this.$confirm(`确定要撤回该申请吗?`, '提示', {
|
|
|
+ confirmButtonText: '确定',
|
|
|
+ cancelButtonText: '取消',
|
|
|
+ type: 'warning'
|
|
|
+ }).then(async () => {
|
|
|
+ await handoverService.findById(row.handoverId).then((data) => {
|
|
|
+ if (data.type !== '2') { // status的值不等于“审核中”,就弹出提示
|
|
|
+ this.$message.error('数据已发生改变或不存在,请刷新数据')
|
|
|
+ this.refreshList()
|
|
|
+ } else {
|
|
|
+ processService.revokeProcIns(row.handoverProcInsId).then((data) => {
|
|
|
+ let form = {type: '3', id: row.handoverId}
|
|
|
+ handoverService.updateStatusById(form)
|
|
|
+ this.$message.success(data)
|
|
|
+ this.refreshList()
|
|
|
+ })
|
|
|
+ }
|
|
|
+ })
|
|
|
+ })
|
|
|
+ },
|
|
|
+ adjustHandover (row) {
|
|
|
+ handoverService.findById(row.handoverId).then((data) => {
|
|
|
+ if (data.type !== '4') { // status的值不等于“驳回”,就弹出提示
|
|
|
+ this.$message.error('数据已发生改变或不存在,请刷新数据')
|
|
|
+ this.refreshList()
|
|
|
+ } else {
|
|
|
+ row.id = row.handoverId
|
|
|
+ this.handover(row)
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
}
|
|
|
}
|
|
|
</script>
|