done.vue 5.55 KB
Newer Older
sunhongwei's avatar
sunhongwei committed
1 2 3 4
<template>
  <div class="app-container">
    <!-- 搜索工作栏 -->
    <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
chenjiuping's avatar
chenjiuping committed
5

Marcus's avatar
Marcus committed
6
      <el-form-item :label="$t('流程编号')" prop="processInstanceId">
dragondean@qq.com's avatar
dragondean@qq.com committed
7
        <el-input v-model="queryParams.processInstanceId" :placeholder="$t('流程编号')" clearable
chenjiuping's avatar
chenjiuping committed
8 9
                  @keyup.enter.native="handleQuery"/>
      </el-form-item>
dragondean@qq.com's avatar
dragondean@qq.com committed
10 11
      <el-form-item :label="$t('流程名称')" prop="name">
        <el-input v-model="queryParams.name" :placeholder="$t('流程名称')" clearable @keyup.enter.native="handleQuery"/>
chenjiuping's avatar
chenjiuping committed
12 13 14 15
      </el-form-item>
      <el-form-item :label="$t('流程分类')" prop="category">
        <el-select v-model="queryParams.category" :placeholder="$t('请选择流程分类')" clearable>
          <el-option v-for="dict in this.getDictDatas(DICT_TYPE.BPM_MODEL_CATEGORY)"
dragondean@qq.com's avatar
dragondean@qq.com committed
16
                     :key="dict.value" :label="$l(dict, 'label')" :value="dict.value"/>
chenjiuping's avatar
chenjiuping committed
17 18
        </el-select>
      </el-form-item>
19
      <el-form-item :label="$t('提交时间')">
sunhongwei's avatar
sunhongwei committed
20
        <el-date-picker v-model="dateRangeCreateTime" style="width: 240px" value-format="yyyy-MM-dd"
chenjiuping's avatar
chenjiuping committed
21 22
                        type="daterange" range-separator="-" :start-placeholder="$t('开始日期')"
                        :end-placeholder="$t('结束日期')"/>
sunhongwei's avatar
sunhongwei committed
23
      </el-form-item>
dragondean@qq.com's avatar
dragondean@qq.com committed
24 25 26 27
      <<!-- el-form-item :label="$t('业务编号')" prop="businessNo">
        <el-input v-model="queryParams.businessNo" :placeholder="$t('请输入业务编号')" clearable
                  @keyup.enter.native="handleQuery"/>
      </el-form-item> -->
sunhongwei's avatar
sunhongwei committed
28
      <el-form-item>
chenjiuping's avatar
chenjiuping committed
29 30
        <el-button type="primary" icon="el-icon-search" @click="handleQuery">{{ $t('搜索') }}</el-button>
        <el-button icon="el-icon-refresh" @click="resetQuery">{{ $t('重置') }}</el-button>
sunhongwei's avatar
sunhongwei committed
31 32 33 34 35
      </el-form-item>
    </el-form>

    <!-- 列表 -->
    <el-table v-loading="loading" :data="list">
36
      <el-table-column :label="$t('流程编号')" align="center" prop="processInstance.id" width="320" fixed/>
dragondean@qq.com's avatar
dragondean@qq.com committed
37
      <el-table-column :label="$t('流程名称')" align="center" prop="processInstance.name" width="200"/>
chenjiuping's avatar
chenjiuping committed
38 39 40 41 42 43
      <el-table-column :label="$t('业务编号')" align="center" prop="businessNo"/>
      <el-table-column :label="$t('流程分类')" align="center" prop="category" width="200">
        <template slot-scope="scope">
          <dict-tag :type="DICT_TYPE.BPM_MODEL_CATEGORY" :value="scope.row.category"/>
        </template>
      </el-table-column>
dragondean@qq.com's avatar
dragondean@qq.com committed
44
      
chenjiuping's avatar
chenjiuping committed
45
      <el-table-column :label="$t('当前审批节点')" align="center" prop="name" width="200"/>
