lincl 2 anos atrás
pai
commit
6e27864901

+ 16 - 0
mini-pro-web/src/api/api-medicineAbinet.js

@ -694,6 +694,22 @@ let service = {
		});
    },
	getPrescriptionStatics: function(params) {
		return request({
			url: `${BASE}/baseDevice/getPrescriptionStatics`,
			method: "get",
			params
		});
    },
	getPrescriptionStaticsRank: function(params) {
		return request({
			url: `${BASE}/baseDevice/getPrescriptionStaticsRank`,
			method: "get",
			params
		});
    },
};
export default service;

+ 18 - 78
mini-pro-web/src/views/index/Index.vue

@ -96,7 +96,7 @@
			</div>
		</div>
        <!-- 取药次数 -->
        <div v-if="medicineShow" class="panel plr15 mt10 medicine">
        <!-- <div v-if="medicineShow" 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">
@ -119,9 +119,9 @@
                <div class="scan">扫码取药:{{ shippingType.saomaTotal }}次</div>
                <div class="care">医保卡取药:{{ shippingType.yibaoTotal }}次</div>
            </div>
		</div>
		</div> -->
        <!-- 电子处方单 -->
        <div class="panel plr15 mt10 medicine">
        <!-- <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">
@ -143,7 +143,9 @@
                </div>
                <div class="prescription-num">药品数量:{{ prescriptionStatics.drugTotal }}盒</div>
            </div>
		</div>
		</div> -->
        <PickAnalyse v-if="medicineShow" ref="PickAnalyse"/>
        <OrderAnalyse ref="OrderAnalyse"/>
        <!-- 销售额 -->
        <!-- <div v-if="sales" class="panel plr15 mt10 medicine">
			<div class="kitbox pt15 box-flex-c">
