审查视图

src/views/technological/task.vue 18.7 KB
小范 authored
1 2 3
<template>
    <el-container>
        <el-main>
小范 authored
4
小范 authored
5
            <el-row>
小范 authored
6 7 8 9 10 11 12 13 14 15
                <el-tabs type="border-card" @tab-click="handleClick">
                    <el-tab-pane label="待办任务">
                        <!--检索条件-->
                        <el-row class="toolbar" style="background-color: white;margin-bottom: 10px">
                            <el-col :span="6">
                                <el-input v-model="queryinfo.name" placeholder="任务名称" style="width: 200px" clearable>
                                    <template slot="prepend">任务名称</template>
                                </el-input>
                            </el-col>
                            <el-col :span="6">
16
                                <el-input v-model="queryinfo.taskDefinitionKey" placeholder="关键字" style="width: 200px" clearable>
小范 authored
17 18 19
                                    <template slot="prepend">关键字</template>
                                </el-input>
                            </el-col>
20 21 22 23 24 25
                            <el-col :span="6">
                                <el-input v-model="queryinfo.assignee" placeholder="执行人或组名" style="width: 200px" clearable>
                                    <template slot="prepend">执行人</template>
                                </el-input>
                            </el-col>
                            <el-col :span="6">
小范 authored
26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125
                                <el-button type="primary" v-on:click="getList">查询</el-button>
                                <!--                    <el-button type="success" v-on:click="toAddDialog">新增</el-button>-->

                            </el-col>
                        </el-row>
                        <template>
                            <el-table
                                    v-loading="tableloading"
                                    :data="tableData"
                                    style="width: 100%"
                                    :default-sort = "{prop: 'date', order: 'descending'}"
                                    :header-cell-style="{background:'#6F8294',color:'#FFFFFF'}" size="mini"
                            >
                                <el-table-column
                                        prop="name"
                                        label="任务名称"
                                        width="160">
                                </el-table-column>
                                <el-table-column
                                        prop="taskDefinitionKey "
                                        label="关键字">
                                </el-table-column>
                                <el-table-column
                                        prop="owner"
                                        label="所有者">
                                </el-table-column>
                                <el-table-column
                                        prop="assignee "
                                        label="执行者"
                                        width="160"
                                        show-overflow-tooltip>
                                </el-table-column>
                                <el-table-column
                                        prop="createTime"
                                        label="开始时间"
                                        width="160">
                                </el-table-column>
                                <!--                        <el-table-column-->
                                <!--                                fixed="right"-->
                                <!--                                label="操作"-->
                                <!--                                width="280">-->
                                <!--                            <template slot-scope="scope">-->
                                <!--                                <el-button type="success" size="mini" @click="sendForm()">实例管理</el-button>-->
                                <!--                                <el-button type="warning" size="mini" @click="remove(scope.$index,scope.row)">删除</el-button>-->
                                <!--                                <el-button type="danger" size="mini" @click="removeDel(scope.$index,scope.row)">彻底删除</el-button>-->
                                <!--                            </template>-->
                                <!--                        </el-table-column>-->
                            </el-table>
                        </template>
                        <!--分页模块-->
                        <el-row style="float: right;margin-top: 20px">
                            <el-col>
                                <div class="block">
                                    <el-pagination
                                            @size-change="handleSizeChange"
                                            @current-change="handleCurrentChange"
                                            :current-page="queryinfo.pageNum"
                                            :page-sizes="[10, 20, 30, 40]"
                                            :page-size="queryinfo.pageSize"
                                            layout="total, sizes, prev, pager, next, jumper"
                                            :total="total">
                                    </el-pagination>
                                </div>
                            </el-col>
                        </el-row>
                    </el-tab-pane>
                    <el-tab-pane label="已办任务">
                        <!--检索条件-->
                        <el-row class="toolbar" style="background-color: white;margin-bottom: 10px">
                            <el-col :span="6">
                                <el-input v-model="queryinfo.name" placeholder="任务名称" style="width: 200px" clearable>
                                    <template slot="prepend">任务名称</template>
                                </el-input>
                            </el-col>
                            <el-col :span="6">
                                <el-input v-model="queryinfo.taskDefinitionKey " placeholder="关键字" style="width: 200px" clearable>
                                    <template slot="prepend">关键字</template>
                                </el-input>
                            </el-col>

                            <el-col :span="8">
                                <el-button type="primary" v-on:click="getAllList">查询</el-button>
                                <!--                    <el-button type="success" v-on:click="toAddDialog">新增</el-button>-->

                            </el-col>
                        </el-row>
                        <template>
                            <el-table
                                    v-loading="tableloading"
                                    :data="tableData"
                                    style="width: 100%"
                                    :default-sort = "{prop: 'date', order: 'descending'}"
                                    :header-cell-style="{background:'#6F8294',color:'#FFFFFF'}" size="mini"
                            >
                                <el-table-column
                                        prop="name"
                                        label="任务名称"
                                        width="160">
                                </el-table-column>
                                <el-table-column
