BuyLogs.vue 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236
  1. <template>
  2. <view>
  3. <view class="keyword-view clearfix">
  4. <u-search disabled @custom="clearValue" @search="searchConfirm()" action-text="重置" :clearabled="true"
  5. placeholder="请选择客户" v-model="customer_name" @click="goPage('/pagesT/customer/selCustomer')"></u-search>
  6. </view>
  7. <view class="logs-ul">
  8. <view class="logs-li clearfix" v-for="(item, index) in order_list" :key="index">
  9. <view class="clearfix logs-goods">
  10. <view class="float_left goods-img">
  11. <image :src="item.goodsImages" mode="aspectFill"></image>
  12. </view>
  13. <view class="float_left goods-info">
  14. <view class="goods-name ellipsis">{{ item.goodsName }}</view>
  15. <view class="date-time">
  16. {{ item.unitName }};
  17. <text v-for="(sku, skuI) in item.specGroup" :key="skuI">{{ sku.specValueName }};</text>
  18. </view>
  19. <view class="other-info">
  20. <view class="info-li">单价:{{ $utils.formattedNumber(item.price) }}</view>
  21. <view class="info-li">购买:{{ item.buyNum }}{{ item.unitName }}</view>
  22. <view class="info-li">发货:{{ $utils.formatNub(item.outNum) }}{{ item.unitName }}</view>
  23. </view>
  24. </view>
  25. <view class="price">{{ $utils.formattedNumber(item.totalMoney) }}</view>
  26. </view>
  27. <view class="bottom clearfix">
  28. <view class="float_left">
  29. <view class="cutomer ellipsis">{{item.customerName}}</view>
  30. </view>
  31. <view class="float_right">
  32. <view class="date">{{ $u.timeFormat(item.createTime, 'yyyy-mm-dd hh:MM:ss') }}</view>
  33. </view>
  34. </view>
  35. </view>
  36. <u-loadmore :status="load_status" />
  37. </view>
  38. </view>
  39. </template>
  40. <script>
  41. export default {
  42. data() {
  43. return {
  44. load_status: 'nomore',
  45. page: 1,
  46. pageSize: 10,
  47. total: 0,
  48. order_list: [],
  49. customer_name: '',
  50. customer_id: 0,
  51. customerData: []
  52. };
  53. },
  54. watch: {
  55. customerData(val) {
  56. if (val) {
  57. this.customer_name = val.name;
  58. this.customer_id = val.userCenterId;
  59. this.page = 1;
  60. this.searchCustomerBuyLog();
  61. }
  62. }
  63. },
  64. onLoad() {
  65. this.searchCustomerBuyLog();
  66. },
  67. onPullDownRefresh() {
  68. this.page = 1;
  69. this.searchCustomerBuyLog();
  70. },
  71. onReachBottom() {
  72. if (this.total / this.pageSize > this.page) {
  73. this.page += 1;
  74. this.searchCustomerBuyLog();
  75. }
  76. },
  77. methods: {
  78. clearValue() {
  79. this.customer_name = '';
  80. this.customer_id = 0;
  81. this.page = 1;
  82. this.searchCustomerBuyLog();
  83. },
  84. searchConfirm(){
  85. this.page = 1;
  86. this.searchCustomerBuyLog();
  87. },
  88. searchCustomerBuyLog() {
  89. let params = {
  90. page: this.page,
  91. pageSize: this.pageSize,
  92. userCenterId: this.customer_id
  93. };
  94. this.$u.api.searchCustomerBuyLog(params).then(res => {
  95. if (this.page === 1) {
  96. this.order_list = res.data;
  97. } else {
  98. this.order_list = this.order_list.concat(res.data);
  99. }
  100. this.load_status = this.$utils.loadStatus(this.page, this.pageSize, res.pageTotal);
  101. this.total = res.pageTotal;
  102. });
  103. }
  104. }
  105. };
  106. </script>
  107. <style lang="scss" scoped>
  108. .keyword-view {
  109. position: fixed;
  110. width: 100%;
  111. top: 0;
  112. left: 0;
  113. padding: 20rpx 24rpx;
  114. background-color: #ffffff;
  115. z-index: 9;
  116. .float_left {
  117. width: 640rpx;
  118. }
  119. .float_right {
  120. line-height: 64rpx;
  121. width: 50rpx;
  122. text-align: center;
  123. color: #666666;
  124. }
  125. }
  126. .logs-ul {
  127. padding-top: 100rpx;
  128. .logs-li {
  129. width: 710rpx;
  130. margin: 20rpx auto;
  131. background-color: #ffffff;
  132. border-radius: 20rpx;
  133. padding: 24rpx;
  134. .logs-goods {
  135. position: relative;
  136. .price {
  137. position: absolute;
  138. color: $uni-color-error;
  139. top: 50%;
  140. right: 0;
  141. transform: translateY(-50%);
  142. }
  143. }
  144. .goods-img {
  145. position: relative;
  146. width: 120rpx;
  147. height: 120rpx;
  148. border-radius: 20rpx;
  149. overflow: hidden;
  150. margin-right: 20rpx;
  151. border: 1px solid #f5f5f5;
  152. image {
  153. width: 100%;
  154. height: 100%;
  155. display: block;
  156. }
  157. }
  158. .goods-info {
  159. width: 520rpx;
  160. .goods-name {
  161. font-weight: bold;
  162. }
  163. .date-time {
  164. font-size: 22rpx;
  165. }
  166. .other-info {
  167. padding-top: 10rpx;
  168. display: flex;
  169. font-size: 22rpx;
  170. .info-li {
  171. flex: 3;
  172. display: inline-block;
  173. color: #6c6c6c;
  174. }
  175. }
  176. }
  177. }
  178. .bottom {
  179. padding-top: 24rpx;
  180. border-top: 1px solid #eeeeee;
  181. margin-top: 24rpx;
  182. .float_left {
  183. width: 320rpx;
  184. .cutomer {
  185. font-weight: bold;
  186. font-size: 26rpx;
  187. padding-bottom: 6rpx;
  188. }
  189. }
  190. .float_right {
  191. .date {
  192. font-size: 22rpx;
  193. color: #666666;
  194. }
  195. .btn-li {
  196. display: inline-block;
  197. border-radius: 10rpx;
  198. margin-left: 16rpx;
  199. width: 140rpx;
  200. line-height: 54rpx;
  201. font-size: 24rpx;
  202. text-align: center;
  203. border: 1px solid $uni-color-primary;
  204. color: $uni-color-primary;
  205. &:last-child {
  206. background-color: $uni-color-primary;
  207. color: #ffffff;
  208. }
  209. }
  210. }
  211. }
  212. }
  213. </style>