|
@@ -37,8 +37,8 @@
|
|
|
style="font-size:14px;margin-left:20px;width:100px;" v-if="planList[0]">选择计划</p>
|
|
|
</div>
|
|
|
<el-form-item label="检查类型" prop="checkCategory">
|
|
|
- <el-select v-model="addForm.checkCategory" placeholder="请选择检查类型"
|
|
|
- style="width: 500px">
|
|
|
+ <el-select :disabled="planType==2" v-model="addForm.checkCategory" placeholder="请选择检查类型"
|
|
|
+ style="width: 500px;height: 40px;">
|
|
|
<el-option
|
|
|
v-for="item in inspectCategoryList"
|
|
|
:key="item.id"
|
|
@@ -139,7 +139,7 @@
|
|
|
<p class="for-title-p">第{{index+1}}隐患项</p>
|
|
|
<div class="for-del-box">
|
|
|
<p class="el-icon-delete"></p>
|
|
|
- <p @click="delCheckHazardDtoList(index)">删除此项</p>
|
|
|
+ <p @click="delCheckHazardDtoList(index,'')">删除此项</p>
|
|
|
</div>
|
|
|
<div class="for-button-box" @click="dataLookButton(item)">
|
|
|
<p :class="item.lookType?'el-icon-arrow-up':'el-icon-arrow-down'"></p>
|
|
@@ -224,14 +224,14 @@
|
|
|
<div class="bottom-form-box" v-if="addForm.checkCategory==2 && pageType==1">
|
|
|
<div class="bottom-form-title-box">
|
|
|
<p>检查项</p>
|
|
|
- <p>隐患数:{{addForm.checkHazardDtoList.length}}</p>
|
|
|
+ <p>检查项:{{addForm.checkHazardInfoVoList.length}}</p>
|
|
|
</div>
|
|
|
<div class="dept-table-max-box">
|
|
|
<div class="device-tip">请选择以下实验室内设备开始检查</div>
|
|
|
- <el-table ref="deviceTable" border :data="deviceTableList" @selection-change="deviceChange" :row-key="getRowKeys" 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>
|
|
@@ -246,10 +246,10 @@
|
|
|
</div>
|
|
|
<div class="for-max-big-box for-max-big-box-special" v-for="(item,index) in addForm.checkHazardInfoVoList" :key="index">
|
|
|
<div class="for-title-box">
|
|
|
- <p class="for-title-p">{{index+1}}、【{{item.name}}】{{item.type}}</p>
|
|
|
+ <p class="for-title-p">{{index+1}}、【{{item.hazardName}}】专项检查</p>
|
|
|
<div class="for-del-box">
|
|
|
<p class="el-icon-delete"></p>
|
|
|
- <p @click="delCheckHazardDtoList(index)">删除此项</p>
|
|
|
+ <p @click="delCheckHazardDtoList(index,'')">删除此项</p>
|
|
|
</div>
|
|
|
<div class="for-button-box" @click="dataLookButton(item)">
|
|
|
<p :class="item.lookType?'el-icon-arrow-up':'el-icon-arrow-down'"></p>
|
|
@@ -258,7 +258,7 @@
|
|
|
</div>
|
|
|
<div class="for-big-box-special" v-for="(item2,index2) in item.checkHazardDtoList">
|
|
|
<div class="for-big-box-special-l">{{index+1}}.{{index2+1}}</div>
|
|
|
- <div class="for-big-box-special-r">
|
|
|
+ <div class="for-big-box for-big-box-special-r">
|
|
|
<el-form-item label="检查项目" :prop="'checkHazardInfoVoList.'+index+'.checkHazardDtoList.'+index2+'.hazardCheckPro'" :rules="rules.hazardCheckPro" label-width="123px">
|
|
|
<el-radio-group v-model="item2.checkFlag" style="margin-right: 20px;">
|
|
|
<el-radio :label="1">符合</el-radio>
|
|
@@ -279,6 +279,7 @@
|
|
|
<p v-else style="max-width:300px;overflow: hidden;text-overflow:ellipsis;white-space:nowrap;">{{data.labelName}}</p>
|
|
|
</template>
|
|
|
</el-cascader>
|
|
|
+ <i class="el-icon-delete" @click="delCheckHazardDtoList(index,index2)" style="color: #0183FA;margin-left: 20px;cursor: pointer;"></i>
|
|
|
<p class="hazard-check-count-p" v-if="hazardCheckCount>0">此检查项在当前实验室累计出现 <span>{{hazardCheckCount}}</span> 次隐患</p>
|
|
|
</el-form-item>
|
|
|
<el-form-item v-if="item2.checkFlag==0" label="隐患等级" :prop="'checkHazardInfoVoList.'+index+'.checkHazardDtoList.'+index2+'.hazardLevel'" :rules="rules.hazardLevel" label-width="123px">
|
|
@@ -322,9 +323,9 @@
|
|
|
</el-form-item>
|
|
|
</div>
|
|
|
</div>
|
|
|
- <p class="add-bottom-button" @click="addObjectTow(item)">+新增隐患检查项</p>
|
|
|
+ <p class="add-bottom-button" v-if="planType == 1" @click="addObjectTow(item)">+新增隐患检查项</p>
|
|
|
</div>
|
|
|
- <p class="add-bottom-button" @click="addObjectDevice()">+新增检查项</p>
|
|
|
+ <p class="add-bottom-button" v-if="planType == 1" @click="addObjectDevice()">+新增检查项</p>
|
|
|
</div>
|
|
|
</el-form>
|
|
|
</div>
|
|
@@ -336,12 +337,12 @@
|
|
|
</div>
|
|
|
<lookImgDialog ref="lookImgDialog"></lookImgDialog>
|
|
|
<!--设备弹窗-->
|
|
|
- <el-dialog title="检查项" :visible.sync="dialogVisible" width="730px" append-to-body :close-on-click-modal="false">
|
|
|
+ <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="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>
|
|
@@ -358,8 +359,10 @@
|
|
|
import lookImgDialog from '@/components/lookImgDialog/lookImgDialog.vue'
|
|
|
import { listDepartments } from "@/api/system/dept";
|
|
|
import { buildFloorGetlist } from "@/api/laboratory/building";
|
|
|
- import { buildBySubList,getCheckPlanBySubId,findCheckManage,checkOptionList,
|
|
|
- checkManageUpdate,checkManageAdd,countHazardNum,getGentle } from "@/api/safetyCheck/index";
|
|
|
+ import {
|
|
|
+ buildBySubList, getCheckPlanBySubId, findCheckManage, checkOptionList,
|
|
|
+ checkManageUpdate, checkManageAdd, countHazardNum, getGentle, getHazardListBySub, getHazardInfo
|
|
|
+ } from '@/api/safetyCheck/index'
|
|
|
export default {
|
|
|
name: 'index',
|
|
|
components: {
|
|
@@ -404,35 +407,7 @@
|
|
|
//综合检查
|
|
|
checkHazardDtoList:[],
|
|
|
//专项检查
|
|
|
- checkHazardInfoVoList:[
|
|
|
- {
|
|
|
- name:'烘箱-001',
|
|
|
- type:'专项检查',
|
|
|
- checkHazardDtoList:[
|
|
|
- {
|
|
|
- checkFlag:0,
|
|
|
- hazardCheckCode:'',
|
|
|
- hazardCheckName:'',
|
|
|
- hazardCheckPoint:'',
|
|
|
- hazardCheckPro:'',
|
|
|
- hazardDescribe:'',
|
|
|
- hazardLevel:'',
|
|
|
- lookType:true,
|
|
|
- uploadDtoList:[],
|
|
|
- },{
|
|
|
- checkFlag:0,
|
|
|
- hazardCheckCode:'',
|
|
|
- hazardCheckName:'',
|
|
|
- hazardCheckPoint:'',
|
|
|
- hazardCheckPro:'',
|
|
|
- hazardDescribe:'',
|
|
|
- hazardLevel:'',
|
|
|
- lookType:true,
|
|
|
- uploadDtoList:[],
|
|
|
- }
|
|
|
- ]
|
|
|
- }
|
|
|
- ],
|
|
|
+ checkHazardInfoVoList:[],
|
|
|
},
|
|
|
|
|
|
|
|
@@ -440,12 +415,7 @@
|
|
|
hazardCheckCount:0,
|
|
|
//上传用名称保存
|
|
|
upDataName:"",
|
|
|
- deviceTableList:[{
|
|
|
- 'chName':'测试',
|
|
|
- 'num':'2',
|
|
|
- 'code':'001',
|
|
|
- 'hazardTypeMode':'冷热设备',
|
|
|
- }],
|
|
|
+ deviceTableList:[],
|
|
|
//检查类型
|
|
|
inspectCategoryList:[{id:'1',name:'综合检查'},{id:'2',name:'专项检查'}],
|
|
|
// 表单校验
|
|
@@ -507,7 +477,9 @@
|
|
|
myApplyGentle:false,
|
|
|
/* ==专项检查== */
|
|
|
dialogVisible:false,
|
|
|
- pageType:1,
|
|
|
+ pageType:0,
|
|
|
+ multipleSelection:[],
|
|
|
+
|
|
|
}
|
|
|
},
|
|
|
created(){
|
|
@@ -523,23 +495,30 @@
|
|
|
getRowKeys(row) {
|
|
|
return row.id
|
|
|
},
|
|
|
- deviceChange(selection){
|
|
|
- console.log(selection)
|
|
|
-
|
|
|
+ //选中设备
|
|
|
+ deviceChange(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
|
|
|
+ }
|
|
|
},
|
|
|
handleClick(doType){
|
|
|
let self=this;
|
|
|
if(doType=='startBtn'){//开始检查
|
|
|
- this.pageType=2;
|
|
|
- this.checkOptionList();
|
|
|
- this.dialogVisible=false;
|
|
|
- if(this.addForm.checkHazardInfoVoList.length<10){
|
|
|
- let obj = {
|
|
|
- name:'烘箱-001',
|
|
|
- type:'专项检查',
|
|
|
- checkHazardDtoList:[]
|
|
|
- };
|
|
|
- this.addForm.checkHazardInfoVoList.push(obj);
|
|
|
+ let hazardIds='';
|
|
|
+ if(this.multipleSelection[0]){
|
|
|
+ this.pageType=2;
|
|
|
+ this.checkOptionList();
|
|
|
+ this.dialogVisible=false;
|
|
|
+ hazardIds=this.multipleSelection.join(',')
|
|
|
+ this.getHazardInfo(this.addForm.subId,hazardIds)
|
|
|
+ }else{
|
|
|
+ this.msgError('请先选择实验室内设备!')
|
|
|
}
|
|
|
}
|
|
|
},
|
|
@@ -568,24 +547,62 @@
|
|
|
if(this.planType == 1){
|
|
|
//新计划
|
|
|
let obj = JSON.parse(JSON.stringify(this.addForm));
|
|
|
- if(obj.checkResult === 0){
|
|
|
- if(!obj.checkHazardDtoList[0]){
|
|
|
- this.msgError('请添加隐患检查项')
|
|
|
- return
|
|
|
- }
|
|
|
- for(let i=0;i<obj.checkHazardDtoList.length;i++){
|
|
|
- delete obj.checkHazardDtoList[i].lookType
|
|
|
- }
|
|
|
- obj.dangerNum = obj.checkHazardDtoList.length
|
|
|
- }else{
|
|
|
- obj.checkHazardDtoList = [];
|
|
|
- }
|
|
|
obj.manageStatus = type
|
|
|
obj.cycleStartTime = obj.dateRange[0]
|
|
|
obj.cycleEndTime = obj.dateRange[1]
|
|
|
obj.subIds = obj.subId;
|
|
|
delete obj.subId;
|
|
|
delete obj.dateRange
|
|
|
+ if(this.addForm.checkCategory==1){//综合检查
|
|
|
+ if(obj.checkResult === 0){
|
|
|
+ if(!obj.checkHazardDtoList[0]){
|
|
|
+ this.msgError('请添加隐患检查项')
|
|
|
+ return
|
|
|
+ }
|
|
|
+ for(let i=0;i<obj.checkHazardDtoList.length;i++){
|
|
|
+ obj.checkHazardDtoList[i].checkCategory=this.addForm.checkCategory;
|
|
|
+ delete obj.checkHazardDtoList[i].lookType
|
|
|
+ }
|
|
|
+ obj.dangerNum = obj.checkHazardDtoList.length
|
|
|
+ }else{
|
|
|
+ obj.checkHazardDtoList = [];
|
|
|
+ }
|
|
|
+
|
|
|
+ }else if(this.addForm.checkCategory==2){//专项检查
|
|
|
+ let list=[]
|
|
|
+ let checkFlagList=[];
|
|
|
+ for(let i=0;i<this.addForm.checkHazardInfoVoList.length;i++){
|
|
|
+ for(let b=0;b<this.addForm.checkHazardInfoVoList[i].checkHazardDtoList.length;b++){
|
|
|
+ checkFlagList.push(this.addForm.checkHazardInfoVoList[i].checkHazardDtoList[b].checkFlag)
|
|
|
+ let obj={
|
|
|
+ checkFlag:this.addForm.checkHazardInfoVoList[i].checkHazardDtoList[b].checkFlag,
|
|
|
+ checkCategory:this.addForm.checkHazardInfoVoList[i].checkHazardDtoList[b].checkCategory,
|
|
|
+ hazardCheckCode:this.addForm.checkHazardInfoVoList[i].checkHazardDtoList[b].hazardCheckCode,
|
|
|
+ hazardCheckName:this.addForm.checkHazardInfoVoList[i].checkHazardDtoList[b].hazardCheckName,
|
|
|
+ hazardCheckPro:this.addForm.checkHazardInfoVoList[i].checkHazardDtoList[b].hazardCheckPro,
|
|
|
+ hazardDescribe:this.addForm.checkHazardInfoVoList[i].checkHazardDtoList[b].hazardDescribe,
|
|
|
+ hazardLevel:this.addForm.checkHazardInfoVoList[i].checkHazardDtoList[b].hazardLevel,
|
|
|
+ uploadDtoList:this.addForm.checkHazardInfoVoList[i].checkHazardDtoList[b].uploadDtoList,
|
|
|
+ code:this.addForm.checkHazardInfoVoList[i].code,
|
|
|
+ hazardId:this.addForm.checkHazardInfoVoList[i].hazardId,
|
|
|
+ hazardName:this.addForm.checkHazardInfoVoList[i].hazardName,
|
|
|
+ hazardTypeMode:this.addForm.checkHazardInfoVoList[i].hazardTypeMode,
|
|
|
+ hazardTypeModeName:this.addForm.checkHazardInfoVoList[i].hazardTypeModeName,
|
|
|
+ joinHazardId:this.addForm.checkHazardInfoVoList[i].joinHazardId,
|
|
|
+ }
|
|
|
+ list.push(obj)
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if(this.multipleSelection[0]){
|
|
|
+ obj.hazardIds=this.multipleSelection.join(',')
|
|
|
+ }
|
|
|
+ if(checkFlagList.every(item=>{return item==1})){//符合
|
|
|
+ obj.checkResult=1;
|
|
|
+ }else{//不符合
|
|
|
+ obj.checkResult=0;
|
|
|
+ }
|
|
|
+ obj.checkHazardDtoList=list;
|
|
|
+ }
|
|
|
checkManageAdd(obj).then(response => {
|
|
|
this.msgSuccess(response.msg);
|
|
|
this.initializationAddData();
|
|
@@ -593,22 +610,55 @@
|
|
|
}if(this.planType == 2){
|
|
|
//已有计划修改
|
|
|
let obj = JSON.parse(JSON.stringify(this.addForm));
|
|
|
- if(obj.checkResult === 0){
|
|
|
- if(!obj.checkHazardDtoList[0]){
|
|
|
- this.msgError('请添加隐患检查项')
|
|
|
- return
|
|
|
- }
|
|
|
- for(let i=0;i<obj.checkHazardDtoList.length;i++){
|
|
|
- delete obj.checkHazardDtoList[i].lookType
|
|
|
- }
|
|
|
- obj.dangerNum = obj.checkHazardDtoList.length
|
|
|
- }else{
|
|
|
- obj.checkHazardDtoList = [];
|
|
|
- }
|
|
|
obj.manageStatus = type
|
|
|
obj.cycleStartTime = obj.dateRange[0]
|
|
|
obj.cycleEndTime = obj.dateRange[1]
|
|
|
delete obj.dateRange
|
|
|
+ if(this.addForm.checkCategory==1){//综合检查
|
|
|
+ if(obj.checkResult === 0){
|
|
|
+ if(!obj.checkHazardDtoList[0]){
|
|
|
+ this.msgError('请添加隐患检查项')
|
|
|
+ return
|
|
|
+ }
|
|
|
+ for(let i=0;i<obj.checkHazardDtoList.length;i++){
|
|
|
+ delete obj.checkHazardDtoList[i].lookType
|
|
|
+ }
|
|
|
+ obj.dangerNum = obj.checkHazardDtoList.length
|
|
|
+ }else{
|
|
|
+ obj.checkHazardDtoList = [];
|
|
|
+ }
|
|
|
+ }else if(this.addForm.checkCategory==2){//专项检查
|
|
|
+ let list=[]
|
|
|
+ let checkFlagList=[];
|
|
|
+ for(let i=0;i<this.addForm.checkHazardInfoVoList.length;i++){
|
|
|
+ for(let b=0;b<this.addForm.checkHazardInfoVoList[i].checkHazardDtoList.length;b++){
|
|
|
+ checkFlagList.push(this.addForm.checkHazardInfoVoList[i].checkHazardDtoList[b].checkFlag)
|
|
|
+ let obj={
|
|
|
+ checkFlag:this.addForm.checkHazardInfoVoList[i].checkHazardDtoList[b].checkFlag,
|
|
|
+ checkCategory:this.addForm.checkHazardInfoVoList[i].checkHazardDtoList[b].checkCategory,
|
|
|
+ hazardCheckCode:this.addForm.checkHazardInfoVoList[i].checkHazardDtoList[b].hazardCheckCode,
|
|
|
+ hazardCheckName:this.addForm.checkHazardInfoVoList[i].checkHazardDtoList[b].hazardCheckName,
|
|
|
+ hazardCheckPro:this.addForm.checkHazardInfoVoList[i].checkHazardDtoList[b].hazardCheckPro,
|
|
|
+ hazardDescribe:this.addForm.checkHazardInfoVoList[i].checkHazardDtoList[b].hazardDescribe,
|
|
|
+ hazardLevel:this.addForm.checkHazardInfoVoList[i].checkHazardDtoList[b].hazardLevel,
|
|
|
+ uploadDtoList:this.addForm.checkHazardInfoVoList[i].checkHazardDtoList[b].uploadDtoList,
|
|
|
+ code:this.addForm.checkHazardInfoVoList[i].code,
|
|
|
+ hazardId:this.addForm.checkHazardInfoVoList[i].hazardId,
|
|
|
+ hazardName:this.addForm.checkHazardInfoVoList[i].hazardName,
|
|
|
+ hazardTypeMode:this.addForm.checkHazardInfoVoList[i].hazardTypeMode,
|
|
|
+ hazardTypeModeName:this.addForm.checkHazardInfoVoList[i].hazardTypeModeName,
|
|
|
+ joinHazardId:this.addForm.checkHazardInfoVoList[i].joinHazardId,
|
|
|
+ }
|
|
|
+ list.push(obj)
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if(checkFlagList.every(item=>{return item==1})){//符合
|
|
|
+ obj.checkResult=1;
|
|
|
+ }else{//不符合
|
|
|
+ obj.checkResult=0;
|
|
|
+ }
|
|
|
+ obj.checkHazardDtoList=list;
|
|
|
+ }
|
|
|
checkManageUpdate(obj).then(response => {
|
|
|
this.msgSuccess(response.msg);
|
|
|
this.initializationAddData();
|
|
@@ -669,7 +719,25 @@
|
|
|
},
|
|
|
//新增检查项
|
|
|
addObjectDevice(item){
|
|
|
+ let self=this;
|
|
|
this.dialogVisible=true;
|
|
|
+ let list=JSON.parse(JSON.stringify(self.multipleSelection))
|
|
|
+ setTimeout(function(){
|
|
|
+ self.$refs.deviceTable.clearSelection();
|
|
|
+ if(list[0]){
|
|
|
+ self.deviceTableList.forEach(row => {
|
|
|
+ list.forEach(function(item) {
|
|
|
+ if(row.id==item){
|
|
|
+ self.$refs.deviceTable.toggleRowSelection(row,true);
|
|
|
+ }
|
|
|
+ })
|
|
|
+ });
|
|
|
+ }else{
|
|
|
+ if(self.$refs.deviceTable){
|
|
|
+ self.$refs.deviceTable.clearSelection();
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },100);
|
|
|
|
|
|
},
|
|
|
//查看图片
|
|
@@ -837,6 +905,7 @@
|
|
|
this.$set(this.addForm,'deptId',self.subSelectList[i].deptId);
|
|
|
this.$set(this.addForm,'buildId',self.subSelectList[i].buildId);
|
|
|
this.getCheckPlanBySubId(val);
|
|
|
+ this.getHazardListBySub(val);
|
|
|
return
|
|
|
}
|
|
|
}
|
|
@@ -866,6 +935,25 @@
|
|
|
this.$set(this,'planList',list);
|
|
|
});
|
|
|
},
|
|
|
+ //根据实验室ID查询实验室设备
|
|
|
+ getHazardListBySub(id){
|
|
|
+ getHazardListBySub({subId:id}).then(response => {
|
|
|
+ this.deviceTableList=response.data;
|
|
|
+ });
|
|
|
+ },
|
|
|
+ //根据设备id生成检查项
|
|
|
+ getHazardInfo(id,hazardIds){
|
|
|
+ getHazardInfo({subId:id,hazardIds:hazardIds}).then(response => {
|
|
|
+ if(response.data[0]){
|
|
|
+ response.data.forEach(function(item) {
|
|
|
+ item.checkHazardDtoList.forEach(function(item2) {
|
|
|
+ item2.hazardCheckCode=item2.code
|
|
|
+ })
|
|
|
+ })
|
|
|
+ }
|
|
|
+ this.addForm.checkHazardInfoVoList=response.data
|
|
|
+ });
|
|
|
+ },
|
|
|
//计划列表选中
|
|
|
planChange(val){
|
|
|
let self = this;
|
|
@@ -886,7 +974,9 @@
|
|
|
key:2,
|
|
|
label:"实验室自查",
|
|
|
}]);
|
|
|
+ this.pageType=1;
|
|
|
}else if(type == 2){
|
|
|
+ this.pageType=0;
|
|
|
this.$set(this.addForm,'checkType',null);
|
|
|
this.$set(this,'checkTypeList',[{ key:1, label:"校院巡查", },{ key:2, label:"实验室自查", }]);
|
|
|
}
|
|
@@ -894,12 +984,27 @@
|
|
|
//查询详情
|
|
|
findCheckManage(id){
|
|
|
findCheckManage({id:id}).then(response => {
|
|
|
- response.data.checkResult = response.data.checkResult === 0 || response.data.checkResult === 1?response.data.checkResult:"";
|
|
|
- response.data.rectifyNotice = response.data.rectifyNotice?response.data.rectifyNotice:"";
|
|
|
- response.data.rectifyDeadline = response.data.rectifyDeadline?response.data.rectifyDeadline:"";
|
|
|
- response.data.dateRange = [response.data.cycleStartTime,response.data.cycleEndTime];
|
|
|
- for(let i=0;i<response.data.checkHazardDtoList.length;i++){
|
|
|
- response.data.checkHazardDtoList[i].lookType = true;
|
|
|
+ if(response.data.checkCategory==1){//综合检查
|
|
|
+ response.data.checkResult = response.data.checkResult === 0 || response.data.checkResult === 1?response.data.checkResult:"";
|
|
|
+ response.data.rectifyNotice = response.data.rectifyNotice?response.data.rectifyNotice:"";
|
|
|
+ response.data.rectifyDeadline = response.data.rectifyDeadline?response.data.rectifyDeadline:"";
|
|
|
+ response.data.dateRange = [response.data.cycleStartTime,response.data.cycleEndTime];
|
|
|
+ for(let i=0;i<response.data.checkHazardDtoList.length;i++){
|
|
|
+ response.data.checkHazardDtoList[i].lookType = true;
|
|
|
+ }
|
|
|
+
|
|
|
+ }else if(response.data.checkCategory==2){//专项检查
|
|
|
+ response.data.rectifyNotice = response.data.rectifyNotice?response.data.rectifyNotice:"";
|
|
|
+ response.data.rectifyDeadline = response.data.rectifyDeadline?response.data.rectifyDeadline:"";
|
|
|
+ response.data.dateRange = [response.data.cycleStartTime,response.data.cycleEndTime];
|
|
|
+ if(response.data.checkHazardInfoVoList[0]){
|
|
|
+ response.data.checkHazardInfoVoList.forEach(function(item) {
|
|
|
+ item.checkHazardDtoList.forEach(function(item2) {
|
|
|
+ item2.hazardCheckCode=item2.code
|
|
|
+ })
|
|
|
+ })
|
|
|
+ }
|
|
|
+ this.pageType=2
|
|
|
}
|
|
|
this.buildBySubList(response.data.buildId,1);
|
|
|
this.$set(this,'addForm',{
|
|
@@ -916,7 +1021,11 @@
|
|
|
dateRange:response.data.dateRange,
|
|
|
rectifyDeadline:response.data.rectifyDeadline,
|
|
|
checkHazardDtoList:response.data.checkHazardDtoList,
|
|
|
+ checkHazardInfoVoList:response.data.checkHazardInfoVoList,
|
|
|
+
|
|
|
});
|
|
|
+ this.checkOptionList();//获取检查项
|
|
|
+
|
|
|
});
|
|
|
},
|
|
|
//初始化数据
|
|
@@ -952,7 +1061,9 @@
|
|
|
this.$set(this,'planList',[]);
|
|
|
},
|
|
|
//删除检查项
|
|
|
- delCheckHazardDtoList(index){
|
|
|
+ delCheckHazardDtoList(index,index2){
|
|
|
+ console.log(index)
|
|
|
+ console.log(index2)
|
|
|
let self = this;
|
|
|
this.$confirm('是否确认删除?', "警告", {
|
|
|
confirmButtonText: "确定",
|
|
@@ -962,7 +1073,12 @@
|
|
|
if(self.addForm.checkCategory==1){//综合检查
|
|
|
self.addForm.checkHazardDtoList.splice(index,1);
|
|
|
}else if(self.addForm.checkCategory==2){//专项检查
|
|
|
- self.addForm.specialCheckHazardDtoList.splice(index,1);
|
|
|
+ if(index2){//小检查项
|
|
|
+ self.addForm.checkHazardInfoVoList[index].checkHazardDtoList.splice(index2,1);
|
|
|
+ }else{//检查设备
|
|
|
+ self.addForm.checkHazardInfoVoList.splice(index,1);
|
|
|
+ }
|
|
|
+
|
|
|
}
|
|
|
|
|
|
}).then(() => {
|
|
@@ -990,6 +1106,7 @@
|
|
|
this.msgError('未找到相关项目')
|
|
|
return
|
|
|
}
|
|
|
+ console.log(obj)
|
|
|
item.hazardCheckCode=obj.code;
|
|
|
item.hazardCheckName=obj.name;
|
|
|
countHazardNum({subId:this.addForm.subId, hazardCheckPro:val}).then( response => {
|