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

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