综合办公系统
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

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