getMyJoinProcint.vue 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185
  1. <template>
  2. <div style = "margin: 0px 24px;">
  3. <el-form ref="form" label-width="80px" :inline="true" size = "mini">
  4. <!-- <el-form-item label="发起人">
  5. <el-select v-model="userId" placeholder="请选择">
  6. <el-option
  7. v-for="item in users"
  8. :key="item.id"
  9. :label="item.displayName"
  10. :value="item.id">
  11. </el-option>
  12. </el-select>
  13. </el-form-item> -->
  14. <el-form-item label="任务名称">
  15. <el-input v-model="excutionName" clearable placeholder="请输入"></el-input>
  16. </el-form-item>
  17. <el-form-item label="流程名称">
  18. <el-input v-model="processDefName" clearable placeholder="请输入"></el-input>
  19. </el-form-item>
  20. <el-form-item>
  21. <el-button type="cyan" icon="el-icon-search" size="mini" @click="getMyJoinProcint(1)">搜索</el-button>
  22. <el-button icon="el-icon-refresh" size="mini" @click="reset">重置</el-button>
  23. </el-form-item>
  24. </el-form>
  25. <el-table
  26. :data="tableData"
  27. stripe
  28. border
  29. style="width: 100%">
  30. <!-- <el-table-column
  31. prop="id"
  32. align = "center"
  33. :show-overflow-tooltip = true
  34. label="id">
  35. </el-table-column> -->
  36. <el-table-column
  37. prop="name"
  38. align = "center"
  39. show-overflow-tooltip
  40. label="任务名称">
  41. </el-table-column>
  42. <el-table-column
  43. prop="processDefinitionName"
  44. align = "center"
  45. show-overflow-tooltip
  46. label="流程名称">
  47. </el-table-column>
  48. <el-table-column
  49. prop="startTime"
  50. align = "center"
  51. show-overflow-tooltip
  52. label="创建日期">
  53. <template slot-scope="scope">
  54. <span>{{ parseTime(new Date(scope.row.startTime), '{y}-{m}-{d} {h}:{i}:{s}') }}</span>
  55. </template>
  56. </el-table-column>
  57. <el-table-column
  58. align = "center"
  59. label="操作"
  60. width="200">
  61. <template slot-scope="scope">
  62. <el-button @click="showHisTaskForm(scope.row)" type="text" size="small">流程进度</el-button>
  63. </template>
  64. </el-table-column>
  65. </el-table>
  66. <el-pagination
  67. v-show="total != 0"
  68. background
  69. layout="prev, pager, next"
  70. :total="total"
  71. :current-page="pageNum"
  72. :page-size = "pageSize"
  73. @current-change="getMyJoinProcint">
  74. </el-pagination>
  75. <el-dialog title="流程进度" :visible.sync="hisTaskForm">
  76. <div>
  77. <el-steps direction="vertical" :active="histaskList[histaskList.length-1] && histaskList[histaskList.length-1].activityType == 'endEvent' ? histaskList.length : histaskList.length-1" finish-status="success" space = "60px">
  78. <el-step :title="item.name" v-for="item in histaskList">
  79. <template slot="description">
  80. <span v-if="item.activityType == 'userTask'">办理人: {{item.displayName}}</span> 节点名称: {{item.activityName}} 任务接收时间 {{item.startTime}} 任务办结时间 {{item.endTime}}
  81. <div v-for="comment in item.commentList" class="text item">
  82. {{'审批意见: ' + comment.message }}
  83. </div>
  84. </template>
  85. </el-step>
  86. </el-steps>
  87. <el-image :src="processImgUrl">
  88. </el-image>
  89. </div>
  90. <div slot="footer" class="dialog-footer">
  91. <el-button @click="hisTaskForm = false">关 闭</el-button>
  92. </div>
  93. </el-dialog>
  94. </div>
  95. </template>
  96. <script>
  97. export default {
  98. data() {
  99. return {
  100. tableData: [],
  101. userId : '',
  102. users : [],
  103. reason : '',
  104. hisTaskForm : false,
  105. tempRow : null,
  106. histaskList : [],
  107. processImgUrl : '',
  108. pageNum : 1,
  109. pageSize : 10,
  110. total : 0,
  111. activeLength : 0,
  112. excutionName : '',
  113. processDefName : ''
  114. }
  115. },
  116. mounted() {
  117. // this.getUsers();
  118. this.getMyJoinProcint(1);
  119. },
  120. methods: {
  121. getUsers() {
  122. var self = this;
  123. this.Axios.post('/api/flow/getUserInf').then(response => {
  124. if (!!response.data) {
  125. this.users = response.data.userList;
  126. } else {
  127. self.users = [];
  128. }
  129. }).catch(err => {
  130. console.log(err)
  131. self.$message.error('请求失败!');
  132. })
  133. },
  134. getMyJoinProcint(e) {
  135. this.pageNum = e;
  136. this.Axios.post('/api/flow/getMyJoinProcint', 'userId='+this.userId +
  137. '&excutionName='+this.excutionName +
  138. '&processDefName='+this.processDefName +
  139. '&pageNum='+this.pageNum+
  140. '&pageSize='+this.pageSize).then(response => {
  141. if (!!response.data) {
  142. this.total = response.data.total;
  143. this.tableData = response.data.data;
  144. } else {
  145. this.tableData = [];
  146. this.total = 0;
  147. }
  148. }).catch(err => {
  149. console.log(err)
  150. this.$message.error('请求失败!');
  151. })
  152. },
  153. /** 流程进度查看 */
  154. showHisTaskForm(r) {
  155. this.hisTaskForm = true;
  156. this.processImgUrl = '/api/flow/genProcessDiagram?processId=' + r.id;
  157. this.Axios.post('/api/flow/getProcessHisTaskList', 'processId=' + r.id).then(response => {
  158. if (!!response.data.data) {
  159. this.histaskList = response.data.data;
  160. if (!!this.histaskList[this.histaskList.length-1].endTime) {
  161. this.activeLength = this.histaskList.length;
  162. } else {
  163. this.activeLength = this.histaskList.length - 1;
  164. }
  165. }
  166. }).catch(err => {
  167. console.log(err)
  168. this.$message.error('请求失败!');
  169. })
  170. },
  171. reset() {
  172. this.excutionName = '';
  173. this.processDefName = '';
  174. this.getMyJoinProcint(1);
  175. },
  176. }
  177. }
  178. </script>
  179. <style>
  180. </style>