|
@@ -135,7 +135,6 @@
|
|
|
</el-input-number>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
- <!-- <el-table-column prop="name" label="原价" width="180"> </el-table-column> -->
|
|
|
<el-table-column prop="address" label="商品单价" width="80">
|
|
|
<template slot-scope="scope">
|
|
|
{{ computePrice(scope.row) }}元/{{ form.unit }}
|
|
@@ -222,12 +221,13 @@
|
|
|
</el-input-number>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
- <el-table-column label="批发价" width="160">
|
|
|
+
|
|
|
+ <el-table-column label="原价" width="160" v-if="saleType == 4">
|
|
|
<template slot-scope="scope">
|
|
|
<el-input-number
|
|
|
:controls="false"
|
|
|
v-model="scope.row.skuPriceList[0].originalPrice"
|
|
|
- placeholder="收购价"
|
|
|
+ placeholder="原价"
|
|
|
clearable
|
|
|
@input="passValue"
|
|
|
>
|
|
@@ -235,17 +235,52 @@
|
|
|
</el-input-number>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
- <el-table-column prop="address" label="商品单价" width="80">
|
|
|
+ <el-table-column label="现价" width="160" v-if="saleType == 4">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <el-input-number
|
|
|
+ :controls="false"
|
|
|
+ v-model="scope.row.skuPriceList[0].price"
|
|
|
+ placeholder="现价"
|
|
|
+ clearable
|
|
|
+ @input="passValue"
|
|
|
+ >
|
|
|
+ <template slot="suffix"> {{ form.unit }}/元 </template>
|
|
|
+ </el-input-number>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+
|
|
|
+ <el-table-column label="批发价" width="160" v-if="saleType != 4">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <el-input-number
|
|
|
+ :controls="false"
|
|
|
+ v-model="scope.row.skuPriceList[0].originalPrice"
|
|
|
+ placeholder="批发价"
|
|
|
+ clearable
|
|
|
+ @input="passValue"
|
|
|
+ >
|
|
|
+ <template slot="suffix"> {{ form.unit }}/元 </template>
|
|
|
+ </el-input-number>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column
|
|
|
+ prop="address"
|
|
|
+ label="商品单价"
|
|
|
+ width="80"
|
|
|
+ v-if="saleType == 4"
|
|
|
+ >
|
|
|
+ <template slot-scope="scope">
|
|
|
+ {{ compilatePrice(scope.row.skuPriceList[0]) }}
|
|
|
+ 元/{{ form.unit }}
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column prop="address" label="商品单价" width="80" v-else>
|
|
|
<template slot-scope="scope">
|
|
|
{{
|
|
|
- scope.row.skuPriceList[0].originalPrice
|
|
|
- ? scope.row.skuPriceList[0].originalPrice
|
|
|
- : 0
|
|
|
+ scope.row.skuPriceList[0].price ? scope.row.skuPriceList[0].price : 0
|
|
|
}}
|
|
|
元/{{ form.unit }}
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
-
|
|
|
<el-table-column label="净重量" width="160">
|
|
|
<template slot-scope="scope">
|
|
|
<el-input-number
|
|
@@ -411,7 +446,7 @@ import { getStoreInfo } from "@/api/common/index";
|
|
|
import Amap from "@/components/Map/map.vue";
|
|
|
import { getDict } from "@/api/common/index.js";
|
|
|
export default {
|
|
|
- props: ["data"],
|
|
|
+ props: ["data", "saleType"],
|
|
|
components: { Amap },
|
|
|
data() {
|
|
|
return {
|
|
@@ -449,6 +484,7 @@ export default {
|
|
|
],
|
|
|
},
|
|
|
shopInfo: {},
|
|
|
+ saleType: undefined,
|
|
|
};
|
|
|
},
|
|
|
mounted() {
|
|
@@ -488,8 +524,23 @@ export default {
|
|
|
deep: true, //深度监听
|
|
|
immediate: true,
|
|
|
},
|
|
|
+ saleType: {
|
|
|
+ handler(newVal, oldVal) {
|
|
|
+ console.log("123123", newVal);
|
|
|
+ this.saleType = newVal;
|
|
|
+ },
|
|
|
+ },
|
|
|
},
|
|
|
methods: {
|
|
|
+ compilatePrice(data) {
|
|
|
+ if (data.price) {
|
|
|
+ return data.price;
|
|
|
+ } else if (data.originalPrice) {
|
|
|
+ return data.originalPrice;
|
|
|
+ } else if (data.originalPrice && data.price) {
|
|
|
+ return data.price;
|
|
|
+ }
|
|
|
+ },
|
|
|
formvalidate() {
|
|
|
let that = this;
|
|
|
return new Promise((resolve) => {
|
|
@@ -498,6 +549,12 @@ export default {
|
|
|
if (valid) {
|
|
|
resolve(valid);
|
|
|
} else {
|
|
|
+ for (const key in row) {
|
|
|
+ for (let index = 0; index < row[key].length; index++) {
|
|
|
+ this.$message.error(row[key][index].message);
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ }
|
|
|
resolve(valid);
|
|
|
}
|
|
|
});
|
|
@@ -539,9 +596,12 @@ export default {
|
|
|
} else {
|
|
|
return 0;
|
|
|
}
|
|
|
+ } else {
|
|
|
+ console.log("1231231", data);
|
|
|
}
|
|
|
},
|
|
|
- passValue() {
|
|
|
+
|
|
|
+ passValue(val) {
|
|
|
if (this.shopInfo.scope == 0) {
|
|
|
this.form.skuList.forEach((e) => {
|
|
|
e.skuPriceList.forEach((a) => {
|
|
@@ -550,12 +610,15 @@ export default {
|
|
|
a.lowestPrice = this.computePrice(e);
|
|
|
});
|
|
|
});
|
|
|
- } else {
|
|
|
- this.form.skuList.forEach((e) => {
|
|
|
- e.skuPriceList.forEach((a) => {
|
|
|
- a.price = a.originalPrice;
|
|
|
+ }
|
|
|
+ else {
|
|
|
+ if (this.saleType != 4) {
|
|
|
+ this.form.skuList.forEach((e) => {
|
|
|
+ e.skuPriceList.forEach((a) => {
|
|
|
+ a.price = a.originalPrice;
|
|
|
+ });
|
|
|
});
|
|
|
- });
|
|
|
+ }
|
|
|
}
|
|
|
this.$emit("updateValue", this.form);
|
|
|
},
|
|
@@ -571,7 +634,6 @@ export default {
|
|
|
this.form.shippingAddrBean.longitude = data.location.lng;
|
|
|
}
|
|
|
this.form.shippingAddrBean.provinceCode = data.pcode;
|
|
|
- this.form.skuList = [];
|
|
|
this.addr = data.address;
|
|
|
this.$refs.mapOpen.closeMap();
|
|
|
this.passValue();
|