 <template>
     <div class="home_wrapper">
         <div class="header_main">
             新增合同信息
             <div class="return_btn" @click="onClickLeft"></div>
         </div>
       <van-form @submit="onSubmit">
         <div class="list_main">
           <div class="titBox">
             <img src="../../assets/images/sunVillage_info/add_icon_1.png" style="width:22PX;height:22PX;margin-right: 10px;"/>
             <p class="tit">合同信息</p>
           </div>
           <van-field required v-model="form.code" label="合同编码" p        laceholder="合同编码" input-align="right" :border="false" />
           <van-field required v-model="form.name" label="合同名称" placeholder="合同名称" input-align="right" :border="false" />
           <van-field v-model="form.assetType" label="合同类型" placeholder="合同类型" input-align="right" is-link :border="false" />
           <van-field required v-model="form.contractionSource" label="合同来源" placeholder="合同来源" input-align="right" is-link :border="false" />
           <van-field required v-model="form.firstParty" label="甲方名称" placeholder="甲方名称" input-align="right" is-link :border="false" />
           <van-field v-model="form.firstPartyDirector" label="甲方代表" placeholder="甲方代表" input-align="right" :border="false" />
           <van-field v-model="form.firstPartyPhone" label="甲方电话" placeholder="甲方电话" input-align="right" :border="false" />
           <van-field required v-model="form.secondParty" label="乙方名称" placeholder="乙方名称" input-align="right" :border="false" />
           <van-field v-model="form.secondPartyDirector" label="乙方代表" placeholder="乙方代表" input-align="right" :border="false" />
           <van-field v-model="form.secondPartyPhone" label="乙方电话" placeholder="乙方电话" input-align="right" :border="false" />
           <van-field required v-model="form.collectionPay" label="收付款类型" placeholder="收付款类型" input-align="right" :border="false" />
           <van-field required v-model="form.settleType" label="结款方式" placeholder="结款方式" input-align="right" :border="false" />
           <van-field required v-model="form.totalAmount" label="合同金额(元)" placeholder="合同金额(元)" input-align="right" :border="false" />
           <van-field v-model="form.num" label="数量/面积" placeholder="数量/面积" input-align="right" :border="false" />
           <van-field v-model="form.unit" label="计量单位" placeholder="计量单位" input-align="right" :border="false" />
           <van-field required v-model="form.price" label="单价(元)" placeholder="单价(元)" input-align="right" :border="false" />
           <van-field required v-model="form.receivedAmount" label="已结款(元)" placeholder="已结款(元)" input-align="right" :border="false" />
           <van-field v-model="form.settledAmount" label="下次结款(元)" placeholder="下次结款(元)" input-align="right" :border="false" />
           <van-field required v-model="form.buildingTime" label="签订日期" placeholder="签订日期" input-align="right" :border="false" />
           <van-field required v-model="form.startTime" label="开始日期" placeholder="开始日期" input-align="right" :border="false" />
           <van-field required v-model="form.endTime" label="结束日期" placeholder="结束日期" input-align="right" :border="false" />
           <van-field required v-model="form.contractionStatus" label="合同状态" placeholder="合同状态" input-align="right" :border="false" />
           <van-field v-model="form.remark" label="备注" placeholder="备注" input-align="right" :border="false" />
         </div>

         <div class="list_main">
           <div class="titBox">
             <img src="../../assets/images/sunVillage_info/add_icon_2.png" style="width:22PX;height:22PX;margin-right: 10px;"/>
             <p class="tit">招标信息</p>
           </div>
           <van-field required v-model="form.biddingWay" label="招标方式" placeholder="招标方式" input-align="right" :border="false" />
           <van-field v-model="form.itemId" label="项目编号" placeholder="项目编号" input-align="right" />
           <van-field required v-model="form.itemName" label="项目名称" placeholder="项目名称" input-align="right" is-link :border="false" />
           <van-field required v-model="form.handleName" label="经办人" placeholder="经办人" input-align="right" is-link :border="false" />
           <van-field required v-model="form.budget" label="预算金额(元)" placeholder="预算金额(元)" input-align="right" is-link :border="false" />
           <van-field v-model="form.biddingDate" label="招标日期" placeholder="招标日期" input-align="right" :border="false" />
           <van-field v-model="form.biddingType" label="招标类型" placeholder="招标类型" input-align="right" :border="false" />
           <van-field v-model="form.winBiddingCompany" label="中标单位" placeholder="中标单位" input-align="right" :border="false" />
           <van-field v-model="form.winBiddingPrice" label="中标金额(元)" placeholder="中标金额(元)" input-align="right" :border="false" />
           <van-field v-model="form.reviewer" label="审核人" placeholder="审核人" input-align="right" :border="false" />
           <van-field v-model="form.reviewTime" label="审核时间" placeholder="审核时间" input-align="right" :border="false" />
         </div>

         <div style="margin: 16px;">
           <van-button round block type="primary" native-type="submit">
             提交
           </van-button>
         </div>
       </van-form>
     </div>
 </template>
 <script>
   import { permanentList } from "@/api/sunVillage_info/fixedAssets";
   export default {
     name: "certificateList",
     data() {
       return {
         applicationList:[],
         applicationListSecond:[],
         assetStatusOptions:[],
         auditStatus:[],
         loading: false,
         finished: false,
         listLength:'0',
         searchInput:'',
         form:{},
         queryParams:{
           pageNum:1,
           pageSize:10,
           orderByColumn:'createTime',
           isAsc:'desc',
           name:'',
         }
       };
     },
     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;
       });
     },
     methods: {
       getList(){
         setTimeout(() => {
           permanentList(this.queryParams).then(response => {
             this.listLength = response.total;
             for (var i = 0; i < response.rows.length; i++) {
               response.rows[i].assetStatus = this.selectDictLabel(this.assetStatusOptions, response.rows[i].assetStatus);
               response.rows[i].assetType = this.selectDictLabel(this.assetTypeOptions, response.rows[i].assetType);
               response.rows[i].useType = this.selectDictLabel(this.useTypeOptions, response.rows[i].useType);
               response.rows[i].originalValue = Number(response.rows[i].originalValue ).toFixed(2).replace(/(\d)(?=(\d{3})+\.)/g, ($0, $1) => { return $1 + ","; }).replace(/\.$/, "")
               this.applicationList.push(response.rows[i]);
               this.applicationListSecond.push(response.rows[i]);
             }
             if(this.applicationList.length >= response.total){
               this.finished = true;
               return;
             }else{
               this.loading = false;
               this.queryParams.pageNum += 1 ;
             }
           });
         }, 1000);
       },
       getSearchList(){
         this.loading = true;
         if(this.applicationListSecond.length>0&&this.queryParams.name!=""){
           let newList = []
           for(let j = 0 ;j<this.applicationListSecond.length;j++){
             if(this.applicationListSecond[j].name.indexOf(this.queryParams.name)>-1){
               newList.push(this.applicationListSecond[j]);
             }
           }
           this.applicationList = newList
         }
         if(this.queryParams.name==""){
           this.applicationList = this.applicationListSecond;
         }
         this.loading = false;
       },
       onSubmit(){}
     },
   }
 </script>
 <style scoped lang="scss">
  .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;
        }

        .add_btn {
            width: 56.4px;
            height: 40.8px;
            background: url('../../assets/images/sunVillage_info/list_icon_9.png') center center no-repeat;
            background-size: 47px 34px;
            position: absolute;
            right: 38px;
            top: 36px;
        }
    }
    .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: 8.2em;
    }
    /deep/ .van-cell--required::before{
      left: 0;
    }

}







 </style>
