parent
b18c5279e0
commit
cf1bd87e50
13 changed files with 485 additions and 303 deletions
@ -1,10 +1,26 @@ |
||||
import request from '@/router/axios'; |
||||
const prefix = '/api/blade-workflow/workOrder' |
||||
// 查询
|
||||
// 工单记录查询
|
||||
export const getList = (query) => { |
||||
return request({ |
||||
url: `${prefix}/historyWorkOrder`, |
||||
method: 'get', |
||||
params:query |
||||
}) |
||||
} |
||||
// 我的待办
|
||||
export const todoList = (query) => { |
||||
return request({ |
||||
url: `${prefix}/myToDo`, |
||||
method: 'get', |
||||
params:query |
||||
}) |
||||
} |
||||
// 头部查询
|
||||
export const conditionalData = (query) => { |
||||
return request({ |
||||
url: `${prefix}/conditionalData`, |
||||
method: 'get', |
||||
params:query |
||||
}) |
||||
} |
||||
@ -1,244 +1,281 @@ |
||||
<template> |
||||
<basic-container class="wf-container"> |
||||
<avue-crud :option="option" |
||||
:table-loading="loading" |
||||
:data="data" |
||||
:page.sync="page" |
||||
:search.sync="query" |
||||
:permission="permissionList" |
||||
v-model="form" |
||||
@search-change="searchChange" |
||||
@search-reset="searchReset" |
||||
@selection-change="selectionChange" |
||||
@current-change="currentChange" |
||||
@size-change="sizeChange" |
||||
@refresh-change="onLoad(page, query)" |
||||
@on-load="onLoad"> |
||||
<template slot="menu" |
||||
slot-scope="{row}"> |
||||
<el-button v-if="permission.wf_process_todo_detail" |
||||
type="text" |
||||
size="small" |
||||
icon="el-icon-info" |
||||
@click="dynamicRoute(row, 'detail')">详情</el-button> |
||||
<el-button v-if="permission.wf_process_todo_follow" |
||||
type="text" |
||||
size="small" |
||||
icon="el-icon-search" |
||||
@click="handleFlow(row)">流程图</el-button> |
||||
</template> |
||||
<template #searchMenu |
||||
v-if="permission.wf_process_todo_search"> |
||||
<el-badge :value="query.formSearch? query.formSearch.split(',').length: 0" |
||||
:hidden="!query.formSearch || query.formSearch.split(',').length == 0"> |
||||
<el-button icon="el-icon-search" |
||||
@click="$refs['wf-search'].visible = true">表单</el-button> |
||||
</el-badge> |
||||
</template> |
||||
</avue-crud> |
||||
<div class="cus-container"> |
||||
<el-form :model="searchForm"> |
||||
<div class="search"> |
||||
<div style="display: flex; align-item: center"> |
||||
<el-select |
||||
v-model="searchForm.taskParent" |
||||
placeholder="任务父类" |
||||
class="search-select" |
||||
clearable |
||||
> |
||||
<el-option |
||||
v-for="item in taskParent" |
||||
:key="item.dictValue" |
||||
:label="item.dictValue" |
||||
:value="item.dictValue" |
||||
> |
||||
</el-option> |
||||
</el-select> |
||||
<el-select |
||||
v-model="searchForm.taskType" |
||||
placeholder="任务种类" |
||||
class="search-select" |
||||
clearable |
||||
> |
||||
<el-option |
||||
v-for="item in taskInfos" |
||||
:key="item.taskTypeName" |
||||
:label="item.taskTypeName" |
||||
:value="item.taskTypeName" |
||||
> |
||||
</el-option> |
||||
</el-select> |
||||
<el-select |
||||
v-model="searchForm.currentResponsiblePerson" |
||||
placeholder="当前责任人" |
||||
class="search-select" |
||||
clearable |
||||
> |
||||
<el-option |
||||
v-for="item in users" |
||||
:key="item.realName" |
||||
:label="item.realName" |
||||
:value="item.realName" |
||||
> |
||||
</el-option> |
||||
</el-select> |
||||
<el-select |
||||
v-model="searchForm.dept" |
||||
placeholder="管理部门" |
||||
class="search-select" |
||||
clearable |
||||
> |
||||
<el-option |
||||
v-for="item in depts" |
||||
:key="item.deptName" |
||||
:label="item.deptName" |
||||
:value="item.deptName" |
||||
> |
||||
</el-option> |
||||
</el-select> |
||||
<el-select |
||||
v-model="searchForm.approvalStatus" |
||||
placeholder="审批状态" |
||||
class="search-select" |
||||
clearable |
||||
> |
||||
<el-option |
||||
v-for="item in statusList" |
||||
:key="item.value" |
||||
:label="item.label" |
||||
:value="item.value" |
||||
> |
||||
</el-option> |
||||
</el-select> |
||||
<el-select |
||||
v-model="searchForm.sponsor" |
||||
placeholder="发起人" |
||||
class="search-select" |
||||
clearable |
||||
> |
||||
<el-option |
||||
v-for="item in users" |
||||
:key="item.realName" |
||||
:label="item.realName" |
||||
:value="item.realName" |
||||
> |
||||
</el-option> |
||||
</el-select> |
||||
<el-date-picker |
||||
style="width: 314px; margin-right: 20px" |
||||
v-model="searchForm.timeArr" |
||||
format="yyyy-MM-dd HH:mm" |
||||
value-format="yyyy-MM-dd HH:mm:ss" |
||||
class="search-picker" |
||||
type="datetimerange" |
||||
range-separator="至" |
||||
start-placeholder="创建开始日期" |
||||
end-placeholder="创建结束日期" |
||||
></el-date-picker> |
||||
<el-button class="search-btn" @click="searchHandle(1)" |
||||
>查询</el-button |
||||
> |
||||
<div class="search-reset" @click="searchHandle(2)"> |
||||
<i class="el-icon-refresh-right" style="font-size: 20px"></i> |
||||
</div> |
||||
</div> |
||||
</div> |
||||
</el-form> |
||||
<div style="margin-top: 30px"> |
||||
<avue-crud |
||||
id="avue-id" |
||||
ref="crud" |
||||
:option="option" |
||||
:data="tableData" |
||||
:page.sync="page" |
||||
:table-loading="loading" |
||||
@current-change="currentChange" |
||||
@size-change="sizeChange" |
||||
> |
||||
<template slot="menu" slot-scope="{ row }"> |
||||
<el-button |
||||
v-if="permission.wf_process_todo_detail" |
||||
@click="dynamicRoute(row, 'detail')" |
||||
>详情</el-button |
||||
> |
||||
</template> |
||||
|
||||
<el-dialog :visible.sync="bpmnVisible" |
||||
append-to-body |
||||
destroy-on-close |
||||
title="流程图" |
||||
width="70%" |
||||
custom-class="wf-dialog"> |
||||
<wf-design ref="bpmn" |
||||
style="height: 60vh;" |
||||
:options="bpmnOption"></wf-design> |
||||
</el-dialog> |
||||
<wf-search ref="wf-search" |
||||
v-model="query.formSearch"></wf-search> |
||||
</basic-container> |
||||
<template slot-scope="scope" slot="approvalStatus"> |
||||
<span |
||||
:style="{ |
||||
color: |
||||
scope.row.approvalStatus == '审批中' |
||||
? '#FF9130' |
||||
: scope.row.approvalStatus == '进行中' |
||||
? '#4CA3FB' |
||||
: scope.row.approvalStatus == '已完成' |
||||
? '#2EE27C' |
||||
: '#ccc', |
||||
}" |
||||
>●{{ scope.row.approvalStatus }}</span |
||||
> |
||||
</template> |
||||
</avue-crud> |
||||
</div> |
||||
</div> |
||||
</template> |
||||
|
||||
<script> |
||||
import { todoList as getList, detail } from "@/api/plugin/workflow/process"; |
||||
import { |
||||
todoList as getList, |
||||
conditionalData, |
||||
} from "@/api/plugin/workflow/workorder.js"; |
||||
import { tableOption } from "@/const/workflow/todo.js"; |
||||
import { mapGetters } from "vuex"; |
||||
|
||||
import exForm from '../mixins/ex-form' |
||||
|
||||
import WfSearch from './components/search.vue' |
||||
|
||||
import exForm from "../mixins/ex-form"; |
||||
export default { |
||||
mixins: [exForm], |
||||
components: { WfSearch }, |
||||
data() { |
||||
return { |
||||
form: {}, |
||||
query: {}, |
||||
loading: true, |
||||
searchForm: {}, |
||||
conpanyList: [{ label: "运维公司", value: 1 }], |
||||
option: tableOption, |
||||
page: { |
||||
pageSize: 10, |
||||
currentPage: 1, |
||||
total: 0 |
||||
current: 1, |
||||
total: 0, |
||||
size: 10, |
||||
}, |
||||
selectionList: [], |
||||
option: { |
||||
size: 'mini', |
||||
height: 'auto', |
||||
calcHeight: 30, |
||||
tip: false, |
||||
border: true, |
||||
selection: true, |
||||
dialogType: 'drawer', |
||||
addBtn: false, |
||||
editBtn: false, |
||||
delBtn: false, |
||||
align: 'center', |
||||
searchMenuSpan: 6, |
||||
searchSize: 'mini', |
||||
searchIndex: 3, |
||||
searchIcon: true, |
||||
column: [ |
||||
{ |
||||
label: '流程名称', |
||||
prop: 'processDefinitionName', |
||||
search: true, |
||||
overHidden: true |
||||
}, |
||||
{ |
||||
label: '流程标识', |
||||
prop: 'processDefinitionKey', |
||||
search: true, |
||||
overHidden: true |
||||
}, |
||||
{ |
||||
label: '流水号', |
||||
prop: 'serialNumber', |
||||
bind: 'variables.serialNumber', |
||||
search: true, |
||||
overHidden: true |
||||
}, |
||||
{ |
||||
label: "流程分类", |
||||
row: true, |
||||
type: 'tree', |
||||
dicUrl: '/api/blade-workflow/design/category/tree', |
||||
props: { |
||||
label: 'name', |
||||
value: 'id' |
||||
}, |
||||
prop: "category", |
||||
search: true, |
||||
}, |
||||
{ |
||||
label: '当前节点', |
||||
prop: 'taskName', |
||||
}, |
||||
{ |
||||
label: '申请人', |
||||
prop: 'startUsername', |
||||
search: true |
||||
}, |
||||
{ |
||||
label: '申请时间', |
||||
prop: 'createTime', |
||||
type: 'datetime', |
||||
format: 'yyyy-MM-dd HH:mm', |
||||
width: 165, |
||||
}, |
||||
] |
||||
}, |
||||
data: [], |
||||
bpmnVisible: false, |
||||
bpmnOption: {} |
||||
// 表格数据 |
||||
tableData: [], |
||||
loading: false, |
||||
taskParent: [], |
||||
taskInfos: [], |
||||
depts: [], |
||||
users: [], |
||||
statusList: [ |
||||
{ |
||||
label: "审批中", |
||||
value: "审批中", |
||||
}, |
||||
{ |
||||
label: "进行中", |
||||
value: "进行中", |
||||
}, |
||||
{ |
||||
label: "已完成", |
||||
value: "已完成", |
||||
}, |
||||
], |
||||
}; |
||||
}, |
||||
created() { |
||||
this.dictBiz(); |
||||
this.onLoad(); |
||||
}, |
||||
computed: { |
||||
...mapGetters(["permission"]), |
||||
permissionList() { |
||||
return { |
||||
addBtn: this.vaildData(this.permission.deployment_add, false), |
||||
viewBtn: this.vaildData(this.permission.deployment_view, false), |
||||
delBtn: this.vaildData(this.permission.deployment_delete, false), |
||||
editBtn: this.vaildData(this.permission.deployment_edit, false) |
||||
}; |
||||
}, |
||||
ids() { |
||||
let ids = []; |
||||
this.selectionList.forEach(ele => { |
||||
ids.push(ele.id); |
||||
}); |
||||
return ids.join(","); |
||||
} |
||||
}, |
||||
methods: { |
||||
handleDetail(row) { |
||||
const param = { |
||||
taskId: row.taskId, |
||||
processInsId: row.processInstanceId |
||||
} |
||||
this.$router.push('/workflow/process/detail/' + Buffer.from(JSON.stringify(param)).toString('base64')) |
||||
}, |
||||
handleFlow(row) { |
||||
const { taskId, processInstanceId } = row |
||||
detail({ taskId, processInsId: processInstanceId }).then(res => { |
||||
const { process, flow } = res.data.data |
||||
|
||||
this.bpmnOption = { |
||||
mode: 'view', |
||||
xml: process.xml, |
||||
flows: this.handleResolveFlows(flow) |
||||
} |
||||
|
||||
this.bpmnVisible = true |
||||
}) |
||||
}, |
||||
searchReset() { |
||||
this.query = {}; |
||||
this.onLoad(this.page); |
||||
}, |
||||
searchChange(params, done) { |
||||
this.query = params; |
||||
this.page.currentPage = 1; |
||||
this.onLoad(this.page, params); |
||||
done(); |
||||
dictBiz() { |
||||
conditionalData().then((res) => { |
||||
const { taskParent, taskInfos, depts, users, taskLevel } = res.data.data; |
||||
this.taskParent = taskParent; |
||||
this.taskInfos = taskInfos; |
||||
this.depts = depts; |
||||
this.users = users; |
||||
this.taskLevel = taskLevel |
||||
}); |
||||
}, |
||||
selectionChange(list) { |
||||
this.selectionList = list; |
||||
// 列表 |
||||
onLoad() { |
||||
this.loading = true; |
||||
const { current, size } = this.page; |
||||
if ( |
||||
this.searchForm.timeArr !== null && |
||||
this.searchForm.timeArr !== undefined |
||||
) { |
||||
this.searchForm.startTime = this.searchForm.timeArr[0]; |
||||
this.searchForm.endTime = this.searchForm.timeArr[1]; |
||||
} |
||||
getList({ current, size,...this.searchForm }).then((res) => { |
||||
const { total, records } = res.data.data; |
||||
this.page.total = total; |
||||
this.tableData = records; |
||||
this.loading = false; |
||||
}); |
||||
}, |
||||
// 分页 |
||||
currentChange(currentPage) { |
||||
this.page.currentPage = currentPage; |
||||
this.page.current = currentPage; |
||||
this.onLoad(); |
||||
}, |
||||
sizeChange(pageSize) { |
||||
this.page.pageSize = pageSize; |
||||
this.page.size = pageSize; |
||||
this.onLoad(); |
||||
}, |
||||
onLoad(page, params = {}) { |
||||
this.loading = true; |
||||
getList(page.currentPage, page.pageSize, Object.assign(params, this.query)).then(res => { |
||||
const data = res.data.data; |
||||
this.page.total = data.total; |
||||
this.data = data.records; |
||||
this.loading = false; |
||||
}); |
||||
} |
||||
} |
||||
// 查询重置 |
||||
searchHandle(index) { |
||||
this.page.current = 1; |
||||
if (index === 2) { |
||||
this.searchForm = { |
||||
timeArr: null, |
||||
}; |
||||
} |
||||
this.onLoad(); |
||||
}, |
||||
}, |
||||
}; |
||||
</script> |
||||
|
||||
<style lang="scss"> |
||||
.wf-container { |
||||
.el-collapse-item__content { |
||||
padding-top: 8px; |
||||
} |
||||
.el-badge__content.is-fixed { |
||||
right: 16px; |
||||
} |
||||
} |
||||
.wf-dialog { |
||||
<style lang="scss" scoped> |
||||
.search-line { |
||||
margin-top: 20px; |
||||
display: flex; |
||||
flex-direction: column; |
||||
margin: 0 !important; |
||||
position: absolute; |
||||
top: 40%; |
||||
left: 50%; |
||||
transform: translate(-50%, -40%); |
||||
max-height: calc(100% - 30px); |
||||
max-width: calc(100% - 30px); |
||||
.el-dialog__body { |
||||
flex: 1; |
||||
overflow: auto; |
||||
} |
||||
justify-content: space-between; |
||||
} |
||||
.search-select { |
||||
width: 150px; |
||||
margin-right: 20px; |
||||
} |
||||
.search-input { |
||||
width: 288px; |
||||
} |
||||
.search-btn { |
||||
width: 130px; |
||||
height: 46px !important; |
||||
background: #2e92f6; |
||||
color: #fff; |
||||
margin: 0 20px; |
||||
} |
||||
.search-reset { |
||||
width: 46px; |
||||
height: 44px !important; |
||||
background: #ff9130; |
||||
color: #fff; |
||||
text-align: center; |
||||
line-height: 46px; |
||||
cursor: pointer; |
||||
} |
||||
/deep/ .el-input__inner { |
||||
height: 46px; |
||||
} |
||||
</style> |
||||
|
||||
Loading…
Reference in new issue