修复bug

This commit is contained in:
weipengfei 2023-10-07 15:05:28 +08:00
parent 635a166bf5
commit 3514231ffa
4 changed files with 16 additions and 13 deletions

View File

@ -224,7 +224,7 @@
if (this.product_id) {
// editGoodsDetils = getStorage('editGoodsDetils');
editGoodsDetils = this.$store.state.storage.storage;
console.log(editGoodsDetils);
// console.log('ss',editGoodsDetils.content);
// editGoodsDetils = getStorage('editGoodsDetils');
// console.log('',editGoodsDetils);
Object.keys(this.addGoodsSecoundData).forEach(item => {

View File

@ -163,7 +163,7 @@
</view> -->
</view>
<commodityComponent v-if="showCommodity" :key="showCommodity" :showCommodity="showCommodity" :resetKey="secoundModel" :product_id="product_id" :merId="merId"
<commodityComponent v-if="showCommodity" :key="showCommodity" :showCommodity="showCommodity" :resetKey="secoundModel" :product_id="product_id" :merId="merId"
:code="code" @lastStep="lastStep">
</commodityComponent>
@ -437,6 +437,8 @@
// this.getDeliveryType();
if (this.product_id) {
this.initDataEditData();
}else {
setStorage('editCommodity',{});
}
},
onBackPress() {
@ -584,6 +586,7 @@
}
productDetail(this.merId, this.product_id).then(res => {
setStorage('editGoodsDetils', res.data);
if(res.data.content_arr) res.data.content = res.data.content_arr;
this.$store.commit('setStorage', res.data);
let editGoodsDetils = res.data;
Object.keys(this.setFormData).forEach(item => {
@ -627,7 +630,6 @@
let that = this;
that.$util.uploadImageOne('upload/image', function(res) {
that.setFormData.imageList.push(res.data.path);
});
},
clk() {

View File

@ -264,15 +264,15 @@
postData[key]=info[key];
})
postData.stock = postData.attrValue[0].stock;
console.log(postData);
if(postData.store_name.trim().length<=0)return Toast('请输入商品名称');
if(postData.imageList.length<=0)return Toast('请上传商品图片');
if(postData.cate_name.trim().length<=0)return Toast('请选择平台分类');
if(postData.unit_name.trim().length<=0)return Toast('请输入商品单位');
// console.log(postData);
if(!postData.store_name||postData.store_name?.trim().length<=0)return Toast('请输入商品名称');
if(!postData.imageList||postData.imageList.length<=0)return Toast('请上传商品图片');
if(postData.cate_name?.trim().length<=0)return Toast('请选择平台分类');
if(postData.unit_name?.trim().length<=0)return Toast('请输入商品单位');
if(!postData.attrValue[0].price||postData.attrValue[0].price<0)return Toast('价格不能小于0');
if(!postData.stock||postData.stock<0)return Toast('库存不能小于0');
if(postData.content.title.trim().length<=0)return Toast('请输入商品详情');
if(postData.content.image.length<=0)return Toast('请上传商品图片');
if(!postData.content.title||postData.content.title?.trim().length<=0)return Toast('请输入商品详情');
if(!postData.content.image||postData.content.image?.length<=0)return Toast('请上传商品图片');
// return Toast('');
if (getStorage('addGoodsFormData').spec_type == 0) {
// postData.attr = [getStorage('singleSpecification')];

View File

@ -111,7 +111,7 @@
}
},
mounted() {
console.log(this.$props.prodectContent);
// console.log(this.$props.prodectContent);
},
methods: {
handleChooseImage() {
@ -143,10 +143,11 @@
[TOKENNAME]: 'Bearer ' + store.state.app.token
},
success: (uploadFileRes) => {
// console.log(uploadFileRes.data);
// console.log(JSON.parse(uploadFileRes.data));
let imgData = JSON.parse(uploadFileRes.data)
// that.prodectContent.imageList.push(imgData.data.path)
that.prodectContent = { imageList: [...that.prodectContent.imageList, imgData.data.path] ,store_name:this.upstore}
if(!that.prodectContent.imageList)that.prodectContent.imageList=[];
that.prodectContent = { imageList: [...that.prodectContent.imageList, imgData.data.path] ,store_name:this.upstore};
},
complete(res) {
// console.log(res)