GetVises.vue 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128
  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.materialInCode)" clickable >
  8. <view slot="body" class="slot-box">
  9. <view class="row">
  10. <view class="column-left">编号:</view>
  11. <view class="column-right">{{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/MaterialInAdd/MaterialInAdd" style="text-decoration: none;" title="入库单添加">
  38. <uni-icons type="plus-filled" size="80" color="#5678FE"></uni-icons>
  39. </router-link>
  40. </view>
  41. <uni-load-more :status="status" :icon-size="16" :content-text="contentText" />
  42. </view>
  43. </template>
  44. <script>
  45. import {
  46. GetVises
  47. } from "@/common/api/viseApi.js";
  48. import uniLoadMore from '@/components/uni-load-more/uni-load-more.vue';
  49. export default {
  50. components: {
  51. uniLoadMore
  52. },
  53. data() {
  54. return {
  55. listData: [],
  56. searchvalue:'',
  57. last_id: '',
  58. reload: false,
  59. status: 'more',
  60. contentText: {
  61. contentdown: '上拉加载更多',
  62. contentrefresh: '加载中',
  63. contentnomore: '没有更多'
  64. }
  65. };
  66. },
  67. onLoad() {
  68. console.info("当前登录状态:" + this.$store.state.isLogin);
  69. //console.info(this);
  70. this.$util.persistLogin(this);
  71. },
  72. onPullDownRefresh() {
  73. this.reload = true;
  74. this.last_id = '';
  75. this.getList();
  76. },
  77. onReachBottom() {
  78. this.status = 'more';
  79. this.getList();
  80. },
  81. created: function() {
  82. this.getList();
  83. },
  84. methods: {
  85. getList() {
  86. let that = this;
  87. let projectcode = that.$util.getState(that,'projectCode');
  88. let search = this.searchvalue;
  89. GetVises(projectcode, search).then((res) => {
  90. console.info(res);
  91. that.listData=[];
  92. res.forEach(function(item, index, array) {
  93. that.$set(that.listData, index, item);
  94. });
  95. console.info(that.listData);
  96. });
  97. },
  98. goDetail: function(id) {
  99. console.info('待审签证godetail',id);
  100. uni.navigateTo({
  101. url: '/pages/template/GetVise/GetVise?id=' + id
  102. });
  103. },
  104. search(res) { //回车搜索
  105. this.searchvalue = res.value; //赋值
  106. this.getList(); //调用搜索方法
  107. },
  108. input(res) {
  109. this.searchVal = res.value
  110. },
  111. cancel(res) {
  112. console.info('点击取消,输入值为:' + res.value);
  113. }
  114. }
  115. };
  116. </script>
  117. <style scoped>
  118. </style>