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()); 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 e5ebc14a..9bf9de84 100644 --- a/sgzb-ui/src/views/iotDevice/index.vue +++ b/sgzb-ui/src/views/iotDevice/index.vue @@ -15,9 +15,9 @@ 添加设备 - 下载二维码 + > --> @@ -92,6 +92,7 @@ icon="el-icon-delete" style="color: #f56c6c" @click="handleDeleteAndUnbind(row.iotId, 1)" + v-if="row.bindStatus === 1" >删除 修改 - - - + @@ -154,6 +159,20 @@ v-model="addDeviceParams.iotCode" /> + + + + @@ -215,6 +234,7 @@ import { unbindDeviceApi, getDeviceBindRecordApi, getDeviceBindDetailsApi, + selectList, } from '@/api/iotDevice' export default { components: { @@ -237,6 +257,7 @@ export default { addDeviceParams: { iotType: '', iotCode: '', + iotStatus: 0, }, // 新增设备表单校验 addDeviceRules: { @@ -261,6 +282,8 @@ export default { sendParams: { iotId: '', }, + // 设备类型数据源 + deviceTypeList: [], // 复选框选中的数据 selectList: [], // 绑定记录Api @@ -273,6 +296,7 @@ export default { created() { this.getDeviceList() + this.getDeviceTypeList() }, methods: { @@ -282,6 +306,18 @@ export default { this.deviceList = res.rows this.total = res.total }, + + //** 获取设备类型 */ + async getDeviceTypeList() { + try { + const res = await selectList() + // this.typeOptions = res.data + console.log(res, '设备类型获取成功') + this.deviceTypeList = res.data + } catch (err) { + console.log('🚀 ~ getIotType ~ err:', err) + } + }, /** 搜索按钮 */ handelQuery() { this.getDeviceList(this.queryParams) @@ -296,7 +332,8 @@ export default { this.dialogConfig.outerTitle = '修改设备' this.addDeviceParams.iotId = row.iotId this.addDeviceParams.iotCode = row.iotCode - this.addDeviceParams.iotType = parseInt(row.iotType) + this.addDeviceParams.iotStatus = row.iotStatus + this.addDeviceParams.iotType = row.iotType } this.dialogConfig.outerWidth = '40%' this.dialogConfig.outerVisible = true 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..44fcf12d 100644 --- a/sgzb-ui/src/views/warehouseManage/machinery/coding/component/BindIOT.vue +++ b/sgzb-ui/src/views/warehouseManage/machinery/coding/component/BindIOT.vue @@ -276,6 +276,13 @@ export default { }, // 提交 submit() { + const isType = this.typeList.some((e) => 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 e3881a01..0eb8fd67 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 }}工程
@@ -42,18 +40,21 @@ -
-
{{ index + 1 }}
+ + -
-
- {{ - index + 1 - }} - {{ item.startTime }} - {{ item.hours }}时{{ - item.mints - }}分 + + -
-
- {{ - index + 1 - }} - {{ item.warnTime }} + + @@ -209,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() @@ -234,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: { @@ -253,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, '行程信息--') @@ -451,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] + } }, }, } diff --git a/sgzb-ui/src/views/warehouseManage/machinery/coding/debug.vue b/sgzb-ui/src/views/warehouseManage/machinery/coding/debug.vue index 8fc6ec58..590edc97 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 +531,16 @@
+ +
+
+
@@ -534,12 +562,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 +642,10 @@ export default { }, ], }, + mapDialogVisible: false, + deviceName: '', + deviceType: '', + iotCode: '', } }, created() { @@ -788,6 +830,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 +866,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; } diff --git a/sgzb-ui/src/views/warehouseManage/machinery/coding/index.vue b/sgzb-ui/src/views/warehouseManage/machinery/coding/index.vue index c1c72bd5..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 @@