This commit is contained in:
KangKang0928 2024-12-12 18:42:39 +08:00
commit 14ad1d4cb6
50 changed files with 8431 additions and 644 deletions

28
src/api/modules/coupon.js Normal file
View File

@ -0,0 +1,28 @@
import $http from "@/utils/httpRequest.js";
export const coupon = {
//优惠券列表
couponList: (data) => {
return $http.request({
url: `/merchant-api/coupon/page`,
method: "get",
params: data,
});
},
//添加优惠卷
addCoupon: (data) => {
return $http.post(`/merchant-api/coupon/save`, data);
},
//新增优惠卷数量
addNumCoupon: (data) => {
return $http.post(`/merchant-api/coupon/addNum`, data);
},
//优惠卷状态
couponStatus: (data) => {
return $http.post(`/merchant-api/coupon/update/status`, data);
},
//删除优惠卷
deleteCoupon: (data) => {
return $http.post(`/merchant-api/coupon/batch/delete`, data);
},
};

View File

@ -0,0 +1,32 @@
import $http from "@/utils/httpRequest.js";
//
export const dataCenter = {
customerAnalysis: (data) => {
return $http.request({
url: `/merchant-api/pc/data/analyse/customer/analyse`,
method: "get",
params: data,
});
},
customerTrend: (data) => {
return $http.request({
url: `/merchant-api/pc/data/analyse/customer/trend`,
method: "get",
params: data,
});
},
updatePreSaleProducts: (data) => {
return $http.request({
url: `/merchant-api/product/save/advance/sell`,
method: "post",
data,
});
},
closePreSaleProducts: (data) => {
return $http.request({
url: `/merchant-api/product/update/advance/sell/status`,
method: "post",
data,
});
},
};

View File

@ -0,0 +1,34 @@
import $http from "@/utils/httpRequest.js";
export const marketing = {
// 会员等级列表
marketingLevelPage: (data) => {
return $http.request({
url: `/merchant-api/memberUnitMemberLevel/list`,
method: "post",
data,
});
},
addMarketingLevel: (data) => {
return $http.request({
url: `/merchant-api/memberUnitMemberLevel/saveAll`,
method: "post",
data: data,
});
},
marketingUserPage: (data) => {
return $http.request({
url: `/merchant-api/memberUnitUser/page`,
method: "get",
params: data,
});
},
//积分列表
integralList: (data) => {
return $http.request({
url: `/merchant-api/memberUnitMemberTask/list`,
method: "post",
data,
});
},
};

View File

@ -49,12 +49,12 @@ export const mer_admin = {
return $http.post(`/merchant-api/product/page`, data);
},
//商户商品分类
getProductCategory: () => {
return $http.get(
`/merchant-api/product/category/list?shopId=${
JSON.parse(sessionStorage.getItem("userInfo")).shopId
}`
);
getProductCategory: (data) => {
return $http.request({
url: `/merchant-api/product/category/list`,
method: "get",
params: data,
});
},
//上架或下架
putOnShelvesProducts: (data) => {
@ -142,9 +142,23 @@ export const mer_admin = {
params: data,
});
},
//添加商家端银行卡
//添加商家端私账银行卡
bankCardAdd: (data) => {
return $http.post(`/merchant-api/bank/com-create`, data);
return $http.post(`/merchant-api/bank/pri-create`, data);
},
//添加商家端公账银行卡
publicAccountBankCardAdd: (data) => {
return $http.post(`/merchant-api/bank/pub-create`, data);
},
//删除银行卡
bankCardDelete: (data) => {
return $http.post(`/merchant-api/bank/delete?id=${data}`);
},
//设置默认银行卡
defaultBank: (data) => {
return $http.post(
`/merchant-api/bank/default-bank?linkId=${data.linkId}&bankId=${data.bankId}`
);
},
//获取银行卡详情
bankCardDetail: (id) => {
@ -154,6 +168,14 @@ export const mer_admin = {
params: { id },
});
},
//市场下的店铺列表
storeList: (data) => {
return $http.request({
method: "get",
url: `/merchant-api/market/shop_list`,
params: data,
});
},
//获取品牌信息
getBrandInfo: () => {
return $http.request({
@ -162,4 +184,24 @@ export const mer_admin = {
params: {},
});
},
//编辑品牌信息
editBrandInfo: (data) => {
return $http.put(`/merchant-api/brand/edit`, data);
},
//修改密码
changePassword: (data) => {
return $http.put(`/merchant-api/auth/change/pwd`, data);
},
//修改管理员
editAdmin: (data) => {
return $http.put(`/merchant-api/brand/change/administrator`, data);
},
//获取验证码
getCaptcha: (data) => {
return $http.request({
method: "get",
url: `/merchant-api/brand/sms_code`,
params: data,
});
},
};

View File

@ -0,0 +1,34 @@
import $http from "@/utils/httpRequest.js";
export const preSale = {
//预售商品列表
preSaleProducts: (data) => {
return $http.request({
url: `/merchant-api/product/advance/sell/page`,
method: "post",
data,
});
},
addPreSaleProducts: (data) => {
return $http.request({
url: `/merchant-api/product/batch/save/advance/sell`,
method: "post",
data,
});
},
updatePreSaleProducts: (data) => {
return $http.request({
url: `/merchant-api/product/save/advance/sell`,
method: "post",
data,
});
},
closePreSaleProducts: (data) => {
return $http.request({
url: `/merchant-api/product/update/advance/sell/status`,
method: "post",
data,
});
},
};

44
src/api/modules/wallet.js Normal file
View File

@ -0,0 +1,44 @@
import $http from "@/utils/httpRequest.js";
export const wallet = {
//钱包管理
myWallet: (data) => {
return $http.request({
url: `/merchant-api/wallet/wallet`,
method: "post",
data,
});
},
//钱包明细
Withdrawal: (data) => {
return $http.request({
url: `/merchant-api/walletDrawCashOrder/apply`,
method: "post",
data,
});
},
//钱包提现订单
WithdrawalRecord: (data) => {
return $http.request({
url: `/merchant-api/walletDrawCashOrder/page`,
method: "get",
params: data,
});
},
//钱包账单收支金额
totalAmount: (data) => {
return $http.request({
url: `/merchant-api/walletBill/totalAmount`,
method: "post",
data: data,
});
},
//钱包账单
getBankInfo: (data) => {
return $http.request({
url: `/merchant-api/walletBill/page`,
method: "get",
params: data,
});
},
};

View File

@ -92,6 +92,7 @@ export default {
orderNum: 0,
open: null,
list: [],
hideInMenu: true,
},
{
menuId: getUUID(),
@ -120,72 +121,323 @@ export default {
},
],
},
// {
// "menuId": getUUID(),
// "parentId": 0,
// "parentName": null,
// "name": "教务管理",
// "url": "local-affairs",
// "perms": "",
// "type": 0,
// "elIcon": "el-icon-office-building",
// "orderNum": 0,
// "open": null,
// list: [
// {
// "menuId": getUUID(),
// "parentId": 2,
// "parentName": null,
// "name": "年级管理",
// "url": "local-affairs/grade",
// "perms": "",
// "type": 1,
// "icon": "log",
// "orderNum": 0,
// "open": null,
// "list": []
// },
// {
// "menuId": getUUID(),
// "parentId": 2,
// "parentName": null,
// "name": "班级管理",
// "url": "local-affairs/class",
// "perms": "",
// "type": 1,
// "icon": "log",
// "orderNum": 0,
// "open": null,
// "list": []
// },
// {
// "menuId": getUUID(),
// "parentId": 2,
// "parentName": null,
// "name": "教师管理",
// "url": "local-teacher/teacher",
// "perms": "",
// "type": 1,
// "icon": "log",
// "orderNum": 0,
// "open": null,
// "list": []
// },
// {
// "menuId": getUUID(),
// "parentId": 0,
// "parentName": null,
// "name": "学校管理",
// "url": "local-school/school",
// "perms": "",
// "type": 1,
// "elIcon": "el-icon-school",
// "orderNum": 0,
// "open": null,
// list: []
// },
// ]
// },
{
menuId: getUUID(),
parentId: 0,
parentName: null,
name: "优惠卷管理",
url: "coupon/index",
perms: "",
type: 0,
elIcon: "el-icon-document-remove",
orderNum: 0,
open: null,
list: [],
},
{
menuId: getUUID(),
parentId: 0,
parentName: null,
name: "预售管理",
url: "",
perms: "",
type: 0,
elIcon: "el-icon-data-analysis",
orderNum: 0,
open: null,
list: [
{
menuId: getUUID(),
parentId: 0,
parentName: null,
name: "预售商品",
url: "presale/products/index",
perms: "",
type: 1,
elIcon: "el-icon-postcard",
orderNum: 0,
open: null,
list: [],
},
{
menuId: getUUID(),
parentId: 0,
parentName: null,
name: "预售订单",
url: "presale/order/index",
perms: "",
type: 1,
elIcon: "el-icon-postcard",
orderNum: 0,
open: null,
list: [],
},
],
},
{
menuId: getUUID(),
parentId: 0,
parentName: null,
name: "数据中心",
url: "",
perms: "",
type: 0,
elIcon: "el-icon-tickets",
orderNum: 0,
open: null,
list: [
{
menuId: getUUID(),
parentId: 0,
parentName: null,
name: "客户分析",
url: "datacenter/customer-analysis/index",
perms: "",
type: 1,
elIcon: "el-icon-user",
orderNum: 0,
open: null,
list: [],
},
{
menuId: getUUID(),
parentId: 0,
parentName: null,
name: "商品分析",
url: "datacenter/product-analysis/index",
perms: "",
type: 1,
elIcon: "el-icon-data-analysis",
orderNum: 0,
open: null,
list: [],
},
{
menuId: getUUID(),
parentId: 0,
parentName: null,
name: "订单统计分析",
url: "datacenter/order-analysis/index",
perms: "",
type: 1,
elIcon: "el-icon-shopping-cart-full",
orderNum: 0,
open: null,
list: [],
},
],
},
{
menuId: getUUID(),
parentId: 0,
parentName: null,
name: "营销管理",
url: "",
perms: "",
type: 0,
elIcon: "el-icon-tickets",
orderNum: 0,
open: null,
list: [
{
menuId: getUUID(),
parentId: 0,
parentName: null,
name: "会员等级管理",
url: "marketing/level/index",
perms: "",
type: 1,
elIcon: "el-icon-user",
orderNum: 0,
open: null,
list: [],
},
{
menuId: getUUID(),
parentId: 0,
parentName: null,
name: "用户管理",
url: "marketing/user/index",
perms: "",
type: 1,
elIcon: "el-icon-data-analysis",
orderNum: 0,
open: null,
list: [],
},
{
menuId: getUUID(),
parentId: 0,
parentName: null,
name: "积分设置",
url: "marketing/points-setting/index",
perms: "",
type: 1,
elIcon: "el-icon-shopping-cart-full",
orderNum: 0,
open: null,
list: [],
},
{
menuId: getUUID(),
parentId: 0,
parentName: null,
name: "积分商城",
url: "marketing/points-mall/index",
perms: "",
type: 1,
elIcon: "el-icon-shopping-cart-full",
orderNum: 0,
open: null,
list: [],
},
{
menuId: getUUID(),
parentId: 0,
parentName: null,
name: "积分订单",
url: "marketing/points-order/index",
perms: "",
type: 1,
elIcon: "el-icon-shopping-cart-full",
orderNum: 0,
open: null,
list: [],
},
],
},
{
menuId: getUUID(),
parentId: 0,
parentName: null,
name: "代理商",
url: "",
perms: "",
type: 0,
elIcon: "el-icon-tickets",
orderNum: 0,
open: null,
list: [
{
menuId: getUUID(),
parentId: 0,
parentName: null,
name: "数据面板",
url: "agent/data-panel/index",
perms: "",
type: 1,
elIcon: "el-icon-user",
orderNum: 0,
open: null,
list: [],
},
{
menuId: getUUID(),
parentId: 0,
parentName: null,
name: "品牌管理",
url: "agent/brand/index",
perms: "",
type: 1,
elIcon: "el-icon-data-analysis",
orderNum: 0,
open: null,
list: [],
},
{
menuId: getUUID(),
parentId: 0,
parentName: null,
name: "报表",
url: "agent/report-form/index",
perms: "",
type: 1,
elIcon: "el-icon-shopping-cart-full",
orderNum: 0,
open: null,
list: [],
},
{
menuId: getUUID(),
parentId: 0,
parentName: null,
name: "市场列表",
url: "agent/market-list/index",
perms: "",
type: 1,
elIcon: "el-icon-shopping-cart-full",
orderNum: 0,
open: null,
list: [],
},
{
menuId: getUUID(),
parentId: 0,
parentName: null,
name: "店铺列表",
url: "agent/shop-list/index",
perms: "",
type: 1,
elIcon: "el-icon-shopping-cart-full",
orderNum: 0,
open: null,
list: [],
},
{
menuId: getUUID(),
parentId: 0,
parentName: null,
name: "分销商列表",
url: "agent/distributor/index",
perms: "",
type: 1,
elIcon: "el-icon-shopping-cart-full",
orderNum: 0,
open: null,
list: [],
},
{
menuId: getUUID(),
parentId: 0,
parentName: null,
name: "权限管理",
url: "agent/jurisdiction/index",
perms: "",
type: 1,
elIcon: "el-icon-shopping-cart-full",
orderNum: 0,
open: null,
list: [],
},
],
},
{
menuId: getUUID(),
parentId: 0,
parentName: null,
name: "钱包管理",
url: "local-course/resources",
perms: "",
type: 0,
elIcon: "el-icon-menu",
orderNum: 0,
open: null,
list: [
{
menuId: getUUID(),
parentId: 0,
parentName: null,
name: "我的钱包",
url: "wallet/index",
perms: "",
type: 1,
elIcon: "el-icon-menu",
orderNum: 0,
open: null,
list: [],
},
],
},
],
code: 0,
permissions: [],

View File

@ -4,111 +4,183 @@
* 建议:
* 1. 代码中路由统一使用name属性跳转(不使用path属性)
*/
import Vue from 'vue'
import Router from 'vue-router'
import http from '@/utils/httpRequest'
import { isURL } from '@/utils/validate'
import { clearLoginInfo } from '@/utils'
import Vue from "vue";
import Router from "vue-router";
import http from "@/utils/httpRequest";
import { isURL } from "@/utils/validate";
import { clearLoginInfo } from "@/utils";
import FULL_ROUTERS from "./full-routers";
import $api from "@/api/index.js"
import { Loading } from 'element-ui';
import $api from "@/api/index.js";
import store from "@/store";
import { Loading } from "element-ui";
Vue.use(Router)
Vue.use(Router);
// 开发环境不使用懒加载, 因为懒加载页面太多的话会造成webpack热更新太慢, 所以只有生产环境使用懒加载
const _import = require('./import-' + process.env.NODE_ENV)
const _import = require("./import-" + process.env.NODE_ENV);
// 全局路由(无需嵌套上左右整体布局)
const globalRoutes = [
{ path: '/404', component: _import('common/404'), name: '404', meta: { title: '404未找到' } },
{ path: '/login', component: _import('common/login'), name: 'login', meta: { title: '登录' } },
{
path: "/404",
component: _import("common/404"),
name: "404",
meta: { title: "404未找到" },
},
{
path: "/login",
component: _import("common/login"),
name: "login",
meta: { title: "登录" },
},
//test用会员管理
]
];
// 主入口路由(需嵌套上左右整体布局)
const mainRoutes = {
path: '/',
component: _import('main'),
name: 'main',
redirect: { name: 'home' },
meta: { title: '主入口整体布局' },
path: "/",
component: _import("main"),
name: "main",
redirect: { name: "home" },
meta: { title: "主入口整体布局" },
children: [
// 通过meta对象设置路由展示方式
// 1. isTab: 是否通过tab展示内容, true: 是, false: 否
// 2. iframeUrl: 是否通过iframe嵌套展示内容, '以http[s]://开头': 是, '': 否
// 提示: 如需要通过iframe嵌套展示内容, 但不通过tab打开, 请自行创建组件使用iframe处理!
{ path: '/home', component: _import('common/home'), name: 'home', meta: { title: '首页' } },
{ path: '/theme', component: _import('common/theme'), name: 'theme', meta: { title: '主题' } },
{ path: '/demo-echarts', component: _import('demo/echarts'), name: 'demo-echarts', meta: { title: 'demo-echarts', isTab: true } }
{
path: "/home",
component: _import("common/home"),
name: "home",
meta: { title: "首页" },
},
{
path: "/theme",
component: _import("common/theme"),
name: "theme",
meta: { title: "主题" },
},
{
path: "/demo-echarts",
component: _import("demo/echarts"),
name: "demo-echarts",
meta: { title: "demo-echarts", isTab: true },
},
],
beforeEnter(to, from, next) {
let token = Vue.cookie.get('token')
let token = Vue.cookie.get("token");
if (!token || !/\S/.test(token)) {
clearLoginInfo()
next({ name: 'login' })
clearLoginInfo();
next({ name: "login" });
}
next()
}
}
next();
},
};
const router = new Router({
mode: 'hash',
mode: "hash",
// mode:"history",
scrollBehavior: () => ({ y: 0 }),
isAddDynamicMenuRoutes: false, // 是否已经添加动态(菜单)路由
routes: globalRoutes.concat(mainRoutes)
})
routes: globalRoutes.concat(mainRoutes),
});
router.beforeEach((to, from, next) => {
console.log("beforeEach");
// 添加动态(菜单)路由
// 1. 已经添加 or 全局路由, 直接访问
// 2. 获取菜单列表, 添加并保存本地存储
if (router.options.isAddDynamicMenuRoutes || fnCurrentRouteType(to, globalRoutes) === 'global') {
next()
if (
router.options.isAddDynamicMenuRoutes ||
fnCurrentRouteType(to, globalRoutes) === "global"
) {
next();
} else {
let loadingInstance = Loading.service({
text:"正在初始化中...",
background:'rgba(255,255,255,0.7)'
text: "正在初始化中...",
background: "rgba(255,255,255,0.7)",
});
$api.getUserInfo()
$api
.getUserInfo()
.then(({ data }) => {
const filterTreeData=(data, permissions) =>{
return data;//临时性返回所有菜单方便调试
return data.reduce((filtered, node) => {
// 如果节点的权限在权限数组中
if (permissions.includes(node.url)) {
// 递归过滤子节点
const list = filterTreeData(node.list || [], permissions);
// 创建一个新的节点,包含过滤后的子节点
filtered.push({
...node,
list
});
}
return filtered;
}, []);
}
const filterTreeData = (data, permissions) => {
return data; //临时性返回所有菜单方便调试
// return data.reduce((filtered, node) => {
// // 如果节点的权限在权限数组中
// if (permissions.includes(node.url)) {
// // 递归过滤子节点
// const list = filterTreeData(node.list || [], permissions);
// // 创建一个新的节点,包含过滤后的子节点
// filtered.push({
// ...node,
// list,
// });
// }
// return filtered;
// }, []);
};
console.log(data);
if (data.data.markets?.length > 0) {
// 存在多个市场
$api.mer_admin
.storeList({ marketId: data.data.markets[0].marketId })
.then((res) => {
store.commit("userData/setState", {
isMerchant: true,
marketList: data.data.markets,
storeList: res.data.data,
marketId: data.data.markets[0].marketId,
shopId: res.data.data[0].shopId,
});
});
console.log(data.data.markets);
} else if (data.data.shopId) {
// 存在单个店铺
store.commit("userData/setState", {
isMerchant: true,
marketList: [],
storeList: [],
marketId: data.data.marketId,
shopId: data.data.shopId,
});
} else {
// 不存在店铺
store.commit("userData/setState", {
isMerchant: false,
marketList: [],
storeList: [],
marketId: "",
shopId: "",
});
}
sessionStorage.setItem("userInfo", JSON.stringify(data.data));
sessionStorage.setItem('permissions', JSON.stringify(data.data.permissions || '[]'))
sessionStorage.setItem(
"permissions",
JSON.stringify(data.data.permissions || "[]")
);
//添加全量菜单,根据权限进行过滤
let _menu=filterTreeData(FULL_ROUTERS.menuList, data.data.permissions);
fnAddDynamicMenuRoutes(_menu)
sessionStorage.setItem('menuList', JSON.stringify(_menu))
router.options.isAddDynamicMenuRoutes = true
next({ ...to, replace: true })
let _menu = filterTreeData(
FULL_ROUTERS.menuList,
data.data.permissions
);
fnAddDynamicMenuRoutes(_menu);
sessionStorage.setItem("menuList", JSON.stringify(_menu));
router.options.isAddDynamicMenuRoutes = true;
next({ ...to, replace: true });
})
.catch((e) => {
sessionStorage.setItem('menuList', '[]')
sessionStorage.setItem('permissions', '[]')
console.log(`%c${e} 请求菜单列表和权限失败,跳转至登录页!!`, 'color:blue')
router.push({ name: 'login' })
next()
sessionStorage.setItem("menuList", "[]");
sessionStorage.setItem("permissions", "[]");
console.log(
`%c${e} 请求菜单列表和权限失败,跳转至登录页!!`,
"color:blue"
);
router.push({ name: "login" });
next();
})
.finally(()=>{
.finally(() => {
loadingInstance.close();
})
});
// http({
// url: '/sys/menu/nav',
// method: 'get',
@ -128,22 +200,25 @@ router.beforeEach((to, from, next) => {
// router.push({ name: 'login' })
// })
}
})
});
/**
* 判断当前路由类型, global: 全局路由, main: 主入口路由
* @param {*} route 当前路由
*/
function fnCurrentRouteType(route, globalRoutes = []) {
var temp = []
var temp = [];
for (var i = 0; i < globalRoutes.length; i++) {
if (route.path === globalRoutes[i].path) {
return 'global'
} else if (globalRoutes[i].children && globalRoutes[i].children.length >= 1) {
temp = temp.concat(globalRoutes[i].children)
return "global";
} else if (
globalRoutes[i].children &&
globalRoutes[i].children.length >= 1
) {
temp = temp.concat(globalRoutes[i].children);
}
}
return temp.length >= 1 ? fnCurrentRouteType(route, temp) : 'main'
return temp.length >= 1 ? fnCurrentRouteType(route, temp) : "main";
}
/**
@ -152,53 +227,59 @@ function fnCurrentRouteType(route, globalRoutes = []) {
* @param {*} routes 递归创建的动态(菜单)路由
*/
function fnAddDynamicMenuRoutes(menuList = [], routes = []) {
var temp = []
var temp = [];
for (var i = 0; i < menuList.length; i++) {
if (menuList[i].list && menuList[i].list.length >= 1) {
temp = temp.concat(menuList[i].list)
temp = temp.concat(menuList[i].list);
} else if (menuList[i].url && /\S/.test(menuList[i].url)) {
menuList[i].url = menuList[i].url.replace(/^\//, '')
menuList[i].url = menuList[i].url.replace(/^\//, "");
var route = {
path: menuList[i].url.replace('/', '-'),
path: menuList[i].url.replace("/", "-"),
component: null,
name: menuList[i].url.replace('/', '-'),
name: menuList[i].url.replace("/", "-"),
meta: {
menuId: menuList[i].menuId,
title: menuList[i].name,
isDynamic: true,
isTab: true,
iframeUrl: '',
isMicroApp:menuList[i].isMicroApp
}
}
iframeUrl: "",
isMicroApp: menuList[i].isMicroApp,
},
};
// url以http[s]://开头, 通过iframe展示,或者启用microApp框架
if (isURL(menuList[i].url)) {
route['path'] = `i-${menuList[i].menuId}`
route['name'] = `i-${menuList[i].menuId}`
route['meta']['iframeUrl'] = menuList[i].url
route["path"] = `i-${menuList[i].menuId}`;
route["name"] = `i-${menuList[i].menuId}`;
route["meta"]["iframeUrl"] = menuList[i].url;
} else {
try {
route['component'] = _import(`modules/${menuList[i].url}`) || null
} catch (e) { }
route["component"] = _import(`modules/${menuList[i].url}`) || null;
} catch (e) {}
}
routes.push(route)
routes.push(route);
}
}
if (temp.length >= 1) {
fnAddDynamicMenuRoutes(temp, routes)
fnAddDynamicMenuRoutes(temp, routes);
} else {
mainRoutes.name = 'main-dynamic'
mainRoutes.children = routes
router.addRoutes([
mainRoutes,
{ path: '*', redirect: { name: '404' } }
])
sessionStorage.setItem('dynamicMenuRoutes', JSON.stringify(mainRoutes.children || '[]'))
console.log('\n')
console.log('%c!<-------------------- 动态(菜单)路由 s -------------------->', 'color:blue')
console.log(mainRoutes.children)
console.log('%c!<-------------------- 动态(菜单)路由 e -------------------->', 'color:blue')
mainRoutes.name = "main-dynamic";
mainRoutes.children = routes;
router.addRoutes([mainRoutes, { path: "*", redirect: { name: "404" } }]);
sessionStorage.setItem(
"dynamicMenuRoutes",
JSON.stringify(mainRoutes.children || "[]")
);
console.log("\n");
console.log(
"%c!<-------------------- 动态(菜单)路由 s -------------------->",
"color:blue"
);
console.log(mainRoutes.children);
console.log(
"%c!<-------------------- 动态(菜单)路由 e -------------------->",
"color:blue"
);
}
}
export default router
export default router;

View File

@ -1,23 +1,25 @@
import Vue from 'vue'
import Vuex from 'vuex'
import cloneDeep from 'lodash/cloneDeep'
import common from './modules/common'
import user from './modules/user'
import Vue from "vue";
import Vuex from "vuex";
import cloneDeep from "lodash/cloneDeep";
import common from "./modules/common";
import user from "./modules/user";
import userData from "./modules/userData";
Vue.use(Vuex)
Vue.use(Vuex);
export default new Vuex.Store({
modules: {
common,
user
user,
userData,
},
mutations: {
// 重置vuex本地储存状态
resetStore (state) {
resetStore(state) {
Object.keys(state).forEach((key) => {
state[key] = cloneDeep(window.SITE_CONFIG['storeState'][key])
})
}
state[key] = cloneDeep(window.SITE_CONFIG["storeState"][key]);
});
},
},
strict: process.env.NODE_ENV !== 'production'
})
strict: process.env.NODE_ENV !== "production",
});

View File

@ -0,0 +1,30 @@
const state = {
isMerchant: false, //是否是经营者还是摊铺 不是就是为false
marketList: [], //经营的市场
storeList: [], //经营的店铺
marketId: "",
shopId: "",
};
// actions
const actions = {};
// mutations
const mutations = {
setState(state, data) {
console.log(data, "传过来的数据");
state.isMerchant = data.isMerchant;
state.marketList = data.marketList;
state.storeList = data.storeList;
state.marketId = data.marketId;
state.shopId = data.shopId;
},
};
export default {
namespaced: true,
state,
mutations,
actions,
};

View File