Marcus's avatar
Marcus committed
46
      <!-- <el-table-column :label="$t('状态')" align="center" prop="" width="200" >{{ $t('缺少字段') }}</el-table-column> -->
dragondean@qq.com's avatar
dragondean@qq.com committed
47
      <!-- <el-table-column :label="$t('流程发起人')" align="center" prop="processInstance.startUserNickname" width="120"/>-->
dragondean@qq.com's avatar
dragondean@qq.com committed
48
      <el-table-column :label="$t('结果')" align="center" prop="result">
sunhongwei's avatar
sunhongwei committed
49 50 51 52
        <template slot-scope="scope">
          <dict-tag :type="DICT_TYPE.BPM_PROCESS_INSTANCE_RESULT" :value="scope.row.result"/>
        </template>
      </el-table-column>
53
      <el-table-column :label="$t('提交时间')" align="center" prop="createTime" width="180">
sunhongwei's avatar
sunhongwei committed
54 55 56 57
        <template slot-scope="scope">
          <span>{{ parseTime(scope.row.createTime) }}</span>
        </template>
      </el-table-column>
58
      <el-table-column :label="$t('结束时间')" align="center" prop="endTime" width="180">
sunhongwei's avatar
sunhongwei committed
59 60 61 62
        <template slot-scope="scope">
          <span>{{ parseTime(scope.row.endTime) }}</span>
        </template>
      </el-table-column>
dragondean@qq.com's avatar
dragondean@qq.com committed
63
      <el-table-column :label="$t('操作')" align="center" fixed="right" class-name="small-padding fixed-width">
sunhongwei's avatar
sunhongwei committed
64 65
        <template slot-scope="scope">
          <el-button size="mini" type="text" icon="el-icon-edit" @click="handleAudit(scope.row)"
chenjiuping's avatar
chenjiuping committed
66 67
                     v-hasPermi="['bpm:task:query']">{{ $t('详情') }}
          </el-button>
sunhongwei's avatar
sunhongwei committed
68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83
        </template>
      </el-table-column>
    </el-table>
    <!-- 分页组件 -->
    <pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNo" :limit.sync="queryParams.pageSize"
                @pagination="getList"/>

  </div>
</template>

<script>
import {getDoneTaskPage} from '@/api/bpm/task'
import {getDate} from "@/utils/dateUtils";

export default {
  name: "Done",
chenjiuping's avatar
chenjiuping committed
84
  components: {},
sunhongwei's avatar
sunhongwei committed
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 126 127 128 129 130 131 132 133 134 135
  data() {
    return {
      // 遮罩层
      loading: true,
      // 显示搜索条件
      showSearch: true,
      // 总条数
      total: 0,
      // 已办任务列表
      list: [],
      // 查询参数
      dateRangeCreateTime: [],
      queryParams: {
        pageNo: 1,
        pageSize: 10,
        name: null,
      },
    };
  },
  created() {
    this.getList();
  },
  methods: {
    /** 查询列表 */
    getList() {
      this.loading = true;
      // 处理查询参数
      let params = {...this.queryParams};
      this.addBeginAndEndTime(params, this.dateRangeCreateTime, 'createTime');
      getDoneTaskPage(params).then(response => {
        this.list = response.data.list;
        this.total = response.data.total;
        this.loading = false;
      });
    },
    /** 搜索按钮操作 */
    handleQuery() {
      this.queryParams.pageNo = 1;
      this.getList();
    },
    /** 重置按钮操作 */
    resetQuery() {
      this.dateRangeCreateTime = [];
      this.resetForm("queryForm");
      this.handleQuery();
    },
    getDateStar(ms) {
      return getDate(ms);
    },
    /** 处理审批按钮 */
    handleAudit(row) {
chenjiuping's avatar
chenjiuping committed
136
      this.$router.push({path: "/bpm/process-instance/detail", query: {id: row.processInstance.id}});
sunhongwei's avatar
sunhongwei committed
137 138 139 140
    },
  }
};
</script>