|
@ -1,6 +1,6 @@
|
|
|
<template>
|
|
|
<div class="machine-index" >
|
|
|
<div v-show="step==3&&rsType!=3&&!inOut" class="back-btn" @click="onPrev">
|
|
|
<div v-show="step==2 || (step==3&&rsType!=3&&!inOut)" class="back-btn" @click="onPrev">
|
|
|
<img src="./img/fanhui_icon.png" alt="">
|
|
|
<span>{{times}}s</span>
|
|
|
</div>
|
|
@ -81,11 +81,13 @@
|
|
|
</template>
|
|
|
</div>
|
|
|
|
|
|
<Dialog ref="Dialog" v-if="showPrintComplete" @back="onPrev"/>
|
|
|
<Scan @onComplete="onComplete" v-show="step==2" @onBack="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"/>
|
|
|
<Result @showOrderDetail="checkCardNo" @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 Dialog from './components/Dialog.vue';
|
|
|
import Scan from './components/Scan.vue';
|
|
|
import Result from './components/Result.vue';
|
|
|
import medicineAbinetApi from '@/api/api-medicineAbinet'
|
|
@ -94,7 +96,8 @@ export default {
|
|
|
name: "machineIndex",
|
|
|
components: {
|
|
|
Scan,
|
|
|
Result
|
|
|
Result,
|
|
|
Dialog
|
|
|
},
|
|
|
data() {
|
|
|
return {
|
|
@ -122,12 +125,16 @@ export default {
|
|
|
times: 30,
|
|
|
shippingType: '', //取药方式(1、扫码,2、医保卡)
|
|
|
inOut: false,
|
|
|
eventName: ''
|
|
|
eventName: '',
|
|
|
showPrintComplete: false,
|
|
|
nextOrderDetail: ''
|
|
|
}
|
|
|
},
|
|
|
watch:{
|
|
|
step(n){
|
|
|
if(n!=3){
|
|
|
if(n==2){
|
|
|
this.countDown()
|
|
|
}else if(n!=3){
|
|
|
this.rsType = 0
|
|
|
}
|
|
|
},
|
|
@ -150,22 +157,33 @@ export default {
|
|
|
this.init(1)
|
|
|
}
|
|
|
window.SetPrintPage = this.SetPrintPage
|
|
|
|
|
|
|
|
|
setTimeout(()=>{
|
|
|
this.showPrintComplete = true
|
|
|
}, 5000)
|
|
|
},
|
|
|
methods: {
|
|
|
onPrev(){
|
|
|
if(this.rsType == 5){
|
|
|
this.nextOrderDetail = ''
|
|
|
this.showPrintComplete = false
|
|
|
if(this.step == 2){
|
|
|
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 {
|
|
|
} else {
|
|
|
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 = {
|
|
@ -371,18 +389,57 @@ export default {
|
|
|
return
|
|
|
}
|
|
|
this.clearReadCardCountDown()
|
|
|
if (msgobj.mess.indexOf("异常") != -1 || msgobj.mess.indexOf("读取信息失败") != -1) {
|
|
|
this.$toast(msgobj.mess)
|
|
|
return
|
|
|
try{
|
|
|
if (msgobj.mess.indexOf("异常") != -1 || msgobj.mess.indexOf("读取信息失败") != -1) {
|
|
|
if(this.nextOrderDetail){
|
|
|
this.$toast.loading({
|
|
|
duration: 0,
|
|
|
forbidClick: true, // 禁用背景点击
|
|
|
loadingType: 'loading',
|
|
|
message: msgobj.mess,
|
|
|
onClose: ()=>{
|
|
|
this.onPrev()
|
|
|
}
|
|
|
});
|
|
|
} else {
|
|
|
this.$toast(msgobj.mess)
|
|
|
}
|
|
|
return
|
|
|
}
|
|
|
|
|
|
var arr = msgobj.mess.split("\n");
|
|
|
var json = {}
|
|
|
arr.forEach(v => {
|
|
|
var tmp = v.split(":")
|
|
|
json[tmp[0]] = tmp[1]
|
|
|
});
|
|
|
var cardNo = json['卡号']
|
|
|
if(this.nextOrderDetail){
|
|
|
if(cardNo != this.oldCardNo){
|
|
|
this.$toast.loading({
|
|
|
duration: 0,
|
|
|
forbidClick: true, // 禁用背景点击
|
|
|
loadingType: 'loading',
|
|
|
message: "医保卡信息不匹配,请重新操作",
|
|
|
onClose: ()=>{
|
|
|
this.onPrev()
|
|
|
}
|
|
|
});
|
|
|
} else {
|
|
|
var order = this.nextOrderDetail
|
|
|
this.nextOrderDetail = ''
|
|
|
this.showOrderDetail(order)
|
|
|
}
|
|
|
return
|
|
|
}
|
|
|
this.oldCardNo = cardNo
|
|
|
this.checkOrderAndReturn({cardNum: cardNo})
|
|
|
}catch(e){
|
|
|
console.error(e)
|
|
|
}
|
|
|
var arr = msgobj.mess.split("\n");
|
|
|
var json = {}
|
|
|
arr.forEach(v => {
|
|
|
var tmp = v.split(":")
|
|
|
json[tmp[0]] = tmp[1]
|
|
|
});
|
|
|
this.checkOrderAndReturn({cardNum: json['卡号']})
|
|
|
} else if(msgobj.type == 'PrintComplete'){
|
|
|
this.showPrintComplete = true
|
|
|
return
|
|
|
this.$dialog.alert({
|
|
|
title: '',
|
|
|
message: '打印完成',
|
|
@ -404,7 +461,19 @@ export default {
|
|
|
this.$loading('读取中..')
|
|
|
this.clearReadCardCountDown()
|
|
|
readCardCountDown = setTimeout(()=>{
|
|
|
this.$toast('读取医保卡失败')
|
|
|
if(this.nextOrderDetail){
|
|
|
this.$toast.loading({
|
|
|
duration: 0,
|
|
|
forbidClick: true, // 禁用背景点击
|
|
|
loadingType: 'loading',
|
|
|
message: "读取医保卡失败",
|
|
|
onClose: ()=>{
|
|
|
this.onPrev()
|
|
|
}
|
|
|
});
|
|
|
} else {
|
|
|
this.$toast('读取医保卡失败')
|
|
|
}
|
|
|
}, 10 * 1000)
|
|
|
|
|
|
var obj = {
|
|
@ -712,6 +781,14 @@ export default {
|
|
|
}
|
|
|
this.systemUpdate()
|
|
|
}
|
|
|
},
|
|
|
checkCardNo(item){
|
|
|
if(this.shippingType == 2){
|
|
|
this.nextOrderDetail = item
|
|
|
this.sendReadCard()
|
|
|
} else {
|
|
|
this.showOrderDetail(item)
|
|
|
}
|
|
|
}
|
|
|
},
|
|
|
destroyed() {
|