parent
b18c5279e0
commit
cf1bd87e50
13 changed files with 485 additions and 303 deletions
@ -1,244 +1,281 @@ |
|||||||
<template> |
<template> |
||||||
<basic-container class="wf-container"> |
<div class="cus-container"> |
||||||
<avue-crud :option="option" |
<el-form :model="searchForm"> |
||||||
:table-loading="loading" |
<div class="search"> |
||||||
:data="data" |
<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" |
:page.sync="page" |
||||||
:search.sync="query" |
:table-loading="loading" |
||||||
:permission="permissionList" |
|
||||||
v-model="form" |
|
||||||
@search-change="searchChange" |
|
||||||
@search-reset="searchReset" |
|
||||||
@selection-change="selectionChange" |
|
||||||
@current-change="currentChange" |
@current-change="currentChange" |
||||||
@size-change="sizeChange" |
@size-change="sizeChange" |
||||||
@refresh-change="onLoad(page, query)" |
> |
||||||
@on-load="onLoad"> |
<template slot="menu" slot-scope="{ row }"> |
||||||
<template slot="menu" |
<el-button |
||||||
slot-scope="{row}"> |
v-if="permission.wf_process_todo_detail" |
||||||
<el-button v-if="permission.wf_process_todo_detail" |
@click="dynamicRoute(row, 'detail')" |
||||||
type="text" |
>详情</el-button |
||||||
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> |
||||||
<template #searchMenu |
|
||||||
v-if="permission.wf_process_todo_search"> |
<template slot-scope="scope" slot="approvalStatus"> |
||||||
<el-badge :value="query.formSearch? query.formSearch.split(',').length: 0" |
<span |
||||||
:hidden="!query.formSearch || query.formSearch.split(',').length == 0"> |
:style="{ |
||||||
<el-button icon="el-icon-search" |
color: |
||||||
@click="$refs['wf-search'].visible = true">表单</el-button> |
scope.row.approvalStatus == '审批中' |
||||||
</el-badge> |
? '#FF9130' |
||||||
|
: scope.row.approvalStatus == '进行中' |
||||||
|
? '#4CA3FB' |
||||||
|
: scope.row.approvalStatus == '已完成' |
||||||
|
? '#2EE27C' |
||||||
|
: '#ccc', |
||||||
|
}" |
||||||
|
>●{{ scope.row.approvalStatus }}</span |
||||||
|
> |
||||||
</template> |
</template> |
||||||
</avue-crud> |
</avue-crud> |
||||||
|
</div> |
||||||
<el-dialog :visible.sync="bpmnVisible" |
</div> |
||||||
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> |
</template> |
||||||
|
|
||||||
<script> |
<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 { mapGetters } from "vuex"; |
||||||
|
import exForm from "../mixins/ex-form"; |
||||||
import exForm from '../mixins/ex-form' |
|
||||||
|
|
||||||
import WfSearch from './components/search.vue' |
|
||||||
|
|
||||||
export default { |
export default { |
||||||
mixins: [exForm], |
mixins: [exForm], |
||||||
components: { WfSearch }, |
|
||||||
data() { |
data() { |
||||||
return { |
return { |
||||||
form: {}, |
searchForm: {}, |
||||||
query: {}, |
conpanyList: [{ label: "运维公司", value: 1 }], |
||||||
loading: true, |
option: tableOption, |
||||||
page: { |
page: { |
||||||
pageSize: 10, |
current: 1, |
||||||
currentPage: 1, |
total: 0, |
||||||
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 |
|
||||||
}, |
}, |
||||||
|
// 表格数据 |
||||||
|
tableData: [], |
||||||
|
loading: false, |
||||||
|
taskParent: [], |
||||||
|
taskInfos: [], |
||||||
|
depts: [], |
||||||
|
users: [], |
||||||
|
statusList: [ |
||||||
{ |
{ |
||||||
label: '流程标识', |
label: "审批中", |
||||||
prop: 'processDefinitionKey', |
value: "审批中", |
||||||
search: true, |
|
||||||
overHidden: true |
|
||||||
}, |
}, |
||||||
{ |
{ |
||||||
label: '流水号', |
label: "进行中", |
||||||
prop: 'serialNumber', |
value: "进行中", |
||||||
bind: 'variables.serialNumber', |
|
||||||
search: true, |
|
||||||
overHidden: true |
|
||||||
}, |
}, |
||||||
{ |
{ |
||||||
label: "流程分类", |
label: "已完成", |
||||||
row: true, |
value: "已完成", |
||||||
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: {} |
|
||||||
}; |
}; |
||||||
}, |
}, |
||||||
|
created() { |
||||||
|
this.dictBiz(); |
||||||
|
this.onLoad(); |
||||||
|
}, |
||||||
computed: { |
computed: { |
||||||
...mapGetters(["permission"]), |
...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: { |
methods: { |
||||||
handleDetail(row) { |
dictBiz() { |
||||||
const param = { |
conditionalData().then((res) => { |
||||||
taskId: row.taskId, |
const { taskParent, taskInfos, depts, users, taskLevel } = res.data.data; |
||||||
processInsId: row.processInstanceId |
this.taskParent = taskParent; |
||||||
} |
this.taskInfos = taskInfos; |
||||||
this.$router.push('/workflow/process/detail/' + Buffer.from(JSON.stringify(param)).toString('base64')) |
this.depts = depts; |
||||||
|
this.users = users; |
||||||
|
this.taskLevel = taskLevel |
||||||
|
}); |
||||||
}, |
}, |
||||||
handleFlow(row) { |
// 列表 |
||||||
const { taskId, processInstanceId } = row |
onLoad() { |
||||||
detail({ taskId, processInsId: processInstanceId }).then(res => { |
this.loading = true; |
||||||
const { process, flow } = res.data.data |
const { current, size } = this.page; |
||||||
|
if ( |
||||||
this.bpmnOption = { |
this.searchForm.timeArr !== null && |
||||||
mode: 'view', |
this.searchForm.timeArr !== undefined |
||||||
xml: process.xml, |
) { |
||||||
flows: this.handleResolveFlows(flow) |
this.searchForm.startTime = this.searchForm.timeArr[0]; |
||||||
|
this.searchForm.endTime = this.searchForm.timeArr[1]; |
||||||
} |
} |
||||||
|
getList({ current, size,...this.searchForm }).then((res) => { |
||||||
this.bpmnVisible = true |
const { total, records } = res.data.data; |
||||||
}) |
this.page.total = total; |
||||||
}, |
this.tableData = records; |
||||||
searchReset() { |
this.loading = false; |
||||||
this.query = {}; |
}); |
||||||
this.onLoad(this.page); |
|
||||||
}, |
|
||||||
searchChange(params, done) { |
|
||||||
this.query = params; |
|
||||||
this.page.currentPage = 1; |
|
||||||
this.onLoad(this.page, params); |
|
||||||
done(); |
|
||||||
}, |
|
||||||
selectionChange(list) { |
|
||||||
this.selectionList = list; |
|
||||||
}, |
}, |
||||||
|
// 分页 |
||||||
currentChange(currentPage) { |
currentChange(currentPage) { |
||||||
this.page.currentPage = currentPage; |
this.page.current = currentPage; |
||||||
|
this.onLoad(); |
||||||
}, |
}, |
||||||
sizeChange(pageSize) { |
sizeChange(pageSize) { |
||||||
this.page.pageSize = pageSize; |
this.page.size = pageSize; |
||||||
|
this.onLoad(); |
||||||
}, |
}, |
||||||
onLoad(page, params = {}) { |
// 查询重置 |
||||||
this.loading = true; |
searchHandle(index) { |
||||||
getList(page.currentPage, page.pageSize, Object.assign(params, this.query)).then(res => { |
this.page.current = 1; |
||||||
const data = res.data.data; |
if (index === 2) { |
||||||
this.page.total = data.total; |
this.searchForm = { |
||||||
this.data = data.records; |
timeArr: null, |
||||||
this.loading = false; |
}; |
||||||
}); |
|
||||||
} |
|
||||||
} |
} |
||||||
|
this.onLoad(); |
||||||
|
}, |
||||||
|
}, |
||||||
}; |
}; |
||||||
</script> |
</script> |
||||||
|
<style lang="scss" scoped> |
||||||
<style lang="scss"> |
.search-line { |
||||||
.wf-container { |
margin-top: 20px; |
||||||
.el-collapse-item__content { |
display: flex; |
||||||
padding-top: 8px; |
justify-content: space-between; |
||||||
} |
} |
||||||
.el-badge__content.is-fixed { |
.search-select { |
||||||
right: 16px; |
width: 150px; |
||||||
|
margin-right: 20px; |
||||||
} |
} |
||||||
|
.search-input { |
||||||
|
width: 288px; |
||||||
} |
} |
||||||
.wf-dialog { |
.search-btn { |
||||||
display: flex; |
width: 130px; |
||||||
flex-direction: column; |
height: 46px !important; |
||||||
margin: 0 !important; |
background: #2e92f6; |
||||||
position: absolute; |
color: #fff; |
||||||
top: 40%; |
margin: 0 20px; |
||||||
left: 50%; |
} |
||||||
transform: translate(-50%, -40%); |
.search-reset { |
||||||
max-height: calc(100% - 30px); |
width: 46px; |
||||||
max-width: calc(100% - 30px); |
height: 44px !important; |
||||||
.el-dialog__body { |
background: #ff9130; |
||||||
flex: 1; |
color: #fff; |
||||||
overflow: auto; |
text-align: center; |
||||||
|
line-height: 46px; |
||||||
|
cursor: pointer; |
||||||
} |
} |
||||||
|
/deep/ .el-input__inner { |
||||||
|
height: 46px; |
||||||
} |
} |
||||||
</style> |
</style> |
||||||
|
|||||||
Loading…
Reference in new issue