lincl 1 年之前
父节点
当前提交
b7e0982e1f

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

@ -80,7 +80,7 @@
                    </div>
                    <div>维护/上架</div>
                </div>
                <div v-if="debugDeviceAuth" class='c-t-center' @click='gotoUrl("/device/reboot", {equNum: info.equNum, equName: info.equName})'>
                <div  class='c-t-center' @click='gotoUrl("/device/reboot", {equNum: info.equNum, equName: info.equName, id: id})'>
                    <div>
                        <van-image class='ability' :src='require("@/assets/images/shebeichongqi.png")'/>
                    </div>

+ 69 - 0
mini-pro-web/src/views/device/reboot.vue

@ -5,6 +5,10 @@
            <van-button block class='c-border-r-5' type="info" @click="toggleDebug('closeDebug')">关闭调试</van-button>
            <van-button block class='c-border-r-5' type="danger" @click="systemUpdate()">设备程序更新</van-button>
            <van-button block class='c-border-r-5' type="danger" @click="exeUpdate()">更新药柜程序</van-button>
            <van-button block class='c-border-r-5' type="danger" @click="pushIndexFunc({yujiaojin: !funcMgn.yujiaojin})">{{funcMgn.yujiaojin===true? '关闭' : '开启'}}预交金充值</van-button>
            <van-button block class='c-border-r-5' type="danger" @click="pushIndexFunc({jiesuan: !funcMgn.jiesuan})">{{funcMgn.jiesuan===true? '关闭' : '开启'}}结算</van-button>
            <van-button block class='c-border-r-5' type="danger" @click="pushIndexFunc({quyao: !funcMgn.quyao})">{{funcMgn.quyao===true? '关闭' : '开启'}}取药</van-button>
        </div>
    </div>
</template>
@ -14,11 +18,42 @@ export default{
    name: 'deviceReboot',
    data(){
        return {
            funcMgn: {
				jiesuan: true,
				quyao: true,
				yujiaojin: true,
			},
            id: this.$route.query.id,
            equNum: this.$route.query.equNum,
            equName: this.$route.query.equName,
        }
    },
    created(){
        this.findById()
    },
    methods:{
        findById(){
            this.$loading('加载中..')
            let p = {
                deviceId: this.id
            }
            medicineAbinetApi
                .findDeviceById(p)
                .then(res=>{
                    console.log(' res.obj.device', res.obj)
                    this.$toast.clear()
                    if(res.obj.device.modules){
						try {
							this.funcMgn = JSON.parse(res.obj.device.modules)
						} catch (error) {
							console.error(error)
						}
					}
                })
                .catch(err=>{
                    console.error(err)
                })
        },
        toggleDebug(event){
            var p = {
                equNum: this.equNum,
@ -83,6 +118,40 @@ export default{
					})
			})
        },
        pushIndexFunc(data){
            var { equName, equNum } = this
            var message = ''
            if(data.hasOwnProperty('yujiaojin')){
                message = `确认${data.yujiaojin===true? '开启' : '关闭'}预交金充值?`
            } else if(data.hasOwnProperty('jiesuan')){
                message = `确认${data.jiesuan===true? '开启' : '关闭'}结算`
            } else if(data.hasOwnProperty('quyao')){
                message = `确认${data.quyao===true? '开启' : '关闭'}取药`
            }
            this.$dialog.confirm({
                title: '',
                message,
            })
            .then(() => {
                var rs = _.assign({}, this.funcMgn, data)
                var p = {
                    equNum,
                    type: 'indexFuncManage',
                    mess: JSON.stringify(rs)
                }
                console.log("params", p)
				medicineAbinetApi
					.systemUpdate(p)
					.then(res => {
                        this.findById()
                        this.$toast('操作成功')
					})
					.catch(err=>{
                        this.findById()
						console.error(err)
					})
			})
        },
    },
}
</script>

+ 1 - 0
mini-pro-web/src/views/order/components/Filter.vue

@ -109,6 +109,7 @@ export default{
                {name: '已取药', value: 1},
                {name: '线下药房', value: -1},
                {name: '线下作废', value: -2},
                {name: '出药异常', value: -5},
            ],
            state: '',
            dateTypeOpts: [