xy 2 years ago
parent 28830c291d
commit dbaca2d03a

@ -2,6 +2,6 @@
ENV = 'development'
# base api
#VUE_APP_BASE_API = https://sstt.115.langye.net
VUE_APP_BASE_API = http://sstt.ali251.langye.net/
VUE_APP_BASE_API = https://sstt.115.langye.net
#VUE_APP_BASE_API = http://sstt.ali251.langye.net/
VUE_APP_UPLOAD_API = http://sstt.ali251.langye.net/api/admin/upload-file

@ -1,26 +1,40 @@
import request from '@/utils/request'
export function getCounts() {
return request({
url: '/api/admin/get-counts',
method: 'get'
})
}
export function getChartsData(params) {
return request({
url: '/api/admin/get-charts-data',
method: 'get',
params: params
})
import request from '@/utils/request'
export function getCounts() {
return request({
url: '/api/admin/get-counts',
method: 'get'
})
}
export function getChartsData(params) {
return request({
url: '/api/admin/get-charts-data',
method: 'get',
params: params
})
}
export function getChartsHome(params) {
return request({
url: '/api/admin/chart/home',
method: 'get',
params: params
})
export function getChartsHome(params) {
return request({
url: '/api/admin/chart/home',
method: 'get',
params: params
})
}
export function getBusinessData(params) {
return request({
url: '/api/admin/chart/business_data',
method: 'get',
params: params
})
}
export function getOrderData(params) {
return request({
url: '/api/admin/chart/order_data',
method: 'get',
params: params
})
}

@ -4,7 +4,8 @@ export function login(data) {
return request({
url: '/api/admin/auth/login',
method: 'post',
data
data,
isLoading: false
})
}
@ -12,7 +13,8 @@ export function getInfo(token) {
return request({
url: '/api/admin/auth/me',
method: 'post',
params: { token }
params: { token },
isLoading: false
})
}
@ -27,6 +29,7 @@ export function getAuthMenu(token) {
return request({
url: '/api/admin/auth/permissions',
method: 'get',
params: { token }
params: { token },
isLoading: false
})
}
}

@ -1,342 +1,346 @@
<template>
<div>
<div class="block" style="padding-top: 10px;display: flex;
justify-content: flex-end;">
<el-button type="primary" round style="margin-right: 10px" @click="isShowDraw = true">超龄查看</el-button>
<el-date-picker v-model="month" type="month" placeholder="选择月" @change="loadData()">
</el-date-picker>
</div>
<div class="statistics">
<panel-group :totaldata="list" />
</div>
<div class="chart">
<div class="chartItem" style="margin-right: 1%;">
<div class="chartItemTitle">营业与收入</div>
<div id="col-chart"></div>
</div>
<div class="chartItem" style="margin-left: 1%;">
<div class="chartItemTitle">客户与订单</div>
<div id="line-chart"></div>
</div>
</div>
<draw :isShow.sync="isShowDraw"></draw>
</div>
</template>
<script>
import echarts from "echarts"
import PanelGroup from './components/PanelGroup'
import {
getChartsHome
} from "../../api/dashboard.js"
import draw from './components/draw.vue'
export default {
components: {
PanelGroup,
draw
},
data() {
return {
isShowDraw:false,
col: '',
line: '',
business_data: [],
collect_data: [],
list: {
"business": {
"server_money_total": 0,
"nurse_money_total": 0,
"remain_money_total": 0
},
"person_efficiency": {
"server_time_total": "0",
"expect": 0,
"act": 0
},
"customer": {
"active": 0,
"add": 0,
"wash": 0
},
"order": {
"server_total": 0,
"cycle_total": 0,
"unit_total": 0
},
},
customerArr: [],
orderArr: [],
chartData: {},
month: ''
}
},
watch: {
chartData(val, newval) {
if (newval) {
this.init();
}
}
},
methods: {
async loadData() {
await getChartsHome({
month: this.month
}).then((res) => {
console.log(res);
this.list = res.list;
this.chartData = res;
let _business_data = [];
let _collect_data = [];
res.business_data.map(item => {
_business_data.push(item.server_money_total)
_collect_data.push(item.collect_money)
})
this.business_data = _business_data;
this.collect_data = _collect_data;
let _customerArr = [];
let _orderArr = [];
res.order_data.map(item => {
_customerArr.push(item.active_customer)
_orderArr.push(item.order_total)
})
this.customerArr = _customerArr;
this.orderArr = _orderArr;
}).catch()
},
init() {
this.col = echarts.init(document.getElementById('col-chart'))
this.col.setOption({
title: {
text: ''
},
tooltip: {
trigger: 'axis',
axisPointer: {
type: 'shadow'
},
position: 'bottom'
},
legend: {},
grid: {
left: '3%',
right: '4%',
bottom: '3%',
containLabel: true
},
yAxis: {
type: 'value',
boundaryGap: [0, 0.01]
},
xAxis: {
type: 'category',
data: ['第一周', '第二周', '第三周', '第四周']
},
series: [{
name: '服务金额',
type: 'bar',
data: this.business_data,
itemStyle: {
normal: {
color: 'rgb(42,182,252)'
},
},
},
{
name: '收款',
type: 'bar',
data: this.collect_data,
itemStyle: {
normal: {
color: 'rgb(34,228,255)'
},
},
}
]
})
this.line = echarts.init(document.getElementById('line-chart'))
this.line.setOption({
title: {
text: ''
},
tooltip: {
trigger: 'axis'
},
legend: {
data: ['活跃客户', '服务订单']
},
grid: {
left: '3%',
right: '6%',
bottom: '3%',
containLabel: true
},
toolbox: {
},
xAxis: {
type: 'category',
boundaryGap: false,
data: ['第一周', '第二周', '第三周', '第四周']
},
yAxis: {
type: 'value',
},
series: [{
name: '活跃客户',
type: 'line',
stack: 'Total',
data: this.customerArr,
itemStyle: {
normal: {
color: 'rgb(42,182,252)'
},
},
},
{
name: '服务订单',
type: 'line',
stack: 'Total',
data: this.orderArr,
itemStyle: {
normal: {
color: 'rgb(34,228,255)'
},
},
}
]
})
}
},
created() {
this.month=this.$moment().format("YYYY-MM")
this.loadData();
},
mounted() {
//setInterval(()=>{ this.isShowDraw = !this.isShowDraw},3000)
//this.init()
window.onresize = () => {
this.col.resize()
this.line.resize()
}
},
destroyed() {
window.onresize = null
}
}
</script>
<style lang="scss" scoped>
.statistics {
display: flex;
margin-top: 20px;
&-title {
padding-left: 6px;
}
&-content {
text-align: center;
font-size: 13px;
&-top {
&__num {
font-weight: 600;
}
&__name {
font-size: 10px;
color: rgb(140, 140, 140);
}
}
&-bottom {
display: flex;
justify-content: space-between;
&-left {
&__num {
font-weight: 600;
}
&__name {
font-size: 10px;
color: rgb(140, 140, 140);
}
}
&-right {
&__num {
font-weight: 600;
}
&__name {
font-size: 10px;
color: rgb(140, 140, 140);
}
}
}
}
&>div {
flex: 1;
margin-right: 20px;
&:last-child {
margin-right: 0;
}
}
}
.chart {
display: flex;
margin-top: 20px;
.chartItem {
width: 49%;
.chartItemTitle {
font-size: 16px;
margin-bottom: 20px;
}
#col-chart {
background: #fff;
border-radius: 10px;
flex: 1;
margin-right: 20px;
padding: 20px;
box-sizing: border-box;
min-height: 400px;
width: 100%;
}
#line-chart {
background: #fff;
border-radius: 10px;
flex: 1;
padding: 20px;
box-sizing: border-box;
min-height: 400px;
}
}
}
</style>
<template>
<div>
<div class="block" style="padding-top: 10px;display: flex;
justify-content: flex-end;">
<el-button type="primary" round style="margin-right: 10px" @click="isShowDraw = true">超龄查看</el-button>
<el-date-picker v-model="month" type="month" placeholder="选择月" @change="loadData()">
</el-date-picker>
</div>
<div class="statistics">
<panel-group :totaldata="list" />
</div>
<div class="chart">
<div class="chartItem" style="margin-right: 1%;">
<div class="chartItemTitle">营业与收入</div>
<div id="col-chart"></div>
</div>
<div class="chartItem" style="margin-left: 1%;">
<div class="chartItemTitle">客户与订单</div>
<div id="line-chart"></div>
</div>
</div>
<draw :isShow.sync="isShowDraw"></draw>
</div>
</template>
<script>
import echarts from "echarts"
import PanelGroup from './components/PanelGroup'
import {
getChartsHome,getBusinessData,getOrderData
} from "../../api/dashboard.js"
import draw from './components/draw.vue'
export default {
components: {
PanelGroup,
draw
},
data() {
return {
isShowDraw:false,
col: '',
line: '',
business_data: [],
collect_data: [],
list: {
"business": {
"server_money_total": 0,
"nurse_money_total": 0,
"remain_money_total": 0
},
"person_efficiency": {
"server_time_total": "0",
"expect": 0,
"act": 0
},
"customer": {
"active": 0,
"add": 0,
"wash": 0
},
"order": {
"server_total": 0,
"cycle_total": 0,
"unit_total": 0
},
},
customerArr: [],
orderArr: [],
chartData: {},
month: ''
}
},
watch: {
chartData(val, newval) {
if (newval) {
this.init();
}
}
},
methods: {
async loadData() {
await Promise.all([getChartsHome({
month: this.month
}),getOrderData({
month: this.month
}),getBusinessData({
month: this.month
})]).then((res) => {
this.list = res[0].list;
this.chartData = res;
let _business_data = [];
let _collect_data = [];
res[2].business_data.map(item => {
_business_data.push(item.server_money_total)
_collect_data.push(item.collect_money)
})
this.business_data = _business_data;
this.collect_data = _collect_data;
let _customerArr = [];
let _orderArr = [];
res[1].order_data.map(item => {
_customerArr.push(item.active_customer)
_orderArr.push(item.order_total)
})
this.customerArr = _customerArr;
this.orderArr = _orderArr;
}).catch()
},
init() {
this.col = echarts.init(document.getElementById('col-chart'))
this.col.setOption({
title: {
text: ''
},
tooltip: {
trigger: 'axis',
axisPointer: {
type: 'shadow'
},
position: 'bottom'
},
legend: {},
grid: {
left: '3%',
right: '4%',
bottom: '3%',
containLabel: true
},
yAxis: {
type: 'value',
boundaryGap: [0, 0.01]
},
xAxis: {
type: 'category',
data: ['第一周', '第二周', '第三周', '第四周']
},
series: [{
name: '服务金额',
type: 'bar',
data: this.business_data,
itemStyle: {
normal: {
color: 'rgb(42,182,252)'
},
},
},
{
name: '收款',
type: 'bar',
data: this.collect_data,
itemStyle: {
normal: {
color: 'rgb(34,228,255)'
},
},
}
]
})
this.line = echarts.init(document.getElementById('line-chart'))
this.line.setOption({
title: {
text: ''
},
tooltip: {
trigger: 'axis'
},
legend: {
data: ['活跃客户', '服务订单']
},
grid: {
left: '3%',
right: '6%',
bottom: '3%',
containLabel: true
},
toolbox: {
},
xAxis: {
type: 'category',
boundaryGap: false,
data: ['第一周', '第二周', '第三周', '第四周']
},
yAxis: {
type: 'value',
},
series: [{
name: '活跃客户',
type: 'line',
stack: 'Total',
data: this.customerArr,
itemStyle: {
normal: {
color: 'rgb(42,182,252)'
},
},
},
{
name: '服务订单',
type: 'line',
stack: 'Total',
data: this.orderArr,
itemStyle: {
normal: {
color: 'rgb(34,228,255)'
},
},
}
]
})
}
},
created() {
this.month=this.$moment().format("YYYY-MM")
this.loadData();
},
mounted() {
//setInterval(()=>{ this.isShowDraw = !this.isShowDraw},3000)
//this.init()
window.onresize = () => {
this.col.resize()
this.line.resize()
}
},
destroyed() {
window.onresize = null
}
}
</script>
<style lang="scss" scoped>
.statistics {
display: flex;
margin-top: 20px;
&-title {
padding-left: 6px;
}
&-content {
text-align: center;
font-size: 13px;
&-top {
&__num {
font-weight: 600;
}
&__name {
font-size: 10px;
color: rgb(140, 140, 140);
}
}
&-bottom {
display: flex;
justify-content: space-between;
&-left {
&__num {
font-weight: 600;
}
&__name {
font-size: 10px;
color: rgb(140, 140, 140);
}
}
&-right {
&__num {
font-weight: 600;
}
&__name {
font-size: 10px;
color: rgb(140, 140, 140);
}
}
}
}
&>div {
flex: 1;
margin-right: 20px;
&:last-child {
margin-right: 0;
}
}
}
.chart {
display: flex;
margin-top: 20px;
.chartItem {
width: 49%;
.chartItemTitle {
font-size: 16px;
margin-bottom: 20px;
}
#col-chart {
background: #fff;
border-radius: 10px;
flex: 1;
margin-right: 20px;
padding: 20px;
box-sizing: border-box;
min-height: 400px;
width: 100%;
}
#line-chart {
background: #fff;
border-radius: 10px;
flex: 1;
padding: 20px;
box-sizing: border-box;
min-height: 400px;
}
}
}
</style>

