<template>
	<div class="eibs-tab">
		<c-row>
			<c-col :span="24">
				<c-col :span="12" style="padding-right: 20px">
					<!--========================== 不为swift格式左边 =========================================-->
					<c-col :span="24">
						<c-ptap 
							:model="model" 
							:isAdrblk="false" 
							:haveAdrLabel="true" 
							:disabledRef="model.oldnidgrp.rec.hndtyp == 'OL' || model.oldnidgrp.rec.hndtyp == 'OC'"
							:disabledExtkey="model.oldnidgrp.rec.hndtyp == 'OL' || model.oldnidgrp.rec.hndtyp == 'OC'" 
							:argadr="{  title: $t('ptap.申请人'), grp: 'nidgrp', rol: 'apl'}" 
							:ptytyp="model.nidgrp.rec.hndtyp=='OT'?'B,F':'C'">
						</c-ptap>
					</c-col>
						<!--<el-card class="box-card">
							<c-col :span="24">
								<el-form-item :label="$t('nitopn.被保证人社会统一信用代码')" prop="nidgrp.rec.grtjuscod" :required="model.nidgrp.rec.fenlishi!=''">
									<c-input :disabled="( model.nidgrp.rec.hndtyp == 'OL' && !model.nidgrp.rec.fenlishi)||(model.nidgrp.rec.hndtyp == 'OT')||(model.nidgrp.rec.hndtyp == 'OC')"  v-model="model.nidgrp.rec.grtjuscod" @change='changeValues' maxlength="18"
									  placeholder="请输入被保证人社会统一信用代码"></c-input>
								</el-form-item>
							</c-col>
							<c-col :span="24">
								<el-form-item label="名称" prop="nidgrp.bdb.pts.nam">
									<c-mul-row-input type="textarea" :rows="2" :cols="35" :autosize="{minRows: 1,	maxRows: 2}" :charmod=" 0" v-model="model.nidgrp.bdb.pts.nam"
									  placeholder="" :disabled="( model.nidgrp.rec.hndtyp == 'OL' && !model.nidgrp.rec.fenlishi)||(model.nidgrp.rec.hndtyp == 'OT')||(model.nidgrp.rec.hndtyp == 'OC')" maxlength="70" show-word-limit></c-mul-row-input>
								</el-form-item>
							</c-col>

							<c-col :span="24">
								<el-form-item label="地址" prop="nidgrp.bdb.pts.adrblk">
									<c-mul-row-input type="textarea" :rows="2" :cols="35" :autosize="{minRows: 1,	maxRows: 2}" :charmod="0" v-model="model.nidgrp.bdb.pts.adrblk"
									  placeholder="" :disabled="!model.nidgrp.rec.fenlishi && model.nidgrp.rec.hndtyp != 'OT'" maxlength="150" show-word-limit></c-mul-row-input>
								</el-form-item>
							</c-col>
						</el-card>-->
					<c-col :span="24">
						<el-card class="box-card">
							<el-form-item prop="nidgrp.rec.grtjuscod" >
								<span slot="label">
									<div>被保证人</div>
									<div>社会统一信用代码</div>
								</span>
								<c-input 	:disabled="!( (model.nidgrp.rec.hndtyp == 'OL' || model.nidgrp.rec.hndtyp == 'OC') && model.nidgrp.rec.fenlishi!='')"
										 v-model="model.nidgrp.rec.grtjuscod" @change='changeValues' maxlength="18"
										 placeholder="请输入被保证人社会统一信用代码"></c-input>
							</el-form-item>
							<c-ptap
									:model="model"
									:isAdrblk="false" :haveAdrLabel="true"
									:no-extkey="true"
									:required-nam="((model.nidgrp.rec.hndtyp == 'OL' || model.nidgrp.rec.hndtyp == 'OC') && model.nidgrp.rec.fenlishi!='')"
									:disabled="!( (model.nidgrp.rec.hndtyp == 'OL' || model.nidgrp.rec.hndtyp == 'OC') && model.nidgrp.rec.fenlishi!='')"
									:argadr="{ title:'被保证人', grp: 'nidgrp', rol: 'bdb'}"
									ptytyp="C"
									:isShowCard="false"
							></c-ptap>

						</el-card>
					</c-col>

					<!-- 新增反担保行,用哪个角色?暂写删除的保兑行角色 -->
					<!-- <c-col :span="24" v-if="(model.nidgrp.rec.hndtyp != 'OT')">
						<c-ptap :model="model" :isAdrblk="true" :haveAdrLabel="true" :disabled="true" :disabledExtkey="true" :disabledRef="model.nidgrp.con.pts.extkey == ''" :argadr="{  title: $t('ptap.反担保行'), grp: 'nidgrp', rol: 'ctr'}" ptytyp="B">
						</c-ptap>
					</c-col> -->

					<!-- 增加判断nidgrp.rec.fenlishi有值时被保证人亮,为空时灰 -->
					<!-- <c-col :span="24">
							<c-ptap :model="model" :isAdrblk="false" :haveAdrLabel="true" :disabled="true" :disabledExtkey="true" :disabledRef="model.nidgrp.bdb.pts.extkey == ''"
							  :argadr="{  title: $t('ptap.被保证人'), grp: 'nidgrp', rol: 'bdb' }" ptytyp="C">
							</c-ptap>
						</c-col>
						<c-col :span="24">
							<el-form-item :label="$t('nitame.被保证人社会统一信用代码/组织机构代码')" prop="nidgrp.rec.grtjuscod">
								<c-input disabled v-model="model.nidgrp.rec.grtjuscod" maxlength="18" placeholder="请输入被保证人社会统一信用代码/组织机构代码"></c-input>
							</el-form-item>
						</c-col> -->
				</c-col>

				<c-col :span="12" style="padding-left: 20px">
					<!-- ==========================不为swift格式右边=================================== -->
          <!-- <c-ptap :model="model" :isAdrblk="false" :haveAdrLabel="true" :disabled="false" :disabledExtkey="false" :disabledRef="false"
					  :argadr="{title: $t('ptap.受益人'), grp: 'nidgrp', rol: 'ben'}" ptytyp="C" chooseLanguage='CN'></c-ptap>

					<c-col :span="24" v-if="model.nidgrp.rec.hndtyp == 'OC' || model.nidgrp.rec.hndtyp == 'OT'">
						<c-ptap :model="model" :isAdrblk="false" :haveAdrLabel="true" :disabled="false" :disabledExtkey="false" chooseLanguage='CN'
						  :argadr="{  title: $t('ptap.开证行'), grp: 'nidgrp', rol: 'iss'}" ptytyp="B">
						</c-ptap>
					</c-col>
					<c-col :span="24" v-if="model.nidgrp.rec.hndtyp != 'OC' && model.nidgrp.rec.hndtyp != 'OT'">
						<c-ptap :model="model" :isAdrblk="false" :haveAdrLabel="true" :disabled="false" chooseLanguage='CN' :disabledExtkey="false"
						  :argadr="{  title: $t('ptap.通知行'), grp: 'nidgrp', rol: 'adv'}" ptytyp="B">
						</c-ptap>
					</c-col> -->
          <c-col :span="24">
            <c-ptap 
              @handleChange='benChange' 
              :model="model" 
              :isAdrblk="false" 
              :haveAdrLabel="true"
              :required-extkey="true"
              :requiredNam="(model.oldnidgrp.rec.hndtyp == 'OL' || model.oldnidgrp.rec.hndtyp == 'OT') || (model.oldnidgrp.rec.hndtyp == 'OC' && model.oldnidgrp.rec.fenlishi == '')"
              :disabledExtkey="model.oldnidgrp.rec.hndtyp == 'OT'" 
              :noEditNameAndAddress="model.oldnidgrp.rec.hndtyp == 'OT'" 
              :argadr="{title: $t('ptap.受益人'), grp: 'nidgrp', rol: 'ben'}" 
              :ptytyp="model.nidgrp.rec.gartyp == 'F'?'H':(model.nidgrp.rec.hndtyp=='OT'?'C':'F')"
            ></c-ptap>
          </c-col>

						<c-col :span="24" v-if="model.nidgrp.rec.hndtyp == 'OC'">
							<c-ptap :model="model" :isAdrblk="true" :haveAdrLabel="true" 
                :disabled="false" :disabledExtkey="false"
                :argadr="{  title: $t('ptap.转开行'), grp: 'nidgrp', rol: 'iss'}" ptytyp="B" 
                :requiredExtkey="model.nidgrp.rec.hndtyp == 'OC'">
							</c-ptap>
						</c-col>

					<c-col :span="24" v-if="model.nidgrp.rec.hndtyp == 'OT'">
						<c-ptap 
            :model="model" 
            :isAdrblk="true" 
            :haveAdrLabel="true" 
            :disabled="true" 
            :requiredExtkey="model.nidgrp.rec.hndtyp == 'OT'" 
            :argadr="{title: $t('ptap.反担保行'), grp: 'nidgrp', rol: 'iss'}" 
            ptytyp="B">
						</c-ptap>
					</c-col>

						<c-col :span="24" v-if="model.nidgrp.rec.hndtyp =='OL'">
							<c-ptap @handleChange="changeAdvCfaRmbflg" 
              :model="model" 
              :isAdrblk="true" 
              :haveAdrLabel="true"  
              :disabled="false" 
              :disabledExtkey="false"
              :argadr="{  title: '通知行', grp: 'nidgrp', rol: 'adv'}" 
              ptytyp="B">
							</c-ptap>
						</c-col>
				  </c-col>

			</c-col>
		</c-row>

	</div>
</template>
<script>
import event from "../event";
import Default from "../model/default";

export default {
  inject: ["root"],
  props: ["model", "codes"],
  mixins: [event, Default],
  data() {
    return {};
  },
  methods: {},
  created: function() {}
};
</script>
<style scoped lang="less">
.box-card {
  margin-bottom: 10px;
  /deep/ .el-form-item--mini.el-form-item,
  .el-form-item--small.el-form-item {
    margin-bottom: 10px;
  }
  /deep/ .el-card__body {
    padding: 10px 10px 10px 0px;
  }
}
</style>