copy.vue 4.16 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">
jiuping520's avatar
jiuping520 committed
5 6 7 8 9 10 11 12 13
      <el-form-item label="任务编号" prop="processId">
        <el-input v-model="queryParams.instanceId" placeholder="请输入任务编号" clearable/>
      </el-form-item>
      <el-form-item label="流程分类" prop="processName">
        <el-select v-model="queryParams.categoryId" placeholder="请选择流程分类" clearable>
          <el-option v-for="dict in this.getDictDatas(DICT_TYPE.BPM_MODEL_CATEGORY)"
                     :key="dict.value" :label="dict.label" :value="dict.value"/>
        </el-select>
      </el-form-item>
dragondean@qq.com's avatar
dragondean@qq.com committed
14 15
      <el-form-item label="任务名称" prop="processName">
        <el-input v-model="queryParams.processName" placeholder="请输入任务名称" clearable/>
sunhongwei's avatar
sunhongwei committed
16
      </el-form-item>
dragondean@qq.com's avatar
dragondean@qq.com committed
17
      <el-form-item :label="$t('创建时间')">
sunhongwei's avatar
sunhongwei committed
18
        <el-date-picker v-model="dateRangeCreateTime" style="width: 240px" value-format="yyyy-MM-dd"
jiuping520's avatar
jiuping520 committed
19
                        type="daterange" range-separator="-" start-placeholder="开始日期" end-placeholder="结束日期"/>
sunhongwei's avatar
sunhongwei committed
20 21
      </el-form-item>
      <el-form-item>
dragondean@qq.com's avatar
dragondean@qq.com committed
22 23
        <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
24 25 26 27 28
      </el-form-item>
    </el-form>

    <!-- 列表 -->
    <el-table v-loading="loading" :data="list">
jiuping520's avatar
jiuping520 committed
29 30 31 32 33 34
      <el-table-column label="任务编号" align="center" prop="instanceId" width="320"/>
      <el-table-column label="流程分类" align="center" prop="categoryId">
        <template slot-scope="scope">
          <dict-tag :type="DICT_TYPE.BPM_MODEL_CATEGORY" :value="scope.row.categoryId" />
        </template>
      </el-table-column>
dragondean@qq.com's avatar
dragondean@qq.com committed
35
      <el-table-column label="任务名称" align="center" prop="processName"/>
jiuping520's avatar
jiuping520 committed
36
      <el-table-column label="流程发起人" align="center" prop="originatorName"/>
sunhongwei's avatar
sunhongwei committed
37 38 39 40 41
      <el-table-column label="创建时间" align="center" prop="createTime" width="180">
        <template slot-scope="scope">
          <span>{{ parseTime(scope.row.createTime) }}</span>
        </template>
      </el-table-column>
42
      <el-table-column :label="$t('操作')" align="center" fixed="right" class-name="small-padding fixed-width">
sunhongwei's avatar
sunhongwei committed
43 44
        <template slot-scope="scope">
          <el-button size="mini" type="text" icon="el-icon-edit" @click="handleAudit(scope.row)"
jiuping520's avatar
jiuping520 committed
45 46
                     v-hasPermi="['bpm:task:query']">详情
          </el-button>
sunhongwei's avatar
sunhongwei committed
47 48 49 50 51 52 53 54 55 56 57 58 59 60 61
        </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 {getCopyTaskPage} from '@/api/bpm/task'

export default {
  name: "Copy",
jiuping520's avatar
jiuping520 committed
62
  components: {},
sunhongwei's avatar
sunhongwei committed
63 64 65 66 67 68 69 70 71 72 73 74 75 76 77
  data() {
    return {
      // 遮罩层
      loading: true,
      // 显示搜索条件
      showSearch: true,
      // 总条数
      total: 0,
      // 待办任务列表
      list: [],
      // 查询参数
      dateRangeCreateTime: [],
      queryParams: {
        pageNo: 1,
        pageSize: 10,
jiuping520's avatar
jiuping520 committed
78 79 80 81
        instanceId: null,
        categoryId: null,
        processName: null

sunhongwei's avatar
sunhongwei committed
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
      },
    };
  },
  created() {
    this.getList();
  },
  methods: {
    /** 查询列表 */
    getList() {
      this.loading = true;
      // 处理查询参数
      let params = {...this.queryParams};
      this.addBeginAndEndTime(params, this.dateRangeCreateTime, 'createTime');
      getCopyTaskPage(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();
    },
    handleAudit(row) {
jiuping520's avatar
jiuping520 committed
113
      this.$router.push({path: "/bpm/process-instance/detail", query: {id: row.instanceId}});
sunhongwei's avatar
sunhongwei committed
114 115 116 117
    },
  }
};
</script>