<template>
  <div class="eibs">
    <!-- ==============左边=========== -->
    <c-col :span="12" style="padding-right: 20px">
      <c-col :span="24">
        <el-form-item
          label="汇款编号"
          prop="cpdgrp.rec.ownref"
          style="width: 100%"
        >
          <c-fullbox>
            <c-input
              v-model="model.cpdgrp.rec.ownref"
              maxlength="16"
              placeholder="请输入汇款编号"
              disabled
            ></c-input>
            <template slot="footer">
              <c-button
                style="margin: 0 10px 0 10px; padding: 0 12px"
                size="small"
                type="primary"
              >
                <i class="el-icon-info"></i>
              </c-button>
              <c-button
                style="margin: 0 0"
                size="small"
                type="primary"
                :disabled="this.flag"
                @click="onAttpGetref"
              >
                获取
              </c-button>
            </template>
          </c-fullbox>
        </el-form-item>
      </c-col>

      <c-col :span="24">
        <c-col :span="12">
          <el-form-item label="汇款金额" prop="cpdgrp.cbs.nom1.cur">
            <c-select
              v-model="model.cpdgrp.cbs.nom1.cur"
              style="width: 100%"
              placeholder="请选择汇款金额"
            >
              <el-option
                v-for="item in codes.curtxt1"
                :key="item.value"
                :label="item.label"
                :value="item.value"
              >
              </el-option>
            </c-select>
          </el-form-item>
        </c-col>

        <c-col :span="12">
          <el-form-item
            style="text-align: left"
            label-width="5px"
            prop="cpdgrp.cbs.nom1.amt"
          >
            <c-input-currency
              v-model="model.cpdgrp.cbs.nom1.amt"
              style="text-align: left; width: 100%"
              placeholder="请输入汇款金额"
              @keyup.enter.native="
                defaultFunction(
                  'cpdgrp.cbs.nom1.amt',
                  model.cpdgrp.cbs.nom1.amt
                )
              "
            ></c-input-currency>
          </el-form-item>
        </c-col>
      </c-col>

      <c-col :span="24">
        <c-col :span="12">
          <el-form-item label="是否需要核验" prop="cpdgrp.rec.ischktyp">
            <c-select
              v-model="model.cpdgrp.rec.ischktyp"
              style="width: 100%"
              placeholder="请选择是否需要核验"
            >
              <el-option
                v-for="item in codes.ischktyp"
                :key="item.value"
                :label="item.label"
                :value="item.value"
              >
              </el-option>
            </c-select>
          </el-form-item>
        </c-col>

        <c-col :span="12">
          <el-form-item label="预计核验日期" prop="cpdgrp.rec.prechkdat">
            <c-date-picker
              type="date"
              v-model="model.cpdgrp.rec.prechkdat"
              style="width: 100%"
              placeholder="请选择PRECHKDAT"
              :disabled="
                model.cpdgrp.rec.ischktyp == '' ||
                model.cpdgrp.rec.ischktyp == 'N'
              "
            ></c-date-picker>
          </el-form-item>
        </c-col>
      </c-col>

      <c-col :span="24">
        <c-col :span="24">
          <el-form-item label="汇款人账户性质" prop="attp.acctyp">
            <c-select
              v-model="model.attp.acctyp"
              style="width: 100%"
              placeholder="请选择汇款人账户性质"
            >
              <el-option
                v-for="item in codes.acctyp1"
                :key="item.value"
                :label="item.label"
                :value="item.value"
              >
              </el-option>
            </c-select>
          </el-form-item>
        </c-col>
      </c-col>

      <c-col :span="24">
        <c-col :span="12">
          <el-form-item label="所属行" prop="cpdgrp.rec.othbch">
            <c-input
              v-model="model.cpdgrp.rec.othbch"
              maxlength="8"
              placeholder="请输入所属行"
              disabled
            ></c-input>
          </el-form-item>
        </c-col>

        <c-col :span="12">
          <el-form-item label="汇款语种" prop="attp.payuil">
            <c-select
              v-model="model.attp.payuil"
              style="width: 100%"
              placeholder="请选择汇款语种"
            >
              <el-option
                v-for="item in codes.payuil"
                :key="item.value"
                :label="item.label"
                :value="item.value"
              >
              </el-option>
            </c-select>
          </el-form-item>
        </c-col>
      </c-col>

      <c-col :span="24">
        <c-col :span="24">
          <el-form-item label="业务种类" prop="attp.bustyp">
            <c-select
              v-model="model.attp.bustyp"
              style="width: 100%"
              placeholder="请选择业务种类"
            >
              <el-option
                v-for="item in bustyp1"
                :key="item.value"
                :label="item.label"
                :value="item.value"
              >
              </el-option>
            </c-select>
          </el-form-item>
        </c-col>
      </c-col>

      <c-col :span="24">
        <c-col :span="12">
          <el-form-item label="清算编号" prop="attp.sysno">
            <c-input
              v-model="model.attp.sysno"
              maxlength="21"
              placeholder="请输入清算编号"
              disabled
            ></c-input>
          </el-form-item>
        </c-col>

        <c-col :span="12">
          <el-form-item
            label="收款人常驻国家/地区代码"
            prop="attp.paycountcode"
            label-width="119px"
          >
          <c-fullbox>
            <c-input
              v-model="model.attp.paycountcode"
              filterable
              style="width: 100%"
              placeholder="收款人常驻国家/地区代码"
              @keyup.enter.native="showGridPromptDialog('attp.paycountcode')"
            >
            </c-input>
            <template slot="footer">
              <c-button
                style="margin-left: 10px;"
                size="small"
                type="primary"
                icon="el-icon-search"
              >
              </c-button>
            </template>
          </c-fullbox>
          </el-form-item>
        </c-col>
      </c-col>

      <c-col :span="24">
        <c-col :span="24">
          <el-form-item label="汇款人名称" prop="attp.orcnam">
            <c-input
              v-model="model.attp.orcnam"
              maxlength="65"
              show-word-limit
              placeholder="请输入汇款人名称"
              :disabled="model.attp.swftyp == ''"
            ></c-input>
          </el-form-item>
        </c-col>
      </c-col>

      <c-col :span="24">
        <c-col :span="24">
          <el-form-item label="汇款人地址" prop="attp.orcadr">
            <c-input
              v-model="model.attp.orcadr"
              maxlength="265"
              show-word-limit
              placeholder="请输入汇款人地址"
              :disabled="model.attp.swftyp == ''"
            ></c-input>
          </el-form-item>
        </c-col>
      </c-col>

      <c-col :span="24">
        <c-col :span="24">
          <el-form-item label="收款人名称" prop="attp.pyenam">
            <c-input
              v-model="model.attp.pyenam"
              maxlength="265"
              show-word-limit
              placeholder="请输入收款人名称"
              :disabled="model.attp.swftyp == ''"
            ></c-input>
          </el-form-item>
        </c-col>
      </c-col>

      <c-col :span="24">
        <c-col :span="24">
          <el-form-item label="收款人地址" prop="attp.pyeadr">
            <c-input
              v-model="model.attp.pyeadr"
              maxlength="265"
              show-word-limit
              placeholder="请输入收款人地址"
              :disabled="model.attp.swftyp == ''"
            ></c-input>
          </el-form-item>
        </c-col>
      </c-col>

      <c-col :span="24">
        <c-col :span="24">
          <el-form-item label="汇款人帐号" prop="cpdgrp.rec.orcact">
            <c-input
              v-model="model.cpdgrp.rec.orcact"
              maxlength="235"
              placeholder="请输入汇款人帐号"
              :disabled="model.attp.swftyp == ''"
            ></c-input>
          </el-form-item>
        </c-col>
      </c-col>

      <c-col :span="24">
        <el-form-item
          label="汇款人"
          prop="cpdgrp.orc.pts.extkey"
          style="width: 100%"
        >
          <c-fullbox>
            <c-input
              v-model="model.cpdgrp.orc.pts.extkey"
              maxlength="216"
              placeholder="请输入"
              :disabled="model.attp.swftyp == ''"
              @keyup.enter.native="
                showGridPromptDialog('cpdgrp.orc.pts.extkey')
              "
            ></c-input>
            <template slot="footer">
              <c-button
                style="margin: 0 10px 0 10px; padding: 0 12px"
                size="small"
                type="primary"
              >
                <i class="el-icon-info" style="font-size: 15px"></i>
              </c-button>
              <c-button
                style="margin: 0 0"
                size="small"
                type="primary"
                :disabled="this.flag"
              >
                获取
              </c-button>
            </template>
          </c-fullbox>
        </el-form-item>
      </c-col>
      <c-col :span="24">
        <c-col :span="24">
          <el-form-item label="地址信息" prop="cpdgrp.orc.pts.adrblk">
            <c-input
              type="textarea"
              v-model="model.cpdgrp.orc.pts.adrblk"
              maxlength="235"
              show-word-limit
              placeholder="请输入地址信息"
              disabled
            ></c-input>
          </el-form-item>
        </c-col>
      </c-col>
    </c-col>
    <!-- ===============================右边============================= -->
    <c-col :span="12" style="padding-left: 20px">
      <c-col :span="24">
        <c-col :span="24">
          <el-form-item label="简略信息" prop="cpdgrp.rec.nam">
            <c-input
              v-model="model.cpdgrp.rec.nam"
              maxlength="240"
              placeholder="请输入简略信息"
              disabled
            ></c-input>
          </el-form-item>
        </c-col>
      </c-col>

      <c-col :span="24">
        <c-col :span="12">
          <el-form-item label="汇款性质" prop="cpdgrp.rec.trntyp">
            <c-select
              v-model="model.cpdgrp.rec.trntyp"
              style="width: 100%"
              placeholder="请选择汇款性质"
            >
              <el-option
                v-for="item in codes.trntyp1"
                :key="item.value"
                :label="item.label"
                :value="item.value"
              >
              </el-option>
            </c-select>
          </el-form-item>
        </c-col>

        <c-col :span="12">
          <el-form-item label="汇款方式" prop="cpdgrp.rec.paytype">
            <c-select
              v-model="model.cpdgrp.rec.paytype"
              style="width: 100%"
              placeholder="请选择汇款方式"
            >
              <el-option
                v-for="item in codes.paytype"
                :key="item.value"
                :label="item.label"
                :value="item.value"
              >
              </el-option>
            </c-select>
          </el-form-item>
        </c-col>
      </c-col>

      <c-col :span="24">
        <c-col :span="12">
          <el-form-item label="收款对象" prop="cpdgrp.rec.gors">
            <c-select
              v-model="model.cpdgrp.rec.gors"
              style="width: 100%"
              placeholder="请选择收款对象"
            >
              <el-option
                v-for="item in codes.gors"
                :key="item.value"
                :label="item.label"
                :value="item.value"
              >
              </el-option>
            </c-select>
          </el-form-item>
        </c-col>

        <c-col :span="12">
          <el-form-item label="费用类型" prop="attp.feetyp">
            <c-select
              v-model="model.attp.feetyp"
              style="width: 100%"
              placeholder="请选择费用类型"
              disabled
            >
              <el-option
                v-for="item in codes.feetyp"
                :key="item.value"
                :label="item.label"
                :value="item.value"
              >
              </el-option>
            </c-select>
          </el-form-item>
        </c-col>
      </c-col>

      <c-col :span="24">
        <c-col :span="12">
          <el-form-item label="起息日期" prop="attp.opndat">
            <c-date-picker
              type="date"
              v-model="model.attp.opndat"
              style="width: 100%"
              placeholder="请选择起息日期"
            ></c-date-picker>
          </el-form-item>
        </c-col>

        <c-col :span="12">
          <el-form-item label="委托日期" prop="cpdgrp.rec.valdat">
            <c-date-picker
              type="date"
              v-model="model.cpdgrp.rec.valdat"
              style="width: 100%"
              placeholder="请选择有效期"
            ></c-date-picker>
          </el-form-item>
        </c-col>
      </c-col>

      <c-col :span="24">
        <c-col :span="12">
          <el-form-item label="客户类型" prop="cpdgrp.rec.clityp">
            <c-select
              v-model="model.cpdgrp.rec.clityp"
              style="width: 100%"
              placeholder="请选择客户类型"
            >
              <el-option
                v-for="item in codes.clityp"
                :key="item.value"
                :label="item.label"
                :value="item.value"
              >
              </el-option>
            </c-select>
          </el-form-item>
        </c-col>

        <c-col :span="12">
          <el-form-item label="报文类型" prop="attp.swftyp">
            <c-select
              v-model="model.attp.swftyp"
              style="width: 100%"
              placeholder="请选择报文类型"
            >
              <el-option
                v-for="item in swftyp"
                :key="item.value"
                :label="item.label"
                :value="item.value"
              >
              </el-option>
            </c-select>
          </el-form-item>
        </c-col>
      </c-col>

      <c-col :span="24">
        <c-row type="flex" justify="end">
          <c-col :span="12">
            <el-form-item label="相关参考号" prop="" v-show="flag1">
              <c-input v-model="model.attp.xnggbh"></c-input>
            </el-form-item>
          </c-col>
          <c-col :span="10" :offset="2" style="text-align: right">
            <el-form-item label="" prop="">
            <c-checkbox v-model="model.cpdgrp.rec.tsnflg"
              >同名划转标志</c-checkbox
            >
            </el-form-item>
          </c-col>
        </c-row>
      </c-col>

      <c-col :span="24">
        <c-col :span="24">
          <el-form-item label="接收行名称" prop="attp.resbchnam">
            <c-input
              v-model="model.attp.resbchnam"
              maxlength="242"
              placeholder="请输入接收行名称"
              @keyup.enter.native="showGridPromptDialog('attp.resbchnam')"
            ></c-input>
          </el-form-item>
        </c-col>
      </c-col>

      <c-col :span="24">
        <c-col :span="24">
          <el-form-item label="接收行BIC" prop="attp.resbch">
            <c-input
              v-model="model.attp.resbch"
              maxlength="211"
              placeholder="请输入接收行BIC"
              disabled
            ></c-input>
          </el-form-item>
        </c-col>
      </c-col>

      <c-col :span="24">
        <c-col :span="24">
          <el-form-item label="发报行名称" prop="attp.sndbchnam">
            <c-input
              v-model="model.attp.sndbchnam"
              maxlength="42"
              placeholder="请输入发报行名称"
              disabled
            ></c-input>
          </el-form-item>
        </c-col>
      </c-col>

      <c-col :span="24">
        <c-col :span="24">
          <el-form-item label="发报行BIC" prop="attp.sndbch">
            <c-input
              v-model="model.attp.sndbch"
              maxlength="11"
              placeholder="请输入发报行BIC"
              disabled
            ></c-input>
          </el-form-item>
        </c-col>
      </c-col>

      <c-col :span="24">
        <c-col :span="24">
          <el-form-item label="收款人帐号" prop="cpdgrp.rec.pyeact">
            <c-input
              v-model="model.cpdgrp.rec.pyeact"
              maxlength="35"
              placeholder="请输入收款人帐号"
            ></c-input>
          </el-form-item>
        </c-col>
      </c-col>

      <c-col :span="24">
        <el-form-item label="收款人" prop="cpdgrp.pye.pts.extkey">
          <c-fullbox>
            <c-input
              v-model="model.cpdgrp.pye.pts.extkey"
              maxlength="16"
              placeholder="请输入收款人名称"
              @keyup.enter.native="
                showGridPromptDialog('cpdgrp.pye.pts.extkey')
              "
            ></c-input>
            <template slot="footer">
              <c-button
                style="margin: 0 10px 0 10px; padding: 0 12px"
                size="small"
                type="primary"
              >
                <i class="el-icon-info" style="font-size: 15px"></i>
              </c-button>
              <c-button size="small" type="primary" style="margin: 0 0">
                详情
              </c-button>
            </template>
          </c-fullbox>
        </el-form-item>
      </c-col>

      <c-col :span="24">
        <c-col :span="24">
          <el-form-item label="地址信息" prop="cpdgrp.pye.pts.adrblk">
            <c-input
              type="textarea"
              v-model="model.cpdgrp.pye.pts.adrblk"
              maxlength="35"
              show-word-limit
              placeholder="请输入地址信息"
            ></c-input>
          </el-form-item>
        </c-col>
      </c-col>
    </c-col>
  </div>
</template>
<script>
import Api from "~/service/Api";
import commonProcess from "~/mixin/commonProcess";
import CodeTable from "~/config/CodeTable";
import Event from "~/model/Cptato/Event";

export default {
  inject: ["root"],
  props: ["model", "codes"],
  mixins: [commonProcess],
  data() {
    return {
      bustyp1: [
        { label: "01-支付运保费", value: "01" },
        { label: "02-代理进出口", value: "02" },
        { label: "03-与特殊经济区企业资金往来", value: "03" },
        { label: "04-同一企业不同账户资金划转", value: "04" },
        { label: "05-归还国内贷款或转贷款", value: "05" },
        { label: "06-贸易深加工结转业务", value: "06" },
        { label: "07-贸易融资业务", value: "07" },
        { label: "08-其他", value: "08" },
      ],
      swftyp: [
        { label: "FMT100", value: "100" },
        { label: "FMT200", value: "200" },
      ],
    };
  },
  methods: { ...Event },
  created: function () {},
  computed: {
    flag() {
      return this.model.cpdgrp.orc.pts.extkey == "";
    },
    flag1() {
      if (this.model.attp.swftyp == "200") {
        return true;
      } else {
        return false;
      }
    },
  },
};
</script>
<style>
</style>