<template>
  <div class="sign_box">

    <el-form label-position="right" ref="form" :rules="rules" :model="form" label-width="80px">
      <el-row :gutter="10" class="mb8 roiyy">
        <el-col :span="1.5" v-if="setrd % 2 == 1">
          <el-button type="primary" v-hasPermi="['bmProject:project:examine']" @click="submitForm">提交</el-button>
          <!-- upBtn -->
        </el-col>
       <!-- <el-col :span="1.5" v-if="setrd % 2 == 1">
          <el-button type="primary" v-hasPermi="['bmProject:project:add']" @click="submitForm">暂存</el-button>
        </el-col> -->
        <el-col :span="1.5">
          <el-button type="primary" @click="goBtn">取消</el-button>
        </el-col>
        <el-col :span="1.5" :offset="16" v-if="setrd % 2 == 1&&setrd>2">
          <el-button
            type="danger"
            @click="backProBtn"
            v-hasPermi="['bmProject:project:back']"
            >撤销审核</el-button
          >
        </el-col>
        <el-col :span="1.5" :offset="18" v-if="setrd % 2 == 0">
          <el-button type="danger"
		   style="background: #00B034;color: #FFF;border: none;"
		   @click="applyBtn" v-hasPermi="['bmProject:project:pass']">审核</el-button>
          <el-button type="danger"
           style="background: #3FBCEF;color: #FFF;border: none;"
           @click="backBtn" v-hasPermi="['bmProject:project:reject']">驳回</el-button>
        </el-col>
        <!-- <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar> -->
      </el-row>
      <div class="sign_tit">项目签约信息</div>
      <el-row>
        <el-form-item label-width="120px"  label="项目名称:" class="elItem" prop="overseasInvestment">
          <el-col :span="18">
            <el-input type="number" :disabled="dis_flag" placeholder="请输入总投资额度" v-model="form.overseasInvestment"></el-input>
          </el-col>
          <div class="dw_name">(填写新注册企业名称+已办项目)</div>
        </el-form-item>

      </el-row>
      <el-row>
        <el-col :span="24">
          <el-form-item label-width="120px" label="投资方式:" class="elItem" prop="investmentType">
            <el-col :span="24">
              <el-radio-group v-model="form.investmentType" :disabled="dis_flag" style="width: 100%">
                <el-col :span="12">
                  <el-radio label="1">独资</el-radio>
                </el-col>
                <el-col :span="12">
                  <el-radio label="2">合资</el-radio>
                </el-col>
              </el-radio-group>
            </el-col>
          </el-form-item>
        </el-col>
        <el-col :span="10">
          <el-form-item label-width="120px" label="建设方式:" class="elItem" prop="isOutInvestment">
            <!-- <el-col :span="6"> -->
              <!-- <el-checkbox-group v-model="form.isOutInvestment" :disabled="dis_flag"> -->
				  <el-radio-group v-model="form.isOutInvestment" :disabled="dis_flag" style="width: 100%">
				    <el-col :span="6">
				      <el-radio label="1">是</el-radio>
				    </el-col>
				    <el-col :span="6">
				      <el-radio label="2">否</el-radio>
				    </el-col>
            <el-col :span="6">
              <el-radio label="2">否</el-radio>
            </el-col>
            <el-col :span="6">
              <el-radio label="2">否</el-radio>
            </el-col>
				  </el-radio-group>
          </el-form-item>
        </el-col>
        <el-col :span="6">
          <el-form-item label="是否宜商:" class="elItem" prop="isOutInvestment">
            <!-- <el-col :span="6"> -->
              <!-- <el-checkbox-group v-model="form.isOutInvestment" :disabled="dis_flag"> -->
          <el-radio-group v-model="form.isOutInvestment" :disabled="dis_flag" style="width: 100%">
            <el-col :span="12">
              <el-radio label="1">是</el-radio>
            </el-col>
            <el-col :span="12">
              <el-radio label="2">否</el-radio>
            </el-col>
          </el-radio-group>
          </el-form-item>
        </el-col>
      </el-row>
      <el-row>
        <el-col :span="9">
        <el-form-item label-width="120px" label="签约日期:" class="elItem" prop="orderDate">
            <el-date-picker value-format="yyyy-MM-dd" :disabled="dis_flag" type="date" placeholder="请选择签约日期" v-model="form.orderDate" style="width: 100%"></el-date-picker>
          <div class="dw_name dw_names">实际合同签订日期</div>
        </el-form-item>
         </el-col>
         <el-col :span="9">
        <el-form-item label-width="100px" label="通报日期:" class="elItem" prop="orderDate">
               <el-date-picker value-format="yyyy-MM-dd" :disabled="dis_flag" type="date" placeholder="请选择通报日期" v-model="form.orderDate" style="width: 100%"></el-date-picker>
          <div class="dw_name dw_names">项目上报月份</div>
        </el-form-item>
        </el-col>
      </el-row>
      <el-row>
        <el-col :span="24">
          <el-form-item label-width="120px" label="协议投资额:" class="elItem" prop="totInvestment">
            <el-col :span="7" style="margin-right:100px;">
              <el-select :disabled="dis_flag" v-model="queryParams.field108" placeholder="请选择" clearable :style="{width: '100%'}">
                <el-option v-for="(item, index) in field107Options" :key="index" :label="item.label"
                  :value="item.value" :disabled="item.disabled"></el-option>
              </el-select>
              </el-col>
            <el-col :span="7">
              <el-input type="number" :disabled="dis_flag" placeholder="请输入协议投资额" v-model="form.totInvestment"></el-input>
            </el-col>


            <div class="dw_name">万元</div>
          </el-form-item>
        </el-col>
      </el-row>
      <el-row>
        <el-col :span="10">
          <el-form-item label-width="182px" label="境固定资产投资额:" class="elItem" prop="overseasInvestment">
            <el-col :span="18">
              <el-input type="number" :disabled="dis_flag" placeholder="请输入总投资额度" v-model="form.overseasInvestment"></el-input>
            </el-col>
            <div class="dw_name">万元</div>
          </el-form-item>
          <el-form-item label-width="182px" label="市外资金:" class="elItem" prop="jnswInvestm" :rules="[
      { required: true, message: '请输入境内省外投资', trigger: 'blur' }]">
            <el-col :span="18">
              <el-input type="number" :disabled="dis_flag" placeholder="请输入境内省外投资额度" v-model="form.jnswInvestm" ></el-input>
            </el-col>
            <div class="dw_name">万元</div>
          </el-form-item>
          <el-form-item label-width="182px" label="签约跟进人手机号:" class="elItem" prop="snswInvestm":rules="[{ required: true, message: '请输入省内市外投资', trigger: 'blur' }]">
            <el-col :span="18">
              <el-input type="number" :disabled="dis_flag" placeholder="请输入省内市外投资额度" v-model="form.snswInvestm"></el-input>
            </el-col>
            <div class="dw_name">万元</div>
          </el-form-item>
          <el-form-item label-width="182px" label="项目所在地(园区或乡镇):" class="elItem" prop="snxwInvestm" :rules="[{ required: true, message: '请输入市内县外投资', trigger: 'blur' }]">
            <el-col :span="18">
              <el-input type="number" :disabled="dis_flag" placeholder="请输入市内县外投资额度" v-model="form.snxwInvestm"></el-input>
            </el-col>
            <div class="dw_name"></div>
          </el-form-item>
          <el-form-item label-width="182px" label="所属行业:" class="elItem" prop="xnInvestm" :rules="[{ required: true, message: '请输入县内投资', trigger: 'blur' }]">
            <el-col :span="18">
              <el-select style="width: 100%;" v-model="form.isIndependentLan" :disabled="dis_flag" placeholder="请选择">
                <el-option label="是" value="Y"></el-option>
                <el-option label="否" value="N"></el-option>
              </el-select>
            </el-col>
          </el-form-item>
        </el-col>
      </el-row>
      <el-row>
        <el-col :span="8">
          <el-form-item label-width="121px" label="是否独立供地:" class="elItem" prop="isIndependentLan">
            <el-col :span="24">
              <el-select style="width: 100%;" v-model="form.isIndependentLan" :disabled="dis_flag" placeholder="请选择">
                <el-option label="是" value="Y"></el-option>
                <el-option label="否" value="N"></el-option>
              </el-select>
            </el-col>
          </el-form-item>
        </el-col>
        <el-col :span="8">
          <el-form-item label-width="121px" label="用地面积:" class="elItem" prop="landArea">
            <el-col :span="20">
              <el-input placeholder="请输入用地面积" :disabled="dis_flag" v-model="form.landArea"></el-input>
            </el-col>
            <div class="dw_name">亩</div>
          </el-form-item>
        </el-col>
        <el-col :span="8">
          <el-form-item label-width="121px" label="建设内容:" class="elItem" prop="landAddress">
            <el-input placeholder="请输入建设内容" :disabled="dis_flag" v-model="form.landAddress"></el-input>
          </el-form-item>
        </el-col>
        <el-col :span="24">
          <el-form-item label-width="121px" label="用地位置:" class="elItem" prop="landAddress">
            <el-input placeholder="请输入用地位置" :disabled="dis_flag" v-model="form.landAddress"></el-input>
          </el-form-item>
        </el-col>
      </el-row>
	  <el-row>
		 <!-- <el-col :span="24">
		    <el-form-item label-width="121px" label="土地证:" class="elItem" prop="landPhoto">
		      <el-upload class="upload-demo" :before-upload= "beforeAvatarUpload"  :disabled="dis_flag" :file-list="fileListTdz" :on-remove="resetPhoto" :on-success="upl_fn" :on-preview="handlePreview" :action="defaultSettings.urls + process + '/common/upload'">
		        <el-button size="small" type="primary">点击上传</el-button>
            <div slot="tip" class="el-upload__tip">只能上传word/pdf格式，大小不超过10M(土地证须盖章)</div>
		      </el-upload>
		    </el-form-item>
		  </el-col> -->
	  </el-row>
      <!-- <el-row>
        <el-col :span="12">
          <el-form-item label-width="121px" label="流转土地面积:" class="elItem" prop="circulationLand">
            <el-col :span="18">
              <el-input placeholder="请输入" :disabled="dis_flag" v-model="form.circulationLand"></el-input>
            </el-col>
            <div class="dw_name">亩</div>
          </el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item label-width="121px" label="流转土地位置:" class="elItem" prop="circulationAddres">
            <el-input placeholder="请输入流转土地位置" :disabled="dis_flag" v-model="form.circulationAddres"></el-input>
          </el-form-item>
        </el-col>
        </el-row> -->
        <!-- <el-row>
        <el-col :span="12">
          <el-form-item label-width="121px" label="土地流转合同:" class="elItem" prop="circulationDoc">
            <el-upload :before-upload= "beforeAvatarUpload" :disabled="dis_flag" class="upload-demo" :on-preview="handlePreview" :on-remove="resetPhoto1" :file-list="fileListTdls" :on-success="upl_fn_lzht" :action="defaultSettings.urls+process+'/common/upload'">
              <el-button size="small" type="primary">点击上传</el-button>
              <div slot="tip" class="el-upload__tip">只能上传word/pdf格式，大小不超过10M(合同须盖章)</div>
            </el-upload>
          </el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item label-width="121px" label="产权证:" class="elItem" prop="circulationPhoto">
            <el-upload :before-upload= "beforeAvatarUpload" :disabled="dis_flag" class="upload-demo"  :on-remove="resetPhoto2" :file-list="fileListCqz" :on-success="upl_fn_cqz" :on-preview="handlePreview" :action="defaultSettings.urls + process + '/common/upload'">
              <el-button size="small" type="primary">点击上传</el-button>
              <div slot="tip" class="el-upload__tip">只能上传word/pdf格式，大小不超过10M(产权证须盖章)</div>
            </el-upload>
          </el-form-item>
        </el-col>
      </el-row> -->



      <el-row style="margin-left: -10px">
        <el-col :span="8">
          <el-form-item label-width="141px" label="拟开工时间:" class="elItem" prop="agreementStartdate">
            <el-col :span="18">
              <el-date-picker :disabled="dis_flag" value-format="yyyy-MM-dd" type="date" placeholder="请选择开工时间" v-model="form.agreementStartdate"
                style="width: 100%"></el-date-picker>
            </el-col>
          </el-form-item>
        </el-col>
        <el-col :span="8">
          <el-form-item label-width="141px" label="立项日期:" class="elItem" prop="agreementEnddate">
            <el-col :span="18">
              <el-date-picker :disabled="dis_flag" value-format="yyyy-MM-dd" type="date" placeholder="请选择竣工时间" v-model="form.agreementEnddate"
                style="width: 100%"></el-date-picker>
            </el-col>
          </el-form-item>
        </el-col>
      </el-row>
      <el-row>
        <el-form-item label-width="121px" label="合同签约方:" class="elItem" prop="je">
        </el-form-item>
      </el-row>
      <el-row>
        <el-col :span="6">
          <el-form-item label-width="121px" label="对方:" class="elItem" prop="agreementPartner">
            <el-input placeholder="请输入对方" :disabled="dis_flag" v-model="form.agreementPartner"></el-input>
          </el-form-item>
        </el-col>
        <el-col :span="6">
          <el-form-item label-width="121px" label="签约人:" class="elItem" prop="partner">
            <el-input placeholder="请输入签约人" :disabled="dis_flag" v-model="form.partner"></el-input>
          </el-form-item>
        </el-col>
		<el-col :span="6">
		  <el-form-item label-width="121px" label="职务:" class="elItem" prop="partnerJob">
		    <el-input placeholder="请输入职务" :disabled="dis_flag" v-model="form.partnerJob"></el-input>
		  </el-form-item>
		</el-col>
      </el-row>
      <el-row>
        <el-col :span="6">
          <el-form-item label-width="121px" label="我方:" class="elItem" prop="agreementUs">
            <el-input placeholder="请输入我方" :disabled="dis_flag" v-model="form.agreementUs"></el-input>
          </el-form-item>
        </el-col>
        <el-col :span="6">
          <el-form-item label-width="121px" label="签约人:" class="elItem" prop="signUs">
            <el-input placeholder="请输入签约人" :disabled="dis_flag" v-model="form.signUs"></el-input>
          </el-form-item>
        </el-col>
		<el-col :span="6">
		  <el-form-item label-width="121px" label="职务:" class="elItem" prop="usJob">
		    <el-input placeholder="请输入职务" :disabled="dis_flag" v-model="form.usJob"></el-input>
		  </el-form-item>
		</el-col>
      </el-row>
      <!-- <el-row>
        <el-col :span="6">
          <el-form-item label-width="121px" label="第三方:" class="elItem" prop="agreementThird">
            <el-input placeholder="请输入第三方" :disabled="dis_flag" v-model="form.agreementThird"></el-input>
          </el-form-item>
        </el-col>
        <el-col :span="6">
          <el-form-item label-width="121px" label="签约人:" class="elItem" prop="third">
            <el-input placeholder="请输入签约人" :disabled="dis_flag" v-model="form.third"></el-input>
          </el-form-item>
        </el-col>
		<el-col :span="6">
		  <el-form-item label-width="121px" label="职务:" class="elItem" prop="thirdJob">
		    <el-input placeholder="请输入职务" :disabled="dis_flag" v-model="form.thirdJob"></el-input>
		  </el-form-item>
		</el-col>
      </el-row> -->
      <!-- <el-row>
        <el-col :span="18">
          <el-form-item label-width="121px" label="合同文本:" class="elItem" prop="agreementUrl">
            <el-upload class="upload-demo" :disabled="dis_flag" ref="upload"   :file-list="flieListHt" :action="defaultSettings.urls + process + '/common/upload'" :on-preview="handlePreview"
              :on-success="up_loat_htwb" :on-remove="handleRemove" :auto-upload="false" :before-upload= "beforeAvatarUpload">
              <el-button slot="trigger" size="small" type="primary">选择文件</el-button>
              <el-button style="margin-left: 10px" size="small" type="success" @click="submitUpload">开始上传</el-button>
              <div slot="tip" class="el-upload__tip">只能上传word/pdf格式，大小不超过10M(合同须盖章)</div>
            </el-upload>
          </el-form-item>
        </el-col>
      </el-row> -->
      <div class="sign_tit">企业注册信息</div>
      <el-row>
        <el-col :span="8">
          <el-form-item label-width="141px" label="在潜注册公司名称:" class="elItem" prop="name">
            <!-- <el-input :disabled="dis_flag" placeholder="请输入在潜注册公司名称" v-model="form.name"></el-input> -->
            <el-autocomplete
              v-model="form.name"
              :fetch-suggestions="querySearchAsync"
              placeholder="请输入在潜注册公司名称"
              @select="handleSelecthuey"
              :trigger-on-focus="false"
              style="width: 100%;"
              :disabled="dis_flag"
            ></el-autocomplete>
          </el-form-item>
        </el-col>
        <el-col :span="8">
          <el-form-item label-width="109px" label="法定代表人:" class="elItem" prop="legalRep">
            <el-input :disabled="dis_flag" placeholder="请输入法定代表人" v-model="form.legalRep"></el-input>
          </el-form-item>
        </el-col>
      </el-row>
      <el-row>
        <el-col :span="8">
          <el-form-item label-width="141px" label="注册资本金(万元):" class="elItem" prop="totMoney">
            <el-input :disabled="dis_flag" placeholder="请输入注册资本金" v-model="form.totMoney"></el-input>
          </el-form-item>
        </el-col>
        <el-col :span="8">
          <el-form-item label-width="109px" label="注册地址:" class="elItem" prop="address">
            <el-input :disabled="dis_flag" placeholder="请输入注册地址" v-model="form.address"></el-input>
          </el-form-item>
        </el-col>
      </el-row>
      <el-row>
        <el-col :span="8">
          <el-form-item label-width="141px" label="统一社会信用代码:" class="elItem" prop="code">
            <el-input :disabled="dis_flag" placeholder="请输入社会信用代码" v-model="form.code"></el-input>
          </el-form-item>
        </el-col>
        <el-col :span="8">
          <el-form-item label-width="109px" label="经营范围:" class="elItem" prop="bussinessUrl">
             <el-input :disabled="dis_flag" placeholder="请输入社会信用代码" v-model="form.code"></el-input>
          </el-form-item>
        </el-col>
        <!-- <el-col :span="8">
          <el-form-item label-width="173px" label="营业执照复印件:" class="elItem" prop="bussinessUrl">
            <el-upload :before-upload= "beforeAvatarUpload" :disabled="dis_flag" class="upload-demo" :on-remove='resetPhoto5'  list-type="picture-card" :on-preview="handlePreview" :file-list="flieListYzz" :on-success="upl_fn_zzfyj" :action="defaultSettings.urls + process + '/common/upload'">
              <el-button size="small" type="primary">点击上传</el-button>
			  <div slot="tip" class="el-upload__tip">
			    只能上传jpg/png文件，且不超过500kb
			  </div>
            </el-upload>
          </el-form-item>
        </el-col> -->
      </el-row>
      <!-- <div class="sign_tit" >企业股东构成  <span style="color: red;">(*以下自然人和企业股东二选一必填)</span></div>
      <el-row>
        <div class="ads_box" @click="addshareBtn" v-hasPermi="['projectPersion:persion:add']">
          <img src="../../assets/images/icon_add@2x.png" alt="" class="add_icon" />
          <span >添加自然人</span>
        </div>
      </el-row>
      <el-row>
        <el-table v-loading="loading" class="elItem" :data="shareholderList">
          <el-table-column label="姓名" align="center" prop="name" />
          <el-table-column label="股权比例" align="center" prop="equityRatio" :show-overflow-tooltip="true">
            <template slot-scope="scope">
              <span>{{ scope.row.equityRatio }}%</span>
            </template>
          </el-table-column>
          <el-table-column label="身份证号码" align="center" prop="idcard" :show-overflow-tooltip="true" />
          <el-table-column label="身份证(正面)" align="center" prop="idcardFront">
            <template slot-scope="scope">
              <img @click="imgBtn(scope.row.idcardFront)" :src="scope.row.idcardFront" alt="" class="imgs" />
            </template>
          </el-table-column>
          <el-table-column label="身份证(反面)" align="center" prop="idcardBack">
            <template slot-scope="scope">
              <img @click="imgBtn(scope.row.idcardBack)" :src="scope.row.idcardBack" alt="" class="imgs" />
            </template>
          </el-table-column>
          <el-table-column label="操作" align="center">
            <template slot-scope="scope">
              <el-button size="mini" :disabled="dis_flag" type="warning" @click="handleUpdate(scope.row)" v-hasPermi="['projectPersion:persion:edit']">修改</el-button>
              <el-button size="mini":disabled="dis_flag" type="danger" @click="handleDelete(scope.row.id)" v-hasPermi="['projectPersion:persion:remove']">删除</el-button>
            </template>
          </el-table-column>
        </el-table>
        <pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNum" :limit.sync="queryParams.pageSize"
          @pagination="getShareholderList" />
      </el-row>
	  <el-row>
	    <div class="ads_box" @click="addshareBtnde" v-hasPermi="['projectInvestor:investor:add']">
	      <img src="../../assets/images/icon_add@2x.png" alt="" class="add_icon" />
	      <span>添加企业股东</span>

	    </div>
	  </el-row> -->
	  <!-- <el-row>
	    <el-table v-loading="loading" class="elItem" :data="shareholderLists">
	      <el-table-column label="企业名称" align="center" prop="companyName" />
	      <el-table-column label="股权比例" align="center" prop="equityRatio" :show-overflow-tooltip="true">
	        <template slot-scope="scope">
	          <span>{{ scope.row.equityRatio }}%</span>
	        </template>
	      </el-table-column>
	      <el-table-column label="企业统一社会信息代码" align="center" prop="companyCode" :show-overflow-tooltip="true" />
	      <el-table-column label="企业股东营业执照" align="center" prop="businessPhoto">
	        <template slot-scope="scope">
	          <img @click="imgBtn(scope.row.businessPhoto)" :src="scope.row.businessPhoto" alt="" class="imgs" />
	        </template>
	      </el-table-column>
	      <el-table-column label="操作" align="center">
	        <template slot-scope="scope">
	          <el-button size="mini" :disabled="dis_flag" type="warning" @click="handleUpdates(scope.row)" v-hasPermi="['projectInvestor:investor:edit']">修改</el-button>
	          <el-button size="mini":disabled="dis_flag" type="danger" @click="handleDeletes(scope.row.id)" v-hasPermi="['projectInvestor:investor:remove']">删除</el-button>
	        </template>
	      </el-table-column>
	    </el-table>
	    <pagination v-show="total > 0" :total="totals" :page.sync="queryParams.pageNum" :limit.sync="queryParams.pageSize"
	      @pagination="getShareholderListss" />
	  </el-row> -->
      <!-- <div class="sign_tit">企业备案信息</div>
      <el-row> -->
        <!-- <el-col :span="8">
          <el-form-item label-width="121px" label="备案单位:" class="elItem" prop="recordName">
            <el-input placeholder="请输入备案单位" :disabled="dis_flag" v-model="form.recordName"></el-input>
          </el-form-item>
        </el-col> -->
        <!-- <el-col :span="6">
          <el-form-item label-width="109px" label="备案文号:" class="elItem" prop="recordCode">
            <el-input placeholder="请输入备案文号" :disabled="dis_flag" v-model="form.recordCode"></el-input>
          </el-form-item>
        </el-col>
      </el-row>
      <el-row>
        <el-col :span="8">
          <el-form-item label-width="121px" label="备案总投资额:" class="elItem" prop="recordTot">
            <el-col :span="18">
              <el-input placeholder="请输入备案总投资额" :disabled="dis_flag" v-model="form.recordTot"></el-input>
            </el-col>
            <div class="dw_name">万元</div>
          </el-form-item>
        </el-col>
        <el-col :span="6">
          <el-form-item label-width="139px" label="备案建设周期:" class="elItem" prop="recordTime">
            <el-input placeholder="请输入备案建设周期" :disabled="dis_flag" v-model="form.recordTime"></el-input>
          </el-form-item>
        </el-col>
      </el-row>
      <el-row>
        <el-col :span="18">
          <el-form-item label-width="121px" label="备案表:" class="elItem" prop="recordUrl">
            <el-upload class="upload-demo" :disabled="dis_flag" ref="bAupload" :before-upload="beforeAvatarUpload" :file-list="flieListBa" :action="defaultSettings.urls + process + '/common/upload'" :on-preview="handlePreview"
              :on-success="up_loat_bab" :on-remove="handleRemove_bab" :auto-upload="false">
              <el-button slot="trigger" size="small" type="primary">选择文件</el-button>
              <el-button style="margin-left: 10px" size="small" type="success" @click="submitUpload_bab">开始上传</el-button>
              <div slot="tip" class="el-upload__tip">只能上传word/pdf格式，大小不超过10M</div>
            </el-upload>
          </el-form-item>
        </el-col>
      </el-row>
      <div class="sign_tit">企业包保服务</div>
      <el-row>
        <el-col :span="8">
          <el-form-item label-width="122px" label="联系领导:" class="elItem" prop="contactLeader">
            <el-input placeholder="请输入联系领导" :disabled="dis_flag" v-model="form.contactLeader"></el-input>
          </el-form-item>
        </el-col>
        <el-col :span="6">
          <el-form-item label-width="98px" label="联系方式:" class="elItem" prop="contactPhone">
            <el-input placeholder="请输入联系方式" :disabled="dis_flag" v-model="form.contactPhone"></el-input>
          </el-form-item>
        </el-col>
      </el-row>
      <el-row>
        <el-col :span="8">
          <el-form-item label-width="122px" label="责任单位:" class="elItem" prop="contactCompany">
            <el-input placeholder="请输入责任单位" :disabled="dis_flag" v-model="form.contactCompany"></el-input>
          </el-form-item>
        </el-col>
        <el-col :span="6">
          <el-form-item label-width="98px" label="责任人:" class="elItem" prop="contactPerson">
            <el-input placeholder="请输入责任人" :disabled="dis_flag" v-model="form.contactPerson"></el-input>
          </el-form-item>
        </el-col>
        <el-col :span="6">
          <el-form-item label-width="98px" label="联系方式:" class="elItem" prop="contactPersonPhone">
            <el-input placeholder="请输入联系方式" :disabled="dis_flag" v-model="form.contactPersonPhone"></el-input>
          </el-form-item>
        </el-col>
      </el-row> -->
    </el-form>
    <!-- 添加或修改岗位对话框 -->
    <el-dialog :close-on-click-modal="false" :title="title" :visible.sync="open" width="600px" append-to-body>
      <el-form ref="forms" :model="sharData" :rules="sharRules" label-width="120px">
        <el-form-item label="姓名" prop="name">
          <el-input v-model="sharData.name" placeholder="请输入姓名" />
        </el-form-item>
        <el-form-item label="股权比例" prop="equityRatio">
          <el-input-number :min="0" :max="100" style="width: 140px" v-model="sharData.equityRatio" /><span style="margin: 0 10px; font-size: 16px">%</span>
        </el-form-item>
        <el-form-item label="身份证号码" prop="idcard">
          <el-input v-model="sharData.idcard" placeholder="请输入身份证号码" />
        </el-form-item>
        <el-form-item label="身份证(正面)" prop="idcardFront">
          <el-upload class="upload-demo" :file-list="idcardFrontFlie" list-type="picture-card" :on-remove="upl_remove_sfzzm" :on-success="upl_fn_sfzzm"
            :action="defaultSettings.urls + process + '/common/upload'">
            <el-button size="small" type="primary">点击上传</el-button>
          </el-upload>
        </el-form-item>
        <el-form-item label="身份证(反面)" prop="idcardBack">
          <el-upload class="upload-demo" :file-list="idcardBackFlie" list-type="picture-card" :on-remove="upl_remove_sfzfm" :on-success="upl_fn_sfzfm"
            :action="defaultSettings.urls + process + '/common/upload'">
            <el-button size="small" type="primary">点击上传</el-button>
          </el-upload>
        </el-form-item>
      </el-form>
      <div slot="footer" class="dialog-footer">
        <el-button type="primary" @click="submitForms">确 定</el-button>
        <el-button @click="open = false">取 消</el-button>
      </div>
    </el-dialog>

	<!-- 添加或修改岗位对话框 -->
	<el-dialog :close-on-click-modal="false" :title="titles" :visible.sync="openss" width="600px" append-to-body>
	  <el-form ref="forms" :model="sharData" :rules="sharRules" label-width="140px">
	    <el-form-item label="企业名称" prop="companyName">
	      <!-- <el-input v-model="sharData.name" placeholder="请输入企业名称" /> -->
		  <el-autocomplete
		    v-model="sharData.companyName"
		    :fetch-suggestions="querySearchAsync"
		    placeholder="请输入企业名称"
		    @select="handleSelecthueys"
		    :trigger-on-focus="false"
		    style="width: 100%;"
		    :disabled="dis_flag"
		  ></el-autocomplete>
	    </el-form-item>
	    <el-form-item label="股权比例" prop="equityRatio">
	      <el-input-number :min="0" :max="100" style="width: 140px" v-model="sharData.equityRatio" /><span style="margin: 0 10px; font-size: 16px">%</span>
	    </el-form-item>
	    <el-form-item label="统一社会信用代码" prop="companyCode">
	      <el-input v-model="sharData.companyCode" placeholder="请输入统一社会信用代码" />
	    </el-form-item>
	    <el-form-item label="企业股东营业执照" prop="businessPhoto">
	      <el-upload class="upload-demo" :file-list="idcardFrontFlie" list-type="picture-card" :on-remove="upl_remove_sfzzms" :on-success="upl_fn_sfzzms"
	        :action="defaultSettings.urls + process + '/common/upload'">
	        <el-button size="small" type="primary">点击上传</el-button>
	      </el-upload>
	    </el-form-item>
	  </el-form>
	  <div slot="footer" class="dialog-footer">
	    <el-button type="primary" @click="submitFormss">确 定</el-button>
	    <el-button @click="openss = false">取 消</el-button>
	  </div>
	</el-dialog>



     <el-dialog :visible.sync="dialogVisible">

       <img width="100%" :src="dialogImageUrl" alt="" v-if="ndheuos">
       <a :href="dialogImageUrl" target="view_window" v-if="!ndheuos"> {{dialogImagename}} <span style="color: red;">点击查看/下载</span> </a>

     </el-dialog>

    <BigPicture ref="BigPicture" :urls="pir_imgs"></BigPicture>
  </div>
