Skip to content

Commit

Permalink
Merge pull request #52 from lanyulei/dev
Browse files Browse the repository at this point in the history
feat: 添加工单筛选功能。
  • Loading branch information
lanyulei authored Nov 22, 2020
2 parents 26f63c4 + 3c477f9 commit 9603487
Show file tree
Hide file tree
Showing 7 changed files with 192 additions and 56 deletions.
4 changes: 2 additions & 2 deletions src/views/process/admin/process-manager.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
<div class="app-container">
<el-card class="box-card">
<el-form ref="listQuery" :model="listQuery" :inline="true">
<el-form-item label="模版名称">
<el-form-item label="流程名称">
<el-input
v-model="listQuery.name"
placeholder="请输入模版名称"
placeholder="请输入流程名称"
clearable
size="small"
style="width: 240px"
Expand Down
4 changes: 2 additions & 2 deletions src/views/process/admin/task-manager.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
<div class="app-container">
<el-card class="box-card">
<el-form ref="listQuery" :model="listQuery" :inline="true">
<el-form-item label="分类名称">
<el-form-item label="任务名称">
<el-input
v-model="listQuery.name"
placeholder="请输入分类名称"
placeholder="请输入任务名称"
clearable
size="small"
style="width: 240px"
Expand Down
25 changes: 12 additions & 13 deletions src/views/process/list/all.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,7 @@
<div class="app-container">
<el-card class="box-card">
<el-form ref="listQuery" :model="listQuery" :inline="true">
<el-form-item label="工单标题">
<el-input
v-model="listQuery.title"
placeholder="请输入工单标题"
clearable
size="small"
style="width: 240px"
@keyup.enter.native="getList"
/>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" size="small" @click="getList">搜索</el-button>
</el-form-item>
<WorkOrderSearch :genre="'all'" @handleSearch="handleSearch" />
</el-form>

