|
@@ -70,15 +70,15 @@
|
|
|
</uni-grid-item>
|
|
</uni-grid-item>
|
|
|
|
|
|
|
|
<uni-grid-item v-if="hasRole(['admin'])">
|
|
<uni-grid-item v-if="hasRole(['admin'])">
|
|
|
- <view class="grid-item-box" @click="scanCode()">
|
|
|
|
|
- <u--image :showLoading="true" src="/static/images/icons/scan.png" width="50rpx" height="50rpx" ></u--image>
|
|
|
|
|
|
|
+ <view class="grid-item-box" @click="goPage('reset')">
|
|
|
|
|
+ <u--image :showLoading="true" src="/static/images/icons/reset.png" width="50rpx" height="50rpx" ></u--image>
|
|
|
<text class="text">注销设备</text>
|
|
<text class="text">注销设备</text>
|
|
|
</view>
|
|
</view>
|
|
|
</uni-grid-item>
|
|
</uni-grid-item>
|
|
|
|
|
|
|
|
</uni-grid>
|
|
</uni-grid>
|
|
|
|
|
|
|
|
- <u-modal :show="show" title="绑定设备" :showCancelButton="true" @confirm="bingDevice" >
|
|
|
|
|
|
|
+ <u-modal :show="show" :title="dlgTitle" @cancel="cancel" :showCancelButton="true" @confirm="bingDevice" >
|
|
|
<view class="slot-content">
|
|
<view class="slot-content">
|
|
|
|
|
|
|
|
<view>设备名称:{{ scanDevice.deviceName }}</view>
|
|
<view>设备名称:{{ scanDevice.deviceName }}</view>
|
|
@@ -100,6 +100,7 @@ export default {
|
|
|
components: {UImage},
|
|
components: {UImage},
|
|
|
data() {
|
|
data() {
|
|
|
return {
|
|
return {
|
|
|
|
|
+ dlgTitle:"",
|
|
|
current: 0,
|
|
current: 0,
|
|
|
swiperDotIndex: 0,
|
|
swiperDotIndex: 0,
|
|
|
show:false,
|
|
show:false,
|
|
@@ -121,7 +122,7 @@ export default {
|
|
|
this.show = false;
|
|
this.show = false;
|
|
|
bingDeviceDept(this.scanDevice).then(res=>{
|
|
bingDeviceDept(this.scanDevice).then(res=>{
|
|
|
if(res.code == 200){
|
|
if(res.code == 200){
|
|
|
- this.$modal.showToast('绑定成功')
|
|
|
|
|
|
|
+ this.$modal.showToast('操作成功')
|
|
|
}else{
|
|
}else{
|
|
|
this.$modal.showToast(res.msg);
|
|
this.$modal.showToast(res.msg);
|
|
|
}
|
|
}
|
|
@@ -129,8 +130,8 @@ export default {
|
|
|
})
|
|
})
|
|
|
},
|
|
},
|
|
|
cancel(){
|
|
cancel(){
|
|
|
- this.scanDevice = {};
|
|
|
|
|
this.show = false;
|
|
this.show = false;
|
|
|
|
|
+ this.scanDevice = {};
|
|
|
},
|
|
},
|
|
|
clickBannerItem(item) {
|
|
clickBannerItem(item) {
|
|
|
console.log();
|
|
console.log();
|
|
@@ -151,6 +152,13 @@ export default {
|
|
|
console.log('条码内容:' + res.result);
|
|
console.log('条码内容:' + res.result);
|
|
|
getDevcieByQrcode(res.result).then(res=>{
|
|
getDevcieByQrcode(res.result).then(res=>{
|
|
|
let device = res.data;
|
|
let device = res.data;
|
|
|
|
|
+ if(!self.hasRole(['admin'])){
|
|
|
|
|
+ if(device.deptId == null || device.deptId == 0){
|
|
|
|
|
+ self.$modal.showToast('设备不存在或无权限')
|
|
|
|
|
+ return;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
if(device != null){
|
|
if(device != null){
|
|
|
uni.navigateTo({
|
|
uni.navigateTo({
|
|
|
url: '/pages/device/detail?id='+device.deviceId
|
|
url: '/pages/device/detail?id='+device.deviceId
|
|
@@ -169,21 +177,23 @@ export default {
|
|
|
success: function (res) {
|
|
success: function (res) {
|
|
|
console.log('条码内容:' + res.result);
|
|
console.log('条码内容:' + res.result);
|
|
|
getDevcieByQrcode(res.result).then(res=>{
|
|
getDevcieByQrcode(res.result).then(res=>{
|
|
|
- let device = res.data;
|
|
|
|
|
- if(!device){
|
|
|
|
|
- self.$modal.showToast('未查到设备信息')
|
|
|
|
|
|
|
+ let device = res.data;
|
|
|
|
|
+ if(!device){
|
|
|
|
|
+ self.$modal.showToast('未查到设备信息')
|
|
|
|
|
+ }else{
|
|
|
|
|
+ if(device.deptId != null){
|
|
|
|
|
+ self.$modal.showToast('该设备已经绑定了用户')
|
|
|
}else{
|
|
}else{
|
|
|
- if(device.deptId != null){
|
|
|
|
|
- self.$modal.showToast('该设备已经绑定了用户')
|
|
|
|
|
- }else{
|
|
|
|
|
- self.scanDevice = device;
|
|
|
|
|
- self.show = true;
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ self.dlgTitle = "绑定设备";
|
|
|
|
|
+ self.scanDevice = device;
|
|
|
|
|
+ self.show = true;
|
|
|
}
|
|
}
|
|
|
|
|
+ }
|
|
|
});
|
|
});
|
|
|
}
|
|
}
|
|
|
});
|
|
});
|
|
|
},
|
|
},
|
|
|
|
|
+
|
|
|
goPage(path){
|
|
goPage(path){
|
|
|
if('device' == path){
|
|
if('device' == path){
|
|
|
uni.navigateTo({
|
|
uni.navigateTo({
|
|
@@ -215,6 +225,11 @@ export default {
|
|
|
url: '/pages/device/error'
|
|
url: '/pages/device/error'
|
|
|
});
|
|
});
|
|
|
}
|
|
}
|
|
|
|
|
+ if('reset' == path){
|
|
|
|
|
+ uni.navigateTo({
|
|
|
|
|
+ url: '/pages/device/reset/reset'
|
|
|
|
|
+ });
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|