| | |
| | | <basic-container> |
| | | <avue-crud :option="option" :table-loading="loading" :data="data" v-model:page="page" v-model="form" ref="crud" |
| | | @search-change="searchChange" @search-reset="searchReset" @current-change="currentChange" |
| | | @size-change="sizeChange" @refresh-change="refreshChange" @on-load="onLoad"> |
| | | @size-change="sizeChange" @refresh-change="refreshChange" @on-load="onLoad" |
| | | @selection-change="selectionTransferTask"> |
| | | <template #menu-left> |
| | | <el-button type="primary" plain @click="reassign">重新指派 |
| | | </el-button> |
| | |
| | | </el-button> |
| | | </template> |
| | | </avue-crud> |
| | | <!-- <el-dialog title="审批" append-to-body v-model="approveBox" width="100%"> |
| | | <div class="approve-box"> |
| | | <div class="left"> |
| | | <TodolistLeft :row="row"/> |
| | | </div> |
| | | <div class="right"> |
| | | <TodolistRightTop :row="row" /> |
| | | <avue-form ref="form" :option="optionApprove" v-model="formApprove" @submit="handleSubmit" /> |
| | | </div> |
| | | </div> |
| | | </el-dialog> --> |
| | | <el-dialog title="指派" append-to-body v-model="reassignBox" width="30%"> |
| | | <avue-form ref="reassginform" :option="reassignOption" v-model="reassignForm" @submit="toPerson"></avue-form> |
| | | </el-dialog> |
| | | <el-drawer title="审批" append-to-body v-model="approveBox" size="100%" v-if="approveBox"> |
| | | <div class="approve-box"> |
| | | <div class="left"> |
| | | <TodolistLeft :row="row" @selection-change="selectionChange"/> |
| | | <TodolistLeft :row="row" @selection-change="selectionChange" /> |
| | | </div> |
| | | <div class="right"> |
| | | <TodolistRightTop :row="row" /> |
| | |
| | | </template> |
| | | |
| | | <script> |
| | | import { getList, approve,getAssignee } from '@/api/flow/todolist'; |
| | | import { getList, approve, getAssignee,reassgin } from '@/api/flow/todolist'; |
| | | import { mapGetters } from 'vuex'; |
| | | import dayjs from 'dayjs'; |
| | | import TodolistLeft from './components/TodolistLeft.vue'; |
| | |
| | | span: 24, |
| | | disabled: false, |
| | | dicData: [ |
| | | |
| | | |
| | | ], |
| | | // rules: [{ required: true, message: '请选择下一审批用户', trigger: 'blur' }], |
| | | }, |
| | |
| | | // tree: true, |
| | | border: true, |
| | | index: true, |
| | | // selection: true, |
| | | selection: true, |
| | | // viewBtn: true, |
| | | menuWidth: 100, |
| | | dialogClickModal: false, |
| | |
| | | width: 100, |
| | | prop: 'categoryName', |
| | | }, |
| | | |
| | | |
| | | { |
| | | label: '机床', |
| | | width: 100, |
| | |
| | | ], |
| | | }, |
| | | data: [], |
| | | transferTaskSelection: [], |
| | | reassignBox: false, |
| | | reassignOption: { |
| | | submitBtn: true, |
| | | emptyBtn: false, |
| | | column: [ |
| | | { |
| | | label: '发送给', |
| | | prop: 'newAssigneeId', |
| | | type: 'select', |
| | | // dicUrl: `/blade-mdm/flow/flow-user-list?deptId=0`, |
| | | // dicFlag: true, |
| | | props: { |
| | | label: 'name', |
| | | value: 'id', |
| | | }, |
| | | span: 24, |
| | | disabled: false, |
| | | dicData: [ |
| | | |
| | | ], |
| | | rules: [{ required: true, message: '请输入选择', trigger: 'blur' }], |
| | | }, |
| | | { |
| | | label: '备注', |
| | | span: 24, |
| | | prop: 'comment', |
| | | type: 'textarea', |
| | | rules: [{ required: true, message: '请输入审批意见', trigger: 'blur' }], |
| | | }, |
| | | ], |
| | | }, |
| | | reassignForm: {} |
| | | }; |
| | | }, |
| | | watch: { |
| | |
| | | // }, |
| | | }, |
| | | mounted() { |
| | | getAssignee().then(res=> { |
| | | getAssignee().then(res => { |
| | | this.assigneeData = res.data.data; |
| | | this.optionApprove.column[1].dicData = this.assigneeData; |
| | | this.reassignOption.column[0].dicData = this.assigneeData; |
| | | }) |
| | | }, |
| | | methods: { |
| | | selectionTransferTask(list) { |
| | | this.transferTaskSelection = list; |
| | | }, |
| | | reassign() {// 重新指派 |
| | | if (this.transferTaskSelection.length === 0) { |
| | | this.$message.warning('请选择需要重新指派的任务'); |
| | | return; |
| | | } |
| | | if (this.transferTaskSelection.length > 1) { |
| | | this.$message.warning('请选择一条'); |
| | | return; |
| | | } |
| | | this.reassignBox = true; |
| | | }, |
| | | toPerson(form, done) { |
| | | this.$confirm('请确认是否指派', '', { |
| | | confirmButtonText: this.$t('submitText'), |
| | | cancelButtonText: this.$t('cancelText'), |
| | | type: 'warning', |
| | | }).then(() => { |
| | | console.log('toPerson', form); |
| | | reassgin({ |
| | | ...form, |
| | | taskId: this.transferTaskSelection[0].taskId, |
| | | processInstanceId: this.transferTaskSelection[0].processInstanceId, |
| | | }).then(res => { |
| | | this.$message.success('指派成功'); |
| | | this.reassignBox = false; |
| | | this.$refs?.reassginform?.resetForm(); |
| | | this.onLoad(this.page, this.query); |
| | | |
| | | }).catch(err => { |
| | | console.error(err); |
| | | }) |
| | | }); |
| | | done(); |
| | | }, |
| | | handleAction(row, index) { |
| | | this.formApprove = { |
| | | comment: '', |
| | |
| | | } |
| | | this.approveBox = true; |
| | | this.row = row |
| | | if(row.taskDefinitionKey=="check") { |
| | | if (row.taskDefinitionKey == "check") { |
| | | this.formApprove.assignee = row.variables.senior; |
| | | } else if(row.taskDefinitionKey=="programmingTask") { |
| | | } else if (row.taskDefinitionKey == "programmingTask") { |
| | | this.formApprove.assignee = row.variables.checker; |
| | | } else if(row.taskDefinitionKey=="teamLeaderTask") { |
| | | } else if (row.taskDefinitionKey == "teamLeaderTask") { |
| | | this.formApprove.assignee = row.variables.programmer |
| | | } else if(row.taskDefinitionKey=="confirmIsUseableTask") { |
| | | } else if (row.taskDefinitionKey == "confirmIsUseableTask") { |
| | | this.formApprove.assignee = row.variables.checker |
| | | } else if(row.taskDefinitionKey=="approveTask") { |
| | | } else if (row.taskDefinitionKey == "approveTask") { |
| | | |
| | | } |
| | | console.log('handleAction', row, index); |
| | |
| | | }).catch(err => { |
| | | console.error(err); |
| | | }); |
| | | }, |
| | | reassign() {// 重新指派 |
| | | |
| | | }, |
| | | searchChange(params, done) { |
| | | let data = {} |
| | |
| | | } catch (error) { |
| | | console.error('日期格式化错误', error); |
| | | } |
| | | |
| | | |
| | | this.loading = true; |
| | | getList(page.currentPage, page.pageSize, Object.assign(query, params)).then(res => { |
| | | const data = res.data.data; |
| | |
| | | this.loading = false; |
| | | }); |
| | | }, |
| | | selectionChange (applist) { |
| | | selectionChange(applist) { |
| | | this.applist = applist |
| | | }, |
| | | }, |
| | |
| | | <style scoped="scoped" lang="scss"> |
| | | .approve-box { |
| | | display: flex; |
| | | & > div { |
| | | |
| | | &>div { |
| | | border: 1px solid #ccc; |
| | | } |
| | | |
| | | .left { |
| | | width: 400px; |
| | | } |
| | | |
| | | .right { |
| | | flex:1; |
| | | flex: 1; |
| | | } |
| | | } |
| | | </style> |