Commit a293c73d authored by 吴卿华's avatar 吴卿华

修改设备信息添加报错bug

parent b45d0c9b
......@@ -174,7 +174,7 @@ public class TDeviceInfoServiceImpl implements ITDeviceInfoService
equipmentLists.add(equipmentList.get(i));
}
}
tDeviceInfoMapper.deleteEquipmentList(equipmentLists,devid);
tDeviceInfoMapper.deleteEquipmentList(equipmentLists,devid);
}
......
......@@ -209,10 +209,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<delete id="deleteEquipmentList" parameterType="java.util.List">
delete from t_relation_device_info where relation_device_id=#{devids}
<if test="list.size()!=0">
and relation_id not in
and relation_id not in (
<foreach collection="list" item="list" index="index" separator=",">
( #{list.relationId} )
#{list.relationId}
</foreach>
)
</if>
</delete>
......
......@@ -209,7 +209,7 @@
</el-row>
<template v-if="$route.query.deviceType!='管道' && form.deviceType != '管道'">
<template v-if="this.deviceType=='调压阀'||this.deviceType=='阀门井'">
<el-row v-if="form.deviceType != '压力表'">
<el-col :span="12" style="padding: 10px;">
<div id="main1" style="height:300px;background-color: rgb(247 247 247);padding: 5px;">
......
......@@ -269,8 +269,30 @@
</el-form-item>
</el-col>
</el-form>
<el-table height="150"border v-if="form.deviceType==1||form.deviceType==2" v-loading="loading" :data="equipmentList" @selection-change="handleSelectionChange">
<el-table-column label="设备名称" align="center" prop="deviceNames" />
<el-table-column label="设备编号" align="center" prop="deviceCodes" />
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope">
<el-button
size="mini"
type="text"
icon="el-icon-delete"
@click="equipmentDelete(scope.$index)"
v-hasPermi="['device:deviceInfo:remove']"
>删除</el-button>
</template>
</el-table-column>
</el-table>
<!-- <div slot="footer" class="dialog-footer">-->
<!-- <el-button type="primary" @click="equipment = true">新增</el-button>-->
<!-- <el-button type="primary" @click="dialogFormVisible=false">确 定</el-button>-->
<!-- </div>-->
<div slot="footer" class="dialog-footer">
<el-button v-if="form.deviceType==1||form.deviceType==2" type="primary" @click="addDevice">添加设备</el-button>
<el-button v-if="form.deviceType==1||form.deviceType==2" type="primary" @click="equipment = true">设备添加</el-button>
<el-button type="primary" @click="submitForm">确 定</el-button>
<el-button @click="cancel">取 消</el-button>
</div>
......@@ -301,7 +323,6 @@
<el-button type="primary" @click="equipment = true">新增</el-button>
<el-button type="primary" @click="dialogFormVisible=false">确 定</el-button>
</div>
</el-dialog>
......@@ -379,6 +400,8 @@
showSearch: true,
// 总条数
total: 0,
//设备总条数
equipmentTotal:0,
// 设备信息表格数据
deviceInfoList: [],
//下级绑定设备数据
......@@ -566,6 +589,7 @@
},
/** 新增按钮操作 */
handleAdd() {
this.equipmentList=[];
this.reset();
pipeAllInfoList().then(response => {
this.options = response.data;
......@@ -580,6 +604,13 @@
this.options = response.data;
});
const deviceId = row.deviceId || this.ids
/**下级设备信息查询*/
if (deviceId != null) {
getDevice(deviceId).then(response => {
this.equipmentList=response.data
});
}
getDeviceInfo(deviceId).then(response => {
this.form = response.data;
if (this.form.iconUrl) {
......@@ -590,6 +621,11 @@
this.open = true;
this.title = "修改设备信息";
});
},
/*提交*/
submitEquipment(){
......
......@@ -90,12 +90,19 @@
</el-form-item>-->
</el-form>
</el-col>
<el-col :span="11">
<div id="marbox"
style="width: 100%;height: 390px;margin-top: -25px; border: 1px solid rgb(218, 213, 213);margin-bottom: 10px;">
<div style="width: 100%;height: 100%" id="container"></div>
</div>
</el-col>
<el-table height="250"border :data="equipmentList">
<el-table-column label="设备名称" align="center" prop="deviceNames" />
<el-table-column label="设备编号" align="center" prop="deviceCodes" />
</el-table>
</el-row>
<div class="" style="width: 95%; height: 60px;margin-left: 50px;text-align: center;margin-top: 5px;">
......@@ -205,6 +212,7 @@
</el-form-item>
</el-col>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm">确 定</el-button>
<el-button @click="cancel">取 消</el-button>
......@@ -219,8 +227,7 @@
</template>
<script>
import { updateDeviceInfo, getDeviceInfo } from "@/api/device/deviceInfo";
import { updateDeviceInfo, getDeviceInfo,getDevice } from "@/api/device/deviceInfo";
import { pipeAllInfoList } from "@/api/device/pipe";
import MyFileUpload from '@/components/MyFileUpload';
import Mapdialog from "@/components/mapDialog/checkDeviceLoaction.vue";
......@@ -248,6 +255,8 @@
dialogTableVisible: false,
// 设备类型字典
typeOptions: [],
//下级绑定设备数据
equipmentList:[],
// 表单参数
form: {},
editForm: {},
......@@ -308,6 +317,9 @@
},
methods: {
getDetail() {
getDevice(this.deviceId).then(response => {
this.equipmentList=response.data
});
getDeviceInfo(this.deviceId).then(response => {
this.form = response.data;
console.log(this.form, "this.form")
......@@ -330,6 +342,7 @@
// this.gaoMap.addMarker(DEVICE_TYPE.WORKORDER, this.form)
});
},
getFileInfo(res) {
this.editForm.iconUrl = res.url;
},
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment