瀏覽代碼

Merge branch 'master' of http://106.14.142.95:3000/wangyuanbo/bt

# Conflicts:
#	imcs-bt-fe/imcs-bt-fe/imcs-ui/src/lang/zh/btOrder.js
#	imcs-bt-fe/imcs-bt-fe/imcs-ui/src/views/zuihou/order/allOrders.vue
#	imcs-bt-fe/imcs-bt-fe/imcs-ui/src/views/zuihou/productionresource/components/allOrders.vue
wangyuanbo 2 年之前
父節點
當前提交
33e99be3cb

+ 32 - 1
imcs-bt-be/imcs-authority-server/src/main/java/com/github/zuihou/api/OpsAppApi.java

@@ -1,6 +1,7 @@
 package com.github.zuihou.api;
 
 import cn.hutool.core.bean.BeanUtil;
+import cn.hutool.core.collection.CollectionUtil;
 import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
@@ -33,6 +34,7 @@ import org.springframework.web.bind.annotation.*;
 
 import java.time.LocalDateTime;
 import java.util.*;
+import java.util.stream.Collectors;
 
 /**
  * 运维小程序接口
@@ -70,7 +72,18 @@ public class OpsAppApi {
         LbqWrapper<ProductionResource> queryWrap = Wraps.lbQ();
         ProductionResource productionResource = BeanUtil.toBean(params.getModel(), ProductionResource.class);
         queryWrap.eq(ProductionResource::getStatus, "1").orderByDesc(ProductionResource::getCreateTime);
+        if(StringUtils.isNotEmpty(productionResource.getOnlineStatus())){
+            List<String> ids = productionTenantResourceService.getEquStatusIds(productionResource.getOnlineStatus());
+            queryWrap.in(ProductionResource::getId, ids);
+        }
         IPage<ProductionResource> list = productionTenantResourceService.pageList(page, queryWrap);
+        if(null!=list.getRecords() && list.getRecords().size()>0) {
+            list.getRecords().stream().forEach(item -> {
+                Map map = productionTenantResourceService.getEquRunInfo(item.getId());
+                item.setOnlineStatus(map.containsKey("equStatus")?map.get("equStatus").toString():"0");
+                item.setErrMsg(map.containsKey("errMsg") && map.get("errMsg")!=null ?map.get("errMsg").toString():"");
+            });
+        }
         return R.success(list);
     }
 
@@ -108,7 +121,16 @@ public class OpsAppApi {
         queryWrap.eq(ProductionResource::getId, equId);
         Page<ProductionResource> page = new Page<>(1L, 1);
         IPage<ProductionResource> productionResourceList = productionTenantResourceService.pageList(page, queryWrap);
-        return R.success(productionResourceList.getRecords().size() > 0 ? productionResourceList.getRecords().get(0) : ProductionResource.builder().build());
+        ProductionResource productionResource = null;
+        if(productionResourceList.getRecords().size()>0){
+            productionResource = productionResourceList.getRecords().get(0);
+            Map map = productionTenantResourceService.getEquRunInfo(productionResource.getId());
+            productionResource.setOnlineStatus(map.containsKey("equStatus")?map.get("equStatus").toString():"0");
+            productionResource.setErrMsg(map.containsKey("errMsg") && map.get("errMsg")!=null ?map.get("errMsg").toString():"");
+        }else{
+            productionResource = ProductionResource.builder().build();
+        }
+        return R.success(productionResource);
     }
 
 
@@ -244,6 +266,15 @@ public class OpsAppApi {
             paramsMap.put("orgIds", orgIds);
         }
         Map map = orderService.getStatisticMap(paramsMap);
+        //补充异常设备数据
+        List<String> ids = productionTenantResourceService.getEquStatusIds("2");
+        List<Long> orgArr = CommonUtil.getOrgIdsArr();
+        if(ids.size()>0 && orgArr.size()>0) {
+            ids = productionTenantResourceService.listByIds(ids).stream().filter(item->CollectionUtil.contains(orgArr,(Long)item.getOrgId())
+            ).map(item->item.getId().toString()).collect(Collectors.toList());
+        }
+        map.put("exceptDevice", ids.size());
+        map.put("lackDevice", ids.size());
         return R.success(map);
     }
 

+ 2 - 0
imcs-bt-be/imcs-business-biz/src/main/java/com/github/zuihou/business/productionresource/service/ProductionTenantResourceService.java

@@ -25,4 +25,6 @@ public interface ProductionTenantResourceService extends SuperService<Production
     List<EquGoodsDto> getEquGoods(Long equId);
 
     HashMap<String, String> getEquRunInfo(Long equId);
+
+    List<String> getEquStatusIds(String onlineStatus);
 }

+ 12 - 0
imcs-bt-be/imcs-business-biz/src/main/java/com/github/zuihou/business/productionresource/service/impl/ProductionTenantResourceServiceImpl.java

@@ -16,6 +16,8 @@ import org.springframework.stereotype.Service;
 
 import java.util.HashMap;
 import java.util.List;
+import java.util.Set;
+import java.util.stream.Collectors;
 
 /**
  * <p>
@@ -60,4 +62,14 @@ public class ProductionTenantResourceServiceImpl extends SuperServiceImpl<Produc
         }
         return resultMap;
     }
+
+    @Override
+    public List<String> getEquStatusIds(String onlineStatus) {
+        Set<String> keys = redisTemplate.keys("equStatus" + "*");
+        List<String> list=keys.stream().filter(key->{
+            String status = (String) redisTemplate.opsForHash().get(key, "status");
+            return status.equals(onlineStatus);
+        }).map(item->item.replace("equStatus","")).collect(Collectors.toList());
+        return list;
+    }
 }

+ 9 - 3
imcs-bt-be/imcs-business-controller/src/main/java/com/github/zuihou/business/controller/productionresource/ProductionResourceController.java

@@ -30,6 +30,7 @@ import com.github.zuihou.utils.DateUtils;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 import lombok.extern.slf4j.Slf4j;
+import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.validation.annotation.Validated;
 import org.springframework.web.bind.annotation.*;
@@ -87,9 +88,14 @@ public class ProductionResourceController extends SuperController<ProductionTena
         ProductionResource model = BeanUtil.toBean(data, ProductionResource.class);
         QueryWrap<ProductionResource> wrap = this.handlerWrapper(null, params);
         LbqWrapper<ProductionResource> wrapper = wrap.lambda();
-        wrapper.like(ProductionResource::getName, model.getName()).like(ProductionResource::getStatus, model.getStatus()).eq(ProductionResource::getOnlineStatus, model.getOnlineStatus()).eq(ProductionResource::getPlaceId, model.getPlaceId())
+        wrapper.like(ProductionResource::getName, model.getName()).like(ProductionResource::getStatus, model.getStatus()).eq(ProductionResource::getPlaceId, model.getPlaceId())
                 .eq(ProductionResource::getAreaId, model.getAreaId())
                 .orderByDesc(ProductionResource::getCreateTime);
+        if(StringUtils.isNotEmpty(model.getOnlineStatus())){
+            //获取特定状态下的设备Id
+            List<String> ids = baseService.getEquStatusIds(model.getOnlineStatus());
+            wrapper.in(ProductionResource::getId, ids);
+        }
         IPage<ProductionResource> iPage = baseService.pageList(page, wrapper);
 
         String date = DateUtil.dateToString(new Date());
@@ -193,9 +199,9 @@ public class ProductionResourceController extends SuperController<ProductionTena
         list.stream().forEach(item->{
             Map<String, String> resultMap = baseService.getEquRunInfo(item.getId());
             String equStatus =  resultMap.get("equStatus");
-            if(equStatus=="0"){
+            if(equStatus.equals("0")){
                 map.put("offlineCount", map.get("offlineCount")+1);
-            }else if(equStatus=="1"){
+            }else if(equStatus.equals("1")){
                 map.put("onLineCount", map.get("onLineCount")+1);
             }else{
                 map.put("exceptCount", map.get("exceptCount")+1);

+ 3 - 0
imcs-bt-be/imcs-business-entity/src/main/java/com/github/zuihou/business/productionresource/dto/ProductionResourcePageDTO.java

@@ -191,4 +191,7 @@ public class ProductionResourcePageDTO implements Serializable {
 
     @ApiModelProperty(value = "纬度")
     private String latitude;
+
+    @ApiModelProperty(value = "错误信息")
+    private String errMsg;
 }

+ 4 - 0
imcs-bt-be/imcs-business-entity/src/main/java/com/github/zuihou/business/productionresource/entity/ProductionResource.java

@@ -326,6 +326,10 @@ public class ProductionResource extends Entity<Long> {
     @TableField(exist = false)
     private String latitude;
 
+    @ApiModelProperty(value = "错误信息")
+    @TableField(exist = false)
+    private String errMsg;
+
     @Builder
     public ProductionResource(Long id, LocalDateTime createTime, Long createUser, LocalDateTime updateTime, Long updateUser,
                               Long compnayId, String moduleId, String areaId, String name, String resourcesCategory,

+ 21 - 20
imcs-bt-fe/imcs-bt-fe/imcs-ui/src/views/zuihou/order/allOrders.vue

@@ -79,10 +79,10 @@
         </template>
       </el-table-column>
       <el-table-column :label="$t('btOrder.equ')" :show-overflow-tooltip="true" align="center"
-                       prop="deviceName"
+                       prop="orderGoodsId"
                        width="">
         <template slot-scope="scope">
-          <span>{{ scope.row.deviceName }}</span>
+          <span>{{ scope.row.equCom }}</span>
         </template>
       </el-table-column>
       <el-table-column :label="$t('btOrder.orderMemberName')" :show-overflow-tooltip="true" align="center"
@@ -101,7 +101,7 @@
         </template>
       </el-table-column>
       <el-table-column :label="$t('btOrder.orderGoodsAmount')" :show-overflow-tooltip="true" align="center"
-                       prop="orderGoodsAmount"
+                       prop="orderSpecs"
                        width="">
         <template slot-scope="scope">
           <span>{{ scope.row.orderGoodsAmount }}</span>
@@ -123,15 +123,15 @@
         </template>
       </el-table-column>
       <el-table-column :label="$t('btOrder.orderStatus')" :show-overflow-tooltip="true" align="center"
-                       prop="orderStatus" width="80px">
-        <template slot-scope="scope">
-                    {{ scope.row.orderStatus == '0' ? $t("btOrder.status.wzf") : '' }}
-                    {{ scope.row.orderStatus == '1' ? $t("btOrder.status.yzf") : '' }}
-                    {{ scope.row.orderStatus == '2' ? $t("btOrder.status.yqx") : '' }}
-                    {{ scope.row.orderStatus == '3' ? $t("btOrder.status.ywc") : '' }}
-                    {{ scope.row.orderStatus == '4' ? $t("btOrder.status.yc") : '' }}
-                    {{ scope.row.orderStatus == '5' ? $t("btOrder.status.zrtk") : '' }}
 
+                       prop="goodsCateStatus" width="80px">
+        <template slot-scope="scope">
+          {{ scope.row.orderStatus === '0' ? $t("btOrder.status.wzf") : '' }}
+          {{ scope.row.orderStatus === '1' ? $t("btOrder.status.yzf") : '' }}
+          {{ scope.row.orderStatus === '2' ? $t("btOrder.status.yqx") : '' }}
+          {{ scope.row.orderStatus === '3' ? $t("btOrder.status.scwc") : '' }}
+          {{ scope.row.orderStatus === '4' ? $t("btOrder.status.yc") : '' }}
+          {{ scope.row.orderStatus === '5' ? $t("btOrder.status.zrtk") : '' }}
         </template>
       </el-table-column>
       <el-table-column
@@ -175,10 +175,8 @@ export default {
   filters: {},
   data() {
     return {
-      statusFilter: [{text: '待支付', value: '1'}, {text: '待生产', value: '2'}, {text: '待取', value: '3'}, {
-        text: '已完成',
-        value: '4'
-      }, {text: '已取消', value: '5'}],
+      statusFilter: [{text: '未支付', value: '0'}, {text: '已支付', value: '1'},{text: '已取消', value: '2'}, {text: '生产完成', value: '3'}, {
+        text: '异常', value: '4'}, {text: '转入退款', value: '5'}],
       // :filters="[{ text: $t('common.status.valid'), value: '1' },{ text: $t('common.status.invalid'), value: '0' }]"
 
 
@@ -192,20 +190,23 @@ export default {
         type: "orderDetail"
       },
       statusOptions: [{
+        value: '0',
+        label: '未支付'
+      },{
         value: '1',
-        label: '待支付'
+        label: '支付'
       }, {
         value: '2',
-        label: '待生产'
+        label: '已取消'
       }, {
         value: '3',
-        label: '待取'
+        label: '生产完成'
       }, {
         value: '4',
-        label: '已完成'
+        label: '异常'
       }, {
         value: '5',
-        label: '已取消'
+        label: '转入退款'
       }],
       // 预览
       preview: {

+ 36 - 27
imcs-bt-fe/imcs-bt-fe/imcs-ui/src/views/zuihou/productionresource/components/allOrders.vue

@@ -31,7 +31,7 @@
         </span>
         <span>
           {{ $t("btOrder.orderStatus") }}:
-          <el-select v-model="queryParams.orderStatus">
+          <el-select v-model="queryParams.model.orderStatus">
             <el-option
               v-for="item in statusOptions"
               :key="item.value"
@@ -82,7 +82,7 @@
                        prop="orderGoodsId"
                        width="">
         <template slot-scope="scope">
-          <span>{{ scope.row.deviceName }}</span>
+          <span>{{ scope.row.equCom }}</span>
         </template>
       </el-table-column>
       <el-table-column :label="$t('btOrder.orderMemberName')" :show-overflow-tooltip="true" align="center"
@@ -124,15 +124,14 @@
       </el-table-column>
       <el-table-column :label="$t('btOrder.orderStatus')" :show-overflow-tooltip="true" align="center"
 
-                       prop="orderStatus" width="80px">
+                       prop="goodsCateStatus" width="80px">
         <template slot-scope="scope">
-          {{ scope.row.orderStatus == '0' ? $t("btOrder.status.wzf") : '' }}
-          {{ scope.row.orderStatus == '1' ? $t("btOrder.status.yzf") : '' }}
-          {{ scope.row.orderStatus == '2' ? $t("btOrder.status.yqx") : '' }}
-          {{ scope.row.orderStatus == '3' ? $t("btOrder.status.ywc") : '' }}
-          {{ scope.row.orderStatus == '4' ? $t("btOrder.status.yc") : '' }}
-          {{ scope.row.orderStatus == '5' ? $t("btOrder.status.zrtk") : '' }}
-
+          {{ scope.row.orderStatus === '0' ? $t("btOrder.status.wzf") : '' }}
+          {{ scope.row.orderStatus === '1' ? $t("btOrder.status.yzf") : '' }}
+          {{ scope.row.orderStatus === '2' ? $t("btOrder.status.yqx") : '' }}
+          {{ scope.row.orderStatus === '3' ? $t("btOrder.status.scwc") : '' }}
+          {{ scope.row.orderStatus === '4' ? $t("btOrder.status.yc") : '' }}
+          {{ scope.row.orderStatus === '5' ? $t("btOrder.status.zrtk") : '' }}
         </template>
       </el-table-column>
       <el-table-column
@@ -175,17 +174,15 @@ export default {
   components: {Pagination, OrderEdit, OrderImport, orderDetail},
   filters: {},
   props: {
-    resourceId: {
-      type: String,
-      default: ''
-    }
+      resourceId: {
+        type:String,
+        default:''
+      }
   },
   data() {
     return {
-      statusFilter: [{text: '待支付', value: '1'}, {text: '待生产', value: '2'}, {text: '待取', value: '3'}, {
-        text: '已完成',
-        value: '4'
-      }, {text: '已取消', value: '5'}],
+      statusFilter: [{text: '未支付', value: '0'}, {text: '已支付', value: '1'},{text: '已取消', value: '2'}, {text: '生产完成', value: '3'}, {
+        text: '异常', value: '4'}, {text: '转入退款', value: '5'}],
       // :filters="[{ text: $t('common.status.valid'), value: '1' },{ text: $t('common.status.invalid'), value: '0' }]"
 
 
@@ -199,20 +196,23 @@ export default {
         type: "orderDetail"
       },
       statusOptions: [{
+        value: '0',
+        label: '未支付'
+      },{
         value: '1',
-        label: '待支付'
+        label: '支付'
       }, {
         value: '2',
-        label: '待生产'
+        label: '已取消'
       }, {
         value: '3',
-        label: '待取'
+        label: '生产完成'
       }, {
         value: '4',
-        label: '已完成'
+        label: '异常'
       }, {
         value: '5',
-        label: '已取消'
+        label: '转入退款'
       }],
       // 预览
       preview: {
@@ -239,7 +239,14 @@ export default {
     };
   },
   computed: {},
-  watch: {},
+  watch: {
+    resourceId: {
+	  		handler(val, oldVal) {
+	        // 加载列表数据
+	  			this.fetch()
+	      }
+	  	}
+  },
   mounted() {
     this.fetch();
 
@@ -264,7 +271,7 @@ export default {
       this.selection = selection;
     },
     search() {
-      this.queryParams.model.orderEquId = this.resourceId
+	  this.queryParams.model.orderEquId = this.resourceId
       this.fetch({
         ...this.queryParams
       });
@@ -381,8 +388,10 @@ export default {
 
       this.queryParams.current = params.current ? params.current : this.queryParams.current;
       this.queryParams.size = params.size ? params.size : this.queryParams.size;
-      this.queryParams.model.orderEquId = this.resourceId
-      orderApi.page(this.queryParams).then(response => {
+
+	  this.queryParams.model.orderEquId = this.resourceId
+
+    orderApi.page(this.queryParams).then(response => {
         const res = response.data;
         if (res.isSuccess) {
           this.tableData = res.data;

+ 3 - 3
imcs-bt-fe/imcs-bt-fe/uni-mall/pages/device/device.vue

@@ -14,8 +14,8 @@
 					</view>					 
 				</view>
 				<view class="status">
-					<text :class="item.status==='1'? 'normal': item.status==='2'? 'exception' : 'lack'">
-					 {{item.status==='1'? '正常': (item.status==='2'? '异常' : '缺料')}}
+					<text :class="item.onlineStatus==='1'? 'normal': item.onlineStatus==='2'? 'exception' : 'lack'">
+					 {{item.onlineStatus==='1'? '正常': (item.onlineStatus==='2'? '异常' : '缺料')}}
 					</text>
 				</view>	 
 				<view class="desc">
@@ -63,7 +63,7 @@
 			getdeviceList: function(type) {
 				let that = this;
 				if(type!=null){
-					//this.queryParams.model.status = type
+					this.queryParams.model.onlineStatus = type
 				}
 				return util.request(api.DeviceList, this.queryParams, 'post', 'application/json').then(function(res) {
 					if (res.code === 0) {

+ 11 - 2
imcs-bt-fe/imcs-bt-fe/uni-mall/pages/device/deviceDetail.vue

@@ -8,8 +8,8 @@
 						<text class="name">{{device.name}}</text>
 						<text class="desc">{{device.address}}</text>
 						<text class="status"
-							:class="device.status==='1'? 'normal': device.status==='2'? 'exception' : 'lack'">
-							{{device.status==='1'? '正常': (device.status==='2'? '异常' : '缺料')}}
+							:class="device.onlineStatus==='1'? 'normal': device.onlineStatus==='2'? 'exception' : 'lack'">
+							{{device.onlineStatus==='1'? '正常': (device.onlineStatus==='2'? '异常' : '缺料')}}
 						</text>
 					</view>
 				</view>
@@ -48,6 +48,7 @@
 				<view class="h">
 					<view class="l">料筒物料</view>
 					<view class="r">
+						<text class="tip">缺料、过期</text>
 						<image class="icon" src="/static/images/go.png" />
 					</view>
 				</view>
@@ -56,6 +57,7 @@
 				<view class="h">
 					<view class="l">杯子物料</view>
 					<view class="r">
+						<text class="tip">缺料</text>
 						<image class="icon" src="/static/images/go.png" />
 					</view>
 				</view>
@@ -292,6 +294,13 @@
 		color: #b4282d;
 		font-size: 24rpx;
 	}
+	.material .r .tip{
+		margin-right: 30rpx;
+		color: #dddd6e;
+		font-size: 30rpx;
+		line-height: 60rpx;
+		height: 60rpx;		
+	}
 
 	.title {
 		margin-left: 30rpx;

+ 6 - 6
imcs-bt-fe/imcs-bt-fe/uni-mall/pages/index/index.vue

@@ -102,8 +102,8 @@
 								<text class="name">{{item.name}}</text>
 								<text class="desc">{{item.address}}</text>								
 								<text class="status"
-									:class="item.status==='1'? 'normal': item.status==='2'? 'exception' : 'lack'">
-									{{item.status==='1'? '正常': (item.status==='2'? '异常' : '缺料')}}
+									:class="item.onlineStatus==='1'? 'normal': item.onlineStatus==='2'? 'exception' : 'lack'">
+									{{item.onlineStatus==='1'? '正常': (item.onlineStatus==='2'? '异常' : '离线')}}
 								</text>
 							</view>
 						</view>
@@ -137,8 +137,8 @@
 								<text class="name">{{item.name}}</text>
 								<text class="desc">{{item.address}}</text>
 								<text class="status"
-									:class="item.status==='1'? 'normal': item.status==='2'? 'exception' : 'lack'">
-								 {{item.status==='1'? '正常': (item.status==='2'? '异常' : '缺料')}}
+									:class="item.onlineStatus==='1'? 'normal': item.onlineStatus==='2'? 'exception' : 'lack'">
+								 {{item.onlineStatus==='1'? '正常': (item.onlineStatus==='2'? '异常' : '缺料')}}
 								</text>
 							</view>
 						</view>
@@ -349,9 +349,9 @@
 						if (res.code === 0) {
 							//that.channel = res.data.channel
 							let statistic = res.data;
-							let arr = [statistic.deviceNum,1,1, statistic.todayNum,statistic.todayAmount,statistic.exceptNum];
+							let arr = [statistic.deviceNum,statistic.exceptDevice,statistic.lackDevice, statistic.todayNum,statistic.todayAmount,statistic.exceptNum];
 							that.channel.forEach((item,i)=>{								
-								item.val = arr[i]
+								item.val = arr[i]+''
 							})
 						}
 					});

+ 16 - 15
imcs-bt-fe/imcs-bt-fe/uni-mall/pages/ucenter/order/order.vue

@@ -94,8 +94,8 @@
 				index: 0,
 				index2: 0,
 				isToday: true,
-				statusId: 0,
-				deviceId: '',
+				//statusId: '0',
+				//deviceId: '',
 				deviceList: [{
 					id: '',
 					name: '全部'
@@ -103,9 +103,9 @@
 				orderCount: 2,
 				orderSum: 0.0,
 				array: [{
-					id: 0,
+					id: "",
 					name: '全部'
-				},{id:1, name: '未支付'},{id:2, name: '已支付'},{id:3, name:'已取消'},{id:4, name:'生产完成'},{id:5, name: '异常'},{id:6, name: '转入退款'},],
+				},{id:"0", name: '未支付'},{id:"1", name: '已支付'},{id:"2", name:'已取消'},{id:"3", name:'生产完成'},{id:"4", name: '异常'},{id:"5", name: '转入退款'},],
 				orderList: [
 					/*{
 					name: '美式咖啡',
@@ -147,7 +147,7 @@
 		methods: {
 			bindPickerChange: function(e) {
 				this.index = e.detail.value
-				this.statusId = this.array[this.index].id				
+				//this.statusId = this.array[this.index].id				
 				this.orderList = []
 				this.queryParams.current = 1
 				let pages = getCurrentPages();
@@ -157,7 +157,7 @@
 			},
 			bindPickerChange2: function(e) {
 				this.index2 = e.detail.value;
-				this.deviceId = this.deviceList[this.index2].id
+				//this.deviceId = this.deviceList[this.index2].id
 				this.orderList = []
 				this.queryParams.current = 1
 				//this.queryParams.model.orderEquId = this.deviceId
@@ -224,18 +224,19 @@
 				if(type=="1"){
 					that.range=[util.getNowDate(0), util.getNowDate(1)];
 					that.isToday = true
-				}else{					
+				}else{
+					if(type=="2"){
+						that.index = 5
+					}
 					that.isToday = false					
 				}
-				if (that.deviceId) {
-					that.queryParams.model.orderEquId = that.deviceId
+				if (that.index2) {
+					that.queryParams.model.orderEquId = that.deviceList[that.index2].id
 				}
-				if(that.statusId>0){
-					that.queryParams.model.orderStatus = that.statusId - 1
-					that.index = that.statusId
-				}else if(type=="2"){
-					that.queryParams.model.orderStatus = '4'
-					that.index = 5
+				if(that.index){
+					that.queryParams.model.orderStatus = that.array[that.index].id					
+				}else if(that.index==''){
+					that.queryParams.model.orderStatus =''
 				}
 				console.log(that.range)
 				if (that.range.length > 0) {