@ -87,7 +87,7 @@
}
let filterMenu=filterMethod(JSON.parse(JSON.stringify(this.menuList)),this.keyWord);
console.log(filterMenu);
return filterMenu;
return filterMenu.filter(item=>item.hideInMenu!=true);
},
//
showSearchInput(){

View File

@ -0,0 +1,15 @@
<template>
<div>
品牌管理
</div>
</template>
<script>
export default {
}
</script>
<style>
</style>

View File

@ -0,0 +1,15 @@
<template>
<div>
数据面板
</div>
</template>
<script>
export default {
}
</script>
<style>
</style>

View File

@ -0,0 +1,15 @@
<template>
<div>
分销商
</div>
</template>
<script>
export default {
}
</script>
<style>
</style>

View File

@ -0,0 +1,15 @@
<template>
<div>
权限管理
</div>
</template>
<script>
export default {
}
</script>
<style>
</style>

View File

@ -0,0 +1,15 @@
<template>
<div>
市场列表
</div>
</template>
<script>
export default {
}
</script>
<style>
</style>

View File

@ -0,0 +1,15 @@
<template>
<div>
报表
</div>
</template>
<script>
export default {
}
</script>
<style>
</style>

View File

@ -0,0 +1,15 @@
<template>
<div>
店铺列表
</div>
</template>
<script>
export default {
}
</script>
<style>
</style>

View File

@ -133,12 +133,25 @@ export default {
{
title: "银行卡号",
align: "center",
field: "cardId",
field: "cardNo",
},
{
title: "账户类型",
align: "center",
field: "bankAcctType",
type: "jsx",
render: ({ row }) => {
if (row.bankAcctType == 2) {
return <span>对私</span>;
} else {
return <span>对公</span>;
}
},
},
{
title: "手机号",
align: "center",
field: "telNo",
field: "legalMp",
},
{
title: "企业名称",
@ -160,13 +173,65 @@ export default {
}
},
},
{
title: "默认银行卡",
align: "center",
field: "status",
type: "jsx",
render: ({ row }) => {
let defaultBank = () => {
if (row.default) {
this.$confirm("此操作将永久删除该文件, 是否继续?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
})
.then(() => {
this.$api.mer_admin
.defaultBank({
linkId: row.linkId,
bankId: row.id,
})
.then((res) => {
this.$refs.oTable.reload();
})
.catch((err) => {
this.$refs.oTable.reload();
});
})
.catch(() => {
this.$refs.oTable.reload();
});
}
};
return (
<el-switch
onchange={defaultBank}
disabled={row.default}
v-model={row.default}
active-text="是"
inactive-text="否"
></el-switch>
);
},
},
{
title: "创建时间",
align: "center",
field: "createTime",
},
{
title: "操作",
fixed: "right",
type: "jsx",
align: "center",
width: "140px",
width: "160px",
render: (row) => {
let deleteBank = () => {
this.$api.mer_admin.bankCardDelete(row.row.id).then((res) => {
this.$refs.oTable.reload();
});
};
let edit = () => {
this.$refs.viewDetails.toggle(row).update();
};
@ -175,6 +240,13 @@ export default {
<el-button size="mini" type="primary" onClick={edit}>
详情
</el-button>
<span style={"margin-left:10px"}>
<el-popconfirm onConfirm={deleteBank} title="确定删除吗?">
<el-button size="mini" type="danger" slot="reference">
删除
</el-button>
</el-popconfirm>
</span>
</div>
);
},

View File

@ -8,8 +8,8 @@
:modalHandles="modalHandles"
>
<template slot="dialog__content">
<el-form :model="modalData" ref="modalForm">
<el-row v-show="process == 1 && modalData.bankAcctType == 1">
<el-form :rules="rules" :model="modalData" ref="modalForm">
<el-row v-if="process == 1 && modalData.bankAcctType == 1">
<el-row>
<el-col :span="12">
<el-form-item
@ -54,31 +54,19 @@
<el-col :span="12">
<el-form-item
label-width="150px"
label="银行类型"
prop="bankType"
label="银行卡号"
prop="cardNo"
>
<el-select
<el-input
style="width: 300px"
v-model="modalData.bankType"
placeholder="请选择"
v-model="modalData.cardNo"
placeholder="请输入银行卡号"
>
<el-option
v-for="item in [
{ label: '摊主银行卡', value: 1 },
{ label: '代理银行卡', value: 2 },
{ label: '专员银行卡', value: 3 },
{ label: '分销银行卡', value: 4 },
{ label: '用户银行卡', value: 5 },
]"
:label="item.label"
:value="item.value"
:key="item.value"
></el-option>
</el-select>
</el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label-width="150px" label="企业名称" prop="cas">
<el-form-item label-width="150px" label="企业名称" prop="name">
<el-input
style="width: 300px"
v-model="modalData.name"
@ -93,7 +81,6 @@
<el-form-item label-width="150px" label="省份:" prop="prov">
<el-select
style="width: 300px"
@change="handleChange"
v-model="modalData.prov"
placeholder="请选择"
>
@ -105,22 +92,10 @@
>
</el-option>
</el-select>
<!-- <el-cascader
v-model="productPlace"
style="width: 300px"
:options="this.$api.mer_admin.getCityOptions()"
@change="handleChange"
clearable
:props="{
value: 'name',
label: 'name',
children: 'children',
}"
></el-cascader> -->
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label-width="150px" label="地级市:" prop="cas">
<el-form-item label-width="150px" label="地级市:" prop="area">
<el-input
style="width: 300px"
v-model="modalData.area"
@ -135,7 +110,7 @@
<el-form-item
label-width="150px"
label="社会信用码:"
prop="prov"
prop="socialCreditCode"
>
<el-input
style="width: 300px"
@ -258,19 +233,38 @@
<el-col :span="12">
<el-form-item
label-width="150px"
label="银行代码"
label="银行"
prop="bankCode"
:validate-on-rule-change="false"
>
<el-input
<el-select
style="width: 300px"
v-model="modalData.bankCode"
placeholder="请输入银行代码"
placeholder="请输入银行卡类型"
>
</el-input>
<el-option
v-for="item in bankOptions"
:label="item.label"
:value="item.value"
:key="item.value"
></el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item
label-width="150px"
label="营业执照号:"
prop="licenseNumber"
>
<el-input
style="width: 300px"
v-model="modalData.licenseNumber"
placeholder="请输入营业执照号"
>
</el-input>
</el-form-item>
<!-- <el-form-item
label-width="150px"
label="银行卡号:"
prop="cardNo"
@ -281,10 +275,10 @@
placeholder="请输入银行卡号"
>
</el-input>
</el-form-item>
</el-form-item> -->
</el-col>
</el-row>
<el-row>
<!-- <el-row>
<el-col :span="24">
<el-form-item
label-width="150px"
@ -299,9 +293,9 @@
</el-input>
</el-form-item>
</el-col>
</el-row>
</el-row> -->
</el-row>
<el-row v-show="process == 2 && modalData.bankAcctType == 1">
<el-row v-if="process == 2 && modalData.bankAcctType == 1">
<el-row>
<el-col :span="12">
<el-form-item
@ -325,7 +319,7 @@
<el-form-item
label-width="150px"
label="法人身份证正面国徽:"
prop="bankAcctType"
prop="idCardFront"
>
<el-upload
class="upload-demo"
@ -345,7 +339,7 @@
<el-form-item
label-width="150px"
label="法人身份证背面人像:"
prop="licensePicture"
prop="idCardBack"
>
<el-upload
class="upload-demo"
@ -363,7 +357,7 @@
<el-form-item
label-width="150px"
label="开户银行许可证照:"
prop="bankAcctType"
prop="bankLicense"
>
<el-upload
class="upload-demo"
@ -383,7 +377,6 @@
<el-form-item
label-width="150px"
label="手持身份证正面国徽(选传)"
prop="licensePicture"
>
<el-upload
class="upload-demo"
@ -401,7 +394,6 @@
<el-form-item
label-width="150px"
label="手持身份证背面人像(选传)"
prop="bankAcctType"
>
<el-upload
class="upload-demo"
@ -417,7 +409,7 @@
</el-col>
</el-row>
</el-row>
<el-row v-show="modalData.bankAcctType == 2">
<el-row v-if="modalData.bankAcctType == 2">
<el-row>
<el-col :span="12">
<el-form-item
@ -461,6 +453,18 @@
<el-row>
<el-col :span="12">
<el-form-item
label-width="150px"
label="银行卡号:"
prop="cardId"
>
<el-input
style="width: 300px"
v-model="modalData.cardId"
placeholder="请输入银行卡号"
>
</el-input>
</el-form-item>
<!-- <el-form-item
label-width="150px"
label="银行类型:"
prop="bankType"
@ -483,7 +487,7 @@
:key="item.value"
></el-option>
</el-select>
</el-form-item>
</el-form-item> -->
</el-col>
<el-col :span="12">
<el-form-item
@ -512,7 +516,7 @@
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item
<!-- <el-form-item
label-width="150px"
label="银行卡号:"
prop="cardId"
@ -523,16 +527,12 @@
placeholder="请输入银行卡号"
>
</el-input>
</el-form-item>
</el-form-item> -->
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item
label-width="150px"
label="法人身份证正面国徽:"
prop="bankAcctType"
>
<el-form-item label-width="150px" label="法人身份证正面国徽:">
<el-upload
class="upload-demo"
:action="this.$api.mer_admin.uploadFile()"
@ -546,11 +546,7 @@
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item
label-width="150px"
label="法人身份证背面人像:"
prop="licensePicture"
>
<el-form-item label-width="150px" label="法人身份证背面人像:">
<el-upload
class="upload-demo"
:action="this.$api.mer_admin.uploadFile()"
@ -590,8 +586,225 @@ export default {
productPlace: "", //
fileList: [],
process: 1,
bankOptions: [
{ label: "工商银行", value: "01020000" },
{ label: "农业银行", value: "01030000" },
{ label: "中国银行", value: "01040000" },
{ label: "建设银行", value: "01050000" },
{ label: "交通银行", value: "03010000" },
{ label: "平安银行", value: "03134402" },
{ label: "中信银行", value: "03020000" },
{ label: "光大银行", value: "03030000" },
{ label: "华夏银行", value: "03040000" },
{ label: "民生银行", value: "03050000" },
{ label: "广发银行", value: "03060000" },
{ label: "招商银行", value: "03080000" },
{ label: "兴业银行", value: "03090000" },
{ label: "浦发银行", value: "03100000" },
{ label: "北京银行", value: "03130011" },
{ label: "天津银行", value: "03130012" },
{ label: "上海银行", value: "03130031" },
{ label: "江苏银行", value: "03130032" },
{ label: "重庆银行", value: "03130050" },
{ label: "大连银行", value: "03132102" },
{ label: "哈尔滨银行", value: "03132301" },
{ label: "南京银行", value: "03133201" },
{ label: "杭州银行", value: "03133301" },
{ label: "宁波银行", value: "03133302" },
{ label: "温州银行", value: "03133308" },
{ label: "恒丰银行", value: "03150000" },
{ label: "浙商银行", value: "03160000" },
],
rules: {
cardName: [
{ required: true, message: "请输入银行卡对应户名", trigger: "blur" },
],
//
cardNo: [
{ required: true, message: "请输入银行卡号", trigger: "blur" },
{
validator: function (rule, value, callback) {
const strBin =
"10,18,30,35,37,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,58,60,62,65,68,69,84,87,88,94,95,98,99";
if (!value) {
return callback(new Error("请输入银行卡号"));
} else if (!Number.isInteger(+value)) {
callback(new Error("银行卡号必须全为数字"));
} else if (value.trim().length < 12 || value.trim().length > 19) {
callback(new Error("银行卡号长度必须在12到19之间"));
} else if (strBin.indexOf(value.substring(0, 2)) === -1) {
callback(new Error("银行卡号开头6位不符合规范"));
} else {
callback();
}
},
trigger: "blur",
},
],
//
cardId: [
{ required: true, message: "请输入银行卡号", trigger: "blur" },
{
validator: function (rule, value, callback) {
const strBin =
"10,18,30,35,37,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,58,60,62,65,68,69,84,87,88,94,95,98,99";
if (!value) {
return callback(new Error("请输入银行卡号"));
} else if (!Number.isInteger(+value)) {
callback(new Error("银行卡号必须全为数字"));
} else if (value.trim().length < 12 || value.trim().length > 19) {
callback(new Error("银行卡号长度必须在12到19之间"));
} else if (strBin.indexOf(value.substring(0, 2)) === -1) {
callback(new Error("银行卡号开头6位不符合规范"));
} else {
callback();
}
},
trigger: "blur",
},
],
certId: [
{ required: true, message: "请输入身份证号", trigger: "blur" },
{
validator: function (rule, value, callback) {
const pattern =
/^\d{6}((((((19|20)\d{2})(0[13-9]|1[012])(0[1-9]|[12]\d|30))|(((19|20)\d{2})(0[13578]|1[02])31)|((19|20)\d{2})02(0[1-9]|1\d|2[0-8])|((((19|20)([13579][26]|[2468][048]|0[48]))|(2000))0229))\d{3})|((((\d{2})(0[13-9]|1[012])(0[1-9]|[12]\d|30))|((\d{2})(0[13578]|1[02])31)|((\d{2})02(0[1-9]|1\d|2[0-8]))|(([13579][26]|[2468][048]|0[048])0229))\d{2}))(\d|X|x)$/;
if (pattern.test(value)) {
callback();
} else {
callback(new Error("身份证格式错误"));
}
},
trigger: "blur",
},
],
telNo: [
{
required: true,
message: "请输入手机号",
trigger: "blur",
},
{
validator: function (rule, value, callback) {
if (/^1[3456789]\d{9}$/.test(value) == false) {
callback(new Error("请输入正确的手机号"));
} else {
callback();
}
},
trigger: "blur",
},
],
socialCreditCode: [
{
required: true,
message: "请输入统一社会信用码",
trigger: ["blur", "change"],
},
],
socialCreditCodeExpires: [
{
required: true,
message: "请输入统一社会信用码有效期",
trigger: ["blur", "change"],
},
],
name: [{ required: true, message: "请输入企业名称", trigger: "blur" }],
prov: [
{
required: true,
message: "请选择省份",
trigger: ["blur", "change"],
},
],
area: [{ required: true, message: "请输入地级市", trigger: "blur" }],
businessScope: [
{ required: true, message: "请输入经营范围", trigger: "blur" },
],
legalPerson: [
{ required: true, message: "请输入法人姓名", trigger: "blur" },
],
legalCertId: [
{ required: true, message: "请输入法人身份证号", trigger: "blur" },
{
validator: function (rule, value, callback) {
const pattern =
/^\d{6}((((((19|20)\d{2})(0[13-9]|1[012])(0[1-9]|[12]\d|30))|(((19|20)\d{2})(0[13578]|1[02])31)|((19|20)\d{2})02(0[1-9]|1\d|2[0-8])|((((19|20)([13579][26]|[2468][048]|0[48]))|(2000))0229))\d{3})|((((\d{2})(0[13-9]|1[012])(0[1-9]|[12]\d|30))|((\d{2})(0[13578]|1[02])31)|((\d{2})02(0[1-9]|1\d|2[0-8]))|(([13579][26]|[2468][048]|0[048])0229))\d{2}))(\d|X|x)$/;
if (pattern.test(value)) {
callback();
} else {
callback(new Error("身份证格式错误"));
}
},
trigger: "blur",
},
],
legalCertIdExpires: [
{
required: true,
message: "请输入法人身份证有效期",
trigger: "change",
},
],
legalMp: [
{
required: true,
message: "请输入法人手机号",
trigger: "blur",
},
{
validator: function (rule, value, callback) {
if (/^1[3456789]\d{9}$/.test(value) == false) {
callback(new Error("请输入正确的手机号"));
} else {
callback();
}
},
trigger: "blur",
},
],
address: [
{ required: true, message: "请输入详细企业地址", trigger: "blur" },
],
bankCode: [
{
required: true,
message: "请输入银行名称",
trigger: "change",
},
],
licenseNumber: [
{ required: true, message: "请输入营业执照号", trigger: "blur" },
],
licensePicture: [
{ required: true, message: "请输入营业执照", trigger: "blur" },
],
bankLicense: [
{
required: true,
message: "请上传开户银行许可证照",
trigger: "blur",
},
],
idCardFront: [
{ required: true, message: "请上传身份证正面", trigger: "blur" },
],
idCardBack: [
{ required: true, message: "请上传身份证反面", trigger: "blur" },
],
},
};
},
watch: {
"modalConfig.show"(newVal) {
if (!newVal) {
//
setTimeout(() => {
this.$refs.modalForm?.resetFields();
});
}
},
},
methods: {
queryTableData(pageNo, pageSize) {},
toggle(e) {
@ -614,7 +827,6 @@ export default {
linkId: JSON.parse(sessionStorage.getItem("userInfo")).managerId
? JSON.parse(sessionStorage.getItem("userInfo")).managerId
: JSON.parse(sessionStorage.getItem("userInfo")).merchantId,
bankType: "",
name: "",
prov: "",
area: "",
@ -638,7 +850,7 @@ export default {
bankAcctType: 1,
licenseNumber: "",
};
this.$refs.modal.resetFields();
this.$refs.modalForm?.resetFields();
});
this.isAdd = true;
},
@ -648,24 +860,25 @@ export default {
};
},
init(row) {},
handleChange(e) {
this.modalData.prov = e.join("-");
},
handleAvatarSuccess(res) {
console.log(res);
this.modalData.licensePicture = res.data;
this.$refs.modalForm.validate();
},
idCardFrontImg(res) {
console.log(res);
this.modalData.idCardFront = res.data;
this.$refs.modalForm.validate();
},
idCardBackImg(res) {
console.log(res);
this.modalData.idCardBack = res.data;
this.$refs.modalForm.validate();
},
bankLicenseImg(res) {
console.log(res);
this.modalData.bankLicense = res.data;
this.$refs.modalForm.validate();
},
handIdCardFrontImg(res) {
console.log(res);
@ -681,7 +894,6 @@ export default {
linkId: JSON.parse(sessionStorage.getItem("userInfo")).managerId
? JSON.parse(sessionStorage.getItem("userInfo")).managerId
: JSON.parse(sessionStorage.getItem("userInfo")).merchantId,
bankType: "",
name: "",
prov: "",
area: "",
@ -711,7 +923,6 @@ export default {
linkId: JSON.parse(sessionStorage.getItem("userInfo")).managerId
? JSON.parse(sessionStorage.getItem("userInfo")).managerId
: JSON.parse(sessionStorage.getItem("userInfo")).merchantId,
bankType: "",
cardId: "",
cardName: "",
certId: "",
@ -720,6 +931,7 @@ export default {
idCardBack: "",
bankAcctType: 2,
};
this.$refs.modalForm?.resetFields();
}
},
},
@ -746,16 +958,24 @@ export default {
label: this.process == 1 ? "下一步" : "确认添加",
type: "primary",
handle: () => {
if (this.process == 1) {
this.process = 2;
} else {
console.log(this.modalData);
this.$api.mer_admin.bankCardAdd(this.modalData).then((res) => {
console.log(res);
this.$emit("queryList");
this.toggle();
});
}
console.log(this.modalData);
this.$refs.modalForm.validate((valid) => {
if (valid) {
if (this.process == 1) {
this.process = 2;
} else {
console.log(this.modalData);
this.$api.mer_admin
.publicAccountBankCardAdd(this.modalData)
.then((res) => {
console.log(res);
this.$emit("queryList");
this.toggle();
});
}
}
});
},
},
];
@ -772,10 +992,16 @@ export default {
type: "primary",
handle: () => {
console.log(this.modalData);
this.$api.mer_admin.bankCardAdd(this.modalData).then((res) => {
console.log(res);
this.$emit("queryList");
this.toggle();
this.$refs.modalForm.validate((valid) => {
if (valid) {
this.$api.mer_admin
.bankCardAdd(this.modalData)
.then((res) => {
console.log(res);
this.$emit("queryList");
this.toggle();
});
}
});
},
},

View File

@ -35,7 +35,7 @@
</div>
</div>
<div class="info-item">
品牌首页: {{ list.homepageStatus == 0 ? "禁用" : "启用" }}
品牌首页: {{ list.homepageStatus == 1 ? "启用" : "禁用" }}
</div>
<div class="info-item">宣传语: {{ list.tagline }}</div>
<div class="info-item" style="display: flex">
@ -46,7 +46,6 @@
width="200px"
height="100px"
object-fit="fill"
autoplay="true"
muted="muted"
loop
controls
@ -62,8 +61,8 @@
</div>
<div class="info-content">
<div class="info-item">
管理员账号{{ list.administrator.substr(0, 3) }}****{{
list.administrator.substr(7)
管理员账号{{ list.administrator?.substr(0, 3) }}****{{
list.administrator?.substr(7)
}}
<span @click="passwordUpdate(true)" class="brandInfo-update">修改</span>
</div>
@ -89,20 +88,23 @@
<div class="info-content">
<div class="info-item">
品牌分销推广:
<span @click="infoUpdate" class="brandInfo-update">配置</span>
<span @click="getConfig" class="brandInfo-update">配置</span>
</div>
</div>
<!-- 编辑品牌信息 -->
<addOrUpdate ref="addOrUpdate"></addOrUpdate>
<addOrUpdate @getList="getList" ref="addOrUpdate"></addOrUpdate>
<!-- 修改密码 -->
<changePassword ref="changePassword"></changePassword>
<!-- 配置 -->
<toConfigure @getList="getList" ref="toConfigure"></toConfigure>
</div>
</template>
<script>
import toConfigure from "./popup/to-configure.vue";
import changePassword from "./popup/change-password.vue";
import addOrUpdate from "./popup/add-or-update.vue";
export default {
components: { addOrUpdate, changePassword },
components: { addOrUpdate, changePassword, toConfigure },
data() {
return {
list: [],
@ -125,16 +127,12 @@ export default {
console.log("123");
},
passwordUpdate(state) {
console.log("123");
if (state) {
this.$nextTick(() => {
this.$refs.changePassword.toggle().add();
});
} else {
this.$nextTick(() => {
this.$refs.changePassword.toggle().update();
});
}
this.$refs.changePassword.init(state);
},
getConfig() {
this.$nextTick(() => {
this.$refs.toConfigure.init(this.list);
});
},
},
};

View File

@ -49,7 +49,11 @@ export default {
});
this.isAdd = true;
},
update: () => {
update: (row) => {
this.fileList = []
this.modalData = JSON.parse(JSON.stringify(row));
console.log(row);
this.isAdd = false;
},
};
@ -61,74 +65,85 @@ export default {
return [
{
label: "品牌名称",
prop: "discount",
prop: "name",
type: "Input",
width: "300px",
rules: { required: true, message: "请输入品牌名称" },
},
{
label: "品牌ID",
prop: "limitCount",
prop: "id",
type: "Input",
disabled: true,
width: "300px",
rules: { required: true, message: "请输入品牌ID" },
},
{
label: "品牌LOGO",
prop: "DiscountTi",
prop: "logo",
type: "Input",
width: "300px",
rules: { required: true, message: "请上传品牌LOGO" },
type: "jsx",
render: () => {
const handleChange = (file, fileList) => {
// console.log(fileList);
};
const handleAvatarSuccess = (res, file, fileList) => {
this.modalData.logo = res.data;
console.log(res, fileList);
};
const handleRemove = (file, fileList) => {
console.log(file, fileList);
};
return (
<el-upload
class="upload-demo"
action={this.$api.mer_admin.uploadFile()}
{...{
props: {
"on-change": handleChange,
"on-success": handleAvatarSuccess,
"on-remove": handleRemove,
},
}}
headers={{
token: "Bearer " + this.$cookie.get("token"),
}}
multiple={true}
file-list={this.fileList}
list-type="picture"
>
<el-button size="small" type="primary">
<i class="el-icon-upload"></i>点击上传
</el-button>
<div class="el-upload__tip" slot="tip">
只能上传jpg/png文件且不超过500kb
<div style="display: flex;">
<el-upload
class="upload-demo"
action={this.$api.mer_admin.uploadFile()}
{...{
props: {
"on-change": handleChange,
"on-success": handleAvatarSuccess,
"on-remove": handleRemove,
},
}}
headers={{
token: "Bearer " + this.$cookie.get("token"),
}}
multiple={true}
file-list={this.fileList}
// list-type="picture"
>
<el-button size="small" type="primary">
<i class="el-icon-upload"></i>点击上传
</el-button>
<div class="el-upload__tip" slot="tip">
只能上传jpg/png文件且不超过500kb
</div>
</el-upload>
<div style="margin-left:20px">
<el-image
style="width: 100px; height: 100px"
src={this.modalData.logo}
preview-src-list={[this.modalData.logo]}
></el-image>
</div>
</el-upload>
</div>
);
},
},
{
label: "品牌首页:",
prop: "limitCoun",
prop: "status",
type: "Input",
width: "300px",
rules: { required: true, message: "请输入品牌ID" },
type: "jsx",
render: () => {
return (
<el-switch
v-model={this.value1}
active-value="1"
inactive-value="0"
v-model={this.modalData.homepageStatus}
active-text="开启"
inactive-text="禁用"
></el-switch>
@ -137,104 +152,126 @@ export default {
},
{
label: "宣传语",
prop: "limitCot",
prop: "tagline",
type: "Input",
width: "300px",
rules: { required: true, message: "请输入宣传语" },
},
{
label: "首页背景",
prop: "DiscountTime",
prop: "background",
type: "Input",
width: "300px",
rules: { required: true, message: "请上传背景图" },
type: "jsx",
render: () => {
const handleChange = (file, fileList) => {
// console.log(fileList);
};
const handleAvatarSuccess = (res, file, fileList) => {
console.log(res, fileList);
this.modalData.background = res.data;
};
const handleRemove = (file, fileList) => {
console.log(file, fileList);
};
return (
<el-upload
class="upload-demo"
action={this.$api.mer_admin.uploadFile()}
{...{
props: {
"on-change": handleChange,
"on-success": handleAvatarSuccess,
"on-remove": handleRemove,
},
}}
headers={{
token: "Bearer " + this.$cookie.get("token"),
}}
multiple={true}
file-list={this.fileList}
list-type="picture"
>
<el-button size="small" type="primary">
<i class="el-icon-upload"></i>点击上传
</el-button>
<div class="el-upload__tip" slot="tip">
只能上传jpg/png文件且不超过500kb
<div style="display: flex;">
<el-upload
class="upload-demo"
action={this.$api.mer_admin.uploadFile()}
{...{
props: {
"on-change": handleChange,
"on-success": handleAvatarSuccess,
"on-remove": handleRemove,
},
}}
headers={{
token: "Bearer " + this.$cookie.get("token"),
}}
multiple={true}
file-list={this.fileList}
// list-type="picture"
>
<el-button size="small" type="primary">
<i class="el-icon-upload"></i>点击上传
</el-button>
<div class="el-upload__tip" slot="tip">
只能上传jpg/png文件且不超过500kb
</div>
</el-upload>
<div style="margin-left:20px">
<el-image
style="width: 100px; height: 100px"
src={this.modalData.background}
preview-src-list={[this.modalData.background]}
></el-image>
</div>
</el-upload>
</div>
);
},
},
{
label: "视频",
prop: "DiscountTim",
prop: "video",
type: "Input",
width: "300px",
rules: { required: true, message: "请上传视频" },
type: "jsx",
render: () => {
const handleChange = (file, fileList) => {
// console.log(fileList);
};
const handleAvatarSuccess = (res, file, fileList) => {
this.modalData.video = res.data;
console.log(res, fileList);
};
const handleRemove = (file, fileList) => {
console.log(file, fileList);
};
return (
<el-upload
class="upload-demo"
action={this.$api.mer_admin.uploadFile()}
{...{
props: {
"on-change": handleChange,
"on-success": handleAvatarSuccess,
"on-remove": handleRemove,
},
}}
headers={{
token: "Bearer " + this.$cookie.get("token"),
}}
multiple={true}
file-list={this.fileList}
list-type="picture"
>
<el-button size="small" type="primary">
<i class="el-icon-upload"></i>点击上传
</el-button>
<div class="el-upload__tip" slot="tip">
只能上传jpg/png文件且不超过500kb
<div style="display: flex;">
<el-upload
class="upload-demo"
action={this.$api.mer_admin.uploadFile()}
{...{
props: {
"on-change": handleChange,
"on-success": handleAvatarSuccess,
"on-remove": handleRemove,
},
}}
headers={{
token: "Bearer " + this.$cookie.get("token"),
}}
multiple={true}
file-list={this.fileList}
// list-type="picture"
>
<el-button size="small" type="primary">
<i class="el-icon-upload"></i>点击上传
</el-button>
<div class="el-upload__tip" slot="tip">
只能上传jpg/png文件且不超过500kb
</div>
</el-upload>
<div style="margin-left:20px">
<video
id="videoPlayer"
width="200px"
height="100px"
object-fit="fill"
muted="muted"
loop
controls
>
<source src={this.modalData.video} type="video/mp4" />
</video>
</div>
</el-upload>
</div>
);
},
},
{
label: "联系电话(仅用户可见)",
prop: "limit",
prop: "contactPhone",
type: "Input",
width: "300px",
rules: { required: true, message: "请输入联系电话" },
@ -254,7 +291,19 @@ export default {
type: "primary",
loading: this.isLoading,
submit: true,
handle: () => {},
handle: () => {
console.log(this.modalData);
this.$api.mer_admin
.editBrandInfo(this.modalData)
.then((res) => {
console.log(res);
this.toggle();
this.$emit("getList");
})
.catch((err) => {
console.log(err);
});
},
},
];
},

View File

@ -1,141 +1,266 @@
<template>
<div>
<obj-modal
ref="modal"
labelWidth="150px"
:modalCols="modalCols"
:modalConfig="modalConfig"
:modalData="modalData"
:modalHandles="modalHandles"
>
</obj-modal>
</div>
<el-dialog
:title="isAdd ? '修改管理员账号' : '修改密码'"
:visible.sync="dialogFormVisible"
>
<el-form v-if="isAdd" ref="ruleForm" :model="form" :rules="rules">
<el-form-item
label="密码:"
prop="password"
:label-width="formLabelWidth"
>
<el-input
style="width: 240px"
type="password"
placeholder="请输入密码"
v-model="form.password"
autocomplete="off"
></el-input>
</el-form-item>
<el-form-item
label="管理员账号"
:label-width="formLabelWidth"
prop="mobile"
>
<el-input
placeholder="请输入账号"
style="width: 240px; margin-right: 20px"
v-model="form.mobile"
></el-input
><el-button @click="getCode" v-if="this.isCode" type="primary"
>获取验证码</el-button
>
<el-button v-else :disabled="totalTime < 60" type="primary">{{
this.content
}}</el-button>
</el-form-item>
<el-form-item prop="code" label="验证码:" :label-width="formLabelWidth">
<el-input
style="width: 240px"
placeholder="请输入验证码"
v-model="form.code"
></el-input>
</el-form-item>
</el-form>
<el-form v-else ref="ruleForm" :model="form" :rules="rules">
<el-form-item
label="旧密码:"
prop="oldPassword"
:label-width="formLabelWidth"
>
<el-input
style="width: 240px"
type="password"
placeholder="请输入密码"
v-model="form.oldPassword"
autocomplete="off"
></el-input>
</el-form-item>
<el-form-item
label="新密码"
:label-width="formLabelWidth"
prop="newPassword"
>
<el-input
placeholder="请输入新密码"
style="width: 240px; margin-right: 20px"
v-model="form.newPassword"
show-password
></el-input>
</el-form-item>
<el-form-item
prop="isPassword"
label="确认新密码:"
:label-width="formLabelWidth"
>
<el-input
style="width: 240px"
placeholder="请再次输入新密码"
v-model="form.isPassword"
show-password
></el-input>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button @click="dialogFormVisible = false"> </el-button>
<el-button type="primary" @click="determine"> </el-button>
</div>
</el-dialog>
</template>
<script>
import { debounce, cloneDeep } from "lodash";
import { Divider } from "element-ui";
export default {
components: {},
data() {
return {
dialogFormVisible: false,
isAdd: true,
//
modalConfig: {
title: "修改密码",
show: false,
width: "60%",
},
modalData: {},
value1: "",
ProductData: {},
fileList: [],
isAdd: "",
};
},
methods: {
queryTableData(pageNo, pageSize) {},
toggle(e) {
if (this.modalConfig.show == false) {
this.modalConfig.show = true;
} else {
this.modalConfig.show = false;
}
if (e) {
this.init(cloneDeep(e));
}
return {
add: () => {
this.$nextTick(() => {
this.modalData = {};
});
this.isAdd = true;
},
update: () => {
this.isAdd = false;
},
};
},
init(row) {},
},
computed: {
modalCols() {
if (this.isAdd) {
return [
formLabelWidth: "120px",
form: {},
totalTime: 60,
content: "获取验证码",
isCode: true,
rules: {
password: [{ required: true, message: "请输入密码", trigger: "blur" }],
mobile: [
{
label: "密码",
prop: "discount",
type: "Input",
width: "300px",
rules: { required: true, message: "请输入旧密码" },
required: true,
message: "请输入手机号",
trigger: "blur",
},
{
label: "管理员账号",
prop: "discoun",
type: "Input",
width: "300px",
rules: { required: true, message: "请输入管理员账号" },
type: "jsx",
render: () => {
return (
<div>
<div>
<el-input style="width:200px;margin-right:20px;margin-bottom:20px" placeholder="请输入管理员账号"></el-input>
<el-button type="primary">获取验证码</el-button>
</div>
<div>
<el-input style="width:300px" placeholder="请输入验证码"></el-input>
</div>
</div>
);
validator: function (rule, value, callback) {
if (/^1[3456789]\d{9}$/.test(value) == false) {
callback(new Error("请输入正确的手机号"));
} else {
callback();
}
},
trigger: "blur",
},
],
code: [
{
required: true,
min: 6,
max: 6,
message: "请输入正确的验证码",
trigger: "blur",
},
],
oldPassword: [
{ required: true, message: "请输入密码", trigger: "blur" },
],
newPassword: [
{
required: true,
message: "请输入密码",
trigger: "blur",
},
{
min: 8,
max: 12,
message:
"密码由8-12位字母、数字、特殊符号~、@、#、$、%、*)的组成,请重新输入",
trigger: "blur",
},
{
trigger: "blur",
validator: (rule, value, callback) => {
var passwordreg =
/(?=.*\d)(?=.*[a-zA-Z])(?=.*[^a-zA-Z0-9]).{8,12}/;
if (!passwordreg.test(value)) {
callback(
new Error(
"密码由8-12位字母、数字、特殊符号~、@、#、$、%、*)的组成,请重新输入"
)
);
} else {
callback();
}
},
},
];
} else {
return [
],
isPassword: [
{
label: "旧密码",
prop: "discount",
type: "Input",
width: "300px",
rules: { required: true, message: "请输入旧密码" },
required: true,
message: "请输入确认密码",
trigger: "blur",
},
{
label: "新密码",
prop: "limitCount",
type: "Input",
width: "300px",
rules: { required: true, message: "请输入新密码" },
trigger: "blur",
validator: (rule, value, callback) => {
if (value != this.form.newPassword) {
callback(new Error("密码输入不一致"));
} else {
callback();
}
},
},
{
label: "确认新密码",
prop: "limitCot",
type: "Input",
width: "300px",
rules: { required: true, message: "请输入新密码" },
},
];
],
},
};
},
watch: {
dialogFormVisible(newVal, oldVal) {
if (!newVal) {
this.$refs.ruleForm.resetFields();
}
},
modalHandles() {
return [
{
label: "取消",
handle: () => {
this.toggle();
},
},
{
label: this.isAdd ? "保存" : "确认",
type: "primary",
loading: this.isLoading,
submit: true,
handle: () => {},
},
];
},
methods: {
init(row) {
if (row) {
this.isAdd = true;
this.form = {
mobile: "",
code: "",
password: "",
};
} else {
this.isAdd = false;
console.log(row);
}
this.dialogFormVisible = true;
},
getCode() {
console.log("发送验证码");
if (this.form.mobile && this.form.mobile.length == 11) {
this.$api.mer_admin
.getCaptcha({
mobile: this.form.mobile,
password: this.form.password,
})
.then((res) => {
console.log(res);
});
this.isCode = false;
this.countDown();
} else {
this.$message.error("请输入正确的手机号");
}
},
countDown() {
console.log("123");
if (this.totalTime == 0) {
this.content = "获取验证码";
this.totalTime = 60;
this.isCode = true;
return;
}
this.content = this.totalTime + "秒后重新获取";
this.totalTime--;
setTimeout(this.countDown, 1000);
},
determine() {
if (this.isAdd) {
this.$refs.ruleForm.validate((valid) => {
console.log(valid);
if (valid) {
this.$api.mer_admin.editAdmin(this.form).then((res) => {
console.log(res);
});
}
});
} else {
this.$refs.ruleForm.validate((valid) => {
console.log(valid);
if (valid) {
this.$api.mer_admin
.changePassword({
oldPassword: this.form.oldPassword,
newPassword: this.form.newPassword,
})
.then((res) => {
this.$message.success("修改成功");
this.dialogFormVisible = false;
});
}
});
}
},
},
asyncComputed: {},
};
</script>
<style lang="scss" scoped>
</style>

View File

@ -1,13 +1,158 @@
<template>
<div>配置</div>
<el-dialog title="品牌分销推广" :visible.sync="dialogFormVisible">
<el-form ref="ruleForm" :model="form" :rules="rules">
<div class="brandInfo">
<span class="pattern"></span>
推广营销工具
</div>
<div style="font-size: 14px; margin-bottom: 20px">
<i
class="el-icon-warning-outline"
style="width: 1em; height: 1em; margin-right: 4px"
></i>
分销推广功能开启后平台的分销商有机会优先选择本品牌进行推广推广成功分销商可获得佣金品牌方可根据实际情况对推广本品牌的分销商佣金比例进行调整品牌分销和商铺分销不叠加同享且优先按品牌分销佣金比例进行分销商分佣
</div>
<el-form-item label="状态:" :label-width="formLabelWidth">
<el-switch
:active-value="1"
:inactive-value="0"
v-model="form.status"
active-text="开启"
inactive-text="禁用"
></el-switch>
<div style="font-size: 14px">
请勿频繁切换已产生的关系&订单不受影响
</div>
</el-form-item>
<div class="brandInfo">
<span class="pattern"></span>
推广佣金配置
</div>
<div style="font-size: 14px; margin-bottom: 20px">
<i
class="el-icon-warning-outline"
style="width: 1em; height: 1em; margin-right: 4px"
></i>
配置推广成功分销商可获得的订单佣金奖励比例订单实付金额品牌分销订单无上级分佣
</div>
<el-form-item
label="订单佣金比例 (单位:%)"
:label-width="formLabelWidth"
prop="sharingRatio"
>
<el-select
:disabled="form.status != 1"
v-model="form.sharingRatio"
filterable
placeholder="请选择"
style="width: 240px"
>
<el-option
v-for="item in proportion"
:key="item"
:label="item"
:value="item"
/>
</el-select>
</el-form-item>
<div class="brandInfo">
<span class="pattern"></span>
品牌分销商招募令配置
</div>
<div style="font-size: 14px; margin-bottom: 20px">
<i
class="el-icon-warning-outline"
style="width: 1em; height: 1em; margin-right: 4px"
></i>
此配置将展示在店铺页吸引用户申请分销商并为店铺进行宣传推广长度限制在100字内
</div>
<el-form-item
prop="promotionWords"
label="推广文案:"
:label-width="formLabelWidth"
>
<el-input
:disabled="form.status != 1"
style="width: 80%"
type="textarea"
:rows="5"
placeholder="请输入内容"
maxlength="100"
show-word-limit
v-model="form.promotionWords"
>
</el-input>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button @click="dialogFormVisible = false"> </el-button>
<el-button type="primary" @click="determine"> </el-button>
</div>
</el-dialog>
</template>
<script>
export default {
data() {
return {
dialogFormVisible: false,
formLabelWidth: "200px",
form: {},
proportion: [],
rules: {
sharingRatio: [
{ required: true, message: "请选择佣金比例", trigger: "change" },
],
promotionWords: [
{ required: true, message: "请输入推广文案", trigger: "blur" },
{ max: 100, message: "长度100个字符内", trigger: "blur" },
],
},
};
},
methods: {
init(row) {
this.form = JSON.parse(JSON.stringify(row));
console.log(this.form);
this.proportion = [];
for (let i = row.minSharingRate; i <= row.maxSharingRate; i++) {
this.proportion.push(i);
}
console.log(this.proportion);
}
this.dialogFormVisible = true;
},
determine() {
if (this.form.status == 0) {
this.$api.mer_admin.editBrandInfo(this.form).then((res) => {
this.dialogFormVisible = false;
this.$emit("getList");
});
} else {
this.$refs.ruleForm.validate((valid) => {
if (valid) {
this.$api.mer_admin.editBrandInfo(this.form).then((res) => {
this.dialogFormVisible = false;
this.$emit("getList");
});
}
});
}
},
},
};
</script>
<style>
<style lang="scss" scoped>
.brandInfo {
margin-bottom: 20px;
font-size: 18px;
font-weight: 700;
}
.pattern {
display: inline-block;
width: 8px;
height: 16px;
background: rgba(28, 146, 152, 1);
}
</style>

View File

@ -0,0 +1,443 @@
<template>
<div v-if="isMerchant" style="height: calc(100vh - 200px)">
<obj-table-plus
ref="oTable"
style="height: 100%"
:tableCols="tableCols"
:tableProp="tableProp"
@query="queryList"
v-model="dataList"
:tableEvent="tableEvent"
:enableAutoQuery="false"
>
<template slot="tableTop">
<el-form :inline="true" :model="formInline" class="demo-form-inline">
<el-form-item label="优惠卷名称">
<el-input
v-model="formInline.name"
placeholder="优惠卷名称搜索"
></el-input>
</el-form-item>
<el-form-item label="状态">
<el-select
v-model="formInline.queryStatus"
placeholder="请选择状态"
>
<el-option
v-for="item in [
{ label: '已失效', value: '0' },
{
label: '生效中',
value: '1',
},
{
label: '待生效',
value: '2',
},
]"
:key="item.value"
:label="item.label"
:value="item.value"
></el-option>
</el-select>
</el-form-item>
<el-form-item v-if="storeList.length > 1" label="店铺">
<el-select v-model="formInline.shopId" placeholder="请选择店铺">
<el-option
v-for="item in storeList"
:key="item.shopId"
:label="item.shopName"
:value="item.shopId"
></el-option>
</el-select>
</el-form-item>
<el-form-item>
<el-button type="primary" @click="$refs.oTable.reload()"
>查询</el-button
>
<el-button type="primary" @click="Reset">重置</el-button>
</el-form-item>
</el-form>
<div class="mb-2">
<el-popover placement="bottom" trigger="click">
<el-button
type="warning"
size="mini"
v-for="item in [
{ label: '无门槛商品优惠卷', value: '1' },
{ label: '满减卷', value: '2' },
{ label: '新粉优惠卷', value: '3' },
]"
:key="item.value"
@click="addProduct({ label: item.label })"
>{{ item.label }}
</el-button>
<el-button
size="small"
slot="reference"
type="primary"
class="link-left"
icon="el-icon-plus"
>添加优惠卷</el-button
>
</el-popover>
<el-button
style="margin-left: 20px"
:disabled="selectList.length <= 0"
type="danger"
size="small"
@click="deleteProduct"
>批量删除</el-button
>
</div>
</template>
</obj-table-plus>
<!-- 添加或编辑 -->
<add-or-update
@queryList="$refs.oTable.reload()"
ref="addOrUpdate"
></add-or-update>
<!-- 满减卷 -->
<fullReductio
@queryList="$refs.oTable.reload()"
ref="fullReductio"
></fullReductio>
<!-- 新粉优惠卷 -->
<newPowder @queryList="$refs.oTable.reload()" ref="newPowder"></newPowder>
<!-- 查看详情 -->
<!-- <viewDetails ref="viewDetails"></viewDetails> -->
</div>
</template>
<script>
import { mapState } from "vuex";
import fullReductio from "./popup/full-reduction.vue";
import AddOrUpdate from "./popup/add-or-update.vue";
import newPowder from "./popup/new-powder.vue";
// import viewDetails from "./popup/view-details.vue";
export default {
components: { AddOrUpdate, fullReductio, newPowder },
data() {
return {
dataList: [],
formInline: {
marketId: "",
shopId: "",
queryStatus: "",
name: "",
},
tableProp: {
"auto-resize": true,
border: true,
height: "auto",
"row-id": "id",
"show-overflow": false,
},
productFilterType: "SALE",
selectList: [],
};
},
created() {
this.formInline = {
name: "",
queryStatus: "",
marketId: this.marketId,
shopId: this.shopId,
};
this.$nextTick(() => {
this.$refs.oTable.reload();
});
},
methods: {
getData() {
// this.$api.mer_admin
// .storeList({ marketId: this.formInline.marketId })
// .then((res) => {
// this.storeList = res.data.data;
// this.formInline.shopId = res.data.data[0].shopId;
// this.$nextTick(() => {
// this.$refs.oTable.reload();
// });
// });
},
addProduct(row) {
console.log(row);
if (row.label == "无门槛商品优惠卷") {
this.$refs.addOrUpdate.toggle().add({
...row,
marketId: this.formInline.marketId,
shopId: this.formInline.shopId,
});
} else if (row.label == "满减卷") {
this.$refs.fullReductio.toggle().add({
...row,
marketId: this.formInline.marketId,
shopId: this.formInline.shopId,
});
} else if (row.label == "新粉优惠卷") {
this.$refs.newPowder.toggle().add({
...row,
marketId: this.formInline.marketId,
shopId: this.formInline.shopId,
});
}
},
Reset() {
this.formInline = {
name: "",
queryStatus: "",
marketId: this.marketId,
shopId: this.shopId,
};
this.$refs.oTable.reload();
},
deleteProduct() {
console.log(this.selectList);
let integers = this.selectList.map((item) => {
return item.id;
});
this.$confirm("此操作将删除该优惠卷, 是否继续?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
})
.then(() => {
console.log("111");
this.$api.coupon.deleteCoupon(integers).then((res) => {
this.$refs.oTable.reload();
this.selectList = [];
});
})
.catch(() => {
this.$message({
type: "info",
message: "已取消删除",
});
});
},
queryList(pageNo, pageSize) {
this.$api.coupon
.couponList({
pageNumber: pageNo,
pageSize: pageSize,
...this.formInline,
})
.then((res) => {
console.log(res);
this.$refs.oTable.complete(
res.data.data.data,
Number(res.data.data.total)
);
})
.catch((err) => {
this.$refs.oTable.complete(false);
});
},
},
computed: {
tableCols() {
return [
{ type: "checkbox", width: "60px", fixed: "left" },
// { type: "seq", width: "60px", align: "center", title: "" },
{
title: "优惠券名称",
align: "center",
field: "name",
},
// {
// title: "",
// align: "center",
// field: "publisher",
// type: "jsx",
// render: ({ row }) => {
// if (row.publisher === "MERCHANT") {
// return <span></span>;
// } else if (row.publisher == "PLATFORM") {
// return <span></span>;
// }
// },
// },
{
title: "类别",
align: "center",
field: "category",
type: "jsx",
render: ({ row }) => {
if (row.category == "NO_THRESHOLD") {
return <span>无门槛优惠券</span>;
} else if (row.category == "MAX_OUT") {
return <span>满减优惠券</span>;
} else if (row.category == "FIRST_ATTENTION") {
return <span>首次关注优惠券</span>;
} else if (row.category == "BIRTHDAY") {
return <span>生日券</span>;
} else if (row.category == "PLATFORM") {
return <span>平台优惠券</span>;
}
},
},
{
title: "优惠券类型",
align: "center",
field: "couponType",
type: "jsx",
render: ({ row }) => {
if (row.couponType == "MONEY") {
return <span>满减券</span>;
} else if (row.couponType == "DISCOUNT") {
return <span>折扣券</span>;
}
},
},
{
title: "优惠金额",
align: "center",
field: "money",
},
{
title: "折扣",
align: "center",
field: "discount",
},
{
title: "最低消费",
align: "center",
field: "minPrice",
},
{
title: "限量",
align: "center",
field: "limitedNum",
},
{
title: "发放总数",
align: "center",
field: "total",
},
{
title: "剩余数量",
align: "center",
field: "lastTotal",
},
{
title: "可使用时间",
align: "center",
field: "useStartTime",
type: "jsx",
render: ({ row }) => {
return (
<span>
{row.useStartTime}{row.useEndTime}
</span>
);
},
},
{
title: "状态",
align: "center",
field: "status",
type: "jsx",
width: "120px",
render: ({ row }) => {
let changeState = () => {
if (row.status == 1) {
this.$confirm("是否要启用此优惠卷?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
})
.then(() => {
this.$api.coupon
.couponStatus({
id: row.id,
status: 1,
})
.then((res) => {
this.$refs.oTable.reload();
})
.catch((err) => {
this.$refs.oTable.reload();
});
})
.catch(() => {
this.$refs.oTable.reload();
});
} else {
this.$confirm("是否要关闭此优惠卷?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
})
.then(() => {
this.$api.coupon
.couponStatus({
id: row.id,
status: 0,
})
.then((res) => {
this.$refs.oTable.reload();
})
.catch((err) => {
this.$refs.oTable.reload();
});
})
.catch(() => {
this.$refs.oTable.reload();
});
}
};
return (
<el-switch
onchange={changeState}
v-model={row.status}
active-text="开"
inactive-text="关"
active-value={1}
inactive-value={0}
></el-switch>
);
},
},
{
title: "操作",
fixed: "right",
type: "jsx",
align: "center",
width: "140px",
render: (row) => {
let edit = () => {
// this.$refs.viewDetails.toggle(row).update();
};
return (
<div>
<el-button size="mini" type="primary" onClick={edit}>
详情
</el-button>
</div>
);
},
},
];
},
tableEvent() {
return {
"checkbox-all": ({ records, reserves }) => {
this.selectList = [...records, ...reserves];
},
"checkbox-change": ({ records, reserves }) => {
this.selectList = [...records, ...reserves];
},
};
},
...mapState("userData", [
"isMerchant",
"marketList",
"storeList",
"marketId",
"shopId",
]),
},
};
</script>
<style lang="scss" scoped></style>

View File

@ -0,0 +1,274 @@
<template>
<div>
<obj-modal
ref="modal"
labelWidth="150px"
:modalConfig="modalConfig"
:modalData="modalData"
:modalHandles="modalHandles"
>
<template slot="dialog__content">
<el-form :model="modalData" ref="modalForm">
<el-form-item label-width="150px" label="优惠券名称" prop="name">
<el-input
style="width: 350px"
v-model="modalData.name"
placeholder="请输入优惠券名称"
>
</el-input>
</el-form-item>
<el-form-item label-width="150px" label="使用日期" prop="name">
<el-date-picker
@change="usageDateChange"
v-model="usageDate"
value-format="yyyy-MM-dd"
type="daterange"
range-separator="至"
start-placeholder="开始日期"
end-placeholder="结束日期"
>
</el-date-picker>
</el-form-item>
<el-form-item label-width="150px" label="开放领取日期" prop="name">
<el-date-picker
@change="collectionDateChange"
v-model="collectionDate"
value-format="yyyy-MM-dd"
type="daterange"
range-separator="至"
start-placeholder="开始日期"
end-placeholder="结束日期"
>
</el-date-picker>
</el-form-item>
<el-form-item label-width="150px" label="选择商品" prop="targetIds">
<el-input
style="width: 350px"
placeholder="请选择选择商品"
v-model="modalData.targetIds"
>
<template slot="append">
<el-button @click="selectProduct">请选择</el-button>
</template>
</el-input>
<div v-if="product.name" class="product">
<div>
<el-image
style="width: 80px; height: 80px; margin-right: 10px"
:src="product.productPhotoList[0].url"
>
</el-image>
</div>
<div>
<div style="line-height: 20px">
商品名称{{ product.name }}
</div>
<div style="line-height: 20px">
库存{{ product.stockNum }}
</div>
<div style="line-height: 20px; color: rgba(255, 87, 51, 1)">
{{ product.minSalePrice }}
</div>
</div>
</div>
</el-form-item>
<el-form-item label-width="150px" label="优惠金额" prop="targetIds">
<el-input-number
v-model="modalData.money"
:min="0"
label="请输入"
></el-input-number>
</el-form-item>
<el-form-item label-width="150px" label="发放数量" prop="targetIds">
<el-input-number
v-model="modalData.total"
:min="0"
:max="99999"
label="请输入"
></el-input-number>
</el-form-item>
<el-form-item label-width="150px" label="每人限领" prop="targetIds">
<el-select v-model="modalData.limitedNum" placeholder="请选择">
<el-option
v-for="item in [
{
label: '不限',
value: 0,
},
{
label: '1张',
value: 1,
},
{
label: '2张',
value: 2,
},
{
label: '3张',
value: 3,
},
{
label: '4张',
value: 4,
},
{
label: '5张',
value: 5,
},
]"
:key="item.value"
:label="item.label"
:value="item.value"
>
</el-option>
</el-select>
</el-form-item>
</el-form>
</template>
</obj-modal>
<!-- 选择商品 -->
<commodity @getProduct="getProduct" ref="commodity"></commodity>
</div>
</template>
<script>
import commodity from "./commodity.vue";
import { debounce, cloneDeep } from "lodash";
import { Divider } from "element-ui";
import loginVue from "../../../common/login.vue";
export default {
components: { commodity },
data() {
return {
isAdd: true,
//
modalConfig: {
title: "添加优惠卷",
show: false,
width: "800px",
},
formInline: {
marketId: "",
shopId: "",
},
modalData: {},
usageDate: [], //使
collectionDate: [], //
product: {}, //
};
},
methods: {
queryTableData(pageNo, pageSize) {},
toggle(e) {
if (this.modalConfig.show == false) {
this.modalConfig.show = true;
} else {
this.modalConfig.show = false;
}
if (e) {
this.init(cloneDeep(e));
}
return {
add: (row) => {
this.formInline = {
marketId: row.marketId,
shopId: row.shopId,
};
this.modalConfig.title = `添加${row.label}`;
this.$nextTick(() => {
this.modalData = {
category: "NO_THRESHOLD",
receiveType: "MANUAL",
couponType: "MONEY",
isTimeReceive: 1, //0-1-
name: "",
useStartTime: "",
useEndTime: "",
receiveStartTime: "",
receiveEndTime: "",
money: "",
total: 10000,
limitedNum: 0,
minPrice: 0,
usableRange: "PARTIAL_GOODS", //-PARTIAL_GOODS -ALL_GOODS -PARTIAL_SHOP
};
// this.$refs.modal.resetFields();
});
this.isAdd = true;
},
update: () => {
this.isAdd = false;
},
};
},
init(row) {},
usageDateChange(e) {
if (e) {
this.modalData.useStartTime = e[0];
this.modalData.useEndTime = e[1];
} else {
this.modalData.useStartTime = "";
this.modalData.useEndTime = "";
}
},
collectionDateChange(e) {
if (e) {
this.modalData.receiveStartTime = e[0];
this.modalData.receiveEndTime = e[1];
} else {
this.modalData.receiveStartTime = "";
this.modalData.receiveEndTime = "";
}
},
//
selectProduct() {
console.log("123");
this.$refs.commodity.toggle().add(this.formInline);
},
//
getProduct(row) {
console.log(row);
this.modalData.targetIds = row.id;
this.product = row;
},
},
computed: {
modalHandles() {
return [
{
label: "取消",
handle: () => {
this.toggle();
},
},
{
label: "确认添加",
type: "primary",
handle: () => {
console.log(this.modalData);
let data = { ...this.modalData };
data.targetIds = [data.targetIds];
console.log(this.modalData, data);
this.$api.coupon
.addCoupon({ ...data, ...this.formInline })
.then((res) => {
console.log(res);
this.$emit("queryList");
this.toggle();
});
},
},
];
},
},
asyncComputed: {},
};
</script>
<style lang="scss" scoped>
.product {
display: flex;
align-items: center;
margin-top: 10px;
border: 1px solid #ccc;
width: 350px;
}
</style>

View File

@ -0,0 +1,230 @@
<template>
<obj-modal
ref="modal"
labelWidth="150px"
:modalConfig="modalConfig"
:modalData="modalData"
:modalHandles="modalHandles"
>
<template slot="dialog__content">
<obj-table-plus
ref="oTable"
style="height: 70vh"
:tableCols="tableCols"
:tableProp="tableProp"
@query="queryList"
v-model="dataList"
:tableEvent="tableEvent"
:enableAutoQuery="false"
>
<!-- <template slot="tableTop">
<el-form :inline="true" :model="formInline" class="demo-form-inline">
<el-form-item v-if="marketList.length > 0" label="菜市场">
<el-select
@change="getData"
v-model="formInline.marketId"
placeholder="请选择菜市场"
>
<el-option
v-for="item in marketList"
:key="item.marketId"
:label="item.marketName"
:value="item.marketId"
></el-option>
</el-select>
</el-form-item>
<el-form-item v-if="marketList.length > 0" label="店铺">
<el-select v-model="formInline.shopId" placeholder="请选择店铺">
<el-option
v-for="item in storeList"
:key="item.shopId"
:label="item.shopName"
:value="item.shopId"
></el-option>
</el-select>
</el-form-item>
<el-form-item>
<el-button type="primary" @click="$refs.oTable.reload()"
>查询</el-button
>
</el-form-item>
</el-form>
</template> -->
</obj-table-plus>
</template>
</obj-modal>
</template>
<script>
import { debounce, cloneDeep } from "lodash";
export default {
data() {
return {
isAdd: true,
//
modalConfig: {
title: "请点击选择商品",
show: false,
width: "1000px",
},
modalData: {},
dataList: [], //
tableProp: {
"auto-resize": true,
border: true,
height: "auto",
"row-id": "id",
"show-overflow": false,
},
selectList: {},
tableEvent: {
"current-change": async (e) => {
console.log(e.row);
this.selectList = e.row;
},
},
formInline: {},
};
},
methods: {
queryList(pageNo, pageSize) {
this.$api.mer_admin
.getProductPage({
p: {
pageNumber: pageNo,
pageSize: pageSize,
},
...this.formInline,
productFilterType: "SALE",
merchantId: JSON.parse(sessionStorage.getItem("userInfo")).merchantId,
productQuerySortParam: [],
})
.then((res) => {
console.log(res);
this.$refs.oTable.complete(
res.data.data.data,
Number(res.data.data.total)
);
})
.catch((err) => {
this.$refs.oTable.complete(false);
});
},
toggle(e) {
if (this.modalConfig.show == false) {
this.modalConfig.show = true;
} else {
this.modalConfig.show = false;
}
if (e) {
this.init(cloneDeep(e));
}
return {
add: (row) => {
this.formInline = row;
this.isAdd = true;
this.$nextTick(() => {
this.$refs.oTable.reload();
});
},
update: () => {
this.isAdd = false;
},
};
},
init(row) {},
},
computed: {
tableCols() {
return [
{ type: "seq", width: "60px", align: "center", title: "序号" },
{
title: "商品图",
field: "productPhotoList",
align: "center",
width: "100px",
type: "jsx",
render: ({ row }) => {
if (row.productPhotoList.length > 0) {
return (
<el-image
preview-src-list={row.productPhotoList.map((item) => {
return item.url;
})}
src={row.productPhotoList[0].url}
></el-image>
);
} else {
return <span>暂无商品图</span>;
}
},
},
{
title: "商品名称",
align: "center",
field: "name",
},
{
title: "商品售价",
align: "center",
field: "minSalePrice",
type: "jsx",
render: ({ row }) => {
if (row.minSalePrice == row.maxSalePrice) {
return <span>{row.minSalePrice}</span>;
} else {
return (
<span>
{row.minSalePrice}~{row.maxSalePrice}
</span>
);
}
},
},
{
title: "折扣",
align: "center",
field: "discountActivity",
type: "jsx",
render: ({ row }) => {
if (row.discountActivity) {
return <span>{row.discountActivity.ruleObject.discount}</span>;
}
},
},
{
title: "销量",
align: "center",
field: "saleNum",
},
{
title: "库存",
align: "center",
field: "stockNum",
},
];
},
modalHandles() {
return [
{
label: "取消",
handle: () => {
this.toggle();
},
},
{
label: "确认",
type: "primary",
handle: () => {
this.$emit("getProduct", this.selectList);
this.toggle();
},
},
];
},
},
};
</script>
<style>
</style>

View File

@ -0,0 +1,307 @@
<template>
<div>
<obj-modal
ref="modal"
labelWidth="150px"
:modalConfig="modalConfig"
:modalData="modalData"
:modalHandles="modalHandles"
>
<template slot="dialog__content">
<el-form :model="modalData" ref="modalForm">
<el-form-item label-width="150px" label="可用范围" prop="name">
<div>
<el-radio
v-model="modalData.usableRange"
label="PARTIAL_GOODS"
border
size="medium"
>全部商品</el-radio
>
<el-radio
v-model="modalData.usableRange"
label="ALL_GOODS"
border
size="medium"
>部分商品</el-radio
>
<el-radio
v-model="modalData.usableRange"
label="PARTIAL_SHOP"
border
size="medium"
>部分摊位</el-radio
>
</div>
</el-form-item>
<el-form-item label-width="150px" label="优惠卷名称" prop="name">
<el-input
style="width: 350px"
v-model="modalData.name"
placeholder="请输入优惠券名称"
>
</el-input>
</el-form-item>
<el-form-item label-width="150px" label="使用日期" prop="name">
<el-date-picker
@change="usageDateChange"
v-model="usageDate"
value-format="yyyy-MM-dd"
type="daterange"
range-separator="至"
start-placeholder="开始日期"
end-placeholder="结束日期"
>
</el-date-picker>
</el-form-item>
<el-form-item label-width="150px" label="开放领取日期" prop="name">
<el-date-picker
@change="collectionDateChange"
v-model="collectionDate"
value-format="yyyy-MM-dd"
type="daterange"
range-separator="至"
start-placeholder="开始日期"
end-placeholder="结束日期"
>
</el-date-picker>
</el-form-item>
<el-form-item label-width="150px" label="优惠设置" prop="name">
<el-col class="line" :span="1"></el-col>
<el-col :span="7">
<el-input placeholder="请输入" v-model="modalData.minPrice">
<template slot="append"></template>
</el-input>
</el-col>
<el-col class="line" :span="1"></el-col>
<el-col class="line" :span="1"></el-col>
<el-col :span="7">
<el-input placeholder="请输入" v-model="modalData.money">
<template slot="append"></template>
</el-input>
</el-col>
</el-form-item>
<el-form-item label-width="150px" label="选择商品" prop="targetIds">
<el-input
style="width: 350px"
placeholder="请选择选择商品"
v-model="modalData.targetIds"
>
<template slot="append">
<el-button @click="selectProduct">请选择</el-button>
</template>
</el-input>
<div v-if="product.name" class="product">
<div>
<el-image
style="width: 80px; height: 80px; margin-right: 10px"
:src="product.productPhotoList[0].url"
>
</el-image>
</div>
<div>
<div style="line-height: 20px">
商品名称{{ product.name }}
</div>
<div style="line-height: 20px">
库存{{ product.stockNum }}
</div>
<div style="line-height: 20px; color: rgba(255, 87, 51, 1)">
{{ product.minSalePrice }}
</div>
</div>
</div>
</el-form-item>
<el-form-item label-width="150px" label="发放数量" prop="targetIds">
<el-input-number
v-model="modalData.total"
:min="0"
:max="99999"
label="请输入"
></el-input-number>
</el-form-item>
<el-form-item label-width="150px" label="每人限领" prop="targetIds">
<el-select v-model="modalData.limitedNum" placeholder="请选择">
<el-option
v-for="item in [
{
label: '不限',
value: 0,
},
{
label: '1张',
value: 1,
},
{
label: '2张',
value: 2,
},
{
label: '3张',
value: 3,
},
{
label: '4张',
value: 4,
},
{
label: '5张',
value: 5,
},
]"
:key="item.value"
:label="item.label"
:value="item.value"
>
</el-option>
</el-select>
</el-form-item>
</el-form>
</template>
</obj-modal>
<!-- 选择商品 -->
<commodity @getProduct="getProduct" ref="commodity"></commodity>
</div>
</template>
<script>
import commodity from "./commodity.vue";
import { debounce, cloneDeep } from "lodash";
import { Divider } from "element-ui";
import loginVue from "../../../common/login.vue";
export default {
components: { commodity },
data() {
return {
isAdd: true,
//
modalConfig: {
title: "添加优惠卷",
show: false,
width: "800px",
},
formInline: {
marketId: "",
shopId: "",
},
modalData: {},
usageDate: [], //使
collectionDate: [], //
product: {}, //
};
},
methods: {
queryTableData(pageNo, pageSize) {},
toggle(e) {
if (this.modalConfig.show == false) {
this.modalConfig.show = true;
} else {
this.modalConfig.show = false;
}
if (e) {
this.init(cloneDeep(e));
}
return {
add: (row) => {
this.formInline = {
marketId: row.marketId,
shopId: row.shopId,
};
this.modalConfig.title = `添加${row.label}`;
this.$nextTick(() => {
this.modalData = {
category: "NO_THRESHOLD",
receiveType: "MANUAL",
couponType: "MONEY",
isTimeReceive: 1, //0-1-
name: "",
useStartTime: "",
useEndTime: "",
receiveStartTime: "",
receiveEndTime: "",
money: "",
total: 10000,
limitedNum: 0,
minPrice: 0,
usableRange: "PARTIAL_GOODS", //-PARTIAL_GOODS -ALL_GOODS -PARTIAL_SHOP
};
// this.$refs.modal.resetFields();
});
this.isAdd = true;
},
update: () => {
this.isAdd = false;
},
};
},
init(row) {},
usageDateChange(e) {
if (e) {
this.modalData.useStartTime = e[0];
this.modalData.useEndTime = e[1];
} else {
this.modalData.useStartTime = "";
this.modalData.useEndTime = "";
}
},
collectionDateChange(e) {
if (e) {
this.modalData.receiveStartTime = e[0];
this.modalData.receiveEndTime = e[1];
} else {
this.modalData.receiveStartTime = "";
this.modalData.receiveEndTime = "";
}
},
//
selectProduct() {
console.log("123");
this.$refs.commodity.toggle().add(this.formInline);
},
//
getProduct(row) {
console.log(row);
this.modalData.targetIds = row.id;
this.product = row;
},
},
computed: {
modalHandles() {
return [
{
label: "取消",
handle: () => {
this.toggle();
},
},
{
label: "确认添加",
type: "primary",
handle: () => {
console.log(this.modalData);
let data = { ...this.modalData };
data.targetIds = [data.targetIds];
console.log(this.modalData, data);
this.$api.coupon
.addCoupon({ ...data, ...this.formInline })
.then((res) => {
console.log(res);
this.$emit("queryList");
this.toggle();
});
},
},
];
},
},
asyncComputed: {},
};
</script>
<style lang="scss" scoped>
.product {
display: flex;
align-items: center;
margin-top: 10px;
border: 1px solid #ccc;
width: 350px;
}
</style>

View File

@ -0,0 +1,307 @@
<template>
<div>
<obj-modal
ref="modal"
labelWidth="150px"
:modalConfig="modalConfig"
:modalData="modalData"
:modalHandles="modalHandles"
>
<template slot="dialog__content">
<el-form :model="modalData" :rules="rules" ref="modalForm">
<el-form-item label-width="150px" label="优惠卷名称:" prop="name">
<el-input
style="width: 350px"
v-model="modalData.name"
placeholder="请输入优惠券名称"
>
</el-input>
</el-form-item>
<el-form-item label-width="150px" label="使用时间:" prop="day">
<el-col class="line" :span="2">领取后</el-col>
<el-col :span="7">
<el-input-number
placeholder="请输入"
controls-position="right"
:precision="0"
v-model="modalData.day"
:min="0"
:max="365"
label="请输入"
></el-input-number>
</el-col>
<el-col style="margin-left: 8px" :span="5"
>(单位) 内可使用</el-col
>
</el-form-item>
<el-form-item label-width="150px" label="可用范围:" prop="name">
<div>
<el-radio
@change="changeThreshold"
v-model="threshold"
:label="false"
border
size="medium"
>无门槛</el-radio
>
<el-radio
@change="changeThreshold"
v-model="threshold"
:label="true"
border
size="medium"
>有门槛</el-radio
>
</div>
</el-form-item>
<el-form-item
v-if="!threshold"
label-width="150px"
label="优惠金额:"
prop="money"
>
<el-col :span="7">
<el-input-number
placeholder="请输入"
controls-position="right"
:precision="0"
v-model="modalData.money"
:min="0"
:max="99999"
label="请输入"
></el-input-number>
</el-col>
<span>单位</span>
</el-form-item>
<el-form-item
v-if="threshold"
label-width="150px"
label="优惠设置:"
prop="money"
>
<el-col class="line" :span="1"></el-col>
<el-col :span="7">
<el-input-number
placeholder="请输入"
controls-position="right"
:precision="0"
v-model="modalData.minPrice"
:min="0"
:max="99999"
label="请输入"
></el-input-number>
</el-col>
<el-col class="line" :span="1"></el-col>
<el-col class="line" :span="1"></el-col>
<el-col :span="7">
<el-input-number
placeholder="请输入"
controls-position="right"
:precision="0"
v-model="modalData.money"
:min="0"
:max="modalData.minPrice"
label="请输入"
></el-input-number>
</el-col>
<span>单位</span>
</el-form-item>
<el-form-item label-width="150px" label="发放数量:" prop="total">
<el-input-number
controls-position="right"
:precision="0"
v-model="modalData.total"
:min="0"
:max="99999"
label="请输入"
></el-input-number>
</el-form-item>
<el-form-item
label-width="150px"
label="每人限领:"
prop="limitedNum"
>
<el-select v-model="modalData.limitedNum" placeholder="请选择">
<el-option
v-for="item in [
{
label: '不限',
value: 0,
},
{
label: '1张',
value: 1,
},
{
label: '2张',
value: 2,
},
{
label: '3张',
value: 3,
},
{
label: '4张',
value: 4,
},
{
label: '5张',
value: 5,
},
]"
:key="item.value"
:label="item.label"
:value="item.value"
>
</el-option>
</el-select>
</el-form-item>
</el-form>
</template>
</obj-modal>
</div>
</template>
<script>
import { debounce, cloneDeep } from "lodash";
export default {
components: {},
data() {
return {
isAdd: true,
//
threshold: false, //
modalConfig: {
title: "添加优惠卷",
show: false,
width: "800px",
},
formInline: {
marketId: "",
shopId: "",
},
modalData: {},
usageDate: [], //使
collectionDate: [], //
rules: {
name: [
{
required: true,
message: "请输入优惠卷名称",
trigger: "blur",
},
{ min: 1, max: 10, message: "长度10字符以内", trigger: "blur" },
],
day: [
{
required: true,
message: "请输入领取后有效天数",
trigger: "blur",
},
],
money: [
{
required: true,
message: "请输入优惠金额",
trigger: "blur",
},
],
total: [
{
required: true,
message: "请输入发放数量",
trigger: "blur",
},
],
limitedNum: [
{
required: true,
message: "请输入每人限领数量",
trigger: "change",
},
],
},
};
},
methods: {
queryTableData(pageNo, pageSize) {},
toggle(e) {
if (this.modalConfig.show == false) {
this.modalConfig.show = true;
} else {
this.modalConfig.show = false;
}
if (e) {
this.init(cloneDeep(e));
}
return {
add: (row) => {
this.formInline = {
marketId: row.marketId,
shopId: row.shopId,
};
this.modalConfig.title = `添加${row.label}`;
this.$nextTick(() => {
this.modalData = {
category: "FIRST_ATTENTION",
receiveType: "MANUAL",
couponType: "MONEY",
isTimeReceive: 0, //0-1-
name: "",
day: "7",
money: "",
total: 10000,
limitedNum: 0,
minPrice: 0,
usableRange: "ALL_GOODS", //-PARTIAL_GOODS -ALL_GOODS -PARTIAL_SHOP
};
// this.$refs.modal.resetFields();
});
this.isAdd = true;
},
update: () => {
this.isAdd = false;
},
};
},
init(row) {},
changeThreshold(e) {
if (e) {
this.modalData.minPrice = 0;
this.modalData.money = 0;
} else {
this.modalData.minPrice = 0;
this.modalData.money = 0;
}
},
},
computed: {
modalHandles() {
return [
{
label: "取消",
handle: () => {
this.toggle();
},
},
{
label: "确认添加",
type: "primary",
handle: () => {
console.log(this.modalData);
this.$api.coupon
.addCoupon({ ...this.modalData, ...this.formInline })
.then((res) => {
console.log(res);
this.$emit("queryList");
this.toggle();
});
},
},
];
},
},
asyncComputed: {},
};
</script>
<style lang="scss" scoped>
</style>

View File

@ -0,0 +1,301 @@
<template>
<div>
<div>
<el-select
style="margin-right: 20px"
v-model="value1"
placeholder="请选择统计类型"
>
<el-option
v-for="item in [
{ value: '1', label: '1' },
{ value: '2', label: '2' },
]"
:key="item.value"
:label="item.label"
:value="item.value"
>
</el-option>
</el-select>
<el-select
style="margin-right: 20px"
v-model="value"
placeholder="请选择"
>
<el-option
v-for="item in [
{ value: '1', label: '日' },
{ value: '2', label: '周' },
{ value: '3', label: '月' },
{ value: '4', label: '年' },
]"
:key="item.value"
:label="item.label"
:value="item.value"
>
</el-option>
</el-select>
<el-button @click="getList" type="primary">查询</el-button>
<el-button type="success">导出</el-button>
</div>
<div class="stat-list">
<div class="stat-item">
<i style="font-size: 22px" class="el-icon-camera-solid"></i>
<div class="stat-right">
<div class="stat-title">展现量 </div>
<div class="stat-value">
<span style="font-size: 20px">{{
analysis.viewCount ? analysis.viewCount : "0"
}}</span>
<span
v-if="analysis.viewCountRatio < 0"
style="font-size: 16px; margin: 0 5px; color: green"
></span
>
<span style="font-size: 16px; margin: 0 5px; color: red" v-else
></span
>
<span style="font-size: 16px">{{
absoluteValue(analysis.viewCountRatio)
}}</span>
</div>
</div>
</div>
<div class="stat-item">
<i style="font-size: 22px" class="el-icon-user-solid"></i>
<div class="stat-right">
<div class="stat-title">浏览人数 </div>
<div class="stat-value">
<span style="font-size: 20px">62</span>
<span
v-if="analysis.peopleCountRatio < 0"
style="font-size: 16px; margin: 0 5px; color: green"
></span
>
<span style="font-size: 16px; margin: 0 5px; color: red" v-else
></span
>
<span style="font-size: 16px">{{
absoluteValue(analysis.peopleCountRatio)
}}</span>
</div>
</div>
</div>
<div class="stat-item">
<i style="font-size: 22px" class="el-icon-user-solid"></i>
<div class="stat-right">
<div class="stat-title">新客数量 </div>
<div class="stat-value">
<span style="font-size: 20px">{{
analysis.newPeopleCount ? analysis.newPeopleCount : "0"
}}</span>
<span
v-if="analysis.newPeopleCountRatio"
style="font-size: 16px; margin: 0 5px; color: green"
></span
>
<span style="font-size: 16px; margin: 0 5px; color: red" v-else
></span
>
<span style="font-size: 16px">{{
absoluteValue(analysis.newPeopleCountRatio)
}}</span>
</div>
</div>
</div>
<div class="stat-item">
<i style="font-size: 22px" class="el-icon-user-solid"></i>
<div class="stat-right">
<div class="stat-title">支付订单人数 </div>
<div style="font-size: 20px" class="stat-value">
{{ analysis.payCount ? analysis.payCount : "0" }}
</div>
</div>
</div>
<div class="stat-item">
<i style="font-size: 22px" class="el-icon-s-order"></i>
<div class="stat-right">
<div class="stat-title">支付订单转化率 %</div>
<div style="font-size: 20px" class="stat-value">
{{ analysis.payConversion ? analysis.payConversion : "0" }}
</div>
</div>
</div>
<div class="stat-item">
<i style="font-size: 22px" class="el-icon-s-order"></i>
<div class="stat-right">
<div class="stat-title">客户复购率 %</div>
<div style="font-size: 20px" class="stat-value">
{{ analysis.repurchaseRate ? analysis.repurchaseRate : "0" }}
</div>
</div>
</div>
</div>
<el-row class="echarts-line">
<div
id="echarts-LineChart"
style="
width: 100%;
height: calc(100vh - 500px);
margin-top: 20px;
border: 1px solid #ccc;
"
/>
</el-row>
</div>
</template>
<script>
import { mapState } from "vuex";
import * as echarts from "echarts";
export default {
data() {
return {
value1: "",
value: "",
formInline: {
marketId: "",
shopId: "",
brandId: "",
countType: "",
dataType: "",
provinceCode: "",
cityCode: "",
},
analysis: {},
trend: [],
};
},
mounted() {
this.formInline = {
marketId: this.marketId,
shopId: this.shopId,
brandId: JSON.parse(sessionStorage.getItem("userInfo")).brandId,
};
this.getList();
},
methods: {
getList() {
console.log("1213");
this.$api.dataCenter.customerAnalysis(this.formInline).then((res) => {
this.analysis = res.data.data;
});
this.$api.dataCenter.customerTrend(this.formInline).then((res) => {
console.log(res);
});
this.init();
},
init() {
this.$nextTick(() => {
// 线
const myChat = echarts.init(
document.getElementById("echarts-LineChart")
);
myChat.setOption(this.LineChart());
window.addEventListener("resize", () => {
myChat.resize();
});
});
},
LineChart() {
return {
title: {
text: "交易趋势分析",
},
tooltip: {
trigger: "axis",
},
legend: {
data: ["订单金额", "订单数", "订单商品数"],
},
grid: {
left: "3%",
right: "4%",
bottom: "3%",
containLabel: true,
},
toolbox: {
feature: {
saveAsImage: {},
},
},
xAxis: {
type: "category",
boundaryGap: false,
data: ["Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun"],
},
yAxis: {
type: "value",
},
series: [
{
name: "订单金额",
type: "line",
stack: "Total",
data: [120, 132, 101, 134, 90, 230, 210],
},
{
name: "订单数",
type: "line",
stack: "Total",
data: [220, 182, 191, 234, 290, 330, 310],
},
{
name: "订单商品数",
type: "line",
stack: "Total",
data: [150, 232, 201, 154, 190, 330, 410],
},
],
};
},
absoluteValue(row) {
if (row === 0) {
return 0;
}
return Math.abs(row);
},
},
computed: {
...mapState("userData", [
"isMerchant",
"marketList",
"storeList",
"marketId",
"shopId",
]),
},
};
</script>
<style lang="scss" scoped>
.stat-list {
display: flex;
align-items: center;
/* justify-content: space-between; */
flex-wrap: wrap;
margin-top: 20px;
padding: 10px;
border: 1px solid #ccc;
}
.stat-item {
width: 25%;
margin: 30px 30px;
display: flex;
align-items: center;
}
.stat-icon {
background: rgb(99 152 252);
width: 60px;
height: 60px;
border-radius: 3px;
}
.stat-right {
margin-left: 12px;
font-size: 18px;
}
.stat-title {
color: #969696;
margin-bottom: 10px;
}
</style>

