123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236 |
- <template>
- <view>
- <view class="keyword-view clearfix">
- <u-search disabled @custom="clearValue" @search="searchConfirm()" action-text="重置" :clearabled="true"
- placeholder="请选择客户" v-model="customer_name" @click="goPage('/pagesT/customer/selCustomer')"></u-search>
- </view>
- <view class="logs-ul">
- <view class="logs-li clearfix" v-for="(item, index) in order_list" :key="index">
- <view class="clearfix logs-goods">
- <view class="float_left goods-img">
- <image :src="item.goodsImages" mode="aspectFill"></image>
- </view>
- <view class="float_left goods-info">
- <view class="goods-name ellipsis">{{ item.goodsName }}</view>
- <view class="date-time">
- {{ item.unitName }};
- <text v-for="(sku, skuI) in item.specGroup" :key="skuI">{{ sku.specValueName }};</text>
- </view>
- <view class="other-info">
- <view class="info-li">单价:{{ $utils.formattedNumber(item.price) }}</view>
- <view class="info-li">购买:{{ item.buyNum }}{{ item.unitName }}</view>
- <view class="info-li">发货:{{ $utils.formatNub(item.outNum) }}{{ item.unitName }}</view>
- </view>
- </view>
- <view class="price">{{ $utils.formattedNumber(item.totalMoney) }}</view>
- </view>
- <view class="bottom clearfix">
- <view class="float_left">
- <view class="cutomer ellipsis">{{item.customerName}}</view>
- </view>
- <view class="float_right">
- <view class="date">{{ $u.timeFormat(item.createTime, 'yyyy-mm-dd hh:MM:ss') }}</view>
- </view>
- </view>
- </view>
- <u-loadmore :status="load_status" />
- </view>
- </view>
- </template>
- <script>
- export default {
- data() {
- return {
- load_status: 'nomore',
- page: 1,
- pageSize: 10,
- total: 0,
- order_list: [],
- customer_name: '',
- customer_id: 0,
- customerData: []
- };
- },
- watch: {
- customerData(val) {
- if (val) {
- this.customer_name = val.name;
- this.customer_id = val.userCenterId;
- this.page = 1;
- this.searchCustomerBuyLog();
- }
- }
- },
- onLoad() {
- this.searchCustomerBuyLog();
- },
- onPullDownRefresh() {
- this.page = 1;
- this.searchCustomerBuyLog();
- },
- onReachBottom() {
- if (this.total / this.pageSize > this.page) {
- this.page += 1;
- this.searchCustomerBuyLog();
- }
- },
- methods: {
- clearValue() {
- this.customer_name = '';
- this.customer_id = 0;
- this.page = 1;
- this.searchCustomerBuyLog();
- },
- searchConfirm(){
- this.page = 1;
- this.searchCustomerBuyLog();
- },
- searchCustomerBuyLog() {
- let params = {
- page: this.page,
- pageSize: this.pageSize,
- userCenterId: this.customer_id
- };
- this.$u.api.searchCustomerBuyLog(params).then(res => {
- if (this.page === 1) {
- this.order_list = res.data;
- } else {
- this.order_list = this.order_list.concat(res.data);
- }
- this.load_status = this.$utils.loadStatus(this.page, this.pageSize, res.pageTotal);
- this.total = res.pageTotal;
- });
- }
- }
- };
- </script>
- <style lang="scss" scoped>
- .keyword-view {
- position: fixed;
- width: 100%;
- top: 0;
- left: 0;
- padding: 20rpx 24rpx;
- background-color: #ffffff;
- z-index: 9;
- .float_left {
- width: 640rpx;
- }
- .float_right {
- line-height: 64rpx;
- width: 50rpx;
- text-align: center;
- color: #666666;
- }
- }
- .logs-ul {
- padding-top: 100rpx;
- .logs-li {
- width: 710rpx;
- margin: 20rpx auto;
- background-color: #ffffff;
- border-radius: 20rpx;
- padding: 24rpx;
- .logs-goods {
- position: relative;
- .price {
- position: absolute;
- color: $uni-color-error;
- top: 50%;
- right: 0;
- transform: translateY(-50%);
- }
- }
- .goods-img {
- position: relative;
- width: 120rpx;
- height: 120rpx;
- border-radius: 20rpx;
- overflow: hidden;
- margin-right: 20rpx;
- border: 1px solid #f5f5f5;
- image {
- width: 100%;
- height: 100%;
- display: block;
- }
- }
- .goods-info {
- width: 520rpx;
- .goods-name {
- font-weight: bold;
- }
- .date-time {
- font-size: 22rpx;
- }
- .other-info {
- padding-top: 10rpx;
- display: flex;
- font-size: 22rpx;
- .info-li {
- flex: 3;
- display: inline-block;
- color: #6c6c6c;
- }
- }
- }
- }
- .bottom {
- padding-top: 24rpx;
- border-top: 1px solid #eeeeee;
- margin-top: 24rpx;
- .float_left {
- width: 320rpx;
- .cutomer {
- font-weight: bold;
- font-size: 26rpx;
- padding-bottom: 6rpx;
- }
- }
- .float_right {
- .date {
- font-size: 22rpx;
- color: #666666;
- }
- .btn-li {
- display: inline-block;
- border-radius: 10rpx;
- margin-left: 16rpx;
- width: 140rpx;
- line-height: 54rpx;
- font-size: 24rpx;
- text-align: center;
- border: 1px solid $uni-color-primary;
- color: $uni-color-primary;
- &:last-child {
- background-color: $uni-color-primary;
- color: #ffffff;
- }
- }
- }
- }
- }
- </style>
|