|
|
|
|
@ -165,6 +165,7 @@ export default { |
|
|
|
|
watch: { |
|
|
|
|
detailForm(newVal, oldVal) { |
|
|
|
|
if (JSON.stringify(newVal) != '{}') { |
|
|
|
|
console.log('JSON.stringify(newVal)---------------------->',JSON.stringify(newVal)) |
|
|
|
|
this.deviceList = [] |
|
|
|
|
this.detailForm = newVal |
|
|
|
|
this.addForm = { |
|
|
|
|
@ -188,7 +189,7 @@ export default { |
|
|
|
|
this.drawfiles = [] |
|
|
|
|
this.filesList = this.detailForm.attaches |
|
|
|
|
this.imgList = this.detailForm.attaches |
|
|
|
|
this.detailForm.draws.map(item => { |
|
|
|
|
this.detailForm.draws && this.detailForm.draws.length != 0 && this.detailForm.draws.map(item => { |
|
|
|
|
this.drawList.push({ |
|
|
|
|
name: item.name, |
|
|
|
|
url: item.link |
|
|
|
|
@ -241,9 +242,9 @@ export default { |
|
|
|
|
this.floorArr = [] |
|
|
|
|
this.roomArr = [] |
|
|
|
|
this.tableData = this.getDeepCode(this.detailForm.details, []) |
|
|
|
|
this.changeUnit(this.detailForm.deptId) |
|
|
|
|
this.detailForm.deptId && this.changeUnit(this.detailForm.deptId) |
|
|
|
|
|
|
|
|
|
this.detailForm.attaches.map(item => { |
|
|
|
|
this.detailForm.attaches && this.detailForm.attaches.length != 0 && this.detailForm.attaches.map(item => { |
|
|
|
|
this.imgList.push({ |
|
|
|
|
name: item.name, |
|
|
|
|
url: item.link |
|
|
|
|
@ -253,7 +254,7 @@ export default { |
|
|
|
|
url: item.link |
|
|
|
|
}) |
|
|
|
|
}) |
|
|
|
|
this.detailForm.draws.map(item => { |
|
|
|
|
this.detailForm.draws && this.detailForm.draws.length != 0 && this.detailForm.draws.map(item => { |
|
|
|
|
this.drawList.push({ |
|
|
|
|
name: item.name, |
|
|
|
|
url: item.link |
|
|
|
|
@ -273,9 +274,7 @@ export default { |
|
|
|
|
}, |
|
|
|
|
methods: { |
|
|
|
|
getDeepCode(data, arr) { |
|
|
|
|
console.log('data', data) |
|
|
|
|
if (data && data.length > 0) { |
|
|
|
|
data.map(item => { |
|
|
|
|
data && data.length != 0 && data.map(item => { |
|
|
|
|
if (item.details.length != 0) { |
|
|
|
|
this.getDeepCode(item.details, arr) |
|
|
|
|
} else { |
|
|
|
|
@ -283,8 +282,6 @@ export default { |
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
|
return arr |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
}, |
|
|
|
|
handleSuccess(response, file, fileList) { |
|
|
|
|
if (response.code == 200) { |
|
|
|
|
@ -456,17 +453,14 @@ export default { |
|
|
|
|
}, |
|
|
|
|
// 切换实验室 |
|
|
|
|
changeUnit(val) { |
|
|
|
|
console.log('val===========>', val) |
|
|
|
|
console.log('unitData===============>', this.unitData) |
|
|
|
|
this.labId = val |
|
|
|
|
if (this.title == '新建') { |
|
|
|
|
this.addForm.unitName = this.unitData.length > 0 ? this.unitData.find(item => item.id == val).title : '' |
|
|
|
|
this.addForm.unitName = this.unitData.find(item => item.id == val) ? this.unitData.find(item => item.id == val).title : '' |
|
|
|
|
this.deviceList.map(item => { |
|
|
|
|
item.disabled = false |
|
|
|
|
}) |
|
|
|
|
} |
|
|
|
|
getDeepData({ parentId: val }).then(res => { |
|
|
|
|
console.log('res ------------------->', res) |
|
|
|
|
this.floorArr = res.data.data |
|
|
|
|
this.activeFloor = res.data.data.length > 0 ? res.data.data[0].id : '' |
|
|
|
|
getDeepData({ parentId: this.activeFloor }).then(res => { |
|
|
|
|
@ -476,13 +470,11 @@ export default { |
|
|
|
|
if (JSON.stringify(this.detailForm) != '{}') { |
|
|
|
|
console.log(this.activeFloor, this.activeRoom) |
|
|
|
|
this.addForm.tableData = this.tableData.filter(item => item.floorId == this.activeFloor && item.deptId == this.activeRoom) |
|
|
|
|
console.log('addForm==========>', this.addForm.tableData) |
|
|
|
|
let arr1 = this.deviceList.filter(item1 => |
|
|
|
|
this.addForm.tableData.some(item2 => |
|
|
|
|
item1.id == item2.deviceId |
|
|
|
|
) |
|
|
|
|
); |
|
|
|
|
console.log('arr1==============>', arr1) |
|
|
|
|
this.deviceList.map(item1 => { |
|
|
|
|
item1.disabled = false |
|
|
|
|
arr1.map(item2 => { |
|
|
|
|
@ -570,11 +562,9 @@ export default { |
|
|
|
|
this.dealFloor(val.id) |
|
|
|
|
}, |
|
|
|
|
clickRoom(val) { |
|
|
|
|
this.activeRoom = val.id |
|
|
|
|
console.log('val1------------->', val) |
|
|
|
|
console.log('title------------->', this.title) |
|
|
|
|
if (val) { |
|
|
|
|
this.activeRoom = val.id |
|
|
|
|
|
|
|
|
|
if (this.title == '新建') { |
|
|
|
|
getDeviceLists({ limsId: this.labId, floorId: this.activeFloor, roomId: this.activeRoom }).then(res => { |
|
|
|
|
this.deviceList = res.data.data |
|
|
|
|
@ -630,8 +620,6 @@ export default { |
|
|
|
|
this.getSpanArr(this.addForm.tableData) |
|
|
|
|
}) |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
}, |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|