lincl 3 år sedan
förälder
incheckning
1ced78f23f

+ 23 - 0
mini-pro-web/src/api/api-medicineAbinet.js

@ -623,6 +623,29 @@ let service = {
			params
		});
    },
	queryUpListByDeviceIdAndStatus: function(params) {
		return request({
			url: `${BASE}/baseUp/queryUpListByDeviceIdAndStatus`,
			method: "get",
			params
		});
    },
	queryUpListByStatus: function(params) {
		return request({
			url: `${BASE}/baseUp/queryUpListByStatus`,
			method: "get",
			params
		});
    },
	updateStockUpStatus: function(data) {
		return request({
			url: `${BASE}/baseUp/updateStockUpStatus`,
			method: "post",
			data
		});
    },
};
export default service;

+ 9 - 3
mini-pro-web/src/views/machine/index.vue

@ -322,10 +322,12 @@ export default {
			console.log(msg.data)
			var msgobj = JSON.parse(msg.data)
			if (msgobj.type == 'ShipInfo') {
				debugger
				var item = this.orderdetail[this.currindex]
				if (msgobj.mess == ( item.layerNo +";"+ item.wayerNo) ) {
					this.updateOrderOutStatus(item.id, 2, msgobj.mess)
						.then(res=>{
							debugger
							this.currindex++;
							if (this.orderdetail.length > this.currindex) {
								this.$loading(`正在出第${this.currindex+1}个药..`)
@ -338,6 +340,7 @@ export default {
							}
						})
						.catch(err=>{
							debugger
							console.error(err)
							this.shipComplete("更新订单状态失败:"+ (err&&err.message))
						})
@ -352,7 +355,6 @@ export default {
						})
				}
			} else if (msgobj.type == 'BarCodeInfo') {
				debugger
				if (msgobj.mess.indexOf("异常") != -1) {
					this.$toast(msgobj.mess)
					console.log(msgobj.mess)
@ -577,9 +579,10 @@ export default {
		},
		updateOrderOutStatus(shipmentLogId, status, msg){
			return new Promise((resolve, reject)=>{
				debugger
				var p = {
					shipmentLogId,
					status,
					shipmentLogId: shipmentLogId || '',
					status: status || '',
					msg: msg || '',
					shippingType: this.shippingType //取药方式(1、扫码,2、医保卡)
				}
@ -587,6 +590,7 @@ export default {
				medicineAbinetApi
					.updateOrderOutStatus(p)
					.then(res=>{
						debugger
						if(res.status == 200){
							resolve()
							return
@ -594,6 +598,7 @@ export default {
						reject()
					})
					.catch(err=>{
						debugger
						console.error(err)
						reject()
					})
@ -654,6 +659,7 @@ export default {
			}
		},
		resetTimeoutInterval(){
			return
			this.clearTimeoutInterval()
			timeoutInterval = setTimeout(()=>{
				var msg = "出药超时,请联系管理员"

+ 108 - 2
mini-pro-web/src/views/replenishment/start/deviceDetail.vue

@ -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>