|
@@ -228,10 +228,10 @@
|
|
|
</div>
|
|
|
<div class="dept-table-max-box">
|
|
|
<div class="device-tip">请选择以下实验室内设备开始检查</div>
|
|
|
- <el-table border :data="deviceTableList" @selection-change="deviceChange" height="350">
|
|
|
+ <el-table border :data="deviceTableList" @selection-change="deviceChange" :row-key="getRowKeys" height="350">
|
|
|
<el-table-column type="selection" width="50" :reserve-selection="true" align="center"/>
|
|
|
<el-table-column label="名称" align="center" prop="chName" show-overflow-tooltip/>
|
|
|
- <el-table-column label="数量" align="center" prop="num" show-overflow-tooltip/>
|
|
|
+ <el-table-column label="数量" align="center" prop="hazardNum" show-overflow-tooltip/>
|
|
|
<el-table-column label="型号" align="center" prop="code" show-overflow-tooltip />
|
|
|
<el-table-column label="类型" align="center" prop="hazardTypeMode" show-overflow-tooltip/>
|
|
|
</el-table>
|
|
@@ -338,10 +338,10 @@
|
|
|
<!--设备弹窗-->
|
|
|
<el-dialog title="检查项" v-if="dialogVisible" :visible.sync="dialogVisible" width="730px" :append-to-body="false" :modal-append-to-body="false" :close-on-click-modal="false">
|
|
|
<div style="margin-bottom:20px ">请选择以下实验室内设备开始检查</div>
|
|
|
- <el-table ref="deviceTable" border :data="deviceTableList" @selection-change="deviceChange" :row-key="getRowKeys" height="350">
|
|
|
+ <el-table ref="deviceTable" border :data="deviceTableList" @selection-change="deviceChange2" :row-key="getRowKeys" height="350">
|
|
|
<el-table-column type="selection" width="50" :reserve-selection="true" align="center"/>
|
|
|
<el-table-column label="名称" align="center" prop="chName" show-overflow-tooltip/>
|
|
|
- <el-table-column label="数量" align="center" prop="num" show-overflow-tooltip/>
|
|
|
+ <el-table-column label="数量" align="center" prop="hazardNum" show-overflow-tooltip/>
|
|
|
<el-table-column label="型号" align="center" prop="code" show-overflow-tooltip />
|
|
|
<el-table-column label="类型" align="center" prop="hazardTypeMode" show-overflow-tooltip/>
|
|
|
</el-table>
|
|
@@ -475,10 +475,10 @@
|
|
|
applyGentle:false,
|
|
|
myApplyGentle:false,
|
|
|
/* ==专项检查== */
|
|
|
- dialogVisible:true,
|
|
|
+ dialogVisible:false,
|
|
|
pageType:1,
|
|
|
multipleSelection:[],
|
|
|
- multipleSelectionArr:[],
|
|
|
+
|
|
|
}
|
|
|
},
|
|
|
created(){
|
|
@@ -496,36 +496,43 @@
|
|
|
},
|
|
|
//选中设备
|
|
|
deviceChange(val){
|
|
|
- this.multipleSelection = val;
|
|
|
- this.multipleSelectionArr=JSON.parse(JSON.stringify(val))
|
|
|
+ console.log('1',val)
|
|
|
+ let deviceList=val
|
|
|
+ let list=[];
|
|
|
+ if(deviceList[0]){
|
|
|
+ for(let i=0;i<deviceList.length;i++){
|
|
|
+ list.push(deviceList[i].id)
|
|
|
+ }
|
|
|
+ this.multipleSelection=list
|
|
|
+ }
|
|
|
+ },
|
|
|
+ //弹窗选中设备
|
|
|
+ deviceChange2(val){
|
|
|
+ console.log('2',val)
|
|
|
+ let deviceList=val
|
|
|
+ let list=[];
|
|
|
+ if(deviceList[0]){
|
|
|
+ for(let i=0;i<deviceList.length;i++){
|
|
|
+ list.push(deviceList[i].id)
|
|
|
+ }
|
|
|
+ this.multipleSelection=list
|
|
|
+ }
|
|
|
+ console.log(this.multipleSelection)
|
|
|
},
|
|
|
handleClick(doType){
|
|
|
let self=this;
|
|
|
if(doType=='startBtn'){//开始检查
|
|
|
let hazardIds='';
|
|
|
- let list=[];
|
|
|
if(this.multipleSelection[0]){
|
|
|
- for(let i=0;i<this.multipleSelection.length;i++){
|
|
|
- list.push(this.multipleSelection[i].id)
|
|
|
- }
|
|
|
this.pageType=2;
|
|
|
this.checkOptionList();
|
|
|
this.dialogVisible=false;
|
|
|
- hazardIds=list.join(',')
|
|
|
+ hazardIds=this.multipleSelection.join(',')
|
|
|
this.getHazardInfo(this.addForm.subId,hazardIds)
|
|
|
}else{
|
|
|
this.msgError('请先选择实验室内设备!')
|
|
|
}
|
|
|
- // if(this.addForm.checkHazardInfoVoList.length<10){
|
|
|
- // let obj = {
|
|
|
- // name:'烘箱-001',
|
|
|
- // type:'专项检查',
|
|
|
- // checkHazardDtoList:[]
|
|
|
- // };
|
|
|
- // this.addForm.checkHazardInfoVoList.push(obj);
|
|
|
- // }
|
|
|
}else if(doType=='addDevice'){//新增检查项
|
|
|
- console.log(this.multipleSelectionArr)
|
|
|
}
|
|
|
},
|
|
|
// 取消按钮
|
|
@@ -689,28 +696,24 @@
|
|
|
addObjectDevice(item){
|
|
|
let self=this;
|
|
|
this.dialogVisible=true;
|
|
|
- //this.$refs.deviceTable.clearSelection()
|
|
|
- console.log(self.multipleSelectionArr)
|
|
|
- let row={
|
|
|
- chName:'一氧化碳',
|
|
|
- code:'001',
|
|
|
- hazardNum:1,
|
|
|
- hazardTypeMode:1,
|
|
|
- hazardTypeModeName:'危险品',
|
|
|
- id:37
|
|
|
- }
|
|
|
- setTimeout(function() {
|
|
|
- self.$refs.deviceTable.toggleRowSelection(row,true);
|
|
|
- },1000)
|
|
|
- // self.$nextTick(()=>{
|
|
|
- // self.multipleSelectionArr.forEach(row => {
|
|
|
- // console.log(row)
|
|
|
- // //self.$refs.deviceTable.toggleRowSelection(row,true);
|
|
|
- // });
|
|
|
- // })
|
|
|
+ console.log(self.multipleSelection)
|
|
|
+ setTimeout(function(){
|
|
|
+ self.$refs.deviceTable.clearSelection();
|
|
|
+ if(self.multipleSelection[0]){
|
|
|
+ self.deviceTableList.forEach(row => {
|
|
|
+ self.multipleSelection.forEach(function(item) {
|
|
|
+ if(row.id==item){
|
|
|
+ self.$refs.deviceTable.toggleRowSelection(row,true);
|
|
|
+ }
|
|
|
+ })
|
|
|
+ });
|
|
|
+ }else{
|
|
|
+ if(self.$refs.deviceTable){
|
|
|
+ self.$refs.deviceTable.clearSelection();
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },100);
|
|
|
|
|
|
- // this.$refs.deviceTable=this.multipleSelectionArr;
|
|
|
- //this.dialogVisible=true;
|
|
|
},
|
|
|
//查看图片
|
|
|
lookImg(list,index){
|