</template>

<script>
  import {
    getOrderinfo,
    getShareholderList,
    getShareholder,
    delShareholder,
    addShareholder,
	  addShareholderde,
    setShareholder,
	  setShareholderde,
    setOrderinfo,
    addOrderinfo,
    getExamine,
    getShareholderListss,
    getShareholders,
    delShareholders
  } from "@/api/system/signContract";
  import {
    addConfigbout,
  } from "@/api/system/config";
  import {
    setExamine,
    setBack,
    setReject
  } from "@/api/projectInfo/info.js";
  import {
    listConfigname
  } from "@/api/system/config";
  const defaultSettings = require("@/settings.js");
  export default {
    data() {
      return {
        dis_flag: false,
        process: process.env.VUE_APP_BASE_API,
        fileListZcq: [],
        fileListZht: [],
        fileListCqz: [],
        fileListTdls: [],
        fileListTdz: [],
        dialogImagename:'',
        flieListHt: [],
        flieListYzz: [],
        flieListBa: [],
        defaultSettings,
        title: "",
        totals:0,
        // 是否显示弹出层
        open: false,
        configList: [],
        setrd: 0,
        sharRules: {
          name: [{
            required: true,
            message: "请输入姓名",
            trigger: "blur",
          }, ],
          equityRatio: [{
            required: true,
            message: "请输入股权比例",
            trigger: "blur",
          }, ],
          idcard: [{
            required: true,
            message: "请输入身份证号",
            trigger: "blur",
          }, {
          pattern:  /(^[1-9]\d{5}(18|19|([23]\d))\d{2}((0[1-9])|(10|11|12))(([0-2][1-9])|10|20|30|31)\d{3}[0-9Xx]$)|(^[1-9]\d{5}\d{2}((0[1-9])|(10|11|12))(([0-2][1-9])|10|20|30|31)\d{2}$)/,
          message: '身份证格式错误',
          trigger: 'blur'
        }],
          idcardFront: [{
            required: true,
            message: "请上传身份证正面",
            trigger: "blur",
          }],
          idcardBack: [{
            required: true,
            message: "请上传身份证反面",
            trigger: "blur",
          }, ],
        },
        sharData: {
          bmProjectId: this.$route.query.setid,
          name: "",
          equityRatio: 0,
          idcard: "",
          idcardFront: "",
          idcardBack: "",
		  companyCode:'',
        },
        queryParams: {
          pageNum: 1,
          pageSize: 10,
          bmProjectId: "",
        },
        total: 0,
		titles:'',
        shareholderList: [],
        shareholderLists:[],
		openss:false,
        // showSearch: true,
        loading: true,
        rules: {
          orderDate: [{
            required: true,
            message: "请选择签约日期",
            trigger: "blur",
          }, ],
          investmentType: [{
            required: true,
            message: "请选择投资方式",
            trigger: "blur",
          }, ],

          totInvestment: [{
            required: true,
            message: "请输入总投资额度",
            trigger: "blur",
          }, ],
          overseasInvestment: [{
            required: true,
            message: "请输入境外投资",
            trigger: "blur",
          }, ],
          isIndependentLan: [{
            required: true,
            message: "请选择是否独立供地",
            trigger: "blur",
          }, ],
          agreementTot: [{
            required: true,
            message: "请输入合同约定产值",
            trigger: "blur",
          }, ],
          agreementTax: [{
            required: true,
            message: "请输入合同约定税收",
            trigger: "blur",
          }, ],
          agreementStartdate: [{
            required: true,
            message: "请选择合同约定开工时间",
            trigger: "blur",
          }, ],
          agreementEnddate: [{
            required: true,
            message: "请选择合同约定竣工时间",
            trigger: "blur",
          }, ],
          agreementPartner: [{
            required: true,
            message: "请输入合同签约对方",
            trigger: "blur",
          }, ],
          partner: [{
            required: true,
            message: "请输入对方合同签约人",
            trigger: "blur",
          }, ],
		  partnerJob:[{
			  required: true,
			  message: "请输入信息",
			  trigger: "blur",
		  }],
		  usJob:[{
		  			  required: true,
		  			  message: "请输入信息",
		  			  trigger: "blur",
		  }],
          agreementUs: [{
            required: true,
            message: "请输入合同签约我方",
            trigger: "blur",
          }, ],
          signUs: [{
            required: true,
            message: "请输入我方合同签约人",
            trigger: "blur",
          }, ],
          agreementUrl: [{
            required: true,
            message: "请上传合同文本",
            trigger: "blur",
          }, ],
          name: [{
            required: true,
            message: "请输入在潜注册公司名称",
            trigger: "blur",
          }, ],
          legalRep: [{
            required: true,
            message: "请输入法定代表人",
            trigger: "blur",
          }, ],
          totMoney: [{
            required: true,
            message: "请输入注册资本金",
            trigger: "blur",
          }, ],
          address: [{
            required: true,
            message: "请输入注册地址",
            trigger: "blur",
          }, ],
          code: [{
            required: true,
            message: "请输入统一社会信用代码",
            trigger: "blur",
          }, ],
          bussinessUrl: [{
            required: true,
            message: "请上传营业执照",
            trigger: "blur",
          }, ],
          recordName: [{
            required: true,
            message: "请输入备案单位",
            trigger: "blur",
          }, ],
          recordCode: [{
            required: true,
            message: "请输入备案文号",
            trigger: "blur",
          }, ],
          recordTot: [{
            required: true,
            message: "请输入备案总投资额",
            trigger: "blur",
          }, ],
          recordTime: [{
            required: true,
            message: "请输入备案建设周期",
            trigger: "blur",
          }, ],
          recordUrl: [{
            required: true,
            message: "请上传备案表信息",
            trigger: "blur",
          }, ],
          contactLeader: [{
            required: true,
            message: "请输入联系领导",
            trigger: "blur",
          }, ],
          contactPhone: [{
            required: true,
            message: "请输入联系方式",
            trigger: "blur",
          }, ],
          contactCompany: [{
            required: true,
            message: "请输入责任单位",
            trigger: "blur",
          }, ],
          contactPerson: [{
            required: true,
            message: "请输入责任人",
            trigger: "blur",
          }, ],
          contactPersonPhone: [{
            required: true,
            message: "请输入责任人联系方式",
            trigger: "blur",
          }, ],
        },
        form: {
          bmProjectId: this.$route.query.setid,
          id: -1,
          orderDate: "", //签约日期
          investmentType: "", //投资方式
          isOutInvestment: "", // 是否外资(N:Y)
          totInvestment: "", //总投资额度
          fixedAssets: "", //固定资产投资额度
          overseasInvestment: "", //境外投资
          jnswInvestm: "", //境内省外投资
          snswInvestm: "", //省内市外投资
          snxwInvestm: "", //市内县外投资
          xnInvestm: "", //县内投资
          isIndependentLan: "", //是否独立供地(N:Y)
          landArea: "", //供地面积
          landAddress: "", //供地位置
          landPhoto: [], //土地证ur
          circulationLand: "", //流转土地面积
          circulationAddres: "", //流转土地位置
          circulationDoc: [], //土地流转合同
          circulationPhoto: [], //产权证
          leasePlantArea: "", //租赁厂房面积
          leasePlantAddress: "", //租赁厂房位置
          leasePlantDoc: [], //租赁合同
          leasePlantPhoto: [], //租赁产权证
          agreementTot: '', //租赁产权证
          agreementTax: "", // 合同约定税收
          agreementStartdate: "", // 合同约定开工时间
          agreementEnddate: "", //合同约定竣工时间
          agreementPartner: "", //合同签约对方
          partner: "", //对方合同签约人
          agreementUs: "", //合同签约我方
          signUs: "", //我方合同签约人
          agreementThird: "", //第三方
          third: "", //第三方签约人
          agreementUrl: [], //合同url
          name: "", //在潜注册公司名称
          legalRep: "", //法定代表人
          totMoney: "", //注册资本金
          address: "", //注册地址
          code: "", //统一社会信用代码
          bussinessUrl: [], //营业执照图片url
          recordName: "", //备案单位
          recordCode: "", //备案文号
          recordTot: "", //备案总投资额
          recordTime: "", //备案建设周期
          recordUrl: [], //备案表url
          contactLeader: "", //企业包服务-联系领导
          contactPhone: "", //联系方式
          contactCompany: "", //责任单位
          contactPerson: "", //责任人
          contactPersonPhone: "", //责任人联系方式
        },
        idcardFrontFlie: [],
        idcardBackFlie: [],
        fileList: [],
        pir_imgs: '',
        dialogImageUrl: '',
                dialogVisible: false,
        dkrou:{},
        ndheuos:false,
        field107Options:[]
      };
    },
    mounted() {
      this.queryParams.bmProjectId = this.$route.query.setid;
      this.setrd = this.$route.query.setrd;
      this.dis_flag = (this.$route.query.setrd!=3)
      this.getOrderinfo();
      this.getShareholderList();
      this.getShareholderListss();
    },
    methods: {
      handlePictureCardPreview(file) {
             this.dialogImageUrl = file.url;
             this.dialogVisible = true;
           },
      backProBtn(){
        var that = this
        this.$confirm("是否确认撤销审核", "提醒", {
            confirmButtonText: "确定",
            cancelButtonText: "取消",
            type: "warning",
          })
          .then(function() {
            return setBack({
              code: 4,
              bmProjectId: that.queryParams.bmProjectId,
            });
          })
          .then(() => {
            this.msgSuccess("撤销成功");
            setTimeout(res => {
              this.$router.go(-1)
            }, 1000)
          });
      },
      imgBtn(url) {
        this.pir_imgs = url
        this.$refs.BigPicture.hidden.status = true
      },
      //审核
      applyBtn() {
        var that = this
        this.$confirm("是否确认审核", "提醒", {
            confirmButtonText: "确定",
            cancelButtonText: "取消",
            type: "warning",
          })
          .then(function() {
            // addConfigbout
            return addConfigbout({
              code: 3,
              bmProjectId: that.queryParams.bmProjectId,
            });
          })
          .then(() => {
            this.msgSuccess("审核成功");
            setTimeout(res => {
              this.$router.go(-1)
            }, 1000)
          });
      },
      //驳回
      backBtn() {
        var that = this
        this.$prompt("请输入驳回意见", "提醒", {
          confirmButtonText: "确定",
          cancelButtonText: "取消",
          type: "warning",
        })
          .then(function({ value }) {
            return setReject({
              code: 2,
              bmProjectId: that.queryParams.bmProjectId,
              remark:value
            });
          })
          .then(() => {
            this.msgSuccess("驳回成功");
            setTimeout(res => {
              this.$router.go(-1)
            }, 1000)
          });
      },
      upBtn() {
        var that = this
        // this.$refs["form"].validate((valid) => {
        //   if (valid) {
        //     let  zNum =  (this.form.overseasInvestment-0)+ (this.form.jnswInvestm-0)+ (this.form.snswInvestm-0)+ (this.form.snxwInvestm-0)+ (this.form.xnInvestm-0)
        //     console.log(this.form.totInvestment,zNum)
        //     if (this.form.totInvestment != zNum) {
        //       this.msgError("请重新填写总投资额,总投资额度与其他投资数总和不等");
        //       return;
        //     }
        //     if (this.total == 0) {
        //       this.msgError("企业股东不能为空，请上传企业股东");
        //       return;
        //     }
        //     let data = JSON.parse(JSON.stringify(this.form));
        //     data.isOutInvestment = Number(data.isOutInvestment)
        //     data.agreementUrl = data.agreementUrl.join(",");
        //     data.landPhoto = data.landPhoto.join(",");
        //     data.recordUrl = data.recordUrl.join(",");
        //     data.circulationDoc = data.circulationDoc.join(",");
        //     data.bussinessUrl = data.bussinessUrl.join(",");
        //     data.leasePlantPhoto = data.leasePlantPhoto.join(",");
        //     data.leasePlantDoc = data.leasePlantDoc.join(",");
        //     data.circulationPhoto = data.circulationPhoto.join(",");
        //     if (this.form.id) {
        //       // 修改
        //       setOrderinfo(JSON.stringify(data)).then((res) => {
        //         this.$confirm("是否确认提交?", "提醒", {
        //             confirmButtonText: "确定",
        //             cancelButtonText: "取消",
        //             type: "warning",
        //           })
        //           .then(function() {
        //             return getExamine({
        //               code: 1,
        //               bmProjectId: that.$route.query.setid,
        //             })
        //           })
        //           .then(() => {
        //             this.msgSuccess("提交成功");
        //             setTimeout(res => {
        //               this.$router.go(-1)
        //             }, 1000)

        //           });

        //       });
        //     } else {
        //       // 新增
        //       addOrderinfo(JSON.stringify(data)).then((res) => {
        //         this.$confirm("是否确认提交?", "提醒", {
        //             confirmButtonText: "确定",
        //             cancelButtonText: "取消",
        //             type: "warning",
        //           })
        //           .then(function() {
        //             return getExamine({
        //               code: 1,
        //               bmProjectId: that.$route.query.setid,
        //             })
        //           })
        //           .then(() => {
        //             this.msgSuccess("提交成功");
        //             setTimeout(res => {
        //               this.$router.go(-1)
        //             }, 1000)
        //           });
        //       });
        //     }
            this.dkrou.code = 1;
            this.dkrou.bmProjectId = that.$route.query.setid;
            setExamine(this.dkrou).then((response) => {
              // setExamine setExamine addConfigbout
              console.log(response);
              this.msgSuccess("提交成功");
              // this.open = false;
              // this.getListtwo();
              this.$router.go(-1);
              // 就可以回到上一页。
              // this.open = false;
              // this.getListtwo();
            });
            console.log(this.queryParams);
          // }
        // });
      },
      goBtn() {
        this.$router.go(-1);
      },
      addshareBtn() {

        if(this.dis_flag){
          return
        }
        this.reset();
        this.title = "添加自然人";
		this.titles = '添加企业股东'
        this.open = true;
      },
	  addshareBtnde() {

	    if(this.dis_flag){
	      return
	    }
	    this.reset();
	    this.title = "添加自然人";
	    this.titles = '添加企业股东'
	    this.openss = true;
	  },
      // 表单重置
      reset() {
        this.sharData = {
          bmProjectId: this.$route.query.setid,
          name: "",
          equityRatio: 0,
          idcard: "",
          idcardFront: "",
          idcardBack: "",
		  companyCode:'',
        };
        this.idcardFrontFlie = [];
        this.idcardBackFlie = [];
        this.resetForm("forms");
      },
      resetPhoto(file, fileList) {
        let urls = ""
        if(file.response){
          urls = file.response.url
        }else{
          urls = file.url
        }
        for (let i = this.form.landPhoto.length - 1; i >= 0; i--) {
          if (this.form.landPhoto[i] == urls) {
            this.form.landPhoto.splice(i, 1);
          }
        }
      },
      resetPhoto1(file, fileList) {
        let urls = ""
        if(file.response){
          urls = file.response.url
        }else{
          urls = file.url
        }
        for (let i = this.form.circulationDoc.length - 1; i >= 0; i--) {
          if (this.form.circulationDoc[i] == urls) {
            this.form.circulationDoc.splice(i, 1);
          }
        }
      },
      resetPhoto2(file, fileList) {
        let urls = ""
        if(file.response){
          urls = file.response.url
        }else{
          urls = file.url
        }
        for (let i = this.form.circulationPhoto.length - 1; i >= 0; i--) {
          if (this.form.circulationPhoto[i] == urls) {
            this.form.circulationPhoto.splice(i, 1);
          }
        }
      },
      resetPhoto3(file, fileList) {
        let urls = ""
        if(file.response){
          urls = file.response.url
        }else{
          urls = file.url
        }
        for (let i = this.form.leasePlantDoc.length - 1; i >= 0; i--) {
          if (this.form.leasePlantDoc[i] == urls) {
            this.form.leasePlantDoc.splice(i, 1);
          }
        }
      },
      beforeAvatarUpload(file) {
        console.log(file.type);
        const isJPG =
          file.type === "image/jpeg" ||
          file.type === "image/png" ||
          file.type === "image/jpg";
        const isPNG = file.type === "image/png";
        const isLt2M = file.size / 1024 / 1024 < 10;
        this.ndheuos = isJPG
        // if (!isJPG) {
        //   this.$message.error("图片只能是 JPG 格式! 或者 PNG 格式!");
        // }
        // if(!isPNG){
        //   this.$message.error('图片只能是 JPG 格式! 或者 PNG 格式!');
        // }
        if (!isLt2M) {
          this.$message.error("文件大小不能超过 10MB!");
        }
        return  isLt2M;
      },
      resetPhoto4(file, fileList) {
        let urls = ""
        if(file.response){
          urls = file.response.url
        }else{
          urls = file.url
        }
        for (let i = this.form.leasePlantPhoto.length - 1; i >= 0; i--) {
          if (this.form.leasePlantPhoto[i] == urls) {
            this.form.leasePlantPhoto.splice(i, 1);
          }
        }
      },
      resetPhoto5(file, fileList) {
        let urls = ""
        if(file.response){
          urls = file.response.url
        }else{
          urls = file.url
        }
        for (let i = this.form.bussinessUrl.length - 1; i >= 0; i--) {
          if (this.form.bussinessUrl[i] == urls) {
            this.form.bussinessUrl.splice(i, 1);
          }
        }
      },
      upl_fn(res, file) {
        this.form.landPhoto.push(res.url);
      },
      upl_fn_lzht(res, file) {
        this.form.circulationDoc.push(res.url);
      },
      upl_fn_cqz(res, file) {
        this.form.circulationPhoto.push(res.url);
      },
      upl_fn_zlht(res, file) {
        this.form.leasePlantDoc.push(res.url);
      },
      upl_fn_zlcqz(res, file) {
        this.form.leasePlantPhoto.push(res.url);
      },
      up_loat_htwb(res, file) {
        this.form.agreementUrl.push(res.url);
      },
      up_loat_bab(res, file) {
        this.form.recordUrl.push(res.url);
      },
      upl_fn_zzfyj(res, file) {
        this.form.bussinessUrl.push(res.url);
      },
      upl_fn_sfzzm(res, file) {
        this.idcardFrontFlie = [];
        this.idcardFrontFlie = [{
          name: res.url,
          url: res.url,
        }, ];
        this.sharData.idcardFront = res.url;
        this.sharData.businessPhoto = res.url
      },
      upl_fn_sfzzms(res, file){
        this.idcardFrontFlie = [];
        this.idcardFrontFlie = [{
          name: res.url,
          url: res.url,
        }, ];
        // this.sharData.idcardFront = res.url;
        this.sharData.businessPhoto = res.url
      },
      upl_remove_sfzzm() {
        this.idcardFrontFlie = [];
        this.sharData.idcardFront = "";
      },
      upl_remove_sfzzms() {
        this.idcardFrontFlie = [];
        this.sharData.businessPhoto = ''
      },
      upl_remove_sfzfm() {
        this.idcardBackFlie = [];
        this.sharData.idcardBack = "";
      },
      upl_fn_sfzfm(res, file) {
        this.idcardBackFlie = [];
        this.idcardBackFlie = [{
          name: res.url,
          url: res.url,
        }, ];
        this.sharData.idcardBack = res.url;
      },
      getShareholderList() {
        getShareholderList(this.queryParams).then((res) => {
          this.shareholderList = res.rows;
          this.total = res.total;
          this.loading = false;
        });
      },
      getShareholderListss() {
        getShareholderListss(this.queryParams).then((res) => {
          this.shareholderLists = res.rows;
          this.totals = res.total;
          this.loading = false;
        });
      },
      submitForms() {
        this.$refs["forms"].validate((valid) => {
          if (valid) {
            if (this.sharData.id) {
              setShareholder(this.sharData).then((res) => {
                this.open = false;
                this.msgSuccess("修改成功");
                this.getShareholderList();
              });
            } else {
              addShareholder(this.sharData).then((res) => {
                this.open = false;
                this.msgSuccess("新增成功");
                this.getShareholderList();
              });
            }
          }
        });
      },
	  submitFormss(){
		  this.$refs["forms"].validate((valid) => {
        // this.sharData
		    if (valid) {
          this.sharData.idcard = undefined
          this.sharData.idcardBack = undefined
          this.sharData.idcardFront = undefined
          this.sharData.name = undefined
		      if (this.sharData.id) {
		        setShareholderde(this.sharData).then((res) => {
		          this.openss = false;
		          this.msgSuccess("修改成功");
		          this.getShareholderListss();
		        });
		      } else {

		        addShareholderde(this.sharData).then((res) => {
		          this.openss = false;
		          this.msgSuccess("新增成功");
		          this.getShareholderListss();
		        });
		      }
		    }
		  });
	  },
      submitForm() {
        console.log(344,this.form)
        if(this.form.orderDate == ""){
          this.msgError("请选择签约日期");
          return  false
        }
        if(this.form.investmentType == ''){
          this.msgError("请选择投资方式");
          return  false
        }
        if(this.form.totInvestment == ''){
          this.msgError("请输入总投资额度");
          return  false
        }
        if(this.form.overseasInvestment == ''){
          this.msgError("请输入境外投资");
          return  false
        }
        if(this.form.isIndependentLan == ''){
          this.msgError("请选择是否独立供地");
          return  false
        }
        if(this.form.agreementTot == ''){
          this.msgError("请输入合同约定产值");
          return  false
        }
        if(this.form.agreementTax == ''){
          this.msgError("请输入合同约定税收");
          return  false
        }
        if(this.form.agreementStartdate == ''){
          this.msgError("请选择合同约定开工时间");
          return  false
        }
        if(this.form.agreementEnddate == ''){
          this.msgError("请选择合同约定竣工时间");
          return  false
        }
        if(this.form.agreementPartner == ''){
          this.msgError("请输入合同签约对方");
          return  false
        }
        if(this.form.partner == ''){
          this.msgError("请输入对方合同签约人");
          return  false
        }
        if(this.form.partnerJob == ''){
          this.msgError("请输入对方职务信息");
          return  false
        }
        if(this.form.usJob == ''){
          this.msgError("请输入我方职务信息");
          return  false
        }
        if(this.form.agreementUs == ''){
          this.msgError("请输入合同签约我方");
          return  false
        }
        if(this.form.signUs == ''){
          this.msgError("请输入我方合同签约人");
          return  false
        }
        if(this.form.agreementUrl.length == 0){
          this.msgError("请上传合同文本");
          return  false
        }
        if(this.form.name == ''){
          this.msgError("请输入在潜注册公司名称");
          return  false
        }
        if(this.form.legalRep == ''){
          this.msgError("请输入法定代表人");
          return  false
        }
        if(this.form.totMoney == ''){
          this.msgError("请输入注册资本金");
          return  false
        }
        if(this.form.address == ''){
          this.msgError("请输入注册地址");
          return  false
        }
        if(this.form.code == undefined){
          this.msgError("请输入统一社会信用代码");
          return  false
        }
        if(this.form.bussinessUrl.length ==0){
          this.msgError("请上传营业执照");
          return  false
        }
        if(this.form.recordName == undefined){
          this.msgError("请输入备案单位");
          return  false
        }
        if(this.form.recordCode == ''){
          this.msgError("请输入备案文号");
          return  false
        }
        if(this.form.recordTot == ''){
          this.msgError("请输入备案总投资额");
          return  false
        }
        if(this.form.recordTime == ''){
          this.msgError("请输入备案建设周期");
          return  false
        }
        if(this.form.recordUrl.length ==0){
          this.msgError("请上传备案表信息");
          return  false
        }
        if(this.form.contactLeader == ''){
          this.msgError("请输入联系领导");
          return  false
        }
        if(this.form.contactPhone == ''){
          this.msgError("请输入联系方式");
          return  false
        }
        if(this.form.contactCompany == ''){
          this.msgError("请输入责任单位");
          return  false
        }
        if(this.form.contactPerson == ''){
          this.msgError("请输入责任人");
          return  false
        }
        if(this.form.contactPersonPhone == ''){
          this.msgError("请输入责任人联系方式");
          return  false
        }

		if(this.shareholderList.length == 0  && this.shareholderLists.length == 0){
			console.log(178)
			this.msgError("自然人和企业股东二选一必填");
			return  false
		}




        this.$refs["form"].validate((valid) => {
          if (valid) {
            let  zNum =  (this.form.overseasInvestment-0)+ (this.form.jnswInvestm-0)+ (this.form.snswInvestm-0)+ (this.form.snxwInvestm-0)+ (this.form.xnInvestm-0)
            console.log(this.form.totInvestment,zNum,765)
            // if (this.total == 0) {
            //   this.msgError("企业股东不能为空，请上传企业股东");
            //   return;
            // }
            if (this.form.totInvestment != zNum) {
              this.msgError("请重新填写总投资额,总投资额度与其他投资数总和不等");
              return;
            }

            let data = JSON.parse(JSON.stringify(this.form));
            data.isOutInvestment = Number(data.isOutInvestment)
            data.agreementUrl = data.agreementUrl.join(",");
            data.landPhoto = data.landPhoto.join(",");
            data.recordUrl = data.recordUrl.join(",");
            data.circulationDoc = data.circulationDoc.join(",");
            data.bussinessUrl = data.bussinessUrl.join(",");
            data.leasePlantPhoto = data.leasePlantPhoto.join(",");
            data.leasePlantDoc = data.leasePlantDoc.join(",");
            data.circulationPhoto = data.circulationPhoto.join(",");


            if (this.form.id!=-1) {
              // 修改
              setOrderinfo(JSON.stringify(data)).then((res) => {
                this.msgSuccess("修改成功");
                this.upBtn()
                // this.$router.push({
                //   path: "/management/info/index",
                // });
              });
            } else {
              // 新增
              addOrderinfo(JSON.stringify(data)).then((res) => {
                this.msgSuccess("操作成功");
                this.upBtn()
                // this.$router.push({
                //   path: "/management/info/index",
                // });
              });
            }
          }
        });
      },
      getOrderinfo() {
        getOrderinfo(this.queryParams.bmProjectId).then((res) => {
          console.log(res);
          if (res.data) {
            let data = res.data
            // data.circulationPhoto = defaultSettings.urls + this.process + data.circulationPhoto
            this.flieListHt = this.gshFn(data.agreementUrl)
            this.fileListTdls = this.gshFn(data.circulationDoc)
            this.flieListBa = this.gshFn(data.recordUrl)
            this.fileListTdz = this.gshFn(data.landPhoto)
            this.flieListYzz = this.gshFns(data.bussinessUrl)
            this.fileListZcq = this.gshFn(data.leasePlantPhoto)
            this.fileListZht = this.gshFn(data.leasePlantDoc)
            // this.fileListCqz = this.gshFn(data.circulationPhoto)
            console.log(this.fileListCqz,234)

            if(data.circulationPhoto.length){
              data.circulationPhoto = data.circulationPhoto.split(',')
            }else{
              data.circulationPhoto = []
            }

            if(data.leasePlantDoc.length){
              data.leasePlantDoc = data.leasePlantDoc.split(',')
            }else{
              data.leasePlantDoc = []
            }

            if(data.bussinessUrl.length){
              data.bussinessUrl = data.bussinessUrl.split(',')
            }else{
              data.bussinessUrl = []
            }
            if(data.leasePlantPhoto.length){
              data.leasePlantPhoto = data.leasePlantPhoto.split(',')
            }else{
              data.leasePlantPhoto = []
            }

            if(data.landPhoto.length){
              data.landPhoto = data.landPhoto.split(',')
            }else{
              data.landPhoto = []
            }

            if(data.agreementUrl.length){
              data.agreementUrl = data.agreementUrl.split(',')
            }else{
              data.agreementUrl = []
            }
            if(data.recordUrl.length){
              data.recordUrl = data.recordUrl.split(',')
            }else{
              data.recordUrl = []
            }
            if(data.circulationDoc.length){
              data.circulationDoc = data.circulationDoc.split(',')
            }else{
              data.circulationDoc = []
            }
            data.isOutInvestment = Boolean(data.isOutInvestment - 0)
            console.log(data.circulationPhoto,defaultSettings.urls + this.process,654)
            this.form = data;
          }
        });
      },
      gshFn(arr){
        let arrs = []
        if(arr){
          for(let item of arr.split(',')){
            arrs.push({
              name: item.substring(item.lastIndexOf("/")+1),
              url: item  ,
            })
          }
        }
        return arrs
      },
      gshFns(arr){
        let arrs = []
        if(arr){
          for(let item of arr.split(',')){
            arrs.push({
              name: item,
              url: item,
            })
          }
        }
        return arrs
      },
      submitUpload_bab() {
        this.$refs.bAupload.submit();
      },
      submitUpload() {
        this.$refs.upload.submit();
      },
      /** 修改按钮操作 */
      handleUpdate(row) {
        this.reset();
        const id = row.id || this.ids;
        getShareholder(id).then((response) => {
          this.sharData = response.data;
          this.idcardFrontFlie = []
          this.idcardBackFlie = []
          this.idcardFrontFlie = [{
            name: response.data.idcardBack,
            url: response.data.idcardBack,
          }, ];
          this.idcardBackFlie = [{
            name: response.data.idcardFront,
            url: response.data.idcardFront,
          }, ];
          this.open = true;
          this.title = "修改自然人";
        });
      },
	  /** 修改按钮操作 */
	  handleUpdates(row) {
	    this.reset();
	    const id = row.id || this.ids;
	    getShareholders(id).then((response) => {
	      this.sharData = response.data;
        this.idcardFrontFlie = []
        this.idcardBackFlie = []
	      this.idcardFrontFlie = [{
	        name: response.data.businessPhoto,
	        url: response.data.businessPhoto,
	      }, ];
	      this.idcardBackFlie = [{
	        name: response.data.businessPhoto,
	        url: response.data.businessPhoto,
	      }, ];
	      this.openss = true;
	      this.titles = "修改股东信息";
	    });
	  },

      /** 删除按钮操作 */
      handleDelete(id) {
        this.$confirm("是否确认删除该股东", "警告", {
            confirmButtonText: "确定",
            cancelButtonText: "取消",
            type: "warning",
          })
          .then(function() {
            return delShareholder(id);
          })
          .then(() => {
            this.getShareholderList();
            this.msgSuccess("删除成功");
          });
      },
      /** 删除按钮操作 */
      handleDeletes(id) {
        this.$confirm("是否确认删除该股东", "警告", {
            confirmButtonText: "确定",
            cancelButtonText: "取消",
            type: "warning",
          })
          .then(function() {
            return delShareholders(id);
          })
          .then(() => {
            this.getShareholderListss();
            this.msgSuccess("删除成功");
          });
      },
      handleRemove(file, fileList) {
        let urls = ""
        if(file.response){
          this.form.agreementUrl =  file.response.url
        }else{
          urls = file.url
        }
        for (let i = this.form.agreementUrl.length - 1; i >= 0; i--) {
          if (this.form.agreementUrl[i] == urls) {
             this.form.agreementUrl.splice(i, 1);
          }
        }
        console.log(this.form.agreementUrl)
      },
      handleRemove_bab(file, fileList) {
        let urls = ""
        if(file.response){
          urls = file.response.url
        }else{
          urls = file.url
        }
        for (let i = this.form.recordUrl.length - 1; i >= 0; i--) {
          if (this.form.recordUrl[i] == urls) {
            this.form.recordUrl.splice(i, 1);
          }
        }
      },
      handlePreview(file) {
        console.log(file, 22);
        if(file.response !== undefined){
          this.dialogImageUrl = file.response.url;
          this.dialogVisible = true;
          this.dialogImagename = file.name
        }else{
          this.dialogImageUrl = file.url;
          this.dialogVisible = true;
          this.dialogImagename = file.name
        }
      },
      handleSelecthuey(item){

        console.log(item)
        // this.form.code = item.id
        // this.form.legalRep = item.labr
        for (let i = 0; i < this.resets.length; i++) {
         if(item.id == this.resets[i].CreditCode){
           // 企业名称
           this.form.name = this.resets[i].Name
           // 企业所在地
           // this.form.address = this.resets[i].Name
           // 法人代表姓名
           this.form.legalRep = this.resets[i].OperName
           // 统一社会信用代码
           this.form.code = item.id
           // 联系方式
           // this.form.companyName = this.resets[i].Name
         }
        }


         // console.log(3345)
      },
	  handleSelecthueys(item){
	    console.log(item)
	    this.form.code = item.id
	    this.form.legalRep = item.labr
	    for (let i = 0; i < this.resets.length; i++) {
	     if(item.id == this.resets[i].CreditCode){
	       // 企业名称
	       this.sharData.companyName = this.resets[i].Name
	       // 企业所在地
	       // this.form.companyAddress = this.resets[i].Name
	       // 法人代表姓名
	       // this.form.companyLegal = this.resets[i].OperName
	       // 统一社会信用代码
	       this.sharData.companyCode = this.resets[i].CreditCode
	       // 联系方式
	       // this.form.companyName = this.resets[i].Name
	     }
	    }


	     // console.log(3345)
	  },
      querySearchAsync(queryString, cb){
         console.log(queryString, cb)
         this.options = []
         // this.form = {}
         listConfigname(queryString).then((res) => {
           console.log(res);
            if (res.code == 200 && res.data.length !== 0) {
           	                var result = res.data
                            this.resets = res.data
           	                //循环放到一个远程搜索需要的数组
           	                for (let i = 0; i < result.length; i++) {
           	                  const element = result[i];
                              console.log(result[i])
           	                  this.options.push({
           	                    value: element.Name,
           	                    id: element.CreditCode,
                                labr:element.OperName
           	                  })
           	                }
           	                cb(this.options);
           	              } else {
           	                this.options = []
           	                cb(this.options);
           	              }
         });
      }
    },
  };
