<template>
  <div class="eibs">
		<c-col :span="24" style="padding-left: 20px;padding-right: 20px;" v-if="!(model.swiadd.purposame == 'ISUA' || model.swiadd.purposame == 'ISCA' || model.swiadd.purposame == 'ICCA')">
			<c-col :span="1" class="field">20</c-col>
			<c-col :span="23" class="fieldName">
				<c-col :span="14">
					<el-form-item label="Applicant" label-width="200px" style="margin-bottom: 0;">
						<el-form-item v-if="model.oldgidgrp.rec.purposin == 'ISCO' || model.oldgidgrp.rec.purposin == 'ICCO'" label-width="0" style="margin-bottom: 10px;">
							<c-ptap :argadr="{ title: $t('gitame.申请人'), grp: 'oldgidgrp', rol: 'apl' }" :haveAdrLabel="true" :isFieldLabelVisible="false" :model="model" :ptytyp="model.oldgidgrp.rec.hndtyp=='OT'?'B,F':'C'" bchinr='00000047' disabled :disabledRef="true" :disabledExtkey="true">
							</c-ptap>
						</el-form-item>
						<el-form-item v-if="model.oldgidgrp.rec.purposin == 'ISSU' || model.oldgidgrp.rec.purposin == ''" label-width="0" style="margin-bottom: 10px;">
							<c-ptap :argadr="{title: $t('gitame.申请人'), grp: 'oldgidgrp', rol: 'apl'}" :haveAdrLabel="true" :isFieldLabelVisible="false" :model="model" :ptytyp="model.oldgidgrp.rec.hndtyp=='OT'?'B,F':'C'" bchinr='00000047' disabled :disabledRef="true" :disabledExtkey="true">
							</c-ptap>
						</el-form-item>
					</el-form-item>
				</c-col>
			</c-col>
		</c-col>

		<c-col :span="24" style="padding-left: 20px;padding-right: 20px;">
			<c-col :span="1" class="field">26E</c-col>
			<c-col :span="23" class="fieldName">
				<c-col :span="14">
					<el-form-item label="Number of Amendment" label-width="200px" prop="swiadd.amenbr">
						<c-input placeholder="请输入修改次数" type="number" v-model="model.swiadd.amenbr"></c-input>
					</el-form-item>
				</c-col>
			</c-col>
		</c-col>

		<c-col :span="24" style="padding-left: 20px;padding-right: 20px;">
			<c-col :span="1" class="field">30</c-col>
			<c-col :span="23" class="fieldName">
				<c-col :span="14">
					<el-form-item label="Date of Amendment" label-width="200px" prop="swiadd.amedat">
						<c-date-picker placeholder="请选择修改日期" style="width: 100%" type="date" v-model="model.swiadd.amedat" @change="changeOpndat">
						</c-date-picker>
					</el-form-item>
				</c-col>
			</c-col>
		</c-col>

		<c-col :span="24" style="padding-left: 20px;padding-right: 20px;" v-if="model.swiadd.ameamt > 0">
			<c-col :span="1" class="field">32B</c-col>
				<c-col :span="23" class="fieldName">
					<c-col :span="14">
						<c-col :span="14">
							<el-form-item label="Increase of Undertaking Amount" prop="swiadd.amecur" label-width="200px">
								<c-input disabled maxlength="3" placeholder="请输入修改金额" v-model="model.swiadd.amecur"></c-input>
							</el-form-item>
						</c-col>
						<c-col :span="10">
							<el-form-item label-width="5px" prop="swiadd.ameamt">
								<c-input disabled placeholder="请输入" v-model="model.swiadd.ameamt" />
							</el-form-item>
						</c-col>
					</c-col>
				</c-col>
		</c-col>

		<c-col :span="24" style="padding-left: 20px;padding-right: 20px;" v-if="model.swiadd.ameamt < 0">
			<c-col :span="1" class="field">33B</c-col>
				<c-col :span="23" class="fieldName">
					<c-col :span="14">
						<c-col :span="14">
							<el-form-item label="Decrease of Undertaking Amount" prop="swiadd.amecur" label-width="200px">
								<c-input disabled maxlength="3" placeholder="请输入修改金额" v-model="model.swiadd.amecur"></c-input>
							</el-form-item>
						</c-col>
						<c-col :span="10">
							<el-form-item label-width="5px" prop="swiadd.ameamt">
								<c-input disabled placeholder="请输入" v-model="model.swiadd.ameamt" />
							</el-form-item>
						</c-col>
					</c-col>
				</c-col>
		</c-col>

		<c-col :span="24" style="padding-left: 20px;padding-right: 20px;">
			<c-col :span="1" class="field">23B</c-col>
			<c-col :span="23">
				<c-col :span="14" class="fieldName">
					<el-form-item label="Expiry Type" label-width="200px" prop="swiadd.liatypc" v-if="model.swiadd.purposame == 'ISCA' || model.swiadd.purposame == 'ICCA'">
						<c-select dbCode="exptyp" v-model="model.swiadd.liatypc" style="width: 100%" :disabled="model.oldgidgrp.rec.hndtyp!='OC'&&model.oldgidgrp.rec.purpos.indexOf('CO')==-1" placeholder="请选择" @change="changeLiatypc">
						</c-select>
					</el-form-item>
					<el-form-item label="Expiry Type" label-width="200px" prop="swiadd.exptyp" v-else>
						<c-select dbCode="exptyp" v-model="model.swiadd.exptyp" style="width: 100%" placeholder="请选择" @change="changeExptyp">
						</c-select>
					</el-form-item>
				</c-col>
			</c-col>
		</c-col>

		<c-col :span="24" style="padding-left: 20px;padding-right: 20px;" v-if="((model.swiadd.purposame == 'ISCA' || model.swiadd.purposame == 'ICCA') && (model.swiadd.newliadat !== '' && model.swiadd.newliadat !== null )) || (!(model.swiadd.purposame == 'ISCA' || model.swiadd.purposame == 'ICCA') && (model.swiadd.newexpdat !== '' && model.swiadd.newexpdat !== null))">
			<c-col :span="1" class="field">31E</c-col>
			<c-col :span="23">
				<c-col :span="14" class="fieldName">
					<el-form-item label="Date of Expiry" label-width="200px" prop="swiadd.newliadat" v-if="(model.swiadd.purposame == 'ISCA' || model.swiadd.purposame == 'ICCA') && (model.swiadd.newliadat !== '' && model.swiadd.newliadat !== null)">
						<c-date-picker :disabled="model.swiadd.liatypc != 'FIXD' && model.swiadd.liatypc != 'COND' " type="date" v-model="model.swiadd.newliadat" style="width: 100%" placeholder="请输入新责任期" @change="newliadatChange">
						</c-date-picker>
					</el-form-item>
					<el-form-item label="Date of Expiry" label-width="200px" prop="swiadd.newexpdat" v-if="!(model.swiadd.purposame == 'ISCA' || model.swiadd.purposame == 'ICCA') && (model.swiadd.newexpdat !== '' && model.swiadd.newexpdat !== null)">
						<c-date-picker :disabled="model.swiadd.exptyp != 'FIXD' && model.swiadd.exptyp != 'COND'" type="date" @change="defaultCfaflg" v-model="model.swiadd.newexpdat" style="width: 100%" placeholder="请选择">
						</c-date-picker>
					</el-form-item>
				</c-col>
			</c-col>
		</c-col>

		<c-col :span="24" style="padding-left: 20px;padding-right: 20px;">

			<c-col :span="1" class="field">35G</c-col>
			<c-col :span="23">
				<c-col :span="14" class="fieldName">
					<el-form-item label="Expiry Condition/Event" label-width="200px" prop="swiadd.liatxtc" v-if="model.swiadd.purposame == 'ISCA' || model.swiadd.purposame == 'ICCA'">
						<c-mul-row-input @change="liatxtcChange" :disabled="model.swiadd.liatypc != 'COND'" :charmod="2"  :autosize="{ minRows: 4, maxRows: 4}" :rows="12" :cols="65" placeholder="请输入新责任条件" v-model="model.swiadd.liatxtc">
						</c-mul-row-input>
					</el-form-item>
					<el-form-item label="Expiry Condition/Event" label-width="200px" prop="swiadd.exptxt" v-else>
						<c-mul-row-input @change="exptxtChange" :disabled="model.swiadd.exptyp != 'COND'" :charmod="2" :autosize="{ minRows: 4, maxRows: 4}" :rows="12" :cols="65" placeholder="请输入新到期条件" v-model="model.swiadd.exptxt">
						</c-mul-row-input>
					</el-form-item>
				</c-col>
			</c-col>
		</c-col>

		<c-col :span="24" style="padding-left: 20px;padding-right: 20px;">
			<c-col :span="1" class="field">59a</c-col>
			<c-col :span="23">
				<c-col :span="14" class="fieldName">
					<el-form-item label="Beneficiary" label-width="200px" style="margin-bottom: 0;" prop="gidgrp.ben.pts.extkey">
						<el-form-item label-width="0" style="margin-bottom: 10px;">
							<c-ptap
								:argadr="{ title:$t('gitame.受益人'), grp: 'gidgrp', rol: 'ben'}"
								:haveAdrLabel="true"
								:isAdrblk="model.oldgidgrp.rec.purpos == 'ICCO'? true : false"
								:isFieldLabelVisible="false" :model="model"
								:ptytyp="model.oldgidgrp.rec.purposin == 'ISCO'? 'B,C,F': (model.oldgidgrp.rec.purpos == 'ISSU'? (model.oldgidgrp.rec.legfrm == 'STBY' && model.oldgidgrp.rec.gartyp == 'G' ? 'B':'B,F,C'):'B')"
								bchinr='00000047'
								:noEditNameAndAddress="((model.swiadd.purposame == 'ISCA' || model.swiadd.purposame == 'ICCA') && model.swiadd.addamtflgc == 'X')||codes.sndflgJudgement =='X'"
								:disabled="((model.swiadd.purposame == 'ISCA' || model.swiadd.purposame == 'ICCA') && model.swiadd.addamtflgc == 'X')||codes.sndflgJudgement =='X'"
								:disabledRef="((model.swiadd.purposame == 'ISCA' || model.swiadd.purposame == 'ICCA') && model.swiadd.addamtflgc == 'X')||codes.sndflgJudgement =='X'"
								:disabledExtkey="((model.swiadd.purposame == 'ISCA' || model.swiadd.purposame == 'ICCA') && model.swiadd.addamtflgc == 'X')||codes.sndflgJudgement =='X'"
                @handleChange="changeBenCfaRmbflg"
							></c-ptap>
						</el-form-item>
					</el-form-item>
				</c-col>
			</c-col>
		</c-col>

		<c-col :span="24" style="padding-left: 20px;padding-right: 20px;">
			<c-col :span="1" class="field">24E</c-col>
			<c-col :span="23">
				<c-col :span="24">
					<c-col :span="14" class="fieldName">
						<el-form-item label="Delivery of Original Undertaking" label-width="200px" prop="gidgrp.rec.delori">
							<c-select :disabled="model.oldgidgrp.rec.purpos == 'ISCO' || model.oldgidgrp.rec.purpos == 'ICCO'" dbCode="delori" placeholder="请选择保函文本交付" style="width: 100%" v-model="model.gidgrp.rec.delori"
									  @change="defaultDeloritxt" isShowKeyAndLabel>
							</c-select>
						</el-form-item>
					</c-col>
				</c-col>
				<c-col :span="24">
					<c-col :span="14">
						<el-form-item label-width="200px" prop="gidgrp.rec.deloritxt">
							<c-input :disabled="(model.gidgrp.rec.delori !== 'COUR' && model.gidgrp.rec.delori !== 'OTHR')||(model.oldgidgrp.rec.purpos == 'ISCO' || model.oldgidgrp.rec.purpos == 'ICCO')"
									 maxlength="35" placeholder="请输入保函文本交付" v-model="model.gidgrp.rec.deloritxt"></c-input>
						</el-form-item>
					</c-col>
				</c-col>
			</c-col>
		</c-col>

		<c-col :span="24" style="padding-left: 20px;padding-right: 20px;">
			<c-col :span="1" class="field">24G</c-col>
			<c-col :span="23">
				<c-col :span="24">
					<c-col :span="14" class="fieldName">
						<el-form-item label="Delivery To/Collection By" label-width="200px" prop="gidgrp.rec.delto">
							<c-select :disabled="model.oldgidgrp.rec.purpos === 'ISCO' || model.oldgidgrp.rec.purpos === 'ICCO'" :filterKey="deltoFilterKey" dbCode="delto" placeholder="请选择交付收款人" style="width: 100%" v-model="model.gidgrp.rec.delto"></c-select>
						</el-form-item>
					</c-col>
				</c-col>
			</c-col>
		</c-col>

		<c-col :span="24" style="padding-left: 20px;padding-right: 20px;">
			<c-col :span="1" class="field"></c-col>
			<c-col :span="23">
				<c-col :span="24" class="fieldName">
					<c-col :span="14">
						<el-form-item label="" label-width="200px" prop="gidgrp.blk.deltoadr">
							<c-mul-row-input :autosize="{ minRows: 4, maxRows: 4}" :charmod="3" :cols="65" :disabled="model.oldgidgrp.rec.purpos === 'ISCO' || model.oldgidgrp.rec.purpos === 'ICCO'" :isRequired="model.gidgrp.rec.delto==='OTHR'" :rows="12" placeholder="请输入交付地址" v-model="model.gidgrp.blk.deltoadr"></c-mul-row-input>
						</el-form-item>
					</c-col>
				</c-col>
			</c-col>
		</c-col>

		<c-col :span="24" style="padding-left: 20px;padding-right: 20px;">
			<c-col :span="1" class="field">Other</c-col>
			<c-col :span="23">
				<c-col :span="24" class="fieldName">
					<c-col :span="14">
						<el-form-item label="Amendment" label-width="200px" >
						</el-form-item>
					</c-col>
				</c-col>
			</c-col>
		</c-col>

		<!-- <c-col :span="24" style="padding-left: 20px;padding-right: 20px;">
			<c-col :span="1" class="field">&nbsp;</c-col>
			<c-col :span="23" class="fieldName">
				<c-col :span="14">
					<el-form-item label="Requested Date of Issue" label-width="200px" prop="gidgrp.rec.opndatc">
						<c-date-picker placeholder="请选择请求开证日期" style="width:100%" type="date" v-model="model.gidgrp.rec.opndatc">
						</c-date-picker>
					</el-form-item>
				</c-col>
			</c-col>
		</c-col>

		<c-col :span="24" style="padding-left: 20px;padding-right: 20px;">
			<c-col :span="1" class="field">&nbsp;</c-col>
			<c-col :span="23">
				<c-col :span="24">
					<c-col :span="14" class="fieldName">
						<el-form-item label="Type of Undertaking" label-width="200px" prop="gidgrp.rec.gartypc">
							<c-select :filterKey="['APAY','PAYM','PERF','TEND','WARR']" @change="changeGartypc" dbCode="gartyc" placeholder="请选择保函类型 " style="width:100%" v-model="model.gidgrp.rec.gartypc">
							</c-select>
						</el-form-item>
					</c-col>
				</c-col>
				<c-col :span="24">
					<c-col :span="14" class="fieldName" v-if="model.gidgrp.rec.gartypc == 'OTHER'">
						<el-form-item label-width="200px" prop="gidgrp.rec.gartyptxtc">
							<c-input :disabled="model.gidgrp.rec.gartypc!='OTHER'" placeholder="请输入保函类型 " v-model="model.gidgrp.blk.gartyptxtc">
							</c-input>
						</el-form-item>
					</c-col>
				</c-col>
			</c-col>
		</c-col> -->

		<c-col :span="24" style="padding-left: 20px;padding-right: 20px;">
			<c-col :span="1" class="field">&nbsp;</c-col>
			<c-col :span="23">
				<c-col :span="14" class="fieldName">
					<el-form-item label="Demand Indicator" label-width="200px" prop="gidgrp.rec.demand">
						<c-select dbCode="demand" placeholder="请选择索赔方式" style="width: 100%" v-model="model.gidgrp.rec.demand" @change="seqBSynToSeqB">
						</c-select>
					</el-form-item>
				</c-col>
			</c-col>
		</c-col>

		<c-col :span="24" style="padding-left: 20px;padding-right: 20px;">
			<c-col :span="1" class="field">&nbsp;</c-col>
			<c-col :span="23">
				<c-col :span="24">
					<c-col :span="14" class="fieldName"> 
						<el-form-item label="Applicable Rules" label-width="200px" prop="gidgrp.blk.apprul">
							<c-select :filterKey="model.gidgrp.rec.legfrm=='DGAR' ? ['URDG','NONE','OTHR','UCPR'] : ['URDG','NONE','OTHR','ISPR','UCPR']" dbCode="apprul" isShowKeyAndLabel placeholder="请选择申请条款" style="width: 100%" v-model="model.gidgrp.blk.apprul" @change="apprulChange($event)">
							</c-select>
						</el-form-item>
					</c-col>
				</c-col>
				<c-col :span="24">
					<c-col :span="14" class="fieldName">
						<el-form-item label-width="200px" prop="gidgrp.blk.apprultxt">
							<c-input :disabled="model.gidgrp.blk.apprul!='OTHR'" maxlength="35" style="width:100%" placeholder="请输入申请条款" v-model="model.gidgrp.blk.apprultxt" @blur="seqBSynToSeqB"></c-input>
						</el-form-item>
					</c-col>
				</c-col>
			</c-col>
		</c-col>

		<c-col :span="24" style="padding-left: 20px;padding-right: 20px;">
			<c-col :span="1" class="field">&nbsp;</c-col>
			<c-col :span="23" class="fieldName">
				<c-col :span="24">
					<c-col :span="14">
						<el-form-item :label="$t('gitopn.费用承担人')" label-width="200px" prop="gidgrp.rec.chato">
							<c-select dbCode="chato" placeholder="请选择费用承担人" style="width: 100%" v-model="model.gidgrp.rec.chato">
							</c-select>
						</el-form-item>
					</c-col>
				</c-col>
				<c-col :span="24">
					<c-col :span="14">
						<el-form-item label="Charges" label-width="200px" prop="gidgrp.blk.feetxt">
							<c-fullbox>
								<c-mul-row-input :autosize="{ minRows: 2, maxRows: 4}" :cols="35" :rows="6" :charmod="3" placeholder="请输入收费代码的附加详情" v-model="model.gidgrp.blk.feetxt"></c-mul-row-input>
								<template slot="footer">
									<c-button style="margin-left: 10px;" icon="el-icon-more" size="small" type="primary"></c-button>
								</template>
							</c-fullbox>
						</el-form-item>
					</c-col>
				</c-col>
			</c-col>
		</c-col>

		<c-col :span="24" style="padding-left: 20px;padding-right: 20px;">
			<c-col :span="1" class="field">&nbsp;</c-col>
			<c-col :span="23" class="fieldName">
				<c-col :span="24">
					<c-col :span="14">
						<c-col :span="12">
							<el-form-item label="Governing Law" label-width="200px" prop="gidgrp.rec.jurlaws20">
								<c-select :filterKey="['CN', 'HK', 'GB']" :isShowKey="true" @change="changeJurlaws20" dbCode="ctytxt" placeholder="请选择适用法律" style="width: 100%" v-model="model.gidgrp.rec.jurlaws20">
								</c-select>
							</el-form-item>
						</c-col>
						<c-col :span="12">
							<el-form-item label-width="5px" prop="gidgrp.rec.jurlaw">
								<c-input :disabled="model.gidgrp.rec.jurlaws20 === ''" maxlength="35" placeholder="请输入" style="width: 100%" v-model="model.gidgrp.rec.jurlaw">
								</c-input>
							</el-form-item>
						</c-col>
					</c-col>
				</c-col>
				<c-col :span="24">
					<c-col :span="14">
						<el-form-item :label="$t('gitopn.仲裁地')" label-width="200px" prop="gidgrp.rec.jurplc">
							<c-input :disabled="model.gidgrp.rec.jurlaws20 === ''" maxlength="65" placeholder="请输入仲裁地" v-model="model.gidgrp.rec.jurplc"></c-input>
						</el-form-item>
					</c-col>
				</c-col>
			</c-col>
		</c-col>
	</div>
