chenyue %!s(int64=3) %!d(string=hai) anos
pai
achega
ccc39aabc6

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

@ -486,7 +486,33 @@ let service = {
			data
		});
    },
    
    //设备温度湿度设置和控制
    updateTAndH: function(data) {
		return request({
			url: `${BASE}/baseDevice/updateTAndH`,
			method: "post",
			data
		});
    },
    //更新设备名称
    updateDevEquName: function(data) {
		return request({
			url: `${BASE}/baseDevice/updateDevEquName`,
			method: "post",
			data
		});
    },
    // 获取设备携带不同类型的日志的二级树,补货日志、换货日志、上货日志
	getDeviceInventoryRecordListWithUserId: function(params) {
		return request({
			url: `${BASE}/baseDevice/getDeviceInventoryRecordListWithUserId`,
			method: "get",
			params
		});
    },
};
export default service;

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

@ -28,18 +28,18 @@
            </div>
        </div>
        <div class='mt20 grid-4 c-f14 c-333 bgc-fff c-border-tb ptb15'>
            <div class='c-t-center' @click='gotoUrl("/device/temperature/index")'>
            <div class='c-t-center' @click='gotoUrl("/device/temperature/index", {id: $route.query.id})'>
                <div>
                    <van-image class='ability' :src='require("@/assets/images/wendukongzhi.png")'/>
                </div>
                <div>温度控制</div>
                <div>温湿度控制</div>
            </div>
            <div class='c-t-center' @click='gotoUrl("/device/humidity/index")'>
            <!-- <div class='c-t-center' @click='gotoUrl("/device/temperature/index", {id: $route.query.id})'>
                <div>
                    <van-image class='ability' :src='require("@/assets/images/shidukongzhi.png")'/>
                </div>
                <div>湿度控制</div>
            </div>
            </div> -->
            <div class='c-t-center' @click='gotoUrl("/device/cargoLane/index", {deviceId: id})'>
                <div>
                    <van-image class='ability' :src='require("@/assets/images/huodaozhuangtai.png")'/>

+ 191 - 6
mini-pro-web/src/views/device/temperature/index.vue

