GetSafeQualityCheckDTOs.vue 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150
  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 section-title">{{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" v-show="$util.getQuery('type')=='2'">
  22. <view class="column-left">检查类型:</view>
  23. <view class="column-right">{{item.inspectType}}</view>
  24. </view>
  25. <view class="row">
  26. <view class="column-left">状态:</view>
  27. <view class="column-right">{{item.statusName}}</view>
  28. </view>
  29. </view>
  30. </uni-list-item>
  31. </uni-list>
  32. <view style="bottom: 15px;right:10px;position: fixed;z-index: 50;">
  33. <router-link :to="'/pages/template/SafeQualityCheckAdd/SafeQualityCheckAdd?type='+$util.getQuery('type')" style="text-decoration: none;" :title="titleName+'添加'">
  34. <uni-icons type="plus-filled" size="80" color="#5678FE"></uni-icons>
  35. </router-link>
  36. </view>
  37. <uni-load-more :status="status" :icon-size="16" :content-text="contentText" />
  38. <page-foot :isShow="true" :showIndex="4"></page-foot>
  39. </view>
  40. </template>
  41. <script>
  42. import {
  43. GetSafeQualityCheckDTOs
  44. } from "@/common/api/SafeQualityCheckApi.js";
  45. import uniLoadMore from '@/components/uni-load-more/uni-load-more.vue';
  46. export default {
  47. components: {
  48. uniLoadMore
  49. },
  50. data() {
  51. return {
  52. listData: [],
  53. searchvalue: '',
  54. last_id: '',
  55. reload: false,
  56. status: 'more',
  57. titleName: '质量安全检查',
  58. contentText: {
  59. contentdown: '上拉加载更多',
  60. contentrefresh: '加载中',
  61. contentnomore: '没有更多'
  62. }
  63. };
  64. },
  65. onLoad() {
  66. console.info("当前登录状态:" + this.$store.state.isLogin);
  67. //console.info(this);
  68. this.$util.persistLogin(this);
  69. },
  70. onPullDownRefresh() {
  71. this.reload = true;
  72. this.last_id = '';
  73. this.getList();
  74. },
  75. onReachBottom() {
  76. this.status = 'more';
  77. this.getList();
  78. },
  79. created: function() {
  80. let type = this.$util.getQuery("type") - 0;
  81. if (type == 1) {
  82. this.titleName = '质量安全检查';
  83. uni.setNavigationBarTitle({
  84. title: '安全检查'
  85. });
  86. } else if (type == 2) {
  87. this.titleName = '材料检查';
  88. uni.setNavigationBarTitle({
  89. title: '材料检查'
  90. });
  91. } else {
  92. this.titleName = '质量安全检查';
  93. uni.setNavigationBarTitle({
  94. title: '质量检查'
  95. });
  96. }
  97. this.getList();
  98. },
  99. methods: {
  100. getList() {
  101. let that = this;
  102. let type = this.$util.getQuery("type") - 0;
  103. let search = this.searchvalue;
  104. console.info('projectcode',this.$util.getState(this,'projectCode'));
  105. GetSafeQualityCheckDTOs(type,this.$util.getState(this,'projectCode'), search).then((res) => {
  106. console.info(res);
  107. that.listData = [];
  108. res.forEach(function(item, index, array) {
  109. that.$set(that.listData, index, item);
  110. });
  111. console.info(that.listData);
  112. });
  113. },
  114. goDetail: function(id) {
  115. console.info('检查godetail', id);
  116. uni.navigateTo({
  117. url: '/pages/template/GetSafeQualityCheckDTO/GetSafeQualityCheckDTO?type=' + this.$util.getQuery("type") +
  118. '&id=' + id
  119. });
  120. },
  121. search(res) { //回车搜索
  122. this.searchvalue = res.value; //赋值
  123. this.getList(); //调用搜索方法
  124. },
  125. input(res) {
  126. this.searchVal = res.value
  127. },
  128. cancel(res) {
  129. console.info('点击取消,输入值为:' + res.value);
  130. },
  131. }
  132. };
  133. </script>
  134. <style scoped lang="scss">
  135. .uni-list-item{
  136. border-bottom: $BgColorBlue;
  137. }
  138. </style>