<!--通知书-->
<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" v-if="propsNoticeDomData.checkCategory == 1">{{documentData.deptName}}：</p>
          <p class="noticeDom-title-1" v-if="propsNoticeDomData.checkCategory == 2">{{documentData.subName}}：</p>
          <p class="noticeDom-title-2" v-if="propsNoticeDomData.checkCategory == 1">学校于{{documentData.checkYear}}年{{documentData.checkMonth}}月{{documentData.checkDay}}日开展了{{documentData.planName}}，共发现了{{documentData.count}}个整改项（见附件）。请逐一对照、分析原因、采取有效措施实施整改，并于{{documentData.deadlineYear}}年{{documentData.deadlineMonth}}月{{documentData.deadlineDay}}日在系统里提交整改证明材料和整改报告。</p>
          <p class="noticeDom-title-2" v-if="propsNoticeDomData.checkCategory == 2">学院于{{documentData.checkYear}}年{{documentData.checkMonth}}月{{documentData.checkDay}}日对你实验室实施了{{documentData.planName}}，共发现了{{documentData.count}}个整改项（见附件）。请逐一对照、分析原因、采取有效措施实施整改，并于{{documentData.deadlineYear}}年{{documentData.deadlineMonth}}月{{documentData.deadlineDay}}日在系统里提交整改证明材料和整改报告。</p>
          <p class="noticeDom-title-2">请你{{propsNoticeDomData.checkCategory == 1?'各学院单位':'你实验室'}}务必高度重视，积极采取有效措施，切实加强对实验室的安全管理。同时，要举一反三，对实验室定期开展安全自查与整改，不断提升实验室安全工作水平。</p>
          <div class="noticeDom-title-min-box">
            <div></div>
            <div>
              <p>{{documentData.checkDeptName}}（公章）</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">
            <p class="title-p-1">整改结果：</p>
            <div class="noticeDom-title-box-1" style="margin-top:170px;">
              <p style="margin-right:140px;">复查人员（签字）：</p>
            </div>
            <div class="noticeDom-title-box-2">
              <p></p>
              <p>
                <span style="margin-right:60px;">年</span>
                <span style="margin-right:60px;">月</span>
                <span>日</span>
              </p>
            </div>
          </div>
        </div>
      </div>
      <div class="noticeDom-box-2">
        <p class="title-p-1">{{documentData.deptName}}实验室安全现场检查发现问题汇总表</p>
        <p class="title-p-2" v-if="propsNoticeDomData.checkCategory == 1">被检查单位：{{documentData.deptName}}</p>
        <p class="title-p-2" v-if="propsNoticeDomData.checkCategory == 2">被检实验室：{{documentData.subName}}{{documentData.roomNum?documentData.roomNum:''}}</p>
        <p class="title-p-2">检查时间：{{documentData.checkDate}}</p>
        <p class="title-p-2">不符合项问题明细：</p>
        <div class="table-max-box">
          <div class="table-title-box" v-if="propsNoticeDomData.checkCategory == 1">
            <p>序号</p>
            <p>条款号</p>
            <p>实验室</p>
            <p>存在问题描述</p>
          </div>
          <div class="table-title-box-one" v-if="propsNoticeDomData.checkCategory == 2">
            <p>序号</p>
            <p>条款号</p>
            <p>存在问题描述</p>
          </div>
          <div v-if="propsNoticeDomData.checkCategory == 1">
            <div class="table-for-box" v-for="(item,index) in documentData.titleList" :key="index">
              <div class="table-left-box">
                <p></p>
                <p>{{item.index}}</p>
                <p></p>
              </div>
              <div class="table-left-box-one">
                <p></p>
                <p>{{item.optionCode}}</p>
                <p></p>
              </div>
              <div class="table-right-box">
                <div class="table-right-bottom-box">
                  <div class="table-for-min-box" v-for="(minItem,minIndex) in item.detailList" :key="minIndex">
                    <div class="table-right-top-box">
                      <p>{{minItem.subName}}</p>
                      <p>{{minItem.checkDesc}}</p>
                    </div>
                    <div class="table-right-bottom-box">
                      <p>主要图片：</p>
                      <div class="img-box">
                        <img :src="minItem.checkImg1" v-if="minItem.checkImg1" @click="lookImgButton(minItem.checkImg1)">
                        <img :src="minItem.checkImg2" v-if="minItem.checkImg2" @click="lookImgButton(minItem.checkImg2)">
                        <img :src="minItem.checkImg3" v-if="minItem.checkImg3" @click="lookImgButton(minItem.checkImg3)">
                        <img :src="minItem.checkImg4" v-if="minItem.checkImg4" @click="lookImgButton(minItem.checkImg4)">
                        <img :src="minItem.checkImg5" v-if="minItem.checkImg5" @click="lookImgButton(minItem.checkImg5)">
                        <img :src="minItem.checkImg6" v-if="minItem.checkImg6" @click="lookImgButton(minItem.checkImg6)">
                      </div>
                    </div>
                  </div>
                </div>
              </div>
            </div>
          </div>
          <div v-if="propsNoticeDomData.checkCategory == 2">
            <div class="table-for-box-one" v-for="(item,index) in documentData.detailList" :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)">
                    <img :src="item.checkImg6" v-if="item.checkImg6" @click="lookImgButton(item.checkImg6)">
                  </div>
                </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 {
    securityRectifyNoticeGetRectifyAdviceNoteView,
  } from "@/api/safetyCheck/index";
  export default {
    name: 'noticeDom',
    props:{
      propsNoticeDomData:{},
    },
    data(){
      return{
        pageType:false,
        documentData:{},
        lookImgType:false,
        lookImg:"",
      }
    },
    created(){},
    mounted(){
      this.securityRectifyNoticeGetRectifyAdviceNoteView();
    },
    methods:{
      securityRectifyNoticeGetRectifyAdviceNoteView(){
        securityRectifyNoticeGetRectifyAdviceNoteView({noticeId:this.propsNoticeDomData.noticeId}).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,[encoded data, 8388 characters]);
      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: 155px;
                  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:70px;
              border-left:1px solid #333;
              border-right:1px solid #333;
            }
            p:nth-child(3){
              width:240px;
              border-right:1px solid #333;
            }
            p:nth-child(4){
              width:265px;
            }
          }
          .table-title-box-one{
            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:70px;
              border-left:1px solid #333;
              border-right:1px solid #333;
            }
            p:nth-child(3){
              width:505px;
            }
          }
          .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-left-box-one{
              display: flex;
              flex-direction: column;
              border-right:1px solid #333;
              p:nth-child(1){
                flex:1;
              }
              p:nth-child(2){
                width:68px;
                text-align: center;
                line-height:16px;
                font-size:14px;
              }
              p:nth-child(3){
                flex:1;
              }
            }
            .table-right-box{
              .table-for-min-box{
                .table-right-top-box{
                  display: flex;
                  p:nth-child(1){
                    font-size:14px;
                    line-height:22px;
                    text-align: center;
                    padding:11px 10px;
                    width:240px;
                    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:265px;
                    border-bottom:1px solid #333;
                  }
                }
                .table-right-bottom-box{
                  min-height:132px;
                  padding:0 10px;
                  border-bottom:1px solid #333;
                  p{
                    line-height:24px;
                    font-size:14px;
                  }
                  .img-box{
                    img{
                      display: inline-block;
                      width:155px;
                      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;
                    }
                  }
                }
              }
              .table-for-min-box:nth-last-child(1){
                .table-right-bottom-box{
                  border-bottom:none;
                }
              }
            }
          }
          .table-for-box-one{
            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:69px;
                  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:506px;
                  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>
