会员管理
This commit is contained in:
parent
5477a783a8
commit
872c553dbb
|
@ -0,0 +1,18 @@
|
|||
import $http from "@/utils/httpRequest.js";
|
||||
|
||||
export const marketing = {
|
||||
marketingLevelPage: (data) => {
|
||||
return $http.request({
|
||||
url: `/merchant-api/memberUnitMemberLevel/list`,
|
||||
method: "post",
|
||||
data,
|
||||
});
|
||||
},
|
||||
marketingUserPage: (data) => {
|
||||
return $http.request({
|
||||
url: `/merchant-api/memberUnitUser/page`,
|
||||
method: "get",
|
||||
params: data,
|
||||
});
|
||||
},
|
||||
};
|
|
@ -16,4 +16,11 @@ export const preSale = {
|
|||
data,
|
||||
});
|
||||
},
|
||||
updatePreSaleProducts: (data) => {
|
||||
return $http.request({
|
||||
url: `/merchant-api/product/save/advance/sell`,
|
||||
method: "post",
|
||||
data,
|
||||
});
|
||||
},
|
||||
};
|
||||
|
|
|
@ -226,6 +226,85 @@ export default {
|
|||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
menuId: getUUID(),
|
||||
parentId: 0,
|
||||
parentName: null,
|
||||
name: "营销管理",
|
||||
url: "",
|
||||
perms: "",
|
||||
type: 0,
|
||||
elIcon: "el-icon-tickets",
|
||||
orderNum: 0,
|
||||
open: null,
|
||||
list: [
|
||||
{
|
||||
menuId: getUUID(),
|
||||
parentId: 0,
|
||||
parentName: null,
|
||||
name: "会员等级管理",
|
||||
url: "marketing/level/index",
|
||||
perms: "",
|
||||
type: 1,
|
||||
elIcon: "el-icon-user",
|
||||
orderNum: 0,
|
||||
open: null,
|
||||
list: [],
|
||||
},
|
||||
{
|
||||
menuId: getUUID(),
|
||||
parentId: 0,
|
||||
parentName: null,
|
||||
name: "用户管理",
|
||||
url: "marketing/user/index",
|
||||
perms: "",
|
||||
type: 1,
|
||||
elIcon: "el-icon-data-analysis",
|
||||
orderNum: 0,
|
||||
open: null,
|
||||
list: [],
|
||||
},
|
||||
{
|
||||
menuId: getUUID(),
|
||||
parentId: 0,
|
||||
parentName: null,
|
||||
name: "积分设置",
|
||||
url: "marketing/points-setting/index",
|
||||
perms: "",
|
||||
type: 1,
|
||||
elIcon: "el-icon-shopping-cart-full",
|
||||
orderNum: 0,
|
||||
open: null,
|
||||
list: [],
|
||||
},
|
||||
{
|
||||
menuId: getUUID(),
|
||||
parentId: 0,
|
||||
parentName: null,
|
||||
name: "积分商城",
|
||||
url: "marketing/points-mall/index",
|
||||
perms: "",
|
||||
type: 1,
|
||||
elIcon: "el-icon-shopping-cart-full",
|
||||
orderNum: 0,
|
||||
open: null,
|
||||
list: [],
|
||||
},
|
||||
{
|
||||
menuId: getUUID(),
|
||||
parentId: 0,
|
||||
parentName: null,
|
||||
name: "积分订单",
|
||||
url: "marketing/points-order/index",
|
||||
perms: "",
|
||||
type: 1,
|
||||
elIcon: "el-icon-shopping-cart-full",
|
||||
orderNum: 0,
|
||||
open: null,
|
||||
list: [],
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
code: 0,
|
||||
permissions: [],
|
||||
|
|
|
@ -0,0 +1,166 @@
|
|||
<template>
|
||||
<div>
|
||||
<div class="tips">
|
||||
<div>请谨慎操作此页面数据,避免频繁修改导致会员流失等不必要的损失。</div>
|
||||
<div style="margin-top: 10px">
|
||||
请注意,用户一旦达到某会员等级,后续修改会员等级要求不会影响用户已达到的会员等级,但可享有该等级对应的会员权益
|
||||
</div>
|
||||
<div style="margin-top: 20px">
|
||||
举例:24年2月,用户在本商铺的成长值达到500升级为VIP2,此时,VIP2会员权益享有的生日优惠卷1;
|
||||
</div>
|
||||
<div style="margin-top: 10px">
|
||||
24年3月,本商铺修改VIP2所需成长值为700,并新增会员生日优惠卷2;修改提交后,该用户会员等级保持VIP2不变且享有会员优惠卷1和会员优惠卷2;
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
<el-form :inline="true" :model="formInline" class="demo-form-inline">
|
||||
<el-form-item label="单位类型:">
|
||||
<el-select
|
||||
v-model="formInline.unitType"
|
||||
placeholder="请选择单位类型:"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in [
|
||||
{ label: '市场', value: '1' },
|
||||
{ label: '摊主', value: '2' },
|
||||
{ label: '云店', value: '3' },
|
||||
]"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button @click="getData" type="primary">查询</el-button>
|
||||
<el-button @click="getData" type="primary">导出</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</div>
|
||||
<div class="tipsLevel">
|
||||
<div>
|
||||
<span style="margin-right: 30px">全部等级(4)</span
|
||||
><el-button @click="add(null)" type="primary">+新增套餐</el-button>
|
||||
</div>
|
||||
<div>
|
||||
<span style="margin-right: 30px">会员快要到期了</span>
|
||||
<el-button @click="add(null)" type="primary">购买工具</el-button>
|
||||
</div>
|
||||
</div>
|
||||
<el-table :data="list" :border="true" style="width: 100%">
|
||||
<el-table-column align="center" label="等级名称" prop="packageName" />
|
||||
<el-table-column align="center" label="所需成长值" prop="packagePrice" />
|
||||
<el-table-column
|
||||
align="center"
|
||||
label="会员权益"
|
||||
prop="packageEffectiveTimeQuantity"
|
||||
/>
|
||||
<el-table-column
|
||||
align="center"
|
||||
label="会员人数"
|
||||
prop="packageEffectiveTimeUnit"
|
||||
>
|
||||
<template v-slot="scope">
|
||||
<span>{{
|
||||
scope.row.packageEffectiveTimeUnit == 1 ? "年" : "月"
|
||||
}}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="操作" fixed="right" width="240">
|
||||
<template v-slot="scope">
|
||||
<el-button @click="add(scope.row)" type="primary">编辑</el-button>
|
||||
<el-button @click="add(scope.row)" type="primary">转移</el-button>
|
||||
<el-popconfirm
|
||||
confirm-button-text="确定"
|
||||
cancel-button-text="取消"
|
||||
icon-color="#626AEF"
|
||||
title="确定删除吗?"
|
||||
@confirm="confirmEvent(scope.row)"
|
||||
@cancel="cancelEvent"
|
||||
>
|
||||
<template #reference>
|
||||
<el-button type="danger">删除</el-button>
|
||||
</template>
|
||||
</el-popconfirm>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
list: [],
|
||||
formInline: {
|
||||
unitType: "1",
|
||||
marketId: "",
|
||||
shopId: "",
|
||||
},
|
||||
isShopId: false,
|
||||
marketList: [],
|
||||
storeList: [],
|
||||
};
|
||||
},
|
||||
created() {
|
||||
if (JSON.parse(sessionStorage.getItem("userInfo")).markets.length > 0) {
|
||||
this.isShopId = true;
|
||||
this.formInline.marketId = JSON.parse(
|
||||
sessionStorage.getItem("userInfo")
|
||||
).markets[0].marketId;
|
||||
this.marketList = JSON.parse(sessionStorage.getItem("userInfo")).markets;
|
||||
console.log(this.marketList);
|
||||
this.getData();
|
||||
} else if (JSON.parse(sessionStorage.getItem("userInfo")).shopId) {
|
||||
(this.formInline.shopId = JSON.parse(
|
||||
sessionStorage.getItem("userInfo")
|
||||
).shopId),
|
||||
(this.isShopId = true);
|
||||
this.$nextTick(() => {
|
||||
this.getList();
|
||||
});
|
||||
} else {
|
||||
this.isShopId = false;
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
getData() {
|
||||
this.$api.mer_admin
|
||||
.storeList({ marketId: this.formInline.marketId })
|
||||
.then((res) => {
|
||||
this.storeList = res.data.data;
|
||||
// this.formInline.shopId = res.data.data[0].shopId;
|
||||
this.$nextTick(() => {
|
||||
this.getList();
|
||||
});
|
||||
});
|
||||
},
|
||||
getList() {
|
||||
this.$api.marketing.marketingLevelPage(this.formInline).then((res) => {
|
||||
console.log(res);
|
||||
});
|
||||
},
|
||||
add() {},
|
||||
confirmEvent() {},
|
||||
cancelEvent() {},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss" >
|
||||
.tips {
|
||||
padding: 15px;
|
||||
margin-bottom: 20px;
|
||||
border-radius: 10px;
|
||||
width: 100%;
|
||||
font-size: 16px;
|
||||
background: #e5e5e5;
|
||||
color: #faa639;
|
||||
}
|
||||
.tipsLevel {
|
||||
margin: 20px 0;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
}
|
||||
</style>
|
|
@ -0,0 +1,15 @@
|
|||
<template>
|
||||
<div>
|
||||
积分商城
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
|
||||
</style>
|
|
@ -0,0 +1,15 @@
|
|||
<template>
|
||||
<div>
|
||||
积分订单
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
|
||||
</style>
|
|
@ -0,0 +1,15 @@
|
|||
<template>
|
||||
<div>
|
||||
积分设置
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
|
||||
</style>
|
|
@ -0,0 +1,322 @@
|
|||
<template>
|
||||
<div style="height: calc(100vh - 200px)">
|
||||
<obj-table-plus
|
||||
ref="oTable"
|
||||
style="height: 100%"
|
||||
:tableCols="tableCols"
|
||||
:tableProp="tableProp"
|
||||
@query="queryList"
|
||||
v-model="dataList"
|
||||
:tableEvent="tableEvent"
|
||||
:enableAutoQuery="false"
|
||||
>
|
||||
<template slot="tableTop">
|
||||
<el-form :inline="true" :model="formInline" class="demo-form-inline">
|
||||
<el-form-item label="用户ID">
|
||||
<el-input
|
||||
placeholder="请输入用户ID"
|
||||
v-model="formInline.name"
|
||||
></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="用户昵称">
|
||||
<el-input
|
||||
placeholder="请输入用户昵称"
|
||||
v-model="formInline.name"
|
||||
></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="会员等级">
|
||||
<el-select
|
||||
@change="getData"
|
||||
v-model="formInline.marketId"
|
||||
placeholder="请选择会员等级"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in marketList"
|
||||
:key="item.marketId"
|
||||
:label="item.marketName"
|
||||
:value="item.marketId"
|
||||
></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="手机号">
|
||||
<el-input
|
||||
placeholder="请输入手机号"
|
||||
v-model="formInline.name"
|
||||
></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="会员状态">
|
||||
<el-select
|
||||
@change="getData"
|
||||
v-model="formInline.marketId"
|
||||
placeholder="请选择会员状态"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in marketList"
|
||||
:key="item.marketId"
|
||||
:label="item.marketName"
|
||||
:value="item.marketId"
|
||||
></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="注册时间">
|
||||
<el-date-picker
|
||||
v-model="value1"
|
||||
type="datetimerange"
|
||||
start-placeholder="开始日期"
|
||||
end-placeholder="结束日期"
|
||||
>
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
<el-form-item label="生日">
|
||||
<el-date-picker
|
||||
v-model="value1"
|
||||
type="datetimerange"
|
||||
start-placeholder="开始日期"
|
||||
end-placeholder="结束日期"
|
||||
>
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
<el-form-item label="会员性别">
|
||||
<el-select
|
||||
@change="getData"
|
||||
v-model="formInline.marketId"
|
||||
placeholder="全部"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in marketList"
|
||||
:key="item.marketId"
|
||||
:label="item.marketName"
|
||||
:value="item.marketId"
|
||||
></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<!-- <el-form-item v-if="marketList.length > 0" label="菜市场">
|
||||
<el-select
|
||||
@change="getData"
|
||||
v-model="formInline.marketId"
|
||||
placeholder="请选择菜市场"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in marketList"
|
||||
:key="item.marketId"
|
||||
:label="item.marketName"
|
||||
:value="item.marketId"
|
||||
></el-option>
|
||||
</el-select>
|
||||
</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-button type="primary" @click="$refs.oTable.reload()"
|
||||
>重置</el-button
|
||||
>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</template>
|
||||
</obj-table-plus>
|
||||
<!-- 添加或编辑 -->
|
||||
<!-- <add-or-update
|
||||
@queryList="$refs.oTable.reload()"
|
||||
ref="addOrUpdate"
|
||||
></add-or-update> -->
|
||||
<!-- 查看详情 -->
|
||||
<!-- <viewDetails ref="viewDetails"></viewDetails> -->
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
// import AddOrUpdate from "./popup/add-or-update.vue";
|
||||
// import viewDetails from "./popup/view-details.vue";
|
||||
export default {
|
||||
// components: { AddOrUpdate },
|
||||
data() {
|
||||
return {
|
||||
dataList: [],
|
||||
formInline: {
|
||||
marketId: "",
|
||||
shopId: "",
|
||||
unitType: "",
|
||||
},
|
||||
tableProp: {
|
||||
"auto-resize": true,
|
||||
border: true,
|
||||
height: "auto",
|
||||
"row-id": "id",
|
||||
"show-overflow": false,
|
||||
},
|
||||
productFilterType: "SALE",
|
||||
selectList: [],
|
||||
isShopId: false,
|
||||
marketList: [],
|
||||
storeList: [],
|
||||
value1: [],
|
||||
};
|
||||
},
|
||||
created() {
|
||||
if (JSON.parse(sessionStorage.getItem("userInfo")).markets.length > 0) {
|
||||
this.isShopId = true;
|
||||
this.formInline.marketId = JSON.parse(
|
||||
sessionStorage.getItem("userInfo")
|
||||
).markets[0].marketId;
|
||||
this.marketList = JSON.parse(sessionStorage.getItem("userInfo")).markets;
|
||||
this.formInline.unitType = JSON.parse(sessionStorage.getItem("userInfo")).unitType
|
||||
console.log(this.marketList);
|
||||
this.getData();
|
||||
} else if (JSON.parse(sessionStorage.getItem("userInfo")).shopId) {
|
||||
(this.formInline.shopId = JSON.parse(
|
||||
sessionStorage.getItem("userInfo")
|
||||
).shopId),
|
||||
(this.isShopId = true);
|
||||
this.$nextTick(() => {
|
||||
this.$refs.oTable.reload();
|
||||
});
|
||||
} else {
|
||||
this.isShopId = false;
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
getData() {
|
||||
this.$api.mer_admin
|
||||
.storeList({ marketId: this.formInline.marketId })
|
||||
.then((res) => {
|
||||
this.storeList = res.data.data;
|
||||
// this.formInline.shopId = res.data.data[0].shopId;
|
||||
this.$nextTick(() => {
|
||||
this.$refs.oTable.reload();
|
||||
});
|
||||
});
|
||||
},
|
||||
queryList(pageNo, pageSize) {
|
||||
this.$api.marketing
|
||||
.marketingUserPage({
|
||||
pageNumber: pageNo,
|
||||
pageSize: pageSize,
|
||||
...this.formInline,
|
||||
})
|
||||
.then((res) => {
|
||||
console.log(res);
|
||||
this.$refs.oTable.complete(
|
||||
res.data.data.data,
|
||||
Number(res.data.data.total)
|
||||
);
|
||||
})
|
||||
.catch((err) => {
|
||||
this.$refs.oTable.complete(false);
|
||||
});
|
||||
},
|
||||
},
|
||||
computed: {
|
||||
tableCols() {
|
||||
return [
|
||||
{ type: "checkbox", width: "60px", fixed: "left" },
|
||||
// { type: "seq", width: "60px", align: "center", title: "序号" },
|
||||
{
|
||||
title: "用戶ID",
|
||||
align: "center",
|
||||
field: "name",
|
||||
},
|
||||
{
|
||||
title: "用戶头像",
|
||||
align: "center",
|
||||
field: "publisher",
|
||||
type: "jsx",
|
||||
render: ({ row }) => {
|
||||
if (row.publisher === "MERCHANT") {
|
||||
return <span>店铺</span>;
|
||||
} else if (row.publisher == "PLATFORM") {
|
||||
return <span>平台</span>;
|
||||
}
|
||||
},
|
||||
},
|
||||
{
|
||||
title: "用戶昵称",
|
||||
align: "center",
|
||||
field: "name",
|
||||
},
|
||||
{
|
||||
title: "手机号",
|
||||
align: "center",
|
||||
field: "name",
|
||||
},
|
||||
{
|
||||
title: "进行中订单数",
|
||||
align: "center",
|
||||
field: "name",
|
||||
},
|
||||
{
|
||||
title: "完成订单数",
|
||||
align: "center",
|
||||
field: "name",
|
||||
},
|
||||
{
|
||||
title: "消费金额(元)",
|
||||
align: "center",
|
||||
field: "name",
|
||||
},
|
||||
{
|
||||
title: "会员等级",
|
||||
align: "center",
|
||||
field: "money",
|
||||
},
|
||||
{
|
||||
title: "生日",
|
||||
align: "center",
|
||||
field: "discount",
|
||||
},
|
||||
{
|
||||
title: "注册时间",
|
||||
align: "center",
|
||||
field: "minPrice",
|
||||
},
|
||||
{
|
||||
title: "限量",
|
||||
align: "center",
|
||||
field: "limitedNum",
|
||||
},
|
||||
{
|
||||
title: "操作",
|
||||
fixed: "right",
|
||||
type: "jsx",
|
||||
align: "center",
|
||||
width: "140px",
|
||||
render: (row) => {
|
||||
let edit = () => {
|
||||
// this.$refs.viewDetails.toggle(row).update();
|
||||
};
|
||||
return (
|
||||
<div>
|
||||
<el-button size="mini" type="primary" onClick={edit}>
|
||||
详情
|
||||
</el-button>
|
||||
</div>
|
||||
);
|
||||
},
|
||||
},
|
||||
];
|
||||
},
|
||||
tableEvent() {
|
||||
return {
|
||||
"checkbox-all": ({ records, reserves }) => {
|
||||
this.selectList = [...records, ...reserves];
|
||||
},
|
||||
"checkbox-change": ({ records, reserves }) => {
|
||||
this.selectList = [...records, ...reserves];
|
||||
},
|
||||
};
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped></style>
|
|
@ -512,29 +512,32 @@ export default {
|
|||
};
|
||||
return (
|
||||
<div>
|
||||
<el-button
|
||||
size="mini"
|
||||
disabled={row.status != "DOWN"}
|
||||
type="primary"
|
||||
onClick={priceAdjustment}
|
||||
>
|
||||
<el-button size="mini" type="primary" onClick={priceAdjustment}>
|
||||
查看
|
||||
</el-button>
|
||||
<el-button size="mini" type="primary" onClick={edit}>
|
||||
<el-button
|
||||
v-show={row.advanceSellStatus != "2"}
|
||||
size="mini"
|
||||
type="primary"
|
||||
onClick={edit}
|
||||
>
|
||||
编辑
|
||||
</el-button>
|
||||
|
||||
<el-button
|
||||
v-show={
|
||||
row.advanceSellStatus != "0" &&
|
||||
row.advanceSellStatus != "2"
|
||||
}
|
||||
size="mini"
|
||||
disabled={row.status != "DOWN"}
|
||||
type="primary"
|
||||
onClick={changeInventory}
|
||||
>
|
||||
关闭
|
||||
</el-button>
|
||||
<el-button
|
||||
v-show={row.advanceSellStatus != "1"}
|
||||
size="mini"
|
||||
disabled={row.status != "DOWN"}
|
||||
type="primary"
|
||||
onClick={setDiscounts}
|
||||
>
|
||||
|
|
|
@ -70,7 +70,7 @@
|
|||
>
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
<el-form-item label="定金可退:" prop="name">
|
||||
<el-form-item label="定金可退:" prop="isRefundEarnestMoney">
|
||||
<el-radio v-model="ruleForm.isRefundEarnestMoney" :label="1"
|
||||
>是</el-radio
|
||||
>
|
||||
|
@ -81,17 +81,17 @@
|
|||
选择是,用户可在付尾款前申请退定金(申请后自动退,无需审核),或付尾款时间结束后系统自动退定金
|
||||
</span>
|
||||
</el-form-item>
|
||||
<el-form-item label="选择商品:" prop="name">
|
||||
<el-form-item v-if="isAdd" label="选择商品:">
|
||||
<el-button type="primary" @click="selectProduct"
|
||||
>点击请选择商品</el-button
|
||||
>
|
||||
<span> 备注:一次最多添加五个商品 </span>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
<div style="padding: 0 0 0 20px; font-size: 16px; font-weight: 600">
|
||||
已选择商品
|
||||
</div>
|
||||
<div style="padding: 20px">
|
||||
<div v-if="isAdd" style="padding: 20px">
|
||||
<div
|
||||
v-for="item in ruleForm.productList"
|
||||
:key="item.id"
|
||||
|
@ -119,7 +119,11 @@
|
|||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="SKU-ID" prop="id" />
|
||||
<el-table-column align="center" label="规格" prop="attributeList">
|
||||
<el-table-column
|
||||
align="center"
|
||||
label="规格"
|
||||
prop="attributeList"
|
||||
>
|
||||
<template slot-scope="scope">
|
||||
<span>{{ scope.row.attributeValue }}</span>
|
||||
</template>
|
||||
|
@ -145,11 +149,11 @@
|
|||
</template>
|
||||
<template slot-scope="scope">
|
||||
<el-input-number
|
||||
v-if="scope.row.isAdvanceSell"
|
||||
@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"
|
||||
|
@ -207,6 +211,125 @@
|
|||
description="请选择商品"
|
||||
></el-empty>
|
||||
</div>
|
||||
<div v-else style="padding: 20px">
|
||||
<div style="border-top: 1px solid #ccc; padding: 10px 0 0 0">
|
||||
<div style="font-size: 16px; margin-bottom: 20px">
|
||||
<span>商品ID:{{ ruleForm.productId }}</span>
|
||||
<span style="margin-left: 20px"
|
||||
>商品名称:{{ ruleForm.name }}</span
|
||||
>
|
||||
</div>
|
||||
<el-table
|
||||
border
|
||||
ref="multipleTable"
|
||||
:data="ruleForm.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
|
||||
v-if="scope.row.isAdvanceSell"
|
||||
@change="
|
||||
scope.row.balancePayment =
|
||||
scope.row.presalePrice - scope.row.earnestMoney
|
||||
"
|
||||
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>
|
||||
</el-form>
|
||||
</div>
|
||||
<!-- 选择商品 -->
|
||||
</obj-modal>
|
||||
|
@ -251,41 +374,56 @@ export default {
|
|||
orderTime: [], //订单支付时间
|
||||
arrears: [], //尾款时间
|
||||
delivery: [], //发货时间
|
||||
tableData: [
|
||||
{
|
||||
date: "2016-05-03",
|
||||
name: "王小虎",
|
||||
address: "红",
|
||||
isShow: false,
|
||||
presalePrice: "",
|
||||
},
|
||||
{
|
||||
date: "2016-05-02",
|
||||
name: "王小虎",
|
||||
address: "弄",
|
||||
isShow: false,
|
||||
presalePrice: "",
|
||||
},
|
||||
{
|
||||
date: "2016-05-04",
|
||||
name: "王小虎",
|
||||
address: "8 弄",
|
||||
isShow: true,
|
||||
presalePrice: "",
|
||||
},
|
||||
],
|
||||
tableData: [],
|
||||
rules: {
|
||||
name: [{ required: true, message: "请输入属性名称", trigger: "blur" }],
|
||||
value: [
|
||||
startTime: [
|
||||
{
|
||||
required: true,
|
||||
message: "请输入属性内容",
|
||||
trigger: "blur",
|
||||
message: "请选择支付时间",
|
||||
trigger: ["blur", "change"],
|
||||
},
|
||||
],
|
||||
balancePaymentStartTime: [
|
||||
{
|
||||
required: true,
|
||||
message: "请选择尾款支付时间",
|
||||
trigger: "change",
|
||||
},
|
||||
],
|
||||
estimatedStartDeliveryTime: [
|
||||
{
|
||||
required: true,
|
||||
message: "请选择预计发货时间",
|
||||
trigger: "change",
|
||||
},
|
||||
],
|
||||
isRefundEarnestMoney: [
|
||||
{
|
||||
required: true,
|
||||
message: "请选择定金可退",
|
||||
trigger: "change",
|
||||
},
|
||||
],
|
||||
presalePrice: [
|
||||
{
|
||||
required: true,
|
||||
message: "请输入预售价格",
|
||||
trigger: ["blur", "change"],
|
||||
},
|
||||
],
|
||||
},
|
||||
};
|
||||
},
|
||||
watch: {
|
||||
"modalConfig.show"(newVal) {
|
||||
if (newVal) {
|
||||
//关闭弹窗清空校验
|
||||
setTimeout(() => {
|
||||
this.$refs.ruleForm.resetFields();
|
||||
});
|
||||
}
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
queryTableData(pageNo, pageSize) {},
|
||||
toggle(e) {
|
||||
|
@ -303,6 +441,12 @@ export default {
|
|||
this.arrears = [];
|
||||
this.delivery = [];
|
||||
this.ruleForm = {
|
||||
startTime: "",
|
||||
endTime: "",
|
||||
balancePaymentStartTime: "",
|
||||
balancePaymentEndTime: "",
|
||||
estimatedStartDeliveryTime: "",
|
||||
estimatedEndDeliveryTime: "",
|
||||
productList: [],
|
||||
isRefundEarnestMoney: 1, //定金可退 1是 2否
|
||||
};
|
||||
|
@ -319,14 +463,23 @@ export default {
|
|||
console.log(row.startTime, row.endTime);
|
||||
this.orderTime = [row.startTime, row.endTime];
|
||||
this.arrears = [row.balancePaymentStartTime, row.balancePaymentEndTime];
|
||||
this.delivery = [row.estimatedStartDeliveryTime, row.estimatedEndDeliveryTime];
|
||||
this.ruleForm.productList = [
|
||||
{
|
||||
productId: row.id,
|
||||
name: row.name,
|
||||
productSpecificationList: row.productSpecificationList,
|
||||
},
|
||||
this.delivery = [
|
||||
row.estimatedStartDeliveryTime,
|
||||
row.estimatedEndDeliveryTime,
|
||||
];
|
||||
(this.ruleForm = {
|
||||
productId: row.id,
|
||||
advanceSellId: row.advanceSellId,
|
||||
startTime: row.startTime,
|
||||
name: row.name,
|
||||
endTime: row.endTime,
|
||||
balancePaymentStartTime: row.balancePaymentStartTime,
|
||||
balancePaymentEndTime: row.balancePaymentEndTime,
|
||||
estimatedStartDeliveryTime: row.estimatedStartDeliveryTime,
|
||||
estimatedEndDeliveryTime: row.estimatedEndDeliveryTime,
|
||||
isRefundEarnestMoney: row.isRefundEarnestMoney,
|
||||
productSpecificationList: row.productSpecificationList,
|
||||
}),
|
||||
console.log(this.orderTime, this.arrears, this.delivery);
|
||||
|
||||
// this.ruleForm = row;
|
||||
|
@ -403,17 +556,31 @@ export default {
|
|||
type: "primary",
|
||||
// submit: true,
|
||||
handle: () => {
|
||||
this.$api.preSale.addPreSaleProducts(this.ruleForm).then((res) => {
|
||||
console.log("确认", res);
|
||||
// this.toggle();
|
||||
if (this.isAdd) {
|
||||
this.$refs.ruleForm.validate((valid) => {
|
||||
if (valid) {
|
||||
console.log(valid);
|
||||
this.$api.preSale
|
||||
.addPreSaleProducts(this.ruleForm)
|
||||
.then((res) => {
|
||||
this.$emit("queryList");
|
||||
this.toggle();
|
||||
});
|
||||
// console.log("确认", this.ruleForm);
|
||||
// this.$refs.ruleForm.validate((valid) => {
|
||||
// if (valid) {
|
||||
// this.$emit("getAttribute", this.ruleForm);
|
||||
// this.toggle();
|
||||
// }
|
||||
// });
|
||||
}
|
||||
});
|
||||
} else {
|
||||
this.$refs.ruleForm.validate((valid) => {
|
||||
if (valid) {
|
||||
console.log(valid);
|
||||
this.$api.preSale
|
||||
.updatePreSaleProducts(this.ruleForm)
|
||||
.then((res) => {
|
||||
this.$emit("queryList");
|
||||
this.toggle();
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
},
|
||||
},
|
||||
];
|
||||
|
|
|
@ -7,32 +7,59 @@
|
|||
:modalHandles="modalHandles"
|
||||
>
|
||||
<template slot="dialog__content">
|
||||
<obj-table-plus
|
||||
ref="oTable"
|
||||
style="height: 70vh"
|
||||
:tableCols="tableCols"
|
||||
:tableProp="tableProp"
|
||||
@query="queryList"
|
||||
v-model="dataList"
|
||||
:tableEvent="tableEvent"
|
||||
:enableAutoQuery="false"
|
||||
>
|
||||
<template slot="tableTop">
|
||||
<el-form :inline="true" :model="formInline" class="demo-form-inline">
|
||||
<el-form-item label="商品搜索">
|
||||
<el-input
|
||||
v-model="formList.name"
|
||||
placeholder="商品搜索"
|
||||
></el-input>
|
||||
<el-input v-model="formList.name" placeholder="商品搜索"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" @click="$refs.oTable.reload()"
|
||||
>查询</el-button
|
||||
>
|
||||
<el-button type="primary" @click="queryList">查询</el-button>
|
||||
<el-button type="primary" @click="Reset">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<el-table
|
||||
border
|
||||
ref="multipleTable"
|
||||
:data="dataList"
|
||||
tooltip-effect="dark"
|
||||
style="width: 100%"
|
||||
@select="select"
|
||||
@select-all="selectAll"
|
||||
>
|
||||
<el-table-column type="selection" width="55"> </el-table-column>
|
||||
<el-table-column label="商品图" width="100">
|
||||
<template slot-scope="scope">
|
||||
<el-image
|
||||
:preview-src-list="[scope.row.productPhotoList[0].url]"
|
||||
:src="scope.row.productPhotoList[0].url"
|
||||
></el-image
|
||||
></template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="name" label="商品名称" />
|
||||
<el-table-column prop="name" label="商品售价">
|
||||
<template slot-scope="scope">
|
||||
<span>¥{{ getSalePrice(scope.row) }}</span>
|
||||
</template>
|
||||
</obj-table-plus>
|
||||
</el-table-column>
|
||||
<el-table-column prop="address" label="折扣">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ scope.row.discountActivity?.ruleObject.discount }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="saleNum" label="销量" />
|
||||
<el-table-column prop="stockNum" label="库存" />
|
||||
</el-table>
|
||||
<div class="pagination-container">
|
||||
<el-pagination
|
||||
:current-page="query.pageNumber"
|
||||
:page-sizes="[10, 20, 30, 50]"
|
||||
:page-size="query.pageSize"
|
||||
:total="total"
|
||||
background
|
||||
layout="total, sizes, prev, pager, next, jumper"
|
||||
@size-change="handleSizeChange"
|
||||
@current-change="handleCurrentChange"
|
||||
/>
|
||||
</div>
|
||||
</template>
|
||||
</obj-modal>
|
||||
</template>
|
||||
|
@ -49,15 +76,13 @@ export default {
|
|||
show: false,
|
||||
width: "1000px",
|
||||
},
|
||||
query: {
|
||||
pageNumber: 1,
|
||||
pageSize: 10,
|
||||
},
|
||||
total: 0,
|
||||
modalData: {},
|
||||
dataList: [], //表格数据
|
||||
tableProp: {
|
||||
"auto-resize": true,
|
||||
border: true,
|
||||
height: "auto",
|
||||
"row-id": "id",
|
||||
"show-overflow": false,
|
||||
},
|
||||
selectList: [],
|
||||
formInline: {},
|
||||
formList: {
|
||||
|
@ -66,27 +91,26 @@ export default {
|
|||
};
|
||||
},
|
||||
methods: {
|
||||
queryList(pageNo, pageSize) {
|
||||
queryList() {
|
||||
this.$api.mer_admin
|
||||
.getProductPage({
|
||||
p: {
|
||||
pageNumber: pageNo,
|
||||
pageSize: pageSize,
|
||||
pageNumber: this.query.pageNumber,
|
||||
pageSize: this.query.pageSize,
|
||||
},
|
||||
...this.formInline,
|
||||
...this.formList,
|
||||
productFilterType: "SALE",
|
||||
merchantId: JSON.parse(sessionStorage.getItem("userInfo")).merchantId,
|
||||
productQuerySortParam: [],
|
||||
})
|
||||
.then((res) => {
|
||||
console.log(res);
|
||||
this.$refs.oTable.complete(
|
||||
res.data.data.data,
|
||||
Number(res.data.data.total)
|
||||
);
|
||||
this.dataList = res.data.data.data;
|
||||
this.total = Number(res.data.data.total);
|
||||
})
|
||||
.catch((err) => {
|
||||
this.$refs.oTable.complete(false);
|
||||
this.dataList = [];
|
||||
});
|
||||
},
|
||||
toggle(e) {
|
||||
|
@ -104,7 +128,7 @@ export default {
|
|||
this.formInline = row;
|
||||
this.isAdd = true;
|
||||
this.$nextTick(() => {
|
||||
this.$refs.oTable.reload();
|
||||
this.queryList();
|
||||
});
|
||||
},
|
||||
update: () => {
|
||||
|
@ -113,77 +137,54 @@ export default {
|
|||
};
|
||||
},
|
||||
init(row) {},
|
||||
toggleSelection(rows) {
|
||||
if (rows) {
|
||||
rows.forEach((row) => {
|
||||
this.$refs.multipleTable.toggleRowSelection(row);
|
||||
});
|
||||
} else {
|
||||
this.$refs.multipleTable.clearSelection();
|
||||
}
|
||||
},
|
||||
select(selection, row) {
|
||||
if (selection.length > 5) {
|
||||
this.$message.error("最多选择5个商品");
|
||||
this.$refs.multipleTable.toggleRowSelection(row, false);
|
||||
} else {
|
||||
this.selectList = selection;
|
||||
}
|
||||
},
|
||||
selectAll(selection) {
|
||||
if (selection.length > 5) {
|
||||
this.$message.error("最多选择5个商品");
|
||||
selection.length = 5;
|
||||
this.selectList = selection;
|
||||
console.log(selection);
|
||||
} else {
|
||||
this.selectList = selection;
|
||||
}
|
||||
},
|
||||
getSalePrice(row) {
|
||||
if (row.minSalePrice == row.maxSalePrice) {
|
||||
return row.minSalePrice;
|
||||
} else {
|
||||
return `${row.minSalePrice}~${row.maxSalePrice}`;
|
||||
}
|
||||
},
|
||||
handleSizeChange(val) {
|
||||
this.query.pageSize = val;
|
||||
this.getList();
|
||||
},
|
||||
handleCurrentChange(val) {
|
||||
this.query.pageNumber = val;
|
||||
this.getList();
|
||||
},
|
||||
Reset() {
|
||||
this.formList = {};
|
||||
this.queryList();
|
||||
},
|
||||
},
|
||||
computed: {
|
||||
tableCols() {
|
||||
return [
|
||||
{ type: "checkbox", width: "60px", fixed: "left" },
|
||||
{
|
||||
title: "商品图",
|
||||
field: "productPhotoList",
|
||||
align: "center",
|
||||
width: "100px",
|
||||
type: "jsx",
|
||||
render: ({ row }) => {
|
||||
if (row.productPhotoList.length > 0) {
|
||||
return (
|
||||
<el-image
|
||||
preview-src-list={row.productPhotoList.map((item) => {
|
||||
return item.url;
|
||||
})}
|
||||
src={row.productPhotoList[0].url}
|
||||
></el-image>
|
||||
);
|
||||
} else {
|
||||
return <span>暂无商品图</span>;
|
||||
}
|
||||
},
|
||||
},
|
||||
{
|
||||
title: "商品名称",
|
||||
align: "center",
|
||||
field: "name",
|
||||
},
|
||||
{
|
||||
title: "商品售价",
|
||||
align: "center",
|
||||
field: "minSalePrice",
|
||||
type: "jsx",
|
||||
render: ({ row }) => {
|
||||
if (row.minSalePrice == row.maxSalePrice) {
|
||||
return <span>¥{row.minSalePrice}</span>;
|
||||
} else {
|
||||
return (
|
||||
<span>
|
||||
¥{row.minSalePrice}~¥{row.maxSalePrice}
|
||||
</span>
|
||||
);
|
||||
}
|
||||
},
|
||||
},
|
||||
{
|
||||
title: "折扣",
|
||||
align: "center",
|
||||
field: "discountActivity",
|
||||
type: "jsx",
|
||||
render: ({ row }) => {
|
||||
if (row.discountActivity) {
|
||||
return <span>{row.discountActivity.ruleObject.discount}折</span>;
|
||||
}
|
||||
},
|
||||
},
|
||||
{
|
||||
title: "销量",
|
||||
align: "center",
|
||||
field: "saleNum",
|
||||
},
|
||||
{
|
||||
title: "库存",
|
||||
align: "center",
|
||||
field: "stockNum",
|
||||
},
|
||||
];
|
||||
},
|
||||
modalHandles() {
|
||||
return [
|
||||
{
|
||||
|
@ -205,10 +206,15 @@ export default {
|
|||
tableEvent() {
|
||||
return {
|
||||
"checkbox-all": ({ records, reserves }) => {
|
||||
console.log(records, reserves);
|
||||
this.selectList = [...records, ...reserves];
|
||||
},
|
||||
"checkbox-change": ({ records, reserves }) => {
|
||||
console.log(this.selectList, "2");
|
||||
console.log(records, reserves);
|
||||
if (records.length > 5) {
|
||||
this.$message.error("最多选择5个商品");
|
||||
return;
|
||||
}
|
||||
this.selectList = [...records, ...reserves];
|
||||
},
|
||||
};
|
||||
|
@ -217,5 +223,8 @@ export default {
|
|||
};
|
||||
</script>
|
||||
|
||||
<style>
|
||||
<style lang="scss" scoped>
|
||||
::v-deep .selectAllbtnDis .cell .el-checkbox__inner {
|
||||
display: none;
|
||||
}
|
||||
</style>
|
Loading…
Reference in New Issue