Browse Source

Merge branch 'master' of http://192.168.1.220:10080/Amoy2/intelligent-medicine-cabinet

lincl 3 years ago
parent
commit
96981280e2

+ 22 - 0
mini-pro-web/package-lock.json

@ -4643,6 +4643,15 @@
        "safer-buffer": "^2.1.0"
      }
    },
    "echarts": {
      "version": "5.2.2",
      "resolved": "https://registry.npmjs.org/echarts/-/echarts-5.2.2.tgz",
      "integrity": "sha512-yxuBfeIH5c+0FsoRP60w4De6omXhA06c7eUYBsC1ykB6Ys2yK5fSteIYWvkJ4xJVLQgCvAdO8C4mN6MLeJpBaw==",
      "requires": {
        "tslib": "2.3.0",
        "zrender": "5.2.1"
      }
    },
    "ee-first": {
      "version": "1.1.1",
      "resolved": "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz",
@ -11406,6 +11415,11 @@
      "integrity": "sha512-csd+vJOb/gkzvcCHgTGSChYpy5f1/XKNsmvBGO4JXS+z1v2HobugDz4s1IeFXM3wZB44uczs+eazB5Q/ccdhQw==",
      "dev": true
    },
    "tslib": {
      "version": "2.3.0",
      "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.3.0.tgz",
      "integrity": "sha512-N82ooyxVNm6h1riLCoyS9e3fuJ3AMG2zIZs2Gd1ATcSFjSA23Q0fzjjZeh0jbJvWVDZ0cJT8yaNNaaXHzueNjg=="
    },
    "tty-browserify": {
      "version": "0.0.0",
      "resolved": "https://registry.npmjs.org/tty-browserify/-/tty-browserify-0.0.0.tgz",
@ -12818,6 +12832,14 @@
      "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-20.2.7.tgz",
      "integrity": "sha512-FiNkvbeHzB/syOjIUxFDCnhSfzAL8R5vs40MgLFBorXACCOAEaWu0gRZl14vG8MR9AOJIZbmkjhusqBYZ3HTHw==",
      "dev": true
    },
    "zrender": {
      "version": "5.2.1",
      "resolved": "https://registry.npmjs.org/zrender/-/zrender-5.2.1.tgz",
      "integrity": "sha512-M3bPGZuyLTNBC6LiNKXJwSCtglMp8XUEqEBG+2MdICDI3d1s500Y4P0CzldQGsqpRVB7fkvf3BKQQRxsEaTlsw==",
      "requires": {
        "tslib": "2.3.0"
      }
    }
  }
}

+ 1 - 0
mini-pro-web/package.json

@ -13,6 +13,7 @@
    "core-js": "^3.6.5",
    "crypto-js": "^4.0.0",
    "custom-components-mobile": "git+http://192.168.1.220:10080/lincl/custom-components-mobile.git#master",
    "echarts": "^5.2.2",
    "exif-js": "^2.3.0",
    "js-cookie": "^2.2.1",
    "lodash": "^4.17.20",

+ 1 - 1
mini-pro-web/public/index.html

@ -27,7 +27,7 @@
    <script src="<%= BASE_URL %>js/vconsole.min.js"></script>
    <script>
			// 初始化
			var vConsole = new VConsole();
			// var vConsole = new VConsole();
		</script> 
  </body>
</html>

+ 5 - 2
mini-pro-web/src/store/index.js

