|
|
|
@ -1,5 +1,9 @@
|
|
|
|
|
<template>
|
|
|
|
|
<div class="content">
|
|
|
|
|
<div
|
|
|
|
|
v-loading="loading"
|
|
|
|
|
class="content"
|
|
|
|
|
element-loading-text="拼命加载中"
|
|
|
|
|
>
|
|
|
|
|
<div class="left">
|
|
|
|
|
<div class="info">
|
|
|
|
|
<div class="info-text title text">库存信息统计</div>
|
|
|
|
@ -20,29 +24,29 @@
|
|
|
|
|
<div>已领用183次,归还180次</div>
|
|
|
|
|
<div>乙醇</div>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="user-info-text" @click="$router.push('/reagent/report/recordinfo/store')">
|
|
|
|
|
<div class="user-info-text" @click="$router.push('/reagent/report/recordinfo/store')">
|
|
|
|
|
<div class="user-info-img" style="float: right"><img src="@/assets/4-报表统计/入库记录.png"></div>
|
|
|
|
|
<div class="title text" style="color:#409EFF ">入库记录</div>
|
|
|
|
|
<div class="use-count">5,037</div>
|
|
|
|
|
<div class="use-count">{{ recordStock.count_number }}</div>
|
|
|
|
|
<div class="use-info-total">入库历史记录(条)</div>
|
|
|
|
|
<div>已领用183次,归还180次</div>
|
|
|
|
|
<div>乙醇</div>
|
|
|
|
|
<div><i class="el-icon-time" /> {{ recordStock.date_time }}</div>
|
|
|
|
|
<div><svg-icon icon-class="cup" /> {{ recordStock.name }}</div>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="user-info-text" @click="$router.push('/reagent/report/recordinfo/collect')">
|
|
|
|
|
<div class="user-info-img" style="float: right"><img src="@/assets/4-报表统计/领用记录.png"></div>
|
|
|
|
|
<div class="title text" style="color: #1ADCE9">领用记录</div>
|
|
|
|
|
<div class="use-count">5,037</div>
|
|
|
|
|
<div class="use-count">{{ recordCollect.count_number }}</div>
|
|
|
|
|
<div class="use-info-total">领用历史记录(条)</div>
|
|
|
|
|
<div>已领用183次,归还180次</div>
|
|
|
|
|
<div>乙醇</div>
|
|
|
|
|
<div><i class="el-icon-time" /> {{ recordCollect.date_time }}</div>
|
|
|
|
|
<div><svg-icon icon-class="cup" />{{ recordCollect.name }}</div>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="user-info-text" @click="$router.push('/reagent/report/recordinfo/sendback')">
|
|
|
|
|
<div class="user-info-img" style="float: right"><img src="@/assets/4-报表统计/归还记录.png"></div>
|
|
|
|
|
<div class="title text" style="color: #5DDC1D">归还记录</div>
|
|
|
|
|
<div class="use-count">5,037</div>
|
|
|
|
|
<div class="use-count">{{ recordConsume.count_number }}</div>
|
|
|
|
|
<div class="use-info-total">归还历史记录(条)</div>
|
|
|
|
|
<div>已领用183次,归还180次</div>
|
|
|
|
|
<div>乙醇</div>
|
|
|
|
|
<div><i class="el-icon-time" /> {{ recordConsume.date_time }}</div>
|
|
|
|
|
<div><svg-icon icon-class="cup" />{{ recordConsume.name }}</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
@ -55,12 +59,12 @@
|
|
|
|
|
<span class="text">试剂库存消耗</span>
|
|
|
|
|
<i style="float: right; padding: 3px 0" class="el-icon-arrow-right" />
|
|
|
|
|
</div>
|
|
|
|
|
<div class="count text">5140</div>
|
|
|
|
|
<div class="count text">{{ pdc }}</div>
|
|
|
|
|
<div class="desc">截至目前试剂入库总量</div>
|
|
|
|
|
<div style="display: flex;line-height: 30px;text-align: center">
|
|
|
|
|
<div :style="instock"><span>20%</span></div>
|
|
|
|
|
<div :style="lending"><span>20%</span></div>
|
|
|
|
|
<div :style="consume"><span>60%</span></div>
|
|
|
|
|
<div :style="instock"><span>{{ instock.width }}</span></div>
|
|
|
|
|
<div :style="lending"><span>{{ lending.width }}</span></div>
|
|
|
|
|
<div :style="consume"><span>{{ consume.width }}</span></div>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="data-count">
|
|
|
|
|
<div :style="{borderBottom:'4px solid '+ instock.background}">
|
|
|
|
@ -84,9 +88,7 @@
|
|
|
|
|
<span class="text">试剂用量消耗</span>
|
|
|
|
|
<i style="float: right; padding: 3px 0" class="el-icon-arrow-right" />
|
|
|
|
|
</div>
|
|
|
|
|
<div style="text-align: center;width: 100%">
|
|
|
|
|
<el-progress size="small" type="dashboard" :percentage="percentage" :color="colors" />
|
|
|
|
|
</div>
|
|
|
|
|
<div id="mychart" />
|
|
|
|
|
</el-card>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="consume">
|
|
|
|
@ -95,8 +97,11 @@
|
|
|
|
|
<span class="text">人员用量消耗</span>
|
|
|
|
|
<i style="float: right; padding: 3px 0" class="el-icon-arrow-right" />
|
|
|
|
|
</div>
|
|
|
|
|
<div v-for="o in 4" :key="o" class="item">
|
|
|
|
|
{{ '列表内容 ' + o }}
|
|
|
|
|
<div v-for="(user,index) in userData" :key="user.create_user_id" class="user-item">
|
|
|
|
|
<el-avatar :size="50" :src="user.avatar_url || 'https://t7.baidu.com/it/u=2006997523,200382512&fm=193&f=GIF'" />
|
|
|
|
|
<div class="order">top{{ index+1 }}</div>
|
|
|
|
|
<div class="name">{{ user.create_user_name||"程小红" }}</div>
|
|
|
|
|
<div class="count">{{ user.count_number }}</div>
|
|
|
|
|
</div>
|
|
|
|
|
</el-card>
|
|
|
|
|
</div>
|
|
|
|
@ -105,33 +110,108 @@
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
<script>
|
|
|
|
|
import { report_home } from '@/api/report'
|
|
|
|
|
|
|
|
|
|
export default {
|
|
|
|
|
name: 'Report',
|
|
|
|
|
data() {
|
|
|
|
|
return {
|
|
|
|
|
pdc: null,
|
|
|
|
|
myChart: null,
|
|
|
|
|
loading: false,
|
|
|
|
|
pageData: null,
|
|
|
|
|
instock: {
|
|
|
|
|
'background': '#409EFF',
|
|
|
|
|
'width': '20%',
|
|
|
|
|
'count': 12485
|
|
|
|
|
'width': '',
|
|
|
|
|
'count': 0
|
|
|
|
|
},
|
|
|
|
|
lending: {
|
|
|
|
|
'background': '#5DDC1D',
|
|
|
|
|
'width': '20%',
|
|
|
|
|
'count': 12485
|
|
|
|
|
'width': '',
|
|
|
|
|
'count': 0
|
|
|
|
|
},
|
|
|
|
|
consume: {
|
|
|
|
|
'background': '#FF9B02',
|
|
|
|
|
'width': '60%',
|
|
|
|
|
'count': 12485
|
|
|
|
|
'width': '',
|
|
|
|
|
'count': 0
|
|
|
|
|
},
|
|
|
|
|
percentage: 10,
|
|
|
|
|
colors: [
|
|
|
|
|
{ color: '#f56c6c', percentage: 20 },
|
|
|
|
|
{ color: '#e6a23c', percentage: 40 },
|
|
|
|
|
{ color: '#5cb87a', percentage: 60 },
|
|
|
|
|
{ color: '#1989fa', percentage: 80 },
|
|
|
|
|
{ color: '#6f7ad3', percentage: 100 }
|
|
|
|
|
]
|
|
|
|
|
recordStock: {
|
|
|
|
|
count_number: 0
|
|
|
|
|
},
|
|
|
|
|
recordCollect: {
|
|
|
|
|
count_number: 0
|
|
|
|
|
},
|
|
|
|
|
recordConsume: {
|
|
|
|
|
count_number: 0
|
|
|
|
|
},
|
|
|
|
|
userData: []
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
created() {
|
|
|
|
|
this.loading = true
|
|
|
|
|
report_home().then(res => {
|
|
|
|
|
this.pageData = res.data
|
|
|
|
|
this.initDataFunc()
|
|
|
|
|
this.initChart()
|
|
|
|
|
}).finally(() => (this.loading = false))
|
|
|
|
|
},
|
|
|
|
|
beforeDestroy() {
|
|
|
|
|
window.removeEventListener('resize', () => {
|
|
|
|
|
this.myChart.resize()
|
|
|
|
|
})
|
|
|
|
|
},
|
|
|
|
|
methods: {
|
|
|
|
|
initDataFunc() {
|
|
|
|
|
const { drug_stock_expend, drug_use_type_data, user_use_expend } = this.pageData
|
|
|
|
|
this.pdc = drug_stock_expend.count_number
|
|
|
|
|
this.userData = user_use_expend
|
|
|
|
|
const instock = drug_stock_expend.data.find(item => item.status === 1)
|
|
|
|
|
const lending = drug_stock_expend.data.find(item => item.status === 2)
|
|
|
|
|
const consume = drug_stock_expend.data.find(item => item.status === 3)
|
|
|
|
|
this.instock.count = instock.count_number
|
|
|
|
|
this.instock.width = instock.ratio
|
|
|
|
|
this.lending.count = lending.count_number
|
|
|
|
|
this.lending.width = lending.ratio
|
|
|
|
|
this.consume.count = consume.count_number
|
|
|
|
|
this.consume.width = consume.ratio
|
|
|
|
|
this.recordStock = drug_use_type_data.find(item => item.record_type === 1)
|
|
|
|
|
this.recordCollect = drug_use_type_data.find(item => item.record_type === 2)
|
|
|
|
|
this.recordConsume = drug_use_type_data.find(item => item.record_type === 3)
|
|
|
|
|
},
|
|
|
|
|
initChart() {
|
|
|
|
|
this.myChart = this.$echarts.init(
|
|
|
|
|
document.getElementById('mychart')
|
|
|
|
|
)
|
|
|
|
|
const data = this.pageData.drug_use_expend.map(item => {
|
|
|
|
|
console.log(item)
|
|
|
|
|
item.value = item.count_num
|
|
|
|
|
return item
|
|
|
|
|
})
|
|
|
|
|
const option = {
|
|
|
|
|
legend: {
|
|
|
|
|
orient: 'vertical',
|
|
|
|
|
left: 'left'
|
|
|
|
|
},
|
|
|
|
|
radius: '50%',
|
|
|
|
|
series: [
|
|
|
|
|
{
|
|
|
|
|
name: 'Nightingale Chart',
|
|
|
|
|
type: 'pie',
|
|
|
|
|
label: {
|
|
|
|
|
normal: {
|
|
|
|
|
show: true,
|
|
|
|
|
formatter: '{b}:{d}%'
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
data
|
|
|
|
|
}
|
|
|
|
|
]
|
|
|
|
|
}
|
|
|
|
|
this.myChart.setOption(option)
|
|
|
|
|
window.addEventListener('resize', () => {
|
|
|
|
|
// 第六步,执行echarts自带的resize方法,即可做到让echarts图表自适应
|
|
|
|
|
this.myChart.resize()
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
@ -228,4 +308,24 @@ export default {
|
|
|
|
|
font-weight: bold;
|
|
|
|
|
color: #303133;
|
|
|
|
|
}
|
|
|
|
|
#mychart{
|
|
|
|
|
width:33rem;
|
|
|
|
|
height: 12.5rem;
|
|
|
|
|
}
|
|
|
|
|
.user-item{
|
|
|
|
|
display: flex;
|
|
|
|
|
flex-direction:column;
|
|
|
|
|
align-items: center;
|
|
|
|
|
.name{
|
|
|
|
|
font-size: 1rem;
|
|
|
|
|
font-weight: bold;
|
|
|
|
|
color: #303133;
|
|
|
|
|
margin: 0.3rem 0 0.3rem 0;
|
|
|
|
|
}
|
|
|
|
|
.count{
|
|
|
|
|
font-size: 1rem;
|
|
|
|
|
font-weight: 400;
|
|
|
|
|
color: #909399;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
</style>
|
|
|
|
|