|
@@ -1,7 +1,7 @@
|
|
|
<template>
|
|
|
<div class="content">
|
|
|
<div class="main">
|
|
|
- <a-layout-header style="padding:0;color:white;background:#347b98;">
|
|
|
+ <a-layout-header class="todoHeader">
|
|
|
<a-icon type="left" @click="$router.go(-1)" style="fontSize:24px;color:white;marginLeft:2%;" />
|
|
|
<span
|
|
|
style="fontSize:20px;
|
|
@@ -15,7 +15,6 @@
|
|
|
</a-layout-header>
|
|
|
|
|
|
<!-- tabs 部分 -->
|
|
|
-
|
|
|
<a-layout-content>
|
|
|
<a-tabs default-active-key="wait" @change="callback" style="text-align: center;" className="todoTabs">
|
|
|
<!-- 我的申请 -->
|
|
@@ -27,40 +26,35 @@
|
|
|
text-align:left;
|
|
|
marginBottom:20px;
|
|
|
border:none;
|
|
|
- background-color:rgba(247, 224, 212,.8);">
|
|
|
-
|
|
|
- <p
|
|
|
- style="fontSize:16px;fontWeight:700; color:#092834;">
|
|
|
-
|
|
|
+ background-color:rgba(247, 224, 212,.8);"
|
|
|
+ >
|
|
|
+ <p style="fontSize:16px;fontWeight:700;color:#092834;">
|
|
|
<a-icon type="highlight" class="cardIcon" />
|
|
|
- 所属流程:{{ item.processName }}
|
|
|
+ {{ item.processName }}
|
|
|
</p>
|
|
|
- <p>标题:{{ item.title }}</p>
|
|
|
+ <p>当前审批环节:{{ item.currTaskName }}</p>
|
|
|
<p>创建时间:{{ item.createTime }}</p>
|
|
|
|
|
|
<!-- 申请状态 -->
|
|
|
<p>
|
|
|
状态:
|
|
|
-
|
|
|
- <span v-if="item.status == 0" class="statusComm">
|
|
|
+ <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,.1);">
|
|
|
+ <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,.1);">
|
|
|
+ <span v-if="item.status == 2" class="statusComm" style="background:rgb(9, 40, 52,.2);">
|
|
|
已结束
|
|
|
</span>
|
|
|
|
|
|
- <span v-if="item.status == 3" class="statusComm">
|
|
|
+ <span v-if="item.status == 3" class="statusComm" style="background:rgb(9, 40, 52,.1);">
|
|
|
已撤回
|
|
|
</span>
|
|
|
</p>
|
|
|
|
|
|
- <a-divider class="dividerBgcO"></a-divider>
|
|
|
-
|
|
|
<!-- 申请结果 -->
|
|
|
<p style="float:left;">
|
|
|
结果:
|
|
@@ -83,6 +77,8 @@
|
|
|
</p>
|
|
|
|
|
|
<p style="float:right;">发起人:{{ item.createBy }}</p>
|
|
|
+
|
|
|
+ <a-divider class="dividerBgcO"></a-divider>
|
|
|
</a-card>
|
|
|
</div>
|
|
|
</a-tab-pane>
|
|
@@ -98,25 +94,23 @@
|
|
|
border:none;
|
|
|
background-color:rgba(247, 224, 212,.8);"
|
|
|
>
|
|
|
- <p style="fontSize:16px;fontWeight:700; color:#092834;">
|
|
|
- <a-icon type="bell" class="cardIcon" />
|
|
|
- 所属流程:{{ item.processName }}
|
|
|
+ <p style="fontSize:16px;fontWeight:700;color:#092834;">
|
|
|
+ <!-- <a-icon type="bell" class="cardIcon" /> -->
|
|
|
+ <img src="@assets/look.png" width="30px;" alt="????" />
|
|
|
+ {{ item.processName }}
|
|
|
</p>
|
|
|
<p>任务名称:{{ item.name }}</p>
|
|
|
<p>创建时间:{{ item.createTime }}</p>
|
|
|
-
|
|
|
- <a-divider class="dividerBgcO"></a-divider>
|
|
|
-
|
|
|
<!-- 优先级 -->
|
|
|
- <p style="float:left;">
|
|
|
+ <p>
|
|
|
优先级:
|
|
|
<span
|
|
|
class="priorityComm"
|
|
|
v-if="item.priority == 0"
|
|
|
- style="background:rgba(20, 137, 184,.8);
|
|
|
- padding:4px 10px;
|
|
|
- borderRadius:6px;
|
|
|
- color:white;"
|
|
|
+ style="background:rgba(252, 96, 10,.4);
|
|
|
+ padding:2px 6px;
|
|
|
+ borderRadius:2px;
|
|
|
+ color:#092834;"
|
|
|
>
|
|
|
普通
|
|
|
</span>
|
|
@@ -141,17 +135,191 @@
|
|
|
>
|
|
|
紧急
|
|
|
</span>
|
|
|
- <span
|
|
|
- class="priorityComm"
|
|
|
- v-else
|
|
|
- style="background:#999;
|
|
|
- "
|
|
|
- >
|
|
|
+ <span class="priorityComm" v-else style="background:#999;">
|
|
|
无
|
|
|
</span>
|
|
|
</p>
|
|
|
- <p style="float:right;">发起人:{{ item.applyer }}</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 dashed style="background:#ccc;"></a-divider>
|
|
|
+
|
|
|
+ <!-- 操作按钮 -->
|
|
|
+ <div class="operation">
|
|
|
+ <p style="fontSize:16px;fontWeight:700;color:#092834;">
|
|
|
+ <img src="@assets/down.png" width="30px;" alt="???? " />
|
|
|
+ 操作
|
|
|
+ </p>
|
|
|
+
|
|
|
+ <div class="btns">
|
|
|
+ <a-button
|
|
|
+ class="itemBtn"
|
|
|
+ ghost
|
|
|
+ @click="detail(item)"
|
|
|
+ style="box-shadow: 8px 8px 8px rgba(128, 128, 128,.9);
|
|
|
+ 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 mid"
|
|
|
+ ghost
|
|
|
+ @click="passTask(item.id)"
|
|
|
+ style="box-shadow: 8px 8px 8px rgba(128, 128, 128,.9);
|
|
|
+ color:#4e73b9;"
|
|
|
+ >
|
|
|
+ 通过
|
|
|
+ </a-button>
|
|
|
+
|
|
|
+ <a-button
|
|
|
+ class="itemBtn mid"
|
|
|
+ ghost
|
|
|
+ @click="backTask(item.id)"
|
|
|
+ style="color:gray;box-shadow: 5px 5px 5px rgba(128, 128, 128,.7);color:#ea472c;"
|
|
|
+ >
|
|
|
+ 驳回
|
|
|
+ </a-button>
|
|
|
+
|
|
|
+ <a-button
|
|
|
+ class="itemBtn mid"
|
|
|
+ ghost
|
|
|
+ @click="delegateTask(item.id)"
|
|
|
+ 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.id)"
|
|
|
+ style="color:gray;box-shadow: 4px 4px 4px rgba(128, 128, 128,.9);color#f2c617;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">
|
|
|
+ <a-form ref="form" :model="form" :label-width="85" :rules="formValidate">
|
|
|
+ <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>
|
|
|
|
|
@@ -166,7 +334,7 @@
|
|
|
border:none;
|
|
|
background-color:rgba(247, 224, 212,.8);"
|
|
|
>
|
|
|
- <p style="fontSize:16px;fontWeight:700; color:#092834;">
|
|
|
+ <p style="fontSize:16px;fontWeight:700;color:#092834;">
|
|
|
<a-icon type="check" class="cardIcon" />
|
|
|
任务名称:{{ item.name }}
|
|
|
</p>
|
|
@@ -178,11 +346,11 @@
|
|
|
<p style="float:left;">
|
|
|
审批操作:
|
|
|
<span
|
|
|
- style="background:rgba(252, 96, 10,.6);
|
|
|
- padding:4px 4px;
|
|
|
- borderRadius:6px;
|
|
|
+ style="background:rgba(20, 137, 184,.3);
|
|
|
+ padding:4px 10px;
|
|
|
+ borderRadius:2px;
|
|
|
letterSpacing:1px;
|
|
|
- color:white;"
|
|
|
+ color: #092834;"
|
|
|
>
|
|
|
{{ item.deleteReason }}
|
|
|
</span>
|
|
@@ -203,96 +371,442 @@
|
|
|
|
|
|
<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'
|
|
|
+
|
|
|
export default {
|
|
|
- name: 'Todo',
|
|
|
- components: {},
|
|
|
- data () {
|
|
|
- return {
|
|
|
- todoList: [], // 待办列表
|
|
|
- applyList: [], // 申请列表
|
|
|
- doneList: [], // 已办列表
|
|
|
- url: {
|
|
|
- todoList: '/actTask/todoList', // 待办
|
|
|
- list: '/actBusiness/listData', // 申请
|
|
|
- doneList: '/actTask/doneList' // 已办
|
|
|
- }
|
|
|
+ name: 'Todo',
|
|
|
+ mixins: [activitiMixin, JeecgListMixin],
|
|
|
+ components: { JSelectUserByDep },
|
|
|
+ data() {
|
|
|
+ return {
|
|
|
+ todoList: [], // 待办列表
|
|
|
+ applyList: [], // 申请列表
|
|
|
+ doneList: [], // 已办列表
|
|
|
+ url: {
|
|
|
+ todoList: '/actTask/todoList', // 待办
|
|
|
+ list: '/actBusiness/listData', // 申请
|
|
|
+ doneList: '/actTask/doneList' // 已办
|
|
|
+ },
|
|
|
+ /*历史*/
|
|
|
+ modalLsVisible: false,
|
|
|
+ modalTaskTitle: '',
|
|
|
+ modalTaskVisible: false,
|
|
|
+ submitLoading: false, // 添加或编辑提交状态
|
|
|
+ procInstId: '',
|
|
|
+ lcModal: {
|
|
|
+ title: '',
|
|
|
+ disabled: false,
|
|
|
+ visible: false,
|
|
|
+ formComponent: null,
|
|
|
+ isNew: false
|
|
|
+ },
|
|
|
+ form: {
|
|
|
+ id: '',
|
|
|
+ userId: '',
|
|
|
+ procInstId: '',
|
|
|
+ comment: '',
|
|
|
+ type: 0,
|
|
|
+ assignees: [],
|
|
|
+ backTaskKey: '-1',
|
|
|
+ sendMessage: true,
|
|
|
+ sendSms: false,
|
|
|
+ sendEmail: false
|
|
|
+ },
|
|
|
+ formValidate: {
|
|
|
+ // 表单验证规则
|
|
|
+ },
|
|
|
+ error: '',
|
|
|
+ showAssign: false,
|
|
|
+ assigneeList: [],
|
|
|
+ isGateway: false,
|
|
|
+ backLoading: false,
|
|
|
+ backList: [
|
|
|
+ {
|
|
|
+ key: '-1',
|
|
|
+ name: '发起人'
|
|
|
}
|
|
|
+ ]
|
|
|
+ }
|
|
|
+ },
|
|
|
+ computed: {},
|
|
|
+
|
|
|
+ created() {
|
|
|
+ this.getDataList()
|
|
|
+ },
|
|
|
+
|
|
|
+ methods: {
|
|
|
+ // 初始化表
|
|
|
+ forminitial() {
|
|
|
+ this.form = {
|
|
|
+ id: '',
|
|
|
+ userId: '',
|
|
|
+ procInstId: '',
|
|
|
+ comment: '',
|
|
|
+ type: 0,
|
|
|
+ assignees: [],
|
|
|
+ backTaskKey: '-1',
|
|
|
+ sendMessage: true,
|
|
|
+ sendSms: false,
|
|
|
+ sendEmail: false
|
|
|
+ }
|
|
|
},
|
|
|
- computed: {},
|
|
|
|
|
|
- created () {
|
|
|
- this.getDataList()
|
|
|
+ init() {
|
|
|
+ this.getDataList()
|
|
|
},
|
|
|
-
|
|
|
- methods: {
|
|
|
+ loadData() {},
|
|
|
// 切换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)
|
|
|
- }
|
|
|
- })
|
|
|
+ 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)
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+ },
|
|
|
+ // 拿到 todoList
|
|
|
+ getDataList() {
|
|
|
+ getAction(this.url.todoList, {}).then(res => {
|
|
|
+ if (res.success) {
|
|
|
+ this.todoList = res.result || []
|
|
|
+ console.log('待办列表', this.todoList)
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+
|
|
|
+ // -------------------------------------
|
|
|
+ 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()
|
|
|
}
|
|
|
- if (key === 'done') {
|
|
|
- getAction(this.url.doneList).then(res => {
|
|
|
- if (res.success) {
|
|
|
- this.doneList = res.result || []
|
|
|
- console.log('已办列表', this.doneList)
|
|
|
- }
|
|
|
- })
|
|
|
+ })
|
|
|
+ } 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()
|
|
|
}
|
|
|
- },
|
|
|
- // 拿到 todoList
|
|
|
- getDataList () {
|
|
|
- getAction(this.url.todoList, {}).then(res => {
|
|
|
- if (res.success) {
|
|
|
- this.todoList = res.result || []
|
|
|
- console.log('待办列表', this.todoList)
|
|
|
- }
|
|
|
+ })
|
|
|
+ }
|
|
|
+ } 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('该id所有信息', item.routeName)
|
|
|
+ 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) {
|
|
|
+ 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) {
|
|
|
+ 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) {
|
|
|
+ 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) {
|
|
|
+ if (!v.procInstId) {
|
|
|
+ this.$message.error('流程实例ID不存在')
|
|
|
+ return
|
|
|
+ }
|
|
|
+ this.procInstId = v.procInstId
|
|
|
+ this.modalLsVisible = true
|
|
|
+ },
|
|
|
+
|
|
|
+ //通过所有
|
|
|
+ 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() {
|
|
|
+ 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()
|
|
|
+ }
|
|
|
+ })
|
|
|
}
|
|
|
+ })
|
|
|
}
|
|
|
+ }
|
|
|
}
|
|
|
</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 {
|
|
|
width: 100%;
|
|
|
height: 100%;
|
|
|
background-color: rgba(247, 224, 212, 0.4);
|
|
|
}
|
|
|
+.todoHeader {
|
|
|
+ padding: 0;
|
|
|
+ color: white;
|
|
|
+ background-color: #347b98;
|
|
|
+ box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.1), 0 6px 20px 0 rgba(0, 0, 0, 0.19);
|
|
|
+ margin-bottom: 20px;
|
|
|
+ letter-spacing: 1px;
|
|
|
+}
|
|
|
.main {
|
|
|
padding: 14px;
|
|
|
}
|
|
|
-// 单个事项卡片 最后一行
|
|
|
-.dividerDown {
|
|
|
- color: #a19c9c;
|
|
|
-}
|
|
|
-
|
|
|
-// 时间
|
|
|
-.dividerDown i {
|
|
|
- font-style: normal;
|
|
|
- margin-right: 10px;
|
|
|
-}
|
|
|
-// 来自
|
|
|
-.dividerDown em {
|
|
|
- font-style: normal;
|
|
|
- display: inline-block;
|
|
|
- margin: 0 10px;
|
|
|
-}
|
|
|
-
|
|
|
-// 状态
|
|
|
-.dividerDown .state {
|
|
|
- float: right;
|
|
|
- background-color: rgba(161, 160, 156, 0.2);
|
|
|
- padding: 2px 14px;
|
|
|
- border-radius: 5px;
|
|
|
- color: rgb(114, 110, 110);
|
|
|
-}
|
|
|
//撤销状态
|
|
|
.state .cancel {
|
|
|
background-color: rgba(161, 160, 156, 0.2);
|
|
@@ -304,26 +818,40 @@ export default {
|
|
|
color: rgb(22, 139, 85);
|
|
|
}
|
|
|
|
|
|
-//优先级的公共样式
|
|
|
+//优先级 公共样式 small
|
|
|
.priorityComm {
|
|
|
padding: 4px 10px;
|
|
|
- border-radius: 6px;
|
|
|
- color: white;
|
|
|
+ color: #092834;
|
|
|
letter-spacing: 1px;
|
|
|
}
|
|
|
|
|
|
-// 结果公共样式
|
|
|
+// 状态 公共样式 small
|
|
|
+.statusComm {
|
|
|
+ padding: 4px 6px;
|
|
|
+ color: #092834;
|
|
|
+}
|
|
|
+
|
|
|
+// 结果 公共样式 big
|
|
|
.resultComm {
|
|
|
padding: 4px 10px;
|
|
|
- border-radius: 6px;
|
|
|
color: white;
|
|
|
letter-spacing: 1px;
|
|
|
}
|
|
|
-
|
|
|
-// 状态公共样式
|
|
|
-.statusComm {
|
|
|
- border-radius: 2px;
|
|
|
- padding: 2px 6px;
|
|
|
- color: #092834;
|
|
|
+.btns {
|
|
|
+ // background-color: rgba(235, 186, 26, 0.4);
|
|
|
+ position: relative;
|
|
|
+}
|
|
|
+.operation /deep/.ant-btn {
|
|
|
+ padding: 0;
|
|
|
+ line-height: 0;
|
|
|
+ border: 1px dashed rgba(128, 128, 128, 0.1);
|
|
|
+ border-radius: 18px;
|
|
|
+ padding: 26px 14px;
|
|
|
+}
|
|
|
+.mid {
|
|
|
+ margin-left: 6%;
|
|
|
+}
|
|
|
+.itemBtn {
|
|
|
+ font-weight: 700;
|
|
|
}
|
|
|
</style>
|