@ -2,42 +2,227 @@
    <div class='temperatureIndex'>
        <div class='bgc-17b3ec ptb10 plr15 c-fff c-f14'>
            <div class='flex f_y_c f_x_s'>
                <span>设备实时温度</span>
                <span>设备实时温湿度</span>
                <van-button size="small" type="text" class='tbtn w60 bgc-fff c-17B3EC'>获取</van-button>
            </div>
            <div class='c-f20'>22°</div>
            <div class='c-f20'>22°<span class='ml20'>70%</span></div>
            <div class='mt10'>设备实时温度每10分钟会从设备端返回一次</div>
        </div>
        <div class='mt10 p10 bgc-fff c-f14 c-333 c-border-tb'>
            <div class='flex f_y_c'>
                <span>温度控制:</span>
                <van-switch @click="gotoUrl('/device/temperature/turnControl')" inactive-color='#ccc' active-color='#17b3ec' v-model="checked" />
                <van-switch @change='temperatureChange' inactive-color='#ccc' active-color='#17b3ec' v-model="form.temperaturecontrol" />
            </div>
            <div class='mt10' v-show='checked'>温度控制值为  {{'22°'}}</div>
            <div class='mt10' v-show='form.temperaturecontrol'>温度控制值为  {{form.temperature?form.temperature+'°':''}}</div>
        </div>
        <div v-if='form.temperaturecontrol'>
            <div class='c-333 c-f14 bgc-fff p15 c-border-b' >
                <div class='flex f_y_c'>
                    <span>加热控制:</span>
                    <van-radio-group class='ml20' v-model="form.heat" direction="horizontal">
                        <van-radio :name="0">关闭</van-radio>
                        <van-radio :name="1">开启</van-radio>
                    </van-radio-group>
                </div>
                <div class='flex mt20'>
                    <div class='lh46'>请设置目标温度值:</div>
                    <div style='flex:1' class='ml10'>
                        <div class='flex f_y_c'><van-field class='c-border w80' v-model="form.temperature" maxlength='2' type="digit" /><span class='ml10'>度</span></div>
                        <!-- <van-notice-bar class='bgc-fff pl0' wrapable :scrollable="false" >可输入的值范围为: {{form.heat==0?'2-25°':form.heat==1?'20-40°':''}}</van-notice-bar> -->
                    </div>
                </div>
                <div class='mt10'>最后一次发送的温度值为 22°</div>
                <div class='mt10 c-999'>指令发送成功后,请等待设备生效,设备每隔十分钟左右会返回一次最新实时温度值</div>
            </div>
            <div class='mt10 p10 bgc-fff c-f14 c-333 c-border-tb' v-if='form.temperaturecontrol'>
                <div class='flex f_y_c'>
                    <span>温度预警:</span>
                    <van-switch inactive-color='#ccc' active-color='#17b3ec' v-model="checked1" />
                </div>
            </div>
        </div>
        <div v-if='checked1'>
            <div class='flex c-333 c-f14 bgc-fff p15'>
                <div class='lh46'>当温度高于:</div>
                <div style='flex:1' class='ml10'>
                    <div class='flex f_y_c'><van-field class='c-border w80' v-model="form.warningTemperatureHeight" maxlength='2' type="digit" /><span class='mlr10'>度</span>时进行预警</div>
                </div>
            </div>
            <div class='flex c-333 c-f14 bgc-fff p15 c-border-b'>
                <div class='lh46'>当温度低于:</div>
                <div style='flex:1' class='ml10'>
                    <div class='flex f_y_c'><van-field class='c-border w80' v-model="form.warningTemperatureLow" maxlength='2' type="digit" /><span class='mlr10'>度</span>时进行预警</div>
                </div>
            </div>
        </div>
        <div class='mb100'>
            <div class='mt10 p10 bgc-fff c-f14 c-333 c-border-tb'>
                <div class='flex f_y_c'>
                    <span>湿度控制:</span>
                    <van-switch @change='humidityChange' inactive-color='#ccc' active-color='#17b3ec' v-model="form.humiditycontrol" />
                </div>
                <div class='mt10' v-show='form.humiditycontrol'>湿度控制值为  {{form.humidity?form.humidity+'%':''}}</div>
            </div>
            <div class='c-333 c-f14 bgc-fff p15 c-border-b' v-if='form.humiditycontrol'>
                <div>请设置目标湿度值:</div>
                <div class='flex f_y_c mt20 pl15'>
                    <van-slider button-size='30px' v-model="form.humidity" @change="onChange" />
                    <div class='ml15'>{{form.humidity}}%</div>
                </div>
                <div class='mt20'>最后一次发送的湿度调整值为%</div>
                <div class='mt10 c-999'>指令发送成功后,请等待设备生效,设备每隔十分钟左右会返回一次最新实时湿度值</div>
            </div>
            <div class='mt10 p10 bgc-fff c-f14 c-333 c-border-tb' v-if='form.humiditycontrol'>
                <div class='flex f_y_c'>
                    <span>湿度预警:</span>
                    <van-switch inactive-color='#ccc' active-color='#17b3ec' v-model="checked2" />
                </div>
            </div>
            <div v-if='checked2'>
                <div class='flex c-333 c-f14 bgc-fff p15'>
                    <div class='lh46'>当湿度高于:</div>
                    <div style='flex:1' class='ml10'>
                        <div class='flex f_y_c'><van-field class='c-border w80' v-model="form.waringHumidityHeight" maxlength='2' type="digit" /><span class='mlr10'>%</span>时进行预警</div>
                    </div>
                </div>
                <div class='flex c-333 c-f14 bgc-fff p15 c-border-b'>
                    <div class='lh46'>当湿度低于:</div>
                    <div style='flex:1' class='ml10'>
                        <div class='flex f_y_c'><van-field class='c-border w80' v-model="form.waringHumidityLow" maxlength='2' type="digit" /><span class='mlr10'>%</span>时进行预警</div>
                    </div>
                </div>
            </div>
        </div>
        <div class='c-position-f b0 ptb15 bgc-fff c-border-t' style='width:100%'><van-button class="w100_60 ml30 " color='#17b3ec' round @click="save">保存</van-button></div>
    </div>
