lincl 3 tahun lalu
induk
melakukan
0f4d43d628
34 mengubah file dengan 1295 tambahan dan 357 penghapusan
  1. 4 4
      mini-pro-web/.env.production
  2. 72 2
      mini-pro-web/src/api/api-medicineAbinet.js
  3. TEMPAT SAMPAH
      mini-pro-web/src/assets/images/drug_default.png
  4. TEMPAT SAMPAH
      mini-pro-web/src/assets/images/gouxuan.png
  5. 43 9
      mini-pro-web/src/components/ProductItem/index.vue
  6. 3 7
      mini-pro-web/src/utils/web-ajax.js
  7. 90 26
      mini-pro-web/src/views/device/cargoLane/index.vue
  8. 239 14
      mini-pro-web/src/views/device/cargoLane/setting.vue
  9. 2 2
      mini-pro-web/src/views/device/detail.vue
  10. 12 7
      mini-pro-web/src/views/device/index.vue
  11. 37 20
      mini-pro-web/src/views/drug/list.vue
  12. 2 1
      mini-pro-web/src/views/index/Index.vue
  13. 22 3
      mini-pro-web/src/views/machine/components/Result.vue
  14. 4 1
      mini-pro-web/src/views/machine/components/Scan.vue
  15. TEMPAT SAMPAH
      mini-pro-web/src/views/machine/img/back.png
  16. TEMPAT SAMPAH
      mini-pro-web/src/views/machine/img/complete.png
  17. TEMPAT SAMPAH
      mini-pro-web/src/views/machine/img/dayin.png
  18. TEMPAT SAMPAH
      mini-pro-web/src/views/machine/img/order_err.png
  19. 144 27
      mini-pro-web/src/views/machine/index.vue
  20. 9 6
      mini-pro-web/src/views/order/detail/components/DrugList.vue
  21. 7 6
      mini-pro-web/src/views/order/detail/components/LogList.vue
  22. 59 16
      mini-pro-web/src/views/order/detail/index.vue
  23. 14 12
      mini-pro-web/src/views/order/list.vue
  24. 52 11
      mini-pro-web/src/views/replenishment/device/detail.vue
  25. 45 57
      mini-pro-web/src/views/replenishment/device/list.vue
  26. 27 9
      mini-pro-web/src/views/replenishment/index.vue
  27. 38 17
      mini-pro-web/src/views/replenishment/picking/detail.vue
  28. 35 9
      mini-pro-web/src/views/replenishment/picking/list.vue
  29. 58 11
      mini-pro-web/src/views/replenishment/start/components/SetStockDialog.vue
  30. 107 45
      mini-pro-web/src/views/replenishment/start/deviceDetail.vue
  31. 10 8
      mini-pro-web/src/views/replenishment/start/deviceList.vue
  32. 120 15
      mini-pro-web/src/views/replenishment/start/productDetail.vue
  33. 34 11
      mini-pro-web/src/views/replenishment/stockUp/detail.vue
  34. 6 1
      mini-pro-web/src/views/replenishment/stockUp/deviceList.vue

+ 4 - 4
mini-pro-web/.env.production

@ -1,7 +1,7 @@
VUE_APP_BASE_API = 'https://zhyzh.gongshu.gov.cn'
VUE_APP_IMAGE_SERVER = 'https://zhyzh.gongshu.gov.cn/fastdfs/'
VUE_APP_SOCKET_URL = 'https://zhyzh.gongshu.gov.cn'
VUE_APP_IM_API = 'https://zhyzh.gongshu.gov.cn/api/v2'
VUE_APP_BASE_API = 'http://ehr.yihu.com/hlwyy'
VUE_APP_IMAGE_SERVER = 'http://ehr.yihu.com/fastdfs/'
VUE_APP_SOCKET_URL = 'http://ehr.yihu.com'
VUE_APP_IM_API = 'http://ehr.yihu.com/api/v2'
VUE_APP_PRE_PATH = '/hlwyy/intelligent-medicine-abinet'
VUE_APP_APPID = "wx2c55f5b7b2f3cb56"

+ 72 - 2
mini-pro-web/src/api/api-medicineAbinet.js

@ -415,8 +415,78 @@ let service = {
			params
		});
    },
	
	
	// 根据设备id查询设备轨道数据
	findMediicinecabinetInventoryByDeviceId: function(params) {
		return request({
			url: `${BASE}/baseDevice/findMediicinecabinetInventoryByDeviceId`,
			method: "get",
			params
		});
    },
	// 更换商品,或者设定商品
	updateMediicinecabineInventory: function(data) {
		return request({
			url: `${BASE}/baseDevice/updateMediicinecabineInventory`,
			method: "post",
			data
		});
    },
	// 根据货道id获取单个货道详情
	selectMediicinecabineInventoryById: function(params) {
		return request({
			url: `${BASE}/baseDevice/selectMediicinecabineInventoryById`,
			method: "get",
			params
		});
    },
	// 矫正库存\\ 更新容量 \\下架商品
	updateMediicinecabineInventoryInfoById: function(data) {
		return request({
			url: `${BASE}/baseDevice/updateMediicinecabineInventoryInfoById`,
			method: "post",
			data
		});
    },
	// 通过userId, 获取缺货列表
	getOutOfStockDeviceListByUserId: function(params) {
		return request({
			url: `${BASE}/baseDevice/getOutOfStockDeviceListByUserId`,
			method: "get",
			params
		});
    },
	// 通过userId 获取设备列表
	getDeviceListWithUserId: function(params) {
		return request({
			url: `${BASE}/baseDevice/getDeviceListWithUserId`,
			method: "get",
			params
		});
    },
	// 更新出货状态
	updateOrderOutStatus: function(data) {
		return request({
			url: `${BASE}/open/noLogin/updateOrderOutStatus`,
			method: "post",
			data
		});
    },
	mergeAndSplitCargo: function(data) {
		return request({
			url: `${BASE}/baseDevice/mergeAndSplitCargo`,
			method: "post",
			data
		});
    },
};
export default service;

TEMPAT SAMPAH
mini-pro-web/src/assets/images/drug_default.png


TEMPAT SAMPAH
mini-pro-web/src/assets/images/gouxuan.png


+ 43 - 9
mini-pro-web/src/components/ProductItem/index.vue

@ -1,33 +1,60 @@
<template>
    <div class='components-product-item' :class="'pitem-full'">
        <div :style="'height: 25%'" class="pitem-bg"></div>
        <div class="pitem-inner">
            <div class="kitbox ">
                <div class="box-flex-1">1号位</div>
                <div>0/5</div>
    <div @click="toSet" class='components-product-item' :class="data.cargoCapacity==data.qty?'pitem-full':''">
        <div :style="'height: '+ (rate) +'%'" class="pitem-bg"></div>
        <div class="pitem-inner" >
            <div class="kitbox " >
                <div class="box-flex-1">{{index+1}}号位</div>
                <div>{{data.qty}}/{{data.cargoCapacity}}</div>
            </div>
            <div class="ellipsis tc pt8">J氯化钠注J氯化钠注</div>
            <div class="tc pt5">¥27.00</div>
            <template v-if="data.shelfStatus==1">
                <div class="ellipsis tc pt8">{{data.drugName}}</div>
                <div class="tc pt5">¥{{data.price}}</div>
            </template>
            <div v-else class="ellipsis tc pt8 ">未设商品</div>
        </div>
        <div class="tag" v-if="data.state==21">主</div>
        <div class="tag" v-else-if="data.state==20">副</div>
    </div>
</template>
<script>
export default{
    props: ['data', 'index'],
    data(){
        return {
            
        }
    },
    computed:{
        rate(){
            var {data} = this
            return (data.qty||0) / (data.cargoCapacity||5) * 100
        },
    },
    created() {
        
    },
    methods:{
        
        toSet(){
            if(this.data.state==20){
                this.$toast('不能操作副通道,如要修改请修改它的主通道')
                return
            }
            if(this.data.shelfStatus != 1){
                this.gotoUrl('/drugList', {
                    trackId: this.data.id
                })
            } else {
                this.gotoUrl('./productDetail', {
                    id: this.data.id,
                })
            }
        }
    },
}
</script>
<style lang='scss' scoped>
.components-product-item{
    overflow: hidden;
    width: 100px;
    height: 80px;
    background: rgb(238, 238, 238);
@ -63,5 +90,12 @@ export default{
                background: #ff5e6c;
        }
    }
    .tag{
        color: red;
        position: absolute;
        right: 2px;
        bottom: 2px;
        font-size: 12px;
    }
}
</style>

+ 3 - 7
mini-pro-web/src/utils/web-ajax.js

@ -8,13 +8,9 @@ let Message = vant.Toast
function redirectToLogin() {
	store.dispatch('LogOut').then(()=>{
		let appId = process.env.VUE_APP_APPID,
          protocol = window.location.protocol,
          host = window.location.host,
          redirctWxAuthUrl = encodeURIComponent(`${protocol}//${host}${process.env.VUE_APP_PRE_PATH}/login`),
          wxAuthUrl = `https://open.weixin.qq.com/connect/oauth2/authorize?appid=${appId}&redirect_uri=${redirctWxAuthUrl}&response_type=code&scope=snsapi_base&state=STATE#wechat_redirect`
      
      location.replace(wxAuthUrl)
		router.push({
			path: "/login"
		})
	})
}
var baseURL = process.env.VUE_APP_BASE_API

+ 90 - 26
mini-pro-web/src/views/device/cargoLane/index.vue