View File

@ -0,0 +1,285 @@
<template>
<div>
<div>
<el-select
style="margin-right: 20px"
v-model="value1"
placeholder="请选择统计类型"
>
<el-option
v-for="item in [
{ value: '1', label: '1' },
{ value: '2', label: '2' },
]"
:key="item.value"
:label="item.label"
:value="item.value"
>
</el-option>
</el-select>
<el-button type="primary">查询</el-button>
</div>
<div class="product">
<div style="font-size: 18px">订单分析</div>
<div class="stat-list">
<div class="stat-item">
<div class="stat-right">
<div class="stat-title">下单订单数量</div>
<div style="font-size: 20px" class="stat-value">435</div>
</div>
</div>
<div class="stat-item">
<div class="stat-right">
<div class="stat-title">支付订单数量</div>
<div style="font-size: 20px" class="stat-value">45</div>
</div>
</div>
<div class="stat-item">
<div class="stat-right">
<div class="stat-title">有效订单数量</div>
<div style="font-size: 20px" class="stat-value">34</div>
</div>
</div>
<div class="stat-item">
<div class="stat-right">
<div class="stat-title">有效订单率</div>
<div style="font-size: 20px" class="stat-value">199</div>
</div>
</div>
<div class="stat-item">
<div class="stat-right">
<div class="stat-title">订单实付金额</div>
<div style="font-size: 20px" class="stat-value">1256</div>
</div>
</div>
<div class="stat-item">
<div class="stat-right">
<div class="stat-title">订单退款金额</div>
<div style="font-size: 20px" class="stat-value">1256</div>
</div>
</div>
<div class="stat-item">
<div class="stat-right">
<div class="stat-title">售后订单数量</div>
<div style="font-size: 20px" class="stat-value">34</div>
</div>
</div>
<div class="stat-item">
<div class="stat-right">
<div class="stat-title">售后订单率%</div>
<div style="font-size: 20px" class="stat-value">199</div>
</div>
</div>
</div>
</div>
<div style="padding: 20px; border: 1px solid #ccc; margin-top: 20px">
<div style="font-size: 18px; margin-bottom: 40px">订单结算明细</div>
<el-form :inline="true" :model="formInline" class="demo-form-inline">
<el-form-item label="下单时间">
<el-date-picker
v-model="value"
type="datetimerange"
start-placeholder="开始日期"
end-placeholder="结束日期"
>
</el-date-picker>
</el-form-item>
<el-form-item label="结算时间">
<el-date-picker
v-model="value"
type="datetimerange"
start-placeholder="开始日期"
end-placeholder="结束日期"
>
</el-date-picker>
</el-form-item>
<el-form-item label="状态:">
<el-select v-model="formInline.marketId" placeholder="请选择状态">
<el-option
v-for="item in [
{ label: '全部', value: '' },
{ label: '进行中', value: '1' },
{ label: '已结算', value: '2' },
]"
:key="item.value"
:label="item.label"
:value="item.value"
></el-option>
</el-select>
</el-form-item>
<el-form-item>
<el-button type="primary">查询</el-button>
<el-button type="primary">导出</el-button>
</el-form-item>
</el-form>
<div
style="
background: #edf4ff;
height: 80px;
margin-bottom: 10px;
font-size: 16px;
"
class="stat-list"
>
<div>
<span>退款金额</span><span style="margin-left: 10px"></span
><span style="font-weight: 600; font-size: 22px">999</span>
</div>
<div>
<span>订单支出</span><span style="margin-left: 10px"></span
><span style="font-weight: 600; font-size: 22px">999</span>
</div>
<div>
<span>待入账金额</span><span style="margin-left: 10px"></span
><span style="font-weight: 600; font-size: 22px">888</span>
</div>
<div>
<span>已入账金额</span><span style="margin-left: 10px"></span
><span style="font-weight: 600; font-size: 22px">888</span>
</div>
</div>
<el-table :data="tableData" border style="width: 100%">
<el-table-column align="center" type="index" label="排名" width="50">
</el-table-column>
<el-table-column prop="date" label="订单编号"> </el-table-column>
<el-table-column
align="center"
prop="name"
label="下单时间"
width="140"
>
</el-table-column>
<el-table-column
align="center"
prop="name"
label="结算时间"
>
</el-table-column>
<el-table-column
align="center"
prop="name"
label="实付金额(元)"
>
</el-table-column>
<el-table-column
align="center"
prop="name"
label="退款金额(元)"
width="140"
>
</el-table-column>
<el-table-column
align="center"
prop="name"
label="订单支出(元)"
width="140"
>
</el-table-column>
<el-table-column
align="center"
prop="name"
label="入账金额(元)"
width="140"
>
</el-table-column>
<el-table-column align="center" prop="name" label="状态" width="140">
</el-table-column>
</el-table>
</div>
</div>
</template>
<script>
export default {
data() {
return {
value1: "",
value: "",
formInline: {
marketId: "",
shopId: "",
name: "",
},
tableData: [
{
date: "2016-05-02",
name: "王小虎",
address: "上海市普陀区金沙江路 1518 弄",
url: "https://fuss10.elemecdn.com/e/5d/4a731a90594a4af544c0c25941171jpeg.jpeg",
},
{
date: "2016-05-04",
name: "王小虎",
address: "上海市普陀区金沙江路 1517 弄",
url: "https://fuss10.elemecdn.com/e/5d/4a731a90594a4af544c0c25941171jpeg.jpeg",
},
{
date: "2016-05-01",
name: "王小虎",
address: "上海市普陀区金沙江路 1519 弄",
url: "https://fuss10.elemecdn.com/e/5d/4a731a90594a4af544c0c25941171jpeg.jpeg",
},
{
date: "2016-05-03",
name: "王小虎",
address: "上海市普陀区金沙江路 1516 弄",
url: "https://fuss10.elemecdn.com/e/5d/4a731a90594a4af544c0c25941171jpeg.jpeg",
},
{
date: "2016-05-03",
name: "王小虎",
address: "上海市普陀区金沙江路 1516 弄",
url: "https://fuss10.elemecdn.com/e/5d/4a731a90594a4af544c0c25941171jpeg.jpeg",
},
],
};
},
methods: {
init() {},
},
};
</script>
<style lang="scss" scoped>
.product {
margin-top: 20px;
padding: 10px;
// border: 1px solid #ccc;
background: #edf4ff;
}
.stat-list {
display: flex;
align-items: center;
justify-content: space-between;
flex-wrap: wrap;
// margin-top: 20px;
padding: 10px;
// border: 1px solid #ccc;
}
.stat-item {
width: 21%;
margin: 30px 0;
display: flex;
align-items: center;
}
.stat-icon {
background: rgb(99 152 252);
width: 60px;
height: 60px;
border-radius: 3px;
}
.stat-right {
margin-left: 12px;
font-size: 18px;
}
.stat-title {
// color: #969696;
font-weight: 600;
margin-bottom: 10px;
}
.grid-content {
margin-bottom: 20px;
font-size: 20px;
font-weight: 600;
}
</style>