126
                                        prop="taskDefinitionKey"
小范 authored
127 128 129 130 131 132 133
                                        label="关键字">
                                </el-table-column>
                                <el-table-column
                                        prop="owner"
                                        label="所有者">
                                </el-table-column>
                                <el-table-column
134 135
                                        prop="assignee"
                                        label="执行人"
小范 authored
136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206
                                        width="160"
                                        show-overflow-tooltip>
                                </el-table-column>
                                <el-table-column
                                        prop="createTime"
                                        label="开始时间"
                                        width="160">
                                </el-table-column>
                                <!--                        <el-table-column-->
                                <!--                                fixed="right"-->
                                <!--                                label="操作"-->
                                <!--                                width="280">-->
                                <!--                            <template slot-scope="scope">-->
                                <!--                                <el-button type="success" size="mini" @click="sendForm()">实例管理</el-button>-->
                                <!--                                <el-button type="warning" size="mini" @click="remove(scope.$index,scope.row)">删除</el-button>-->
                                <!--                                <el-button type="danger" size="mini" @click="removeDel(scope.$index,scope.row)">彻底删除</el-button>-->
                                <!--                            </template>-->
                                <!--                        </el-table-column>-->
                            </el-table>
                        </template>
                        <!--分页模块-->
                        <el-row style="float: right;margin-top: 20px">
                            <el-col>
                                <div class="block">
                                    <el-pagination
                                            @size-change="handleSizeChange"
                                            @current-change="handleCurrentChange"
                                            :current-page="queryinfo.pageNum"
                                            :page-sizes="[10, 20, 30, 40]"
                                            :page-size="queryinfo.pageSize"
                                            layout="total, sizes, prev, pager, next, jumper"
                                            :total="total">
                                    </el-pagination>
                                </div>
                            </el-col>
                        </el-row>
                    </el-tab-pane>
                    <el-tab-pane label="我发起的">
                        <!--检索条件-->
                        <el-row class="toolbar" style="background-color: white;margin-bottom: 10px">
                            <el-col :span="6">
                                <el-input v-model="queryinfo.name" placeholder="任务名称" style="width: 200px" clearable>
                                    <template slot="prepend">任务名称</template>
                                </el-input>
                            </el-col>
                            <el-col :span="6">
                                <el-input v-model="queryinfo.taskDefinitionKey " placeholder="关键字" style="width: 200px" clearable>
                                    <template slot="prepend">关键字</template>
                                </el-input>
                            </el-col>

                            <el-col :span="8">
                                <el-button type="primary"  v-on:click="getMyList">查询</el-button>
                                <!--                    <el-button type="success" v-on:click="toAddDialog">新增</el-button>-->

                            </el-col>
                        </el-row>
                        <template>
                            <el-table
                                    v-loading="tableloading"
                                    :data="tableData"
                                    style="width: 100%"
                                    :default-sort = "{prop: 'date', order: 'descending'}"
                                    :header-cell-style="{background:'#6F8294',color:'#FFFFFF'}" size="mini"
                            >
                                <el-table-column
                                        prop="name"
                                        label="任务名称"
                                        width="160">
                                </el-table-column>
                                <el-table-column
207
                                        prop="taskDefinitionKey"
小范 authored
208 209 210 211 212 213 214
                                        label="关键字">
                                </el-table-column>
                                <el-table-column
                                        prop="owner"
                                        label="所有者">
                                </el-table-column>
                                <el-table-column