@ -7,10 +7,13 @@ Vue.use(Vuex)
export default new Vuex.Store({
	state: {
		loading: true
        loading: true,
        deviceActive:1,
	},
	mutations: {
        getDeviceActive(state,payload){
            state.deviceActive = payload
        }
	},
	actions: {
		

+ 6 - 3
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">
        <van-tabs v-model="active" @click="onClick">
            <van-tab :name="1" title="全部设备"></van-tab>
            <van-tab :name="0" title="缺药设备"></van-tab>
        </van-tabs>
@ -56,7 +56,7 @@ export default{
        return {
            list: [],
            result: [],
            active: 1
            active: this.$store.state.deviceActive
        }
    },
    watch:{
@ -65,12 +65,15 @@ export default{
        }
    },
    created() {
        
        // console.log('this.$store.deviceActive',this.$store.state.deviceActive)
    },
    methods:{
        $refreshData(){
            this.$refs.customList.refresh(true)
        },
        onClick(name,title){
            this.$store.commit('getDeviceActive' ,name);
        },
        onLoad({page, pageSize, searchText}){
            var p = {
                content: searchText,

+ 50 - 31
mini-pro-web/src/views/index/Index.vue

@ -33,28 +33,28 @@
			<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>
                        <van-col @click="gotoDevice()" 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 @click="gotoDevice()" 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 @click="gotoDevice()" 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 @click="gotoUrl('/order/list')" 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="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">
@ -103,7 +103,7 @@
            </div>
		</div>
        <!-- 销售额 -->
        <div class="panel plr15 mt10 medicine">
        <div v-if="sales" 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">
@ -137,6 +137,9 @@ export default {
  	data() {
    	return {
            medicineBag:'1',
            medicineData:false,
            medicineShow:true,
            sales:true,
            prescriptionBag:'1',
            salesBag:'1',
            count:[],
@ -170,6 +173,11 @@ export default {
		this.countall();
		this.medicine();
        this.prescriptions();
        console.log('this.$store.user.state',this.$store.state.user.curRoleCode)
        if(this.$store.state.user.curRoleCode =='replenisher'){
            this.medicineShow = false;
            this.sales = false;
        }
    },
    mounted(){
        this.echartsData();
@ -182,7 +190,7 @@ export default {
					userId: this.user.id
				})
				.then(res=>{
                    console.log('countall', res);
                    // console.log('countall', res);
                    this.overview = res.obj.overview;
                    this.maintain = res.obj.maintain;
				})
@ -190,6 +198,11 @@ export default {
					console.error(err)
				})
        },
        //跳转
        gotoDevice(){
            this.$router.push('/device/index')
            this.$store.commit('getDeviceActive' ,0);
        },
        // 取药次数
        medicine(){
            medicineAbinetApi
@ -199,10 +212,12 @@ export default {
				})
				.then(res=>{
                    console.log('medicine', res)
                    this.medicineData = true;
                    this.shippingType = res.obj;
				})
				.catch(err=>{
					console.error(err)
                    console.error(err)
                    this.medicineData = true;
				})
        },
        // 电子处方单
@ -222,16 +237,18 @@ export default {
        },
        // 取药时间查询
        medicineTime(val){
            if(val == '全部'){
                this.medicineBag = '';
            if(this.medicineData){
                if(val == '全部'){
                    this.medicineBag = '';
                    console.log('全部')
                }else{
                    this.medicineBag = val;
                    console.log('1,3,7,9')
                }
                this.medicineData = false;
                this.medicine();
                console.log('全部')
            }else{
                this.medicineBag = val;
                this.medicine();
                console.log('1,3,7,9')
                
            }
            
        },
        // 电子处方单查询
        prescriptionTime(val){
@ -257,13 +274,14 @@ export default {
            this.echartsData();
        },
        echartsData(){
            medicineAbinetApi
            if(this.sales){
                medicineAbinetApi
                .getechartsData({
                    userId: this.user.id,
                    day:this.salesBag
                })
                .then(res=>{
                    console.log('echartsData', res);
                    // console.log('echartsData', res);
                    this.amount = res.obj.amount;
                    this.count = res.obj.amountdateList.map((item) =>{
                        return item.count
@ -323,6 +341,7 @@ export default {
                .catch(err=>{
                    console.error(err)
                })
            }
        },
    },
}

+ 1 - 0
mini-pro-web/src/views/login/Login.vue

@ -330,6 +330,7 @@ export default {
                            console.error(err)
                            this.$toast.clear()
                        })
                        // console.log('userinfo',userInfo)
                } else {
                    this.$toast.clear()
                    this.$toast(result.status==1300? "验证码错误" : result.message);