<!--通知书-->
<template>
  <div class="noticeDom" v-if="pageType">
    <div class="noticeDom-page" v-if="!lookImgType">
      <div class="noticeDom-box-1">
        <p class="noticeDom-title-p-1">{{documentData.deptName}}实验室安全隐患整改通知书</p>
        <p class="noticeDom-title-p-2">编号：<span>{{documentData.code}}</span></p>
        <div class="noticeDom-title-box">
          <p class="noticeDom-title-1">{{documentData.subName}}实验室：</p>
          <p class="noticeDom-title-2">学院于{{documentData.checkYear}}年{{documentData.checkMonth}}月{{documentData.checkDay}}日对你实验室实施了安全管理现场检查，共发现了{{documentData.count}}个整改项（见附件）。请逐一对照、分析原因、采取有效措施实施整改，并于{{documentData.rectifyYear}}年{{documentData.rectifyMonth}}月{{documentData.rectifyDay}}日在系统里提交整改证明材料和整改报告。</p>
          <p class="noticeDom-title-2">请你实验室务必高度重视，积极采取有效措施，切实加强对实验室的安全管理。同时，要举一反三，对实验室定期开展安全自查与整改，不断提升实验室安全工作水平。</p>
          <div class="noticeDom-title-min-box">
            <div></div>
            <div>
              <p>{{documentData.deptName}}（公章）</p>
              <p>{{documentData.checkYear}}年{{documentData.checkMonth}}月{{documentData.checkDay}}日</p>
            </div>
          </div>
          <img :src="documentData.checkDeptSign">
        </div>
        <div class="noticeDom-text-max-box">
          <div class="noticeDom-text-box" v-for="(item,index) in documentData.checkManageDetail2List" :key="index">
            <p class="title-p-1">整改结果：</p>
            <div class="title-box-1">
              <p class="title-p-2">{{item.hazardName}}</p>
              <p class="title-p-2">整改结果：{{item.rectifyStatus}}</p>
              <p class="title-p-2">整改措施：{{item.rectifyMeasure}}</p>
              <div class="img-box">
                <img :src="item.rectifyImg1" v-if="item.rectifyImg1" @click="lookImgButton(item.rectifyImg1)">
                <img :src="item.rectifyImg2" v-if="item.rectifyImg2" @click="lookImgButton(item.rectifyImg2)">
                <img :src="item.rectifyImg3" v-if="item.rectifyImg3" @click="lookImgButton(item.rectifyImg3)">
                <img :src="item.rectifyImg4" v-if="item.rectifyImg4" @click="lookImgButton(item.rectifyImg4)">
                <img :src="item.rectifyImg5" v-if="item.rectifyImg5" @click="lookImgButton(item.rectifyImg5)">
              </div>
            </div>
            <div class="noticeDom-title-box-1">
              <p>复查人员（签字）：</p>
              <img :src="item.rechecker">
            </div>
            <div class="noticeDom-title-box-2">
              <p></p>
              <p>{{item.rectifyYear}}年{{item.rectifyMonth}}月{{item.rectifyDay}}日</p>
            </div>
          </div>
        </div>
      </div>
      <div class="noticeDom-box-2">
        <p class="title-p-1">{{documentData.checkDeptName}}实验室安全现场检查发现问题汇总表</p>
        <p class="title-p-2">被检实验室名称（房间号）：{{documentData.checkRoom}}</p>
        <p class="title-p-2">检查时间：{{documentData.checkDate}}</p>
        <p class="title-p-2">检查人员：{{documentData.checkUser}}</p>
        <p class="title-p-2">不符合项问题明细：</p>
        <div class="table-max-box">
          <div class="table-title-box">
            <p>序号</p>
            <p>条款号</p>
            <p>存在问题描述</p>
          </div>
          <div class="table-for-box" v-for="(item,index) in documentData.checkManageDetailList" :key="index">
            <div class="table-left-box">
              <p></p>
              <p>{{item.index}}</p>
              <p></p>
            </div>
            <div class="table-right-box">
              <div class="table-right-top-box">
                <p>{{item.optionCode}}</p>
                <p>{{item.checkDesc}}</p>
              </div>
              <div class="table-right-bottom-box">
                <p>主要图片：</p>
                <div class="img-box">
                  <img :src="item.checkImg1" v-if="item.checkImg1" @click="lookImgButton(item.checkImg1)">
                  <img :src="item.checkImg2" v-if="item.checkImg2" @click="lookImgButton(item.checkImg2)">
                  <img :src="item.checkImg3" v-if="item.checkImg3" @click="lookImgButton(item.checkImg3)">
                  <img :src="item.checkImg4" v-if="item.checkImg4" @click="lookImgButton(item.checkImg4)">
                  <img :src="item.checkImg5" v-if="item.checkImg5" @click="lookImgButton(item.checkImg5)">
                </div>
              </div>
            </div>
          </div>
        </div>
      </div>
    </div>
    <div class="look-img-box" v-if="lookImgType">
      <img class="look-img" :src="lookImg">
      <p v-if="lookImgType" class="out-look-button" @click="outLookImgButton">退出查看</p>
    </div>
  </div>
