lincl 3 سال پیش
والد
کامیت
9ed7f84987

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

@ -470,6 +470,16 @@ let service = {
		});
    },
	checkOrderAndReturnOrderList: function(params) {
		return request({
			url: `${BASE}/open/noLogin/checkOrderAndReturnOrderList`,
			method: "get",
			params
		});
    },
	
	// 更新出货状态
	updateOrderOutStatus: function(data) {
		return request({

+ 1 - 1
mini-pro-web/src/store/modules/app.js

@ -6,7 +6,7 @@ const app = {
			wxId: process.env.VUE_APP_WXID
        },
        loading: false,
        pageTitle: "智能药柜"
        pageTitle: "智能药房"
	},
	mutations: {
		SET_LOADING: (state, bool) => {

+ 58 - 5
mini-pro-web/src/views/machine/components/Result.vue

@ -5,7 +5,17 @@
			<img v-show="rsType==2" src="../img/order_err.png" alt="">
			<img v-show="rsType==3" src="../img/order_suc.png" alt="">
			<img v-show="rsType==4" src="../img/complete.png" alt="">
			<div class="content">
			<img v-show="rsType==5" src="../img/order_list.png" alt="">
			<div class="order-list" v-if="rsType==5">
				<div>
					<div class="order-list-inner">
						<div @click="$emit('showOrderDetail', item)" v-for="(item, i) in orderList" :key="i" class="item">
							处方编号:{{item.num}}
						</div>
					</div>
				</div>
			</div>
			<div class="content" v-else>
				<div class="bold">处方药品清单:</div>
				<div class="list">
					<div class="kitbox" v-for="(item, i) in orderdetail" :key="i" :style="item.success? 'color: green' : ''">
@ -15,12 +25,15 @@
					</div>
				</div>
			</div>
			<div class="btns" :class="rsType==4? 'inline' : ''">
			<div class="btns" :class="rsType==5? 'rsType-5' : rsType==4? 'inline' : ''">
				<img @click="$emit('outDrug'); rsType=3;" v-show="rsType==1" src="../img/quanbuquyao_icon.png" alt="">
				<img @click="$emit('onBack')" v-show="rsType==2" src="../img/yaofangquyao_icon.png" alt="">
				<img @click="$emit('onBackIndex')" v-show="rsType==4" src="../img/back.png" alt="">
				<img @click="$emit('onPrint')" v-show="rsType==4" src="../img/dayin.png" alt="">
				<img class="jiantou" v-show="rsType==5" src="../img/tjiantou.png" alt="">
				<img class="check-btn" v-show="rsType==5" src="../img/shangfangdingdan.png" alt="">
			</div>
		</div>
		
@ -28,10 +41,10 @@
</template>
<script>
export default {
	props: ['rsType', 'orderdetail'],
	props: ['rsType', 'orderdetail', 'orderList'],
  	data() {
    	return {
			// rsType: 1 //1:订单信息 2订单错误  3订单成功  4出药完成
			// rsType: 1 //1:订单信息 2订单错误  3订单成功  4出药完成  5订单列表
    	}
  	},
	created(){
@ -41,7 +54,9 @@ export default {
  	},
  	methods: {
		
		back(){
		}
    },
}
</script>
@ -98,7 +113,45 @@ export default {
				}
			}
		}
		&.rsType-5{
			img{
				&.jiantou{
					margin: calc(60px / 6) auto 0;
					width: calc(125px / 6);
				}
				&.check-btn{
					margin-top: calc(73px / 6);
				}
			}
		}
	}
	.order-list{
		position: absolute;
		top: calc(1560px /6);
		width: 100%;
		padding:  0 calc(217px / 6);
		>div{
			height: calc(1146px / 6);
			overflow-y: auto;
		}
		.order-list-inner{
			border-left: 1px solid #e1e1e1;
			border-top: 1px solid #e1e1e1;
			
			.item{
				border-right: 1px solid #e1e1e1;
				border-bottom: 1px solid #e1e1e1;
				padding: calc(63px / 6) calc(35px / 6);
				color: #333;
				font-size: calc(70px / 6);
			}
		}
		
	}
	
}
</style>

+ 1 - 1
mini-pro-web/src/views/machine/components/Scan.vue

@ -32,7 +32,7 @@
export default {
  	data() {
    	return {
			num: '',//64022149
			num: '',//64022149  628476381
			keyboardShow: false,
    	}
  	},

BIN
mini-pro-web/src/views/machine/img/biaoti_img.png


BIN
mini-pro-web/src/views/machine/img/fanhui_icon.png


BIN
mini-pro-web/src/views/machine/img/order_list.png


BIN
mini-pro-web/src/views/machine/img/shangfangdingdan.png


BIN
mini-pro-web/src/views/machine/img/tjiantou.png


+ 96 - 18
mini-pro-web/src/views/machine/index.vue

@ -1,5 +1,10 @@
<template>
	<div class="machine-index">
		<div v-show="step==3&&rsType!=3" class="back-btn" @click="onPrev">
			<img src="./img/fanhui_icon.png" alt="">
			<span>{{times}}s</span>
		</div>
		<div v-show="step===0" class="tc">
			<div class="plr15 pt20">
				<van-field v-model="deviceNum" clearable label="" placeholder="请输入设备编号" />
@ -70,13 +75,14 @@
		</div>
		<Scan @onComplete="onComplete" v-show="step==2" @onBack="step=1"/>
		<Result @outDrug="sendShipment" @onPrint="SetPrintPage" :rsType.sync="rsType" :orderdetail="orderdetail" v-show="step==3" @onBack="step=2" @onBackIndex="step=1"/>
		<Result @showOrderDetail="showOrderDetail" @outDrug="sendShipment" @onPrint="SetPrintPage" :rsType.sync="rsType" :orderList="orderList" :orderdetail="orderdetail" v-show="step==3" @onBack="step=2" @onBackIndex="step=1"/>
	</div>
</template>
<script>
import Scan from './components/Scan.vue';
import Result from './components/Result.vue';
import medicineAbinetApi from '@/api/api-medicineAbinet'
var countDownFunc
export default {
	name: "machineIndex",
	components: {
@ -85,8 +91,8 @@ export default {
  	},
  	data() {
    	return {
			deviceNum: this.$route.query.deviceNum,//14912202107000001500000000000000
			step: 0,
			deviceNum: this.$route.query.deviceNum || '14912202107000001500000000000000',//14912202107000001500000000000000
			step: 0, //0启动页  1首页  2扫码页  3订单页
			curImg: '',
			illustrationMskShow: false,
			socketUrl: '',
@ -99,17 +105,47 @@ export default {
			heartbitInterval: '',
			currindex: 0,
			orderdetail: [],
			rsType: 1,
			rsType: 0,// 1:订单信息 2订单错误  3订单成功  4出药完成  5订单列表
			imgList: [],
			videoList: [],
			inCheckBarcode: false,
			orderInfo: ''
			orderInfo: '',
			orderList: [],
			times: 30
    	}
  	},
	watch:{
		step(n){
			if(n!=3){
				this.rsType = 0
			}
		},
		rsType(n){
			clearInterval(countDownFunc)
			if(n!=4 && this.step==3){
				this.countDown()
			}
		}
	},
	created(){
		console.log(_.groupBy([{a: 1,},{a: 1,},{a: 2,},{a: 1,},], 'a'))
		
	},
  	methods: {
		onPrev(){
			if(this.rsType == 5){
				this.step = 1
			} else if(this.rsType==1 || this.rsType==2 || this.rsType==4){
				var orderLen = this.orderList&&this.orderList.length>1
				if(orderLen){
					if(this.rsType==4){
						this.orderList.splice(this.orderList.indexOf(this.orderInfo), 1)
					}
					this.rsType = 5
				} else {
					this.step = 1
				}
			} 
		},
		devinfoAdvList(){
			var p = {
				equNum: this.deviceNum
@ -144,22 +180,26 @@ export default {
            let p = {
                deviceId: this.deviceNum, //设备编号
				pickUpNum, //取药码
				cardNum //社保卡号
				cardNum: cardNum //社保卡号 //"DA7292254" ||
            }
            console.log('params', p)
            medicineAbinetApi
                .checkOrderAndReturn(p)
                .checkOrderAndReturnOrderList(p)
                .then(res=>{
                    console.log('getDetialOutOfStock', res)
                    console.log('checkOrderAndReturnOrderList', res)
					if(res.status == 200){
						this.$toast.clear()
						res.obj.list.forEach(v=>{
							v.success = false
						})
						this.orderdetail = res.obj.list
						this.orderInfo = res.obj
						this.rsType = res.obj.status==1? 1 : 2
						this.step = 3
						if(res.obj && res.obj.orderList && res.obj.orderList.length){
							if(res.obj.orderList.length == 1){
								this.showOrderDetail(res.obj.orderList[0])
							} else {
								this.orderList = res.obj.orderList || []
								this.rsType = 5
								this.step = 3
							}
						} else {
							this.$toast('查不到订单信息')
						}
					} else {
						this.$toast(res.message || '获取订单失败')
					}
@ -170,6 +210,15 @@ export default {
					this.inCheckBarcode = false
                })
        },
		showOrderDetail(item){
			item.drugList.forEach(v=>{
				v.success = false
			})
			this.orderdetail = item.drugList
			this.orderInfo = item
			this.rsType = item.status==1? 1 : 2
			this.step = 3
		},
		init: function() {
			if(!this.deviceNum){
				return
@ -258,7 +307,7 @@ export default {
					message: '打印完成',
					confirmButtonText: "返回首页"
				}).then(() => {
					this.step = 1
					this.onPrev()
				});
			}
		},
@ -350,7 +399,7 @@ export default {
			var printcon =[
				{type:"reset"},
				{type:"nline"},
				{type:"text", text:"智能药柜\n小票凭据\n",nLan:0,nOrgx:-2,nWidthTimes:0,nHeightTimes:0,FontType:0,nFontStyle:0},
				{type:"text", text:"智能药房\n小票凭据\n",nLan:0,nOrgx:-2,nWidthTimes:0,nHeightTimes:0,FontType:0,nFontStyle:0},
				{type:"text", text:"--------------------------------\n",nLan:0,nOrgx:-2,nWidthTimes:0,nHeightTimes:0,FontType:0,nFontStyle:0},
			];
			var allPrice = 0, allcount = 0
@ -434,6 +483,17 @@ export default {
				return
			}
			this.rsType = 4
		},
		countDown(){
			return
			this.times = 30
			countDownFunc = setInterval(()=>{
				if(this.times === 0){
					clearInterval(countDownFunc)
					this.onPrev()
				}
				this.times--
			}, 1000)
		}
    },
	destroyed() {
@ -573,5 +633,23 @@ export default {
			display: block;
		}
	}
	.back-btn{
		z-index: 2;
		position: fixed;
		top: calc(200px / 6);
		left: calc(127px / 6);
		img{
			width: calc(100px / 6);
			vertical-align: middle;
			display: inline-block;
		}
		span{
			vertical-align: middle;
			color: #fff;
			margin-left: calc(40px / 6);
			font-size: calc(80px / 6);
		}
	}
}
</style>