</template>
<script>
import medicineAbinetApi from '@/api/api-medicineAbinet'
export default{
    name: 'temperatureIndex',
    data(){
        return {
            checked: false
            checked1: '',
            checked2: '',
            form:{
                deviceId: this.$route.query.id,
                humidity: '',
                temperature: '',
                humiditycontrol: '',
                temperaturecontrol:'',
                heat: '',
                warningTemperatureHeight: '',
                waringHumidityHeight: '',
                warningTemperatureLow: '',
                waringHumidityLow: '',
            },
        }
    },
    watch:{
        checked1(n){
            if(!n){
                this.form.warningTemperatureLow = '';
                this.form.warningTemperatureHeight = '';
            }
        },
        checked2(n){
            if(!n){
                this.form.waringHumidityHeight = '';
                this.form.waringHumidityLow = '';
            }
        }
    },
    methods:{
        temperatureChange(n){
            if(n==0){
                this.form.checked1 = false;
                this.form.temperature = '';
                this.heat = ''
            }
        },
        humidityChange(n){
            if(n==0){
                this.form.checked2 = false;
                this.form.humidity = '';
            }
        },
        save(){
            this.form.humiditycontrol = this.form.humiditycontrol?'1':'0';
            this.form.temperaturecontrol = this.form.temperaturecontrol?'1':'0'
            //this.form.heat = !this.form.heat?'0':this.form.heat
            medicineAbinetApi.updateTAndH(this.form).then(res=>{
                if(res.status==200){
                    this.$toast(res.message);
                    this.goBack();
                }else{
                    this.$toast(res.message)
                }
            }).catch(err=>{
                this.$toast(err.message)
            })
        },
        initMain(){
            medicineAbinetApi.getHumidity({}).then(res=>{
            }).catch(err=>{
                
            })
        }
    },
    created(){
        
        let vm = this;
        this.$EventBus.$on('openTemperature',(e)=>{
            if(e.status){
                Object.assign(vm.form, e.detail)
                vm.checked1 = true
            }else{
                vm.checked1 = false
            }
        })
        this.$EventBus.$on('openSecurity',(e)=>{
            if(e.status){
                Object.assign(vm.form, e.detail)
                vm.checked2 = true
            }else{
                vm.checked2 = false
            }
        })
        this.$EventBus.$on('openHumidity',(e)=>{
            if(e.status){
                Object.assign(vm.form, e.detail)
                vm.checked3 = true
            }else{
                vm.checked3 = false
            }
        })
    },
    beforeDestroy(){
        this.$EventBus.$off('openTemperature');
        this.$EventBus.$off('openSecurity');
        this.$EventBus.$off('openHumidity')
    }
}
</script>
<style scoped lang='scss'>
.temperatureIndex{
    min-height: 100vh;
    overflow-y: scroll;
    position: relative;
    .tbtn{
        border: 0;
        border-radius: 5px;
    }
    .w100_60{
        width: calc(100% - 60px);
    }
    .b0{
        bottom: 0px;
    }
    .c-position-f{
        position: fixed;
    }
    .mb100{
        margin-bottom: 100px
    }
}
</style>

+ 23 - 4
mini-pro-web/src/views/device/temperature/turnControl.vue

@ -4,8 +4,8 @@
            <div class='flex f_y_c'>
                <span>请设定模式:</span>
                <van-radio-group class='ml20' v-model="model" direction="horizontal">
                    <van-radio :name="1">制冷</van-radio>
                    <van-radio :name="2">制热</van-radio>
                    <van-radio :name="0">制冷</van-radio>
                    <van-radio :name="1">制热</van-radio>
                </van-radio-group>
            </div>
            <div class='flex mt20'>
@ -25,15 +25,33 @@
                    <van-button class='bgc-ccc w100 c-border-r-5' style='border:0' type="info" @click="cancel">取消</van-button>
                </div>
            </div>
            <div class='c-333 c-f14 bgc-fff p15 c-border-b' v-if='checked3'>
                <div>请设置目标湿度值:</div>
                <div class='flex f_y_c mt20 pl15'>
                    <van-slider button-size='30px' v-model="sd" @change="onChange" />
                    <div class='ml15'>{{sd}}%</div>
                </div>
                <div class='mt20'>最后一次发送的湿度调整值为%</div>
                <div class='mt10 c-999'>指令发送成功后,请等待设备生效,设备每隔十分钟左右会返回一次最新实时湿度值</div>
                <div class='flex mt20'>
                    <div class='c-t-center' style='flex:1'>
                        <van-button class='w100 c-border-r-5' type="info" @click="confirm">确认</van-button>
                    </div>
                    <div class='c-t-center' style='flex:1'>
                        <van-button class='bgc-ccc w100 c-border-r-5' style='border:0' type="info" @click="cancel">取消</van-button>
                    </div>
                </div>
            </div>
        </div>
    </div>
</template>
<script>
import medicineAbinetApi from '@/api/api-medicineAbinet'
export default{
    name: 'temperature-turnControl',
    data(){
        return {
            model: 0,
            model: '',
            wd: '',
        }
    },
@ -68,9 +86,10 @@ export default{
            }
        },
        confirm(){
            this.goBack();
            this.$EventBus.$emit('openTemperature',{status: true, detail:{temperature: this.wd, }})
        },
        cancel(){
            this.$EventBus.$emit('openTemperature',{status: false})
            this.goBack();
        }
    },

+ 99 - 60
mini-pro-web/src/views/replenishment/record/list.vue