View File

@ -0,0 +1,242 @@
<template>
<div>
<div>
<el-select
style="margin-right: 20px"
v-model="value1"
placeholder="请选择统计类型"
>
<el-option
v-for="item in [
{ value: '1', label: '1' },
{ value: '2', label: '2' },
]"
:key="item.value"
:label="item.label"
:value="item.value"
>
</el-option>
</el-select>
<el-select
style="margin-right: 20px"
v-model="value"
placeholder="请选择"
>
<el-option
v-for="item in [
{ value: '1', label: '日' },
{ value: '2', label: '周' },
{ value: '3', label: '月' },
{ value: '4', label: '年' },
]"
:key="item.value"
:label="item.label"
:value="item.value"
>
</el-option>
</el-select>
<el-button type="primary">查询</el-button>
<el-button type="success">导出</el-button>
</div>
<div class="product">
<div style="font-size: 18px">商品整体概况</div>
<div class="stat-list">
<div class="stat-item">
<div class="stat-right">
<div class="stat-title">在售商品数</div>
<div style="font-size: 20px" class="stat-value">435</div>
</div>
</div>
<div class="stat-item">
<div class="stat-right">
<div class="stat-title">被访问商品数</div>
<div style="font-size: 20px" class="stat-value">45</div>
</div>
</div>
<div class="stat-item">
<div class="stat-right">
<div class="stat-title">折扣商品数</div>
<div style="font-size: 20px" class="stat-value">34</div>
</div>
</div>
<div class="stat-item">
<div class="stat-right">
<div class="stat-title">预售商品数</div>
<div style="font-size: 20px" class="stat-value">199</div>
</div>
</div>
<div class="stat-item">
<div class="stat-right">
<div class="stat-title">商品浏览量</div>
<div style="font-size: 20px" class="stat-value">1256</div>
</div>
</div>
<div class="stat-item">
<div class="stat-right">
<div class="stat-title">商品浏览人数</div>
<div style="font-size: 20px" class="stat-value">1256</div>
</div>
</div>
<div class="stat-item">
<div class="stat-right">
<div class="stat-title">商品加购件数</div>
<div style="font-size: 20px" class="stat-value">34</div>
</div>
</div>
<div class="stat-item">
<div class="stat-right">
<div class="stat-title">商品点赞件数</div>
<div style="font-size: 20px" class="stat-value">199</div>
</div>
</div>
<div class="stat-item">
<div class="stat-right">
<div class="stat-title">商品支付件数</div>
<div style="font-size: 20px" class="stat-value">1256</div>
</div>
</div>
</div>
</div>
<div style="padding: 10px; border: 1px solid #ccc; margin-top: 20px">
<div style="font-size: 18px; margin-bottom: 40px">商品排行榜</div>
<el-row style="" type="flex" justify="space-between">
<el-col :span="11"
><div class="grid-content bg-purple">商品访客数TOP</div>
<el-table :data="tableData" border style="width: 100%;" >
<el-table-column align="center" type="index" label="排名" width="50">
</el-table-column>
<el-table-column prop="date" label="商品名称">
<template slot-scope="scope">
<div style="display: flex; align-items: center">
<div>
<el-image
style="width: 60px; height: 60px"
:src="scope.row.url"
:preview-src-list="[scope.row.url]"
>
</el-image>
</div>
<div style="margin-left:10px;color:blue">{{ scope.row.name }}</div>
</div>
</template>
</el-table-column>
<el-table-column align="center" prop="name" label="访客数" width="140">
</el-table-column> </el-table
></el-col>
<el-col :span="11"
><div class="grid-content bg-purple">商品支付转化率TOP</div>
<el-table :data="tableData" border style="width: 100%">
<el-table-column align="center" type="index" label="排名" width="50">
</el-table-column>
<el-table-column prop="date" label="商品名称">
<template slot-scope="scope">
<div style="display: flex; align-items: center">
<div>
<el-image
style="width: 60px; height: 60px"
:src="scope.row.url"
:preview-src-list="[scope.row.url]"
>
</el-image>
</div>
<div style="margin-left:10px;color:blue">{{ scope.row.name }}</div>
</div>
</template>
</el-table-column>
<el-table-column align="center" prop="name" label="支付转化率(%" width="140">
</el-table-column> </el-table
>
</el-col>
</el-row>
</div>
</div>
</template>
<script>
export default {
data() {
return {
value1: "",
value: "",
tableData: [
{
date: "2016-05-02",
name: "王小虎",
address: "上海市普陀区金沙江路 1518 弄",
url: "https://fuss10.elemecdn.com/e/5d/4a731a90594a4af544c0c25941171jpeg.jpeg",
},
{
date: "2016-05-04",
name: "王小虎",
address: "上海市普陀区金沙江路 1517 弄",
url: "https://fuss10.elemecdn.com/e/5d/4a731a90594a4af544c0c25941171jpeg.jpeg",
},
{
date: "2016-05-01",
name: "王小虎",
address: "上海市普陀区金沙江路 1519 弄",
url: "https://fuss10.elemecdn.com/e/5d/4a731a90594a4af544c0c25941171jpeg.jpeg",
},
{
date: "2016-05-03",
name: "王小虎",
address: "上海市普陀区金沙江路 1516 弄",
url: "https://fuss10.elemecdn.com/e/5d/4a731a90594a4af544c0c25941171jpeg.jpeg",
},
{
date: "2016-05-03",
name: "王小虎",
address: "上海市普陀区金沙江路 1516 弄",
url: "https://fuss10.elemecdn.com/e/5d/4a731a90594a4af544c0c25941171jpeg.jpeg",
},
],
};
},
methods: {
init() {},
},
};
</script>
<style lang="scss" scoped>
.product {
margin-top: 20px;
padding: 10px;
border: 1px solid #ccc;
}
.stat-list {
display: flex;
align-items: center;
/* justify-content: space-between; */
flex-wrap: wrap;
// margin-top: 20px;
padding: 10px;
// border: 1px solid #ccc;
}
.stat-item {
width: 25%;
margin: 30px 30px;
display: flex;
align-items: center;
}
.stat-icon {
background: rgb(99 152 252);
width: 60px;
height: 60px;
border-radius: 3px;
}
.stat-right {
margin-left: 12px;
font-size: 18px;
}
.stat-title {
// color: #969696;
font-weight: 600;
margin-bottom: 10px;
}
.grid-content {
margin-bottom: 20px;
font-size: 20px;
font-weight: 600;
}
</style>

