index.vue 11 KB

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