<template>
  <div class="inspectionManagement-infoPage">
    <div class="title-max-box">
      <p class="title-p">检查详情</p>
      <p class="title-button add-button-one-90" @click="outButton">返回</p>
      <img class="position-img" v-if="imgType == 1" src="@/assets/ZDimages/safetyCheck/icon_xyxc_qx.png">
      <img class="position-img" v-if="imgType == 2" src="@/assets/ZDimages/safetyCheck/icon_xyxc_sys.png">
      <img class="position-img" v-if="imgType == 3" src="@/assets/ZDimages/safetyCheck/icon_xyxc_xy.png">
    </div>
    <div class="content-max-box scrollbar-box">
      <el-form  :model="addForm" label-width="82px">
        <div class="top-form-box">
          <div class="top-form-left-box">
            <el-form-item label="计划标题" prop="data1">
              <el-input disabled v-model="addForm.data1" placeholder="未填写" maxLength="10" style="width: 690px"/>
            </el-form-item>
            <div style="display: flex">
              <el-form-item label="学院" prop="data2">
                <el-input disabled v-model="addForm.data2" placeholder="未填写" maxLength="10" style="width: 300px"/>
              </el-form-item>
              <el-form-item label="实验室" prop="data3" label-width="110px">
                <el-input disabled v-model="addForm.data3" placeholder="未填写" maxLength="10" style="width: 280px"/>
              </el-form-item>
            </div>
            <el-form-item label="检查要求" prop="data4">
              <el-input disabled v-model="addForm.data4" placeholder="未填写" maxLength="10" style="width: 690px"/>
            </el-form-item>
            <el-form-item label="检查结果" prop="data5">
              <el-input disabled v-model="addForm.data5" placeholder="未填写" maxLength="10" style="width: 690px"/>
            </el-form-item>
            <div style="display: flex">
              <el-form-item label="整改告知书" prop="data6" style="width: 300px">
                <div class="data-button-box">
                  <p class="look-button" @click="lookDocumentButton(1)">查看</p>
                  <p class="download-button" @click="downloadButton">下载</p>
                </div>
              </el-form-item>
              <el-form-item label="整改通知书" prop="data6" style="width: 300px">
                <div class="data-button-box">
                  <p class="look-button" @click="lookDocumentButton(1)">查看</p>
                  <p class="download-button" @click="downloadButton">下载</p>
                </div>
              </el-form-item>
              <el-form-item label="材料附件" prop="data6" style="width: 300px">
                <div class="data-button-box">
                  <p class="look-button" @click="lookDocumentListButton(1)">查看</p>
                </div>
              </el-form-item>
            </div>
          </div>
          <div class="top-form-right-box">
            <el-form-item label="检查类型" prop="data6">
              <el-input disabled v-model="addForm.data6" placeholder="未填写" maxLength="10" style="width: 450px"/>
            </el-form-item>
            <el-form-item label="楼栋" prop="data8">
              <el-input disabled v-model="addForm.data8" placeholder="未填写" maxLength="10" style="width: 450px"/>
            </el-form-item>
            <el-form-item label="计划周期" prop="data9">
              <el-input disabled v-model="addForm.data9" placeholder="未填写" maxLength="10" style="width: 450px"/>
            </el-form-item>
            <el-form-item label="整改期限" prop="data10">
              <el-input disabled v-model="addForm.data10" placeholder="未填写" maxLength="10" style="width: 450px"/>
            </el-form-item>
            <el-form-item label="材料附件" prop="data6" style="width: 450px">
              <div class="data-button-box">
                <p class="look-button" @click="lookDocumentListButton(1)">查看</p>
              </div>
            </el-form-item>
          </div>
        </div>
        <div class="bottom-form-box">
          <div class="bottom-form-title-box">
            <p>不符合项</p>
            <p>隐患数：{{addForm.rectificationList.length}}</p>
          </div>
          <div class="for-max-big-box" v-for="(item,index) in addForm.rectificationList" :key="index">
            <div class="for-title-box">
              <p class="for-title-p">第{{index+1}}隐患项</p>
            </div>
            <div class="for-content-box">
              <div class="content-box">
                <div class="min-content-box">
                  <div class="left-min-content-box">
                    <p></p>
                    <p>隐患状态</p>
                    <p></p>
                  </div>
                  <div class="right-min-content-box">
                    <p class="button-p" @click="addDialogOpen(true,item)">已完成 <i class="el-icon-d-arrow-right"></i></p>
                  </div>
                </div>
                <div class="min-content-box">
                  <div class="left-min-content-box">
                    <p></p>
                    <p>检查项目</p>
                    <p></p>
                  </div>
                  <div class="right-min-content-box" style="height:120px;">
                    <div class="inspection-box">
                      <p class="scrollbar-box">1 检查项目名称 — 1.1 检查项目名称名称名称名称 — 1.1.1 检查项目名称名称名称名称名
                        称名称名称名称名称名称名称名称名称名称名称名称名称名称名称名称名称名称名称名称
                      </p>
                      <p>此检查项在当前实验室累计出现 <span>9</span> 次隐患</p>
                    </div>
                  </div>
                </div>
                <div class="min-content-box">
                  <div class="left-min-content-box">
                    <p></p>
                    <p>隐患描述</p>
                    <p></p>
                  </div>
                  <div class="right-min-content-box" style="height:120px;">
                    <div class="text-box">
                      <p class="null-p"></p>
                      <p class="text-p">一二三四五六七八九十一二三四五六七八九十一二三四五六七八九十一二三四五六七八九十一二三四五六七八九十一二三四五六七八九十一二三四五六七八九十一二三四五六七八九十一二三四五六七八九十一二三四五六七八九十</p>
                      <p class="null-p"></p>
                    </div>
                  </div>
                </div>
              </div>
              <div class="content-box">
                <div class="min-content-box">
                  <div class="left-min-content-box">
                    <p></p>
                    <p>隐患等级</p>
                    <p></p>
                  </div>
                  <div class="right-min-content-box">
                    <p class="title-p">一般隐患</p>
                  </div>
                </div>
                <div class="min-content-box">
                  <div class="left-min-content-box">
                    <p></p>
                    <p>检查要点</p>
                    <p></p>
                  </div>
                  <div class="right-min-content-box" style="height:120px;">
                    <div class="text-box">
                      <p class="null-p"></p>
                      <p class="text-p">一二三四五六七八九十一二三四五六七八九十一二三四五六七八九十一二三四五六七八九十一二三四五六七八九十一二三四五六七八九十一二三四五六七八九十一二三四五六七八九十一二三四五六七八九十一二三四五六七八九十</p>
                      <p class="null-p"></p>
                    </div>
                  </div>
                </div>
                <div class="min-content-box">
                  <div class="left-min-content-box">
                    <p></p>
                    <p>隐患照片</p>
                    <p></p>
                  </div>
                  <div class="right-min-content-box" style="height:120px;">
                    <div class="img-box">
                      <img :src="imgItem.url" @click="lookImg(item.imgList,imgIndex)"
                           v-for="(imgItem,imgIndex) in item.imgList" :ley="imgIndex">
                    </div>
                  </div>
                </div>
              </div>
            </div>
          </div>
        </div>
      </el-form>
    </div>
    <lookImgDialog ref="lookImgDialog"></lookImgDialog>
    <infoDialog v-if="infoDialogType"></infoDialog>
    <lookDocumentDialog v-if="lookDocumentType" :propsLookDocumentData="propsLookDocumentData"></lookDocumentDialog>
    <lookDocumentListDialog v-if="lookDocumentListType" :propsLookDocumentListData="propsLookDocumentListData"></lookDocumentListDialog>
  </div>
