list.vue 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133
  1. <template>
  2. <view class="page-detail">
  3. <view class="page-center">
  4. <uni-section title="待审批列表" type="line" style="margin-top: 0;" />
  5. <uni-card v-for="item in list" :title="item.name || '无标题'" @click="toDetail(item)" >
  6. <view class="item">
  7. <view class="label">发起时间</view>
  8. <view class="value">{{formateDate(item.create_time)}}</view>
  9. </view>
  10. <view class="item">
  11. <view class="label">发起人</view>
  12. <view class="value">{{item.AuthorInfo && item.AuthorInfo.CName}}</view>
  13. </view>
  14. <button size="mini" type="default" class="detailBtn" @click="toDetail(item)">查看详情</button>
  15. <!-- <view class="row">
  16. <view class="item">
  17. <view class="label">分类</view>
  18. <view class="value">{{'classify[item.classify_id]' || '未知分类'}}</view>
  19. </view>
  20. <view class="item">
  21. <view class="label">提交人</view>
  22. <view class="value">{{'item.AuthorInfo && item.AuthorInfo.CName'}}</view>
  23. </view>
  24. </view> -->
  25. </uni-card>
  26. <view style="text-align: center;" v-if="list.length == 0">暂无审批项</view>
  27. </view>
  28. </view>
  29. </template>
  30. <script>
  31. import {
  32. getOAAuditList
  33. } from "@/services/oa.js"
  34. export default {
  35. data() {
  36. return {
  37. list: [],
  38. pagination: {
  39. current: 1,
  40. pageSize: 10,
  41. total: 0,
  42. }
  43. }
  44. },
  45. onLoad(query) {
  46. },
  47. mounted() {
  48. this.init()
  49. },
  50. onShow() {
  51. this.queryList()
  52. },
  53. methods: {
  54. async init() {},
  55. async queryList() {
  56. var {
  57. list,
  58. pagination
  59. } = await getOAAuditList()
  60. this.list = list;
  61. this.pagination = pagination;
  62. },
  63. formateDate(date) {
  64. const origin = new Date(date);
  65. const datePart = origin.getFullYear() + "-" + (origin.getMonth() + 1) + "-" + origin.getDate();
  66. const timePart = origin.getHours() + ":" + origin.getMinutes() + ":" + origin.getSeconds();
  67. return datePart + " " + timePart;
  68. },
  69. toDetail(item) {
  70. uni.navigateTo({
  71. url: `./detail?id=${item.id}`
  72. })
  73. }
  74. },
  75. }
  76. </script>
  77. <style lang="less" scoped>
  78. .page-detail {
  79. min-height: 100vh;
  80. padding: 15px;
  81. background: url("~@/static/index/bg.png") no-repeat center;
  82. background-size: cover;
  83. background-attachment: fixed;
  84. .page-center {
  85. padding: 20rpx;
  86. padding-top: 0;
  87. border-radius: 5px;
  88. background-color: #fff;
  89. }
  90. }
  91. .item {
  92. margin-bottom: 14px;
  93. .label {
  94. font-weight: bold;
  95. font-size: 16px;
  96. margin-bottom: 5px;
  97. }
  98. .value {
  99. font-size: 14;
  100. }
  101. }
  102. .row {
  103. display: flex;
  104. .item {
  105. width: 50%;
  106. display: flex;
  107. align-items: center;
  108. .label {
  109. margin-right: 12px;
  110. margin-bottom: 0;
  111. }
  112. }
  113. }
  114. .detailBtn {
  115. position: absolute;
  116. bottom: 20px;
  117. right: 20px;
  118. background-color: #2979ff;
  119. color: #fff;
  120. }
  121. </style>