|
@@ -0,0 +1,1071 @@
|
|
|
+<template>
|
|
|
+ <div class="content">
|
|
|
+ <div class="main">
|
|
|
+ <a-layout-header class="Header">
|
|
|
+ <a-icon type="left" @click="$router.go(-1)" style="fontSize:24px;color:white;marginLeft:2%;" />
|
|
|
+ <span>我的事项</span>
|
|
|
+ </a-layout-header>
|
|
|
+
|
|
|
+ <!-- tabs 部分 -->
|
|
|
+ <a-layout-content class="todoBody">
|
|
|
+ <a-tabs default-active-key="wait" @change="callback" class="todoPage">
|
|
|
+ <!-- 我的申请 -->
|
|
|
+ <a-tab-pane key="apply" tab="申请" class="apply">
|
|
|
+ <div v-for="item in applyList" :key="item.id">
|
|
|
+ <a-card class="cardTask">
|
|
|
+ <p class="pTitle">
|
|
|
+ <span>
|
|
|
+ <img src="@assets/look.gif" />
|
|
|
+ </span>
|
|
|
+ <i>
|
|
|
+ {{ item.processName }}
|
|
|
+ </i>
|
|
|
+ </p>
|
|
|
+
|
|
|
+ <p>当前审批环节:{{ item.currTaskName }}</p>
|
|
|
+ <p>创建时间:{{ item.createTime }}</p>
|
|
|
+
|
|
|
+ <!-- 申请状态 -->
|
|
|
+ <p>
|
|
|
+ 状态:
|
|
|
+ <span v-if="item.status == 0" class="statusComm" style="background:rgb(9, 40, 52,.1);">
|
|
|
+ 草稿
|
|
|
+ </span>
|
|
|
+
|
|
|
+ <span v-if="item.status == 1" class="statusComm" style="background:rgb(252, 96, 10,.2);">
|
|
|
+ 处理中
|
|
|
+ </span>
|
|
|
+
|
|
|
+ <span v-if="item.status == 2" class="statusComm" style="background:rgb(9, 40, 52,.2);">
|
|
|
+ 已结束
|
|
|
+ </span>
|
|
|
+
|
|
|
+ <span v-if="item.status == 3" class="statusComm" style="background:rgb(9, 40, 52,.1);">
|
|
|
+ 已撤回
|
|
|
+ </span>
|
|
|
+ </p>
|
|
|
+
|
|
|
+ <!-- 申请结果 -->
|
|
|
+ <p style="float:left;">
|
|
|
+ 结果:
|
|
|
+
|
|
|
+ <span class="resultComm" v-if="item.result == 0" style="background:rgba(52, 123, 152,.7);">
|
|
|
+ 未提交
|
|
|
+ </span>
|
|
|
+
|
|
|
+ <span class="resultComm" v-else-if="item.result == 1" style="background:rgb(252, 96, 10,.8);">
|
|
|
+ 处理中
|
|
|
+ </span>
|
|
|
+
|
|
|
+ <span class="resultComm" v-else-if="item.result == 2" style="background:rgb(9, 40, 52,.8);">
|
|
|
+ 通过
|
|
|
+ </span>
|
|
|
+
|
|
|
+ <span class="resultComm" v-else-if="item.result == 3" style="background:rgba(9, 40, 52,.7);">
|
|
|
+ 驳回
|
|
|
+ </span>
|
|
|
+ </p>
|
|
|
+
|
|
|
+ <p style="float:right;">发起人:{{ item.createBy }}</p>
|
|
|
+
|
|
|
+ <a-divider style="background:rgba(128, 128, 128,.1);"></a-divider>
|
|
|
+
|
|
|
+ <!-- 操作 -->
|
|
|
+ <div class="operation">
|
|
|
+ <p>
|
|
|
+ <span class="operationImg">
|
|
|
+ <img src="@assets/down.png" />
|
|
|
+ </span>
|
|
|
+ 操作
|
|
|
+ </p>
|
|
|
+
|
|
|
+ <!-- -->
|
|
|
+ <div class="btns">
|
|
|
+ <!-- 处理中 渲染的按钮 -->
|
|
|
+ <span v-if="item.status == 1" class="ingBtns">
|
|
|
+ <a-button
|
|
|
+ class="itemBtn"
|
|
|
+ ghost
|
|
|
+ @click="cancel(item)"
|
|
|
+ style="box-shadow: 8px 8px 8px rgba(128, 128, 128,.9);
|
|
|
+ color:red;"
|
|
|
+ >
|
|
|
+ 撤回
|
|
|
+ </a-button>
|
|
|
+ <a-button
|
|
|
+ class="itemBtn"
|
|
|
+ ghost
|
|
|
+ @click="detail(item)"
|
|
|
+ style="box-shadow: 8px 8px 8px rgba(128, 128, 128,.7);
|
|
|
+ color:orange;"
|
|
|
+ >
|
|
|
+ 进度
|
|
|
+ </a-button>
|
|
|
+
|
|
|
+ <a-button
|
|
|
+ class="itemBtn"
|
|
|
+ ghost
|
|
|
+ @click="detail(item)"
|
|
|
+ style="box-shadow: 8px 8px 8px rgba(128, 128, 128,.7);
|
|
|
+ color:#4e73b9;"
|
|
|
+ >
|
|
|
+ 详情
|
|
|
+ </a-button>
|
|
|
+ </span>
|
|
|
+
|
|
|
+ <!-- 驳回 状态 渲染的按钮 -->
|
|
|
+ <span v-if="item.status == 2 || item.status == 3" class="overBtns">
|
|
|
+ <a-button
|
|
|
+ class="itemBtn"
|
|
|
+ ghost
|
|
|
+ @click="detail(item)"
|
|
|
+ style="box-shadow: 8px 8px 8px rgba(128, 128, 128);
|
|
|
+ color:rgb(80, 95, 102);"
|
|
|
+ >
|
|
|
+ 重新申请
|
|
|
+ </a-button>
|
|
|
+ <a-button
|
|
|
+ class="itemBtn"
|
|
|
+ ghost
|
|
|
+ @click="detail(item)"
|
|
|
+ style="box-shadow: 8px 8px 8px rgba(128, 128, 128);
|
|
|
+ color:#4e73b9;"
|
|
|
+ >
|
|
|
+ 编辑
|
|
|
+ </a-button>
|
|
|
+
|
|
|
+ <a-button
|
|
|
+ class="itemBtn"
|
|
|
+ ghost
|
|
|
+ @click="detail(item)"
|
|
|
+ style="box-shadow: 8px 8px 8px rgba(128, 128, 128);
|
|
|
+ color:gray;"
|
|
|
+ >
|
|
|
+ 历史
|
|
|
+ </a-button>
|
|
|
+
|
|
|
+ <a-button
|
|
|
+ class="itemBtn"
|
|
|
+ ghost
|
|
|
+ @click="detail(item)"
|
|
|
+ style="box-shadow: 8px 8px 8px rgba(128, 128, 128);
|
|
|
+ color:red;"
|
|
|
+ >
|
|
|
+ 删除
|
|
|
+ </a-button>
|
|
|
+ </span>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </a-card>
|
|
|
+ </div>
|
|
|
+ </a-tab-pane>
|
|
|
+
|
|
|
+ <!-- 我的待办 -->
|
|
|
+ <a-tab-pane key="wait" tab="待办" force-render class="wait">
|
|
|
+ <div v-for="item in todoList" :key="item.id">
|
|
|
+ <a-card class="cardTask">
|
|
|
+ <p class="pTitle">
|
|
|
+ <span>
|
|
|
+ <img src="@assets/look.gif" />
|
|
|
+ </span>
|
|
|
+ {{ item.processName }}
|
|
|
+ </p>
|
|
|
+
|
|
|
+ <p>任务名称:{{ item.name }}</p>
|
|
|
+ <p>创建时间:{{ item.createTime }}</p>
|
|
|
+
|
|
|
+ <!-- 优先级 -->
|
|
|
+ <p>
|
|
|
+ 优先级:
|
|
|
+ <span
|
|
|
+ class="priorityComm"
|
|
|
+ v-if="item.priority == 0"
|
|
|
+ style="background:rgba(252, 96, 10,.4);
|
|
|
+ padding:2px 6px;
|
|
|
+ borderRadius:2px;
|
|
|
+ color:#092834;"
|
|
|
+ >
|
|
|
+ 普通
|
|
|
+ </span>
|
|
|
+ <span
|
|
|
+ class="priorityComm"
|
|
|
+ v-else-if="item.priority == 1"
|
|
|
+ style="background:#FC600A;
|
|
|
+ padding:4px 10px;
|
|
|
+ borderRadius:6px;
|
|
|
+ color:white;"
|
|
|
+ >
|
|
|
+ 重要
|
|
|
+ </span>
|
|
|
+
|
|
|
+ <span
|
|
|
+ class="priorityComm"
|
|
|
+ v-else-if="item.priority == 2"
|
|
|
+ style="background:red;
|
|
|
+ padding:4px 10px;
|
|
|
+ borderRadius:6px;
|
|
|
+ color:white;"
|
|
|
+ >
|
|
|
+ 紧急
|
|
|
+ </span>
|
|
|
+ <span class="priorityComm" v-else style="background:#999;">
|
|
|
+ 无
|
|
|
+ </span>
|
|
|
+ </p>
|
|
|
+
|
|
|
+ <!-- 状态 -->
|
|
|
+ <p style="float:left;marginBottom:30px;">
|
|
|
+ 状态:
|
|
|
+ <span v-if="item.isSuspended == false" style="background:rgba(252, 96, 10,.8);" class="resultComm">
|
|
|
+ 已激活
|
|
|
+ </span>
|
|
|
+ <span v-if="item.isSuspended == true" style="background:rgba(20, 137, 184,.8);" class="resultComm">
|
|
|
+ 已挂起
|
|
|
+ </span>
|
|
|
+ {{ item.status }}
|
|
|
+ </p>
|
|
|
+
|
|
|
+ <!-- 发起人 -->
|
|
|
+ <p style="float:right;marginBottom:30px;">发起人:{{ item.applyer }}</p>
|
|
|
+
|
|
|
+ <a-divider style="background:rgba(128, 128, 128,.1);"></a-divider>
|
|
|
+
|
|
|
+ <!-- 操作 -->
|
|
|
+ <div class="operation">
|
|
|
+ <p>
|
|
|
+ <span class="operationImg">
|
|
|
+ <img src="@assets/down.png" />
|
|
|
+ </span>
|
|
|
+
|
|
|
+ 操作
|
|
|
+ </p>
|
|
|
+
|
|
|
+ <div class="btns">
|
|
|
+ <a-button
|
|
|
+ class="itemBtn"
|
|
|
+ ghost
|
|
|
+ @click="detail(item)"
|
|
|
+ style="box-shadow: 8px 8px 8px rgba(128, 128, 128);
|
|
|
+ color:#4e73b9;"
|
|
|
+ >
|
|
|
+ 详情
|
|
|
+ </a-button>
|
|
|
+
|
|
|
+ <!-- 挂起 状态 按钮不可用 -->
|
|
|
+ <span
|
|
|
+ v-if="item.isSuspended == true"
|
|
|
+ style="cursor: no-drop;color: #999999;"
|
|
|
+ title="流程已被挂起,无法操作!"
|
|
|
+ >
|
|
|
+ <a-button class="itemBtn" disabled>通过</a-button>
|
|
|
+ <a-button class="itemBtn" disabled>驳回</a-button>
|
|
|
+ <a-button class="itemBtn" disabled>历史</a-button>
|
|
|
+ </span>
|
|
|
+
|
|
|
+ <!-- 激活 状态 -->
|
|
|
+ <span v-else>
|
|
|
+ <a-button
|
|
|
+ class="itemBtn midBtn"
|
|
|
+ ghost
|
|
|
+ @click="passTask(item)"
|
|
|
+ style="box-shadow: 8px 8px 8px rgba(128, 128, 128);
|
|
|
+ color:#4e73b9;"
|
|
|
+ >
|
|
|
+ 通过
|
|
|
+ </a-button>
|
|
|
+
|
|
|
+ <a-button
|
|
|
+ class="itemBtn midBtn"
|
|
|
+ ghost
|
|
|
+ @click="backTask(item)"
|
|
|
+ style="color:gray;box-shadow: 5px 5px 5px rgba(128, 128, 128,.7);color:#ea472c;"
|
|
|
+ >
|
|
|
+ 驳回
|
|
|
+ </a-button>
|
|
|
+
|
|
|
+ <a-button
|
|
|
+ class="itemBtn midBtn"
|
|
|
+ ghost
|
|
|
+ @click="delegateTask(item)"
|
|
|
+ style="color:gray;box-shadow: 6px 6px 6px rgba(128, 128, 128,.7);color:orange;"
|
|
|
+ >
|
|
|
+ 委托
|
|
|
+ </a-button>
|
|
|
+ </span>
|
|
|
+
|
|
|
+ <a-button
|
|
|
+ class="itemBtn"
|
|
|
+ ghost
|
|
|
+ @click="history(item)"
|
|
|
+ style="color:gray;
|
|
|
+ box-shadow: 4px 4px 4px rgba(128, 128, 128,.7);
|
|
|
+ position:absolute;
|
|
|
+ right:0;
|
|
|
+ marginRight:0;"
|
|
|
+ >
|
|
|
+ 历史
|
|
|
+ </a-button>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </a-card>
|
|
|
+
|
|
|
+ <!-- 审批历史 -->
|
|
|
+ <a-modal title="审批历史" v-model="modalLsVisible" :mask-closable="false" :width="'80%'" :footer="null">
|
|
|
+ <div v-if="modalLsVisible">
|
|
|
+ <component :is="historicDetail" :procInstId="procInstId"></component>
|
|
|
+ </div>
|
|
|
+ </a-modal>
|
|
|
+
|
|
|
+ <!--流程表单-->
|
|
|
+ <a-modal
|
|
|
+ :title="lcModal.title"
|
|
|
+ v-model="lcModal.visible"
|
|
|
+ :footer="null"
|
|
|
+ :maskClosable="false"
|
|
|
+ width="100%"
|
|
|
+ >
|
|
|
+ <component
|
|
|
+ :disabled="lcModal.disabled"
|
|
|
+ v-if="lcModal.visible"
|
|
|
+ :is="lcModal.formComponent"
|
|
|
+ :processData="lcModal.processData"
|
|
|
+ :isNew="lcModal.isNew"
|
|
|
+ @close=";(lcModal.visible = false), (lcModal.disabled = false)"
|
|
|
+ @getDataList="getDataList"
|
|
|
+ ></component>
|
|
|
+ </a-modal>
|
|
|
+
|
|
|
+ <!-- 审批操作 -->
|
|
|
+ <a-modal :title="modalTaskTitle" v-model="modalTaskVisible" :mask-closable="false" :width="500">
|
|
|
+ <div v-if="modalTaskVisible">
|
|
|
+ <!-- 下面删除 :rules="formValidate" -->
|
|
|
+ <a-form ref="form" :model="form" :label-width="85">
|
|
|
+ <a-form-item label="审批意见" prop="reason">
|
|
|
+ <a-input type="textarea" v-model="form.comment" :rows="4" />
|
|
|
+ </a-form-item>
|
|
|
+ <a-form-item label="下一审批人" prop="assignees" v-show="showAssign" :error="error">
|
|
|
+ <a-select
|
|
|
+ v-model="form.assignees"
|
|
|
+ placeholder="请选择"
|
|
|
+ allowClear
|
|
|
+ mode="multiple"
|
|
|
+ :loading="userLoading"
|
|
|
+ >
|
|
|
+ <a-select-option v-for="(item, i) in assigneeList" :key="i" :value="item.username">{{
|
|
|
+ item.realname
|
|
|
+ }}</a-select-option>
|
|
|
+ </a-select>
|
|
|
+ </a-form-item>
|
|
|
+ <a-form-item label="下一审批人" v-show="isGateway">
|
|
|
+ <span>分支网关处暂不支持自定义选择下一审批人,将发送给下一节点所有人</span>
|
|
|
+ </a-form-item>
|
|
|
+ <div v-show="form.type == 1">
|
|
|
+ <a-form-item label="驳回至">
|
|
|
+ <a-select v-model="form.backTaskKey" :loading="backLoading" @change="changeBackTask">
|
|
|
+ <a-select-option v-for="(item, i) in backList" :key="i" :value="item.key">{{
|
|
|
+ item.name
|
|
|
+ }}</a-select-option>
|
|
|
+ </a-select>
|
|
|
+ </a-form-item>
|
|
|
+ <a-form-item
|
|
|
+ label="指定原节点审批人"
|
|
|
+ prop="assignees"
|
|
|
+ v-show="form.backTaskKey != -1"
|
|
|
+ :error="error"
|
|
|
+ >
|
|
|
+ <a-select
|
|
|
+ v-model="form.assignees"
|
|
|
+ placeholder="请选择"
|
|
|
+ allowClear
|
|
|
+ mode="multiple"
|
|
|
+ :loading="userLoading"
|
|
|
+ >
|
|
|
+ <a-select-option v-for="(item, i) in assigneeList" :key="i" :value="item.id">{{
|
|
|
+ item.username
|
|
|
+ }}</a-select-option>
|
|
|
+ </a-select>
|
|
|
+ </a-form-item>
|
|
|
+ </div>
|
|
|
+ <a-form-item label="选择委托人" prop="userId" :error="error" v-show="form.type == 2">
|
|
|
+ <JSelectUserByDep v-model="form.userId" :multi="false"></JSelectUserByDep>
|
|
|
+ </a-form-item>
|
|
|
+ <a-form-item label="消息通知">
|
|
|
+ <a-checkbox v-model="form.sendMessage">站内消息通知</a-checkbox>
|
|
|
+ <a-checkbox v-model="form.sendSms" disabled>短信通知</a-checkbox>
|
|
|
+ <a-checkbox v-model="form.sendEmail" disabled>邮件通知</a-checkbox>
|
|
|
+ </a-form-item>
|
|
|
+ </a-form>
|
|
|
+ </div>
|
|
|
+ <div slot="footer">
|
|
|
+ <a-button type="text" @click="modalTaskVisible = false">取消</a-button>
|
|
|
+ <a-button type="primary" :loading="submitLoading" @click="handelSubmit">提交</a-button>
|
|
|
+ </div>
|
|
|
+ </a-modal>
|
|
|
+ </div>
|
|
|
+ </a-tab-pane>
|
|
|
+
|
|
|
+ <!-- 我的已办 -->
|
|
|
+ <a-tab-pane key="done" tab="已办" class="done">
|
|
|
+ <div v-for="item in doneList" :key="item.id">
|
|
|
+ <a-card class="cardTask">
|
|
|
+ <p class="pTitle">
|
|
|
+ <span>
|
|
|
+ <img src="@assets/look.gif" />
|
|
|
+ </span>
|
|
|
+ <i>
|
|
|
+ {{ item.processName }}
|
|
|
+ </i>
|
|
|
+ </p>
|
|
|
+ <p>任务名称:{{ item.name }}</p>
|
|
|
+ <p>创建时间:{{ item.createTime }}</p>
|
|
|
+
|
|
|
+ <!-- 审批操作 -->
|
|
|
+ <p style="float:left;">
|
|
|
+ 审批操作:
|
|
|
+ <span
|
|
|
+ v-if="item.deleteReason == '审批通过'"
|
|
|
+ style="background:rgba(20, 137, 184,.3);
|
|
|
+ padding:4px 10px;
|
|
|
+ borderRadius:2px;
|
|
|
+ letterSpacing:1px;
|
|
|
+ color: #092834;"
|
|
|
+ >
|
|
|
+ {{ item.deleteReason }}</span
|
|
|
+ >
|
|
|
+ <span
|
|
|
+ v-if="item.deleteReason == '审批驳回'"
|
|
|
+ style="background:rgba(9, 40, 52,.7);
|
|
|
+ padding:4px 10px;
|
|
|
+ borderRadius:2px;
|
|
|
+ letterSpacing:1px;
|
|
|
+ color: white;"
|
|
|
+ >
|
|
|
+ {{ item.deleteReason }}
|
|
|
+ </span>
|
|
|
+ </p>
|
|
|
+ <p style="float:right;">发起人:{{ item.applyer }}</p>
|
|
|
+
|
|
|
+ <a-divider style="background:rgba(128, 128, 128,.1);"></a-divider>
|
|
|
+
|
|
|
+ <!-- 操作 -->
|
|
|
+ <div class="operation">
|
|
|
+ <p>
|
|
|
+ <span class="operationImg">
|
|
|
+ <img src="@assets/down.png" />
|
|
|
+ </span>
|
|
|
+
|
|
|
+ 操作
|
|
|
+ </p>
|
|
|
+
|
|
|
+ <div class="btns">
|
|
|
+ <a-button
|
|
|
+ class="itemBtn"
|
|
|
+ ghost
|
|
|
+ @click="detail(item)"
|
|
|
+ style="box-shadow: 8px 8px 8px rgba(128, 128, 128);
|
|
|
+ color:#4e73b9;"
|
|
|
+ >
|
|
|
+ 详情
|
|
|
+ </a-button>
|
|
|
+
|
|
|
+ <a-button
|
|
|
+ class="itemBtn"
|
|
|
+ ghost
|
|
|
+ @click="Donehistory(item)"
|
|
|
+ style="color:gray;
|
|
|
+ box-shadow: 8px 8px 8px rgba(128, 128, 128,.7)"
|
|
|
+ >
|
|
|
+ 历史
|
|
|
+ </a-button>
|
|
|
+
|
|
|
+ <a-popconfirm title="确定删除吗?" placement="left">
|
|
|
+ <a-button
|
|
|
+ class="itemBtn"
|
|
|
+ ghost
|
|
|
+ @click="remove(item)"
|
|
|
+ style="color:gray;
|
|
|
+ box-shadow: 7px 7px 7px rgba(128, 128, 128,.7);
|
|
|
+ color:red;"
|
|
|
+ >
|
|
|
+ 删除
|
|
|
+ </a-button>
|
|
|
+ </a-popconfirm>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </a-card>
|
|
|
+ </div>
|
|
|
+ </a-tab-pane>
|
|
|
+ </a-tabs>
|
|
|
+ </a-layout-content>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <a-layout-footer class="footer">
|
|
|
+ 上海萃颠信息科技有限公司出品
|
|
|
+ </a-layout-footer>
|
|
|
+ </div>
|
|
|
+</template>
|
|
|
+
|
|
|
+<script>
|
|
|
+import { deleteAction, getAction, downFile } from '@/api/manage'
|
|
|
+import JSelectUserByDep from '@/components/jeecgbiz/JSelectUserByDep'
|
|
|
+import { JeecgListMixin } from '@/mixins/JeecgListMixin'
|
|
|
+import { activitiMixin } from '@/views/activiti/mixins/activitiMixin'
|
|
|
+import DictItemListVue from '../system/DictItemList.vue'
|
|
|
+
|
|
|
+export default {
|
|
|
+ name: 'Todo',
|
|
|
+ mixins: [activitiMixin, JeecgListMixin],
|
|
|
+ components: { JSelectUserByDep },
|
|
|
+ data() {
|
|
|
+ return {
|
|
|
+ openSearch: true,
|
|
|
+ openTip: true,
|
|
|
+ loading: true, // 表单加载状态
|
|
|
+ modalLsVisible: false,
|
|
|
+ userLoading: false, //已办
|
|
|
+ backLoading: false,
|
|
|
+ selectCount: 0, // 多选计数
|
|
|
+ selectList: [], // 多选数据
|
|
|
+ assigneeList: [],
|
|
|
+ backList: [
|
|
|
+ {
|
|
|
+ key: '-1',
|
|
|
+ name: '发起人'
|
|
|
+ }
|
|
|
+ ],
|
|
|
+ error: '',
|
|
|
+ showAssign: false,
|
|
|
+ searchForm: {
|
|
|
+ // 搜索框对应data对象
|
|
|
+ name: ''
|
|
|
+ },
|
|
|
+
|
|
|
+ modalTaskTitle: '',
|
|
|
+ modalTitle: '', // 添加或编辑标题
|
|
|
+
|
|
|
+ form: {
|
|
|
+ id: '',
|
|
|
+ userId: '',
|
|
|
+ procInstId: '',
|
|
|
+ comment: '',
|
|
|
+ type: 0,
|
|
|
+ assignees: [],
|
|
|
+ backTaskKey: '-1',
|
|
|
+ sendMessage: true,
|
|
|
+ sendSms: false,
|
|
|
+ sendEmail: false
|
|
|
+ },
|
|
|
+ // formValidate: {
|
|
|
+ // // 表单验证规则
|
|
|
+ // },
|
|
|
+
|
|
|
+ submitLoading: false, // 添加或编辑提交状态
|
|
|
+ data: [], // 表单数据
|
|
|
+ total: 0, // 表单数据总数
|
|
|
+ dictPriority: [],
|
|
|
+ isGateway: false,
|
|
|
+ lcModal: {
|
|
|
+ title: '',
|
|
|
+ disabled: false,
|
|
|
+ visible: false,
|
|
|
+ formComponent: null,
|
|
|
+ isNew: false
|
|
|
+ },
|
|
|
+
|
|
|
+ url: {
|
|
|
+ todoList: '/actTask/todoList', // 待办
|
|
|
+ doneList: '/actTask/doneList', // 已办
|
|
|
+ deleteHistoricTask: '/actTask/deleteHistoric/', //已办接口
|
|
|
+ list: '/actBusiness/listData', // 申请
|
|
|
+
|
|
|
+ deleteHistoricTask: '/actTask/deleteHistoric/', //已办接口
|
|
|
+ pass: '/actTask/pass',
|
|
|
+ back: '/actTask/back',
|
|
|
+ backToTask: '/actTask/backToTask',
|
|
|
+ delegate: '/actTask/delegate',
|
|
|
+ getNextNode: '/activiti_process/getNextNode',
|
|
|
+ getNode: '/activiti_process/getNode/',
|
|
|
+ getBackList: '/actTask/getBackList/',
|
|
|
+ passAll: '/actTask/passAll/',
|
|
|
+ backAll: '/actTask/backAll/',
|
|
|
+ // 我的申请
|
|
|
+ cancelApply: '/actBusiness/cancel'
|
|
|
+ },
|
|
|
+
|
|
|
+ todoList: [], // 待办列表
|
|
|
+ applyList: [], // 申请列表
|
|
|
+ doneList: [], // 已办列表
|
|
|
+
|
|
|
+ modalTaskVisible: false,
|
|
|
+ procInstId: '',
|
|
|
+
|
|
|
+ modalCancelVisible: false
|
|
|
+ }
|
|
|
+ },
|
|
|
+
|
|
|
+ created() {
|
|
|
+ this.getDataList()
|
|
|
+ },
|
|
|
+ mounted() {
|
|
|
+ this.init()
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ init() {
|
|
|
+ this.getDataList()
|
|
|
+ },
|
|
|
+ loadData() {},
|
|
|
+
|
|
|
+ // 拿到 所有列表(待办、已办)
|
|
|
+ getDataList() {
|
|
|
+ // 待办
|
|
|
+ getAction(this.url.todoList, {}).then(res => {
|
|
|
+ if (res.success) {
|
|
|
+ this.todoList = res.result || []
|
|
|
+ this.total = this.data.leading
|
|
|
+ console.log('待办列表', this.todoList)
|
|
|
+ }
|
|
|
+ }),
|
|
|
+ // 已办
|
|
|
+ this.postFormAction(this.url.doneList, this.searchForm).then(res => {
|
|
|
+ this.loading = false
|
|
|
+ if (res.success) {
|
|
|
+ this.doneList = res.result || []
|
|
|
+ console.log('最新已办列表', this.doneList)
|
|
|
+ } else {
|
|
|
+ this.$message.error(res.message)
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+
|
|
|
+ // 初始化表
|
|
|
+ forminitial() {
|
|
|
+ this.form = {
|
|
|
+ id: '',
|
|
|
+ userId: '',
|
|
|
+ procInstId: '',
|
|
|
+ comment: '',
|
|
|
+ type: 0,
|
|
|
+ assignees: [],
|
|
|
+ backTaskKey: '-1',
|
|
|
+ sendMessage: true,
|
|
|
+ sendSms: false,
|
|
|
+ sendEmail: false
|
|
|
+ }
|
|
|
+ },
|
|
|
+
|
|
|
+ // 切换tabs值
|
|
|
+ callback(key) {
|
|
|
+ console.log(key)
|
|
|
+ if (key === 'apply') {
|
|
|
+ getAction(this.url.list).then(res => {
|
|
|
+ if (res.success) {
|
|
|
+ this.applyList = res.result || []
|
|
|
+ console.log('我的申请', this.applyList)
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+ if (key === 'done') {
|
|
|
+ getAction(this.url.doneList).then(res => {
|
|
|
+ if (res.success) {
|
|
|
+ this.doneList = res.result || []
|
|
|
+ console.log('我的已办', this.doneList)
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+ },
|
|
|
+
|
|
|
+ handleSearch() {
|
|
|
+ this.getDataList()
|
|
|
+ },
|
|
|
+ handleReset() {
|
|
|
+ this.searchForm = {}
|
|
|
+ // 重新加载数据
|
|
|
+ this.getDataList()
|
|
|
+ },
|
|
|
+ showSelect(e) {
|
|
|
+ this.selectList = e
|
|
|
+ this.selectCount = e.length
|
|
|
+ },
|
|
|
+ clearSelectAll() {
|
|
|
+ this.$refs.table.selectAll(false)
|
|
|
+ },
|
|
|
+
|
|
|
+ // 提交
|
|
|
+ handelSubmit() {
|
|
|
+ console.log('提交')
|
|
|
+ this.submitLoading = true
|
|
|
+ var formData = Object.assign({}, this.form)
|
|
|
+ formData.assignees = formData.assignees.join(',')
|
|
|
+ if (formData.type == 0) {
|
|
|
+ // 通过
|
|
|
+ if (this.showAssign && formData.assignees.length < 1) {
|
|
|
+ this.$message.error('请至少选择一个审批人')
|
|
|
+ this.submitLoading = false
|
|
|
+ return
|
|
|
+ } else {
|
|
|
+ this.error = ''
|
|
|
+ }
|
|
|
+ this.postFormAction(this.url.pass, formData).then(res => {
|
|
|
+ this.submitLoading = false
|
|
|
+ if (res.success) {
|
|
|
+ this.$message.success('操作成功')
|
|
|
+ this.modalTaskVisible = false
|
|
|
+ this.getDataList()
|
|
|
+ }
|
|
|
+ })
|
|
|
+ } else if (formData.type == 1) {
|
|
|
+ // 驳回
|
|
|
+ if (formData.backTaskKey == '-1') {
|
|
|
+ // 驳回至发起人
|
|
|
+ this.postFormAction(this.url.back, formData).then(res => {
|
|
|
+ this.submitLoading = false
|
|
|
+ if (res.success) {
|
|
|
+ this.$message.success('操作成功')
|
|
|
+ this.modalTaskVisible = false
|
|
|
+ this.getDataList()
|
|
|
+ }
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+ // 自定义驳回
|
|
|
+ if (formData.backTaskKey != '-1' && formData.assignees.length < 1) {
|
|
|
+ this.$message.error('请至少选择一个审批人')
|
|
|
+ this.submitLoading = false
|
|
|
+ return
|
|
|
+ } else {
|
|
|
+ this.error = ''
|
|
|
+ }
|
|
|
+ this.postFormAction(this.url.backToTask, formData).then(res => {
|
|
|
+ this.submitLoading = false
|
|
|
+ if (res.success) {
|
|
|
+ this.$message.success('操作成功')
|
|
|
+ this.modalTaskVisible = false
|
|
|
+ this.getDataList()
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+ } else if (formData.type == 2) {
|
|
|
+ // 委托
|
|
|
+ if (!formData.userId) {
|
|
|
+ this.$message.error('请选择一委托人')
|
|
|
+ this.submitLoading = false
|
|
|
+ return
|
|
|
+ } else {
|
|
|
+ this.error = ''
|
|
|
+ }
|
|
|
+ this.postFormAction(this.url.delegate, formData).then(res => {
|
|
|
+ this.submitLoading = false
|
|
|
+ if (res.success) {
|
|
|
+ this.$message.success('操作成功')
|
|
|
+ this.modalTaskVisible = false
|
|
|
+ this.getDataList()
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+ },
|
|
|
+
|
|
|
+ // 详情
|
|
|
+ detail(item) {
|
|
|
+ console.log('详情吗?', item)
|
|
|
+ if (!item.routeName) {
|
|
|
+ this.$message.warning('该流程信息未配置表单,请联系开发人员!')
|
|
|
+ return
|
|
|
+ }
|
|
|
+ item.operationType = '1' // 操作类型待办
|
|
|
+ if (item.routeName.indexOf('外部表单') != -1) {
|
|
|
+ //其他项目的表单流程
|
|
|
+ alert('调用其他项目页面')
|
|
|
+ } else if (item.routeName.indexOf('自定义') != -1) {
|
|
|
+ //自定义的表单流程
|
|
|
+ this.lcModal.disabled = true
|
|
|
+ this.lcModal.title = '查看流程业务信息:' + item.processName
|
|
|
+ let com = { component: () => import(`@/views/activiti/form/demoForm2`) }
|
|
|
+ this.lcModal.formComponent = com.component
|
|
|
+ this.lcModal.isNew = false
|
|
|
+ this.lcModal.processData = item
|
|
|
+ this.lcModal.visible = true
|
|
|
+ } else {
|
|
|
+ //固定的表单流程
|
|
|
+ this.lcModal.disabled = true
|
|
|
+ this.lcModal.title = '查看流程业务信息:' + item.processName
|
|
|
+ this.lcModal.formComponent = this.getFormComponent(item.routeName).component
|
|
|
+ this.lcModal.processData = item
|
|
|
+ this.lcModal.isNew = false
|
|
|
+ this.lcModal.visible = true
|
|
|
+ }
|
|
|
+ },
|
|
|
+
|
|
|
+ // 通过
|
|
|
+ passTask(v) {
|
|
|
+ console.log('我在哪是啥', v)
|
|
|
+ this.forminitial()
|
|
|
+ this.modalTaskTitle = '审批通过'
|
|
|
+ this.form.id = v.id
|
|
|
+ this.form.procInstId = v.procInstId
|
|
|
+ this.form.priority = v.priority
|
|
|
+ this.form.type = 0
|
|
|
+ this.modalTaskVisible = true
|
|
|
+ this.userLoading = true
|
|
|
+ this.getAction(this.url.getNextNode, { procDefId: v.procDefId, currActId: v.key, procInstId: v.procInstId }).then(
|
|
|
+ res => {
|
|
|
+ this.userLoading = false
|
|
|
+ if (res.success) {
|
|
|
+ if (res.result.type == 3 || res.result.type == 4) {
|
|
|
+ this.isGateway = true
|
|
|
+ this.showAssign = false
|
|
|
+ this.error = ''
|
|
|
+ return
|
|
|
+ }
|
|
|
+ this.isGateway = false
|
|
|
+ if (res.result.users && res.result.users.length > 0) {
|
|
|
+ this.error = ''
|
|
|
+ this.assigneeList = res.result.users
|
|
|
+ // 默认勾选
|
|
|
+ let ids = []
|
|
|
+ res.result.users.forEach(e => {
|
|
|
+ ids.push(e.username)
|
|
|
+ })
|
|
|
+ this.form.assignees = ids
|
|
|
+ this.showAssign = true
|
|
|
+ } else {
|
|
|
+ this.form.assignees = []
|
|
|
+ this.showAssign = false
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ )
|
|
|
+ },
|
|
|
+
|
|
|
+ // 审批驳回
|
|
|
+ changeBackTask(v) {
|
|
|
+ console.log('驳回吗?', v)
|
|
|
+ if (v == '-1') {
|
|
|
+ return
|
|
|
+ }
|
|
|
+ this.userLoading = true
|
|
|
+ this.getAction(this.url.getNode + v + '&' + this.form.procInstId).then(res => {
|
|
|
+ this.userLoading = false
|
|
|
+ if (res.success) {
|
|
|
+ if (res.result.users && res.result.users.length > 0) {
|
|
|
+ this.assigneeList = res.result.users
|
|
|
+ // 默认勾选
|
|
|
+ let ids = []
|
|
|
+ res.result.users.forEach(e => {
|
|
|
+ ids.push(e.username)
|
|
|
+ })
|
|
|
+ this.form.assignees = ids
|
|
|
+ }
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+
|
|
|
+ // 操作 驳回
|
|
|
+ backTask(v) {
|
|
|
+ console.log('驳回吗?', v)
|
|
|
+ this.forminitial()
|
|
|
+ this.modalTaskTitle = '审批驳回'
|
|
|
+ this.form.id = v.id
|
|
|
+ this.form.procInstId = v.procInstId
|
|
|
+ this.form.procDefId = v.procDefId
|
|
|
+ this.form.priority = v.priority
|
|
|
+ this.form.type = 1
|
|
|
+ this.showAssign = false
|
|
|
+ this.modalTaskVisible = true
|
|
|
+ // 获取可驳回节点
|
|
|
+ this.backList = [
|
|
|
+ {
|
|
|
+ key: '-1',
|
|
|
+ name: '发起人'
|
|
|
+ }
|
|
|
+ ]
|
|
|
+ this.form.backTaskKey = '-1'
|
|
|
+ this.backLoading = true
|
|
|
+ this.getAction(this.url.getBackList + v.procInstId).then(res => {
|
|
|
+ this.backLoading = false
|
|
|
+ if (res.success) {
|
|
|
+ res.result.forEach(e => {
|
|
|
+ this.backList.push(e)
|
|
|
+ })
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+
|
|
|
+ // 委托他人代办
|
|
|
+ delegateTask(v) {
|
|
|
+ console.log('委托吗?', v)
|
|
|
+ this.forminitial()
|
|
|
+ this.modalTaskTitle = '委托他人代办'
|
|
|
+ this.form.id = v.id
|
|
|
+ this.form.procInstId = v.procInstId
|
|
|
+ this.form.type = 2
|
|
|
+ this.showAssign = false
|
|
|
+ this.modalTaskVisible = true
|
|
|
+ },
|
|
|
+
|
|
|
+ //待办 历史
|
|
|
+ history(v) {
|
|
|
+ console.log('历史吗?', v)
|
|
|
+ if (!v.procInstId) {
|
|
|
+ this.$message.error('流程实例ID不存在')
|
|
|
+ return
|
|
|
+ }
|
|
|
+ console.log(v.procInstId)
|
|
|
+ this.procInstId = v.procInstId
|
|
|
+ this.modalLsVisible = true
|
|
|
+ },
|
|
|
+ // ------------------------------------
|
|
|
+ // 审批 历史(已办)
|
|
|
+ Donehistory(item) {
|
|
|
+ console.log('已办审批历史吗?', item)
|
|
|
+ if (!item.procInstId) {
|
|
|
+ console.log('item.procInstId')
|
|
|
+ this.procInstId = item.procInstId
|
|
|
+ this.modalLsVisible = true
|
|
|
+ this.$message.error('流程实例ID不存在')
|
|
|
+ return
|
|
|
+ }
|
|
|
+ this.procInstId = item.procInstId
|
|
|
+ this.modalLsVisible = true
|
|
|
+ },
|
|
|
+
|
|
|
+ // 已办 methods
|
|
|
+ remove(item) {
|
|
|
+ console.log('点击这项是:', item)
|
|
|
+ this.postFormAction(this.url.deleteHistoricTask, item.id).then(res => {
|
|
|
+ console.log(res)
|
|
|
+ if (res.success) {
|
|
|
+ console.log('要删除的这项id是:', item.id)
|
|
|
+ this.$message.success('操作成功')
|
|
|
+ this.getDataList()
|
|
|
+ } else {
|
|
|
+ this.$message.error(res.message)
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+
|
|
|
+ //通过所有
|
|
|
+ passAll() {
|
|
|
+ if (this.selectCount <= 0) {
|
|
|
+ this.$message.warning('您还未选择要通过的数据')
|
|
|
+ return
|
|
|
+ }
|
|
|
+ // 批量通过
|
|
|
+ this.modalVisible = true
|
|
|
+ this.$confirm({
|
|
|
+ title: '确认通过',
|
|
|
+ content: '您确认要通过所选的 ' + this.selectCount + ' 条数据? 注意:将默认分配给节点设定的所有可审批用户',
|
|
|
+ loading: true,
|
|
|
+ onOk: () => {
|
|
|
+ let ids = ''
|
|
|
+ this.selectList.forEach(function(e) {
|
|
|
+ ids += e.id + ','
|
|
|
+ })
|
|
|
+ ids = ids.substring(0, ids.length - 1)
|
|
|
+ this.postFormAction(this.url.passAll, { ids: ids }).then(res => {
|
|
|
+ if (res.success) {
|
|
|
+ this.$message.success('操作成功')
|
|
|
+ this.modalVisible = false
|
|
|
+ this.clearSelectAll()
|
|
|
+ this.getDataList()
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+
|
|
|
+ // 驳回所有
|
|
|
+ backAll() {
|
|
|
+ console.log('111')
|
|
|
+ if (this.selectCount <= 0) {
|
|
|
+ this.$message.warning('您还未选择要驳回的数据')
|
|
|
+ return
|
|
|
+ }
|
|
|
+ // 批量驳回
|
|
|
+ this.modalVisible = true
|
|
|
+ this.$confirm({
|
|
|
+ title: '确认驳回',
|
|
|
+ content: '您确认要驳回所选的 ' + this.selectCount + ' 条数据? 注意:所有流程将驳回至发起人',
|
|
|
+ loading: true,
|
|
|
+ onOk: () => {
|
|
|
+ let procInstIds = ''
|
|
|
+ this.selectList.forEach(function(e) {
|
|
|
+ procInstIds += e.procInstId + ','
|
|
|
+ })
|
|
|
+ procInstIds = procInstIds.substring(0, procInstIds.length - 1)
|
|
|
+ this.postFormAction(this.url.backAll, { procInstIds: procInstIds }).then(res => {
|
|
|
+ if (res.success) {
|
|
|
+ this.$message.success('操作成功')
|
|
|
+ this.modalVisible = false
|
|
|
+ this.clearSelectAll()
|
|
|
+ this.getDataList()
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ // 申请 方法
|
|
|
+ // 撤回
|
|
|
+ cancel(item) {
|
|
|
+ console.log('走到这没', item.id)
|
|
|
+ console.log('222', item.procInstId)
|
|
|
+ this.cancelForm.id = item.id
|
|
|
+ this.cancelForm.procInstId = DictItemListVue.procInstId
|
|
|
+ this.modalCancelVisible = true
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|
|
|
+</script>
|
|
|
+
|
|
|
+<style src="@assets/less/overwrite.less" lang="less" scoped></style>
|
|
|
+<style lang="less">
|
|
|
+@import '~@assets/less/common.less';
|
|
|
+</style>
|
|
|
+<style lang="less" scoped>
|
|
|
+.content {
|
|
|
+ .main {
|
|
|
+ padding: 14px;
|
|
|
+
|
|
|
+ //tabs 内容
|
|
|
+ .todoBody {
|
|
|
+ //优先级
|
|
|
+ .priorityComm {
|
|
|
+ padding: 4px 10px;
|
|
|
+ color: #092834;
|
|
|
+ letter-spacing: 1px;
|
|
|
+ }
|
|
|
+ // 状态
|
|
|
+ .statusComm {
|
|
|
+ padding: 4px 6px;
|
|
|
+ color: #092834;
|
|
|
+ }
|
|
|
+
|
|
|
+ // 结果
|
|
|
+ .resultComm {
|
|
|
+ padding: 4px 10px;
|
|
|
+ color: white;
|
|
|
+ letter-spacing: 1px;
|
|
|
+ }
|
|
|
+ // 操作 ===============================
|
|
|
+ .wait .btns {
|
|
|
+ position: relative;
|
|
|
+
|
|
|
+ .midBtn {
|
|
|
+ margin-left: 3.3%;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ //已办 操作按钮
|
|
|
+ .done .btns {
|
|
|
+ display: flex;
|
|
|
+ justify-content: space-between;
|
|
|
+ }
|
|
|
+
|
|
|
+ //申请 不同情况按钮排布
|
|
|
+ .apply .btns .ingBtns,
|
|
|
+ .apply .btns .overBtns {
|
|
|
+ display: flex;
|
|
|
+ justify-content: space-between;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|
|
|
+</style>
|