From 10689a848f6ff8cefea50fdfe9b79a6e359bf21e Mon Sep 17 00:00:00 2001 From: BianLzhaoMin <11485688+bianliangzhaomin123@user.noreply.gitee.com> Date: Fri, 9 Aug 2024 15:16:43 +0800 Subject: [PATCH 1/9] =?UTF-8?q?iot=E8=AE=BE=E5=A4=87=E9=A1=B5=E9=9D=A2?= =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sgzb-ui/src/views/iotDevice/index.vue | 20 +++- .../machinery/coding/component/MapDIalog.vue | 5 +- .../machinery/coding/debug.vue | 100 +++++++++++++++--- 3 files changed, 102 insertions(+), 23 deletions(-) diff --git a/sgzb-ui/src/views/iotDevice/index.vue b/sgzb-ui/src/views/iotDevice/index.vue index e5ebc14a..b12b5782 100644 --- a/sgzb-ui/src/views/iotDevice/index.vue +++ b/sgzb-ui/src/views/iotDevice/index.vue @@ -15,9 +15,9 @@ 添加设备 - 下载二维码 + > --> @@ -154,6 +154,20 @@ v-model="addDeviceParams.iotCode" /> + + + + @@ -237,6 +251,7 @@ export default { addDeviceParams: { iotType: '', iotCode: '', + iotStatus: 0, }, // 新增设备表单校验 addDeviceRules: { @@ -296,6 +311,7 @@ export default { this.dialogConfig.outerTitle = '修改设备' this.addDeviceParams.iotId = row.iotId this.addDeviceParams.iotCode = row.iotCode + this.addDeviceParams.iotStatus = row.iotStatus this.addDeviceParams.iotType = parseInt(row.iotType) } this.dialogConfig.outerWidth = '40%' diff --git a/sgzb-ui/src/views/warehouseManage/machinery/coding/component/MapDIalog.vue b/sgzb-ui/src/views/warehouseManage/machinery/coding/component/MapDIalog.vue index e3881a01..d977fbaf 100644 --- a/sgzb-ui/src/views/warehouseManage/machinery/coding/component/MapDIalog.vue +++ b/sgzb-ui/src/views/warehouseManage/machinery/coding/component/MapDIalog.vue @@ -13,9 +13,7 @@ ({{ deviceType }}) -
- 定位设备编号: {{ equipmentNumber }} -
+
定位设备编号: {{ iotCode }}
{{ engineering }}工程
@@ -195,7 +193,6 @@ export default { trackAni: null, // 轨迹实例 calLon: '', calLat: '', - // 查询设备行程信息的参数 tripParams: { beginTime: moment() diff --git a/sgzb-ui/src/views/warehouseManage/machinery/coding/debug.vue b/sgzb-ui/src/views/warehouseManage/machinery/coding/debug.vue index 8fc6ec58..450377ec 100644 --- a/sgzb-ui/src/views/warehouseManage/machinery/coding/debug.vue +++ b/sgzb-ui/src/views/warehouseManage/machinery/coding/debug.vue @@ -1,6 +1,6 @@ + + + + + + - + @@ -513,6 +530,16 @@ + + +
+
@@ -534,12 +561,22 @@ import Treeselect from '@riophae/vue-treeselect' import '@riophae/vue-treeselect/dist/vue-treeselect.css' import QRCode from 'qrcodejs2' +import BindIOT from './component/BindIOT' +import MapDialog from './component/MapDIalog' + export default { name: 'Devices', dicts: ['sys_normal_disable'], - components: { Treeselect }, + components: { Treeselect, BindIOT, MapDialog }, data() { return { + openMap: false, + isShow: false, + props: { + isShow: false, + typeId: '', + maCode: '', + }, // 遮罩层 loading: true, // 选中数组 @@ -604,6 +641,10 @@ export default { }, ], }, + mapDialogVisible: false, + deviceName: '', + deviceType: '', + iotCode: '', } }, created() { @@ -788,6 +829,29 @@ export default { // ...this.queryParams // }, `type_${new Date().getTime()}.xlsx`) }, + + // iot设备绑定 + handleBindIOT(row) { + console.log('🚀 ~ handleBindIOT ~ row:', row) + this.props = { + isShow: true, + typeId: row.typeId, + maCode: row.maCode, + } + }, + // 查看设备地图 + async handleMap(row) { + this.deviceName = row.specificationType + this.deviceType = row.maStatusName + this.iotCode = row.iotCode + + this.mapDialogVisible = true + }, + + /** 关闭地图弹框 */ + handelCloseDialog() { + this.mapDialogVisible = false + }, }, } @@ -801,8 +865,10 @@ export default { margin-top: 15px; font-size: 18px; } -::v-deep.el-table .fixed-width .el-button--mini { - width: 60px !important; - margin-bottom: 10px; + +.location-icon { + font-size: 20px; + cursor: pointer; + color: #409eff; } From 98d25536815bd62157431bfe9460ac408e8a2ffc Mon Sep 17 00:00:00 2001 From: BianLzhaoMin <11485688+bianliangzhaomin123@user.noreply.gitee.com> Date: Fri, 9 Aug 2024 15:29:09 +0800 Subject: [PATCH 2/9] =?UTF-8?q?=E4=BB=A3=E7=A0=81=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sgzb-ui/src/views/iotDevice/index.vue | 28 +++++++++++++++++++++++---- 1 file changed, 24 insertions(+), 4 deletions(-) diff --git a/sgzb-ui/src/views/iotDevice/index.vue b/sgzb-ui/src/views/iotDevice/index.vue index b12b5782..08308db8 100644 --- a/sgzb-ui/src/views/iotDevice/index.vue +++ b/sgzb-ui/src/views/iotDevice/index.vue @@ -92,6 +92,7 @@ icon="el-icon-delete" style="color: #f56c6c" @click="handleDeleteAndUnbind(row.iotId, 1)" + v-if="row.bindStatus === 1" >删除 - - - + @@ -158,7 +162,7 @@ Date: Fri, 9 Aug 2024 15:30:17 +0800 Subject: [PATCH 3/9] =?UTF-8?q?=E7=BB=B4=E4=BF=AE=E9=85=8D=E4=BB=B6?= =?UTF-8?q?=E6=95=B0=E6=8D=AE=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/bonus/sgzb/base/service/impl/RepairServiceImpl.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sgzb-modules/sgzb-base/src/main/java/com/bonus/sgzb/base/service/impl/RepairServiceImpl.java b/sgzb-modules/sgzb-base/src/main/java/com/bonus/sgzb/base/service/impl/RepairServiceImpl.java index b0ef8569..f4dc2bf1 100644 --- a/sgzb-modules/sgzb-base/src/main/java/com/bonus/sgzb/base/service/impl/RepairServiceImpl.java +++ b/sgzb-modules/sgzb-base/src/main/java/com/bonus/sgzb/base/service/impl/RepairServiceImpl.java @@ -82,6 +82,7 @@ public class RepairServiceImpl implements RepairService { List partList = bean.getPartList(); BigDecimal sfCosts = new BigDecimal("0"); BigDecimal bsfCosts = new BigDecimal("0"); + Integer partNum = 0; String nbType = "1"; // 内部维修 String fcType = "2"; //返厂维修 String sfPart = "1"; //收费 @@ -135,11 +136,12 @@ public class RepairServiceImpl implements RepairService { partDetails.setCompanyId(bean.getCompanyId()); mapper.addPart(partDetails); bean.setPartPrice(partDetails.getPartCost()); - bean.setPartNum(partDetails.getPartNum()); + partNum += partDetails.getPartNum(); bean.setRepairContent(partDetails.getRepairContent()); bean.setPartType(partDetails.getPartType()); } } + bean.setPartNum(partNum); } if (fcType.equals(bean.getRepairType())) { bean.setPartName(partList.get(0).getPartName()); From 71f97c334a6d8ed034b6e9881223789e4fc38a7b Mon Sep 17 00:00:00 2001 From: BianLzhaoMin <11485688+bianliangzhaomin123@user.noreply.gitee.com> Date: Fri, 9 Aug 2024 15:48:27 +0800 Subject: [PATCH 4/9] =?UTF-8?q?iot=E9=A1=B5=E9=9D=A2=E4=BB=A3=E7=A0=81?= =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sgzb-ui/src/views/iotDevice/config.js | 2 +- sgzb-ui/src/views/iotDevice/index.vue | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/sgzb-ui/src/views/iotDevice/config.js b/sgzb-ui/src/views/iotDevice/config.js index 1ecf2392..acd7c285 100644 --- a/sgzb-ui/src/views/iotDevice/config.js +++ b/sgzb-ui/src/views/iotDevice/config.js @@ -7,7 +7,7 @@ export const dialogConfig = { isSelShow: false,// 表格是否需要复选框 isFormShow: true, // 是否显示表单查询组件 formLabel: [ - { f_label: '关键字', f_model: 'keywords', f_type: 'ipt' }, + { f_label: '关键字', f_model: 'keyWord', f_type: 'ipt' }, ], columnsList: [ diff --git a/sgzb-ui/src/views/iotDevice/index.vue b/sgzb-ui/src/views/iotDevice/index.vue index 08308db8..fc2910bb 100644 --- a/sgzb-ui/src/views/iotDevice/index.vue +++ b/sgzb-ui/src/views/iotDevice/index.vue @@ -100,6 +100,7 @@ icon="el-icon-edit" style="color: #67c23a" @click="addDevice(row)" + v-if="row.bindStatus === 1" >修改 Date: Fri, 9 Aug 2024 15:58:10 +0800 Subject: [PATCH 5/9] =?UTF-8?q?=E4=BB=A3=E7=A0=81=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sgzb-ui/src/views/iotDevice/index.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sgzb-ui/src/views/iotDevice/index.vue b/sgzb-ui/src/views/iotDevice/index.vue index fc2910bb..9bf9de84 100644 --- a/sgzb-ui/src/views/iotDevice/index.vue +++ b/sgzb-ui/src/views/iotDevice/index.vue @@ -333,7 +333,7 @@ export default { this.addDeviceParams.iotId = row.iotId this.addDeviceParams.iotCode = row.iotCode this.addDeviceParams.iotStatus = row.iotStatus - this.addDeviceParams.iotType = parseInt(row.iotType) + this.addDeviceParams.iotType = row.iotType } this.dialogConfig.outerWidth = '40%' this.dialogConfig.outerVisible = true From e41bc3419a7a6c77ffc1e20a650e400c072a695b Mon Sep 17 00:00:00 2001 From: BianLzhaoMin <11485688+bianliangzhaomin123@user.noreply.gitee.com> Date: Fri, 9 Aug 2024 16:13:05 +0800 Subject: [PATCH 6/9] =?UTF-8?q?=E4=BB=A3=E7=A0=81=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sgzb-ui/src/views/warehouseManage/machinery/coding/index.vue | 1 + 1 file changed, 1 insertion(+) diff --git a/sgzb-ui/src/views/warehouseManage/machinery/coding/index.vue b/sgzb-ui/src/views/warehouseManage/machinery/coding/index.vue index c1c72bd5..fbc4ca3b 100644 --- a/sgzb-ui/src/views/warehouseManage/machinery/coding/index.vue +++ b/sgzb-ui/src/views/warehouseManage/machinery/coding/index.vue @@ -223,6 +223,7 @@
From 5bd0f38ff2ca4e11b5cfaa52ea1d26cabe3eacbe Mon Sep 17 00:00:00 2001 From: BianLzhaoMin <11485688+bianliangzhaomin123@user.noreply.gitee.com> Date: Fri, 9 Aug 2024 16:20:27 +0800 Subject: [PATCH 7/9] =?UTF-8?q?=E4=BB=A3=E7=A0=81=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/views/warehouseManage/machinery/coding/debug.vue | 7 ++++--- .../src/views/warehouseManage/machinery/coding/index.vue | 6 +++--- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/sgzb-ui/src/views/warehouseManage/machinery/coding/debug.vue b/sgzb-ui/src/views/warehouseManage/machinery/coding/debug.vue index 450377ec..590edc97 100644 --- a/sgzb-ui/src/views/warehouseManage/machinery/coding/debug.vue +++ b/sgzb-ui/src/views/warehouseManage/machinery/coding/debug.vue @@ -209,9 +209,9 @@
diff --git a/sgzb-ui/src/views/warehouseManage/machinery/coding/index.vue b/sgzb-ui/src/views/warehouseManage/machinery/coding/index.vue index fbc4ca3b..5dcfa57b 100644 --- a/sgzb-ui/src/views/warehouseManage/machinery/coding/index.vue +++ b/sgzb-ui/src/views/warehouseManage/machinery/coding/index.vue @@ -209,9 +209,9 @@ Date: Fri, 9 Aug 2024 17:05:07 +0800 Subject: [PATCH 8/9] =?UTF-8?q?=E4=BB=A3=E7=A0=81=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../machinery/coding/component/BindIOT.vue | 9 +- .../machinery/coding/component/MapDIalog.vue | 161 +++++++++++------- 2 files changed, 103 insertions(+), 67 deletions(-) diff --git a/sgzb-ui/src/views/warehouseManage/machinery/coding/component/BindIOT.vue b/sgzb-ui/src/views/warehouseManage/machinery/coding/component/BindIOT.vue index f0f9595c..c099d075 100644 --- a/sgzb-ui/src/views/warehouseManage/machinery/coding/component/BindIOT.vue +++ b/sgzb-ui/src/views/warehouseManage/machinery/coding/component/BindIOT.vue @@ -115,7 +115,7 @@ /> - + e == this.IOTForm.iotType) + if (isType) { + this.$message.error( + '当前机具已绑定改IOT类型设备,不可重复绑定!', + ) + return + } try { // 校验 this.$refs.IOTForm.validate(async (valid) => { diff --git a/sgzb-ui/src/views/warehouseManage/machinery/coding/component/MapDIalog.vue b/sgzb-ui/src/views/warehouseManage/machinery/coding/component/MapDIalog.vue index d977fbaf..0eb8fd67 100644 --- a/sgzb-ui/src/views/warehouseManage/machinery/coding/component/MapDIalog.vue +++ b/sgzb-ui/src/views/warehouseManage/machinery/coding/component/MapDIalog.vue @@ -40,18 +40,21 @@ -
-
{{ index + 1 }}
+ + -
-
- {{ - index + 1 - }} - {{ item.startTime }} - {{ item.hours }}时{{ - item.mints - }}分 + + -
-
- {{ - index + 1 - }} - {{ item.warnTime }} + + @@ -193,6 +210,7 @@ export default { trackAni: null, // 轨迹实例 calLon: '', calLat: '', + // 查询设备行程信息的参数 tripParams: { beginTime: moment() @@ -206,18 +224,20 @@ export default { activeIndex: '', // 停留点信息 parkList: [], + warningList: [], + loadingData: true, } }, - created() { - this.handleQuery() - }, + created() {}, mounted() { - Promise.all([this.getIotDeviceLocation()]) + Promise.all([this.getIotDeviceLocation(), this.handleQuery()]) .then((res) => { + this.loadingData = false this.initMap() }) .catch((err) => { console.log(err) + this.loadingData = false }) // this.getIotDeviceLocation() @@ -231,9 +251,12 @@ export default { this.trackAni.cancel() } // 2. 清除地图上面的标点覆盖物 并清除地图实例 - this.map.clearOverlays() - this.map.destroy() - this.map = null + + if (this.map) { + this.map.clearOverlays() + this.map.destroy() + this.map = null + } }, methods: { @@ -250,6 +273,10 @@ export default { }, /** 查询按钮 */ async handleQuery() { + if (!this.queryForm.date) { + this.$message.error('请选择时间范围!') + return + } this.tripParams.iotId = this.iotCode const res = await getIotDeviceTripApi({ ...this.tripParams }) console.log(res, '行程信息--') @@ -448,8 +475,10 @@ export default { }, /** 时间选择器 */ onChangeTime(val) { - this.tripParams.beginTime = val[0] - this.tripParams.endTime = val[1] + if (val) { + this.tripParams.beginTime = val[0] + this.tripParams.endTime = val[1] + } }, }, } From a911f36d75b1c176d07a0d84b908a783c122db87 Mon Sep 17 00:00:00 2001 From: BianLzhaoMin <11485688+bianliangzhaomin123@user.noreply.gitee.com> Date: Fri, 9 Aug 2024 17:06:58 +0800 Subject: [PATCH 9/9] =?UTF-8?q?=E4=BB=A3=E7=A0=81=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../warehouseManage/machinery/coding/component/BindIOT.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sgzb-ui/src/views/warehouseManage/machinery/coding/component/BindIOT.vue b/sgzb-ui/src/views/warehouseManage/machinery/coding/component/BindIOT.vue index c099d075..44fcf12d 100644 --- a/sgzb-ui/src/views/warehouseManage/machinery/coding/component/BindIOT.vue +++ b/sgzb-ui/src/views/warehouseManage/machinery/coding/component/BindIOT.vue @@ -115,7 +115,7 @@ /> - +