|
@@ -17,12 +17,24 @@
|
|
|
<u-cell-item title="打印走纸" @click="onPrintFeed()">
|
|
|
<u-icon slot="icon" custom-prefix="custom-icon" size="35" name="wodecheliang"></u-icon>
|
|
|
</u-cell-item>
|
|
|
+ <u-cell-item title="地锁控制" @click="lockControl()">
|
|
|
+ <u-icon slot="icon" custom-prefix="custom-icon" size="35" name="wodecheliang"></u-icon>
|
|
|
+ </u-cell-item>
|
|
|
<u-cell-item title="退出登录" @click="onLoginOut()">
|
|
|
<u-icon slot="icon" custom-prefix="custom-icon" size="35" name="wodecheliang"></u-icon>
|
|
|
</u-cell-item>
|
|
|
</u-cell-group>
|
|
|
</view>
|
|
|
-
|
|
|
+ <u-popup v-model="show" mode="center" length="auto" >
|
|
|
+ <view>
|
|
|
+ <u-form :model="lockForm" ref="uForm">
|
|
|
+ <u-form-item label="设备编码" label-width="150"><u-input v-model="lockForm.deviceNo" /></u-form-item>
|
|
|
+ <u-form-item label="是否开锁" label-width="150"><u-input v-model="lockForm.cmdLabel" type="select" @click="lockForm.cmdFlag = true"/></u-form-item>
|
|
|
+ </u-form>
|
|
|
+ </view>
|
|
|
+ <u-button @click="submit" type="primary">提交</u-button>
|
|
|
+ </u-popup>
|
|
|
+ <u-select v-model="lockForm.cmdFlag" :list="list" @confirm="getCmdValue"></u-select>
|
|
|
<u-toast ref="uToast" />
|
|
|
</view>
|
|
|
</template>
|
|
@@ -34,7 +46,21 @@
|
|
|
export default{
|
|
|
data(){
|
|
|
return{
|
|
|
-
|
|
|
+ show: false,
|
|
|
+ lockForm:{
|
|
|
+ deviceNo:'',
|
|
|
+ cmd:'',
|
|
|
+ cmdLabel: '',
|
|
|
+ cmdFlag: false
|
|
|
+ },
|
|
|
+ list:[{
|
|
|
+ value: 'up',
|
|
|
+ label: '升板'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ value: 'down',
|
|
|
+ label: '降板'
|
|
|
+ }]
|
|
|
}
|
|
|
},
|
|
|
onLoad(){
|
|
@@ -44,6 +70,25 @@
|
|
|
|
|
|
},
|
|
|
methods:{
|
|
|
+ lockControl(){
|
|
|
+ this.show=true;
|
|
|
+ },
|
|
|
+ submit(){
|
|
|
+ this.$u.api.lockControl({deviceNo:this.lockForm.deviceNo, cmd:this.lockForm.cmd})
|
|
|
+ .then( res =>{
|
|
|
+ if(res.code == 200){
|
|
|
+ this.$refs.uToast.show({
|
|
|
+ title: res.msg,
|
|
|
+ type: 'success',
|
|
|
+ });
|
|
|
+ }
|
|
|
+ }).catch(err=>{
|
|
|
+ this.$refs.uToast.show({
|
|
|
+ title: err.msg,
|
|
|
+ type: 'error',
|
|
|
+ });
|
|
|
+ })
|
|
|
+ },
|
|
|
customBack(){
|
|
|
this.$u.route({
|
|
|
// type:'switchTab',
|
|
@@ -67,6 +112,11 @@
|
|
|
});
|
|
|
//#endif
|
|
|
},
|
|
|
+ getCmdValue(val) {
|
|
|
+ console.log(val)
|
|
|
+ this.lockForm.cmd = val[0].value
|
|
|
+ this.lockForm.cmdLabel = val[0].label
|
|
|
+ },
|
|
|
onLoginOut(){
|
|
|
uni.showModal({
|
|
|
title: '温馨提示',
|