分公司管理

This commit is contained in:
2023-12-12 16:31:04 +08:00
parent 12f89352c3
commit 476906af0c
17 changed files with 285 additions and 191 deletions

BIN
.DS_Store vendored

Binary file not shown.

5
.env
View File

@@ -1,8 +1,7 @@
NODE_ENV=production
VUE_APP_PREVIEW=false
# <!-- //水感应正式环境-->
# VUE_APP_API_BASE_URL=https://douhuo.douhuofalv.com/agent
VUE_APP_API_BASE_URL=https://api.shui.shuiganying.com/api
# <!-- // 水感应测试-->
# VUE_APP_API_BASE_URL=https://api.douhuotest.douhuofalv.com/agent
VUE_APP_API_BASE_URL=https://shuitest.shuiganying.com/api
# VUE_APP_API_BASE_URL=https://shuitest.shuiganying.com/api

View File

@@ -1,16 +1,15 @@
###
# @Author: Aimee~
# @Date: 2023-05-11 11:17:32
# @LastEditTime: 2023-07-28 09:49:14
# @LastEditors: error: error: git config user.name & please set dead value or install git && error: git config user.email & please set dead value or install git & please set dead value or install git
# @FilePath: /douhuo-agent/.env.development
# @LastEditTime: 2023-12-12 15:52:34
# @LastEditors: Aimee
# @FilePath: /water_dealer-agent/.env.development
# @Description: 正式环境测试环境更改
###
NODE_ENV=development
VUE_APP_PREVIEW=true
# <!-- //水感应正式环境-->
# VUE_APP_API_BASE_URL=https://douhuo.douhuofalv.com/agent
VUE_APP_API_BASE_URL=https://api.shui.shuiganying.com/api
# <!-- //水感应测试-->
# VUE_APP_API_BASE_URL=https://api.douhuotest.douhuofalv.com/agent
VUE_APP_API_BASE_URL=https://shuitest.shuiganying.com/api
# <!-- // 水感应测试-->
# VUE_APP_API_BASE_URL=https://shuitest.shuiganying.com/api

View File

@@ -1,16 +1,15 @@
###
# @Author: Aimee~
# @Date: 2023-05-11 11:17:32
# @LastEditTime: 2023-07-28 10:09:13
# @LastEditors: error: error: git config user.name & please set dead value or install git && error: git config user.email & please set dead value or install git & please set dead value or install git
# @FilePath: /douhuo-agent/.env.preview
# @LastEditTime: 2023-12-12 15:52:50
# @LastEditors: Aimee
# @FilePath: /water_dealer-agent/.env.preview
# @Description:
###
NODE_ENV=production
VUE_APP_PREVIEW=true
# <!-- //水感应正式环境-->
# VUE_APP_API_BASE_URL=https://douhuo.douhuofalv.com/agent
VUE_APP_API_BASE_URL=https://api.shui.shuiganying.com/api
# <!-- //水感应测试-->
# VUE_APP_API_BASE_URL=https://api.douhuotest.douhuofalv.com/agent
VUE_APP_API_BASE_URL=https://shuitest.shuiganying.com/api
# <!-- // 水感应测试-->
# VUE_APP_API_BASE_URL=https://shuitest.shuiganying.com/api

View File

@@ -1,11 +1,13 @@
<!--
* @Author: Aimee~
* @Date: 2023-05-11 12:02:45
* @LastEditTime: 2023-12-12 10:09:20
* @LastEditTime: 2023-12-12 10:20:00
* @LastEditors: Aimee
* @FilePath: /water_dealer-agent/README.md
* @Description: 备注信息
-->
# 组件
ant-design-vue
# 水感应 分公司 中台(数据展示及分公司数据) 线上中台
打包后文件件需要有一个 static 文件存放
'/static/vue.min.js'
@@ -17,10 +19,12 @@
# node 版本 node-v14.21.3
# 水感应测试-存放路径
/home/wwwroot/Development/Douhuo/agent
# 水感应正式-存放路径
oss://douhuo-agent/
OSS_ACCESS_KEY=LTAI5tHYDoN6trRhsBmRvD7h
OSS_SECRET_KEY=k3e6veUY45WM8QMMMyRKYr0KjiOXzC
oss://sgy-agent-web/
# 运行 yarn run dev
# 打包 yarn build

12
public/index.html vendored
View File

