|
@ -49,9 +49,13 @@
|
|
|
<span class="ml5 fs-12">故障</span>
|
|
|
</div>
|
|
|
<div class="plr15" v-if="!isView&&this.outDetailList&&this.outDetailList.length">
|
|
|
<van-button @click="changeShowDrug" type="primary" color="#17b3ec" size="mini">{{showDeviceDrug? '备药单药品' : '设备库存药品'}}</van-button>
|
|
|
<van-button v-if="curOrder" @click="updateStockUpStatus(curOrder, 2)" type="primary" color="#17b3ec" size="mini">完成入库</van-button>
|
|
|
<van-button v-else-if="orderList&&orderList.length" @click="showOrderPicker=true" type="primary" color="#17b3ec" size="mini">导入备药单药品</van-button>
|
|
|
|
|
|
<!-- <van-button v-else @click="changeShowDrug" type="primary" color="#17b3ec" size="mini">{{showDeviceDrug? '备药单药品' : '导入备药单药品'}}</van-button> -->
|
|
|
</div>
|
|
|
<div class="plr15" v-if="isView">
|
|
|
|
|
|
<van-button @click="gotoUrl('/replenishment/start/deviceDetail', {deviceId: deviceId})" type="primary" color="#17b3ec" size="mini">点击进行入库</van-button>
|
|
|
</div>
|
|
|
</div>
|
|
@ -83,6 +87,23 @@
|
|
|
</template>
|
|
|
</div>
|
|
|
</div>
|
|
|
|
|
|
<van-popup v-model="showOrderPicker">
|
|
|
<div class="tc fs-16 pt15 pb10">备药单选择</div>
|
|
|
<div class="order-list" v-if="orderList&&orderList.length">
|
|
|
<div class="order-item kitbox ptb10" v-for="item in orderList" :key="item.id">
|
|
|
<div class="box-flex-1">
|
|
|
<div class="break-all">备药单:{{item.docNum}}</div>
|
|
|
<div class="break-all">新增日期:{{item.docTime}}</div>
|
|
|
<div class="break-all">申领品类:{{item.replenishCate}}</div>
|
|
|
<div class="break-all">申请数量:{{item.replenishInventory}}</div>
|
|
|
</div>
|
|
|
<div class="pl15 box-v-middle">
|
|
|
<van-button @click="updateStockUpStatus(item, 1)" size="mini" type="info">导入</van-button>
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
</van-popup>
|
|
|
</div>
|
|
|
</template>
|
|
|
<script>
|
|
@ -109,7 +130,10 @@ export default{
|
|
|
faultCount: 0,
|
|
|
outDetailList: [],
|
|
|
deviceDrugList: [],
|
|
|
showDeviceDrug: true
|
|
|
showDeviceDrug: true,
|
|
|
curOrder: '',
|
|
|
orderList: [],
|
|
|
showOrderPicker: false
|
|
|
}
|
|
|
},
|
|
|
watch:{
|
|
@ -127,10 +151,76 @@ export default{
|
|
|
},
|
|
|
async initPage(){
|
|
|
this.$loading('加载中..')
|
|
|
await this.queryUpListByDeviceIdAndStatus()
|
|
|
await this.queryUpListByStatus()
|
|
|
await this.getDrugInventoryCount()
|
|
|
await this.getOutDetailByUserIdAndDeviceId()
|
|
|
this.findMediicinecabinetInventoryByDeviceId()
|
|
|
},
|
|
|
updateStockUpStatus(item, status){
|
|
|
this.$toast('加载中..')
|
|
|
//查备药单详情
|
|
|
let p = {
|
|
|
id: item.id,
|
|
|
status
|
|
|
}
|
|
|
console.log('updateStockUpStatus', p)
|
|
|
medicineAbinetApi
|
|
|
.updateStockUpStatus(p)
|
|
|
.then(res=>{
|
|
|
this.$toast.clear()
|
|
|
console.log('updateStockUpStatus', res)
|
|
|
if(res && res.status == 200){
|
|
|
if(status == 1){
|
|
|
this.curOrder = item
|
|
|
// this.list[0].list = res.obj.list
|
|
|
this.queryUpListByStatus()
|
|
|
this.showOrderPicker = false
|
|
|
} else {
|
|
|
this.curOrder = ''
|
|
|
}
|
|
|
}
|
|
|
})
|
|
|
.catch(err=>{
|
|
|
console.error(err)
|
|
|
})
|
|
|
},
|
|
|
async queryUpListByStatus(){
|
|
|
//查询已领取 未导入的备药单
|
|
|
let p = {
|
|
|
replenishEr: this.user.id,
|
|
|
deviceId: this.deviceId
|
|
|
}
|
|
|
console.log('queryUpListByStatus', p)
|
|
|
await medicineAbinetApi
|
|
|
.queryUpListByStatus(p)
|
|
|
.then(res=>{
|
|
|
console.log('queryUpListByStatus', res)
|
|
|
this.orderList = res.detailModelList
|
|
|
})
|
|
|
.catch(err=>{
|
|
|
console.error(err)
|
|
|
})
|
|
|
},
|
|
|
async queryUpListByDeviceIdAndStatus(){
|
|
|
//查询是否存在未完成备药单
|
|
|
let p = {
|
|
|
replenishEr: this.user.id,
|
|
|
deviceId: this.deviceId
|
|
|
}
|
|
|
console.log('queryUpListByDeviceIdAndStatus', p)
|
|
|
await medicineAbinetApi
|
|
|
.queryUpListByDeviceIdAndStatus(p)
|
|
|
.then(res=>{
|
|
|
console.log('queryUpListByDeviceIdAndStatus', res)
|
|
|
if(res && res.detailModelList && res.detailModelList.length){
|
|
|
this.curOrder = res.detailModelList[0]
|
|
|
}
|
|
|
})
|
|
|
.catch(err=>{
|
|
|
console.error(err)
|
|
|
})
|
|
|
},
|
|
|
async getDrugInventoryCount(){
|
|
|
let p = {
|
|
|
deviceId: this.deviceId
|
|
@ -289,6 +379,22 @@ export default{
|
|
|
height: calc(100vh - 44px);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
.van-popup{
|
|
|
border-radius: 10px;
|
|
|
}
|
|
|
.order-list{
|
|
|
max-height: 50vh;
|
|
|
overflow-y: auto;
|
|
|
padding: 0 15px;
|
|
|
width: 80vw;
|
|
|
.order-item{
|
|
|
border-bottom: 1px solid #e1e1e1;
|
|
|
&:last-child{
|
|
|
border-bottom: 0;
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
</style>
|
|
|
|