query.vue 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154
  1. <template>
  2. <view class="query-wrap">
  3. <uni-easyinput prefixIcon="search" v-model="value" placeholder="请输入耗材名称" @input="searchData">
  4. </uni-easyinput>
  5. <view class="inner-item" v-for="(item,index) in dataList" :key="index">
  6. <view class="inventory-item">
  7. <view class="shuo-item-name">
  8. <view class="shuo-label-podnme">
  9. {{item.prodName}}
  10. </view>
  11. <!-- <view class="shuo-unit">
  12. {{item.unit}}
  13. </view> -->
  14. </view>
  15. </view>
  16. <view class="inventory-item">
  17. <view class="shuo-item">
  18. <view class="shuo-label">
  19. 规格:
  20. </view>
  21. <view class="shuo-cont">
  22. {{item.spec}}
  23. </view>
  24. </view>
  25. <view class="shuo-item">
  26. <view class="shuo-label">
  27. 型号:
  28. </view>
  29. <view class="shuo-cont">
  30. {{item.mol}}
  31. </view>
  32. </view>
  33. </view>
  34. <view class="inventory-item">
  35. <view class="shuo-item">
  36. <view class="shuo-label">
  37. 耗材类别:
  38. </view>
  39. <view class="shuo-cont-blue">
  40. <span v-if="item.mcsType == '0'"> 普通耗材 </span>
  41. <span v-if="item.mcsType == '1'"> 高值耗材 </span>
  42. <span v-if="item.mcsType == '2'"> 试剂 </span>
  43. <span v-if="item.mcsType == '3'"> 总务耗材 </span>
  44. </view>
  45. </view>
  46. <view class="shuo-item">
  47. <view class="shuo-label">
  48. 生产来源:
  49. </view>
  50. <view class="shuo-cont-blue">
  51. <span v-if="item.prodSouc == '1'" type="success"> 国产 </span>
  52. <span v-if="item.prodSouc == '2'" type="danger"> 进口 </span>
  53. </view>
  54. </view>
  55. </view>
  56. <view class="inventory-item">
  57. <view class="shuo-item-name">
  58. <view class="shuo-label">
  59. 生产企业:
  60. </view>
  61. <view class="shuo-cont">
  62. {{item.prodEntp}}
  63. </view>
  64. </view>
  65. </view>
  66. <view class="inventory-item">
  67. <view class="shuo-item">
  68. <view class="shuo-label">
  69. 所在仓库:
  70. </view>
  71. <view class="shuo-cont">
  72. {{houseSelectData.houseName}}
  73. </view>
  74. </view>
  75. </view>
  76. <view class="inventory-item">
  77. <view class="shuo-item">
  78. <view class="shuo-label">
  79. 现有库存:
  80. </view>
  81. <view class="shuo-cont-blue">
  82. {{item.invCnt}}
  83. </view>
  84. </view>
  85. </view>
  86. </view>
  87. </view>
  88. </template>
  89. <script>
  90. import {
  91. mapState,
  92. mapMutations,
  93. mapActions
  94. } from 'vuex';
  95. import {
  96. debounce
  97. } from 'lodash';
  98. export default {
  99. data() {
  100. return {
  101. value: '',
  102. queryData: [],
  103. dataList: [],
  104. }
  105. },
  106. computed: {
  107. ...mapState(['houseSelectData'])
  108. },
  109. async mounted() {
  110. await this.queryList({
  111. current: 1,
  112. size: 10
  113. })
  114. },
  115. methods: {
  116. queryList(data) {
  117. let that = this;
  118. this.$http('query.getListData', {
  119. ...data,
  120. stroomId: this.houseSelectData.houseId,
  121. }, '加载中', true).then((res) => {
  122. if (res.success == true) {
  123. that.dataList = res.data.records;
  124. }
  125. })
  126. },
  127. //搜索数据
  128. searchData: debounce(function(e) {
  129. this.queryList({
  130. mcsInfo: e,
  131. current: 1,
  132. size: 10
  133. })
  134. }, 500)
  135. }
  136. }
  137. </script>
  138. <style lang="scss">
  139. uni-page-body {
  140. width: 100%;
  141. height: 100%;
  142. }
  143. .query-wrap {
  144. width: 100%;
  145. height: 100%;
  146. padding: 20rpx;
  147. box-sizing: border-box;
  148. background-color: #F1F1F1;
  149. overflow-y: scroll;
  150. overflow-x: hidden;
  151. }
  152. </style>