View File

@ -1,6 +1,6 @@
<template>
<div>
<div v-if="shopId">
<div v-if="isMerchant">
<obj-table-plus
style="height: calc(100vh - 132px)"
ref="oTable"
@ -8,6 +8,7 @@
:tableCols="tableCols"
v-model="dataList"
@query="queryList"
:enableAutoQuery="false"
>
<template slot="flexEmpty">
<el-empty description="暂无数据"></el-empty>
@ -52,6 +53,7 @@
</template>
<script>
import { mapState } from "vuex";
import addTemplate from "./popup/add-template.vue";
export default {
components: { addTemplate },
@ -62,26 +64,16 @@ export default {
name: "",
linkId: "",
},
shopId: "",
marketList: "",
};
},
created() {
if (JSON.parse(sessionStorage.getItem("userInfo")).markets.length > 0) {
this.shopId = true;
this.searchForm.linkId = JSON.parse(
sessionStorage.getItem("userInfo")
).markets[0].marketId;
this.marketList = JSON.parse(sessionStorage.getItem("userInfo")).markets;
console.log(this.marketList);
} else if (JSON.parse(sessionStorage.getItem("userInfo")).shopId) {
this.searchForm.linkId = JSON.parse(
sessionStorage.getItem("userInfo")
).shopId;
this.shopId = true;
} else {
this.shopId = false;
}
this.searchForm = {
name: "",
linkId: this.marketId ? this.marketId : this.shopId,
};
this.$nextTick(() => {
this.$refs.oTable.reload();
});
},
methods: {
queryList(pageNo, pageSize) {
@ -105,8 +97,7 @@ export default {
Reset() {
this.searchForm = {
name: "",
linkId: JSON.parse(sessionStorage.getItem("userInfo")).markets[0]
.marketId,
linkId: this.marketId ? this.marketId : this.shopId,
};
this.$refs.oTable.reload();
},
@ -330,6 +321,13 @@ export default {
},
];
},
...mapState("userData", [
"isMerchant",
"marketList",
"storeList",
"marketId",
"shopId",
]),
},
};
</script>

View File

@ -0,0 +1,232 @@
<template>
<div>
<div class="tips">
<div>请谨慎操作此页面数据避免频繁修改导致会员流失等不必要的损失</div>
<div style="margin-top: 10px">
请注意用户一旦达到某会员等级后续修改会员等级要求不会影响用户已达到的会员等级但可享有该等级对应的会员权益
</div>
<div style="margin-top: 20px">
举例24年2月用户在本商铺的成长值达到500升级为VIP2,此时,VIP2会员权益享有的生日优惠卷1
</div>
<div style="margin-top: 10px">
24年3月本商铺修改VIP2所需成长值为700并新增会员生日优惠卷2修改提交后,该用户会员等级保持VIP2不变且享有会员优惠卷1和会员优惠卷2
</div>
</div>
<div>
<!-- <el-form :inline="true" :model="formInline" class="demo-form-inline">
<el-form-item label="单位类型:">
<el-select
v-model="formInline.unitType"
placeholder="请选择单位类型:"
>
<el-option
v-for="item in [
{ label: '市场', value: '1' },
{ label: '摊主', value: '2' },
{ label: '云店', value: '3' },
]"
:key="item.value"
:label="item.label"
:value="item.value"
></el-option>
</el-select>
</el-form-item>
<el-form-item>
<el-button @click="getData" type="primary">查询</el-button>
<el-button @click="getData" type="primary">导出</el-button>
</el-form-item>
</el-form> -->
</div>
<div class="tipsLevel">
<div>
<span style="margin-right: 30px">全部等级({{list.length}})</span
><el-button @click="add(null)" type="primary">+新增套餐</el-button>
</div>
<div>
<!-- <span style="margin-right: 30px">会员快要到期了</span>
<el-button @click="add(null)" type="primary">购买工具</el-button> -->
</div>
</div>
<el-table :data="list" :border="true" style="width: 100%">
<el-table-column
width="140"
align="center"
label="等级名称"
prop="levelName"
/>
<el-table-column
width="140"
align="center"
label="所需成长值"
prop="requiredGrowthValue"
/>
<el-table-column
width="140"
align="center"
label="会员人数"
prop="memberCount"
>
</el-table-column>
<el-table-column
align="center"
label="会员权益"
prop="packageEffectiveTimeQuantity"
>
<template slot-scope="scope">
<div>
<span>{{scope.row.enableMemberDiscount ? '会员折扣,' :''}}</span>
<span>{{scope.row.enablePointsRedemption ? '积分兑换,' : ''}}</span>
<span>{{scope.row.enableBirthdayCoupons ? '生日优惠卷,' : ''}}</span>
<span>{{scope.row.enableBirthdayReward ? '生日双倍积分' : ''}}</span>
</div>
</template>
</el-table-column>
<!-- <el-table-column align="center" label="操作" fixed="right" width="240"> -->
<!-- <template v-slot="scope">
<el-button @click="add(scope.row)" type="primary">编辑</el-button>
<el-button @click="add(scope.row)" type="primary">转移</el-button>
<el-popconfirm
confirm-button-text="确定"
cancel-button-text="取消"
icon-color="#626AEF"
title="确定删除吗?"
@confirm="confirmEvent(scope.row)"
@cancel="cancelEvent"
>
<template #reference>
<el-button type="danger">删除</el-button>
</template>
</el-popconfirm>
</template> -->
<!-- </el-table-column> -->
</el-table>
<!-- 添加 -->
<addOrUpdate ref="addOrUpdate"></addOrUpdate>
</div>
</template>
<script>
import addOrUpdate from "./popup/add-or-update.vue";
import { mapState } from "vuex";
export default {
components: {
addOrUpdate,
},
data() {
return {
list: [],
formInline: {
unitType: "1",
marketId: "",
shopId: "",
},
};
},
created() {
this.formInline = {
unitType: JSON.parse(sessionStorage.getItem("userInfo")).unitType,
marketId: this.marketId,
shopId: "",
};
this.getList();
},
methods: {
// getData() {
// this.$api.mer_admin
// .storeList({ marketId: this.formInline.marketId })
// .then((res) => {
// this.storeList = res.data.data;
// this.formInline.shopId = res.data.data[0].shopId;
// this.$nextTick(() => {
// this.getList();
// });
// });
// },
getList() {
this.$api.marketing.marketingLevelPage(this.formInline).then((res) => {
this.list = res.data.data;
});
},
add() {
// this.$api.marketing
// .addMarketingLevel({
// marketId: this.marketId,
// unitType: this.formInline.unitType,
// levelList: [
// {
// levelName: "",
// requiredGrowthValue: 0,
// growthValueUpperLimit: 99,
// enableMemberDiscount: true,
// enablePointsRedemption: true,
// enableBirthdayCoupons: true,
// enableBirthdayReward: true,
// discountRate: "9",
// rewardEffectiveTimeType: 1,
// memberLevelCouponsList: [
// {
// couponsName: "",
// couponsThreshold: "10",
// couponsMinus: 8,
// couponsEffectiveTimeType: 2,
// },
// ],
// },
// {
// levelName: "",
// requiredGrowthValue: 100,
// growthValueUpperLimit: 999999999,
// enableMemberDiscount: true,
// enablePointsRedemption: true,
// enableBirthdayCoupons: true,
// enableBirthdayReward: true,
// discountRate: "8",
// rewardEffectiveTimeType: 1,
// memberLevelCouponsList: [
// {
// couponsName: "",
// couponsThreshold: "20",
// couponsMinus: 10,
// couponsEffectiveTimeType: 2,
// },
// ],
// },
// ],
// })
// .then((res) => {
// console.log(res);
// });
this.$refs.addOrUpdate.toggle().add();
},
confirmEvent() {},
cancelEvent() {},
},
computed: {
...mapState("userData", [
"isMerchant",
"marketList",
"storeList",
"marketId",
"shopId",
]),
},
};
</script>
<style scoped lang="scss" >
.tips {
padding: 15px;
margin-bottom: 20px;
border-radius: 10px;
width: 100%;
font-size: 16px;
background: #e5e5e5;
color: #faa639;
}
.tipsLevel {
margin: 20px 0;
display: flex;
justify-content: space-between;
}
</style>

View File

@ -0,0 +1,191 @@
<template>
<div>
<obj-modal
ref="modal"
labelWidth="150px"
:modalCols="modalCols"
:modalConfig="modalConfig"
:modalData="modalData"
:modalHandles="modalHandles"
>
<template slot="dialog__after"> </template>
</obj-modal>
</div>
</template>
<script>
import { debounce, cloneDeep } from "lodash";
import { Divider } from "element-ui";
export default {
components: {},
data() {
return {
isAdd: true,
//
modalConfig: {
title: "添加优惠卷",
show: false,
width: "60%",
},
modalData: {},
value1: [],
};
},
methods: {
queryTableData(pageNo, pageSize) {},
toggle(e) {
if (this.modalConfig.show == false) {
this.modalConfig.show = true;
} else {
this.modalConfig.show = false;
this.$refs.modal.resetFields();
}
if (e) {
this.init(cloneDeep(e));
}
return {
add: (row) => {
this.modalConfig.title = "添加优惠卷";
this.$nextTick(() => {
this.$refs.modal?.resetFields();
});
this.isAdd = true;
if (row) {
this.modalData = row[0];
console.log("111");
return;
}
this.modalData = {
couponsName: "",
couponsThreshold: 0,
couponsMinus: 0,
couponsEffectiveTimeType: "1",
};
console.log("qqw");
},
update: () => {
this.isAdd = false;
},
};
},
init(row) {
if (row) {
this.modalData = row;
return;
}
console.log("123");
},
},
computed: {
modalCols() {
return [
{
label: "优惠卷名称",
prop: "couponsName",
type: "Input",
width: "300px",
rules: { required: true, message: "请优惠卷名称" },
},
{
label: "优惠券门槛金额",
prop: "couponsThreshold",
type: "Input",
width: "300px",
rules: { required: true, message: "请输入优惠券门槛金额" },
type: "jsx",
render: () => {
return (
<el-input-number
controls-position="right"
precision={0}
v-model={this.modalData.couponsThreshold}
min={0}
max={99999}
label="请输入"
></el-input-number>
);
},
},
{
label: "优惠券减免金额",
prop: "couponsMinus",
type: "Input",
width: "300px",
rules: { required: true, message: "请输入优惠券减免金额" },
type: "jsx",
render: () => {
return (
<el-input-number
controls-position="right"
precision={0}
v-model={this.modalData.couponsMinus}
min={0}
max={99999}
label="请输入"
></el-input-number>
);
},
},
{
label: "优惠券有效时间",
prop: "couponsEffectiveTimeType",
type: "Input",
width: "300px",
rules: { required: true, message: "请输入优惠券有效时间" },
type: "jsx",
render: () => {
return (
<el-select
v-model={this.modalData.couponsEffectiveTimeType}
placeholder="请选择"
>
{[
{ label: "当天", value: "1" },
{
label: "当周",
value: "2",
},
{
label: "当月",
value: "2",
},
].map((item) => {
return (
<el-option
label={item.label}
value={item.value}
></el-option>
);
})}
</el-select>
);
},
},
];
},
modalHandles() {
return [
{
label: "取消",
handle: () => {
this.toggle();
},
},
{
label: this.isAdd ? "确认添加" : "确认",
type: "primary",
loading: this.isLoading,
submit: true,
handle: () => {
console.log(this.modalData);
this.$emit("addCouponData", this.modalData);
this.toggle();
},
},
];
},
},
asyncComputed: {},
};
</script>
<style lang="scss" scoped>
</style>

View File

@ -0,0 +1,485 @@
<template>
<div>
<obj-modal
ref="modal"
labelWidth="150px"
:modalConfig="modalConfig"
:modalCols="modalCols"
:modalData="modalData"
:modalHandles="modalHandles"
>
<div slot="dialog__content">
<el-form :model="modalData" ref="modalForm">
<obj-table-plus
style="height: 70vh"
ref="oTableThree"
v-model="modalData.tableData"
:tableCols="tableCols"
:tableProp="tableProp"
:toolbarProp="toolbarProp"
:tableEvent="tableEvent"
>
<div slot="tableTop" class="mb-2"></div>
</obj-table-plus>
</el-form>
</div>
</obj-modal>
<addCoupon @addCouponData="addCouponData" ref="addCoupon"></addCoupon>
</div>
</template>
<script>
import addCoupon from "./add-coupon.vue";
import { debounce, cloneDeep } from "lodash";
export default {
components: { addCoupon },
data() {
return {
isAdd: true,
isLoading: false,
//
//
tableProp: {
height: "auto",
border: true,
"auto-resize": false,
"print-config": {},
},
toolbarProp: {},
tableEvent: {},
modalConfig: {
title: "新增等级",
show: false,
width: "1300px",
fullscreen: true,
},
modalCols: [],
couponIndex: 0,
modalData: {
marketId: "",
shopId: "",
unitType: "",
tableData: [
{
levelName: "",
requiredGrowthValue: 0,
growthValueUpperLimit: 999999999,
enableMemberDiscount: false,
enablePointsRedemption: false,
enableBirthdayCoupons: false,
enableBirthdayReward: false,
discountRate: "",
rewardEffectiveTimeType: "",
memberLevelCouponsList: "",
},
],
},
};
},
methods: {
queryTableData(pageNo, pageSize) {
setTimeout(() => {
setTimeout(() => {
this.$refs.oTableThree.complete([
{
levelName: "",
requiredGrowthValue: 0,
growthValueUpperLimit: 999999999,
enableMemberDiscount: false,
enablePointsRedemption: false,
enableBirthdayCoupons: false,
enableBirthdayReward: false,
discountRate: "",
rewardEffectiveTimeType: "",
memberLevelCouponsList: "",
},
]);
});
}, 10);
},
toggle(e) {
if (this.modalConfig.show == false) {
this.modalConfig.show = true;
this.$nextTick(() => {
this.$refs.oTableThree.doLayout();
});
} else {
this.modalConfig.show = false;
}
if (e) {
this.init(cloneDeep(e.row));
}
return {
add: () => {
this.modalData = {};
this.queryTableData();
this.isAdd = true;
},
update: (id) => {
this.isAdd = false;
},
};
},
init(row) {
this.modalData = row;
},
addCouponData(data) {
console.log(data);
let row = JSON.parse(JSON.stringify(data));
this.modalData.tableData[this.couponIndex].memberLevelCouponsList = [row];
},
},
computed: {
tableCols() {
return [
{
title: "序号",
type: "seq",
align: "center",
width: "60px",
},
{
title: "等级名称",
field: "typeName",
align: "center",
width: "150px",
type: "jsx",
render: (e) => {
let row = e.row;
return (
<el-form-item
prop={`tableData.${e.$rowIndex}.levelName`}
rules={{
required: true,
message: "请输入等级名称",
}}
>
<el-input
v-model={row.levelName}
placeholder="请输入等级名称"
></el-input>
</el-form-item>
);
},
},
{
title: "所需成长值",
field: "requiredGrowthValue",
align: "center",
width: "170px",
type: "jsx",
render: (e) => {
return (
<el-form-item
prop={`tableData.${e.$rowIndex}.requiredGrowthValue`}
rules={{
required: true,
message: "请输入所需成长值",
}}
>
<el-input-number
disabled={e.$rowIndex == 0}
style="width:150px"
controls-position="right"
precision={0}
v-model={e.row.requiredGrowthValue}
min={0}
max={999999999}
label="请输入"
></el-input-number>
</el-form-item>
);
},
},
{
title: "成长值上限",
field: "growthValueUpperLimit",
align: "center",
width: "170px",
type: "jsx",
render: (e) => {
return (
<el-form-item
prop={`tableData.${e.$rowIndex}.requiredGrowthValue`}
rules={{
required: true,
message: "请输入所需成长值",
}}
>
<el-input-number
disabled={this.modalData.tableData.length == e.$rowIndex + 1}
style="width:150px"
controls-position="right"
precision={0}
v-model={e.row.growthValueUpperLimit}
min={0}
max={999999999}
label="请输入"
></el-input-number>
</el-form-item>
);
},
},
{
title: "开启会员折扣",
field: "enableMemberDiscount",
align: "center",
width: "120px",
type: "jsx",
render: ({ row }) => {
let changeDiscountRate = () => {
if (!row.enableMemberDiscount) {
row.discountRate = "";
}
};
return (
<el-switch
onchange={changeDiscountRate}
v-model={row.enableMemberDiscount}
></el-switch>
);
},
},
{
title: "折扣率(折)",
field: "discountRate",
align: "center",
width: "170px",
type: "jsx",
render: (e) => {
if (e.row.enableMemberDiscount) {
return (
<el-form-item
prop={`tableData.${e.$rowIndex}.discountRate`}
rules={{
required: true,
message: "请输入所需成长值",
}}
>
<el-input-number
style="width:150px"
controls-position="right"
precision={1}
v-model={e.row.discountRate}
min={0}
max={9.9}
label="请输入"
></el-input-number>
</el-form-item>
);
} else {
return <div></div>;
}
},
},
{
title: "开启积分兑换",
field: "enableMemberDiscount",
align: "center",
width: "120px",
type: "jsx",
render: ({ row }) => {
return <el-switch v-model={row.enablePointsRedemption}></el-switch>;
},
},
{
title: "开启生日优惠券",
field: "enableBirthdayCoupons",
align: "center",
width: "120px",
type: "jsx",
render: ({ row }) => {
let changeCouponsList = () => {
if (!row.enableBirthdayCoupons) {
row.memberLevelCouponsList = "";
}
};
return (
<el-switch
onchange={changeCouponsList}
v-model={row.enableBirthdayCoupons}
></el-switch>
);
},
},
{
title: "添加生日优惠卷",
field: "memberLevelCouponsList",
align: "center",
width: "150px",
type: "jsx",
render: (e) => {
let addCouponsList = () => {
this.couponIndex = e.$rowIndex;
this.$refs.addCoupon.toggle().add(e.row.memberLevelCouponsList);
console.log(e.row.memberLevelCouponsList);
};
if (e.row.enableBirthdayCoupons) {
return (
<el-form-item
prop={`tableData.${e.$rowIndex}.memberLevelCouponsList`}
rules={{
required: true,
message: "请添加优惠卷",
}}
>
<el-button
size="mini"
onClick={addCouponsList}
type="primary"
>
添加优惠卷
</el-button>
</el-form-item>
);
} else {
return <div></div>;
}
},
},
{
title: "开启生日双倍积分",
field: "enableBirthdayReward",
align: "center",
width: "120px",
type: "jsx",
render: ({ row }) => {
let changeReward = () => {
if (!row.enableBirthdayReward) {
row.rewardEffectiveTimeType = "";
}
};
return (
<el-switch
onchange={changeReward}
v-model={row.enableBirthdayReward}
></el-switch>
);
},
},
{
title: "双倍积分有效时间",
field: "rewardEffectiveTimeType",
align: "center",
width: "120px",
type: "jsx",
render: (e) => {
if (e.row.enableBirthdayReward) {
return (
<el-form-item
prop={`tableData.${e.$rowIndex}.rewardEffectiveTimeType`}
rules={{
required: true,
message: "请输入所需成长值",
}}
>
<el-select
size="mini"
v-model={e.row.rewardEffectiveTimeType}
placeholder="请选择"
>
{[
{ label: "当天", value: "1" },
{
label: "当月",
value: "2",
},
].map((item) => {
return (
<el-option
label={item.label}
value={item.value}
></el-option>
);
})}
</el-select>
</el-form-item>
);
} else {
return <div></div>;
}
},
},
{
title: "操作",
fixed: "right",
type: "jsx",
width: "200px",
align: "center",
render: (e) => {
let add = () => {
console.log(e);
this.modalData.tableData.splice(e.$rowIndex + 1, 0, {
levelName: "",
requiredGrowthValue: "0",
growthValueUpperLimit: "999999999",
enableMemberDiscount: false,
enablePointsRedemption: false,
enableBirthdayCoupons: false,
enableBirthdayReward: false,
discountRate: "",
rewardEffectiveTimeType: "",
memberLevelCouponsList: "",
});
};
let remove = () => {
this.modalData.tableData.splice(e.$rowIndex, 1);
};
return (
<div>
<el-button
v-show={this.modalData.tableData.length == e.$rowIndex + 1}
style="margin-right: 10px"
type="primary"
size="mini"
onClick={add}
slot="reference"
>
添加
</el-button>
{this.modalData.tableData.length > 1 && e.$rowIndex != 0 ? (
<el-popconfirm title="确认要删除吗?" onConfirm={remove}>
<el-button
class="ml-1"
type="danger"
size="mini"
slot="reference"
>
删除
</el-button>
</el-popconfirm>
) : null}
</div>
);
},
},
];
},
modalHandles() {
return [
{
label: "取消",
handle: debounce(() => {
this.toggle();
}, 300),
},
{
label: this.isAdd ? "确认添加" : "确认修改",
type: "primary",
handle: debounce(() => {
this.modalData.marketId = this.marketId;
this.modalData.shopId = this.shopId;
this.modalData.unitType = JSON.parse(
sessionStorage.getItem("userInfo")
).unitType;
console.log(this.modalData);
this.$refs.modalForm.validate((valid) => {
console.log(valid);
});
}, 300),
},
];
},
},
asyncComputed: {},
};
</script>

