Compare commits
2 Commits
e70e0e9c0b
...
e2451fb087
Author | SHA1 | Date |
---|---|---|
|
e2451fb087 | |
|
7225340c62 |
|
@ -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,
|
||||||
|
});
|
||||||
|
},
|
||||||
};
|
};
|
||||||
|
|
|
@ -99,6 +99,8 @@
|
||||||
</obj-table-plus>
|
</obj-table-plus>
|
||||||
<!-- 添加或编辑 -->
|
<!-- 添加或编辑 -->
|
||||||
<add-or-update
|
<add-or-update
|
||||||
|
:marketId="formInline.marketId"
|
||||||
|
:shopId="formInline.shopId"
|
||||||
@queryList="$refs.oTable.reload()"
|
@queryList="$refs.oTable.reload()"
|
||||||
ref="addOrUpdate"
|
ref="addOrUpdate"
|
||||||
></add-or-update>
|
></add-or-update>
|
||||||
|
@ -128,6 +130,7 @@ export default {
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
activeName: "5",
|
activeName: "5",
|
||||||
|
advanceSellStatus: "",
|
||||||
dataList: [],
|
dataList: [],
|
||||||
formInline: {
|
formInline: {
|
||||||
name: "",
|
name: "",
|
||||||
|
@ -235,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: [],
|
||||||
})
|
})
|
||||||
|
@ -259,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() {
|
||||||
|
@ -273,7 +282,7 @@ export default {
|
||||||
{
|
{
|
||||||
title: "商品ID",
|
title: "商品ID",
|
||||||
align: "center",
|
align: "center",
|
||||||
field: "name",
|
field: "id",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: "商品图",
|
title: "商品图",
|
||||||
|
@ -299,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: "尾款支付时间",
|
||||||
|
@ -307,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>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
@ -332,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: "状态",
|
||||||
|
@ -345,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>;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
@ -361,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 = () => {
|
||||||
|
@ -384,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,43 +92,69 @@
|
||||||
已选择商品
|
已选择商品
|
||||||
</div>
|
</div>
|
||||||
<div style="padding: 20px">
|
<div style="padding: 20px">
|
||||||
<div style="border-top: 1px solid #ccc; padding: 10px 0 0 0">
|
<div
|
||||||
|
v-for="item in ruleForm.productList"
|
||||||
|
:key="item.id"
|
||||||
|
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:</span>
|
<span>商品ID:{{ item.productId }}</span>
|
||||||
<span style="margin-left: 20px">商品名称:</span>
|
<span style="margin-left: 20px">商品名称:{{ item.name }}</span>
|
||||||
</div>
|
</div>
|
||||||
<el-table
|
<el-table
|
||||||
border
|
border
|
||||||
ref="multipleTable"
|
ref="multipleTable"
|
||||||
:data="tableData"
|
:data="item.productSpecificationList"
|
||||||
tooltip-effect="dark"
|
tooltip-effect="dark"
|
||||||
style="width: 100%"
|
style="width: 100%"
|
||||||
@selection-change="handleSelectionChange"
|
@selection-change="handleSelectionChange"
|
||||||
>
|
>
|
||||||
<el-table-column align="center" label="是否预售" width="80">
|
<el-table-column align="center" label="是否预售" width="80">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<el-checkbox v-model="scope.row.isShow"></el-checkbox>
|
<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>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column align="center" label="SKU-ID" prop="date" />
|
|
||||||
<el-table-column align="center" label="规格" prop="name" />
|
|
||||||
<el-table-column align="center" label="属性" prop="address" />
|
|
||||||
<el-table-column
|
<el-table-column
|
||||||
align="center"
|
align="center"
|
||||||
label="销售价"
|
label="销售价"
|
||||||
prop="address"
|
prop="marketPrice"
|
||||||
width="120"
|
width="120"
|
||||||
/>
|
/>
|
||||||
<el-table-column align="center" label="*是否预售" width="200">
|
<el-table-column align="center" label="*是否预售" width="200">
|
||||||
<template slot="header">
|
<template slot="header">
|
||||||
<span style="color: red">*是否预售</span>
|
<span style="color: red">*预售价</span>
|
||||||
</template>
|
</template>
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<el-input
|
<el-input-number
|
||||||
v-if="scope.row.isShow"
|
@change="
|
||||||
|
scope.row.balancePayment =
|
||||||
|
scope.row.presalePrice - scope.row.earnestMoney
|
||||||
|
"
|
||||||
|
v-if="scope.row.isAdvanceSell"
|
||||||
v-model="scope.row.presalePrice"
|
v-model="scope.row.presalePrice"
|
||||||
placeholder="请输入销售价"
|
:min="0"
|
||||||
></el-input>
|
:max="scope.row.marketPrice"
|
||||||
|
label="请输入销售价"
|
||||||
|
></el-input-number>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column align="center" label="*定金" width="200">
|
<el-table-column align="center" label="*定金" width="200">
|
||||||
|
@ -112,17 +162,25 @@
|
||||||
<span style="color: red">*定金</span>
|
<span style="color: red">*定金</span>
|
||||||
</template>
|
</template>
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<el-input
|
<el-input-number
|
||||||
v-if="scope.row.isShow"
|
@change="
|
||||||
v-model="scope.row.presalePrice"
|
scope.row.balancePayment =
|
||||||
placeholder="请输入订金"
|
scope.row.presalePrice - scope.row.earnestMoney
|
||||||
></el-input>
|
"
|
||||||
|
v-if="scope.row.isAdvanceSell"
|
||||||
|
v-model="scope.row.earnestMoney"
|
||||||
|
:min="0"
|
||||||
|
:max="scope.row.presalePrice"
|
||||||
|
label="请输入订金"
|
||||||
|
></el-input-number>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column align="center" label="尾款" width="200">
|
<el-table-column align="center" label="尾款" width="200">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<span v-if="scope.row.isShow">{{
|
<span v-if="scope.row.isAdvanceSell">{{
|
||||||
scope.row.presalePrice
|
scope.row.presalePrice
|
||||||
|
? scope.row.presalePrice - scope.row.earnestMoney
|
||||||
|
: ""
|
||||||
}}</span>
|
}}</span>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
|
@ -131,24 +189,45 @@
|
||||||
<span style="color: red">*预售库存</span>
|
<span style="color: red">*预售库存</span>
|
||||||
</template>
|
</template>
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<el-input
|
<el-input-number
|
||||||
v-if="scope.row.isShow"
|
v-if="scope.row.isAdvanceSell"
|
||||||
v-model="scope.row.presalePrice"
|
v-model="scope.row.advanceSellStockNum"
|
||||||
placeholder="请输入预售库存"
|
:min="0"
|
||||||
></el-input>
|
:max="999999"
|
||||||
|
:step="10"
|
||||||
|
:precision="0"
|
||||||
|
label="请输入预售库存"
|
||||||
|
></el-input-number>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
</el-table>
|
</el-table>
|
||||||
</div>
|
</div>
|
||||||
|
<el-empty
|
||||||
|
v-show="ruleForm.productList.length == 0"
|
||||||
|
description="请选择商品"
|
||||||
|
></el-empty>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<!-- 选择商品 -->
|
||||||
</obj-modal>
|
</obj-modal>
|
||||||
|
<commodity @getProduct="getProduct" ref="commodity"></commodity>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<script>
|
<script>
|
||||||
|
import commodity from "./commodity.vue";
|
||||||
import { debounce, cloneDeep } from "lodash";
|
import { debounce, cloneDeep } from "lodash";
|
||||||
export default {
|
export default {
|
||||||
components: {},
|
components: { commodity },
|
||||||
|
props: {
|
||||||
|
marketId: {
|
||||||
|
type: String,
|
||||||
|
default: "",
|
||||||
|
},
|
||||||
|
shopId: {
|
||||||
|
type: String,
|
||||||
|
default: "",
|
||||||
|
},
|
||||||
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
isAdd: true,
|
isAdd: true,
|
||||||
|
@ -161,9 +240,13 @@ export default {
|
||||||
},
|
},
|
||||||
modalData: {},
|
modalData: {},
|
||||||
ruleForm: {
|
ruleForm: {
|
||||||
name: "",
|
productList: [],
|
||||||
value: "1",
|
isRefundEarnestMoney: 1, //定金可退 1是 2否
|
||||||
radio: "1",
|
},
|
||||||
|
pickerOptions: {
|
||||||
|
disabledDate(time) {
|
||||||
|
return time.getTime() < Date.now();
|
||||||
|
},
|
||||||
},
|
},
|
||||||
orderTime: [], //订单支付时间
|
orderTime: [], //订单支付时间
|
||||||
arrears: [], //尾款时间
|
arrears: [], //尾款时间
|
||||||
|
@ -212,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;
|
||||||
},
|
},
|
||||||
|
@ -226,24 +316,78 @@ 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() {
|
||||||
console.log("选择商品");
|
console.log("选择商品", this.marketId, this.shopId);
|
||||||
|
this.$nextTick(() => {
|
||||||
|
this.$refs.commodity.toggle().add({
|
||||||
|
marketId: this.marketId,
|
||||||
|
shopId: this.shopId,
|
||||||
|
});
|
||||||
|
});
|
||||||
},
|
},
|
||||||
handleSelectionChange(e) {
|
handleSelectionChange(e) {
|
||||||
console.log(e);
|
console.log(e);
|
||||||
},
|
},
|
||||||
|
getProduct(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("获取商品");
|
||||||
|
},
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
modalHandles() {
|
modalHandles() {
|
||||||
|
@ -259,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();
|
||||||
|
// }
|
||||||
|
// });
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
|
|
@ -17,39 +17,21 @@
|
||||||
:tableEvent="tableEvent"
|
:tableEvent="tableEvent"
|
||||||
:enableAutoQuery="false"
|
:enableAutoQuery="false"
|
||||||
>
|
>
|
||||||
<!-- <template slot="tableTop">
|
<template slot="tableTop">
|
||||||
<el-form :inline="true" :model="formInline" class="demo-form-inline">
|
<el-form :inline="true" :model="formInline" class="demo-form-inline">
|
||||||
<el-form-item v-if="marketList.length > 0" label="菜市场">
|
<el-form-item label="商品搜索">
|
||||||
<el-select
|
<el-input
|
||||||
@change="getData"
|
v-model="formList.name"
|
||||||
v-model="formInline.marketId"
|
placeholder="商品搜索"
|
||||||
placeholder="请选择菜市场"
|
></el-input>
|
||||||
>
|
</el-form-item>
|
||||||
<el-option
|
<el-form-item>
|
||||||
v-for="item in marketList"
|
<el-button type="primary" @click="$refs.oTable.reload()"
|
||||||
:key="item.marketId"
|
>查询</el-button
|
||||||
:label="item.marketName"
|
>
|
||||||
:value="item.marketId"
|
</el-form-item>
|
||||||
></el-option>
|
</el-form>
|
||||||
</el-select>
|
</template>
|
||||||
</el-form-item>
|
|
||||||
<el-form-item v-if="marketList.length > 0" label="店铺">
|
|
||||||
<el-select v-model="formInline.shopId" placeholder="请选择店铺">
|
|
||||||
<el-option
|
|
||||||
v-for="item in storeList"
|
|
||||||
:key="item.shopId"
|
|
||||||
:label="item.shopName"
|
|
||||||
:value="item.shopId"
|
|
||||||
></el-option>
|
|
||||||
</el-select>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item>
|
|
||||||
<el-button type="primary" @click="$refs.oTable.reload()"
|
|
||||||
>查询</el-button
|
|
||||||
>
|
|
||||||
</el-form-item>
|
|
||||||
</el-form>
|
|
||||||
</template> -->
|
|
||||||
</obj-table-plus>
|
</obj-table-plus>
|
||||||
</template>
|
</template>
|
||||||
</obj-modal>
|
</obj-modal>
|
||||||
|
@ -63,7 +45,7 @@ export default {
|
||||||
isAdd: true,
|
isAdd: true,
|
||||||
//表格属性
|
//表格属性
|
||||||
modalConfig: {
|
modalConfig: {
|
||||||
title: "请点击选择商品",
|
title: "请点击选择商品 (提示:最多选择5个商品)",
|
||||||
show: false,
|
show: false,
|
||||||
width: "1000px",
|
width: "1000px",
|
||||||
},
|
},
|
||||||
|
@ -76,14 +58,11 @@ export default {
|
||||||
"row-id": "id",
|
"row-id": "id",
|
||||||
"show-overflow": false,
|
"show-overflow": false,
|
||||||
},
|
},
|
||||||
selectList: {},
|
selectList: [],
|
||||||
tableEvent: {
|
|
||||||
"current-change": async (e) => {
|
|
||||||
console.log(e.row);
|
|
||||||
this.selectList = e.row;
|
|
||||||
},
|
|
||||||
},
|
|
||||||
formInline: {},
|
formInline: {},
|
||||||
|
formList: {
|
||||||
|
name: "",
|
||||||
|
},
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
@ -121,6 +100,7 @@ export default {
|
||||||
}
|
}
|
||||||
return {
|
return {
|
||||||
add: (row) => {
|
add: (row) => {
|
||||||
|
console.log(row);
|
||||||
this.formInline = row;
|
this.formInline = row;
|
||||||
this.isAdd = true;
|
this.isAdd = true;
|
||||||
this.$nextTick(() => {
|
this.$nextTick(() => {
|
||||||
|
@ -137,7 +117,7 @@ export default {
|
||||||
computed: {
|
computed: {
|
||||||
tableCols() {
|
tableCols() {
|
||||||
return [
|
return [
|
||||||
{ type: "seq", width: "60px", align: "center", title: "序号" },
|
{ type: "checkbox", width: "60px", fixed: "left" },
|
||||||
{
|
{
|
||||||
title: "商品图",
|
title: "商品图",
|
||||||
field: "productPhotoList",
|
field: "productPhotoList",
|
||||||
|
@ -222,6 +202,17 @@ export default {
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
},
|
},
|
||||||
|
tableEvent() {
|
||||||
|
return {
|
||||||
|
"checkbox-all": ({ records, reserves }) => {
|
||||||
|
this.selectList = [...records, ...reserves];
|
||||||
|
},
|
||||||
|
"checkbox-change": ({ records, reserves }) => {
|
||||||
|
console.log(this.selectList, "2");
|
||||||
|
this.selectList = [...records, ...reserves];
|
||||||
|
},
|
||||||
|
};
|
||||||
|
},
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
Loading…
Reference in New Issue