grounding.vue 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208
  1. <template>
  2. <view class="ground-wrap">
  3. <qs-scanlistener @scan="scan"></qs-scanlistener>
  4. <uni-easyinput prefixIcon="search" :value="value" placeholder="请输入或扫描入库单号" @iconClick="iconClick" :focus="true"
  5. @input="input" @blur="blur" @confirm="confirm">
  6. </uni-easyinput>
  7. <z-paging ref="paging" @query="queryList" v-model="dataList" :use-page-scroll="true">
  8. <view class="list-item" v-for="(item,index) in dataList" :key="index" @click="itemDetails(item)">
  9. <view class="list-data">
  10. <text class="text-label">单据编号:</text>
  11. <text class="text-cont">{{item.id_instock}}</text>
  12. </view>
  13. <view class="list-data">
  14. <text class="text-label">供应商:</text>
  15. <text class="text-cont">{{item.lykf}}</text>
  16. </view>
  17. <view class="list-data">
  18. <text class="text-label">商品数量:</text>
  19. <text class="text-cont">{{item.qty}}</text>
  20. </view>
  21. <view class="list-data">
  22. <text class="text-label">单据时间:</text>
  23. <text class="text-cont">{{item.rq}}</text>
  24. </view>
  25. <!-- <view class="list-data">
  26. <text class="text-label">到货时间:</text>
  27. <text class="text-cont">{{item.daohuoTime}}</text>
  28. </view> -->
  29. <view class="status-text">{{item.flag}}</view>
  30. <!-- <view class="time-text">1小时前</view> -->
  31. </view>
  32. </z-paging>
  33. </view>
  34. </template>
  35. <script>
  36. import {
  37. listData
  38. } from "../home/list.js";
  39. import {
  40. mapState,
  41. mapMutations,
  42. mapActions
  43. } from 'vuex';
  44. import {
  45. debounced
  46. } from '@/utils/debounced.js';
  47. import ZPMixin from '@/uni_modules/z-paging/components/z-paging/js/z-paging-mixin.js'
  48. export default {
  49. mixins: [ZPMixin],
  50. data() {
  51. return {
  52. title: 'Hello',
  53. value1: "",
  54. value: "",
  55. dataList: [],
  56. inputVal: "",
  57. codeVal: "",
  58. confirmVal: "",
  59. changeVal: "",
  60. listData: listData
  61. }
  62. },
  63. onLoad() {
  64. },
  65. computed: {
  66. ...mapState(['groundData'])
  67. },
  68. onShow() {
  69. uni.$once('update', function(data) {
  70. // uni.redirectTo({
  71. // url: '/pages/grounding/grounding' //写你的路径
  72. // });
  73. })
  74. },
  75. mounted() {
  76. },
  77. methods: {
  78. ...mapActions(['getGroundData']),
  79. ...mapMutations(['setMentItemData']),
  80. queryList(pageNo, pageSize) {
  81. this.getGroundData({
  82. type: ""
  83. });
  84. },
  85. //跳转上架详情
  86. itemDetails(item) {
  87. this.setMentItemData([item]);
  88. uni.navigateTo({
  89. url: '/pages/groundetials/groundetials',
  90. success: function(res) {}
  91. });
  92. },
  93. input(e) {
  94. this.$nextTick(() => {
  95. this.value = e;
  96. this.inputVal = e;
  97. })
  98. this.getGroundData({
  99. id_instock: e,
  100. type: ""
  101. })
  102. },
  103. iconClick(e) {
  104. console.log(e, '点击搜索拿到的数据');
  105. },
  106. blur(e) {
  107. this.$nextTick(() => {
  108. this.value = e.target.value;
  109. })
  110. },
  111. confirm(e) {
  112. this.$nextTick(() => {
  113. this.value = e;
  114. this.confirmVal = e;
  115. })
  116. },
  117. scan(code) {
  118. this.codeVal = code;
  119. this.$nextTick(() => {
  120. this.value = code;
  121. this.$debounced(this.getGroundData({
  122. id_instock: code,
  123. type: ""
  124. }), 2000)
  125. })
  126. }
  127. },
  128. watch: {
  129. groundData(newData, flodData) {
  130. this.$refs.paging.complete(newData);
  131. }
  132. }
  133. }
  134. </script>
  135. <style lang="scss" scoped>
  136. .ground-wrap {
  137. width: 100%;
  138. height: 100%;
  139. padding: 20rpx;
  140. box-sizing: border-box;
  141. background-color: #F1F1F1;
  142. .list-item {
  143. width: 100%;
  144. height: 260rpx;
  145. margin-top: 10rpx;
  146. border: 2rpx solid #BDBDBD;
  147. padding: 20rpx 20rpx 20rpx 50rpx;
  148. box-sizing: border-box;
  149. position: relative;
  150. background-color: #fff;
  151. border-radius: 20rpx;
  152. .list-data {
  153. width: 70%;
  154. height: 40rpx;
  155. line-height: 40rpx;
  156. margin-top: 10rpx;
  157. .text-label {
  158. color: rgba(16, 16, 16, 1);
  159. font-size: 28rpx;
  160. font-family: PingFangSC-medium;
  161. }
  162. .text-cont {
  163. color: rgba(16, 16, 16, 1);
  164. font-size: 28rpx;
  165. font-family: PingFangSC-regular;
  166. }
  167. }
  168. .status-text {
  169. width: 100rpx;
  170. height: 40rpx;
  171. position: absolute;
  172. right: 20rpx;
  173. top: 30rpx;
  174. font-family: PingFangSC-semiBold;
  175. font-size: 28rpx;
  176. color: rgba(71, 73, 161, 0.86);
  177. }
  178. .time-text {
  179. width: 100rpx;
  180. height: 40rpx;
  181. position: absolute;
  182. right: 20rpx;
  183. bottom: 25rpx;
  184. font-family: PingFangSC-semiBold;
  185. font-size: 28rpx;
  186. color: rgba(71, 73, 161, 0.86);
  187. }
  188. }
  189. }
  190. uni-page-body {
  191. width: 100%;
  192. height: 100%;
  193. }
  194. </style>