|
@@ -13,7 +13,10 @@
|
|
:saleModels="form.saleModel"
|
|
:saleModels="form.saleModel"
|
|
></salesInfo>
|
|
></salesInfo>
|
|
<el-descriptions title="商品详情" column="1"> </el-descriptions>
|
|
<el-descriptions title="商品详情" column="1"> </el-descriptions>
|
|
- <productInfo ref="productRefs" @updateValue="updateValue"></productInfo>
|
|
|
|
|
|
+ <productInfo
|
|
|
|
+ ref="productRefs"
|
|
|
|
+ @updateValue="updateValue"
|
|
|
|
+ ></productInfo>
|
|
|
|
|
|
<div class="dialog-footer" style="text-align: center">
|
|
<div class="dialog-footer" style="text-align: center">
|
|
<el-button @click="submitCancel">取 消</el-button>
|
|
<el-button @click="submitCancel">取 消</el-button>
|
|
@@ -67,7 +70,9 @@
|
|
class="price"
|
|
class="price"
|
|
:key="item"
|
|
:key="item"
|
|
v-for="item in form.skuList ? form.skuList.slice(0, 1) : []"
|
|
v-for="item in form.skuList ? form.skuList.slice(0, 1) : []"
|
|
- >{{ item.skuPriceList ? item.skuPriceList[0].price : 0 }}元</span
|
|
|
|
|
|
+ >{{
|
|
|
|
+ item.skuPriceList ? item.skuPriceList[0].price : 0
|
|
|
|
+ }}元</span
|
|
>
|
|
>
|
|
|
|
|
|
<span>/{{ form.unit }}</span>
|
|
<span>/{{ form.unit }}</span>
|
|
@@ -80,7 +85,9 @@
|
|
<div v-for="(item, index) in form.skuList" :key="index">
|
|
<div v-for="(item, index) in form.skuList" :key="index">
|
|
<div class="price_info">
|
|
<div class="price_info">
|
|
<span
|
|
<span
|
|
- >{{ item.skuSpecsList[0] ? item.skuSpecsList[0].specsName : "" }}
|
|
|
|
|
|
+ >{{
|
|
|
|
+ item.skuSpecsList[0] ? item.skuSpecsList[0].specsName : ""
|
|
|
|
+ }}
|
|
{{
|
|
{{
|
|
item.skuSpecsList[0].specsValue
|
|
item.skuSpecsList[0].specsValue
|
|
? item.skuSpecsList[0].specsValue
|
|
? item.skuSpecsList[0].specsValue
|
|
@@ -117,7 +124,8 @@
|
|
}}/{{ form.unit }}起购</span
|
|
}}/{{ form.unit }}起购</span
|
|
>
|
|
>
|
|
<span style="font-size: 14px"
|
|
<span style="font-size: 14px"
|
|
- >库存:{{ item.stock + item.predictStocks }}{{ form.unit }}</span
|
|
|
|
|
|
+ >库存:{{ item.stock + item.predictStocks
|
|
|
|
+ }}{{ form.unit }}</span
|
|
>
|
|
>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
@@ -135,7 +143,11 @@
|
|
<el-col :span="24">
|
|
<el-col :span="24">
|
|
<el-form-item label="发货地" prop="spuName">
|
|
<el-form-item label="发货地" prop="spuName">
|
|
<div style="width: 185px">
|
|
<div style="width: 185px">
|
|
- {{ form.shippingAddrBean ? form.shippingAddrBean.addr : "" }}
|
|
|
|
|
|
+ {{
|
|
|
|
+ form.shippingAddrBean
|
|
|
|
+ ? form.shippingAddrBean.addr
|
|
|
|
+ : ""
|
|
|
|
+ }}
|
|
{{
|
|
{{
|
|
form.shippingAddrBean
|
|
form.shippingAddrBean
|
|
? form.shippingAddrBean.addrDetail
|
|
? form.shippingAddrBean.addrDetail
|
|
@@ -267,11 +279,15 @@ export default {
|
|
mounted() {
|
|
mounted() {
|
|
this.getInfo();
|
|
this.getInfo();
|
|
if (
|
|
if (
|
|
- (this.$route.query.params != "[object Object]" && this.$route.query.params) ||
|
|
|
|
|
|
+ (this.$route.query.params != "[object Object]" &&
|
|
|
|
+ this.$route.query.params) ||
|
|
JSON.parse(localStorage.getItem("productInfo"))
|
|
JSON.parse(localStorage.getItem("productInfo"))
|
|
) {
|
|
) {
|
|
let info = {};
|
|
let info = {};
|
|
- if (this.$route.query.params != "[object Object]" && this.$route.query.params) {
|
|
|
|
|
|
+ if (
|
|
|
|
+ this.$route.query.params != "[object Object]" &&
|
|
|
|
+ this.$route.query.params
|
|
|
|
+ ) {
|
|
info = this.$route.query.params;
|
|
info = this.$route.query.params;
|
|
} else {
|
|
} else {
|
|
info = JSON.parse(localStorage.getItem("productInfo"));
|
|
info = JSON.parse(localStorage.getItem("productInfo"));
|
|
@@ -367,7 +383,6 @@ export default {
|
|
},
|
|
},
|
|
methods: {
|
|
methods: {
|
|
skuRemove(list) {
|
|
skuRemove(list) {
|
|
- console.log("list", list);
|
|
|
|
this.skulist = list;
|
|
this.skulist = list;
|
|
},
|
|
},
|
|
getInfo() {
|
|
getInfo() {
|
|
@@ -406,12 +421,15 @@ export default {
|
|
submitFormDraft() {
|
|
submitFormDraft() {
|
|
if (!this.form.presaleStartTime && !this.form.presaleEndTime) {
|
|
if (!this.form.presaleStartTime && !this.form.presaleEndTime) {
|
|
if (this.form.datePicke) {
|
|
if (this.form.datePicke) {
|
|
- this.form.presaleStartTime = moment(this.form.datePicker[0]).valueOf();
|
|
|
|
|
|
+ this.form.presaleStartTime = moment(
|
|
|
|
+ this.form.datePicker[0]
|
|
|
|
+ ).valueOf();
|
|
this.form.presaleEndTime = moment(this.form.datePicker[1]).valueOf();
|
|
this.form.presaleEndTime = moment(this.form.datePicker[1]).valueOf();
|
|
}
|
|
}
|
|
}
|
|
}
|
|
if (this.form.categoryId?.length > 0) {
|
|
if (this.form.categoryId?.length > 0) {
|
|
- this.form.categoryId = this.form.categoryId[this.form.categoryId.length - 1];
|
|
|
|
|
|
+ this.form.categoryId =
|
|
|
|
+ this.form.categoryId[this.form.categoryId.length - 1];
|
|
}
|
|
}
|
|
// if (this.form.bannerList?.length > 0) {
|
|
// if (this.form.bannerList?.length > 0) {
|
|
// this.form.bannerList.shift();
|
|
// this.form.bannerList.shift();
|
|
@@ -443,25 +461,30 @@ export default {
|
|
this.$message.error(`商品规格不能为空`);
|
|
this.$message.error(`商品规格不能为空`);
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
- // if (this.form.bannerList?.length > 0) {
|
|
|
|
- // this.form.bannerList.shift();
|
|
|
|
- // }
|
|
|
|
|
|
+ if (!this.form.shippingAddrBean.provinceCode) {
|
|
|
|
+ this.$message.error(`请选择发货地址的省市区!`);
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
this.btnLading = true;
|
|
this.btnLading = true;
|
|
-
|
|
|
|
if (!this.form.presaleStartTime && !this.form.presaleEndTime) {
|
|
if (!this.form.presaleStartTime && !this.form.presaleEndTime) {
|
|
if (this.form.datePicke) {
|
|
if (this.form.datePicke) {
|
|
- this.form.presaleStartTime = moment(this.form.datePicker[0]).valueOf();
|
|
|
|
|
|
+ this.form.presaleStartTime = moment(
|
|
|
|
+ this.form.datePicker[0]
|
|
|
|
+ ).valueOf();
|
|
this.form.presaleEndTime = moment(this.form.datePicker[1]).valueOf();
|
|
this.form.presaleEndTime = moment(this.form.datePicker[1]).valueOf();
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
if (this.form.categoryId?.length > 0) {
|
|
if (this.form.categoryId?.length > 0) {
|
|
- this.form.categoryId = this.form.categoryId[this.form.categoryId.length - 1];
|
|
|
|
|
|
+ this.form.categoryId =
|
|
|
|
+ this.form.categoryId[this.form.categoryId.length - 1];
|
|
}
|
|
}
|
|
|
|
|
|
if (this.form.id) {
|
|
if (this.form.id) {
|
|
if (this.skulist?.length > 0) {
|
|
if (this.skulist?.length > 0) {
|
|
- removeSkuBySkuId({ skuIds: this.skulist.toString() }).then((res) => {});
|
|
|
|
|
|
+ removeSkuBySkuId({ skuIds: this.skulist.toString() }).then(
|
|
|
|
+ (res) => {}
|
|
|
|
+ );
|
|
}
|
|
}
|
|
if (this.form.skuList.length < 1 || this.form.skuList === "") {
|
|
if (this.form.skuList.length < 1 || this.form.skuList === "") {
|
|
this.$message.error(`规格不能为空`);
|
|
this.$message.error(`规格不能为空`);
|
|
@@ -519,8 +542,6 @@ export default {
|
|
});
|
|
});
|
|
}
|
|
}
|
|
this.headerImg.sort((a, b) => a.sort - b.sort); //排序 视频在最前面>封面>商品banner
|
|
this.headerImg.sort((a, b) => a.sort - b.sort); //排序 视频在最前面>封面>商品banner
|
|
-
|
|
|
|
- console.log("1231231", this.form);
|
|
|
|
},
|
|
},
|
|
unique(arr) {
|
|
unique(arr) {
|
|
const res = new Map();
|
|
const res = new Map();
|