综合办公系统
Você não pode selecionar mais de 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.

index.vue 8.3KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315
  1. <!--
  2. * @Author: ysh
  3. * @Date: 2025-01-16 11:17:08
  4. * @LastEditors: Please set LastEditors
  5. * @LastEditTime: 2025-09-03 16:38:56
  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: 'instruments',
  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. name: '工作填报',
  93. icon: '/static/images/work/declare.png',
  94. url: 'declare',
  95. hasPermi: checkPermi(['oa:declare:list'])
  96. },
  97. {
  98. name: '人事管理',
  99. icon: '/static/images/work/staff.png',
  100. url: 'staff',
  101. hasPermi: checkRole(['staff','leader'])
  102. }
  103. ],
  104. flowList: ['借款审批', '用车审批', '设备审批', '工作填报'],
  105. sendFlowList: [],
  106. // 查询参数
  107. queryProcessParams: {
  108. pageNum: 1,
  109. pageSize: 9999,
  110. parentDeploymentId: null,
  111. name: null,
  112. category: null,
  113. key: null,
  114. tenantId: null,
  115. deployTime: null,
  116. derivedFrom: null,
  117. derivedFromRoot: null,
  118. parentDeploymentId: null,
  119. engineVersion: null
  120. },
  121. definitionList: [],
  122. processTotal: 0,
  123. processLoading: true
  124. }
  125. },
  126. created() {
  127. this.getDefinitionList();
  128. },
  129. methods: {
  130. checkPermi,
  131. checkRole,
  132. clickBannerItem(item) {
  133. console.info(item)
  134. },
  135. changeSwiper(e) {
  136. this.current = e.detail.current
  137. },
  138. toUrlFn(type) {
  139. if (type == 'borrow') {
  140. uni.navigateTo({
  141. url: '/pages/oa/borrow/borrowList'
  142. })
  143. } else if (type == 'deviceLog') {
  144. uni.navigateTo({
  145. url: '/pages/oa/device/deviceLog'
  146. })
  147. } else if (type == 'car') {
  148. uni.navigateTo({
  149. url: '/pages/oa/car/carList'
  150. })
  151. } else if (type == 'instruments') {
  152. uni.navigateTo({
  153. url: '/pages/oa/device/instrumentsList'
  154. })
  155. } else if (type == 'declare') {
  156. uni.navigateTo({
  157. url: '/pages/oa/declare/declareList'
  158. })
  159. } else if (type == 'staff') {
  160. uni.navigateTo({
  161. url: '/pages/oa/staff/staffList'
  162. })
  163. }
  164. else {
  165. this.$modal.showToast('模块建设中~')
  166. }
  167. },
  168. sendFlow(row) {
  169. let formId = new Snowflake(1n, 1n, 0n).nextId().toString();
  170. getNextFlowNodeByStart({ deploymentId: row.deploymentId, variables: { formId: formId } }).then(res => {
  171. let data = res.data;
  172. const variables = {};
  173. const formData = {};
  174. formData.disabled = true;
  175. formData.formBtns = false;
  176. formData.formId = formId
  177. if (row.id) {
  178. variables.variables = formData;
  179. definitionStart(row.id, JSON.stringify(variables)).then(res => {
  180. this.$modal.msgSuccess(res.msg);
  181. let procInstanceId = res.data;
  182. todoList({
  183. pageNum: 1,
  184. pageSize: 99999999, processInsId: procInstanceId
  185. }).then(toDoRes => {
  186. let records = toDoRes.data.records;
  187. if (records.length == 1) {
  188. records = records[0]
  189. }
  190. const query = {
  191. procInsId: records.procInsId,
  192. executionId: records.executionId,
  193. deployId: records.deployId,
  194. taskId: records.taskId,
  195. taskName: records.taskName,
  196. startUserName: records.startUserName + '-' + records.startDeptName,
  197. formId: formData.formId,
  198. procDefName: records.procDefName
  199. }
  200. const encodedParams = encodeURIComponent(JSON.stringify(query));
  201. uni.navigateTo({
  202. url: `/pages/message/apply/detail?params=${encodedParams}`
  203. })
  204. this.$refs.popup.close();
  205. })
  206. })
  207. }
  208. })
  209. },
  210. getDefinitionList() {
  211. listDefinition(this.queryProcessParams).then(response => {
  212. this.definitionList = response.data.records;
  213. this.processTotal = response.data.total;
  214. this.processLoading = false;
  215. let list = []
  216. for (let i of this.definitionList) {
  217. if (this.flowList.includes(i.name)) {
  218. if (i.name != "借款审批")
  219. list.push(i);
  220. if (i.name == "借款审批" && i.version == 2)
  221. list.push(i);
  222. }
  223. }
  224. this.sendFlowList = list;
  225. });
  226. },
  227. }
  228. }
  229. </script>
  230. <style lang="scss">
  231. /* #ifndef APP-NVUE */
  232. page {
  233. display: flex;
  234. flex-direction: column;
  235. box-sizing: border-box;
  236. background-color: #fff;
  237. min-height: 100%;
  238. height: auto;
  239. }
  240. view {
  241. font-size: 14px;
  242. line-height: inherit;
  243. }
  244. /* #endif */
  245. .text {
  246. text-align: center;
  247. font-size: 26rpx;
  248. margin-top: 10rpx;
  249. }
  250. .grid-item-box {
  251. flex: 1;
  252. /* #ifndef APP-NVUE */
  253. display: flex;
  254. /* #endif */
  255. flex-direction: column;
  256. align-items: center;
  257. justify-content: center;
  258. padding: 15px 0;
  259. }
  260. .uni-margin-wrap {
  261. width: 690rpx;
  262. width: 100%;
  263. ;
  264. }
  265. .swiper {
  266. height: 300rpx;
  267. }
  268. .swiper-box {
  269. height: 150px;
  270. }
  271. .swiper-item {
  272. /* #ifndef APP-NVUE */
  273. display: flex;
  274. /* #endif */
  275. flex-direction: column;
  276. justify-content: center;
  277. align-items: center;
  278. color: #fff;
  279. height: 300rpx;
  280. line-height: 300rpx;
  281. }
  282. @media screen and (min-width: 500px) {
  283. .uni-swiper-dot-box {
  284. width: 400px;
  285. /* #ifndef APP-NVUE */
  286. margin: 0 auto;
  287. /* #endif */
  288. margin-top: 8px;
  289. }
  290. .image {
  291. width: 100%;
  292. }
  293. }
  294. .bottom-popup {
  295. max-height: 50vh;
  296. margin-bottom: 65px;
  297. padding: 10px;
  298. text-align: center;
  299. }
  300. </style>