添加恢复商品

This commit is contained in:
luofei 2024-05-16 11:44:45 +08:00
parent 39a49b1b43
commit 5d3981c27e
2 changed files with 30 additions and 4 deletions

View File

@ -844,7 +844,9 @@
}, },
async onLoad() { async onLoad() {
// #ifdef APP
this.subNVue = uni.getSubNVueById('concat') this.subNVue = uni.getSubNVueById('concat')
// #endif
this.Fheight = uni.getSystemInfoSync().windowHeight + 'px'; this.Fheight = uni.getSystemInfoSync().windowHeight + 'px';
await this.$onLaunched; await this.$onLaunched;
this.list1(); this.list1();

View File

@ -49,12 +49,12 @@
v-if='where.type==6||where.type==5||where.type==7||where.type==2'> v-if='where.type==6||where.type==5||where.type==7||where.type==2'>
删除 删除
</view> </view>
<view v-if="where.type==2" <view v-if="where.type==2 && where.type != 5"
style="border-right: 1px solid #CECECE;flex: 1;text-align: center;" style="border-right: 1px solid #CECECE;flex: 1;text-align: center;"
@click="Fline(item)"> @click="Fline(item)">
修改库存 修改库存
</view> </view>
<view v-else style="border-right: 1px solid #CECECE;flex: 1;text-align: center;" <view v-if="where.type!=2 && where.type != 5" style="border-right: 1px solid #CECECE;flex: 1;text-align: center;"
@click="Fline(item)"> @click="Fline(item)">
修改库存 修改库存
</view> </view>
@ -68,9 +68,12 @@
@click="handleShelves(item,1)"> @click="handleShelves(item,1)">
上架 上架
</view> </view>
<view style="flex: 1;text-align: center;" @click="editGoods(item)"> <view v-if="where.type != 5" style="flex: 1;text-align: center;" @click="editGoods(item)">
编辑商品 编辑商品
</view> </view>
<view v-if="where.type == 5" style="flex: 1;text-align: center;" @click="handleRestore(item)">
恢复
</view>
</view> </view>
<view class="card-footer" v-if='where.type==1'> <view class="card-footer" v-if='where.type==1'>
<view class="card-footer-li" style="flex: 1.5;"> <view class="card-footer-li" style="flex: 1.5;">
@ -214,7 +217,8 @@
productRecommendApi, productRecommendApi,
productUpdateFree, productUpdateFree,
productTitle, productTitle,
productDestory productDestory,
productRestore
} from "@/api/product"; } from "@/api/product";
import { import {
labelLst labelLst
@ -851,6 +855,26 @@
}) })
this.showOverly = false
},
handleRestore(item) {
let index = this.productList.findIndex(items => items.product_id == item.product_id)
let that = this
productRestore(that.mer_id, item.product_id)
.then(res => {
that.$util.Tips({
title: res.message,
icon: 'success'
});
that.getList(this.mer_id, true)
// this.$set(this, 'num', -1);
})
.catch(rej => {
this.$set(this, 'num', -1);
Toast(`${rej}, 删除失败`);
})
this.showOverly = false this.showOverly = false
}, },
// 0 // 0