|
@@ -128,15 +128,14 @@
|
|
|
</vxe-column>
|
|
|
<vxe-column width="100px" title="归档状态" field="filedType" >
|
|
|
<template slot-scope="scope">
|
|
|
-<!-- {{ $dictUtils.getDictLabel("filed_type", scope.row.filedType, '-') }}-->
|
|
|
<el-button type="text" @click="detailFiled(scope.row)" :type="$dictUtils.getDictLabel('filed_type', scope.row.filedType, '-')" effect="dark" size="mini">{{$dictUtils.getDictLabel("filed_type", scope.row.filedType, '-')}} </el-button>
|
|
|
</template>
|
|
|
</vxe-column>
|
|
|
-<!-- <vxe-column width="100px" title="借用状态" field="borrowType" >-->
|
|
|
-<!-- <template slot-scope="scope">-->
|
|
|
-<!-- {{ $dictUtils.getDictLabel("borrow_type", scope.row.borrowType, '-') }}-->
|
|
|
-<!-- </template>-->
|
|
|
-<!-- </vxe-column>-->
|
|
|
+ <vxe-column width="100px" title="借用状态" field="borrowType" >
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <el-button type="text" @click="detailBorrow(scope.row)" :type="$dictUtils.getDictLabel('borrow_type', scope.row.borrowType, '-')" effect="dark" size="mini">{{$dictUtils.getDictLabel("borrow_type", scope.row.borrowType, '-')}} </el-button>
|
|
|
+ </template>
|
|
|
+ </vxe-column>
|
|
|
|
|
|
<vxe-column title="操作" width="200px" fixed="right" align="center">
|
|
|
<template slot-scope="scope">
|
|
@@ -147,6 +146,9 @@
|
|
|
<el-button v-if="hasPermission('sys:workContract:back') && scope.row.status === '2'" type="text" icon="el-icon-back" size="small" @click="reback(scope.row)">撤回</el-button>
|
|
|
<el-button v-if="hasPermission('sys:workContract:filed') && scope.row.status === '5' && scope.row.createId === create && (scope.row.filedType === '1' || scope.row.filedType === '2' || scope.row.filedType === '4' || scope.row.filedType === '5' || scope.row.filedType === undefined)" type="text" icon="el-icon-s-order" size="small" @click="filed(scope.row.id)">归档</el-button>
|
|
|
<el-button v-if="hasPermission('sys:workContract:back') && scope.row.status === '5' && scope.row.filedType === '3'" type="text" icon="el-icon-back" size="small" @click="rebackFiled(scope.row)">撤回</el-button>
|
|
|
+ <el-button v-if="hasPermission('sys:workContract:borrow') && scope.row.status === '5' && scope.row.filedType === '6' && (scope.row.borrowType === undefined || scope.row.borrowType === '1')" type="text" icon="el-icon-s-order" size="small" @click="borrow(scope.row.id)">借用</el-button>
|
|
|
+ <el-button v-if="hasPermission('sys:workContract:back') && scope.row.status === '5' && scope.row.filedType === '6' && scope.row.borrowType === '2'" type="text" icon="el-icon-back" size="small" @click="rebackBorrow(scope.row)">撤回</el-button>
|
|
|
+ <el-button v-if="hasPermission('sys:workContract:reture') && scope.row.status === '5' && scope.row.filedType === '6' && scope.row.borrowType === '6'" type="text" icon="el-icon-back" size="small" @click="retureBorrow(scope.row)">归还合同</el-button>
|
|
|
</template>
|
|
|
</vxe-column>
|
|
|
</vxe-table>
|
|
@@ -165,6 +167,7 @@
|
|
|
<!-- 弹窗, 新增 / 修改 -->
|
|
|
<WorkContractForm2 ref="workContractForm2" @refreshDataList="refreshList"></WorkContractForm2>
|
|
|
<WorkClientForm ref="workClientForm" @refreshDataList="refreshList"></WorkClientForm>
|
|
|
+ <WorkContractBorrowMessageForm ref="workContractBorrowMessageForm" @refreshDataList="refreshList"></WorkContractBorrowMessageForm>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
@@ -172,8 +175,10 @@
|
|
|
import InputNumber from './InputNumber.vue'
|
|
|
import WorkContractForm2 from './WorkContractForm2'
|
|
|
import WorkClientForm from '../workClient/WorkClientForm'
|
|
|
+ import WorkContractBorrowMessageForm from './WorkContractBorrowMessageForm'
|
|
|
import WorkContractService from '@/api/sys/WorkContractService'
|
|
|
import WorkContractFileService from '@/api/sys/WorkContractFileService'
|
|
|
+ import WorkContractBorrowService from '@/api/sys/WorkContractBorrowService'
|
|
|
import SelectUserTree from '@/views/modules/utils/treeUserSelect'
|
|
|
import TaskService from '@/api/flowable/TaskService'
|
|
|
import ProcessService from '@/api/flowable/ProcessService'
|
|
@@ -211,12 +216,14 @@
|
|
|
},
|
|
|
workContractService: null,
|
|
|
workContractFileService: null,
|
|
|
+ workContractBorrowService: null,
|
|
|
taskService: null,
|
|
|
processService: null,
|
|
|
userService: null,
|
|
|
created () {
|
|
|
this.workContractService = new WorkContractService()
|
|
|
this.workContractFileService = new WorkContractFileService()
|
|
|
+ this.workContractBorrowService = new WorkContractBorrowService()
|
|
|
this.taskService = new TaskService()
|
|
|
this.processService = new ProcessService()
|
|
|
this.userService = new UserService()
|
|
@@ -225,6 +232,7 @@
|
|
|
InputNumber,
|
|
|
WorkContractForm2,
|
|
|
WorkClientForm,
|
|
|
+ WorkContractBorrowMessageForm,
|
|
|
SelectUserTree
|
|
|
},
|
|
|
activated () {
|
|
@@ -490,6 +498,20 @@
|
|
|
row.filedType = '4'
|
|
|
this.workContractFileService.updateStatusById(row)
|
|
|
}
|
|
|
+ if (type === 'rebackBorrow') {
|
|
|
+ row.borrowType = '1'
|
|
|
+ this.workContractBorrowService.updateStatusByContractInfoId(row).then(() => {
|
|
|
+ this.workContractBorrowService.deleteById(row.id)
|
|
|
+ })
|
|
|
+ }
|
|
|
+ if (type === 'retureBorrow') {
|
|
|
+ row.borrowType = '1'
|
|
|
+ this.workContractBorrowService.updateStatusByContractInfoId(row).then(() => {
|
|
|
+ row.type = 'reture'
|
|
|
+ row.borrowType = '6'
|
|
|
+ this.workContractBorrowService.updateMessageStatusById(row)
|
|
|
+ })
|
|
|
+ }
|
|
|
},
|
|
|
is () {
|
|
|
this.userService.is().then(({data}) => {
|
|
@@ -528,7 +550,7 @@
|
|
|
}
|
|
|
})
|
|
|
},
|
|
|
- // 详情
|
|
|
+ // 归档详情
|
|
|
detailFiled (row) {
|
|
|
this.workContractFileService.findByContractInfoId(row.id).then(({data}) => {
|
|
|
if (!this.commonJS.isEmpty(data.id)) {
|
|
@@ -549,6 +571,72 @@
|
|
|
})
|
|
|
}
|
|
|
})
|
|
|
+ },
|
|
|
+ // 借用
|
|
|
+ borrow (id) {
|
|
|
+ this.processService.getByName('合同登记借用').then(({data}) => {
|
|
|
+ if (!this.commonJS.isEmpty(data.id)) {
|
|
|
+ console.log('data', data)
|
|
|
+ // 读取流程表单
|
|
|
+ let tabTitle = `发起流程【合同登记借用】`
|
|
|
+ let processTitle = `${this.userName} 在 ${this.moment(new Date()).format('YYYY-MM-DD HH:mm')} 发起了 [合同登记借用]`
|
|
|
+ this.taskService.getTaskDef({ procDefId: data.id,
|
|
|
+ businessId: id,
|
|
|
+ businessTable: 'work_contract_borrow',
|
|
|
+ status: 'startAndCloseBorrow'}).then((reture) => {
|
|
|
+ this.$router.push({
|
|
|
+ path: '/flowable/task/TaskForm',
|
|
|
+ query: {
|
|
|
+ procDefId: data.id,
|
|
|
+ procDefKey: data.key,
|
|
|
+ status: 'startAndCloseBorrow',
|
|
|
+ title: tabTitle,
|
|
|
+ formType: reture.data.formType,
|
|
|
+ formUrl: reture.data.formUrl,
|
|
|
+ formTitle: processTitle,
|
|
|
+ businessTable: 'work_contract_borrow',
|
|
|
+ businessId: id,
|
|
|
+ isShow: false,
|
|
|
+ routePath: '/sys/workContract/WorkContractList'
|
|
|
+ }
|
|
|
+ })
|
|
|
+ })
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ // 借用详情
|
|
|
+ detailBorrow (row) {
|
|
|
+ this.$refs.workContractBorrowMessageForm.findList(row.id)
|
|
|
+ },
|
|
|
+ // 借用撤回
|
|
|
+ rebackBorrow (row) {
|
|
|
+ this.$confirm(`确定撤回流程吗?`, '提示', {
|
|
|
+ confirmButtonText: '确定',
|
|
|
+ cancelButtonText: '取消',
|
|
|
+ taskId: row.taskBorrowId,
|
|
|
+ type: 'warning'
|
|
|
+ }).then(() => {
|
|
|
+ console.log('datas', row.taskBorrowId)
|
|
|
+ this.taskService.backNodes(row.taskBorrowId).then(({data}) => {
|
|
|
+ let backNodes = data
|
|
|
+ if (backNodes.length > 0) {
|
|
|
+ let backTaskDefKey = backNodes[0].taskDefKey
|
|
|
+ this.taskService.back({
|
|
|
+ taskId: row.taskBorrowId,
|
|
|
+ backTaskDefKey: backTaskDefKey,
|
|
|
+ isShow: false,
|
|
|
+ ...this.auditForm
|
|
|
+ }).then(({data}) => {
|
|
|
+ this.updateStatusById(row, 'rebackBorrow')
|
|
|
+ this.$message.success('回退成功')
|
|
|
+ })
|
|
|
+ }
|
|
|
+ })
|
|
|
+ })
|
|
|
+ },
|
|
|
+ // 归还合同
|
|
|
+ retureBorrow (row) {
|
|
|
+ this.updateStatusById(row, 'retureBorrow')
|
|
|
}
|
|
|
}
|
|
|
}
|