|
@ -1,8 +1,8 @@
|
|
|
<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>
|
|
|
<span v-if="rsType!=4">{{times}}s</span>
|
|
|
</div>
|
|
|
|
|
|
<div v-show="step===0" class="tc">
|
|
@ -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,11 +96,12 @@ export default {
|
|
|
name: "machineIndex",
|
|
|
components: {
|
|
|
Scan,
|
|
|
Result
|
|
|
Result,
|
|
|
Dialog
|
|
|
},
|
|
|
data() {
|
|
|
return {
|
|
|
isErr: 0,
|
|
|
isErr: 0, //1设备维护 2正常使用
|
|
|
deviceNum: this.$route.query.deviceNum || '',//14912202107000001500000000000000 14912202111000001000000000000000
|
|
|
step: 0, //0启动页 1首页 2扫码页 3订单页
|
|
|
curImg: '',
|
|
@ -121,13 +124,22 @@ export default {
|
|
|
orderList: [],
|
|
|
times: 30,
|
|
|
shippingType: '', //取药方式(1、扫码,2、医保卡)
|
|
|
inOut: false
|
|
|
inOut: false,
|
|
|
eventName: '',
|
|
|
showPrintComplete: false,
|
|
|
nextOrderDetail: '',
|
|
|
oldCardNo: '',
|
|
|
reconnect: false,
|
|
|
}
|
|
|
},
|
|
|
watch:{
|
|
|
step(n){
|
|
|
if(n!=3){
|
|
|
if(n==2){
|
|
|
clearInterval(countDownFunc)
|
|
|
this.countDown()
|
|
|
}else if(n!=3){
|
|
|
this.rsType = 0
|
|
|
this.oldCardNo = ''
|
|
|
}
|
|
|
},
|
|
|
rsType(n){
|
|
@ -143,28 +155,36 @@ export default {
|
|
|
this.path = "ws://yik.ab-inbev.vip/c/websocket/"
|
|
|
} else {
|
|
|
//正式线
|
|
|
this.path = "wss://zb.xmtyw.cn/cabinet/websocket/"
|
|
|
// this.path = "wss://zb.xmtyw.cn/cabinet/websocket/"
|
|
|
this.path = process.env.VUE_APP_MACHINE_SOCKET_URL
|
|
|
}
|
|
|
if(this.deviceNum){
|
|
|
this.init(1)
|
|
|
}
|
|
|
window.SetPrintPage = this.SetPrintPage
|
|
|
window.vm = this
|
|
|
},
|
|
|
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 = {
|
|
@ -198,6 +218,7 @@ export default {
|
|
|
this.$toast.clear()
|
|
|
this.$loading('加载中..')
|
|
|
this.shippingType = pickUpNum? 1 : 2
|
|
|
this.oldCardNo = cardNum || ''
|
|
|
let p = {
|
|
|
deviceId: this.deviceNum, //设备编号
|
|
|
pickUpNum, //取药码
|
|
@ -207,7 +228,8 @@ export default {
|
|
|
|
|
|
// p = {
|
|
|
// deviceId: this.deviceNum, //设备编号
|
|
|
// cardNum: 'DD4517690'
|
|
|
// cardNum: '',
|
|
|
// ehcCard: "2AA15E2786973077D40FF5DEFFB5E7B12D79E3BD50BE59F22559FF361667E22C:0:445D0CE646F8F9DFEF648D36910287B5:3502A0001GZHA0002"
|
|
|
// }
|
|
|
console.log('params', p)
|
|
|
medicineAbinetApi
|
|
@ -224,7 +246,7 @@ export default {
|
|
|
list.forEach(v=>{
|
|
|
var allPrice = 0
|
|
|
v.drugList.forEach(d=>{
|
|
|
allPrice += d.price * Number(d.quantity)
|
|
|
allPrice += d.price * ((d.quantity&&Number(d.quantity)) || 1)
|
|
|
})
|
|
|
v.price = allPrice.toFixed(2)
|
|
|
})
|
|
@ -276,6 +298,10 @@ export default {
|
|
|
})
|
|
|
},
|
|
|
init: function(type) {
|
|
|
if(this.reconnect === true){
|
|
|
this.reconnect = 1
|
|
|
}
|
|
|
|
|
|
if(!this.deviceNum){
|
|
|
return
|
|
|
}
|
|
@ -302,24 +328,30 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
open: function() {
|
|
|
if(this.reconnect===1){
|
|
|
this.$toast('服务器重连成功')
|
|
|
this.reconnect = false
|
|
|
}
|
|
|
console.log("socket连接成功")
|
|
|
this.heartbit()
|
|
|
},
|
|
|
error: function() {
|
|
|
this.$dialog.alert({
|
|
|
title: '',
|
|
|
message: '连接服务器失败',
|
|
|
confirmButtonText: "重试"
|
|
|
})
|
|
|
.then(()=>{
|
|
|
this.init()
|
|
|
})
|
|
|
console.log("连接错误")
|
|
|
this.reconnectTimeout()
|
|
|
return
|
|
|
// this.socket.close()
|
|
|
},
|
|
|
getMessage: function(msg) {
|
|
|
console.log(msg.data)
|
|
|
//有收到消息后 重置重连定时器时间
|
|
|
// this.reconnectTimeout()
|
|
|
|
|
|
var msgobj = JSON.parse(msg.data)
|
|
|
if (msgobj.type == 'ShipInfo') {
|
|
|
if(!this.inOut){
|
|
|
//有可能前端15秒已超时 但是后端还没超时 等了1分钟才返回数据
|
|
|
return
|
|
|
}
|
|
|
var item = this.orderdetail[this.currindex]
|
|
|
if (msgobj.mess == ( item.layerNo +";"+ item.wayerNo) ) {
|
|
|
this.updateOrderOutStatus(item.id, 2, msgobj.mess)
|
|
@ -350,7 +382,6 @@ export default {
|
|
|
})
|
|
|
}
|
|
|
} else if (msgobj.type == 'BarCodeInfo') {
|
|
|
debugger
|
|
|
if (msgobj.mess.indexOf("异常") != -1) {
|
|
|
this.$toast(msgobj.mess)
|
|
|
console.log(msgobj.mess)
|
|
@ -370,18 +401,53 @@ 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({
|
|
|
forbidClick: true, // 禁用背景点击
|
|
|
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({
|
|
|
forbidClick: true, // 禁用背景点击
|
|
|
message: "医保卡信息不匹配,请重新操作",
|
|
|
onClose: ()=>{
|
|
|
this.onPrev()
|
|
|
}
|
|
|
});
|
|
|
} else {
|
|
|
this.$toast.clear()
|
|
|
var order = this.nextOrderDetail
|
|
|
this.nextOrderDetail = ''
|
|
|
this.showOrderDetail(order)
|
|
|
}
|
|
|
return
|
|
|
}
|
|
|
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: '打印完成',
|
|
@ -389,8 +455,12 @@ export default {
|
|
|
}).then(() => {
|
|
|
this.onPrev()
|
|
|
});
|
|
|
} else if(msgobj.type == 'PageRload'){
|
|
|
location.reload(true)
|
|
|
} else if(msgobj.type == 'heart'){
|
|
|
if(this.heartbitTimeout){
|
|
|
clearTimeout(this.heartbitTimeout)
|
|
|
}
|
|
|
} else {
|
|
|
this.checkNextEvent(msgobj.type)
|
|
|
}
|
|
|
|
|
|
// var obj = {
|
|
@ -403,14 +473,26 @@ export default {
|
|
|
this.$loading('读取中..')
|
|
|
this.clearReadCardCountDown()
|
|
|
readCardCountDown = setTimeout(()=>{
|
|
|
this.$toast('读取医保卡失败')
|
|
|
}, 10 * 1000)
|
|
|
if(this.nextOrderDetail){
|
|
|
this.$toast.loading({
|
|
|
duration: 0,
|
|
|
forbidClick: true, // 禁用背景点击
|
|
|
loadingType: 'loading',
|
|
|
message: "读取医保卡超时",
|
|
|
onClose: ()=>{
|
|
|
this.onPrev()
|
|
|
}
|
|
|
});
|
|
|
} else {
|
|
|
this.$toast('读取医保卡超时')
|
|
|
}
|
|
|
}, 20 * 1000)
|
|
|
|
|
|
var obj = {
|
|
|
type: "ReadCard",
|
|
|
mess: ""
|
|
|
}
|
|
|
this.socket.send(JSON.stringify(obj));
|
|
|
this.send(obj);
|
|
|
},
|
|
|
|
|
|
sendShipment: function() {
|
|
@ -434,15 +516,14 @@ export default {
|
|
|
layerNo: row.layerNo,
|
|
|
wayerNo: row.wayerNo
|
|
|
}
|
|
|
this.socket.send(JSON.stringify(obj));
|
|
|
this.send(obj);
|
|
|
},
|
|
|
send: function() {
|
|
|
var obj = {
|
|
|
type: "读取设备功能列表",
|
|
|
mess: "",
|
|
|
layerNo: this.layerNo,
|
|
|
wayerNo: this.wayerNo,
|
|
|
send: function(obj) {
|
|
|
if(obj.type != 'heart'){
|
|
|
//发送消息时 重置重连定时器时间
|
|
|
// this.reconnectTimeout()
|
|
|
}
|
|
|
|
|
|
this.socket.send(JSON.stringify(obj));
|
|
|
},
|
|
|
send2: function() {
|
|
@ -450,31 +531,84 @@ export default {
|
|
|
type: "读取设备功能列表",
|
|
|
mess: ""
|
|
|
}
|
|
|
this.socket.send(JSON.stringify(obj));
|
|
|
this.send(obj);
|
|
|
},
|
|
|
close: function() {
|
|
|
console.log("socket已经关闭")
|
|
|
this.reconnectTimeout()
|
|
|
return
|
|
|
this.clearHeartbit()
|
|
|
if(!this.forceClose){
|
|
|
console.log("socket已经关闭")
|
|
|
this.init()
|
|
|
this.reconnect = true
|
|
|
this.$loading('服务器异常断开,正在重连..')
|
|
|
setTimeout(()=>{
|
|
|
this.init()
|
|
|
}, 2000)
|
|
|
}
|
|
|
this.forceClose = false
|
|
|
},
|
|
|
reconnectTimeout(){
|
|
|
if(this.reconnect === true){
|
|
|
return
|
|
|
}
|
|
|
this.clearHeartbit()
|
|
|
if(!this.forceClose){
|
|
|
this.reconnect = true
|
|
|
this.$loading('服务器异常断开,正在重连..')
|
|
|
setTimeout(()=>{
|
|
|
this.init()
|
|
|
}, 2000)
|
|
|
}
|
|
|
this.forceClose = false
|
|
|
|
|
|
|
|
|
return
|
|
|
if(this.reconnectInterval){
|
|
|
clearInterval(this.reconnectInterval)
|
|
|
}
|
|
|
this.reconnectInterval = setInterval(()=>{
|
|
|
if(this.socket){
|
|
|
this.forceClose = true
|
|
|
this.socket.close()
|
|
|
}
|
|
|
setTimeout(()=>{
|
|
|
this.init()
|
|
|
}, 200)
|
|
|
}, 5 * 60 * 1000 + 5000)
|
|
|
},
|
|
|
clearHeartbit(){
|
|
|
if(this.heartbitInterval){
|
|
|
clearInterval(this.heartbitInterval)
|
|
|
this.heartbitInterval = undefined
|
|
|
}
|
|
|
if(this.heartbitTimeout){
|
|
|
clearInterval(this.heartbitTimeout)
|
|
|
this.heartbitTimeout = undefined
|
|
|
}
|
|
|
},
|
|
|
heartbit(){
|
|
|
this.clearHeartbit()
|
|
|
this.heartbitInterval = setInterval(()=>{
|
|
|
var obj = {
|
|
|
type: "heart",
|
|
|
mess: "",
|
|
|
}
|
|
|
this.socket.send(JSON.stringify(obj));
|
|
|
}, 60 * 1000)
|
|
|
this.send(obj);
|
|
|
|
|
|
//8s没接收到heart的回执 就重连
|
|
|
// this.heartbitTimeout = setTimeout(()=>{
|
|
|
// this.socket.close()
|
|
|
// }, 8000)
|
|
|
}, 30 * 1000)
|
|
|
|
|
|
// this.reconnectTimeout()
|
|
|
},
|
|
|
sendDeviceInfo: function() {
|
|
|
var obj = {
|
|
|
type: "ReadDevice",
|
|
|
mess: ""
|
|
|
}
|
|
|
this.socket.send(JSON.stringify(obj));
|
|
|
this.send(obj);
|
|
|
},
|
|
|
SetPrintPage: function() {
|
|
|
// string type; //text 文本 |line 间隔行|barcode 条码|qrcode 二维码|reset 重置打印机 |nline 走纸【进行【
|
|
@ -496,7 +630,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
|
|
@ -513,36 +647,35 @@ export default {
|
|
|
}
|
|
|
list.forEach(v=>{
|
|
|
printcon.push({
|
|
|
type:"text", text: (v.drugName)+"\n",nLan:0,nOrgx:-1,nWidthTimes:0,nHeightTimes:0,FontType:0,nFontStyle:0
|
|
|
type:"text", text: (v.drugName||v.goodsName)+"\n",nLan:0,nOrgx:-1,nWidthTimes:0,nHeightTimes:0,FontType:0,nFontStyle:0
|
|
|
})
|
|
|
printcon.push({
|
|
|
type:"text", text: `单价:${v.price}元 数量:${v.quantity}\n药品编码:${v.drugCode}\n规格:${v.specif}\n剂型:${v.dosForm||''}\n`,nLan:0,nOrgx:-1,nWidthTimes:0,nHeightTimes:0,FontType:0,nFontStyle:0
|
|
|
type:"text", text: `数量:${v.quantity}${v.unit}\n规格:${v.specif}\n用法:${v.useWay||''} ${v.useDose||''}${v.unit||''} ${v.useRate||''}`,nLan:0,nOrgx:-1,nWidthTimes:0,nHeightTimes:0,FontType:0,nFontStyle:0
|
|
|
})
|
|
|
printcon.push({type:"line"})
|
|
|
})
|
|
|
var {date, phone, num, remark, time, community, qrCodeContent, info} = this.orderInfo
|
|
|
printcon.push({
|
|
|
type:"text", text: `药品总价:${(allPrice).toFixed(2)}元\n药品数量:${allcount}\n订单金额:${allPrice.toFixed(2)}元\n`,nLan:0,nOrgx:-1,nWidthTimes:0,nHeightTimes:0,FontType:0,nFontStyle:0
|
|
|
})
|
|
|
|
|
|
var {date, phone, num, remark, time, community, qrCodeContent, info} = this.orderInfo
|
|
|
// printcon.push({
|
|
|
// type:"text", text: `药品总价:${(allPrice).toFixed(2)}元\n药品数量:${allcount}\n订单金额:${allPrice.toFixed(2)}元\n`,nLan:0,nOrgx:-1,nWidthTimes:0,nHeightTimes:0,FontType:0,nFontStyle:0
|
|
|
// })
|
|
|
|
|
|
var infoArr = (info&&info.split(',')) || [],
|
|
|
infoTextArr = []
|
|
|
if(infoArr.indexOf("community") != -1){
|
|
|
infoTextArr.push(`商家名称:${community}\n`)
|
|
|
infoTextArr.push(`机构名称:${community}\n`)
|
|
|
}
|
|
|
if(infoArr.indexOf("phone") != -1){
|
|
|
infoTextArr.push(`客服电话:${phone}\n`)
|
|
|
}
|
|
|
if(infoArr.indexOf("equNum") != -1){
|
|
|
infoTextArr.push(`设备编号:${this.deviceNum}\n`)
|
|
|
}
|
|
|
// if(infoArr.indexOf("equNum") != -1){
|
|
|
// infoTextArr.push(`设备编号:${this.deviceNum}\n`)
|
|
|
// }
|
|
|
if(infoArr.indexOf("orderNo") != -1){
|
|
|
infoTextArr.push(`处方单号:${num}\n`)
|
|
|
}
|
|
|
if(infoArr.indexOf("shipTime") != -1){
|
|
|
infoTextArr.push(`取药日期:${date}\n`)
|
|
|
infoTextArr.push(`取药时间:${time}\n`)
|
|
|
infoTextArr.push(`取药日期:${date} ${time}\n`)
|
|
|
}
|
|
|
if(infoTextArr&&infoTextArr.length){
|
|
|
printcon.push({type:"text", text:"--------------------------------\n",nLan:0,nOrgx:-2,nWidthTimes:0,nHeightTimes:0,FontType:0,nFontStyle:0})
|
|
@ -558,9 +691,9 @@ export default {
|
|
|
printcon.push({
|
|
|
type:"text", text: `备注:${remark||""}\n`,nLan:0,nOrgx:-1,nWidthTimes:0,nHeightTimes:0,FontType:0,nFontStyle:0
|
|
|
})
|
|
|
if(qrCodeContent){
|
|
|
printcon.push({type:"qrcode",text: qrCodeContent, nWidth:6,nVersion:0,nErrlevenl:4})
|
|
|
}
|
|
|
// if(qrCodeContent){
|
|
|
printcon.push({type:"qrcode",text: qrCodeContent||"http://weixin.qq.com/r/hj9vd_LEAL9-raYU92qU", nWidth:6,nVersion:0,nErrlevenl:4})
|
|
|
// }
|
|
|
|
|
|
printcon.push({type:"nline"})
|
|
|
printcon.push({type:"nline"})
|
|
@ -572,13 +705,13 @@ export default {
|
|
|
type: "PrintPage",
|
|
|
mess: JSON.stringify(printcon),
|
|
|
}
|
|
|
this.socket.send(JSON.stringify(obj));
|
|
|
this.send(obj);
|
|
|
},
|
|
|
updateOrderOutStatus(shipmentLogId, status, msg){
|
|
|
return new Promise((resolve, reject)=>{
|
|
|
var p = {
|
|
|
shipmentLogId,
|
|
|
status,
|
|
|
shipmentLogId: shipmentLogId || '',
|
|
|
status: status || '',
|
|
|
msg: msg || '',
|
|
|
shippingType: this.shippingType //取药方式(1、扫码,2、医保卡)
|
|
|
}
|
|
@ -586,6 +719,7 @@ export default {
|
|
|
medicineAbinetApi
|
|
|
.updateOrderOutStatus(p)
|
|
|
.then(res=>{
|
|
|
console.log('updateOrderOutStatus', res)
|
|
|
if(res.status == 200){
|
|
|
resolve()
|
|
|
return
|
|
@ -614,10 +748,22 @@ export default {
|
|
|
confirmButtonText: "返回首页"
|
|
|
}).then(() => {
|
|
|
this.step = 1
|
|
|
if(this.eventName){
|
|
|
var eventName = this.eventName
|
|
|
this.eventName = ''
|
|
|
this.checkNextEvent(eventName)
|
|
|
return
|
|
|
}
|
|
|
});
|
|
|
return
|
|
|
}
|
|
|
this.rsType = 4
|
|
|
if(this.eventName){
|
|
|
var eventName = this.eventName
|
|
|
this.eventName = ''
|
|
|
this.checkNextEvent(eventName)
|
|
|
return
|
|
|
}
|
|
|
},
|
|
|
countDown(){
|
|
|
this.times = 30
|
|
@ -630,9 +776,7 @@ export default {
|
|
|
}, 1000)
|
|
|
},
|
|
|
clearTimeoutInterval(){
|
|
|
if(timeoutInterval){
|
|
|
clearTimeout(timeoutInterval)
|
|
|
}
|
|
|
clearTimeout(timeoutInterval)
|
|
|
},
|
|
|
clearReadCardCountDown(){
|
|
|
if(readCardCountDown){
|
|
@ -650,7 +794,7 @@ export default {
|
|
|
.catch(err=>{
|
|
|
console.error(err)
|
|
|
})
|
|
|
}, 15 * 1000)
|
|
|
}, 30 * 1000)
|
|
|
},
|
|
|
videoSwipeChange(i){
|
|
|
var video = this.$refs.videoSwipe.$el.getElementsByTagName("video")[i]
|
|
@ -670,6 +814,53 @@ export default {
|
|
|
return
|
|
|
}
|
|
|
this.$refs.videoSwipe.next()
|
|
|
},
|
|
|
systemUpdate(){
|
|
|
this.$loading('系统将进行更新,请勿操作')
|
|
|
setTimeout(()=>{
|
|
|
location.reload(true)
|
|
|
}, 3000)
|
|
|
},
|
|
|
checkNextEvent(eventName){
|
|
|
if(eventName == 'equ_normal'){
|
|
|
//设备上线
|
|
|
if(this.inOut){
|
|
|
this.eventName = eventName
|
|
|
return
|
|
|
}
|
|
|
this.isErr = 2
|
|
|
} else if(eventName == 'equ_maintenance'){
|
|
|
//设备维护
|
|
|
if(this.inOut){
|
|
|
this.eventName = eventName
|
|
|
return
|
|
|
}
|
|
|
this.isErr = 1
|
|
|
} else if(eventName == 'systemUpdate'){
|
|
|
//系统更新
|
|
|
if(this.inOut){
|
|
|
this.eventName = eventName
|
|
|
return
|
|
|
}
|
|
|
this.systemUpdate()
|
|
|
} else if(eventName == 'openDebug'){
|
|
|
if(!window.vConsole){
|
|
|
window.vConsole = new VConsole();
|
|
|
}
|
|
|
} else if(eventName == 'closeDebug'){
|
|
|
if(window.vConsole){
|
|
|
window.vConsole.destroy()
|
|
|
window.vConsole = ""
|
|
|
}
|
|
|
}
|
|
|
},
|
|
|
checkCardNo(item){
|
|
|
if(this.oldCardNo){
|
|
|
this.nextOrderDetail = item
|
|
|
this.sendReadCard()
|
|
|
} else {
|
|
|
this.showOrderDetail(item)
|
|
|
}
|
|
|
}
|
|
|
},
|
|
|
destroyed() {
|