@ -2,53 +2,56 @@
    <div class='cargoLaneIndex'>
        <div class='grid-4 c-f14 c-border-b c-333 ptb15 bgc-fff'>
            <div class="c-t-center">
                <div class='c-ff5e6c c-f16 mb5'>{{rows}}</div>
                <div class='c-ff5e6c c-f16 mb5'>{{deviceInfo.layer || 0}}</div>
                <span>层数</span>
            </div>
            <div class="c-t-center">
                <div class='c-ff5e6c c-f16 mb5'>{{number}}</div>
                <div class='c-ff5e6c c-f16 mb5'>{{deviceInfo.aisles || 0}}</div>
                <span>货道数</span>
            </div>
            <div class="c-t-center">
                <div class='c-ff5e6c c-f16 mb5'>{{playNum}}</div>
                <div class='c-ff5e6c c-f16 mb5'>{{0}}</div>
                <span>启用</span>
            </div>
            <div class="c-t-center">
                <div class='c-ff5e6c c-f16 mb5'>{{disableNum}}</div>
                <div class='c-ff5e6c c-f16 mb5'>{{0}}</div>
                <span>禁用</span>
            </div>
        </div>
        <div class='bgc-fff p10'>
            <div class='flex f_y_c f_x_s'>
                <div>
                    <van-button type="info" class='mr10 c-border-r-5'>货道开启</van-button>
                    <van-button type="info" class='c-border-r-5'>货道关闭</van-button>
                <div style="width: 50%" class="pr10">
                    <van-button block type="info" class='c-border-r-5'>货道开启</van-button>
                </div>
                <div>
                <div style="width: 50%" class="pl10">
                    <van-button block type="info" class='c-border-r-5'>货道关闭</van-button>
                </div>
                <!-- <div>
                    <van-button type="info" class='mr10 c-border-r-5'>售卖</van-button>
                    <van-button type="info" class='c-border-r-5'>停售</van-button>
                </div>
                </div> -->
            </div>
            <div class='mt10'><van-button type="info" style='width:100%;' class='c-border-r-5'>获取货道状态</van-button></div>
            <div class='mt10'><van-button @click="findMediicinecabinetInventoryByDeviceId" type="info" style='width:100%;' class='c-border-r-5'>获取货道状态</van-button></div>
            <div class='mt20 c-f14'>
                <div class='flex f_y_c x-overflow'>
                    <div v-for='(item, index) in (Math.ceil(number/6))'>
                    <div v-for='(citem, index) in list' :key="index">
                        <div>
                            <div class='c-t-center w50 ptb10 bgc-ccc' :class='(Math.ceil(number/6))!=index+1?"mr10":""'>{{index+1}}</div>
                            <div v-for='(item, index) in rows'>
                                <div class='c-t-center w50 ptb10 mt10 bgc-fff c-border c-position-r' :class='(Math.ceil(number/6))!=index+1?"mr10":""'>
                            <div v-for='(item, j) in citem.list' :key="j">
                                <div @click="onSelect(item)" class='c-t-center w50 ptb10 mt10 bgc-fff c-border c-position-r' 
                                    :class="{'mr10': (Math.ceil(number/6))!=index+1, 'active': selectList.indexOf(item)!=-1}">
                                    <div>
                                        <div v-if='true' class='c-20d7ad'>正常</div>
                                        <div v-else class='c-ff9526'>故障</div>
                                    </div>
                                    <div>
                                        <div v-if='true' class='c-20d7ad'>已停用</div>
                                        <div v-else class='c-ff5e6c'>停售</div>
                                        <div v-if='true' class='c-20d7ad'>已启动</div>
                                        <div v-else class='c-ff5e6c'>已停用</div>
                                    </div>
                                    <div>
                                    <!-- <div>
                                        <div v-if='true' class='c-20d7ad'>售卖</div>
                                        <div v-else class='c-ff5e6c'>停售</div>
                                    </div>
                                    </div> -->
                                </div>
                            </div>
                        </div>
@ -60,23 +63,81 @@
    </div>
</template>
<script>
import medicineAbinetApi from '@/api/api-medicineAbinet'
export default{
    name: 'cargoLaneIndex',
    data(){
        return {
            rows: 6,
            number: 240,
            playNum: 240,
            disableNum: 0,
            list: []
            deviceInfo: '',
            deviceId: this.$route.query.deviceId,
            list: [],
            activeKey: 0,
            curItem: [],
            selectList: []
        }
    },
     created() {
        this.findMediicinecabinetInventoryByDeviceId()
        this.findDeviceById()
    },
    methods:{
        $refreshData(){
            this.findMediicinecabinetInventoryByDeviceId()
        },
        findMediicinecabinetInventoryByDeviceId(){
            this.$loading('加载中..')
            let p = {
                deviceId: this.deviceId
            }
            console.log('params', p)
            medicineAbinetApi
                .findMediicinecabinetInventoryByDeviceId(p)
                .then(res=>{
                    console.log('findMediicinecabinetInventoryByDeviceId', res)
                    this.$toast.clear()
                    if(res.detailModelList && res.detailModelList.length){
                        var list = _.map(res.detailModelList, v=>{
                            var key = _.keys(v)[0]
                            return {
                                index: key,
                                list: v[key],
                            }
                        })
                        list = _.sortBy(list, 'index')
                        this.list = list
                        this.curItem = this.list[0]
                        console.log(list, this.curItem)
                    }
                })
                .catch(err=>{
                    console.error(err)
                })
        },
        findDeviceById(){
            let p = {
                deviceId: this.deviceId
            }
            console.log('params', p)
            medicineAbinetApi
                .findDeviceById(p)
                .then(res=>{
                    console.log('findDeviceById', res)
                    this.$toast.clear()
                    this.deviceInfo = res.obj.device
                })
                .catch(err=>{
                    console.error(err)
                })
        },
        onSelect(item){
            var i = this.selectList.indexOf(item)
            if(i == -1){
                this.selectList.push(item)
            } else {
                this.selectList.splice(i, 1)
            }
        }
    },
    created(){
        
    }
}
</script>
<style scoped lang='scss'>
@ -93,5 +154,8 @@ export default{
    .x-overflow::-webkit-scrollbar{
        display:none;
    }
    .active{
        border-color: red;
    }
}
</style>

+ 239 - 14
mini-pro-web/src/views/device/cargoLane/setting.vue

@ -14,50 +14,259 @@
                <span>关闭</span>
            </div>
        </div>
        <div v-for='(item, index) in rows'>
        <div v-for='(citem, index) in list' :key="index">
            <div class='mt10 bgc-fff ptb10 c-border-tb plr15 c-f14'>
                <div class='flex f_y_c f_x_s'>
                    <span>第{{index+1}}层</span>
                    <van-radio v-model="checkAll">选择整行</van-radio>
                    <van-checkbox v-model="citem.checkAll" @change="onRowChange($event, citem)" color="#17b3ec">选择整行</van-checkbox>
                </div>
                <div class='flex mt10 x-overflow'>
                    <div v-for='(citem, cindex) in cols'>
                        <div class='c-t-center w30 c-position-r' :class='cindex!=cols.length-1?"mr10":""'>
                    <div v-for='(item, cindex) in citem.list' :key="cindex">
                        <div @click="onSelectCol(item)" class='c-t-center w30 c-position-r item' 
                            :class='{mr10: cindex!=citem.list.length-1}'>
                            <div>{{cindex+1}}</div>
                            <div class='c-t-center'><div class='c-cirlce-17b3ec'></div></div>
                            <div class='c-border ptb5'>5</div>
                            <div class='c-border ptb5 item-box ellipsis_1' :class='{active: selectList.indexOf(item)!=-1, isMerge: item.state==21||item.state==20}'>{{item.state==21?"主":item.cargoCapacity}}</div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        <div class='mt20 plr15'>
            <van-button class='c-border-r-5' style='width:100%' type="info">设置货道容量</van-button>
            <van-button class='c-border-r-5' style='width:100%' type="info" @click="toSetCount">设置货道容量</van-button>
        </div>
        <div class='mt20 plr15'>
            <van-button class='c-border-r-5' style='width:100%' type="info">货道合并</van-button>
            <van-button @click="mergeAndSplitCargo(true)" class='c-border-r-5' style='width:100%' type="info">货道合并</van-button>
        </div>
        <div class='mt20 plr15 mb30'>
            <van-button class='c-border-r-5' style='width:100%' type="info">货道拆分</van-button>
            <van-button @click="mergeAndSplitCargo(false)" class='c-border-r-5' style='width:100%' type="info">货道拆分</van-button>
        </div>
        <SetStockDialog 
            v-model="setStockShow" 
            :data="info"
            @onConfirm="updateMediicinecabineInventoryInfoById" 
            :bussiness="1"/>
    </div>
</template>
<script>
import medicineAbinetApi from '@/api/api-medicineAbinet'
import SetStockDialog from '@/views/replenishment/start/components/SetStockDialog'
export default{
    name: 'deviceDetail',
    components: {
        SetStockDialog
    },
    data(){
        return {
            rows: 6,
            cols: 40,
            checkAll: []
            deviceInfo: '',
            deviceId: this.$route.query.deviceId,
            list: [],
            activeKey: 0,
            curItem: '',
            checkAll: [],
            selectList: [],
            setStockShow: false,
        }
    },
    created(){
        this.findMediicinecabinetInventoryByDeviceId()
        this.findDeviceById()
    },
    methods:{
        findMediicinecabinetInventoryByDeviceId(){
            this.$loading('加载中..')
            let p = {
                deviceId: this.deviceId
            }
            console.log('params', p)
            medicineAbinetApi
                .findMediicinecabinetInventoryByDeviceId(p)
                .then(res=>{
                    console.log('findMediicinecabinetInventoryByDeviceId', res)
                    this.$toast.clear()
                    if(res.detailModelList && res.detailModelList.length){
                        var list = _.map(res.detailModelList, v=>{
                            var key = _.keys(v)[0]
                            v[key].forEach(m => {
                                m.check = false
                            });
                            return {
                                index: key,
                                list: v[key],
                                checkAll: false
                            }
                        })
                        list = _.sortBy(list, 'index')
                        this.list = list
                        console.log(list)
                    }
                })
                .catch(err=>{
                    console.error(err)
                })
        },
        findDeviceById(){
            let p = {
                deviceId: this.deviceId
            }
            console.log('params', p)
            medicineAbinetApi
                .findDeviceById(p)
                .then(res=>{
                    console.log('findDeviceById', res)
                    this.$toast.clear()
                    this.deviceInfo = res.obj.device
                })
                .catch(err=>{
                    console.error(err)
                })
        },
        onSelect(item){
            var i = this.selectList.indexOf(item)
            if(i == -1){
                this.selectList.push(item)
            } else {
                this.selectList.splice(i, 1)
            }
        },
        onSelectCol(item){
            var i = this.selectList.indexOf(item)
            if(i != -1){
                var exist = _.filter(this.selectList, v=>{
                    var n = Number(item.wayerNo)
                    return v.wayerNo==n-1 || v.wayerNo==n+1
                })
                if(exist.length==2){
                    return
                }
                this.selectList.splice(i, 1)
                return
            }
            if(this.selectList.length!==0 && item.layerNo!=Number(this.selectList[0].layerNo)){
                return
            }
            
            if(this.selectList.length){
                var exist = _.find(this.selectList, v=>{
                    var n = Number(item.wayerNo)
                    return v.wayerNo==n-1 || v.wayerNo==n+1
                })
                if(!exist){
                    return
                }
            }
            
            this.selectList.push(item)
        },
        onRowChange(e, item){
            if(this.selectList.length && this.selectList[0].layerNo!=item.layerNo){
                this.list[Number(this.selectList[0].layerNo)-1].checkAll = false
            }
            if(e){
                this.selectList = item.list
            } else {
                this.selectList = []
            }
        },
        mergeAndSplitCargo(isMerge){
            this.$loading('保存中..')
            var ids = []
            if(isMerge){
                debugger
                if(!this.selectList.length || this.selectList.length<2){
                    this.$toast('至少选择两个相邻的货道')
                    return
                }
                var exist = _.find(this.selectList, v=>{
                    return v.state==20 || v.state==21
                })
                if(exist){
                    this.$toast('不能选择已合并的通道')
                    return 
                }
                var list = _.sortBy(this.selectList, 'wayerNo')
                ids = _.map(list, v=>{
                    return v.id
                })
            } else {
                if(!this.selectList.length || this.selectList.length>1 || this.selectList[0].state!=21){
                    this.$toast('请选择一个主货道')
                    return
                }
                var item = this.selectList[0]
                var list = this.list[Number(item.layerNo)-1].list
                ids.push(item.id)
                for(var i=Number(item.wayerNo); i<=list.length; i++){
                    var v = list[i]
                    if(v.state == 20){
                        ids.push(v.id)
                    } else {
                        break;
                    }
                }
            }
            
            var p = {
                cargoIds: ids.join(','),
                isMerge
            }
            console.log(p)
            medicineAbinetApi
                .mergeAndSplitCargo(p)
                .then(res=>{
                    console.log('mergeAndSplitCargo', res)
                    if(res.status == 200){
                        this.selectList = []
                        this.$toast('操作成功')
                        this.findMediicinecabinetInventoryByDeviceId()
                    } 
                })
                .catch(err=>{
                    console.error(err)
                })
        },
        toSetCount(){
            if(!this.selectList || !this.selectList.length){
                this.$toast("至少选择一个货道")
                return
            }
            if(this.selectList[0].state==20){
                this.$toast("副通道不能修改容量,请修改它的主通道")
                return
            }
            this.setStockShow = true
        },
        updateMediicinecabineInventoryInfoById(data){
            this.$loading('保存中..')
            var ids = _.map(this.selectList, v=>{
                return v.id
            })
            let p = {
                id: ids.join(","),
                cargoCapacity: data
            }
            console.log('params', p)
            medicineAbinetApi
                .updateMediicinecabineInventoryInfoById(p)
                .then(res=>{
                    console.log('updateMediicinecabineInventoryInfoById', res)
                    if(res.status == 200){
                        this.setStockShow = false
                        this.$toast.clear()
                        this.selectList = []
                        this.findMediicinecabinetInventoryByDeviceId()
                    }
                })
                .catch(err=>{
                    console.error(err)
                })
        },
    },
    created(){
        
    }
    
}
</script>
<style scoped lang='scss'>
@ -80,5 +289,21 @@ export default{
    .x-overflow::-webkit-scrollbar{
        display:none;
    }
    .item{
        .active{
            border-color: #17b3ec;
            background-image: url('../../../assets/images/gouxuan.png');
            background-size: 15px 15px;
            background-repeat: no-repeat;
            background-position: bottom right;
        }
        .isMerge{
            background-color: #17b3ec;
            color: #fff;
        }
        .item-box{
            line-height: 20px;
        }
    }
}
</style>

