Merge branch 'master' into ma

This commit is contained in:
mabo
2021-06-23 08:48:30 +08:00
90 changed files with 3995 additions and 4229 deletions

View File

@@ -5,10 +5,21 @@ import { getRequest, postRequest, putRequest, deleteRequest} from '@/libs/axios'
export const getManagerBrandPage = (params) => {
return getRequest('/goods/brand/getByPage', params)
}
// 添加或修改品牌设置
// 批量删除
export const delBrand = (ids) =>{
return deleteRequest(`/goods/brand/delByIds/${ids}`)
}
// 添加
export const addBrand = (params) => {
return postRequest('/goods/brand', params)
}
// 修改品牌设置
export const updateBrand = (params) => {
return putRequest(`/goods/brand/${params.id}`, params)
}
// 禁用品牌
export const disableBrand = (id, params) => {
return putRequest(`/goods/brand/disable/${id}`, params)

View File

@@ -14,7 +14,7 @@ export const getPromotionSeckill = params => {
// 是否推荐直播间
export const whetherStar = params => {
return getRequest(`/broadcast/studio/id/${params.id}&recommend=${params.recommend}`);
return putRequest(`/broadcast/studio/recommend/${params.id}`,params);
};
// 添加优惠券活动
@@ -119,8 +119,8 @@ export const getCouponActivityList = params => {
return getRequest("/promotion/couponActivity", params);
};
// 作废优惠券
export const deleteCouponActivity = ids => {
return deleteRequest(`/promotion/couponActivity/${ids}`);
export const closeActivity = id => {
return deleteRequest(`/promotion/couponActivity/${id}`);
};
// 更新优惠券活动
export const updateCouponActivity = params => {

View File

@@ -21,10 +21,10 @@ export default {
// buyer: "https://buyer-api.pickmall.cn",
// seller: "https://store-api.pickmall.cn",
// manager: "https://admin-api.pickmall.cn"
common: 'http://192.168.0.100:8890',
buyer: 'http://192.168.0.100:8888',
seller: 'http://192.168.0.100:8889',
manager: 'http://192.168.0.100:8887'
common: 'http://192.168.0.109:8890',
buyer: 'http://192.168.0.109:8888',
seller: 'http://192.168.0.109:8889',
manager: 'http://192.168.0.109:8887'
},
api_prod: {
common: "https://common-api.pickmall.cn",

View File

@@ -251,10 +251,16 @@ export const otherRouter = {
},
{
path: "coupon-activity/edit",
title: "编辑平台优惠券",
title: "编辑平台优惠券活动",
name: "edit-coupon-activity",
component: () => import("@/views/promotion/couponActivity/couponPublish.vue")
},
{
path: "promotion/coupon-activity-info",
title: "券活动详情",
name: "coupon-activity-info",
component: () => import("@/views/promotion/couponActivity/couponInfo.vue")
},
{
path: "promotion/member-receive-coupon",
title: "领取详情",
@@ -332,7 +338,7 @@ export const otherRouter = {
path: "liveDetail",
title: "查看直播",
name: "liveDetail",
component: () => import("@/views/live/liveDetail.vue")
component: () => import("@/views/promotion/live/liveDetail.vue")
}
]
};

View File

@@ -147,21 +147,13 @@ export default {
sortable: false,
render: (h, params) => {
if (params.row.distributionStatus == "PASS") {
return h("Badge", {
props: { status: "success", text: "审核通过" },
});
return h("Tag", {props: {color: "green",},},"通过");
} else if (params.row.distributionStatus == "APPLY") {
return h("Badge", {
props: { status: "processing", text: "申请中" },
});
return h("Tag", {props: {color: "geekblue",},},"待审核");
} else if (params.row.distributionStatus == "RETREAT") {
return h("Badge", {
props: { status: "warning", text: "已清退" },
});
return h("Tag", {props: {color: "volcano",},},"清退");
} else if (params.row.distributionStatus == "REFUSE") {
return h("Badge", {
props: { status: "error", text: "审核拒绝" },
});
return h("Tag", {props: {color: "red",},},"拒绝");
}
},
},

View File

@@ -38,6 +38,12 @@
<Option value="DOWN">下架</Option>
</Select>
</Form-item>
<Form-item label="商品类型" prop="status">
<Select v-model="searchForm.goodsType" placeholder="请选择" clearable style="width: 200px">
<Option value="PHYSICAL_GOODS">实物商品</Option>
<Option value="VIRTUAL_GOODS">虚拟商品</Option>
</Select>
</Form-item>
<Button @click="handleSearch" class="search-btn" type="primary" icon="ios-search" >搜索</Button>
</Form>
</Row>
@@ -174,29 +180,29 @@ export default {
);
},
},
{
title: "商品类型",
key: "goodsType",
width: 130,
render: (h, params) => {
if (params.row.goodsType === 'PHYSICAL_GOODS') {
return h("Tag", {props: {color: "green",},}, "实物商品");
} else if (params.row.goodsType === 'VIRTUAL_GOODS') {
return h("Tag", {props: {color: "volcano",},}, "虚拟商品");
} else {
return h("Tag", {props: {color: "geekblue",},}, "电子卡券");
}
},
},
{
title: "状态",
key: "marketEnable",
width: 100,
render: (h, params) => {
if (params.row.marketEnable == "DOWN") {
return h("div", [
h("Badge", {
props: {
status: "error",
text: "下架",
},
}),
]);
return h("Tag", {props: {color: "green"},},"上架");
} else if (params.row.marketEnable == "UPPER") {
return h("div", [
h("Badge", {
props: {
status: "success",
text: "上架",
},
}),
]);
return h("Tag", {props: {color: "volcano",},},"下架");
}
},
},
@@ -206,36 +212,14 @@ export default {
width: 130,
render: (h, params) => {
if (params.row.isAuth == "TOBEAUDITED") {
return h("div", [
h("Badge", {
props: {
status: "error",
text: "待审核",
},
}),
]);
return h("Tag", {props: {color: "volcano",},},"待审核");
} else if (params.row.isAuth == "PASS") {
return h("div", [
h("Badge", {
props: {
status: "success",
text: "审核通过",
},
}),
]);
return h("Tag", {props: {color: "green"},},"通过");
} else if (params.row.isAuth == "REFUSE") {
return h("div", [
h("Badge", {
props: {
status: "error",
text: "审核拒绝",
},
}),
]);
return h("Tag", {props: {color: "red",},},"拒绝");
}
},
},
{
title: "店铺名称",
key: "storeName",

View File

@@ -1,25 +1,13 @@
<style lang="scss">
@import "@/styles/table-common.scss";
@import "@/styles/table-common.scss";
</style>
<template>
<div class="search">
<Card>
<Row @keydown.enter.native="handleSearch">
<Form
ref="searchForm"
:model="searchForm"
inline
:label-width="70"
class="search-form"
>
<Form ref="searchForm" :model="searchForm" inline :label-width="70" class="search-form">
<Form-item label="品牌名称" prop="name">
<Input
type="text"
v-model="searchForm.name"
placeholder="请输入品牌名称"
clearable
style="width: 200px"
/>
<Input type="text" v-model="searchForm.name" placeholder="请输入品牌名称" clearable style="width: 200px" />
</Form-item>
<Button @click="handleSearch" type="primary" icon="ios-search" class="search-btn">搜索</Button>
@@ -28,370 +16,361 @@
<Row class="operation padding-row">
<Button @click="add" type="primary">添加</Button>
</Row>
<Table
:loading="loading"
border
:columns="columns"
:data="data"
ref="table"
sortable="custom"
@on-sort-change="changeSort"
@on-selection-change="changeSelect"
></Table>
<Table :loading="loading" border :columns="columns" :data="data" ref="table" sortable="custom" @on-sort-change="changeSort" @on-selection-change="changeSelect"></Table>
<Row type="flex" justify="end" class="page">
<Page
:current="searchForm.pageNumber"
:total="total"
:page-size="searchForm.pageSize"
@on-change="changePage"
@on-page-size-change="changePageSize"
:page-size-opts="[10, 20, 50]"
size="small"
show-total
show-elevator
show-sizer
></Page>
<Page :current="searchForm.pageNumber" :total="total" :page-size="searchForm.pageSize" @on-change="changePage" @on-page-size-change="changePageSize" :page-size-opts="[10, 20, 50]" size="small"
show-total show-elevator show-sizer></Page>
</Row>
</Card>
<Modal
:title="modalTitle"
v-model="modalVisible"
:mask-closable="false"
:width="500"
>
<Modal :title="modalTitle" v-model="modalVisible" :mask-closable="false" :width="500">
<Form ref="form" :model="form" :label-width="100" :rules="formValidate">
<FormItem label="品牌名称" prop="name">
<Input v-model="form.name" clearable style="width: 100%"/>
<Input v-model="form.name" clearable style="width: 100%" />
</FormItem>
<FormItem label="品牌图标" prop="logo">
<upload-pic-input
v-model="form.logo"
style="width: 100%"
></upload-pic-input>
<upload-pic-input v-model="form.logo" style="width: 100%"></upload-pic-input>
</FormItem>
</Form>
<div slot="footer">
<Button type="text" @click="modalVisible = false">取消</Button>
<Button type="primary" :loading="submitLoading" @click="handleSubmit"
>提交
</Button
>
<Button type="primary" :loading="submitLoading" @click="handleSubmit">提交
</Button>
</div>
</Modal>
</div>
</template>
<script>
import {getManagerBrandPage, addBrand, disableBrand} from "@/api/goods";
import uploadPicInput from "@/views/my-components/lili/upload-pic-input";
import {
getManagerBrandPage,
addBrand,
updateBrand,
disableBrand,
delBrand,
} from "@/api/goods";
import uploadPicInput from "@/views/my-components/lili/upload-pic-input";
export default {
name: "brand",
components: {
uploadPicInput,
},
data() {
return {
loading: true, // 表单加载状态
modalType: 0, // 添加或编辑标识
modalVisible: false, // 添加或编辑显示
modalTitle: "", // 添加或编辑标题
searchForm: {
// 搜索框初始化对象
pageNumber: 1, // 当前页数
pageSize: 10, // 页面大小
sort: "create_time", // 默认排序字段
order: "desc", // 默认排序方式
export default {
name: "brand",
components: {
uploadPicInput,
},
data() {
return {
loading: true, // 表单加载状态
modalType: 0, // 添加或编辑标识
modalVisible: false, // 添加或编辑显示
modalTitle: "", // 添加或编辑标题
searchForm: {
// 搜索框初始化对象
pageNumber: 1, // 当前页数
pageSize: 10, // 页面大小
sort: "create_time", // 默认排序字段
order: "desc", // 默认排序方式
},
form: {
// 添加或编辑表单对象初始化数据
name: "",
logo: "",
deleteFlag: "",
},
// 表单验证规则
formValidate: {},
submitLoading: false, // 添加或编辑提交状态
selectList: [], // 多选数据
selectCount: 0, // 多选计数
columns: [
{
title: "品牌名称",
key: "name",
width: 200,
resizable: true,
sortable: false,
},
form: {
// 添加或编辑表单对象初始化数据
name: "",
logo: "",
deleteFlag: "",
{
title: "品牌图标",
key: "logo",
align: "left",
render: (h, params) => {
return h("img", {
attrs: {
src: params.row.logo,
alt: "加载图片失败",
},
style: {
cursor: "pointer",
width: "80px",
height: "60px",
margin: "10px 0",
"object-fit": "contain",
},
});
},
},
// 表单验证规则
formValidate: {},
submitLoading: false, // 添加或编辑提交状态
selectList: [], // 多选数据
selectCount: 0, // 多选计数
columns: [
{
title: "品牌名称",
key: "name",
width: 200,
resizable: true,
sortable: false,
},
{
title: "品牌图标",
key: "logo",
align: "left",
render: (h, params) => {
return h("img", {
attrs: {
src: params.row.logo,
alt: "加载图片失败",
},
style: {
cursor: "pointer",
width: "80px",
height: "60px",
margin: "10px 0",
"object-fit": "contain",
},
});
},
},
{
title: "状态",
key: "deleteFlag",
align: "left",
render: (h, params) => {
if (params.row.deleteFlag == 0) {
return h("div", [
h("Badge", {
props: {
status: "success",
text: "启用",
},
}),
]);
} else if (params.row.deleteFlag == 1) {
return h("div", [
h("Badge", {
props: {
status: "error",
text: "禁用",
},
}),
]);
}
},
filters: [
{
label: "启用",
value: 0,
},
{
label: "禁用",
value: 1,
},
],
filterMultiple: false,
filterMethod(value, row) {
if (value == 0) {
return row.deleteFlag == 0;
} else if (value == 1) {
return row.deleteFlag == 1;
}
},
},
{
title: "操作",
key: "action",
width: 180,
align: "center",
fixed: "right",
render: (h, params) => {
let enableOrDisable = "";
if (params.row.deleteFlag == 0) {
enableOrDisable = h(
"Button",
{
props: {
size: "small",
type: "error",
},
style: {
marginRight: "5px",
},
on: {
click: () => {
this.disable(params.row);
},
},
},
"禁用"
);
} else {
enableOrDisable = h(
"Button",
{
props: {
type: "success",
size: "small",
},
style: {
marginRight: "5px",
},
on: {
click: () => {
this.enable(params.row);
},
},
},
"启用"
);
}
return h("div", [
h(
"Button",
{
props: {
type: "info",
size: "small",
},
style: {
marginRight: "5px",
},
on: {
click: () => {
this.edit(params.row);
},
},
},
"编辑"
),
enableOrDisable,
]);
},
},
],
data: [], // 表单数据
total: 0, // 表单数据总数
};
},
methods: {
init() {
this.getDataList();
},
changePage(v) {
this.searchForm.pageNumber = v;
this.getDataList();
this.clearSelectAll();
},
changePageSize(v) {
this.searchForm.pageSize = v;
this.getDataList();
},
handleSearch() {
this.searchForm.pageNumber = 1;
this.searchForm.pageSize = 10;
this.getDataList();
},
changeSort(e) {
this.searchForm.sort = e.key;
this.searchForm.order = e.order;
if (e.order === "normal") {
this.searchForm.order = "";
}
this.getDataList();
},
clearSelectAll() {
this.$refs.table.selectAll(false);
},
changeSelect(e) {
this.selectList = e;
this.selectCount = e.length;
},
getDataList() {
this.loading = true;
// 带多条件搜索参数获取表单数据 请自行修改接口
getManagerBrandPage(this.searchForm).then((res) => {
this.loading = false;
if (res.success) {
console.warn(12)
this.data = res.result.records;
this.total = res.result.total;
}
});
},
handleSubmit() {
this.$refs.form.validate((valid) => {
if (valid) {
this.submitLoading = true;
if (this.modalType === 0) {
// 添加 避免编辑后传入id等数据 记得删除
delete this.form.id;
addBrand(this.form).then((res) => {
this.submitLoading = false;
if (res.success) {
this.$Message.success("操作成功");
this.getDataList();
this.modalVisible = false;
}
});
} else {
// 编辑
addBrand(this.form).then((res) => {
this.submitLoading = false;
if (res.success) {
this.$Message.success("操作成功");
this.getDataList();
this.modalVisible = false;
}
});
{
title: "状态",
key: "deleteFlag",
align: "left",
render: (h, params) => {
if (params.row.deleteFlag == 0) {
return h("Tag", {props: {color: "green",},},"启用");
} else if (params.row.deleteFlag == 1) {
return h("Tag", {props: {color: "volcano",},},"禁用");
}
}
});
},
add() {
this.modalType = 0;
this.modalTitle = "添加";
this.$refs.form.resetFields();
delete this.form.id;
this.modalVisible = true;
},
edit(v) {
this.modalType = 1;
this.modalTitle = "编辑";
this.$refs.form.resetFields();
// 转换null为""
for (let attr in v) {
if (v[attr] === null) {
v[attr] = "";
},
filters: [
{
label: "启用",
value: 0,
},
{
label: "禁用",
value: 1,
},
],
filterMultiple: false,
filterMethod(value, row) {
if (value == 0) {
return row.deleteFlag == 0;
} else if (value == 1) {
return row.deleteFlag == 1;
}
},
},
{
title: "操作",
key: "action",
width: 180,
align: "center",
fixed: "right",
render: (h, params) => {
let enableOrDisable = "";
if (params.row.deleteFlag == 0) {
enableOrDisable = h(
"Button",
{
props: {
size: "small",
type: "error",
},
style: {
marginRight: "5px",
},
on: {
click: () => {
this.disable(params.row);
},
},
},
"禁用"
);
} else {
enableOrDisable = h(
"Button",
{
props: {
type: "success",
size: "small",
},
style: {
marginRight: "5px",
},
on: {
click: () => {
this.enable(params.row);
},
},
},
"启用"
);
}
return h("div", [
h(
"Button",
{
props: {
type: "info",
size: "small",
},
style: {
marginRight: "5px",
},
on: {
click: () => {
this.edit(params.row);
},
},
},
"编辑"
),
enableOrDisable,
h(
"Button",
{
props: {
size: "small",
},
style: {
marginRight: "5px",
},
on: {
click: () => {
this.delBrand(params.row.id);
},
},
},
"删除"
),
]);
},
},
],
data: [], // 表单数据
total: 0, // 表单数据总数
};
},
methods: {
// 删除品牌
async delBrand(id) {
let res = await delBrand(id);
if (res.success) {
this.$Message.success("品牌删除成功!");
this.getDataList();
}
},
init() {
this.getDataList();
},
changePage(v) {
this.searchForm.pageNumber = v;
this.getDataList();
this.clearSelectAll();
},
changePageSize(v) {
this.searchForm.pageSize = v;
this.getDataList();
},
handleSearch() {
this.searchForm.pageNumber = 1;
this.searchForm.pageSize = 10;
this.getDataList();
},
changeSort(e) {
this.searchForm.sort = e.key;
this.searchForm.order = e.order;
if (e.order === "normal") {
this.searchForm.order = "";
}
this.getDataList();
},
clearSelectAll() {
this.$refs.table.selectAll(false);
},
changeSelect(e) {
this.selectList = e;
this.selectCount = e.length;
},
getDataList() {
this.loading = true;
// 带多条件搜索参数获取表单数据 请自行修改接口
getManagerBrandPage(this.searchForm).then((res) => {
this.loading = false;
if (res.success) {
console.warn(12);
this.data = res.result.records;
this.total = res.result.total;
}
});
},
handleSubmit() {
this.$refs.form.validate((valid) => {
if (valid) {
this.submitLoading = true;
if (this.modalType === 0) {
// 添加 避免编辑后传入id等数据 记得删除
delete this.form.id;
addBrand(this.form).then((res) => {
this.submitLoading = false;
if (res.success) {
this.$Message.success("操作成功");
this.getDataList();
this.modalVisible = false;
}
});
} else {
// 编辑
updateBrand(this.form).then((res) => {
this.submitLoading = false;
if (res.success) {
this.$Message.success("操作成功");
this.getDataList();
this.modalVisible = false;
}
});
}
}
let str = JSON.stringify(v);
let data = JSON.parse(str);
this.form = data;
this.modalVisible = true;
},
enable(v) {
this.$Modal.confirm({
title: "确认启用",
content: "您确认要启用品牌 " + v.name + " ?",
loading: true,
onOk: () => {
disableBrand(v.id, {disable: false}).then((res) => {
this.$Modal.remove();
if (res.success) {
this.$Message.success("操作成功");
this.getDataList();
}
});
},
});
},
disable(v) {
this.$Modal.confirm({
title: "确认禁用",
content: "您确认要禁用品牌 " + v.name + " ?",
loading: true,
onOk: () => {
disableBrand(v.id, {disable: true}).then((res) => {
this.$Modal.remove();
if (res.success) {
this.$Message.success("操作成功");
this.getDataList();
}
});
},
});
},
});
},
mounted() {
this.init();
add() {
this.modalType = 0;
this.modalTitle = "添加";
this.$refs.form.resetFields();
delete this.form.id;
this.modalVisible = true;
},
};
edit(v) {
this.modalType = 1;
this.modalTitle = "编辑";
this.$refs.form.resetFields();
// 转换null为""
for (let attr in v) {
if (v[attr] === null) {
v[attr] = "";
}
}
let str = JSON.stringify(v);
let data = JSON.parse(str);
this.form = data;
this.modalVisible = true;
},
enable(v) {
this.$Modal.confirm({
title: "确认启用",
content: "您确认要启用品牌 " + v.name + " ?",
loading: true,
onOk: () => {
disableBrand(v.id, { disable: false }).then((res) => {
this.$Modal.remove();
if (res.success) {
this.$Message.success("操作成功");
this.getDataList();
}
});
},
});
},
disable(v) {
this.$Modal.confirm({
title: "确认禁用",
content: "您确认要禁用品牌 " + v.name + " ?",
loading: true,
onOk: () => {
disableBrand(v.id, { disable: true }).then((res) => {
this.$Modal.remove();
if (res.success) {
this.$Message.success("操作成功");
this.getDataList();
}
});
},
});
},
},
mounted() {
this.init();
},
};
</script>

View File

@@ -11,7 +11,7 @@
<tree-table ref="treeTable" size="default" :loading="loading" :data="tableData" :columns="columns" :border="true" :show-index="false" :is-fold="true" :expand-type="false" primary-key="id">
<template slot="action" slot-scope="scope">
<Dropdown v-show="scope.row.level == 2" transfer="true" trigger="click">
<Dropdown v-show="scope.row.level == 2" transfer="true" trigger="click">
<Button size="small">
绑定
<Icon type="ios-arrow-down"></Icon>
@@ -106,7 +106,7 @@
<Modal :title="modalSpecTitle" v-model="modalSpecVisible" :mask-closable="false" :width="500">
<Form ref="specForm" :model="specForm" :label-width="100">
<Select v-model="specForm.category_specs" multiple>
<Select v-model="specForm.categorySpecs" multiple>
<Option v-for="item in specifications" :value="item.id" :key="item.id" :label="item.specName">
</Option>
</Select>
@@ -134,7 +134,6 @@ import {
} from "@/api/goods";
import TreeTable from "@/views/my-components/tree-table/Table/Table";
import uploadPicInput from "@/views/my-components/lili/upload-pic-input";
import * as filters from "@/utils/filters";
export default {
name: "lili-components",
@@ -153,7 +152,7 @@ export default {
specifications: [], //规格集合
categoryId: "", // 分类id
category_brands: [], //已经选择的品牌
category_specs: [], //已经选择的规格
categorySpecs: [], //已经选择的规格
expandLevel: 1, // 展开层级
modalType: 0, // 添加或编辑标识
modalVisible: false, // 添加或编辑显示
@@ -212,13 +211,17 @@ export default {
},
],
tableData: [],
categoryIndex: 0,
};
},
methods: {
changeSortCate(val) {
let way = this.categoryList.find((item) => {
return item.name == val;
let way = this.categoryList.find((item, index) => {
if (item.name == val) {
this.categoryIndex = index;
console.log((this.categoryIndex = index));
return item.name == val;
}
});
this.tableData = [way];
},
@@ -236,7 +239,8 @@ export default {
//获取所有规格
getSpecList() {
getSpecificationList().then((res) => {
if (res.success) {
if (res.length != 0) {
this.specifications = res;
}
});
@@ -244,7 +248,7 @@ export default {
//弹出品牌关联框
brandOperation(v) {
getCategoryBrandListData(v.id).then((res) => {
console.warn(res)
console.warn(res);
this.categoryId = v.id;
this.modalBrandTitle = "品牌关联";
this.brandForm.categoryBrands = res.result.map((item) => item.id);
@@ -257,7 +261,8 @@ export default {
getCategorySpecListData(v.id).then((res) => {
this.categoryId = v.id;
this.modalSpecTitle = "规格关联";
this.specForm.category_specs = res.map((item) => item.id);
console.log(res);
this.specForm.categorySpecs = res.map((item) => item.id);
this.modalSpecVisible = true;
});
},
@@ -337,7 +342,7 @@ export default {
this.submitLoading = false;
if (res.success) {
this.$Message.success("添加成功");
this.getAllList(0);
this.getAllList(this.categoryIndex);
this.modalVisible = false;
this.$refs.form.resetFields();
}
@@ -348,7 +353,7 @@ export default {
this.submitLoading = false;
if (res.success) {
this.$Message.success("修改成功");
this.getAllList(0);
this.getAllList(this.categoryIndex);
this.modalVisible = false;
this.$refs.form.resetFields();
}
@@ -376,12 +381,11 @@ export default {
});
},
getAllList(parent_id) {
this.sortCateList = [];
this.loading = true;
getCategoryTree(parent_id).then((res) => {
this.loading = false;
if (res.success) {
// 仅展开指定级数 默认后台已展开所有
let expandLevel = this.expandLevel;
localStorage.setItem("category", JSON.stringify(res.result));
res.result.forEach((e, index, arr) => {
this.sortCateList.push({
@@ -389,65 +393,13 @@ export default {
value: e.name,
});
this.sortCate = arr[0].name;
if (expandLevel == 1) {
if (e.level == 0) {
e.expand = false;
}
if (e.children && e.children.length > 0) {
e.children.forEach(function (c) {
if (c.level == 1) {
c.expand = false;
}
if (c.children && c.children.length > 0) {
c.children.forEach(function (b) {
if (b.level == 2) {
b.expand = false;
}
});
}
});
}
} else if (expandLevel == 2) {
if (e.level == 0) {
e.expand = true;
}
if (e.children && e.children.length > 0) {
e.children.forEach(function (c) {
if (c.level == 1) {
c.expand = false;
}
if (c.children && c.children.length > 0) {
c.children.forEach(function (b) {
if (b.level == 2) {
b.expand = false;
}
});
}
});
}
} else if (expandLevel == 3) {
if (e.level == 0) {
e.expand = true;
}
if (e.children && e.children.length > 0) {
e.children.forEach(function (c) {
if (c.level == 1) {
c.expand = true;
}
if (c.children && c.children.length > 0) {
c.children.forEach(function (b) {
if (b.level == 2) {
b.expand = false;
}
});
}
});
}
}
});
this.categoryList = res.result;
this.tableData = [res.result[0]];
this.$nextTick(() => {
this.$set(this, "tableData", [res.result[this.categoryIndex]]);
});
}
});
},
@@ -507,22 +459,8 @@ export default {
background: #fff;
padding: 20px;
}
.article {
font-size: 16px;
font-weight: 400;
margin: 12px 0;
}
.href-text {
font-size: 12px;
}
.operation {
margin-bottom: 2vh;
}
.select-count {
font-weight: 600;
color: #40a9ff;
}
</style>

View File

@@ -135,35 +135,11 @@ export default {
width: 90,
render: (h, params) => {
if (params.row.grade == "GOOD") {
return h(
"Tag",
{
props: {
color: "success",
},
},
"好评"
);
return h("Tag", {props: {color: "green",},}, "好评");
} else if (params.row.grade == "MODERATE") {
return h(
"Tag",
{
props: {
color: "warning",
},
},
"中评"
);
return h("Tag", {props: {color: "orange",},}, "中评");
} else {
return h(
"Tag",
{
props: {
color: "error",
},
},
"差评"
);
return h("Tag", {props: {color: "red",},}, "差评");
}
},
},

View File

@@ -18,7 +18,7 @@
<Input type="text" @keyup="handleLink(linkItem,linkList.length)" v-model="linkItem.url" placeholder="https://"></Input>
</div>
</Poptip>
</div>
</Col>
</Row>
@@ -74,7 +74,12 @@ export default {
icon: "md-happy",
___type: "sign",
},
{
title: "小程序直播",
icon: "ios-videocam",
___type: "live",
},
],
linkItem: {
title: "外部链接",

View File

@@ -25,7 +25,7 @@
<span slot="close"></span>
</i-switch>
<Button type="info" placement="right" @click="Template(item)" size="small">编辑</Button>
<Button type="success" placement="right" @click="decorate(item.id)" size="small">装修</Button>
<Button type="success" placement="right" @click="decorate(item)" size="small">装修</Button>
<Poptip confirm title="删除此模板?" @on-ok="delTemplate(item.id)" @on-cancel="cancel">
<Button type="error" size="small">删除</Button>
</Poptip>
@@ -139,9 +139,9 @@ export default {
this.showModal = true;
},
decorate(id) {
decorate(val) {
// 装修
this.$router.push({ name: "renovation", query: { id: id } });
this.$router.push({ name: "renovation", query: { id: val.id,pageShow:val.pageShow } });
},
getTemplateList() {

View File

@@ -1,172 +1,174 @@
<template>
<div class="renovation">
<!-- 左侧模块列表 -->
<div class="model-list">
<div class="classification-title">基础模块</div>
<draggable tag="ul" :list="modelData"
v-bind="{group:{ name:'model', pull:'clone',put:false},sort:false, ghostClass: 'ghost'}"
@end="handleMoveEnd"
@start="handleMoveStart"
:move="handleMove"
>
<li v-for="(model, index) in modelData" :key="index" class="model-item">
<Icon :type="model.icon" />
<span>{{model.name}}</span>
</li>
</draggable>
</div>
<!-- 中间展示模块 -->
<div class="show-content">
<model-form ref="modelForm" :data="modelForm"></model-form>
</div>
<!-- 保存按钮 -->
<div class="btn-bar"><Button type="primary" @click="saveTemplate">保存模板</Button> <Button @click="resetTemplate">还原模板</Button></div>
<div class="renovation">
<!-- 左侧模块列表 -->
<div class="model-list">
<div class="classification-title">基础模块</div>
<draggable tag="ul" :list="modelData" v-bind="{group:{ name:'model', pull:'clone',put:false},sort:false, ghostClass: 'ghost'}" @end="handleMoveEnd" @start="handleMoveStart" :move="handleMove">
<li v-for="(model, index) in modelData" :key="index" class="model-item">
<Icon :type="model.icon" />
<span>{{model.name}}</span>
</li>
</draggable>
</div>
<!-- 中间展示模块 -->
<div class="show-content">
<model-form ref="modelForm" :data="modelForm"></model-form>
</div>
<!-- 保存按钮 -->
<div class="btn-bar"><Button type="primary" @click="saveTemplate">保存模板</Button> <Button @click="resetTemplate">还原模板</Button></div>
</div>
</template>
<script>
import { modelData } from './modelConfig';
import { modelData } from "./modelConfig";
import Draggable from "vuedraggable";
import ModelForm from './modelForm.vue';
import * as API_floor from '@/api/other.js';
import ModelForm from "./modelForm.vue";
import * as API_floor from "@/api/other.js";
export default {
components:{
Draggable, ModelForm
components: {
Draggable,
ModelForm,
},
mounted() {
this.getTemplateItem(this.$route.query.id);
},
data() {
return {
modelData, // 可选模块数据
modelForm: { list: [] }, // 模板数据
};
},
methods: {
saveTemplate() {
// 保存模板
this.submitTemplate(this.$route.query.pageShow ? 'OPEN' : 'CLOSE')
},
mounted(){
this.getTemplateItem(this.$route.query.id)
},
data() {
return {
modelData, // 可选模块数据
modelForm:{list:[]} // 模板数据
// 提交模板
submitTemplate(pageShow) {
this.modelForm.list.unshift(this.$refs.modelForm.navList);
this.modelForm.list.unshift(this.$refs.modelForm.topAdvert);
const modelForm = JSON.stringify(this.modelForm);
const data = {
id: this.$route.query.id,
pageData: modelForm,
pageShow,
};
API_floor.updateHome(this.$route.query.id, data).then((res) => {
if (res.success) {
this.$Message.success("保存模板成功");
} else {
this.$Message.error(res.message);
}
});
},
methods:{
saveTemplate(){ // 保存模板
this.modelForm.list.unshift(this.$refs.modelForm.navList)
this.modelForm.list.unshift(this.$refs.modelForm.topAdvert)
const modelForm = JSON.stringify(this.modelForm)
const data = {
id:this.$route.query.id,
pageData:modelForm,
resetTemplate() {
// 还原模板
this.getTemplateItem(this.$route.query.id);
},
getTemplateItem(id) {
// 获取模板数据
API_floor.getHomeData(id).then((res) => {
if (res.success) {
let pageData = res.result.pageData;
if (pageData) {
pageData = JSON.parse(pageData);
if (pageData.list[0].type === "topAdvert") {
// topAdvert 为顶部广告 navList为导航栏
this.$refs.modelForm.topAdvert = pageData.list[0];
this.$refs.modelForm.navList = pageData.list[1];
pageData.list.splice(0, 2);
this.modelForm = pageData;
} else {
this.modelForm = { list: [] };
}
API_floor.updateHome(this.$route.query.id, data).then(res=> {
if(res.success) {
this.$Message.success('保存模板成功');
} else {
this.$Message.error(res.message)
}
})
},
resetTemplate(){ // 还原模板
this.getTemplateItem(this.$route.query.id)
},
getTemplateItem(id){ // 获取模板数据
API_floor.getHomeData(id).then(res => {
if (res.success) {
let pageData = res.result.pageData;
if(pageData) {
pageData = JSON.parse(pageData);
if (pageData.list[0].type === 'topAdvert') { // topAdvert 为顶部广告 navList为导航栏
this.$refs.modelForm.topAdvert = pageData.list[0];
this.$refs.modelForm.navList = pageData.list[1];
pageData.list.splice(0,2)
this.modelForm = pageData;
} else {
this.modelForm = {list:[]}
}
} else {
this.modelForm = {list:[]}
}
}
// this.$refs.modelForm.topAdvert = {};
// this.$refs.modelForm.navList = {}
})
} else {
this.modelForm = { list: [] };
}
}
// this.$refs.modelForm.topAdvert = {};
// this.$refs.modelForm.navList = {}
});
},
watch: {
modelForm: {
deep: true,
handler: function (val) {
console.log(val)
}
}
}
}
},
watch: {
modelForm: {
deep: true,
handler: function (val) {
console.log(val);
},
},
},
};
</script>
<style lang="scss" scoped>
.renovation{
position: relative;
display: flex;
.renovation {
position: relative;
display: flex;
}
.model-list{
width: 120px;
height:auto;
padding: 10px;
background: #fff;
margin-top: 60px;
position: fixed;
z-index: 100;
box-shadow: 1px 1px 10px #999;
.classification-title{
width: 100%;
height: 30px;
line-height: 30px;
}
.model-item{
width: 100px;
height: 30px;
background: #eee;
margin-top: 10px;
line-height: 30px;
text-align: center;
color: #999;
&:hover{
border: 1px dashed #409EFF;
color: #409EFF;
cursor: move;
}
}
.ghost::after{
border:none;
height: 0;
content: '';
}
}
.show-content{
margin-left: 150px;
margin-top: 60px;
}
.ghost{
background: #fff;
height: 30px;
position: relative;
&::after{
content: '松开鼠标添加模块';
position: absolute;
background: #fff;
border: 1px dashed #409EFF;
color: #409EFF;
top: 0;
left: 0;
width: 100%;
height: 50px;
text-align: center;
line-height: 50px;
}
}
.btn-bar{
position: fixed;
.model-list {
width: 120px;
height: auto;
padding: 10px;
background: #fff;
margin-top: 60px;
position: fixed;
z-index: 100;
box-shadow: 1px 1px 10px #999;
.classification-title {
width: 100%;
background:#fff;
height: 50px;
padding: 10px;
box-shadow: 1px 1px 10px #999;
z-index: 99;
top: 100px;
height: 30px;
line-height: 30px;
}
.model-item {
width: 100px;
height: 30px;
background: #eee;
margin-top: 10px;
line-height: 30px;
text-align: center;
color: #999;
&:hover {
border: 1px dashed #409eff;
color: #409eff;
cursor: move;
}
}
.ghost::after {
border: none;
height: 0;
content: "";
}
}
</style>
.show-content {
margin-left: 150px;
margin-top: 60px;
}
.ghost {
background: #fff;
height: 30px;
position: relative;
&::after {
content: "松开鼠标添加模块";
position: absolute;
background: #fff;
border: 1px dashed #409eff;
color: #409eff;
top: 0;
left: 0;
width: 100%;
height: 50px;
text-align: center;
line-height: 50px;
}
}
.btn-bar {
position: fixed;
width: 100%;
background: #fff;
height: 50px;
padding: 10px;
box-shadow: 1px 1px 10px #999;
z-index: 99;
top: 100px;
}
</style>

View File

@@ -3,35 +3,22 @@
<div class="model-title">
<div>店铺装修</div>
<div class="btns">
<Button
@click="clickBtn(item)"
size="small"
v-for="(item, index) in way"
:key="index"
:type="item.selected ? 'primary' : ''"
>
<Button @click="clickBtn(item)" size="small" v-for="(item, index) in way" :key="index" :type="item.selected ? 'primary' : ''">
{{ item.title }}
</Button>
</div>
<div class="model-title-view-btn">
<Poptip placement="bottom" width="100">
<!-- TODO 后期会补全 目前版本暂无 -->
<!-- <Poptip placement="bottom" width="100">
<Button size="default" @click="creatQrCode">预览模板</Button>
<div slot="content" class="default-view-content">
<div>临时预览</div>
<div ref="qrCodeUrl"></div>
</div>
</Poptip>
<Button size="default" type="primary" @click="handleSpinShow"
>保存模板</Button
>
</Poptip> -->
<Button size="default" type="primary" @click="handleSpinShow">保存模板</Button>
<Modal
title="保存中"
v-model="saveDialog"
:closable="true"
:mask-closable="false"
:footer-hide="true"
>
<Modal title="保存中" v-model="saveDialog" :closable="true" :mask-closable="false" :footer-hide="true">
<div v-if="progress">
<div class="model-item">
模板名称 <Input style="width: 200px" v-model="submitWay.name" />
@@ -61,7 +48,8 @@ export default {
progress: true, // 展示进度
num: 20, // 提交进度
saveDialog: false, // 加载状态
way: [ // 装修tab栏切换
way: [
// 装修tab栏切换
{
title: "首页",
name: "index",
@@ -80,7 +68,8 @@ export default {
},
],
qrcode: "", // 二维码
submitWay: { // 表单信息
submitWay: {
// 表单信息
pageShow: this.$route.query.type || false,
name: this.$route.query.name || "模板名称",
pageClientType: "H5",
@@ -124,11 +113,13 @@ export default {
// 更新
update() {
this.progress = false;
this.progress = false;
API_Other.updateHome(this.$route.query.id, {
pageData: JSON.stringify(this.$store.state.styleStore),
name: this.submitWay.name,
pageShow: this.submitWay.pageShow,
pageType: "INDEX",
pageClientType: "H5",
})
.then((res) => {
this.num = 50;
@@ -171,7 +162,7 @@ export default {
this.goback();
}, 1000);
} else {
this.progress = true;
this.progress = true;
this.saveDialog = false;
this.$Message.error("保存失败,请稍后重试");
}

View File

@@ -1,6 +1,6 @@
.image-mode {
max-width: 100%;
height: auto;
width: 100%;
height: 100%;
display: block;
padding: 1px;
}

View File

@@ -1,11 +1,11 @@
<template>
<div class="layout">
<img class="image-mode" :src="res.list[0].img" alt="">
<img class="image-mode" :src="res.list[1].img" alt="">
<img class="image-mode" :src="res.list[2].img" alt="">
<img class="image-mode" :src="res.list[3].img" alt="">
<img class="image-mode" :src="res.list[4].img" alt="">
<img class="image-mode" :src="res.list[0].img" alt="">
<img class="image-mode" :src="res.list[1].img" alt="">
<img class="image-mode" :src="res.list[2].img" alt="">
<img class="image-mode" :src="res.list[3].img" alt="">
<img class="image-mode" :src="res.list[4].img" alt="">
</div>
</template>
@@ -13,21 +13,18 @@
export default {
title: "五列单行图片模块",
props: ["res"],
mounted() {
console.log(this.res);
}
};
</script>
<style lang="scss" scoped>
@import "./tpl.scss";
.layout {
background: #e8e8e8;
display: flex;
align-items: center;
justify-content: center;
background-size: cover;
}
img{
img {
width: 67px;
}
</style>
</style>

View File

@@ -12,21 +12,22 @@
export default {
title: "四列单行图片模块",
props: ["res"],
mounted() {
console.log(this.res);
}
};
</script>
<style lang="scss" scoped>
@import "./tpl.scss";
.layout {
height: 84px;
// background: #e8e8e8;
// height: 84px;
display: flex;
padding: 0 8px;
align-items: center;
justify-content: center;
background-size: cover;
}
img{
width: 84px;
}
</style>
</style>

View File

@@ -11,14 +11,12 @@
export default {
title: "三列单行图片模块",
props: ["res"],
mounted() {
console.log(this.res);
}
};
</script>
<style lang="scss" scoped>
@import "./tpl.scss";
.layout {
background: #e8e8e8;
height: 110px;
display: flex;
align-items: center;
@@ -28,4 +26,4 @@ export default {
img{
width: 111px;
}
</style>
</style>

View File

@@ -20,7 +20,7 @@ export default {
title: "左一右二",
props: ["res"],
mounted() {
console.log(this.res);
}
};
</script>
@@ -34,4 +34,4 @@ export default {
background-size: cover;
}
</style>
</style>

View File

@@ -10,7 +10,7 @@
</div>
</div>
<div class="view-height-150">
<img class="image-mode" :src="res.list[2].img" />
<img class="image-mode" style="height:150px;" :src="res.list[2].img" />
</div>
</div>
</template>
@@ -21,18 +21,22 @@ export default {
props: ["res"],
mounted() {
console.log(this.res);
}
},
};
</script>
<style lang="scss" scoped>
@import "./tpl.scss";
.layout {
height: 167px;
height: 150px;
display: flex;
align-items: center;
justify-content: center;
background-size: cover;
}
</style>
.view-height-75 {
.image-mode {
height: 75px;
}
}
</style>

View File

@@ -23,12 +23,7 @@
</Row>
<!-- 拼图验证码 -->
<verify
ref="verify"
class="verify-con"
verifyType="LOGIN"
@change="verifyChange"
></verify>
<verify ref="verify" class="verify-con" verifyType="LOGIN" @change="verifyChange"></verify>
<div v-if="socialLogining">
<RectLoading />
</div>
@@ -48,7 +43,7 @@ import LangSwitch from "@/views/main-components/lang-switch";
import RectLoading from "@/views/my-components/lili/rect-loading";
import CountDownButton from "@/views/my-components/lili/count-down-button";
import util from "@/libs/util.js";
import verify from '@/views/my-components/verify';
import verify from "@/views/my-components/verify";
export default {
components: {
@@ -57,18 +52,20 @@ export default {
LangSwitch,
Header,
Footer,
verify
verify,
},
data() {
return {
loading: false, // 加载状态
form: { // 表单数据
form: {
// 表单数据
username: "",
password: "",
mobile: "",
code: "",
},
rules: { // 验证规则
rules: {
// 验证规则
username: [
{
required: true,
@@ -88,7 +85,8 @@ export default {
},
methods: {
mounted() {},
afterLogin(res) { // 登录成功后处理
afterLogin(res) {
// 登录成功后处理
let accessToken = res.result.accessToken;
let refreshToken = res.result.refreshToken;
this.setStore("accessToken", accessToken);
@@ -109,28 +107,35 @@ export default {
}
});
},
submitLogin() { // 登录操作
submitLogin() {
// 登录操作
this.$refs.usernameLoginForm.validate((valid) => {
if (valid) {
this.$refs.verify.show = true;
}
});
},
verifyChange (con) { // 拼图验证码回显
verifyChange(con) {
// 拼图验证码回显
if (!con.status) return;
this.loading = true;
login({
username: this.form.username,
password: this.md5(this.form.password),
}).then((res) => {
if (res && res.success) {
this.afterLogin(res);
} else {
})
.then((res) => {
if (res && res.success) {
this.afterLogin(res);
} else {
this.loading = false;
}
})
.catch(() => {
this.loading = false;
}
}).catch(()=>{this.loading = false});
}
});
this.$refs.verify.show = false;
},
},
};
</script>
@@ -154,7 +159,7 @@ export default {
position: relative;
zoom: 1;
}
.verify-con{
.verify-con {
position: absolute;
top: 90px;
z-index: 10;
@@ -198,5 +203,4 @@ export default {
.flex {
justify-content: center;
}
</style>

View File

@@ -2,7 +2,6 @@
<div>
<Row class="header">
<img src="../../assets/logo.png" class="logo" width="220px">
<!-- <div class="description">{{ $t('LILISHOP-ADMIN') }}</div> -->
</Row>
</div>
</template>
@@ -15,13 +14,13 @@ export default {
<style lang="scss" scoped>
.header {
margin-bottom: 6vh;
text-align: center;
display: flex;
justify-content: center !important;
}
.logo {
transform: scale(2);
width: 440px;
height: 158px;
}
</style>

View File

@@ -55,6 +55,7 @@ export default {
},
methods: {
changeMenu(name) { //二级路由点击
console.log(name)
this.$router.push({
name: name
});

View File

@@ -131,23 +131,9 @@
sortable: false,
render: (h, params) => {
if (params.row.payStatus == "PAID") {
return h("div", [
h("Badge", {
props: {
status: "success",
text: "已付款",
},
}),
]);
} else if (params.row.payStatus == "UNPAID") {
return h("div", [
h("Badge", {
props: {
status: "error",
text: "未付款",
},
}),
]);
return h("Tag", {props: {color: "green",},}, "已付款");
} else {
return h("Tag", {props: {color: "red",},}, "未付款");
}
},
},

View File

@@ -312,6 +312,7 @@ export default {
],
data: [], // 表单数据
total: 0, // 表单数据总数
selectMember: [], //保存选中的用户
};
},
props: {
@@ -320,18 +321,66 @@ export default {
type: Boolean,
default: false,
},
// 已选择用户数据
selectedList: {
type: null,
default: "",
},
},
watch: {
selectedList: {
handler(val) {
this.$set(this, "selectMember", JSON.parse(JSON.stringify(val)));
this.init(this.data);
// 将父级数据与当前组件数据进行匹配
},
deep: true,
immediate: true,
},
},
methods: {
// 回调给父级
callback(val, index) {
val.___selected = !val.___selected;
this.$set(val, "___selected", !val.___selected);
console.log(val.___selected);
let findUser = this.selectMember.find((item) => {
return item.id == val.id;
});
// 如果没有则添加
if (!findUser) {
this.selectMember.push(val);
} else {
// 有重复数据就删除
this.selectMember.map((item, index) => {
if (item.id == findUser.id) {
this.selectMember.splice(index, 1);
}
});
}
this.$emit("callback", val);
},
init() {
this.getData();
// 初始化信息
init(data) {
data.forEach((item) => {
if (this.selectMember.length != 0) {
this.selectMember.forEach((member) => {
if (member.id == item.id) {
this.$set(item, "___selected", true);
}
});
} else {
this.$set(item, "___selected", false);
}
});
this.data = data;
},
changePage(v) {
this.searchForm.pageNumber = v;
// 此处如果是父子级传值的时候需要做一下处理
//selectedMember
this.getData();
},
changePageSize(v) {
@@ -387,15 +436,13 @@ export default {
}
});
},
//查询会员列表
getData() {
API_Member.getMemberListData(this.searchForm).then((res) => {
if (res.result.records) {
this.loading = false;
res.result.records.forEach((item) => {
item.___selected = false;
});
this.data = res.result.records;
this.init(res.result.records);
this.total = res.result.total;
}
});
@@ -484,7 +531,7 @@ export default {
},
},
mounted() {
this.init();
this.getData();
},
};
</script>

View File

@@ -15,20 +15,8 @@
</div>
</div>
<Modal
title="编辑html代码"
v-model="showHTMLModal"
:mask-closable="false"
:width="900"
:fullscreen="full"
>
<Input
v-if="!full"
v-model="dataEdit"
:rows="15"
type="textarea"
style="max-height:60vh;overflow:auto;"
/>
<Modal title="编辑html代码" v-model="showHTMLModal" :mask-closable="false" :width="900" :fullscreen="full">
<Input v-if="!full" v-model="dataEdit" :rows="15" type="textarea" style="max-height:60vh;overflow:auto;" />
<Input v-if="full" v-model="dataEdit" :rows="32" type="textarea" />
<div slot="footer">
<Button @click="full=!full" icon="md-expand">全屏开/</Button>
@@ -56,21 +44,21 @@ export default {
props: {
id: {
type: String,
default: "editor"
default: "editor",
},
value: String,
base64: {
type: Boolean,
default: false
default: false,
},
showExpand: {
type: Boolean,
default: true
default: true,
},
openXss: {
type: Boolean,
default: false
}
default: false,
},
},
data() {
return {
@@ -79,16 +67,17 @@ export default {
dataEdit: "", // 编辑数据
showHTMLModal: false, // 显示html
full: false, // html全屏开关
fullscreenModal: false // 显示全屏预览
fullscreenModal: false, // 显示全屏预览
};
},
methods: {
initEditor() {
let that = this;
// 详见wangeditor3官网文档 https://www.kancloud.cn/wangfupeng/wangeditor3/332599
editor = new E(`#${this.id}`);
// 编辑内容绑定数据
editor.config.onchange = html => {
editor.config.onchange = (html) => {
if (this.openXss) {
this.data = xss(html);
} else {
@@ -108,30 +97,30 @@ export default {
editor.config.uploadImgServer = uploadFile;
// lili如要header中传入token鉴权
editor.config.uploadImgHeaders = {
accessToken: that.getStore("accessToken")
accessToken: that.getStore("accessToken"),
};
editor.config.uploadFileName = "file";
editor.config.uploadImgHooks = {
before: function(xhr, editor, files) {
before: function (xhr, editor, files) {
// 图片上传之前触发
},
success: function(xhr, editor, result) {
success: function (xhr, editor, result) {
// 图片上传并返回结果,图片插入成功之后触发
},
fail: function(xhr, editor, result) {
fail: function (xhr, editor, result) {
// 图片上传并返回结果,但图片插入错误时触发
that.$Message.error("上传图片失败");
},
error: function(xhr, editor) {
error: function (xhr, editor) {
// 图片上传出错时触发
that.$Message.error("上传图片出错");
},
timeout: function(xhr, editor) {
timeout: function (xhr, editor) {
// 图片上传超时时触发
that.$Message.error("上传图片超时");
},
// 如果服务器端返回的不是 {errno:0, data: [...]} 这种格式,可使用该配置
customInsert: function(insertImg, result, editor) {
customInsert: function (insertImg, result, editor) {
if (result.success == true) {
let url = result.result;
insertImg(url);
@@ -139,10 +128,11 @@ export default {
} else {
that.$Message.error(result.message);
}
}
},
};
}
editor.config.customAlert = function(info) {
editor.config.customAlert = function (info) {
// info 是需要提示的内容
// that.$Message.info(info);
};
@@ -156,8 +146,8 @@ export default {
// type -> 'emoji' / 'image'
type: "image",
// content -> 数组
content: sina
}
content: sina,
},
];
editor.create();
if (this.value) {
@@ -187,7 +177,7 @@ export default {
editor.txt.html(this.data);
this.$emit("input", this.data);
this.$emit("on-change", this.data);
}
},
});
},
setData(value) {
@@ -200,22 +190,21 @@ export default {
this.$emit("input", this.data);
this.$emit("on-change", this.data);
}
}
},
},
watch: {
value(val) {
this.setData(val);
}
},
},
mounted() {
this.initEditor();
}
},
};
</script>
<style lang="scss" scoped>
.e-menu {
z-index: 101;
position: absolute;
cursor: pointer;

View File

@@ -216,11 +216,11 @@
width: 100,
render: (h, params) => {
if (params.row.serviceType == "RETURN_MONEY") {
return h('div', [h('span', {}, '退款'),]);
return h('div', [h('tag', {props: {color: "blue"}}, '退款'),]);
} else if (params.row.serviceType == "RETURN_GOODS") {
return h('div', [h('span', {}, '退货'),]);
return h('div', [h('tag', {props: {color: "volcano"}}, '退货'),]);
} else if (params.row.serviceType == "EXCHANGE_GOODS") {
return h('div', [h('span', {}, '换货'),]);
return h('div', [h('tag', {props: {color: "green"}}, '换货'),]);
}
}
},
@@ -231,27 +231,23 @@
width: 110,
render: (h, params) => {
if (params.row.serviceStatus == "APPLY") {
return h('div', [h('span', {}, '申请中'),]);
return h('div', [h('tag', {props: {color: "blue"}}, '申请中'),]);
} else if (params.row.serviceStatus == "PASS") {
return h('div', [h('span', {}, '通过售后'),]);
return h('div', [h('tag', {props: {color: "cyan"}}, '通过售后'),]);
} else if (params.row.serviceStatus == "REFUSE") {
return h('div', [h('span', {}, '拒绝售后'),]);
return h('div', [h('tag', {props: {color: "volcano"}}, '拒绝售后'),]);
} else if (params.row.serviceStatus == "BUYER_RETURN") {
return h('div', [h('span', {}, '买家退货,待卖家收货'),]);
} else if (params.row.serviceStatus == "SELLER_RE_DELIVERY") {
return h('div', [h('span', {}, '商家换货/补发'),]);
return h('div', [h('tag', {props: {color: "orange"}}, '买家退货,待卖家收货'),]);
} else if (params.row.serviceStatus == "SELLER_CONFIRM") {
return h('div', [h('span', {}, '卖家确认收货'),]);
return h('div', [h('tag', {props: {color: "gold"}}, '卖家确认收货'),]);
} else if (params.row.serviceStatus == "SELLER_TERMINATION") {
return h('div', [h('span', {}, '卖家终止售后'),]);
} else if (params.row.serviceStatus == "BUYER_CONFIRM") {
return h('div', [h('span', {}, '买家确认收货'),]);
return h('div', [h('tag', {props: {color: "lime"}}, '卖家终止售后'),]);
} else if (params.row.serviceStatus == "BUYER_CANCEL") {
return h('div', [h('span', {}, '买家取消售后'),]);
return h('div', [h('tag', {props: {color: "purple"}}, '买家取消售后'),]);
} else if (params.row.serviceStatus == "COMPLETE") {
return h('div', [h('span', {}, '完成售后'),]);
return h('div', [h('tag', {props: {color: "green"}}, '完成售后'),]);
}else if (params.row.serviceStatus == "WAIT_REFUND") {
return h('div', [h('span', {}, '待平台退款'),]);
return h('div', [h('tag', {props: {color: "geekblue"}}, '待平台退款'),]);
}
}
},

View File

@@ -191,17 +191,17 @@
width: 100,
render: (h, params) => {
if (params.row.complainStatus == "NEW") {
return h('div', [h('span', { }, '新投诉'),]);
return h('div', [h('tag',{props: {color: "purple"}}, '新投诉'),]);
} else if (params.row.complainStatus == "CANCEL") {
return h('div', [h('span', { }, '已撤销'),]);
return h('div', [h('tag', {props: {color: "cyan"}}, '已撤销'),]);
} else if (params.row.complainStatus == "WAIT_APPEAL") {
return h('div', [h('span', { }, '待申诉'),]);
return h('div', [h('tag', {props: {color: "volcano"}}, '待申诉'),]);
} else if (params.row.complainStatus == "COMMUNICATION") {
return h('div', [h('span', { }, '对话中'),]);
return h('div', [h('tag', {props: {color: "orange"}}, '对话中'),]);
}else if (params.row.complainStatus == "WAIT_ARBITRATION") {
return h('div', [h('span', { }, '等待仲裁'),]);
return h('div', [h('tag', {props: {color: "blue"}}, '等待仲裁'),]);
}else if (params.row.complainStatus == "COMPLETE") {
return h('div', [h('span', { }, '已完成'),]);
return h('div', [h('tag', {props: {color: "green"}}, '已完成'),]);
}
}
},

View File

@@ -72,51 +72,13 @@ export default {
align: "center",
render: (h, params) => {
if (params.row.paymentMethod === "WECHAT") {
return h("div", [
h(
"Tag",
{
props: {
color: "green",
},
},
"微信"
),
]);
return h("div", [h("Tag", {props: {color: "green",},}, "微信"),]);
} else if (params.row.paymentMethod === "ALIPAY") {
return h("div", [
h(
"Tag",
{
props: {
color: "blue",
},
},
"支付宝"
),
]);
return h("div", [h("Tag", {props: {color: "blue",},}, "支付宝"),]);
} else if (params.row.paymentMethod === "WALLET") {
return h("div", [
h(
"Tag",
{
props: {},
},
"余额支付"
),
]);
return h("div", [h("Tag", {props: {color: "geekblue",},}, "余额支付"),]);
} else if (params.row.paymentMethod === "BANK_TRANSFER") {
return h("div", [
h(
"Tag",
{
props: {
color: "orange",
},
},
"银行转帐"
),
]);
return h("div", [h("Tag", {props: {color: "orange",},}, "银行转帐"),]);
} else {
return h("div", [h("Tag", {}, "暂未付款")]);
}

View File

@@ -100,9 +100,9 @@ export default {
width: 95,
render: (h, params) => {
if (params.row.isRefund == "1") {
return h("div", [h("span", {}, "已退款")]);
return h("div", [h("Tag", {props: {color: "green",},}, "已退款")]);
} else {
return h("div", [h("span", {}, "未退款")]);
return h("div", [h("Tag", {props: {color: "orange",},}, "未退款")]);
}
},
},

View File

@@ -94,8 +94,8 @@
// 搜索框初始化对象
pageNumber: 1, // 当前页数
pageSize: 10, // 页面大小
sort: "createTime", // 默认排序字段
order: "desc", // 默认排序方式
sort: "", // 默认排序字段
order: "", // 默认排序方式
startDate: "", // 起始时间
endDate: "", // 终止时间
orderType: "FICTITIOUS",
@@ -118,8 +118,6 @@
title: "下单时间",
key: "createTime",
width: 200,
sortable: true,
sortType: "desc",
},
{
title: "订单来源",
@@ -150,19 +148,15 @@
width:95,
render: (h, params) => {
if (params.row.orderStatus == "UNPAID") {
return h('div', [h('span', { }, '未付款'),]);
return h("div", [h("tag", {props: {color: "magenta"}}, "未付款")]);
} else if (params.row.orderStatus == "PAID") {
return h('div', [h('span', { }, '已付款'),]);
} else if (params.row.orderStatus == "UNDELIVERED") {
return h('div', [h('span', { }, '待发货'),]);
} else if (params.row.orderStatus == "DELIVERED") {
return h('div', [h('span', { }, '已发货'),]);
}else if (params.row.orderStatus == "COMPLETED") {
return h('div', [h('span', { }, '已完成'),]);
}else if (params.row.orderStatus == "TAKE") {
return h('div', [h('span', { }, '待核验'),]);
}else if (params.row.orderStatus == "CANCELLED") {
return h('div', [h('span', { }, '已取消'),]);
return h("div", [h("tag", {props: {color: "blue"}}, "已付款")]);
} else if (params.row.orderStatus == "COMPLETED") {
return h("div", [h("tag", {props: {color: "green"}}, "已完成")]);
} else if (params.row.orderStatus == "TAKE") {
return h("div", [h("tag", {props: {color: "volcano"}}, "待核验")]);
} else if (params.row.orderStatus == "CANCELLED") {
return h("div", [h("tag", {props: {color: "red"}}, "已取消")]);
}
}
},

View File

@@ -37,7 +37,7 @@
<div class="div-item">
<div class="div-item-left">订单来源</div>
<div class="div-item-right">
{{ orderInfo.order.clientType }}
{{ orderInfo.order.clientType | clientTypeWay}}
</div>
</div>

View File

@@ -1,47 +1,58 @@
<template>
<div class="search">
<Card>
<Row @keydown.enter.native="handleSearch">
<Form ref="searchForm" :model="searchForm" inline :label-width="70" class="search-form">
<Form-item label="订单号" prop="orderSn">
<Input type="text" v-model="searchForm.orderSn" placeholder="请输入订单号" clearable style="width: 200px" />
</Form-item>
<Form-item label="会员名称" prop="buyerName">
<Input type="text" v-model="searchForm.buyerName" placeholder="请输入会员名称" clearable style="width: 200px" />
</Form-item>
<Form-item label="订单状态" prop="orderStatus">
<Select v-model="searchForm.orderStatus" placeholder="请选择" clearable style="width: 200px">
<Option value="UNPAID">未付款</Option>
<Option value="PAID">已付款</Option>
<Option value="UNDELIVERED">待发货</Option>
<Option value="DELIVERED">已发货</Option>
<Option value="COMPLETED">已完成</Option>
<Option value="TAKE">待核验</Option>
<Option value="CANCELLED">已取消</Option>
</Select>
</Form-item>
<Card>
<Form-item label="下单时间">
<DatePicker v-model="selectDate" type="datetimerange" format="yyyy-MM-dd" clearable @on-change="selectDateRange" placeholder="选择起始时间" style="width: 200px"></DatePicker>
</Form-item>
<Button @click="handleSearch" type="primary" icon="ios-search" class="search-btn">搜索</Button>
<Row @keydown.enter.native="handleSearch">
<Form ref="searchForm" :model="searchForm" inline :label-width="70" class="search-form">
<Form-item label="订单号" prop="orderSn">
<Input type="text" v-model="searchForm.orderSn" placeholder="请输入订单号" clearable style="width: 160px" />
</Form-item>
<Form-item label="会员名称" prop="buyerName">
<Input type="text" v-model="searchForm.buyerName" placeholder="请输入会员名称" clearable style="width: 160px" />
</Form-item>
<download-excel class="export-excel-wrapper" :data="data" :fields="fields" name="商品订单.xls">
<Button type="primary" ghost class="search-btn">导出Excel</Button>
</download-excel>
<Form-item label="订单类型" prop="orderType">
<Select v-model="searchForm.orderType" placeholder="请选择" clearable style="width: 160px">
<Option value="NORMAL">普通订单</Option>
<Option value="PINTUAN">拼团订单</Option>
<Option value="GIFT">赠品订单</Option>
<Option value="VIRTUAL">核验订单</Option>
</Select>
</Form-item>
<Form-item label="订单状态" prop="orderStatus">
<Select v-model="searchForm.orderStatus" placeholder="请选择" clearable style="width: 160px">
<Option value="UNPAID">未付款</Option>
<Option value="PAID">已付款</Option>
<Option value="UNDELIVERED">待发货</Option>
<Option value="DELIVERED">已发货</Option>
<Option value="COMPLETED">已完成</Option>
<Option value="TAKE">待核验</Option>
<Option value="CANCELLED">已取消</Option>
</Select>
</Form-item>
<Form-item label="下单时间">
<DatePicker v-model="selectDate" type="datetimerange" format="yyyy-MM-dd" clearable @on-change="selectDateRange" placeholder="选择起始时间" style="width: 160px"></DatePicker>
</Form-item>
<Button @click="handleSearch" type="primary" icon="ios-search" class="search-btn">搜索</Button>
</Form>
</Row>
<div>
<download-excel class="export-excel-wrapper" :data="data" :fields="fields" name="商品订单.xls">
<Button type="primary" class="export">
导出Excel
</Button>
</download-excel>
</div>
</Form>
</Row>
<Table :loading="loading" border :columns="columns" :data="data" ref="table" sortable="custom" @on-sort-change="changeSort" @on-selection-change="changeSelect"></Table>
<Table :loading="loading" border :columns="columns" :data="data" ref="table" sortable="custom" @on-sort-change="changeSort" @on-selection-change="changeSelect"></Table>
<Row type="flex" justify="end" class="page">
<Page :current="searchForm.pageNumber" :total="total" :page-size="searchForm.pageSize" @on-change="changePage" @on-page-size-change="changePageSize" :page-size-opts="[10, 20, 50]"
size="small" show-total show-elevator show-sizer></Page>
</Row>
</Card>
<Row type="flex" justify="end" class="page">
<Page :current="searchForm.pageNumber" :total="total" :page-size="searchForm.pageSize" @on-change="changePage" @on-page-size-change="changePageSize" :page-size-opts="[10, 20, 50]" size="small"
show-total show-elevator show-sizer></Page>
</Row>
</Card>
</div>
</template>
@@ -56,53 +67,54 @@ export default {
},
data() {
return {
// 表格的表头以及内容
fields:{
"订单编号":"sn",
"下单时间":"createTime",
"客户名称":"memberName",
"客户账号":"",
"收货人":"",
"收货人手机号":"",
"收货人地址":"",
"支付方式":{
fields: {
订单编号: "sn",
下单时间: "createTime",
客户名称: "memberName",
客户账号: "",
收货人: "",
收货人手机号: "",
收货人地址: "",
支付方式: {
field: "clientType",
callback:value=>{
callback: (value) => {
if (value == "H5") {
return "移动端"
return "移动端";
} else if (value == "PC") {
return "PC端"
} else if (value== "WECHAT_MP") {
return "小程序端"
return "PC端";
} else if (value == "WECHAT_MP") {
return "小程序端";
} else if (value == "APP") {
return "移动应用端"
return "移动应用端";
} else {
return value;
}
}
},
},
"配送方式":"",
"配送费用":"",
"订单商品金额":"",
"订单优惠金额":"",
"订单应付金额":"",
"商品SKU编号":"",
"商品数量":"groupNum",
"买家备注":"",
"订单状态":"",
"付款状态":{
field:"payStatus",
callback:value=>{
return value == "UNPAID" ? "未付款" : value == "PAID" ? "已付款" : ""
}
配送方式: "",
配送费用: "",
订单商品金额: "",
订单优惠金额: "",
订单应付金额: "",
商品SKU编号: "",
商品数量: "groupNum",
买家备注: "",
订单状态: "",
付款状态: {
field: "payStatus",
callback: (value) => {
return value == "UNPAID"
? "未付款"
: value == "PAID"
? "已付款"
: "";
},
},
"发货状态":"",
"发票类型":"",
"发票抬头":"",
"店铺":"storeName",
发货状态: "",
发票类型: "",
发票抬头: "",
店铺: "storeName",
},
loading: true, // 表单加载状态
searchForm: {
@@ -126,18 +138,14 @@ export default {
{
title: "订单号",
key: "sn",
minWidth: 230,
minWidth: 240,
tooltip: true,
},
{
title: "下单时间",
key: "createTime",
width: 200,
},
{
title: "订单来源",
key: "clientType",
width: 95,
width: 120,
render: (h, params) => {
if (params.row.clientType == "H5") {
return h("div", {}, "移动端");
@@ -152,15 +160,34 @@ export default {
}
},
},
{
title: "订单类型",
key: "orderType",
width: 120,
render: (h, params) => {
if (params.row.orderType == "NORMAL") {
return h("div", [h("tag", {props: {color: "blue"}}, "普通订单")]);
} else if (params.row.orderType == "PINTUAN") {
return h("div", [h("tag", {props: {color: "volcano"}}, "拼团订单")]);
} else if (params.row.orderType == "GIFT") {
return h("div", [h("tag", {props: {color: "green"}}, "赠品订单")]);
} else if (params.row.orderType == "VIRTUAL") {
return h("div", [h("tag", {props: {color: "geekblue"}}, "核验订单")]);
}
},
},
{
title: "买家名称",
key: "memberName",
width: 130,
minWidth: 130,
tooltip: true,
},
{
title: "订单金额",
key: "flowPrice",
minWidth: 120,
minWidth: 100,
tooltip: true,
render: (h, params) => {
return h(
"div",
@@ -172,31 +199,38 @@ export default {
{
title: "订单状态",
key: "orderStatus",
width: 95,
minWidth: 100,
render: (h, params) => {
if (params.row.orderStatus == "UNPAID") {
return h("div", [h("span", {}, "未付款")]);
return h("div", [h("tag", {props: {color: "magenta"}}, "未付款")]);
} else if (params.row.orderStatus == "PAID") {
return h("div", [h("span", {}, "已付款")]);
return h("div", [h("tag", {props: {color: "blue"}}, "已付款")]);
} else if (params.row.orderStatus == "UNDELIVERED") {
return h("div", [h("span", {}, "待发货")]);
return h("div", [h("tag", {props: {color: "geekblue"}}, "待发货")]);
} else if (params.row.orderStatus == "DELIVERED") {
return h("div", [h("span", {}, "已发货")]);
return h("div", [h("tag", {props: {color: "cyan"}}, "已发货")]);
} else if (params.row.orderStatus == "COMPLETED") {
return h("div", [h("span", {}, "已完成")]);
return h("div", [h("tag", {props: {color: "green"}}, "已完成")]);
} else if (params.row.orderStatus == "TAKE") {
return h("div", [h("span", {}, "待核验")]);
return h("div", [h("tag", {props: {color: "volcano"}}, "待核验")]);
} else if (params.row.orderStatus == "CANCELLED") {
return h("div", [h("span", {}, "已取消")]);
return h("div", [h("tag", {props: {color: "red"}}, "已取消")]);
}
},
},
{
title: "下单时间",
key: "createTime",
width: 170,
sortable: true,
sortType: "desc",
},
{
title: "操作",
key: "action",
align: "center",
width: 180,
width: 150,
render: (h, params) => {
return h("div", [
h(
@@ -340,4 +374,11 @@ export default {
<style lang="scss" scoped>
// 建议引入通用样式 可删除下面样式代码
@import "@/styles/table-common.scss";
.export {
margin: 10px 20px 10px 0;
}
.export-excel-wrapper {
display: inline;
}
</style>

View File

@@ -57,7 +57,7 @@
<Input type="number" v-model="form.sort" clearable style="width: 10%" />
</FormItem>
<FormItem class="form-item-view-el" label="文章内容" prop="content">
<editor v-model="form.content"></editor>
<editor openXss v-model="form.content"></editor>
</FormItem>
<FormItem label="是否展示" prop="openStatus">
<i-switch size="large" v-model="form.openStatus" :true-value="open" :false-value="close">
@@ -72,7 +72,7 @@
</div>
</Modal>
</template>
</Card>
</Col>
@@ -123,7 +123,7 @@ export default {
searchTreeValue: "", // 切换
form: {
// 添加或编辑表单对象初始化数据
openStatus:false,
openStatus: false,
title: "",
categoryId: "",
sort: 1,
@@ -380,7 +380,6 @@ export default {
//为了在是否展示一列展示开关 需要改一下数据类型,最终提交再次更改
this.data = [];
if (res.result.records.length > 0) {
this.data = res.result.records;
}
}
@@ -390,7 +389,6 @@ export default {
},
handleSubmit() {
this.$refs.form.validate((valid) => {
if (valid) {
this.submitLoading = true;
@@ -403,7 +401,6 @@ export default {
this.$Message.success("操作成功");
this.getDataList();
this.modalVisible = false;
}
});
} else {
@@ -414,8 +411,6 @@ export default {
this.$Message.success("操作成功");
this.getDataList();
this.modalVisible = false;
}
});
}
@@ -440,10 +435,25 @@ export default {
this.form.categoryId = res.result.categoryId;
this.treeValue = data.articleCategoryName;
this.form.id = data.id;
this.form.content = res.result.content;
this.form.content = htmlEscape(res.result.content);
this.form.title = res.result.title;
this.form.sort = res.result.sort;
this.form.openStatus = res.result.openStatus
this.form.openStatus = res.result.openStatus;
}
});
},
htmlEscape(text) {
return text.replace(/[<>"&]/g, function (match, pos, originalText) {
switch (match) {
case "<":
return "&lt;";
case ">":
return "&gt;";
case "&":
return "&amp;";
case '"':
return "&quot;";
}
});
},

View File

@@ -4,7 +4,7 @@
<Row>
<Form ref="searchForm" :model="searchForm" inline :label-width="70" class="search-form">
<Form-item label="活动名称" prop="couponName">
<Input type="text" v-model="searchForm.couponName" placeholder="请输入活动名称" clearable style="width: 200px"/>
<Input type="text" v-model="searchForm.couponName" placeholder="请输入活动名称" clearable style="width: 200px" />
</Form-item>
<Form-item label="活动状态" prop="promotionStatus">
<Select v-model="searchForm.promotionStatus" placeholder="请选择" clearable style="width: 200px">
@@ -15,8 +15,7 @@
</Select>
</Form-item>
<Form-item label="活动时间">
<DatePicker v-model="selectDate" type="daterange" clearable placeholder="选择起始时间"
style="width: 200px"></DatePicker>
<DatePicker v-model="selectDate" type="daterange" clearable placeholder="选择起始时间" style="width: 200px"></DatePicker>
</Form-item>
<Button @click="handleSearch" type="primary" icon="ios-search" class="search-btn">搜索</Button>
</Form>
@@ -26,21 +25,17 @@
<Button @click="delAll">批量下架</Button>
<!-- <Button @click="upAll" >批量上架</Button> -->
</Row>
<Table :loading="loading" border :columns="columns" :data="data" ref="table" sortable="custom"
@on-sort-change="changeSort" @on-selection-change="changeSelect">
<Table :loading="loading" border :columns="columns" :data="data" ref="table" sortable="custom" @on-sort-change="changeSort" @on-select-cancel="cancelSelect" @on-selection-change="changeSelect">
<template slot-scope="{ row,index }" slot="action">
<Button v-if="!checked && row.promotionStatus === 'NEW' || row.promotionStatus === 'CLOSE'" type="primary"
size="small" style="margin-right: 10px" @click="edit(row)">编辑
<Button v-if="!checked && row.promotionStatus === 'NEW' || row.promotionStatus === 'CLOSE'" type="primary" size="small" style="margin-right: 10px" @click="edit(row)">编辑
</Button>
<Button v-if="!checked && row.promotionStatus === 'START' || row.promotionStatus === 'NEW'" type="error"
size="small" style="margin-right: 10px" @click="remove(row)">下架
<Button v-if="!checked && row.promotionStatus === 'START' || row.promotionStatus === 'NEW'" type="error" size="small" style="margin-right: 10px" @click="remove(row)">下架
</Button>
</template>
</Table>
<Row type="flex" justify="end" class="page">
<Page :current="searchForm.pageNumber + 1" :total="total" :page-size="searchForm.pageSize"
@on-change="changePage" @on-page-size-change="changePageSize" :page-size-opts="[10, 20, 50]"
size="small" show-total show-elevator show-sizer></Page>
<Page :current="searchForm.pageNumber" :total="total" :page-size="searchForm.pageSize" @on-change="changePage" @on-page-size-change="changePageSize" :page-size-opts="[10, 20, 50]" size="small"
show-total show-elevator show-sizer></Page>
</Row>
</Card>
</div>
@@ -64,11 +59,11 @@ export default {
modalTitle: "", // 添加或编辑标题
searchForm: {
// 搜索框初始化对象
pageNumber: 0, // 当前页数
pageNumber: 1, // 当前页数
pageSize: 10, // 页面大小
sort: "startTime", // 默认排序字段
order: "desc", // 默认排序方式
getType: '', // 默认排序方式
getType: "", // 默认排序方式
},
form: {
// 添加或编辑表单对象初始化数据
@@ -77,7 +72,7 @@ export default {
// 表单验证规则
formValidate: {
promotionName: [
{required: true, message: "不能为空", trigger: "blur"},
{ required: true, message: "不能为空", trigger: "blur" },
],
},
submitLoading: false, // 添加或编辑提交状态
@@ -94,19 +89,19 @@ export default {
{
title: "活动名称",
key: "promotionName",
minWidth: 100,
fixed: "left",
},
{
title: "优惠券名称",
key: "couponName",
minWidth: 100,
tooltip: true,
},
{
title: "面额/折扣",
key: "price",
width: 120,
width: 100,
render: (h, params) => {
if (params.row.price) {
return h(
@@ -122,26 +117,28 @@ export default {
{
title: "领取数量/总数量",
key: "publishNum",
width: 150,
width: 130,
render: (h, params) => {
return h(
"div",
params.row.receivedNum + "/" + params.row.publishNum
);
},
},
{
title: "优惠券类型",
key: "couponType",
width: 120,
render: (h, params) => {
let text = "未知";
let text = "";
if (params.row.couponType === "DISCOUNT") {
text = "打折";
return h("Tag", {props: {color: "blue",},}, "打折");
} else if (params.row.couponType === "PRICE") {
text = "减免现金";
return h("Tag", {props: {color: "geekblue",},}, "减免现金");
}else {
return h("Tag", {props: {color: "purple",},}, "未知");
}
return h("div", [text]);
},
},
{
@@ -164,15 +161,15 @@ export default {
},
{
title: "活动时间",
width: 120,
render: (h, params) => {
render: (h, params) => {
if (params.row.getType === "ACTIVITY") {
return h("div", "长期有效");
} else {
return h("div", {
domProps: {
innerHTML: params.row.startTime + "<br/>" + params.row.endTime,
innerHTML:
params.row.startTime + "<br/>" + params.row.endTime,
},
});
}
@@ -188,7 +185,7 @@ export default {
color = "red";
if (params.row.promotionStatus == "NEW") {
text = "未开始";
color = "default";
color = "geekblue";
} else if (params.row.promotionStatus == "START") {
text = "已开始";
color = "green";
@@ -211,17 +208,19 @@ export default {
),
]);
},
minWidth: 70,
},
{
title: "操作",
slot: "action",
align: "center",
fixed: "right",
width: 100,
maxWidth: 140,
},
],
data: [], // 表单数据
total: 0, // 表单数据总数
selectCoupon: [], //本级选中的优惠券
};
},
props: {
@@ -233,13 +232,13 @@ export default {
//优惠券类型 查询参数
getType: {
type: String,
default: ''
default: "",
},
//已选择优惠券
selectList: {
selectedList: {
type: Array,
default: []
}
default: [],
},
},
watch: {
$route(to, from) {
@@ -250,26 +249,37 @@ export default {
},
methods: {
// 选中优惠券 父级传值
selectedList: {
handler(val) {
// 判断是否是父级回调给自己已选择优惠券
if (val.length != 0) {
this.selectCoupon = val;
}
},
deep: true,
immediate: true,
},
check() {
this.$emit("selected", this.selectList);
// this.selectCoupon.push(this.selectList)
this.$emit("selected", this.selectCoupon);
},
init() {
this.getDataList();
},
add() {
this.$router.push({name: "add-platform-coupon"});
this.$router.push({ name: "add-platform-coupon" });
},
/** 跳转至领取详情页面 */
receiveInfo(v) {
this.$router.push({name: "member-receive-coupon", query: {id: v.id}});
this.$router.push({ name: "member-receive-coupon", query: { id: v.id } });
},
info(v) {
this.$router.push({name: "platform-coupon-info", query: {id: v.id}});
this.$router.push({ name: "platform-coupon-info", query: { id: v.id } });
},
changePage(v) {
this.searchForm.pageNumber = v - 1;
this.searchForm.pageNumber = v;
this.getDataList();
this.clearSelectAll();
// this.clearSelectAll();
},
changePageSize(v) {
this.searchForm.pageSize = v;
@@ -291,10 +301,37 @@ export default {
clearSelectAll() {
this.$refs.table.selectAll(false);
},
/**
* 取消已选择的数据
*/
cancelSelect(selection, row) {
console.log(row)
let findCoupon = this.selectCoupon.find((item) => {
return item.id == row.id;
});
// 如果没有则添加
if (!findCoupon) {
this.selectCoupon.push(row);
} else {
// 有重复数据就删除
this.selectCoupon.map((item, index) => {
if (item.id == findCoupon.id) {
this.selectCoupon.splice(index, 1);
}
});
}
},
/**
* 选择优惠券
*/
changeSelect(e) {
if (this.checked && e.length != 0) {
this.selectCoupon.push(...e);
this.check();
}
this.selectList = e;
this.selectCount = e.length;
this.checked ? this.check() : '';
},
getDataList() {
this.loading = true;
@@ -309,9 +346,18 @@ export default {
getPlatformCouponList(this.searchForm).then((res) => {
this.loading = false;
if (res.success) {
res.result.records.forEach(item => {
item.___selected = false
})
res.result.records.forEach((item) => {
if (this.selectCoupon.length != 0) {
this.selectCoupon.forEach((child) => {
if (item.id == child.id) {
item.___selected = true;
item._checked = true;
}
});
}
item.___selected = false;
});
this.data = res.result.records;
this.total = res.result.total;
}
@@ -353,7 +399,7 @@ export default {
});
},
edit(v) {
this.$router.push({name: "edit-platform-coupon", query: {id: v.id}});
this.$router.push({ name: "edit-platform-coupon", query: { id: v.id } });
},
remove(v) {
this.$Modal.confirm({

View File

@@ -4,8 +4,17 @@
<Row class="operation padding-row">
<Button @click="add" type="primary">添加活动</Button>
</Row>
<Table :loading="loading" border :columns="columns" :data="data" ref="table" sortable="custom"
@on-sort-change="changeSort" @on-selection-change="changeSelect">
<Table :loading="loading" border :columns="columns" :data="data" ref="table" sortable="custom">
<template slot-scope="{ row,index }" slot="action">
<Button type="primary"
size="small" style="margin-right: 10px" @click="info(row)">查看
</Button>
<Button v-if="!checked && row.promotionStatus === 'START' || row.promotionStatus === 'NEW'" type="error"
size="small" style="margin-right: 10px" @click="remove(row)">停止
</Button>
</template>
</Table>
<Row type="flex" justify="end" class="page">
<Page :current="searchForm.pageNumber + 1" :total="total" :page-size="searchForm.pageSize"
@@ -19,11 +28,11 @@
<script>
import {
getCouponActivityList,
updatePlatformCouponStatus,
closeActivity,
} from "@/api/promotion";
export default {
name: "coupon",
name: "couponActivity",
components: {},
data() {
return {
@@ -148,63 +157,36 @@ export default {
default: false,
},
},
watch: {
$route(to, from) {
if (to.fullPath == "/promotion/manager-coupon") {
this.init();
}
},
},
methods: {
// 选中优惠券 父级传值
check(val, index) {
this.data[index].___selected = !this.data[index].___selected
this.$emit("selected", val);
},
//获取数据 初始化
init() {
this.getDataList();
},
//增加券活动
add() {
this.$router.push({name: "add-coupon-activity"});
},
/** 跳转至领取详情页面 */
receiveInfo(v) {
this.$router.push({name: "member-receive-coupon", query: {id: v.id}});
},
//查看详情
info(v) {
this.$router.push({name: "platform-coupon-info", query: {id: v.id}});
this.$router.push({name: "coupon-activity-info", query: {id: v.id}});
},
//跳转页面
changePage(v) {
this.searchForm.pageNumber = v - 1;
this.getDataList();
this.clearSelectAll();
},
//修改分页
changePageSize(v) {
this.searchForm.pageSize = v;
this.getDataList();
},
//搜索活动
handleSearch() {
this.searchForm.pageNumber = 0;
this.searchForm.pageSize = 10;
this.getDataList();
},
changeSort(e) {
this.searchForm.sort = e.key;
this.searchForm.order = e.order;
if (e.order === "normal") {
this.searchForm.order = "";
}
this.getDataList();
},
clearSelectAll() {
this.$refs.table.selectAll(false);
},
changeSelect(e) {
this.selectList = e;
this.selectCount = e.length;
},
//数据获取
getDataList() {
this.loading = true;
if (this.selectDate && this.selectDate[0] && this.selectDate[1]) {
@@ -218,133 +200,32 @@ export default {
getCouponActivityList(this.searchForm).then((res) => {
this.loading = false;
if (res.success) {
res.result.records.forEach(item => {
item.___selected = false
})
this.data = res.result.records;
this.total = res.result.total;
}
});
this.total = this.data.length;
this.loading = false;
},
handleSubmit() {
this.$refs.form.validate((valid) => {
if (valid) {
this.submitLoading = true;
if (this.modalType === 0) {
// 添加 避免编辑后传入id等数据 记得删除
delete this.form.id;
this.postRequest("/coupon/insertOrUpdate", this.form).then(
(res) => {
this.submitLoading = false;
if (res.success) {
this.$Message.success("操作成功");
this.getDataList();
this.modalVisible = false;
}
}
);
} else {
// 编辑
this.postRequest("/coupon/insertOrUpdate", this.form).then(
(res) => {
this.submitLoading = false;
if (res.success) {
this.$Message.success("操作成功");
this.getDataList();
this.modalVisible = false;
}
}
);
}
}
});
},
//跳转编辑
edit(v) {
this.$router.push({name: "edit-platform-coupon", query: {id: v.id}});
},
//下架活动
remove(v) {
this.$Modal.confirm({
title: "确认下架",
// 记得确认修改此处
content: "确认要下架此优惠券么?",
content: "确认要下架此优惠券活动么?下架活动只能重新创建",
loading: true,
onOk: () => {
// 删除
updatePlatformCouponStatus({
couponIds: v.id,
promotionStatus: "CLOSE",
})
.then((res) => {
this.$Modal.remove();
if (res.success) {
this.$Message.success("优惠券已作废");
this.getDataList();
}
})
.catch(() => {
this.$Modal;
});
},
});
},
delAll() {
if (this.selectCount <= 0) {
this.$Message.warning("您还未选择要下架的优惠券");
return;
}
this.$Modal.confirm({
title: "确认下架",
content: "您确认要下架所选的 " + this.selectCount + " 条数据?",
loading: true,
onOk: () => {
let ids = [];
this.selectList.forEach(function (e) {
ids.push(e.id);
});
let params = {
couponIds: ids.toString(),
promotionStatus: "CLOSE",
};
// 批量删除
updatePlatformCouponStatus(params).then((res) => {
this.$Modal.remove();
closeActivity(v.id).then((res) => {
if (res.success) {
this.$Message.success("下架成功");
this.clearSelectAll();
this.getDataList();
}
});
},
});
},
upAll() {
if (this.selectCount <= 0) {
this.$Message.warning("请选择要上架的优惠券");
return;
}
this.$Modal.confirm({
title: "确认上架",
content: "您确认要上架所选的 " + this.selectCount + " 条数据?",
loading: true,
onOk: () => {
let ids = [];
this.selectList.forEach(function (e) {
ids.push(e.id);
});
let params = {
couponIds: ids.toString(),
promotionStatus: "START",
};
// 批量上架
updatePlatformCouponStatus(params).then((res) => {
this.$Modal.remove();
if (res.success) {
this.$Message.success("上架成功");
this.clearSelectAll();
this.$Message.success("优惠券活动已作废");
this.getDataList();
}
}).catch(() => {
this.$Modal;
});
},
});

View File

@@ -3,81 +3,37 @@
<div class="content-goods-publish">
<Form ref="form" :model="form" :label-width="130">
<div class="base-info-item">
<h4>平台券活动详情</h4>
<h4>优惠券活动详情</h4>
<div class="form-item-view">
<FormItem label="活动名称">
<span class="goods-category-name">{{ form.promotionName }}</span>
<span>{{ couponActivity.promotionName }}</span>
</FormItem>
<FormItem label="活动类型">
<span class="goods-category-name">{{
getCouponType(form.couponType)
}}</span>
<span v-if="couponActivity.couponActivityType === 'REGISTERED'" >新人发券</span>
<spin v-else>精确发券</spin>
</FormItem>
<FormItem label="面额">
<span class="goods-category-name"> {{ form.price | unitPrice }}</span>
<FormItem label="活动范围" v-if="couponActivity.couponActivityType === 'SPECIFY'" >
<span v-if="couponActivity.activityScope === 'ALL'" >全部会员</span>
<spin v-else>指定会员</spin>
</FormItem>
<FormItem label="活动说明">
<span class="goods-category-name">{{ form.description }}</span>
<FormItem label="活动时间">
<span>{{ couponActivity.startTime }}{{ couponActivity.endTime }}</span>
</FormItem>
<FormItem label="发放总数">
<span class="goods-category-name">{{ form.publishNum }}</span>
</FormItem>
<FormItem label="领取限制">
<span class="goods-category-name">{{ form.limitNum }}</span>
</FormItem>
<FormItem label="活动开始时间">
<span class="goods-category-name">{{ form.startTime }}</span>
</FormItem>
<FormItem label="消费限额">
<span class="goods-category-name">{{
form.consumptionLimit
}}</span>
</FormItem>
<FormItem label="使用有效期">
<span class="goods-category-name">{{ form.startTime }} {{ form.endTime }}</span>
</FormItem>
<FormItem label="适用品类范围">
<span class="goods-category-name">{{
getScopeType(form.scopeType)
}}</span>
</FormItem>
<FormItem label="品类范围描述">
<span class="goods-category-name">{{ form.couponName }}</span>
</FormItem>
<FormItem label="状态">
<span class="goods-category-name">{{
getStatus(form.status)
}}</span>
</FormItem>
<FormItem label="优惠券类型">
<span class="goods-category-name">{{
getType(form.getType)
}}</span>
</FormItem>
<FormItem label="活动创建时间">
<span class="goods-category-name">{{ form.createTime }}</span>
</FormItem>
<FormItem label="活动最后更新时间">
<span class="goods-category-name">{{ form.updateTime }}</span>
</FormItem>
<FormItem label="更新管理员名称">
<span class="goods-category-name">{{ form.updateBy }}</span>
</FormItem>
<FormItem label="已发放数量">
<span class="goods-category-name">{{ form.receivedNum }}</span>
</FormItem>
<FormItem label="已使用数量">
<span class="goods-category-name">{{ form.usedNum }}</span>
<FormItem label="活动状态">
<span v-if="couponActivity.promotionStatus==='NEW'">新建</span>
<span v-if="couponActivity.promotionStatus==='START'">已开始</span>
<span v-if="couponActivity.promotionStatus==='END'">已结束</span>
<span v-if="couponActivity.promotionStatus==='CLOSE'">已废弃</span>
</FormItem>
</div>
<h4>适用品类范围</h4>
<div>
<Table :loading="loading" border :columns="columns1" :data="data1" ref="table" sortable="custom" @on-sort-change="changeSort" @on-selection-change="changeSelect"></Table>
<Row type="flex" justify="end" class="page">
<Page :current="searchForm.pageNumber" :total="total" :page-size="searchForm.pageSize" @on-change="changePage" @on-page-size-change="changePageSize" :page-size-opts="[10, 20, 50]"
size="small" show-total show-elevator show-sizer></Page>
</Row>
</div>
<h4>优惠券列表</h4>
<Table :columns="couponColumn" :data="couponData" ref="table">
</Table>
<h4 v-if="couponActivity.activityScopeInfo && memberData.length>0">会员列表列表</h4>
<Table :columns="memberColumn" :data="memberData">
</Table>
</div>
</Form>
</div>
@@ -89,145 +45,78 @@
</template>
<script>
import { getPlatformCoupon } from "@/api/promotion";
import uploadPicThumb from "@/views/my-components/lili/upload-pic-thumb";
import editor from "@/views/my-components/lili/editor";
import {getCouponActivity} from "@/api/promotion";
export default {
name: "addCoupon",
components: {
uploadPicThumb,
editor,
},
name: "couponActivityInfo",
data() {
return {
modalType: 0, // 当前类型
loading: false, // 表单加载状态
searchForm: {
// 搜索框初始化对象
pageNumber: 1, // 当前页数
pageSize: 10, // 页面大小
sort: "createTime", // 默认排序字段
order: "desc", // 默认排序方式
},
form: {
/** 店铺承担比例 */
sellerCommission: 0,
/** 发行数量 */
publishNum: 1,
/** 运费承担者 */
scopeType: "ALL",
/** 消费限额 */
consumptionLimit: "",
/** 限领数量 */
limitNum: 1,
/** 活动类型 */
couponType: "",
/** 优惠券名称 */
couponName: "",
/** 已被使用数量 */
usedNum: 0,
/** 已被领取的数量 */
receivedNum: 0,
},
id: this.$route.query.id,
columns1: [
id: this.$route.query.id,//表单id
couponActivity: "",//券活动
couponColumn: [
{
title: "一级类目",
key: "name",
title: "优惠券名称",
key: 'couponName'
},
{
title: "二级类目",
key: "age",
title: "优惠券金额",
key: 'price',
render: (h, params) => {
let text = "未知";
if (params.row.couponType === "DISCOUNT") {
text = params.row.price + "折";
} else if (params.row.couponType === "PRICE") {
text = "¥" + params.row.price;
}
return h("div", [text]);
},
},
{
title: "三级类目",
key: "address",
title: "优惠券类型",
key: 'couponType',
render: (h, params) => {
let text = "未知";
if (params.row.couponType == "DISCOUNT") {
text = "打折";
} else if (params.row.couponType == "PRICE") {
text = "减免现金";
}
return h("div", [text]);
},
},
{
title: "赠送数量",
key: "num",
}
],
couponData: [],
memberColumn: [
{
title: "会员id",
key: "id",
},
{
title: "昵称",
key: "nickName",
},
],
data1: [
{
name: "王小明",
age: 18,
address: "北京市朝阳区芍药居",
},
{
name: "张小刚",
age: 25,
address: "北京市海淀区西二旗",
},
{
name: "李小红",
age: 30,
address: "上海市浦东新区世纪大道",
},
{
name: "周小伟",
age: 26,
address: "深圳市南山区深南大道",
},
],
submitLoading: false, // 添加或编辑提交状态
memberData: [],
};
},
mounted() {
// 如果id不为空则查询信息
if (this.id) {
this.getCoupon();
this.modalType = 1;
}
this.getCouponActivity();
},
methods: {
getCouponType(value) {
switch (value) {
case "POINT":
return "打折";
case "PRICE":
return "减免现金";
}
},
/** 获取状态 */
getStatus(value) {
switch (value) {
case "NEW":
return "新建";
case "START":
return "开始";
case "LOWER":
return "结束";
case "CANCEL":
return "作废";
}
},
/** 关联范围类型 */
getScopeType(value) {
switch (value) {
case "PORTION_CATEGORY":
return "部分商品分类";
case "PORTION_GOODS":
return "指定商品";
case "ALL":
return "全品类";
}
},
/** 优惠券类型 */
getType(value) {
switch (value) {
case "FREE":
return "免费获取";
case "ACTIVITY":
return "活动获取";
}
},
getCoupon() {
getPlatformCoupon(this.id).then((res) => {
this.form = res.result;
//获取优惠券活动
getCouponActivity() {
getCouponActivity(this.id).then((res) => {
this.couponActivity = res.result;
this.couponData = this.couponActivity.couponActivityItems;
this.memberData = JSON.parse(this.couponActivity.activityScopeInfo);
});
},
back() {
this.$store.commit("removeTag", "platform-coupon-info");
this.$store.commit("removeTag", "coupon-activity");
this.$router.go(-1);
},
},

View File

@@ -123,10 +123,6 @@ div.base-info-item {
}
/** 审核信息-拒绝原因 */
.auth-info {
color: red;
}
.el-form-item {
width: 30%;

View File

@@ -10,8 +10,8 @@
</FormItem>
<FormItem label="活动时间">
<DatePicker type="datetimerange" v-model="rangeTime" format="yyyy-MM-dd HH:mm:ss" placeholder="请选择"
:options="options" style="width: 260px">
<DatePicker type="datetimerange" :options="options" v-model="rangeTime" format="yyyy-MM-dd HH:mm:ss"
placeholder="请选择" style="width: 260px">
</DatePicker>
</FormItem>
@@ -30,12 +30,10 @@
<FormItem label="选择会员" prop="scopeType"
v-if="form.couponActivityType==='SPECIFY' && form.activityScope==='DESIGNATED'">
<Button type="primary" icon="ios-add" @click="addVip" ghost>选择会员</Button>
</FormItem>
{{ selectedMember }}
<FormItem label="活动描述" prop="activityScopeInfo">
<Input v-model="form.activityScopeInfo" type="textarea" :rows="4" maxlength="50" show-word-limit clearable
style="width: 260px"/>
<div style="margin-top:24px;" v-if="form.activityScope == 'DESIGNATED'">
<Table border :columns="userColumns" :data="this.selectedMember">
</Table>
</div>
</FormItem>
</div>
<h4>配置优惠券</h4>
@@ -61,12 +59,13 @@
</div>
</Form>
</Card>
<Modal v-model="showCouponSelect" width="80%">
<couponTemplate :checked="true" :selectList="selectCouponList" getType="ACTIVITY" @selected="selectedCoupon"/>
<Modal @on-ok="()=>{this.showCouponSelect = false}" @on-cancel="()=>{this.showCouponSelect = false}"
v-model="showCouponSelect" width="80%">
<couponTemplate :checked="true" :selectedList="selectCouponList" getType="ACTIVITY" @selected="selectedCoupon"/>
</Modal>
<Modal width="1200" v-model="checkUserList">
<userList @callback="callbackSelectUser" ref="memberLayout"/>
<userList v-if="checkUserList" @callback="callbackSelectUser" :selectedList="selectedMember" ref="memberLayout"/>
</Modal>
</div>
</template>
@@ -76,10 +75,7 @@ import couponTemplate from "@/views/promotion/coupon/coupon";
import userList from "@/views/member/list/index";
import {
saveActivityCoupon,
updateCouponActivity,
} from "@/api/promotion";
import {saveActivityCoupon, updateCouponActivity} from "@/api/promotion";
export default {
name: "addCouponActivity",
@@ -89,30 +85,75 @@ export default {
},
data() {
return {
showCouponSelect: false,//显示优惠券选择框
modalType: 0, // 是否编辑
rangeTime: '',//时间区间
checkUserList: false,//会员选择器
selectedMember: [],//选择的会员
options: {
disabledDate(date) {
return date && date.valueOf() < Date.now() - 86400000;
},
},
showCouponSelect: false, //显示优惠券选择框
rangeTime: "", //时间区间
checkUserList: false, //会员选择器
selectedMember: [], //选择的会员
form: {
promotionName: '', //活动名称
activityScope: 'ALL', //活动范围
couponActivityType: 'REGISTERED', //触发活动方式
activityScopeInfo: '', //活动描述
startTime: '', //开始时间
endTime: '', //结束时间
couponActivityItems: []
}, // 表单
id: this.$route.query.id, // 优惠券活动id
promotionName: "", //活动名称
activityScope: "ALL", //活动范围 ,默认全体发券
couponActivityType: "REGISTERED", //触发活动方式 默认新人赠券
startTime: "", //开始时间
endTime: "", //结束时间
memberDTOS: [], //指定会员范围
couponActivityItems: [],//优惠券列表
},
submitLoading: false, // 添加或编辑提交状态
selectCouponList: [],//选择的优惠券列表
selectCouponList: [], //选择的优惠券列表
formRule: {
promotionName: [{required: true, message: "活动名称不能为空"}],
rangeTime: [{required: true, message: "请选择活动有效期"}],
description: [{required: true, message: "请输入范围描述"}],
},
//优惠券表哥
// 用户表格
userColumns: [
{
title: "用户名称",
key: "nickName",
minWidth: 120,
},
{
title: "手机号",
key: "mobile",
render: (h, params) => {
return h("div", params.row.mobile || "暂未填写");
},
},
{
title: "最后登录时间",
key: "lastLoginDate",
},
{
title: "操作",
key: "action",
minWidth: 50,
align: "center",
render: (h, params) => {
return h(
"Button",
{
props: {
size: "small",
type: "error",
ghost: true,
},
on: {
click: () => {
this.delUser(params.index);
},
},
},
"删除"
);
},
},
],
//优惠券表格
columns: [
{
title: "优惠券名称",
@@ -175,7 +216,7 @@ export default {
},
on: {
click: () => {
// this.delGoods(params.index);
this.delCoupon(params.index);
},
},
},
@@ -186,22 +227,62 @@ export default {
],
};
},
async mounted() {
// 如果id不为空则查询信息
if (this.id) {
this.getCoupon();
this.modalType = 1;
}
},
methods: {
// 返回已选择的用户
callbackSelectUser(val) {
let index = this.selectedMember.indexOf(val)
if (index > 0) {
this.selectedMember.remove(val);
// 每次将返回的数据回调判断
let findUser = this.selectedMember.find((item) => {
return item.id === val.id;
});
// 如果没有则添加
if (!findUser) {
this.selectedMember.push(val);
} else {
// 有重复数据就删除
this.selectedMember.map((item, index) => {
if (item.id === findUser.id) {
this.selectedMember.splice(index, 1);
}
});
}
this.selectedMember.push(val);
this.reSelectMember();
},
// 删除选择的会员
delUser(index) {
this.selectedMember.splice(index, 1);
this.reSelectMember();
},
//更新选择的会员
reSelectMember() {
this.form.memberDTOS = this.selectedMember.map((item) => {
return {
nickName: item.nickName,
id: item.id
}
});
},
/**
* 返回优惠券*/
selectedCoupon(val) {
this.selectCouponList = val;
this.reSelectCoupon();
},
// 删除选择的优惠券
delCoupon(index) {
this.selectCouponList.splice(index, 1);
this.reSelectCoupon();
},
reSelectCoupon() {
//清空原有数据
this.form.couponActivityItems = this.selectCouponList.map((item) => {
return {
num: 0,
couponId: item.id,
}
});
console.log(this.form.couponActivityItems)
},
// 添加指定用户
@@ -215,68 +296,8 @@ export default {
showSelector() {
this.showCouponSelect = true;
},
/**
* 返回优惠券*/
selectedCoupon(val) {
this.selectCouponList = val
//清空原有数据
this.form.couponActivityItems = [];
val.forEach((item, index) => {
this.form.couponActivityItems.push({
num: 0,
couponId: item.id
})
})
console.log(val)
},
getCoupon() {
/**
* 获取优惠券活动详情
*/
getPlatformCoupon(this.id).then((res) => {
let data = res.result;
if (!data.promotionGoodsList) data.promotionGoodsList = [];
if (data.scopeType == "PORTION_GOODS_CATEGORY") {
let prevCascader = data.scopeId.split(",");
// console.log(prevCascader);
function next(params, prev) {
for (let i = 0; i < params.length; i++) {
const item = params[i];
console.log(item);
if (item.children) {
next(item.children, [...prev, item]);
} else {
if (prevCascader.includes(item.id)) {
prevCascader = prevCascader.map((key) => {
if (key === item.id) {
let result = prev.map((item) => item.id);
return [...result, item.id];
} else {
return key;
}
});
} else {
i === params.length - 1 && (prev = []);
}
}
}
}
next(this.goodsCategoryList, []);
data.scopeIdGoods = prevCascader;
}
data.rangeTime = [];
data.rangeTime.push(new Date(data.startTime), new Date(data.endTime));
this.form = data;
});
},
/** 保存平台优惠券 */
handleSubmit() {
this.form.startTime = this.$options.filters.unixToDate(
this.rangeTime[0] / 1000
);
@@ -287,27 +308,17 @@ export default {
this.$refs.form.validate((valid) => {
if (valid) {
const params = JSON.parse(JSON.stringify(this.form));
console.log(params)
console.log(params);
this.submitLoading = true;
if (this.modalType === 0) {
// 添加 避免编辑后传入id等数据 记得删除
delete params.id;
saveActivityCoupon(params).then((res) => {
this.submitLoading = false;
if (res.success) {
this.$Message.success("优惠券活动创建成功");
this.closeCurrentPage();
}
});
} else {
updateCouponActivity(params).then((res) => {
this.submitLoading = false;
if (res.success) {
this.$Message.success("优惠券活动修改成功");
this.closeCurrentPage();
}
});
}
// 添加 避免编辑后传入id等数据 记得删除
delete params.id;
saveActivityCoupon(params).then((res) => {
this.submitLoading = false;
if (res.success) {
this.$Message.success("优惠券活动创建成功");
this.closeCurrentPage();
}
});
}
});
},
@@ -318,7 +329,7 @@ export default {
this.$store.state.app.pageOpenedList
);
this.$router.go(-1);
}
},
},
};
</script>

View File

@@ -1,172 +0,0 @@
<template>
<div>
<Card>
<Form ref="form" :model="form" :label-width="120">
<div class="base-info-item">
<h4>优惠券将在指定发放时间发放到用户账号中</h4>
<div class="form-item-view">
<FormItem label="活动名称" prop="promotionName">
<Input type="text" v-model="form.promotionName" placeholder="活动名称" clearable style="width: 260px" />
</FormItem>
<FormItem label="目标客户" prop="vipType">
<RadioGroup v-model="vipType">
<Radio :label="0">全平台客户</Radio>
<Radio :label="1">指定客户</Radio>
</RadioGroup>
<Button type="primary" v-if="vipType==1" icon="ios-add" @click="addVip" ghost>添加客户</Button>
</FormItem>
<FormItem label="发放时间" prop="couponDiscount">
<DatePicker type="datetime" v-model="form.rangeTime" format="yyyy-MM-dd HH:mm:ss" placeholder="请选择" :options="options" style="width: 260px">
</DatePicker>
</FormItem>
<FormItem label="选择优惠券" prop="couponType">
<Button type="primary" icon="ios-add" @click="checkCoupon=!checkCoupon" ghost>选择优惠券</Button>
<Table class="table" :columns="couponColumns" :data="couponData"></Table>
</FormItem>
</div>
<div style="margin-left:100px">
<Button type="text" @click="closeCurrentPage">返回</Button>
<Button type="primary" :loading="submitLoading" @click="handleSubmit">提交</Button>
</div>
</div>
</Form>
<Modal width="1200" v-model="checkCoupon">
<couponList checked @selected="callbackSelectCoupon" />
</Modal>
<Modal width="1200" v-model="checkUserList">
<userList @selected="callbackSelectUser" ref="memberLayout" />
</Modal>
</Card>
</div>
</template>
<script>
import { addCouponActivity } from "@/api/promotion";
import couponList from "./coupon";
import userList from "@/views/member/list/index";
// import userList from ''
export default {
components: {
couponList,
userList,
},
data() {
return {
// 选择优惠券
checkCoupon: false,
// 选择用户
checkUserList: false,
// 优惠券表格title
couponColumns: [
{
title: "优惠券名称",
key: "name",
},
{
title: "有效期",
key: "age",
},
{
title: "优惠券数量",
key: "address",
},
{
title: "操作",
key: "action",
},
],
// datpicker时间设置
options: {
disabledDate(date) {
return date && date.valueOf() < Date.now() - 86400000;
},
},
//
vipType: 0, //客户会员类型 0全平台客户 1指定客户
form: {},
formRule: {},
id: this.$route.query.id, // 优惠券id
callbackCoupon: [],
};
},
mounted() {},
methods: {
// 添加指定用户
addVip() {
this.checkUserList = true;
this.$nextTick(() => {
this.$refs.memberLayout.selectedMember = true;
});
},
// 返回已选择的用户
callbackSelectUser(val){
console.log(val)
},
// 返回已选择的优惠券
callbackSelectCoupon(val) {
if (val.___selected) {
this.callbackCoupon.forEach((item, index) => {
if (item.id == val.id) this.callbackCoupon.splice(index, 1);
});
} else {
this.callbackCoupon.push(val);
}
},
// 关闭当前页面
closeCurrentPage() {
this.$store.commit("removeTag", "add-coupon-specify");
localStorage.pageOpenedList = JSON.stringify(
this.$store.state.app.pageOpenedList
);
this.$router.go(-1);
},
async handleSubmit() {
let res = await addCouponActivity();
},
},
};
</script>
<style lang="scss" scpoed>
.table {
width: 800px;
margin: 20px 0;
}
h4 {
margin-bottom: 10px;
padding: 0 10px;
border: 1px solid #ddd;
background-color: #f8f8f8;
font-weight: bold;
color: #333;
font-size: 14px;
line-height: 40px;
text-align: left;
}
.form-item-view {
margin: 20px 0;
}
.describe {
font-size: 12px;
margin-left: 10px;
color: #999;
}
.effectiveDays {
font-size: 12px;
color: #999;
> * {
margin: 0 4px;
}
}
</style>

View File

@@ -1,250 +0,0 @@
<template>
<div class="search">
<Card>
<Table
:loading="loading"
border
:columns="columns"
:data="data"
ref="table"
sortable="custom"
@on-sort-change="changeSort"
@on-selection-change="changeSelect"
>
<template slot-scope="{ row }" slot="rangeTime">
<div>{{ row.startTime }} ~ {{ row.endTime }}</div>
</template>
<template slot-scope="{ row }" slot="action">
<Button
type="error"
ghost
size="small"
:disabled="row.memberCouponStatus != 'NEW'"
@click="remove(row)"
>作废</Button
>
</template>
</Table>
<Row type="flex" justify="end" class="page">
<Page
:current="searchForm.pageNumber"
:total="total"
:page-size="searchForm.pageSize"
@on-change="changePage"
@on-page-size-change="changePageSize"
:page-size-opts="[10, 20, 50]"
size="small"
show-total
show-elevator
show-sizer
></Page>
</Row>
</Card>
</div>
</template>
<script>
import {
getMemberReceiveCouponList,
deleteMemberReceiveCoupon,
} from "@/api/promotion";
export default {
name: "memberReceiveCoupon",
components: {},
data() {
return {
loading: true, // 表单加载状态
searchForm: {
// 搜索框初始化对象
pageNumber: 1, // 当前页数
pageSize: 10, // 页面大小
sort: "createTime", // 默认排序字段
order: "desc", // 默认排序方式
},
id: this.$route.query.id, // 优惠券id
submitLoading: false, // 添加或编辑提交状态
selectList: [], // 多选数据
columns: [
// 表头
{
title: "优惠券编号",
key: "couponId",
minWidth: 120,
},
{
title: "面额",
key: "price",
render: (h, params) => {
return h(
"div",
this.$options.filters.unitPrice(params.row.price, "¥")
);
},
},
{
title: "消费门槛",
key: "consumeThreshold",
render: (h, params) => {
return h(
"div",
this.$options.filters.unitPrice(params.row.consumeThreshold, "¥")
);
},
},
{
title: "有效期",
slot: "rangeTime",
minWidth: 120
},
{
title: "会员名称",
key: "memberName",
minWidth: 120
},
{
title: "适用范围",
key: "couponType",
minWidth: 50,
render: (h, params) => {
let text = "未知";
if (params.row.scopeType == "ALL") {
text = "全品类";
} else if (params.row.scopeType == "PORTION_CATEGORY") {
text = "部分商品分类";
} else if (params.row.scopeType == "PORTION_GOODS") {
text = "指定商品";
}
return h("div", [text]);
},
},
{
title: "会员名称",
key: "memberName",
},
{
title: "状态",
key: "memberCouponStatus",
minWidth: 50,
render: (h, params) => {
let text = "未知",
color = "";
if (params.row.memberCouponStatus == "NEW") {
text = "未使用";
color = "default";
} else if (params.row.memberCouponStatus == "USED") {
text = "已使用";
color = "green";
} else if (params.row.memberCouponStatus == "EXPIRE") {
text = "已过期";
color = "red";
} else if (params.row.memberCouponStatus == "CLOSED") {
text = "已作废";
color = "red";
}
return h("div", [
h(
"Tag",
{
props: {
color: color,
},
},
text
),
]);
},
},
{
title: "操作",
slot: "action",
align: "center",
width: 100,
},
],
data: [], // 表单数据
total: 0, // 表单数据总数
};
},
methods: {
init() {
this.getDataList();
},
changePage(v) {
this.searchForm.pageNumber = v;
this.getDataList();
this.clearSelectAll();
},
changePageSize(v) {
this.searchForm.pageSize = v;
this.getDataList();
},
handleSearch() {
this.searchForm.pageNumber = 1;
this.searchForm.pageSize = 10;
this.getDataList();
},
handleReset() {
this.$refs.searchForm.resetFields();
this.searchForm.pageNumber = 1;
this.searchForm.pageSize = 10;
// 重新加载数据
this.getDataList();
},
changeSort(e) {
this.searchForm.sort = e.key;
this.searchForm.order = e.order;
if (e.order === "normal") {
this.searchForm.order = "";
}
this.getDataList();
},
clearSelectAll() {
this.$refs.table.selectAll(false);
},
changeSelect(e) {
this.selectList = e;
},
/** 查询单个优惠券领取详情 */
getDataList() {
this.loading = true;
// 带多条件搜索参数获取表单数据 请自行修改接口
getMemberReceiveCouponList(this.id).then((res) => {
this.loading = false;
if (res.success) {
this.data = res.result.records;
this.total = res.result.total;
}
});
this.total = this.data.length;
this.loading = false;
},
/** 作废优惠券 */
remove(v) {
this.$Modal.confirm({
title: "确认作废",
content: "您确认要作废此优惠券?",
loading: true,
onOk: () => {
// 删除
deleteMemberReceiveCoupon(v.id).then((res) => {
this.$Modal.remove();
if (res.success) {
this.$Message.success("作废成功");
this.getDataList();
}
});
},
});
},
},
mounted() {
this.init();
},
};
</script>
<style lang="scss">
@import "@/styles/table-common.scss";
</style>

View File

@@ -132,19 +132,19 @@ export default {
minWidth: 60,
render: (h, params) => {
let text = "未知",
color = "default";
color = "purple";
if (params.row.promotionStatus == "NEW") {
text = "未开始";
color = "default";
color = "geekblue";
} else if (params.row.promotionStatus == "START") {
text = "已开始";
color = "green";
color = "blue";
} else if (params.row.promotionStatus == "END") {
text = "已结束";
color = "blue";
color = "green";
} else if (params.row.promotionStatus == "CLOSE") {
text = "已关闭";
color = "red";
color = "volcano";
}
return h("div", [
h(

View File

@@ -93,7 +93,7 @@ export default {
},
on: {
"on-change": () => {
this.star(params.row,params.index);
this.star(params.row, params.index);
},
},
},
@@ -183,19 +183,19 @@ export default {
/**
* 是否推荐
*/
async star(val,index) {
let switched
if(this.liveData[index].recommend){
this.$set(this.liveData[index],'recommend',false)
switched = false
}
else{
this.$set(this.liveData[index],'recommend',true)
switched = true
async star(val, index) {
let switched;
if (this.liveData[index].recommend) {
this.$set(this.liveData[index], "recommend", false);
switched = false;
} else {
this.$set(this.liveData[index], "recommend", true);
switched = true;
}
await whetherStar({id:val.id,recommend:switched});
await whetherStar({ id: val.id, recommend: switched });
this.getStoreLives();
},
/**

View File

@@ -122,16 +122,16 @@ export default {
color = "";
if (params.row.promotionStatus == "NEW") {
text = "未开始";
color = "default";
color = "geekblue";
} else if (params.row.promotionStatus == "START") {
text = "已开始";
color = "green";
color = "blue";
} else if (params.row.promotionStatus == "END") {
text = "已结束";
color = "blue";
color = "green";
} else if (params.row.promotionStatus == "CLOSE") {
text = "已关闭";
color = "red";
color = "volcano";
}
return h("div", [
h(

View File

@@ -92,7 +92,7 @@
<div>{{ row.startTime }}</div>
<div>{{ row.endTime }}</div>
</template>
<template slot-scope="{ row }" slot="action">
<Button
v-if="row.promotionStatus == 'NEW'"
@@ -213,16 +213,16 @@ export default {
color = "";
if (params.row.promotionStatus == "NEW") {
text = "未开始";
color = "default";
color = "geekblue";
} else if (params.row.promotionStatus == "START") {
text = "已开始";
color = "green";
color = "blue";
} else if (params.row.promotionStatus == "END") {
text = "已结束";
color = "blue";
color = "green";
} else if (params.row.promotionStatus == "CLOSE") {
text = "已关闭";
color = "red";
color = "volcano";
}
return h("div", [h("Tag", { props: { color: color } }, text)]);
},

View File

@@ -102,41 +102,13 @@ export default {
width: 100,
render: (h, params) => {
if (params.row.promotionStatus == "NEW") {
return h("div", [
h("Badge", {
props: {
status: "error",
text: "新建",
},
}),
]);
return h("Tag", {props: {color: "volcano",},},"新建");
} else if (params.row.promotionStatus == "START") {
return h("div", [
h("Badge", {
props: {
status: "success",
text: "开始",
},
}),
]);
return h("Tag", {props: {color: "blue",},},"开始");
} else if (params.row.promotionStatus == "END") {
return h("div", [
h("Badge", {
props: {
status: "error",
text: "结束",
},
}),
]);
return h("Tag", {props: {color: "green",},},"结束");
} else if (params.row.promotionStatus == "CLOSE") {
return h("div", [
h("Badge", {
props: {
status: "error",
text: "废弃",
},
}),
]);
return h("Tag", {props: {color: "volcano",},},"结束");
}
},
},

View File

@@ -1,5 +1,5 @@
<template>
<div>
<div v-if="templateShow">
<Form :model="form" :label-width="120">
<FormItem label="每日场次设置">
<Row :gutter="16" class="row">
@@ -27,6 +27,7 @@ import { getSetting, setSetting } from "@/api/index";
export default {
data() {
return {
templateShow:false,
submitLoading: false,
selectedTime: [],
times: [], //时间集合 1-24点
@@ -81,6 +82,7 @@ export default {
async init() {
let result = await getSetting("SECKILL_SETTING");
if (result.success) {
this.templateShow = true
this.form.seckillRule = result.result.seckillRule;
this.times=[]
for (let i = 0; i < 24; i++) {

View File

@@ -303,7 +303,7 @@ export default {
content: "更新后店铺以及用户地区绑定数据将全部错乱",
onOk: () => {
let timer;
let numer;
let number;
this.asyncLoading = true
@@ -319,7 +319,8 @@ export default {
click: () => {
this.$Message.destroy();
this.asyncLoading = false
clearInterval(timer, numer);
clearInterval(number);
clearTimeout(timer)
},
},
},
@@ -329,11 +330,12 @@ export default {
},
});
numer = setInterval(() => {
number = setInterval(() => {
this.num--;
}, 1000);
timer = setTimeout(() => {
clearInterval(number)
asyncRegion().then((res) => {
this.asyncLoading = false
this.$Message.loading("地区数据正在更新中!");

View File

@@ -95,13 +95,13 @@ export default {
width: 100,
render: (h, params) => {
if (params.row.billStatus == "OUT") {
return h("div", "已出账");
return h("Tag", {props: {color: "blue",},},"已出账");
} else if (params.row.billStatus == "CHECK") {
return h("div", "已对账");
return h("Tag", {props: {color: "geekblue",},},"已对账");
} else if (params.row.billStatus == "EXAMINE") {
return h("div", "已审核");
return h("Tag", {props: {color: "purple",},},"已审核");
} else {
return h("div", "已付款");
return h("Tag", {props: {color: "green",},},"已付款");
}
},
},
@@ -189,7 +189,7 @@ export default {
(this.searchForm.endTime = this.$options.filters.unixToDate(
this.searchForm.endTime / 1000
));
this.searchForm.billStatus = "OUT";
this.searchForm.billStatus = "CHECK";
API_Shop.getBuyBillPage(this.searchForm).then((res) => {
this.loading = false;
if (res.success) {

View File

@@ -106,13 +106,13 @@ export default {
width: 100,
render: (h, params) => {
if (params.row.billStatus == "OUT") {
return h("div", "已出账");
return h("Tag", {props: {color: "blue",},},"已出账");
} else if (params.row.billStatus == "CHECK") {
return h("div", "已对账");
return h("Tag", {props: {color: "geekblue",},},"已对账");
} else if (params.row.billStatus == "EXAMINE") {
return h("div", "已审核");
return h("Tag", {props: {color: "purple",},},"已审核");
} else {
return h("div", "已付款");
return h("Tag", {props: {color: "green",},},"已付款");
}
},
},

View File

@@ -126,7 +126,7 @@ export default {
"Tag",
{
props: {
color: params.row.selfOperated ? "error" : "success",
color: params.row.selfOperated ? "volcano" : "green",
},
},
params.row.selfOperated ? "自营" : "非自营"
@@ -141,50 +141,15 @@ export default {
width: 130,
render: (h, params) => {
if (params.row.storeDisable == "OPEN") {
return h("div", [
h("Badge", {
props: {
status: "success",
text: "开启中",
},
}),
]);
return h("Tag", {props: {color: "green",},},"开启中");
} else if (params.row.storeDisable == "CLOSED") {
return h("div", [
h("Badge", {
props: {
status: "error",
text: "已关闭",
},
}),
]);
return h("Tag", {props: {color: "volcano",},},"已关闭");
} else if (params.row.storeDisable == "APPLY") {
return h("div", [
h("Badge", {
props: {
status: "error",
text: "申请中",
},
}),
]);
return h("Tag", {props: {color: "geekblue",},},"申请中");
} else if (params.row.storeDisable == "APPLYING") {
return h("div", [
h("Badge", {
props: {
status: "error",
text: "审核中",
},
}),
]);
return h("Tag", {props: {color: "purple",},},"审核中");
} else if (params.row.storeDisable == "REFUSED") {
return h("div", [
h("Badge", {
props: {
status: "error",
text: "审核拒绝",
},
}),
]);
return h("Tag", {props: {color: "red",},},"审核拒绝");
}
},
},

View File

@@ -6,7 +6,7 @@
<div class="shop-item">
<div class="label-item">
<span>订单来源</span>
<span>{{res.clientType}}</span>
<span>{{res.clientType | clientTypeWay}}</span>
</div>
<div class="label-item">
<span>订单状态</span>

View File

@@ -347,6 +347,7 @@ export default {
this.form.versionUpdateDate / 1000
);
this.form.versionUpdateDate = versionUpdateDate;
this.form.updateTime = versionUpdateDate;
if (this.modalType == 0) {
// 添加 避免编辑后传入id等数据 记得删除