|
@@ -349,11 +349,13 @@ export default {
|
|
|
} else {
|
|
} else {
|
|
|
formData.cover = '';
|
|
formData.cover = '';
|
|
|
}
|
|
}
|
|
|
|
|
+ if(formData.stockSet === '0'){
|
|
|
|
|
+ formData.stock = 9999;
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
addGoodsData({ status: this.status, ...formData }).then(res => {
|
|
addGoodsData({ status: this.status, ...formData }).then(res => {
|
|
|
uni.hideLoading()
|
|
uni.hideLoading()
|
|
|
- this.$msg("添加成功")
|
|
|
|
|
- this.removeFromSaveDirect()
|
|
|
|
|
|
|
+ // this.removeFromSaveDirect()
|
|
|
|
|
|
|
|
// 把新增的商品添加到商品列表页的商品数组的第一项
|
|
// 把新增的商品添加到商品列表页的商品数组的第一项
|
|
|
if (res.code === 1 && res.data) {
|
|
if (res.code === 1 && res.data) {
|
|
@@ -376,6 +378,7 @@ export default {
|
|
|
prevPage.$vm.list.data.unshift(newGoodsItem);
|
|
prevPage.$vm.list.data.unshift(newGoodsItem);
|
|
|
prevPage.$vm.list.total = (prevPage.$vm.list.total || 0) + 1;
|
|
prevPage.$vm.list.total = (prevPage.$vm.list.total || 0) + 1;
|
|
|
}
|
|
}
|
|
|
|
|
+ this.$msg("添加成功")
|
|
|
} catch (error) {
|
|
} catch (error) {
|
|
|
console.log('更新列表页数据失败:', error);
|
|
console.log('更新列表页数据失败:', error);
|
|
|
}
|
|
}
|