Merge remote-tracking branch 'origin/dev-nx' into dev-nx

This commit is contained in:
76164 2024-08-09 17:11:42 +08:00
commit 04137f7203
7 changed files with 237 additions and 97 deletions

View File

@ -82,6 +82,7 @@ public class RepairServiceImpl implements RepairService {
List<RepairPartDetails> 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());

View File

@ -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: [

View File

@ -15,9 +15,9 @@
<el-button size="mini" type="primary" @click="addDevice(null)"
>添加设备</el-button
>
<el-button size="mini" type="primary" @click="uploadCode()"
<!-- <el-button size="mini" type="primary" @click="uploadCode()"
>下载二维码</el-button
>
> -->
</el-form-item>
</el-form>
@ -92,6 +92,7 @@
icon="el-icon-delete"
style="color: #f56c6c"
@click="handleDeleteAndUnbind(row.iotId, 1)"
v-if="row.bindStatus === 1"
>删除</el-button
>
<el-button
@ -99,6 +100,7 @@
icon="el-icon-edit"
style="color: #67c23a"
@click="addDevice(row)"
v-if="row.bindStatus === 1"
>修改</el-button
>
<el-button
@ -142,9 +144,12 @@
clearable
v-model="addDeviceParams.iotType"
>
<el-option :value="125" label="定位设备" />
<el-option :value="126" label="其他设备" />
<el-option :value="127" label="其他设备" />
<el-option
v-for="item in deviceTypeList"
:key="item.iotTypeId"
:value="item.iotTypeId"
:label="item.iotTypeName"
/>
</el-select>
</el-form-item>
<el-form-item label="设备编号" prop="iotCode">
@ -154,6 +159,20 @@
v-model="addDeviceParams.iotCode"
/>
</el-form-item>
<el-form-item
label="设备状态: "
prop="iotStatus"
v-if="dialogConfig.outerTitle === '修改设备'"
>
<el-switch
v-model="addDeviceParams.iotStatus"
active-text="在线"
inactive-text="离线"
:active-value="0"
:inactive-value="1"
/>
</el-form-item>
</el-form>
<el-row style="margin-top: 20px; text-align: right">
@ -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

View File

@ -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) => {

View File

@ -13,9 +13,7 @@
<span>({{ deviceType }})</span>
</div>
<div class="equipment">
定位设备编号: {{ equipmentNumber }}
</div>
<div class="equipment"> 定位设备编号: {{ iotCode }} </div>
<div class="equipment" v-if="false">{{ engineering }}工程</div>
<el-row :gutter="24">
<el-col :span="16">
@ -42,18 +40,21 @@
<el-col :span="6">
<el-tabs type="border-card" class="map-left">
<el-tab-pane label="行程">
<div
class="trip-container"
@click="handlePreviewTrip(item, index)"
v-for="(item, index) in tripList"
:key="index"
>
<div class="left-num">{{ index + 1 }}</div>
<template v-if="tripList.length > 0">
<div
class="right-info"
:class="{ active: activeIndex === index }"
class="trip-container"
@click="handlePreviewTrip(item, index)"
v-for="(item, index) in tripList"
:key="index"
>
<!-- <ul>
<div class="left-num">{{ index + 1 }}</div>
<div
class="right-info"
:class="{
active: activeIndex === index,
}"
>
<!-- <ul>
<li>{{ item.tripdistance }}KM</li>
<li>{{ item.drivingDuration }}</li>
<li>{{ item.maxspeed }}KM/h</li>
@ -66,63 +67,77 @@
<li>平均速度</li>
</ul> -->
<div style="margin-top: 10px">
<div class="time-container">
<span class="radius-span"></span>
<span>{{ item.startTime }}</span>
<div style="margin-top: 10px">
<div class="time-container">
<span class="radius-span"
></span
>
<span>{{
item.startTime
}}</span>
</div>
<h3>{{ item.startAddress }}</h3>
</div>
<h3>{{ item.startAddress }}</h3>
</div>
<div style="margin-top: 10px">
<div class="time-container">
<span
class="radius-span"
style="
background-color: #e6a23c;
"
></span
>
<span>{{ item.endTime }}</span>
<div style="margin-top: 10px">
<div class="time-container">
<span
class="radius-span"
style="
background-color: #e6a23c;
"
></span
>
<span>{{ item.endTime }}</span>
</div>
<h3>{{ item.endAddress }}</h3>
</div>
<h3>{{ item.endAddress }}</h3>
</div>
</div>
</div>
</template>
<template v-else>
{{ loadingData ? '数据加载中...' : 暂无数据 }}
</template>
</el-tab-pane>
<el-tab-pane label="停留点">
<div
class="point-container"
v-for="(item, index) in parkList"
:key="index"
>
<div class="time-container">
<span class="radius-span">{{
index + 1
}}</span>
<span>{{ item.startTime }}</span>
<span
>{{ item.hours }}{{
item.mints
}}</span
>
<template v-if="parkList.length > 0">
<div
class="point-container"
v-for="(item, index) in parkList"
:key="index"
>
<div class="time-container">
<span class="radius-span">{{
index + 1
}}</span>
<span>{{ item.startTime }}</span>
<span
>{{ item.hours }}{{
item.mints
}}</span
>
</div>
<h3>{{ item.address }}</h3>
</div>
<h3>{{ item.address }}</h3>
</div>
</template>
<template v-else> 暂无数据 </template>
</el-tab-pane>
<el-tab-pane label="报警">
<div
class="point-container"
v-for="(item, index) in warningList"
:key="index"
>
<div class="time-container">
<span class="radius-span">{{
index + 1
}}</span>
<span>{{ item.warnTime }}</span>
<template v-if="warningList.length > 0">
<div
class="point-container"
v-for="(item, index) in warningList"
:key="index"
>
<div class="time-container">
<span class="radius-span">{{
index + 1
}}</span>
<span>{{ item.warnTime }}</span>
</div>
<h3>{{ item.startAlarm }}</h3>
</div>
<h3>{{ item.startAlarm }}</h3>
</div>
</template>
<template v-else> 暂无数据 </template>
</el-tab-pane>
</el-tabs>
</el-col>
@ -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]
}
},
},
}

