requisitionlist.vue 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137
  1. <template>
  2. <view>
  3. <view class="uni-list">
  4. <block v-for="(item, index) in listData" :key="index">
  5. <view class="uni-list-cell" hover-class="uni-list-cell-hover" @click="goDetail(item.requisitionCode)">
  6. <view class="uni-media-list">
  7. <view class="uni-media-list-body">
  8. <view class="uni-media-list-text-top" style="font-size:18px;"> {{item.requisitionName}} </view>
  9. <view style="font-size:13px;" class="uni-media-list-text-body">{{item.requisitionReason.substring(0,30)}}</view>
  10. <view class="uni-media-list-text-bottom">
  11. <text>申请人:{{item.person}}</text>
  12. <text>{{item.requisitionDate.substring(0,10)}}</text>
  13. </view>
  14. </view>
  15. </view>
  16. </view>
  17. </block>
  18. </view>
  19. <view style="bottom: 15px;right:10px;position: fixed;z-index: 50;">
  20. <router-link to="/pages/template/requisitionadd/requisitionadd" style="text-decoration: none;" title="签证申请添加">
  21. <uni-icons type="plus-filled" size="80" color="#5678FE"></uni-icons>
  22. </router-link>
  23. </view>
  24. <uni-load-more :status="status" :icon-size="16" :content-text="contentText" />
  25. </view>
  26. </template>
  27. <script>
  28. import {
  29. getUnit,
  30. getUnitUser
  31. } from "@/common/api/commonApi.js";
  32. import uniLoadMore from '@/components/uni-load-more/uni-load-more.vue';
  33. import {
  34. GetRequisitionList
  35. } from "@/common/api/requisitionApi.js";
  36. export default {
  37. components: {
  38. uniLoadMore
  39. },
  40. data() {
  41. return {
  42. listData: [],
  43. last_id: '',
  44. reload: false,
  45. status: 'more',
  46. adpid: '',
  47. contentText: {
  48. contentdown: '上拉加载更多',
  49. contentrefresh: '加载中',
  50. contentnomore: '没有更多'
  51. }
  52. };
  53. },
  54. onLoad() {
  55. console.info("当前登录状态:" + this.$store.state.isLogin);
  56. //console.info(this);
  57. this.$util.persistLogin(this);
  58. this.adpid = this.$adpid;
  59. //this.getList();
  60. },
  61. onPullDownRefresh() {
  62. this.reload = true;
  63. this.last_id = '';
  64. this.getList();
  65. },
  66. onReachBottom() {
  67. this.status = 'more';
  68. this.getList();
  69. },
  70. created: function() {
  71. this.getList();
  72. },
  73. methods: {
  74. getList() {
  75. let that = this;
  76. let where='1=1 and projectcode=\''+this.$store.state.projectCode+'\'';
  77. GetRequisitionList(where).then((res) => {
  78. console.info(res);
  79. res.forEach(function(item, index, array) {
  80. that.$set(that.listData, index, item);
  81. });
  82. console.info(that.listData);
  83. });
  84. },
  85. goDetail: function(id) {
  86. console.info('godetail');
  87. console.info(id);
  88. uni.navigateTo({
  89. // requisitiondetail
  90. url: '../requisitiondetail/requisitiondetail?id=' + id
  91. });
  92. },
  93. }
  94. };
  95. </script>
  96. <style scoped>
  97. .uni-media-list-body {
  98. height: auto;
  99. justify-content: space-around;
  100. }
  101. .uni-media-list-text-top {
  102. height:35px;
  103. line-height: 35px;
  104. font-size: 15rpx;
  105. font-weight: 500;
  106. letter-spacing:1px;
  107. overflow: hidden;
  108. }
  109. .uni-media-list-text-body{
  110. flex-direction: row;
  111. height:50px;
  112. font-size: 13px;
  113. color: #8f8f94;
  114. letter-spacing:1px;
  115. }
  116. .uni-media-list-text-bottom {
  117. display: flex;
  118. justify-content: space-between;
  119. height:35px;
  120. line-height: 35px;
  121. font-size: 13px;
  122. color: #8f8f94;
  123. letter-spacing:1px;
  124. padding-bottom: 0;
  125. }
  126. </style>