</template>

<script>
  import lookImgDialog from '@/components/lookImgDialog/lookImgDialog.vue'
  import lookDocumentDialog from '@/components/lookDocumentDialog/lookDocumentDialog.vue'
  import lookDocumentListDialog from '@/components/lookDocumentDialog/lookDocumentListDialog.vue'
  import infoDialog from '@/views/safetyCheck/components/infoDialog/infoDialog.vue'
  export default {
    name: 'infoPage',
    components: {
      lookImgDialog,
      infoDialog,
      lookDocumentDialog,
      lookDocumentListDialog
    },
    data(){
      return{
        //子组件数据
        lookDocumentType:false,
        propsLookDocumentData:{},
        lookDocumentListType:false,
        propsLookDocumentListData:{},
        //页面
        imgType:1,
        infoDialogType:false,
        addForm:{
          data1:0,
          data2:0,
          data3:0,
          data4:0,
          data5:0,
          data6:0,
          data7:[
            {
              name:"考勤一体机连接地址配置方法.docx",
              url:"/statics/bigFile/2023042615/17558d57-744c-47ae-84b0-3acdd5559d19.docx",
            },
            {
              name:"我是内容我是内容我是内容我是内容我是内容我是内容我是内容我是内容我是内容我是内容我是内容我是内容我是内容我是内容我是内容我是内容我是内容我是内容我是内容我是内容",
              url:"www.baidu.com",
            },
            {
              name:"我是内容我是内容我是内容我是内容我是内容我是内容我是内容我是内容我是内容我是内容我是内容我是内容我是内容我是内容我是内容我是内容我是内容我是内容我是内容我是内容",
              url:"statics/bigFile/2023022011/f23a32c8-bf8e-40b5-9e52-04cf73fc6037.docx",
            },
            {
              name:"我是内容我是内容我是内容我是内容我是内容我是内容我是内容我是内容我是内容我是内容我是内容我是内容我是内容我是内容我是内容我是内容我是内容我是内容我是内容我是内容",
              url:"statics/bigFile/2023022011/f23a32c8-bf8e-40b5-9e52-04cf73fc6037.docx",
            },
            {
              name:"我是内容我是内容我是内容我是内容我是内容我是内容我是内容我是内容我是内容我是内容我是内容我是内容我是内容我是内容我是内容我是内容我是内容我是内容我是内容我是内容",
              url:"statics/bigFile/2023022011/f23a32c8-bf8e-40b5-9e52-04cf73fc6037.docx",
            },
            {
              name:"我是内容我是内容我是内容我是内容我是内容我是内容我是内容我是内容我是内容我是内容我是内容我是内容我是内容我是内容我是内容我是内容我是内容我是内容我是内容我是内容",
              url:"statics/bigFile/2023022011/f23a32c8-bf8e-40b5-9e52-04cf73fc6037.docx",
            },
            {
              name:"我是内容我是内容我是内容我是内容我是内容我是内容我是内容我是内容我是内容我是内容我是内容我是内容我是内容我是内容我是内容我是内容我是内容我是内容我是内容我是内容",
              url:"statics/bigFile/2023022011/f23a32c8-bf8e-40b5-9e52-04cf73fc6037.docx",
            },
            {
              name:"我是内容我是内容我是内容我是内容我是内容我是内容我是内容我是内容我是内容我是内容我是内容我是内容我是内容我是内容我是内容我是内容我是内容我是内容我是内容我是内容",
              url:"statics/bigFile/2023022011/f23a32c8-bf8e-40b5-9e52-04cf73fc6037.docx",
            },
            {
              name:"我是内容我是内容我是内容我是内容我是内容我是内容我是内容我是内容我是内容我是内容我是内容我是内容我是内容我是内容我是内容我是内容我是内容我是内容我是内容我是内容",
              url:"statics/bigFile/2023022011/f23a32c8-bf8e-40b5-9e52-04cf73fc6037.docx",
            },
            {
              name:"我是内容我是内容我是内容我是内容我是内容我是内容我是内容我是内容我是内容我是内容我是内容我是内容我是内容我是内容我是内容我是内容我是内容我是内容我是内容我是内容",
              url:"statics/bigFile/2023022011/f23a32c8-bf8e-40b5-9e52-04cf73fc6037.docx",
            },
            {
              name:"我是内容我是内容我是内容我是内容我是内容我是内容我是内容我是内容我是内容我是内容我是内容我是内容我是内容我是内容我是内容我是内容我是内容我是内容我是内容我是内容",
              url:"statics/bigFile/2023022011/f23a32c8-bf8e-40b5-9e52-04cf73fc6037.docx",
            },
            {
              name:"我是内容我是内容我是内容我是内容我是内容我是内容我是内容我是内容我是内容我是内容我是内容我是内容我是内容我是内容我是内容我是内容我是内容我是内容我是内容我是内容",
              url:"statics/bigFile/2023022011/f23a32c8-bf8e-40b5-9e52-04cf73fc6037.docx",
            },
            {
              name:"我是内容我是内容我是内容我是内容我是内容我是内容我是内容我是内容我是内容我是内容我是内容我是内容我是内容我是内容我是内容我是内容我是内容我是内容我是内容我是内容",
              url:"statics/bigFile/2023022011/f23a32c8-bf8e-40b5-9e52-04cf73fc6037.docx",
            }
          ],
          rectificationList:[
            {
              lookType:true,
              imgList:[
                {name:"1",url:'https://img2.baidu.com/it/u=3219906533,2982923681&fm=253&fmt=auto&app=138&f=JPEG?w=800&h=500'},
                {name:"2",url:'https://img1.baidu.com/it/u=567782244,1695500002&fm=253&fmt=auto&app=138&f=JPEG?w=753&h=500'},
                {name:"3",url:'https://img1.baidu.com/it/u=2995157981,91041597&fm=253&fmt=auto&app=138&f=JPEG?w=500&h=750'},
                {name:"4",url:'https://img0.baidu.com/it/u=561734853,2461096286&fm=253&fmt=auto&app=138&f=JPEG?w=889&h=500'},
                {name:"5",url:'https://img2.baidu.com/it/u=567357414,4240886412&fm=253&fmt=auto&app=138&f=JPEG?w=800&h=500'},
              ],
            },
            {
              lookType:true,
              imgList:[
                {name:"1",url:'https://img2.baidu.com/it/u=3219906533,2982923681&fm=253&fmt=auto&app=138&f=JPEG?w=800&h=500'},
                {name:"2",url:'https://img1.baidu.com/it/u=567782244,1695500002&fm=253&fmt=auto&app=138&f=JPEG?w=753&h=500'},
                {name:"3",url:'https://img1.baidu.com/it/u=2995157981,91041597&fm=253&fmt=auto&app=138&f=JPEG?w=500&h=750'},
                {name:"4",url:'https://img0.baidu.com/it/u=561734853,2461096286&fm=253&fmt=auto&app=138&f=JPEG?w=889&h=500'},
                {name:"5",url:'https://img2.baidu.com/it/u=567357414,4240886412&fm=253&fmt=auto&app=138&f=JPEG?w=800&h=500'},
              ],
            },
          ],
        },
      }
    },
    created(){},
    mounted(){},
    methods:{
      //开关详情页面
      addDialogOpen(type,data){
        if(this.infoDialogType != type){
          this.$set(this,'infoDialogType',type);
        }
      },
      //返回事件
      outButton(){
        this.$parent.goAddPage(1);
      },
      //收起/展开
      dataLookButton(item){
        item.lookType = !item.lookType
      },
      //查看图片
      lookImg(list,index){
        this.$refs.lookImgDialog.lookImgDialogOpen(1,list,index);
      },
      // 单个下载按钮
      downloadButton(){
        this.download(this.addForm.data7[0].url, {}, this.addForm.data7[0].name)
      },
      //查看单个文档
      lookDocumentButton(type){
        if(type==1){
          this.$set(this,'propsLookDocumentData',{
            title:"整改报告",
            name:this.addForm.data7[0].name,
            url:this.addForm.data7[0].url
          });
          this.$set(this,'lookDocumentType',true);
        }else{
          this.$set(this,'lookDocumentType',false);
        }
      },
      // 多个下载按钮
      allDownloadButton(){
        this.download(this.lookDocumentList[this.lookDocumentListIndex].url, {}, this.lookDocumentList[this.lookDocumentListIndex].name)
      },
      //查看多个文档
      lookDocumentListButton(type){
        if(type==1){
          this.$set(this,'propsLookDocumentListData',{
            title:"查看附件",
            list:this.addForm.data7
          });
          this.$set(this,'lookDocumentListType',true);
        }else{
          this.$set(this,'lookDocumentListType',false);
        }
      },
    }
  }
