|
@@ -3,10 +3,12 @@
|
|
<view v-if="merchantList.length>1">
|
|
<view v-if="merchantList.length>1">
|
|
<uni-collapse :accordion="true">
|
|
<uni-collapse :accordion="true">
|
|
<view class="titleFlag">
|
|
<view class="titleFlag">
|
|
- <image class="img" src="../../static/img/red.png" ></image> <font class="wenziT">红色代表机器报警</font>
|
|
|
|
- <image class="img" src="../../static/img/green.png"></image> <font class="wenziT">绿色代表机器正常</font>
|
|
|
|
|
|
+ <image class="img" src="../../static/img/red.png"></image>
|
|
|
|
+ <font class="wenziT">红色代表机器报警</font>
|
|
|
|
+ <image class="img" src="../../static/img/green.png"></image>
|
|
|
|
+ <font class="wenziT">绿色代表机器正常</font>
|
|
</view>
|
|
</view>
|
|
- <view class="titlelist" v-for="(merchant,index) in merchantList" :key="merchant.id" >
|
|
|
|
|
|
+ <view class="titlelist" v-for="(merchant,index) in merchantList" :key="merchant.id">
|
|
<uni-collapse-item :title="getMerchantTitle(merchant)" :open="index===0">
|
|
<uni-collapse-item :title="getMerchantTitle(merchant)" :open="index===0">
|
|
<view style="padding: 20upx;background-color: aliceblue;">
|
|
<view style="padding: 20upx;background-color: aliceblue;">
|
|
<view v-if="merchant.equipmentList.length==0" style="text-align: center;">暂无数据</view>
|
|
<view v-if="merchant.equipmentList.length==0" style="text-align: center;">暂无数据</view>
|
|
@@ -32,7 +34,7 @@
|
|
<view class="swithBox" v-if="equipment.eqeStatus==0">
|
|
<view class="swithBox" v-if="equipment.eqeStatus==0">
|
|
<view class="swichFont">关机:已关机</view>
|
|
<view class="swichFont">关机:已关机</view>
|
|
<view class="switch">
|
|
<view class="switch">
|
|
- <switch style="transform:scale(0.65)" checked @change="OnOff(equipment.id,1)" />
|
|
|
|
|
|
+ <switch style="transform:scale(0.65)" checked @change="OnOff(equipment.id,1)" />
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
<view class="swithBox" v-else>
|
|
<view class="swithBox" v-else>
|
|
@@ -47,19 +49,20 @@
|
|
<view><span>炉头温度:</span><span>{{equipment.furnaceTm?equipment.furnaceTm:''}}</span></view>
|
|
<view><span>炉头温度:</span><span>{{equipment.furnaceTm?equipment.furnaceTm:''}}</span></view>
|
|
<view><span>柜内湿度:</span><span>{{equipment.cabinetHd?equipment.cabinetHd:''}}</span></view>
|
|
<view><span>柜内湿度:</span><span>{{equipment.cabinetHd?equipment.cabinetHd:''}}</span></view>
|
|
<view><span>柜内温度:</span><span>{{equipment.cabinetTm?equipment.cabinetTm:''}}</span></view>
|
|
<view><span>柜内温度:</span><span>{{equipment.cabinetTm?equipment.cabinetTm:''}}</span></view>
|
|
- <view v-if="equipment.hasTodayAlarm">
|
|
|
|
|
|
+ <view v-if="equipment.hasTodayAlarm">
|
|
<view><span>报警内容:</span></view>
|
|
<view><span>报警内容:</span></view>
|
|
<view v-for="(alarm,index) in equipment.alarmList" :key="index">
|
|
<view v-for="(alarm,index) in equipment.alarmList" :key="index">
|
|
- <view><span class="baojing">{{alarm.occurrenceTime?alarm.occurrenceTime:''}} {{alarm.alarmContent}}</span></view>
|
|
|
|
|
|
+ <view><span class="baojing">{{alarm.occurrenceTime?alarm.occurrenceTime:''}} {{alarm.alarmContent}}</span></view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
- <view v-else>
|
|
|
|
- <view><span>报警内容:</span><span>{{equipment.occurrenceTime?equipment.occurrenceTime:''}} {{equipment.alarmContent}}</span></view>
|
|
|
|
|
|
+ <view v-else>
|
|
|
|
+ <view><span>报警内容:</span><span>{{equipment.occurrenceTime?equipment.occurrenceTime:''}}
|
|
|
|
+ {{equipment.alarmContent}}</span></view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</uni-collapse-item>
|
|
</uni-collapse-item>
|
|
</view>
|
|
</view>
|
|
- </uni-collapse>
|
|
|
|
|
|
+ </uni-collapse>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</uni-collapse-item>
|
|
</uni-collapse-item>
|
|
@@ -69,17 +72,20 @@
|
|
<view v-else>
|
|
<view v-else>
|
|
<uni-collapse :show-animation="true">
|
|
<uni-collapse :show-animation="true">
|
|
<view class="titleFlag">
|
|
<view class="titleFlag">
|
|
- <image class="img" src="../../static/img/red.png" ></image> <font class="wenziT">{{$t('equipmentStatusList.red')}}</font>
|
|
|
|
- <image class="img" src="../../static/img/green.png"></image> <font class="wenziT">{{$t('equipmentStatusList.green')}}</font>
|
|
|
|
|
|
+ <image class="img" src="../../static/img/red.png"></image>
|
|
|
|
+ <font class="wenziT">{{$t('equipmentStatusList.red')}}</font>
|
|
|
|
+ <image class="img" src="../../static/img/green.png"></image>
|
|
|
|
+ <font class="wenziT">{{$t('equipmentStatusList.green')}}</font>
|
|
</view>
|
|
</view>
|
|
<view class="titlelist" style="position: relative;" v-for="equipment in merchantList[0].equipmentList" :key="equipment.id">
|
|
<view class="titlelist" style="position: relative;" v-for="equipment in merchantList[0].equipmentList" :key="equipment.id">
|
|
<span class="status-css" :class="equipment.hasTodayAlarm===true?statusError : statusNormal"></span>
|
|
<span class="status-css" :class="equipment.hasTodayAlarm===true?statusError : statusNormal"></span>
|
|
<uni-collapse-item :title="getEquipmentTitle(equipment)">
|
|
<uni-collapse-item :title="getEquipmentTitle(equipment)">
|
|
|
|
+ <!-- 睡眠 -->
|
|
<view style="padding: 20upx;background-color: antiquewhite;">
|
|
<view style="padding: 20upx;background-color: antiquewhite;">
|
|
<view class="swithBox" v-if="equipment.isSleep">
|
|
<view class="swithBox" v-if="equipment.isSleep">
|
|
<view class="swichFont">{{$t('equipmentStatusList.sleep')}}</view>
|
|
<view class="swichFont">{{$t('equipmentStatusList.sleep')}}</view>
|
|
<view class="switch">
|
|
<view class="switch">
|
|
- <switch style="transform:scale(0.65)" checked @change="change(equipment.id,0)" />
|
|
|
|
|
|
+ <switch style="transform:scale(0.65)" checked @change="change(equipment.id,0)" />
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
<view class="swithBox" v-else>
|
|
<view class="swithBox" v-else>
|
|
@@ -89,19 +95,32 @@
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
<view class="line1"></view>
|
|
<view class="line1"></view>
|
|
- <view class="swithBox" v-if="equipment.eqeStatus==0">
|
|
|
|
- <view class="swichFont">{{$t('equipmentStatusList.off')}}</view>
|
|
|
|
- <view class="switch">
|
|
|
|
- <switch style="transform:scale(0.65)" checked @change="OnOff(equipment.id,1)" />
|
|
|
|
|
|
+ <!-- 关机 -->
|
|
|
|
+ <view class="" v-if="globalUser.open==0">
|
|
|
|
+ <view class="swithBox" v-if="equipment.eqeStatus==0">
|
|
|
|
+ <view class="swichFont">{{$t('equipmentStatusList.off')}}</view>
|
|
|
|
+ <view class="switch">
|
|
|
|
+ <switch style="transform:scale(0.65)" checked @change="OnOff(equipment.id,1)" />
|
|
|
|
+ </view>
|
|
</view>
|
|
</view>
|
|
- </view>
|
|
|
|
- <view class="swithBox" v-else>
|
|
|
|
- <view class="swichFont">{{$t('equipmentStatusList.on')}}</view>
|
|
|
|
- <view class="switch">
|
|
|
|
- <switch style="transform:scale(0.65)" :checked="onffChecked" @change="OnOff(equipment.id,0)" />
|
|
|
|
|
|
+ <view class="swithBox" v-else>
|
|
|
|
+ <view class="swichFont">{{$t('equipmentStatusList.on')}}</view>
|
|
|
|
+ <view class="switch">
|
|
|
|
+ <switch style="transform:scale(0.65)" :checked="onffChecked" @change="OnOff(equipment.id,0)" />
|
|
|
|
+ </view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
|
|
+
|
|
<view class="line1"></view>
|
|
<view class="line1"></view>
|
|
|
|
+ <!-- 远程开门 -->
|
|
|
|
+ <view class="opendoor"><span>{{$t('equipmentStatusList.door')}}:</span>
|
|
|
|
+ <view class="button">
|
|
|
|
+ <button type="primary" @click="openDoor(equipment.id)" class="button">
|
|
|
|
+ <p class="p">{{$t('equipmentStatusList.open')}}</p>
|
|
|
|
+ </button>
|
|
|
|
+ </view>
|
|
|
|
+ </view>
|
|
|
|
+
|
|
<view><span>{{$t('equipmentStatusList.equipmentNo')}}:</span><span>{{equipment.clientId}}</span></view>
|
|
<view><span>{{$t('equipmentStatusList.equipmentNo')}}:</span><span>{{equipment.clientId}}</span></view>
|
|
<view><span>{{$t('equipmentStatusList.area')}}:</span><span>{{equipment.fullName?equipment.fullName:''}}</span></view>
|
|
<view><span>{{$t('equipmentStatusList.area')}}:</span><span>{{equipment.fullName?equipment.fullName:''}}</span></view>
|
|
<view><span>{{$t('equipmentStatusList.temperature')}}:</span><span>{{equipment.furnaceTm?equipment.furnaceTm:''}}</span></view>
|
|
<view><span>{{$t('equipmentStatusList.temperature')}}:</span><span>{{equipment.furnaceTm?equipment.furnaceTm:''}}</span></view>
|
|
@@ -110,28 +129,35 @@
|
|
<view class="" v-if="equipment.hasTodayAlarm">
|
|
<view class="" v-if="equipment.hasTodayAlarm">
|
|
<view><span>{{$t('equipmentStatusList.alarm')}}:</span></view>
|
|
<view><span>{{$t('equipmentStatusList.alarm')}}:</span></view>
|
|
<view v-for="(alarm,index) in equipment.alarmList" :key="index">
|
|
<view v-for="(alarm,index) in equipment.alarmList" :key="index">
|
|
- <view><span class="baojing">{{alarm.occurrenceTime?alarm.occurrenceTime:''}} {{alarm.alarmContent}}</span></view>
|
|
|
|
|
|
+ <view><span class="baojing">{{alarm.occurrenceTime?alarm.occurrenceTime:''}} {{alarm.alarmContent}}</span></view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
<view class="" v-else>
|
|
<view class="" v-else>
|
|
- <view><span>{{$t('equipmentStatusList.alarm')}}:</span><span>{{equipment.occurrenceTime?equipment.occurrenceTime:''}} {{equipment.alarmContent}}</span></view>
|
|
|
|
|
|
+ <view><span>{{$t('equipmentStatusList.alarm')}}:</span><span>{{equipment.occurrenceTime?equipment.occurrenceTime:''}}
|
|
|
|
+ {{equipment.alarmContent}}</span></view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</uni-collapse-item>
|
|
</uni-collapse-item>
|
|
</view>
|
|
</view>
|
|
- </uni-collapse>
|
|
|
|
|
|
+ </uni-collapse>
|
|
</view>
|
|
</view>
|
|
-
|
|
|
|
|
|
+
|
|
</template>
|
|
</template>
|
|
|
|
|
|
<script>
|
|
<script>
|
|
- import {mapState,mapActions,mapMutations} from 'vuex'
|
|
|
|
|
|
+ import {
|
|
|
|
+ mapState,
|
|
|
|
+ mapActions,
|
|
|
|
+ mapMutations
|
|
|
|
+ } from 'vuex'
|
|
import uniCollapse from '@/components/uni-collapse/uni-collapse.vue'
|
|
import uniCollapse from '@/components/uni-collapse/uni-collapse.vue'
|
|
import uniCollapseItem from '@/components/uni-collapse-item/uni-collapse-item.vue'
|
|
import uniCollapseItem from '@/components/uni-collapse-item/uni-collapse-item.vue'
|
|
import uniList from '@/components/uni-list/uni-list.vue'
|
|
import uniList from '@/components/uni-list/uni-list.vue'
|
|
import uniListItem from '@/components/uni-list-item/uni-list-item.vue'
|
|
import uniListItem from '@/components/uni-list-item/uni-list-item.vue'
|
|
- import {dateUtils} from '@/common/util.js';
|
|
|
|
- export default {
|
|
|
|
|
|
+ import {
|
|
|
|
+ dateUtils
|
|
|
|
+ } from '@/common/util.js';
|
|
|
|
+ export default {
|
|
components: {
|
|
components: {
|
|
uniCollapse,
|
|
uniCollapse,
|
|
uniCollapseItem,
|
|
uniCollapseItem,
|
|
@@ -140,64 +166,113 @@
|
|
},
|
|
},
|
|
data() {
|
|
data() {
|
|
return {
|
|
return {
|
|
- globalUser:{},
|
|
|
|
- merchantList:[{equipmentList:[]}],
|
|
|
|
|
|
+ globalUser: {},
|
|
|
|
+ merchantList: [{
|
|
|
|
+ equipmentList: []
|
|
|
|
+ }],
|
|
extraIcon: {
|
|
extraIcon: {
|
|
color: '#4cd964',
|
|
color: '#4cd964',
|
|
size: '22',
|
|
size: '22',
|
|
type: 'spinner'
|
|
type: 'spinner'
|
|
},
|
|
},
|
|
- statusNormal:'status-normal',
|
|
|
|
- statusError:'status-error',
|
|
|
|
- sleepChecked:null,
|
|
|
|
- onffChecked:null,
|
|
|
|
|
|
+ statusNormal: 'status-normal',
|
|
|
|
+ statusError: 'status-error',
|
|
|
|
+ sleepChecked: null,
|
|
|
|
+ onffChecked: null,
|
|
|
|
+ time: null,
|
|
|
|
+ timeAll: {
|
|
|
|
+
|
|
|
|
+ },
|
|
|
|
+ input: 0,
|
|
}
|
|
}
|
|
},
|
|
},
|
|
computed: {
|
|
computed: {
|
|
...mapState(['loginUser']),
|
|
...mapState(['loginUser']),
|
|
},
|
|
},
|
|
- onLoad(state){
|
|
|
|
- // this.getEquipmentListData();
|
|
|
|
- },
|
|
|
|
onPullDownRefresh() {
|
|
onPullDownRefresh() {
|
|
this.getEquipmentListData();
|
|
this.getEquipmentListData();
|
|
},
|
|
},
|
|
onShow() {
|
|
onShow() {
|
|
|
|
+ this.input = this.input + 1;
|
|
this.globalUser = uni.getStorageSync("globalUser");
|
|
this.globalUser = uni.getStorageSync("globalUser");
|
|
- uni.setNavigationBarTitle({title: this.$t('equipmentStatusList.title')});
|
|
|
|
- uni.setTabBarItem({ index: 3,text: this.$t('tabs.tab4')});
|
|
|
|
- this.getEquipmentListData();
|
|
|
|
|
|
+ uni.setNavigationBarTitle({
|
|
|
|
+ title: this.$t('equipmentStatusList.title')
|
|
|
|
+ });
|
|
|
|
+ uni.setTabBarItem({
|
|
|
|
+ index: 3,
|
|
|
|
+ text: this.$t('tabs.tab4')
|
|
|
|
+ });
|
|
|
|
+ if (this.globalUser.id!=null) {
|
|
|
|
+ this.getEquipmentListData();
|
|
|
|
+ }else{
|
|
|
|
+ uni.reLaunch({
|
|
|
|
+ url: '../Login/Login',
|
|
|
|
+ });
|
|
|
|
+ }
|
|
},
|
|
},
|
|
methods: {
|
|
methods: {
|
|
...mapActions('chart', ['getEquipmentListByUser']),
|
|
...mapActions('chart', ['getEquipmentListByUser']),
|
|
- getMerchantTitle(merchant){
|
|
|
|
- return merchant.name?merchant.name:merchant.username;
|
|
|
|
|
|
+ getMerchantTitle(merchant) {
|
|
|
|
+ return merchant.name ? merchant.name : merchant.username;
|
|
},
|
|
},
|
|
- getEquipmentTitle(equipment){
|
|
|
|
- return equipment.name?equipment.name:'暂无名称';
|
|
|
|
|
|
+ getEquipmentTitle(equipment) {
|
|
|
|
+ return equipment.name ? equipment.name : '暂无名称';
|
|
},
|
|
},
|
|
- getEquipmentListData(){
|
|
|
|
|
|
+ getEquipmentListData() {
|
|
this.getEquipmentListByUser(this.globalUser)
|
|
this.getEquipmentListByUser(this.globalUser)
|
|
- .then(data => {
|
|
|
|
- this.merchantList = data;
|
|
|
|
- var listName = data[0].equipmentList;
|
|
|
|
- var listId = data[0].id;
|
|
|
|
- if(listId!=null && listId!='1'){
|
|
|
|
- uni.setStorageSync("listName",listName);
|
|
|
|
- }
|
|
|
|
- uni.stopPullDownRefresh();
|
|
|
|
- }
|
|
|
|
- , _ => void uni.stopPullDownRefresh());
|
|
|
|
|
|
+ .then(data => {
|
|
|
|
+ this.merchantList = data;
|
|
|
|
+ var listName = data[0].equipmentList;
|
|
|
|
+ var times = new Map;
|
|
|
|
+ if (this.input == 1) {
|
|
|
|
+ for (var i = 0; i < listName.length; i++) {
|
|
|
|
+ var k = listName[i].id;
|
|
|
|
+ times.set(k, null);
|
|
|
|
+ }
|
|
|
|
+ this.timeAll = times;
|
|
|
|
+ }
|
|
|
|
+ var listId = data[0].id;
|
|
|
|
+ if (listId != null && listId != '1') {
|
|
|
|
+ uni.setStorageSync("listName", listName);
|
|
|
|
+ }
|
|
|
|
+ uni.stopPullDownRefresh();
|
|
|
|
+ }, _ => void uni.stopPullDownRefresh());
|
|
},
|
|
},
|
|
- OnOff(id,code){
|
|
|
|
|
|
+ OnOff(id, code) {
|
|
var that = this;
|
|
var that = this;
|
|
|
|
+ uni.request({
|
|
|
|
+ url: that.serverurl + '/TEquipment/onoffStatus',
|
|
|
|
+ data: {
|
|
|
|
+ "equipmentId": id
|
|
|
|
+ },
|
|
|
|
+ method: "POST",
|
|
|
|
+ success: (res) => {
|
|
|
|
+
|
|
|
|
+ },
|
|
|
|
+ });
|
|
|
|
+ var ddd = this.timeAll.get(id);
|
|
|
|
+ if (that.timeAll.get(id) != null) {
|
|
|
|
+ var stamp = Date.parse(new Date());
|
|
|
|
+ var t = (stamp - that.timeAll.get(id)) / 1000;
|
|
|
|
+ if (t < 30) {
|
|
|
|
+ var s = 30 - t;
|
|
|
|
+ uni.showModal({
|
|
|
|
+ title: that.$t('equipmentStatusList.onoff'),
|
|
|
|
+ content: that.$t('equipmentStatusList.remainingtime') + s + "s",
|
|
|
|
+ success: function(res) {
|
|
|
|
+ that.getEquipmentListData();
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
var code1 = code;
|
|
var code1 = code;
|
|
- if(code1==0){
|
|
|
|
|
|
+ if (code1 == 0) {
|
|
uni.showModal({
|
|
uni.showModal({
|
|
- title: that.$t('equipmentStatusList.tip'),
|
|
|
|
- content: that.$t('equipmentStatusList.onoffTip'),
|
|
|
|
- success: function (res) {
|
|
|
|
- if (res.confirm) {
|
|
|
|
|
|
+ title: that.$t('equipmentStatusList.tip'),
|
|
|
|
+ content: that.$t('equipmentStatusList.onoffTip'),
|
|
|
|
+ success: function(res) {
|
|
|
|
+ if (res.confirm) {
|
|
var serverurl = that.serverurl;
|
|
var serverurl = that.serverurl;
|
|
var code2 = code1;
|
|
var code2 = code1;
|
|
var equipmentId = id;
|
|
var equipmentId = id;
|
|
@@ -210,16 +285,40 @@
|
|
method: "POST",
|
|
method: "POST",
|
|
success: (res) => {
|
|
success: (res) => {
|
|
var list = res.data.data;
|
|
var list = res.data.data;
|
|
|
|
+ that.input = 2;
|
|
|
|
+ var timestamp = Date.parse(new Date());
|
|
|
|
+ that.timeAll.set(id, timestamp);
|
|
|
|
+ var oo = that.timeAll;
|
|
|
|
+ // that.time = timestamp;
|
|
that.getEquipmentListData();
|
|
that.getEquipmentListData();
|
|
|
|
+ if (list == 'SUCCESS') {
|
|
|
|
+ uni.showModal({
|
|
|
|
+ title: that.$t('equipmentStatusList.guanji'),
|
|
|
|
+ content: that.$t('equipmentStatusList.tishi'),
|
|
|
|
+ success: function(res) {
|
|
|
|
+ that.getEquipmentListData();
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ } else {
|
|
|
|
+ uni.showModal({
|
|
|
|
+ title: that.$t('equipmentStatusList.error'),
|
|
|
|
+ content: that.$t('equipmentStatusList.guanjierror'),
|
|
|
|
+ success: function(res) {
|
|
|
|
+ that.onffChecked = true;
|
|
|
|
+ that.getEquipmentListData();
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ }
|
|
|
|
+
|
|
}
|
|
}
|
|
});
|
|
});
|
|
- } else if (res.cancel) {
|
|
|
|
|
|
+ } else if (res.cancel) {
|
|
that.onffChecked = false;
|
|
that.onffChecked = false;
|
|
that.getEquipmentListData();
|
|
that.getEquipmentListData();
|
|
- }
|
|
|
|
- }
|
|
|
|
|
|
+ }
|
|
|
|
+ }
|
|
});
|
|
});
|
|
- }else{
|
|
|
|
|
|
+ } else {
|
|
var serverurl = that.serverurl;
|
|
var serverurl = that.serverurl;
|
|
var code = code;
|
|
var code = code;
|
|
var equipmentId = id;
|
|
var equipmentId = id;
|
|
@@ -231,21 +330,63 @@
|
|
},
|
|
},
|
|
method: "POST",
|
|
method: "POST",
|
|
success: (res) => {
|
|
success: (res) => {
|
|
|
|
+ that.input = 2;
|
|
var list = res.data.data;
|
|
var list = res.data.data;
|
|
that.getEquipmentListData();
|
|
that.getEquipmentListData();
|
|
|
|
+ var timestamp = Date.parse(new Date());
|
|
|
|
+ that.timeAll.set(id, timestamp);
|
|
|
|
+ var oo = that.timeAll;
|
|
|
|
+ // that.time = timestamp;
|
|
|
|
+ if (list == "SUCCESS") {
|
|
|
|
+ uni.showModal({
|
|
|
|
+ title: that.$t('equipmentStatusList.kaiji'),
|
|
|
|
+ content: that.$t('equipmentStatusList.tishi'),
|
|
|
|
+ success: function(res) {
|
|
|
|
+ that.getEquipmentListData();
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ } else {
|
|
|
|
+ uni.showModal({
|
|
|
|
+ title: that.$t('equipmentStatusList.error'),
|
|
|
|
+ content: that.$t('equipmentStatusList.kaijierror'),
|
|
|
|
+ success: function(res) {
|
|
|
|
+ that.onffChecked = false;
|
|
|
|
+ that.getEquipmentListData();
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ }
|
|
|
|
+
|
|
}
|
|
}
|
|
});
|
|
});
|
|
}
|
|
}
|
|
},
|
|
},
|
|
- change(id,code){
|
|
|
|
|
|
+ openDoor(id) {
|
|
|
|
+ uni.request({
|
|
|
|
+ url: this.serverurl + '/TEquipment/openDoor',
|
|
|
|
+ data: {
|
|
|
|
+ "equipmentId": id
|
|
|
|
+ },
|
|
|
|
+ method: "POST",
|
|
|
|
+ success: (res) => {
|
|
|
|
+ uni.showModal({
|
|
|
|
+ title: this.$t('equipmentStatusList.open'),
|
|
|
|
+ content: this.$t('equipmentStatusList.opensuccess'),
|
|
|
|
+ success: function(res) {
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+ },
|
|
|
|
+ change(id, code) {
|
|
var that = this;
|
|
var that = this;
|
|
var code1 = code;
|
|
var code1 = code;
|
|
- if(code1==1){
|
|
|
|
|
|
+ if (code1 == 1) {
|
|
uni.showModal({
|
|
uni.showModal({
|
|
- title: that.$t('equipmentStatusList.tip'),
|
|
|
|
- content: that.$t('equipmentStatusList.sleepTip'),
|
|
|
|
- success: function (res) {
|
|
|
|
- if (res.confirm) {
|
|
|
|
|
|
+ title: that.$t('equipmentStatusList.tip'),
|
|
|
|
+ content: that.$t('equipmentStatusList.sleepTip'),
|
|
|
|
+ success: function(res) {
|
|
|
|
+ if (res.confirm) {
|
|
var serverurl = that.serverurl;
|
|
var serverurl = that.serverurl;
|
|
var code2 = code1;
|
|
var code2 = code1;
|
|
var equipmentId = id;
|
|
var equipmentId = id;
|
|
@@ -261,13 +402,13 @@
|
|
that.getEquipmentListData();
|
|
that.getEquipmentListData();
|
|
}
|
|
}
|
|
});
|
|
});
|
|
- } else if (res.cancel) {
|
|
|
|
|
|
+ } else if (res.cancel) {
|
|
that.sleepChecked = false;
|
|
that.sleepChecked = false;
|
|
that.getEquipmentListData();
|
|
that.getEquipmentListData();
|
|
- }
|
|
|
|
- }
|
|
|
|
|
|
+ }
|
|
|
|
+ }
|
|
});
|
|
});
|
|
- }else{
|
|
|
|
|
|
+ } else {
|
|
var serverurl = that.serverurl;
|
|
var serverurl = that.serverurl;
|
|
var code = code;
|
|
var code = code;
|
|
var equipmentId = id;
|
|
var equipmentId = id;
|
|
@@ -284,25 +425,9 @@
|
|
}
|
|
}
|
|
});
|
|
});
|
|
}
|
|
}
|
|
-
|
|
|
|
- // var serverurl = this.serverurl;
|
|
|
|
- // var code = code;
|
|
|
|
- // var equipmentId = id;
|
|
|
|
- // uni.request({
|
|
|
|
- // url: serverurl + '/TEquipment/sleep',
|
|
|
|
- // data: {
|
|
|
|
- // "adminId": code,
|
|
|
|
- // "equipmentId": equipmentId
|
|
|
|
- // },
|
|
|
|
- // method: "POST",
|
|
|
|
- // success: (res) => {
|
|
|
|
- // var list = res.data.data;
|
|
|
|
- // this.getEquipmentListData();
|
|
|
|
- // }
|
|
|
|
- // });
|
|
|
|
},
|
|
},
|
|
}
|
|
}
|
|
- }
|
|
|
|
|
|
+ }
|
|
</script>
|
|
</script>
|
|
|
|
|
|
<style>
|
|
<style>
|
|
@@ -316,16 +441,20 @@
|
|
color: "#596D83";
|
|
color: "#596D83";
|
|
font-size: 12upx;
|
|
font-size: 12upx;
|
|
}
|
|
}
|
|
|
|
+
|
|
.status-error {
|
|
.status-error {
|
|
background-color: #dd524d
|
|
background-color: #dd524d
|
|
}
|
|
}
|
|
|
|
+
|
|
.status-normal {
|
|
.status-normal {
|
|
background-color: #4cd964
|
|
background-color: #4cd964
|
|
}
|
|
}
|
|
- .baojing{
|
|
|
|
|
|
+
|
|
|
|
+ .baojing {
|
|
padding-left: 120upx;
|
|
padding-left: 120upx;
|
|
}
|
|
}
|
|
- .titleFlag{
|
|
|
|
|
|
+
|
|
|
|
+ .titleFlag {
|
|
height: 56upx;
|
|
height: 56upx;
|
|
background-color: #F8F8F8;
|
|
background-color: #F8F8F8;
|
|
color: #8C959F;
|
|
color: #8C959F;
|
|
@@ -333,36 +462,60 @@
|
|
display: flex;
|
|
display: flex;
|
|
flex-direction: row;
|
|
flex-direction: row;
|
|
}
|
|
}
|
|
- .img{
|
|
|
|
|
|
+
|
|
|
|
+ .opendoor {
|
|
|
|
+ padding-top: 10upx;
|
|
|
|
+ padding-bottom: 10upx;
|
|
|
|
+ text-align: center;
|
|
|
|
+ display: flex;
|
|
|
|
+ flex-direction: row;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ .button {
|
|
|
|
+ padding-left: 15upx;
|
|
|
|
+ padding-top: 2upx;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ .p {
|
|
|
|
+ padding-left: 10upx;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ .img {
|
|
padding-top: 20upx;
|
|
padding-top: 20upx;
|
|
padding-left: 30upx;
|
|
padding-left: 30upx;
|
|
width: 15upx;
|
|
width: 15upx;
|
|
height: 15upx;
|
|
height: 15upx;
|
|
}
|
|
}
|
|
- .wenziT{
|
|
|
|
|
|
+
|
|
|
|
+ .wenziT {
|
|
padding-top: 10upx;
|
|
padding-top: 10upx;
|
|
padding-left: 10upx;
|
|
padding-left: 10upx;
|
|
}
|
|
}
|
|
- .titlelist{
|
|
|
|
- color:#363D44;
|
|
|
|
|
|
+
|
|
|
|
+ .titlelist {
|
|
|
|
+ color: #363D44;
|
|
font-size: 16upx;
|
|
font-size: 16upx;
|
|
font-family: "PingFang-SC-Medium";
|
|
font-family: "PingFang-SC-Medium";
|
|
}
|
|
}
|
|
- .swithBox{
|
|
|
|
|
|
+
|
|
|
|
+ .swithBox {
|
|
display: flex;
|
|
display: flex;
|
|
flex-direction: row;
|
|
flex-direction: row;
|
|
padding-bottom: 15upx;
|
|
padding-bottom: 15upx;
|
|
padding-top: 5upx;
|
|
padding-top: 5upx;
|
|
}
|
|
}
|
|
- .switch{
|
|
|
|
|
|
+
|
|
|
|
+ .switch {
|
|
width: 44upx;
|
|
width: 44upx;
|
|
height: 22upx;
|
|
height: 22upx;
|
|
}
|
|
}
|
|
- .swichFont{
|
|
|
|
|
|
+
|
|
|
|
+ .swichFont {
|
|
width: 85%;
|
|
width: 85%;
|
|
padding-top: 12upx;
|
|
padding-top: 12upx;
|
|
}
|
|
}
|
|
- .line1{
|
|
|
|
|
|
+
|
|
|
|
+ .line1 {
|
|
width: 100%;
|
|
width: 100%;
|
|
height: 3upx;
|
|
height: 3upx;
|
|
background: #000000;
|
|
background: #000000;
|