<template>
	<div class="eibs">
		<c-col :span="24">
			<c-col :span="24" style="padding-left: 20px;padding-right: 20px;">
				<c-col :span="1" class="field">31C</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="请选择请求开证日期" disabled 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">22D</c-col>
				<c-col :span="23" class="fieldName">
					<c-col :span="14">
						<el-form-item label="Form of Undertaking" label-width="200px" prop="gidgrp.rec.legfrmc">
							<c-select :filterKey="['DGAR','STBY']" disabled dbCode="legfrm" placeholder="请选择保函形式" style="width:100%" v-model="model.gidgrp.rec.legfrmc">
							</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">40C</c-col>
				<c-col :span="23">
					<c-col :span="24">
						<c-col :span="14" class="fieldName">
							<el-form-item :label="$t('gitopn.主保函适用规则')" label-width="200px" prop="gidgrp.blk.apprulc">
								<c-select :filterKey="['URDG','UCPR','NONE','OTHR','ISPR']" disabled dbCode="apprul" isShowKeyAndLabel placeholder="请选择主保函适用规则" style="width:100%" v-model="model.gidgrp.blk.apprulc">
								</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.apprultxtc">
								<c-input disabled maxlength="35" style="width:100%" placeholder="请输入主保函适用规则" v-model="model.gidgrp.blk.apprultxtc"></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">22K</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']" disabled dbCode="gartyc" isShowKeyAndLabel 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 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">23B</c-col>
				<c-col :span="23" class="fieldName">
					<c-col :span="14">
						<el-form-item label="Expiry Type" label-width="200px" prop="gidgrp.rec.exptyp">
							<c-select dbCode="exptyp" placeholder="请选择到期类型" style="width:100%" isShowKeyAndLabel disabled v-model="model.gidgrp.rec.exptyp">
							</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">31E</c-col>
				<c-col :span="23" class="fieldName">
					<c-col :span="14">
						<el-form-item  label="Date of Expiry" label-width="200px" prop="gidgrp.rec.expdat">
							<c-date-picker disabled placeholder="请选择保函效期" style="width: 100%" type="date" v-model="model.gidgrp.rec.expdat">
							</c-date-picker>
						</el-form-item>
					</c-col>
					<c-col :span="4">
						<c-checkbox disabled class="checkbox-left" false-label="" style="margin: 0 0 0 10px" true-label="X" v-model="model.gidgrp.rec.expflg">
							效期敞口
						</c-checkbox>
					</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="gidgrp.blk.exptxt" v-if="model.gitp.exptxtmodflg != 'X'">
							<c-mul-row-input :autosize="{ minRows: 4, maxRows: 4}" :cols="65" :rows="12" disabled placeholder="请输入到期条件" v-model="model.gidgrp.blk.exptxt">
							</c-mul-row-input>
						</el-form-item>
						<el-form-item label="Expiry Condition/Event" label-width="200px" prop="gidgrp.blk.atxexptxt" v-if="model.gitp.exptxtmodflg == 'X'">
							<c-mul-row-input :autosize="{ minRows: 4, maxRows: 4}" :cols="65" :rows="12" disabled placeholder="请输入到期条件" v-model="model.gidgrp.blk.atxexptxt">
							</c-mul-row-input>
						</el-form-item>
					</c-col>
					<c-col :span="5" class="fieldName">
						<c-checkbox disabled class="checkbox-left" false-label="" style="margin: 0 0 0 10px" true-label="X" v-model="model.gitp.exptxtmodflg"
                        v-if="model.gidgrp.rec.hndtyp == 'OT'">手工修改
						</c-checkbox>
					</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">50</c-col>
			<c-col :span="23">
				<c-col :span="14" class="fieldName">
					<el-form-item label="Applicant" label-width="200px" style="margin-bottom: 0;" prop="gidgrp.apc.pts.extkey">
						<el-form-item label-width="0" style="margin-bottom: 10px;">
							<c-ptap :argadr="{title: $t('gitopn.申请人'), grp: 'gidgrp', rol: 'apc'}" :disabled="true" :disabledRef="true" :disabledExtkey="true" :model="model" bchinr='00000047' :isFieldLabelVisible="false" ptytyp="C">
							</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">52a</c-col>
			<c-col :span="23">
				<c-col :span="14" class="fieldName">
					<el-form-item label="Issuer" label-width="200px" style="margin-bottom: 0;">
						<el-form-item label-width="0" style="margin-bottom: 10px;">
							<c-ptap :argadr="{title: $t('gitopn.开证行'), grp: 'gidgrp', rol: 'iss'}" :disabled="true" :disabledRef="true" :disabledExtkey="true" :model="model"  :isFieldLabelVisible="false" bchinr='00000036'  ptytyp="B">
							</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">59</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.bec.pts.extkey">
						<el-form-item label-width="0" style="margin-bottom: 10px;">
							<c-ptap :argadr="{title: $t('gitopn.国际受益人'), grp: 'gidgrp', rol: 'bec'}" :haveAdrLabel="true" :isAdrblk="false" :isFieldLabelVisible="false" :model="model" :disabled="true" :disabledRef="true" :disabledExtkey="true" bchinr='00000047' ptytyp="F,C">
							</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">32B</c-col>
			<c-col :span="23">
				<c-col :span="14">
					<c-col :span="14" class="fieldName">
						<el-form-item label="Undertaking Amount" label-width="200px" prop="gidgrp.cbs.mac.cur">
							<c-select dbCode="curtxt" placeholder="请选择保函币种" sort="SRT" style="width:100%" disabled v-model="model.gidgrp.cbs.mac.cur">
							</c-select>
						</el-form-item>
					</c-col>
					<c-col :span="10" class="fieldName">
						<el-form-item label-width="5px" prop="gidgrp.cbs.mac.amt">
							<c-input-currency  placeholder="请输入保函金额" style="width:100%" disabled v-model="model.gidgrp.cbs.mac.amt"></c-input-currency>
						</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.gidgrp.rec.legfrmc == 'STBY'">
			<c-col :span="1" class="field">41a</c-col>
			<c-col :span="23">
				<c-col :span="14" class="fieldName">
					<el-form-item label="Available With..." label-width="200px" style="margin-bottom: 0;">
						<el-form-item label-width="0" style="margin-bottom: 10px;">
							<c-ptap :argadr="{title:$t('gitopn.可用银行'), grp: 'gidgrp', rol: 'avc'}" :disabled="true" :disabledExtkey='true' :disabledRef='true' :isAdrVisible="false" :isFieldLabelVisible="false" :model="model" bchinr='00000047' ptytyp="B">
							</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">71D</c-col>
			<c-col :span="23" class="fieldName">
				<c-col :span="14">
					<el-form-item label="Charges" label-width="200px" prop="gidgrp.blk.feetxtc">
						<c-mul-row-input :autosize="{ minRows: 4, maxRows: 4}" disabled :cols="35" :rows="6" placeholder="请输入收费代码的附加详情" style="width:100%" v-model="model.gidgrp.blk.feetxtc">
						</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">45C</c-col>
			<c-col :span="23">
				<c-col :span="14" class="fieldName over">
					<el-form-item label="Document and Presentation Instructions" label-width="200px" prop="gidgrp.blk.atxpreperc" >
						<c-mul-row-input :autosize="{ minRows: 2, maxRows: 6}" :cols="65" disabled :rows="100" placeholder="请输入交单指示" v-model="model.gidgrp.blk.atxpreperc"></c-mul-row-input>
					</el-form-item>
					<!-- <el-form-item label="Document and Presentation Instructions" label-width="200px" prop="gidgrp.blk.preperc" v-else>
						<c-mul-row-input :autosize="{ minRows: 2, maxRows: 6}" :cols="65" disabled :rows="100"  placeholder="请输入交单指示" v-model="model.gidgrp.blk.preperc"></c-mul-row-input>
					</el-form-item> -->
				</c-col>
				<c-col :span="5">
					<c-checkbox false-label="" style="margin: 0 0 0 10px" true-label="X" disabled v-model="model.gitp.prepercmodflg" v-if="model.gidgrp.rec.hndtyp == 'OT'" class="checkbox-left">手工修改</c-checkbox>
				</c-col>
			</c-col>
		</c-col>

		<c-col :span="24" style="padding-left: 20px;padding-right: 20px;">
			<c-col :span="1" class="field">44H</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 and/or|" label-width="200px" prop="gidgrp.rec.jurlawc">
								<c-select  :isShowKey="true" disabled :filterKey="['CN', 'HK', 'GB']" dbCode="ctytxt" placeholder="请选择适用法律" style="width: 100%" v-model="model.gidgrp.rec.jurlawc">
								</c-select>
							</el-form-item>
						</c-col>
						<c-col :span="12">
							<el-form-item label-width="5px" prop="gidgrp.rec.jurlawtxtc">
								<c-select dbCode="ctytxt" disabled maxlength="35" placeholder="请输入" style="width: 100%" v-model="model.gidgrp.rec.jurlawtxtc">
								</c-select>
							</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.jurplcc">
							<c-input disabled maxlength="35" placeholder="请输入仲裁地" v-model="model.gidgrp.rec.jurplcc"></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">48B</c-col>
			<c-col :span="23" class="fieldName">
				<c-col :span="14">
					<el-form-item label="Demand Indicator" label-width="200px" prop="gidgrp.rec.demandc">
						<c-select dbCode="demand" disabled placeholder="请选择索赔方式 " style="width:100%" v-model="model.gidgrp.rec.demandc">
						</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">45L</c-col>
			<c-col :span="23">
				<c-col :span="14" class="fieldName">
					<el-form-item label="Underlying Transaction Details" label-width="200px" prop="gidgrp.blk.atxcovgodsrvc">
						<c-mul-row-input  disabled :autosize="{ minRows: 4, maxRows: 4}" :charmod="1" :cols="65" :rows="50" placeholder="请输入Underly. Transact. Det." v-model="model.gidgrp.blk.atxcovgodsrvc">
						</c-mul-row-input>
					</el-form-item>
					<!-- <el-form-item label="Underlying Transaction Details" label-width="200px" prop="gidgrp.blk.covgodsrvc" v-else>
						<c-mul-row-input :autosize="{ minRows: 4, maxRows: 4}" :charmod="1" :cols="65" :rows="50" disabled placeholder="请输入合同标的" v-model="model.gidgrp.blk.covgodsrvc">
						</c-mul-row-input>
					</el-form-item> -->
				</c-col>
				<!-- <c-col :span="5">
					<c-checkbox class="checkbox-left" false-label="" style="margin: 0 0 0 10px" true-label="X" @change="changeCovgodsrvcmodflg" v-model="model.gitp.covgodsrvcmodflg"
                      v-if="model.gidgrp.rec.hndtyp == 'OT'">
						手工修改
					</c-checkbox>
				</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 Local Undertaking" label-width="200px" prop="gidgrp.rec.deloric">
							<c-select dbCode="DELORI" placeholder="请选择保函文本交付" style="width: 100%" v-model="model.gidgrp.rec.deloric" disabled 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.deloritxtc">
							<c-input disabled maxlength="35" placeholder="请输入保函文本交付" v-model="model.gidgrp.rec.deloritxtc"></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.deltoc">
							<c-select :filterKey="deltoFilterKey" disabled dbCode="delto" placeholder="请选择交付收款人" style="width: 100%" v-model="model.gidgrp.rec.deltoc">
							</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.blk.deltoadrc">
							<c-mul-row-input :autosize="{ minRows: 4, maxRows: 4}" :cols="35" disabled :rows="6" placeholder="请输入交付地址" style="width:100%" v-model="model.gidgrp.blk.deltoadrc"></c-mul-row-input>
						</el-form-item>
					</c-col>
				</c-col>
			</c-col>
		</c-col>
	</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: {
    changeCovgodsrvcmodflg() {
      if (
        this.model.gitp.covgodsrvcmodflg === "" &&
        this.model.gidgrp.blk.atxcovgodsrvc !== ""
      ) {
        this.$confirm(
          "Do you really want to redefault the standard text?\nIf you confirm all modifications are lost",
          "提示",
          {
            confirmButtonText: "确定",
            cancelButtonText: "取消",
            type: "warning"
          }
        )
          .then(() => {
            this.model.gidgrp.blk.atxcovgodsrvc = "";
          })
          .catch(() => {
            this.model.gitp.covgodsrvcmodflg = "X";
          });
      }
    },
    changePrepercmodflg() {
      if (
        this.model.gitp.prepercmodflg === "" &&
        this.model.gidgrp.blk.preperc !== ""
      ) {
        this.$confirm(
          "Do you really want to redefault the standard text?\nIf you confirm all modifications are lost",
          "提示",
          {
            confirmButtonText: "确定",
            cancelButtonText: "取消",
            type: "warning"
          }
        )
          .then(() => {
            this.model.gidgrp.blk.preperc = "";
          })
          .catch(() => {
            this.model.gitp.prepercmodflg = "X";
          });
      }
    }
  },
  computed: {
    deltoFilterKey() {
      let filterKey = ["OTHR"];
      if (
        this.model.gidgrp.bec.pts.adrblk != null &&
        this.model.gidgrp.bec.pts.adrblk != ""
      ) {
        filterKey.push("BENE");
      }
      return filterKey;
    }
  },
  created: function() {},
  mounted() {
    this.model.gitp.exptxtmodflg = 'X';
    this.model.gitp.prepercmodflg = 'X';
  },
  watch: {
    'model.gidgrp.rec.hndtyp' : function() {
      if(this.model.gidgrp.rec.hndtyp == 'OT'){
        this.model.gitp.covgodsrvcmodflg = 'X';
        this.model.gitp.prepercmodflg = 'X';
      }
    }
  },
};
</script>
<style lang="less" scoped>
.field {
  text-align: left;
  line-height: 32px;
  width: 40px;
}

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

  /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>