GetMaterialOuts.vue 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179
  1. <template>
  2. <view>
  3. <uni-list>
  4. <uni-list-item v-for="(item, index) in listData" :key="index" @click="goDetail(item.materialOutCode)" clickable >
  5. <view slot="body" class="slot-box">
  6. <view class="row">
  7. <view class="column-left">领料编号:</view>
  8. <view class="column-right">{{item.materialOutCode}}</view>
  9. </view>
  10. <view class="row">
  11. <view class="column-left">状态:</view>
  12. <view class="column-right">{{item.statusName}}</view>
  13. </view>
  14. <view class="row">
  15. <view class="column-left">领料类型:</view>
  16. <view class="column-right">{{item.groupName}}</view>
  17. </view>
  18. <view class="row">
  19. <view class="column-left">调拨人:</view>
  20. <view class="column-right">{{item.outPersonName}}</view>
  21. </view>
  22. <view class="row">
  23. <view class="column-left">领料日期:</view>
  24. <view class="column-right">{{item.outDate}}</view>
  25. </view>
  26. <view class="row">
  27. <view class="column-left">工程合同:</view>
  28. <view class="column-right">{{item.contractName}}</view>
  29. </view>
  30. </view>
  31. </uni-list-item>
  32. </uni-list>
  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. getUnit,
  56. getUnitUser
  57. } from "@/common/api/commonApi.js";
  58. import uniLoadMore from '@/components/uni-load-more/uni-load-more.vue';
  59. import {
  60. GetMaterialOuts
  61. } from "@/common/api/MaterialInOut.js";
  62. export default {
  63. components: {
  64. uniLoadMore
  65. },
  66. data() {
  67. return {
  68. listData: [],
  69. last_id: '',
  70. reload: false,
  71. status: 'more',
  72. /* 底部导航 */
  73. show_index: 3, //控制显示那个组件
  74. tab_nav_list: [{
  75. 'id': 0,
  76. 'name': '首页'
  77. }, {
  78. 'id': 1,
  79. 'name': '签证申请'
  80. }, {
  81. 'id': 2,
  82. 'name': '入库单'
  83. }, {
  84. 'id': 3,
  85. 'name': '领料单'
  86. }, {
  87. 'id': 4,
  88. 'name': '质量检查'
  89. }], //菜单列表
  90. is_lhp: false,
  91. contentText: {
  92. contentdown: '上拉加载更多',
  93. contentrefresh: '加载中',
  94. contentnomore: '没有更多'
  95. }
  96. };
  97. },
  98. onLoad() {
  99. console.info("当前登录状态:" + this.$store.state.isLogin);
  100. //console.info(this);
  101. this.$util.persistLogin(this);
  102. },
  103. onPullDownRefresh() {
  104. this.reload = true;
  105. this.last_id = '';
  106. this.getList();
  107. },
  108. onReachBottom() {
  109. this.status = 'more';
  110. this.getList();
  111. },
  112. created: function() {
  113. this.getList();
  114. },
  115. methods: {
  116. getList() {
  117. let that = this;
  118. let projectcode = that.$util.getState(that,'projectCode');
  119. let usercode = that.$util.getState(that,'userCode');
  120. let search = '';
  121. GetMaterialOuts(projectcode, search).then((res) => {
  122. console.info(res);
  123. res.forEach(function(item, index, array) {
  124. that.$set(that.listData, index, item);
  125. });
  126. console.info(that.listData);
  127. });
  128. },
  129. goDetail: function(id) {
  130. console.info('领料单 godetail',id);
  131. uni.navigateTo({
  132. url: '/pages/template/GetMaterialOutDetail/GetMaterialOutDetail?id=' + id
  133. });
  134. },
  135. // 切换组件
  136. cut_index(type) {
  137. console.log('----------------------------------', type)
  138. let _this = this
  139. _this.show_index = type
  140. if (_this.show_index == 0) {
  141. uni.navigateTo({
  142. url: '/pages/index/index'
  143. })
  144. } else if (_this.show_index == 1) {
  145. uni.navigateTo({
  146. url: '/pages/template/requisitionlist/requisitionlist'
  147. })
  148. } else if (_this.show_index == 2) {
  149. uni.navigateTo({
  150. url: '/pages/template/GetMaterialIns/GetMaterialIns'
  151. })
  152. } else if (_this.show_index == 3) {
  153. uni.navigateTo({
  154. url: '/pages/template/GetMaterialOuts/GetMaterialOuts'
  155. })
  156. }else if (_this.show_index == 4) {
  157. uni.navigateTo({
  158. url: '/pages/template/GetSafeQualityCheckDTOs/GetSafeQualityCheckDTOs?type=0'
  159. })
  160. }
  161. }
  162. }
  163. };
  164. </script>
  165. <style scoped>
  166. </style>