|
|
@ -31,8 +31,17 @@
|
|
|
|
</view>
|
|
|
|
</view>
|
|
|
|
<view class="content-top">
|
|
|
|
<view class="content-top">
|
|
|
|
<view style="color: #9fafff; font-size: 24rpx">全部</view>
|
|
|
|
<view style="color: #9fafff; font-size: 24rpx">全部</view>
|
|
|
|
<view style="color: #4f598b; font-size: 16rpx">按库存更新排序</view>
|
|
|
|
<view
|
|
|
|
|
|
|
|
@click="showPicker"
|
|
|
|
|
|
|
|
style="color: #4f598b; font-size: 16rpx"
|
|
|
|
|
|
|
|
>{{ sortByName }}</view
|
|
|
|
|
|
|
|
>
|
|
|
|
</view>
|
|
|
|
</view>
|
|
|
|
|
|
|
|
<u-picker
|
|
|
|
|
|
|
|
:show="pcikerShow"
|
|
|
|
|
|
|
|
@confirm="pickerConfirm"
|
|
|
|
|
|
|
|
@cancel="pickerCancel"
|
|
|
|
|
|
|
|
:columns="columns"></u-picker>
|
|
|
|
<view
|
|
|
|
<view
|
|
|
|
class="management-list"
|
|
|
|
class="management-list"
|
|
|
|
style="margin-bottom: 20rpx">
|
|
|
|
style="margin-bottom: 20rpx">
|
|
|
@ -202,11 +211,21 @@ export default {
|
|
|
|
changeStock: "",
|
|
|
|
changeStock: "",
|
|
|
|
image: "",
|
|
|
|
image: "",
|
|
|
|
},
|
|
|
|
},
|
|
|
|
|
|
|
|
columns: [["按库存更新排序", "入库时间倒序", "库存倒序"]],
|
|
|
|
|
|
|
|
pcikerShow: false,
|
|
|
|
|
|
|
|
sortByName: "按库存更新排序",
|
|
|
|
|
|
|
|
sortBy: "stockChangeDesc",
|
|
|
|
};
|
|
|
|
};
|
|
|
|
},
|
|
|
|
},
|
|
|
|
mounted() {
|
|
|
|
mounted() {
|
|
|
|
this.getManagementList();
|
|
|
|
this.getManagementList();
|
|
|
|
},
|
|
|
|
},
|
|
|
|
|
|
|
|
onPullDownRefresh() {
|
|
|
|
|
|
|
|
this.managementList = [];
|
|
|
|
|
|
|
|
this.page = 1;
|
|
|
|
|
|
|
|
this.getManagementList();
|
|
|
|
|
|
|
|
uni.stopPullDownRefresh();
|
|
|
|
|
|
|
|
},
|
|
|
|
methods: {
|
|
|
|
methods: {
|
|
|
|
handleScroll() {
|
|
|
|
handleScroll() {
|
|
|
|
if (this.total > this.managementList.length) {
|
|
|
|
if (this.total > this.managementList.length) {
|
|
|
@ -224,12 +243,13 @@ export default {
|
|
|
|
await this.$api.management
|
|
|
|
await this.$api.management
|
|
|
|
.manageList({
|
|
|
|
.manageList({
|
|
|
|
title: this.title,
|
|
|
|
title: this.title,
|
|
|
|
|
|
|
|
sortBy: this.sortBy,
|
|
|
|
page: this.page,
|
|
|
|
page: this.page,
|
|
|
|
PageSize: this.PageSize,
|
|
|
|
PageSize: this.PageSize,
|
|
|
|
})
|
|
|
|
})
|
|
|
|
.then((res) => {
|
|
|
|
.then((res) => {
|
|
|
|
this.total = res.data.count;
|
|
|
|
this.total = res.data.count;
|
|
|
|
this.managementList = this.managementList.concat(res.data.data);
|
|
|
|
this.managementList = this.managementList.concat(res.data.data || []);
|
|
|
|
});
|
|
|
|
});
|
|
|
|
},
|
|
|
|
},
|
|
|
|
// 去我的
|
|
|
|
// 去我的
|
|
|
@ -285,6 +305,21 @@ export default {
|
|
|
|
},
|
|
|
|
},
|
|
|
|
});
|
|
|
|
});
|
|
|
|
},
|
|
|
|
},
|
|
|
|
|
|
|
|
showPicker() {
|
|
|
|
|
|
|
|
this.pcikerShow = true;
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
pickerConfirm(e) {
|
|
|
|
|
|
|
|
console.log(e);
|
|
|
|
|
|
|
|
this.sortByName = e.value[0];
|
|
|
|
|
|
|
|
this.sortBy = e.indexs[0] == 0 ? "stockChangeDesc" :e.indexs[0] == 1 ? "createdDesc" : "stockSizeDesc";
|
|
|
|
|
|
|
|
this.pcikerShow = false;
|
|
|
|
|
|
|
|
this.managementList = [];
|
|
|
|
|
|
|
|
this.page = 1;
|
|
|
|
|
|
|
|
this.getManagementList();
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
pickerCancel(e) {
|
|
|
|
|
|
|
|
this.pcikerShow = false;
|
|
|
|
|
|
|
|
},
|
|
|
|
// 生成新商品
|
|
|
|
// 生成新商品
|
|
|
|
goCreateNew() {
|
|
|
|
goCreateNew() {
|
|
|
|
this.showCreate = false;
|
|
|
|
this.showCreate = false;
|
|
|
@ -304,9 +339,14 @@ export default {
|
|
|
|
});
|
|
|
|
});
|
|
|
|
},
|
|
|
|
},
|
|
|
|
async goOutNum() {
|
|
|
|
async goOutNum() {
|
|
|
|
|
|
|
|
// 不可以小于0
|
|
|
|
|
|
|
|
if (parseInt(this.goodsInfo.changeStock) <= 0) {
|
|
|
|
|
|
|
|
uni.$u.toast("出库数量不可小于0");
|
|
|
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
}
|
|
|
|
let data = {
|
|
|
|
let data = {
|
|
|
|
ID: this.goodsInfo.ID,
|
|
|
|
ID: this.goodsInfo.ID,
|
|
|
|
changeStock: 0-parseInt(this.goodsInfo.changeStock),
|
|
|
|
changeStock: 0 - parseInt(this.goodsInfo.changeStock),
|
|
|
|
};
|
|
|
|
};
|
|
|
|
let res = await this.$api.management.addNum(data);
|
|
|
|
let res = await this.$api.management.addNum(data);
|
|
|
|
if (res.status == 0) {
|
|
|
|
if (res.status == 0) {
|
|
|
|