Ver código fonte

修改部分需求

lincl 3 anos atrás
pai
commit
1268e24a45

+ 42 - 8
mini-pro-web/src/components/layout/components/AppBotNav.vue

@ -64,15 +64,15 @@ export default {
	},
	created(){
		var urls = [
			{url: "/home/index", count: 0, name: "首页", icon1: require('@/assets/images/icon_shouye.png'), icon2: require('@/assets/images/icon_shouye-dianji.png')},
			{url: "homeIndex", count: 0, name: "首页", icon1: require('@/assets/images/icon_shouye.png'), icon2: require('@/assets/images/icon_shouye-dianji.png')},
		]
		if(this.$hasAuth('orderManage')){
			urls.push({url: "/order/list", count: 0, name: "订单管理", icon1: require('@/assets/images/diandanguanli_icon.png'), icon2: require('@/assets/images/diandanguanli01_icon.png')})
			urls.push({url: "orderList", count: 0, name: "订单管理", icon1: require('@/assets/images/diandanguanli_icon.png'), icon2: require('@/assets/images/diandanguanli01_icon.png')})
		}
		if(this.$hasAuth('device', 'operate')){
			urls.push({url: "/device/index", count: 0, name: "设备管理", icon1: require('@/assets/images/shebeigaunli_icon.png'), icon2: require('@/assets/images/shebeigaunli01_icon.png')})
			urls.push({url: "deviceIndex", count: 0, name: "设备管理", icon1: require('@/assets/images/shebeigaunli_icon.png'), icon2: require('@/assets/images/shebeigaunli01_icon.png')})
		}
		urls.push({url: "/personal/index", count: 0, name: "我的", icon1: require('@/assets/images/icon_wode.png'), icon2: require('@/assets/images/icon_wode-dianji.png')})
		urls.push({url: "personalIndex", count: 0, name: "我的", icon1: require('@/assets/images/icon_wode.png'), icon2: require('@/assets/images/icon_wode-dianji.png')})
		
		var active = this.check(urls)
		this.urls = urls
@ -85,7 +85,7 @@ export default {
	methods: {
		check(urls){
			urls = urls || this.urls
			var p = this.$route.path
			var p = this.$route.name
			var index = -1
			urls.forEach((v, i) => {
@ -99,10 +99,44 @@ export default {
			this.active = type;
			let url = this.urls[this.active].url
			if(url){
				this.$router.replace({
					path: url
				})
				if(this.$route.name == 'homeIndex'){
					this.$router.push({
						name: url
					})
				} else {
					if(url == 'homeIndex'){
						var exist = _.find(this.$navigation.getRoutes(), v=>{
							return v.indexOf(url+'?') === 0
						})
						if(exist){
							exist = exist.split('?')
							url = this.replaceCamel(exist[0])
							if(url.indexOf('/')!==0){
								url = "/" + url
							}
							this.$router.replace({
								path: url,
								query: {
									VNK: exist[1]
								}
							})
						} else {
							this.$router.replace({
								name: url
							})
						}
					} else {
						this.$router.replace({
							name: url
						})
					}
				}
			}
		},
		replaceCamel(str){
			return str.replace(/([A-Z])/g, function(s){
				return '/' +s.toLowerCase()
			}).trim()
		}
	}
};

+ 1 - 2
mini-pro-web/src/router/index.js

@ -10,7 +10,6 @@ import Login from '@/views/login/Login'
import Register from '@/views/login/Register'
import FotgetPassword from '@/views/login/FotgetPassword'
import DrugList from '@/views/drug/list'
import Index from '@/views/index/Index'
import personal from './personal'
import order from './order'
import replenishment from './replenishment'
@ -66,7 +65,7 @@ const routes = [
        children: [{
            path: "index",
            name: "homeIndex",
            component: Index,
            component: () => import('@/views/index/Index'),
            meta: {
                title: '首页',
                hasBot: true,

+ 9 - 8
mini-pro-web/src/views/device/index.vue

@ -1,7 +1,7 @@
<template>
<div class='deviceIndex'>
    <van-sticky :offset-top="offsetTop">
        <van-tabs v-model="active" @click="onClick">
        <van-tabs v-model="active">
            <van-tab :name="1" title="全部设备"></van-tab>
            <van-tab :name="0" title="缺药设备"></van-tab>
        </van-tabs>
@ -59,8 +59,10 @@ export default{
        return {
            list: [],
            result: [],
            active: this.$store.state.deviceActive,
            active: this.$route.query.active||this.$route.query.active===0? Number(this.$route.query.active) : 1,
            networkStatus: this.$route.query.networkStatus,
            community: this.$route.query.hospital,
            town: this.$route.query.town,
        }
    },
    watch:{
@ -69,22 +71,21 @@ export default{
        }
    },
    created() {
        // console.log('this.$store.deviceActive',this.$store.state.deviceActive)
        console.log(this.$route.query)
    },
    methods:{
        $refreshData(){
            this.$refs.customList.refresh(true)
        },
        onClick(name,title){
            this.$store.commit('getDeviceActive' ,name);
        },
        onLoad({page, pageSize, searchText}){
            var p = {
                networkStatus: this.networkStatus,
                networkStatus: this.networkStatus!=undefined? this.networkStatus : '',
                content: searchText,
                userId: this.user.id,
                page: page,
                size: pageSize
                size: pageSize,
                community: this.community || '',
                town: this.community? '' : (this.town || '')
            }
            var func
            if(this.active === 0){

+ 49 - 8
mini-pro-web/src/views/index/Index.vue

@ -49,7 +49,7 @@
			<div class="pt10">
				<div class="pb20">
                    <van-row>
                        <van-col @click="gotoDevice()" class="col col-tl" span="12">
                        <van-col @click="gotoDevice(0)" 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>
@ -61,7 +61,7 @@
                            <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 @click="gotoUrl('/order/list')" class="col col-t" span="12">
                        <van-col @click="toOrderPage()" 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>
@ -147,7 +147,7 @@ import { findOneUser} from "@/api/login";
import * as echarts from 'echarts';
import medicineAbinetApi from '@/api/api-medicineAbinet'
export default {
	name: "index",
	name: "homeIndex",
	components: {
		
  	},
@ -218,10 +218,11 @@ export default {
            defaultOption: [
                { townName: '全部', town: "", children: [{hospital: '', hospitalName: '全部'}] },
            ],
            
            first: false
    	}
  	},
	created(){
        this.first = true
		this.refreshData()
        this.getOrgList()
        console.log('this.$store.user.state',this.$store.state.user.curRoleCode)
@ -230,6 +231,13 @@ export default {
            this.sales = false;
        }
    },
    activated(){
        if(this.first){
            this.first = false
        } else {
            this.refreshData()
        }
    },
    mounted(){
        this.echartsData();
    },
@ -249,9 +257,13 @@ export default {
				})
        },
        //跳转
        gotoDevice(){
            this.$router.push('/device/index')
            this.$store.commit('getDeviceActive' ,0);
        gotoDevice(active){
            var p = this.getTownUrlParams()
            p.active = active
            this.$router.push({
                path: '/device/index',
                query: p
            })
        },
        // 取药次数
        medicine(){
@ -484,12 +496,41 @@ export default {
            this.communityList = item.children
        },
        onSelect(item){
            console.log('this.selcommunity', item)
            this.selcommunity = item;
            this.drowMenuShow = false;
            this.refreshData()
        },
        gotoDeviceList(networkStatus){
            this.gotoUrl('/device/index', {networkStatus})
            var p = this.getTownUrlParams()
            p.networkStatus = networkStatus
            this.gotoUrl('/device/index', p)
        },
        toOrderPage(){
            var p = this.getTownUrlParams()
            p.sellState = 0
            this.gotoUrl('/order/list', p)
        },
        getTownUrlParams(){
            var p = {}
            if(this.selcommunity){
                if(this.selcommunity.hospital===''){
                    var item = this.townList[this.activeKey]
                    if(item.town === ''){
                    } else {
                        p.town = item.town;
                        p.townName = item.townName;
                    }
                } else {
                    var item = this.townList[this.activeKey]
                    p.town = item.town;
                    p.townName = item.townName;
                    p.hospital = this.selcommunity.hospital
                    p.hospitalName = this.selcommunity.hospitalName
                }
            }
            return p 
        }
    },
}

+ 28 - 17
mini-pro-web/src/views/order/components/Filter.vue

@ -6,7 +6,7 @@
                    <div class="ptb10">按社区</div>
                    <div class="drop-menu" :class="{active: drowMenuShow}">
                        <div class="drop-menu-title tc fs-14" @click="drowMenuShow=!drowMenuShow">
                            <span class="v-middle">{{selcommunity? selcommunity.hospitalName : '全部'}}</span>
                            <span class="v-middle">{{selcommunity? (selcommunity.hospitalCode? selcommunity.hospitalName : selcommunity.townName) : '全部'}}</span>
                            <van-icon name="arrow-down" />
                        </div>
                        <div class="drop-menu-area kitbox">
@ -37,7 +37,7 @@
                <div class="buttons kitbox ">
                    <div><van-button @click="reset" round block plain  size="small">重置</van-button></div>
                    <div><van-button @click="submit" round block type="primary" color="#17b3ec" size="small">确定</van-button></div>
                    <div><van-button @click="submit()" round block type="primary" color="#17b3ec" size="small">确定</van-button></div>
                </div>
            </div>
        </van-popup>
@ -136,23 +136,34 @@ export default{
            this.selcommunity = ''
            this.state = ''
        },
        submit(){
        submit(selcommunity, state, allTime){
            console.log('selcommunity', this.selcommunity)
            var {dateType} = this
            console.log(this.selcommunity, 'this.selcommunity')
            if(selcommunity){
                this.selcommunity = selcommunity
            }
            if(state!==undefined){
                this.state = state
            }
            var startTime = '', endTime = ''
            if(dateType==1 || dateType==3 || dateType==6){
                startTime = this.$moment().subtract(dateType, 'months')
                endTime = new Date()
            } else if(dateType > 2000){
                var time = this.$moment().years(dateType)
                startTime = time.startOf('year').toDate()
                endTime = time.endOf('year').toDate()
            if(allTime){
                this.dateType = ''
            } else {
                if(this.startDate){
                    startTime = this.startDate
                }
                if(this.endDate){
                    endTime = this.endDate
                if(dateType==1 || dateType==3 || dateType==6){
                    startTime = this.$moment().subtract(dateType, 'months')
                    endTime = new Date()
                } else if(dateType > 2000){
                    var time = this.$moment().years(dateType)
                    startTime = time.startOf('year').toDate()
                    endTime = time.endOf('year').toDate()
                } else {
                    if(this.startDate){
                        startTime = this.startDate
                    }
                    if(this.endDate){
                        endTime = this.endDate
                    }
                }
            }
            
@ -233,7 +244,7 @@ export default{
                                v.hospitalName = v.name
                                v.hospitalCode = v.code
                            })
                            item.children = res.detailModelList
                            item.children = [{hospitalName:'全部', hospitalCode: '', town: item.town, townName: item.townName}].concat(res.detailModelList) 
                        }
                    })
                    .catch(err=>{

+ 23 - 5
mini-pro-web/src/views/order/list.vue

@ -146,8 +146,7 @@ export default{
            townList: [],
            communityList: [],
            selcommunity: '',
            sellState: ''
            
            sellState: '',
        }
    },
    watch: {
@ -156,10 +155,23 @@ export default{
        }
    },
    created() {
        // this.getOrgList()
        
    },
    mounted(){
        this.$refs.Filter.submit()
        var allTime = false
        if(this.$route.query.hospital||this.$route.query.town){
            this.selcommunity = {
                hospitalCode: this.$route.query.hospital||'',
                hospitalName: this.$route.query.hospitalName||'',
                town: this.$route.query.town||'',
                townName: this.$route.query.townName||'',
            }
        }
        if(this.$route.query.sellState!==''&&this.$route.query.sellState!==undefined){
            this.sellState = this.$route.query.sellState
            allTime = true
        }
        this.$refs.Filter.submit(this.selcommunity, this.sellState, allTime)
    },
    methods:{
        onLoad({page, pageSize, searchText}){
@ -173,11 +185,17 @@ export default{
                    size: pageSize
                }
            } else {
                var town = '', community = ''
                if(this.selcommunity){
                    community = this.selcommunity.hospitalCode||this.selcommunity.hospital||''
                    town = community? '' : (this.selcommunity.town||'')
                }
                p = {
                    startTime: startDate? this.$moment(startDate).format('YYYY-MM-DD 00:00:00') : '',
                    endTime: endDate? this.$moment(endDate).format('YYYY-MM-DD 23:59:59') : '',
                    userId: this.user.id,
                    community: this.selcommunity? (this.selcommunity.hospitalCode||this.selcommunity.hospital) : '',
                    community,
                    town,
                    sellState: this.sellState,
                    page: page,
                    size: pageSize