|
@@ -3,16 +3,16 @@
|
|
<div style="width: 100%; height: 85vh; overflow: auto">
|
|
<div style="width: 100%; height: 85vh; overflow: auto">
|
|
<el-row style="padding-top: 20px">
|
|
<el-row style="padding-top: 20px">
|
|
<el-col :span="24">
|
|
<el-col :span="24">
|
|
- <el-descriptions title="基本信息" column="1"> </el-descriptions>
|
|
|
|
|
|
+ <el-descriptions title="基本信息" :column="1"> </el-descriptions>
|
|
<basicInfo ref="basicRefs" @updateValue="updateValue"></basicInfo>
|
|
<basicInfo ref="basicRefs" @updateValue="updateValue"></basicInfo>
|
|
- <el-descriptions title="销售信息" column="1"> </el-descriptions>
|
|
|
|
|
|
+ <el-descriptions title="销售信息" :column="1"> </el-descriptions>
|
|
<salesInfo
|
|
<salesInfo
|
|
ref="salesRefs"
|
|
ref="salesRefs"
|
|
@updateValue="updateValue"
|
|
@updateValue="updateValue"
|
|
@skuRemove="skuRemove"
|
|
@skuRemove="skuRemove"
|
|
:saleModels="form.saleModel"
|
|
:saleModels="form.saleModel"
|
|
></salesInfo>
|
|
></salesInfo>
|
|
- <el-descriptions title="商品详情" column="1"> </el-descriptions>
|
|
|
|
|
|
+ <el-descriptions title="商品详情" :column="1"> </el-descriptions>
|
|
<productInfo
|
|
<productInfo
|
|
ref="productRefs"
|
|
ref="productRefs"
|
|
@updateValue="updateValue"
|
|
@updateValue="updateValue"
|
|
@@ -68,8 +68,8 @@
|
|
<span>¥</span>
|
|
<span>¥</span>
|
|
<span
|
|
<span
|
|
class="price"
|
|
class="price"
|
|
- :key="item"
|
|
|
|
- v-for="item in form.skuList ? form.skuList.slice(0, 1) : []"
|
|
|
|
|
|
+ :key="index"
|
|
|
|
+ v-for="(item,index) in form.skuList ? form.skuList.slice(0, 1) : []"
|
|
>{{
|
|
>{{
|
|
item.skuPriceList ? item.skuPriceList[0].price : 0
|
|
item.skuPriceList ? item.skuPriceList[0].price : 0
|
|
}}元</span
|
|
}}元</span
|
|
@@ -271,13 +271,14 @@ export default {
|
|
},
|
|
},
|
|
|
|
|
|
created() {
|
|
created() {
|
|
- window.addEventListener("beforeunload", function (e) {
|
|
|
|
- this.$store.dispatch("tagsView/delView", this.$route); //关闭当前页
|
|
|
|
|
|
+ window.addEventListener("beforeunload", () => {
|
|
|
|
+ // 使用箭头函数保留 this 指向
|
|
|
|
+ this.$store.dispatch("tagsView/delView", this.$route);
|
|
this.$router.replace({ path: "/product/product/index" });
|
|
this.$router.replace({ path: "/product/product/index" });
|
|
});
|
|
});
|
|
},
|
|
},
|
|
mounted() {
|
|
mounted() {
|
|
- this.getInfo();
|
|
|
|
|
|
+
|
|
if (
|
|
if (
|
|
(this.$route.query.params != "[object Object]" &&
|
|
(this.$route.query.params != "[object Object]" &&
|
|
this.$route.query.params) ||
|
|
this.$route.query.params) ||
|
|
@@ -379,6 +380,7 @@ export default {
|
|
}
|
|
}
|
|
});
|
|
});
|
|
}
|
|
}
|
|
|
|
+ this.getInfo();
|
|
}
|
|
}
|
|
},
|
|
},
|
|
methods: {
|
|
methods: {
|
|
@@ -498,9 +500,9 @@ export default {
|
|
(res) => {}
|
|
(res) => {}
|
|
);
|
|
);
|
|
}
|
|
}
|
|
- if (this.form.bannerList?.length > 0) {
|
|
|
|
- this.form.bannerList.shift();
|
|
|
|
- }
|
|
|
|
|
|
+ // if (this.form.bannerList?.length > 0) {
|
|
|
|
+ // this.form.bannerList.shift();
|
|
|
|
+ // }
|
|
if (this.form.skuList.length < 1 || this.form.skuList === "") {
|
|
if (this.form.skuList.length < 1 || this.form.skuList === "") {
|
|
this.$message.error(`规格不能为空`);
|
|
this.$message.error(`规格不能为空`);
|
|
return;
|
|
return;
|