新增委托功能

This commit is contained in:
a0049873 2022-10-20 14:51:02 +08:00
parent 56c4393f2e
commit fe1f6dc08d
3 changed files with 98 additions and 41 deletions

View File

@ -9,13 +9,14 @@
</el-form>
<template slot="footer">
<el-button @click="visible = false">{{ $t('cancel') }}</el-button>
<el-button type="primary" @click="entrustTask()">{{ $t('confirm') }}</el-button>
<el-button type="primary" @click="entrustTask($store.state.contentTabsActiveName)">{{ $t('confirm') }}</el-button>
</template>
<select-user v-if="selectUserVisible" ref="selectUser" ></select-user>
</el-dialog>
</template>
<script>
import bus from '@/views/bus.js'
import SelectUser from './select-user'
import qs from 'qs'
export default {
@ -52,11 +53,11 @@ export default {
init () {
this.visible = true
this.$nextTick(() => {
this.$refs['dataForm'].resetFields()
this.$refs.dataForm.resetFields()
})
},
//
entrustTask () {
entrustTask (data) {
if (!this.dataForm.entrustUserId) {
this.$message.error(this.$t('process.entrustError'))
return
@ -65,9 +66,11 @@ export default {
taskId: this.dataForm.taskId,
assignee: this.dataForm.entrustUserId
})
this.$http['post']('/act/task/entrust', task).then(({ data: res }) => {
this.$http.post('/act/task/entrust', task).then(({ data: res }) => {
if (res.code !== 0) {
this.$message.error(res.msg)
this.tabRemoveHandle(data)
bus.$emit('updateTaskNum')
if (this.callbacks.taskHandleErrorCallback) {
this.callbacks.taskHandleErrorCallback(res)
}
@ -79,6 +82,8 @@ export default {
duration: 500,
onClose: () => {
this.visible = false
this.tabRemoveHandle(data)
bus.$emit('updateTaskNum')
if (this.callbacks.taskHandleSuccessCallback) {
this.callbacks.taskHandleSuccessCallback(res)
}
@ -93,6 +98,33 @@ export default {
this.$refs.selectUser.init(this.setUserInfo)
})
},
tabRemoveHandle (tabName) {
console.log(tabName, 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa')
if (tabName === 'home') {
return false
}
this.$store.state.contentTabs = this.$store.state.contentTabs.filter(
(item) => item.name !== tabName
)
if (this.$store.state.contentTabs.length <= 0) {
this.$store.state.sidebarMenuActiveName =
this.$store.state.contentTabsActiveName = 'home'
return false
}
// tab
if (tabName === this.$store.state.contentTabsActiveName) {
const tab =
this.$store.state.contentTabs[
this.$store.state.contentTabs.length - 1
]
this.$router.push({
name: /^iframe_.+/.test(tab.name) ? 'iframe' : tab.name,
params: { ...tab.params },
query: { ...tab.query }
})
}
},
setUserInfo (userInfo) {
this.dataForm.entrustUserId = userInfo.id
this.dataForm.entrustUserName = userInfo.realName

View File

@ -74,31 +74,31 @@
</template>
<script>
import * as moment from 'moment';
import * as moment from 'moment'
export default {
data () {
return {
//
detailInfo: {},
dataList: [],
dataList: []
}
},
created () {
this.detailInfo = this.$route.params.params || {};
console.log('this.detailInfo------------>', this.detailInfo);
this.detailInfo = this.$route.params.params || {}
console.log('this.detailInfo------------>', this.detailInfo)
//
let durationInSeconds = ''
if (this.detailInfo.auditTime && this.detailInfo.auditTime) {
durationInSeconds = moment(this.detailInfo.auditTime).diff(moment(this.detailInfo.createDate), 'seconds')
}
let _obj = {
const _obj = {
activityName: this.detailInfo.title || '',
assigneeName: this.detailInfo.auditorName || '',
startTime: this.detailInfo.createDate || '',
endTime: this.detailInfo.auditTime,
comment: this.detailInfo.auditViem,
durationInSeconds: durationInSeconds,
durationInSeconds: durationInSeconds
}
this.dataList.push(_obj)
}
@ -316,4 +316,3 @@ export default {
padding-right: 10px;
}
</style>

View File

@ -1,8 +1,8 @@
<!--
* @Author: hisense.liangjunhua
* @Date: 2022-06-29 15:59:51
* @LastEditors: hisense.liangjunhua
* @LastEditTime: 2022-08-04 14:34:45
* @LastEditors: Light
* @LastEditTime: 2022-10-20 14:39:06
* @Description: 告诉大家这是什么
-->
<!-- 流程业务表单 -->
@ -93,6 +93,8 @@
<el-radio-button label="同意" class="blueAll" @click="showDialog('同意')">同意</el-radio-button>
<el-radio-button label="退回" class="redAll" @click="showDialog('退回')">退回</el-radio-button>
</el-radio-group> -->
<!-- 委托 -->
<el-button type="info" @click="entrustTask()" v-if='taskEntrustFlag'>{{ $t('process.entrustTask') }}</el-button>
<el-button type="primary" @click="showDialog('同意')">同意</el-button>
<el-button type="danger" plain @click="showDialog('驳回')">驳回</el-button>
<!-- <el-input v-if="agreeOrList ==='同意' " v-model="inputAgree" placeholder="请输入同意意见"></el-input>
@ -101,6 +103,7 @@
</div>
</div>
<ren-task-entrust v-if="renTaskEntrustVisible" ref="renTaskEntrust"></ren-task-entrust>
<!-- 流程详情 -->
<ren-process-detail></ren-process-detail>
<el-dialog title="审批意见" :close-on-click-modal="false" :visible.sync="dialogVisible" width="30%"
@ -116,6 +119,7 @@
<script>
//
import RenTaskEntrust from '@/components/ren-process-running/src/ren-task-entrust'
import processModule from '@/mixins/process-module'
// import mixinViewModule from '@/mixins/view-module'
import debounce from 'lodash/debounce'
@ -127,7 +131,9 @@ export default {
mixins: [processModule],
data () {
return {
taskEntrustFlag: false,
dialogVisible: false,
renTaskEntrustVisible: false,
dialogType: '',
input: '',
visible: true,
@ -155,6 +161,17 @@ export default {
}
},
created () {
//
this.$http.get('/sys/user/info').then(({ data: res }) => {
res.data.roleIdList.map(val => {
this.$http.get('/sys/role/' + val).then(role => {
console.log('depid', role.data.data)
if (role.data.data.name === '申请流转员') {
this.taskEntrustFlag = true
}
})
})
})
// KEY
console.log('params=================>', this.$route, this.$route.params)
this.dataForm.taskId = this.$route.params.taskId
@ -185,7 +202,8 @@ export default {
// }
},
components: {
RenProcessDetail
RenProcessDetail,
RenTaskEntrust
},
methods: {
init () {
@ -200,6 +218,14 @@ export default {
}
})
},
entrustTask () {
this.renTaskEntrustVisible = true
this.$nextTick(() => {
this.$refs.renTaskEntrust.dataForm.taskId = this.dataForm.taskId
this.$refs.renTaskEntrust.callbacks = this.callbacks
this.$refs.renTaskEntrust.init()
})
},
showDialog (title) {
this.dialogVisible = true
this.dialogType = title
@ -473,7 +499,7 @@ export default {
alink.download = '附件' // ,,IE10
alink.href = data.attachment // url
alink.click() //
},
}
},
mounted () {
// this.applyData()