| | |
| | | <el-card class="box-card" > |
| | | <div slot="header" class="clearfix" style="display: flex"> |
| | | <div style="flex: 1" class="el-icon-document">{{`任务办理:` + processName}}</div> |
| | | <div style="flex: 2">{{projectName + '——' + flowName}}</div> |
| | | <div style="flex: 2; color: #303133">{{projectName + '——' + flowName}}</div> |
| | | <el-button style="float: right;" size="mini" type="danger" @click="goBack">关闭</el-button> |
| | | </div> |
| | | <el-tabs tab-position="top" v-model="activeName" @tab-click="handleClick"> |
| | | <!--表单信息--> |
| | | <el-tab-pane label="表单信息" name="1"> |
| | | <!--初始化流程加载表单信息--> |
| | | <el-col :span="16" :offset="4" v-loading="formLoading" class="tab-min-height"> |
| | | <el-col :span="24" v-loading="formLoading" class="tab-min-height"> |
| | | <div v-if="formDataList && formDataList.length > 0"> |
| | | <div v-for="(formDataObj, index) in formDataList" :key="index" class="form-warp" style="position: relative"> |
| | | <div v-if="formDataObj.current"> |
| | | <!-- 当前节点可协同、转办等操作 --> |
| | | <div class="op-list"> |
| | | <el-button size="small" type="primary" :disabled="formDataObj.taskStatus === '挂起' || submitLoading" v-loading="submitLoading" @click="submitForm">确认并提交</el-button> |
| | | <!-- <el-button size="small" type="primary" disabled @click="submitForm">协同办理(功能开发中)</el-button>--> |
| | | <el-button size="small" type="primary" :disabled="formDataObj.taskStatus === '挂起'" @click="openDelegation(formDataList[0].beforeNodeName)">转办</el-button> |
| | | <el-button v-if="formDataObj.canJump" :disabled="formDataObj.taskStatus === '挂起'" size="small" type="primary" @click="jumpTask()">跳过</el-button> |
| | | <el-button v-if="formDataObj.canWait" :disabled="formDataObj.taskStatus === '挂起'" size="small" type="primary" >容缺</el-button> |
| | | <el-button v-if="formDataObj.canHangup && formDataObj.taskStatus !== '挂起'" size="small" type="primary" @click="hangup">挂起</el-button> |
| | | <el-button v-if="formDataObj.canHangup && formDataObj.taskStatus === '挂起'" size="small" type="primary" @click="cancelHangup">结束挂起</el-button> |
| | | </div> |
| | | <div class="current">当前阶段:<span>{{formDataObj.beforeNodeName}}</span><span v-if="formDataObj.taskStatus === 'HANGUP'">(挂起中)</span></div> |
| | | </div> |
| | | <div v-else-if="formDataList.length > 1"> |
| | | <!-- 前置节点可驳回 --> |
| | | <div class="reject-but"> |
| | | <el-button type="danger" size="small" @click="openRejectTask(formDataObj.beforeNodeName)">驳 回</el-button> |
| | | <el-popover |
| | | style="margin-left: 10px" v-if="formDataObj.events.length > 0" |
| | | placement="right-start" |
| | | title="任务日志" |
| | | width="800" |
| | | trigger="hover" |
| | | > |
| | | <div v-if="formDataObj.events.length > 0"> |
| | | <log-view :log-list="formDataObj.events"/> |
| | | <div v-for="(formDataObj, index) in formDataList" :key="index" class="form-warp"> |
| | | <el-row> |
| | | <el-col :span="18" style="position: relative"> |
| | | <div v-if="formDataObj.current"> |
| | | <!-- 当前节点可协同、转办等操作 --> |
| | | <div class="op-list"> |
| | | <el-button size="small" type="primary" :disabled="formDataObj.taskStatus === '挂起' || submitLoading" v-loading="submitLoading" @click="submitForm">确认并提交</el-button> |
| | | <!-- <el-button size="small" type="primary" disabled @click="submitForm">协同办理(功能开发中)</el-button>--> |
| | | <el-button size="small" type="primary" v-if="!isWait" :disabled="formDataObj.taskStatus === '挂起'" @click="openDelegation(formDataList[0].beforeNodeName)">转办</el-button> |
| | | <el-button v-if="formDataObj.canJump && !isWait" :disabled="formDataObj.taskStatus === '挂起'" size="small" type="primary" @click="jumpTask()">跳过</el-button> |
| | | <el-button v-if="formDataObj.canWait && !isWait" :disabled="formDataObj.taskStatus === '挂起'" size="small" type="primary" @click="waitTask()">容缺</el-button> |
| | | <el-button v-if="formDataObj.canHangup && formDataObj.taskStatus !== '挂起' && !isWait" size="small" type="primary" @click="hangup">挂起</el-button> |
| | | <el-button v-if="formDataObj.canHangup && formDataObj.taskStatus === '挂起' && !isWait" size="small" type="primary" @click="cancelHangup">结束挂起</el-button> |
| | | </div> |
| | | <el-button slot="reference">任务日志</el-button> |
| | | </el-popover> |
| | | </div> |
| | | <div class="before">前置阶段:<span>{{formDataObj.beforeNodeName}}</span></div> |
| | | </div> |
| | | <div v-if="formDataObj != null && formDataObj.formJsonObj != null"> |
| | | <v-form-render :form-data="formDataObj.formJsonObj.formJson" :ref="'form' + index"/> |
| | | </div> |
| | | <div v-else> |
| | | <el-alert |
| | | title="未绑定表单" |
| | | type="warning" |
| | | :closable="false" |
| | | > |
| | | </el-alert> |
| | | </div> |
| | | <div v-if="formDataList.length <= 1"> |
| | | <div class="before_none">前置阶段:<span>不存在前置阶段</span></div> |
| | | <el-alert |
| | | title="不存在前置阶段" |
| | | type="warning" |
| | | :closable="false" |
| | | > |
| | | </el-alert> |
| | | </div> |
| | | <div class="current">当前阶段:<span>{{formDataObj.beforeNodeName}}</span><span v-if="formDataObj.taskStatus === 'HANGUP'">(挂起中)</span></div> |
| | | </div> |
| | | <div v-else-if="formDataList.length > 1"> |
| | | <!-- 前置节点可驳回 --> |
| | | <div class="reject-but"> |
| | | <el-button type="danger" size="small" @click="openRejectTask(formDataObj.beforeNodeName)">驳 回</el-button> |
| | | </div> |
| | | <div class="before">前置阶段:<span>{{formDataObj.beforeNodeName}}</span></div> |
| | | </div> |
| | | <div v-if="formDataObj != null && formDataObj.formJsonObj != null"> |
| | | <v-form-render :form-data="formDataObj.formJsonObj.formJson" :ref="'form' + index"/> |
| | | </div> |
| | | <div v-else> |
| | | <el-alert |
| | | title="未绑定表单" |
| | | type="warning" |
| | | :closable="false" |
| | | > |
| | | </el-alert> |
| | | </div> |
| | | <div v-if="formDataList.length <= 1"> |
| | | <div class="before_none">前置阶段:<span>不存在前置阶段</span></div> |
| | | <el-alert |
| | | title="不存在前置阶段" |
| | | type="warning" |
| | | :closable="false" |
| | | > |
| | | </el-alert> |
| | | </div> |
| | | </el-col> |
| | | <el-col :span="6"> |
| | | <log-time-line v-if="formDataObj.events.length > 0" :log-list="formDataObj.events"/> |
| | | </el-col> |
| | | </el-row> |
| | | </div> |
| | | </div> |
| | | </el-col> |
| | |
| | | import SingleUser from '@/components/flow/User/SingleUser' |
| | | import MultUser from '@/components/flow/User/MultUser' |
| | | import MyRole from '@/components/flow/Role/MyRole' |
| | | import {completeSubmitFormTask} from "@/api/flowable/process"; |
| | | import {completeSubmitFormTask, waitCompleteSubmitFormTask} from "@/api/flowable/process"; |
| | | import { flowTaskForm } from "@/api/flowable/todo"; |
| | | import {getNextFlowNodeByStart} from "@/api/flowable/todo"; |
| | | import LogView from "@/views/projectProcess/components/LogView"; |
| | | import LogTimeLine from "@/views/projectProcess/components/LogTimeLine"; |
| | | import {rejectTask} from "@/api/flowable/process"; |
| | | import {cancelTaskHangup, taskDelegation, taskHangup, taskJump} from "@/api/projectProcess/projectProcess"; |
| | | import {cancelTaskHangup, taskDelegation, taskHangup, taskJump, taskWait} from "@/api/projectProcess/projectProcess"; |
| | | |
| | | export default { |
| | | name: "Record", |
| | |
| | | MyDept, |
| | | SingleUser, |
| | | MultUser, |
| | | LogView |
| | | LogView, |
| | | LogTimeLine |
| | | }, |
| | | props: {}, |
| | | data() { |
| | | return { |
| | | isWait: false, |
| | | jumpDesc: '', // 跳过说明 |
| | | rejectLoading: false, // 驳回按钮加载 |
| | | submitLoading: false, // 提交按钮加载 |
| | |
| | | this.procDefId = this.$route.query && this.$route.query.procDefId; |
| | | this.procInsId = this.$route.query && this.$route.query.procInsId; |
| | | this.goBackParams = this.$route.query && this.$route.query.goBackParams; |
| | | this.isWait = this.$route.query && this.$route.query.isWait === 'true' ? true : false; |
| | | // this.getNextFlowNodeByStart(this.deployId); |
| | | this.getFlowFormData(this.taskId); |
| | | }, |
| | |
| | | }) |
| | | }) |
| | | }, |
| | | // 容缺任务 |
| | | waitTask() { |
| | | this.$prompt('备注说明', '确定要容缺此任务吗', { |
| | | confirmButtonText: '确定', |
| | | cancelButtonText: '取消', |
| | | inputType: 'textarea', |
| | | inputValidator: (value) => { |
| | | if (!value || value.trim() === '') { |
| | | return "请填写备注说明" |
| | | } |
| | | return true |
| | | }, |
| | | inputErrorMessage: '请填写备注说明' |
| | | }).then(({ value }) => { |
| | | let waitForm = { |
| | | taskId: this.taskId, |
| | | projectId: this.projectId, |
| | | processInsId: this.procInsId, |
| | | desc: value |
| | | } |
| | | taskWait(waitForm).then(res => { |
| | | this.$message.success("操作成功") |
| | | this.goBack() |
| | | }) |
| | | }).catch(() => { |
| | | this.$message({ |
| | | type: 'info', |
| | | message: '已取消容缺操作' |
| | | }); |
| | | }); |
| | | }, |
| | | // 跳过任务 |
| | | jumpTask() { |
| | | this.$prompt('备注说明', '确定要跳过此任务吗', { |
| | | confirmButtonText: '确定', |
| | | cancelButtonText: '取消', |
| | | inputType: 'textarea' |
| | | // inputPattern: /[\w!#$%&'*+/=?^_`{|}~-]+(?:\.[\w!#$%&'*+/=?^_`{|}~-]+)*@(?:[\w](?:[\w-]*[\w])?\.)+[\w](?:[\w-]*[\w])?/, |
| | | // inputErrorMessage: '邮箱格式不正确' |
| | | inputType: 'textarea', |
| | | inputValidator: (value) => { |
| | | if (!value || value.trim() === '') { |
| | | return "请填写备注说明" |
| | | } |
| | | return true |
| | | }, |
| | | inputErrorMessage: '请填写备注说明' |
| | | }).then(({ value }) => { |
| | | let jumpForm = { |
| | | taskId: this.taskId, |
| | |
| | | // 复制对象的属性值给新的对象 |
| | | Object.assign(param, formData); |
| | | // 完成任务 |
| | | completeSubmitFormTask(this.taskId, param).then(res => { |
| | | if (this.isWait) { |
| | | waitCompleteSubmitFormTask(this.taskId, param).then(res => { |
| | | this.$modal.msgSuccess(res.msg); |
| | | this.submitLoading = false |
| | | this.goBack(); |
| | | }) |
| | | } else { |
| | | completeSubmitFormTask(this.taskId, param).then(res => { |
| | | this.$modal.msgSuccess(res.msg); |
| | | this.submitLoading = false |
| | | this.goBack(); |
| | | }) |
| | | } |
| | | }) |
| | | } else { |
| | | // 没关联表单直接传空 |
| | | if (this.isWait) { |
| | | waitCompleteSubmitFormTask(this.taskId, {}).then(res => { |
| | | this.$modal.msgSuccess(res.msg); |
| | | this.submitLoading = false |
| | | this.goBack(); |
| | | }) |
| | | }) |
| | | } else { |
| | | // 没关联表单直接传空 |
| | | completeSubmitFormTask(this.taskId, {}).then(res => { |
| | | this.$modal.msgSuccess(res.msg); |
| | | this.submitLoading = false |
| | | this.goBack(); |
| | | }) |
| | | } else { |
| | | completeSubmitFormTask(this.taskId, {}).then(res => { |
| | | this.$modal.msgSuccess(res.msg); |
| | | this.submitLoading = false |
| | | this.goBack(); |
| | | }) |
| | | } |
| | | } |
| | | }).catch((err) => { |
| | | console.log(err) |
| | |
| | | padding: 20px; |
| | | margin-top: 5px; |
| | | margin-bottom: 20px; |
| | | margin-left: 3px; |
| | | margin-right: 3px; |
| | | box-shadow: rgba(67, 71, 85, 0.27) 0px 0px 0.25em, rgba(90, 125, 188, 0.05) 0px 0.25em 1em; |
| | | } |
| | | .before { |
| | |
| | | } |
| | | .reject-but { |
| | | position: absolute; |
| | | top: 4px; |
| | | top: -4px; |
| | | right: 4px |
| | | } |
| | | .current { |
| | |
| | | } |
| | | .op-list { |
| | | position: absolute; |
| | | top: 4px; |
| | | top: -4px; |
| | | right: 4px; |
| | | display: flex; |
| | | justify-content: center; |