GetSafeQualityCheckDTOs.vue 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130
  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.checkCode)" clickable >
  8. <view slot="body" class="slot-box">
  9. <view class="row">
  10. <view class="column-left">编号:</view>
  11. <view class="column-right">{{item.checkCode}}</view>
  12. </view>
  13. <view class="row">
  14. <view class="column-left">工程名称:</view>
  15. <view class="column-right">{{item.projectName}}</view>
  16. </view>
  17. <view class="row">
  18. <view class="column-left">日期:</view>
  19. <view class="column-right">{{item.checkDateStr}}</view>
  20. </view>
  21. <view class="row">
  22. <view class="column-left">状态:</view>
  23. <view class="column-right">{{item.statusName}}</view>
  24. </view>
  25. </view>
  26. </uni-list-item>
  27. </uni-list>
  28. <view style="bottom: 15px;right:10px;position: fixed;z-index: 50;">
  29. <router-link to="/pages/template/viseadd/viseadd" style="text-decoration: none;" title="质量检查添加">
  30. <uni-icons type="plus-filled" size="80" color="#5678FE"></uni-icons>
  31. </router-link>
  32. </view>
  33. <uni-load-more :status="status" :icon-size="16" :content-text="contentText" />
  34. </view>
  35. </template>
  36. <script>
  37. import {
  38. GetSafeQualityCheckDTOs
  39. } from "@/common/api/SafeQualityCheckApi.js";
  40. import uniLoadMore from '@/components/uni-load-more/uni-load-more.vue';
  41. export default {
  42. components: {
  43. uniLoadMore
  44. },
  45. data() {
  46. return {
  47. listData: [],
  48. searchvalue:'',
  49. last_id: '',
  50. reload: false,
  51. status: 'more',
  52. contentText: {
  53. contentdown: '上拉加载更多',
  54. contentrefresh: '加载中',
  55. contentnomore: '没有更多'
  56. }
  57. };
  58. },
  59. onLoad() {
  60. console.info("当前登录状态:" + this.$store.state.isLogin);
  61. //console.info(this);
  62. this.$util.persistLogin(this);
  63. let type=this.$util.getQuery("type")-0;
  64. if(type==1){
  65. uni.setNavigationBarTitle({
  66. title:'安全检查'
  67. });
  68. }
  69. else{
  70. uni.setNavigationBarTitle({
  71. title:'质量检查'
  72. });
  73. }
  74. },
  75. onPullDownRefresh() {
  76. this.reload = true;
  77. this.last_id = '';
  78. this.getList();
  79. },
  80. onReachBottom() {
  81. this.status = 'more';
  82. this.getList();
  83. },
  84. created: function() {
  85. this.getList();
  86. },
  87. methods: {
  88. getList() {
  89. let that = this;
  90. let type = this.$util.getQuery("type")-0;
  91. let search = this.searchvalue;
  92. GetSafeQualityCheckDTOs(type, search).then((res) => {
  93. console.info(res);
  94. that.listData=[];
  95. res.forEach(function(item, index, array) {
  96. that.$set(that.listData, index, item);
  97. });
  98. console.info(that.listData);
  99. });
  100. },
  101. goDetail: function(id) {
  102. console.info('检查godetail',id);
  103. uni.navigateTo({
  104. url: '/pages/template/GetSafeQualityCheckDTO/GetSafeQualityCheckDTO?type='+this.$util.getQuery("type")+'&id=' + id
  105. });
  106. },
  107. search(res) { //回车搜索
  108. this.searchvalue = res.value; //赋值
  109. this.getList(); //调用搜索方法
  110. },
  111. input(res) {
  112. this.searchVal = res.value
  113. },
  114. cancel(res) {
  115. console.info('点击取消,输入值为:' + res.value);
  116. }
  117. }
  118. };
  119. </script>
  120. <style scoped>
  121. </style>