parent
9e5313a660
commit
73c9d59125
9 changed files with 446 additions and 49 deletions
@ -0,0 +1,108 @@ |
|||||||
|
export const tableOption = { |
||||||
|
index: true, |
||||||
|
indexLabel: "序号", |
||||||
|
indexWidth:120, |
||||||
|
selection: false, |
||||||
|
border: false, |
||||||
|
gutter: 60, //设置input的大小
|
||||||
|
headerAlign: "left", |
||||||
|
align: "left", |
||||||
|
menuAlign:'left', |
||||||
|
menuHeaderAlign:'left', |
||||||
|
menuBtn: true, |
||||||
|
editBtn: false, |
||||||
|
delBtn: false, |
||||||
|
addBtn: false, |
||||||
|
tip: false, |
||||||
|
searchMenuSpan: 3, //控制搜索按钮
|
||||||
|
columnBtn: false, |
||||||
|
refreshBtn: false, |
||||||
|
// dialogCustomClass: "custom",
|
||||||
|
header: false, |
||||||
|
menuWidth:200, |
||||||
|
column: [ |
||||||
|
{ |
||||||
|
type: "input", |
||||||
|
label: "任务父类", |
||||||
|
prop: "taskParent", |
||||||
|
align: "left", |
||||||
|
overHidden: true, |
||||||
|
}, |
||||||
|
{ |
||||||
|
type: "input", |
||||||
|
label: "任务种类", |
||||||
|
prop: "taskType", |
||||||
|
align: "left", |
||||||
|
overHidden: true, |
||||||
|
}, |
||||||
|
{ |
||||||
|
type: "input", |
||||||
|
label: "操作模块", |
||||||
|
prop: "operationModule", |
||||||
|
align: "left", |
||||||
|
overHidden: true, |
||||||
|
}, |
||||||
|
// 改
|
||||||
|
{ |
||||||
|
type: "input", |
||||||
|
label: "操作对象", |
||||||
|
prop: "operationModule", |
||||||
|
align: "left", |
||||||
|
overHidden: true, |
||||||
|
}, |
||||||
|
{ |
||||||
|
type: "input", |
||||||
|
label: "当前责任人", |
||||||
|
prop: "currentResponsiblePerson", |
||||||
|
align: "left", |
||||||
|
overHidden: true, |
||||||
|
}, |
||||||
|
{ |
||||||
|
type: "input", |
||||||
|
label: "管理部门", |
||||||
|
prop: "dept", |
||||||
|
align: "left", |
||||||
|
overHidden: true, |
||||||
|
}, |
||||||
|
{ |
||||||
|
type: "input", |
||||||
|
label: "运维公司", |
||||||
|
prop: "currentResponsiblePerson", |
||||||
|
align: "left", |
||||||
|
overHidden: true, |
||||||
|
}, |
||||||
|
{ |
||||||
|
type: "input", |
||||||
|
label: "发起人", |
||||||
|
prop: "sponsor", |
||||||
|
align: "left", |
||||||
|
overHidden: true, |
||||||
|
}, |
||||||
|
|
||||||
|
{ |
||||||
|
label: "创建时间", |
||||||
|
type: "datetime", |
||||||
|
overHidden: true, |
||||||
|
prop: "createTime", |
||||||
|
format: "yyyy-MM-dd HH:mm", |
||||||
|
valueFormat: "yyyy-MM-dd HH:mm:ss", |
||||||
|
}, |
||||||
|
// 改
|
||||||
|
{ |
||||||
|
type: "input", |
||||||
|
label: "重复模式", |
||||||
|
prop: "approvalStatus", |
||||||
|
align: "left", |
||||||
|
overHidden: true, |
||||||
|
}, |
||||||
|
// 改
|
||||||
|
{ |
||||||
|
label: "终止日期", |
||||||
|
type: "datetime", |
||||||
|
overHidden: true, |
||||||
|
prop: "expectedCompletionTime", |
||||||
|
format: "yyyy-MM-dd HH:mm", |
||||||
|
valueFormat: "yyyy-MM-dd HH:mm:ss", |
||||||
|
}, |
||||||
|
], |
||||||
|
} |
||||||
@ -0,0 +1,288 @@ |
|||||||
|
<template> |
||||||
|
<div class="cus-container"> |
||||||
|
<el-form :model="searchForm"> |
||||||
|
<div class="search"> |
||||||
|
<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.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-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-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> |
||||||
|
</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 |
||||||
|
@click="dynamicRoute(row, 'detail')" |
||||||
|
>详情</el-button |
||||||
|
> |
||||||
|
<el-button |
||||||
|
type="danger" |
||||||
|
@click="stopHandle(row)" |
||||||
|
>终止</el-button |
||||||
|
> |
||||||
|
</template> |
||||||
|
|
||||||
|
</avue-crud> |
||||||
|
</div> |
||||||
|
</div> |
||||||
|
</template> |
||||||
|
<script> |
||||||
|
import { |
||||||
|
todoList as getList, |
||||||
|
conditionalData, |
||||||
|
} from "@/api/plugin/workflow/workorder.js"; |
||||||
|
import { tableOption } from "@/const/workflow/crontab.js"; |
||||||
|
import { mapGetters } from "vuex"; |
||||||
|
import exForm from "../mixins/ex-form"; |
||||||
|
export default { |
||||||
|
mixins: [exForm], |
||||||
|
data() { |
||||||
|
return { |
||||||
|
searchForm: {}, |
||||||
|
option: tableOption, |
||||||
|
page: { |
||||||
|
currentPage: 1, |
||||||
|
total: 0, |
||||||
|
pageSize: 10, |
||||||
|
}, |
||||||
|
// 表格数据 |
||||||
|
tableData: [], |
||||||
|
loading: false, |
||||||
|
taskParent: [], |
||||||
|
taskInfos: [], |
||||||
|
depts: [], |
||||||
|
users: [], |
||||||
|
statusList: [ |
||||||
|
{ |
||||||
|
label: "审批中", |
||||||
|
value: "审批中", |
||||||
|
}, |
||||||
|
{ |
||||||
|
label: "进行中", |
||||||
|
value: "进行中", |
||||||
|
}, |
||||||
|
{ |
||||||
|
label: "已完成", |
||||||
|
value: "已完成", |
||||||
|
}, |
||||||
|
], |
||||||
|
}; |
||||||
|
}, |
||||||
|
created() { |
||||||
|
this.dictBiz(); |
||||||
|
this.onLoad(); |
||||||
|
}, |
||||||
|
computed: { |
||||||
|
...mapGetters(["permission"]), |
||||||
|
}, |
||||||
|
methods: { |
||||||
|
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 |
||||||
|
}); |
||||||
|
}, |
||||||
|
// 列表 |
||||||
|
onLoad() { |
||||||
|
this.loading = true; |
||||||
|
const { currentPage, pageSize } = 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:currentPage, size:pageSize,...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.onLoad(); |
||||||
|
}, |
||||||
|
sizeChange(pageSize) { |
||||||
|
this.page.pageSize = pageSize; |
||||||
|
this.onLoad(); |
||||||
|
}, |
||||||
|
// 查询重置 |
||||||
|
searchHandle(index) { |
||||||
|
this.page.currentPage = 1; |
||||||
|
if (index === 2) { |
||||||
|
this.searchForm = { |
||||||
|
timeArr: null, |
||||||
|
}; |
||||||
|
} |
||||||
|
this.onLoad(); |
||||||
|
}, |
||||||
|
// 终止 |
||||||
|
stopHandle(row) { |
||||||
|
this.$confirm("此操作会终止该条重复任务,且无法恢复,确定停止吗?", "提示", { |
||||||
|
confirmButtonText: "确定", |
||||||
|
cancelButtonText: "取消", |
||||||
|
type: "warning", |
||||||
|
}) |
||||||
|
.then(() => { |
||||||
|
// remove(row.id).then((res) => { |
||||||
|
// // 测试用的假方法 |
||||||
|
// console.log(res); |
||||||
|
// this.$message.success("删除成功!"); |
||||||
|
// this.onLoad(this.page[0]); |
||||||
|
// }); |
||||||
|
}) |
||||||
|
.catch(() => { |
||||||
|
// this.$message({ type: "info", message: "已取消删除" }); |
||||||
|
}); |
||||||
|
} |
||||||
|
}, |
||||||
|
}; |
||||||
|
</script> |
||||||
|
<style lang="scss" scoped> |
||||||
|
.search-line { |
||||||
|
margin-top: 20px; |
||||||
|
display: flex; |
||||||
|
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 { |
||||||
|
display: inline-block; |
||||||
|
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