follow.vue 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161
  1. <template>
  2. <basic-container>
  3. <avue-crud :option="option"
  4. :data="data"
  5. ref="crud"
  6. v-model="form"
  7. :page="page"
  8. :permission="permissionList"
  9. @row-del="rowDel"
  10. @search-change="searchChange"
  11. @search-reset="searchReset"
  12. @selection-change="selectionChange"
  13. @on-load="onLoad">
  14. </avue-crud>
  15. <el-dialog title="流程删除"
  16. :visible.sync="followBox"
  17. width="20%">
  18. <el-form :model="form"
  19. ref="form"
  20. label-width="80px">
  21. <el-form-item label="删除理由">
  22. <el-input v-model="deleteReason"
  23. placeholder="请输入删除理由"></el-input>
  24. </el-form-item>
  25. </el-form>
  26. <span slot="footer"
  27. class="dialog-footer">
  28. <el-button @click="followBox = false">关 闭</el-button>
  29. <el-button type="primary"
  30. @click="handleDelete">确 定</el-button>
  31. </span>
  32. </el-dialog>
  33. </basic-container>
  34. </template>
  35. <script>
  36. import {mapGetters} from "vuex";
  37. import {followList, deleteProcessInstance} from "@/api/flow/flow";
  38. export default {
  39. data() {
  40. return {
  41. form: {},
  42. selectionId: '',
  43. processInstanceId: '',
  44. selectionList: [],
  45. page: {
  46. pageSize: 10,
  47. currentPage: 1,
  48. total: 0
  49. },
  50. followBox: false,
  51. deleteReason: '',
  52. option: {
  53. tip: false,
  54. border: true,
  55. index: true,
  56. selection: true,
  57. editBtn: false,
  58. addBtn: false,
  59. viewBtn: false,
  60. dialogWidth: 300,
  61. dialogHeight: 400,
  62. column: [
  63. {
  64. label: "执行id",
  65. prop: "executionId",
  66. search: true,
  67. },
  68. {
  69. label: "流程key",
  70. prop: "processDefinitionKey",
  71. search: true,
  72. },
  73. {
  74. label: "流程实例id",
  75. prop: "processInstanceId",
  76. search: true,
  77. },
  78. {
  79. label: "状态",
  80. prop: "suspensionState",
  81. },
  82. {
  83. label: "发起人",
  84. prop: "startUser",
  85. },
  86. {
  87. label: '开始时间',
  88. prop: 'startTime',
  89. },
  90. ]
  91. },
  92. data: []
  93. };
  94. },
  95. computed: {
  96. ...mapGetters(["permission"]),
  97. permissionList() {
  98. return {
  99. delBtn: this.vaildData(this.permission.flow_follow_delete, false),
  100. };
  101. },
  102. ids() {
  103. let ids = [];
  104. this.selectionList.forEach(ele => {
  105. ids.push(ele.id);
  106. });
  107. return ids.join(",");
  108. }
  109. },
  110. methods: {
  111. rowDel(row) {
  112. this.followBox = true;
  113. this.selectionId = row.id;
  114. this.processInstanceId = row.processInstanceId;
  115. },
  116. handleDelete() {
  117. this.$confirm("确定将选择数据删除?", {
  118. confirmButtonText: "确定",
  119. cancelButtonText: "取消",
  120. type: "warning"
  121. })
  122. .then(() => {
  123. return deleteProcessInstance({deleteReason: this.deleteReason, processInstanceId: this.processInstanceId});
  124. })
  125. .then(() => {
  126. this.onLoad(this.page);
  127. this.followBox = false;
  128. this.$message({
  129. type: "success",
  130. message: "操作成功!"
  131. });
  132. });
  133. },
  134. searchReset() {
  135. this.onLoad(this.page);
  136. },
  137. searchChange(params) {
  138. this.onLoad(this.page, params);
  139. },
  140. selectionChange(list) {
  141. this.selectionList = list;
  142. },
  143. onLoad(page, params = {}) {
  144. followList(page.currentPage, page.pageSize, params).then(res => {
  145. const data = res.data.data;
  146. this.page.total = data.total;
  147. this.data = data.records;
  148. });
  149. }
  150. }
  151. };
  152. </script>
  153. <style>
  154. .none-border {
  155. border: 0;
  156. background-color: transparent!important;
  157. }
  158. </style>