|
|
@@ -66,7 +66,8 @@
|
|
|
<view class="data">
|
|
|
<span>{{item.productName}}</span>
|
|
|
<!-- <span>售卖时间:{{item.time}}</span> -->
|
|
|
- <view class="repertory">库存:{{item.stockQuantity}} <span @click.stop="goUser(item)">销量:{{item.soldQuantity}}</span> </view>
|
|
|
+ <view class="repertory">库存:{{item.stockQuantity}} <span
|
|
|
+ @click.stop="goUser(item)">销量:{{item.soldQuantity}}</span> </view>
|
|
|
<view class="price">
|
|
|
<span style="font-size: 22rpx;margin: 0px;">¥</span>{{item.soldPrice}}
|
|
|
<span v-if="item.categoryId == 1945013773786701826 ">~</span>
|
|
|
@@ -238,10 +239,11 @@
|
|
|
})
|
|
|
},
|
|
|
//销量页面
|
|
|
- goUser(item){
|
|
|
+ goUser(item) {
|
|
|
console.log(item)
|
|
|
uni.navigateTo({
|
|
|
- url: '/pages/product/salesUser?productName='+item.productName+'&productImage='+item.productImage+'&productId='+item.productId
|
|
|
+ url: '/pages/product/salesUser?productName=' + item.productName + '&productImage=' + item.productImage +
|
|
|
+ '&productId=' + item.productId
|
|
|
})
|
|
|
},
|
|
|
handleClear() {
|
|
|
@@ -330,16 +332,16 @@
|
|
|
remove() {
|
|
|
console.log(this.productList)
|
|
|
this.productList.forEach((item => {
|
|
|
- if(item.select){
|
|
|
- this.productHandleList.push(item.productId)
|
|
|
+ if (item.select) {
|
|
|
+ this.productHandleList.push(item.productId)
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
}))
|
|
|
this.isDelete = true
|
|
|
},
|
|
|
removeProduct() {
|
|
|
- let ids =[]
|
|
|
- ids = this.productHandleList.join(',')
|
|
|
+ let ids = []
|
|
|
+ ids = this.productHandleList.join(',')
|
|
|
console.log(ids)
|
|
|
this.$http.get("/app/product/deleteBatch?ids=" + ids, )
|
|
|
.then(res => {
|
|
|
@@ -433,12 +435,25 @@
|
|
|
},
|
|
|
//上架
|
|
|
sell(item) {
|
|
|
- console.log(item)
|
|
|
- this.sellProducts.push({
|
|
|
- productId: item.productId,
|
|
|
- productStatus: 1
|
|
|
- })
|
|
|
- this.isSell = true
|
|
|
+ console.log(item.categoryId)
|
|
|
+ let noStockCheckCategoryIds = [
|
|
|
+ '1889837335015636994',
|
|
|
+ '1889837859597238273',
|
|
|
+ '1909434886438043649'
|
|
|
+ ];
|
|
|
+
|
|
|
+ if (item.stockQuantity == 0 && !noStockCheckCategoryIds.includes(item.categoryId)) {
|
|
|
+ uni.showToast({
|
|
|
+ icon: 'none',
|
|
|
+ title: '上架商品,库存不能为0'
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+ this.sellProducts.push({
|
|
|
+ productId: item.productId,
|
|
|
+ productStatus: 1
|
|
|
+ })
|
|
|
+ this.isSell = true
|
|
|
+ }
|
|
|
},
|
|
|
sellProduct() {
|
|
|
this.$http.post("/app/product/shelves", this.sellProducts)
|
|
|
@@ -772,7 +787,7 @@
|
|
|
// width: 1rpx;
|
|
|
// height: 20rpx;
|
|
|
// background: #d9d9d9;
|
|
|
- margin-left: 12rpx;
|
|
|
+ margin-left: 12rpx;
|
|
|
}
|
|
|
}
|
|
|
|