<el-table v-loading="loading" border :data="ticketList" @selection-change="handleSelectionChange">
Expand Down Expand Up @@ -133,7 +121,12 @@
<script>
import { workOrderList, unityWorkOrder, inversionWorkOrder, deleteWorkOrder } from '@/api/process/work-order'
import { listUser } from '@/api/system/sysuser'
// 搜索
import WorkOrderSearch from './components/search/index'
export default {
components: { WorkOrderSearch },
data() {
return {
users: [],
Expand Down Expand Up @@ -180,6 +173,12 @@ export default {
this.loading = false
})
},
handleSearch(val) {
for (var k in val) {
this.listQuery[k] = val[k]
}
this.getList()
},
handleView(row) {
this.$router.push({ name: 'ProcessListHandle', query: { workOrderId: row.id, processId: row.process }})
},
Expand Down
135 changes: 135 additions & 0 deletions src/views/process/list/components/search/index.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,135 @@
<template>
<div>
<el-form-item label="工单标题">
<el-input
v-model="listQuery.title"
placeholder="请输入工单标题"
clearable
size="small"
style="width: 180px"
@keyup.enter.native="getList"
/>
</el-form-item>
<el-form-item v-if="genre !== 'upcoming'" label="当前处理人">
<el-select
v-model="listQuery.processor"
filterable
remote
size="small"
reserve-keyword
placeholder="请输入当前处理人"
:remote-method="remoteUserList"
:loading="loading"
style="width: 150px"
@change="getList"
>
<el-option
v-for="item in UserOptions"
:key="item.userId"
:label="item.nickName"
:value="item.userId"
/>
</el-select>
</el-form-item>
<el-form-item label="优先级">
<el-select v-model="listQuery.priority" placeholder="请选择优先级" size="small" clearable style="width: 130px" @change="getList">
<el-option label="一般" :value="1" />
<el-option label="紧急" :value="2" />
<el-option label="非常紧急" :value="3" />
</el-select>
</el-form-item>
<el-form-item v-if="genre !== 'upcoming'" label="是否结束">
<el-select v-model="listQuery.isEnd" placeholder="请选择状态" size="small" clearable style="width: 130px" @change="getList">
<el-option label="" :value="1" />
<el-option label="" :value="0" />
</el-select>
</el-form-item>
<el-form-item label="创建时间">
<el-date-picker
v-model="timeValue"
size="small"
type="datetimerange"
:picker-options="pickerOptions"
range-separator=""
start-placeholder="开始日期"
end-placeholder="结束日期"
align="right"
/>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" size="small" @click="getList">搜索</el-button>
</el-form-item>
</div>
</template>

<script>
import {
listUser
} from '@/api/system/sysuser'
import { parseTime } from '@/utils'
export default {
name: 'WorkOrderSearch',
// eslint-disable-next-line vue/require-prop-types
props: ['genre'],
data() {
return {
loading: false,
timeValue: '',
listQuery: {},
UserOptions: [],
pickerOptions: {
shortcuts: [{
text: '最近一周',
onClick(picker) {
const end = new Date()
const start = new Date()
start.setTime(start.getTime() - 3600 * 1000 * 24 * 7)
picker.$emit('pick', [start, end])
}
}, {
text: '最近一个月',
onClick(picker) {
const end = new Date()
const start = new Date()
start.setTime(start.getTime() - 3600 * 1000 * 24 * 30)
picker.$emit('pick', [start, end])
}
}, {
text: '最近三个月',
onClick(picker) {
const end = new Date()
const start = new Date()
start.setTime(start.getTime() - 3600 * 1000 * 24 * 90)
picker.$emit('pick', [start, end])
}
}]
}
}
},
methods: {
getList() {
if (this.timeValue === null || this.timeValue === undefined || this.timeValue === '') {
this.listQuery.startTime = ''
this.listQuery.endTime = ''
} else {
this.listQuery.startTime = parseTime(this.timeValue[0])
this.listQuery.endTime = parseTime(this.timeValue[1])
}
this.$emit('handleSearch', this.listQuery)
},
remoteUserList(query) {
listUser({
pageSize: 999999,
nickName: query
}).then(res => {
this.UserOptions = res.data.list
})
}
}
}
</script>

<style scoped>
</style>
26 changes: 13 additions & 13 deletions src/views/process/list/my-create.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,9 @@
<div class="app-container">
<el-card class="box-card">
<el-form ref="listQuery" :model="listQuery" :inline="true">
<el-form-item label="工单标题">
<el-input
v-model="listQuery.title"
placeholder="请输入工单标题"
clearable
size="small"
style="width: 240px"
@keyup.enter.native="getList"
/>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" size="small" @click="getList">搜索</el-button>
</el-form-item>
<el-form ref="listQuery" :model="listQuery" :inline="true">
<WorkOrderSearch :genre="'my-create'" @handleSearch="handleSearch" />
</el-form>
</el-form>

<el-table v-loading="loading" border :data="ticketList" @selection-change="handleSelectionChange">
Expand Down Expand Up @@ -91,7 +81,11 @@

<script>
import { workOrderList, urgeWorkOrder } from '@/api/process/work-order'
// 搜索
import WorkOrderSearch from './components/search/index'
export default {
components: { WorkOrderSearch },
data() {
return {
users: [],
Expand Down Expand Up @@ -137,6 +131,12 @@ export default {
this.loading = false
})
},
handleSearch(val) {
for (var k in val) {
this.listQuery[k] = val[k]
}
this.getList()
},
handleView(row) {
this.$router.push({ name: 'ProcessListHandle', query: { workOrderId: row.id, processId: row.process }})
},
Expand Down
27 changes: 14 additions & 13 deletions src/views/process/list/related.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,9 @@
<div class="app-container">
<el-card class="box-card">
<el-form ref="listQuery" :model="listQuery" :inline="true">
<el-form-item label="工单标题">
<el-input
v-model="listQuery.title"
placeholder="请输入工单标题"
clearable
size="small"
style="width: 240px"
@keyup.enter.native="getList"
/>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" size="small" @click="getList">搜索</el-button>
</el-form-item>
<el-form ref="listQuery" :model="listQuery" :inline="true">
<WorkOrderSearch :genre="'my-create'" @handleSearch="handleSearch" />
</el-form>
</el-form>

<el-table v-loading="loading" border :data="ticketList" @selection-change="handleSelectionChange">
Expand Down Expand Up @@ -109,7 +99,12 @@

<script>
import { workOrderList } from '@/api/process/work-order'
// 搜索
import WorkOrderSearch from './components/search/index'
export default {
components: { WorkOrderSearch },
data() {
return {
users: [],
Expand Down Expand Up @@ -156,6 +151,12 @@ export default {
this.loading = false
})
},
handleSearch(val) {
for (var k in val) {
this.listQuery[k] = val[k]
}
this.getList()
},
handleView(row) {
this.$router.push({ name: 'ProcessListHandle', query: { workOrderId: row.id, processId: row.process }})
},
Expand Down
27 changes: 14 additions & 13 deletions src/views/process/list/upcoming.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,9 @@
<div class="app-container">
<el-card class="box-card">
<el-form ref="listQuery" :model="listQuery" :inline="true">
<el-form-item label="工单标题">
<el-input
v-model="listQuery.title"
placeholder="请输入工单标题"
clearable
size="small"
style="width: 240px"
@keyup.enter.native="getList"
/>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" size="small" @click="getList">搜索</el-button>
</el-form-item>
<el-form ref="listQuery" :model="listQuery" :inline="true">
<WorkOrderSearch :genre="'upcoming'" @handleSearch="handleSearch" />
</el-form>
</el-form>

<el-table v-loading="loading" border :data="ticketList" @selection-change="handleSelectionChange">
Expand Down Expand Up @@ -118,7 +108,12 @@
<script>
import { workOrderList, inversionWorkOrder } from '@/api/process/work-order'
import { listUser } from '@/api/system/sysuser'
// 搜索
import WorkOrderSearch from './components/search/index'
export default {
components: { WorkOrderSearch },
data() {
return {
users: [],
Expand Down Expand Up @@ -165,6 +160,12 @@ export default {
this.loading = false
})
},
handleSearch(val) {
for (var k in val) {
this.listQuery[k] = val[k]
}
this.getList()
},
handleView(row) {
this.$router.push({ name: 'ProcessListHandle', query: { workOrderId: row.id, processId: row.process }})
},
Expand Down

0 comments on commit 9603487

Please sign in to comment.