workflowMenu

This commit is contained in:
shijing 2021-09-24 15:32:30 +08:00
parent 142bd0a8d0
commit 767c20bc90
2 changed files with 163 additions and 59 deletions

View File

@ -257,42 +257,34 @@ export const asyncRoutes = [
} }
] ]
}, },
{ {
path: '/workflow', path: '/workflow',
component: Layout, component: Layout,
redirect: '/workflow/index', redirect: '/workflow/index',
name: 'workflow', name: 'workflow',
meta: { title: '工作流管理', icon: 'example', perms: ['workflow_set'] }, meta: { title: '工作流', icon: 'example', perms: ['workflow_set'] },
children: [ children: [
{
path: 'index',
name: 'index',
component: () => import('@/views/workflow/index'),
meta: { title: '工作流配置', icon: 'example', perms: ['workflow_manage'] }
},
{ {
path: 'configuration', path: 'index',
name: 'configuration', name: 'index',
component: () => import('@/views/workflow/configuration'), component: () => import('@/views/workflow/index'),
meta: { title: '人员信息详情', icon: 'example', perms: ['configuration_manage'] }, meta: { title: '工作流配置', icon: 'example', perms: ['workflow_manage'] }
hidden: true
}, },
{ {
path: 'ticket', path: 'ticket',
name: 'ticket', name: 'ticket',
component: () => import('@/views/workflow/ticket'), component: () => import('@/views/workflow/ticket'),
meta: { title: '工单列表', icon: 'example', perms: ['ticket_manage'] }, meta: { title: '工单管理', icon: 'example', perms: ['workflow_manage'] },
hidden: true },
},{ {
path: 'test', path: 'configuration',
name: 'test', name: 'configuration',
component: () => import('@/views/workflow/test'), component: () => import('@/views/workflow/configuration'),
meta: { title: '工单', icon: 'example', perms: ['test_manage'] }, meta: { title: '人员信息详情', icon: 'example', perms: ['workflow_manage'] },
hidden: true hidden: true
}, },
] ]
}, },
{ {
path: '/system', path: '/system',
component: Layout, component: Layout,

View File

@ -1,36 +1,130 @@
<template> <template>
<div class="app-container"> <div class="app-container">
<el-card style="margin-top: 10px"> <el-tabs v-model="activeName" type="border-card" @tab-click="handleClick">
<el-table v-loading="listLoading" :data="tickets" border fit stripe highlight-current-row max-height="600"> <el-tab-pane label="待处理" name="first">
<el-table-column type="index" width="50" /> <el-table :data="tickets" border fit stripe style="width: 100%" >
<el-table-column label="工单标题"> <el-table-column label="工单标题" min-width="100" prop="title">
<template slot-scope="scope">{{ scope.row.title }}</template> </el-table-column>
</el-table-column> <el-table-column label="当前状态" min-width="100">
<el-table-column label="当前状态"> <template slot-scope="scope">
<template slot-scope="scope"> <span v-if="scope.row.act_state===1">已提交</span>
<span v-if="scope.row.act_state===1">已提交</span> <span v-else-if="scope.row.act_state===4">已完成</span>
<span v-else-if="scope.row.act_state===4">已完成</span> <span v-else>审批中</span>
<span v-else>审批中</span> </template>
</template> </el-table-column>
</el-table-column> <el-table-column label="类型" min-width="100">
<el-table-column width="180" label="创建时间"> <template slot-scope="scope">{{ scope.row.workflow_.name }}</template>
<template slot-scope="scope">{{ scope.row.create_time }}</template> </el-table-column>
</el-table-column> <el-table-column label="创建时间" min-width="100" prop="create_time">
<el-table-column align="center" label="操作" width="220px"> </el-table-column>
<template slot-scope="scope"> <el-table-column align="center" label="操作">
<el-link v-if="stateSteps==scope.row.act_state" type="danger" @click="handlePicture(scope)">查看流程图</el-link> <template slot-scope="scope">
<el-link v-else type="danger" @click="handleDetail(scope)">工单详情</el-link> <el-link v-if="stateSteps==scope.row.act_state" type="danger" @click="handlePicture(scope)">查看流程图</el-link>
</template> <el-link v-else type="danger" @click="handleDetail(scope)">处理</el-link>
</el-table-column> <!--<el-link type="danger" @click="handleDetail(scope)">处理</el-link>-->
</el-table> </template>
<pagination </el-table-column>
v-show="total > 0" </el-table>
:total="total" <pagination
:page.sync="pageForm.page" :total="total"
:limit.sync="pageForm.page_size" :page.sync="pageForm.page"
@pagination="getList" :limit.sync="pageForm.page_size"
/> @pagination="getList"
</el-card> />
</el-tab-pane>
<el-tab-pane label="已处理" name="second">
<el-table :data="tickets" border fit stripe style="width: 100%" >
<el-table-column label="工单标题" min-width="100" prop="title">
</el-table-column>
<el-table-column label="当前状态" min-width="100">
<template slot-scope="scope">
<span v-if="scope.row.act_state===1">已提交</span>
<span v-else-if="scope.row.act_state===4">已完成</span>
<span v-else>审批中</span>
</template>
</el-table-column>
<el-table-column label="类型" min-width="100">
<template slot-scope="scope">{{ scope.row.workflow_.name }}</template>
</el-table-column>
<el-table-column label="创建时间" min-width="100" prop="create_time">
</el-table-column>
<el-table-column align="center" label="操作">
<template slot-scope="scope">
<el-link v-if="stateSteps==scope.row.act_state" type="danger" @click="handlePicture(scope)">查看流程图</el-link>
<el-link v-else type="danger" @click="handleDetail(scope)">处理</el-link>
</template>
</el-table-column>
</el-table>
<pagination
:total="total"
:page.sync="pageForm.page"
:limit.sync="pageForm.page_size"
@pagination="getList"
/>
</el-tab-pane>
<el-tab-pane label="已发起" name="third">
<!--<el-button type="primary" icon="el-icon-plus" @click="handleusedstepCreate"-->
<!--&gt;新增</el-button>-->
<el-table :data="tickets" border fit stripe style="width: 100%" >
<el-table-column label="工单标题" min-width="100" prop="title">
</el-table-column>
<el-table-column label="当前状态" min-width="100">
<template slot-scope="scope">
<span v-if="scope.row.act_state===1">已提交</span>
<span v-else-if="scope.row.act_state===4">已完成</span>
<span v-else>审批中</span>
</template>
</el-table-column>
<el-table-column label="类型" min-width="100">
<template slot-scope="scope">{{ scope.row.workflow_.name }}</template>
</el-table-column>
<el-table-column label="创建时间" min-width="100" prop="create_time">
</el-table-column>
<el-table-column align="center" label="操作">
<template slot-scope="scope">
<el-link type="danger" @click="handleDetail(scope)">处理</el-link>
</template>
</el-table-column>
</el-table>
<pagination
:total="total"
:page.sync="pageForm.page"
:limit.sync="pageForm.page_size"
@pagination="getList"
/>
</el-tab-pane>
<el-tab-pane label="抄送我" name="fourth">
<el-table :data="tickets" border fit stripe style="width: 100%" >
<el-table-column label="工单标题" min-width="100" prop="title">
</el-table-column>
<el-table-column label="当前状态" min-width="100">
<template slot-scope="scope">
<span v-if="scope.row.act_state===1">已提交</span>
<span v-else-if="scope.row.act_state===4">已完成</span>
<span v-else>审批中</span>
</template>
</el-table-column>
<el-table-column label="类型" min-width="100">
<template slot-scope="scope">{{ scope.row.workflow_.name }}</template>
</el-table-column>
<el-table-column label="创建时间" min-width="100" prop="create_time">
</el-table-column>
<el-table-column align="center" label="操作">
<template slot-scope="scope">
<el-link v-if="stateSteps==scope.row.act_state" type="danger" @click="handlePicture(scope)">查看流程图</el-link>
<el-link v-else type="danger" @click="handleDetail(scope)">处理</el-link>
<!--<el-link type="danger" @click="handleDetail(scope)">处理</el-link>-->
</template>
</el-table-column>
</el-table>
<pagination
:total="total"
:page.sync="pageForm.page"
:limit.sync="pageForm.page_size"
@pagination="getList"
/>
</el-tab-pane>
</el-tabs>
<div class="svgMark" v-if="dialogVisible" @click="closeMark"> <div class="svgMark" v-if="dialogVisible" @click="closeMark">
<div class="svgWrapper"> <div class="svgWrapper">
<div class="svgItem">工单流程图<i class="el-dialog__close el-icon el-icon-close" @click="closeMark"></i></div> <div class="svgItem">工单流程图<i class="el-dialog__close el-icon el-icon-close" @click="closeMark"></i></div>
@ -96,6 +190,7 @@
}, },
workflow:0, workflow:0,
stateSteps:0, stateSteps:0,
activeName:'first',
keyword:'', keyword:'',
tickets:[], tickets:[],
ticketDetail:{}, ticketDetail:{},
@ -152,11 +247,28 @@
this.listLoading = true; this.listLoading = true;
getTickets( this.pageForm).then((res)=>{ getTickets( this.pageForm).then((res)=>{
if(res.data.results){ if(res.data.results){
this.total = res.data.count;
this.tickets = res.data.results; this.tickets = res.data.results;
this.listLoading = false; this.listLoading = false;
} }
}) })
}, },
handleClick(tab, event) {
console.log(tab, event);
debugger;
//pagepageSizetotaltickets都要发生变化
let paneName = tab.paneName;
this.activeName = paneName;
if(paneName=='first'){
}else if(paneName=='second'){
}else if(paneName=='third'){
}else if(paneName=='fourth'){
}
},
getStates(){ getStates(){
getWfStateList(this.workflow).then((response) => { getWfStateList(this.workflow).then((response) => {
if (response.data) { if (response.data) {