approvallist.vue 7.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286
  1. <template>
  2. <view class="approval">
  3. <view class="top-banner">
  4. <u-swiper :list="pictureList" height="320rpx" imgMode="heightFix" keyName="picture" radius="0" circular ></u-swiper>
  5. </view>
  6. <view class="grid">
  7. <u-grid :border="false" col="3">
  8. <u-grid-item @click="toPage('/subpages/approval/launch')">
  9. <image
  10. class="grid-img"
  11. src="../../static/czzn-img/approve/approval-launch.png"
  12. />
  13. <text class="grid-text">{{$t('home.initiated')}}</text>
  14. </u-grid-item>
  15. <u-grid-item @click="toPage('/subpages/approval/done')">
  16. <image
  17. class="grid-img"
  18. src="../../static/czzn-img/approve/approval-done.png"
  19. />
  20. <text class="grid-text">{{$t('home.done')}}</text>
  21. </u-grid-item>
  22. <u-grid-item @click="toPage('/subpages/approval/pending')">
  23. <image class="grid-img"
  24. src="../../static/czzn-img/approve/approval-pending.png"
  25. />
  26. <text class="grid-text">{{$t('home.toDo')}}</text>
  27. </u-grid-item>
  28. </u-grid>
  29. </view>
  30. <view class="list-wrap" v-for="list in approvalList" :key="list.id">
  31. <u-cell :border="false" :customStyle="{'font-weight':'bold','padding':'10rpx 10rpx'}" :title="list.fullName"></u-cell>
  32. <view class="cell-wrap">
  33. <view class="cell-item" v-for="(item,index) in list.children" :key="index" @click="toForm(item)">
  34. <view class="cell-icon">
  35. <uni-icons custom-prefix="elicon" :type="item.icon" size="30" color="#4680F9"></uni-icons>
  36. </view>
  37. <text>{{item.fullName}}</text>
  38. </view>
  39. </view>
  40. </view>
  41. <view class="message-wrap" style="padding:32rpx">
  42. <view class="message-title" @click="toPage('/subpages/approval/messageList')">
  43. <span class="label">消息通知</span>
  44. <span class="message">
  45. 3条未读信息
  46. <u-icon name="arrow-right" color="#222222"></u-icon>
  47. </span>
  48. </view>
  49. <!-- 单消息 -->
  50. <view class="message-item">
  51. <view class="title">
  52. <span style="color:#222">价格申请</span>
  53. <span>23分钟前</span>
  54. </view>
  55. <view class="info">
  56. <view class="cell-icon">
  57. <uni-icons custom-prefix="elicon" type="el-icon-s-promotion" size="16" color="#4680F9"></uni-icons>
  58. </view>
  59. <span class="info-text">善良的咖啡机提交了关于什么什么价格申请,阿姆斯特朗登月</span>
  60. </view>
  61. </view>
  62. </view>
  63. <Bars></Bars>
  64. </view>
  65. </template>
  66. <script>
  67. import {getApprovalList} from "../../api/approval"
  68. import Bars from '../../components/tabBar/tabBar.vue';
  69. import imgUtil from '../../utils/imgUtil';
  70. export default {
  71. components:{
  72. Bars
  73. },
  74. data(){
  75. return {
  76. approvalList:[],
  77. pictureList:[imgUtil.approvalBanner]
  78. }
  79. },
  80. onLoad(options) {
  81. uni.hideTabBar()
  82. this.getApprovalList()
  83. },
  84. methods:{
  85. //获取审批列表
  86. getApprovalList(){
  87. getApprovalList().then(res=>{
  88. if(res.data.code == 200){
  89. this.approvalList=res.data.data.list
  90. }
  91. })
  92. },
  93. //跳转页面
  94. toPage(url){
  95. uni.navigateTo({ url: url })
  96. // switch (item) {
  97. // case '1':
  98. // uni.navigateTo({ url: '/subpages/approval/launch' })
  99. // break;
  100. // case '2':
  101. // uni.navigateTo({ url: '/subpages/approval/done' })
  102. // break;
  103. // case '3':
  104. // uni.navigateTo({ url: '/subpages/approval/pending' })
  105. // break;
  106. // default:
  107. // break;
  108. // }
  109. },
  110. //跳转到发起审批
  111. toForm(item){
  112. console.log(item);
  113. uni.navigateTo({ url: `/subpages/approvalform/${item.enCode}?flowId=${item.id}`})
  114. },
  115. }
  116. };
  117. </script>
  118. <style lang="scss" scoped>
  119. /* #ifndef APP-NVUE */
  120. view {
  121. display: flex;
  122. box-sizing: border-box;
  123. flex-direction: column;
  124. }
  125. .report-list {
  126. display: flex;
  127. flex-wrap: wrap;
  128. flex-direction: row;
  129. padding: 0 16rpx 16rpx;
  130. .item {
  131. display: flex;
  132. align-items: center;
  133. background: #fff;
  134. width: calc(50% - 40rpx);
  135. margin: 16rpx 20rpx;
  136. padding: 32rpx;
  137. .item-img {
  138. width: 76rpx;
  139. height: 68rpx;
  140. }
  141. .item-text {
  142. font-size: 24rpx;
  143. line-height: 2;
  144. color: #222;
  145. }
  146. }
  147. }
  148. page {
  149. background-color: #f5f7fa;
  150. }
  151. /* #endif*/
  152. .approval {
  153. /* #ifndef APP-NVUE */
  154. display: flex;
  155. width: 750rpx;
  156. min-height: 100%;
  157. /* #endif */
  158. flex-direction: column;
  159. flex: 1;
  160. background-color: #f5f7fa;
  161. .top-banner{
  162. padding: 32rpx 32rpx 0;
  163. }
  164. .grid{
  165. padding: 36rpx 48rpx;
  166. margin: 40rpx 32rpx 0;
  167. background-color: #fff;
  168. border-radius: 10rpx;
  169. color: #000;
  170. .grid-img{
  171. width: 64rpx;
  172. height: 64rpx;
  173. }
  174. .grid-text{
  175. font-size: 24rpx;
  176. margin-top: 12rpx;
  177. }
  178. }
  179. .list-wrap{
  180. @extend .grid;
  181. padding: 0;
  182. .cell-wrap{
  183. padding-left: 40rpx;
  184. display: flex;
  185. flex-direction: row;
  186. justify-content: left;
  187. flex-wrap: wrap;
  188. .cell-item{
  189. text-align: center;
  190. width: 100rpx;
  191. margin-right: 61rpx;
  192. font-size: 20rpx;
  193. margin-bottom: 40rpx;
  194. .cell-icon{
  195. width: 100rpx;
  196. height: 100rpx;
  197. background-color: #E1EBFF;
  198. border-radius: 10rpx;
  199. display: flex;
  200. justify-content: space-around;
  201. align-items: center;
  202. margin-bottom: 10rpx;
  203. }
  204. }
  205. }
  206. .grid-text{
  207. font-size: 24rpx;
  208. margin-top: 12rpx;
  209. color: #999;
  210. }
  211. }
  212. .message-wrap{
  213. margin: 40rpx 32rpx;
  214. background-color: #fff;
  215. padding: 40rpx;
  216. border-radius: 10rpx;
  217. .message-title{
  218. display: flex;
  219. flex-direction: row;
  220. justify-content: space-between;
  221. line-height: 32rpx;
  222. .label{
  223. color: #222;
  224. font-size: 28rpx;
  225. font-weight: bold;
  226. }
  227. .message{
  228. display: flex;
  229. flex-direction: row;
  230. color: #999;
  231. font-size: 24rpx;
  232. }
  233. }
  234. .message-item{
  235. margin-top: 32rpx;
  236. background-color: #f9f9f9;
  237. border-radius: 10rpx;
  238. padding: 28rpx 32rpx;
  239. .title{
  240. justify-content: space-between;
  241. display: flex;
  242. flex-direction: row;
  243. // width: 176rpx;
  244. color: #999;
  245. font-size: 24rpx;
  246. align-items: center;
  247. justify-content: space-between;
  248. margin-bottom: 32rpx;
  249. }
  250. .info{
  251. flex-direction: row;
  252. .cell-icon{
  253. width: 50rpx;
  254. height: 50rpx;
  255. background-color: #E1EBFF;
  256. border-radius: 10rpx;
  257. display: flex;
  258. justify-content: space-around;
  259. align-items: center;
  260. margin-right: 32rpx;
  261. }
  262. .info-text{
  263. flex: 1;
  264. overflow: hidden;
  265. text-overflow: ellipsis;
  266. white-space: nowrap;
  267. font-size: 22rpx;
  268. color: #666;
  269. }
  270. }
  271. }
  272. }
  273. }
  274. </style>