GetSafeQualityCheckDTOs.vue 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201
  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" 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. <!-- 底部导航开始 /////////////////////////////////////////////////////////////-->
  35. <!-- is_lhp判断是否为刘海屏在main.js里,好像uniapp有一个css变量获取刘海屏的安全区域 -->
  36. <view class="tabBar" :style="{height:is_lhp?'140rpx':'98rpx'}">
  37. <!-- 导航的中间圆圈 -->
  38. <view class="border_box" :style="{paddingBottom:is_lhp?'40rpx':''}">
  39. <view class="tabBar_miden_border"></view>
  40. </view>
  41. <view class="tabBar_list" :style="{paddingBottom:is_lhp?'40rpx':''}">
  42. <view v-for="(item) in tab_nav_list" :key="item.id" :class="{'tabBar_item':item.id!=2,'tabBar_item2':item.id==2}"
  43. @tap="cut_index(item.id)">
  44. <image v-if="show_index == item.id" :src="`/static/tabBar/${item.id+1}${item.id+1}.png`"></image>
  45. <image v-else :src="`/static/tabBar/${item.id+1}.png`"></image>
  46. <view :class="{'tabBar_name':true,'nav_active':show_index == item.id}">{{item.name}}</view>
  47. </view>
  48. </view>
  49. </view>
  50. <!-- 底部导航结束 /////////////////////////////////////////////////////////////-->
  51. </view>
  52. </template>
  53. <script>
  54. import {
  55. GetSafeQualityCheckDTOs
  56. } from "@/common/api/SafeQualityCheckApi.js";
  57. import uniLoadMore from '@/components/uni-load-more/uni-load-more.vue';
  58. export default {
  59. components: {
  60. uniLoadMore
  61. },
  62. data() {
  63. return {
  64. listData: [],
  65. searchvalue: '',
  66. last_id: '',
  67. reload: false,
  68. status: 'more',
  69. /* 底部导航 */
  70. show_index: 4, //控制显示那个组件
  71. tab_nav_list: [{
  72. 'id': 0,
  73. 'name': '首页'
  74. }, {
  75. 'id': 1,
  76. 'name': '签证申请'
  77. }, {
  78. 'id': 2,
  79. 'name': '入库单'
  80. }, {
  81. 'id': 3,
  82. 'name': '领料单'
  83. }, {
  84. 'id': 4,
  85. 'name': '质量检查'
  86. }], //菜单列表
  87. is_lhp: false,
  88. contentText: {
  89. contentdown: '上拉加载更多',
  90. contentrefresh: '加载中',
  91. contentnomore: '没有更多'
  92. }
  93. };
  94. },
  95. onLoad() {
  96. console.info("当前登录状态:" + this.$store.state.isLogin);
  97. //console.info(this);
  98. this.$util.persistLogin(this);
  99. let type = this.$util.getQuery("type") - 0;
  100. if (type == 1) {
  101. uni.setNavigationBarTitle({
  102. title: '安全检查'
  103. });
  104. } else {
  105. uni.setNavigationBarTitle({
  106. title: '质量检查'
  107. });
  108. }
  109. },
  110. onPullDownRefresh() {
  111. this.reload = true;
  112. this.last_id = '';
  113. this.getList();
  114. },
  115. onReachBottom() {
  116. this.status = 'more';
  117. this.getList();
  118. },
  119. created: function() {
  120. this.getList();
  121. },
  122. methods: {
  123. getList() {
  124. let that = this;
  125. let type = this.$util.getQuery("type") - 0;
  126. let search = this.searchvalue;
  127. GetSafeQualityCheckDTOs(type, search).then((res) => {
  128. console.info(res);
  129. that.listData = [];
  130. res.forEach(function(item, index, array) {
  131. that.$set(that.listData, index, item);
  132. });
  133. console.info(that.listData);
  134. });
  135. },
  136. goDetail: function(id) {
  137. console.info('检查godetail', id);
  138. uni.navigateTo({
  139. url: '/pages/template/GetSafeQualityCheckDTO/GetSafeQualityCheckDTO?type=' + this.$util.getQuery("type") +
  140. '&id=' + id
  141. });
  142. },
  143. search(res) { //回车搜索
  144. this.searchvalue = res.value; //赋值
  145. this.getList(); //调用搜索方法
  146. },
  147. input(res) {
  148. this.searchVal = res.value
  149. },
  150. cancel(res) {
  151. console.info('点击取消,输入值为:' + res.value);
  152. },
  153. // 切换组件
  154. cut_index(type) {
  155. console.log('----------------------------------', type)
  156. let _this = this
  157. _this.show_index = type
  158. if (_this.show_index == 0) {
  159. uni.navigateTo({
  160. url: '/pages/index/index'
  161. })
  162. } else if (_this.show_index == 1) {
  163. uni.navigateTo({
  164. url: '/pages/template/requisitionlist/requisitionlist'
  165. })
  166. } else if (_this.show_index == 2) {
  167. uni.navigateTo({
  168. url: '/pages/template/GetMaterialIns/GetMaterialIns'
  169. })
  170. } else if (_this.show_index == 3) {
  171. uni.navigateTo({
  172. url: '/pages/template/GetMaterialOuts/GetMaterialOuts'
  173. })
  174. }else if (_this.show_index == 4) {
  175. uni.navigateTo({
  176. url: '/pages/template/GetSafeQualityCheckDTOs/GetSafeQualityCheckDTOs?type=0'
  177. })
  178. }
  179. }
  180. }
  181. };
  182. </script>
  183. <style scoped>
  184. </style>