GetMaterialIns.vue 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183
  1. <template>
  2. <view>
  3. <uni-list>
  4. <uni-list-item v-for="(item, index) in listData" :key="index" @click="goDetail(item.materialInCode)" clickable >
  5. <view slot="body" class="slot-box">
  6. <view class="row">
  7. <view class="column-left">入库编号:</view>
  8. <view class="column-right">{{item.materialInCode}}</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.purUserName}}</view>
  21. </view>
  22. <view class="row">
  23. <view class="column-left">入库时间:</view>
  24. <view class="column-right">{{item.inDate}}</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. <view style="bottom: 15px;right:10px;position: fixed;z-index: 50;">
  34. <router-link to="/pages/template/MaterialInAdd/MaterialInAdd" style="text-decoration: none;" title="入库单添加">
  35. <uni-icons type="plus-filled" size="80" color="#5678FE"></uni-icons>
  36. </router-link>
  37. </view>
  38. <uni-load-more :status="status" :icon-size="16" :content-text="contentText" />
  39. <!-- 底部导航开始 /////////////////////////////////////////////////////////////-->
  40. <!-- is_lhp判断是否为刘海屏在main.js里,好像uniapp有一个css变量获取刘海屏的安全区域 -->
  41. <view class="tabBar" :style="{height:is_lhp?'140rpx':'98rpx'}">
  42. <!-- 导航的中间圆圈 -->
  43. <view class="border_box" :style="{paddingBottom:is_lhp?'40rpx':''}">
  44. <view class="tabBar_miden_border"></view>
  45. </view>
  46. <view class="tabBar_list" :style="{paddingBottom:is_lhp?'40rpx':''}">
  47. <view v-for="(item) in tab_nav_list" :key="item.id" :class="{'tabBar_item':item.id!=2,'tabBar_item2':item.id==2}"
  48. @tap="cut_index(item.id)">
  49. <image v-if="show_index == item.id" :src="`/static/tabBar/${item.id+1}${item.id+1}.png`"></image>
  50. <image v-else :src="`/static/tabBar/${item.id+1}.png`"></image>
  51. <view :class="{'tabBar_name':true,'nav_active':show_index == item.id}">{{item.name}}</view>
  52. </view>
  53. </view>
  54. </view>
  55. <!-- 底部导航结束 /////////////////////////////////////////////////////////////-->
  56. </view>
  57. </template>
  58. <script>
  59. import {
  60. getUnit,
  61. getUnitUser
  62. } from "@/common/api/commonApi.js";
  63. import uniLoadMore from '@/components/uni-load-more/uni-load-more.vue';
  64. import {
  65. GetMaterialIns
  66. } from "@/common/api/requisitionApi.js";
  67. export default {
  68. components: {
  69. uniLoadMore
  70. },
  71. data() {
  72. return {
  73. listData: [],
  74. last_id: '',
  75. reload: false,
  76. status: 'more',
  77. /* 底部导航 */
  78. show_index: 2, //控制显示那个组件
  79. tab_nav_list: [{
  80. 'id': 0,
  81. 'name': '首页'
  82. }, {
  83. 'id': 1,
  84. 'name': '签证申请'
  85. }, {
  86. 'id': 2,
  87. 'name': '入库单'
  88. }, {
  89. 'id': 3,
  90. 'name': '领料单'
  91. }, {
  92. 'id': 4,
  93. 'name': '质量检查'
  94. }], //菜单列表
  95. is_lhp: false,
  96. contentText: {
  97. contentdown: '上拉加载更多',
  98. contentrefresh: '加载中',
  99. contentnomore: '没有更多'
  100. }
  101. };
  102. },
  103. onLoad() {
  104. console.info("当前登录状态:" + this.$store.state.isLogin);
  105. //console.info(this);
  106. this.$util.persistLogin(this);
  107. },
  108. onPullDownRefresh() {
  109. this.reload = true;
  110. this.last_id = '';
  111. this.getList();
  112. },
  113. onReachBottom() {
  114. this.status = 'more';
  115. this.getList();
  116. },
  117. created: function() {
  118. this.getList();
  119. },
  120. methods: {
  121. getList() {
  122. let that = this;
  123. let projectcode = that.$store.state.projectCode;
  124. let usercode = that.$store.state.user.userCode;
  125. let search = '';
  126. //let where='1=1 and projectcode=\''+this.$store.state.projectCode+'\'';
  127. GetMaterialIns(projectcode, usercode, search).then((res) => {
  128. console.info(res);
  129. res.forEach(function(item, index, array) {
  130. that.$set(that.listData, index, item);
  131. });
  132. console.info(that.listData);
  133. });
  134. },
  135. goDetail: function(id) {
  136. console.info('入库单 godetail',id);
  137. uni.navigateTo({
  138. url: '/pages/template/GetMaterialIn/GetMaterialIn?id=' + id
  139. });
  140. },
  141. // 切换组件
  142. cut_index(type) {
  143. console.log('----------------------------------', type)
  144. let _this = this
  145. _this.show_index = type
  146. if (_this.show_index == 0) {
  147. uni.navigateTo({
  148. url: '/pages/index/index'
  149. })
  150. } else if (_this.show_index == 1) {
  151. uni.navigateTo({
  152. url: '/pages/template/requisitionlist/requisitionlist'
  153. })
  154. } else if (_this.show_index == 2) {
  155. uni.navigateTo({
  156. url: '/pages/template/GetMaterialIns/GetMaterialIns'
  157. })
  158. } else if (_this.show_index == 3) {
  159. uni.navigateTo({
  160. url: '/pages/template/GetMaterialOuts/GetMaterialOuts'
  161. })
  162. }else if (_this.show_index == 4) {
  163. uni.navigateTo({
  164. url: '/pages/template/GetSafeQualityCheckDTOs/GetSafeQualityCheckDTOs?type=0'
  165. })
  166. }
  167. }
  168. }
  169. };
  170. </script>
  171. <style scoped>
  172. </style>