</template>

<script>
  import { getRectifyAdviceNoteView } from '@/apiDemo/safetyCheck/index'
  export default {
    name: 'noticeDom',
    props:{
      propsNoticeDomData:{},
    },
    data(){
      return{
        pageType:false,
        documentData:{},
        lookImgType:false,
        lookImg:"",
      }
    },
    created(){},
    mounted(){
      this.getRectifyAdviceNoteView();
    },
    methods:{
      getRectifyAdviceNoteView(){
        getRectifyAdviceNoteView(this.propsNoticeDomData.id).then(response => {
          this.$set(this,'documentData',response.data);
          this.$set(this,'pageType',true);
        });
      },
      //查看图片
      lookImgButton(url){
        this.$set(this,'lookImg',url);
        this.$set(this,'lookImgType',true);
      },
      //退出查看图片
      outLookImgButton(){
        this.$set(this,'lookImg','');
        this.$set(this,'lookImgType',false);
      },
    }
  }
</script>

<style scoped lang="scss">
  .noticeDom{
    width:790px;
    margin:0 auto;
    .noticeDom-page{
      color:#333;
      background-image: url(data:image/png;base64, );
      background-color: #fff;
      width:790px;
      padding: 80px;
      .noticeDom-box-1{
        .noticeDom-title-p-1{
          text-align: center;
          font-size:18px;
          line-height:40px;
          font-weight: 700;
        }
        .noticeDom-title-p-2{
          text-align: right;
          font-size:16px;
          line-height:28px;
          margin-right:10px;
          font-weight: 700;
          span{
            text-decoration: underline;
            text-underline-offset: 4px;
          }
        }
        .noticeDom-title-box{
          position: relative;
          padding:10px;
          border:1px solid #333;
          overflow: hidden;
          height:420px;
          .noticeDom-title-1{
            font-size:14px;
            line-height:26px;
            text-decoration:underline;
            text-underline-offset: 4px;
          }
          .noticeDom-title-2{
            font-size:16px;
            line-height:36px;
            text-indent:40px;
          }
          .noticeDom-title-min-box{
            margin-top:64px;
            display: flex;
            div:nth-child(1){
              flex:1;
            }
            div:nth-child(2){
              p:nth-child(1){
                font-size:14px;
                line-height:24px;
                text-align: right;
              }
              p:nth-child(2){
                font-size:16px;
                line-height:34px;
                text-align: right;
              }
            }
          }
          img{
            display: block;
            width:150px;
            height:150px;
            position: absolute;
            right:20px;
            bottom:20px;
          }
        }
        .noticeDom-text-max-box{
          .noticeDom-text-box:nth-child(1){
            margin-top:0;
            border-top:none;
          }
          .noticeDom-text-box{
            padding:10px;
            border:1px solid #333;
            min-height:300px;
            margin-top:30px;
            .title-p-1{
              text-align: left;
              font-size:16px;
              line-height:28px;
            }
            .title-box-1{
              min-height:210px;
              .title-p-2{
                text-align: left;
                font-size:16px;
                line-height:36px;
                text-indent:70px;
              }
              .img-box{
                margin-bottom:20px;
                img{
                  display: inline-block;
                  width: 196px;
                  height:110px;
                  margin-bottom:10px;
                }
                img:nth-child(1){
                  margin-right:10px;
                }
                img:nth-child(2){
                  margin-right:10px;
                }
                img:nth-child(4){
                  margin-right:10px;
                }
                img:nth-child(5){
                  margin-right:10px;
                }
              }
            }
            .noticeDom-title-box-1{
              display: flex;
              p{
                text-align: right;
                flex:1;
                line-height:40px;
                font-size:16px;
              }
              img{
                width:120px;
                height:40px;
                display: block;
                margin-right:10px;
              }
            }
            .noticeDom-title-box-2{
              display: flex;
              margin-bottom:14px;
              p:nth-child(1){
                flex:1;
              }
              p:nth-child(2){
                line-height:26px;
                font-size:16px;
                margin-right:40px;
              }
            }
          }
        }
      }
      .noticeDom-box-2{
        margin-top: 50px;
        overflow: hidden;
        .title-p-1{
          text-align:center;
          margin:62px 0 50px;
          font-size:18px;
          line-height:34px;
          font-weight: 700;
        }
        .title-p-2{
          text-align:left;
          line-height:32px;
          font-size:16px;
          font-weight: 700;
        }
        .table-max-box{
          margin-top:10px;
          .table-title-box{
            display: flex;
            border:1px solid #333;
            p{
              text-align: center;
              font-size:14px;
              line-height:44px;
            }
            p:nth-child(1){
              width:52px;
            }
            p:nth-child(2){
              width:153px;
              border-left:1px solid #333;
              border-right:1px solid #333;
            }
            p:nth-child(3){
              width:422px;
            }
          }
          .table-for-box{
            display: flex;
            border:1px solid #333;
            border-top:none;
            .table-left-box{
              display: flex;
              flex-direction: column;
              border-right:1px solid #333;
              p:nth-child(1){
                flex:1;
              }
              p:nth-child(2){
                width:52px;
                text-align: center;
                line-height:44px;
                font-size:14px;
              }
              p:nth-child(3){
                flex:1;
              }
            }
            .table-right-box{
              .table-right-top-box{
                display: flex;
                p:nth-child(1){
                  font-size:14px;
                  line-height:22px;
                  text-align: center;
                  padding:11px 10px;
                  width:152px;
                  border-right:1px solid #333;
                  border-bottom:1px solid #333;
                }
                p:nth-child(2){
                  font-size:14px;
                  line-height:22px;
                  text-align: left;
                  padding:11px 10px;
                  width:422px;
                  border-bottom:1px solid #333;
                }
              }
              .table-right-bottom-box{
                min-height:132px;
                padding:0 10px;
                p{
                  line-height:24px;
                  font-size:14px;
                }
                .img-box{
                  img{
                    display: inline-block;
                    width:184px;
                    height:104px;
                    margin-bottom:10px;
                  }
                  img:nth-child(1){
                    margin-right:10px;
                  }
                  img:nth-child(2){
                    margin-right:10px;
                  }
                  img:nth-child(4){
                    margin-right:10px;
                  }
                  img:nth-child(5){
                    margin-right:10px;
                  }
                }
              }
            }
          }
        }
      }
    }
    .look-img-box{
      height:100%;
      display: flex;
      flex-direction: column;
      position: relative;
      .look-img{
        display: block;
        width: 790px;
      }
      .out-look-button{
        position: absolute;
        right:15px;
        top:15px;
        border:1px solid #0183fa;
        border-radius:4px;
        line-height:30px;
        width:100px;
        text-align: center;
        cursor: pointer;
        color:#0183fa;
        background-color: #fff;
      }
      .out-look-button:hover{
        background-color:#0183fa;
        color:#fff;
      }
    }
  }
</style>
