shikeying
2023-04-03 d8887d36d08e3a0a5068763c8460b0b4f16e87ee
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
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
126
127
128
129
130
131
132
133
134
135
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
<template>
  <div class="app-container">
 
 
    <el-table v-loading="loading" :data="tastList">
      <!--      <el-table-column label="流程ID" align="center" prop="id"/>-->
      <el-table-column label="流程名称" align="left" prop="title"/>
      <el-table-column label="任务名称" align="left" prop="taskName"/>
      <el-table-column label="任务标识" align="left" prop="taskDefineKey"/>
      <el-table-column label="执行人" align="left" prop="assignee"/>
      <el-table-column label="代理人" align="left" prop="owner"/>
      <el-table-column label="任务开始" align="left" prop="startTime"/>
      <el-table-column label="任务完成" align="left" prop="endTime"/>
      <el-table-column label="流程结束" align="left" prop="processEnd"/>
      <el-table-column label="业务编号" align="left" prop="businessKey"/>
      <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
        <template slot-scope="scope">
          <el-button
            size="mini"
            type="text"
            icon="el-icon-edit"
            @click="showApprove(scope.row)"
            v-hasPermi="['wf:task:**']"
          >查看
          </el-button>
        </template>
      </el-table-column>
    </el-table>
 
    <pagination
      v-show="total>0"
      :total="total"
      :page.sync="queryParams.pageNum"
      :limit.sync="queryParams.pageSize"
      @pagination="getList"
    />
 
    <!-- 展示审批历史 -->
    <el-dialog :title="title" :visible.sync="open" v-if="open" width="800px" append-to-body>
<!--      <leaveHistoryForm :businessKey="businessKey" v-if="'leave'==definitionKey"/>-->
<!--      <el-form :model="form" ref="form" label-width="100px" class="demo-dynamic">-->
<!--        <el-form-item-->
<!--          v-for="(domain, index) in form.formData"-->
<!--          :label="domain.controlLable"-->
<!--          :key="index"-->
<!--        >-->
<!--          <el-radio-group v-model="domain.controlValue" v-if="'radio'==domain.controlType">-->
<!--            <el-radio v-for="(defaults,indexd) in domain.controlDefault.split('&#45;&#45;__&#45;&#45;')"-->
<!--                      :label=indexd-->
<!--                      :key="indexd"-->
<!--                      >{{defaults}}-->
 
<!--            </el-radio>-->
 
<!--          </el-radio-group>-->
<!--          <el-input type="textarea" v-model="domain.controlValue" v-if="'textarea'==domain.controlType"-->
<!--          ></el-input>-->
<!--        </el-form-item>-->
<!--      </el-form>-->
      <div  v-for="(approve, index) in approveList"
            :key="index" >
        <h2>
          ----------------------------------
          {{approve.taskName}}
        </h2>
        <h3>任务开始:{{approve.startTime}},任务结束:{{approve.endTime}}</h3>
        <h3 v-if="approve.taskCount==1">办理人:{{approve.assignee}},意见:{{approve.approveSummary}}</h3>
        <h3 v-if="approve.taskCount==1">办理时间:{{approve.approveTime}}</h3>
        <el-form v-for="(approveItem, indexH) in approve.children" :key="indexH" label-width="80px" v-if="approve.taskCount>1">
          <h3>办理人:{{approveItem.assignee}},意见:{{approveItem.approveSummary}}</h3>
          <h3>办理时间:{{approveItem.approveTime}}</h3>
<!--          <el-form-item :label=approveItem.assignee v-if="approveItem.assignee !=''">-->
<!--            <el-input v-model="approveItem.approveTime"/>-->
<!--          </el-form-item>-->
        </el-form>
      </div>
 
      <div slot="footer" class="dialog-footer">
<!--        <el-button type="primary" @click="submitForm">确 定</el-button>-->
        <el-button @click="cancel">关 闭</el-button>
      </div>
    </el-dialog>
  </div>
</template>
 
<script>
 
  import {listDone, listApprove, formDataShow, formDataSave} from "@/api/activiti/task";
  // import leaveHistoryForm from "@/views/workflow/leave/leaveHistoryForm";
 
  export default {
    name: "DoneTask",
    // components: {leaveHistoryForm},
    data() {
      return {
        id:'',
        definitionKey: '',
        businessKey: '',
        // 遮罩层
        loading: true,
        // 选中数组
        ids: [],
        // 非单个禁用
        single: true,
        // 非多个禁用
        multiple: true,
        // 显示搜索条件
        showSearch: true,
        // 总条数
        total: 0,
        // 请假表格数据
        tastList: [],
 
        // 审批历史集合,2023-04-03
        approveList: [],
 
        // 弹出层标题
        title: "",
        // 是否显示弹出层
        open: false,
        // 查询参数
        queryParams: {
          pageNum: 1,
          pageSize: 10,
        },
        // 表单参数
        form: {
          formData:[]
        },
        // 表单校验
        rules: {}
      };
    },
    created() {
      this.getList();
    },
    methods: {
      /** 查询请假列表 */
      getList() {
        this.loading = true;
        listDone(this.queryParams).then(response => {
          this.tastList = response.data;
          this.total = response.total;
          this.loading = false;
        });
      },
 
      /** 查询审批历史集合 */
      getApproveList(processInstanceId){
        this.loading = true;
        listApprove(processInstanceId).then(response => {
          this.approveList = response.data;
          this.loading = false;
        });
      },
 
      // 取消按钮
      cancel() {
        this.open = false;
        this.reset();
      },
      // 表单重置
      reset() {
        this.definitionKey = '',
          this.businessKey = '',
          this.form = {
            formData:[],
          };
        this.resetForm("form");
      },
 
      /** 展示审批列表 */
      showApprove(row) {
        console.log("processInstanceId = " + row.processInstanceId)
        this.reset();
        this.definitionKey = row.definitionKey;
        this.businessKey = row.businessKey;
        this.id=row.id;
        this.getApproveList(row.processInstanceId);
        this.open = true;
        this.title = "审批历史";
      }
 
      // /** 提交按钮 */
      // submitForm() {
      //   formDataSave(this.id,this.form.formData).then(response => {
      //     this.$modal.msgSuccess("审批成功");
      //     this.open = false;
      //     this.getList();
      //   });
      // },
    }
  };
</script>