215
                                        prop="assignee"
小范 authored
216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254
                                        label="执行者"
                                        width="160"
                                        show-overflow-tooltip>
                                </el-table-column>
                                <el-table-column
                                        prop="createTime"
                                        label="开始时间"
                                        width="160">
                                </el-table-column>
                                <!--                        <el-table-column-->
                                <!--                                fixed="right"-->
                                <!--                                label="操作"-->
                                <!--                                width="280">-->
                                <!--                            <template slot-scope="scope">-->
                                <!--                                <el-button type="success" size="mini" @click="sendForm()">实例管理</el-button>-->
                                <!--                                <el-button type="warning" size="mini" @click="remove(scope.$index,scope.row)">删除</el-button>-->
                                <!--                                <el-button type="danger" size="mini" @click="removeDel(scope.$index,scope.row)">彻底删除</el-button>-->
                                <!--                            </template>-->
                                <!--                        </el-table-column>-->
                            </el-table>
                        </template>
                        <!--分页模块-->
                        <el-row style="float: right;margin-top: 20px">
                            <el-col>
                                <div class="block">
                                    <el-pagination
                                            @size-change="handleSizeChange"
                                            @current-change="handleCurrentChange"
                                            :current-page="queryinfo.pageNum"
                                            :page-sizes="[10, 20, 30, 40]"
                                            :page-size="queryinfo.pageSize"
                                            layout="total, sizes, prev, pager, next, jumper"
                                            :total="total">
                                    </el-pagination>
                                </div>
                            </el-col>
                        </el-row>
                    </el-tab-pane>
                </el-tabs>
小范 authored
255
            </el-row>
小范 authored
256
小范 authored
257 258 259 260 261
        </el-main>
    </el-container>
</template>

<script>
小范 authored
262
    import {allTask,allTaskHistory} from "../../api/technological";
小范 authored
263 264 265 266 267 268 269 270

    export default {
        name: "task",
        data() {
            return{
                queryinfo:{
                    name:'',
                    taskDefinitionKey:'',
271
                    assignee:'',
小范 authored
272
                    pageNum:1,
273
                    pageSize:10
小范 authored
274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315
                },
                total:0,
                tableData: [],
                tableloading:false,
            }
        },
        mounted() {
            this.getList();
        },
        methods: {
            // 分页
            handleSizeChange(val) {
                this.queryinfo.pageSize= val
                this.getList()
            },
            handleCurrentChange(val) {
                this.queryinfo.pageNum  = val
                this.getList()
            },
            //查询
            getList() {
                const _this = this
                this.tableloading = true;
                allTask(this.queryinfo).then((response) => {
                    const res = response.data
                    if (res.code != '200') {
                        return _this.$message.error('获取消息收发记录,失败!')
                    }
                    // 获取列表数据
                    _this.tableData = res.data
                    // 获取列表的总记录数
                    _this.total = res.total
                    this.tableloading = false;
                    _this.$message.success('获取消息收发记录,成功!')
                }).catch(error => {

                    // 关闭加载
                    _this.$message.error(error.toString())
                    this.tableloading = false;

                })
            },
小范 authored
316 317 318 319 320 321 322 323 324
            handleClick(tab, event){
                if (tab.index == 0) {
                    this.getList();
                } else if (tab.index == 1) {
                    this.getAllList();
                } else {
                    this.getMyList();
                }
            },
325 326 327
            getMyList(){

            },
小范 authored
328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350
            //查询
            getAllList() {
                const _this = this
                this.tableloading = true;
                allTaskHistory(this.queryinfo).then((response) => {
                    const res = response.data
                    if (res.code != '200') {
                        return _this.$message.error('获取消息收发记录,失败!')
                    }
                    // 获取列表数据
                    _this.tableData = res.data
                    // 获取列表的总记录数
                    _this.total = res.total
                    this.tableloading = false;
                    _this.$message.success('获取消息收发记录,成功!')
                }).catch(error => {

                    // 关闭加载
                    _this.$message.error(error.toString())
                    this.tableloading = false;

                })
            },
小范 authored
351 352 353 354 355 356 357 358
        }

    }
</script>

<style scoped>

</style>