View File

@ -0,0 +1,226 @@
<template>
<div style="height: calc(100vh - 200px)">
<obj-table-plus
ref="oTable"
style="height: 100%"
:tableCols="tableCols"
:tableProp="tableProp"
@query="queryList"
v-model="dataList"
:tableEvent="tableEvent"
:enableAutoQuery="false"
>
<template slot="tableTop">
<el-form :inline="true" :model="formInline" class="demo-form-inline">
<el-form-item label="商品ID">
<el-input
placeholder="请输入商品ID"
v-model="formInline.name"
></el-input>
</el-form-item>
<el-form-item label="商品名称">
<el-input
placeholder="请输入商品名称"
v-model="formInline.name"
></el-input>
</el-form-item>
<el-form-item label="商品状态">
<el-select
@change="getData"
v-model="formInline.marketId"
placeholder="请选择"
>
<el-option
v-for="item in marketList"
:key="item.marketId"
:label="item.marketName"
:value="item.marketId"
></el-option>
</el-select>
</el-form-item>
<el-form-item label="积分数量">
<el-input
placeholder="请输入手机号"
v-model="formInline.name"
></el-input>
</el-form-item>
<el-form-item>
<el-button type="primary" @click="$refs.oTable.reload()"
>查询</el-button
>
<el-button type="primary" @click="$refs.oTable.reload()"
>重置</el-button
>
</el-form-item>
</el-form>
<div class="mb-2">
<el-button type="primary" size="small">+添加</el-button>
</div>
</template>
</obj-table-plus>
<!-- 添加或编辑 -->
<!-- <add-or-update
@queryList="$refs.oTable.reload()"
ref="addOrUpdate"
></add-or-update> -->
<!-- 查看详情 -->
<!-- <viewDetails ref="viewDetails"></viewDetails> -->
</div>
</template>
<script>
// import AddOrUpdate from "./popup/add-or-update.vue";
// import viewDetails from "./popup/view-details.vue";
import { mapState } from "vuex";
export default {
// components: { AddOrUpdate },
data() {
return {
dataList: [],
formInline: {
marketId: "",
shopId: "",
unitType: "",
},
tableProp: {
"auto-resize": true,
border: true,
height: "auto",
"row-id": "id",
"show-overflow": false,
},
productFilterType: "SALE",
selectList: [],
value1: [],
};
},
created() {
this.formInline = {
unitType: JSON.parse(sessionStorage.getItem("userInfo")).unitType,
marketId: this.marketId,
shopId: "",
};
this.$nextTick(() => {
this.$refs.oTable.reload();
});
},
methods: {
getData() {
this.$api.mer_admin
.storeList({ marketId: this.formInline.marketId })
.then((res) => {
this.storeList = res.data.data;
// this.formInline.shopId = res.data.data[0].shopId;
this.$nextTick(() => {
this.$refs.oTable.reload();
});
});
},
queryList(pageNo, pageSize) {
this.$api.marketing
.marketingUserPage({
pageNumber: pageNo,
pageSize: pageSize,
...this.formInline,
})
.then((res) => {
console.log(res);
this.$refs.oTable.complete(
res.data.data.data,
Number(res.data.data.total)
);
})
.catch((err) => {
this.$refs.oTable.complete(false);
});
},
},
computed: {
tableCols() {
return [
{ type: "checkbox", width: "60px", fixed: "left" },
// { type: "seq", width: "60px", align: "center", title: "" },
{
title: "商品ID",
align: "center",
field: "name",
},
{
title: "商品名称",
align: "center",
field: "publisher",
type: "jsx",
render: ({ row }) => {
if (row.publisher === "MERCHANT") {
return <span>店铺</span>;
} else if (row.publisher == "PLATFORM") {
return <span>平台</span>;
}
},
},
{
title: "兑换积分",
align: "center",
field: "name",
},
{
title: "剩余兑换库存",
align: "center",
field: "name",
},
{
title: "兑换状态",
align: "center",
field: "name",
},
{
title: "已兑换数",
align: "center",
field: "name",
},
{
title: "操作",
fixed: "right",
type: "jsx",
align: "center",
width: "140px",
render: (row) => {
let edit = () => {
// this.$refs.viewDetails.toggle(row).update();
};
return (
<div>
<el-button size="mini" type="primary" onClick={edit}>
编辑
</el-button>
<el-button size="mini" type="danger" onClick={edit}>
删除
</el-button>
</div>
);
},
},
];
},
tableEvent() {
return {
"checkbox-all": ({ records, reserves }) => {
this.selectList = [...records, ...reserves];
},
"checkbox-change": ({ records, reserves }) => {
this.selectList = [...records, ...reserves];
},
};
},
...mapState("userData", [
"isMerchant",
"marketList",
"storeList",
"marketId",
"shopId",
]),
},
};
</script>
<style lang="scss" scoped></style>

View File

@ -0,0 +1,375 @@
<template>
<div>
<div v-if="isShopId" style="height: calc(100vh - 200px)">
<obj-table-plus
ref="oTable"
style="height: 100%"
:tableCols="tableCols"
:tableProp="tableProp"
@query="queryList"
v-model="dataList"
:tableEvent="tableEvent"
:enableAutoQuery="false"
>
<template slot="tableTop">
<el-form :inline="true" :model="formInline" class="demo-form-inline">
<el-form-item label="订单号">
<el-input
v-model="formInline.name"
placeholder="订单号搜索"
></el-input>
</el-form-item>
<el-form-item label="商品名称">
<el-input
v-model="formInline.name"
placeholder="商品名称或id"
></el-input>
</el-form-item>
<el-form-item label="下单时间">
<el-date-picker
v-model="value1"
type="datetimerange"
start-placeholder="开始日期"
end-placeholder="结束日期"
>
</el-date-picker>
</el-form-item>
<el-form-item>
<el-button type="primary" @click="$refs.oTable.reload()"
>查询</el-button
>
<el-button type="primary" @click="Reset">重置</el-button>
</el-form-item>
</el-form>
<el-tabs v-model="activeName" @tab-click="handleClick">
<el-tab-pane
v-for="item in statusList"
:key="item.value"
:label="item.label"
:name="item.value"
></el-tab-pane>
</el-tabs>
<div class="mb-2">
<el-button type="primary" size="small" @click="addProduct"
>批量导出</el-button
>
</div>
</template>
</obj-table-plus>
<!-- 添加或编辑 -->
<!-- <add-or-update
:marketId="formInline.marketId"
:shopId="formInline.shopId"
@queryList="$refs.oTable.reload()"
ref="addOrUpdate"
></add-or-update> -->
</div>
<div style="height: calc(100vh - 200px)" v-else>
<el-empty :image-size="200" description="您不是摊主哦"></el-empty>
</div>
</div>
</template>
<script>
// import AddDiscount from "./popup/add-discount.vue";
// import AddPrice from "./popup/add-price.vue";
// import AddOrUpdate from "./popup/add-or-update.vue";
// import earlyWarning from "./popup/early-warning.vue";
export default {
// components: { earlyWarning, AddOrUpdate },
data() {
return {
activeName: "5",
value1: "1",
advanceSellStatus: "",
dataList: [],
formInline: {
name: "",
marketId: "",
shopId: "",
},
marketList: [],
tableProp: {
"auto-resize": true,
border: true,
height: "auto",
"row-id": "id",
"show-overflow": false,
},
statusList: [
{
label: "全部",
value: "5",
},
{
label: "代发货",
value: "0",
},
{
label: "带收货",
value: "1",
},
{
label: "待评价",
value: "2",
},
{
label: "已取消",
value: "3",
},
{
label: "交易关闭",
value: "3",
},
{
label: "已完成",
value: "3",
},
],
productFilterType: "SALE",
selectList: [],
isShopId: "",
storeList: [],
};
},
created() {
if (JSON.parse(sessionStorage.getItem("userInfo")).markets?.length > 0) {
this.isShopId = true;
this.formInline.marketId = JSON.parse(
sessionStorage.getItem("userInfo")
).markets[0].marketId;
this.marketList = JSON.parse(sessionStorage.getItem("userInfo")).markets;
console.log(this.marketList);
this.getData();
} else if (JSON.parse(sessionStorage.getItem("userInfo")).shopId) {
(this.formInline.shopId = JSON.parse(
sessionStorage.getItem("userInfo")
).shopId),
(this.isShopId = true);
this.$nextTick(() => {
this.$refs.oTable.reload();
});
} else {
this.isShopId = false;
}
},
methods: {
getData() {
this.$api.mer_admin
.storeList({ marketId: this.formInline.marketId })
.then((res) => {
this.storeList = res.data.data;
this.formInline.shopId = res.data.data[0].shopId;
this.$nextTick(() => {
this.$refs.oTable.reload();
});
});
},
addProduct() {
this.$refs.addOrUpdate.toggle().add();
},
deleteProduct() {
console.log(this.selectList);
let integers = this.selectList.map((item) => {
return item.id;
});
this.$confirm("此操作将删除该商品, 是否继续?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
})
.then(() => {
console.log("111");
this.$api.mer_admin.BatchDeleteProducts(integers).then((res) => {
this.$refs.oTable.reload();
});
})
.catch(() => {
this.$message({
type: "info",
message: "已取消删除",
});
});
},
queryList(pageNo, pageSize) {
this.$api.preSale
.preSaleProducts({
pageNumber: pageNo,
pageSize: pageSize,
...this.formInline,
advanceSellStatus: this.advanceSellStatus,
merchantId: JSON.parse(sessionStorage.getItem("userInfo")).merchantId,
productQuerySortParam: [],
})
.then((res) => {
console.log(res);
this.$refs.oTable.complete(
res.data.data.data,
Number(res.data.data.total)
);
})
.catch((err) => {
this.$refs.oTable.complete(false);
});
},
Reset() {
this.formInline = {
name: "",
marketId: JSON.parse(sessionStorage.getItem("userInfo")).markets[0]
.marketId,
};
this.$refs.oTable.reload();
},
handleClick(e) {
console.log(e.name);
if (e.name == "5") {
this.advanceSellStatus = "";
} else {
this.advanceSellStatus = e.name;
}
this.$refs.oTable.reload();
},
addEarlyWarning() {
this.$refs.earlyWarning.toggle().add();
},
},
computed: {
tableCols() {
return [
{ type: "checkbox", width: "60px", fixed: "left" },
// { type: "seq", width: "60px", align: "center", title: "" },
{
title: "订单号",
align: "center",
field: "id",
},
{
title: "订单商品",
field: "productPhotoList",
align: "center",
width: "80px",
type: "jsx",
render: ({ row }) => {
if (row.productPhotoList.length > 0) {
return (
<el-image
preview-src-list={row.productPhotoList.map((item) => {
return item.url;
})}
src={row.productPhotoList[0].url}
></el-image>
);
} else {
return <span>暂无商品图</span>;
}
},
},
{
title: "规格/数量",
align: "center",
field: "startTime",
type: "jsx",
render: ({ row }) => {
return (
<span>
{row.startTime}{row.endTime}
</span>
);
},
},
{
title: "兑换积分",
align: "center",
field: "minSalePrice",
type: "jsx",
render: ({ row }) => {
return (
<span>
{row.balancePaymentStartTime}{row.balancePaymentEndTime}
</span>
);
},
},
{
title: "下单时间",
align: "center",
field: "presalePrice",
type: "jsx",
render: ({ row }) => {
if (
Math.min.apply(
Math,
row.productSpecificationList.map((item) => item.presalePrice)
) ==
Math.max.apply(
Math,
row.productSpecificationList.map((item) => item.presalePrice)
)
) {
return (
<span>
{Math.min.apply(
Math,
row.productSpecificationList.map(
(item) => item.presalePrice
)
)}
</span>
);
} else {
return (
<span>
{Math.min.apply(
Math,
row.productSpecificationList.map(
(item) => item.presalePrice
)
)}
{Math.max.apply(
Math,
row.productSpecificationList.map(
(item) => item.presalePrice
)
)}
</span>
);
}
},
},
{
title: "操作",
fixed: "right",
type: "jsx",
align: "center",
width: "100px",
render: ({ row }) => {
let changeInventory = () => {
this.$refs.addStock.toggle(row).update();
};
return (
<div>
<el-button size="mini" type="primary" onClick={changeInventory}>
查看
</el-button>
</div>
);
},
},
];
},
tableEvent() {
return {
"checkbox-all": ({ records, reserves }) => {
this.selectList = [...records, ...reserves];
},
"checkbox-change": ({ records, reserves }) => {
this.selectList = [...records, ...reserves];
},
};
},
},
};
</script>
<style lang="scss" scoped></style>

View File

@ -0,0 +1,129 @@
<template>
<div>
<div class="tips">
此页面数据在每日0点提交并生效;请勿频繁操作以免影响用户体验
</div>
<div class="tipsLevel">积分/成长值任务9</div>
<div class="tipsLevel" v-if="storeList.length > 0">
<el-select v-model="formInline.shopId" placeholder="请选择">
<el-option
v-for="item in storeList"
:key="item.shopId"
:label="item.shopName"
:value="item.shopId"
>
</el-option>
</el-select>
<el-button style="margin-left: 20px" @click="getList" type="primary"
>查询</el-button
>
</div>
<el-table :data="list" :border="true" style="width: 100%">
<el-table-column align="center" label="任务名称" prop="taskName" />
<el-table-column align="center" label="任务描述" prop="taskConfigDetail" />
<el-table-column
align="center"
label="排序"
prop="taskSort"
/>
<el-table-column
align="center"
label="状态"
prop="packageEffectiveTimeUnit"
>
<template v-slot="scope">
<span>{{
scope.row.packageEffectiveTimeUnit == 1 ? "年" : "月"
}}</span>
</template>
</el-table-column>
<el-table-column align="center" label="操作" fixed="right" width="240">
<template v-slot="scope">
<el-button @click="add(scope.row)" type="primary">编辑</el-button>
<el-button @click="add(scope.row)" type="primary">转移</el-button>
<el-popconfirm
confirm-button-text="确定"
cancel-button-text="取消"
icon-color="#626AEF"
title="确定删除吗?"
@confirm="confirmEvent(scope.row)"
@cancel="cancelEvent"
>
<template #reference>
<el-button type="danger">删除</el-button>
</template>
</el-popconfirm>
</template>
</el-table-column>
</el-table>
</div>
</template>
<script>
import { mapState } from "vuex";
export default {
data() {
return {
list: [],
formInline: {
unitType: "1",
marketId: "",
shopId: "",
},
};
},
created() {
this.formInline = {
unitType: JSON.parse(sessionStorage.getItem("userInfo")).unitType,
marketId: this.marketId,
shopId: this.shopId,
};
this.getList();
},
methods: {
// getData() {
// this.$api.mer_admin
// .storeList({ marketId: this.formInline.marketId })
// .then((res) => {
// this.storeList = res.data.data;
// this.formInline.shopId = res.data.data[0].shopId;
// this.$nextTick(() => {
// this.getList();
// });
// });
// },
getList() {
this.$api.marketing.integralList(this.formInline).then((res) => {
this.list = res.data.data;
});
},
add() {},
confirmEvent() {},
cancelEvent() {},
},
computed: {
...mapState("userData", [
"isMerchant",
"marketList",
"storeList",
"marketId",
"shopId",
]),
},
};
</script>
<style scoped lang="scss" >
.tips {
padding: 15px;
margin-bottom: 20px;
border-radius: 10px;
width: 100%;
font-size: 16px;
background: #e5e5e5;
color: #faa639;
}
.tipsLevel {
margin: 20px 0;
}
</style>

View File

@ -0,0 +1,315 @@
<template>
<div style="height: calc(100vh - 200px)">
<obj-table-plus
ref="oTable"
style="height: 100%"
:tableCols="tableCols"
:tableProp="tableProp"
@query="queryList"
v-model="dataList"
:tableEvent="tableEvent"
:enableAutoQuery="false"
>
<template slot="tableTop">
<el-form :inline="true" :model="formInline" class="demo-form-inline">
<el-form-item label="用户ID">
<el-input
placeholder="请输入用户ID"
v-model="formInline.name"
></el-input>
</el-form-item>
<el-form-item label="用户昵称">
<el-input
placeholder="请输入用户昵称"
v-model="formInline.name"
></el-input>
</el-form-item>
<el-form-item label="会员等级">
<el-select
@change="getData"
v-model="formInline.marketId"
placeholder="请选择会员等级"
>
<el-option
v-for="item in marketList"
:key="item.marketId"
:label="item.marketName"
:value="item.marketId"
></el-option>
</el-select>
</el-form-item>
<el-form-item label="手机号">
<el-input
placeholder="请输入手机号"
v-model="formInline.name"
></el-input>
</el-form-item>
<el-form-item label="会员状态">
<el-select
@change="getData"
v-model="formInline.marketId"
placeholder="请选择会员状态"
>
<el-option
v-for="item in marketList"
:key="item.marketId"
:label="item.marketName"
:value="item.marketId"
></el-option>
</el-select>
</el-form-item>
<el-form-item label="注册时间">
<el-date-picker
v-model="value1"
type="datetimerange"
start-placeholder="开始日期"
end-placeholder="结束日期"
>
</el-date-picker>
</el-form-item>
<el-form-item label="生日">
<el-date-picker
v-model="value1"
type="datetimerange"
start-placeholder="开始日期"
end-placeholder="结束日期"
>
</el-date-picker>
</el-form-item>
<el-form-item label="会员性别">
<el-select
@change="getData"
v-model="formInline.marketId"
placeholder="全部"
>
<el-option
v-for="item in marketList"
:key="item.marketId"
:label="item.marketName"
:value="item.marketId"
></el-option>
</el-select>
</el-form-item>
<!-- <el-form-item v-if="marketList.length > 0" label="菜市场">
<el-select
@change="getData"
v-model="formInline.marketId"
placeholder="请选择菜市场"
>
<el-option
v-for="item in marketList"
:key="item.marketId"
:label="item.marketName"
:value="item.marketId"
></el-option>
</el-select>
</el-form-item>
<el-form-item v-if="marketList.length > 0" label="店铺">
<el-select v-model="formInline.shopId" placeholder="请选择店铺">
<el-option
v-for="item in storeList"
:key="item.shopId"
:label="item.shopName"
:value="item.shopId"
></el-option>
</el-select>
</el-form-item> -->
<el-form-item>
<el-button type="primary" @click="$refs.oTable.reload()"
>查询</el-button
>
<el-button type="primary" @click="$refs.oTable.reload()"
>重置</el-button
>
</el-form-item>
</el-form>
</template>
</obj-table-plus>
<!-- 添加或编辑 -->
<!-- <add-or-update
@queryList="$refs.oTable.reload()"
ref="addOrUpdate"
></add-or-update> -->
<!-- 查看详情 -->
<!-- <viewDetails ref="viewDetails"></viewDetails> -->
</div>
</template>
<script>
// import AddOrUpdate from "./popup/add-or-update.vue";
// import viewDetails from "./popup/view-details.vue";
import { mapState } from "vuex";
export default {
// components: { AddOrUpdate },
data() {
return {
dataList: [],
formInline: {
marketId: "",
shopId: "",
unitType: "",
},
tableProp: {
"auto-resize": true,
border: true,
height: "auto",
"row-id": "id",
"show-overflow": false,
},
productFilterType: "SALE",
selectList: [],
value1: [],
};
},
created() {
this.formInline = {
unitType: JSON.parse(sessionStorage.getItem("userInfo")).unitType,
marketId: this.marketId,
shopId: "",
};
this.$nextTick(() => {
this.$refs.oTable.reload();
});
},
methods: {
getData() {
this.$api.mer_admin
.storeList({ marketId: this.formInline.marketId })
.then((res) => {
this.storeList = res.data.data;
// this.formInline.shopId = res.data.data[0].shopId;
this.$nextTick(() => {
this.$refs.oTable.reload();
});
});
},
queryList(pageNo, pageSize) {
this.$api.marketing
.marketingUserPage({
pageNumber: pageNo,
pageSize: pageSize,
...this.formInline,
})
.then((res) => {
console.log(res);
this.$refs.oTable.complete(
res.data.data.data,
Number(res.data.data.total)
);
})
.catch((err) => {
this.$refs.oTable.complete(false);
});
},
},
computed: {
tableCols() {
return [
{ type: "checkbox", width: "60px", fixed: "left" },
// { type: "seq", width: "60px", align: "center", title: "" },
{
title: "用戶ID",
align: "center",
field: "name",
},
{
title: "用戶头像",
align: "center",
field: "publisher",
type: "jsx",
render: ({ row }) => {
if (row.publisher === "MERCHANT") {
return <span>店铺</span>;
} else if (row.publisher == "PLATFORM") {
return <span>平台</span>;
}
},
},
{
title: "用戶昵称",
align: "center",
field: "name",
},
{
title: "手机号",
align: "center",
field: "name",
},
{
title: "进行中订单数",
align: "center",
field: "name",
},
{
title: "完成订单数",
align: "center",
field: "name",
},
{
title: "消费金额(元)",
align: "center",
field: "name",
},
{
title: "会员等级",
align: "center",
field: "money",
},
{
title: "生日",
align: "center",
field: "discount",
},
{
title: "注册时间",
align: "center",
field: "minPrice",
},
{
title: "限量",
align: "center",
field: "limitedNum",
},
{
title: "操作",
fixed: "right",
type: "jsx",
align: "center",
width: "140px",
render: (row) => {
let edit = () => {
// this.$refs.viewDetails.toggle(row).update();
};
return (
<div>
<el-button size="mini" type="primary" onClick={edit}>
详情
</el-button>
</div>
);
},
},
];
},
tableEvent() {
return {
"checkbox-all": ({ records, reserves }) => {
this.selectList = [...records, ...reserves];
},
"checkbox-change": ({ records, reserves }) => {
this.selectList = [...records, ...reserves];
},
};
},
...mapState("userData", [
"isMerchant",
"marketList",
"storeList",
"marketId",
"shopId",
]),
},
};
</script>
<style lang="scss" scoped></style>

View File

@ -0,0 +1,12 @@
<template>
<div style="height: calc(100vh - 200px)">
预售订单
</div>
</template>
<script>
export default {}
</script>
<style lang="scss" scoped></style>

View File

