<!--入库记录-详情-->
<template>
  <div class="addPage">
    <div class="addPage_title">
      <p>入库详情</p>
      <p  class="reset-button-one" @click="backPage">返回</p>
    </div>
    <div class="small_title">气瓶信息</div>
     <!--基本信息-->
    <div class="info" v-if="formInfo">
      <li><i>气瓶编号：</i><i>{{formInfo.airNumber}}</i></li>
      <li><i>气体名称：</i><i>{{formInfo.airName}}</i></li>
      <li><i>气体级别/规格：</i><i>{{formInfo.configName}}</i></li>
      <li><i>气瓶厂家：</i><i>{{formInfo.companyName}}</i></li>
      <li><i>气体组分：</i><i>{{formInfo.airConstituents}}</i></li>
    </div>
    <div class="small_title">申请人信息</div>
    <div class="info" v-if="form.qpTask">
      <li><i>申请人：</i><i>{{form.qpTask.userName}}</i></li>
      <li><i>联系方式：</i><i>{{form.qpTask.phone}}</i></li>
      <li><i>实验室地点：</i><i>{{form.qpTask.location}}</i></li>
      <li v-if="formInfo.storageStatus==1"><i>状态：</i><i>空闲</i></li>
      <li v-if="formInfo.storageStatus==2"><i>状态：</i><i>使用中</i></li>
      <li v-if="formInfo.storageStatus==3"><i>状态：</i><i>已出库</i></li>
    </div>
    <div class="small_title">入库信息</div>
    <div class="addPage_b" v-if="form.bottleStorage">
      <div class="addPage_b_t">
        <li><i>入库时间：</i><i>{{form.bottleStorage.createTime}}</i></li>
        <li><i>检验有效期：</i><i>{{form.bottleStorage.validateStartTime}}-{{form.bottleStorage.validateEndTime}}</i></li>
        <li><i>电子标签：</i><i>{{form.bottleStorage.electronicTag}}</i></li>
        <li><i>验收备注</i><i>{{form.bottleStorage.validateRemark}}</i></li>
      </div>
      <div class="addPage_b_b">
        <el-form :model="form"   :inline="true">
          <el-form-item label="瓶身颜色" prop="name">
            <el-radio-group disabled  v-model="form.bottleStorage.color">
              <el-radio :label="1">灰色</el-radio>
              <el-radio :label="2">白色</el-radio>
              <el-radio :label="3">蓝色</el-radio>
            </el-radio-group>
          </el-form-item>
          <el-form-item label="有无手轮" prop="name">
            <el-radio-group disabled v-model="form.bottleStorage.isHandwheel">
              <el-radio :label="1">有</el-radio>
              <el-radio :label="0">无</el-radio>
            </el-radio-group>
          </el-form-item>
          <el-form-item label="是否固定" prop="name">
            <el-radio-group disabled v-model="form.bottleStorage.isFixed">
              <el-radio :label="1">是</el-radio>
              <el-radio :label="0">否</el-radio>
            </el-radio-group>
          </el-form-item>
          <el-form-item label="电子标签" prop="name">
            <el-radio-group disabled v-model="form.bottleStorage.isElectronicTag">
              <el-radio :label="1">有</el-radio>
              <el-radio :label="0">无</el-radio>
            </el-radio-group>
          </el-form-item>
          <el-form-item label="气瓶状态标牌" prop="name">
            <el-radio-group disabled v-model="form.bottleStorage.isStatusSign">
              <el-radio :label="1">有</el-radio>
              <el-radio :label="0">无</el-radio>
            </el-radio-group>
          </el-form-item>
          <el-form-item label="标牌已拍照" prop="name">
            <el-radio-group disabled v-model="form.bottleStorage.isPhoto">
              <el-radio :label="1">已拍照</el-radio>
              <el-radio :label="0">未拍照</el-radio>
            </el-radio-group>
          </el-form-item>
        </el-form>
      </div>
    </div>
  </div>
</template>
<script>