</script>

<style lang="scss">
  .el-upload-list--picture-card .el-upload-list__item{
    width: 100px;
    height: 100px;
  }
  .el-upload--picture-card{
    width: auto;
    height: auto;
    background-color: transparent;
    border: none;
    line-height: 0;
  }
  .imgs {
    width: 100px;
    height: 100px;
    object-fit: cover;
  }

  .roiyy {

    position: fixed;
    top: 95px;
    left: 0;
    width: 100%;
    padding-left: 230px;
    padding-right: 30px;
    box-sizing: border-box;
    z-index: 999;
  }

  .ads_box {
    margin: 18px 0;
    font-size: 14px;
    color: #666;
    width: 140px;
    display: flex;
    align-items: center;
    cursor: pointer;

    .add_icon {
      margin-right: 6px;
      width: 15px;
      height: 15px;
    }
  }

  .sign_box {
    padding: 0 0 26px;

    .sign_tit {
      font-size: 14px;
      border-left: 3px solid #1c84c6;
      padding: 5px 0 5px 13px;
      color: #343434;
      line-height: 1;
      margin: 8px 0;
      font-weight: bold;

      span {
        color: #df0024;
        margin-left: 10px;
      }
    }

    .elItem {
      margin: 15px 0;
    }
  }

  .qz_name {
    font-size: 14px;
    color: #606266;
    display: inline-block;
    margin: 15px 0 15px;
    font-weight: bold;
    text-align: right;
    line-height: 36px;
    width: 100%;
  }
  .dw_names{
    font-size: 12px;
    color: red;
  }
</style>