@ -9,7 +9,7 @@
经度
</div>
<div class="xy-table-item-content">
<el-input readonly v-model="form.lat " clearable placeholder="请输入经度 " style="width: 300px;" />
<el-input v-model="form.lat " clearable placeholder="请输入经度 " style="width: 300px;" />
</div>
</div>
</template>
@ -19,7 +19,7 @@
纬度
</div>
<div class="xy-table-item-content">
<el-input readonly v-model="form.lng " clearable placeholder="请输入纬度 " style="width: 300px;" />
<el-input v-model="form.lng " clearable placeholder="请输入纬度 " style="width: 300px;" />
</div>
</div>
</template>

@ -92,7 +92,10 @@ export default {
},
methods: {
async getTypes(){
const res = await getTypes({},false)
const res = await getTypes({
page: 1,
page_size: 999
},false)
this.types = res.data
},

@ -7,7 +7,7 @@ function resolve(dir) {
}
const name = defaultSettings.title || '四世同堂业务管理系统' // page title
const timeStamp = new Date().getTime()
// If your port is set to 80,
// use administrator privileges to execute the command line.
// For example, Mac: sudo npm run
@ -25,7 +25,7 @@ module.exports = {
* Detail: https://cli.vuejs.org/config/#publicpath
*/
publicPath: '/admin/',
outputDir: '/Users/mac/Documents/Work/c-常州四世同堂/code/shishitongtang-service/public/admin',
outputDir: './dist',
assetsDir: 'static',
css: {
loaderOptions: { // 向 CSS 相关的 loader 传递选项

Loading…
Cancel
Save