@ -0,0 +1,562 @@
<template>
<div>
<div v-if="isShopId" style="height: calc(100vh - 200px)">
<obj-table-plus
ref="oTable"
style="height: 100%"
:tableCols="tableCols"
:tableProp="tableProp"
@query="queryList"
v-model="dataList"
:tableEvent="tableEvent"
:enableAutoQuery="false"
>
<template slot="tableTop">
<el-form :inline="true" :model="formInline" class="demo-form-inline">
<el-row v-if="marketList.length > 0">
<el-col :span="24">
<el-form-item label="菜市场">
<el-select
@change="getData"
v-model="formInline.marketId"
placeholder="请选择菜市场"
>
<el-option
v-for="item in marketList"
:key="item.marketId"
:label="item.marketName"
:value="item.marketId"
></el-option>
</el-select>
</el-form-item>
<el-form-item label="店铺">
<el-select
v-model="formInline.shopId"
placeholder="请选择店铺"
>
<el-option
v-for="item in storeList"
:key="item.shopId"
:label="item.shopName"
:value="item.shopId"
></el-option>
</el-select> </el-form-item
></el-col>
</el-row>
<el-form-item label="商品ID">
<el-input
v-model="formInline.name"
placeholder="商品ID搜索"
></el-input>
</el-form-item>
<el-form-item label="商品名称">
<el-input
v-model="formInline.name"
placeholder="商品名称搜索"
></el-input>
</el-form-item>
<el-form-item label="状态">
<el-select v-model="formInline.status" placeholder="请选择状态">
<el-option
v-for="item in statusList"
:key="item.value"
:label="item.label"
:value="item.value"
></el-option>
</el-select>
</el-form-item>
<el-form-item>
<el-button type="primary" @click="$refs.oTable.reload()"
>查询</el-button
>
<el-button type="primary" @click="Reset">重置</el-button>
</el-form-item>
</el-form>
<el-tabs v-model="activeName" @tab-click="handleClick">
<el-tab-pane
v-for="item in statusList"
:key="item.value"
:label="item.label"
:name="item.value"
></el-tab-pane>
</el-tabs>
<div class="mb-2">
<el-button @click="addEarlyWarning" type="primary" size="small"
>库存预警设置</el-button
>
<el-button
:disabled="selectList.length <= 0"
type="danger"
size="small"
@click="deleteProduct"
>批量关闭</el-button
>
<el-button type="primary" size="small" @click="addProduct"
>添加商品</el-button
>
</div>
</template>
</obj-table-plus>
<!-- 添加或编辑 -->
<add-or-update
:marketId="formInline.marketId"
:shopId="formInline.shopId"
@queryList="$refs.oTable.reload()"
ref="addOrUpdate"
></add-or-update>
<!-- 改价格 -->
<!-- <AddPrice ref="AddPrice" @queryList="$refs.oTable.reload()"></AddPrice> -->
<!-- 改库存 -->
<!-- <addStock ref="addStock" @queryList="$refs.oTable.reload()"></addStock> -->
<!-- 打折扣 -->
<earlyWarning
ref="earlyWarning"
@queryList="$refs.oTable.reload()"
></earlyWarning>
</div>
<div style="height: calc(100vh - 200px)" v-else>
<el-empty :image-size="200" description="您不是摊主哦"></el-empty>
</div>
</div>
</template>
<script>
// import AddDiscount from "./popup/add-discount.vue";
// import AddPrice from "./popup/add-price.vue";
import AddOrUpdate from "./popup/add-or-update.vue";
import earlyWarning from "./popup/early-warning.vue";
export default {
components: { earlyWarning, AddOrUpdate },
data() {
return {
activeName: "5",
advanceSellStatus: "",
dataList: [],
formInline: {
name: "",
marketId: "",
shopId: "",
},
marketList: [],
tableProp: {
"auto-resize": true,
border: true,
height: "auto",
"row-id": "id",
"show-overflow": false,
},
statusList: [
{
label: "全部",
value: "5",
},
{
label: "未开始",
value: "0",
},
{
label: "进行中",
value: "1",
},
{
label: "已结束",
value: "2",
},
{
label: "已关闭",
value: "3",
},
],
productFilterType: "SALE",
selectList: [],
isShopId: "",
storeList: [],
};
},
created() {
if (JSON.parse(sessionStorage.getItem("userInfo")).markets?.length > 0) {
this.isShopId = true;
this.formInline.marketId = JSON.parse(
sessionStorage.getItem("userInfo")
).markets[0].marketId;
this.marketList = JSON.parse(sessionStorage.getItem("userInfo")).markets;
console.log(this.marketList);
this.getData();
} else if (JSON.parse(sessionStorage.getItem("userInfo")).shopId) {
(this.formInline.shopId = JSON.parse(
sessionStorage.getItem("userInfo")
).shopId),
(this.isShopId = true);
this.$nextTick(() => {
this.$refs.oTable.reload();
});
} else {
this.isShopId = false;
}
},
methods: {
getData() {
this.$api.mer_admin
.storeList({ marketId: this.formInline.marketId })
.then((res) => {
this.storeList = res.data.data;
this.formInline.shopId = res.data.data[0].shopId;
this.$nextTick(() => {
this.$refs.oTable.reload();
});
});
},
addProduct() {
this.$refs.addOrUpdate.toggle().add();
},
deleteProduct() {
console.log(this.selectList);
let integers = this.selectList.map((item) => {
return item.id;
});
this.$confirm("此操作将删除该商品, 是否继续?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
})
.then(() => {
console.log("111");
this.$api.mer_admin.BatchDeleteProducts(integers).then((res) => {
this.$refs.oTable.reload();
});
})
.catch(() => {
this.$message({
type: "info",
message: "已取消删除",
});
});
},
queryList(pageNo, pageSize) {
this.$api.preSale
.preSaleProducts({
pageNumber: pageNo,
pageSize: pageSize,
...this.formInline,
advanceSellStatus: this.advanceSellStatus,
merchantId: JSON.parse(sessionStorage.getItem("userInfo")).merchantId,
productQuerySortParam: [],
})
.then((res) => {
console.log(res);
this.$refs.oTable.complete(
res.data.data.data,
Number(res.data.data.total)
);
})
.catch((err) => {
this.$refs.oTable.complete(false);
});
},
Reset() {
this.formInline = {
name: "",
marketId: JSON.parse(sessionStorage.getItem("userInfo")).markets[0]
.marketId,
};
this.$refs.oTable.reload();
},
handleClick(e) {
console.log(e.name);
if (e.name == "5") {
this.advanceSellStatus = "";
} else {
this.advanceSellStatus = e.name;
}
this.$refs.oTable.reload();
},
addEarlyWarning() {
this.$refs.earlyWarning.toggle().add();
},
},
computed: {
tableCols() {
return [
{ type: "checkbox", width: "60px", fixed: "left" },
// { type: "seq", width: "60px", align: "center", title: "" },
{
title: "商品ID",
align: "center",
field: "id",
},
{
title: "商品图",
field: "productPhotoList",
align: "center",
width: "80px",
type: "jsx",
render: ({ row }) => {
if (row.productPhotoList.length > 0) {
return (
<el-image
preview-src-list={row.productPhotoList.map((item) => {
return item.url;
})}
src={row.productPhotoList[0].url}
></el-image>
);
} else {
return <span>暂无商品图</span>;
}
},
},
{
title: "定金支付时间",
align: "center",
field: "startTime",
type: "jsx",
render: ({ row }) => {
return (
<span>
{row.startTime}{row.endTime}
</span>
);
},
},
{
title: "尾款支付时间",
align: "center",
field: "minSalePrice",
type: "jsx",
render: ({ row }) => {
return (
<span>
{row.balancePaymentStartTime}{row.balancePaymentEndTime}
</span>
);
},
},
{
title: "预售价",
align: "center",
field: "presalePrice",
type: "jsx",
render: ({ row }) => {
if (
Math.min.apply(
Math,
row.productSpecificationList.map((item) => item.presalePrice)
) ==
Math.max.apply(
Math,
row.productSpecificationList.map((item) => item.presalePrice)
)
) {
return (
<span>
{Math.min.apply(
Math,
row.productSpecificationList.map(
(item) => item.presalePrice
)
)}
</span>
);
} else {
return (
<span>
{Math.min.apply(
Math,
row.productSpecificationList.map(
(item) => item.presalePrice
)
)}
{Math.max.apply(
Math,
row.productSpecificationList.map(
(item) => item.presalePrice
)
)}
</span>
);
}
},
},
{
title: "定金",
align: "center",
field: "earnestMoney",
type: "jsx",
render: ({ row }) => {
if (
Math.min.apply(
Math,
row.productSpecificationList.map((item) => item.earnestMoney)
) ==
Math.max.apply(
Math,
row.productSpecificationList.map((item) => item.earnestMoney)
)
) {
return (
<span>
{Math.min.apply(
Math,
row.productSpecificationList.map(
(item) => item.earnestMoney
)
)}
</span>
);
} else {
return (
<span>
{Math.min.apply(
Math,
row.productSpecificationList.map(
(item) => item.earnestMoney
)
)}
{Math.max.apply(
Math,
row.productSpecificationList.map(
(item) => item.earnestMoney
)
)}
</span>
);
}
},
},
{
title: "尾款",
align: "center",
field: "balancePayment",
type: "jsx",
render: ({ row }) => {
if (
Math.min.apply(
Math,
row.productSpecificationList.map((item) => item.balancePayment)
) ==
Math.max.apply(
Math,
row.productSpecificationList.map((item) => item.balancePayment)
)
) {
return (
<span>
{Math.min.apply(
Math,
row.productSpecificationList.map(
(item) => item.balancePayment
)
)}
</span>
);
} else {
return (
<span>
{Math.min.apply(
Math,
row.productSpecificationList.map(
(item) => item.balancePayment
)
)}
{Math.max.apply(
Math,
row.productSpecificationList.map(
(item) => item.balancePayment
)
)}
</span>
);
}
},
},
{
title: "状态",
align: "center",
field: "status",
type: "jsx",
render: ({ row }) => {
if (row.advanceSellStatus == "0") {
return <span>未开始</span>;
} else if (row.advanceSellStatus == "1") {
return <span>进行中</span>;
} else if (row.advanceSellStatus == "2") {
return <span>已结束</span>;
} else if (row.advanceSellStatus == "3") {
return <span>已关闭</span>;
}
},
},
{
title: "操作",
fixed: "right",
type: "jsx",
align: "center",
width: "300px",
render: ({ row }) => {
let edit = () => {
console.log(row);
this.$refs.addOrUpdate.toggle(row).update();
};
let close = () => {
this.$api.preSale
.closePreSaleProducts({
productIds: [row.id],
advanceSellStatus: 3,
})
.then((res) => {
this.$refs.oTable.reload();
});
};
let changeInventory = () => {
this.$refs.addStock.toggle(row).update();
};
let setDiscounts = () => {
this.$refs.AddDiscount.toggle(row).update();
};
return (
<div>
<el-button size="mini" type="primary" onClick={changeInventory}>
查看
</el-button>
<el-button
v-show={
row.advanceSellStatus == "0" || row.advanceSellStatus == "1"
}
size="mini"
type="primary"
onClick={edit}
>
编辑
</el-button>
<el-button
v-show={row.advanceSellStatus == "1"}
size="mini"
type="primary"
onClick={close}
>
关闭
</el-button>
</div>
);
},
},
];
},
tableEvent() {
return {
"checkbox-all": ({ records, reserves }) => {
this.selectList = [...records, ...reserves];
},
"checkbox-change": ({ records, reserves }) => {
this.selectList = [...records, ...reserves];
},
};
},
},
};
</script>
<style lang="scss" scoped></style>

View File

@ -0,0 +1,593 @@
<template>
<div>
<obj-modal
ref="modal"
labelWidth="150px"
:modalConfig="modalConfig"
:modalData="modalData"
:modalHandles="modalHandles"
>
<div slot="dialog__content">
<el-form
:model="ruleForm"
:rules="rules"
ref="ruleForm"
label-width="150px"
class="demo-ruleForm"
>
<el-row>
<el-col :span="12">
<el-form-item label="订金支付时间:" prop="startTime">
<el-date-picker
@change="getOrderTime"
format="yyyy-MM-dd HH:mm"
data-format="yyyy-MM-dd HH:mm"
value-format="yyyy-MM-dd HH:mm:ss"
v-model="orderTime"
type="datetimerange"
range-separator="至"
start-placeholder="开始日期"
end-placeholder="结束日期"
:editable="false"
>
</el-date-picker> </el-form-item
></el-col>
<el-col :span="12">
<el-form-item
label="尾款支付时间:"
prop="balancePaymentStartTime"
>
<el-date-picker
@change="getArrearsTime"
format="yyyy-MM-dd"
data-format="yyyy-MM-dd"
value-format="yyyy-MM-dd HH:mm:ss"
v-model="arrears"
type="datetimerange"
range-separator="至"
start-placeholder="开始日期"
end-placeholder="结束日期"
:picker-options="pickerOptions"
>
</el-date-picker> </el-form-item
></el-col>
</el-row>
<el-form-item
label="预计发货时间:"
prop="estimatedStartDeliveryTime"
>
<el-date-picker
format="yyyy-MM-dd HH:mm"
data-format="yyyy-MM-dd HH:mm"
value-format="yyyy-MM-dd HH:mm:ss"
@change="deliveryTime"
v-model="delivery"
type="datetimerange"
range-separator="至"
start-placeholder="开始日期"
end-placeholder="结束日期"
:picker-options="pickerOptions"
>
</el-date-picker>
</el-form-item>
<el-form-item label="定金可退:" prop="isRefundEarnestMoney">
<el-radio v-model="ruleForm.isRefundEarnestMoney" :label="1"
></el-radio
>
<el-radio v-model="ruleForm.isRefundEarnestMoney" :label="2"
></el-radio
>
<span>
选择是用户可在付尾款前申请退定金申请后自动退无需审核或付尾款时间结束后系统自动退定金
</span>
</el-form-item>
<el-form-item v-if="isAdd" label="选择商品:">
<el-button type="primary" @click="selectProduct"
>点击请选择商品</el-button
>
<span> 备注一次最多添加五个商品 </span>
</el-form-item>
<div style="padding: 0 0 0 20px; font-size: 16px; font-weight: 600">
已选择商品
</div>
<div v-if="isAdd" style="padding: 20px">
<div
v-for="item in ruleForm.productList"
:key="item.id"
style="border-top: 1px solid #ccc; padding: 10px 0 0 0"
>
<div style="font-size: 16px; margin-bottom: 20px">
<span>商品ID:{{ item.productId }}</span>
<span style="margin-left: 20px">商品名称:{{ item.name }}</span>
</div>
<el-table
border
ref="multipleTable"
:data="item.productSpecificationList"
tooltip-effect="dark"
style="width: 100%"
@selection-change="handleSelectionChange"
>
<el-table-column align="center" label="是否预售" width="80">
<template slot-scope="scope">
<el-checkbox
:true-label="1"
:false-label="0"
v-model="scope.row.isAdvanceSell"
></el-checkbox>
</template>
</el-table-column>
<el-table-column align="center" label="SKU-ID" prop="id" />
<el-table-column
align="center"
label="规格"
prop="attributeList"
>
<template slot-scope="scope">
<span>{{ scope.row.attributeValue }}</span>
</template>
</el-table-column>
<el-table-column align="center" label="属性" prop="address">
<template slot-scope="scope">
<span>{{
scope.row.attributeList
? scope.row.attributeList[0].attributeName
: "无"
}}</span>
</template>
</el-table-column>
<el-table-column
align="center"
label="销售价"
prop="marketPrice"
width="120"
/>
<el-table-column align="center" label="*是否预售" width="200">
<template slot="header">
<span style="color: red">*预售价</span>
</template>
<template slot-scope="scope">
<el-input-number
v-if="scope.row.isAdvanceSell"
@change="
scope.row.balancePayment =
scope.row.presalePrice - scope.row.earnestMoney
"
v-model="scope.row.presalePrice"
:min="0"
:max="scope.row.marketPrice"
label="请输入销售价"
></el-input-number>
</template>
</el-table-column>
<el-table-column align="center" label="*定金" width="200">
<template slot="header">
<span style="color: red">*定金</span>
</template>
<template slot-scope="scope">
<el-input-number
@change="
scope.row.balancePayment =
scope.row.presalePrice - scope.row.earnestMoney
"
v-if="scope.row.isAdvanceSell"
v-model="scope.row.earnestMoney"
:min="0"
:max="scope.row.presalePrice"
label="请输入订金"
></el-input-number>
</template>
</el-table-column>
<el-table-column align="center" label="尾款" width="200">
<template slot-scope="scope">
<span v-if="scope.row.isAdvanceSell">{{
scope.row.presalePrice
? scope.row.presalePrice - scope.row.earnestMoney
: ""
}}</span>
</template>
</el-table-column>
<el-table-column align="center" label="*预售库存" width="200">
<template slot="header">
<span style="color: red">*预售库存</span>
</template>
<template slot-scope="scope">
<el-input-number
v-if="scope.row.isAdvanceSell"
v-model="scope.row.advanceSellStockNum"
:min="0"
:max="999999"
:step="10"
:precision="0"
label="请输入预售库存"
></el-input-number>
</template>
</el-table-column>
</el-table>
</div>
<el-empty
v-show="ruleForm.productList.length == 0"
description="请选择商品"
></el-empty>
</div>
<div v-else style="padding: 20px">
<div style="border-top: 1px solid #ccc; padding: 10px 0 0 0">
<div style="font-size: 16px; margin-bottom: 20px">
<span>商品ID:{{ ruleForm.productId }}</span>
<span style="margin-left: 20px"
>商品名称:{{ ruleForm.name }}</span
>
</div>
<el-table
border
ref="multipleTable"
:data="ruleForm.productSpecificationList"
tooltip-effect="dark"
style="width: 100%"
@selection-change="handleSelectionChange"
>
<el-table-column align="center" label="是否预售" width="80">
<template slot-scope="scope">
<el-checkbox
:true-label="1"
:false-label="0"
v-model="scope.row.isAdvanceSell"
></el-checkbox>
</template>
</el-table-column>
<el-table-column align="center" label="SKU-ID" prop="id" />
<el-table-column
align="center"
label="规格"
prop="attributeList"
>
<template slot-scope="scope">
<span>{{ scope.row.attributeValue }}</span>
</template>
</el-table-column>
<el-table-column align="center" label="属性" prop="address">
<template slot-scope="scope">
<span>{{
scope.row.attributeList
? scope.row.attributeList[0].attributeName
: "无"
}}</span>
</template>
</el-table-column>
<el-table-column
align="center"
label="销售价"
prop="marketPrice"
width="120"
/>
<el-table-column align="center" label="*是否预售" width="200">
<template slot="header">
<span style="color: red">*预售价</span>
</template>
<template slot-scope="scope">
<el-input-number
v-if="scope.row.isAdvanceSell"
@change="
scope.row.balancePayment =
scope.row.presalePrice - scope.row.earnestMoney
"
v-model="scope.row.presalePrice"
:min="0"
:max="scope.row.marketPrice"
label="请输入销售价"
></el-input-number>
</template>
</el-table-column>
<el-table-column align="center" label="*定金" width="200">
<template slot="header">
<span style="color: red">*定金</span>
</template>
<template slot-scope="scope">
<el-input-number
@change="
scope.row.balancePayment =
scope.row.presalePrice - scope.row.earnestMoney
"
v-if="scope.row.isAdvanceSell"
v-model="scope.row.earnestMoney"
:min="0"
:max="scope.row.presalePrice"
label="请输入订金"
></el-input-number>
</template>
</el-table-column>
<el-table-column align="center" label="尾款" width="200">
<template slot-scope="scope">
<span v-if="scope.row.isAdvanceSell">{{
scope.row.presalePrice
? scope.row.presalePrice - scope.row.earnestMoney
: ""
}}</span>
</template>
</el-table-column>
<el-table-column align="center" label="*预售库存" width="200">
<template slot="header">
<span style="color: red">*预售库存</span>
</template>
<template slot-scope="scope">
<el-input-number
v-if="scope.row.isAdvanceSell"
v-model="scope.row.advanceSellStockNum"
:min="0"
:max="999999"
:step="10"
:precision="0"
label="请输入预售库存"
></el-input-number>
</template>
</el-table-column>
</el-table>
</div>
<el-empty
v-show="ruleForm.productList?.length == 0"
description="请选择商品"
></el-empty>
</div>
</el-form>
</div>
<!-- 选择商品 -->
</obj-modal>
<commodity @getProduct="getProduct" ref="commodity"></commodity>
</div>
</template>
<script>
import commodity from "./commodity.vue";
import { debounce, cloneDeep } from "lodash";
export default {
components: { commodity },
props: {
marketId: {
type: String,
default: "",
},
shopId: {
type: String,
default: "",
},
},
data() {
return {
isAdd: true,
//
modalConfig: {
title: "库存预警设置",
show: false,
width: "1200px",
fullscreen: true,
},
modalData: {},
ruleForm: {
productList: [],
isRefundEarnestMoney: 1, //退 1 2
},
pickerOptions: {
disabledDate(time) {
return time.getTime() < Date.now();
},
},
orderTime: [], //
arrears: [], //
delivery: [], //
tableData: [],
rules: {
startTime: [
{
required: true,
message: "请选择支付时间",
trigger: ["blur", "change"],
},
],
balancePaymentStartTime: [
{
required: true,
message: "请选择尾款支付时间",
trigger: "change",
},
],
estimatedStartDeliveryTime: [
{
required: true,
message: "请选择预计发货时间",
trigger: "change",
},
],
isRefundEarnestMoney: [
{
required: true,
message: "请选择定金可退",
trigger: "change",
},
],
presalePrice: [
{
required: true,
message: "请输入预售价格",
trigger: ["blur", "change"],
},
],
},
};
},
watch: {
"modalConfig.show"(newVal) {
if (newVal) {
//
setTimeout(() => {
this.$refs.ruleForm.resetFields();
});
}
},
},
methods: {
queryTableData(pageNo, pageSize) {},
toggle(e) {
if (this.modalConfig.show == false) {
this.modalConfig.show = true;
} else {
this.modalConfig.show = false;
}
if (e) {
this.init(cloneDeep(e));
}
return {
add: () => {
this.orderTime = [];
this.arrears = [];
this.delivery = [];
this.ruleForm = {
startTime: "",
endTime: "",
balancePaymentStartTime: "",
balancePaymentEndTime: "",
estimatedStartDeliveryTime: "",
estimatedEndDeliveryTime: "",
productList: [],
isRefundEarnestMoney: 1, //退 1 2
};
this.modalConfig.title = "新增预售";
this.isAdd = true;
},
update: () => {
this.modalConfig.title = "编辑预售";
this.isAdd = false;
},
};
},
init(row) {
console.log(row.startTime, row.endTime);
this.orderTime = [row.startTime, row.endTime];
this.arrears = [row.balancePaymentStartTime, row.balancePaymentEndTime];
this.delivery = [
row.estimatedStartDeliveryTime,
row.estimatedEndDeliveryTime,
];
(this.ruleForm = {
productId: row.id,
advanceSellId: row.advanceSellId,
startTime: row.startTime,
name: row.name,
endTime: row.endTime,
balancePaymentStartTime: row.balancePaymentStartTime,
balancePaymentEndTime: row.balancePaymentEndTime,
estimatedStartDeliveryTime: row.estimatedStartDeliveryTime,
estimatedEndDeliveryTime: row.estimatedEndDeliveryTime,
isRefundEarnestMoney: row.isRefundEarnestMoney,
productSpecificationList: row.productSpecificationList,
}),
console.log(this.orderTime, this.arrears, this.delivery);
// this.ruleForm = row;
},
//
getOrderTime(e) {
if (e) {
console.log(e);
this.ruleForm.startTime = e[0];
this.ruleForm.endTime = e[1];
} else {
this.ruleForm.startTime = "";
this.ruleForm.endTime = "";
}
},
//
getArrearsTime(e) {
if (e) {
console.log(e);
this.ruleForm.balancePaymentStartTime = e[0];
this.ruleForm.balancePaymentEndTime = e[1];
} else {
this.ruleForm.balancePaymentStartTime = "";
this.ruleForm.balancePaymentEndTime = "";
}
},
//
deliveryTime(e) {
if (e) {
console.log(e);
this.ruleForm.estimatedStartDeliveryTime = e[0];
this.ruleForm.estimatedEndDeliveryTime = e[1];
} else {
this.ruleForm.estimatedStartDeliveryTime = "";
this.ruleForm.estimatedEndDeliveryTime = "";
}
},
selectProduct() {
console.log("选择商品", this.marketId, this.shopId);
this.$nextTick(() => {
this.$refs.commodity.toggle().add({
marketId: this.marketId,
shopId: this.shopId,
});
});
},
handleSelectionChange(e) {
console.log(e);
},
getProduct(row) {
this.ruleForm.productList = row.map((item) => {
return {
productId: item.id,
name: item.name,
productSpecificationList: item.productSpecificationList,
};
});
console.log(this.ruleForm.productList, this.ruleForm.productList.length);
console.log("获取商品");
},
},
computed: {
modalHandles() {
return [
{
label: "取消",
handle: () => {
this.toggle();
},
},
{
label: "确认",
type: "primary",
// submit: true,
handle: () => {
if (this.isAdd) {
this.$refs.ruleForm.validate((valid) => {
if (valid) {
console.log(valid);
this.$api.preSale
.addPreSaleProducts(this.ruleForm)
.then((res) => {
this.$emit("queryList");
this.toggle();
});
}
});
} else {
this.$refs.ruleForm.validate((valid) => {
if (valid) {
console.log(valid);
this.$api.preSale
.updatePreSaleProducts(this.ruleForm)
.then((res) => {
this.$emit("queryList");
this.toggle();
});
}
});
}
},
},
];
},
},
asyncComputed: {},
};
</script>
<style lang="scss" scoped>
</style>

View File

@ -0,0 +1,230 @@
<template>
<obj-modal
ref="modal"
labelWidth="150px"
:modalConfig="modalConfig"
:modalData="modalData"
:modalHandles="modalHandles"
>
<template slot="dialog__content">
<el-form :inline="true" :model="formInline" class="demo-form-inline">
<el-form-item label="商品搜索">
<el-input v-model="formList.name" placeholder="商品搜索"></el-input>
</el-form-item>
<el-form-item>
<el-button type="primary" @click="queryList">查询</el-button>
<el-button type="primary" @click="Reset">重置</el-button>
</el-form-item>
</el-form>
<el-table
border
ref="multipleTable"
:data="dataList"
tooltip-effect="dark"
style="width: 100%"
@select="select"
@select-all="selectAll"
>
<el-table-column type="selection" width="55"> </el-table-column>
<el-table-column label="商品图" width="100">
<template slot-scope="scope">
<el-image
:preview-src-list="[scope.row.productPhotoList[0].url]"
:src="scope.row.productPhotoList[0].url"
></el-image
></template>
</el-table-column>
<el-table-column prop="name" label="商品名称" />
<el-table-column prop="name" label="商品售价">
<template slot-scope="scope">
<span>{{ getSalePrice(scope.row) }}</span>
</template>
</el-table-column>
<el-table-column prop="address" label="折扣">
<template slot-scope="scope">
<span>{{ scope.row.discountActivity?.ruleObject.discount }}</span>
</template>
</el-table-column>
<el-table-column prop="saleNum" label="销量" />
<el-table-column prop="stockNum" label="库存" />
</el-table>
<div class="pagination-container">
<el-pagination
:current-page="query.pageNumber"
:page-sizes="[10, 20, 30, 50]"
:page-size="query.pageSize"
:total="total"
background
layout="total, sizes, prev, pager, next, jumper"
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
/>
</div>
</template>
</obj-modal>
</template>
<script>
import { debounce, cloneDeep } from "lodash";
export default {
data() {
return {
isAdd: true,
//
modalConfig: {
title: "请点击选择商品 (提示最多选择5个商品)",
show: false,
width: "1000px",
},
query: {
pageNumber: 1,
pageSize: 10,
},
total: 0,
modalData: {},
dataList: [], //
selectList: [],
formInline: {},
formList: {
name: "",
},
};
},
methods: {
queryList() {
this.$api.mer_admin
.getProductPage({
p: {
pageNumber: this.query.pageNumber,
pageSize: this.query.pageSize,
},
...this.formInline,
...this.formList,
productFilterType: "SALE",
merchantId: JSON.parse(sessionStorage.getItem("userInfo")).merchantId,
productQuerySortParam: [],
})
.then((res) => {
console.log(res);
this.dataList = res.data.data.data;
this.total = Number(res.data.data.total);
})
.catch((err) => {
this.dataList = [];
});
},
toggle(e) {
if (this.modalConfig.show == false) {
this.modalConfig.show = true;
} else {
this.modalConfig.show = false;
}
if (e) {
this.init(cloneDeep(e));
}
return {
add: (row) => {
console.log(row);
this.formInline = row;
this.isAdd = true;
this.$nextTick(() => {
this.queryList();
});
},
update: () => {
this.isAdd = false;
},
};
},
init(row) {},
toggleSelection(rows) {
if (rows) {
rows.forEach((row) => {
this.$refs.multipleTable.toggleRowSelection(row);
});
} else {
this.$refs.multipleTable.clearSelection();
}
},
select(selection, row) {
if (selection.length > 5) {
this.$message.error("最多选择5个商品");
this.$refs.multipleTable.toggleRowSelection(row, false);
} else {
this.selectList = selection;
}
},
selectAll(selection) {
if (selection.length > 5) {
this.$message.error("最多选择5个商品");
selection.length = 5;
this.selectList = selection;
console.log(selection);
} else {
this.selectList = selection;
}
},
getSalePrice(row) {
if (row.minSalePrice == row.maxSalePrice) {
return row.minSalePrice;
} else {
return `${row.minSalePrice}~${row.maxSalePrice}`;
}
},
handleSizeChange(val) {
this.query.pageSize = val;
this.getList();
},
handleCurrentChange(val) {
this.query.pageNumber = val;
this.getList();
},
Reset() {
this.formList = {};
this.queryList();
},
},
computed: {
modalHandles() {
return [
{
label: "取消",
handle: () => {
this.toggle();
},
},
{
label: "确认",
type: "primary",
handle: () => {
this.$emit("getProduct", this.selectList);
this.toggle();
},
},
];
},
tableEvent() {
return {
"checkbox-all": ({ records, reserves }) => {
console.log(records, reserves);
this.selectList = [...records, ...reserves];
},
"checkbox-change": ({ records, reserves }) => {
console.log(records, reserves);
if (records.length > 5) {
this.$message.error("最多选择5个商品");
return;
}
this.selectList = [...records, ...reserves];
},
};
},
},
};
</script>
<style lang="scss" scoped>
::v-deep .selectAllbtnDis .cell .el-checkbox__inner {
display: none;
}
</style>

View File