View File

@ -1,6 +1,6 @@
<template>
<!-- 编码设备管理 -->
<div class="app-container" id="devices">
<div class="app-container" id="devices" v-if="!props.isShow">
<el-form
:model="queryParams"
ref="queryForm"
@ -119,7 +119,7 @@
icon="el-icon-download"
size="mini"
@click="handleExport"
v-hasPermi="['machinery:debug:export']"
v-hasPermi="['machinery:coding:export']"
>导出</el-button
>
</el-form-item>
@ -135,6 +135,7 @@
<el-table
v-loading="loading"
:data="devicesList"
border
@selection-change="handleSelectionChange"
>
<el-table-column type="selection" width="55" align="center" />
@ -151,13 +152,13 @@
label="设备类型"
align="center"
prop="deviceType"
:show-overflow-tooltip="true"
show-overflow-tooltip
/>
<el-table-column
label="规格型号"
align="center"
prop="specificationType"
:show-overflow-tooltip="true"
show-overflow-tooltip
>
</el-table-column>
<el-table-column
@ -206,37 +207,54 @@
>
</template>
</el-table-column>
<el-table-column label="IOT设备" align="center" prop="ownHouseName">
<template slot-scope="{ row }">
<el-button type="text" @click="handleBindIOT(row)">{{
row.iotNum === 0 ? '未绑定' : row.iotNum
}}</el-button>
</template>
</el-table-column>
<el-table-column
label="位置信息"
align="center"
prop="ownHouseName"
>
<template slot-scope="{ row }">
<i
class="el-icon-location location-icon"
@click="handleMap(row)"
v-if="row.iotNum > 0"
/>
</template>
</el-table-column>
<!-- <el-table-column
label="所在仓库"
align="center"
prop="ownHouseName"
/>
/> -->
<!-- <el-table-column label="创建时间" align="center" prop="createTime" width="180">-->
<!-- <template slot-scope="scope">-->
<!-- <span>{{ parseTime(scope.row.createTime) }}</span>-->
<!-- </template>-->
<!-- </el-table-column>-->
<el-table-column
label="操作"
align="center"
width="150"
class-name="small-padding fixed-width"
>
<el-table-column label="操作" align="center" width="150">
<template slot-scope="scope">
<el-button
style="padding: 6px 10px"
size="mini"
type="primary"
icon="el-icon-edit"
@click="handleUpdate(scope.row)"
v-hasPermi="['machinery:debug:edit']"
v-hasPermi="['machinery:coding:edit']"
>编辑</el-button
>
<el-button
style="padding: 6px 10px"
size="mini"
type="danger"
icon="el-icon-delete"
@click="handleDelete(scope.row)"
v-hasPermi="['machinery:debug:del']"
v-hasPermi="['machinery:coding:del']"
>删除</el-button
>
</template>
@ -513,6 +531,16 @@
<!-- <el-button type="primary" @click="downloadCode"> </el-button> -->
</div>
</el-dialog>
<MapDialog
v-if="mapDialogVisible"
:deviceName="deviceName"
:deviceType="deviceType"
:iotCode="iotCode"
@handelCloseDialog="handelCloseDialog"
/>
</div>
<div v-else>
<BindIOT :props="props" />
</div>
</template>
@ -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
},
},
}
</script>
@ -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;
}
</style>

View File

@ -209,9 +209,9 @@
</el-table-column>
<el-table-column label="IOT设备" align="center" prop="ownHouseName">
<template slot-scope="{ row }">
<el-button type="text" @click="handleBindIOT(row)"
>未绑定</el-button
>
<el-button type="text" @click="handleBindIOT(row)">{{
row.iotNum === 0 ? '未绑定' : row.iotNum
}}</el-button>
</template>
</el-table-column>
<el-table-column
@ -223,6 +223,7 @@
<i
class="el-icon-location location-icon"
@click="handleMap(row)"
v-if="row.iotNum > 0"
/>
</template>
</el-table-column>