添加预售
This commit is contained in:
parent
7225340c62
commit
e2451fb087
|
@ -1,7 +1,7 @@
|
||||||
import $http from "@/utils/httpRequest.js";
|
import $http from "@/utils/httpRequest.js";
|
||||||
|
|
||||||
export const preSale = {
|
export const preSale = {
|
||||||
//优惠券列表
|
//预售商品列表
|
||||||
preSaleProducts: (data) => {
|
preSaleProducts: (data) => {
|
||||||
return $http.request({
|
return $http.request({
|
||||||
url: `/merchant-api/product/advance/sell/page`,
|
url: `/merchant-api/product/advance/sell/page`,
|
||||||
|
@ -9,4 +9,11 @@ export const preSale = {
|
||||||
data,
|
data,
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
addPreSaleProducts: (data) => {
|
||||||
|
return $http.request({
|
||||||
|
url: `/merchant-api/product/batch/save/advance/sell`,
|
||||||
|
method: "post",
|
||||||
|
data,
|
||||||
|
});
|
||||||
|
},
|
||||||
};
|
};
|
||||||
|
|
|
@ -130,6 +130,7 @@ export default {
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
activeName: "5",
|
activeName: "5",
|
||||||
|
advanceSellStatus: "",
|
||||||
dataList: [],
|
dataList: [],
|
||||||
formInline: {
|
formInline: {
|
||||||
name: "",
|
name: "",
|
||||||
|
@ -237,7 +238,7 @@ export default {
|
||||||
pageNumber: pageNo,
|
pageNumber: pageNo,
|
||||||
pageSize: pageSize,
|
pageSize: pageSize,
|
||||||
...this.formInline,
|
...this.formInline,
|
||||||
advanceSellStatus: this.activeName,
|
advanceSellStatus: this.advanceSellStatus,
|
||||||
merchantId: JSON.parse(sessionStorage.getItem("userInfo")).merchantId,
|
merchantId: JSON.parse(sessionStorage.getItem("userInfo")).merchantId,
|
||||||
productQuerySortParam: [],
|
productQuerySortParam: [],
|
||||||
})
|
})
|
||||||
|
@ -261,6 +262,12 @@ export default {
|
||||||
this.$refs.oTable.reload();
|
this.$refs.oTable.reload();
|
||||||
},
|
},
|
||||||
handleClick(e) {
|
handleClick(e) {
|
||||||
|
console.log(e.name);
|
||||||
|
if (e.name == "5") {
|
||||||
|
this.advanceSellStatus = "";
|
||||||
|
} else {
|
||||||
|
this.advanceSellStatus = e.name;
|
||||||
|
}
|
||||||
this.$refs.oTable.reload();
|
this.$refs.oTable.reload();
|
||||||
},
|
},
|
||||||
addEarlyWarning() {
|
addEarlyWarning() {
|
||||||
|
@ -275,7 +282,7 @@ export default {
|
||||||
{
|
{
|
||||||
title: "商品ID",
|
title: "商品ID",
|
||||||
align: "center",
|
align: "center",
|
||||||
field: "name",
|
field: "id",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: "商品图",
|
title: "商品图",
|
||||||
|
@ -301,7 +308,15 @@ export default {
|
||||||
{
|
{
|
||||||
title: "定金支付时间",
|
title: "定金支付时间",
|
||||||
align: "center",
|
align: "center",
|
||||||
field: "name",
|
field: "startTime",
|
||||||
|
type: "jsx",
|
||||||
|
render: ({ row }) => {
|
||||||
|
return (
|
||||||
|
<span>
|
||||||
|
{row.startTime}至{row.endTime}
|
||||||
|
</span>
|
||||||
|
);
|
||||||
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: "尾款支付时间",
|
title: "尾款支付时间",
|
||||||
|
@ -309,15 +324,11 @@ export default {
|
||||||
field: "minSalePrice",
|
field: "minSalePrice",
|
||||||
type: "jsx",
|
type: "jsx",
|
||||||
render: ({ row }) => {
|
render: ({ row }) => {
|
||||||
if (row.minSalePrice == row.maxSalePrice) {
|
return (
|
||||||
return <span>¥{row.minSalePrice}</span>;
|
<span>
|
||||||
} else {
|
{row.balancePaymentStartTime}至{row.balancePaymentEndTime}
|
||||||
return (
|
</span>
|
||||||
<span>
|
);
|
||||||
¥{row.minSalePrice}~¥{row.maxSalePrice}
|
|
||||||
</span>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
@ -334,12 +345,96 @@ export default {
|
||||||
{
|
{
|
||||||
title: "定金",
|
title: "定金",
|
||||||
align: "center",
|
align: "center",
|
||||||
field: "saleNum",
|
field: "earnestMoney",
|
||||||
|
type: "jsx",
|
||||||
|
render: ({ row }) => {
|
||||||
|
if (
|
||||||
|
Math.min.apply(
|
||||||
|
Math,
|
||||||
|
row.productSpecificationList.map((item) => item.earnestMoney)
|
||||||
|
) ==
|
||||||
|
Math.max.apply(
|
||||||
|
Math,
|
||||||
|
row.productSpecificationList.map((item) => item.earnestMoney)
|
||||||
|
)
|
||||||
|
) {
|
||||||
|
return (
|
||||||
|
<span>
|
||||||
|
{Math.min.apply(
|
||||||
|
Math,
|
||||||
|
row.productSpecificationList.map(
|
||||||
|
(item) => item.earnestMoney
|
||||||
|
)
|
||||||
|
)}
|
||||||
|
</span>
|
||||||
|
);
|
||||||
|
} else {
|
||||||
|
return (
|
||||||
|
<span>
|
||||||
|
{Math.min.apply(
|
||||||
|
Math,
|
||||||
|
row.productSpecificationList.map(
|
||||||
|
(item) => item.earnestMoney
|
||||||
|
)
|
||||||
|
)}
|
||||||
|
至
|
||||||
|
{Math.max.apply(
|
||||||
|
Math,
|
||||||
|
row.productSpecificationList.map(
|
||||||
|
(item) => item.earnestMoney
|
||||||
|
)
|
||||||
|
)}
|
||||||
|
</span>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: "尾款",
|
title: "尾款",
|
||||||
align: "center",
|
align: "center",
|
||||||
field: "stockNum",
|
field: "balancePayment",
|
||||||
|
type: "jsx",
|
||||||
|
render: ({ row }) => {
|
||||||
|
if (
|
||||||
|
Math.min.apply(
|
||||||
|
Math,
|
||||||
|
row.productSpecificationList.map((item) => item.balancePayment)
|
||||||
|
) ==
|
||||||
|
Math.max.apply(
|
||||||
|
Math,
|
||||||
|
row.productSpecificationList.map((item) => item.balancePayment)
|
||||||
|
)
|
||||||
|
) {
|
||||||
|
return (
|
||||||
|
<span>
|
||||||
|
{Math.min.apply(
|
||||||
|
Math,
|
||||||
|
row.productSpecificationList.map(
|
||||||
|
(item) => item.balancePayment
|
||||||
|
)
|
||||||
|
)}
|
||||||
|
</span>
|
||||||
|
);
|
||||||
|
} else {
|
||||||
|
return (
|
||||||
|
<span>
|
||||||
|
{Math.min.apply(
|
||||||
|
Math,
|
||||||
|
row.productSpecificationList.map(
|
||||||
|
(item) => item.balancePayment
|
||||||
|
)
|
||||||
|
)}
|
||||||
|
至
|
||||||
|
{Math.max.apply(
|
||||||
|
Math,
|
||||||
|
row.productSpecificationList.map(
|
||||||
|
(item) => item.balancePayment
|
||||||
|
)
|
||||||
|
)}
|
||||||
|
</span>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: "状态",
|
title: "状态",
|
||||||
|
@ -347,10 +442,14 @@ export default {
|
||||||
field: "status",
|
field: "status",
|
||||||
type: "jsx",
|
type: "jsx",
|
||||||
render: ({ row }) => {
|
render: ({ row }) => {
|
||||||
if (row.status == "DOWN") {
|
if (row.advanceSellStatus == "0") {
|
||||||
return <span>未开始</span>;
|
return <span>未开始</span>;
|
||||||
} else {
|
} else if (row.advanceSellStatus == "1") {
|
||||||
return <span>上架</span>;
|
return <span>进行中</span>;
|
||||||
|
} else if (row.advanceSellStatus == "2") {
|
||||||
|
return <span>已结束</span>;
|
||||||
|
} else if (row.advanceSellStatus == "3") {
|
||||||
|
return <span>已关闭</span>;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
@ -363,7 +462,6 @@ export default {
|
||||||
render: ({ row }) => {
|
render: ({ row }) => {
|
||||||
let edit = () => {
|
let edit = () => {
|
||||||
console.log(row);
|
console.log(row);
|
||||||
|
|
||||||
this.$refs.addOrUpdate.toggle(row).update();
|
this.$refs.addOrUpdate.toggle(row).update();
|
||||||
};
|
};
|
||||||
let priceAdjustment = () => {
|
let priceAdjustment = () => {
|
||||||
|
@ -386,12 +484,7 @@ export default {
|
||||||
>
|
>
|
||||||
查看
|
查看
|
||||||
</el-button>
|
</el-button>
|
||||||
<el-button
|
<el-button size="mini" type="primary" onClick={edit}>
|
||||||
size="mini"
|
|
||||||
disabled={row.status != "DOWN"}
|
|
||||||
type="primary"
|
|
||||||
onClick={edit}
|
|
||||||
>
|
|
||||||
编辑
|
编辑
|
||||||
</el-button>
|
</el-button>
|
||||||
|
|
||||||
|
|
|
@ -17,42 +17,66 @@
|
||||||
>
|
>
|
||||||
<el-row>
|
<el-row>
|
||||||
<el-col :span="12">
|
<el-col :span="12">
|
||||||
<el-form-item label="订金支付时间:" prop="name">
|
<el-form-item label="订金支付时间:" prop="startTime">
|
||||||
<el-date-picker
|
<el-date-picker
|
||||||
@change="getOrderTime"
|
@change="getOrderTime"
|
||||||
|
format="yyyy-MM-dd HH:mm:ss"
|
||||||
|
data-format="yyyy-MM-dd HH:mm:ss"
|
||||||
|
value-format="yyyy-MM-dd HH:mm:ss"
|
||||||
v-model="orderTime"
|
v-model="orderTime"
|
||||||
type="datetimerange"
|
type="datetimerange"
|
||||||
range-separator="至"
|
range-separator="至"
|
||||||
start-placeholder="开始日期"
|
start-placeholder="开始日期"
|
||||||
end-placeholder="结束日期"
|
end-placeholder="结束日期"
|
||||||
|
:editable="false"
|
||||||
>
|
>
|
||||||
</el-date-picker> </el-form-item
|
</el-date-picker> </el-form-item
|
||||||
></el-col>
|
></el-col>
|
||||||
<el-col :span="12">
|
<el-col :span="12">
|
||||||
<el-form-item label="尾款支付时间:" prop="name">
|
<el-form-item
|
||||||
|
label="尾款支付时间:"
|
||||||
|
prop="balancePaymentStartTime"
|
||||||
|
>
|
||||||
<el-date-picker
|
<el-date-picker
|
||||||
|
@change="getArrearsTime"
|
||||||
|
format="yyyy-MM-dd"
|
||||||
|
data-format="yyyy-MM-dd"
|
||||||
|
value-format="yyyy-MM-dd HH:mm:ss"
|
||||||
v-model="arrears"
|
v-model="arrears"
|
||||||
type="datetimerange"
|
type="datetimerange"
|
||||||
range-separator="至"
|
range-separator="至"
|
||||||
start-placeholder="开始日期"
|
start-placeholder="开始日期"
|
||||||
end-placeholder="结束日期"
|
end-placeholder="结束日期"
|
||||||
|
:picker-options="pickerOptions"
|
||||||
>
|
>
|
||||||
</el-date-picker> </el-form-item
|
</el-date-picker> </el-form-item
|
||||||
></el-col>
|
></el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
<el-form-item label="预计发货时间:" prop="name">
|
<el-form-item
|
||||||
|
label="预计发货时间:"
|
||||||
|
prop="estimatedStartDeliveryTime"
|
||||||
|
>
|
||||||
<el-date-picker
|
<el-date-picker
|
||||||
|
format="yyyy-MM-dd HH:mm"
|
||||||
|
data-format="yyyy-MM-dd HH:mm"
|
||||||
|
value-format="yyyy-MM-dd HH:mm:ss"
|
||||||
|
@change="deliveryTime"
|
||||||
v-model="delivery"
|
v-model="delivery"
|
||||||
type="datetimerange"
|
type="datetimerange"
|
||||||
range-separator="至"
|
range-separator="至"
|
||||||
start-placeholder="开始日期"
|
start-placeholder="开始日期"
|
||||||
end-placeholder="结束日期"
|
end-placeholder="结束日期"
|
||||||
|
:picker-options="pickerOptions"
|
||||||
>
|
>
|
||||||
</el-date-picker>
|
</el-date-picker>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="定金可退:" prop="name">
|
<el-form-item label="定金可退:" prop="name">
|
||||||
<el-radio v-model="ruleForm.radio" label="1">是</el-radio>
|
<el-radio v-model="ruleForm.isRefundEarnestMoney" :label="1"
|
||||||
<el-radio v-model="ruleForm.radio" label="2">否</el-radio>
|
>是</el-radio
|
||||||
|
>
|
||||||
|
<el-radio v-model="ruleForm.isRefundEarnestMoney" :label="2"
|
||||||
|
>否</el-radio
|
||||||
|
>
|
||||||
<span>
|
<span>
|
||||||
选择是,用户可在付尾款前申请退定金(申请后自动退,无需审核),或付尾款时间结束后系统自动退定金
|
选择是,用户可在付尾款前申请退定金(申请后自动退,无需审核),或付尾款时间结束后系统自动退定金
|
||||||
</span>
|
</span>
|
||||||
|
@ -68,87 +92,120 @@
|
||||||
已选择商品
|
已选择商品
|
||||||
</div>
|
</div>
|
||||||
<div style="padding: 20px">
|
<div style="padding: 20px">
|
||||||
<div
|
<div
|
||||||
v-for="item in ruleForm.productList"
|
v-for="item in ruleForm.productList"
|
||||||
:key="item.id"
|
:key="item.id"
|
||||||
style="border-top: 1px solid #ccc; padding: 10px 0 0 0"
|
style="border-top: 1px solid #ccc; padding: 10px 0 0 0"
|
||||||
>
|
>
|
||||||
<div style="font-size: 16px; margin-bottom: 20px">
|
<div style="font-size: 16px; margin-bottom: 20px">
|
||||||
<span>商品ID:{{item.id}}</span>
|
<span>商品ID:{{ item.productId }}</span>
|
||||||
<span style="margin-left: 20px">商品名称:{{item.name}}</span>
|
<span style="margin-left: 20px">商品名称:{{ item.name }}</span>
|
||||||
</div>
|
|
||||||
<el-table
|
|
||||||
border
|
|
||||||
ref="multipleTable"
|
|
||||||
:data="item.productSpecificationList"
|
|
||||||
tooltip-effect="dark"
|
|
||||||
style="width: 100%"
|
|
||||||
@selection-change="handleSelectionChange"
|
|
||||||
>
|
|
||||||
<el-table-column align="center" label="是否预售" width="80">
|
|
||||||
<template slot-scope="scope">
|
|
||||||
<el-checkbox v-model="scope.row.isShow"></el-checkbox>
|
|
||||||
</template>
|
|
||||||
</el-table-column>
|
|
||||||
<el-table-column align="center" label="SKU-ID" prop="id" />
|
|
||||||
<el-table-column align="center" label="规格" prop="attributeList">
|
|
||||||
<template slot-scope="scope">
|
|
||||||
<span>{{scope.row.attributeList}}:{{scope.row.attributeValue}}</span>
|
|
||||||
</template>
|
|
||||||
</el-table-column>
|
|
||||||
<el-table-column align="center" label="属性" prop="address" />
|
|
||||||
<el-table-column
|
|
||||||
align="center"
|
|
||||||
label="销售价"
|
|
||||||
prop="address"
|
|
||||||
width="120"
|
|
||||||
/>
|
|
||||||
<el-table-column align="center" label="*是否预售" width="200">
|
|
||||||
<template slot="header">
|
|
||||||
<span style="color: red">*是否预售</span>
|
|
||||||
</template>
|
|
||||||
<template slot-scope="scope">
|
|
||||||
<el-input
|
|
||||||
v-if="scope.row.isShow"
|
|
||||||
v-model="scope.row.presalePrice"
|
|
||||||
placeholder="请输入销售价"
|
|
||||||
></el-input>
|
|
||||||
</template>
|
|
||||||
</el-table-column>
|
|
||||||
<el-table-column align="center" label="*定金" width="200">
|
|
||||||
<template slot="header">
|
|
||||||
<span style="color: red">*定金</span>
|
|
||||||
</template>
|
|
||||||
<template slot-scope="scope">
|
|
||||||
<el-input
|
|
||||||
v-if="scope.row.isShow"
|
|
||||||
v-model="scope.row.presalePrice"
|
|
||||||
placeholder="请输入订金"
|
|
||||||
></el-input>
|
|
||||||
</template>
|
|
||||||
</el-table-column>
|
|
||||||
<el-table-column align="center" label="尾款" width="200">
|
|
||||||
<template slot-scope="scope">
|
|
||||||
<span v-if="scope.row.isShow">{{
|
|
||||||
scope.row.presalePrice
|
|
||||||
}}</span>
|
|
||||||
</template>
|
|
||||||
</el-table-column>
|
|
||||||
<el-table-column align="center" label="*预售库存" width="200">
|
|
||||||
<template slot="header">
|
|
||||||
<span style="color: red">*预售库存</span>
|
|
||||||
</template>
|
|
||||||
<template slot-scope="scope">
|
|
||||||
<el-input
|
|
||||||
v-if="scope.row.isShow"
|
|
||||||
v-model="scope.row.presalePrice"
|
|
||||||
placeholder="请输入预售库存"
|
|
||||||
></el-input>
|
|
||||||
</template>
|
|
||||||
</el-table-column>
|
|
||||||
</el-table>
|
|
||||||
</div>
|
</div>
|
||||||
<el-empty v-show="ruleForm.productList.length == 0" description="请选择商品"></el-empty>
|
<el-table
|
||||||
|
border
|
||||||
|
ref="multipleTable"
|
||||||
|
:data="item.productSpecificationList"
|
||||||
|
tooltip-effect="dark"
|
||||||
|
style="width: 100%"
|
||||||
|
@selection-change="handleSelectionChange"
|
||||||
|
>
|
||||||
|
<el-table-column align="center" label="是否预售" width="80">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<el-checkbox
|
||||||
|
:true-label="1"
|
||||||
|
:false-label="0"
|
||||||
|
v-model="scope.row.isAdvanceSell"
|
||||||
|
></el-checkbox>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column align="center" label="SKU-ID" prop="id" />
|
||||||
|
<el-table-column align="center" label="规格" prop="attributeList">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<span>{{ scope.row.attributeValue }}</span>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column align="center" label="属性" prop="address">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<span>{{
|
||||||
|
scope.row.attributeList
|
||||||
|
? scope.row.attributeList[0].attributeName
|
||||||
|
: "无"
|
||||||
|
}}</span>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column
|
||||||
|
align="center"
|
||||||
|
label="销售价"
|
||||||
|
prop="marketPrice"
|
||||||
|
width="120"
|
||||||
|
/>
|
||||||
|
<el-table-column align="center" label="*是否预售" width="200">
|
||||||
|
<template slot="header">
|
||||||
|
<span style="color: red">*预售价</span>
|
||||||
|
</template>
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<el-input-number
|
||||||
|
@change="
|
||||||
|
scope.row.balancePayment =
|
||||||
|
scope.row.presalePrice - scope.row.earnestMoney
|
||||||
|
"
|
||||||
|
v-if="scope.row.isAdvanceSell"
|
||||||
|
v-model="scope.row.presalePrice"
|
||||||
|
:min="0"
|
||||||
|
:max="scope.row.marketPrice"
|
||||||
|
label="请输入销售价"
|
||||||
|
></el-input-number>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column align="center" label="*定金" width="200">
|
||||||
|
<template slot="header">
|
||||||
|
<span style="color: red">*定金</span>
|
||||||
|
</template>
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<el-input-number
|
||||||
|
@change="
|
||||||
|
scope.row.balancePayment =
|
||||||
|
scope.row.presalePrice - scope.row.earnestMoney
|
||||||
|
"
|
||||||
|
v-if="scope.row.isAdvanceSell"
|
||||||
|
v-model="scope.row.earnestMoney"
|
||||||
|
:min="0"
|
||||||
|
:max="scope.row.presalePrice"
|
||||||
|
label="请输入订金"
|
||||||
|
></el-input-number>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column align="center" label="尾款" width="200">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<span v-if="scope.row.isAdvanceSell">{{
|
||||||
|
scope.row.presalePrice
|
||||||
|
? scope.row.presalePrice - scope.row.earnestMoney
|
||||||
|
: ""
|
||||||
|
}}</span>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column align="center" label="*预售库存" width="200">
|
||||||
|
<template slot="header">
|
||||||
|
<span style="color: red">*预售库存</span>
|
||||||
|
</template>
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<el-input-number
|
||||||
|
v-if="scope.row.isAdvanceSell"
|
||||||
|
v-model="scope.row.advanceSellStockNum"
|
||||||
|
:min="0"
|
||||||
|
:max="999999"
|
||||||
|
:step="10"
|
||||||
|
:precision="0"
|
||||||
|
label="请输入预售库存"
|
||||||
|
></el-input-number>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
</el-table>
|
||||||
|
</div>
|
||||||
|
<el-empty
|
||||||
|
v-show="ruleForm.productList.length == 0"
|
||||||
|
description="请选择商品"
|
||||||
|
></el-empty>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<!-- 选择商品 -->
|
<!-- 选择商品 -->
|
||||||
|
@ -183,10 +240,13 @@ export default {
|
||||||
},
|
},
|
||||||
modalData: {},
|
modalData: {},
|
||||||
ruleForm: {
|
ruleForm: {
|
||||||
name: "",
|
|
||||||
value: "1",
|
|
||||||
radio: "1",
|
|
||||||
productList: [],
|
productList: [],
|
||||||
|
isRefundEarnestMoney: 1, //定金可退 1是 2否
|
||||||
|
},
|
||||||
|
pickerOptions: {
|
||||||
|
disabledDate(time) {
|
||||||
|
return time.getTime() < Date.now();
|
||||||
|
},
|
||||||
},
|
},
|
||||||
orderTime: [], //订单支付时间
|
orderTime: [], //订单支付时间
|
||||||
arrears: [], //尾款时间
|
arrears: [], //尾款时间
|
||||||
|
@ -235,10 +295,17 @@ export default {
|
||||||
this.modalConfig.show = false;
|
this.modalConfig.show = false;
|
||||||
}
|
}
|
||||||
if (e) {
|
if (e) {
|
||||||
this.init(cloneDeep(e.row));
|
this.init(cloneDeep(e));
|
||||||
}
|
}
|
||||||
return {
|
return {
|
||||||
add: (data) => {
|
add: () => {
|
||||||
|
this.orderTime = [];
|
||||||
|
this.arrears = [];
|
||||||
|
this.delivery = [];
|
||||||
|
this.ruleForm = {
|
||||||
|
productList: [],
|
||||||
|
isRefundEarnestMoney: 1, //定金可退 1是 2否
|
||||||
|
};
|
||||||
this.modalConfig.title = "新增预售";
|
this.modalConfig.title = "新增预售";
|
||||||
this.isAdd = true;
|
this.isAdd = true;
|
||||||
},
|
},
|
||||||
|
@ -249,16 +316,52 @@ export default {
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
init(row) {
|
init(row) {
|
||||||
this.modalData = row;
|
console.log(row.startTime, row.endTime);
|
||||||
|
this.orderTime = [row.startTime, row.endTime];
|
||||||
|
this.arrears = [row.balancePaymentStartTime, row.balancePaymentEndTime];
|
||||||
|
this.delivery = [];
|
||||||
|
this.ruleForm.productList = [
|
||||||
|
{
|
||||||
|
productId: row.id,
|
||||||
|
name: row.name,
|
||||||
|
productSpecificationList: row.productSpecificationList,
|
||||||
|
},
|
||||||
|
];
|
||||||
|
console.log(this.orderTime, this.arrears, this.delivery);
|
||||||
|
|
||||||
|
// this.ruleForm = row;
|
||||||
},
|
},
|
||||||
//订单支付时间
|
//订单支付时间
|
||||||
getOrderTime(e) {
|
getOrderTime(e) {
|
||||||
if (e) {
|
if (e) {
|
||||||
ruleForm.startTime = e[0];
|
console.log(e);
|
||||||
ruleForm.endTime = e[1];
|
this.ruleForm.startTime = e[0];
|
||||||
|
this.ruleForm.endTime = e[1];
|
||||||
} else {
|
} else {
|
||||||
ruleForm.startTime = "";
|
this.ruleForm.startTime = "";
|
||||||
ruleForm.endTime = "";
|
this.ruleForm.endTime = "";
|
||||||
|
}
|
||||||
|
},
|
||||||
|
//尾款支付时间
|
||||||
|
getArrearsTime(e) {
|
||||||
|
if (e) {
|
||||||
|
console.log(e);
|
||||||
|
this.ruleForm.balancePaymentStartTime = e[0];
|
||||||
|
this.ruleForm.balancePaymentEndTime = e[1];
|
||||||
|
} else {
|
||||||
|
this.ruleForm.balancePaymentStartTime = "";
|
||||||
|
this.ruleForm.balancePaymentEndTime = "";
|
||||||
|
}
|
||||||
|
},
|
||||||
|
//发货时间
|
||||||
|
deliveryTime(e) {
|
||||||
|
if (e) {
|
||||||
|
console.log(e);
|
||||||
|
this.ruleForm.estimatedStartDeliveryTime = e[0];
|
||||||
|
this.ruleForm.estimatedEndDeliveryTime = e[1];
|
||||||
|
} else {
|
||||||
|
this.ruleForm.estimatedStartDeliveryTime = "";
|
||||||
|
this.ruleForm.estimatedEndDeliveryTime = "";
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
selectProduct() {
|
selectProduct() {
|
||||||
|
@ -274,7 +377,13 @@ export default {
|
||||||
console.log(e);
|
console.log(e);
|
||||||
},
|
},
|
||||||
getProduct(row) {
|
getProduct(row) {
|
||||||
this.ruleForm.productList = row;
|
this.ruleForm.productList = row.map((item) => {
|
||||||
|
return {
|
||||||
|
productId: item.id,
|
||||||
|
name: item.name,
|
||||||
|
productSpecificationList: item.productSpecificationList,
|
||||||
|
};
|
||||||
|
});
|
||||||
console.log(this.ruleForm.productList, this.ruleForm.productList.length);
|
console.log(this.ruleForm.productList, this.ruleForm.productList.length);
|
||||||
|
|
||||||
console.log("获取商品");
|
console.log("获取商品");
|
||||||
|
@ -294,12 +403,17 @@ export default {
|
||||||
type: "primary",
|
type: "primary",
|
||||||
// submit: true,
|
// submit: true,
|
||||||
handle: () => {
|
handle: () => {
|
||||||
this.$refs.ruleForm.validate((valid) => {
|
this.$api.preSale.addPreSaleProducts(this.ruleForm).then((res) => {
|
||||||
if (valid) {
|
console.log("确认", res);
|
||||||
this.$emit("getAttribute", this.ruleForm);
|
// this.toggle();
|
||||||
this.toggle();
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
|
// console.log("确认", this.ruleForm);
|
||||||
|
// this.$refs.ruleForm.validate((valid) => {
|
||||||
|
// if (valid) {
|
||||||
|
// this.$emit("getAttribute", this.ruleForm);
|
||||||
|
// this.toggle();
|
||||||
|
// }
|
||||||
|
// });
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
|
Loading…
Reference in New Issue