综合办公系统
Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.

index.vue 7.0KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245
  1. <!--
  2. * @Author: ysh
  3. * @Date: 2025-01-21 10:01:39
  4. * @LastEditors: Please set LastEditors
  5. * @LastEditTime: 2025-05-23 16:08:41
  6. -->
  7. <template>
  8. <view class="u-page container">
  9. <scroll-view class="scroll-list" scroll-y="true">
  10. <view class="uni-list">
  11. <view class="uni-list-cell">
  12. <view class="uni-media-list" @click="$tab.navigateTo('/pages/message/apply/apply')">
  13. <view style="margin-right: 20rpx;">
  14. <u-image :fade="false" src="@/static/images/message/apply.png" width="40px" height="40px"></u-image>
  15. </view>
  16. <view class="uni-media-list-body">
  17. <view class="uni-media-list-text-top"><span>待办任务</span>
  18. </view>
  19. <view class="uni-media-list-text-bottom">
  20. <uni-text><span>您有新流程待办</span></uni-text>
  21. </view>
  22. </view>
  23. <view class="info">
  24. <span style="font-size: 26rpx;color: #999999;">{{ acceptTime }}</span>
  25. <u-badge class="info-badge" type="error" count="2" :max="99" :value="detail"></u-badge>
  26. </view>
  27. </view>
  28. </view>
  29. <view class="uni-list-cell">
  30. <view class="uni-media-list" @click="openSendFlow">
  31. <view style="margin-right: 20rpx;">
  32. <u-image :fade="false" src="@/static/images/message/sendFlow.png" width="40px" height="40px"></u-image>
  33. </view>
  34. <view class="uni-media-list-body">
  35. <view class="uni-media-list-text-top"><span>发起流程</span>
  36. </view>
  37. <view class="uni-media-list-text-bottom">
  38. <uni-text><span>发起新流程</span></uni-text>
  39. </view>
  40. </view>
  41. </view>
  42. </view>
  43. <view class="uni-list-cell">
  44. <view class="uni-media-list" @click="$tab.navigateTo('/pages/message/completed/index')">
  45. <view style="margin-right: 20rpx;">
  46. <u-image :fade="false" src="@/static/images/message/completed.png" width="40px" height="40px"></u-image>
  47. </view>
  48. <view class="uni-media-list-body">
  49. <view class="uni-media-list-text-top"><span>已办任务</span>
  50. </view>
  51. <view class="uni-media-list-text-bottom">
  52. <uni-text><span>您的已办任务,在此进行撤回或查看已办任务等操作</span></uni-text>
  53. </view>
  54. </view>
  55. </view>
  56. </view>
  57. <view class="uni-list-cell">
  58. <view class="uni-media-list" @click="$tab.navigateTo('/pages/message/myProcess/index')">
  59. <view style="margin-right: 20rpx;">
  60. <u-image :fade="false" src="@/static/images/message/flowable.png" width="40px" height="40px"></u-image>
  61. </view>
  62. <view class="uni-media-list-body">
  63. <view class="uni-media-list-text-top"><span>我的流程</span>
  64. </view>
  65. <view class="uni-media-list-text-bottom">
  66. <uni-text><span>您发起的流程,在此可取消流程</span></uni-text>
  67. </view>
  68. </view>
  69. </view>
  70. </view>
  71. </view>
  72. </scroll-view>
  73. <uv-popup ref="popup" mode="bottom">
  74. <view class="bottom-popup">
  75. <view v-for="item, index in sendFlowList" :key="index">
  76. <u-button @click="sendFlow(item)">{{ item.name }}</u-button>
  77. </view>
  78. </view>
  79. </uv-popup>
  80. </view>
  81. </template>
  82. <script>
  83. import { Snowflake } from '@/utils/snowFlake.js';
  84. import { getNextFlowNodeByStart, todoList } from "@/api/flowable/todo";
  85. import { listDefinition, definitionStart, flowXmlAndNode } from "@/api/flowable/definition";
  86. export default {
  87. data() {
  88. return {
  89. todoList: [],
  90. detail: 0,
  91. acceptTime: '',
  92. flowList: ['借款审批', '用车审批', '设备审批', '工作填报'],
  93. sendFlowList: [],
  94. queryProcessParams: {
  95. pageNum: 1,
  96. pageSize: 9999,
  97. name: null,
  98. category: null,
  99. key: null,
  100. tenantId: null,
  101. deployTime: null,
  102. derivedFrom: null,
  103. derivedFromRoot: null,
  104. parentDeploymentId: null,
  105. engineVersion: null
  106. },
  107. };
  108. },
  109. created() {
  110. this.getTodoList();
  111. this.getDefinitionList();
  112. },
  113. onLoad: function (options) {
  114. uni.startPullDownRefresh();
  115. },
  116. onPullDownRefresh() {
  117. this.getTodoList();
  118. },
  119. methods: {
  120. getTodoList() {
  121. todoList({
  122. pageNum: 1,
  123. pageSize: 999,
  124. name: null
  125. }).then(response => {
  126. this.detail = response.data.total;
  127. this.todoList = response.data.records;
  128. if (response.data.records.length != 0) {
  129. this.acceptTime = response.data.records[0].createTime;
  130. }
  131. uni.stopPullDownRefresh();
  132. });
  133. },
  134. getDefinitionList() {
  135. listDefinition(this.queryProcessParams).then(response => {
  136. this.definitionList = response.data.records;
  137. this.processTotal = response.data.total;
  138. this.processLoading = false;
  139. let list = []
  140. for (let i of this.definitionList) {
  141. if (this.flowList.includes(i.name)) {
  142. list.push(i)
  143. }
  144. }
  145. this.sendFlowList = list;
  146. });
  147. },
  148. openSendFlow() {
  149. this.$refs.popup.open();
  150. },
  151. sendFlow(row) {
  152. uni.showModal({
  153. title: '提示',
  154. content: '是否发起《' + row.name + '》流程?',
  155. success: (res) => {
  156. if (!res.confirm) {
  157. return;
  158. }
  159. // 继续执行后续代码
  160. this.sendFlowFun(row);
  161. }
  162. });
  163. },
  164. sendFlowFun(row) {
  165. let formId = new Snowflake(1n, 1n, 0n).nextId().toString();
  166. getNextFlowNodeByStart({ deploymentId: row.deploymentId, variables: { formId: formId } }).then(res => {
  167. let data = res.data;
  168. const variables = {};
  169. const formData = {};
  170. formData.disabled = true;
  171. formData.formBtns = false;
  172. formData.formId = formId
  173. if (row.id) {
  174. variables.variables = formData;
  175. definitionStart(row.id, JSON.stringify(variables)).then(res => {
  176. this.$modal.msgSuccess(res.msg);
  177. let procInstanceId = res.data;
  178. todoList({
  179. pageNum: 1,
  180. pageSize: 99999999, processInsId: procInstanceId
  181. }).then(toDoRes => {
  182. let records = toDoRes.data.records;
  183. if (records.length == 1) {
  184. records = records[0]
  185. }
  186. const query = {
  187. procInsId: records.procInsId,
  188. executionId: records.executionId,
  189. deployId: records.deployId,
  190. taskId: records.taskId,
  191. taskName: records.taskName,
  192. startUserName: records.startUserName + '-' + records.startDeptName,
  193. formId: formData.formId,
  194. procDefName: records.procDefName
  195. }
  196. const encodedParams = encodeURIComponent(JSON.stringify(query));
  197. uni.navigateTo({
  198. url: `/pages/message/apply/detail?params=${encodedParams}`
  199. })
  200. this.$refs.popup.close();
  201. })
  202. })
  203. }
  204. })
  205. }
  206. },
  207. };
  208. </script>
  209. <style lang="scss">
  210. @import '../common/uni.css';
  211. .info {
  212. position: relative;
  213. .info-badge {
  214. position: absolute;
  215. right: 0;
  216. top: 45rpx;
  217. }
  218. }
  219. .container {
  220. // position: relative;
  221. }
  222. .bottom-popup {
  223. max-height: 50vh;
  224. margin-bottom: 65px;
  225. padding: 10px;
  226. text-align: center;
  227. .popup-item {}
  228. }
  229. </style>
  230. <style>
  231. .icon {
  232. width: 1em;
  233. height: 1em;
  234. vertical-align: -0.15em;
  235. fill: currentColor;
  236. overflow: hidden;
  237. }
  238. </style>