ActivitiDaibanList.vue 8.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274
  1. <template>
  2. <div>
  3. <a-card>
  4. <div class="table-page-search-wrapper">
  5. <a-form layout="inline" @keyup.enter.native="searchQuery">
  6. <a-row :gutter="24">
  7. <a-col :xl="6" :lg="7" :md="8" :sm="24">
  8. <a-form-model-item prop="key" label="流程KEY">
  9. <a-input v-model="queryParam.key" allowClear placeholder="请输入流程KEY" ></a-input>
  10. </a-form-model-item>
  11. </a-col>
  12. <a-col :xl="6" :lg="7" :md="8" :sm="24">
  13. <span style="float: left;overflow: hidden;" class="table-page-search-submitButtons">
  14. <a-button @click="searchQuery" type="primary" icon="search" style="margin-right: 8px">查询</a-button>
  15. </span>
  16. </a-col>
  17. </a-row>
  18. </a-form>
  19. </div>
  20. <a-table
  21. :columns="columns"
  22. :dataSource="dataSource"
  23. rowKey="id"
  24. :loading="loading"
  25. class="j-table-force-nowrap"
  26. :pagination="ipagination"
  27. @change="handleTableChange"
  28. >
  29. <span slot="action" slot-scope="text, record">
  30. <a @click="handleDetail1(record)">查看流程进度</a>
  31. <a-divider type="vertical"/>
  32. <a @click="handleBanli(record)">办理</a>
  33. </span>
  34. <a-divider type="vertical" />
  35. </a-table>
  36. <activiti-file-model ref="ativitiFileModel" ></activiti-file-model>
  37. <pic-form1 ref="picForm" @ok="modalFormOk" ></pic-form1>
  38. </a-card>
  39. </div>
  40. </template>
  41. <script>
  42. import {getAction, deleteAction, banli, postAction} from '@/api/manage'
  43. import { mixinDevice } from '@/utils/mixin'
  44. import { JeecgListMixin } from '@/mixins/JeecgListMixin'
  45. import ActivitiFileModel from './ActivitiFileModel'
  46. import { getModelList } from '@/api/activiti/activiti'
  47. import {filterObj} from "@/utils/util";
  48. import PicForm1 from "@views/activiti/PicForm1";
  49. export default {
  50. name: 'ActivitiDaibanList',
  51. mixins: [JeecgListMixin, mixinDevice],
  52. components: {
  53. PicForm1,
  54. ActivitiFileModel
  55. },
  56. data() {
  57. return {
  58. columns: [
  59. {
  60. title: '序号',
  61. dataIndex: '',
  62. key: 'rowIndex',
  63. width: 60,
  64. align: 'center',
  65. customRender: function (t, r, index) {
  66. return parseInt(index) + 1
  67. }
  68. }, {
  69. dataIndex: 'taskName',
  70. title: '任务名称',
  71. align: 'center'
  72. }, {
  73. dataIndex: 'processInstanceId',
  74. title: '流程实例编号',
  75. align: 'center'
  76. }, {
  77. dataIndex: 'executionId',
  78. title: '执行实例编号',
  79. align: 'center'
  80. }, {
  81. dataIndex: 'businessKey',
  82. title: '业务号',
  83. align: 'center'
  84. }, {
  85. title: '流程名称',
  86. dataIndex: 'processName',
  87. align: 'center',
  88. scopedSlots: { customRender: 'suspensionState' }
  89. },
  90. {
  91. title: '发起人',
  92. dataIndex: 'starter',
  93. align: 'center'
  94. },
  95. {
  96. title: '办理人',
  97. dataIndex: 'assignee',
  98. align: 'center'
  99. },
  100. {
  101. title: '任务创建时间',
  102. dataIndex: 'createTime',
  103. align: 'center'
  104. },
  105. {
  106. title: '流程启动时间',
  107. dataIndex: 'startTime',
  108. align: 'center'
  109. },
  110. {
  111. title: '操作',
  112. dataIndex: 'action',
  113. width: '150px',
  114. align: 'center',
  115. scopedSlots: { customRender: 'action' }
  116. }],
  117. url: {
  118. list: '/service/act/mylist',
  119. delete: '/act/reprocdef/deleteByDeploymentId',
  120. convertToModel: '/act/reprocdef/convertToModel',
  121. updateHandle: '/act/reprocdef/update',
  122. banli: '/service/completeTask',
  123. banlijson: '/service/getTaskInfo'
  124. },
  125. queryParam: {
  126. category: '',
  127. key: '',
  128. name: ''
  129. }
  130. }
  131. },
  132. created() {
  133. // this.getDataList()
  134. },
  135. methods: {
  136. handleDetail1:function(record){
  137. this.$refs.picForm.edit(record);
  138. this.$refs.picForm.title="流程";
  139. this.$refs.picForm.disableSubmit = true;
  140. },
  141. handleBanli:function (record){
  142. // banli(this.url.banli+"/"+record.taskId).then(res => {
  143. // console.log('转为模型', res)
  144. // if (res.code == 0) {
  145. // this.$message.success(res.msg);
  146. // } else {
  147. // this.$message.warning(res.msg);
  148. // }
  149. // })
  150. banli(this.url.banlijson+"/"+record.executionId+"/"+record.taskId).then(res => {
  151. console.log('转为模型', res)
  152. if (res.code == 0) {
  153. this.$message.success(res.msg);
  154. } else {
  155. this.$message.warning(res.msg);
  156. }
  157. })
  158. },
  159. // 删除
  160. actDelete(deploymentId) {
  161. deleteAction(this.url.delete, { deploymentId: deploymentId }).then(res => {
  162. if (res.success) {
  163. this.$message.success(res.message)
  164. this.searchQuery()
  165. } else {
  166. this.$message.warning(res.message)
  167. }
  168. })
  169. },
  170. // 转为模型
  171. convertToModel(id) {
  172. getAction(this.url.convertToModel, { id: id }).then(res => {
  173. console.log('转为模型', res)
  174. if (res.success) {
  175. this.$message.success('操作成功,流程编号:' + res.result.deploymentId)
  176. this.searchQuery()
  177. } else {
  178. this.$message.warning('操作失败,流程编号:' + res.result.deploymentId)
  179. }
  180. })
  181. },
  182. // 挂起和激活
  183. updateHandle(id, state) {
  184. getAction(this.url.updateHandle, { id: id, state: state }).then(res => {
  185. console.log('挂起和激活', res)
  186. if (res.success) {
  187. this.$message.success(res.message)
  188. this.searchQuery()
  189. } else {
  190. this.$message.warning(res.message)
  191. }
  192. })
  193. },
  194. searchQuery() {
  195. this.selectedRowKeys = [];
  196. this.selectionRows = [];
  197. this.loadData(1);
  198. },
  199. loadData(arg) {
  200. if(!this.url.list){
  201. this.$message.error("请设置url.list属性!")
  202. return
  203. }
  204. //加载数据 若传入参数1则加载第一页的内容
  205. if (arg === 1) {
  206. this.ipagination.current = 1;
  207. }
  208. var params = this.getQueryParams();//查询条件
  209. this.loading = true;
  210. getAction(this.url.list, params).then((res) => {
  211. if (res.success) {
  212. //update-begin---author:zhangyafei Date:20201118 for:适配不分页的数据列表------------
  213. this.dataSource = res.result.records||res.result;
  214. this.totalOrderPrice = res.message
  215. if(res.result.total)
  216. {
  217. this.ipagination.total = res.result.total;
  218. }else{
  219. this.ipagination.total = 0;
  220. }
  221. //update-end---author:zhangyafei Date:20201118 for:适配不分页的数据列表------------
  222. }else{
  223. this.$message.warning(res.message)
  224. }
  225. }).finally(() => {
  226. this.loading = false
  227. })
  228. },
  229. // 查询
  230. getDataList() {
  231. this.loading = true
  232. let params = this.queryParam
  233. getModelList(this.url.list, params).then(res => {
  234. console.log('查询数据', res)
  235. this.dataSource = res.result.records
  236. this.total = res.result.total
  237. this.ipagination.total = res.result.total
  238. this.loading = false
  239. })
  240. },
  241. openModeler() {
  242. this.$refs.ativitiFileModel.openModel()
  243. },
  244. deployProcess(id) {
  245. getAction(this.url.deploy, { id: id }).then(res => {
  246. if (res.success) {
  247. this.$message.success(res.message)
  248. this.searchQuery()
  249. } else {
  250. this.$message.error(res.message)
  251. }
  252. })
  253. }
  254. }
  255. }
  256. </script>
  257. <style lang="less" scoped>
  258. .table-operator .ant-btn {
  259. margin: 3px 8px 4px 0;
  260. }
  261. </style>