综合办公系统
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.

index.vue 7.5KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287
  1. <!--
  2. * @Author: ysh
  3. * @Date: 2025-01-16 11:17:08
  4. * @LastEditors: Please set LastEditors
  5. * @LastEditTime: 2025-06-23 09:55:12
  6. -->
  7. <template>
  8. <view class="work-container">
  9. <!-- 轮播图 -->
  10. <!-- <uni-swiper-dot class="uni-swiper-dot-box" :info="data" :current="current" field="content">
  11. <swiper class="swiper-box" :current="swiperDotIndex" @change="changeSwiper">
  12. <swiper-item v-for="(item, index) in data" :key="index">
  13. <view class="swiper-item" @click="clickBannerItem(item)">
  14. <image :src="item.image" mode="aspectFill" :draggable="false" />
  15. </view>
  16. </swiper-item>
  17. </swiper>
  18. </uni-swiper-dot> -->
  19. <!-- 宫格组件 -->
  20. <uni-section title="常用操作" type="line"></uni-section>
  21. <view class="grid-body">
  22. <uni-grid :column="4" :showBorder="false">
  23. <uni-grid-item>
  24. <view class="grid-item-box" @click="$refs.popup.open()">
  25. <u-image :fade="false" src="@/static/images/work/sendFlow.png" width="40px" height="40px"></u-image>
  26. <text class="text">发起流程</text>
  27. </view>
  28. </uni-grid-item>
  29. <uni-grid-item v-for="item in gridList" :key="item.url" v-if="item.hasPermi">
  30. <view class="grid-item-box" @click="toUrlFn(item.url)" v-if="item.name != '发起流程'">
  31. <u-image :fade="false" :src="item.icon" width="40px" height="40px"></u-image>
  32. <text class="text">{{ item.name }}</text>
  33. </view>
  34. </uni-grid-item>
  35. </uni-grid>
  36. </view>
  37. <uv-popup ref="popup" mode="bottom">
  38. <view class="bottom-popup">
  39. <view v-for="item, index in sendFlowList" :key="index">
  40. <u-button @click="sendFlow(item)">{{ item.name }}</u-button>
  41. </view>
  42. </view>
  43. </uv-popup>
  44. </view>
  45. </template>
  46. <script>
  47. import { listDefinition } from "@/api/flowable/definition";
  48. import { Snowflake } from '@/utils/snowFlake.js';
  49. import { getNextFlowNodeByStart, todoList } from "@/api/flowable/todo";
  50. import { definitionStart, flowXmlAndNode } from "@/api/flowable/definition";
  51. import { checkPermi, checkRole } from "@/utils/permission";
  52. export default {
  53. data() {
  54. return {
  55. current: 0,
  56. swiperDotIndex: 0,
  57. data: [{
  58. image: '/static/images/banner/banner01.jpg'
  59. },
  60. {
  61. image: '/static/images/banner/banner02.jpg'
  62. },
  63. {
  64. image: '/static/images/banner/banner03.jpg'
  65. }],
  66. gridList: [
  67. {
  68. name: '借款管理',
  69. icon: '/static/images/work/borrow.png',
  70. url: 'borrow',
  71. hasPermi: checkPermi(['oa:borrow:list'])
  72. },
  73. {
  74. name: '用车管理',
  75. icon: '/static/images/work/car.png',
  76. url: 'car',
  77. hasPermi: checkPermi(['oa:car:list'])
  78. },
  79. {
  80. name: '设备管理',
  81. icon: '/static/images/work/device.png',
  82. url: 'device',
  83. hasPermi: checkPermi(['oa:device:list'])
  84. },
  85. {
  86. name: '设备作业记录',
  87. icon: '/static/images/work/workDay.png',
  88. url: 'deviceLog',
  89. hasPermi: checkPermi(['oa:deviceLog:list'])
  90. }
  91. ],
  92. flowList: ['借款审批', '用车审批', '设备审批', '工作填报'],
  93. sendFlowList: [],
  94. // 查询参数
  95. queryProcessParams: {
  96. pageNum: 1,
  97. pageSize: 9999,
  98. name: null,
  99. category: null,
  100. key: null,
  101. tenantId: null,
  102. deployTime: null,
  103. derivedFrom: null,
  104. derivedFromRoot: null,
  105. parentDeploymentId: null,
  106. engineVersion: null
  107. },
  108. definitionList: [],
  109. processTotal: 0,
  110. processLoading: true
  111. }
  112. },
  113. created() {
  114. this.getDefinitionList();
  115. },
  116. methods: {
  117. checkPermi,
  118. checkRole,
  119. clickBannerItem(item) {
  120. console.info(item)
  121. },
  122. changeSwiper(e) {
  123. this.current = e.detail.current
  124. },
  125. toUrlFn(type) {
  126. if (type == 'borrow') {
  127. uni.navigateTo({
  128. url: '/pages/oa/borrow/borrowList'
  129. })
  130. } else if (type == 'deviceLog') {
  131. uni.navigateTo({
  132. url: '/pages/oa/device/deviceLog'
  133. })
  134. } else if (type == 'car') {
  135. uni.navigateTo({
  136. url: '/pages/oa/car/carList'
  137. })
  138. }
  139. else {
  140. this.$modal.showToast('模块建设中~')
  141. }
  142. },
  143. sendFlow(row) {
  144. let formId = new Snowflake(1n, 1n, 0n).nextId().toString();
  145. getNextFlowNodeByStart({ deploymentId: row.deploymentId, variables: { formId: formId } }).then(res => {
  146. let data = res.data;
  147. const variables = {};
  148. const formData = {};
  149. formData.disabled = true;
  150. formData.formBtns = false;
  151. formData.formId = formId
  152. if (row.id) {
  153. variables.variables = formData;
  154. definitionStart(row.id, JSON.stringify(variables)).then(res => {
  155. this.$modal.msgSuccess(res.msg);
  156. let procInstanceId = res.data;
  157. todoList({
  158. pageNum: 1,
  159. pageSize: 99999999, processInsId: procInstanceId
  160. }).then(toDoRes => {
  161. let records = toDoRes.data.records;
  162. if (records.length == 1) {
  163. records = records[0]
  164. }
  165. const query = {
  166. procInsId: records.procInsId,
  167. executionId: records.executionId,
  168. deployId: records.deployId,
  169. taskId: records.taskId,
  170. taskName: records.taskName,
  171. startUserName: records.startUserName + '-' + records.startDeptName,
  172. formId: formData.formId,
  173. procDefName: records.procDefName
  174. }
  175. const encodedParams = encodeURIComponent(JSON.stringify(query));
  176. uni.navigateTo({
  177. url: `/pages/message/apply/detail?params=${encodedParams}`
  178. })
  179. this.$refs.popup.close();
  180. })
  181. })
  182. }
  183. })
  184. },
  185. getDefinitionList() {
  186. listDefinition(this.queryProcessParams).then(response => {
  187. this.definitionList = response.data.records;
  188. this.processTotal = response.data.total;
  189. this.processLoading = false;
  190. let list = []
  191. for (let i of this.definitionList) {
  192. if (this.flowList.includes(i.name)) {
  193. list.push(i)
  194. }
  195. }
  196. this.sendFlowList = list;
  197. });
  198. },
  199. }
  200. }
  201. </script>
  202. <style lang="scss">
  203. /* #ifndef APP-NVUE */
  204. page {
  205. display: flex;
  206. flex-direction: column;
  207. box-sizing: border-box;
  208. background-color: #fff;
  209. min-height: 100%;
  210. height: auto;
  211. }
  212. view {
  213. font-size: 14px;
  214. line-height: inherit;
  215. }
  216. /* #endif */
  217. .text {
  218. text-align: center;
  219. font-size: 26rpx;
  220. margin-top: 10rpx;
  221. }
  222. .grid-item-box {
  223. flex: 1;
  224. /* #ifndef APP-NVUE */
  225. display: flex;
  226. /* #endif */
  227. flex-direction: column;
  228. align-items: center;
  229. justify-content: center;
  230. padding: 15px 0;
  231. }
  232. .uni-margin-wrap {
  233. width: 690rpx;
  234. width: 100%;
  235. ;
  236. }
  237. .swiper {
  238. height: 300rpx;
  239. }
  240. .swiper-box {
  241. height: 150px;
  242. }
  243. .swiper-item {
  244. /* #ifndef APP-NVUE */
  245. display: flex;
  246. /* #endif */
  247. flex-direction: column;
  248. justify-content: center;
  249. align-items: center;
  250. color: #fff;
  251. height: 300rpx;
  252. line-height: 300rpx;
  253. }
  254. @media screen and (min-width: 500px) {
  255. .uni-swiper-dot-box {
  256. width: 400px;
  257. /* #ifndef APP-NVUE */
  258. margin: 0 auto;
  259. /* #endif */
  260. margin-top: 8px;
  261. }
  262. .image {
  263. width: 100%;
  264. }
  265. }
  266. .bottom-popup {
  267. max-height: 50vh;
  268. margin-bottom: 65px;
  269. padding: 10px;
  270. text-align: center;
  271. }
  272. </style>