approveList.js 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112
  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. } else {
  37. uni.showToast({
  38. title: res.msg,
  39. icon: 'none'
  40. })
  41. this.page.pageIndex = 1
  42. this.getList(true)
  43. }
  44. }
  45. }
  46. })
  47. },
  48. // 重新发起
  49. handle2RestartWorkflow(item){
  50. uni.navigateTo({
  51. url: `/pages/workflowTask/webviewPages/startFlow?id=${item.procDefId}&processInstanceId=${item.id}&defaultTitle=${item.name}&name=${item.processDefinitionName}&restart=true&type=myLaunch`
  52. })
  53. }
  54. },
  55. watch: {
  56. searchKeyWord: {
  57. handler: function (val) {
  58. this.list = []
  59. console.log(val,'搜索关键字', this.type)
  60. if(this.type === 'myLaunch'){
  61. this.queryParam['processInstanceId'] = val||undefined
  62. }else{
  63. this.queryParam['queryName'] = val
  64. }
  65. this.handlePullDownRefresh()
  66. }
  67. },
  68. applyTime:{
  69. handler: function (val) {
  70. console.log('改变',val)
  71. this.queryParam['applyTime'] = val||undefined
  72. this.handlePullDownRefresh()
  73. }
  74. },
  75. processDefinitionName:{
  76. handler: function (val) {
  77. console.log('改变',val)
  78. this.queryParam['processDefinitionName'] = val||undefined
  79. this.handlePullDownRefresh()
  80. }
  81. },
  82. processStatus:{
  83. handler: function (val) {
  84. console.log('改变',val)
  85. this.queryParam['processStatus'] = val||undefined
  86. this.handlePullDownRefresh()
  87. }
  88. }
  89. },
  90. props: {
  91. approveListHeight: {
  92. type: Number
  93. },
  94. searchKeyWord: {
  95. type: String
  96. },
  97. type: {
  98. type: String,
  99. required: true
  100. },
  101. applyTime: {
  102. type: Array
  103. },
  104. processDefinitionName: {
  105. type: String
  106. },
  107. processStatus: {
  108. type: Number
  109. },
  110. }
  111. }