@ -183,10 +185,13 @@
import { findOneUser} from "@/api/login";
import * as echarts from 'echarts';
import medicineAbinetApi from '@/api/api-medicineAbinet'
import OrderAnalyse from './components/OrderAnalyse'
import PickAnalyse from './components/PickAnalyse'
export default {
	name: "homeIndex",
	components: {
		
		OrderAnalyse,
        PickAnalyse
  	},
    watch: {
        drowMenuShow(n){
@ -237,15 +242,7 @@ export default {
                noGetDrugNum:'- -', // 待取药订单数
                addTotal:'- -', // 缺货设备数
            },
            shippingType:{
                saomaTotal:'- -',
                total:'- -',
                yibaoTotal:'- -'
            },
            prescriptionStatics:{
                total:'- -',
                drugTotal:'- -'
            },
            
            drowMenuShow: false,
            townList: [],
@ -269,7 +266,6 @@ export default {
  	},
	created(){
        this.first = true
		this.refreshData()
        this.getOrgList()
        console.log('this.$store.user.state',this.$store.state.user.curRoleCode)
        if(this.$store.state.user.curRoleCode =='replenisher'){
@ -285,6 +281,7 @@ export default {
        }
    },
    mounted(){
        this.refreshData()
        this.echartsData();
    },
  	methods: {
@ -311,62 +308,8 @@ export default {
                query: p
            })
        },
        // 取药次数
        medicine(){
            var p = this.getTownParams()
            var { startDate, endDate, medicineBag } = this
            if(medicineBag){
                if(medicineBag == -1){
                } else {
                    p.endTime = this.$moment().format('YYYY-MM-DD 23:59:59')
                    p.startTime = this.$moment().add(-Number(medicineBag)+1, 'days').format('YYYY-MM-DD 00:00:00')
                }
            } else {
                p.startTime = startDate + " 00:00:00"
                p.endTime = endDate? (endDate + " 23:59:59") : ""
            }
            // p.day = this.medicineBag
            console.log('medicine', p)
            medicineAbinetApi
				.getmedicine(p)
				.then(res=>{
                    console.log('medicine', res)
                    this.medicineData = true;
                    this.shippingType = res.obj;
				})
				.catch(err=>{
                    console.error(err)
                    this.medicineData = true;
				})
        },
        // 电子处方单
        prescriptions(){
            var p = this.getTownParams()
            var { startDate, endDate, prescriptionBag } = this
            if(prescriptionBag){
                if(prescriptionBag == -1){
                } else {
                    p.endTime = this.$moment().format('YYYY-MM-DD 23:59:59')
                    p.startTime = this.$moment().add(-Number(prescriptionBag)+1, 'days').format('YYYY-MM-DD 00:00:00')
                }
            } else {
                p.startTime = startDate + " 00:00:00"
                p.endTime = endDate? (endDate + " 23:59:59") : ""
            }
            medicineAbinetApi
				.getprescriptions(p)
				.then(res=>{
                    // console.log('prescriptions', res)
                    this.prescriptionStatics = res.obj;
				})
				.catch(err=>{
					console.error(err)
				})
        },
        
        
        // 取药时间查询
        medicineTime(val){
            if(this.medicineData){
@ -382,11 +325,6 @@ export default {
                
            }
        },
        // 电子处方单查询
        prescriptionTime(val){
            this.prescriptionBag = val;
            this.prescriptions();
        },
        // 销售额查询
        salesTime(val){
            if(val == '全部'){
@ -470,8 +408,10 @@ export default {
        refreshData(){
            this.countall();
            this.medicine();
            this.prescriptions();
            // if(this.medicineShow){
                this.$refs.PickAnalyse.refreshData();
            // }
            this.$refs.OrderAnalyse.refreshData();
        },
        getTownParams(){
            var p = {

+ 334 - 0
mini-pro-web/src/views/index/components/OrderAnalyse.vue

@ -0,0 +1,334 @@
<template>
	<div class="index-OrderAnalyse mt10">
        <div class="panel plr15  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="border-r" :class="prescriptionBag == '1' ? 'li-bag':''">今日</li>
                        <li @click="prescriptionTime('7')" class="border-r" :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('-1')" :class="prescriptionBag == '-1' ? 'li-bag':''">全部</li>
                    </ul>
                </div>
			</div>
            <div class=" ">
                <div>
                    <div class="pie-charts" ref="pie"></div>
                </div>
            </div>
            <div>
                <div class="kitbox pt15 box-flex-c bt-e1e1e1">
                    <div class="box-flex-c c-333 fs-16 f-bold">订单排行</div>
                    <div class="box-flex-c c-333 fs-12 type-list kitbox">
                        <div class="type-item blue">订单量</div>
                        <div class="type-item orange">药柜取药</div>
                    </div>
                </div>
                <div class="bar-charts pt15 " :style="height + 'px'">
                    <div v-show="!nodata" ref="barChart"></div>
                    <NoData v-show="nodata"/>
                </div>
            </div>
		</div>
	</div>
</template>
<script>
import * as echarts from 'echarts';
import medicineAbinetApi from '@/api/api-medicineAbinet'
export default {
  	data() {
    	return {
            dataIndex: 0,
            prescriptionBag: "1",
            nodata: false,
            height: 200,
            startDate: '',
            endDate: '',
    	}
  	},
  	methods: {
        refreshData(){
            this.prescriptions();
            this.getPrescriptionStaticsRank()
        },
        prescriptionTime(val){
            this.prescriptionBag = val;
            this.refreshData();
        },
        prescriptions(){
            var p = this.$parent.getTownParams()
            
            // if(!p.level){
            //     p.level = '1'
            //     p.area = '350200';
            // }
            var { startDate, endDate, prescriptionBag } = this
            if(prescriptionBag){
                if(prescriptionBag == -1){
                    
                } else {
                    p.endTime = this.$moment().format('YYYY-MM-DD 23:59:59')
                    p.startTime = this.$moment().add(-Number(prescriptionBag)+1, 'days').format('YYYY-MM-DD 00:00:00')
                }
            } else {
                p.startTime = startDate + " 00:00:00"
                p.endTime = endDate? (endDate + " 23:59:59") : ""
            }
            console.log('getprescriptions', p)
            medicineAbinetApi
				.getprescriptions(p)
				.then(res=>{
                    console.log('getprescriptions', res)
                    if(res.status == 200){
                        var { onlineTotal, offlineTotal } = res.obj
                        this.initPie([
                            { value: onlineTotal, name: '线上订单' },
                            { value: offlineTotal, name: '线下订单' },
                        ])
                    }
				})
				.catch(err=>{
					console.error(err)
				})
        },
        initPie(seriesData){
            var { dataIndex } = this
            var option = {
                tooltip: {
                    show: false,
                    trigger: 'item'
                },
                legend: {
                    top: 'middle',
                    left: '54%',
                },
                series: [
                    {
                        type: 'pie',
                        center: ['25%', '50%'],
                        radius: ['55%', '70%'],
                        avoidLabelOverlap: false,
                        label: {
                            show: false,
                            position: 'center'
                        },
                        emphasis: {
                            label: {
                                show: true,
                                fontSize: '12',
                                lineHeight: 20,
                                formatter: '{c}\n{d}%\n{b}',
                                // rich: {
                                //     b: {
                                //         lineHeight: 20
                                //     },
                                //     d: {
                                //         fontSize: '14',
                                //     },
                                // }
                            }
                        },
                        labelLine: {
                            show: false
                        },
                        data: seriesData
                    }
                ]
            };
            if(!this.myChart){
                this.myChart = echarts.init(this.$refs.pie);
                this.myChart.on('click', (e)=>{
                    if(this.dataIndex !== e.dataIndex) {
                        this.myChart.dispatchAction({ 
                            type: 'downplay',
                            seriesIndex: 0,
                            dataIndex: this.dataIndex
                        })
                        // this.dataIndex = -1
                    }
                    this.dataIndex = e.dataIndex
                    this.myChart.dispatchAction({ 
                        type: 'highlight',
                        seriesIndex: 0,
                        dataIndex: e.dataIndex
                    })
                });
            }
            this.myChart.setOption(option)
            this.$nextTick(()=>{
                this.myChart.dispatchAction({ 
                    type: 'highlight',
                    seriesIndex: 0,
                    dataIndex
                })
            })
        },
        getPrescriptionStaticsRank(){
            var p = this.$parent.getTownParams()
            var { startDate, endDate, prescriptionBag } = this
            if(prescriptionBag){
                if(prescriptionBag == -1){
                    
                } else {
                    p.endTime = this.$moment().format('YYYY-MM-DD 23:59:59')
                    p.startTime = this.$moment().add(-Number(prescriptionBag)+1, 'days').format('YYYY-MM-DD 00:00:00')
                }
            } else {
                p.startTime = startDate + " 00:00:00"
                p.endTime = endDate? (endDate + " 23:59:59") : ""
            }
            console.log('getPrescriptionStaticsRank', p)
            medicineAbinetApi
				.getPrescriptionStaticsRank(p)
				.then(res=>{
                    console.log('getPrescriptionStaticsRank', res)
                    if(res.status == 200){
                        if(res.detailModelList.length){
                            this.nodata = false
                            this.height = res.detailModelList.length * 60
                            this.$nextTick(()=>{
                                var seriesData1 = [], seriesData2 = [], max = 0, yAxisData = []
                                _.each(res.detailModelList, v=>{
                                    if(v.orderTotal > max){
                                        max = v.orderTotal
                                    }
                                    if(v.sellTotal > max){
                                        max = v.sellTotal
                                    }
                                    seriesData1.push(v.orderTotal)
                                    seriesData2.push(v.sellTotal)
                                    yAxisData.push(v.community.substring(0, 9)+ "\n" +v.community.substring(9))
                                })
                                this.initBar(yAxisData, seriesData1, seriesData2, max)
                            })
                            return
                        }
                    }
                    this.height = 200
                    this.nodata = true
				})
				.catch(err=>{
					console.error(err)
                    this.nodata = true
				})
        },
        initBar(yAxisData, seriesData1, seriesData2, max){
            var option = {
                tooltip: {
                    trigger: 'axis',
                    axisPointer: {
                        type: 'shadow'
                    }
                },
                grid: {
                    top: "3%",
                    left: '0%',
                    right: '0%',
                    bottom: '3%',
                    containLabel: true
                },
                xAxis: {
                    type: 'value',
                    show: false,
                    max: Math.ceil(max / 4) + max
                    // boundaryGap: [0, 0.01]
                },
                yAxis: {
                    type: 'category',
                    data: yAxisData, //['XX社区卫生\n服务中心', 'XX社区卫生\n服务中心', 'XX社区卫生\n服务中心', 'XX社区卫生\n服务中心', 'XX社区卫生\n服务中心', 'XX社区卫生\n服务中心'],
                    axisLabel: {
                        with: 100
                    }
                },
                series: [
                    {
                        name: '订单量',
                        type: 'bar',
                        itemStyle: {
                            color: '#0099ff'
                        },
                        label: {
                            show: true,
                            position: 'right'
                        },
                        // label: {
                        //     show: true,
                        //     formatter: '{b}',
                        //     align: 'right'
                        // },
                        data: seriesData1
                    },
                    {
                        name: '药柜取药',
                        type: 'bar',
                        label: {
                            show: true,
                            position: 'right'
                        },
                        itemStyle: {
                            color: '#ff9900'
                        },
                        data: seriesData2
                    }
                ]
            };
            if(!this.barChart){
                this.barChart = echarts.init(this.$refs.barChart);
            }
            this.barChart.setOption(option)
        }
    },
}
</script>
<style lang="scss" scoped>
.index-OrderAnalyse{
    .pie-charts{
        height: 200px;
    }
    .bar-charts{
        min-height: 200px;
        >div{
            height: 100%;
            min-height: 200px;
        }
    }
    .type-list{
        -webkit-box-align: center;
        .type-item{
            padding-right: 20px;
            display: -webkit-box;
            -webkit-box-align: center;
            &::before{
                content: "";
                display: block;
                width: 16px;
                height: 16px;
                margin-right: 5px;
            }
            &.orange{
                &::before{
                    background: #ff9900;
                }
            }
            &.blue{
                &::before{
                    background: #0099ff;
                }
            }
            &:last-child{
                padding-right: 0;
            }
        }
    }
}
</style>

+ 150 - 0
mini-pro-web/src/views/index/components/PickAnalyse.vue

@ -0,0 +1,150 @@
<template>
	<div class="index-PickAnalyse mt10">
        <div class="panel plr15  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="border-r" :class="medicineBag == '1' ? 'li-bag':''">今日</li>
                        <li @click="prescriptionTime('7')" class="border-r" :class="medicineBag == '7' ? 'li-bag':''">7日</li>
                        <li @click="prescriptionTime('30')" class="border-r" :class="medicineBag == '30' ? 'li-bag':''">30日</li>
                        <li @click="prescriptionTime('90')" class="border-r" :class="medicineBag == '90' ? 'li-bag':''">90日</li>
                        <li @click="prescriptionTime('-1')" :class="medicineBag == '-1' ? 'li-bag':''">全部</li>
                    </ul>
                </div>
			</div>
            <div class=" ">
                <div>
                    <div class="pie-charts" ref="pie"></div>
                </div>
            </div>
           
		</div>
	</div>
</template>
<script>
import * as echarts from 'echarts';
import medicineAbinetApi from '@/api/api-medicineAbinet'
export default {
  	data() {
    	return {
            dataIndex: 0,
            medicineBag: "1",
    	}
  	},
  	methods: {
        refreshData(){
            this.medicine();
        },
        medicine(p){
            var p = this.$parent.getTownParams()
            var { startDate, endDate, medicineBag } = this
            if(medicineBag){
                if(medicineBag == -1){
                } else {
                    p.endTime = this.$moment().format('YYYY-MM-DD 23:59:59')
                    p.startTime = this.$moment().add(-Number(medicineBag)+1, 'days').format('YYYY-MM-DD 00:00:00')
                }
            } else {
                p.startTime = startDate + " 00:00:00"
                p.endTime = endDate? (endDate + " 23:59:59") : ""
            }
            console.log('medicine', p)
            medicineAbinetApi
				.getmedicine(p)
				.then(res=>{
                    console.log('medicine', res)
                    var { saomaTotal, yibaoTotal } = res.obj
                    this.initPie([
                        { value: yibaoTotal, name: '医保卡取药' },
                        { value: saomaTotal, name: '扫码取药' },
                    ])
				})
				.catch(err=>{
                    console.error(err)
				})
        },
        prescriptionTime(val){
            this.medicineBag = val;
            this.medicine();
        },
        initPie(seriesData){
            var { dataIndex } = this
            var option = {
                tooltip: {
                    show: false,
                    trigger: 'item'
                },
                legend: {
                    top: 'middle',
                    left: '54%',
                    // formatter: function (name, a) {
                    //     return 'Legend ' + name;
                    // }
                },
                series: [
                    {
                        type: 'pie',
                        center: ['25%', '50%'],
                        radius: ['55%', '70%'],
                        avoidLabelOverlap: false,
                        label: {
                            show: false,
                            position: 'center'
                        },
                        emphasis: {
                            label: {
                                show: true,
                                fontSize: '12',
                                lineHeight: 20,
                                formatter: '{c}\n{d}%\n{b}',
                            }
                        },
                        labelLine: {
                            show: false
                        },
                        data: seriesData
                    }
                ]
            };
            if(!this.myChart){
                this.myChart = echarts.init(this.$refs.pie);
                this.myChart.on('click', (e)=>{
                    if(this.dataIndex !== e.dataIndex) {
                        this.myChart.dispatchAction({ 
                            type: 'downplay',
                            seriesIndex: 0,
                            dataIndex: this.dataIndex
                        })
                        // this.dataIndex = -1
                    }
                    this.dataIndex = e.dataIndex
                    this.myChart.dispatchAction({ 
                        type: 'highlight',
                        seriesIndex: 0,
                        dataIndex: e.dataIndex
                    })
                });
            }
            this.myChart.setOption(option)
            this.$nextTick(()=>{
                this.myChart.dispatchAction({ 
                    type: 'highlight',
                    seriesIndex: 0,
                    dataIndex
                })
            })
        },
    },
}
</script>
<style lang="scss" scoped>
.index-PickAnalyse{
    .pie-charts{
        height: 200px;
    }
}
</style>

+ 1 - 1
mini-pro-web/src/views/index/scss/index.scss

@ -118,7 +118,7 @@
            }
        }
    }
	.panel{
	::v-deep .panel{
		width: 345px;
		background-color: #ffffff;
		box-shadow: 0px 2px 10px 0px 

+ 3 - 2
mini-pro-web/src/views/order/detail/index.vue

@ -64,7 +64,7 @@
            </div>
            <div class="row">
                <div>审方医生</div>
                <div>{{info.reviewerDoctor || '--'}}</div>
                <div>{{info.reviewerDoctorName || '--'}}</div>
            </div>
            <div class="row">
                <div>审方时间</div>
@ -215,7 +215,8 @@ export default{
                let p = {
                    orderId: this.id,
                    reviewerState,
                    reviewerContent
                    reviewerContent,
                    doctor: this.user.id
                }
                medicineAbinetApi
                    .reviewerOrder(p)

+ 2 - 1
mini-pro-web/src/views/order/list.vue

@ -378,7 +378,8 @@ export default{
                let p = {
                    orderId: item.id,
                    reviewerState: -2,
                    reviewerContent: ''
                    reviewerContent: '',
                    doctor: this.user.id
                }
                medicineAbinetApi
                    .reviewerOrder(p)

+ 23 - 0
mini-pro-web/src/views/order/listPending.vue

@ -0,0 +1,23 @@
<template>
    <List ref="List" type="pending"/>
</template>
<script>
import List from './list'
export default{
    name: 'orderListPending',
    components:{
        List
    },
    data(){
        return {
            
        }
    },
    methods:{
        
    },
}
</script>
<style lang='scss' scoped>
</style>