requisitionlist.vue 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161
  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?type='+type" style="text-decoration: none;" title="签证申请添加">
  21. <uni-icons type="plus-filled" size="80" color="#5678FE"></uni-icons>
  22. </router-link>
  23. </view>
  24. <page-foot :isShow="true" :showIndex="1"></page-foot>
  25. <uni-load-more :status="status" :icon-size="16" :content-text="contentText" />
  26. </view>
  27. </template>
  28. <script>
  29. import {
  30. getUnit,
  31. getUnitUser
  32. } from "@/common/api/commonApi.js";
  33. import uniLoadMore from '@/components/uni-load-more/uni-load-more.vue';
  34. import {
  35. GetRequisitionList
  36. } from "@/common/api/requisitionApi.js";
  37. export default {
  38. components: {
  39. uniLoadMore
  40. },
  41. data() {
  42. return {
  43. listData: [],
  44. last_id: '',
  45. reload: false,
  46. status: 'more',
  47. adpid: '',
  48. type:0,
  49. contentText: {
  50. contentdown: '上拉加载更多',
  51. contentrefresh: '加载中',
  52. contentnomore: '没有更多'
  53. }
  54. };
  55. },
  56. onLoad() {
  57. console.info("当前登录状态:" + this.$store.state.isLogin);
  58. //console.info(this);
  59. this.$util.persistLogin(this);
  60. this.adpid = this.$adpid;
  61. //this.getList();
  62. },
  63. onPullDownRefresh() {
  64. this.reload = true;
  65. this.last_id = '';
  66. this.getList();
  67. },
  68. onReachBottom() {
  69. this.status = 'more';
  70. this.getList();
  71. },
  72. created: function() {
  73. if(this.$util.getQuery("type")=="1")
  74. {
  75. this.type=1;
  76. uni.setNavigationBarTitle({
  77. title:'变更申请单'
  78. });
  79. }
  80. else{
  81. this.type=0;
  82. uni.setNavigationBarTitle({
  83. title:'签证申请单'
  84. });
  85. }
  86. this.getList();
  87. },
  88. methods: {
  89. getList() {
  90. let that = this;
  91. let projectCode=this.$util.getState(this,'projectCode');
  92. let type=this.$util.getQuery("type")-0;
  93. GetRequisitionList(projectCode,type).then((res) => {
  94. console.info(res);
  95. if(res=="-1"){
  96. uni.showToast({
  97. title:'项目编号或类型为空',
  98. duration:4000,
  99. icon:'none'
  100. });
  101. return;
  102. }
  103. res.forEach(function(item, index, array) {
  104. that.$set(that.listData, index, item);
  105. });
  106. console.info(that.listData);
  107. });
  108. },
  109. goDetail: function(id) {
  110. console.info('godetail');
  111. console.info(id);
  112. let type=this.$util.getQuery("type");
  113. uni.navigateTo({
  114. // requisitiondetail
  115. url: '../requisitiondetail/requisitiondetail?id=' + id
  116. });
  117. },
  118. }
  119. };
  120. </script>
  121. <style scoped>
  122. .uni-media-list-body {
  123. height: auto;
  124. justify-content: space-around;
  125. }
  126. .uni-media-list-text-top {
  127. height:35px;
  128. line-height: 35px;
  129. font-size: 15rpx;
  130. font-weight: 500;
  131. letter-spacing:1px;
  132. overflow: hidden;
  133. }
  134. .uni-media-list-text-body{
  135. flex-direction: row;
  136. height:50px;
  137. font-size: 13px;
  138. color: #8f8f94;
  139. letter-spacing:1px;
  140. }
  141. .uni-media-list-text-bottom {
  142. display: flex;
  143. justify-content: space-between;
  144. height:35px;
  145. line-height: 35px;
  146. font-size: 13px;
  147. color: #8f8f94;
  148. letter-spacing:1px;
  149. padding-bottom: 0;
  150. }
  151. </style>