|
@ -1,5 +1,10 @@
|
|
<template>
|
|
<template>
|
|
<div class="machine-index">
|
|
<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 v-show="step===0" class="tc">
|
|
<div class="plr15 pt20">
|
|
<div class="plr15 pt20">
|
|
<van-field v-model="deviceNum" clearable label="" placeholder="请输入设备编号" />
|
|
<van-field v-model="deviceNum" clearable label="" placeholder="请输入设备编号" />
|
|
@ -70,13 +75,14 @@
|
|
</div>
|
|
</div>
|
|
|
|
|
|
<Scan @onComplete="onComplete" v-show="step==2" @onBack="step=1"/>
|
|
<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>
|
|
</div>
|
|
</template>
|
|
</template>
|
|
<script>
|
|
<script>
|
|
import Scan from './components/Scan.vue';
|
|
import Scan from './components/Scan.vue';
|
|
import Result from './components/Result.vue';
|
|
import Result from './components/Result.vue';
|
|
import medicineAbinetApi from '@/api/api-medicineAbinet'
|
|
import medicineAbinetApi from '@/api/api-medicineAbinet'
|
|
|
|
var countDownFunc
|
|
export default {
|
|
export default {
|
|
name: "machineIndex",
|
|
name: "machineIndex",
|
|
components: {
|
|
components: {
|
|
@ -85,8 +91,8 @@ export default {
|
|
},
|
|
},
|
|
data() {
|
|
data() {
|
|
return {
|
|
return {
|
|
deviceNum: this.$route.query.deviceNum,//14912202107000001500000000000000
|
|
|
|
step: 0,
|
|
|
|
|
|
deviceNum: this.$route.query.deviceNum || '14912202107000001500000000000000',//14912202107000001500000000000000
|
|
|
|
step: 0, //0启动页 1首页 2扫码页 3订单页
|
|
curImg: '',
|
|
curImg: '',
|
|
illustrationMskShow: false,
|
|
illustrationMskShow: false,
|
|
socketUrl: '',
|
|
socketUrl: '',
|
|
@ -99,17 +105,47 @@ export default {
|
|
heartbitInterval: '',
|
|
heartbitInterval: '',
|
|
currindex: 0,
|
|
currindex: 0,
|
|
orderdetail: [],
|
|
orderdetail: [],
|
|
rsType: 1,
|
|
|
|
|
|
rsType: 0,// 1:订单信息 2订单错误 3订单成功 4出药完成 5订单列表
|
|
imgList: [],
|
|
imgList: [],
|
|
videoList: [],
|
|
videoList: [],
|
|
inCheckBarcode: false,
|
|
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(){
|
|
created(){
|
|
console.log(_.groupBy([{a: 1,},{a: 1,},{a: 2,},{a: 1,},], 'a'))
|
|
|
|
|
|
|
|
},
|
|
},
|
|
methods: {
|
|
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(){
|
|
devinfoAdvList(){
|
|
var p = {
|
|
var p = {
|
|
equNum: this.deviceNum
|
|
equNum: this.deviceNum
|
|
@ -144,22 +180,26 @@ export default {
|
|
let p = {
|
|
let p = {
|
|
deviceId: this.deviceNum, //设备编号
|
|
deviceId: this.deviceNum, //设备编号
|
|
pickUpNum, //取药码
|
|
pickUpNum, //取药码
|
|
cardNum //社保卡号
|
|
|
|
|
|
cardNum: cardNum //社保卡号 //"DA7292254" ||
|
|
}
|
|
}
|
|
console.log('params', p)
|
|
console.log('params', p)
|
|
medicineAbinetApi
|
|
medicineAbinetApi
|
|
.checkOrderAndReturn(p)
|
|
|
|
|
|
.checkOrderAndReturnOrderList(p)
|
|
.then(res=>{
|
|
.then(res=>{
|
|
console.log('getDetialOutOfStock', res)
|
|
|
|
|
|
console.log('checkOrderAndReturnOrderList', res)
|
|
if(res.status == 200){
|
|
if(res.status == 200){
|
|
this.$toast.clear()
|
|
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 {
|
|
} else {
|
|
this.$toast(res.message || '获取订单失败')
|
|
this.$toast(res.message || '获取订单失败')
|
|
}
|
|
}
|
|
@ -170,6 +210,15 @@ export default {
|
|
this.inCheckBarcode = false
|
|
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() {
|
|
init: function() {
|
|
if(!this.deviceNum){
|
|
if(!this.deviceNum){
|
|
return
|
|
return
|
|
@ -258,7 +307,7 @@ export default {
|
|
message: '打印完成',
|
|
message: '打印完成',
|
|
confirmButtonText: "返回首页"
|
|
confirmButtonText: "返回首页"
|
|
}).then(() => {
|
|
}).then(() => {
|
|
this.step = 1
|
|
|
|
|
|
this.onPrev()
|
|
});
|
|
});
|
|
}
|
|
}
|
|
},
|
|
},
|
|
@ -350,7 +399,7 @@ export default {
|
|
var printcon =[
|
|
var printcon =[
|
|
{type:"reset"},
|
|
{type:"reset"},
|
|
{type:"nline"},
|
|
{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},
|
|
{type:"text", text:"--------------------------------\n",nLan:0,nOrgx:-2,nWidthTimes:0,nHeightTimes:0,FontType:0,nFontStyle:0},
|
|
];
|
|
];
|
|
var allPrice = 0, allcount = 0
|
|
var allPrice = 0, allcount = 0
|
|
@ -434,6 +483,17 @@ export default {
|
|
return
|
|
return
|
|
}
|
|
}
|
|
this.rsType = 4
|
|
this.rsType = 4
|
|
|
|
},
|
|
|
|
countDown(){
|
|
|
|
return
|
|
|
|
this.times = 30
|
|
|
|
countDownFunc = setInterval(()=>{
|
|
|
|
if(this.times === 0){
|
|
|
|
clearInterval(countDownFunc)
|
|
|
|
this.onPrev()
|
|
|
|
}
|
|
|
|
this.times--
|
|
|
|
}, 1000)
|
|
}
|
|
}
|
|
},
|
|
},
|
|
destroyed() {
|
|
destroyed() {
|
|
@ -573,5 +633,23 @@ export default {
|
|
display: block;
|
|
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>
|
|
</style>
|