import { getToken } from "@/utils/auth";
import { enterRecordDetail, } from '@/api/gasManage3_0/index'
let Base64 = require('js-base64').Base64;
export default {
  name: "addPage",
  props:{
    pageData2: {},
  },
  data() {
    return {
      pageType:1,
      uploadImgUrl: this.uploadUrl(), // 上传的图片服务器地址
      headers: {
        Authorization: "Bearer " + getToken(),
      },

      loading:false,
      form:{

      },
      formInfo:{},
      // 查询参数
      queryParams: {
        page: 1,
        pageSize:20,
      },
      total:0,
      tableData:[{
        num:0,
      }],
    };
  },
  created() {

  },
  methods: {
    handleClick(index,row,doType){
      let _this=this;
      if(doType=='again'){//重新申请
        this.$parent.handleClick('','','again');
      }
    },
    /**查看图片  */
    lookFile(item){
      let visitUrl=window.location.href.split('://')[0]+'://'+this.judgmentNetworkReturnAddress()+'/admin/'+item;
      window.open(localStorage.getItem('filePreviewUrl') + '/onlinePreview?url='+encodeURIComponent(Base64.encode(visitUrl)));
    },
    //返回
    backPage(){
      this.$parent.handleClick('','','back');
    },
    /* 详情 */
    getInfo(id){
      let _this=this;
      enterRecordDetail({id:id}).then( response => {
        let res=response.data;
        if(response.code==200){
          _this.form=res;
        }
      });

    },

  },
  mounted() {
    this.formInfo=this.pageData2.item
    this.getInfo(this.pageData2.item.id);
  }

};
</script>

<style scoped lang="scss">
.addPage {
  flex:1;
  display: flex!important;
  flex-direction: column;
  box-shadow: 0 0 8px 2px rgba(0, 0, 0, 0.1);
  border-radius:10px;
  /*顶部*/
  .addPage_title{
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #E0E0E0;
    padding-top:20px;
    p:nth-child(1){
      flex: 1;
      line-height:60px;
      color: #0045AF;
      font-size:18px;
      margin:0 12px 0 20px;
    }
    p:nth-child(2){
      margin-right:20px;
    }
    p:nth-child(3){
      margin-right:20px;
    }
  }
  /*小标题*/
  .small_title{
    font-size: 16px;
    font-family: Microsoft YaHei;
    font-weight: bold;
    color: #333333;
    line-height: 16px;
    margin: 20px 0 0 20px;
  }
  /*基本信息*/
  .info{
    display: flex;
    justify-content: flex-start;
    flex-wrap: wrap;
    height: 130px;
    border: 1px solid #E0E0E0;
    margin: 20px;
    padding: 30px 48px;
    box-sizing: border-box;
    >li{
      list-style-type: none;
      margin-right: 30px;
      >i{
        font-style: normal;
      }
      >i:nth-of-type(1){
        font-size: 16px;
        font-family: Microsoft YaHei;
        font-weight: 400;
        color: #999999;
        line-height: 16px;
      }
      >i:nth-of-type(2){
        font-size: 16px;
        font-family: Microsoft YaHei;
        font-weight: 400;
        color: #333333;
        line-height: 16px;
      }
    }
    .look_img{
      >i:nth-of-type(2){
        color: #0183FA;
      }
    }
  }
  /*入库信息*/
  .addPage_b{
    border: 1px solid #E0E0E0;
    margin: 20px;
    padding: 30px 48px;
    box-sizing: border-box;
    .addPage_b_t{
      display: flex;
      justify-content: flex-start;
      flex-wrap: wrap;
      >li{
        list-style-type: none;
        margin-right: 30px;
        margin-bottom: 12px;
        >i{
          font-style: normal;
        }
        >i:nth-of-type(1){
          font-size: 16px;
          font-family: Microsoft YaHei;
          font-weight: 400;
          color: #999999;
          line-height: 16px;
        }
        >i:nth-of-type(2){
          font-size: 16px;
          font-family: Microsoft YaHei;
          font-weight: 400;
          color: #333333;
          line-height: 16px;
        }
      }
    }
    .addPage_b_b{
      .el-form-item{
        margin-right: 60px;
      }
    }
  }

}
</style>