@ -7,89 +7,128 @@
                <van-tab title="上货"></van-tab>
            </van-tabs>
        </van-sticky>
        <div class="list">
            <van-collapse v-model="activeName" accordion>
                <van-collapse-item v-for="(item, i) in list" :key="i" :title="item.title" :name="item.id">
                    <div class="item" v-for="(citem, k) in item.children" :key="k">
                        <template>
                            <div>补货时间:2020-08-24 17:15:19</div>
                            <div>设备编号:149122021070000</div>
                            <div>商品数量:2</div>
                            <div>补货人员:张三</div>
                        </template>
                        <!-- <template>
                            <div>换货时间:2020-08-24 17:15:19</div>
                            <div>设备编号:149122021070000</div>
                            <div>换货人员:张三</div>
                        </template>
                        <template>
                            <div>上货时间:2020-08-24 17:15:19</div>
                            <div>设备编号:149122021070000</div>
                            <div>上货人员:张三</div>
                        </template> -->
                    </div>
                </van-collapse-item>
            </van-collapse>
        </div>
        <CustomList 
			ref="customList"
            :searchfun='false'
			@onLoad="onLoad">
            <div class="list">
                <van-collapse v-model="activeName" accordion>
                    <van-collapse-item v-for="(item, i) in list" :key="i" :title="item.equName" :name="i">
                        <div class="item" v-for="(citem, k) in item.children" :key="k">
                            <template>
                                <div>补货时间:{{citem.createTime}}</div>
                                <div>设备编号:{{citem.deviceId}}</div>
                                <div>商品数量:{{citem.quantity}}</div>
                                <div>补货人员:{{citem.createUserName}}</div>
                            </template>
                            <!-- <template>
                                <div>换货时间:2020-08-24 17:15:19</div>
                                <div>设备编号:149122021070000</div>
                                <div>换货人员:张三</div>
                            </template>
                            <template>
                                <div>上货时间:2020-08-24 17:15:19</div>
                                <div>设备编号:149122021070000</div>
                                <div>上货人员:张三</div>
                            </template> -->
                        </div>
                    </van-collapse-item>
                </van-collapse>
            </div>
        </CustomList>
    </div>
</template>
<script>
import medicineAbinetApi from '@/api/api-medicineAbinet'
export default{
    name: 'replenishmentRecordList',
    data(){
        return {
            active: 0,
            activeName: 1,
            list: [{
                title: '众健信联1号',
                id: 1,
                children: [{}, {}],
                noMore: false
            }],
            activeName: '',
            list: [],
        }
    },
    watch:{
        activeName(n){
            //'808080eb7d8524f8017d85911adf0001'
            medicineAbinetApi.findDeviceById({deviceId: this.list[n].id}).then(res=>{
                if(res.status==200){
                    this.list[n].children = res.obj.inventoryList;
                }
            })
        }
    },
    created() {
        
    },
    methods:{
        onLoad({page, pageSize, searchText}){
            setTimeout(()=>{
                for(var i=0; i<pageSize; i++){
                    this.list.push((page-1)*pageSize + i)
                }
                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
                };
        // onLoad({page, pageSize, searchText}){
        //     setTimeout(()=>{
        //         for(var i=0; i<pageSize; i++){
        //             this.list.push((page-1)*pageSize + i)
        //         }
        //         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)
        //     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)
        //         })
        // },
        onLoad({page, pageSize, searchText}){
            var p = {
                userId: this.user.id,
                page: 1,
                size: pageSize
            }
            console.log('params', p)
            medicineAbinetApi.getDeviceListWithUserId(p)
                .then(res=>{
                    console.log('getDeviceListWithUserId', res)
                    if(res.status == 200){
                        var list = res.detailModelList.map(item=>{
                            var data = item
                            data.photo = this.$root.setDocPhoto(data.photo)
                            return data
                        res.detailModelList.forEach(el=>{
                            el.children = []
                        })
                        var list = res.detailModelList
                        
                        this.list = page==1? list : this.list.concat(list)
                        this.$refs.customList.endLoad(!res.detailModelList || res.detailModelList.length==0, this.list.length)
                        debugger
                        this.$refs.customList.endLoad(res.totalPage<=page, this.list.length)
                    } else {
                        this.$refs.customList[this.active].endLoad(false, true)
                        this.list = []
                        this.$refs.customList.endLoad(false, true)
                    }
                }).catch(err=>{
                    console.error(err)
                    this.$refs.customList[this.active].endLoad(false, true)
                    this.list = []
                    this.$refs.customList.endLoad(false, true)
                })
        },
    },

+ 3 - 1
mini-pro-web/src/views/replenishment/start/productDetail.vue

@ -99,6 +99,7 @@ export default{
            this.$loading('保存中..')
            let p = {
                id: this.id,
                userId: this.user.id,
            }
            if(bussiness==3){
                p.status = data //下架状态0,上架状态1
@ -132,7 +133,8 @@ export default{
            let p = {
                id: this.id,
                drugId: this.drugId,
                qty:data
                qty:data,
                userId: this.user.id,
            }
            
            console.log('params', p)

+ 1 - 0
mini-pro-web/src/views/replenishment/stockUp/detail.vue

@ -95,6 +95,7 @@ export default{
            console.log('params', p)
            medicineAbinetApi
                .baseUpCreateUp({
                    userId: this.user.id,
                    jsonData: JSON.stringify(p),
                })
                .then(res => {