+ 2 - 2
mini-pro-web/src/views/device/detail.vue

@ -40,13 +40,13 @@
                </div>
                <div>湿度控制</div>
            </div>
            <div class='c-t-center' @click='gotoUrl("/device/cargoLane/index")'>
            <div class='c-t-center' @click='gotoUrl("/device/cargoLane/index", {deviceId: id})'>
                <div>
                    <van-image class='ability' :src='require("@/assets/images/huodaozhuangtai.png")'/>
                </div>
                <div>货道状态</div>
            </div>
            <div class='c-t-center' @click='gotoUrl("/device/cargoLane/setting")'>
            <div class='c-t-center' @click='gotoUrl("/device/cargoLane/setting", {deviceId: id})'>
                <div>
                    <van-image class='ability' :src='require("@/assets/images/huodaoshezhi.png")'/>
                </div>

+ 12 - 7
mini-pro-web/src/views/device/index.vue

@ -72,23 +72,28 @@ export default{
        stopSell(item){
        },
        findList(){
            this.$loading('加载中..')
            this.list = []
            let p = {
                content: this.searchText,
                userId: this.user.id,
                page: 1,
                size: 9999,
                size: 999
            }
            medicineAbinetApi
                .deviceList(p)
            medicineAbinetApi.getDeviceListWithUserId(p)
                .then(res=>{
                    this.$toast.clear()
                    this.list = res.detailModelList
                    console.log(res.detailModelList)
                })
                .catch(err=>{
                    console.log('getDeviceListWithUserId', res)
                    if(res.status == 200){
                        this.list = res.detailModelList
                    } else {
                        this.list = []
                    }
                }).catch(err=>{
                    console.error(err)
                    this.list = []
                })
        }
    },

+ 37 - 20
mini-pro-web/src/views/drug/list.vue

@ -1,28 +1,30 @@
<template>
    <div class="drug-list">
        <div class="search">
            <form action="/">
                <van-search
                    v-model="value"
                    placeholder="请输入搜索关键词"
                    show-action
                    @search="getDrugDictionary"
                    @cancel="onCancel"
                />
            </form>
        </div>
        <van-sticky>
            <div class="search">
                <form action="/">
                    <van-search
                        v-model="value"
                        placeholder="请输入搜索关键词"
                        show-action
                        @search="getDrugDictionary"
                        @cancel="onCancel"
                    />
                </form>
            </div>
        </van-sticky>
        <div class="list" v-if="list.length">
            <div 
                v-for="(item, i) in list" :key="i"
                @click="addDrug(item)"
                class="item mb10 bgc-fff btb-e1e1e1 pt10 pb10 plr15">
                <van-row class="lh25 c-333">
                    <span class="fs-17">{{item.drugname}}</span>
                    <span class="fs-14 ml20">处方名称/项目名称:{{item.drugname}}</span>
                    <span class="fs-17">{{item.drugName}}</span>
                    <span class="fs-14 ml20">处方名称/项目名称:{{item.drugName}}</span>
                </van-row>
                <van-row class="lh25">
                    <van-col span="12" class="c-999">规格:<span class="c-333">{{item.specification}}</span></van-col>
                    <van-col span="12" class="c-999">零售价:<span class="c-333">{{item.retprice}}</span></van-col>
                    <van-col span="12" class="c-999">规格:<span class="c-333">{{item.specif}}</span></van-col>
                    <van-col span="12" class="c-999">零售价:<span class="c-333">{{item.price}}</span></van-col>
                </van-row>
                <van-row class="lh25">
                    <van-col span="12" class="c-999">医保支付价:<span class="c-333"></span></van-col>
@ -32,22 +34,29 @@
                    <van-col span="12" class="c-999">基药:<span class="c-333"></span></van-col>
                    <van-col span="12" class="c-999">药品类别:<span class="c-333"></span></van-col>
                </van-row>
                <div class="c-ff5e6c fs-14 lh25">高危药品:</div>
                <!-- <div class="c-ff5e6c fs-14 lh25">高危药品:</div> -->
            </div>
        </div>
        <div v-else class="c-999 fs-14 tc pt20">
            <div v-if="value">搜索不到数据~~</div>
            <div v-else>请输入关键词进行搜索</div>
        </div>
        <SetStockDialog 
            v-model="setStockShow" 
            :trackId="trackId"
            :bussiness="5"
            :drugId="drugId"/>
    </div>
