|
@@ -93,7 +93,7 @@
|
|
/>
|
|
/>
|
|
</template>
|
|
</template>
|
|
</el-table-column>
|
|
</el-table-column>
|
|
- <el-table-column prop="name" label="预计库存" width="160">
|
|
|
|
|
|
+ <el-table-column prop="name" label="预计库存" width="140">
|
|
<template slot-scope="scope">
|
|
<template slot-scope="scope">
|
|
<el-input-number
|
|
<el-input-number
|
|
:controls="false"
|
|
:controls="false"
|
|
@@ -186,7 +186,44 @@
|
|
</el-input-number>
|
|
</el-input-number>
|
|
</template>
|
|
</template>
|
|
</el-table-column>
|
|
</el-table-column>
|
|
- <el-table-column prop="address" label="商品单价" width="140">
|
|
|
|
|
|
+
|
|
|
|
+ <el-table-column
|
|
|
|
+ prop="presaleTotalPrice"
|
|
|
|
+ label="预售总价"
|
|
|
|
+ width="140"
|
|
|
|
+ v-if="saleModel == 2"
|
|
|
|
+ >
|
|
|
|
+ <template slot-scope="scope">
|
|
|
|
+ <el-input-number
|
|
|
|
+ :controls="false"
|
|
|
|
+ @input="passValue"
|
|
|
|
+ v-model="scope.row.skuPriceList[0].presaleTotalPrice"
|
|
|
|
+ placeholder="预售总价"
|
|
|
|
+ clearable
|
|
|
|
+ >
|
|
|
|
+ <template slot="suffix"> {{ form.unit }}/元 </template>
|
|
|
|
+ </el-input-number>
|
|
|
|
+ </template>
|
|
|
|
+ </el-table-column>
|
|
|
|
+ <el-table-column
|
|
|
|
+ prop="address"
|
|
|
|
+ label="预售定金"
|
|
|
|
+ width="140"
|
|
|
|
+ v-if="saleModel == 2"
|
|
|
|
+ >
|
|
|
|
+ <template slot-scope="scope">
|
|
|
|
+ <el-input-number
|
|
|
|
+ :controls="false"
|
|
|
|
+ @input="passValue"
|
|
|
|
+ v-model="scope.row.skuPriceList[0].downPayPrice"
|
|
|
|
+ placeholder="预售定金"
|
|
|
|
+ clearable
|
|
|
|
+ >
|
|
|
|
+ <template slot="suffix"> {{ form.unit }}/元 </template>
|
|
|
|
+ </el-input-number>
|
|
|
|
+ </template>
|
|
|
|
+ </el-table-column>
|
|
|
|
+ <el-table-column prop="address" label="商品单价" width="100">
|
|
<template slot-scope="scope">
|
|
<template slot-scope="scope">
|
|
{{ computePrice(scope.row) }}元/{{ form.unit }}
|
|
{{ computePrice(scope.row) }}元/{{ form.unit }}
|
|
</template>
|
|
</template>
|
|
@@ -324,36 +361,25 @@
|
|
</el-form-item>
|
|
</el-form-item>
|
|
</el-col>
|
|
</el-col>
|
|
<el-col :span="24" style="margin-top: 20px">
|
|
<el-col :span="24" style="margin-top: 20px">
|
|
- <el-form-item prop="shippingAddrBean.addrDetail">
|
|
|
|
|
|
+ <el-form-item prop="shippingAddrId">
|
|
<span slot="label"> 发货地址</span>
|
|
<span slot="label"> 发货地址</span>
|
|
- <div style="display: flex; flex-direction: row; align-items: center">
|
|
|
|
- <el-button
|
|
|
|
- @click="selectAddr"
|
|
|
|
- type="text"
|
|
|
|
- style="
|
|
|
|
- font-size: 16px;
|
|
|
|
- display: flex;
|
|
|
|
- flex-direction: row;
|
|
|
|
- align-items: center;
|
|
|
|
- "
|
|
|
|
- ><img
|
|
|
|
- src="@/assets/images/point.png"
|
|
|
|
- style="width: 20px; height: 20px"
|
|
|
|
- />
|
|
|
|
- 选择地址</el-button
|
|
|
|
|
|
+ <el-select
|
|
|
|
+ v-model="form.shippingAddrId"
|
|
|
|
+ placeholder="请选择"
|
|
|
|
+ style="width: 300px"
|
|
|
|
+ @change="passValue"
|
|
|
|
+ >
|
|
|
|
+ <el-option
|
|
|
|
+ v-for="item in options"
|
|
|
|
+ :key="item.id"
|
|
|
|
+ :label="item.address"
|
|
|
|
+ :value="item.id"
|
|
>
|
|
>
|
|
- <span style="margin-left: 20px">已选择地址:{{ addr }}</span>
|
|
|
|
- </div>
|
|
|
|
-
|
|
|
|
- <el-input
|
|
|
|
- type="textarea"
|
|
|
|
- :rows="3"
|
|
|
|
- placeholder="请输入详细地址"
|
|
|
|
- v-model="form.shippingAddrBean.addrDetail"
|
|
|
|
- style="width: 700px"
|
|
|
|
- @blur="passValue"
|
|
|
|
|
|
+ </el-option>
|
|
|
|
+ </el-select>
|
|
|
|
+ <el-button type="text" @click="areaAdd" style="margin-left: 10px">
|
|
|
|
+ 没有所需地址?前去添加</el-button
|
|
>
|
|
>
|
|
- </el-input>
|
|
|
|
</el-form-item>
|
|
</el-form-item>
|
|
</el-col>
|
|
</el-col>
|
|
<el-col :span="24">
|
|
<el-col :span="24">
|
|
@@ -381,6 +407,7 @@ import { getMerchantClassifyList } from "@/api/sort/index.js";
|
|
import { getStoreInfo } from "@/api/common/index";
|
|
import { getStoreInfo } from "@/api/common/index";
|
|
import Amap from "@/components/Map/map.vue";
|
|
import Amap from "@/components/Map/map.vue";
|
|
import { getDict } from "@/api/common/index.js";
|
|
import { getDict } from "@/api/common/index.js";
|
|
|
|
+import { dxAddressList } from "@/api/manage/address";
|
|
export default {
|
|
export default {
|
|
props: ["data", "saleType", "saleModels"],
|
|
props: ["data", "saleType", "saleModels"],
|
|
components: { Amap },
|
|
components: { Amap },
|
|
@@ -408,6 +435,7 @@ export default {
|
|
merchantClassifyId: "",
|
|
merchantClassifyId: "",
|
|
merchantClassifyIds: [],
|
|
merchantClassifyIds: [],
|
|
merchantClassifyName: "",
|
|
merchantClassifyName: "",
|
|
|
|
+ shippingAddrId: "",
|
|
},
|
|
},
|
|
addr: "",
|
|
addr: "",
|
|
measure: [],
|
|
measure: [],
|
|
@@ -429,8 +457,8 @@ export default {
|
|
packing: [
|
|
packing: [
|
|
{ required: true, message: "包装方式不能为空", trigger: "blur" },
|
|
{ required: true, message: "包装方式不能为空", trigger: "blur" },
|
|
],
|
|
],
|
|
- "shippingAddrBean.addrDetail": [
|
|
|
|
- { required: true, message: "详细地址不能为空", trigger: "blur" },
|
|
|
|
|
|
+ shippingAddrId: [
|
|
|
|
+ { required: true, message: "请选择地址", trigger: "blur" },
|
|
],
|
|
],
|
|
merchantClassifyIds: [
|
|
merchantClassifyIds: [
|
|
{ required: true, message: "店铺所属分类不能为空", trigger: "blur" },
|
|
{ required: true, message: "店铺所属分类不能为空", trigger: "blur" },
|
|
@@ -449,6 +477,7 @@ export default {
|
|
label: "label",
|
|
label: "label",
|
|
value: "value",
|
|
value: "value",
|
|
},
|
|
},
|
|
|
|
+ options: [],
|
|
};
|
|
};
|
|
},
|
|
},
|
|
watch: {
|
|
watch: {
|
|
@@ -461,9 +490,19 @@ export default {
|
|
mounted() {
|
|
mounted() {
|
|
this.getInfo();
|
|
this.getInfo();
|
|
this.getdictImpl();
|
|
this.getdictImpl();
|
|
|
|
+ this.getAreaList();
|
|
},
|
|
},
|
|
-
|
|
|
|
methods: {
|
|
methods: {
|
|
|
|
+ areaAdd() {
|
|
|
|
+ this.$router.push({ path: "/manage/manage/address/index" });
|
|
|
|
+ },
|
|
|
|
+ getAreaList() {
|
|
|
|
+ dxAddressList().then((res) => {
|
|
|
|
+ if (res.code == 200) {
|
|
|
|
+ this.options = res.data;
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+ },
|
|
categoryLazyLoad(node, resolve) {
|
|
categoryLazyLoad(node, resolve) {
|
|
let level = node.level;
|
|
let level = node.level;
|
|
if (!node.data) {
|
|
if (!node.data) {
|
|
@@ -511,40 +550,59 @@ export default {
|
|
this.passValue();
|
|
this.passValue();
|
|
},
|
|
},
|
|
getFormInfo(record) {
|
|
getFormInfo(record) {
|
|
- this.form.merchantClassifyName = record.merchantClassifyName;
|
|
|
|
- this.saleModel = record.saleModel;
|
|
|
|
- this.addr = record.shippingAddr;
|
|
|
|
- this.form.expressType = record.expressType;
|
|
|
|
- this.form.shareRate = record.shareRate;
|
|
|
|
- this.form.merchantClassifyIds = record.merchantClassifyId;
|
|
|
|
- this.form.merchantClassifyId = record.merchantClassifyId;
|
|
|
|
- this.form.shippingAddrBean = {
|
|
|
|
- addr: record.shippingAddr,
|
|
|
|
- addrDetail: record.shippingAddrBean
|
|
|
|
- ? record.shippingAddrBean.addrDetail
|
|
|
|
- : undefined,
|
|
|
|
- cityCode: record.cityCode,
|
|
|
|
- countyCode: record.countyCode,
|
|
|
|
- latitude: record.latitude,
|
|
|
|
- longitude: record.longitude,
|
|
|
|
- provinceCode: record.provinceCode,
|
|
|
|
|
|
+ // 基础属性赋值
|
|
|
|
+ const {
|
|
|
|
+ shippingAddrId,
|
|
|
|
+ merchantClassifyName,
|
|
|
|
+ saleModel,
|
|
|
|
+ shippingAddr: addr,
|
|
|
|
+ expressType,
|
|
|
|
+ shareRate,
|
|
|
|
+ merchantClassifyId,
|
|
|
|
+ lookSalesVolume,
|
|
|
|
+ unit,
|
|
|
|
+ packing,
|
|
|
|
+ shippingTimeDesc,
|
|
|
|
+ freeShipping,
|
|
|
|
+ skuList,
|
|
|
|
+ props = [], // 默认空数组避免后续判断
|
|
|
|
+ } = record;
|
|
|
|
+
|
|
|
|
+ // 更新表单数据
|
|
|
|
+ this.form = {
|
|
|
|
+ ...this.form, // 保留原有属性
|
|
|
|
+ shippingAddrId,
|
|
|
|
+ merchantClassifyName,
|
|
|
|
+ expressType,
|
|
|
|
+ shareRate,
|
|
|
|
+ merchantClassifyIds: merchantClassifyId,
|
|
|
|
+ merchantClassifyId,
|
|
|
|
+ lookSalesVolume,
|
|
|
|
+ unit,
|
|
|
|
+ shippingAddr: addr,
|
|
|
|
+ packing,
|
|
|
|
+ shippingTimeDesc,
|
|
|
|
+ freeShipping: this.form.freeShipping
|
|
|
|
+ ? freeShipping
|
|
|
|
+ : this.form.freeShipping,
|
|
|
|
+ skuList,
|
|
|
|
+ props, // 已默认处理空值情况
|
|
|
|
+ shippingAddrBean: {
|
|
|
|
+ addr,
|
|
|
|
+ addrDetail: record.shippingAddrBean?.addrDetail,
|
|
|
|
+ cityCode: record.cityCode,
|
|
|
|
+ countyCode: record.countyCode,
|
|
|
|
+ latitude: record.latitude,
|
|
|
|
+ longitude: record.longitude,
|
|
|
|
+ provinceCode: record.provinceCode,
|
|
|
|
+ },
|
|
};
|
|
};
|
|
- if (record.props && record.props?.length < 1) {
|
|
|
|
- this.form.props = [];
|
|
|
|
- } else if (!record.props) {
|
|
|
|
- this.form.props = [];
|
|
|
|
- } else {
|
|
|
|
- this.form.props = record.props;
|
|
|
|
- }
|
|
|
|
- this.form.lookSalesVolume = record.lookSalesVolume;
|
|
|
|
- this.form.unit = record.unit;
|
|
|
|
- this.form.shippingAddr = record.shippingAddr;
|
|
|
|
- this.form.packing = record.packing;
|
|
|
|
- this.form.shippingTimeDesc = record.shippingTimeDesc;
|
|
|
|
- if (this.form.freeShipping) {
|
|
|
|
- this.form.freeShipping = record.freeShipping;
|
|
|
|
- }
|
|
|
|
- this.form.skuList = record.skuList;
|
|
|
|
|
|
+
|
|
|
|
+ console.log(this.form);
|
|
|
|
+
|
|
|
|
+ // 独立处理特殊属性
|
|
|
|
+ this.saleModel = saleModel;
|
|
|
|
+ this.addr = addr;
|
|
},
|
|
},
|
|
compilatePrice(data) {
|
|
compilatePrice(data) {
|
|
if (data.price) {
|
|
if (data.price) {
|
|
@@ -613,12 +671,13 @@ export default {
|
|
passValue() {
|
|
passValue() {
|
|
this.form.skuList.forEach((e) => {
|
|
this.form.skuList.forEach((e) => {
|
|
e.skuPriceList.forEach((a) => {
|
|
e.skuPriceList.forEach((a) => {
|
|
|
|
+ e.presaleTotalPrice = a.presaleTotalPrice;
|
|
|
|
+ e.downPayPrice = a.downPayPrice;
|
|
a.price = this.computePrice(e);
|
|
a.price = this.computePrice(e);
|
|
a.originalPrice = this.computePrice(e);
|
|
a.originalPrice = this.computePrice(e);
|
|
a.lowestPrice = this.computePrice(e);
|
|
a.lowestPrice = this.computePrice(e);
|
|
});
|
|
});
|
|
});
|
|
});
|
|
-
|
|
|
|
this.$emit("updateValue", this.form);
|
|
this.$emit("updateValue", this.form);
|
|
},
|
|
},
|
|
|
|
|