GetSafeQualityCheckDTOs.vue 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143
  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/SafeQualityCheckAdd/SafeQualityCheckAdd?type='+$util.getQuery('type')" style="text-decoration: none;" :title="titleName+'添加'">
  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. <page-foot :isShow="true" :showIndex="4"></page-foot>
  35. </view>
  36. </template>
  37. <script>
  38. import {
  39. GetSafeQualityCheckDTOs
  40. } from "@/common/api/SafeQualityCheckApi.js";
  41. import uniLoadMore from '@/components/uni-load-more/uni-load-more.vue';
  42. export default {
  43. components: {
  44. uniLoadMore
  45. },
  46. data() {
  47. return {
  48. listData: [],
  49. searchvalue: '',
  50. last_id: '',
  51. reload: false,
  52. status: 'more',
  53. titleName: '质量安全检查',
  54. contentText: {
  55. contentdown: '上拉加载更多',
  56. contentrefresh: '加载中',
  57. contentnomore: '没有更多'
  58. }
  59. };
  60. },
  61. onLoad() {
  62. console.info("当前登录状态:" + this.$store.state.isLogin);
  63. //console.info(this);
  64. this.$util.persistLogin(this);
  65. },
  66. onPullDownRefresh() {
  67. this.reload = true;
  68. this.last_id = '';
  69. this.getList();
  70. },
  71. onReachBottom() {
  72. this.status = 'more';
  73. this.getList();
  74. },
  75. created: function() {
  76. let type = this.$util.getQuery("type") - 0;
  77. if (type == 1) {
  78. this.titleName = '质量安全检查';
  79. uni.setNavigationBarTitle({
  80. title: '安全检查'
  81. });
  82. } else if (type == 2) {
  83. this.titleName = '材料检查';
  84. uni.setNavigationBarTitle({
  85. title: '材料检查'
  86. });
  87. } else {
  88. this.titleName = '质量安全检查';
  89. uni.setNavigationBarTitle({
  90. title: '质量检查'
  91. });
  92. }
  93. this.getList();
  94. },
  95. methods: {
  96. getList() {
  97. let that = this;
  98. let type = this.$util.getQuery("type") - 0;
  99. let search = this.searchvalue;
  100. GetSafeQualityCheckDTOs(type, search).then((res) => {
  101. console.info(res);
  102. that.listData = [];
  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', id);
  111. uni.navigateTo({
  112. url: '/pages/template/GetSafeQualityCheckDTO/GetSafeQualityCheckDTO?type=' + this.$util.getQuery("type") +
  113. '&id=' + id
  114. });
  115. },
  116. search(res) { //回车搜索
  117. this.searchvalue = res.value; //赋值
  118. this.getList(); //调用搜索方法
  119. },
  120. input(res) {
  121. this.searchVal = res.value
  122. },
  123. cancel(res) {
  124. console.info('点击取消,输入值为:' + res.value);
  125. },
  126. }
  127. };
  128. </script>
  129. <style scoped>
  130. </style>