修复bug,新增免审编辑

This commit is contained in:
weipengfei 2023-10-20 18:45:31 +08:00
parent 6f692eb4d9
commit ac36382442
3 changed files with 28 additions and 10 deletions

View File

@ -291,6 +291,14 @@ export function productUpdate(merId, id, data) {
login: true
});
}
/*
免审编辑商品, 线下入库is_stock
*/
export function productUpdateFree(id, data) {
return request.post(`user_free_trial/${id}`, data, {
login: true
});
}
/*
添加商品 -- 获取送货方式信息
*/

View File

@ -65,7 +65,7 @@
import {
productLstApi,
productCreate,
productUpdate,
productUpdateFree,
productDetail
} from '@/api/product.js'
import {
@ -147,7 +147,13 @@
async submitCreatedGoods() {
this.particulars.attrValue[0].stock = Number(this.goodsNum)
this.particulars.attrValue[0].price = this.goodsPrive
const res = await productUpdate(this.merId, this.product_id, this.particulars)
const res = await productUpdateFree(this.product_id, {
attr:this.particulars.attr,
attrValue:this.particulars.attrValue,
mer_cate_id:this.particulars.mer_cate_id,
spec_type:this.particulars.spec_type,
is_stock:0,
})
// Toast(message)
this.getGoodsList()
this.goodsList = []

View File

@ -198,7 +198,7 @@
productDeleteApi,
productOffApi,
productRecommendApi,
postImport
productUpdateFree
} from "@/api/product";
import Loading from '@/components/Loading/index.vue';
import {
@ -245,7 +245,8 @@
data: {
product_id: '',
unique: "",
number: 1
number: 1,
submit_info:{}
},
on_line: '',
isshow: false,
@ -386,7 +387,6 @@
this.checkboxList1 = item.attrValue
// console.log(this.checkboxList1.length)
if (this.checkboxList1.length > 0) {
this.show = true
this.data.product_id = this.checkboxList1[0].product_id
this.data.unique = this.checkboxList1[0].unique
@ -413,7 +413,15 @@
title: '入库数量不得小于一件'
})
} else {
postImport(this.mer_id, this.data).then(res => {
let obj = {
"attr": [],
"attrValue": [...this.checkboxList1],
"mer_cate_id": [],
"spec_type": 0,
"is_stock": 1
};
obj.attrValue[0].price = this.data.number;
productUpdateFree(this.data.product_id, obj).then(res => {
this.data.unique = ''
this.data.product_id = ''
this.data.number = 1
@ -427,8 +435,6 @@
this.data.unique = ''
this.data.product_id = ''
this.data.number = 1
}).catch(err => {
this.show = false
this.data.unique = ''
@ -448,12 +454,10 @@
title: '请选择规格'
})
} else {
navigateTo(1, '/pages/users/online_warehousing/index', {
mer_id: this.mer_id,
product_id: this.data.product_id,
unique: this.data.unique,
});