综合办公系统
您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

index.vue 8.3KB

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