index.vue 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523
  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="3rem" />
  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({status: 1})
  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: 15px;
  269. color: #333;
  270. padding: 10rpx 0 20rpx 0rpx;
  271. margin-top: 10rpx;
  272. /* #ifndef APP-PLUS */
  273. box-sizing: border-box;
  274. /* #endif */
  275. }
  276. .grid-item {
  277. display: flex;
  278. justify-content: space-evenly;
  279. border-right: 1px solid #f3f3f3;
  280. border-bottom: 1px solid #f3f3f3;
  281. }
  282. .list-container {
  283. height: 80%;
  284. padding: 24rpx;
  285. background: $page-bg;
  286. overflow: hidden;
  287. // position: absolute;
  288. // top: 88rpx;
  289. // bottom: 0;
  290. // left: 0;
  291. // right: 0;
  292. /deep/ .u-list {
  293. height: 100% !important;
  294. }
  295. }
  296. .no_data {
  297. position: fixed;
  298. top: 50%;
  299. left: 50%;
  300. transform: translate(-50%, -50%);
  301. color: #999;
  302. font-size: 50rpx;
  303. }
  304. .kd-card {
  305. font-size: 34rpx;
  306. color: #333;
  307. background-color: #fff;
  308. border-radius: 10rpx;
  309. word-break: break-all;
  310. margin-bottom: 24rpx;
  311. min-height: 220rpx;
  312. .status {
  313. font-weight: normal;
  314. }
  315. .card-title {
  316. font-size: 0.9rem;
  317. font-weight: bold;
  318. border-bottom: 1px solid #f1f1f1;
  319. padding: 10rpx 30rpx;
  320. color: #353535;
  321. }
  322. }
  323. .tabbarBox {
  324. height: 30rpx;
  325. }
  326. ::v-deep .tabbarItem {
  327. .uicon-file-text,
  328. .uicon-edit-pen,
  329. .uicon-arrow-upward {
  330. font-size: 20px !important;
  331. top: 2px !important;
  332. line-height: 14px !important;
  333. }
  334. }
  335. .navBarBox {
  336. height: 140rpx;
  337. }
  338. .blacklog-container {
  339. height: 100vh;
  340. display: flex;
  341. flex-direction: column;
  342. }
  343. .kd-card-1 {
  344. font-size: 34rpx;
  345. color: #333;
  346. background-color: #fff;
  347. border-radius: 10rpx;
  348. word-break: break-all;
  349. margin-bottom: 24rpx;
  350. .status-1 {
  351. font-weight: normal;
  352. }
  353. .card-title-1 {
  354. font-size: 0.9rem;
  355. font-weight: bold;
  356. .card-time-1 {
  357. font-weight: normal;
  358. color: #bfbfbf;
  359. font-size: 0.9rem;
  360. align-self: center;
  361. }
  362. }
  363. .card-footer-1,
  364. .card-title-1 {
  365. display: flex;
  366. justify-content: space-between;
  367. padding: 30rpx 30rpx;
  368. }
  369. .card-footer-1 {
  370. padding: 10rpx 30rpx 18rpx 30rpx;
  371. font-size: 0.8rem;
  372. /deep/ .u-button {
  373. width: 48%;
  374. }
  375. }
  376. .card-body-1 {
  377. padding: 0 28rpx;
  378. position: relative;
  379. min-height: 150rpx;
  380. }
  381. .card-body-1:after {
  382. content: '';
  383. position: absolute;
  384. left: auto;
  385. top: auto;
  386. bottom: 10rpx;
  387. right: auto;
  388. height: 1rpx;
  389. width: 91%;
  390. background-color: #f1f1f1;
  391. }
  392. .card-col-1 {
  393. padding: 8rpx 0;
  394. display: flex;
  395. // line-height: ;
  396. .content-1 {
  397. flex: 1;
  398. overflow: hidden;
  399. font-size: 0.9rem;
  400. }
  401. .label-1 {
  402. font-size: 0.9rem;
  403. color: #999;
  404. width: 25%;
  405. }
  406. }
  407. }
  408. .kd-card-2 {
  409. font-size: 34rpx;
  410. color: #333;
  411. background-color: #fff;
  412. border-radius: 10rpx;
  413. word-break: break-all;
  414. margin-bottom: 24rpx;
  415. padding-bottom: 24rpx;
  416. .status-1 {
  417. font-weight: normal;
  418. }
  419. .card-title-1 {
  420. font-size: 0.9rem;
  421. font-weight: bold;
  422. .card-time-1 {
  423. font-weight: normal;
  424. color: #bfbfbf;
  425. font-size: 0.9rem;
  426. align-self: center;
  427. }
  428. }
  429. .card-footer-1,
  430. .card-title-1 {
  431. display: flex;
  432. justify-content: space-between;
  433. padding: 30rpx 30rpx;
  434. }
  435. .card-footer-1 {
  436. padding: 10rpx 30rpx 18rpx 30rpx;
  437. font-size: 0.8rem;
  438. /deep/ .u-button {
  439. width: 48%;
  440. }
  441. }
  442. .card-body-1 {
  443. padding: 0 28rpx;
  444. position: relative;
  445. // min-height: 150rpx;
  446. }
  447. .card-body-1:after {
  448. content: '';
  449. position: absolute;
  450. left: auto;
  451. top: auto;
  452. bottom: 10rpx;
  453. right: auto;
  454. height: 1rpx;
  455. width: 91%;
  456. background-color: #f1f1f1;
  457. }
  458. .card-col-1 {
  459. padding: 8rpx 0;
  460. display: flex;
  461. // line-height: ;
  462. .content-1 {
  463. flex: 1;
  464. overflow: hidden;
  465. font-size: 0.9rem;
  466. }
  467. .label-1 {
  468. font-size: 0.9rem;
  469. color: #999;
  470. width: 25%;
  471. }
  472. }
  473. }
  474. </style>