综合办公系统
Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.

index.vue 7.4KB

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