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

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