</template>
<script>
import event from "../event";
import Default from "../model/default";
import commonFunctions from "~/mixin/commonFunctions.js";

export default {
  inject: ["root"],
  props: ["model", "codes"],
  mixins: [event, Default, commonFunctions],
  data() {
    return {
      frameList: [],
      frameData: {}
    };
  },
  methods: {},
  mounted() {},
  computed: {
    deltoFilterKey() {
      let filterKey = ["OTHR"];
      if (
        this.model.oldgidgrp.ben.pts.adrblk != null &&
        this.model.oldgidgrp.ben.pts.adrblk != ""
      ) {
        filterKey.push("BENE");
      }
      if (
        this.model.oldgidgrp.ctr.pts.adrblk != null &&
        this.model.oldgidgrp.ctr.pts.adrblk != ""
      ) {
        filterKey.push("OBLI");
      }
      return filterKey;
    }
  },
  created: function() {}
};
</script>
<style lang="less" scoped>
.el-textarea .el-textarea__inner {
  height: 100px;
}

.page-wrap {
  width: 100%;
  height: 100%;
  position: absolute;
  left: 0;
  top: 0;
  padding: 2px;
  box-sizing: border-box;
  display: flex;
  align-items: flex-start;
  justify-content: flex-start;
  flex-direction: column;
  border: 1px solid #707070;

  .form-content {
    width: 100%;
    flex: 1;
    position: relative;
    border: 1px solid #b1b1b1;
    overflow-y: auto;
    background-color: #fff;
    padding: 5px 0;
  }
}

.field {
  text-align: left;
  line-height: 32px;
	width: 40px;
	height: 32px;
}

.fieldName {
  /deep/ .el-form-item--small .el-form-item__label {
    width: 200px !important;
		justify-content: flex-start;
		text-align: left;
  }

  /deep/ .el-date-editor.el-input {
    width: 90%;
  }

  /deep/ .el-select {
    width: 90%;
  }
}
.over {
  /deep/ .el-form-item--small .el-form-item__label {
    text-align: left;
  }
}
</style>