|
@@ -2,12 +2,14 @@
|
|
|
<template>
|
|
|
<div class="page-container initiateInspect" v-show="loadType">
|
|
|
<div class="page-top-title-box">
|
|
|
- <p class="page-top-title-name-p">开展检查/编辑检查/检查详情/整改/复核</p>
|
|
|
- <p class="page-top-title-edit-p" @click="submitForm(1)" v-if="projectData.checkStatus != 1">保存草稿</p>
|
|
|
- <p class="page-top-title-edit-p" @click="submitForm(2)" v-if="projectData.checkStatus != 1">继续检查</p>
|
|
|
- <p class="page-top-title-add-p" @click="submitForm(3)" v-if="projectData.checkStatus != 1">提交查看</p>
|
|
|
+ <!--开始检查/检查详情/隐患整改/整改详情/复查验证/复查详情-->
|
|
|
+ <p class="page-top-title-name-p">{{initiateData.orderTitle}}</p>
|
|
|
+ <p class="page-top-title-edit-p" @click="submitForm(1)" v-if="!lookInfoType&&projectData.checkStatus != 1">保存草稿</p>
|
|
|
+ <p class="page-top-title-edit-p" @click="submitForm(2)" v-if="!lookInfoType&&projectData.checkStatus != 1">继续检查</p>
|
|
|
+ <p class="page-top-title-add-p" @click="submitForm(3)" v-if="!lookInfoType&&projectData.checkStatus != 1">提交查看</p>
|
|
|
+ <p class="page-top-title-add-p" @click="submitForm(3)" v-if="!lookInfoType&&projectData.checkStatus == 1 && projectData.checkSetProgress < 100">编辑</p>
|
|
|
<p class="page-top-title-out-p" @click="backPage">返回</p>
|
|
|
- <p class="page-top-title-add-p" @click="submitForm(4)">提交</p>
|
|
|
+ <p class="page-top-title-add-p" @click="submitForm(4)" v-if="!lookInfoType&&(initiateData.orderType == 3||initiateData.orderType == 5)">提交</p>
|
|
|
</div>
|
|
|
<div class="content-box">
|
|
|
<!--校级角标-->
|
|
@@ -115,17 +117,17 @@
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
- <div class="content-right-flex-border-box">
|
|
|
+ <div class="content-right-flex-border-box" v-if="projectData.checkStatus == 1">
|
|
|
<div class="right-text-box">
|
|
|
<p class="right-text-name-p">检查人</p>
|
|
|
<div class="right-text-title-box">
|
|
|
- <p>{{checkItemData.data13}}</p>
|
|
|
+ <p>{{projectData.checkUserName}}-{{projectData.checkAccount}}</p>
|
|
|
</div>
|
|
|
</div>
|
|
|
<div class="right-text-box">
|
|
|
<p class="right-text-name-p" style="width:138px;">检查时间</p>
|
|
|
<div class="right-text-title-box">
|
|
|
- <p>{{checkItemData.data14}}</p>
|
|
|
+ <p>{{parseTime(projectData.checkTime,"{y}-{m}-{d} {h}:{i}")}}</p>
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
@@ -139,6 +141,7 @@
|
|
|
<div v-if="itemShowType_2" style="margin-top:20px;">
|
|
|
<el-form-item label="检查项目" prop="hazardCheckPro">
|
|
|
<el-cascader
|
|
|
+ v-if="!freeChoiceType"
|
|
|
:disabled="lookInfoType||!freeChoiceType"
|
|
|
placeholder="请选择检查项目"
|
|
|
style="width:700px;"
|
|
@@ -148,6 +151,17 @@
|
|
|
:options="cascaderData"
|
|
|
:props="{ value: 'id', label: 'labelName',emitPath:false }"
|
|
|
></el-cascader>
|
|
|
+ <el-cascader
|
|
|
+ v-if="freeChoiceType"
|
|
|
+ :disabled="lookInfoType"
|
|
|
+ placeholder="请选择检查项目"
|
|
|
+ style="width:700px;"
|
|
|
+ v-model="addForm.hazardCheckPro"
|
|
|
+ filterable
|
|
|
+ @change="hazardCheckProChange"
|
|
|
+ :options="cascaderData"
|
|
|
+ :props="{ value: 'id', label: 'labelName',emitPath:false }"
|
|
|
+ ></el-cascader>
|
|
|
</el-form-item>
|
|
|
<p class="dangers-num-p" v-if="dangersNum>0">此检查项在当前实验室累计出现 <span>{{dangersNum}}</span> 次隐患</p>
|
|
|
<el-form-item label="检查要点" prop="hazardCheckPoint">
|
|
@@ -155,7 +169,8 @@
|
|
|
style="width:700px;"></el-input>
|
|
|
</el-form-item>
|
|
|
<div style="display: flex;">
|
|
|
- <el-form-item label="检查结果" prop="checkFlag" v-if="!lookInfoType">
|
|
|
+ <!--未检查-->
|
|
|
+ <el-form-item label="检查结果" prop="checkFlag" v-if="!lookInfoType&& projectData.checkSetProgress < 100">
|
|
|
<div class="check-button-box">
|
|
|
<div :class="addForm.checkFlag == 0?'check-button-border':''" @click="checkButton(0)">
|
|
|
<p>不符合</p>
|
|
@@ -167,20 +182,27 @@
|
|
|
</div>
|
|
|
</div>
|
|
|
</el-form-item>
|
|
|
- <el-form-item label="检查结果" prop="checkFlag" v-if="lookInfoType">
|
|
|
+ <!--查看-已检查-->
|
|
|
+ <el-form-item label="检查结果" prop="checkFlag" v-if="lookInfoType&&projectData.checkStatus == 1">
|
|
|
<div class="check-button-border-box">
|
|
|
- <p>{{addForm.checkFlag == 0?'不符合':'符合'}}</p>
|
|
|
+ <p>{{projectData.checkFlag == 0?'不符合':'符合'}}</p>
|
|
|
<img src="@/assets/ZDimages/safetyCheck/icom_xjjc_jcjc@1x.png">
|
|
|
</div>
|
|
|
</el-form-item>
|
|
|
+ <!--查看-未检查-->
|
|
|
+ <el-form-item label="检查结果" prop="checkFlag" v-if="lookInfoType&&projectData.checkStatus != 1">
|
|
|
+ <div class="check-button-border-box" style="border:1px solid #999!important;color:#666!important;">
|
|
|
+ <p>待检查</p>
|
|
|
+ </div>
|
|
|
+ </el-form-item>
|
|
|
</div>
|
|
|
</div>
|
|
|
<!--第一次检查时选择不符合时展示-->
|
|
|
- <p class="content-right-title-min-p" v-if="processType == 'inspect' && addForm.checkFlag == 0 && projectData.checkStatus != 1">
|
|
|
+ <p class="content-right-title-min-p" v-if="addForm.checkFlag == 0 && initiateData.orderType == 1">
|
|
|
隐患信息
|
|
|
<span :class="itemShowType_3?'el-icon-arrow-down':'el-icon-arrow-up'" @click="itemShowButton(3)"></span>
|
|
|
</p>
|
|
|
- <div v-if="processType == 'inspect' && addForm.checkFlag == 0 && projectData.checkStatus != 1 && itemShowType_3" style="margin-top:20px;">
|
|
|
+ <div v-if="addForm.checkFlag == 0 && initiateData.orderType == 1 && projectData.checkSetProgress < 100 && itemShowType_3" style="margin-top:20px;">
|
|
|
<el-form-item label="隐患描述" prop="hazardDescribe">
|
|
|
<el-input placeholder="请输入隐患描述" maxLength='200' type="textarea" style="width:704px;"
|
|
|
resize="none" v-model="addForm.hazardDescribe" show-word-limit :rows="3"></el-input>
|
|
@@ -212,14 +234,12 @@
|
|
|
</div>
|
|
|
</el-form>
|
|
|
<!--历史记录-->
|
|
|
- <history-records-component ref="historyRecordsComponent"
|
|
|
+ <history-records-component ref="historyRecordsComponent" v-if="projectData.checkStatus == 1 && initiateData.orderType != 1 && historyRecordsComponentPropsType"
|
|
|
:historyRecordsComponentPropsData="historyRecordsComponentPropsData"></history-records-component>
|
|
|
<!--整改-->
|
|
|
- <rectification-component ref="rectificationComponent"
|
|
|
- :recheckComponentPropsData="recheckComponentPropsData"></rectification-component>
|
|
|
+ <rectification-component ref="rectificationComponent" v-if="initiateData.orderType == 3"></rectification-component>
|
|
|
<!--复核-->
|
|
|
- <recheck-component ref="recheckComponent"
|
|
|
- :rectificationComponentPropsData="rectificationComponentPropsData"></recheck-component>
|
|
|
+ <recheck-component ref="recheckComponent" v-if="initiateData.orderType == 5"></recheck-component>
|
|
|
</div>
|
|
|
</div>
|
|
|
<fullScreenView :fullScreenViewProps="fullScreenViewProps" ref="fullScreenView"></fullScreenView>
|
|
@@ -240,11 +260,15 @@
|
|
|
import {
|
|
|
securityCheckPlanCheckInfo,
|
|
|
securityCheckPhotoGetCheckNumBySub,
|
|
|
- securityCheckOptionList,
|
|
|
- securityRecordCheckCommit,
|
|
|
+ securityCheckOptionSelAllList,
|
|
|
+ securityCheckSetOptionCheckCommit,
|
|
|
securityCheckSetOptionUnCheckList,
|
|
|
- securityCheckDangerDetailList,
|
|
|
- } from '@/api/safetyCheck/indexDemoOne'
|
|
|
+ securityCheckDangerGetDangerId,
|
|
|
+ securityDraftFindBySetOptionId,
|
|
|
+ securityCheckDangerCheckRectify,
|
|
|
+ securityCheckDangerApprove,
|
|
|
+ securityCheckPlanBatchDownloadFile,
|
|
|
+ } from '@/api/safetyCheck/index'
|
|
|
|
|
|
export default {
|
|
|
name: 'initiateInspect',
|
|
@@ -268,8 +292,7 @@
|
|
|
},
|
|
|
//页面加载状态
|
|
|
loadType:false,
|
|
|
- //流程状态-用于区分父级入口
|
|
|
- processType:null,
|
|
|
+ initiateData:{},
|
|
|
//图片组件数据
|
|
|
fullScreenViewProps: [],
|
|
|
//查看详情状态
|
|
@@ -283,12 +306,10 @@
|
|
|
uploadDtoList: []
|
|
|
},
|
|
|
//检查项详情
|
|
|
- checkItemData: {
|
|
|
- data13: '姓名-工号',
|
|
|
- data14: '2024-09-06'
|
|
|
- },
|
|
|
+ checkItemData: {},
|
|
|
//检查项
|
|
|
cascaderData: [],
|
|
|
+ cascaderDataList: [],
|
|
|
dangerLevel: [],
|
|
|
//子项展开状态
|
|
|
itemShowType_1: true,
|
|
@@ -302,7 +323,19 @@
|
|
|
uploadDtoList: [],
|
|
|
speechRemarksList: []
|
|
|
},
|
|
|
- rulesNo: {},
|
|
|
+ rulesNo: {
|
|
|
+ checkFlag: [
|
|
|
+ { required: true, message: '请选择检查结果', trigger: 'blur' },
|
|
|
+ { required: true, message: '请选择检查结果', validator: this.spaceJudgment, trigger: 'blur' }
|
|
|
+ ],
|
|
|
+ hazardDescribe: [
|
|
|
+ { required: true, message: '请输入隐患描述', trigger: 'blur' },
|
|
|
+ { required: true, message: '请输入隐患描述', validator: this.spaceJudgment, trigger: 'blur' }
|
|
|
+ ],
|
|
|
+ uploadDtoList: [
|
|
|
+ { required: true, message: '请上传现场照片', trigger: 'blur' }
|
|
|
+ ]
|
|
|
+ },
|
|
|
rules: {
|
|
|
hazardCheckPro: [
|
|
|
{ required: true, message: '请选择检查项目', trigger: 'blur' },
|
|
@@ -322,15 +355,11 @@
|
|
|
},
|
|
|
//历史记录组件数据
|
|
|
historyRecordsComponentPropsData: {},
|
|
|
- //开始检查组件数据
|
|
|
- inspectComponentPropsData: {},
|
|
|
- //整改组件数据
|
|
|
- rectificationComponentPropsData: {},
|
|
|
- //复核组件数据
|
|
|
- recheckComponentPropsData: {}
|
|
|
+ historyRecordsComponentPropsType:false,
|
|
|
}
|
|
|
},
|
|
|
created() {
|
|
|
+ this.$set(this,'initiateData',this.initiateInspectData);
|
|
|
this.initialize()
|
|
|
},
|
|
|
mounted() {
|
|
@@ -340,71 +369,127 @@
|
|
|
//初始化
|
|
|
initialize() {
|
|
|
//计划详情
|
|
|
- this.securityCheckPlanCheckInfo()
|
|
|
- // 上级页面检查项状态 指定时false,未指定true
|
|
|
- if (this.initiateInspectData.freeChoiceType) {
|
|
|
- this.$set(this, 'freeChoiceType', true)
|
|
|
- //未执行过的检查项列表
|
|
|
- this.securityCheckSetOptionUnCheckList();
|
|
|
- }else{
|
|
|
- //全部检查项列表
|
|
|
- this.securityCheckOptionList();
|
|
|
- }
|
|
|
+ this.securityCheckPlanCheckInfo('initialize');
|
|
|
// 是否是详情进入
|
|
|
- if (this.initiateInspectData.showType) {
|
|
|
+ if (this.initiateData.showType) {
|
|
|
this.$set(this, 'lookInfoType', true)
|
|
|
} else {
|
|
|
this.$set(this, 'lookInfoType', false)
|
|
|
}
|
|
|
},
|
|
|
//开始检查计划详情
|
|
|
- securityCheckPlanCheckInfo() {
|
|
|
+ securityCheckPlanCheckInfo(type) {
|
|
|
+ //type 初始化时为FALSE 提交再次调用为true
|
|
|
let self = this
|
|
|
securityCheckPlanCheckInfo({
|
|
|
- manageId: this.initiateInspectData.manageId,
|
|
|
- dangerId: this.initiateInspectData.dangerId ? this.initiateInspectData.dangerId : '',
|
|
|
- setOptionId: this.initiateInspectData.setOptionId ? this.initiateInspectData.setOptionId : ''
|
|
|
+ manageId: this.initiateData.manageId,
|
|
|
+ setOptionId:this.initiateData.setOptionId ? this.initiateData.setOptionId : ''
|
|
|
}).then(response => {
|
|
|
this.$set(this, 'projectData', response.data)
|
|
|
this.$set(this.projectData, 'uploadDtoList', response.data.uploadDtoList?response.data.uploadDtoList:[])
|
|
|
- //有检查项ID时去查询检查项触发次数
|
|
|
- if (this.projectData.hazardCheckPro) {
|
|
|
- //查询次数
|
|
|
- this.securityCheckPhotoGetCheckNumBySub()
|
|
|
- if (this.projectData.checkStatus == 1) {
|
|
|
- //已提交
|
|
|
- this.securityCheckDangerDetailList();
|
|
|
- } else if (this.projectData.checkStatus == 2) {
|
|
|
- //草稿
|
|
|
- this.$set(this.addForm, 'uploadDtoList', this.projectData.photoList?this.projectData.photoList:[])
|
|
|
- this.$set(this.addForm, 'speechRemarksList', this.projectData.voiceList?this.projectData.voiceList:[])
|
|
|
- this.$nextTick(() => {
|
|
|
- for (let i = 0; i < self.addForm.speechRemarksList.length; i++) {
|
|
|
- self.addForm.speechRemarksList[i].playType = false
|
|
|
+ this.$nextTick(()=>{
|
|
|
+ //已制定检查项
|
|
|
+ if (this.projectData.hazardCheckPro) {
|
|
|
+ //查询次数
|
|
|
+ this.securityCheckPhotoGetCheckNumBySub()
|
|
|
+ if (this.projectData.checkStatus == 1) {
|
|
|
+ //已提交
|
|
|
+ this.securityCheckDangerGetDangerId();
|
|
|
+ if(this.projectData.checkSetProgress < 100){
|
|
|
+ this.$set(this.addForm, 'uploadDtoList', response.data.photoList?response.data.photoList:[])
|
|
|
+ this.$set(this.addForm, 'checkFlag', response.data.checkFlag?response.data.checkFlag:0)
|
|
|
+ this.$set(this.addForm, 'hazardDescribe', response.data.hazardDescribe?response.data.hazardDescribe:'')
|
|
|
}
|
|
|
- })
|
|
|
- this.$set(this.addForm, 'checkFlag', this.projectData.checkFlag)
|
|
|
- this.$set(this.addForm, 'hazardDescribe', this.projectData.hazardDescribe)
|
|
|
+ } else if (this.projectData.checkStatus == 0&&this.initiateData.checkDraftVo) {
|
|
|
+ //草稿
|
|
|
+ this.securityDraftFindBySetOptionId(this.initiateData.setOptionId);
|
|
|
+ }else{
|
|
|
+ this.$set(this,'loadType',true);
|
|
|
+ }
|
|
|
+ }else{
|
|
|
+ //未指定检查项
|
|
|
+ this.$set(this,'loadType',true);
|
|
|
}
|
|
|
- }
|
|
|
+ if(type == 'initialize'){
|
|
|
+ // 上级页面检查项状态 指定时false,未指定true
|
|
|
+ if (this.initiateData.freeChoiceType) {
|
|
|
+ this.$set(this, 'freeChoiceType', true)
|
|
|
+ //开始检查/未指定检查项-获取未执行过的检查项列表
|
|
|
+ this.securityCheckSetOptionUnCheckList();
|
|
|
+ }else{
|
|
|
+ //开始检查/开始整改/开始复查-获取所有检查项列表
|
|
|
+ this.securityCheckOptionSelAllList();
|
|
|
+ }
|
|
|
+ }
|
|
|
+ })
|
|
|
+ })
|
|
|
+ },
|
|
|
+ //草稿数据查询
|
|
|
+ securityDraftFindBySetOptionId(setOptionId){
|
|
|
+ let self = this;
|
|
|
+ securityDraftFindBySetOptionId({setOptionId:setOptionId}).then(response => {
|
|
|
+ this.$set(this.addForm, 'uploadDtoList', response.data.photoList?response.data.photoList:[])
|
|
|
+ this.$set(this.addForm, 'speechRemarksList', response.data.voiceList?response.data.voiceList:[])
|
|
|
+ this.$nextTick(() => {
|
|
|
+ for (let i = 0; i < self.addForm.speechRemarksList.length; i++) {
|
|
|
+ self.addForm.speechRemarksList[i].playType = false
|
|
|
+ }
|
|
|
+ })
|
|
|
+ this.$set(this.addForm, 'checkFlag', response.data.checkFlag?response.data.checkFlag:0)
|
|
|
+ this.$set(this.addForm, 'hazardDescribe', response.data.hazardDescribe?response.data.hazardDescribe:'')
|
|
|
+ this.$refs['addForm'].clearValidate();
|
|
|
this.$nextTick(() => {
|
|
|
this.$set(this,'loadType',true);
|
|
|
})
|
|
|
})
|
|
|
},
|
|
|
//查询检查项流程详情
|
|
|
- securityCheckDangerDetailList(){
|
|
|
- securityCheckDangerDetailList({
|
|
|
- managerId: this.initiateInspectData.manageId,
|
|
|
- setOptionId: this.initiateInspectData.setOptionId
|
|
|
+ securityCheckDangerGetDangerId(){
|
|
|
+ securityCheckDangerGetDangerId({
|
|
|
+ manageId: this.initiateData.manageId,
|
|
|
+ setOptionId: this.initiateData.setOptionId
|
|
|
}).then(response => {
|
|
|
-
|
|
|
+ let obj = {
|
|
|
+ orderInfo:{
|
|
|
+ hazardDescribe:this.projectData.hazardDescribe,
|
|
|
+ uploadDtoList:this.projectData.photoList,
|
|
|
+ checkFlag:this.projectData.checkFlag,
|
|
|
+ showType:true,
|
|
|
+ },
|
|
|
+ checkRectifyVoList:[],
|
|
|
+ }
|
|
|
+ if(response.data){
|
|
|
+ if(this.initiateInspectData.editType){
|
|
|
+ let rectifyUploadList = [];
|
|
|
+ for(let i=0;i<response.data.checkRectifyVoList[0].rectifyUploadList.length;i++){
|
|
|
+ rectifyUploadList.push({
|
|
|
+ fileName:response.data.checkRectifyVoList[0].rectifyUploadList[i].fileName,
|
|
|
+ fileUrl:response.data.checkRectifyVoList[0].rectifyUploadList[i].fileUrl,
|
|
|
+ fileType:response.data.checkRectifyVoList[0].rectifyUploadList[i].fileType,
|
|
|
+ })
|
|
|
+ }
|
|
|
+ this.$refs['rectificationComponent'].addForm = {
|
|
|
+ rectifyResult:response.data.checkRectifyVoList[0].rectifyResult?1:0,
|
|
|
+ rectifyMeasure:response.data.checkRectifyVoList[0].rectifyMeasure?response.data.checkRectifyVoList[0].rectifyMeasure:'',
|
|
|
+ rectifyUploadList:rectifyUploadList,
|
|
|
+ rectifyMaterialUrl:'',
|
|
|
+ }
|
|
|
+ }else{
|
|
|
+ obj.checkRectifyVoList = response.data.checkRectifyVoList?response.data.checkRectifyVoList:[]
|
|
|
+ }
|
|
|
+ }
|
|
|
+ this.$set(this,'checkItemData',response.data);
|
|
|
+ this.$set(this,'historyRecordsComponentPropsData',obj);
|
|
|
+ this.$set(this,'historyRecordsComponentPropsType',true);
|
|
|
+ this.$nextTick(() => {
|
|
|
+ this.$set(this,'loadType',true);
|
|
|
+ })
|
|
|
})
|
|
|
},
|
|
|
//查询隐患发生次数
|
|
|
securityCheckPhotoGetCheckNumBySub() {
|
|
|
securityCheckPhotoGetCheckNumBySub({
|
|
|
- subId: this.projectData.subId,
|
|
|
+ subId: this.initiateData.subId,
|
|
|
hazardCheckId: this.projectData.hazardCheckPro
|
|
|
}).then(response => {
|
|
|
this.$set(this, 'dangersNum', response.data)
|
|
@@ -412,7 +497,21 @@
|
|
|
},
|
|
|
//手动选择检查项目
|
|
|
hazardCheckProChange(val){
|
|
|
-
|
|
|
+ let self = this;
|
|
|
+ if (val){
|
|
|
+ for (let i=0;i<self.cascaderDataList.length;i++){
|
|
|
+ if(val == self.cascaderDataList[i].hazardCheckPro){
|
|
|
+ self.$set(self.projectData,'setOptionId',self.cascaderDataList[i].setOptionId);
|
|
|
+ self.$set(self.projectData,'hazardCheckPoint',self.cascaderDataList[i].hazardCheckPoint);
|
|
|
+ self.$set(self.projectData,'hazardCheckPro',self.cascaderDataList[i].hazardCheckPro);
|
|
|
+ self.$nextTick(()=>{
|
|
|
+ self.securityDraftFindBySetOptionId(self.cascaderDataList[i].setOptionId);
|
|
|
+ self.securityCheckPhotoGetCheckNumBySub()
|
|
|
+ })
|
|
|
+ break
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
},
|
|
|
// 返回按钮
|
|
|
backPage() {
|
|
@@ -420,48 +519,91 @@
|
|
|
},
|
|
|
/** 提交按钮 */
|
|
|
submitForm(type) {
|
|
|
+ let self = this;
|
|
|
if (type == 1 || type == 2 || type == 3) {
|
|
|
- this.$refs['addForm'].validate(valid => {
|
|
|
+ self.$refs['addForm'].validate(valid => {
|
|
|
if (valid) {
|
|
|
- //保存草稿/继续检查/提交查看
|
|
|
- this.securityRecordCheckCommit(type)
|
|
|
+ this.$confirm(type==1?'确认保存草稿?':(type==2?'确认继续检查?':(type==3?'确认提交查看?':'')), "警告", {
|
|
|
+ confirmButtonText: "确定",
|
|
|
+ cancelButtonText: "取消",
|
|
|
+ type: "warning"
|
|
|
+ }).then(function() {
|
|
|
+ }).then(() => {
|
|
|
+ //保存草稿/继续检查/提交查看
|
|
|
+ self.securityCheckSetOptionCheckCommit(type)
|
|
|
+ }).catch(() => {});
|
|
|
}
|
|
|
})
|
|
|
} else if (type == 4) {
|
|
|
- //提交
|
|
|
+ if(this.initiateData.orderType == 3){
|
|
|
+ //整改提交
|
|
|
+ this.$refs['rectificationComponent'].submitData().then(data => {
|
|
|
+ let obj = {
|
|
|
+ checkCategory:this.projectData.checkCategory,
|
|
|
+ dangerId:this.checkItemData.dangerId,
|
|
|
+ rectifyMeasure:data.rectifyMeasure,
|
|
|
+ rectifyMaterialName:data.rectifyMaterialName,
|
|
|
+ rectifyMaterialUrl:data.rectifyMaterialUrl,
|
|
|
+ rectifyResult:data.rectifyResult,
|
|
|
+ rectifyUploadList:data.rectifyUploadList,
|
|
|
+ };
|
|
|
+ securityCheckDangerCheckRectify(obj).then(response => {
|
|
|
+ this.msgSuccess(response.message)
|
|
|
+ this.$parent.tableButton(6)
|
|
|
+ })
|
|
|
+ });
|
|
|
+ }else if(this.initiateData.orderType == 5){
|
|
|
+ //复查提交
|
|
|
+ this.$refs['recheckComponent'].submitData().then(data => {
|
|
|
+ let list = JSON.parse(JSON.stringify(this.$refs['historyRecordsComponent'].dataList))
|
|
|
+ let obj = {
|
|
|
+ rectifyId:list[list.length-1].rectifyId,
|
|
|
+ examineResult:data.examineResult,
|
|
|
+ examineOpinion:data.examineOpinion,
|
|
|
+ examineUploadList:data.examineUploadList,
|
|
|
+ };
|
|
|
+ securityCheckDangerApprove(obj).then(response => {
|
|
|
+ this.msgSuccess(response.message)
|
|
|
+ this.$parent.tableButton(6)
|
|
|
+ })
|
|
|
+ });
|
|
|
+ }
|
|
|
}
|
|
|
},
|
|
|
//检查提交
|
|
|
- securityRecordCheckCommit(type) {
|
|
|
+ securityCheckSetOptionCheckCommit(type) {
|
|
|
let obj = {
|
|
|
checkFlag: this.addForm.checkFlag,
|
|
|
checkStatus: type == 1 ? '2' : 1,
|
|
|
- recordId:this.projectData.checkStatus == 2?this.projectData.recordId:'',
|
|
|
hazardDescribe: this.addForm.hazardDescribe,
|
|
|
- manageId: this.initiateInspectData.manageId,
|
|
|
- setOptionId: this.initiateInspectData.setOptionId,
|
|
|
+ setOptionId: this.freeChoiceType?this.projectData.setOptionId:this.initiateData.setOptionId,
|
|
|
photoList: this.addForm.uploadDtoList,
|
|
|
voiceList: this.addForm.speechRemarksList,
|
|
|
}
|
|
|
- for(let i=0;i<obj.photoList.length;i++){
|
|
|
- obj.photoList[i].fileType = 2;
|
|
|
- obj.photoList[i].source = 2;
|
|
|
- }
|
|
|
- for(let i=0;i<obj.voiceList.length;i++){
|
|
|
- obj.photoList[i].fileType = 3;
|
|
|
- obj.photoList[i].source = 2;
|
|
|
- }
|
|
|
- securityRecordCheckCommit(obj).then(response => {
|
|
|
+ securityCheckSetOptionCheckCommit(obj).then(response => {
|
|
|
this.msgSuccess(response.message)
|
|
|
if (type == 1) {
|
|
|
//保存草稿
|
|
|
this.$parent.tableButton(6)
|
|
|
} else if (type == 2) {
|
|
|
//继续检查
|
|
|
+ this.$set(this,'addForm',{
|
|
|
+ checkFlag: 0,
|
|
|
+ hazardDescribe: '',
|
|
|
+ uploadDtoList: [],
|
|
|
+ speechRemarksList: []
|
|
|
+ })
|
|
|
+ this.$set(this,'dangersNum',0)
|
|
|
+ this.$set(this.initiateData,'freeChoiceType',true)
|
|
|
+ this.$set(this.initiateData,'setOptionId',null)
|
|
|
+ this.initialize()
|
|
|
} else if (type == 3) {
|
|
|
//提交查看
|
|
|
+ this.$set(this.initiateData, 'setOptionId', this.projectData.setOptionId)
|
|
|
this.securityCheckPlanCheckInfo();
|
|
|
this.$set(this, 'lookInfoType', true)
|
|
|
+ this.$set(this, 'historyRecordsComponentPropsType', false)
|
|
|
+ this.$set(this.initiateData, 'orderType', 2)
|
|
|
}
|
|
|
})
|
|
|
},
|
|
@@ -484,7 +626,6 @@
|
|
|
|
|
|
/*==========上传相关==========*/
|
|
|
handleAvatarSuccess(res) {
|
|
|
- this.$set(this, 'loading', false)
|
|
|
if (this.addForm.uploadDtoList.length > 5) {
|
|
|
this.msgError('最多只可上传6张')
|
|
|
return
|
|
@@ -514,7 +655,6 @@
|
|
|
this.msgError('上传图片大小不能超过2M')
|
|
|
return false
|
|
|
}
|
|
|
- this.$set(this, 'loading', true)
|
|
|
this.upDataName = file.name
|
|
|
type = true
|
|
|
} else {
|
|
@@ -529,7 +669,11 @@
|
|
|
},
|
|
|
//照片预览
|
|
|
fullScreenViewClick(list, index) {
|
|
|
- this.$set(this, 'fullScreenViewProps', list)
|
|
|
+ let newList = [];
|
|
|
+ for(let i=0;i<list.length;i++){
|
|
|
+ newList.push(list[i].fileUrl)
|
|
|
+ }
|
|
|
+ this.$set(this, 'fullScreenViewProps', newList)
|
|
|
this.$refs['fullScreenView'].initialize(index)
|
|
|
},
|
|
|
//文件预览
|
|
@@ -552,92 +696,124 @@
|
|
|
},
|
|
|
// 下载全部
|
|
|
downloadAll() {
|
|
|
-
|
|
|
+ this.download('security/checkPlan/batchDownloadFile', {
|
|
|
+ ...{planId:this.initiateData.planId}
|
|
|
+ }, `材料附件.zip`)
|
|
|
},
|
|
|
//检查项列表
|
|
|
- securityCheckOptionList() {
|
|
|
- securityCheckOptionList({}).then(response => {
|
|
|
- let list = this.getCascaderData(response.data)
|
|
|
- this.$set(this, 'cascaderData', list)
|
|
|
+ securityCheckOptionSelAllList() {
|
|
|
+ securityCheckOptionSelAllList({}).then(response => {
|
|
|
+ let list = this.getCascaderData(JSON.parse(JSON.stringify(response.data)),3)
|
|
|
+ this.$nextTick(()=>{
|
|
|
+ this.$set(this, 'cascaderData', list)
|
|
|
+ })
|
|
|
})
|
|
|
},
|
|
|
//未执行过的检查项列表
|
|
|
securityCheckSetOptionUnCheckList(){
|
|
|
- securityCheckSetOptionUnCheckList({
|
|
|
- manageId: this.initiateInspectData.manageId,
|
|
|
- searchValue: ''
|
|
|
- }).then(response => {
|
|
|
- let list = this.getCascaderData(response.data)
|
|
|
- this.$set(this, 'cascaderData', list)
|
|
|
+ securityCheckOptionSelAllList({}).then(response => {
|
|
|
+ let maxList = this.getCascaderData(JSON.parse(JSON.stringify(response.data)),2)
|
|
|
+ this.$nextTick(()=>{
|
|
|
+ securityCheckSetOptionUnCheckList({
|
|
|
+ manageId: this.initiateData.manageId,
|
|
|
+ }).then(response => {
|
|
|
+ if(response.data[0]){
|
|
|
+ this.$set(this,'cascaderDataList',response.data);
|
|
|
+ for(let i=0;i<maxList.length;i++){
|
|
|
+ for(let o=0;o<maxList[i].children.length;o++){
|
|
|
+ for(let x=0;x<response.data.length;x++){
|
|
|
+ if(maxList[i].children[o].id == response.data[x].hazardCheckPro2){
|
|
|
+ if(maxList[i].children[o].children){
|
|
|
+ maxList[i].children[o].children.push({
|
|
|
+ id: response.data[x].hazardCheckPro,
|
|
|
+ name: response.data[x].hazardCheckName,
|
|
|
+ mainPoint: response.data[x].hazardCheckPoint,
|
|
|
+ hazardLevelName: null,
|
|
|
+ code: response.data[x].hazardCheckCode,
|
|
|
+ parentId: response.data[x].hazardCheckPro2,
|
|
|
+ type: 1,
|
|
|
+ level: 3,
|
|
|
+ hazardReid: null,
|
|
|
+ })
|
|
|
+ }else{
|
|
|
+ maxList[i].children[o].children = [{
|
|
|
+ id: response.data[x].hazardCheckPro,
|
|
|
+ name: response.data[x].hazardCheckName,
|
|
|
+ mainPoint: response.data[x].hazardCheckPoint,
|
|
|
+ hazardLevelName: null,
|
|
|
+ code: response.data[x].hazardCheckCode,
|
|
|
+ parentId: response.data[x].hazardCheckPro2,
|
|
|
+ type: 1,
|
|
|
+ level: 3,
|
|
|
+ hazardReid: null,
|
|
|
+ }]
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ let list = this.getCascaderData(JSON.parse(JSON.stringify(maxList)),3)
|
|
|
+ this.$nextTick(()=>{
|
|
|
+ this.$set(this, 'cascaderData', list)
|
|
|
+ this.$set(this.addForm, 'hazardCheckPro', list[0].children[0].children[0].id)
|
|
|
+ this.hazardCheckProChange(list[0].children[0].children[0].id);
|
|
|
+ })
|
|
|
+ }else{
|
|
|
+ this.$parent.tableButton(6)
|
|
|
+ }
|
|
|
+ })
|
|
|
+ })
|
|
|
})
|
|
|
},
|
|
|
//检查项格式处理
|
|
|
- getCascaderData(list) {
|
|
|
+ getCascaderData(list,type) {
|
|
|
let self = this
|
|
|
for (let i = 0; i < list.length; i++) {
|
|
|
list[i].labelName = list[i].code ? list[i].code + ' ' + list[i].name : list[i].name
|
|
|
- if (list[i].children) {
|
|
|
+ if(list[i].level == type){
|
|
|
+ delete list[i].children
|
|
|
+ }else if (list[i].children) {
|
|
|
if (list[i].children[0]) {
|
|
|
- list[i].children = self.getCascaderData(list[i].children)
|
|
|
+ list[i].children = self.getCascaderData(list[i].children,type)
|
|
|
} else {
|
|
|
- if (list[i].level != 3) {
|
|
|
- list.splice(i, 1)
|
|
|
- i--
|
|
|
- } else {
|
|
|
- delete list[i].children
|
|
|
- }
|
|
|
- }
|
|
|
- } else {
|
|
|
- if (list[i].level != 3) {
|
|
|
list.splice(i, 1)
|
|
|
i--
|
|
|
- } else {
|
|
|
- delete list[i].children
|
|
|
}
|
|
|
+ } else {
|
|
|
+ list.splice(i, 1)
|
|
|
+ i--
|
|
|
}
|
|
|
}
|
|
|
for (let i = 0; i < list.length; i++) {
|
|
|
list[i].labelName = list[i].code ? list[i].code + ' ' + list[i].name : list[i].name
|
|
|
- if (list[i].children) {
|
|
|
+ if(list[i].level == type){
|
|
|
+ delete list[i].children
|
|
|
+ }else if (list[i].children) {
|
|
|
if (list[i].children[0]) {
|
|
|
- list[i].children = self.getCascaderData(list[i].children)
|
|
|
+ list[i].children = self.getCascaderData(list[i].children,type)
|
|
|
} else {
|
|
|
- if (list[i].level != 3) {
|
|
|
- list.splice(i, 1)
|
|
|
- i--
|
|
|
- } else {
|
|
|
- delete list[i].children
|
|
|
- }
|
|
|
- }
|
|
|
- } else {
|
|
|
- if (list[i].level != 3) {
|
|
|
list.splice(i, 1)
|
|
|
i--
|
|
|
- } else {
|
|
|
- delete list[i].children
|
|
|
}
|
|
|
+ } else {
|
|
|
+ list.splice(i, 1)
|
|
|
+ i--
|
|
|
}
|
|
|
}
|
|
|
for (let i = 0; i < list.length; i++) {
|
|
|
list[i].labelName = list[i].code ? list[i].code + ' ' + list[i].name : list[i].name
|
|
|
- if (list[i].children) {
|
|
|
+ if(list[i].level == type){
|
|
|
+ delete list[i].children
|
|
|
+ }else if (list[i].children) {
|
|
|
if (list[i].children[0]) {
|
|
|
- list[i].children = self.getCascaderData(list[i].children)
|
|
|
+ list[i].children = self.getCascaderData(list[i].children,type)
|
|
|
} else {
|
|
|
- if (list[i].level != 3) {
|
|
|
- list.splice(i, 1)
|
|
|
- i--
|
|
|
- } else {
|
|
|
- delete list[i].children
|
|
|
- }
|
|
|
- }
|
|
|
- } else {
|
|
|
- if (list[i].level != 3) {
|
|
|
list.splice(i, 1)
|
|
|
i--
|
|
|
- } else {
|
|
|
- delete list[i].children
|
|
|
}
|
|
|
+ } else {
|
|
|
+ list.splice(i, 1)
|
|
|
+ i--
|
|
|
}
|
|
|
}
|
|
|
return list
|