|
@@ -39,13 +39,27 @@
|
|
|
:checkbox-config="{}">
|
|
|
<vxe-column type="seq" width="40"></vxe-column>
|
|
|
<vxe-column type="checkbox" width="40px"></vxe-column>
|
|
|
- <vxe-column width="200" title="姓名" field="rosterBaseDTO.name">
|
|
|
+ <vxe-column width="150" title="姓名" field="rosterBaseDTO.name">
|
|
|
<template slot-scope="scope">
|
|
|
<el-link type="primary" :underline="false" v-if="hasPermission('changes:dimission:view')" @click="view(scope.row.id)">{{!commonJS.isEmpty(scope.row.rosterBaseDTO.name)?scope.row.rosterBaseDTO.name:'--'}}</el-link>
|
|
|
<span v-else>{{!commonJS.isEmpty(scope.row.rosterBaseDTO.name)?scope.row.rosterBaseDTO.name:'--'}}</span>
|
|
|
</template>
|
|
|
</vxe-column>
|
|
|
-
|
|
|
+ <vxe-column width="120" title="离职审批" field="vettingStatus">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ {{$dictUtils.getDictLabel('vetting_status', scope.row.vettingStatus, '-')}}
|
|
|
+ </template>
|
|
|
+ </vxe-column>
|
|
|
+ <vxe-column width="120" title="离职交接" field="handoverStatus">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ {{$dictUtils.getDictLabel('handover_status', scope.row.handoverStatus, '-')}}
|
|
|
+ </template>
|
|
|
+ </vxe-column>
|
|
|
+ <vxe-column width="120" title="离职状态" field="status">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ {{$dictUtils.getDictLabel('dimission_status', scope.row.status, '-')}}
|
|
|
+ </template>
|
|
|
+ </vxe-column>
|
|
|
<vxe-column width="200" title="工号" field="rosterBaseDTO.jobNo"></vxe-column>
|
|
|
<vxe-column width="200" title="部门" field="soName"></vxe-column>
|
|
|
<vxe-column width="200" title="职位" field="jpName"></vxe-column>
|
|
@@ -65,47 +79,76 @@
|
|
|
</template>
|
|
|
</vxe-column>
|
|
|
<vxe-column width="200" title="备注" field="remarks"></vxe-column>
|
|
|
- <vxe-column width="200" title="离职审批" field="vettingStatus">
|
|
|
- <template slot-scope="scope">
|
|
|
- {{$dictUtils.getDictLabel('vetting_status', scope.row.vettingStatus, '-')}}
|
|
|
- </template>
|
|
|
- </vxe-column>
|
|
|
- <vxe-column width="200" title="离职交接" field="handoverStatus">
|
|
|
- <template slot-scope="scope">
|
|
|
- {{$dictUtils.getDictLabel('handover_status', scope.row.handoverStatus, '-')}}
|
|
|
- </template>
|
|
|
- </vxe-column>
|
|
|
- <vxe-column width="200" title="离职状态" field="status">
|
|
|
- <template slot-scope="scope">
|
|
|
- {{$dictUtils.getDictLabel('dimission_status', scope.row.status, '-')}}
|
|
|
- </template>
|
|
|
- </vxe-column>
|
|
|
+
|
|
|
|
|
|
<vxe-column title="操作" width="50px" fixed="right" align="center">
|
|
|
<template slot-scope="scope">
|
|
|
<el-dropdown size="small" @command="handleCommand">
|
|
|
<span class="el-dropdown-link">
|
|
|
- . . .
|
|
|
+ 更多
|
|
|
</span>
|
|
|
<el-dropdown-menu slot="dropdown">
|
|
|
<el-dropdown-item v-if="hasPermission('changes:dimission:view')" :command="{method:'view', id:scope.row.id}">
|
|
|
查看
|
|
|
</el-dropdown-item>
|
|
|
- <el-dropdown-item v-if="hasPermission('changes:dimission:edit')&&scope.row.status === '1'" :command="{method:'edit', id:scope.row.id}">
|
|
|
+ <el-dropdown-item v-if="hasPermission('changes:dimission:edit')&&
|
|
|
+ (scope.row.status === '1'&&scope.row.vettingStatus === '1')||
|
|
|
+ (scope.row.status === '1'&&scope.row.vettingStatus === '3')||
|
|
|
+ (scope.row.status === '1'&&scope.row.vettingStatus === '5')
|
|
|
+ "
|
|
|
+ :command="{method:'edit', id:scope.row.id}">
|
|
|
修改
|
|
|
</el-dropdown-item>
|
|
|
- <el-dropdown-item v-if="hasPermission('changes:dimission:del')&&scope.row.status === '1'" :command="{method:'del', id:scope.row.id}">
|
|
|
- 删除
|
|
|
+ <el-dropdown-item v-if="hasPermission('changes:dimission:del')&&
|
|
|
+ (scope.row.status === '1'&&scope.row.vettingStatus === '1')||
|
|
|
+ (scope.row.status === '1'&&scope.row.vettingStatus === '3')||
|
|
|
+ (scope.row.status === '1'&&scope.row.vettingStatus === '5')||
|
|
|
+ (scope.row.status === '1'&&scope.row.vettingStatus === '6')
|
|
|
+ "
|
|
|
+ :command="{method:'del', id:scope.row.id}">
|
|
|
+ 放弃离职
|
|
|
</el-dropdown-item>
|
|
|
- <el-dropdown-item v-if="hasPermission('changes:dimission:edit')&&scope.row.status === '1'" :command="{method:'sure', id:scope.row.id}">
|
|
|
+ <el-dropdown-item v-if="hasPermission('changes:dimission:edit')&&
|
|
|
+ (scope.row.status === '1'&&scope.row.vettingStatus === '1')||
|
|
|
+ (scope.row.status === '1'&&scope.row.vettingStatus === '3')||
|
|
|
+ (scope.row.status === '1'&&scope.row.vettingStatus === '5')||
|
|
|
+ (scope.row.status === '1'&&scope.row.vettingStatus === '6')
|
|
|
+ "
|
|
|
+ :command="{method:'sure', id:scope.row.id}">
|
|
|
确认离职
|
|
|
</el-dropdown-item>
|
|
|
- <el-dropdown-item v-if="hasPermission('changes:dimission:edit')&&scope.row.status === '2'" :command="{method:'removeSure', id:scope.row.id}">
|
|
|
+ <el-dropdown-item v-if="hasPermission('changes:dimission:edit')&&
|
|
|
+ (scope.row.handoverStatus === '1'&&scope.row.status === '2')||
|
|
|
+ (scope.row.handoverStatus === '2'&&scope.row.status === '2')||
|
|
|
+ (scope.row.handoverStatus === '5'&&scope.row.status === '2')"
|
|
|
+ :command="{method:'removeSure', row:scope.row}">
|
|
|
取消确认
|
|
|
</el-dropdown-item>
|
|
|
- <el-dropdown-item v-if="hasPermission('changes:dimission:edit')&&scope.row.status === '2'" :command="{method:'handover', row:scope.row}">
|
|
|
+ <el-dropdown-item v-if="hasPermission('changes:dimission:edit')&&
|
|
|
+ scope.row.status === '2'&&
|
|
|
+ scope.row.handoverStatus === '1'||scope.row.handoverStatus === '2'||scope.row.handoverStatus === '5'"
|
|
|
+ :command="{method:'handover', row:scope.row}">
|
|
|
发起工作交接审批
|
|
|
</el-dropdown-item>
|
|
|
+ <el-dropdown-item v-if="hasPermission('changes:dimission:view')&&
|
|
|
+ scope.row.status === '2'&&
|
|
|
+ scope.row.handoverStatus === '3'||scope.row.handoverStatus === '4'"
|
|
|
+ :command="{method:'handoverDetail', row:scope.row}">
|
|
|
+ 工作交接审批结果
|
|
|
+ </el-dropdown-item>
|
|
|
+ <el-dropdown-item v-if="hasPermission('changes:dimission:edit')&&
|
|
|
+ (scope.row.status === '1'&&scope.row.vettingStatus === '1')||
|
|
|
+ (scope.row.status === '1'&&scope.row.vettingStatus === '3')||
|
|
|
+ (scope.row.status === '1'&&scope.row.vettingStatus === '5')"
|
|
|
+ :command="{method:'audit', row:scope.row}">
|
|
|
+ 发起离职审批
|
|
|
+ </el-dropdown-item>
|
|
|
+ <el-dropdown-item v-if="hasPermission('changes:dimission:view')&&
|
|
|
+ (scope.row.status === '1'&&scope.row.vettingStatus === '4')||
|
|
|
+ (scope.row.status === '1'&&scope.row.vettingStatus === '6')"
|
|
|
+ :command="{method:'auditDetail', row:scope.row}">
|
|
|
+ 离职审批结果
|
|
|
+ </el-dropdown-item>
|
|
|
</el-dropdown-menu>
|
|
|
</el-dropdown>
|
|
|
</template>
|
|
@@ -134,6 +177,9 @@
|
|
|
import DimissionForm from './DimissionForm'
|
|
|
import DimissionHandoverFormDialog from './DimissionHandoverFormDialog'
|
|
|
import TaskService from '@/api/flowable/TaskService'
|
|
|
+ import ProcessService from '@/api/flowable/ProcessService'
|
|
|
+ import DimissionHandoverService from '@/api/changes/dimission/DimissionHandoverService'
|
|
|
+ import pick from 'lodash.pick'
|
|
|
export default {
|
|
|
data () {
|
|
|
return {
|
|
@@ -149,14 +195,22 @@
|
|
|
pageSize: 10,
|
|
|
orders: []
|
|
|
},
|
|
|
- loading: false
|
|
|
+ loading: false,
|
|
|
+ processDefinitionId: '',
|
|
|
+ procDefKey: '',
|
|
|
+ processDefinitionAuditId: '',
|
|
|
+ procDefAuditKey: ''
|
|
|
}
|
|
|
},
|
|
|
dimissionService: null,
|
|
|
taskService: null,
|
|
|
+ processService: null,
|
|
|
+ dimissionHandoverService: null,
|
|
|
created () {
|
|
|
this.dimissionService = new DimissionService()
|
|
|
this.taskService = new TaskService()
|
|
|
+ this.processService = new ProcessService()
|
|
|
+ this.dimissionHandoverService = new DimissionHandoverService()
|
|
|
},
|
|
|
computed: {
|
|
|
userName () {
|
|
@@ -184,6 +238,18 @@
|
|
|
this.tablePage.total = data.total
|
|
|
this.loading = false
|
|
|
})
|
|
|
+ this.processService.getByName('离职归档交接审批').then(({data}) => {
|
|
|
+ if (!this.commonJS.isEmpty(data.id)) {
|
|
|
+ this.processDefinitionId = data.id
|
|
|
+ this.procDefKey = data.key
|
|
|
+ }
|
|
|
+ })
|
|
|
+ this.processService.getByName('离职审批').then(({data}) => {
|
|
|
+ if (!this.commonJS.isEmpty(data.id)) {
|
|
|
+ this.processDefinitionAuditId = data.id
|
|
|
+ this.procDefAuditKey = data.key
|
|
|
+ }
|
|
|
+ })
|
|
|
},
|
|
|
// 当前页
|
|
|
currentChangeHandle ({ currentPage, pageSize }) {
|
|
@@ -224,24 +290,96 @@
|
|
|
// 读取流程表单
|
|
|
let title = `发起流程【离职归档交接审批】`
|
|
|
let processTitle = `${this.userName} 在 ${this.moment(new Date()).format('YYYY-MM-DD HH:mm')} 发起了 [离职归档交接审批]`
|
|
|
- this.taskService.getTaskDef({ procDefId: 'Process_1663572940585:6:ea3bdc78-37f5-11ed-84f6-f266559b56cb',
|
|
|
+ this.taskService.getTaskDef({ procDefId: this.processDefinitionId,
|
|
|
+ businessId: row.id,
|
|
|
+ businessTable: 'changes_dimission'}).then((data) => {
|
|
|
+ this.$router.push({
|
|
|
+ path: '/flowable/task/TaskForm',
|
|
|
+ query: {
|
|
|
+ procDefId: this.processDefinitionId,
|
|
|
+ procDefKey: this.procDefKey,
|
|
|
+ title: title,
|
|
|
+ formType: data.data.formType,
|
|
|
+ formUrl: data.data.formUrl,
|
|
|
+ formTitle: processTitle,
|
|
|
+ businessTable: 'changes_dimission',
|
|
|
+ businessId: row.id,
|
|
|
+ isShow: 'false',
|
|
|
+ status: 'startAndHold',
|
|
|
+ routePath: '/changes/dimission/DimissionList'
|
|
|
+ }
|
|
|
+ })
|
|
|
+ })
|
|
|
+ },
|
|
|
+ // 查看交接审批流程结果
|
|
|
+ handoverDetail (row) {
|
|
|
+ // eslint-disable-next-line eqeqeq
|
|
|
+ if (!this.commonJS.isEmpty(row.status)) {
|
|
|
+ this.taskService.getTaskDef({
|
|
|
+ procInsId: row.procInsId,
|
|
|
+ procDefId: this.processDefinitionId
|
|
|
+ }).then(({data}) => {
|
|
|
+ this.$router.push({
|
|
|
+ path: '/flowable/task/TaskFormDetail',
|
|
|
+ query: {
|
|
|
+ isShow: 'false',
|
|
|
+ readOnly: true,
|
|
|
+ title: '离职归档交接审批' + '流程详情',
|
|
|
+ formTitle: '离职归档交接审批' + '流程详情',
|
|
|
+ businessId: row.id,
|
|
|
+ ...pick(data, 'formType', 'formUrl', 'procDefKey', 'taskDefKey', 'procInsId', 'procDefId', 'taskId', 'status', 'title', 'businessId')
|
|
|
+ }
|
|
|
+ })
|
|
|
+ })
|
|
|
+ }
|
|
|
+ },
|
|
|
+ // 发起离职审批
|
|
|
+ audit (row) {
|
|
|
+ // 读取流程表单
|
|
|
+ let title = `发起流程【离职审批】`
|
|
|
+ let processTitle = `${this.userName} 在 ${this.moment(new Date()).format('YYYY-MM-DD HH:mm')} 发起了 [离职审批]`
|
|
|
+ this.taskService.getTaskDef({ procDefId: this.processDefinitionAuditId,
|
|
|
businessId: row.id,
|
|
|
- businessTable: 'dimission_handover_info'}).then((data) => {
|
|
|
+ businessTable: 'changes_dimission'}).then((data) => {
|
|
|
this.$router.push({
|
|
|
path: '/flowable/task/TaskForm',
|
|
|
query: {
|
|
|
- procDefId: 'Process_1663572940585:6:ea3bdc78-37f5-11ed-84f6-f266559b56cb',
|
|
|
- procDefKey: 'Process_1663572940585',
|
|
|
+ procDefId: this.processDefinitionAuditId,
|
|
|
+ procDefKey: this.procDefAuditKey,
|
|
|
title: title,
|
|
|
formType: data.data.formType,
|
|
|
formUrl: data.data.formUrl,
|
|
|
formTitle: processTitle,
|
|
|
- businessTable: 'dimission_handover_info',
|
|
|
+ businessTable: 'changes_dimission',
|
|
|
+ businessId: row.id,
|
|
|
+ isShow: 'false',
|
|
|
+ status: 'startAndHold',
|
|
|
+ routePath: '/changes/dimission/DimissionList'
|
|
|
+ }
|
|
|
+ })
|
|
|
+ })
|
|
|
+ },
|
|
|
+ // 查看离职审批流程结果
|
|
|
+ auditDetail (row) {
|
|
|
+ // eslint-disable-next-line eqeqeq
|
|
|
+ if (!this.commonJS.isEmpty(row.vettingStatus)) {
|
|
|
+ this.taskService.getTaskDef({
|
|
|
+ procInsId: row.procInsId,
|
|
|
+ procDefId: this.processDefinitionAuditId
|
|
|
+ }).then(({data}) => {
|
|
|
+ this.$router.push({
|
|
|
+ path: '/flowable/task/TaskFormDetail',
|
|
|
+ query: {
|
|
|
+ isShow: 'false',
|
|
|
+ readOnly: true,
|
|
|
+ title: '离职审批' + '流程详情',
|
|
|
+ formTitle: '离职审批' + '流程详情',
|
|
|
businessId: row.id,
|
|
|
- routePath: '@views/modules/changes/dimission/DimissionHandoverForm'
|
|
|
+ ...pick(data, 'formType', 'formUrl', 'procDefKey', 'taskDefKey', 'procInsId', 'procDefId', 'taskId', 'status', 'title', 'businessId')
|
|
|
}
|
|
|
})
|
|
|
})
|
|
|
+ }
|
|
|
},
|
|
|
// 删除
|
|
|
del (id) {
|
|
@@ -286,14 +424,26 @@
|
|
|
} else if (command.method === 'sure') {
|
|
|
this.sure(command.id)
|
|
|
} else if (command.method === 'removeSure') {
|
|
|
- this.removeSure(command.id)
|
|
|
+ this.removeSure(command.row)
|
|
|
} else if (command.method === 'handover') {
|
|
|
this.handover(command.row)
|
|
|
+ } else if (command.method === 'handoverDetail') {
|
|
|
+ this.handoverDetail(command.row)
|
|
|
+ } else if (command.method === 'audit') {
|
|
|
+ this.audit(command.row)
|
|
|
+ } else if (command.method === 'auditDetail') {
|
|
|
+ this.auditDetail(command.row)
|
|
|
}
|
|
|
},
|
|
|
- async removeSure (id) {
|
|
|
+ async removeSure (row) {
|
|
|
this.loading = true
|
|
|
- await this.dimissionService.updateStatus(id).then(() => {
|
|
|
+ if (row.vettingStatus !== '6' && row.vettingStatus !== '4') {
|
|
|
+ let obj = {id: row.id, vettingStatus: '1'}
|
|
|
+ await this.dimissionService.updateVettingStatusById(obj)
|
|
|
+ }
|
|
|
+ let object = {id: row.id, handoverStatus: '1'}
|
|
|
+ await this.dimissionHandoverService.updateStatusById(object)
|
|
|
+ await this.dimissionService.updateStatus(row.id).then(() => {
|
|
|
this.refreshList()
|
|
|
this.loading = false
|
|
|
}).catch(() => {
|