item.vue 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184
  1. <template>
  2. <view class="box-container">
  3. <view class="box-head">
  4. <view class="box-head-title">单号: {{renderItem(item,'id','--')}} </view>
  5. <view class="box-head-action">
  6. <tq-tab
  7. :classType="{
  8. 'blue': item.flowStatus == 1,
  9. 'green': item.flowStatus == 2,
  10. 'red': item.flowStatus == 3 || item.flowStatus == 4,
  11. }"
  12. >
  13. {{renderItem(item,'flowStatusName','--')}}
  14. </tq-tab>
  15. </view>
  16. </view>
  17. <view class="box-body" @click="handleDetaisl(item)">
  18. <u-row>
  19. <u-col :span="12">
  20. <view class="item">
  21. <view class="label">事件区域:</view>
  22. <view class="value">{{renderItem(item,'areaCodeName','--')}}</view>
  23. </view>
  24. <view class="item">
  25. <view class="label">事件标题:</view>
  26. <view class="value">{{renderItem(item,'eventTitle','--')}}</view>
  27. </view>
  28. <view class="item">
  29. <view class="label">事件类型:</view>
  30. <view class="value">{{renderItem(item,'problemType','--')}}</view>
  31. </view>
  32. <view class="item">
  33. <view class="label">事件等级:</view>
  34. <view class="value">{{renderItem(item,'eventLevel','--')}}</view>
  35. </view>
  36. <view class="item">
  37. <view class="label">解决期限:</view>
  38. <view class="value">{{renderItem(item,'settleDate','--')}}</view>
  39. </view>
  40. </u-col>
  41. </u-row>
  42. </view>
  43. <view class="box-footer" v-if="queryType==1">
  44. <u-row style="justify-content: flex-end;">
  45. <u-col :span="4" style="padding: 20rpx 30rpx;" v-if="item.flowStatus === 1">
  46. <u-button type="error"
  47. :custom-style="{
  48. width: '100%',
  49. height: '28px',
  50. }"
  51. plain
  52. shape="circle"
  53. @click="handleBack(item)">撤销上报
  54. </u-button>
  55. </u-col>
  56. <u-col :span="4" style="padding: 20rpx 30rpx;" v-if="item.flowStatus === 3">
  57. <u-button type="primary"
  58. :custom-style="{
  59. width: '100%',
  60. height: '28px',
  61. }"
  62. plain
  63. shape="circle"
  64. @click="handleReSubmit(item)">重新上报
  65. </u-button>
  66. </u-col>
  67. </u-row>
  68. </view>
  69. </view>
  70. </template>
  71. <script>
  72. import { renderItem } from '@/utils/gdtq'
  73. import {recordtaskOperate} from '@/api/system/event.js'
  74. export default {
  75. components: {
  76. },
  77. props: {
  78. item: {
  79. type: Object,
  80. default: () => {}
  81. },
  82. queryType: {
  83. type: Number,
  84. default: ''
  85. }
  86. },
  87. data() {
  88. return {}
  89. },
  90. methods: {
  91. handleBack(item) {
  92. uni.showModal({
  93. title: '提示',
  94. content: `确认撤销?`,
  95. showCancel:true,
  96. confirmText: '确定',
  97. success: async (res) => {
  98. if (res.confirm) {
  99. const {processInstanceId} = item
  100. let {code} = await recordtaskOperate({
  101. processInstanceId,
  102. taskOperate: 'cancel',
  103. validTask: false,
  104. })
  105. if(code == 0) {
  106. uni.showToast({
  107. title: '撤销成功',
  108. icon: 'none',
  109. })
  110. this.$emit('getList')
  111. }
  112. }
  113. }
  114. })
  115. },
  116. handleReSubmit(item) {
  117. uni.navigateTo({
  118. url: `/pages/flow/diboot?routes=/workflow/mobile/startFlow&id=${item.procDefId}&processInstanceId=${item.processInstanceId}&defaultTitle=${item.companyName}&name=${item.companyName}&restart=true`,
  119. })
  120. },
  121. handleDetaisl(item){
  122. uni.navigateTo({
  123. url: `/pages/flow/diboot?routes=/workflow/mobile/dealTask&Id=${item.procDefId}&processInstanceId=${item.processInstanceId}&defaultTitle=${item.companyName}&name=${item.companyName}&withDealTask=false&fromMobile=true`,
  124. })
  125. }
  126. },
  127. }
  128. </script>
  129. <style lang="scss" scoped>
  130. .box-container {
  131. background: #fff;
  132. margin: 20rpx 10rpx;
  133. border-radius: 20rpx;
  134. font-size: 24rpx;
  135. .box-head {
  136. border-bottom: 1px solid #ddd;
  137. padding: 20rpx;
  138. font-weight: 700;
  139. display: flex;
  140. justify-content: space-between;
  141. align-items: center;
  142. .box-head-title {
  143. flex: 1;
  144. }
  145. .box-head-action {
  146. flex-basis: 120rpx;
  147. }
  148. }
  149. .box-body {
  150. padding: 20rpx;
  151. .item {
  152. margin: 4rpx;
  153. display: flex;
  154. .label {
  155. }
  156. .value {
  157. flex: 1;
  158. }
  159. }
  160. }
  161. .box-footer {
  162. border-top: 1px solid #ddd;
  163. // padding: 20rpx;
  164. }
  165. }
  166. .primary {
  167. color: $uni-color-primary;
  168. }
  169. </style>