|
@ -1,74 +1,133 @@
|
|
<template>
|
|
<template>
|
|
<div class="index-wrap pt30">
|
|
|
|
<!-- <div class="panel plr15">
|
|
|
|
|
|
<div class="index-wrap">
|
|
|
|
<!-- <div class="home-text">首页</div> -->
|
|
|
|
<div class="select">
|
|
|
|
|
|
|
|
</div>
|
|
|
|
<!-- 设备概况 -->
|
|
|
|
<div class="panel sbzl">
|
|
|
|
<div class="kitbox pt15 plr15 box-flex-c">
|
|
|
|
<div class="box-flex-c c-333 fs-16 f-bold">设备概况</div>
|
|
|
|
<div class="box-flex-c c-333 f-bold fs-12">在线率:{{ overview.onlineRate }}</div>
|
|
|
|
</div>
|
|
|
|
<div class="box-flex-c pt10 pb20 plr15">
|
|
|
|
<div class="Online">
|
|
|
|
<div class="equipment-num">{{ overview.onlineTotal }}</div>
|
|
|
|
<div class="equipment-text">在线设备</div>
|
|
|
|
</div>
|
|
|
|
<div class="total">
|
|
|
|
<div class="equipment-num">{{ overview.total }}</div>
|
|
|
|
<div class="equipment-text">运营总台数</div>
|
|
|
|
</div>
|
|
|
|
<div class="offline">
|
|
|
|
<div class="equipment-num">{{ overview.noOnlineTotal }}</div>
|
|
|
|
<div class="equipment-text">离线设备</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<!-- 运维数据 -->
|
|
|
|
<div class="panel plr15 mt10 cygn">
|
|
<div class="kitbox pt15 ">
|
|
<div class="kitbox pt15 ">
|
|
<div class="box-flex-1 c-333 fs-16 f-bold">今日订单数量</div>
|
|
|
|
<div class="c-666 fs-12 box-v-middle">
|
|
|
|
<div @click="searchTypeShow=!searchTypeShow" class="drop-sel c-666 fs-12 plr10 ptb4">
|
|
|
|
<span class="v-middle">{{searchType}}</span>
|
|
|
|
<van-icon class="v-middle ml4" name="arrow-down" />
|
|
|
|
<div v-show="searchTypeShow" class="sel-body fs-12 c-666">
|
|
|
|
<div v-for="(item, i) in options" :key="i" v-show="searchType!=item" @click.stop="searchType=item;searchTypeShow=false;search()" class="ptb6">{{item}}</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
<div class="box-flex-1 c-333 fs-16 f-bold">运维数据</div>
|
|
</div>
|
|
</div>
|
|
<div class="c-20d7ad fs-23 pt10">
|
|
|
|
752,600
|
|
|
|
|
|
<div class="pt10">
|
|
|
|
<div class="pb20">
|
|
|
|
<van-row>
|
|
|
|
<van-col class="col col-tl" span="12">
|
|
|
|
<div class="operations-num">{{ maintain.addTotal }}</div>
|
|
|
|
<div class="operations-text"><span><img class="img" src="../../assets/images/waiting-equipment.png" alt=""></span>待补设备数</div>
|
|
|
|
</van-col>
|
|
|
|
<van-col class="col" span="12">
|
|
|
|
<div class="operations-num">{{ maintain.hcWaringTotalNum }}</div>
|
|
|
|
<div class="operations-text"><span><img class="img" src="../../assets/images/thermometer.png" alt=""></span>温湿度预警数</div>
|
|
|
|
</van-col>
|
|
|
|
<van-col class="col col-t col-bl" span="12">
|
|
|
|
<div class="operations-num">{{ maintain.noOnlineTotal1WithUserId }}</div>
|
|
|
|
<div class="operations-text"><span><img class="img" src="../../assets/images/waiting-equipment.png" alt=""></span>离线设备数</div>
|
|
|
|
</van-col>
|
|
|
|
<van-col class="col col-t" span="12">
|
|
|
|
<div class="operations-num">{{ maintain.noGetDrugNum }}</div>
|
|
|
|
<div class="operations-text"><span><img class="img" src="../../assets/images/offline-medicine.png" alt=""></span>待取药订单数</div>
|
|
|
|
</van-col>
|
|
|
|
</van-row>
|
|
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="c-666 fs-14 pt10 pb10">今日补货量 <span class="ml10 c-17b3ec">0</span></div>
|
|
|
|
</div> -->
|
|
|
|
|
|
|
|
<div class="">
|
|
|
|
<div class="panel sbzl">
|
|
|
|
<div class="kitbox pt15 plr15">
|
|
|
|
<div class="box-flex-1 c-333 fs-16 f-bold">设备总览</div>
|
|
|
|
</div>
|
|
|
|
<div class="pt20 pb20 plr5">
|
|
|
|
<van-row class="">
|
|
|
|
<van-col span="6" class="tc ">
|
|
|
|
<div class="fs-23 c-17b3ec">{{countObj.total}}</div>
|
|
|
|
<div class="fs-14 c-666 pt5">全部设备</div>
|
|
|
|
</van-col>
|
|
|
|
<van-col span="6" class="tc">
|
|
|
|
<div class="fs-23 c-ff9526">{{countObj.onlineTotal}}</div>
|
|
|
|
<div class="fs-14 c-666 pt5">在线设备</div>
|
|
|
|
</van-col>
|
|
|
|
<van-col span="6" class="tc">
|
|
|
|
<div class="fs-23 c-ff5e6c">{{(countObj.onlineRate * 100).toFixed(0)}}%</div>
|
|
|
|
<div class="fs-14 c-666 pt5">在线率</div>
|
|
|
|
</van-col>
|
|
|
|
<van-col span="6" class="tc">
|
|
|
|
<div class="fs-23 c-17b3ec">{{countObj.saleTotal}}</div>
|
|
|
|
<div class="fs-14 c-666 pt5">在售设备</div>
|
|
|
|
</van-col>
|
|
|
|
</van-row>
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
|
|
|
<!-- 取药次数 -->
|
|
|
|
<div class="panel plr15 mt10 medicine">
|
|
|
|
<div class="kitbox pt15 box-flex-c">
|
|
|
|
<div class="box-flex-c c-333 fs-16 f-bold">取药次数</div>
|
|
|
|
<div class="box-flex-c c-333 fs-12 f-bold time">
|
|
|
|
<ul class="ul">
|
|
|
|
<li @click="medicineTime('1')" :class="medicineBag == '1' ? 'li-bag':''">今日</li>
|
|
|
|
<li @click="medicineTime('7')" :class="medicineBag == '7' ? 'li-bag':''">7日</li>
|
|
|
|
<li @click="medicineTime('30')" class="border-r" :class="medicineBag == '30' ? 'li-bag':''">30日</li>
|
|
|
|
<li @click="medicineTime('90')" class="border-r" :class="medicineBag == '90' ? 'li-bag':''">90日</li>
|
|
|
|
<li @click="medicineTime('全部')" :class="medicineBag == '' ? 'li-bag':''">全部</li>
|
|
|
|
</ul>
|
|
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="pt24 pb19">
|
|
|
|
<div class="medicine-b-l">
|
|
|
|
<div class="medicine-b-g-num">
|
|
|
|
{{ shippingType.total }}
|
|
|
|
<span>次</span>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="scan">扫码取药:{{ shippingType.saomaTotal }}次</div>
|
|
|
|
<div class="care">医保卡取药:{{ shippingType.yibaoTotal }}次</div>
|
|
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
|
|
<!-- <div class="mt10">
|
|
|
|
<div class="panel cygn">
|
|
|
|
<div class="kitbox pt15 plr15">
|
|
|
|
<div class="box-flex-1 c-333 fs-16 f-bold">常用功能</div>
|
|
|
|
</div>
|
|
|
|
<div class="ptb10 plr5">
|
|
|
|
<van-row class="">
|
|
|
|
<van-col @click="$router.replace({path: '/order/list'})" span="6" class="tc ">
|
|
|
|
<div class="fs-23 c-17b3ec"><img src="@/assets/images/dingdanguanli.png" alt=""></div>
|
|
|
|
<div class="fs-14 c-666 pt5">订单管理</div>
|
|
|
|
</van-col>
|
|
|
|
<van-col @click="$router.replace({path: '/device'})" span="6" class="tc">
|
|
|
|
<div class="fs-23 c-ff9526"><img src="@/assets/images/shebeiguanli.png" alt=""></div>
|
|
|
|
<div class="fs-14 c-666 pt5">设备管理</div>
|
|
|
|
</van-col>
|
|
|
|
</van-row>
|
|
|
|
</div>
|
|
|
|
|
|
<!-- 电子处方单 -->
|
|
|
|
<div class="panel plr15 mt10 medicine">
|
|
|
|
<div class="kitbox pt15 box-flex-c">
|
|
|
|
<div class="box-flex-c c-333 fs-16 f-bold">电子处方单</div>
|
|
|
|
<div class="box-flex-c c-333 fs-12 f-bold time">
|
|
|
|
<ul class="ul">
|
|
|
|
<li @click="prescriptionTime('1')" :class="prescriptionBag == '1' ? 'li-bag':''">今日</li>
|
|
|
|
<li @click="prescriptionTime('7')" :class="prescriptionBag == '7' ? 'li-bag':''">7日</li>
|
|
|
|
<li @click="prescriptionTime('30')" class="border-r" :class="prescriptionBag == '30' ? 'li-bag':''">30日</li>
|
|
|
|
<li @click="prescriptionTime('90')" class="border-r" :class="prescriptionBag == '90' ? 'li-bag':''">90日</li>
|
|
|
|
<li @click="prescriptionTime('全部')" :class="prescriptionBag == '' ? 'li-bag':''">全部</li>
|
|
|
|
</ul>
|
|
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div> -->
|
|
|
|
|
|
<div class="pt24 pb19">
|
|
|
|
<div class="medicine-b-l prescription">
|
|
|
|
<div class="medicine-b-g-num">
|
|
|
|
{{ prescriptionStatics.total }}
|
|
|
|
<span>次</span>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="prescription-num">药品数量:{{ prescriptionStatics.drugTotal }}件</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<!-- 销售额 -->
|
|
|
|
<div class="panel plr15 mt10 medicine">
|
|
|
|
<div class="kitbox pt15 box-flex-c">
|
|
|
|
<div class="box-flex-c c-333 fs-16 f-bold">销售额</div>
|
|
|
|
<div class="box-flex-c c-333 fs-12 f-bold time">
|
|
|
|
<ul class="ul">
|
|
|
|
<li @click="salesTime('1')" :class="salesBag == '1' ? 'li-bag':''">今日</li>
|
|
|
|
<li @click="salesTime('7')" :class="salesBag == '7' ? 'li-bag':''">7日</li>
|
|
|
|
<li @click="salesTime('30')" class="border-r" :class="salesBag == '30' ? 'li-bag':''">30日</li>
|
|
|
|
<li @click="salesTime('90')" class="border-r" :class="salesBag == '90' ? 'li-bag':''">90日</li>
|
|
|
|
<li @click="salesTime('全部')" :class="salesBag == '' ? 'li-bag':''">全部</li>
|
|
|
|
</ul>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="pt20 pb20 sales-data">
|
|
|
|
<div>¥{{ amount }}</div>
|
|
|
|
<div style="display:none;">月同比:<span>0.40%</span></div>
|
|
|
|
<div style="display:none;">日环比:<span>5.00%</span></div>
|
|
|
|
</div>
|
|
|
|
<div id="sales-chart" class="sales-chart"></div>
|
|
|
|
</div>
|
|
|
|
<div class="home-bottom"></div>
|
|
</div>
|
|
</div>
|
|
</template>
|
|
</template>
|
|
<script>
|
|
<script>
|
|
|
|
import * as echarts from 'echarts';
|
|
import medicineAbinetApi from '@/api/api-medicineAbinet'
|
|
import medicineAbinetApi from '@/api/api-medicineAbinet'
|
|
export default {
|
|
export default {
|
|
name: "index",
|
|
name: "index",
|
|
@ -77,98 +136,197 @@ export default {
|
|
},
|
|
},
|
|
data() {
|
|
data() {
|
|
return {
|
|
return {
|
|
searchTypeShow: false,
|
|
|
|
searchType: "今日",
|
|
|
|
options: ['今日', '7天内', '30天内'],
|
|
|
|
countObj: {
|
|
|
|
"total": 0, //总的在线数
|
|
|
|
"saleTotal": 0, //在售数
|
|
|
|
"onlineRate": 0, //在线率
|
|
|
|
"onlineTotal": 0, //在线设备数
|
|
|
|
"outCount": 0 //缺药设备数
|
|
|
|
}
|
|
|
|
|
|
medicineBag:'1',
|
|
|
|
prescriptionBag:'1',
|
|
|
|
salesBag:'1',
|
|
|
|
count:[],
|
|
|
|
date:[],
|
|
|
|
amount:'- -',
|
|
|
|
overview:{
|
|
|
|
total:'- -', // 总台数
|
|
|
|
noOnlineTotal:'- -', // 不在线数
|
|
|
|
onlineRate:'- -', // 在线率
|
|
|
|
onlineTotal:'- -', // 在线台数
|
|
|
|
},
|
|
|
|
maintain:{
|
|
|
|
hcWaringTotalNum:'- -', // 温湿度异常警告
|
|
|
|
noOnlineTotal1WithUserId:'- -', // 不在线数
|
|
|
|
noGetDrugNum:'- -', // 待取药订单数
|
|
|
|
addTotal:'- -', // 缺货设备数
|
|
|
|
},
|
|
|
|
shippingType:{
|
|
|
|
saomaTotal:'- -',
|
|
|
|
total:'- -',
|
|
|
|
yibaoTotal:'- -'
|
|
|
|
},
|
|
|
|
prescriptionStatics:{
|
|
|
|
total:'- -',
|
|
|
|
drugTotal:'- -'
|
|
|
|
}
|
|
|
|
|
|
}
|
|
}
|
|
},
|
|
},
|
|
created(){
|
|
created(){
|
|
this.countall()
|
|
|
|
},
|
|
|
|
|
|
this.countall();
|
|
|
|
this.medicine();
|
|
|
|
this.prescriptions();
|
|
|
|
},
|
|
|
|
mounted(){
|
|
|
|
this.echartsData();
|
|
|
|
},
|
|
methods: {
|
|
methods: {
|
|
|
|
// 设备概况 运营数据
|
|
countall(){
|
|
countall(){
|
|
medicineAbinetApi
|
|
medicineAbinetApi
|
|
.countAllDevice({
|
|
.countAllDevice({
|
|
userId: this.user.id
|
|
userId: this.user.id
|
|
})
|
|
})
|
|
.then(res=>{
|
|
.then(res=>{
|
|
console.log('countall', res)
|
|
|
|
this.countObj = _.assign(this.countObj, res.obj)
|
|
|
|
|
|
console.log('countall', res);
|
|
|
|
this.overview = res.obj.overview;
|
|
|
|
this.maintain = res.obj.maintain;
|
|
|
|
})
|
|
|
|
.catch(err=>{
|
|
|
|
console.error(err)
|
|
|
|
})
|
|
|
|
},
|
|
|
|
// 取药次数
|
|
|
|
medicine(){
|
|
|
|
medicineAbinetApi
|
|
|
|
.getmedicine({
|
|
|
|
userId: this.user.id,
|
|
|
|
day:this.medicineBag
|
|
|
|
})
|
|
|
|
.then(res=>{
|
|
|
|
console.log('medicine', res)
|
|
|
|
this.shippingType = res.obj;
|
|
|
|
})
|
|
|
|
.catch(err=>{
|
|
|
|
console.error(err)
|
|
|
|
})
|
|
|
|
},
|
|
|
|
// 电子处方单
|
|
|
|
prescriptions(){
|
|
|
|
medicineAbinetApi
|
|
|
|
.getprescriptions({
|
|
|
|
userId: this.user.id,
|
|
|
|
day:this.prescriptionBag
|
|
|
|
})
|
|
|
|
.then(res=>{
|
|
|
|
// console.log('prescriptions', res)
|
|
|
|
this.prescriptionStatics = res.obj;
|
|
})
|
|
})
|
|
.catch(err=>{
|
|
.catch(err=>{
|
|
console.error(err)
|
|
console.error(err)
|
|
})
|
|
})
|
|
}
|
|
|
|
|
|
},
|
|
|
|
// 取药时间查询
|
|
|
|
medicineTime(val){
|
|
|
|
if(val == '全部'){
|
|
|
|
this.medicineBag = '';
|
|
|
|
this.medicine();
|
|
|
|
console.log('全部')
|
|
|
|
}else{
|
|
|
|
this.medicineBag = val;
|
|
|
|
this.medicine();
|
|
|
|
console.log('1,3,7,9')
|
|
|
|
}
|
|
|
|
|
|
|
|
},
|
|
|
|
// 电子处方单查询
|
|
|
|
prescriptionTime(val){
|
|
|
|
if(val == '全部'){
|
|
|
|
this.prescriptionBag = '';
|
|
|
|
this.prescriptions();
|
|
|
|
console.log('全部')
|
|
|
|
}else{
|
|
|
|
this.prescriptionBag = val;
|
|
|
|
this.prescriptions();
|
|
|
|
console.log('1,3,7,9')
|
|
|
|
}
|
|
|
|
},
|
|
|
|
// 销售额查询
|
|
|
|
salesTime(val){
|
|
|
|
if(val == '全部'){
|
|
|
|
this.salesBag = '';
|
|
|
|
console.log('全部')
|
|
|
|
}else{
|
|
|
|
this.salesBag = val;
|
|
|
|
console.log('1,3,7,9')
|
|
|
|
}
|
|
|
|
this.echartsData();
|
|
|
|
},
|
|
|
|
echartsData(){
|
|
|
|
medicineAbinetApi
|
|
|
|
.getechartsData({
|
|
|
|
userId: this.user.id,
|
|
|
|
day:this.salesBag
|
|
|
|
})
|
|
|
|
.then(res=>{
|
|
|
|
console.log('echartsData', res);
|
|
|
|
this.amount = res.obj.amount;
|
|
|
|
this.count = res.obj.amountdateList.map((item) =>{
|
|
|
|
return item.count
|
|
|
|
});
|
|
|
|
this.date = res.obj.amountdateList.map((item) =>{
|
|
|
|
return item.date
|
|
|
|
});
|
|
|
|
|
|
|
|
// 基于准备好的dom,初始化echarts实例
|
|
|
|
var myChart;
|
|
|
|
if (myChart != null && myChart != "" && myChart != undefined){
|
|
|
|
// chartDom.clear();
|
|
|
|
myChart.dispose();
|
|
|
|
// document.getElementById('sales-chart').innerHTML = '';
|
|
|
|
}
|
|
|
|
var chartDom = document.getElementById('sales-chart');
|
|
|
|
myChart = echarts.init(chartDom);
|
|
|
|
var option;
|
|
|
|
|
|
|
|
option = {
|
|
|
|
grid:{
|
|
|
|
left: '3%',
|
|
|
|
right: '4%',
|
|
|
|
bottom: '2%',
|
|
|
|
top:'5%',
|
|
|
|
containLabel: true
|
|
|
|
},
|
|
|
|
tooltip: {
|
|
|
|
trigger: 'axis'
|
|
|
|
},
|
|
|
|
xAxis: {
|
|
|
|
type: 'category',
|
|
|
|
boundaryGap: false,
|
|
|
|
data: this.date,
|
|
|
|
axisTick:{
|
|
|
|
show:false, // X轴刻度隐藏
|
|
|
|
},
|
|
|
|
axisLabel:{
|
|
|
|
fontSize:'8', // X轴文字字体大小
|
|
|
|
}
|
|
|
|
},
|
|
|
|
yAxis: {
|
|
|
|
type: 'value'
|
|
|
|
},
|
|
|
|
series: [
|
|
|
|
{
|
|
|
|
data: this.count,
|
|
|
|
type: 'line'
|
|
|
|
}
|
|
|
|
]
|
|
|
|
};
|
|
|
|
// if (myChart != null && myChart != "" && myChart != undefined) {
|
|
|
|
// myChart.dispose();
|
|
|
|
// }
|
|
|
|
option && myChart.setOption(option);
|
|
|
|
})
|
|
|
|
.catch(err=>{
|
|
|
|
console.error(err)
|
|
|
|
})
|
|
|
|
},
|
|
},
|
|
},
|
|
}
|
|
}
|
|
</script>
|
|
</script>
|
|
<style lang="scss" scoped>
|
|
<style lang="scss" scoped>
|
|
.index-wrap {
|
|
|
|
background: url('../../assets/images/index_banner.png') no-repeat;
|
|
|
|
background-size: 100%;
|
|
|
|
.panel{
|
|
|
|
width: 345px;
|
|
|
|
background-color: #ffffff;
|
|
|
|
box-shadow: 0px 2px 10px 0px
|
|
|
|
rgba(0, 0, 0, 0.15);
|
|
|
|
border-radius: 5px;
|
|
|
|
margin: 0 auto;
|
|
|
|
.drop-sel{
|
|
|
|
background-color: rgba($color: #000000, $alpha: 0.05);
|
|
|
|
border-radius: 12px;
|
|
|
|
position: relative;
|
|
|
|
.sel-body{
|
|
|
|
width: 60px;
|
|
|
|
left: 0;
|
|
|
|
position: absolute;
|
|
|
|
box-shadow: 2px 3px 8px 0px
|
|
|
|
rgba(0, 0, 0, 0.15);
|
|
|
|
border-radius: 11px;
|
|
|
|
background-color: rgba($color: #ffff, $alpha: 0.8);
|
|
|
|
text-align: center;
|
|
|
|
padding: 10px 0;
|
|
|
|
top: 30px;
|
|
|
|
z-index: 1;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
&.sbzl{
|
|
|
|
.van-col {
|
|
|
|
position: relative;
|
|
|
|
&::after{
|
|
|
|
content: "";
|
|
|
|
width: 1px;
|
|
|
|
height: 41px;
|
|
|
|
background-color: #e7e7e7;
|
|
|
|
right: 0;
|
|
|
|
position: absolute;
|
|
|
|
top: 2px;
|
|
|
|
}
|
|
|
|
&:last-child{
|
|
|
|
&::after{
|
|
|
|
display: none;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
&.cygn{
|
|
|
|
.van-col{
|
|
|
|
padding: 10px 0;
|
|
|
|
img{
|
|
|
|
display: block;
|
|
|
|
width: 40px;
|
|
|
|
height: 40px;
|
|
|
|
margin: 0 auto;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
@import "./scss/index.scss";
|
|
</style>
|
|
</style>
|