</script>

<style scoped lang="scss">
  .inspectionManagement-infoPage{
    flex: 1;
    display: flex !important;
    flex-direction: column;
    overflow: hidden;
    *{
      font-weight:500;
    }
    .title-max-box{
      position: relative;
      height:90px;
      display: flex;
      border-bottom:1px solid #dedede;
      .title-p{
        flex:1;
        color:#0045AF;
        margin-left:64px;
        line-height:90px;
        font-size:16px;
      }
      .title-button{
        width:70px;
        margin:24px 31px;
      }
      .position-img{
        width:80px;
        height:80px;
        position: absolute;
        top:0;
        left:0;
      }
    }
    .content-max-box{
      flex:1;
      display: flex;
      flex-direction: column;
      .top-form-box{
        padding:40px 85px 20px;
        display: flex;
        .top-form-left-box{
          height:317px;
          width:770px;
          margin-right:90px;
        }
        .top-form-right-box{
          height:317px;
          width:534px;
        }
        .data-button-box{
          display: flex;
          padding-top: 5px;
          .look-button{
            width: 70px;
            height: 30px;
            background: #0045AF;
            border-radius: 4px 4px 4px 4px;
            color:#fff;
            font-size:14px;
            text-align: center;
            line-height:30px;
            margin-right:12px;
            cursor: pointer;
          }
          .download-button{
            width: 70px;
            height: 30px;
            border-radius: 4px 4px 4px 4px;
            opacity: 1;
            border: 1px solid #0045AF;
            color:#0045AF;
            font-size:14px;
            text-align: center;
            line-height:30px;
            cursor: pointer;
          }
        }
      }
      .bottom-form-box{
        .bottom-form-title-box{
          background: #F5F5F5;
          display: flex;
          margin-bottom:31px;
          p{
            font-size:16px;
            line-height:50px;
          }
          p:nth-child(1){
            color:#333;
            margin-left:30px;
            flex:1;
          }
          p:nth-child(2){
            color:#0183FA;
            margin-right:37px;
          }
        }
        .add-bottom-button{
          cursor: pointer;
          color:#0183FA;
          border-radius:4px;
          border:1px dashed #0183FA;
          width:800px;
          line-height:40px;
          text-align: center;
          font-size:14px;
          margin: 20px auto;
        }
      }
    }
    .for-max-big-box{
      border:1px solid #dedede;
      border-bottom:none;
      overflow: hidden;
      margin:0 81px 40px;
      .for-title-box{
        display: flex;
        background: #F5F5F5;
        border-bottom:1px solid #dedede;
        line-height:50px;
        .for-title-p{
          color:#333333;
          font-size:16px;
          margin-left: 30px;
          flex:1;
        }
      }
      .for-content-box{
        display: flex;
        .content-box{
          flex:1;
          display: flex;
          flex-direction: column;
          .min-content-box{
            display: flex;
            .left-min-content-box{
              display: flex;
              flex-direction: column;
              width:120px;
              border-right:1px solid #E0E0E0;
              border-bottom:1px solid #E0E0E0;
              p:nth-child(1){
                flex:1;
              }
              p:nth-child(2){
                font-size:16px;
                color:#333;
                text-align: center;
                min-height:40px;
                line-height:40px;
              }
              p:nth-child(3){
                flex:1;
              }
            }
            .right-min-content-box{
              width:588px;
              border-right:1px solid #E0E0E0;
              border-bottom:1px solid #E0E0E0;
              .button-p{
                width:80px;
                color:#0183FA;
                font-size:16px;
                min-height:40px;
                line-height:40px;
                margin-left:39px;
                cursor: pointer;
                i{
                  font-size:14px;
                }
              }
              .inspection-box{
                height:120px;
                padding:12px 20px;
                font-size:14px;
                color:#333;
                line-height:18px;
                display: flex;
                flex-direction: column;
                overflow: hidden;
                p:nth-child(1){
                  flex:1;
                }
                p:nth-child(2){
                  margin-top:10px;
                  height:20px;
                  line-height:20px;
                  span{
                    color:#FF0000;
                  }
                }
              }
              .text-box{
                height:120px;
                padding:0 20px;
                display: flex;
                flex-direction: column;
                .null-p{
                  flex:1;
                }
                .text-p{
                  font-size:14px;
                  color:#333;
                  line-height:18px;
                }
              }
              .title-p{
                font-size:16px;
                color:#333;
                min-height:40px;
                line-height:40px;
                margin-left:18px;
              }
              .img-box{
                height:120px;
                padding:0 20px;
                img{
                  height:80px;
                  width:80px;
                  border-radius:4px;
                  display: inline-block;
                  overflow: hidden;
                  margin:20px 10px 0 0;
                  cursor: pointer;
                }

              }
            }
          }
        }
      }
    }
  }
  ::v-deep .is-disabled{
    .el-input__inner{
      background-color: #f5f5f5;
      color: #333;
      border-color: #f5f5f5;
      cursor:auto;
    }
  }
</style>
