|
@ -40,7 +40,7 @@
|
|
|
<template v-if="curItem">
|
|
|
<template v-for="(item, k) in curItem.list">
|
|
|
<div class="item" v-if="item.state!=20" :key="k">
|
|
|
<ProductItem bussuness="quick" @onChange="onChange($event, item)" :data="item" :index="k"/>
|
|
|
<ProductItem v-longpress="()=>{gotoDetail(item)}" bussuness="quick" @onChange="onChange($event, item)" :data="item" :index="k"/>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
@ -64,7 +64,7 @@
|
|
|
import medicineAbinetApi from '@/api/api-medicineAbinet'
|
|
|
import ProductItem from '@/components/ProductItem'
|
|
|
export default{
|
|
|
name: 'replenishmentStartDeviceDetail',
|
|
|
name: 'replenishmentStartQuick',
|
|
|
components: {
|
|
|
ProductItem
|
|
|
},
|
|
@ -74,6 +74,7 @@ export default{
|
|
|
query: this.$route.query,
|
|
|
selItemList: [],
|
|
|
allNum: 0,
|
|
|
curCargo: '',
|
|
|
|
|
|
deviceInfo: {device: ''},
|
|
|
deviceId: this.$route.query.deviceId,
|
|
@ -107,8 +108,46 @@ export default{
|
|
|
// this.findDeviceById()
|
|
|
},
|
|
|
methods:{
|
|
|
$refreshData(){
|
|
|
this.findMediicinecabinetInventoryByDeviceId()
|
|
|
$refreshData(p){
|
|
|
if(p){
|
|
|
var oQty = this.curCargo.cargoCapacity - this.curCargo.qty
|
|
|
//1修改容量 2矫正库存 3下架药品 4更换药品
|
|
|
switch(Number(p.bussiness)){
|
|
|
case 1:
|
|
|
// 1修改容量
|
|
|
case 2:
|
|
|
// 2矫正库存
|
|
|
if(p.bussiness==1){
|
|
|
this.curCargo.cargoCapacity = p.data
|
|
|
} else {
|
|
|
this.curCargo.qty = p.data
|
|
|
}
|
|
|
if(this.curCargo.qty > this.curCargo.cargoCapacity){
|
|
|
this.curCargo.qty = this.curCargo.cargoCapacity
|
|
|
}
|
|
|
if(this.curCargo.isActive){
|
|
|
this.allNum = this.allNum - oQty + (this.curCargo.cargoCapacity - this.curCargo.qty)
|
|
|
}
|
|
|
break;
|
|
|
case 3:
|
|
|
// 3下架药品
|
|
|
this.curCargo.shelfStatus = 0
|
|
|
this.curCargo.qty = 0
|
|
|
if(this.curCargo.isActive){
|
|
|
this.allNum = this.allNum - oQty + this.curCargo.cargoCapacity
|
|
|
}
|
|
|
break;
|
|
|
case 4:
|
|
|
// 4更换药品
|
|
|
this.curItem.list.splice(this.curItem.list.indexOf(this.curCargo), 1)
|
|
|
if(this.curCargo.isActive){
|
|
|
this.allNum = this.allNum - oQty
|
|
|
}
|
|
|
break;
|
|
|
}
|
|
|
} else {
|
|
|
this.findMediicinecabinetInventoryByDeviceId()
|
|
|
}
|
|
|
},
|
|
|
initPage(){
|
|
|
this.findMediicinecabinetInventoryByDeviceId()
|
|
@ -449,6 +488,15 @@ export default{
|
|
|
console.error(err)
|
|
|
})
|
|
|
},
|
|
|
gotoDetail(item){
|
|
|
if(item.shelfStatus==1){
|
|
|
this.curCargo = item;
|
|
|
this.gotoUrl('./productDetail', {
|
|
|
id: item.id,
|
|
|
from: 'quick'
|
|
|
})
|
|
|
}
|
|
|
}
|
|
|
},
|
|
|
}
|
|
|
</script>
|