</template>
<script>
import medicineAbinetApi from '@/api/api-medicineAbinet'
import SetStockDialog from '@/views/replenishment/start/components/SetStockDialog'
export default {
    name: "DrugSel",
    components: {
        
        SetStockDialog
    },
    watch: {
        value(n, o){
@ -56,17 +65,20 @@ export default {
    },
    data(){
        return {
            trackId: this.$route.query.trackId,//轨道id
            value: "",
            list: [],
            setStockShow: false,
            drugId: ''
        }
    },
    async created(){
        
        this.getDrugDictionary()
    },
    methods: {
        getDrugDictionary(){
            var val = this.value
			if(val&&val.length>=2){
			// if(val&&val.length>=2){
                var p = {
                    content: this.value,
                    page: 1,
@ -84,12 +96,17 @@ export default {
                    .catch(err=>{
                        console.error(err)
                    })
			}
			// }
        },
        onCancel(){
            this.$router.back()
        },
        addDrug(item){
            if(this.trackId){
                this.drugId = item.id
                this.setStockShow = true
                return
            }
            this.$EventBus.$emit('drug-sel', item)
            this.$router.back()
        },

+ 2 - 1
mini-pro-web/src/views/index/Index.vue

@ -84,7 +84,8 @@ export default {
				"total": 0,							//总的在线数
				"saleTotal": 0,						//在售数
				"onlineRate": 0,					//在线率
				"onlineTotal": 0						//在线设备数
				"onlineTotal": 0,						//在线设备数
				"outCount": 0 						//缺货设备数
			}
    	}
  	},

+ 22 - 3
mini-pro-web/src/views/machine/components/Result.vue

@ -4,19 +4,23 @@
			<img v-show="rsType==1" src="../img/order_info.png" alt="">
			<img v-show="rsType==2" src="../img/order_err.png" alt="">
			<img v-show="rsType==3" src="../img/order_suc.png" alt="">
			<img v-show="rsType==4" src="../img/complete.png" alt="">
			<div class="content">
				<div class="bold">处方药品清单:</div>
				<div class="list">
					<div class="kitbox" v-for="(item, i) in orderdetail" :key="i" :style="item.success? 'color: green' : ''">
						<div class="box-flex-1 ellipsis_1" ><van-icon v-if="item.success" style="vertical-align: text-top;" name="passed"/> {{i+1}}、{{item.goodsName || item.drugName}}</div>
						<div v-if="item.status==1">x{{item.quantity}} ({{item.unit}})</div>
						<div v-if="item.orderState==1||rsType==1||rsType==3||rsType==4">x{{item.quantity || 1}} ({{item.unit}})</div>
						<div v-else class="c-red">药柜无货</div>
					</div>
				</div>
			</div>
			<div class="btns">
			<div class="btns" :class="rsType==4? 'inline' : ''">
				<img @click="$emit('outDrug'); rsType=3;" v-show="rsType==1" src="../img/quanbuquyao_icon.png" alt="">
				<img @click="$emit('onBack')" v-show="rsType==2" src="../img/yaofangquyao_icon.png" alt="">
				<img @click="$emit('onBackIndex')" v-show="rsType==4" src="../img/back.png" alt="">
				<img @click="$emit('onPrint')" v-show="rsType==4" src="../img/dayin.png" alt="">
			</div>
		</div>
		
@ -27,7 +31,7 @@ export default {
	props: ['rsType', 'orderdetail'],
  	data() {
    	return {
			// rsType: 1 //1:订单信息 2订单错误  3订单成功
			// rsType: 1 //1:订单信息 2订单错误  3订单成功  4出药完成
    	}
  	},
	created(){
@ -79,6 +83,21 @@ export default {
			width: calc(1250px / 6);
			margin: calc(186px / 6) auto 0;
		}
		&.inline{
			text-align: center;
			img{
				display: inline-block;
				margin: calc(186px / 6) auto 0;
				width: calc(790px / 6);
				&:first-child{
					margin-right: calc(60px / 6);
				}
				&:last-child{
					margin-left: calc(60px / 6);
				}
			}
		}
	}
}

+ 4 - 1
mini-pro-web/src/views/machine/components/Scan.vue

@ -32,7 +32,7 @@
export default {
  	data() {
    	return {
			num: '',
			num: '',//64022149
			keyboardShow: false,
    	}
  	},
@ -46,6 +46,9 @@ export default {
			return false
		},
		onCheckOrder(){
			if(!this.num){
				return
			}
			this.$loading('获取订单..')
			this.$emit('onComplete', this.num)
			this.num = ''

TEMPAT SAMPAH
mini-pro-web/src/views/machine/img/back.png


TEMPAT SAMPAH
mini-pro-web/src/views/machine/img/complete.png


TEMPAT SAMPAH
mini-pro-web/src/views/machine/img/dayin.png


TEMPAT SAMPAH
mini-pro-web/src/views/machine/img/order_err.png


+ 144 - 27
mini-pro-web/src/views/machine/index.vue

@ -70,7 +70,7 @@
		</div>
		<Scan @onComplete="onComplete" v-show="step==2" @onBack="step=1"/>
		<Result @outDrug="sendShipment" :rsType.sync="rsType" :orderdetail="orderdetail" v-show="step==3" @onBack="step=2"/>
		<Result @outDrug="sendShipment" @onPrint="SetPrintPage" :rsType.sync="rsType" :orderdetail="orderdetail" v-show="step==3" @onBack="step=2" @onBackIndex="step=1"/>
	</div>
</template>
<script>
@ -85,11 +85,11 @@ export default {
  	},
  	data() {
    	return {
			deviceNum: 'dev_001',
			deviceNum: this.$route.query.deviceNum,//14912202107000001500000000000000
			step: 0,
			curImg: '',
			illustrationMskShow: false,
			socketUrl: '',
			path: "ws://yik.ab-inbev.vip/c/websocket/",
			socket: "",
			mess: [],
@ -101,11 +101,13 @@ export default {
			orderdetail: [],
			rsType: 1,
			imgList: [],
			videoList: []
			videoList: [],
			inCheckBarcode: false,
			orderInfo: ''
    	}
  	},
	created(){
		
		console.log(_.groupBy([{a: 1,},{a: 1,},{a: 2,},{a: 1,},], 'a'))
	},
  	methods: {
		devinfoAdvList(){
@ -155,14 +157,17 @@ export default {
							v.success = false
						})
						this.orderdetail = res.obj.list
						this.orderInfo = res.obj
						this.rsType = res.obj.status==1? 1 : 2
						this.step = 3
					} else {
						this.$toast(res.message || '获取订单失败')
					}
					this.inCheckBarcode = false
                })
                .catch(err=>{
                    console.error(err)
					this.inCheckBarcode = false
                })
        },
		init: function() {
@ -170,12 +175,14 @@ export default {
				return
			}
			this.devinfoAdvList()
			this.path += this.deviceNum + "_T"
			if(!this.socketUrl){
				this.socketUrl = this.path + this.deviceNum + "_T"
			}
			if (typeof(WebSocket) === "undefined") {
				alert("您的浏览器不支持socket")
			} else {
				// 实例化socket
				this.socket = new WebSocket(this.path)
				this.socket = new WebSocket(this.socketUrl)
				// 监听socket连接
				this.socket.onopen = this.open
				// 监听socket错误信息
@ -206,33 +213,36 @@ export default {
			this.mess.push(msg.data); //返回数据信息,包含医保瞳
			var msgobj = JSON.parse(msg.data)
			if (msgobj.type == 'ShipInfo') {
				if (msgobj.mess.indexOf("异常") < 0) {
				var item = this.orderdetail[this.currindex]
				if (msgobj.mess == ( item.layerNo +";"+ item.wayerNo) ) {
					this.updateOrderOutStatus(item.id, 2, msgobj.mess)
					this.currindex++;
					if (this.orderdetail.length > this.currindex) {
						this.$loading(`正在出第${this.currindex+1}个药..`)
						this.nextShipment(this.orderdetail[this.currindex]);
					} else {
						this.$dialog.alert({
							title: '出药提示',
							message: '出药完成',
							confirmButtonText: "返回首页"
						}).then(() => {
							this.step = 1
						});
						this.$toast.clear()
						setTimeout(()=>{
							this.shipComplete()
						}, 200)
					}
				} else {
					this.$toast(msg.data.mess)
					this.updateOrderOutStatus(item.id, 3, msgobj.mess)
					this.shipComplete(msgobj.mess)
				}
			} else if (msgobj.type == 'BarCodeInfo') {
				if (msgobj.mess.indexOf("异常") != -1) {
					this.$toast(msg.data.mess)
					console.log(msg.data.mess)
					this.$toast(msgobj.mess)
					console.log(msgobj.mess)
					return
				}
				if(this.inCheckBarcode || this.step!=2){
					return
				}
				this.checkOrderAndReturn({pickUpNum: msg.data.mess})
				this.checkOrderAndReturn({pickUpNum: msgobj.mess})
			} else if(msgobj.type == 'CardInfo'){
				if (msgobj.mess.indexOf("异常") != -1) {
					this.$toast(msg.data.mess)
					this.$toast(msgobj.mess)
					return
				}
				var arr = msgobj.mess.split("\n");
@ -242,6 +252,14 @@ export default {
					json[tmp[0]] = tmp[1]
				});
				this.checkOrderAndReturn({cardNum: json['卡号']})
			} else if(msgobj.type == 'PrintComplete'){
				this.$dialog.alert({
					title: '',
					message: '打印完成',
					confirmButtonText: "返回首页"
				}).then(() => {
					this.step = 1
				});
			}
		},
		sendReadCard: function() {
@ -259,13 +277,7 @@ export default {
			if (this.orderdetail.length > this.currindex) {
				this.nextShipment(this.orderdetail[this.currindex]);
			} else {
				this.$dialog.alert({
					title: '出药提示',
					message: '出药完成',
					confirmButtonText: "返回首页"
				}).then(() => {
					this.step = 1
				});
				this.shipComplete()
			}
		},
		nextShipment: function(row) {
@ -318,6 +330,111 @@ export default {
			}
			this.socket.send(JSON.stringify(obj));
		},
		SetPrintPage: function() {
			// string type; //text 文本 |line 间隔行|barcode 条码|qrcode 二维码|reset 重置打印机 |nline 走纸【进行【
			// string text;  //文本内容
			// int nLan;//文本编码类型0:GBK   1:UTF-8
			// int nOrgx;//打印的文本位置,各值定义如下:-1 左对齐 -2 居中对齐 -3 右对齐 >=0   在第n点位置开始打印
			// int nWidthTimes;//字符宽度放大的倍数,范围[0,7]
			// int nHeightTimes;// 字符高度放大的倍数,范围[0,7]
			// int FontType;//打印的字体类型,各值定义如下:度值  定义 0:  12*24  1:  9*17
			// int nFontStyle;// 打印的字体类型,各值定义如下:需要合并的把两个值相加得到整数回传 值  定义0x00  正常0x08  加粗0x80    1点下划线0x100   2点下划线0x200 倒置打印 0x400 反显、黑底白字0x1000 每个字符顺时针旋转 90 
			// int nBarcodeType;//打印的条码类型,各值定义如下:值   类型 0x41     UPC-A  0x42     UPC-E 0x43     EAN13  0x44     EAN80x45     CODE39 0x46     ITF0x47     CODABAR0x48     CODE93
			// int  nUnitWidth;// 打印的条码宽度,值范围[1,6]
			// int  nUnitHeight;//打印的条码高度,值范围[1,255]
			// int  FontPosition;//可读字符(HRI)的打印位置,各值定义如下:值    定义 0     不打印1     条码上方2     条码下方 3   条码上方和下方
			// int nWidth;// 二维码的宽度,取值范围[1,6}二维码单元宽度越大,QR码越大。
			// int nVersion;// 二维码的规格,取值范围[0,16],0表示自动计算版本。 二维码码版本越大,能编码的字符就越多,QR码也越大。
			// int nErrlevenl;//二维码纠错等级,取值[1,4]
			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",nLan:0,nOrgx:-2,nWidthTimes:0,nHeightTimes:0,FontType:0,nFontStyle:0},
			];
			var allPrice = 0, allcount = 0
			var obj = _.groupBy(this.orderdetail.concat([]), 'drugCode')
			var list = []
			for(var k in obj){
				var tem = obj[k]
				tem[0].quantity = tem.length
				list.push(tem[0])
				tem.forEach(v=>{
					allPrice += v.price
					allcount += 1
				})
			}
			list.forEach(v=>{
				printcon.push({
					type:"text", text: (v.drugName)+"\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
				})
				printcon.push({type:"line"})
			})
			var {date, phone, num, remark, time, community, qrCodeContent} = 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
			})
			printcon.push({type:"text", text:"--------------------------------\n",nLan:0,nOrgx:-2,nWidthTimes:0,nHeightTimes:0,FontType:0,nFontStyle:0})
			printcon.push({
				type:"text", text: `商家名称:${community}\n客服电话:${phone}\n药柜编码:${this.deviceNum}\n销售单号:${num}\n取药日期:${date}\n取药时间:${time}\n`,nLan:0,nOrgx:-1,nWidthTimes:0,nHeightTimes:0,FontType:0,nFontStyle:0
			})
			
			printcon.push({type:"text", text:"--------------------------------\n",nLan:0,nOrgx:-2,nWidthTimes:0,nHeightTimes:0,FontType:0,nFontStyle:0})
			if(remark){
				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})
			}
			
			printcon.push({type:"nline"})
			printcon.push({type:"nline"})
			printcon.push({type:"nline"})
			printcon.push({type:"nline"})
			printcon.push({type:"nline"})
			var obj = {
				type: "PrintPage",
				mess: JSON.stringify(printcon),
			}
			this.socket.send(JSON.stringify(obj));
		},
		updateOrderOutStatus(shipmentLogId, status, msg){
			var p = {
				shipmentLogId,
				status,
				msg: msg || ''
			}
			console.log('updateOrderOutStatus', p)
			medicineAbinetApi
				.updateOrderOutStatus(p)
				.then(res=>{
					console.log('updateOrderOutStatus', res)
				})
				.catch(err=>{
					console.error(err)
				})
		},
		shipComplete(msg){
			this.$toast.clear()
			if(msg){
				this.$dialog.alert({
					title: '',
					message: '出药异常中断,请联系管理员',
					confirmButtonText: "返回首页"
				}).then(() => {
					this.step = 1
				});
				return
			}
			this.rsType = 4
		}
    },
	destroyed() {
		this.forceClose = true

+ 9 - 6
mini-pro-web/src/views/order/detail/components/DrugList.vue

@ -1,22 +1,23 @@
<template>
    <div class='order-detail-drug-list'>
        <div v-for="i in 20" :key="i" class="item kitbox  plr15 ptb10 break-all bgc-fff fs-14 bb-e1e1e1">
        <div v-for="(item, i) in list" :key="i" class="item kitbox  plr15 ptb10 break-all bgc-fff fs-14 bb-e1e1e1">
            <div class="">
                <van-image
                    radius="5px"
                    src="https://img01.yzcdn.cn/vant/cat.jpeg"
                    :src="require('@/assets/images/drug_default.png')"
                />
            </div>
            <div class="pl10 box-flex-1">
                <div class="ellipsis">J氯化钠注射液(90mg)J氯化钠注射液(90mg)J氯化钠注射液(90mg)</div>
                <div class="pt8">¥25.78</div>
                <div class="ellipsis">{{item.goodsName}}</div>
                <div class="pt8">¥{{getMoney(item)}}</div>
            </div>
            <div class="kitbox box-v-middle pl15">x4</div>
            <div class="kitbox box-v-middle pl15">x{{item.quantity}}</div>
        </div>
    </div>
</template>
<script>
export default{
    props: ['list'],
    data(){
        return {
            
@ -26,7 +27,9 @@ export default{
        
    },
    methods:{
        
        getMoney(item){
            return (Number(item.price) * Number(item.quantity)).toFixed(2)
        }
    },
}
</script>

+ 7 - 6
mini-pro-web/src/views/order/detail/components/LogList.vue

@ -1,18 +1,19 @@
<template>
    <div class='order-detail-log-list'>
        <div v-for="i in 20" :key="i" class="item lh26 plr15 ptb10 break-all bgc-fff fs-14 bb-e1e1e1">
            <div>出货货道: <span>0号柜4行36列</span></div>
        <div v-for="(item, i) in list" :key="i" class="item lh26 plr15 ptb10 break-all bgc-fff fs-14 bb-e1e1e1">
            <div>出货货道: <span>{{item.layerNo}}行{{item.wayerNo}}列</span></div>
            <div class="kitbox">
                <div class="box-flex-1">商品名称: <span>J氯化钠注射液(90mg)</span></div>
                <div>x4</div>
                <div class="box-flex-1">商品名称: <span>{{item.drugName}}</span></div>
                <div>x1</div>
            </div>
            <div>设备日志: <span>(无异常)红外检测出货成功</span></div>
            <div>设备名称: <span>众健信联1号</span></div>
            <div>设备日志: <span>{{item.status==2? '(无异常)出货成功' : item.description}}</span></div>
            <div>设备名称: <span>{{item.equName}}</span></div>
        </div>
    </div>
</template>
<script>
export default{
    props: ['list'],
    data(){
        return {
            

+ 59 - 16
mini-pro-web/src/views/order/detail/index.vue

@ -1,50 +1,51 @@
<template>
    <div class='order-detail'>
    <div class='order-detail' v-if="info">
        <div class="lh26 plr15 ptb10 bgc-fff fs-14">
            <div class="row">
                <div>处方号</div>
                <div>D2021090811040440280122</div>
                <div>{{info.prescribeNum}}</div>
            </div>
            <div class="row">
                <div>订单类型</div>
                <div>取货订单</div>
                <div>{{info.orderTypeName}}</div>
            </div>
            <div class="row">
                <div>开方时间</div>
                <div>2021-09-08 11:04</div>
                <div>{{formatDatetime(info.prescribeTime)}}</div>
            </div>
            <div class="row">
                <div>订单金额</div>
                <div>¥0</div>
                <div>¥{{info.amount}}</div>
            </div>
            <div class="row">
                <div>社保扣款</div>
                <div>¥264.66</div>
                <div>¥{{info.socialinsurPayment}}</div>
            </div>
            <div class="row">
                <div>订单状态</div>
                <div>待取货</div>
                <div>{{info.orderStateName}}</div>
            </div>
            <div class="row">
                <div>存取信息</div>
                <div>取药码 43057502</div>
                <div>取药码 {{info.pickUpNum}}</div>
            </div>
        </div>
        <van-tabs class="mt10" v-model="active" sticky>
            <van-tab title="药品详情">
                <DrugList/>
                <DrugList :list="info.drugList"/>
            </van-tab>
            <van-tab title="出货日志">
                <LogList/>
            <van-tab v-if="info.outList&&info.outList.length" title="出货日志">
                <LogList :list="info.outList"/>
            </van-tab>
            <van-tab title="设备信息">
                <DeviceInfo/>
            <van-tab title="设备信息" v-if="info.device">
                <DeviceInfo :data="info.device"/>
            </van-tab>
        </van-tabs>
    </div>
</template>
<script>
import medicineAbinetApi from '@/api/api-medicineAbinet'
import DeviceInfo from './components/DeviceInfo'
import LogList from './components/LogList'
import DrugList from './components/DrugList'
@ -57,14 +58,56 @@ export default{
    },
    data(){
        return {
            
            id: this.$route.query.id,
            info: ''
        }
    },
    created() {
        
        this.getOrderDetailById()
    },
    methods:{
        
        getOrderDetailById(){
            this.$loading('加载中..')
            let p = {
                orderId: this.id
            }
            medicineAbinetApi
                .getOrderDetailById(p)
                .then(res=>{
                    this.$toast.clear()
                    console.log('getOrderDetailById', res)
                    if(res.status == 200){
                        this.info = res.obj
                    } 
                })
                .catch(err=>{
                    console.error(err)
                })
        }
        // getOrderDetailById(){
        //     if(!this.id){
        //         return
        //     }
        //     this.loadingForm = true
        //     console.log('this.id.id', this.id)
        //     medicineAbinetApi
        //         .getOrderDetailById({
        //             orderId: this.id
        //         })
        //         .then(res => {
        //             if(res.obj.drugList){
        //                 res.obj.drugList.forEach(v => {
        //                     v.total = ((v.price * v.drugNum) || 0).toFixed(2)
        //                 });
        //             }
        //             this.model = _.assign(this.model, res.obj)
        //             console.log('getOrderDetailById', this.model)
        //             this.loadingForm = false
        //         }).catch(err=>{
        //             this.loadingForm = false
        //             console.error(err)
        //         })
        // },
    },
}
</script>

+ 14 - 12
mini-pro-web/src/views/order/list.vue

@ -5,15 +5,15 @@
                <div @click="pickDate(1)" class="date-item">{{$moment(startDate).format('YYYY-MM-DD')}}</div>
                <div class="ptb5 plr10">至</div>
                <div @click="pickDate(2)" class="date-item">{{$moment(endDate).format('YYYY-MM-DD')}}</div>
                <div class="pl15 pt2">
                <div class="pl15 pt2 box-flex-1 tr pr15">
                    <van-button @click="onSearch" type="info" size="mini">搜索</van-button>
                </div>
                <div class="fs-25 pr15 tr box-flex-1 pt3 c-pr">
                <!-- <div class="fs-25 pr15 tr box-flex-1 pt3 c-pr">
                    <van-dropdown-menu>
                        <van-dropdown-item ref="dropdown" v-model="value1" :options="option1" />
                    </van-dropdown-menu>
                    <van-icon class="block" @click.stop="$refs.dropdown.toggle()" name="filter-o" />
                </div>
                </div> -->
            </div>
        </van-sticky>
        <CustomList 
@ -21,18 +21,18 @@
            :searchfun="false"
			@onLoad="onLoad">
			<div class="list plr15">
                <div v-for="(item, i) in list" :key="i" class="item plr15 c-333 fs-14">
                <div @click="gotoUrl('./detail', {id: item.id})" v-for="(item, i) in list" :key="i" class="item plr15 c-333 fs-14">
                    <div class="kitbox ptb10 bb-e1e1e1">
                        <div class="box-flex-1 fs-14">D2021090811040440280122</div>
                        <div class="">待取货</div>
                        <!-- <div class="c-17b3ec">取货成功</div> -->
                        <div class="box-flex-1 fs-14">{{item.prescribeNum}}</div>
                        <div v-if="item.sellState==1" class="c-17b3ec">{{item.sellStatusName}}</div>
                        <div v-else class="" >{{item.sellStatusName}}</div>
                    </div>
                    <div class="lh20 ptb10">
                        <div>订单类型:取货订单</div>
                        <div>开方时间:2021-09-08 11:04</div>
                        <div>存取信息:取药码 43057502</div>
                        <div>订单类型:{{item.orderTypeName}}</div>
                        <div>开方时间:{{formatDatetime(item.prescribeTime)}}</div>
                        <!-- <div>存取信息:取药码 {{item.pickUpNum}}</div> -->
                    </div>
                    <div class="ptb10 bt-e1e1e1">¥120</div>
                    <div class="ptb10 bt-e1e1e1">¥{{item.amount}}</div>
                </div>
            </div>
		</CustomList>
@ -63,7 +63,7 @@ export default{
            currentDate: new Date(),
            maxDate: new Date(),
            datePickerShow: false,
            startDate: new Date(),
            startDate: this.$moment().subtract(30, 'days'),
            endDate: new Date(),
            pickType: 1,
@ -82,6 +82,7 @@ export default{
            var p = {
				startTime: startDate? this.$moment(startDate).format('YYYY-MM-DD 00:00:00') : '',
				endTime: endDate? this.$moment(endDate).format('YYYY-MM-DD 23:59:59') : '',
                userId: this.user.id,
				// content: searchForm.content,
				// community: len? this.community[len-1] : '',
				// sellState: searchForm.sellStatus,
@ -92,6 +93,7 @@ export default{
            medicineAbinetApi
                .orderList(p)
                .then(res=>{
                    console.log('orderList', res)
                    if(res.status == 200){
                        var list = res.detailModelList
                        this.list = page==1? list : this.list.concat(list)

+ 52 - 11
mini-pro-web/src/views/replenishment/device/detail.vue

@ -2,22 +2,26 @@
    <div class='replenishment-device-detail'>
        <div class="kitbox plr15 ptb10">
            <div class="box-flex-1 box-v-middle fs-14">从上往下数</div>
            <div><van-button type="info" size="small">点击设置商品</van-button></div>
            <div><van-button @click="gotoUrl('/replenishment/start/deviceDetail', {deviceId: deviceId})" type="info" size="small">点击设置商品</van-button></div>
        </div>
        <div class="list ">
            <div v-for="i in 15" :key="i" class="item plr15 bt-e1e1e1 bb-e1e1e1">
            <div v-for="(item, i) in list" :key="i" class="item plr15 bt-e1e1e1 bb-e1e1e1">
                <div class="pt10">第1层</div>
                <div class="item-list ptb10">
                    <div v-for="j in 20" :key="j" :class="'pitem-full'" class="pitem">
                        <div :style="'height: 25%'" class="pitem-bg"></div>
                    <div v-for="(data, k) in item.list" :key="k" :class="data.cargoCapacity==data.qty?'pitem-full':''" class="pitem">
                        <div :style="'height: '+ (formatRate(data)) +'%'" class="pitem-bg"></div>
                        <div class="pitem-inner">
                            <div class="kitbox ">
                                <div class="box-flex-1">1号位</div>
                                <div>0/5</div>
                                <div class="box-flex-1">{{k+1}}号位</div>
                                <div>{{data.qty}}/{{data.cargoCapacity}}</div>
                            </div>
                            <div class="ellipsis tc pt8">J氯化钠注J氯化钠注</div>
                            <div class="tc pt5">¥27.00</div>
                            <template v-if="data.shelfStatus==1">
                                <div class="ellipsis tc pt8">{{data.drugName}}</div>
                                <div class="tc pt5">¥{{data.price}}</div>
                            </template>
                            <div v-else class="ellipsis tc pt8 ">未设商品</div>
                        </div>
                    </div>
                </div>
@ -26,18 +30,50 @@
    </div>
</template>
<script>
import medicineAbinetApi from '@/api/api-medicineAbinet'
export default{
    name: 'replenishmentDeviceDetail',
    data(){
        return {
            
            deviceId: this.$route.query.deviceId,
            list: []
        }
    },
    created() {
        
        this.findMediicinecabinetInventoryByDeviceId()
    },
    methods:{
        
        findMediicinecabinetInventoryByDeviceId(){
            this.$loading('加载中..')
            let p = {
                deviceId: this.deviceId
            }
            console.log('params', p)
            medicineAbinetApi
                .findMediicinecabinetInventoryByDeviceId(p)
                .then(res=>{
                    console.log('findMediicinecabinetInventoryByDeviceId', res)
                    this.$toast.clear()
                    if(res.detailModelList && res.detailModelList.length){
                        var list = _.map(res.detailModelList, v=>{
                            var key = _.keys(v)[0]
                            return {
                                index: key,
                                list: v[key],
                            }
                        })
                        list = _.sortBy(list, 'index')
                        this.list = list
                        console.log(list, this.curItem)
                    }
                })
                .catch(err=>{
                    console.error(err)
                })
        },
        formatRate(data){
            return (data.qty||0) / (data.cargoCapacity||5) * 100
        },
    },
}
</script>
@ -51,6 +87,10 @@ export default{
                overflow-y: scroll;
                width: 100%;
                display: flex;
                // ::v-deep .components-product-item{
                //     overflow: initial;
                //     width: 100px;
                // }
                .pitem{
                    width: 100px;
                    height: 80px;
@ -67,6 +107,7 @@ export default{
                        margin-left: 0;
                    }
                    .pitem-inner{
                        width: 80px;
                        position: relative;
                        z-index: 1;
                        background: transparent;

+ 45 - 57
mini-pro-web/src/views/replenishment/device/list.vue

@ -4,20 +4,20 @@
			ref="customList"
			@onLoad="onLoad">
			<div class="list plr15 pt10">
                <div @click="gotoUrl('/replenishment/device/detail')" v-for="(item, i) in list" :key="i" class="item bgc-fff plr15 c-333 fs-14">
                <div @click="gotoUrl('/replenishment/device/detail', {deviceId: item.id})" v-for="(item, i) in list" :key="i" class="item bgc-fff plr15 c-333 fs-14">
                    <div class=" ptb10 kitbox">
                        <div class="box-flex-1 fs-14">众健信联1号</div>
                        <div class="box-flex-1 fs-14">{{item.equName}}</div>
                        <div class="">
                            <van-tag type="success">在线</van-tag>
                            <van-tag type="success" class="ml5">在售</van-tag>
                            <van-tag :type="item.networkStatus==1? 'success' : 'danger'">{{item.networkStatusName}}</van-tag>
                            <van-tag :type="item.saleStatus==1? 'success' : 'danger'" class="ml5">{{item.saleStatusName}}</van-tag>
                        </div>
                    </div>
                    <div class="lh20 ptb10 kitbox">
                        <div class="box-flex-1">
                            <div>药柜容量:1156</div>
                            <div>商品库存:340.00</div>
                            <div>设备所属:禾山街道社区卫生服务中心</div>
                            <div>设备编号:149122021070000</div>
                            <div>药柜容量:{{item.capacity}}</div>
                            <div>商品库存:{{item.totalQty}}</div>
                            <div>设备所属:{{item.community}}</div>
                            <div>设备编号:{{item.equNum}}</div>
                        </div>
                        <div class="fs-20 c-pr">
                            <van-icon name="arrow" />
@ -29,58 +29,46 @@
    </div>
</template>
<script>
    export default{
        name: 'replenishmentDeviceList',
        data(){
            return {
                list: [],
import medicineAbinetApi from '@/api/api-medicineAbinet'
export default{
    name: 'replenishmentDeviceList',
    data(){
        return {
            list: [],
        }
    },
    created() {
        
    },
    methods:{
        onLoad({page, pageSize, searchText}){
            var p = {
                content: searchText,
                userId: this.user.id,
                page: 1,
                size: pageSize
            }
        },
        created() {
            
        },
        methods:{
            onLoad({page, pageSize, searchText}){
                setTimeout(()=>{
                    for(var i=0; i<pageSize; i++){
                        this.list.push((page-1)*pageSize + i)
            console.log('params', p)
            medicineAbinetApi.getDeviceListWithUserId(p)
                .then(res=>{
                    console.log('getDeviceListWithUserId', res)
                    if(res.status == 200){
                        var list = res.detailModelList
                        this.list = page==1? list : this.list.concat(list)
                        debugger
                        this.$refs.customList.endLoad(res.totalPage<=page, this.list.length)
                    } else {
                        this.list = []
                        this.$refs.customList.endLoad(false, true)
                    }
                    console.log(this.list)
                    debugger
                    this.$refs.customList.endLoad(page==5, this.list.length)
                }, 1000)
                return
                var that = this, 
                    params = {
                        orgCode: this.$store.getters.orgCode,
                        doctorNameKey: searchText,
                        dept: this.routerParam.dept,
                        diseaseKey: this.routerParam.disease,
                        page: page,
                        pagesize: pageSize
                    };
                
                zhuanjiazixunApi
                    .findDoctorByHospitalAndDiseaseAndDept(params)
                    .then(res=>{
                        if(res.status == 200){
                            var list = res.detailModelList.map(item=>{
                                var data = item
                                data.photo = this.$root.setDocPhoto(data.photo)
                                return data
                            })
                            this.list = page==1? list : this.list.concat(list)
                            this.$refs.customList.endLoad(!res.detailModelList || res.detailModelList.length==0, this.list.length)
                        } else {
                            this.$refs.customList[this.active].endLoad(false, true)
                        }
                    }).catch(err=>{
                        console.error(err)
                        this.$refs.customList[this.active].endLoad(false, true)
                    })
            },
                }).catch(err=>{
                    console.error(err)
                    this.list = []
                    this.$refs.customList.endLoad(false, true)
                })
        },
    }
    },
}
</script>
<style lang='scss' scoped>
.replenishment-device-list{

+ 27 - 9
mini-pro-web/src/views/replenishment/index.vue

@ -6,7 +6,7 @@
			</div>
			<div class="kitbox  pt10">
				<div class="box-flex-1">
					<span class="fs-23">0</span>
					<span class="fs-23">{{countObj.total}}</span>
					<span class="ml5">台</span>
				</div>
				<div class="">
@ -15,8 +15,8 @@
				</div>
			</div>
			<div class="pt10 pb10">
				<span>在线:0台</span> 
				<span class="ml10">离线:0台</span>
				<span>在线:{{countObj.onlineTotal}}台</span> 
				<span class="ml10">离线:{{countObj.total - countObj.onlineTotal}}台</span>
			</div>
		</div>
@ -26,7 +26,7 @@
				<div class="fs-16 f-bold">缺货设备  |  实时</div>
			</div>
			<div class="  pt10">
				<span class="fs-23">0</span>
				<span class="fs-23">{{countObj.outCount}}</span>
				<span class="ml5">台</span>
			</div>
			<div class="pt10 ">
@ -64,6 +64,7 @@
	</div>
</template>
<script>
import medicineAbinetApi from '@/api/api-medicineAbinet'
export default {
	name: "index",
	components: {
@ -73,17 +74,34 @@ export default {
    	return {
			searchTypeShow: false,
            searchType: "今日",
			options: ['今日', '7天内', '30天内']
			options: ['今日', '7天内', '30天内'],
			countObj: {
				"total": 0,							//总的在线数
				"saleTotal": 0,						//在售数
				"onlineRate": 0,					//在线率
				"onlineTotal": 0,						//在线设备数
				"outCount": 0 						//缺货设备数
			}
			
    	}
  	},
	created(){
		
		this.countall()
	},
  	mounted() {
  	},
  	methods: {
		countall(){
			medicineAbinetApi
				.countAllDevice({
					userId: this.user.id
				})
				.then(res=>{
					console.log('countall', res)
					this.countObj = _.assign(this.countObj, res.obj) 
				})
				.catch(err=>{
					console.error(err)
				})
		},
		search(){
			
		}

+ 38 - 17
mini-pro-web/src/views/replenishment/picking/detail.vue

@ -20,7 +20,8 @@ export default{
        return {
            entity: '',
            drugList: [],
            idUp: this.$route.query.idUp
            idUp: this.$route.query.idUp,
            idOut: this.$route.query.idOut,
        }
    },
    created() {
@ -29,23 +30,43 @@ export default{
    methods:{
        findById(){
            this.$loading('加载中..')
            let p = {
                idUp: this.idUp
            if(this.idUp){
                let p = {
                    idUp: this.idUp
                }
                medicineAbinetApi
                    .getUpDetailById(p)
                    .then(res=>{
                        this.$toast.clear()
                        console.log('getUpDetailById', res)
                        if(res.status == 200){
                            this.drugList = res.obj.list
                        } else {
                            this.drugList = []
                        }
                    })
                    .catch(err=>{
                        console.error(err)
                    })
            } else {
                let p = {
                    idOut: this.idOut
                }
                medicineAbinetApi
                    .getOutDetailById(p)
                    .then(res=>{
                        this.$toast.clear()
                        console.log('getOutDetailById', res)
                        if(res.status == 200){
                            this.drugList = res.obj.list
                        } else {
                            this.drugList = []
                        }
                    })
                    .catch(err=>{
                        console.error(err)
                    })
            }
            medicineAbinetApi
                .getUpDetailById(p)
                .then(res=>{
                    this.$toast.clear()
                    console.log('getUpDetailById', res)
                    if(res.status == 200){
                        this.drugList = res.obj.list
                    } else {
                        this.drugList = []
                    }
                })
                .catch(err=>{
                    console.error(err)
                })
        }
    },
}

+ 35 - 9
mini-pro-web/src/views/replenishment/picking/list.vue

@ -2,7 +2,7 @@
    <div class='replenishment-picking-list'>
        <van-sticky>
            <van-tabs v-model="active" @change="onChange">
                <van-tab title="全部"></van-tab>
                <!-- <van-tab title="全部"></van-tab> -->
                <van-tab title="备货中"></van-tab>
                <van-tab title="">
                    <div slot="title">
@ -11,7 +11,7 @@
                    </div>
                </van-tab>
                <van-tab title="已领料"></van-tab>
                <van-tab title="已驳回"></van-tab>
                <!-- <van-tab title="已驳回"></van-tab> -->
            </van-tabs>
        </van-sticky>
        <CustomList 
@ -19,14 +19,14 @@
            :searchfun="false"
			@onLoad="onLoad">
			<div class="list plr15 pt10">
                <div @click="gotoUrl('./detail', {idUp: item.id})" v-for="(item, i) in list" :key="i" class="item bgc-fff plr15 c-333 fs-14">
                <div @click="gotoDetail(item)" v-for="(item, i) in list" :key="i" class="item bgc-fff plr15 c-333 fs-14">
                    <div class=" ptb10 kitbox bb-e1e1e1">
                        <div class="box-flex-1 fs-14">备货单号:{{item.docNum}}</div>
                        <div class="">
                            <span class="c-ff9526">备货中</span>
                            <!-- <span class="c-17b3ec">待领料</span>
                            <span class="c-999">已领料</span>
                            <span class="c-ff5e6c">已驳回</span> -->
                            <span v-if="active===0" class="c-ff9526">备货中</span>
                            <span v-else-if="active===1" class="c-17b3ec">待领料</span>
                            <span v-else-if="active===2" class="c-999">已领料</span>
                            <!-- <span class="c-ff5e6c">已驳回</span> -->
                        </div>
                    </div>
                    <div class="lh20 ptb10 kitbox">
@ -83,13 +83,24 @@ export default{
				// content: searchForm.content,
				// community: len? this.community[len-1] : '',
				// sellState: searchForm.sellStatus,
                userId: this.user.id,
                page: page,
                size: pageSize
            }
            var func;
            if(this.active === 0){
                func = medicineAbinetApi.replenishList
            } else if(this.active === 1){
                p.receiveState = 0
                func = medicineAbinetApi.outboundOrderList
            } else if(this.active === 2){
                p.receiveState = 1
                func = medicineAbinetApi.outboundOrderList
            } 
            console.log('params', p)
            medicineAbinetApi
                .replenishList(p)
            func(p)
                .then(res=>{
                    console.log('replenishList', res)
                    if(res.status == 200){
                        var list = res.detailModelList
                        this.list = page==1? list : this.list.concat(list)
@ -105,7 +116,19 @@ export default{
                })
        },
        onChange(){
            this.list = []
            this.$refs.customList.refresh(true)
        },
        gotoDetail(item){
            var query = {
            }
            if(this.active===0){
                query.idUp = item.id
            } else {
                query.idOut = item.id
            }
            this.gotoUrl('./detail', query)
        }
    },
}
@ -155,6 +178,9 @@ export default{
            }
        }
    }  
    .custom-list{
        height: calc(100vh - 50px);
    }
}
</style>

+ 58 - 11
mini-pro-web/src/views/replenishment/start/components/SetStockDialog.vue

@ -4,54 +4,101 @@
            <div class="plr15 ptb10 c-pr" style="width: 80vw">
                <div class="close fs-20"><van-icon @click="emitValue(false)" name="close" /></div>
                <div class="tc fs-14 c-333">
                    <span>{{title}}</span>
                    <span>{{bussiness==1? '修改容量' : bussiness==2? '矫正库存' : bussiness==4||bussiness==5? '设置库存' : ''}}</span>
                </div>
                <template v-if="bussiness==1">
                <template v-if="bussiness==1||bussiness==4||bussiness==5">
                    <div class="tc pt30 pb20"><van-stepper v-model="stock" min="1" /></div>
                </template>
                <div class="tc" v-else>
                    <div class="pt10">
                        <van-image
                            radius="5px"
                            src="https://img01.yzcdn.cn/vant/cat.jpeg"
                            :src="require('@/assets/images/drug_default.png')"
                        />
                    </div>
                    <div class="pt10 c-333 fs-16">J氯化钠注射液(90mg)</div>
                    <div class="pt10 c-999">软件显示库存:5</div>
                    <div class="pt10 c-333 fs-16">{{data.drugName}}</div>
                    <div class="pt10 c-999">软件显示库存:{{data.qty}}</div>
                    <div class="pt10 pb20 ipt plr50">
                        <van-field v-model="stock" label="" type="digit" placeholder=" 请填写实际库存" />
                    </div>
                </div>
                <div class="ptb10">
                    <van-button type="info" size="small" block>确认</van-button>
                    <van-button type="info" @click="confirm" size="small" block>确认</van-button>
                </div>
            </div>
        </van-popup>
    </div>
</template>
<script>
import medicineAbinetApi from '@/api/api-medicineAbinet'
export default{
    props:{
        title:{
            default: '设置库存'
        },
        value: {},
        bussiness: {
            default: 1
        }
            default: 1 //1修改容量 2矫正库存 4设置库存 5选择商品后 设置库存
        },
        data: {
            default: function(){
                return {}
            }
        },
        trackId: {default: ""},
        drugId: {default: ""}
    },
    data(){
        return {
            stock: 1
        }
    },
    watch:{
        value:{
            handler(){
                this.stock = this.bussiness==1? this.data.cargoCapacity : this.data.qty 
            },
            immediate: true
        }
    },
    created() {
        
    },
    methods:{
        confirm(){
            if(this.trackId){
                this.updateMediicinecabineInventory()
                return
            }
            this.$emit('onConfirm', this.stock)
        },
        emitValue(show){
            this.$emit('input', show)
        },
        updateMediicinecabineInventory(data){
            this.$loading('保存中..')
            let p = {
                id: this.trackId,
                drugId: this.drugId,
                qty: this.stock
            }
            
            console.log('params', p)
            medicineAbinetApi
                .updateMediicinecabineInventory(p)
                .then(res=>{
                    console.log('updateMediicinecabineInventory', res)
                    this.setStockShow = false
                    this.$toast.clear()
                    this.$emitRefreshPage('replenishmentStartDeviceDetail')
                    this.$router.replace({
                        path: '/replenishment/start/productDetail',
                        query: {
                            id: this.trackId
                        }
                    })
                })
                .catch(err=>{
                    console.error(err)
                })
        },
    },
}
</script>

+ 107 - 45
mini-pro-web/src/views/replenishment/start/deviceDetail.vue

@ -1,61 +1,63 @@
<template>
    <div class='replenishment-start-device-detail fs-14'>
        <div class="bgc-17b3ec c-fff">
            <van-row>
                <van-col span="6">
                    <div class="tc pt15 pb10">
                        <div class="fs-20">1156</div>
                        <div class="fs-12 pt5">库存容量</div>
                    </div>
                </van-col>
                <van-col span="6">
                    <div class="tc pt15 pb10">
                        <div class="fs-20">
                            <span>156</span>
                            <span class="fs-12">/29%</span>
        <van-sticky>
            <div class="bgc-17b3ec c-fff">
                <div class="pt10 plr15 ellipsis_1">当前货柜:{{deviceInfo.equName}}</div>
                <van-row>
                    <van-col span="6">
                        <div class="tc pt10 pb10">
                            <div class="fs-20">{{deviceInfo.capacity||0}}</div>
                            <div class="fs-12 pt5">设备容量</div>
                        </div>
                        <div class="fs-12 pt5">在架库存</div>
                    </div>
                </van-col>
                <van-col span="6">
                    <div class="tc pt15 pb10">
                        <div class="fs-20">1156</div>
                        <div class="fs-12 pt5">缺货库存</div>
                    </div>
                </van-col>
                <van-col span="6">
                    <div class="tc pt15 pb10">
                        <div class="fs-20">1156</div>
                        <div class="fs-12 pt5">预警货道</div>
                    </div>
                </van-col>
            </van-row>
            <div class="kitbox fs-12 plr10 pb5">
                <div class="box-flex-1">当前:0号柜</div>
                <div class="box-flex-1 ml5"> 共:6层</div>
                <div class="box-flex-1 ml5">总货道数:240</div>
                <div class="box-flex-1 ml5">故障货道:18</div>
                <div class="box-flex-1 ml5">关闭货道:0</div>
                    </van-col>
                    <van-col span="6">
                        <div class="tc pt10 pb10">
                            <div class="fs-20">
                                <span>{{deviceInfo.totalQty||0}}</span>
                                <span class="fs-12">/{{(1 - (deviceInfo.idleRate||1)) * 100}}%</span>
                            </div>
                            <div class="fs-12 pt5">在架库存</div>
                        </div>
                    </van-col>
                    <van-col span="6">
                        <div class="tc pt10 pb10">
                            <div class="fs-20">0</div>
                            <div class="fs-12 pt5">缺货库存</div>
                        </div>
                    </van-col>
                    <van-col span="6">
                        <div class="tc pt10 pb10">
                            <div class="fs-20">0</div>
                            <div class="fs-12 pt5">预警货道</div>
                        </div>
                    </van-col>
                </van-row>
                <div class="kitbox fs-12 plr10 pb5">
                    <!-- <div class="box-flex-1">当前:0号柜</div> -->
                    <div class="box-flex-1"> 共:{{deviceInfo.layer}}层</div>
                    <div class="box-flex-1 ml5">总货道:{{deviceInfo.aisles}}</div>
                    <div class="box-flex-1 ml5">故障:0</div>
                    <div class="box-flex-1 ml5">关闭:0</div>
                </div>
            </div>
        </div>
        </van-sticky>
        <div class="fs-14 pl15 ptb10 bgc-fff">从上往下数</div>
        <div class="kitbox">
            <div>
            <div class="left-list">
                <van-sidebar v-model="activeKey">
                    <van-sidebar-item title="一层"  />
                    <van-sidebar-item title="二层"  />
                    <van-sidebar-item title="三层"  />
                    <van-sidebar-item v-for="(item, i) in list" :key="i" :title="(i+1)+'层'"  />
                </van-sidebar>
            </div>
            <div class="list box-flex-1 bgc-fff">
                <div class="item" v-for="i in 5" :key="i">
                    <ProductItem/>
                <div class="item" v-for="(item, k) in curItem.list" :key="k">
                    <ProductItem :data="item" :index="k"/>
                </div>
            </div>
        </div>
    </div>
</template>
<script>
import medicineAbinetApi from '@/api/api-medicineAbinet'
import ProductItem from '@/components/ProductItem'
export default{
    name: 'replenishmentStartDeviceDetail',
@ -64,14 +66,71 @@ export default{
    },
    data(){
        return {
            activeKey: 0
            deviceInfo: '',
            deviceId: this.$route.query.deviceId,
            list: [],
            activeKey: 0,
            curItem: []
        }
    },
    watch:{
        activeKey(n){
            this.curItem = this.list[n]
        }
    },
    created() {
        
        this.findMediicinecabinetInventoryByDeviceId()
        this.findDeviceById()
    },
    methods:{
        
        $refreshData(){
            this.findMediicinecabinetInventoryByDeviceId()
        },
        findMediicinecabinetInventoryByDeviceId(){
            this.$loading('加载中..')
            let p = {
                deviceId: this.deviceId
            }
            console.log('params', p)
            medicineAbinetApi
                .findMediicinecabinetInventoryByDeviceId(p)
                .then(res=>{
                    console.log('findMediicinecabinetInventoryByDeviceId', res)
                    this.$toast.clear()
                    if(res.detailModelList && res.detailModelList.length){
                        var list = _.map(res.detailModelList, v=>{
                            var key = _.keys(v)[0]
                            return {
                                index: key,
                                list: v[key],
                            }
                        })
                        list = _.sortBy(list, 'index')
                        this.list = list
                        this.curItem = this.list[0]
                        console.log(list, this.curItem)
                    }
                })
                .catch(err=>{
                    console.error(err)
                })
        },
        findDeviceById(){
            let p = {
                deviceId: this.deviceId
            }
            console.log('params', p)
            medicineAbinetApi
                .findDeviceById(p)
                .then(res=>{
                    console.log('findDeviceById', res)
                    this.$toast.clear()
                    this.deviceInfo = res.obj.device
                })
                .catch(err=>{
                    console.error(err)
                })
        },
    },
}
</script>
@ -92,5 +151,8 @@ export default{
            }
        }
    }
    .left-list{
        height: calc(100vh - 153px);
    }
}
</style>

+ 10 - 8
mini-pro-web/src/views/replenishment/start/deviceList.vue

@ -26,9 +26,8 @@
                            <div>上次补货时间:</div>
                        </div>
                    </div>
                    <div class="operate kitbox pt10 pb10">
                        <div class=" pr10"><van-button type="info" size="small" block  plain>标记已补货</van-button></div>
                        <div class="pl10"><van-button @click="gotoUrl('./deviceDetail')" type="info" size="small" block>开始补货</van-button></div>
                    <div class="operate pt10 pb10">
                        <van-button round block @click="gotoUrl('./deviceDetail', {deviceId: item.id})" type="info" size="small" >开始补货</van-button>
                    </div>
                </div>
            </div>
@ -58,23 +57,26 @@ export default{
    methods:{
        onLoad({page, pageSize, searchText}){
            var p = {
                content: searchText,
                userId: this.user.id,
                page: page,
                size: pageSize
            }
            var func
            if(this.active === 0){
                func = medicineAbinetApi.getOutOfStockDeviceList
                func = medicineAbinetApi.getOutOfStockDeviceListByUserId
            } else {
                func = medicineAbinetApi.getDeviceListWithUserId
            }
            console.log('params', p)
            func(p)
                .then(res=>{
                    console.log('getOutOfStockDeviceList', res)
                    console.log('getOutOfStockDeviceListByUserId', res)
                    if(res.status == 200){
                        debugger
                        var list = res.detailModelList
                        this.list = page==1? list : this.list.concat(list)
                        this.$refs.customList.endLoad(this.active===0 || !list || !list.length, this.list.length)
                        this.$refs.customList.endLoad(res.totalPage<=page || this.active===0, this.list.length)
                    } else {
                        this.list = []
                        this.$refs.customList.endLoad(false, true)
@ -111,7 +113,7 @@ export default{
    }   
    .operate{
        >div{
            width: 50%;
            // width: 50%;
        }
    }
}

+ 120 - 15
mini-pro-web/src/views/replenishment/start/productDetail.vue

@ -1,34 +1,39 @@
<template>
    <div class='replenishment-start-product-detail fs-14'>
    <div class='replenishment-start-product-detail fs-14' v-if="info">
        <div class="tc pt50">
            <van-image
                radius="5px"
                src="https://img01.yzcdn.cn/vant/cat.jpeg"
                :src="require('@/assets/images/drug_default.png')"
            />
        </div>
        <div class="c-17b3ec tc pt20">更换商品</div>
        <div class="c-17b3ec tc pt20" @click="gotoUrl('/drugList')">更换商品</div>
        <div class=" tc pt20">
            <span class="mr10">现有数量:5 </span>
            <span class="ml10">货道容量:5 </span>
            <span class="mr10">现有数量:{{info.qty}} </span>
            <span class="ml10">货道容量:{{info.cargoCapacity}} </span>
        </div>
        <div class="pt20">
            <div class="progress">
                <div class="bar"></div>
                <div class="text">21/500</div>
                <div class="bar" :style="'width:'+ (rate) +'%'"></div>
                <div class="text">{{info.qty}}/{{info.cargoCapacity}}</div>
            </div>
        </div>
        <div class="bot-banner  ptb10">
            <div><van-button type="info" round block size="small">矫正库存</van-button></div>
            <div><van-button type="info" @click="bussiness=2;setStockShow=true" round block size="small">矫正库存</van-button></div>
            <div class="kitbox pt10">
                <div class="box-flex-1 pr10"><van-button type="info" round block plain size="small">修改容量</van-button></div>
                <div class="box-flex-1 pl10"><van-button type="info" round block plain class="red" size="small">下架商品</van-button></div>
                <div class="box-flex-1 pr10"><van-button @click="bussiness=1;setStockShow=true" type="info" round block plain size="small">修改容量</van-button></div>
                <div class="box-flex-1 pl10"><van-button @click="checkRemoveDrug()" type="info" round block plain class="red" size="small">下架商品</van-button></div>
            </div>
        </div>
        <!-- 修改容量 -->
        <SetStockDialog v-model="setStockShow" title="矫正库存" :bussiness="2"/>
        <SetStockDialog 
            v-model="setStockShow" 
            :data="info"
            @onConfirm="updateMediicinecabineInventoryInfoById" 
            :bussiness="bussiness"/>
    </div>
</template>
<script>
import medicineAbinetApi from '@/api/api-medicineAbinet'
import SetStockDialog from './components/SetStockDialog'
export default{
    name: 'replenishmentStartProductDetail',
@ -37,14 +42,114 @@ export default{
    },
    data(){
        return {
            setStockShow: true
            id: this.$route.query.id,
            shelfStatus: this.$route.query.shelfStatus,
            setStockShow: false,
            info: '',
            bussiness: 1, //1修改容量 2矫正库存 3上下架
            drugId: ''
        }
    },
    computed:{
        rate(){
            var {info} = this
            return (info&&(Number(info.qty) / Number(info.cargoCapacity) * 100))|| 0
        }
    },
    created() {
        
        this.$EventBus.$on('drug-sel', data=>{
            this.drugId = data.id
            this.bussiness = 4
            this.setStockShow = true
        })
        this.selectMediicinecabineInventoryById()
    },
    methods:{
        
        selectMediicinecabineInventoryById(){
            this.$loading('加载中..')
            let p = {
                id: this.id
            }
            console.log('params', p)
            medicineAbinetApi
                .selectMediicinecabineInventoryById(p)
                .then(res=>{
                    console.log('selectMediicinecabineInventoryById', res)
                    this.$toast.clear()
                    this.info = res.obj
                })
                .catch(err=>{
                    console.error(err)
                })
        },
        checkRemoveDrug(){
            this.$dialog.confirm({
                title: '提示',
                message: '确认下架该药品?',
            })
            .then(() => {
                this.updateMediicinecabineInventoryInfoById(0, 3)
            })
        },
        updateMediicinecabineInventoryInfoById(data, bussiness){
            if(this.bussiness == 4){
                this.updateMediicinecabineInventory(data)
                return
            }
            this.$loading('保存中..')
            let p = {
                id: this.id,
            }
            if(bussiness==3){
                p.status = data //下架状态0,上架状态1
            } else if(this.bussiness == 1){
                p.cargoCapacity = data
            } else if(this.bussiness == 2){
                p.qty = data
            } 
            console.log('params', p)
            medicineAbinetApi
                .updateMediicinecabineInventoryInfoById(p)
                .then(res=>{
                    console.log('updateMediicinecabineInventoryInfoById', res)
                    this.setStockShow = false
                    this.$toast.clear()
                    this.$emitRefreshPage('replenishmentStartDeviceDetail')
                    this.$emitRefreshPage('replenishmentDeviceDetail')
                    if(bussiness==3){
                        this.$router.back()
                    } else {
                        this.selectMediicinecabineInventoryById()
                    }
                })
                .catch(err=>{
                    console.error(err)
                })
        },
        updateMediicinecabineInventory(data){
            this.$loading('保存中..')
            let p = {
                id: this.id,
                drugId: this.drugId,
                qty:data
            }
            
            console.log('params', p)
            medicineAbinetApi
                .updateMediicinecabineInventory(p)
                .then(res=>{
                    console.log('updateMediicinecabineInventory', res)
                    this.setStockShow = false
                    this.$toast.clear()
                    this.$emitRefreshPage('replenishmentStartDeviceDetail')
                    this.$emitRefreshPage('replenishmentDeviceDetail')
                    this.selectMediicinecabineInventoryById()
                })
                .catch(err=>{
                    console.error(err)
                })
        },
    },
}
</script>
@ -61,6 +166,7 @@ export default{
        border-radius: 20px;
        margin: 0 auto  ;
        position: relative;
        overflow: hidden;
        .bar{
            background: #17b3ec;
            height: 100%;
@ -70,7 +176,6 @@ export default{
            border-top-left-radius: 20px;
            border-bottom-left-radius: 20px;
            line-height: 20px;
            min-width: 40px;
        }
        .text{
            position: absolute;

+ 34 - 11
mini-pro-web/src/views/replenishment/stockUp/detail.vue

@ -1,23 +1,25 @@
<template>
    <div class='replenishment-stock-up-detail fs-14'>
        <div class="list bgc-fff">
            <div class="row kitbox">
                <div class="box-flex-1 pl10">商品名称</div>
                <div class="tc">现料数</div>
                <div class="tc">缺料数</div>
                <div class="tc">操作</div>
            </div>
        <div class="list bgc-fff ">
            <van-sticky>
                <div class="row kitbox bgc-fff"  >
                    <div class="box-flex-1 pl10">商品名称</div>
                    <div class="tc">现料数</div>
                    <div class="tc">缺料数</div>
                    <div class="tc">操作</div>
                </div>
            </van-sticky>
            <div v-for="(item, i) in list" :key="i" class="row kitbox">
                <div class="box-flex-1 pl10 ellipsis">{{item.drugName}}</div>
                <div class="tc">{{item.qty}}</div>
                <div class="tc">{{item.upInventory}}</div>
                <div class="tc">删除</div>
                <div class="tc c-red"><span @click="del(item, i)">删除</span></div>
            </div>
        </div>
        <div class="btns">
            <div class="pl15 pr8">
                <van-button plain @click="gotoUrl('/drugList')" block round type="info">新增商品</van-button>
                <van-button plain @click="toAdd" block round type="info">新增商品</van-button>
            </div>
            <div class="pl8 pr15">
                <van-button  block @click="submit" round type="info">生成备货单</van-button>
@ -40,7 +42,10 @@ export default{
    },
    created() {
        this.$EventBus.$on('drug-sel', (item)=>{
            item.qty = 0
            item.upInventory = 5
            this.list.push(item)
            console.log('unusedAisles', this.oriData[0].unusedAisles)
        })
        this.getDetialOutOfStock()
    },
@ -56,8 +61,11 @@ export default{
                .then(res=>{
                    console.log('getDetialOutOfStock', res)
                    this.$toast.clear()
                    var data = res.detailModelList[0]
                    data.canPickCount = (data.unusedAisles) + (data.children&&data.children.length||0)
                    this.oriData = res.detailModelList
					this.tableData = res.detailModelList&&res.detailModelList[0].children
					this.list = res.detailModelList&&res.detailModelList[0].children
                })
                .catch(err=>{
@ -91,7 +99,8 @@ export default{
                })
                .then(res => {
                    if(res.status == 200){
                        this.setBackRefresh()
                        // this.setBackRefresh()
                        this.$emitRefreshPage('replenishmentStockUpDeviceList')
                        this.$toast('生成成功')
                        history.back()
                    }
@ -100,12 +109,26 @@ export default{
                    console.error(err)
                })
                
        },
        del(item, k){
            this.list.splice(k, 1)
            console.log('unusedAisles', this.oriData[0].unusedAisles)
        },
        toAdd(){
            var device = this.oriData[0]
            debugger
            if(device.canPickCount <= this.list.length){
				this.$toast(`已达到药柜容量,无法在添加`)
				return
			}
            this.gotoUrl('/drugList')
        }
    },
}
</script>
<style lang='scss' scoped>
.replenishment-stock-up-detail{
    padding-bottom: 100px;
    .list{
        .row{
            padding: 10px 0;

+ 6 - 1
mini-pro-web/src/views/replenishment/stockUp/deviceList.vue

@ -74,8 +74,13 @@ export default{
        
    },
    methods:{
        $refreshPage(){
            this.$refs.customList.refresh()
        },
        onLoad({page, pageSize, searchText}){
            var p = {
                content: searchText,
                userId: this.user.id,
				// startTime: startDate? this.$moment(startDate).format('YYYY-MM-DD 00:00:00') : '',
				// endTime: endDate? this.$moment(endDate).format('YYYY-MM-DD 23:59:59') : '',
				// content: searchForm.content,
@ -86,7 +91,7 @@ export default{
            }
            console.log('params', p)
            medicineAbinetApi
                .getOutOfStockDeviceList(p)
                .getOutOfStockDeviceListByUserId(p)
                .then(res=>{
                    console.log('getOutOfStockDeviceList', res)
                    if(res.status == 200){