requisitionlist.vue 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151
  1. <template>
  2. <view>
  3. <uni-list>
  4. <uni-list-item v-for="(item, index) in listData" :key="index" @click="goDetail(item.requisitionCode)" clickable>
  5. <view slot="body" class="slot-box">
  6. <view class="row">
  7. <view class="column-left">申请单编号:</view>
  8. <view class="column-right section-title">{{item.requisitionNumber}}</view>
  9. </view>
  10. <view class="row">
  11. <view class="column-left">申请单名称:</view>
  12. <view class="column-right">{{item.requisitionName}}</view>
  13. </view>
  14. <view class="row">
  15. <view class="column-left">类型:</view>
  16. <view class="column-right">{{item.changeType}}</view>
  17. </view>
  18. <view class="row">
  19. <view class="column-left">申请人:</view>
  20. <view class="column-right">{{item.personName}}</view>
  21. </view>
  22. <view class="row" >
  23. <view class="column-left">经办部门:</view>
  24. <view class="column-right">{{item.unitName}}</view>
  25. </view>
  26. <view class="row" >
  27. <view class="column-left">申请日期:</view>
  28. <view class="column-right">{{item.requisitionDate}}</view>
  29. </view>
  30. <view class="row">
  31. <view class="column-left">当前状态:</view>
  32. <view class="column-right">{{item.stateName}}</view>
  33. </view>
  34. </view>
  35. </uni-list-item>
  36. </uni-list>
  37. <view style="bottom: 15px;right:10px;position: fixed;z-index: 50;">
  38. <router-link :to="'/pages/template/requisitionadd/requisitionadd?type='+type" style="text-decoration: none;" title="签证申请添加">
  39. <uni-icons type="plus-filled" size="80" color="#5678FE"></uni-icons>
  40. </router-link>
  41. </view>
  42. <page-foot :isShow="true" :showIndex="1"></page-foot>
  43. <uni-load-more :status="status" :icon-size="16" :content-text="contentText" />
  44. </view>
  45. </template>
  46. <script>
  47. import {
  48. getUnit,
  49. getUnitUser
  50. } from "@/common/api/commonApi.js";
  51. import uniLoadMore from '@/components/uni-load-more/uni-load-more.vue';
  52. import {
  53. GetRequisitionList
  54. } from "@/common/api/requisitionApi.js";
  55. export default {
  56. components: {
  57. uniLoadMore
  58. },
  59. data() {
  60. return {
  61. listData: [],
  62. last_id: '',
  63. reload: false,
  64. status: 'more',
  65. adpid: '',
  66. type:0,
  67. contentText: {
  68. contentdown: '上拉加载更多',
  69. contentrefresh: '加载中',
  70. contentnomore: '没有更多'
  71. }
  72. };
  73. },
  74. onLoad() {
  75. console.info("当前登录状态:" + this.$store.state.isLogin);
  76. //console.info(this);
  77. this.$util.persistLogin(this);
  78. this.adpid = this.$adpid;
  79. //this.getList();
  80. },
  81. onPullDownRefresh() {
  82. this.reload = true;
  83. this.last_id = '';
  84. this.getList();
  85. },
  86. onReachBottom() {
  87. this.status = 'more';
  88. this.getList();
  89. },
  90. created: function() {
  91. if(this.$util.getQuery("type")=="1")
  92. {
  93. this.type=1;
  94. uni.setNavigationBarTitle({
  95. title:'变更申请单'
  96. });
  97. }
  98. else{
  99. this.type=0;
  100. uni.setNavigationBarTitle({
  101. title:'签证申请单'
  102. });
  103. }
  104. this.getList();
  105. },
  106. methods: {
  107. getList() {
  108. let that = this;
  109. let projectCode=this.$util.getState(this,'projectCode');
  110. let type=this.$util.getQuery("type")-0;
  111. GetRequisitionList(projectCode,type).then((res) => {
  112. console.info(res);
  113. if(res=="-1"){
  114. uni.showToast({
  115. title:'项目编号或类型为空',
  116. duration:4000,
  117. icon:'none'
  118. });
  119. return;
  120. }
  121. res.forEach(function(item, index, array) {
  122. that.$set(that.listData, index, item);
  123. });
  124. console.info(that.listData);
  125. });
  126. },
  127. goDetail: function(id) {
  128. console.info('godetail');
  129. console.info(id);
  130. let type=this.$util.getQuery("type");
  131. uni.navigateTo({
  132. // requisitiondetail
  133. url: '../requisitiondetail/requisitiondetail?id=' + id
  134. });
  135. },
  136. }
  137. };
  138. </script>
  139. <style scoped lang="scss">
  140. .uni-list-item{
  141. border-bottom: $BgColorBlue;
  142. }
  143. </style>