Commit 2a0a5ae1 authored by v-yuchenglong's avatar v-yuchenglong

update:商品添加图片bug

parent 5ab3a7a3
......@@ -367,14 +367,11 @@ export default {
},
// 图片删除后
removeDetailFiles(file, fileList) {
for (let i = 0; i < fileList.length; i++) {
if (fileList[i].uid == file.uid) {
this.picUploadList.splice(i, 1);
}
}
removeDetailFiles() {
this.picStr = "";
this.hideUpload = this.picUploadList.length >= this.limitCount;
this.picUrlList = [];
this.picUploadList = [];
// this.hideUpload = this.picUploadList.length >= this.limitCount;
},
// 获取商家
......@@ -394,13 +391,13 @@ export default {
// 查看商品详情
async markGoodsInfoMet(goodSkuID) {
this.picUrlList = [];
let params = { goods_sku_id: goodSkuID, marketing_type: "4" };
const res = await markGoodsInfo(params);
this.inventoryRest = res.result.goods_info.inventory_rest;
this.inventoryTotal = res.result.goods_info.inventory_total;
this.commodityForm = res.result.goods_info;
this.commodityForm.business1 = res.result.goods_info.ota_id;
this.picUrlList = [];
for (var i in res.result.goods_info.desc_pic_url_list) {
this.picUrlList.push({
url: res.result.goods_info.desc_pic_url_list[i],
......@@ -466,11 +463,13 @@ export default {
// 添加修改商品
async commodity(type, val) {
this.$refs.picUpload && this.$refs.picUpload.clearFiles && this.$refs.picUpload.clearFiles();
this.picUrlList = [];
this.addCommodityPopup = true;
this.commodityForm = {};
if (type == "add") {
this.hideUpload = false;
// this.picUrlList = [];
this.inventoryRest = 0;
this.commodityForm.total_amount_order = 0;
this.addCommodityTitle = "商品添加";
......@@ -487,7 +486,7 @@ export default {
const res = await addGoods({
marketing_name: this.stepTwoTitle,
goods_name: this.commodityForm.goods_name,
desc_pic_url: this.picUploadList.join(","),
desc_pic_url: this.picStr,
desc: "",
inventory: this.commodityForm.inventory_total,
original_price: this.commodityForm.original_price,
......@@ -502,7 +501,7 @@ export default {
type: "success",
});
this.comTableData.push(res.result.goods_info);
this.$refs.picUpload.clearFiles();
// this.$refs.picUpload.clearFiles();
this.addCommodityPopup = false;
} else {
ElMessage.error(res.reason);
......@@ -592,6 +591,13 @@ export default {
}
this.comTableData = newVal;
},
picUrlList: function () {
if(this.picUrlList.length >= this.limitCount) {
this.hideUpload = true
}else {
this.hideUpload = false
}
}
},
created() {
this.getBusinessListMet();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment