From d8228730095cdcaccb40dd2dc290fc44779e340a Mon Sep 17 00:00:00 2001
From: wangmengzhao <1036088376@qq.com>
Date: 星期三, 13 十二月 2023 22:21:52 +0800
Subject: [PATCH] 滤芯寿命清单列表接口编写20231213wmz
---
wumei-smart-master/springboot/wumei-iot/src/main/java/com/ruoyi/iot/controller/DeviceController.java | 45 +
wumei-smart-master/springboot/wumei-iot/src/main/java/com/ruoyi/iot/model/ThingsModelItem/ReadOnlyModelOutput.java | 3
wumei-smart-master/vue/src/views/equipmentManagement/maintenance.vue | 28
wumei-smart-master/springboot/wumei-iot/src/main/java/com/ruoyi/iot/model/ThingsModelItem/EnumItemOutput.java | 3
wumei-smart-master/springboot/wumei-iot/src/main/java/com/ruoyi/iot/model/ThingsModelItem/ThingsModelItemBase.java | 31
wumei-smart-master/springboot/wumei-iot/src/main/java/com/ruoyi/iot/mapper/DeviceMapper.java | 25
wumei-smart-master/springboot/wumei-iot/src/main/java/com/ruoyi/iot/domain/Device.java | 13
wumei-smart-master/springboot/wumei-iot/src/main/java/com/ruoyi/iot/model/ThingsModelItem/BoolModelOutput.java | 3
wumei-smart-master/springboot/wumei-iot/src/main/java/com/ruoyi/iot/model/ThingsModels/ThingsModelValuesOutput.java | 2
wumei-smart-master/springboot/wumei-iot/src/main/java/com/ruoyi/iot/model/ThingsModelItem/ArrayModelOutput.java | 3
wumei-smart-master/springboot/wumei-iot/src/main/java/com/ruoyi/iot/task/DeviceOrderTask.java | 12
wumei-smart-master/springboot/wumei-iot/src/main/resources/mapper/iot/DeviceMapper.xml | 115 ++
wumei-smart-master/springboot/wumei-iot/src/main/java/com/ruoyi/iot/model/ThingsModels/PropertyDto.java | 1
wumei-smart-master/springboot/wumei-iot/src/main/java/com/ruoyi/iot/domain/DeviceOrder.java | 14
wumei-smart-master/springboot/wumei-iot/src/main/java/com/ruoyi/iot/model/ThingsModels/ThingsModelValueRemarkItem.java | 1
wumei-smart-master/springboot/wumei-iot/src/main/java/com/ruoyi/iot/service/impl/DeviceServiceImpl.java | 5
wumei-smart-master/vue/src/views/equipmentManagement/installation.vue | 1855 +++++++++++++++++++++++++++--------------------
wumei-smart-master/springboot/pom.xml | 3
wumei-smart-master/springboot/wumei-iot/src/main/java/com/ruoyi/iot/model/ThingsModels/IdentityAndName.java | 1
wumei-smart-master/springboot/wumei-iot/src/main/java/com/ruoyi/iot/service/IDeviceService.java | 8
wumei-smart-master/springboot/wumei-iot/src/main/resources/mapper/iot/DeviceOrderMapper.xml | 6
wumei-smart-master/springboot/wumei-iot/src/main/java/com/ruoyi/iot/dto/DeviceFilterDto.java | 117 +++
wumei-smart-master/springboot/wumei-iot/src/main/java/com/ruoyi/iot/model/ThingsModels/ThingsModelValueItemDto.java | 2
wumei-smart-master/.idea/compiler.xml | 16
wumei-smart-master/.idea/encodings.xml | 4
25 files changed, 1,471 insertions(+), 845 deletions(-)
diff --git a/wumei-smart-master/.idea/compiler.xml b/wumei-smart-master/.idea/compiler.xml
index 990b97e..573d8ea 100644
--- a/wumei-smart-master/.idea/compiler.xml
+++ b/wumei-smart-master/.idea/compiler.xml
@@ -18,14 +18,14 @@
</component>
<component name="JavacSettings">
<option name="ADDITIONAL_OPTIONS_OVERRIDE">
- <module name="wumei" options="-bootclasspath "C:/Program Files/Java/jdk1.8.0_144/jre/lib/rt.jar;C:/Program Files/Java/jdk1.8.0_144/jre/lib/jce.jar"" />
- <module name="wumei-admin" options="-bootclasspath "C:/Program Files/Java/jdk1.8.0_144/jre/lib/rt.jar;C:/Program Files/Java/jdk1.8.0_144/jre/lib/jce.jar"" />
- <module name="wumei-common" options="-bootclasspath "C:/Program Files/Java/jdk1.8.0_144/jre/lib/rt.jar;C:/Program Files/Java/jdk1.8.0_144/jre/lib/jce.jar"" />
- <module name="wumei-framework" options="-bootclasspath "C:/Program Files/Java/jdk1.8.0_144/jre/lib/rt.jar;C:/Program Files/Java/jdk1.8.0_144/jre/lib/jce.jar"" />
- <module name="wumei-generator" options="-bootclasspath "C:/Program Files/Java/jdk1.8.0_144/jre/lib/rt.jar;C:/Program Files/Java/jdk1.8.0_144/jre/lib/jce.jar"" />
- <module name="wumei-iot" options="-bootclasspath "C:/Program Files/Java/jdk1.8.0_144/jre/lib/rt.jar;C:/Program Files/Java/jdk1.8.0_144/jre/lib/jce.jar"" />
- <module name="wumei-quartz" options="-bootclasspath "C:/Program Files/Java/jdk1.8.0_144/jre/lib/rt.jar;C:/Program Files/Java/jdk1.8.0_144/jre/lib/jce.jar"" />
- <module name="wumei-system" options="-bootclasspath "C:/Program Files/Java/jdk1.8.0_144/jre/lib/rt.jar;C:/Program Files/Java/jdk1.8.0_144/jre/lib/jce.jar"" />
+ <module name="wumei" options="" />
+ <module name="wumei-admin" options="-bootclasspath $PROJECT_DIR$/../../../soft1/jdk/jdk1.8.0_151/jre/lib/rt.jar;$PROJECT_DIR$/../../../soft1/jdk/jdk1.8.0_151/jre/lib/jce.jar" />
+ <module name="wumei-common" options="-bootclasspath $PROJECT_DIR$/../../../soft1/jdk/jdk1.8.0_151/jre/lib/rt.jar;$PROJECT_DIR$/../../../soft1/jdk/jdk1.8.0_151/jre/lib/jce.jar" />
+ <module name="wumei-framework" options="-bootclasspath $PROJECT_DIR$/../../../soft1/jdk/jdk1.8.0_151/jre/lib/rt.jar;$PROJECT_DIR$/../../../soft1/jdk/jdk1.8.0_151/jre/lib/jce.jar" />
+ <module name="wumei-generator" options="-bootclasspath $PROJECT_DIR$/../../../soft1/jdk/jdk1.8.0_151/jre/lib/rt.jar;$PROJECT_DIR$/../../../soft1/jdk/jdk1.8.0_151/jre/lib/jce.jar" />
+ <module name="wumei-iot" options="-bootclasspath $PROJECT_DIR$/../../../soft1/jdk/jdk1.8.0_151/jre/lib/rt.jar;$PROJECT_DIR$/../../../soft1/jdk/jdk1.8.0_151/jre/lib/jce.jar" />
+ <module name="wumei-quartz" options="-bootclasspath $PROJECT_DIR$/../../../soft1/jdk/jdk1.8.0_151/jre/lib/rt.jar;$PROJECT_DIR$/../../../soft1/jdk/jdk1.8.0_151/jre/lib/jce.jar" />
+ <module name="wumei-system" options="-bootclasspath $PROJECT_DIR$/../../../soft1/jdk/jdk1.8.0_151/jre/lib/rt.jar;$PROJECT_DIR$/../../../soft1/jdk/jdk1.8.0_151/jre/lib/jce.jar" />
</option>
</component>
</project>
\ No newline at end of file
diff --git a/wumei-smart-master/.idea/encodings.xml b/wumei-smart-master/.idea/encodings.xml
index ef0411e..304dd7f 100644
--- a/wumei-smart-master/.idea/encodings.xml
+++ b/wumei-smart-master/.idea/encodings.xml
@@ -1,14 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="Encoding">
- <file url="file://$PROJECT_DIR$/springboot/src/main/java" charset="UTF-8" />
- <file url="file://$PROJECT_DIR$/springboot/src/main/resources" charset="UTF-8" />
<file url="file://$PROJECT_DIR$/springboot/wumei-admin/src/main/java" charset="UTF-8" />
<file url="file://$PROJECT_DIR$/springboot/wumei-admin/src/main/resources" charset="UTF-8" />
<file url="file://$PROJECT_DIR$/springboot/wumei-common/src/main/java" charset="UTF-8" />
- <file url="file://$PROJECT_DIR$/springboot/wumei-common/src/main/resources" charset="UTF-8" />
<file url="file://$PROJECT_DIR$/springboot/wumei-framework/src/main/java" charset="UTF-8" />
- <file url="file://$PROJECT_DIR$/springboot/wumei-framework/src/main/resources" charset="UTF-8" />
<file url="file://$PROJECT_DIR$/springboot/wumei-generator/src/main/java" charset="UTF-8" />
<file url="file://$PROJECT_DIR$/springboot/wumei-generator/src/main/resources" charset="UTF-8" />
<file url="file://$PROJECT_DIR$/springboot/wumei-iot/src/main/java" charset="UTF-8" />
diff --git a/wumei-smart-master/springboot/pom.xml b/wumei-smart-master/springboot/pom.xml
index 56ff483..c861f12 100644
--- a/wumei-smart-master/springboot/pom.xml
+++ b/wumei-smart-master/springboot/pom.xml
@@ -2,7 +2,7 @@
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
- <modelVersion>4.0.0</modelVersion>
+ <modelVersion>4.0.0</modelVersion>
<groupId>com.wumei</groupId>
<artifactId>wumei</artifactId>
@@ -207,7 +207,6 @@
<artifactId>wumei-iot</artifactId>
<version>${wumei.version}</version>
</dependency>
-
</dependencies>
diff --git a/wumei-smart-master/springboot/wumei-iot/src/main/java/com/ruoyi/iot/controller/DeviceController.java b/wumei-smart-master/springboot/wumei-iot/src/main/java/com/ruoyi/iot/controller/DeviceController.java
index 9140b65..c8513eb 100644
--- a/wumei-smart-master/springboot/wumei-iot/src/main/java/com/ruoyi/iot/controller/DeviceController.java
+++ b/wumei-smart-master/springboot/wumei-iot/src/main/java/com/ruoyi/iot/controller/DeviceController.java
@@ -1,16 +1,21 @@
package com.ruoyi.iot.controller;
+import com.alibaba.fastjson.JSON;
+import com.alibaba.fastjson.JSONObject;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
+import com.ruoyi.common.core.domain.entity.SysUser;
import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.iot.domain.Device;
+import com.ruoyi.iot.dto.DeviceFilterDto;
import com.ruoyi.iot.model.DeviceAllShortOutput;
import com.ruoyi.iot.model.DeviceRelateUserInput;
import com.ruoyi.iot.model.DeviceShortOutput;
+import com.ruoyi.iot.model.ThingsModels.ThingsModelValueItem;
import com.ruoyi.iot.mqtt.EmqxService;
import com.ruoyi.iot.service.IDeviceService;
import com.ruoyi.system.service.ISysUserService;
@@ -77,6 +82,46 @@
}
}
+ /**
+ * 鏌ヨ婊よ姱瀵垮懡娓呭崟鍒楄〃
+ */
+ @PreAuthorize("@ss.hasPermi('iot:device:list')")
+ @GetMapping("/cartridgeList")
+ @ApiOperation("婊よ姱瀵垮懡娓呭崟鍒楄〃")
+ public TableDataInfo selectCartridgeLifeList(Device device) throws Exception {
+ //鎶奷evice琛ㄤ腑姣忎竴鏉℃暟鎹殑things_model_value鐗╂ā鍨嬪�糺son瑙f瀽涓篢hingsModelValueItem瀵硅薄
+ List<DeviceFilterDto> list = new ArrayList<>();
+ Long deviceId = 0L;
+ ThingsModelValueItem thingsModelValueItem = null;
+ //鏌ヨ鎵�鏈夌殑璁惧
+ List<Device> deviceList = deviceService.selectDeviceAll();
+ for (Device devices : deviceList) {
+ //鎷垮埌鐗╂ā鍨嬪��
+ String thingsModelValue = devices.getThingsModelValue();
+ deviceId = devices.getDeviceId();
+ if (thingsModelValue != null) {
+ //JSONObject.parseObject鏂规硶鐢ㄤ簬灏嗕竴涓狫SON瀛楃涓茶В鏋愪负涓�涓狫SONObject瀵硅薄
+ JSONObject jsonObject = JSONObject.parseObject(thingsModelValue);
+ //toJavaObject鏂规硶鏄敤浜庡皢JSON瀛楃涓茶浆鎹负Java瀵硅薄鐨勯潤鎬佹柟娉曘�傝繖涓柟娉曞彲浠ュ皢JSON鏍煎紡鐨勫瓧绗︿覆杞崲涓哄搴旂殑Java瀵硅薄銆�
+ thingsModelValueItem = jsonObject.toJavaObject(ThingsModelValueItem.class);
+ //鎷垮埌鐗╂ā鍨嬬殑id鈥斺�擣ilterA
+ String thingsModelId = thingsModelValueItem.getId();
+ //鎷垮埌鐗╂ā鍨媔d鏄疐ilterA鐨勫��
+ int thingsModelValues = Integer.parseInt(thingsModelValueItem.getValue());
+ if ("FilterA".equals(thingsModelId) && thingsModelValues <= 5 || "FilterB".equals(thingsModelId) && thingsModelValues <= 5 || "FilterC".equals(thingsModelId) && thingsModelValues <= 5 || "FilterD".equals(thingsModelId) && thingsModelValues <= 5) {
+ //鏍规嵁婊よ姱瀵垮懡A灏忎簬绛変簬5鐨勮澶噄d鍘绘煡璇㈣澶囦俊鎭�
+ Device deviceA = deviceService.selectDeviceByDeviceId(deviceId);
+ DeviceFilterDto deviceFilterDto = new DeviceFilterDto(deviceA.getDeviceId(), deviceA.getDeviceName(), deviceA.getDeviceOrder().getUserName(), deviceA.getDeviceOrder().getUserPhone(), thingsModelValues, null, null, null);
+ list.add(deviceFilterDto);
+ break;
+ }
+ } else {
+ return null;
+ }
+ }
+ startPage();
+ return getDataTable(list);
+ }
/**
* 鏌ヨ鏈垎閰嶆巿鏉冪爜璁惧鍒楄〃
diff --git a/wumei-smart-master/springboot/wumei-iot/src/main/java/com/ruoyi/iot/domain/Device.java b/wumei-smart-master/springboot/wumei-iot/src/main/java/com/ruoyi/iot/domain/Device.java
index 55f53d6..e59ac6e 100644
--- a/wumei-smart-master/springboot/wumei-iot/src/main/java/com/ruoyi/iot/domain/Device.java
+++ b/wumei-smart-master/springboot/wumei-iot/src/main/java/com/ruoyi/iot/domain/Device.java
@@ -184,6 +184,18 @@
*/
private Integer installFlag;
+ /**
+ * 璁惧璁㈠崟鍒楄〃
+ */
+ private DeviceOrder deviceOrder;
+
+ public DeviceOrder getDeviceOrder() {
+ return deviceOrder;
+ }
+
+ public void setDeviceOrder(DeviceOrder deviceOrder) {
+ this.deviceOrder = deviceOrder;
+ }
public Integer getLocationWay() {
return locationWay;
@@ -462,6 +474,7 @@
.append("tDSA", gettDSA())
.append("repairFlag", getRepairFlag())
.append("installFlag", getInstallFlag())
+ .append("deviceOrder", getDeviceOrder())
.toString();
}
}
diff --git a/wumei-smart-master/springboot/wumei-iot/src/main/java/com/ruoyi/iot/domain/DeviceOrder.java b/wumei-smart-master/springboot/wumei-iot/src/main/java/com/ruoyi/iot/domain/DeviceOrder.java
index 4ff4468..45c93ee 100644
--- a/wumei-smart-master/springboot/wumei-iot/src/main/java/com/ruoyi/iot/domain/DeviceOrder.java
+++ b/wumei-smart-master/springboot/wumei-iot/src/main/java/com/ruoyi/iot/domain/DeviceOrder.java
@@ -173,12 +173,12 @@
/**
* 鎺ュ崟瓒呮椂鏍囪瘑
*/
- private boolean receiveTimeoutFlag;
+ private Integer receiveTimeoutFlag;
/**
* 缁撳崟瓒呮椂鏍囪瘑
*/
- private boolean finishTimeoutFlag;
+ private Integer finishTimeoutFlag;
/**
* 鏄惁鐢ㄦ埛鍒涘缓鏍囪瘑
@@ -405,19 +405,19 @@
this.customFlag = customFlag;
}
- public boolean isReceiveTimeoutFlag() {
+ public Integer getReceiveTimeoutFlag() {
return receiveTimeoutFlag;
}
- public void setReceiveTimeoutFlag(boolean receiveTimeoutFlag) {
+ public void setReceiveTimeoutFlag(Integer receiveTimeoutFlag) {
this.receiveTimeoutFlag = receiveTimeoutFlag;
}
- public boolean isFinishTimeoutFlag() {
+ public Integer getFinishTimeoutFlag() {
return finishTimeoutFlag;
}
- public void setFinishTimeoutFlag(boolean finishTimeoutFlag) {
+ public void setFinishTimeoutFlag(Integer finishTimeoutFlag) {
this.finishTimeoutFlag = finishTimeoutFlag;
}
@@ -450,6 +450,8 @@
.append("updateUserId", getUpdateUserId())
.append("imgUrl", getImgUrl())
.append("description", getDescription())
+ .append("receiveTimeoutFlag", getReceiveTimeoutFlag())
+ .append("finishTimeoutFlag", getFinishTimeoutFlag())
.append("customFlag", getCustomFlag())
.toString();
}
diff --git a/wumei-smart-master/springboot/wumei-iot/src/main/java/com/ruoyi/iot/dto/DeviceFilterDto.java b/wumei-smart-master/springboot/wumei-iot/src/main/java/com/ruoyi/iot/dto/DeviceFilterDto.java
new file mode 100644
index 0000000..a5adef6
--- /dev/null
+++ b/wumei-smart-master/springboot/wumei-iot/src/main/java/com/ruoyi/iot/dto/DeviceFilterDto.java
@@ -0,0 +1,117 @@
+package com.ruoyi.iot.dto;
+
+/**
+ * @author wmz
+ * @version v1.0
+ * @ClassName DeviceFilterDto
+ * @description TODO
+ * @createTime 2023/12/13 17:55
+ */
+
+public class DeviceFilterDto {
+
+ /**
+ * 璁惧ID
+ */
+ private Long deviceId;
+ /**
+ * 璁惧鍚嶇О
+ */
+ private String deviceName;
+ /**
+ * 瀹㈡埛濮撳悕
+ */
+ private String userName;
+ /**
+ * 瀹㈡埛鎵嬫満鍙�
+ */
+ private String userPhone;
+
+ /**
+ * 婊よ姱瀵垮懡A鐨勭墿妯″瀷鍊�
+ */
+ private Integer FilterAValue;
+ /**
+ * 婊よ姱瀵垮懡B鐨勭墿妯″瀷鍊�
+ */
+ private Integer FilterBValue;
+ /**
+ * 婊よ姱瀵垮懡C鐨勭墿妯″瀷鍊�
+ */
+ private Integer FilterCValue;
+ /**
+ * 婊よ姱瀵垮懡D鐨勭墿妯″瀷鍊�
+ */
+ private Integer FilterDValue;
+
+ public DeviceFilterDto() {
+ }
+
+ public DeviceFilterDto(Long deviceId, String deviceName, String user_name, String user_phone, Integer filterAValue, Integer filterBValue, Integer filterCValue, Integer filterDValue) {
+ this.deviceId = deviceId;
+ this.deviceName = deviceName;
+ this.userName = user_name;
+ this.userPhone = user_phone;
+ this.FilterAValue = filterAValue;
+ this.FilterBValue = filterBValue;
+ this.FilterCValue = filterCValue;
+ this.FilterDValue = filterDValue;
+
+ }
+
+ public String getDeviceName() {
+ return deviceName;
+ }
+
+ public void setDeviceName(String deviceName) {
+ this.deviceName = deviceName;
+ }
+
+ public String getUserName() {
+ return userName;
+ }
+
+ public void setUserName(String userName) {
+ this.userName = userName;
+ }
+
+ public String getUserPhone() {
+ return userPhone;
+ }
+
+ public void setUserPhone(String userPhone) {
+ this.userPhone = userPhone;
+ }
+
+ public Integer getFilterAValue() {
+ return FilterAValue;
+ }
+
+ public void setFilterAValue(Integer filterAValue) {
+ FilterAValue = filterAValue;
+ }
+
+ public Integer getFilterBValue() {
+ return FilterBValue;
+ }
+
+ public void setFilterBValue(Integer filterBValue) {
+ FilterBValue = filterBValue;
+ }
+
+ public Integer getFilterCValue() {
+ return FilterCValue;
+ }
+
+ public void setFilterCValue(Integer filterCValue) {
+ FilterCValue = filterCValue;
+ }
+
+ public Integer getFilterDValue() {
+ return FilterDValue;
+ }
+
+ public void setFilterDValue(Integer filterDValue) {
+ FilterDValue = filterDValue;
+ }
+}
diff --git a/wumei-smart-master/springboot/wumei-iot/src/main/java/com/ruoyi/iot/mapper/DeviceMapper.java b/wumei-smart-master/springboot/wumei-iot/src/main/java/com/ruoyi/iot/mapper/DeviceMapper.java
index 674e6b9..695469e 100644
--- a/wumei-smart-master/springboot/wumei-iot/src/main/java/com/ruoyi/iot/mapper/DeviceMapper.java
+++ b/wumei-smart-master/springboot/wumei-iot/src/main/java/com/ruoyi/iot/mapper/DeviceMapper.java
@@ -51,6 +51,31 @@
public int selectUserDeviceByCount(int id) throws Exception;
/**
+ * 鏍规嵁鐧诲綍鐨勭敤鎴疯鑹叉煡璇㈡护鑺鍛芥竻鍗曞垪琛�
+ *
+ * @param device
+ * @return
+ * @throws Exception
+ */
+ public List<Device> selectCartridgeLifeList(Device device) throws Exception;
+
+ /**
+ * 鏌ヨ鎵�鏈夌殑璁惧
+ *
+ * @return
+ * @throws Exception
+ */
+ public List<Device> selectDeviceAll() throws Exception;
+
+ /**
+ * 鏍规嵁璁惧id鏌ヨ璁惧
+ *
+ * @param deviceId 璁惧涓婚敭
+ * @return 璁惧
+ */
+ public Device selectDeviceById(Long deviceId);
+
+ /**
* 鏍规嵁璁惧缂栧彿鏌ヨ璁惧
*
* @param serialNumber 璁惧涓婚敭
diff --git a/wumei-smart-master/springboot/wumei-iot/src/main/java/com/ruoyi/iot/model/ThingsModelItem/ArrayModelOutput.java b/wumei-smart-master/springboot/wumei-iot/src/main/java/com/ruoyi/iot/model/ThingsModelItem/ArrayModelOutput.java
index 5c91063..6ae2ae4 100644
--- a/wumei-smart-master/springboot/wumei-iot/src/main/java/com/ruoyi/iot/model/ThingsModelItem/ArrayModelOutput.java
+++ b/wumei-smart-master/springboot/wumei-iot/src/main/java/com/ruoyi/iot/model/ThingsModelItem/ArrayModelOutput.java
@@ -1,7 +1,6 @@
package com.ruoyi.iot.model.ThingsModelItem;
-public class ArrayModelOutput extends ThingsModelItemBase
-{
+public class ArrayModelOutput extends ThingsModelItemBase {
private String arrayType;
public String getArrayType() {
diff --git a/wumei-smart-master/springboot/wumei-iot/src/main/java/com/ruoyi/iot/model/ThingsModelItem/BoolModelOutput.java b/wumei-smart-master/springboot/wumei-iot/src/main/java/com/ruoyi/iot/model/ThingsModelItem/BoolModelOutput.java
index 7f362bc..6cf6bf2 100644
--- a/wumei-smart-master/springboot/wumei-iot/src/main/java/com/ruoyi/iot/model/ThingsModelItem/BoolModelOutput.java
+++ b/wumei-smart-master/springboot/wumei-iot/src/main/java/com/ruoyi/iot/model/ThingsModelItem/BoolModelOutput.java
@@ -1,7 +1,6 @@
package com.ruoyi.iot.model.ThingsModelItem;
-public class BoolModelOutput extends ThingsModelItemBase
-{
+public class BoolModelOutput extends ThingsModelItemBase {
private String falseText;
private String trueText;
diff --git a/wumei-smart-master/springboot/wumei-iot/src/main/java/com/ruoyi/iot/model/ThingsModelItem/EnumItemOutput.java b/wumei-smart-master/springboot/wumei-iot/src/main/java/com/ruoyi/iot/model/ThingsModelItem/EnumItemOutput.java
index 7a9b25c..4cc9431 100644
--- a/wumei-smart-master/springboot/wumei-iot/src/main/java/com/ruoyi/iot/model/ThingsModelItem/EnumItemOutput.java
+++ b/wumei-smart-master/springboot/wumei-iot/src/main/java/com/ruoyi/iot/model/ThingsModelItem/EnumItemOutput.java
@@ -1,7 +1,6 @@
package com.ruoyi.iot.model.ThingsModelItem;
-public class EnumItemOutput
-{
+public class EnumItemOutput {
private String text;
private String value;
diff --git a/wumei-smart-master/springboot/wumei-iot/src/main/java/com/ruoyi/iot/model/ThingsModelItem/ReadOnlyModelOutput.java b/wumei-smart-master/springboot/wumei-iot/src/main/java/com/ruoyi/iot/model/ThingsModelItem/ReadOnlyModelOutput.java
index 3da683d..ba4c1d0 100644
--- a/wumei-smart-master/springboot/wumei-iot/src/main/java/com/ruoyi/iot/model/ThingsModelItem/ReadOnlyModelOutput.java
+++ b/wumei-smart-master/springboot/wumei-iot/src/main/java/com/ruoyi/iot/model/ThingsModelItem/ReadOnlyModelOutput.java
@@ -3,8 +3,7 @@
import java.math.BigDecimal;
import java.util.List;
-public class ReadOnlyModelOutput extends ThingsModelItemBase
-{
+public class ReadOnlyModelOutput extends ThingsModelItemBase {
private BigDecimal min;
private BigDecimal max;
private BigDecimal step;
diff --git a/wumei-smart-master/springboot/wumei-iot/src/main/java/com/ruoyi/iot/model/ThingsModelItem/ThingsModelItemBase.java b/wumei-smart-master/springboot/wumei-iot/src/main/java/com/ruoyi/iot/model/ThingsModelItem/ThingsModelItemBase.java
index 6efcf55..703403e 100644
--- a/wumei-smart-master/springboot/wumei-iot/src/main/java/com/ruoyi/iot/model/ThingsModelItem/ThingsModelItemBase.java
+++ b/wumei-smart-master/springboot/wumei-iot/src/main/java/com/ruoyi/iot/model/ThingsModelItem/ThingsModelItemBase.java
@@ -2,21 +2,34 @@
import com.ruoyi.common.annotation.Excel;
-public class ThingsModelItemBase
-{
- /** 鐗╂ā鍨嬪敮涓�鏍囪瘑绗� */
+public class ThingsModelItemBase {
+ /**
+ * 鐗╂ā鍨嬪敮涓�鏍囪瘑绗�
+ */
private String id;
- /** 鐗╂ā鍨嬪悕绉� */
+ /**
+ * 鐗╂ā鍨嬪悕绉�
+ */
private String name;
- /** 鐗╂ā鍨嬪�� */
+ /**
+ * 鐗╂ā鍨嬪��
+ */
private String value;
- /** 鏄惁棣栭〉鏄剧ず锛�0-鍚︼紝1-鏄級 */
+ /**
+ * 鏄惁棣栭〉鏄剧ず锛�0-鍚︼紝1-鏄級
+ */
private Integer isTop;
- /** 鏄惁瀹炴椂鐩戞祴锛�0-鍚︼紝1-鏄級 */
+ /**
+ * 鏄惁瀹炴椂鐩戞祴锛�0-鍚︼紝1-鏄級
+ */
private Integer isMonitor;
- /** 鏁版嵁绫诲瀷 */
+ /**
+ * 鏁版嵁绫诲瀷
+ */
private String type;
- /** 褰卞瓙鍊� */
+ /**
+ * 褰卞瓙鍊�
+ */
private String shadow;
public String getShadow() {
diff --git a/wumei-smart-master/springboot/wumei-iot/src/main/java/com/ruoyi/iot/model/ThingsModels/IdentityAndName.java b/wumei-smart-master/springboot/wumei-iot/src/main/java/com/ruoyi/iot/model/ThingsModels/IdentityAndName.java
index 5cd7e64..3bf4815 100644
--- a/wumei-smart-master/springboot/wumei-iot/src/main/java/com/ruoyi/iot/model/ThingsModels/IdentityAndName.java
+++ b/wumei-smart-master/springboot/wumei-iot/src/main/java/com/ruoyi/iot/model/ThingsModels/IdentityAndName.java
@@ -1,6 +1,5 @@
package com.ruoyi.iot.model.ThingsModels;
-import org.apache.commons.math3.analysis.function.Identity;
/**
* 鐗╂ā鍨嬪�肩殑椤�
diff --git a/wumei-smart-master/springboot/wumei-iot/src/main/java/com/ruoyi/iot/model/ThingsModels/PropertyDto.java b/wumei-smart-master/springboot/wumei-iot/src/main/java/com/ruoyi/iot/model/ThingsModels/PropertyDto.java
index aa7a862..b7e09e6 100644
--- a/wumei-smart-master/springboot/wumei-iot/src/main/java/com/ruoyi/iot/model/ThingsModels/PropertyDto.java
+++ b/wumei-smart-master/springboot/wumei-iot/src/main/java/com/ruoyi/iot/model/ThingsModels/PropertyDto.java
@@ -2,7 +2,6 @@
import com.alibaba.fastjson.JSONObject;
-import java.util.List;
/**
* 浜у搧鍒嗙被鐨処d鍜屽悕绉拌緭鍑�
diff --git a/wumei-smart-master/springboot/wumei-iot/src/main/java/com/ruoyi/iot/model/ThingsModels/ThingsModelValueItemDto.java b/wumei-smart-master/springboot/wumei-iot/src/main/java/com/ruoyi/iot/model/ThingsModels/ThingsModelValueItemDto.java
index bc4ef1f..a7b8407 100644
--- a/wumei-smart-master/springboot/wumei-iot/src/main/java/com/ruoyi/iot/model/ThingsModels/ThingsModelValueItemDto.java
+++ b/wumei-smart-master/springboot/wumei-iot/src/main/java/com/ruoyi/iot/model/ThingsModels/ThingsModelValueItemDto.java
@@ -1,7 +1,5 @@
package com.ruoyi.iot.model.ThingsModels;
-import org.springframework.data.redis.connection.DataType;
-
import java.math.BigDecimal;
import java.util.List;
diff --git a/wumei-smart-master/springboot/wumei-iot/src/main/java/com/ruoyi/iot/model/ThingsModels/ThingsModelValueRemarkItem.java b/wumei-smart-master/springboot/wumei-iot/src/main/java/com/ruoyi/iot/model/ThingsModels/ThingsModelValueRemarkItem.java
index 9af7eed..2883086 100644
--- a/wumei-smart-master/springboot/wumei-iot/src/main/java/com/ruoyi/iot/model/ThingsModels/ThingsModelValueRemarkItem.java
+++ b/wumei-smart-master/springboot/wumei-iot/src/main/java/com/ruoyi/iot/model/ThingsModels/ThingsModelValueRemarkItem.java
@@ -1,6 +1,5 @@
package com.ruoyi.iot.model.ThingsModels;
-import com.alibaba.fastjson.JSONObject;
/**
* 鐗╂ā鍨嬪�肩殑椤�
diff --git a/wumei-smart-master/springboot/wumei-iot/src/main/java/com/ruoyi/iot/model/ThingsModels/ThingsModelValuesOutput.java b/wumei-smart-master/springboot/wumei-iot/src/main/java/com/ruoyi/iot/model/ThingsModels/ThingsModelValuesOutput.java
index fdbc9a0..2f98b75 100644
--- a/wumei-smart-master/springboot/wumei-iot/src/main/java/com/ruoyi/iot/model/ThingsModels/ThingsModelValuesOutput.java
+++ b/wumei-smart-master/springboot/wumei-iot/src/main/java/com/ruoyi/iot/model/ThingsModels/ThingsModelValuesOutput.java
@@ -1,6 +1,6 @@
package com.ruoyi.iot.model.ThingsModels;
-import com.ruoyi.common.annotation.Excel;
+
/**
* 璁惧杈撳叆鐗╂ā鍨嬪�煎弬鏁�
diff --git a/wumei-smart-master/springboot/wumei-iot/src/main/java/com/ruoyi/iot/service/IDeviceService.java b/wumei-smart-master/springboot/wumei-iot/src/main/java/com/ruoyi/iot/service/IDeviceService.java
index 457fbc7..f70b77e 100644
--- a/wumei-smart-master/springboot/wumei-iot/src/main/java/com/ruoyi/iot/service/IDeviceService.java
+++ b/wumei-smart-master/springboot/wumei-iot/src/main/java/com/ruoyi/iot/service/IDeviceService.java
@@ -59,6 +59,14 @@
public int selectUserDeviceByCount(int id) throws Exception;
/**
+ * 鏌ヨ鎵�鏈夌殑璁惧
+ *
+ * @return
+ * @throws Exception
+ */
+ public List<Device> selectDeviceAll() throws Exception;
+
+ /**
* 鏍规嵁璁惧缂栧彿鏌ヨ绠�浠嬭澶�
*
* @param serialNumber 璁惧涓婚敭
diff --git a/wumei-smart-master/springboot/wumei-iot/src/main/java/com/ruoyi/iot/service/impl/DeviceServiceImpl.java b/wumei-smart-master/springboot/wumei-iot/src/main/java/com/ruoyi/iot/service/impl/DeviceServiceImpl.java
index a257ad6..7a2a1b4 100644
--- a/wumei-smart-master/springboot/wumei-iot/src/main/java/com/ruoyi/iot/service/impl/DeviceServiceImpl.java
+++ b/wumei-smart-master/springboot/wumei-iot/src/main/java/com/ruoyi/iot/service/impl/DeviceServiceImpl.java
@@ -184,6 +184,11 @@
return deviceMapper.selectUserDeviceByCount(id);
}
+ @Override
+ public List<Device> selectDeviceAll() throws Exception {
+ return deviceMapper.selectDeviceAll();
+ }
+
/**
* 鏍规嵁璁惧缂栧彿鏌ヨ绠�浠嬭澶�
*
diff --git a/wumei-smart-master/springboot/wumei-iot/src/main/java/com/ruoyi/iot/task/DeviceOrderTask.java b/wumei-smart-master/springboot/wumei-iot/src/main/java/com/ruoyi/iot/task/DeviceOrderTask.java
index cdc2246..95328c5 100644
--- a/wumei-smart-master/springboot/wumei-iot/src/main/java/com/ruoyi/iot/task/DeviceOrderTask.java
+++ b/wumei-smart-master/springboot/wumei-iot/src/main/java/com/ruoyi/iot/task/DeviceOrderTask.java
@@ -78,12 +78,12 @@
//褰撳墠鏃堕棿鈥斺�旀淳鍗曟椂闂村鏋滃ぇ浜巇eviceorderTime琛ㄤ腑鐨剅eceive_timeout灏辨槸璁㈠崟宸茬粡瓒呮椂浜�
receiveTimeout = deviceOrderTimes.getReceiveTimeout();
finishTimeout = deviceOrderTimes.getFinishTimeout();
- return;
+ break;
}
if (createUser_Id == userId && deviceOrderTimes.getOrderType() == 2 && deviceOrderType.equals(deviceOrderTimes.getOrderType())) {
receiveTimeout = deviceOrderTimes.getReceiveTimeout();
finishTimeout = deviceOrderTimes.getFinishTimeout();
- return;
+ break;
}
}
if (deviceOrders.getReceiveTime() != null) {
@@ -97,12 +97,12 @@
if (createUser_Id == userId && deviceOrderTimes.getOrderType() == 1 && deviceOrderType.equals(deviceOrderTimes.getOrderType())) {
receiveTimeout = deviceOrderTimes.getReceiveTimeout();
finishTimeout = deviceOrderTimes.getFinishTimeout();
- return;
+ break;
}
if (createUser_Id == userId && deviceOrderTimes.getOrderType() == 2 && deviceOrderType.equals(deviceOrderTimes.getOrderType())) {
receiveTimeout = deviceOrderTimes.getReceiveTimeout();
finishTimeout = deviceOrderTimes.getFinishTimeout();
- return;
+ break;
}
}
}
@@ -117,7 +117,7 @@
long assginTimeMinutes = Math.abs(durationA.toMinutes());
if (assginTimeMinutes > finishTimeout) {
deviceOrders.setId(deviceOrders.getId());
- deviceOrders.setReceiveTimeoutFlag(true);
+ deviceOrders.setReceiveTimeoutFlag(1);
int rows = deviceOrderMapper.updateDeviceOrder(deviceOrders);
}
@@ -128,7 +128,7 @@
long receiveTimeMinutes = Math.abs(durationB.toMinutes());
if (receiveTimeMinutes > receiveTimeout) {
deviceOrders.setId(deviceOrders.getId());
- deviceOrders.setFinishTimeoutFlag(true);
+ deviceOrders.setFinishTimeoutFlag(1);
int rows = deviceOrderMapper.updateDeviceOrder(deviceOrders);
}
break;
diff --git a/wumei-smart-master/springboot/wumei-iot/src/main/resources/mapper/iot/DeviceMapper.xml b/wumei-smart-master/springboot/wumei-iot/src/main/resources/mapper/iot/DeviceMapper.xml
index 5bcaa76..6c9df1a 100644
--- a/wumei-smart-master/springboot/wumei-iot/src/main/resources/mapper/iot/DeviceMapper.xml
+++ b/wumei-smart-master/springboot/wumei-iot/src/main/resources/mapper/iot/DeviceMapper.xml
@@ -117,6 +117,36 @@
<result property="tenantName" column="tenant_name"/>
</resultMap>
+ <resultMap id="DeviceAndDeviceOrderResult" type="com.ruoyi.iot.domain.Device">
+ <result property="deviceId" column="device_id"/>
+ <result property="deviceName" column="device_name"/>
+ <result property="productId" column="product_id"/>
+ <result property="productName" column="product_name"/>
+ <result property="userId" column="user_id"/>
+ <result property="userName" column="user_name"/>
+ <result property="tenantId" column="tenant_id"/>
+ <result property="tenantName" column="tenant_name"/>
+ <result property="serialNumber" column="serial_number"/>
+ <result property="firmwareVersion" column="firmware_version"/>
+ <result property="status" column="status"/>
+ <result property="activeTime" column="active_time"/>
+ <result property="rssi" column="rssi"/>
+ <result property="isShadow" column="is_shadow"/>
+ <result property="locationWay" column="location_way"/>
+ <result property="thingsModelValue" column="things_model_value"/>
+ <result property="imgUrl" column="img_url"/>
+ <result property="assignTime" column="assign_time"/>
+ <result property="tDSP" column="tds_p"/>
+ <result property="tDSA" column="tds_a"/>
+ <result property="repairFlag" column="repair_flag"/>
+ <result property="installFlag" column="install_flag"/>
+ <collection property="deviceOrder" ofType="DeviceOrder" resultMap="DeviceOrderResult"/>
+ </resultMap>
+
+ <resultMap id="DeviceOrderResult" type="DeviceOrder">
+ <result property="userName" column="deusername"/>
+ <result property="userPhone" column="deuserphone"/>
+ </resultMap>
<sql id="selectDeviceVo">
select device_id,
device_name,
@@ -339,7 +369,6 @@
<if test="groupId != null and groupId !=0 ">
left join iot_device_group g on g.device_id=d.device_id
</if>
-
<where>
<if test="groupId != null and groupId !=0 ">
and g.group_id = #{groupId}
@@ -722,6 +751,90 @@
from iot_device
where serial_number = #{deviceNum}
</select>
+ <select id="selectCartridgeLifeList" resultMap="DeviceAndDeviceOrderResult">
+ select
+ d.device_id,
+ d.device_name,
+ d.product_id,
+ d.product_name,
+ d.user_id,
+ d.user_name,
+ d.tenant_id,
+ su.nick_name tenant_name,
+ d.serial_number,
+ d.location_way,
+ d.things_model_value,
+ d.tds_p,
+ d.tds_a,
+ de.user_name as deusername,
+ de.user_phone as deuserphone
+ from iot_device d
+ inner join iot_device_order de on de.device_id = d.device_id
+ inner join sys_user su on su.user_id = d.tenant_id
+ <!-- <if test="groupId != null and groupId !=0 ">-->
+ <!-- left join iot_device_group g on g.device_id=d.device_id-->
+ <!-- </if>-->
+ where d.del_flag = '0'
+ <!-- <if test="groupId != null and groupId !=0 ">-->
+ <!-- and g.group_id = #{groupId}-->
+ <!-- </if>-->
+ <if test="tenantId != null and tenantId != 1">
+ and d.tenant_id = #{tenantId}
+ </if>
+ <if test="params.beginActiveTime != null and params.beginActiveTime != '' and params.endActiveTime != null and params.endActiveTime != ''">
+ and d.active_time between #{params.beginActiveTime} and #{params.endActiveTime}
+ </if>
+ group by d.device_id,d.user_id
+ order by d.create_time desc
+ </select>
+ <!-- 鏍规嵁tenantId鍘绘煡璇㈣澶囩殑鐗╂ā鍨� -->
+ <select id="selectDeviceAll" resultMap="DeviceResult">
+ select device_id,
+ device_name,
+ product_id,
+ product_name,
+ user_id,
+ user_name,
+ tenant_id,
+ serial_number,
+ firmware_version,
+ status,
+ rssi,
+ is_shadow,
+ location_way,
+ things_model_value,
+ assign_time,
+ active_time,
+ img_url,
+ tds_p,
+ tds_a,
+ repair_flag,
+ install_flag
+ from iot_device
+ where del_flag = '0'
+ </select>
+ <select id="selectDeviceById" resultType="com.ruoyi.iot.domain.Device">
+ select d.device_id,
+ d.device_name,
+ d.product_id,
+ d.product_name,
+ d.user_id,
+ d.user_name,
+ d.tenant_id,
+ su.nick_name tenant_name,
+ d.serial_number,
+ d.location_way,
+ d.things_model_value,
+ d.tds_p,
+ d.tds_a,
+ de.user_name as deusername,
+ de.user_phone as deuserphone
+ from iot_device d
+ inner join iot_device_order de on de.device_id = d.device_id
+ inner join sys_user su on su.user_id = d.tenant_id
+ where device_id = #{deviceId}
+ and d.del_flag = '0'
+ </select>
<delete id="deleteDeviceGroupByDeviceId" parameterType="com.ruoyi.iot.model.UserIdDeviceIdModel">
delete from iot_device_group
diff --git a/wumei-smart-master/springboot/wumei-iot/src/main/resources/mapper/iot/DeviceOrderMapper.xml b/wumei-smart-master/springboot/wumei-iot/src/main/resources/mapper/iot/DeviceOrderMapper.xml
index e278520..0b30307 100644
--- a/wumei-smart-master/springboot/wumei-iot/src/main/resources/mapper/iot/DeviceOrderMapper.xml
+++ b/wumei-smart-master/springboot/wumei-iot/src/main/resources/mapper/iot/DeviceOrderMapper.xml
@@ -126,6 +126,12 @@
<if test="userId != null and userId > 0">
and d.user_id = #{userId}
</if>
+ <if test=" receiveTimeoutFlag != null and receiveTimeoutFlag != 0">
+ and d.receive_timeout_flag = #{receiveTimeoutFlag}
+ </if>
+ <if test=" finishTimeoutFlag != null and finishTimeoutFlag != 0">
+ and d.finish_timeout_flag = #{finishTimeoutFlag}
+ </if>
order by d.create_time desc
${params.dataScope}
</select>
diff --git a/wumei-smart-master/vue/src/views/equipmentManagement/installation.vue b/wumei-smart-master/vue/src/views/equipmentManagement/installation.vue
index 856693b..69fb88c 100644
--- a/wumei-smart-master/vue/src/views/equipmentManagement/installation.vue
+++ b/wumei-smart-master/vue/src/views/equipmentManagement/installation.vue
@@ -1,241 +1,468 @@
<template>
- <div id="" style="padding:6px;">
- <el-card style="margin-bottom:6px;">
- <el-form :model="queryParams" ref="queryForm" :inline="true">
- <el-form-item label="鐘舵��" prop="status">
- <el-select v-model="state" placeholder="鑿滃崟鐘舵��" size="mini">
- <el-option label="鍏ㄩ儴" :value="-1" />
- <el-option label="鏈淳鍗�" :value="0" />
- <el-option label="宸叉淳鍗�" :value="1" />
- <el-option label="宸叉帴鍗�" :value="2" />
- <el-option label="宸插畬鎴�" :value="3" />
- </el-select>
- </el-form-item>
- <el-form-item label="绛夌骇" prop="level">
- <el-select v-model="level" placeholder="鑿滃崟鐘舵��" :disabled="erectoListLevel.length == 0" size="mini">
- <el-option label="鏈骇" :value="0" />
- <el-option label="涓嬬骇" :value="1" />
- </el-select>
- </el-form-item>
- <el-form-item v-if="level == 1 && erectoListLevel.length > 0" label="涓嬬骇鑱旇惀鍟�" prop="nextlevel">
- <el-select v-model="nextlevel" placeholder="鑿滃崟鐘舵��" size="mini">
- <el-option v-for="item in erectoListLevel" :label="item.dept.deptName" :value="item.userId" />
- </el-select>
- </el-form-item>
- <el-form-item>
- <el-button size="mini" type="primary" icon="el-icon-search"
- @click="changePage(1)">鎼滅储</el-button></el-form-item>
- <el-form-item v-if="roleKey=='tenant'||roleKey=='tenanthelper'">
- <el-button size="mini" type="primary" icon="el-icon-message-solid"
- @click="openTimeOutModal">瓒呮椂閰嶇疆</el-button></el-form-item>
- <el-form-item style="float: right;" v-if="roleKey !== 'admin'">
- <el-button type="primary" v-hasPermi="['iot:device:add']" plain icon="el-icon-plus" size="mini"
- @click="openAZModal">鏂板</el-button>
- </el-form-item>
- </el-form>
- <el-table :data="tableData" style="width: 100%" @selection-change="handleSelectionChange">
- <el-table-column type="selection" fixed width="55">
- </el-table-column>
- <el-table-column prop="id" label="缂栧彿" width="60">
- </el-table-column>
- <el-table-column label="瀹夎淇℃伅">
- <el-table-column prop="device" label="璁惧鍚嶇О" width="120">
- <template slot-scope="scope">
- <div>
- {{ scope.row.device && scope.row.device.deviceName ? scope.row.device.deviceName : '--' }}
- </div>
+ <div id="" style="padding: 6px">
+ <el-card style="margin-bottom: 6px">
+ <el-form :model="queryParams" ref="queryForm" :inline="true">
+ <el-form-item label="鐘舵��" prop="status">
+ <el-select v-model="state" placeholder="鑿滃崟鐘舵��" size="mini">
+ <el-option label="鍏ㄩ儴" :value="-1" />
+ <el-option label="鏈淳鍗�" :value="0" />
+ <el-option label="宸叉淳鍗�" :value="1" />
+ <el-option label="宸叉帴鍗�" :value="2" />
+ <el-option label="宸插畬鎴�" :value="3" />
+ </el-select>
+ </el-form-item>
- </template>
- </el-table-column>
- <el-table-column prop="erectoName" label="瀹夎宸ヤ汉" width="120">
- </el-table-column>
+ <el-form-item label="瓒呮椂" prop="level">
+ <el-select
+ v-model="timeOutSelect"
+ placeholder="瓒呮椂鏌ヨ"
+ :disabled="erectoListLevel.length == 0"
+ size="mini"
+ >
+ <el-option label="鍏ㄩ儴" :value="0" />
+ <el-option label="鎺ュ崟瓒呮椂" :value="1" />
+ <el-option label="鎺ュ崟瓒呮椂" :value="2" />
+ </el-select>
+ </el-form-item>
+ <el-form-item label="绛夌骇" prop="level">
+ <el-select
+ v-model="level"
+ placeholder="鑿滃崟鐘舵��"
+ :disabled="erectoListLevel.length == 0"
+ size="mini"
+ >
+ <el-option label="鏈骇" :value="0" />
+ <el-option label="涓嬬骇" :value="1" />
+ </el-select>
+ </el-form-item>
+ <el-form-item
+ v-if="level == 1 && erectoListLevel.length > 0"
+ label="涓嬬骇鑱旇惀鍟�"
+ prop="nextlevel"
+ >
+ <el-select v-model="nextlevel" placeholder="鑿滃崟鐘舵��" size="mini">
+ <el-option
+ v-for="item in erectoListLevel"
+ :label="item.dept.deptName"
+ :value="item.userId"
+ />
+ </el-select>
+ </el-form-item>
+ <el-form-item>
+ <el-button
+ size="mini"
+ type="primary"
+ icon="el-icon-search"
+ @click="changePage(1)"
+ >鎼滅储</el-button
+ ></el-form-item
+ >
+ <el-form-item v-if="roleKey == 'tenant' || roleKey == 'tenanthelper'">
+ <el-button
+ size="mini"
+ type="primary"
+ icon="el-icon-message-solid"
+ @click="openTimeOutModal"
+ >瓒呮椂閰嶇疆</el-button
+ ></el-form-item
+ >
+ <el-form-item style="float: right" v-if="roleKey !== 'admin'">
+ <el-button
+ type="primary"
+ v-hasPermi="['iot:device:add']"
+ plain
+ icon="el-icon-plus"
+ size="mini"
+ @click="openAZModal"
+ >鏂板</el-button
+ >
+ </el-form-item>
+ </el-form>
+ <el-table
+ :data="tableData"
+ style="width: 100%"
+ @selection-change="handleSelectionChange"
+ >
+ <el-table-column type="selection" fixed width="55"> </el-table-column>
+ <el-table-column prop="id" label="缂栧彿" width="60"> </el-table-column>
+ <el-table-column label="瀹夎淇℃伅">
+ <el-table-column prop="device" label="璁惧鍚嶇О" width="120">
+ <template slot-scope="scope">
+ <div>
+ {{
+ scope.row.device && scope.row.device.deviceName
+ ? scope.row.device.deviceName
+ : "--"
+ }}
+ </div>
+ </template>
+ </el-table-column>
+ <el-table-column prop="erectoName" label="瀹夎宸ヤ汉" width="120">
+ </el-table-column>
- <el-table-column prop="appointmentTime" label="棰勭害鏃堕棿" width="150">
- <template slot-scope="scope">
- <div>
- {{ scope.row.appointmentTime ? scope.row.appointmentTime : '--' }}
- </div>
- </template>
- </el-table-column>
- <el-table-column prop="remark" label="璁㈠崟澶囨敞">
- <template slot-scope="scope">
- <div>
- {{ scope.row.remark ? scope.row.remark : '--' }}
- </div>
- </template>
- </el-table-column>
+ <el-table-column prop="appointmentTime" label="棰勭害鏃堕棿" width="150">
+ <template slot-scope="scope">
+ <div>
+ {{
+ scope.row.appointmentTime ? scope.row.appointmentTime : "--"
+ }}
+ </div>
+ </template>
+ </el-table-column>
+ <el-table-column prop="remark" label="璁㈠崟澶囨敞">
+ <template slot-scope="scope">
+ <div>
+ {{ scope.row.remark ? scope.row.remark : "--" }}
+ </div>
+ </template>
+ </el-table-column>
+ </el-table-column>
+ <el-table-column label="璁㈠崟鐘舵��" prop="state" width="120">
+ <template slot-scope="scope">
+ <div v-if="scope.row.state == 0">鏈淳鍗�</div>
+ <div v-if="scope.row.state == 1">宸叉淳鍗�</div>
+ <div v-if="scope.row.state == 2">宸叉帴鍗�</div>
+ <div v-if="scope.row.state == 3">宸插畬鎴�</div>
- </el-table-column>
- <el-table-column label="璁㈠崟鐘舵��" prop="state" width="120">
- <template slot-scope="scope">
- <div v-if="scope.row.state == 0">
- 鏈淳鍗�
- </div>
- <div v-if="scope.row.state == 1">
- 宸叉淳鍗�
- </div>
- <div v-if="scope.row.state == 2">
- 宸叉帴鍗�
- </div>
- <div v-if="scope.row.state == 3">
- 宸插畬鎴�
- </div>
- </template>
- </el-table-column>
- <el-table-column label="鐢ㄦ埛淇℃伅">
- <el-table-column prop="userName" label="鐢ㄦ埛濮撳悕" width="120">
- </el-table-column>
- <el-table-column prop="userPhone" label="鐢ㄦ埛鐢佃瘽" width="120">
- </el-table-column>
- <el-table-column prop="address" label="瀹夎鍦板潃">
- </el-table-column>
- </el-table-column>
- <!-- <el-table-column label="璇勪环淇℃伅">
+ <div v-if="scope.row.receiveTimeoutFlag == 1">
+ <el-tag size="mini" effect="dark" type="danger">鎺ュ崟瓒呮椂</el-tag>
+ </div>
+ <div v-if="scope.row.finishTimeoutFlag == 1">
+ <el-tag size="mini" effect="dark" type="warning">缁撳崟瓒呮椂</el-tag>
+ </div>
+ </template>
+ </el-table-column>
+ <el-table-column label="鐢ㄦ埛淇℃伅">
+ <el-table-column prop="userName" label="鐢ㄦ埛濮撳悕" width="120">
+ </el-table-column>
+ <el-table-column prop="userPhone" label="鐢ㄦ埛鐢佃瘽" width="120">
+ </el-table-column>
+ <el-table-column prop="address" label="瀹夎鍦板潃"> </el-table-column>
+ </el-table-column>
+ <!-- <el-table-column label="璇勪环淇℃伅">
<el-table-column prop="score" label="璇勫垎" width="120">
</el-table-column>
<el-table-column prop="evaluate" label="璇勪环" minWidth="120">
</el-table-column>
</el-table-column> -->
- <el-table-column label="鎿嶄綔" fixed="right" align="center" width="150" class-name="small-padding fixed-width"
- v-if="roleKey !== 'admin'">
- <template slot-scope="scope">
- <div style="display: flex;justify-content: space-around;">
- <el-button v-if="scope.row.state != 3" size="small" type="primary" style="padding:5px;"
- icon="el-icon-edit" v-hasPermi="['iot:device:edit']"
- @click="editModal(scope.row)">淇敼</el-button>
- <el-button v-if="scope.row.state == 0" size="small" type="danger" style="padding:5px;"
- icon="el-icon-delete" v-hasPermi="['iot:device:remove']"
- @click="delModal(scope.row)">鍒犻櫎</el-button>
- <el-button v-if="scope.row.state == 1 && scope.row.erectoName == nickName" size="small"
- type="success" style="padding:5px;" icon="el-icon-odometer"
- @click="JDModal(scope.row)">鎺ュ崟</el-button>
- <el-button v-if="scope.row.state == 2 && scope.row.erectoName == nickName" size="small"
- type="success" style="padding:5px;" icon="el-icon-check"
- @click="jdModal(scope.row)">缁撳崟</el-button>
- <el-button v-if="scope.row.state == 3" size="small" type="success" style="padding:5px;"
- icon="el-icon-view" @click="viewModal(scope.row)">鏌ョ湅</el-button>
- </div>
- </template>
- </el-table-column>
- <el-table-column label="鎿嶄綔" fixed="right" align="center" width="150" class-name="small-padding fixed-width"
- v-if="roleKey == 'admin'">
- <template slot-scope="scope">
- <div style="display: flex;justify-content: space-around;">
- <el-button v-if="scope.row.state == 3" size="small" type="success" style="padding:5px;"
- icon="el-icon-view" @click="viewModal(scope.row)">鏌ョ湅</el-button>
- </div>
- </template>
- </el-table-column>
- </el-table>
- <el-pagination background :current-page="pageIndex" @current-change="changePage" :page-size="pageSize"
- layout="prev, pager, next" :total="total" style="margin-top: 12px;">
- </el-pagination>
- </el-card>
+ <el-table-column
+ label="鎿嶄綔"
+ fixed="right"
+ align="center"
+ width="150"
+ class-name="small-padding fixed-width"
+ v-if="roleKey !== 'admin'"
+ >
+ <template slot-scope="scope">
+ <div style="display: flex; justify-content: space-around">
+ <el-button
+ v-if="scope.row.state != 3"
+ size="small"
+ type="primary"
+ style="padding: 5px"
+ icon="el-icon-edit"
+ v-hasPermi="['iot:device:edit']"
+ @click="editModal(scope.row)"
+ >淇敼</el-button
+ >
+ <el-button
+ v-if="scope.row.state == 0"
+ size="small"
+ type="danger"
+ style="padding: 5px"
+ icon="el-icon-delete"
+ v-hasPermi="['iot:device:remove']"
+ @click="delModal(scope.row)"
+ >鍒犻櫎</el-button
+ >
+ <el-button
+ v-if="scope.row.state == 1 && scope.row.erectoName == nickName"
+ size="small"
+ type="success"
+ style="padding: 5px"
+ icon="el-icon-odometer"
+ @click="JDModal(scope.row)"
+ >鎺ュ崟</el-button
+ >
+ <el-button
+ v-if="scope.row.state == 2 && scope.row.erectoName == nickName"
+ size="small"
+ type="success"
+ style="padding: 5px"
+ icon="el-icon-check"
+ @click="jdModal(scope.row)"
+ >缁撳崟</el-button
+ >
+ <el-button
+ v-if="scope.row.state == 3"
+ size="small"
+ type="success"
+ style="padding: 5px"
+ icon="el-icon-view"
+ @click="viewModal(scope.row)"
+ >鏌ョ湅</el-button
+ >
+ </div>
+ </template>
+ </el-table-column>
+ <el-table-column
+ label="鎿嶄綔"
+ fixed="right"
+ align="center"
+ width="150"
+ class-name="small-padding fixed-width"
+ v-if="roleKey == 'admin'"
+ >
+ <template slot-scope="scope">
+ <div style="display: flex; justify-content: space-around">
+ <el-button
+ v-if="scope.row.state == 3"
+ size="small"
+ type="success"
+ style="padding: 5px"
+ icon="el-icon-view"
+ @click="viewModal(scope.row)"
+ >鏌ョ湅</el-button
+ >
+ </div>
+ </template>
+ </el-table-column>
+ </el-table>
+ <el-pagination
+ background
+ :current-page="pageIndex"
+ @current-change="changePage"
+ :page-size="pageSize"
+ layout="prev, pager, next"
+ :total="total"
+ style="margin-top: 12px"
+ >
+ </el-pagination>
+ </el-card>
- <el-dialog :title="title" :visible.sync="AZModal" width="800">
- <div class="azmodal">
- <el-form :model="form" :rules="rules" ref="form">
- <el-form-item label="璁惧" :label-width="formLabelWidth" prop="deviceId">
- <el-select v-model="form.deviceId" placeholder="璇烽�夋嫨" :disabled="title == '淇敼瀹夎鍗�' || view">
- <el-option v-for="item in deviceList" :label="item.deviceName"
- :value="item.deviceId"></el-option>
- </el-select>
- </el-form-item>
- <el-form-item label="瀹夎宸ヤ汉" :label-width="formLabelWidth" prop="erectoId">
- <el-select v-model="form.erectoId" placeholder="璇烽�夋嫨"
- :disabled="form.state > 1 || roleKey == 'tenantservice'">
- <el-option v-for="item in erectoList" :label="item.nickName" :value="item.userId"></el-option>
- </el-select>
- </el-form-item>
- <el-form-item label="璁㈠崟鐘舵��" :label-width="formLabelWidth" prop="state">
- <el-radio-group v-model="form.state" disabled>
- <el-radio :label="0">鏈寚娲�</el-radio>
- <el-radio :label="1">宸叉淳鍗�</el-radio>
- <el-radio :label="2">宸叉帴鍗�</el-radio>
- <el-radio :label="3">宸插畬鎴�</el-radio>
- </el-radio-group>
- </el-form-item>
- <el-form-item label="鐢ㄦ埛濮撳悕" :label-width="formLabelWidth" prop="userName">
- <el-input v-model="form.userName" autocomplete="off" :disabled="view"></el-input>
- </el-form-item>
- <el-form-item label="鐢ㄦ埛鐢佃瘽" :label-width="formLabelWidth" prop="userPhone">
- <el-input v-model="form.userPhone" autocomplete="off" :disabled="view"></el-input>
- </el-form-item>
- <el-form-item label="瀹夎鍦板潃" :label-width="formLabelWidth" prop="address">
- <el-input v-model="form.address" autocomplete="off" :disabled="view"></el-input>
- </el-form-item>
- <el-form-item label="棰勭害鏃堕棿" :label-width="formLabelWidth">
- <el-date-picker v-model="form.appointmentTime" type="datetime" placeholder="閫夋嫨鏃ユ湡鏃堕棿"
- :disabled="form.state == 3" value-format="yyyy-MM-dd HH:mm:ss">
- </el-date-picker>
- </el-form-item>
- <el-form-item label="璁㈠崟澶囨敞" :label-width="formLabelWidth">
- <el-input type="textarea" v-model="form.remark" :disabled="view"></el-input>
- </el-form-item>
- <el-form-item label="瀹夎璇佹槑" v-if="view" :label-width="formLabelWidth">
- <img :src="form.imgUrl" alt="">
- </el-form-item>
- <el-form-item label="涓婁紶鍥剧墖" v-if="form.state == 3 && !view" :label-width="formLabelWidth">
- <el-upload ref="uploadImg" action="#" :on-change="handleChange" list-type="picture-card"
- :multiple="false" :auto-upload="false" :on-preview="handlePictureCardPreview"
- :headers="headerObj" :limit="1" :on-exceed="exceed" :on-remove="handleRemove">
- <i class="el-icon-plus"></i>
- </el-upload>
- <el-dialog :visible.sync="dialogVisible">
- <img width="100%" :src="dialogImageUrl" alt="">
- </el-dialog>
- </el-form-item>
- <el-form-item label="鐢ㄦ埛璇勫垎" v-if="form.isRate" :label-width="formLabelWidth">
- <el-rate disabled v-model="form.score" style="padding-top: 8px;"></el-rate>
- </el-form-item>
- <el-form-item label="鐢ㄦ埛璇勪环" v-if="form.isRate" :label-width="formLabelWidth">
- <el-input type="textarea" disabled v-model="form.evaluate" :disabled="view"></el-input>
- </el-form-item>
- </el-form>
- </div>
- <div slot="footer" class="dialog-footer">
- <el-button @click="AZModal = false" :disabled="view" size="mini">鍙� 娑�</el-button>
- <el-button type="primary" @click="submitForm('form')" :disabled="view" size="mini">纭� 瀹�</el-button>
- </div>
- </el-dialog>
- <el-dialog title="鍒犻櫎鏁版嵁" :visible.sync="deleteModal" width="30%">
- <span>鏄惁鍒犻櫎璇ユ潯鏁版嵁</span>
- <span slot="footer" class="dialog-footer">
- <el-button @click="deleteModal = false" size="mini">鍙� 娑�</el-button>
- <el-button type="primary" @click="delDate" size="mini">纭� 瀹�</el-button>
- </span>
- </el-dialog>
- <el-dialog title="鎺ュ崟" :visible.sync="acceptModal" width="30%">
- <span>鏄惁纭鎺ュ崟?姝ゆ搷浣滀笉鍙仮澶�!</span>
- <span slot="footer" class="dialog-footer">
- <el-button @click="acceptModal = false" size="mini">鍙� 娑�</el-button>
- <el-button type="primary" @click="add" size="mini">纭� 瀹�</el-button>
- </span>
- </el-dialog>
- <el-dialog title="瓒呮椂閰嶇疆" :visible.sync="timeOutModal">
- <el-form :model="timeForm" :rules="timeRules" ref="timeForm">
- <el-form-item label="娲惧崟鎺ュ崟瓒呮椂闂撮殧(鍗曚綅锛氬垎閽�)" :label-width="timeformLabelWidth" prop="ReceiveTimeout">
- <el-input v-model="timeForm.ReceiveTimeout" autocomplete="off"></el-input>
- </el-form-item>
- <el-form-item label="鎺ュ崟瀹屾垚瓒呮椂闂撮殧(鍗曚綅锛氬垎閽�)" :label-width="timeformLabelWidth" prop="FinishTimeout">
- <el-input v-model="timeForm.FinishTimeout" autocomplete="off"></el-input>
- </el-form-item>
- </el-form>
- <div slot="footer" class="dialog-footer">
- <el-button @click="timeOutModal = false" size="mini">鍙� 娑�</el-button>
- <el-button type="primary" @click="submitTimeForm('timeForm')" size="mini">纭� 瀹�</el-button>
- </div>
- </el-dialog>
- </div>
+ <el-dialog :title="title" :visible.sync="AZModal" width="800">
+ <div class="azmodal">
+ <el-form :model="form" :rules="rules" ref="form">
+ <el-form-item
+ label="璁惧"
+ :label-width="formLabelWidth"
+ prop="deviceId"
+ >
+ <el-select
+ v-model="form.deviceId"
+ placeholder="璇烽�夋嫨"
+ :disabled="title == '淇敼瀹夎鍗�' || view"
+ >
+ <el-option
+ v-for="item in deviceList"
+ :label="item.deviceName"
+ :value="item.deviceId"
+ ></el-option>
+ </el-select>
+ </el-form-item>
+ <el-form-item
+ label="瀹夎宸ヤ汉"
+ :label-width="formLabelWidth"
+ prop="erectoId"
+ >
+ <el-select
+ v-model="form.erectoId"
+ placeholder="璇烽�夋嫨"
+ :disabled="form.state > 1 || roleKey == 'tenantservice'"
+ >
+ <el-option
+ v-for="item in erectoList"
+ :label="item.nickName"
+ :value="item.userId"
+ ></el-option>
+ </el-select>
+ </el-form-item>
+ <el-form-item
+ label="璁㈠崟鐘舵��"
+ :label-width="formLabelWidth"
+ prop="state"
+ >
+ <el-radio-group v-model="form.state" disabled>
+ <el-radio :label="0">鏈寚娲�</el-radio>
+ <el-radio :label="1">宸叉淳鍗�</el-radio>
+ <el-radio :label="2">宸叉帴鍗�</el-radio>
+ <el-radio :label="3">宸插畬鎴�</el-radio>
+ </el-radio-group>
+ </el-form-item>
+ <el-form-item
+ label="鐢ㄦ埛濮撳悕"
+ :label-width="formLabelWidth"
+ prop="userName"
+ >
+ <el-input
+ v-model="form.userName"
+ autocomplete="off"
+ :disabled="view"
+ ></el-input>
+ </el-form-item>
+ <el-form-item
+ label="鐢ㄦ埛鐢佃瘽"
+ :label-width="formLabelWidth"
+ prop="userPhone"
+ >
+ <el-input
+ v-model="form.userPhone"
+ autocomplete="off"
+ :disabled="view"
+ ></el-input>
+ </el-form-item>
+ <el-form-item
+ label="瀹夎鍦板潃"
+ :label-width="formLabelWidth"
+ prop="address"
+ >
+ <el-input
+ v-model="form.address"
+ autocomplete="off"
+ :disabled="view"
+ ></el-input>
+ </el-form-item>
+ <el-form-item label="棰勭害鏃堕棿" :label-width="formLabelWidth">
+ <el-date-picker
+ v-model="form.appointmentTime"
+ type="datetime"
+ placeholder="閫夋嫨鏃ユ湡鏃堕棿"
+ :disabled="form.state == 3"
+ value-format="yyyy-MM-dd HH:mm:ss"
+ >
+ </el-date-picker>
+ </el-form-item>
+ <el-form-item label="璁㈠崟澶囨敞" :label-width="formLabelWidth">
+ <el-input
+ type="textarea"
+ v-model="form.remark"
+ :disabled="view"
+ ></el-input>
+ </el-form-item>
+ <el-form-item
+ label="瀹夎璇佹槑"
+ v-if="view"
+ :label-width="formLabelWidth"
+ >
+ <img :src="form.imgUrl" alt="" />
+ </el-form-item>
+ <el-form-item
+ label="涓婁紶鍥剧墖"
+ v-if="form.state == 3 && !view"
+ :label-width="formLabelWidth"
+ >
+ <el-upload
+ ref="uploadImg"
+ action="#"
+ :on-change="handleChange"
+ list-type="picture-card"
+ :multiple="false"
+ :auto-upload="false"
+ :on-preview="handlePictureCardPreview"
+ :headers="headerObj"
+ :limit="1"
+ :on-exceed="exceed"
+ :on-remove="handleRemove"
+ >
+ <i class="el-icon-plus"></i>
+ </el-upload>
+ <el-dialog :visible.sync="dialogVisible">
+ <img width="100%" :src="dialogImageUrl" alt="" />
+ </el-dialog>
+ </el-form-item>
+ <el-form-item
+ label="鐢ㄦ埛璇勫垎"
+ v-if="form.isRate"
+ :label-width="formLabelWidth"
+ >
+ <el-rate
+ disabled
+ v-model="form.score"
+ style="padding-top: 8px"
+ ></el-rate>
+ </el-form-item>
+ <el-form-item
+ label="鐢ㄦ埛璇勪环"
+ v-if="form.isRate"
+ :label-width="formLabelWidth"
+ >
+ <el-input
+ type="textarea"
+ disabled
+ v-model="form.evaluate"
+ :disabled="view"
+ ></el-input>
+ </el-form-item>
+ </el-form>
+ </div>
+ <div slot="footer" class="dialog-footer">
+ <el-button @click="AZModal = false" :disabled="view" size="mini"
+ >鍙� 娑�</el-button
+ >
+ <el-button
+ type="primary"
+ @click="submitForm('form')"
+ :disabled="view"
+ size="mini"
+ >纭� 瀹�</el-button
+ >
+ </div>
+ </el-dialog>
+ <el-dialog title="鍒犻櫎鏁版嵁" :visible.sync="deleteModal" width="30%">
+ <span>鏄惁鍒犻櫎璇ユ潯鏁版嵁</span>
+ <span slot="footer" class="dialog-footer">
+ <el-button @click="deleteModal = false" size="mini">鍙� 娑�</el-button>
+ <el-button type="primary" @click="delDate" size="mini">纭� 瀹�</el-button>
+ </span>
+ </el-dialog>
+ <el-dialog title="鎺ュ崟" :visible.sync="acceptModal" width="30%">
+ <span>鏄惁纭鎺ュ崟?姝ゆ搷浣滀笉鍙仮澶�!</span>
+ <span slot="footer" class="dialog-footer">
+ <el-button @click="acceptModal = false" size="mini">鍙� 娑�</el-button>
+ <el-button type="primary" @click="add" size="mini">纭� 瀹�</el-button>
+ </span>
+ </el-dialog>
+ <el-dialog title="瓒呮椂閰嶇疆" :visible.sync="timeOutModal">
+ <el-form :model="timeForm" :rules="timeRules" ref="timeForm">
+ <el-form-item
+ label="娲惧崟鎺ュ崟瓒呮椂闂撮殧(鍗曚綅锛氬垎閽�)"
+ :label-width="timeformLabelWidth"
+ prop="ReceiveTimeout"
+ >
+ <el-input
+ v-model="timeForm.ReceiveTimeout"
+ autocomplete="off"
+ ></el-input>
+ </el-form-item>
+ <el-form-item
+ label="鎺ュ崟瀹屾垚瓒呮椂闂撮殧(鍗曚綅锛氬垎閽�)"
+ :label-width="timeformLabelWidth"
+ prop="FinishTimeout"
+ >
+ <el-input
+ v-model="timeForm.FinishTimeout"
+ autocomplete="off"
+ ></el-input>
+ </el-form-item>
+ </el-form>
+ <div slot="footer" class="dialog-footer">
+ <el-button @click="timeOutModal = false" size="mini">鍙� 娑�</el-button>
+ <el-button
+ type="primary"
+ @click="submitTimeForm('timeForm')"
+ size="mini"
+ >纭� 瀹�</el-button
+ >
+ </div>
+ </el-dialog>
+ </div>
</template>
<script>
-import request from '@/utils/request'
+import request from "@/utils/request";
import FileUpload from "@/components/FileUpload/index.vue";
-import {
- getToken
-} from "@/utils/auth";
+import { getToken } from "@/utils/auth";
// import {
// listAlertLog,
// getAlertLog,
@@ -245,594 +472,636 @@
// } from "@/api/iot/alertLog";
export default {
- // name: "AlertLog",
- // dicts: ['iot_alert_level', 'iot_process_status'],
- components: {
- FileUpload
- },
- data() {
- return {
- timeForm: {
- ReceiveTimeout: 0,
- FinishTimeout: 0,
- },
- timeRules: {
- ReceiveTimeout: [
- { required: true, message: "娲惧崟鎺ュ崟瓒呮椂闂撮殧涓嶈兘涓虹┖", trigger: "blur" }
- ],
- FinishTimeout: [
- { required: true, message: "鎺ュ崟瀹屾垚瓒呮椂闂撮殧涓嶈兘涓虹┖", trigger: "blur" }
- ],
- },
- timeOutModal: false,
- nickName: localStorage.getItem('nickName'),
- headerObj: {
- Authorization: "Bearer " + getToken()
- },
- acceptModal: false,
- acceptDateParams: {},
- nextlevel: 0,
- level: 0,
- title: '鍒涘缓瀹夎鍗�',
- deleteModal: false,
- pageIndex: 1,
- pageSize: 10,
- total: 20,
- searchName: '',
- queryParams: {
- WXBody: '鏈淳鍗�',
- PDBody: '鏈淳鍗�'
- },
- WXBodyType: [{ label: '鍏ㄩ儴宸ュ崟', value: '鍏ㄩ儴宸ュ崟' }, { label: '鏈淳鍗�', value: '鏈淳鍗�' }, { label: 'num1', value: 'num1' }],
- rules: {
- deviceId: [
- { required: true, message: '璇烽�夋嫨璁惧', trigger: 'change' }
- ],
- erectoId: [
- { required: true, message: "璇烽�夋嫨瀹夎宸�", trigger: "change" }
- ],
- userName: [
- { required: true, message: "鐢ㄦ埛濮撳悕涓嶈兘涓虹┖", trigger: "blur" }
- ],
- userPhone: [
- { required: true, trigger: "blur", message: "璇疯緭鍏ユ偍鐨勬墜鏈哄彿鐮�" },
- { pattern: /^1[3456789]\d{9}$/, message: '鎵嬫満鍙风爜鏍煎紡涓嶆纭�', trigger: 'blur' }
- ],
- address: [
- { required: true, message: "瀹夎鍦板潃涓嶈兘涓虹┖", trigger: "blur" }
- ],
- },
- form: {},
- tableData: [
- ],
- timeformLabelWidth: '215px',
- formLabelWidth: '120px',
- AZModal: false,
- deviceList: [],
- state: -1,
- id: 0,
- erectoList: [],
- erectoListLevel: [],
- roleKey: localStorage.getItem('roleKey'),
- dialogImageUrl: '',
- dialogVisible: false,
- view: false,
- delDeviceId:0
+ // name: "AlertLog",
+ // dicts: ['iot_alert_level', 'iot_process_status'],
+ components: {
+ FileUpload,
+ },
+ data() {
+ return {
+ timeOutSelect: 0,
+ timeForm: {
+ ReceiveTimeout: 0,
+ FinishTimeout: 0,
+ },
+ timeRules: {
+ ReceiveTimeout: [
+ {
+ required: true,
+ message: "娲惧崟鎺ュ崟瓒呮椂闂撮殧涓嶈兘涓虹┖",
+ trigger: "blur",
+ },
+ ],
+ FinishTimeout: [
+ {
+ required: true,
+ message: "鎺ュ崟瀹屾垚瓒呮椂闂撮殧涓嶈兘涓虹┖",
+ trigger: "blur",
+ },
+ ],
+ },
+ timeOutModal: false,
+ nickName: localStorage.getItem("nickName"),
+ headerObj: {
+ Authorization: "Bearer " + getToken(),
+ },
+ acceptModal: false,
+ acceptDateParams: {},
+ nextlevel: 0,
+ level: 0,
+ title: "鍒涘缓瀹夎鍗�",
+ deleteModal: false,
+ pageIndex: 1,
+ pageSize: 10,
+ total: 20,
+ searchName: "",
+ queryParams: {
+ WXBody: "鏈淳鍗�",
+ PDBody: "鏈淳鍗�",
+ },
+ WXBodyType: [
+ { label: "鍏ㄩ儴宸ュ崟", value: "鍏ㄩ儴宸ュ崟" },
+ { label: "鏈淳鍗�", value: "鏈淳鍗�" },
+ { label: "num1", value: "num1" },
+ ],
+ rules: {
+ deviceId: [
+ { required: true, message: "璇烽�夋嫨璁惧", trigger: "change" },
+ ],
+ erectoId: [
+ { required: true, message: "璇烽�夋嫨瀹夎宸�", trigger: "change" },
+ ],
+ userName: [
+ { required: true, message: "鐢ㄦ埛濮撳悕涓嶈兘涓虹┖", trigger: "blur" },
+ ],
+ userPhone: [
+ { required: true, trigger: "blur", message: "璇疯緭鍏ユ偍鐨勬墜鏈哄彿鐮�" },
+ {
+ pattern: /^1[3456789]\d{9}$/,
+ message: "鎵嬫満鍙风爜鏍煎紡涓嶆纭�",
+ trigger: "blur",
+ },
+ ],
+ address: [
+ { required: true, message: "瀹夎鍦板潃涓嶈兘涓虹┖", trigger: "blur" },
+ ],
+ },
+ form: {},
+ tableData: [],
+ timeformLabelWidth: "215px",
+ formLabelWidth: "120px",
+ AZModal: false,
+ deviceList: [],
+ state: -1,
+ id: 0,
+ erectoList: [],
+ erectoListLevel: [],
+ roleKey: localStorage.getItem("roleKey"),
+ dialogImageUrl: "",
+ dialogVisible: false,
+ view: false,
+ delDeviceId: 0,
+ };
+ },
+ mounted() {
+ console.log(this.nickName);
+ this.getList();
+ this.getErectoList();
+ this.getErectoListLevel();
+ // this.selecttimeout()
+ },
+ methods: {
+ submitTimeForm() {
+ this.$refs["timeForm"].validate((valid) => {
+ if (valid) {
+ this.editTimeOut();
+ } else {
+ console.log("error submit!!");
+ return false;
}
+ });
},
-
- mounted() {
- console.log(this.nickName);
- this.getList();
- this.getErectoList()
- this.getErectoListLevel()
- // this.selecttimeout()
- },
- methods: {
- submitTimeForm() {
- this.$refs['timeForm'].validate((valid) => {
- if (valid) {
- this.editTimeOut()
- } else {
- console.log('error submit!!');
- return false;
- }
- });
- },
- editTimeOut() {
- let data = {
- receiveTimeout: this.timeForm.ReceiveTimeout,
- finishTimeout: this.timeForm.FinishTimeout,
- orderType: 1,
- userId: localStorage.getItem('userID')
- }
- request({
- url: `/iot/deviceOrder/updatetimeout`,
- method: "put",
- params: data,
- }).then((res) => {
- console.log(res);
- if (res.code == 200) {
- this.$message({
- message: '淇敼鎴愬姛',
- type: 'success'
- });
- this.timeOutModal = false
- } else {
- this.$message({
- message: '淇敼澶辫触',
- type: 'error'
- });
- }
- }).catch((res) => {
- this.$message({
- message: '淇敼澶辫触',
- type: 'error'
- });
- })
-
- },
- getTimeOut() {
- let data = {
- orderType: 1,
- userId: localStorage.getItem('userID')
- }
- request({
- url: `/iot/deviceOrder/selecttimeout`,
- method: "get",
- params: data,
- }).then((res) => {
- console.log(res);
- if (res.code == 200) {
- this.timeForm.ReceiveTimeout = res.data.receiveTimeout
- this.timeForm.FinishTimeout = res.data.finishTimeout
- } else {
- this.timeForm.ReceiveTimeout = 0
- this.timeForm.FinishTimeout = 0
- }
- }).catch((res) => {
- this.timeForm.ReceiveTimeout = 0
- this.timeForm.FinishTimeout = 0
- return false
- })
- },
- openTimeOutModal() {
- this.getTimeOut()
- this.timeOutModal = true
-
- },
- exceed(e) {
- console.log(e);
+ editTimeOut() {
+ let data = {
+ receiveTimeout: this.timeForm.ReceiveTimeout,
+ finishTimeout: this.timeForm.FinishTimeout,
+ orderType: 1,
+ userId: localStorage.getItem("userID"),
+ };
+ request({
+ url: `/iot/deviceOrder/updatetimeout`,
+ method: "put",
+ params: data,
+ })
+ .then((res) => {
+ console.log(res);
+ if (res.code == 200) {
this.$message({
- message: '鍥剧墖鏈�澶氫笂浼犱竴寮�',
- type: 'error'
+ message: "淇敼鎴愬姛",
+ type: "success",
});
- },
- handleRemove(file, fileList) {
- this.form.imgUrl = ''
- console.log(file, fileList);
- },
- handleChange(file) {
-
- if (file.size > 1024 * 1024 * 2) {
- this.$refs.uploadImg.uploadFiles.length = 0;
- this.$message({
- message: '鍥剧墖澶у皬涓嶈兘瓒呰繃2M,璇烽噸鏂颁笂浼�',
- type: 'error'
- });
- return
- }
- this.dialogImageUrl = file.url;
- let formData = new FormData();
- formData.append('avatarfile', file.raw);
- formData.append('orderType', 1);
- request({
- url: '/iot/deviceOrder/profile/avatar',
- method: "post",
- data: formData
- }).then((res) => {
- console.log(res);
- if (res.code == 200) {
- this.$message({
- message: '涓婁紶鎴愬姛',
- type: 'success'
- });
- this.form.imgUrl = 'https://puyue.yhupai.com/prod-api' + res.imgUrl
- } else {
- this.$message({
- message: '涓婁紶澶辫触',
- type: 'error'
- });
- }
- }).catch((res) => {
- this.$message({
- message: '涓婁紶澶辫触',
- type: 'error'
- });
- })
-
- },
- handlePictureCardPreview(file) {
- this.dialogImageUrl = file.url;
- this.dialogVisible = true;
- },
- getErectoList() {
- let data = {
- pageNum: 1,
- pageSize: 10000,
- deptId: localStorage.getItem('deptId'),
- isAuthentication: 1,
- }
- request({
- url: '/system/user/list',
- method: "get",
- params: data
- }).then((res) => {
- console.log(res);
- if (res.code == 200) {
- this.erectoList = res.rows
- this.erectoList.unshift({
- nickName: '鏈寚娲�',
- userId: -1
- })
- } else {
- this.erectoList = []
- }
- }).catch((res) => {
- this.erectoList = []
- })
- },
- getErectoListLevel() {
- this.erectoListLevel = []
- let data = {
- pageNum: 1,
- pageSize: 10000,
- deptId: localStorage.getItem('deptId'),
- // isAuthentication: 1,
- roleKey: 'tenanthelper',
- }
- request({
- url: '/system/user/list',
- method: "get",
- params: data
- }).then((res) => {
- console.log(res);
- if (res.code == 200 && res.rows.length > 0) {
- this.erectoListLevel = res.rows
- this.nextlevel = res.rows[0].userId
- } else {
- this.erectoListLevel = []
- }
- }).catch((res) => {
- this.erectoListLevel = []
- })
- },
- // 鑾峰彇璁惧鍒楄〃
- getDeviceList() {
- let data = {
- status: 1
- }
- request({
- url: '/iot/device/shortList',
- method: "get",
- params: data
- }).then((res) => {
- if (res.code == 200) {
- this.deviceList = res.rows
- } else {
- this.deviceList = []
- }
- }).catch((res) => {
- this.deviceList = []
- })
- },
- // 鑾峰彇瀹夎鍒楄〃
- getList() {
- this.tableData = []
- let data = {
- pageNum: this.pageIndex,
- pageSize: this.pageSize,
- state: this.state,
- orderType: 1,
- }
- if (this.roleKey == 'tenantservice') {
- data.createUserId = 0
- data.erectoId = localStorage.getItem('userID')
- }
- if (this.roleKey == 'admin') {
- data.createUserId = 0;
- data.erectoId = 0;
- }
- if (this.roleKey == 'tenant' || this.roleKey == 'tenanthelper') {
- data.createUserId = localStorage.getItem('userID');
- data.erectoId = 0;
- }
- if (this.level == 1) { //褰撻�夋嫨涓嬬骇鏃�
- data.createUserId = this.nextlevel
- }
- request({
- url: '/iot/deviceOrder/list',
- method: "get",
- params: data
- }).then((res) => {
- if (res.code == 200) {
- this.tableData = res.rows
- this.total = res.total
- } else {
- this.tableData = []
- this.total = 0
- }
- }).catch((res) => {
- this.tableData = []
- this.total = 0
- })
- },
- handleSelectionChange(e) {
- console.log(1, e);
- },
- filterHandlerBody(e) {
- console.log(2, e);
- },
- filterHandlerStatus(e) {
- console.log(3, e);
- },
- changePage(e) {
- this.pageIndex = e
- this.getList()
- },
- openAZModal() {
- this.getDeviceList();
- this.form = {
- deviceId: undefined,
- address: '',//鍦板潃
- appointmentTime: '',//棰勭害鏃堕棿
- remark: '',//澶囨敞
- erectoId: -1,//瀹夎宸�
- userName: '', //鐢ㄦ埛淇℃伅,鑱旂郴浜�
- userPhone: '',//鐢ㄦ埛淇℃伅鑱旂郴鐢佃瘽
- erectoName: '鏈寚娲�',
- state: 0,
- erectoPhone: '',
- }
- this.title = '鍒涘缓瀹夎鍗�'
- this.AZModal = true
- },
- submitForm() {
- this.$refs['form'].validate((valid) => {
- if (valid) {
- this.add()
- } else {
- console.log('error submit!!');
- return false;
- }
+ this.timeOutModal = false;
+ } else {
+ this.$message({
+ message: "淇敼澶辫触",
+ type: "error",
});
- },
- add() {
- console.log(this.erectoList);
- for (let i = 0; i < this.erectoList.length; i++) {
- if (this.form.erectoId == this.erectoList[i].userId) {
- this.form.erectoName = this.erectoList[i].nickName
- this.form.erectoPhone=this.erectoList[i].phonenumber
- }
- }
- console.log(this.form);
-
- let data = {
- deviceId: this.form.deviceId,
- erectoId: this.form.erectoId,
- erectoName: this.form.erectoName,
- userName: this.form.userName,
- userPhone: this.form.userPhone,
- address: this.form.address,
- appointmentTime: this.form.appointmentTime,
- remark: this.form.remark,
- state: this.form.state,
- erectoPhone:this.form.erectoPhone
- }
- if (this.form.receiveTime) {
- data.receiveTime = this.form.receiveTime
- }
-
- console.log(data);
- if (this.title == '淇敼瀹夎鍗�') {
- data.id = this.id,
- data.orderType = '1'
- if (this.form.state == 3) {
- if (!this.form.imgUrl) {
- this.$message({
- message: '璇蜂笂浼犲浘鐗�',
- type: 'error'
- });
- return
- }
- data.imgUrl = this.form.imgUrl
- }
- console.log(data);
- request({
- url: '/iot/deviceOrder',
- method: "put",
- data: data
- }).then((res) => {
- console.log(res);
- if (res.code == 200) {
- this.state = -1
- this.pageIndex = 1
- this.getList()
- this.AZModal = false
- this.acceptModal = false
-
- } else {
- this.state = -1
- this.pageIndex = 1
- this.getList()
- this.AZModal = false
- this.acceptModal = false
-
- }
- }).catch((res) => {
- this.state = -1
- this.pageIndex = 1
- this.getList()
- this.AZModal = false
- this.acceptModal = false
- })
- } else {
-
- request({
- url: '/iot/deviceOrder',
- method: "post",
- data: data
- }).then((res) => {
- if (res.code == 200) {
- this.state = -1
- this.pageIndex = 1
- this.getList()
- this.AZModal = false
-
- } else {
- this.state = -1
- this.pageIndex = 1
- this.getList()
- this.AZModal = false
- }
- }).catch((res) => {
- this.state = -1
- this.pageIndex = 1
- this.getList()
- this.AZModal = false
- })
- }
-
- },
- editModal(item) {
- this.title = '淇敼瀹夎鍗�'
- this.form = item
- this.form = JSON.parse(JSON.stringify(item))
- this.deviceList = [{ deviceName: item.device.deviceName, deviceId: item.device.deviceId }]
- this.deviceList = [{ deviceName: item.device.deviceName, deviceId: item.device.deviceId }]
- console.log(this.form);
- this.view = false
- this.AZModal = true
- this.id = item.id
- },
- delModal(item) {
- this.id = item.id
- this.delDeviceId=item.deviceId
- this.deleteModal = true
- },
- delDate() {
- let that = this
- let data = {
- id: this.id,
- deviceId:this.delDeviceId
- }
- request({
- url: `/iot/deviceOrder/${that.id}/${that.delDeviceId}`,
- method: "DELETE",
- // data: data
- }).then((res) => {
- if (res.code == 200) {
- that.pageIndex = 1
- that.getList()
- that.deleteModal = false
- } else {
- that.pageIndex = 1
- that.getList()
- that.deleteModal = false
- }
-
- }).catch((res) => {
- that.pageIndex = 1
- that.getList()
- that.deleteModal = false
- })
- },
- // 鎺ュ崟
- JDModal(item) {
- if (!item.appointmentTime) {
- this.$message({
- message: '璇峰拰瀹㈡埛纭棰勭害鏃堕棿骞跺綍鍏ョ郴缁熷啀鎺ュ崟!',
- type: 'error'
- });
- return false
- }
- this.title = '淇敼瀹夎鍗�'
- this.form = JSON.parse(JSON.stringify(item))
- this.form.state = 2
- this.deviceList = [{ deviceName: item.device.deviceName, deviceId: item.device.deviceId }]
- this.id = item.id
- this.form.receiveTime = this.formatNow()
- this.view = false
- this.acceptModal = true
- },
- formatNow() {
- let now = new Date();
- let year = now.getFullYear();
- let month = (now.getMonth() + 1).toString().padStart(2, '0'); // 娉ㄦ剰锛氭湀浠芥槸浠� 0 寮�濮嬬殑锛屾墍浠ラ渶瑕� +1
- let day = now.getDate().toString().padStart(2, '0');
- let hour = now.getHours().toString().padStart(2, '0');
- let minute = now.getMinutes().toString().padStart(2, '0');
- let second = now.getSeconds().toString().padStart(2, '0');
- let millisecond = now.getMilliseconds().toString().padStart(3, '0');
- return `${year}-${month}-${day} ${hour}:${minute}:${second}`;
- },
- // 缁撳崟
- jdModal(item) {
- this.title = '淇敼瀹夎鍗�'
- this.form = JSON.parse(JSON.stringify(item))
- this.form.state = 3
- this.deviceList = [{ deviceName: item.device.deviceName, deviceId: item.device.deviceId }]
- this.id = item.id
- this.view = false
- // this.form.receiveTime = this.formatNow()
- this.AZModal = true
- },
- // 缁撳崟鏌ョ湅
- viewModal(item) {
- this.title = '鏌ョ湅瀹夎鍗�'
- this.form = JSON.parse(JSON.stringify(item))
- this.form.erectoId = this.form.erectoName
- this.deviceList = [{ deviceName: item.device.deviceName, deviceId: item.device.deviceId }]
- console.log(this.erectoList);
- this.id = item.id
- this.view = true
- console.log(this.form);
- // this.form.receiveTime = this.formatNow()
- this.AZModal = true
- },
+ }
+ })
+ .catch((res) => {
+ this.$message({
+ message: "淇敼澶辫触",
+ type: "error",
+ });
+ });
},
- watch: {
- 'form.erectoId': {
- handler(newVal, oldVal) {
- if (this.form.state < 2) {
- if (newVal && newVal == -1) {
- this.form.state = 0
- } else {
- this.form.state = 1
- }
- }
- },
- deep: true,
- },
- }
-}
+ getTimeOut() {
+ let data = {
+ orderType: 1,
+ userId: localStorage.getItem("userID"),
+ };
+ request({
+ url: `/iot/deviceOrder/selecttimeout`,
+ method: "get",
+ params: data,
+ })
+ .then((res) => {
+ console.log(res);
+ if (res.code == 200) {
+ this.timeForm.ReceiveTimeout = res.data.receiveTimeout;
+ this.timeForm.FinishTimeout = res.data.finishTimeout;
+ } else {
+ this.timeForm.ReceiveTimeout = 0;
+ this.timeForm.FinishTimeout = 0;
+ }
+ })
+ .catch((res) => {
+ this.timeForm.ReceiveTimeout = 0;
+ this.timeForm.FinishTimeout = 0;
+ return false;
+ });
+ },
+ openTimeOutModal() {
+ this.getTimeOut();
+ this.timeOutModal = true;
+ },
+ exceed(e) {
+ console.log(e);
+ this.$message({
+ message: "鍥剧墖鏈�澶氫笂浼犱竴寮�",
+ type: "error",
+ });
+ },
+ handleRemove(file, fileList) {
+ this.form.imgUrl = "";
+ console.log(file, fileList);
+ },
+ handleChange(file) {
+ if (file.size > 1024 * 1024 * 2) {
+ this.$refs.uploadImg.uploadFiles.length = 0;
+ this.$message({
+ message: "鍥剧墖澶у皬涓嶈兘瓒呰繃2M,璇烽噸鏂颁笂浼�",
+ type: "error",
+ });
+ return;
+ }
+ this.dialogImageUrl = file.url;
+ let formData = new FormData();
+ formData.append("avatarfile", file.raw);
+ formData.append("orderType", 1);
+ request({
+ url: "/iot/deviceOrder/Install/profile/avatar",
+ method: "post",
+ data: formData,
+ })
+ .then((res) => {
+ console.log(res);
+ if (res.code == 200) {
+ this.$message({
+ message: "涓婁紶鎴愬姛",
+ type: "success",
+ });
+ this.form.imgUrl = "https://puyue.yhupai.com/prod-api" + res.imgUrl;
+ } else {
+ this.$message({
+ message: "涓婁紶澶辫触",
+ type: "error",
+ });
+ }
+ })
+ .catch((res) => {
+ this.$message({
+ message: "涓婁紶澶辫触",
+ type: "error",
+ });
+ });
+ },
+ handlePictureCardPreview(file) {
+ this.dialogImageUrl = file.url;
+ this.dialogVisible = true;
+ },
+ getErectoList() {
+ let data = {
+ pageNum: 1,
+ pageSize: 10000,
+ deptId: localStorage.getItem("deptId"),
+ isAuthentication: 1,
+ };
+ request({
+ url: "/system/user/list",
+ method: "get",
+ params: data,
+ })
+ .then((res) => {
+ console.log(res);
+ if (res.code == 200) {
+ this.erectoList = res.rows;
+ this.erectoList.unshift({
+ nickName: "鏈寚娲�",
+ userId: -1,
+ });
+ } else {
+ this.erectoList = [];
+ }
+ })
+ .catch((res) => {
+ this.erectoList = [];
+ });
+ },
+ getErectoListLevel() {
+ this.erectoListLevel = [];
+ let data = {
+ pageNum: 1,
+ pageSize: 10000,
+ deptId: localStorage.getItem("deptId"),
+ // isAuthentication: 1,
+ roleKey: "tenanthelper",
+ };
+ request({
+ url: "/system/user/list",
+ method: "get",
+ params: data,
+ })
+ .then((res) => {
+ console.log(res);
+ if (res.code == 200 && res.rows.length > 0) {
+ this.erectoListLevel = res.rows;
+ this.nextlevel = res.rows[0].userId;
+ } else {
+ this.erectoListLevel = [];
+ }
+ })
+ .catch((res) => {
+ this.erectoListLevel = [];
+ });
+ },
+ // 鑾峰彇璁惧鍒楄〃
+ getDeviceList() {
+ let data = {
+ status: 1,
+ };
+ request({
+ url: "/iot/device/shortList",
+ method: "get",
+ params: data,
+ })
+ .then((res) => {
+ if (res.code == 200) {
+ this.deviceList = res.rows;
+ } else {
+ this.deviceList = [];
+ }
+ })
+ .catch((res) => {
+ this.deviceList = [];
+ });
+ },
+ // 鑾峰彇瀹夎鍒楄〃
+ getList() {
+ this.tableData = [];
+ let data = {
+ pageNum: this.pageIndex,
+ pageSize: this.pageSize,
+ state: this.state,
+ orderType: 1,
+ };
+ if (this.timeOutSelect == 0) {
+ } else if (this.timeOutSelect == 1) {
+ data.receiveTimeoutFlag = 1;
+ } else if (this.timeOutSelect == 2) {
+ data.finishTimeoutFlag = 1;
+ }
+ if (this.roleKey == "tenantservice") {
+ data.createUserId = 0;
+ data.erectoId = localStorage.getItem("userID");
+ }
+ if (this.roleKey == "admin") {
+ data.createUserId = 0;
+ data.erectoId = 0;
+ }
+ if (this.roleKey == "tenant" || this.roleKey == "tenanthelper") {
+ data.createUserId = localStorage.getItem("userID");
+ data.erectoId = 0;
+ }
+ if (this.level == 1) {
+ //褰撻�夋嫨涓嬬骇鏃�
+ data.createUserId = this.nextlevel;
+ }
+ console.log(data);
+ request({
+ url: "/iot/deviceOrder/list",
+ method: "get",
+ params: data,
+ })
+ .then((res) => {
+ if (res.code == 200) {
+ this.tableData = res.rows;
+ this.total = res.total;
+ } else {
+ this.tableData = [];
+ this.total = 0;
+ }
+ })
+ .catch((res) => {
+ this.tableData = [];
+ this.total = 0;
+ });
+ },
+ handleSelectionChange(e) {
+ console.log(1, e);
+ },
+ filterHandlerBody(e) {
+ console.log(2, e);
+ },
+ filterHandlerStatus(e) {
+ console.log(3, e);
+ },
+ changePage(e) {
+ this.pageIndex = e;
+ this.getList();
+ },
+ openAZModal() {
+ this.getDeviceList();
+ this.form = {
+ deviceId: undefined,
+ address: "", //鍦板潃
+ appointmentTime: "", //棰勭害鏃堕棿
+ remark: "", //澶囨敞
+ erectoId: -1, //瀹夎宸�
+ userName: "", //鐢ㄦ埛淇℃伅,鑱旂郴浜�
+ userPhone: "", //鐢ㄦ埛淇℃伅鑱旂郴鐢佃瘽
+ erectoName: "鏈寚娲�",
+ state: 0,
+ erectoPhone: "",
+ };
+ this.title = "鍒涘缓瀹夎鍗�";
+ this.AZModal = true;
+ },
+ submitForm() {
+ this.$refs["form"].validate((valid) => {
+ if (valid) {
+ this.add();
+ } else {
+ console.log("error submit!!");
+ return false;
+ }
+ });
+ },
+ add() {
+ console.log(this.erectoList);
+ for (let i = 0; i < this.erectoList.length; i++) {
+ if (this.form.erectoId == this.erectoList[i].userId) {
+ this.form.erectoName = this.erectoList[i].nickName;
+ this.form.erectoPhone = this.erectoList[i].phonenumber;
+ }
+ }
+ console.log(this.form);
+
+ let data = {
+ deviceId: this.form.deviceId,
+ erectoId: this.form.erectoId,
+ erectoName: this.form.erectoName,
+ userName: this.form.userName,
+ userPhone: this.form.userPhone,
+ address: this.form.address,
+ appointmentTime: this.form.appointmentTime,
+ remark: this.form.remark,
+ state: this.form.state,
+ erectoPhone: this.form.erectoPhone,
+ };
+ if (this.form.receiveTime) {
+ data.receiveTime = this.form.receiveTime;
+ }
+
+ console.log(data);
+ if (this.title == "淇敼瀹夎鍗�") {
+ (data.id = this.id), (data.orderType = "1");
+ if (this.form.state == 3) {
+ if (!this.form.imgUrl) {
+ this.$message({
+ message: "璇蜂笂浼犲浘鐗�",
+ type: "error",
+ });
+ return;
+ }
+ data.imgUrl = this.form.imgUrl;
+ }
+ console.log(data);
+ request({
+ url: "/iot/deviceOrder",
+ method: "put",
+ data: data,
+ })
+ .then((res) => {
+ console.log(res);
+ if (res.code == 200) {
+ this.state = -1;
+ this.pageIndex = 1;
+ this.getList();
+ this.AZModal = false;
+ this.acceptModal = false;
+ } else {
+ this.state = -1;
+ this.pageIndex = 1;
+ this.getList();
+ this.AZModal = false;
+ this.acceptModal = false;
+ }
+ })
+ .catch((res) => {
+ this.state = -1;
+ this.pageIndex = 1;
+ this.getList();
+ this.AZModal = false;
+ this.acceptModal = false;
+ });
+ } else {
+ request({
+ url: "/iot/deviceOrder",
+ method: "post",
+ data: data,
+ })
+ .then((res) => {
+ if (res.code == 200) {
+ this.state = -1;
+ this.pageIndex = 1;
+ this.getList();
+ this.AZModal = false;
+ } else {
+ this.state = -1;
+ this.pageIndex = 1;
+ this.getList();
+ this.AZModal = false;
+ }
+ })
+ .catch((res) => {
+ this.state = -1;
+ this.pageIndex = 1;
+ this.getList();
+ this.AZModal = false;
+ });
+ }
+ },
+ editModal(item) {
+ this.title = "淇敼瀹夎鍗�";
+ this.form = item;
+ this.form = JSON.parse(JSON.stringify(item));
+ this.deviceList = [
+ { deviceName: item.device.deviceName, deviceId: item.device.deviceId },
+ ];
+ this.deviceList = [
+ { deviceName: item.device.deviceName, deviceId: item.device.deviceId },
+ ];
+ console.log(this.form);
+ this.view = false;
+ this.AZModal = true;
+ this.id = item.id;
+ },
+ delModal(item) {
+ this.id = item.id;
+ this.delDeviceId = item.deviceId;
+ this.deleteModal = true;
+ },
+ delDate() {
+ let that = this;
+ let data = {
+ id: this.id,
+ deviceId: this.delDeviceId,
+ };
+ request({
+ url: `/iot/deviceOrder/${that.id}/${that.delDeviceId}`,
+ method: "DELETE",
+ // data: data
+ })
+ .then((res) => {
+ if (res.code == 200) {
+ that.pageIndex = 1;
+ that.getList();
+ that.deleteModal = false;
+ } else {
+ that.pageIndex = 1;
+ that.getList();
+ that.deleteModal = false;
+ }
+ })
+ .catch((res) => {
+ that.pageIndex = 1;
+ that.getList();
+ that.deleteModal = false;
+ });
+ },
+ // 鎺ュ崟
+ JDModal(item) {
+ if (!item.appointmentTime) {
+ this.$message({
+ message: "璇峰拰瀹㈡埛纭棰勭害鏃堕棿骞跺綍鍏ョ郴缁熷啀鎺ュ崟!",
+ type: "error",
+ });
+ return false;
+ }
+ this.title = "淇敼瀹夎鍗�";
+ this.form = JSON.parse(JSON.stringify(item));
+ this.form.state = 2;
+ this.deviceList = [
+ { deviceName: item.device.deviceName, deviceId: item.device.deviceId },
+ ];
+ this.id = item.id;
+ this.form.receiveTime = this.formatNow();
+ this.view = false;
+ this.acceptModal = true;
+ },
+ formatNow() {
+ let now = new Date();
+ let year = now.getFullYear();
+ let month = (now.getMonth() + 1).toString().padStart(2, "0"); // 娉ㄦ剰锛氭湀浠芥槸浠� 0 寮�濮嬬殑锛屾墍浠ラ渶瑕� +1
+ let day = now.getDate().toString().padStart(2, "0");
+ let hour = now.getHours().toString().padStart(2, "0");
+ let minute = now.getMinutes().toString().padStart(2, "0");
+ let second = now.getSeconds().toString().padStart(2, "0");
+ let millisecond = now.getMilliseconds().toString().padStart(3, "0");
+ return `${year}-${month}-${day} ${hour}:${minute}:${second}`;
+ },
+ // 缁撳崟
+ jdModal(item) {
+ this.title = "淇敼瀹夎鍗�";
+ this.form = JSON.parse(JSON.stringify(item));
+ this.form.state = 3;
+ this.deviceList = [
+ { deviceName: item.device.deviceName, deviceId: item.device.deviceId },
+ ];
+ this.id = item.id;
+ this.view = false;
+ // this.form.receiveTime = this.formatNow()
+ this.AZModal = true;
+ },
+ // 缁撳崟鏌ョ湅
+ viewModal(item) {
+ this.title = "鏌ョ湅瀹夎鍗�";
+ this.form = JSON.parse(JSON.stringify(item));
+ this.form.erectoId = this.form.erectoName;
+ this.deviceList = [
+ { deviceName: item.device.deviceName, deviceId: item.device.deviceId },
+ ];
+ console.log(this.erectoList);
+ this.id = item.id;
+ this.view = true;
+ console.log(this.form);
+ // this.form.receiveTime = this.formatNow()
+ this.AZModal = true;
+ },
+ },
+ watch: {
+ "form.erectoId": {
+ handler(newVal, oldVal) {
+ if (this.form.state < 2) {
+ if (newVal && newVal == -1) {
+ this.form.state = 0;
+ } else {
+ this.form.state = 1;
+ }
+ }
+ },
+ deep: true,
+ },
+ },
+};
</script>
<style lang="scss" scoped>
.title {
- display: flex;
+ display: flex;
}
.el-select .el-input {
- width: 130px;
+ width: 130px;
}
.input-with-select .el-input-group__prepend {
- background-color: #fff;
+ background-color: #fff;
}
.azmodal {
- max-height: 600px;
- overflow-y: auto !important;
+ max-height: 600px;
+ overflow-y: auto !important;
}
</style>
diff --git a/wumei-smart-master/vue/src/views/equipmentManagement/maintenance.vue b/wumei-smart-master/vue/src/views/equipmentManagement/maintenance.vue
index a074dfc..f3c7d53 100644
--- a/wumei-smart-master/vue/src/views/equipmentManagement/maintenance.vue
+++ b/wumei-smart-master/vue/src/views/equipmentManagement/maintenance.vue
@@ -11,6 +11,14 @@
<el-option label="宸插畬鎴�" :value="3" />
</el-select>
</el-form-item>
+ <el-form-item label="瓒呮椂" prop="level">
+ <el-select v-model="timeOutSelect" placeholder="瓒呮椂鏌ヨ" :disabled="erectoListLevel.length == 0"
+ size="mini">
+ <el-option label="鍏ㄩ儴" :value="0" />
+ <el-option label="鎺ュ崟瓒呮椂" :value="1" />
+ <el-option label="鎺ュ崟瓒呮椂" :value="2" />
+ </el-select>
+ </el-form-item>
<el-form-item label="绛夌骇" prop="level">
<el-select v-model="level" placeholder="鑿滃崟鐘舵��" :disabled="erectoListLevel.length == 0" size="mini">
<el-option label="鏈骇" :value="0" />
@@ -80,6 +88,12 @@
</div>
<div v-if="scope.row.state == 3">
宸插畬鎴�
+ </div>
+ <div v-if="scope.row.receiveTimeoutFlag == 1">
+ <el-tag size="mini" effect="dark" type="danger">鎺ュ崟瓒呮椂</el-tag>
+ </div>
+ <div v-if="scope.row.finishTimeoutFlag == 1">
+ <el-tag size="mini" effect="dark" type="warning">缁撳崟瓒呮椂</el-tag>
</div>
</template>
</el-table-column>
@@ -161,7 +175,7 @@
value-format="yyyy-MM-dd HH:mm:ss">
</el-date-picker>
</el-form-item>
- <el-form-item label="璁㈠崟澶囨敞" :label-width="formLabelWidth">
+ <el-form-item label="鏁呴殰鎻忚堪" :label-width="formLabelWidth" prop="description">
<el-input type="textarea" v-model="form.description" :disabled="view"></el-input>
</el-form-item>
<el-form-item label="缁翠慨璇佹槑" v-if="view" :label-width="formLabelWidth">
@@ -225,6 +239,7 @@
export default {
data() {
return {
+ timeOutSelect: 0,
timeForm: {
ReceiveTimeout: 0,
FinishTimeout: 0,
@@ -270,6 +285,9 @@
],
address: [
{ required: true, message: "缁翠慨鍦板潃涓嶈兘涓虹┖", trigger: "blur" }
+ ],
+ description :[
+ { required: true, message: "鏁呴殰鎻忚堪涓嶈兘涓虹┖", trigger: "blur" }
],
},
form: {},
@@ -396,7 +414,7 @@
formData.append('avatarfile', file.raw);
formData.append('orderType', 2);
request({
- url: '/iot/deviceOrder/profile/avatar',
+ url: '/iot/deviceOrder/Repair/profile/avatar',
method: "post",
data: formData
}).then((res) => {
@@ -504,6 +522,12 @@
state: this.state,
orderType: 2,
}
+ if (this.timeOutSelect == 0) {
+ } else if (this.timeOutSelect == 1) {
+ data.receiveTimeoutFlag = 1
+ } else if (this.timeOutSelect == 2) {
+ data.finishTimeoutFlag = 1
+ }
if (this.roleKey == 'tenantservice') {
data.createUserId = 0
data.erectoId = localStorage.getItem('userID')
--
Gitblit v1.8.0