|
@@ -15,9 +15,9 @@
|
|
|
<view class="list-right">库存</view>
|
|
|
</view>
|
|
|
<template v-if="datalist&&datalist.length">
|
|
|
- <view class="list-row u-flex" v-for="item in datalist" :key="item.matDescribe">
|
|
|
- <view class="list-left">{{item.matDescribe}}</view>
|
|
|
- <view class="list-right">{{item.stock}}</view>
|
|
|
+ <view class="list-row u-flex u-skeleton" v-for="item in datalist" :key="item.matDescribe">
|
|
|
+ <view class="list-left u-skeleton-rect">{{item.matDescribe}}</view>
|
|
|
+ <view class="list-right u-skeleton-rect">{{item.stock}}</view>
|
|
|
</view>
|
|
|
</template>
|
|
|
<u-empty v-else text="暂无数据" mode="list"></u-empty>
|
|
@@ -47,7 +47,7 @@
|
|
|
}],
|
|
|
// 分页信息
|
|
|
first: 0,
|
|
|
- pageSize: 20, //每页条数
|
|
|
+ pageSize: 10, //每页条数
|
|
|
currentPage: 1, //当前页码
|
|
|
totalPage: 0, //总页码数
|
|
|
loadStatus: "loadmore",
|
|
@@ -85,15 +85,19 @@
|
|
|
},
|
|
|
|
|
|
handleSearch: function(v) {
|
|
|
+ this.first = 0;
|
|
|
+ this.currentPage = 1;
|
|
|
console.log(v)
|
|
|
this.handleGetData();
|
|
|
},
|
|
|
handleFilterBrand: function(v2) {
|
|
|
+ this.first = 0;
|
|
|
+ this.currentPage = 1;
|
|
|
this.current = v2;
|
|
|
- this.currentBrand = this.brandlLst[this.current].brandName;
|
|
|
+ this.currentBrand = this.brandlLst[this.current].brandCode;
|
|
|
this.handleGetData();
|
|
|
console.log(arguments);
|
|
|
- console.log(this.brandlLst[this.current].brandName)
|
|
|
+ console.log(this.brandlLst[this.current].brandCode)
|
|
|
},
|
|
|
handleGetFilterData: function() {
|
|
|
var _this = this;
|
|
@@ -146,11 +150,11 @@
|
|
|
url: '/homepage/storeGetStock',
|
|
|
method: 'post',
|
|
|
data: {
|
|
|
- storeId: "990289",
|
|
|
+ storeId: "1000",
|
|
|
userId: "1",
|
|
|
current: _this.currentPage,
|
|
|
pageSize: _this.pageSize,
|
|
|
- brandCode: _this.currentBrand,
|
|
|
+ brandCode: _this.currentBrand=="all"?"":_this.currentBrand,
|
|
|
specKey: _this.keyword
|
|
|
}
|
|
|
}).then(res => {
|
|
@@ -158,8 +162,9 @@
|
|
|
console.log(res)
|
|
|
// 获取数据列表
|
|
|
if (_this.first == 0) {
|
|
|
- _this.datalist = res.data.data;
|
|
|
- _this.total = parseInt(res.data.data.count);
|
|
|
+ _this.datalist = [];
|
|
|
+ _this.datalist = _this.datalist.concat(res.data.data);
|
|
|
+ _this.total = parseInt(res.data.count);
|
|
|
_this.totalPage = Math.ceil(_this.total / _this.pageSize);
|
|
|
console.log(_this.totalPage)
|
|
|
} else {
|