|
@ -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="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="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="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>
|
|
</div>
|
|
</div>
|
|
</template>
|
|
</template>
|
|
@ -14,11 +18,42 @@ export default{
|
|
name: 'deviceReboot',
|
|
name: 'deviceReboot',
|
|
data(){
|
|
data(){
|
|
return {
|
|
return {
|
|
|
|
funcMgn: {
|
|
|
|
jiesuan: true,
|
|
|
|
quyao: true,
|
|
|
|
yujiaojin: true,
|
|
|
|
},
|
|
|
|
id: this.$route.query.id,
|
|
equNum: this.$route.query.equNum,
|
|
equNum: this.$route.query.equNum,
|
|
equName: this.$route.query.equName,
|
|
equName: this.$route.query.equName,
|
|
}
|
|
}
|
|
},
|
|
},
|
|
|
|
created(){
|
|
|
|
this.findById()
|
|
|
|
},
|
|
methods:{
|
|
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){
|
|
toggleDebug(event){
|
|
var p = {
|
|
var p = {
|
|
equNum: this.equNum,
|
|
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>
|
|
</script>
|