@ -0,0 +1,123 @@
<template>
<div>
<obj-modal
ref="modal"
labelWidth="150px"
:modalConfig="modalConfig"
:modalData="modalData"
:modalHandles="modalHandles"
>
<div slot="dialog__content">
<el-form
:model="ruleForm"
:rules="rules"
ref="ruleForm"
label-width="150px"
class="demo-ruleForm"
>
<el-form-item label="预售剩余库存:" prop="name">
<span style="font-size: 20px; margin-right: 20px"></span>
<el-input-number
v-model="ruleForm.name"
:min="1"
:max="9999"
:precision="0"
:step="1"
label="请输入数量"
></el-input-number>
<span style="font-size: 20px; margin-left: 14px">时通知我</span>
</el-form-item>
<el-form-item label="通知方式:" prop="value">
<el-radio v-model="ruleForm.value" label="1">系统通知</el-radio>
<el-radio v-model="ruleForm.value" label="2">短信通知</el-radio>
</el-form-item>
</el-form>
</div>
</obj-modal>
</div>
</template>
<script>
import { debounce, cloneDeep } from "lodash";
export default {
components: {},
data() {
return {
isAdd: true,
//
modalConfig: {
title: "库存预警设置",
show: false,
width: "800px",
},
modalData: {},
ruleForm: {
name: "",
value: "1",
},
rules: {
name: [{ required: true, message: "请输入属性名称", trigger: "blur" }],
value: [
{
required: true,
message: "请输入属性内容",
trigger: "blur",
},
],
},
};
},
methods: {
queryTableData(pageNo, pageSize) {},
toggle(e) {
if (this.modalConfig.show == false) {
this.modalConfig.show = true;
} else {
this.modalConfig.show = false;
}
if (e) {
this.init(cloneDeep(e.row));
}
return {
add: (data) => {
this.modalConfig.title = "库存预警设置";
this.isAdd = true;
},
update: () => {
this.isAdd = false;
},
};
},
init(row) {
this.modalData = row;
},
},
computed: {
modalHandles() {
return [
{
label: "取消",
handle: () => {
this.toggle();
},
},
{
label: "确认",
type: "primary",
// submit: true,
handle: () => {
this.$refs.ruleForm.validate((valid) => {
if (valid) {
this.$emit("getAttribute", this.ruleForm);
this.toggle();
}
});
},
},
];
},
},
asyncComputed: {},
};
</script>
<style lang="scss" scoped>
</style>

View File

@ -1,6 +1,6 @@
<template>
<div>
<div v-if="shopId" style="height: calc(100vh - 200px)">
<div v-if="isMerchant" style="height: calc(100vh - 200px)">
<obj-table-plus
ref="oTable"
style="height: 100%"
@ -9,6 +9,7 @@
@query="queryList"
v-model="dataList"
:tableEvent="tableEvent"
:enableAutoQuery="false"
>
<template slot="tableTop">
<el-form :inline="true" :model="formInline" class="demo-form-inline">
@ -30,8 +31,12 @@
placeholder="商品搜索"
></el-input>
</el-form-item>
<el-form-item v-if="marketList.length > 0" label="摊铺">
<el-select v-model="formInline.marketId" placeholder="请选择摊铺">
<el-form-item v-if="marketList.length > 0" label="菜市场">
<el-select
@change="getData"
v-model="formInline.marketId"
placeholder="请选择菜市场"
>
<el-option
v-for="item in marketList"
:key="item.marketId"
@ -40,6 +45,16 @@
></el-option>
</el-select>
</el-form-item>
<el-form-item v-if="marketList.length > 0" label="店铺">
<el-select v-model="formInline.shopId" placeholder="请选择店铺">
<el-option
v-for="item in storeList"
:key="item.shopId"
:label="item.shopName"
:value="item.shopId"
></el-option>
</el-select>
</el-form-item>
<el-form-item>
<el-button type="primary" @click="$refs.oTable.reload()"
>查询</el-button
@ -88,6 +103,7 @@
</template>
<script>
import { mapState } from "vuex";
import AddDiscount from "./popup/add-discount.vue";
import AddPrice from "./popup/add-price.vue";
import AddOrUpdate from "./popup/add-or-update.vue";
@ -101,8 +117,8 @@ export default {
formInline: {
name: "",
marketId: "",
shopId: "",
},
marketList: [],
tableProp: {
"auto-resize": true,
border: true,
@ -112,26 +128,32 @@ export default {
},
productFilterType: "SALE",
selectList: [],
shopId: "",
};
},
created() {
if (JSON.parse(sessionStorage.getItem("userInfo")).markets.length > 0) {
this.shopId = true;
this.formInline.marketId = JSON.parse(
sessionStorage.getItem("userInfo")
).markets[0].marketId;
this.marketList = JSON.parse(sessionStorage.getItem("userInfo")).markets;
console.log(this.marketList);
} else if (JSON.parse(sessionStorage.getItem("userInfo")).shopId) {
this.shopId = true;
} else {
this.shopId = false;
}
this.formInline = {
name: "",
marketId: this.marketId,
shopId: this.shopId,
};
this.$nextTick(() => {
this.$refs.oTable.reload();
});
},
methods: {
//
getData() {
this.$api.mer_admin
.storeList({ marketId: this.formInline.marketId })
.then((res) => {
this.formInline.shopId = res.data.data[0].shopId;
this.$nextTick(() => {
this.$refs.oTable.reload();
});
});
},
addProduct() {
this.$refs.addOrUpdate.toggle().add();
this.$refs.addOrUpdate.toggle().add(this.formInline.shopId);
},
deleteProduct() {
console.log(this.selectList);
@ -157,6 +179,8 @@ export default {
});
},
queryList(pageNo, pageSize) {
console.log(this.formInline);
this.$api.mer_admin
.getProductPage({
p: {
@ -166,7 +190,6 @@ export default {
...this.formInline,
productFilterType: this.productFilterType,
merchantId: JSON.parse(sessionStorage.getItem("userInfo")).merchantId,
shopId: JSON.parse(sessionStorage.getItem("userInfo")).shopId,
productQuerySortParam: [],
})
.then((res) => {
@ -183,8 +206,8 @@ export default {
Reset() {
this.formInline = {
name: "",
marketId: JSON.parse(sessionStorage.getItem("userInfo")).markets[0]
.marketId,
marketId: this.marketId,
shopId: this.shopId,
};
this.$refs.oTable.reload();
},
@ -393,6 +416,13 @@ export default {
},
};
},
...mapState("userData", [
"isMerchant",
"marketList",
"storeList",
"marketId",
"shopId",
]),
},
};
</script>

View File

@ -150,6 +150,9 @@ export default {
fileListTwo: [], //
place: "", //
passCheck: [], //
shopId: "",
getProductCategory: [],
getSaleUnit: [],
};
},
mounted() {},
@ -174,7 +177,10 @@ export default {
this.init(cloneDeep(e));
}
return {
add: () => {
add: (shopId) => {
this.shopId = shopId;
this.getData();
console.log(this.shopId);
this.$nextTick(() => {
this.modalConfig.title = "添加商品";
this.modalData = {
@ -192,17 +198,15 @@ export default {
productVideo: "",
shelfLife: "",
shopId: "",
singlePrice: "",
singleStock: "",
specType: 0,
minCostPrice: "",
status: "UP",
};
this.modalData.merchantId = JSON.parse(
sessionStorage.getItem("userInfo")
).merchantId;
this.modalData.shopId = JSON.parse(
sessionStorage.getItem("userInfo")
).shopId;
this.modalData.shopId = shopId;
this.passCheck = [];
this.place = [];
});
@ -218,6 +222,8 @@ export default {
},
init(row) {
console.log(row);
this.shopId = row.shopId;
this.getData();
this.fileList = row.productPhotoList.map((item) => {
return {
name: "",
@ -246,14 +252,22 @@ export default {
}
this.place = row.productPlace.split("-");
this.modalData = row;
this.$set(this.modalData, "singleStock", row.stockNum);
if (row.minSalePrice == row.maxSalePrice) {
this.$set(this.modalData, "singlePrice", row.maxSalePrice);
if (row.minCostPrice == row.maxCostPrice) {
this.$set(this.modalData, "costPrice", row.minCostPrice);
} else {
this.$set(
this.modalData,
"singlePrice",
row.minSalePrice + "~" + row.maxSalePrice
"costPrice",
row.minCostPrice + "~" + row.maxCostPrice
);
}
if (row.minMarketPrice == row.maxMarketPrice) {
this.$set(this.modalData, "marketPrice", row.minMarketPrice);
} else {
this.$set(
this.modalData,
"marketPrice",
row.minMarketPrice + "~" + row.maxMarketPrice
);
}
if (!row.productAttributeList) {
@ -264,6 +278,8 @@ export default {
} else {
this.modalData.otherAttribute = [];
}
console.log(this.modalData);
},
addSpecs() {
console.log("123");
@ -288,9 +304,8 @@ export default {
}
},
//
getSpecs(tableData, AttributeData, salePrice, stockNum) {
getSpecs(tableData, AttributeData) {
console.log(tableData);
this.modalData.specType = 1;
let AttributeList = AttributeData.map((item) => {
return {
@ -300,8 +315,6 @@ export default {
});
this.$set(this.modalData, "productSpecificationList", tableData);
this.$set(this.modalData, "productAttributeList", AttributeList);
this.$set(this.modalData, "singlePrice", salePrice);
this.$set(this.modalData, "singleStock", stockNum);
},
addAttribute() {
if (this.isAdd) {
@ -335,6 +348,18 @@ export default {
});
return state;
},
getData() {
this.$api.mer_admin
.getProductCategory({ shopId: this.shopId })
.then((res) => {
this.getProductCategory = res.data.data;
console.log(res);
});
this.$api.mer_admin.getSaleUnit({ shopId: this.shopId }).then((res) => {
this.getSaleUnit = res.data.data;
console.log(res);
});
},
},
computed: {
modalCols() {
@ -530,12 +555,6 @@ export default {
{
label: "规格",
prop: "productSpecificationList",
// required: true,
// rules: {
// required: true,
// message: "",
// trigger: "blur",
// },
type: "jsx",
render: () => {
return (
@ -547,14 +566,14 @@ export default {
},
{
label: "成本",
prop: "minCostPrice",
prop: "costPrice",
type: "jsx",
render: () => {
return (
<el-input
readonly={this.modalData.specType != 0}
placeholder="请输入价格"
v-model={this.modalData.minCostPrice}
v-model={this.modalData.costPrice}
>
<template slot="append">单位</template>
</el-input>
@ -562,15 +581,15 @@ export default {
},
},
{
label: "",
prop: "singlePrice",
label: "市场价",
prop: "marketPrice",
type: "jsx",
render: () => {
return (
<el-input
readonly={this.modalData.specType != 0}
placeholder="请输入"
v-model={this.modalData.singlePrice}
placeholder="请输入市场价"
v-model={this.modalData.marketPrice}
>
<template slot="append">单位</template>
</el-input>
@ -579,14 +598,14 @@ export default {
},
{
label: "库存",
prop: "singleStock",
prop: "stockNum",
type: "jsx",
render: () => {
return (
<el-input
readonly={this.modalData.specType != 0}
placeholder="请输入库存"
v-model={this.modalData.singleStock}
v-model={this.modalData.stockNum}
></el-input>
);
},
@ -818,9 +837,9 @@ export default {
this.modalData.productSpecificationList = [
{
attributeValue: "默认",
costPrice: this.modalData.minCostPrice,
salePrice: this.modalData.singlePrice,
stockNum: this.modalData.singleStock,
costPrice: this.modalData.costPrice,
marketPrice: this.modalData.marketPrice,
stockNum: this.modalData.stockNum,
weight: this.modalData.weight,
volume: this.modalData.volume,
},
@ -852,9 +871,9 @@ export default {
this.modalData.productSpecificationList = [
{
attributeValue: "默认",
costPrice: this.modalData.minCostPrice,
salePrice: this.modalData.singlePrice,
stockNum: this.modalData.singleStock,
costPrice: this.modalData.costPrice,
marketPrice: this.modalData.marketPrice,
stockNum: this.modalData.stockNum,
weight: this.modalData.weight,
volume: this.modalData.volume,
},
@ -872,18 +891,17 @@ export default {
},
},
asyncComputed: {
async getProductCategory() {
let res = await this.$api.mer_admin.getProductCategory();
return res.data.data;
},
async getSaleUnit() {
let res = await this.$api.mer_admin.getSaleUnit({
shopId: JSON.parse(sessionStorage.getItem("userInfo")).shopId,
});
console.log(res);
return res.data.data;
},
// async getProductCategory() {
// let res = await this.$api.mer_admin.getProductCategory();
// return res.data.data;
// },
// async getSaleUnit() {
// let res = await this.$api.mer_admin.getSaleUnit({
// shopId: JSON.parse(sessionStorage.getItem("userInfo")).shopId,
// });
// console.log(res);
// return res.data.data;
// },
},
};
</script>

View File

@ -268,6 +268,7 @@ export default {
attributeValue: item.name,
salePrice: 0,
costPrice: 0,
marketPrice: 0,
stockNum: 0,
weight: 0,
volume: 0,
@ -286,25 +287,6 @@ export default {
align: "center",
"min-width": "160px",
},
{
title: "价格(元)",
field: "salePrice",
align: "center",
"min-width": "160px",
type: "jsx",
render: ({ row }) => {
return (
<div>
<el-input-number
min={0}
size="small"
v-model={row.salePrice}
placeholder="请输入价格"
></el-input-number>
</div>
);
},
},
{
title: "成本(元)",
field: "costPrice",
@ -316,7 +298,6 @@ export default {
<div>
<el-input-number
min={0}
max={row.salePrice}
size="small"
v-model={row.costPrice}
placeholder="请输入成本"
@ -325,6 +306,25 @@ export default {
);
},
},
{
title: "市场价(元)",
field: "marketPrice",
align: "center",
"min-width": "160px",
type: "jsx",
render: ({ row }) => {
return (
<div>
<el-input-number
min={0}
size="small"
v-model={row.marketPrice}
placeholder="请输入成本"
></el-input-number>
</div>
);
},
},
{
title: "库存",
field: "stockNum",
@ -418,51 +418,10 @@ export default {
disabled: () => this.tableData.length <= 0,
// submit: true,
handle: () => {
let volume = ""; //
let weight = ""; //
let salePrice = ""; //
let stockNum = ""; //
let minSalePrice = Math.min.apply(
Math,
this.tableData.map((item) => {
return item.salePrice;
})
);
let maxSalePrice = Math.max.apply(
Math,
this.tableData.map((item) => {
return item.salePrice;
})
);
let minStockNum = Math.min.apply(
Math,
this.tableData.map((item) => {
return item.stockNum;
})
);
let maxStockNum = Math.max.apply(
Math,
this.tableData.map((item) => {
return item.stockNum;
})
);
if (minSalePrice == maxSalePrice) {
salePrice = maxSalePrice;
} else {
salePrice = minSalePrice + "~" + maxSalePrice;
}
if (minStockNum == maxStockNum) {
stockNum = maxStockNum;
} else {
stockNum = minStockNum + "~" + maxStockNum;
}
this.$emit(
"getSpecs",
this.tableData,
this.AttributeData,
salePrice,
stockNum
);
this.toggle();
},

View File

@ -0,0 +1,477 @@
<template>
<div>
<el-row :gutter="20">
<el-col :span="15"
><div class="grid-content bg-purple">
<div class="userInfo">
<div class="userInfo">
<el-avatar
:size="60"
src="https://cube.elemecdn.com/0/88/03b0d39583f48206768a7534e55bcpng.png"
></el-avatar>
<span class="userName">用户名{{ userInfo.userName }}</span>
</div>
<div>
<el-button
@click="$router.push({ path: 'bank-card-index' })"
type="primary"
round
>绑定银行卡</el-button
>
<el-button @click="addWithdrawal" type="primary" round
>发起提现</el-button
>
</div>
</div>
<div class="userInfo">
<el-card class="box-card">
<div style="font-size: 18px; font-weight: 600">可用金额</div>
<div style="margin-top: 20px; font-size: 18px">
{{
userInfo.availableAmount ? userInfo.availableAmount : "0"
}}
</div>
<div class="userTime">{{ userInfo.updateTime }}</div>
</el-card>
<el-card class="box-card">
<div style="font-size: 18px; font-weight: 600">冻结金额</div>
<div style="margin-top: 20px; font-size: 18px">
{{ userInfo.freezeAmount ? userInfo.freezeAmount : "0" }}
</div>
<div class="userTime">{{ userInfo.updateTime }}</div>
</el-card>
</div>
<div style="margin: 10px">
<div style="font-size: 16px; margin: 0 0 20px 0; font-weight: 600">
钱包提现记录
</div>
<el-form
:inline="true"
:model="formInline"
class="demo-form-inline"
>
<el-form-item label="申请状态">
<el-select
style="width: 140px"
size="mini"
v-model="formInline.cashOutStatus"
placeholder="请选择"
>
<el-option
v-for="item in [
{
label: '审核中',
value: '1',
},
{
label: '审核不通过',
value: '2',
},
{
label: '审核成功',
value: '3',
},
{
label: '提现中',
value: '4',
},
{
label: '提现失败',
value: '5',
},
{
label: '提现成功',
value: '6',
},
]"
:key="item.value"
:label="item.label"
:value="item.value"
>
</el-option>
</el-select>
</el-form-item>
<el-form-item label="申请时间">
<el-date-picker
value-format="yyyy-MM-dd HH:mm:ss"
size="mini"
style="width: 260px"
@change="changeTime"
v-model="value1"
type="datetimerange"
start-placeholder="开始日期"
end-placeholder="结束日期"
>
</el-date-picker>
</el-form-item>
<el-form-item>
<el-button
size="mini"
type="primary"
@click="getWithdrawalRecord"
>查询</el-button
>
<el-button size="mini" type="primary" @click="Reset"
>重置</el-button
>
</el-form-item>
</el-form>
<div>
<el-table
border
height="47vh"
:data="tableData"
style="width: 100%"
>
<el-table-column
align="center"
prop="cashOutOrderNumber"
label="提现申请订单号"
width="180"
>
</el-table-column>
<el-table-column
align="center"
prop="cashOutAmount"
label="提现申请金额"
width="120"
>
</el-table-column>
<el-table-column
align="center"
prop="cashOutStatus"
label="申请状态"
>
<template slot-scope="scope">
<span>{{ getStatus(scope.row.cashOutStatus) }}</span>
</template>
</el-table-column>
<el-table-column
align="center"
prop="cashOutTime"
label="提现申请时间"
>
</el-table-column>
<el-table-column
align="center"
prop="tradeReceivedTime"
label="交易到账时间"
>
</el-table-column>
</el-table>
</div>
</div>
<div class="pagination-container">
<el-pagination
:current-page="query.pageNumber"
:page-sizes="[10, 20, 30, 50]"
:page-size="query.pageSize"
:total="total"
background
layout="total, sizes, prev, pager, next, jumper"
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
/>
</div>
</div>
</el-col>
<el-col :span="9"
><div class="grid-content bg-purple">
<div style="margin: 9px 0">
<el-form
:inline="true"
:model="formInline"
class="demo-form-inline"
>
<el-form-item label="订单时间">
<el-date-picker
value-format="yyyy-MM-dd HH:mm:ss"
size="mini"
style="width: 260px"
@change="changeTimeTwo"
v-model="value2"
type="datetimerange"
start-placeholder="开始日期"
end-placeholder="结束日期"
>
</el-date-picker>
</el-form-item>
<el-form-item>
<el-button size="mini" type="primary" @click="init"
>查询</el-button
>
</el-form-item>
</el-form>
</div>
<el-card class="box-cardTwo">
<div class="cardTwo-item">
<div>
<div style="font-size: 18px; font-weight: 600">总收入</div>
<div style="margin-top: 20px; font-size: 18px">
{{ TotalData.totalIncome ? TotalData.totalIncome : "0" }}
</div>
</div>
<div>
<div style="font-size: 18px; font-weight: 600">总支出</div>
<div style="margin-top: 20px; font-size: 18px">
{{
TotalData.totalExpenditure
? TotalData.totalExpenditure
: "0"
}}
</div>
</div>
</div>
</el-card>
<div style="margin: 10px 0">
<div style="font-size: 16px; margin: 0 0 20px 0; font-weight: 600">
钱包账单
</div>
<div style="background: #fff; padding: 10px; height: 51vh;min-width: 400px;
overflow-y:scroll;">
<div
v-for="item in billList"
:key="item.id"
style="
min-width: 380px;
background: #f1f8fe;
padding: 10px;
border-radius: 10px;
margin-bottom: 10px;
"
>
<div style="font-size: 18px">{{ item.billOrderTime }}</div>
<div class="wallet-item">
<div>订单号{{ item.billOrderNumber }}</div>
<div>订单状态{{ getBillStatus(item.billStatus) }}</div>
</div>
<div class="wallet-item">
<div>{{ item.billTypeName }}</div>
<div>余额{{ item.amountAfterChange }}</div>
</div>
</div>
</div>
</div>
<div class="pagination-container">
<el-pagination
:current-page="form.pageNumber"
:page-sizes="[10, 20, 30, 50]"
:page-size="form.pageSize"
:total="totalTwo"
background
layout="total, sizes, prev, pager, next, jumper"
@size-change="handleSizeChangeTwo"
@current-change="handleCurrentChangeTwo"
/>
</div>
</div>
</el-col>
</el-row>
<!-- 提现 -->
<withdrawal @init="init" ref="withdrawal"></withdrawal>
</div>
</template>
<script>
import withdrawal from "./popup/withdrawal";
export default {
components: { withdrawal },
data() {
return {
value2: [],
value1: [],
userInfo: {},
tableData: [],
TotalData: {},
billList: [],
query: {
pageNumber: 1,
pageSize: 10,
},
formInline: {
cashOutStatus: "",
startCashOutTime: "",
endCashOutTime: "",
},
form: {
pageNumber: 1,
pageSize: 10,
},
formTimeData: {},
total: 0,
totalTwo: 0,
};
},
created() {
this.init();
this.getWithdrawalRecord();
},
methods: {
init() {
console.log("1213");
this.$api.wallet.myWallet().then((res) => {
this.userInfo = res.data.data;
});
this.$api.wallet
.totalAmount({ amountChangeType: "", ...this.formTimeData })
.then((res) => {
this.TotalData = res.data.data;
});
this.$api.wallet
.getBankInfo({ ...this.form, ...this.formTimeData })
.then((res) => {
console.log(res, "bull");
this.billList = res.data.data.data;
this.totalTwo = Number(res.data.data.total);
});
},
getWithdrawalRecord() {
this.$api.wallet
.WithdrawalRecord({ ...this.query, ...this.formInline })
.then((res) => {
this.tableData = res.data.data.data;
this.total = Number(res.data.data.total);
});
},
handleSizeChange(val) {
this.query.pageSize = val;
this.getWithdrawalRecord();
},
handleCurrentChange(val) {
this.query.pageNumber = val;
this.getWithdrawalRecord();
},
handleSizeChangeTwo(val) {
this.form.pageSize = val;
this.init();
},
handleCurrentChangeTwo(val) {
this.form.pageNumber = val;
this.init();
},
Reset() {
this.value1 = [];
this.formInline = {};
this.getWithdrawalRecord();
},
addWithdrawal() {
this.$api.mer_admin
.bankCardPage({
pageNumber: 1,
pageSize: 10,
linkId: JSON.parse(sessionStorage.getItem("userInfo")).managerId
? JSON.parse(sessionStorage.getItem("userInfo")).managerId
: JSON.parse(sessionStorage.getItem("userInfo")).merchantId,
status: "1",
})
.then((res) => {
if (res.data.data.data.length > 0) {
this.$refs.withdrawal.toggle().add(this.userInfo.availableAmount);
} else {
this.$message.error("请先绑定银行卡");
}
})
.catch((err) => {
this.$message.error("获取银行卡失败");
});
},
getStatus(row) {
if (row == 1) {
return "审核中";
} else if (row == 2) {
return "审核不通过";
} else if (row == 3) {
return "审核成功";
} else if (row == 4) {
return "提现中";
} else if (row == 5) {
return "提现失败";
} else if (row == 6) {
return "提现成功";
}
},
changeTime(e) {
if (e) {
this.formInline.startCashOutTime = e[0];
this.formInline.endCashOutTime = e[1];
} else {
this.formInline.startCashOutTime = "";
this.formInline.endCashOutTime = "";
}
},
changeTimeTwo(e) {
if (e) {
this.formTimeData.startBillOrderTime = e[0];
this.formTimeData.endBillOrderTime = e[1];
} else {
this.formTimeData.startBillOrderTime = "";
this.formTimeData.endBillOrderTime = "";
}
},
getBillStatus(row) {
if (row == 1) {
return "待同步";
} else if (row == 2) {
return "同步中";
} else if (row == 3) {
return "同步成功";
} else if (row == 4) {
return "同步失败";
}
},
},
};
</script>
<style lang="scss" scoped>
.el-col {
border-radius: 4px;
}
.bg-purple {
background: #f1f8fe;
}
.grid-content {
border-radius: 4px;
padding: 20px;
height: 85vh;
overflow: auto;
}
.userInfo {
display: flex;
align-items: center;
justify-content: space-between;
}
.userName {
margin-left: 30px;
font-size: 16px;
color: #303e9f;
}
.box-card {
margin: 20px;
width: 50%;
height: 200px;
border-radius: 10px;
position: relative;
}
.userTime {
position: absolute;
bottom: 10px;
right: 20px;
font-size: 16px;
}
.box-cardTwo {
margin-bottom: 30px;
height: 200px;
border-radius: 10px;
}
.cardTwo-item {
display: flex;
align-items: center;
justify-content: space-evenly;
}
.wallet-item {
margin: 10px 0;
display: flex;
justify-content: space-between;
}
</style>

View File

@ -0,0 +1,144 @@
<template>
<div>
<obj-modal
ref="modal"
labelWidth="150px"
:modalConfig="modalConfig"
:modalData="modalData"
:modalHandles="modalHandles"
>
<div slot="dialog__content">
<el-form
:model="ruleForm"
:rules="rules"
ref="ruleForm"
label-width="150px"
class="demo-ruleForm"
>
<el-form-item label="提现金额:" prop="amount">
<div>
<el-input-number
v-model="ruleForm.amount"
:min="0"
:max="this.amountSum"
:step="1"
label="描述文字"
></el-input-number>
</div>
<div>可提现金额{{ amountSum }}</div>
</el-form-item>
</el-form>
</div>
<!-- 选择商品 -->
</obj-modal>
</div>
</template>
<script>
import { debounce, cloneDeep } from "lodash";
export default {
components: {},
props: {},
data() {
return {
isAdd: true,
//
modalConfig: {
title: "提现",
show: false,
width: "600px",
},
amountSum: 0,
modalData: {},
ruleForm: {
amount: "",
},
rules: {
amount: [
{
required: true,
message: "请输入提现金额",
trigger: ["blur", "change"],
},
{
validator: (rule, value, callback) => {
if (value > this.amountSum) {
callback(new Error("提现金额不能大于可提现金额"));
} else {
callback();
}
},
trigger: ["blur", "change"],
},
],
},
};
},
watch: {
"modalConfig.show"(newVal) {
if (newVal) {
//
setTimeout(() => {
this.$refs.ruleForm.resetFields();
});
}
},
},
methods: {
queryTableData(pageNo, pageSize) {},
toggle(e) {
if (this.modalConfig.show == false) {
this.modalConfig.show = true;
} else {
this.modalConfig.show = false;
}
if (e) {
this.init(cloneDeep(e));
}
return {
add: (row) => {
this.amountSum = row ? row : 0;
this.modalConfig.title = "提现金额";
this.isAdd = true;
},
update: () => {
this.isAdd = false;
},
};
},
init(row) {},
},
computed: {
modalHandles() {
return [
{
label: "取消",
handle: () => {
this.toggle();
},
},
{
label: "确认",
type: "primary",
// submit: true,
handle: () => {
if (this.isAdd) {
this.$refs.ruleForm.validate((valid) => {
if (valid) {
console.log(valid);
this.$api.wallet.Withdrawal(this.ruleForm).then((res) => {
this.$emit("init");
this.toggle();
});
}
});
}
},
},
];
},
},
asyncComputed: {},
};
</script>
<style lang="scss" scoped>
</style>