index.vue 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492
  1. <template>
  2. <view class="blacklog-container">
  3. <uni-nav-bar height="100rpx" fixed="true" statusBar="true" left-icon="back" :title="title" @clickLeft="back"
  4. background-color="#157A2C" color="#fff"></uni-nav-bar>
  5. <!-- <div>
  6. <u-search placeholder="搜索模板名称" shape="square" v-model="keyword"></u-search>
  7. </div> -->
  8. <view class="list-container">
  9. <u-list v-show='value1==0'>
  10. <u-list-item v-for="(item, index) in baseList" :key="index">
  11. <view class="kd-card">
  12. <view class="card-title">
  13. <text>{{ Object.values(item)[0] }}</text>
  14. </view>
  15. <view>
  16. <u-grid :border="true">
  17. <u-grid-item v-if='listItem.dictType== Object.keys(item)[0]' class='grid-item'
  18. :customStyle="{width:33+'%',height:220+'rpx'}"
  19. v-for="(listItem,listIndex) in defaultList" :key="listIndex"
  20. @click="handleDetail(listItem,'add')">
  21. <zui-svg-icon style="position: relative;bottom: -14px" :icon="listItem.icon"
  22. width="2rem" />
  23. <text class="grid-text">{{listItem.name}}</text>
  24. </u-grid-item>
  25. </u-grid>
  26. </view>
  27. </view>
  28. </u-list-item>
  29. </u-list>
  30. <u-list v-show='value1==1' @scrolltolower="scrolltolower">
  31. <view v-show="list.length === 0" class="no_data">
  32. <u-empty mode="data" textSize="30"></u-empty>
  33. </view>
  34. <u-list-item v-for="(item, index) in list" :key="index">
  35. <view class="kd-card-1">
  36. <view class="card-title-1">
  37. <text>{{ item.processInstance.name }}</text>
  38. <text class="card-time-1">{{ item.createTime }}</text>
  39. </view>
  40. <view>
  41. <view class="card-body-1">
  42. <view class="card-col-1" v-for="itm in colOptions">
  43. <text class="label-1">{{ itm.label }}</text>
  44. <text class="content-1">{{ item[itm.key] }}</text>
  45. </view>
  46. </view>
  47. <view class="card-footer-1">
  48. <u-button type="success" @click="handleDetail(item, 'view')">处理</u-button>
  49. <u-button type="info" @click="handleDetailView(item, 'detail')">流程详情</u-button>
  50. </view>
  51. </view>
  52. </view>
  53. </u-list-item>
  54. </u-list>
  55. <u-list v-show='value1==2' @scrolltolower="scrolltolowerDone">
  56. <view v-show="doneList.length === 0" class="no_data">
  57. <u-empty mode="data" textSize="30"></u-empty>
  58. </view>
  59. <u-list-item v-for="(item, index) in doneList" :key="index" @click.native="handleDetailView(item)">
  60. <view class="kd-card-2">
  61. <view class="card-title-1">
  62. <text>{{ item.name }}</text>
  63. <text :class="resultClass[item.result]">{{ handleResult[item.result] }}</text>
  64. </view>
  65. <view>
  66. <view class="card-body-1">
  67. <view class="card-col-1">
  68. <text class="label-1">审批意见</text>
  69. <text class="content-1">{{ item.reason }}</text>
  70. </view>
  71. <view class="card-col-1">
  72. <text class="label-1">处理时间</text>
  73. <text class="content-1">{{ item.endTime }}</text>
  74. </view>
  75. <view class="card-col-1">
  76. <text class="label-1">处理时间</text>
  77. <text class="content-1">{{ item.endTime }}</text>
  78. </view>
  79. </view>
  80. </view>
  81. </view>
  82. </u-list-item>
  83. </u-list>
  84. </view>
  85. <u-tabbar class="tabbarBox" :value="value1" @change="change1" :fixed="true" :placeholder='false'
  86. :safeAreaInsetBottom="true">
  87. <u-tabbar-item class='tabbarItem' v-for="item in tabbarItems" :text="item.text" :icon="item.icon"
  88. @click="click1"></u-tabbar-item>
  89. </u-tabbar>
  90. </view>
  91. </template>
  92. <script>
  93. import {
  94. getTodoTaskPage,
  95. getProcessInstancePage
  96. } from '@/api/wt/index.js'
  97. let [page, size, isEnd] = [1, 10, true]
  98. let [donePage, doneSize, doneIsEnd] = [1, 10, true]
  99. import {
  100. getBpmCustomFormList
  101. } from '@/api/wt/index.js'
  102. import {
  103. getByCode
  104. } from '@/api/pda/common.js'
  105. import svgIcon from '@/components/svg-icon.vue'
  106. export default {
  107. components: {
  108. svgIcon
  109. },
  110. data() {
  111. return {
  112. value1: 0,
  113. title: '申请',
  114. handleResult: {
  115. 1: '处理中',
  116. 2: '通过',
  117. 3: '不通过',
  118. 4: '已取消',
  119. },
  120. resultClass: {
  121. 1: 'text-warning',
  122. 2: 'text-primary',
  123. 3: 'text-danger',
  124. 4: 'text-normal',
  125. },
  126. tabbarItems: [{
  127. text: '申请',
  128. icon: 'file-text',
  129. },
  130. {
  131. text: '我审批的',
  132. icon: 'edit-pen',
  133. },
  134. {
  135. text: '我提交的',
  136. icon: 'arrow-upward',
  137. }
  138. ],
  139. keyword: '',
  140. baseList: [],
  141. defaultList: [],
  142. list: [],
  143. doneList: [],
  144. }
  145. },
  146. computed: {
  147. colOptions() {
  148. return [{
  149. label: '流程节点',
  150. key: 'name'
  151. },
  152. {
  153. label: '流程发起人',
  154. key: `startUserNickname`
  155. }
  156. ]
  157. }
  158. },
  159. onShow() {
  160. this.getBaseList()
  161. page = 1
  162. this.list = []
  163. this.getList()
  164. donePage = 1
  165. this.doneList = []
  166. this.getDoneList()
  167. },
  168. methods: {
  169. scrolltolower() {
  170. if (isEnd) return
  171. page++
  172. this.getList()
  173. },
  174. scrolltolowerDone() {
  175. if (doneIsEnd) return
  176. donePage++
  177. this.getDoneList()
  178. },
  179. async getBaseList() {
  180. this.defaultList = await getBpmCustomFormList()
  181. this.baseList = await getByCode('collaborative_type')
  182. },
  183. handleDetail(item, type) {
  184. //'pages/home' + this.listData.miniHandleRouter
  185. ///wt/components/feeApplication/taskSubmit
  186. let params = JSON.stringify({
  187. id: item.id,
  188. processInstanceId: item.processInstance?.id|| '',
  189. type: type
  190. })
  191. let queryParams = `params=${params}`
  192. let url = '/pages/home/wt/components/formParser/routerView'
  193. uni.navigateTo({
  194. url: `${url}?${queryParams}`
  195. })
  196. },
  197. handleDetailView(item) {
  198. console.log(item)
  199. uni.navigateTo({
  200. url: `/pages/home/wt/components/detail?processInstanceId=${item.processInstance?.id||item.id}`
  201. })
  202. },
  203. async getList() {
  204. let paging = {
  205. pageNo: page,
  206. pageSize: size,
  207. processType: 1
  208. }
  209. let par = Object.assign(paging, this.params)
  210. isEnd = false
  211. const data = await getTodoTaskPage(par)
  212. this.list.push(...data.list)
  213. this.list.forEach(item => {
  214. item.startUserNickname = item.processInstance.startUserNickname
  215. })
  216. isEnd = this.list.length >= data.count
  217. },
  218. async getDoneList() {
  219. const params = {
  220. pageNo: page,
  221. pageSize: 8,
  222. ...this.searchData,
  223. processType: 1
  224. }
  225. doneIsEnd = false
  226. const data = await getProcessInstancePage(params)
  227. this.doneList.push(...data.list)
  228. doneIsEnd = this.doneList.length >= data.count
  229. },
  230. change1(index) {
  231. console.log(index)
  232. this.value1 = index
  233. this.title = this.tabbarItems[index].text
  234. },
  235. click1(index) {
  236. this.value1 = index
  237. this.title = this.tabbarItems[index].text
  238. },
  239. }
  240. }
  241. </script>
  242. <style scoped lang="scss">
  243. .blacklog-container {
  244. height: 100vh;
  245. display: flex;
  246. flex-direction: column;
  247. }
  248. .grid-text {
  249. font-size: 14px;
  250. color: #909399;
  251. padding: 10rpx 0 20rpx 0rpx;
  252. /* #ifndef APP-PLUS */
  253. box-sizing: border-box;
  254. /* #endif */
  255. }
  256. .grid-item {
  257. display: flex;
  258. justify-content: space-evenly;
  259. border-right: 1px solid #f3f3f3;
  260. border-bottom: 1px solid #f3f3f3;
  261. }
  262. .list-container {
  263. height: 80%;
  264. padding: 24rpx;
  265. background: $page-bg;
  266. overflow: hidden;
  267. // position: absolute;
  268. // top: 88rpx;
  269. // bottom: 0;
  270. // left: 0;
  271. // right: 0;
  272. /deep/ .u-list {
  273. height: 100% !important;
  274. }
  275. }
  276. .no_data {
  277. position: fixed;
  278. top: 50%;
  279. left: 50%;
  280. transform: translate(-50%, -50%);
  281. color: #999;
  282. font-size: 50rpx;
  283. }
  284. .kd-card {
  285. font-size: 34rpx;
  286. color: #333;
  287. background-color: #fff;
  288. border-radius: 10rpx;
  289. word-break: break-all;
  290. margin-bottom: 24rpx;
  291. min-height: 220rpx;
  292. .status {
  293. font-weight: normal;
  294. }
  295. .card-title {
  296. font-size: 0.9rem;
  297. font-weight: bold;
  298. border-bottom: 1px solid #f1f1f1;
  299. padding: 10rpx 30rpx;
  300. color: #353535;
  301. }
  302. }
  303. .tabbarBox {
  304. height: 30rpx;
  305. }
  306. ::v-deep .tabbarItem {
  307. .uicon-file-text,
  308. .uicon-edit-pen,
  309. .uicon-arrow-upward {
  310. font-size: 20px !important;
  311. top: 2px !important;
  312. line-height: 14px !important;
  313. }
  314. }
  315. .navBarBox {
  316. height: 140rpx;
  317. }
  318. .blacklog-container {
  319. height: 100vh;
  320. display: flex;
  321. flex-direction: column;
  322. }
  323. .kd-card-1 {
  324. font-size: 34rpx;
  325. color: #333;
  326. background-color: #fff;
  327. border-radius: 10rpx;
  328. word-break: break-all;
  329. margin-bottom: 24rpx;
  330. .status-1 {
  331. font-weight: normal;
  332. }
  333. .card-title-1 {
  334. font-size: 0.9rem;
  335. font-weight: bold;
  336. .card-time-1 {
  337. font-weight: normal;
  338. color: #bfbfbf;
  339. font-size: 0.9rem;
  340. align-self: center;
  341. }
  342. }
  343. .card-footer-1,
  344. .card-title-1 {
  345. display: flex;
  346. justify-content: space-between;
  347. padding: 30rpx 30rpx;
  348. }
  349. .card-footer-1 {
  350. padding: 10rpx 30rpx 18rpx 30rpx;
  351. font-size: 0.8rem;
  352. /deep/ .u-button {
  353. width: 48%;
  354. }
  355. }
  356. .card-body-1 {
  357. padding: 0 28rpx;
  358. position: relative;
  359. min-height: 150rpx;
  360. }
  361. .card-body-1:after {
  362. content: '';
  363. position: absolute;
  364. left: auto;
  365. top: auto;
  366. bottom: 10rpx;
  367. right: auto;
  368. height: 1rpx;
  369. width: 91%;
  370. background-color: #f1f1f1;
  371. }
  372. .card-col-1 {
  373. padding: 8rpx 0;
  374. display: flex;
  375. // line-height: ;
  376. .content-1 {
  377. flex: 1;
  378. overflow: hidden;
  379. font-size: 0.9rem;
  380. }
  381. .label-1 {
  382. font-size: 0.9rem;
  383. color: #999;
  384. width: 25%;
  385. }
  386. }
  387. }
  388. .kd-card-2 {
  389. font-size: 34rpx;
  390. color: #333;
  391. background-color: #fff;
  392. border-radius: 10rpx;
  393. word-break: break-all;
  394. margin-bottom: 24rpx;
  395. padding-bottom: 24rpx;
  396. .status-1 {
  397. font-weight: normal;
  398. }
  399. .card-title-1 {
  400. font-size: 0.9rem;
  401. font-weight: bold;
  402. .card-time-1 {
  403. font-weight: normal;
  404. color: #bfbfbf;
  405. font-size: 0.9rem;
  406. align-self: center;
  407. }
  408. }
  409. .card-footer-1,
  410. .card-title-1 {
  411. display: flex;
  412. justify-content: space-between;
  413. padding: 30rpx 30rpx;
  414. }
  415. .card-footer-1 {
  416. padding: 10rpx 30rpx 18rpx 30rpx;
  417. font-size: 0.8rem;
  418. /deep/ .u-button {
  419. width: 48%;
  420. }
  421. }
  422. .card-body-1 {
  423. padding: 0 28rpx;
  424. position: relative;
  425. min-height: 150rpx;
  426. }
  427. .card-col-1 {
  428. padding: 8rpx 0;
  429. display: flex;
  430. // line-height: ;
  431. .content-1 {
  432. flex: 1;
  433. overflow: hidden;
  434. font-size: 0.9rem;
  435. }
  436. .label-1 {
  437. font-size: 0.9rem;
  438. color: #999;
  439. width: 25%;
  440. }
  441. }
  442. }
  443. </style>