@@ -1,3 +1,11 @@
<!--
* @Author: Aimee~
* @Date: 2023-08-03 17:36:19
* @LastEditTime: 2023-12-12 16:12:55
* @LastEditors: Aimee
* @FilePath: /water_dealer-agent/public/index.html
* @Description:
-->
<!DOCTYPE html>
<html lang="zh-cmn-Hans">
@@ -6,7 +14,7 @@
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width,initial-scale=1.0">
<link rel="icon" href="<%= BASE_URL %>logo.png">
<title> 水感应经销商管理后台 WaterFeel.Vip</title>
<title> 水感应分公司管理 WaterFeel.Vip</title>
<style>.first-loading-wrp{display:flex;justify-content:center;align-items:center;flex-direction:column;min-height:420px;height:100%}.first-loading-wrp>h1{font-size:128px}.first-loading-wrp .loading-wrp{padding:98px;display:flex;justify-content:center;align-items:center}.dot{animation:antRotate 1.2s infinite linear;transform:rotate(45deg);position:relative;display:inline-block;font-size:32px;width:32px;height:32px;box-sizing:border-box}.dot i{width:14px;height:14px;position:absolute;display:block;background-color:#1890ff;border-radius:100%;transform:scale(.75);transform-origin:50% 50%;opacity:.3;animation:antSpinMove 1s infinite linear alternate}.dot i:nth-child(1){top:0;left:0}.dot i:nth-child(2){top:0;right:0;-webkit-animation-delay:.4s;animation-delay:.4s}.dot i:nth-child(3){right:0;bottom:0;-webkit-animation-delay:.8s;animation-delay:.8s}.dot i:nth-child(4){bottom:0;left:0;-webkit-animation-delay:1.2s;animation-delay:1.2s}@keyframes antRotate{to{-webkit-transform:rotate(405deg);transform:rotate(405deg)}}@-webkit-keyframes antRotate{to{-webkit-transform:rotate(405deg);transform:rotate(405deg)}}@keyframes antSpinMove{to{opacity:1}}@-webkit-keyframes antSpinMove{to{opacity:1}}</style>
<!-- require cdn assets css -->
<% for (var i in htmlWebpackPlugin.options.cdn && htmlWebpackPlugin.options.cdn.css) { %>
@@ -19,7 +27,7 @@
</noscript>
<div id="app">
<div class="first-loading-wrp">
<h1> 水感应经销商管理后台</h1>
<h1> 水感应分公司管理</h1>
<div class="loading-wrp">
<span class="dot dot-spin"><i></i><i></i><i></i><i></i></span>
</div>

View File

@@ -1,8 +1,8 @@
/*
* @Author: error: error: git config user.name & please set dead value or install git && error: git config user.email & please set dead value or install git & please set dead value or install git
* @Date: 2023-07-07 14:02:05
* @LastEditors: error: error: git config user.name & please set dead value or install git && error: git config user.email & please set dead value or install git & please set dead value or install git
* @LastEditTime: 2023-07-31 13:58:48
* @LastEditors: Aimee
* @LastEditTime: 2023-12-12 11:47:55
* @FilePath: /water_dealer-agent/src/api/statistical.js
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
*/
@@ -10,13 +10,18 @@
import request from '@/utils/request'
// 获取 首页数据看板数据
export function getMiddlesUserDatas (item) {
export function getMiddlesUserDatas (item, value) {
const params = {
time_type: item
}
if (value !== null) {
params.start_at = value[0]
params.end_at = value[1]
}
return request({
url: '/middles/user/datas',
method: 'get',
params: {
time_type: item
}
params: params
})
}

View File

@@ -1,9 +1,9 @@
/*
* @Author: Aimee~
* @Date: 2022-06-12 15:05:53
* @LastEditTime: 2022-06-13 09:33:54
* @LastEditTime: 2023-12-12 16:13:22
* @LastEditors: Aimee
* @FilePath: /gl-agent/src/config/defaultSettings.js
* @FilePath: /water_dealer-agent/src/config/defaultSettings.js
* @Description: 修改默认配置
*/
/**
@@ -31,7 +31,7 @@ var defaultValue = {
menu: {
locale: true
},
title: ' 水感应经销商管理后台',
title: ' 水感应分公司管理',
pwa: false,
production: process.env.NODE_ENV === 'production' && process.env.VUE_APP_PREVIEW !== 'true'
}

View File

@@ -1,9 +1,9 @@
/*
* @Author: Aimee~
* @Date: 2023-05-11 12:02:45
* @LastEditTime: 2023-07-05 15:03:09
* @LastEditTime: 2023-12-12 16:13:30
* @LastEditors: Aimee
* @FilePath: /douhuo-agent/src/config/router.config.js
* @FilePath: /water_dealer-agent/src/config/router.config.js
* @Description: 路由
*/
import {
@@ -16,7 +16,7 @@ import user from './routes/user'
import coupon from './routes/coupon'
import permission from './routes/permission'
import sales from './routes/sales'
import cityExperienceOfficer from './routes/cityExperienceOfficer'
// import cityExperienceOfficer from './routes/cityExperienceOfficer'
export const asyncRouterMap = [{
path: '/',
@@ -38,7 +38,7 @@ export const asyncRouterMap = [{
}
},
...detail,
...cityExperienceOfficer,
// ...cityExperienceOfficer,
...stock,
...sales,
...user,
@@ -67,7 +67,7 @@ export const constantRouterMap = [{
name: 'Login',
component: () => import('@/views/auth/Login'),
meta: {
title: '登陆水感应经销商系统'
title: '登陆水感应分公司管理'
}
},
{

View File

@@ -1,3 +1,11 @@
/*
* @Author: Aimee~
* @Date: 2023-10-30 15:25:23
* @LastEditTime: 2023-12-12 11:04:30
* @LastEditors: Aimee
* @FilePath: /water_dealer-agent/src/config/routes/sales.js
* @Description: 零售订单
*/
import {
RouteView
} from '@/layouts'
@@ -6,7 +14,7 @@ export default [{
path: '/sales',
name: 'StockIndex',
meta: {
title: '销售管理',
title: '订单管理',
icon: 'bank'
},
component: RouteView,
@@ -15,7 +23,7 @@ export default [{
path: '/sales/online',
name: 'SalesOnline',
meta: {
title: '线上零售订单',
title: '零售订单',
icon: 'unordered-list'
},
component: () => import('@/views/sales/Online')
@@ -24,7 +32,7 @@ export default [{
path: '/sales/stock',
name: 'SalesStock',
meta: {
title: '线上进货订单',
title: '进货订单',
icon: 'unordered-list'
},
component: () => import('@/views/sales/OnStock')

View File

@@ -1,3 +1,11 @@
/*
* @Author: Aimee~
* @Date: 2023-10-30 15:25:23
* @LastEditTime: 2023-12-12 11:02:36
* @LastEditors: Aimee
* @FilePath: /water_dealer-agent/src/config/routes/stock.js
* @Description: 库存管理
*/
import {
RouteView
} from '@/layouts'
@@ -11,74 +19,72 @@ export default [{
},
component: RouteView,
children: [
{
path: '/stock/ins',
name: 'StockIns',
{
path: '/stock/dealer/in',
name: 'DealerIn',
component: () => import('@/views/stock/DealerIn'),
meta: {
title: '分公司库存管理',
icon: 'control'
},
component: RouteView,
redirect: '/stock/in',
children: [
{
path: '/stock/in',
name: 'StockIn',
component: () => import('@/views/stock/In'),
meta: {
title: '入库管理',
icon: 'import'
}
},
{
path: '/sales/offline',
name: 'SalesOffline',
meta: {
title: '线下出货列表',
icon: 'unordered-list'
},
component: () => import('@/views/sales/Offline')
}
// {
// path: '/stock/out',
// name: 'StockOut',
// component: () => import('@/views/stock/Out'),
// meta: {
// title: '出库管理',
// icon: 'export'
// }
// }
]
},
{
path: '/stock/dealer',
name: 'StockDealer',
title: '经销商入库管理',
icon: 'import'
}
},
{
path: '/stock/dealer/out',
name: 'DealerOut',
component: () => import('@/views/stock/DealerOut'),
meta: {
title: '经销商库管理',
icon: 'usergroup-add'
},
component: RouteView,
redirect: '/stock/dealer/in',
children: [
{
path: '/stock/dealer/in',
name: 'DealerIn',
component: () => import('@/views/stock/DealerIn'),
meta: {
title: '入库管理',
icon: 'import'
}
},
{
path: '/stock/dealer/out',
name: 'DealerOut',
component: () => import('@/views/stock/DealerOut'),
meta: {
title: '出库管理',
icon: 'export'
}
}
]
}
title: '经销商库管理',
icon: 'export'
}
}
// {
// path: '/stock/ins',
// name: 'StockIns',
// meta: {
// title: '分公司库存管理',
// icon: 'control'
// },
// component: RouteView,
// redirect: '/stock/in',
// children: [
// {
// path: '/stock/in',
// name: 'StockIn',
// component: () => import('@/views/stock/In'),
// meta: {
// title: '入库管理',
// icon: 'import'
// }
// },
// {
// path: '/sales/offline',
// name: 'SalesOffline',
// meta: {
// title: '线下出货列表',
// icon: 'unordered-list'
// },
// component: () => import('@/views/sales/Offline')
// }
// // {
// // path: '/stock/out',
// // name: 'StockOut',
// // component: () => import('@/views/stock/Out'),
// // meta: {
// // title: '出库管理',
// // icon: 'export'
// // }
// // }
// ]
// },
// {
// path: '/stock/dealer',
// name: 'StockDealer',
// meta: {
// title: '经销商入库管理',
// icon: 'usergroup-add'
// },
// component: RouteView,
// redirect: '/stock/dealer/in'
// }
]
}]

View File

@@ -18,7 +18,7 @@
</template>
<template v-slot:rightContentRender>
<span class="rightContentRenderTitle">欢迎使用水感应经销商端</span>
<span class="rightContentRenderTitle">欢迎使用水感应分公司管理</span>
<right-content :is-mobile="isMobile" :theme="settings.theme" :top-menu="settings.layout === 'topmenu'" />
</template>
@@ -61,7 +61,7 @@ export default {
menus: [],
// 侧栏收起状态
collapsed: false,
title: ' 水感应代理商 ',
title: ' 水感应分公司管理 ',
logo: '',
settings: {
// 布局类型

View File

@@ -6,7 +6,7 @@
<div class="header">
<a href="/">
<span class="title">欢迎登录</span>
<span class="des">欢迎使用水感应经销商端</span>
<span class="des">欢迎使用水感应分公司管理</span>
</a>
</div>
</div>

View File

@@ -1,14 +1,22 @@
/*
* @Author: Aimee~
* @Date: 2023-08-03 17:36:19
* @LastEditTime: 2023-12-12 16:13:49
* @LastEditors: Aimee
* @FilePath: /water_dealer-agent/src/utils/screenLog.js
* @Description: 关键字
*/
/* eslint-disable */
export const printANSI = () => {
// console.clear()
// ASCII - ANSI Shadow
let text = `水感应大数据综合管理后台
let text = `水感应分公司管理
PUBLISHED: 1.0.0-10.0.0
EMAIL: yuzhankeji@163.com
CREATED_AT: ${BUILD_DATE}`
console.log(`%c${text}`, 'color: #fc4d50')
console.log(`%c可以植入广告`, 'color: #fc4d50')
console.log('%c感谢使用 水感应大数据综合管理后台', 'color: #fc4d50; font-size: 14px; font-family: Hiragino Sans GB,Microsoft YaHei,\\\\5FAE\\8F6F\\96C5\\9ED1,Droid Sans Fallback,Source Sans,Wenquanyi Micro Hei,WenQuanYi Micro Hei Mono,WenQuanYi Zen Hei,Apple LiGothic Medium,SimHei,ST Heiti,WenQuanYi Zen Hei Sharp,sans-serif;')
console.log('%cThanks for DouHuo - Vip!', 'color: #fc4d50; font-size: 14px; font-weight: 300; text-shadow:#000 1px 0 0,#000 0 1px 0,#000 -1px 0 0,#000 0 -1px 0;')
console.log('%c感谢使用 水感应分公司管理', 'color: #fc4d50; font-size: 14px; font-family: Hiragino Sans GB,Microsoft YaHei,\\\\5FAE\\8F6F\\96C5\\9ED1,Droid Sans Fallback,Source Sans,Wenquanyi Micro Hei,WenQuanYi Micro Hei Mono,WenQuanYi Zen Hei,Apple LiGothic Medium,SimHei,ST Heiti,WenQuanYi Zen Hei Sharp,sans-serif;')
console.log('%cThanks for ShuiGanYing - Vip!', 'color: #fc4d50; font-size: 14px; font-weight: 300; text-shadow:#000 1px 0 0,#000 0 1px 0,#000 -1px 0 0,#000 0 -1px 0;')
}

View File

@@ -1,10 +1,18 @@
<!--
* @Author: Aimee~
* @Date: 2023-08-03 17:36:19
* @LastEditTime: 2023-12-12 16:06:46
* @LastEditors: Aimee
* @FilePath: /water_dealer-agent/src/views/home/Index.vue
* @Description: index
-->
<template>
<a-row :gutter="[24, 24]">
<!-- <a-col :lg="10" :md="24" :sm="24" :xl="8" :xxl="7">
<UserInfo />
</a-col> -->
<a-col :lg="24" :md="24" :sm="24" :xl="24" :xxl="24">
<Count v-if="info!=={}" :info="info" />
<Count v-if="info != {}" :info="info" />
</a-col>
<!--
<a-col :lg="24" :md="24" :sm="24" :xl="24" :xxl="24">
@@ -26,8 +34,9 @@ export default {
},
data () {
return {
info: {},
serarchkey: 'today'
info: [],
serarchkey: 'year',
searchValue: null
}
},
computed: {
@@ -43,8 +52,17 @@ export default {
created () {
this.getInfo()
// 监听是否切换了日,周,月,年
this.eventBus.$on('updateHomeDataByType', (type) => {
this.serarchkey = type.type
this.eventBus.$on('updateHomeDataByType', (item) => {
if (item.type === 'custom' && item.value == null) {
return
} else if (item.type === 'custom' && item.value !== null) {
this.serarchkey = item.type
this.searchValue = item.value
this.getInfo()
return
}
this.serarchkey = item.type
this.searchValue = item.value
this.getInfo()
})
},
@@ -53,7 +71,7 @@ export default {
},
methods: {
getInfo () {
getMiddlesUserDatas(this.serarchkey).then(res => {
getMiddlesUserDatas(this.serarchkey, this.searchValue).then(res => {
this.info = res
}).catch(err => {
this.$notification.error(err)

View File

@@ -2,7 +2,7 @@
<a-row>
<a-row :gutter="24">
<!-- 分公司库存 -->
<a-col
<!-- <a-col
v-if="info.middle"
:sm="24"
:md="12"
@@ -12,15 +12,14 @@
>
<chart-card :loading="loading" title="分公司总库存(瓶)" :total="info.middle.total">
<template slot="footer">
<!-- <trend flag="up"> <span slot="term">{{ $t('线上库存') }}</span>{{ info.middle.online_stock }}</trend> -->
<trend flag="down">
<span slot="term">{{ $t('线下库存') }}</span>{{ info.middle.offline_stock }}
</trend>
</template>
</chart-card>
</a-col>
</a-col> -->
<!-- 经销商总库存 -->
<a-col
<!-- <a-col
:sm="24"
:md="12"
:xl="12"
@@ -37,53 +36,59 @@
</div>
<template slot="footer">{{ $t('经销商总数') }}<span style="margin-right:20px;"> {{ info.agent.users | NumberFormat }} </span></template>
</chart-card>
</a-col>
</a-col> -->
</a-row>
<a-col :span="24" >
<a-card :bordered="false" title="用户数据">
<template #extra>
<a-col
:span="24"
v-for="(item, index) in info"
:key="index">
<a-card :bordered="false" :title="item.title">
<template v-if="index === 0" #extra>
<a-dropdown v-model="visible">
<a class="ant-dropdown-link" @click="e => e.preventDefault()">{{ searchs[typeIndex].title }} <a-icon type="down" /></a>
<a-menu slot="overlay" @click="handleMenuClick">
<a-menu-item
v-for="item in searchs"
:key="item.key">
<a href="javascript:;">{{ item.title }}</a>
v-for="iit in searchs"
:key="iit.key">
<a href="javascript:;">{{ iit.title }}</a>
</a-menu-item>
</a-menu>
</a-dropdown>
<a-range-picker
style="margin-left:40px;"
v-if="type == 'custom'"
:placeholder="['开始日期', '结束日期']"
:value="rang_at"
:ranges="{ Today: [moment(), moment()], 'This Month': [moment(), moment().endOf('month')] }"
@change="onCreateChange" />
</template>
<a-row v-if="info.users">
<a-col :sm="24" :md="12" :xl="8" :xxl="8" class="mt20">
<info title="用户总数量(人)" :value="''+info.users.all" :bordered="true" />
</a-col>
<a-col :sm="24" :md="12" :xl="8" :xxl="8" class="mt20">
<info title="新增代理数(人)" :value="''+info.users.new_agents" :bordered="true" />
</a-col>
<a-col :sm="24" :md="12" :xl="8" :xxl="8" class="mt20">
<info title="新增创客数(人)" :value="''+info.users.new_makers" :bordered="true"/>
</a-col>
<a-col :sm="24" :md="12" :xl="8" :xxl="8" class="mt20">
<info title="新增VIP数(人)" :value="''+info.users.new_vips" :bordered="true"/>
</a-col>
<a-col :sm="24" :md="12" :xl="8" :xxl="8" class="mt20">
<info title="新增游客数量(人)" :value="''+info.users.new_visitors"/>
<a-row>
<a-col
:sm="24"
:md="12"
:xl="8"
:xxl="8"
v-for="(it, idx) in item.data"
:key="idx"
class="mt20">
<info :title="it.title" :value="''+ it.number" :bordered="(idx + 1) === item.data.length ? false : true" />
</a-col>
</a-row>
</a-card>
</a-col>
<a-col :span="24" v-if="info.sales_quantity">
<!-- <a-col :span="24" v-if="info.sales_quantity">
<a-card :bordered="false" title="累计销售数量">
<a-row>
<a-col :sm="24" :md="12" :xl="8" :xxl="8" class="mt20">
<info title="累计销售数量(瓶)" :value="''+info.sales_quantity.online_all" :bordered="true" />
</a-col>
<a-col :sm="24" :md="12" :xl="8" :xxl="8" class="mt20">
<info title="线上销售数量(瓶)" :value="''+info.sales_quantity.online_retail" :bordered="true"/>
</a-col>
<a-col :sm="24" :md="12" :xl="8" :xxl="8" class="mt20">
<info title="线下出货数量(瓶)" :value="''+info.sales_quantity.offline" />
<a-col
:sm="24"
:md="12"
:xl="8"
:xxl="8"
class="mt20"
v-for="(item, index) in info.sales_quantity"
:key="index">
<info :title="item.title" :value="'' + item.number" :bordered="true" />
</a-col>
</a-row>
</a-card>
@@ -91,19 +96,19 @@
<a-col :span="24" v-if="info.sales_amount">
<a-card :bordered="false" title="售卖数据管理">
<a-row>
<a-col :sm="24" :md="12" :xl="8" :xxl="8" class="mt20">
<info title="售卖数据管理总数(元)" :value="''+info.sales_amount.online_agent_all" :bordered="true"/>
</a-col>
<a-col :sm="24" :md="12" :xl="8" :xxl="8" class="mt20">
<info title="线上销售金额(元)" :value="''+info.sales_amount.online_sell" :bordered="true"/>
</a-col>
<a-col :sm="24" :md="12" :xl="8" :xxl="8" class="mt20">
<info title="线下出货金额总和(元)" :value="''+info.sales_amount.offline_sell" />
<a-col
:sm="24"
:md="12"
:xl="8"
:xxl="8"
class="mt20"
v-for="(item, index) in info.sales_amount"
:key="index">
<info :title="item.title" :value="'' + item.number" :bordered="true" />
</a-col>
</a-row>
</a-card>
</a-col>
</a-col> -->
<!-- <a-col :span="24" v-if="info.b_recheck">
<a-card :bordered="false" title="复审业务操作">
<a-row>
@@ -119,7 +124,6 @@
</a-row>
</a-card>
</a-col> -->
</a-row>
</template>
@@ -136,6 +140,7 @@
NumberInfo,
MiniSmoothArea
} from '@/components'
import moment from 'moment'
export default {
components: {
@@ -152,9 +157,9 @@ export default {
},
props: {
info: {
type: Object,
type: Array,
default: () => {
return {}
return []
}
}
},
@@ -162,21 +167,35 @@ export default {
data: () => ({
visible: false,
loading: false,
type: 'today',
type: 'year',
typeIndex: 0,
searchs: [
{ key: 'today', title: '本' },
{ key: 'week', title: '本周' },
{ key: 'year', title: '本' },
{ key: 'month', title: '本月' },
{ key: 'year', title: '本' }
]
{ key: 'week', title: '本' },
{ key: 'today', title: '本日' },
{ key: 'custom', title: '自定义时间' }
],
rang_at: null, // 开始时间 结束时间
date2: null
}),
methods: {
moment,
handleMenuClick (e) {
this.typeIndex = this.searchs.findIndex(item => item.key === e.key)
this.visible = false
this.type = e.key
this.eventBus.$emit('updateHomeDataByType', { type: e.key })
if (this.type === 'custom') {
return
} else {
this.date2 = null
}
this.eventBus.$emit('updateHomeDataByType', { type: e.key, value: this.date2 })
},
onCreateChange (dates, dateStrings) {
this.rang_at = dates
this.date2 = dates.length === 2 ? dateStrings : null
this.eventBus.$emit('updateHomeDataByType', { type: this.type, value: this.date2 })
}
}
}

View File

@@ -5,26 +5,26 @@
<div class="table-page-search-wrapper">
<a-form layout="inline">
<a-row :gutter="48">
<a-col :md="8" :sm="24">
<a-col :md="6" :sm="24">
<a-form-item label="用户昵称">
<a-input v-model="queryParam.nickname" placeholder="用户昵称" />
</a-form-item>
</a-col>
<a-col :md="8" :sm="24">
<a-col :md="6" :sm="24">
<a-form-item label="用户手机号">
<a-input v-model="queryParam.username" placeholder="用户手机号" />
</a-form-item>
</a-col>
<a-col :md="8" :sm="24">
<a-col :md="6" :sm="24">
<a-form-item label="身份筛选" has-feedback>
<a-select v-model="queryParam.identity_id" placeholder="身份筛选">
<a-select-option v-for="item in indentitys" :key="item.id" :value="item.id">{{ item.name }}</a-select-option>
</a-select>
</a-form-item>
</a-col>
<a-col :md="8" :sm="24">
<a-col :md="6" :sm="24">
<a-button type="primary" @click="search"><a-icon type="search" />搜索</a-button>
<a-button class="ml8" type="primary" @click="onAddRole"><a-icon type="plus" />新增</a-button>
<!-- <a-button class="ml8" type="primary" @click="onAddRole"><a-icon type="plus" />新增</a-button> -->
<a-button class="ml8" @click="resetSearch"><a-icon type="undo" />重置</a-button>
</a-col>
</a-row>
@@ -55,6 +55,10 @@
<div slot="parent" slot-scope="text, record">{{ record.parent.nickname }}<div>{{ record.parent.username }}</div></div>
<span slot="created_at" slot-scope="text, record">{{ record.created_at }}</span>
<div slot="order_count" slot-scope="text, record" style="color: #1890ff">{{ record.order.count + '(单)' || '-' }}</div>
<div slot="order_price" slot-scope="text, record" style="color: #1890ff">{{ record.order.price + '(元)' || '-' }}</div>
<div slot="stock" slot-scope="text, record" style="color: #1890ff">{{ record.stock + '(件)' || '-' }}</div>
<!-- 操作 -->
<div slot="actions" slot-scope="text, record">
<a class="ant-dropdown-link" @click="onEdit(record)">更改推荐人</a>
@@ -87,35 +91,52 @@ const columns = [
title: '昵称',
scopedSlots: { customRender: 'nickname' },
align: 'center',
width: 200
width: 140
},
{
title: '真实姓名',
scopedSlots: { customRender: 'name' },
align: 'center',
width: 140
width: 120
},
{
title: '用户手机',
scopedSlots: { customRender: 'username' },
align: 'center',
width: 140
width: 130
},
{
title: '身份',
scopedSlots: { customRender: 'identity' },
align: 'center',
width: 140
width: 120
},
{
title: '邀请码',
scopedSlots: { customRender: 'invite' },
align: 'center',
width: 140
width: 130
}
],
width: 300,
align: 'center'
}, {
title: '当前库存',
scopedSlots: { customRender: 'stock' },
width: 120,
align: 'center'
},
{
title: '消费订单量',
scopedSlots: { customRender: 'order_count' },
width: 120,
align: 'center'
},
{
title: '消费订单额',
scopedSlots: { customRender: 'order_price' },
width: 120,
align: 'center'
},
{
title: '推荐人手机号',
@@ -128,15 +149,15 @@ const columns = [
dataIndex: 'created_at',
width: 200,
align: 'center'
},
{
title: '操作',
dataIndex: 'status10',
scopedSlots: { customRender: 'actions' },
align: 'center',
width: 160,
fixed: 'right'
}
// {
// title: '操作',
// dataIndex: 'status10',
// scopedSlots: { customRender: 'actions' },
// align: 'center',
// width: 160,
// fixed: 'right'
// }
]
export default {