GetVises.vue 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131
  1. <template>
  2. <view>
  3. <view>
  4. <uni-search-bar :radius="100" @confirm="search" @input="input" @cancel="cancel"></uni-search-bar>
  5. </view>
  6. <uni-list>
  7. <uni-list-item v-for="(item, index) in listData" :key="index" @click="goDetail(item.viseCode)" clickable >
  8. <view slot="body" class="slot-box">
  9. <view class="row">
  10. <view class="column-left">编号:</view>
  11. <view class="column-right section-title">{{item.viseId}}</view>
  12. </view>
  13. <view class="row">
  14. <view class="column-left">名称:</view>
  15. <view class="column-right">{{item.viseName}}</view>
  16. </view>
  17. <view class="row">
  18. <view class="column-left">日期:</view>
  19. <view class="column-right">{{item.viseDate}}</view>
  20. </view>
  21. <view class="row">
  22. <view class="column-left">所属部门:</view>
  23. <view class="column-right">{{item.unitFullName}}</view>
  24. </view>
  25. <view class="row">
  26. <view class="column-left">关联合同:</view>
  27. <view class="column-right">{{item.contractName}}</view>
  28. </view>
  29. <view class="row">
  30. <view class="column-left">状态:</view>
  31. <view class="column-right">{{item.stateName}}</view>
  32. </view>
  33. </view>
  34. </uni-list-item>
  35. </uni-list>
  36. <view style="bottom: 15px;right:10px;position: fixed;z-index: 50;">
  37. <router-link to="/pages/template/viseadd/viseadd" style="text-decoration: none;" title="待审签证添加">
  38. <uni-icons type="plus-filled" size="80" color="#5678FE"></uni-icons>
  39. </router-link>
  40. </view>
  41. <page-foot :isShow="true" :showIndex="0"></page-foot>
  42. <uni-load-more :status="status" :icon-size="16" :content-text="contentText" />
  43. </view>
  44. </template>
  45. <script>
  46. import {
  47. GetVises
  48. } from "@/common/api/viseApi.js";
  49. import uniLoadMore from '@/components/uni-load-more/uni-load-more.vue';
  50. export default {
  51. components: {
  52. uniLoadMore
  53. },
  54. data() {
  55. return {
  56. listData: [],
  57. searchvalue:'',
  58. last_id: '',
  59. reload: false,
  60. status: 'more',
  61. contentText: {
  62. contentdown: '上拉加载更多',
  63. contentrefresh: '加载中',
  64. contentnomore: '没有更多'
  65. }
  66. };
  67. },
  68. onLoad() {
  69. console.info("当前登录状态:" + this.$store.state.isLogin);
  70. //console.info(this);
  71. this.$util.persistLogin(this);
  72. },
  73. onPullDownRefresh() {
  74. this.reload = true;
  75. this.last_id = '';
  76. this.getList();
  77. },
  78. onReachBottom() {
  79. this.status = 'more';
  80. this.getList();
  81. },
  82. created: function() {
  83. this.getList();
  84. },
  85. methods: {
  86. getList() {
  87. let that = this;
  88. let projectcode = that.$util.getState(that,'projectCode');
  89. let search = this.searchvalue;
  90. GetVises(projectcode, search).then((res) => {
  91. console.info(res);
  92. that.listData=[];
  93. res.forEach(function(item, index, array) {
  94. that.$set(that.listData, index, item);
  95. });
  96. console.info(that.listData);
  97. });
  98. },
  99. goDetail: function(id) {
  100. console.info('待审签证godetail',id);
  101. uni.navigateTo({
  102. url: '/pages/template/getvise/getvise?id=' + id
  103. });
  104. },
  105. search(res) { //回车搜索
  106. this.searchvalue = res.value; //赋值
  107. this.getList(); //调用搜索方法
  108. },
  109. input(res) {
  110. this.searchVal = res.value
  111. },
  112. cancel(res) {
  113. console.info('点击取消,输入值为:' + res.value);
  114. }
  115. }
  116. };
  117. </script>
  118. <style scoped lang="scss" >
  119. .uni-list-item{
  120. border-bottom: $BgColorBlue;
  121. }
  122. </style>