<template>
  <div class="home_wrapper">
    <van-nav-bar
      title="合同详情"
      left-arrow
      fixed
      placeholder
      @click-left="onClickLeft"
    />
    <div class="list_main">
      <van-divider>合同信息</van-divider>
      <van-field v-model="form.contractCode" label="合同编号" placeholder="合同编号" input-align="right" :border="false" />
      <van-field v-model="form.contractName" label="合同名称" placeholder="合同名称" input-align="right" :border="false" />
      <van-field v-model="form.contractType" label="合同类别" placeholder="合同类别" input-align="right" :border="false" />
      <van-field v-model="form.firstParty" label="甲方" placeholder="甲方" input-align="right" :border="false" />
      <van-field v-model="form.secondParty" label="乙方" placeholder="乙方" input-align="right" :border="false" />
      <van-field v-model="form.contractMoney" label="合同金额" placeholder="合同金额" input-align="right" :border="false" />
      <van-field v-model="form.contractDate" label="登记日期" placeholder="登记日期" input-align="right" :border="false" />
      <van-field v-model="form.startTime" label="开始日期" placeholder="开始日期" input-align="right" :border="false" />
      <van-field v-model="form.endTime" label="结束日期" placeholder="结束日期" input-align="right" :border="false" />
      <van-field v-model="form.status" label="是否有效" placeholder="是否有效" input-align="right" :border="false" />
      <van-field v-model="form.signingMode" label="签订方式" placeholder="签订方式" input-align="right" :border="false" />
      <van-field v-model="form.signingStatus" label="签订状态" placeholder="签订状态" input-align="right" :border="false" />
      <van-field v-model="form.contractRemark" label="合同备注" placeholder="合同备注" input-align="right" :border="false" />

      <van-divider>甲方信息</van-divider>
      <van-field v-model="form.firstIsSign" label="甲方已签" placeholder="甲方已签" input-align="right" :border="false" />
      <van-field v-model="form.firstPartyAt" label="甲方签字日期" placeholder="甲方签字日期" input-align="right" :border="false" />
      <van-field label="甲方签字" input-align="right" :border="false" />
      <img :src="'/api'+form.firstSigning" width="100%" alt="" v-if="form.firstSigning">
      <van-field label="村级公章" input-align="right" :border="false" />
      <img :src="'/api'+form.firstSeal" width="100%" alt="" v-if="form.firstSeal">

      <van-divider>乙方信息</van-divider>
      <van-field v-model="form.secondIsSign" label="乙方已签" placeholder="乙方已签" input-align="right" :border="false" />
      <van-field v-model="form.secondPartyAt" label="乙方签字日期" placeholder="乙方签字日期" input-align="right" :border="false" />
      <van-field label="乙方签字" input-align="right" :border="false" />
      <img :src="'/api'+form.secondSigning" width="100%" alt="" v-if="form.secondSigning" >
    </div>
  </div>
</template>

<script>
  import { contractGet } from "@/api/sunVillage_info/fixedAssets";
  import Cookies from "js-cookie";
  export default {
    name: "certificateList",
    data() {
      return {
        showBuildTime:false,
        form:{

        },
        openPic:[],
        fileList:[],
        fileList1:[],
        openNy:new Date(),
        type:'',
        openFile:[],
        openFileList:[],
        queryParams:{
          bookId:'',
          deptId:''
        },
        openFile2:[],
        openPic2:[],
      };
    },
    created() {
      this.houseGetDicts("asset_status").then((response) => {
        this.assetStatusOptions = response.data;
      });
      this.houseGetDicts("asset_type").then((response) => {
        this.assetTypeOptions = response.data;
      });
      this.houseGetDicts("use_type").then((response) => {
        this.useTypeOptions = response.data;
      });
      this.type = this.$route.query.type;
      this.queryParams.bookId = Cookies.get('bookId');
      this.queryParams.deptId = Cookies.get('deptId');
      this.getDetail();
    },
    methods: {
      getDetail(){
        let query = {
          translate_dict:1
        }
        contractGet(query,this.$route.query.id).then((res) => {
          if (res.code == 200){
            this.form = res.data;
          }
        })
      },

    },
  }
</script>

<style scoped lang="scss">
  /deep/ .van-button--primary{
    background: url("../../../assets/images/sunVillage_info/btn_bg.png") no-repeat;
    background-size: 100% 100%;
    border: none;
  }
  .home_wrapper{
    background: #e9e9e9;
    min-height: 100vh;
    width: 100vw;
    .header_main {
      height: 116px;
      background: url('../../../assets/images/sunVillage_info/list_head.png') no-repeat;
      background-size: 100% 100%;
      position: fixed;
      top: 0;
      left: 0;
      width: 100%;
      font-size: 36px;
      line-height: 116px;
      text-align: center;
      color: #fff;
      position: relative;

      .return_btn {
        width: 24px;
        height: 43.2px;
        background: url('../../../assets/images/sunVillage_info/list_icon_5.png') center center no-repeat;
        background-size: 20px 36px;
        position: absolute;
        left: 38px;
        top: 36px;
      }
    }
    .release_head{
      height: 90px;
      padding:0 23px;
      display: flex;
      align-items: center;
      font-size: 26px;
      color: #929292;
      .people{
        flex: 1;
        display: flex;
        align-items: center;
        .icon{
          width: 24px;
          height: 21px;
          background: url('../../../assets/images/sunVillage_info/details_icon_1.png') no-repeat;
          background-size: 100% 100%;
          display: block;
          margin-right: 8px;
        }
      }
      .time{
        flex: 1;
        display: flex;
        align-items: center;
        justify-content:flex-end;
        .icon{
          width: 25px;
          height: 25px;
          background: url('../../../assets/images/sunVillage_info/details_icon_2.png') no-repeat;
          background-size: 100% 100%;
          display: block;
          margin-right: 8px;
        }
      }
    }
    .release_conetnt{
      padding:0 22px;
      font-size: 32px;
      color: #252525;
      line-height: 44px;
      img{
        max-width: 100%;
        margin-bottom: 16px;
      }
      p{
        margin-bottom: 16px;
      }
    }
    .list_main{
      padding:25px;
      background: #ffffff;
      width: 94%;
      margin: 25px auto 0;
      border-radius: 15PX;
      box-shadow: 4px 6px 5px rgba(63, 68, 75, 0.1);
    }
    .titBox{
      display: flex;
      align-items: center;
    }
    .tit{
      font-size: 36px;
      font-weight: bold;
    }
    /deep/ .van-cell{
      padding-left: 0!important;
      padding-right: 0!important;
      padding-bottom: 0!important;
    }
    /deep/ .van-field__label{
      /*padding-left: 10PX;*/
      width: auto;
      display: flex;
      align-items: center;
    }
    /deep/ .van-cell--required::before{
      left: 85PX;
    }
    /deep/ .van-field__error-message{
      display: none;
    }
  }
</style>
