approveList.js 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. import list from '@/mixins/list'
  2. import {dibootApi} from '@/utils/dibootApi'
  3. export default {
  4. mixins: [list],
  5. created() {
  6. this.activeIndex = -100
  7. this.getList(true)
  8. },
  9. methods: {
  10. handle2ProcessTask(id, instId, category, definitionId, allowDeal) {
  11. uni.navigateTo({
  12. url:`/pages/workflowTask/webviewPages/dealTask?id=${id}&definitionId=${definitionId}&instId=${instId}&category=${category}&allowDeal=${allowDeal}`
  13. })
  14. },
  15. // 撤销
  16. handle2Click(processInstanceId, taskOperate) {
  17. uni.showModal({
  18. title: '',
  19. content: `确认撤销?`,
  20. showCancel: true,
  21. confirmText: '确定',
  22. success: async (res) => {
  23. if (res.confirm) {
  24. const res = await dibootApi.put('/workflow/task/taskOperate', {
  25. processInstanceId,
  26. taskOperate,
  27. validTask: false
  28. })
  29. if (res.code === 0) {
  30. uni.showToast({
  31. title: '撤销成功',
  32. icon: 'none'
  33. })
  34. this.page.pageIndex = 1
  35. this.getList(true)
  36. }
  37. }
  38. }
  39. })
  40. },
  41. // 重新发起
  42. handle2RestartWorkflow(item){
  43. uni.navigateTo({
  44. url: `/pages/workflowTask/webviewPages/startFlow?id=${item.procDefId}&processInstanceId=${item.id}&defaultTitle=${item.name}&name=${item.processDefinitionName}&restart=true&type=myLaunch`
  45. })
  46. }
  47. },
  48. watch: {
  49. searchKeyWord: {
  50. handler: function (val) {
  51. this.list = []
  52. console.log('搜索关键字', this.type)
  53. if(this.type === 'myLaunch'){
  54. this.queryParam['procInstId'] = val||undefined
  55. }else{
  56. this.queryParam['name'] = val
  57. }
  58. this.handlePullDownRefresh()
  59. }
  60. }
  61. },
  62. props: {
  63. approveListHeight: {
  64. type: Number
  65. },
  66. searchKeyWord: {
  67. type: String
  68. },
  69. type: {
  70. type: String,
  71. required: true
  72. }
  73. }
  74. }