<template>
  <div class="eibs-tab">
    <c-row>
      <!-- <c-col :span="22" :offset="1"> -->
      <c-col :span="12">
        <c-row>
          <c-col :span="15">
            <el-form-item label="信用证参考号" prop="didgrp.rec.ownref">
              <c-input
                :disabled="true"
                v-model="model.didgrp.rec.ownref"
                maxlength="16"
                placeholder="请输入参考号"
              ></c-input>
            </el-form-item>
          </c-col>

          <c-col :span="9" style="margin-left: -65px">
            <el-form-item
              style="width: 120%"
              label="到期日"
              prop="didgrp.rec.expdat"
            >
              <c-date-picker
                :disabled="true"
                style="width: 120%"
                type="date"
                v-model="model.didgrp.rec.expdat"
                placeholder="请选择到期日"
              ></c-date-picker>
            </el-form-item>
          </c-col>
        </c-row>
      </c-col>

      <c-col :span="12">
        <c-col :span="13">
          <el-form-item label="信用证余额" prop="didgrp.cbs.opn1.cur">
            <c-select
              disabled
              v-model="model.didgrp.cbs.opn1.cur"
              style="width: 95%"
              placeholder="请选择币种"
            >
              <el-option
                v-for="item in codes.cur"
                :key="item.value"
                :label="item.label"
                :value="item.value"
              >
              </el-option>
            </c-select>
          </el-form-item>
        </c-col>
        <c-col :span="11">
          <el-form-item
            style="text-align: left"
            label-width="0"
            prop="didgrp.cbs.opn1.amt"
          >
            <c-input-currency
              disabled
              v-model="model.didgrp.cbs.opn1.amt"
              style="text-align: left; width: 100%"
              placeholder="请输入信用证金额"
            ></c-input-currency>
          </el-form-item>
        </c-col>
      </c-col>

      <c-col :span="12">
        <el-form-item label="单据参考号" prop="bddgrp.rec.ownref">
          <c-input
            :disabled="true"
            v-model="model.bddgrp.rec.ownref"
            maxlength="16"
            placeholder="请输入单据参考号"
          ></c-input>
        </el-form-item>
      </c-col>

      <c-col :span="12">
        <el-form-item label="摘要" prop="bddgrp.rec.nam">
          <c-input
            :disabled="true"
            v-model="model.bddgrp.rec.nam"
            maxlength="40"
            placeholder="请输入摘要"
          ></c-input>
        </el-form-item>
      </c-col>
    </c-row>

    <c-row>
      <c-col :span="12">
        <c-row>
          

<c-col :span="24">
        <c-col :span="13">
          <el-form-item label="单据金额" prop="bddgrp.cbs.max.cur">
            <c-select
              disabled
              v-model="model.bddgrp.cbs.max.cur"
              style="width: 95%"
              placeholder="请选择币种"
            >
              <el-option
                v-for="item in codes.cur"
                :key="item.value"
                :label="item.label"
                :value="item.value"
              >
              </el-option>
            </c-select>
          </el-form-item>
        </c-col>
        <c-col :span="11">
          <el-form-item
            style="text-align: left"
            label-width="0"
            prop="bddgrp.cbs.max.amt"
          >
            <c-input-currency
              disabled
              v-model="model.bddgrp.cbs.max.amt"
              style="text-align: left; width: 100%"
              placeholder="请输入单据金额"
            ></c-input-currency>
          </el-form-item>
        </c-col>
      </c-col>



         <c-col :span="24">
        <c-col :span="13">
          <el-form-item label="单据余额" prop="bddgrp.cbs.opn1.cur">
            <c-select
              disabled
              v-model="model.bddgrp.cbs.opn1.cur"
              style="width: 95%"
              placeholder="请选择币种"
            >
              <el-option
                v-for="item in codes.cur"
                :key="item.value"
                :label="item.label"
                :value="item.value"
              >
              </el-option>
            </c-select>
          </el-form-item>
        </c-col>
        <c-col :span="11">
          <el-form-item
            style="text-align: left"
            label-width="0"
            prop="bddgrp.cbs.opn1.amt"
          >
            <c-input-currency
              disabled
              v-model="model.bddgrp.cbs.opn1.amt"
              style="text-align: left; width: 100%"
              placeholder="请输入单据余额"
            ></c-input-currency>
          </el-form-item>
        </c-col>
      </c-col>
        </c-row>
      </c-col>

      <c-col :span="12">
        <m-ptsmsg
          :model="model"
          :disabled="true"
          :argadr="{ title: '申请人', url: 'bddgrp.apl.pts' }"
        ></m-ptsmsg>
      </c-col>
    </c-row>

    <c-row>
      <c-col :span="12">
        <c-row>
          <c-col :span="12">
            <el-form-item label="到单日期" prop="bddgrp.rec.rcvdat">
              <c-date-picker
                :disabled="true"
                type="date"
                v-model="model.bddgrp.rec.rcvdat"
                style="width: 100%"
                placeholder="请选择到期日"
              ></c-date-picker>
            </el-form-item>
          </c-col>

          <c-col :span="12">
            <el-form-item label="远期起算日" prop="bddgrp.rec.stadat">
              <c-date-picker
                :disabled="true"
                type="date"
                v-model="model.bddgrp.rec.stadat"
                style="width: 100%"
                placeholder=""
              ></c-date-picker>
            </el-form-item>
          </c-col>
        </c-row>

        <c-row>
          <c-col :span="12">
            <el-form-item label="单据到期日" prop="bddgrp.rec.matdat">
              <c-date-picker
                :disabled="true"
                type="date"
                v-model="model.bddgrp.rec.matdat"
                style="width: 100%"
                placeholder="请选择单据到期日"
              ></c-date-picker>
            </el-form-item>
          </c-col>

          <c-col :span="12">
            <el-form-item label="远期期限" prop="bddgrp.rec.tenmaxday">
              <c-input
                :disabled="true"
                v-model.number="model.bddgrp.rec.tenmaxday"
                placeholder="请输入"
                style="width: 100%"
                maxlength="3"
              ></c-input>
            </el-form-item>
          </c-col>
        </c-row>
      </c-col>

      <c-col :span="12">
        <m-ptsmsg
          :disabled="true"
          :model="model"
          :argadr="{ title: '受益人', url: 'bddgrp.ben.pts' }"
        ></m-ptsmsg>
      </c-col>
    </c-row>

    <c-row>
      <c-col :span="12">
        <c-row>
          <c-col :span="24">
            <el-form-item label="单据类型" prop="bddgrp.rec.docflg">
              <c-select
                :disabled="true"
                v-model="model.bddgrp.rec.docflg"
                style="width: 100%"
                placeholder="请选择单据类型"
              >
                <el-option
                  v-for="item in codes.bdd_brdtyp"
                  :key="item.value"
                  :label="item.label"
                  :value="item.value"
                >
                </el-option>
              </c-select>
            </el-form-item>
          </c-col>
          <c-col :span="24">
            <el-form-item label="单据状态" prop="bddgrp.rec.docsta">
              <c-select
                :disabled="true"
                v-model="model.bddgrp.rec.docsta"
                style="width: 100%"
                placeholder="请选择单据状态"
              >
                <el-option
                  v-for="item in codes.bdd_docsta"
                  :key="item.value"
                  :label="item.label"
                  :value="item.value"
                >
                </el-option>
              </c-select>
            </el-form-item>
          </c-col>
        </c-row>
      </c-col>

      <c-col :span="12">
        <m-ptsmsg
          :disabled="true"
          :model="model"
          :argadr="{ title: '交单行', url: 'bddgrp.prb.pts' }"
        ></m-ptsmsg>
      </c-col>
    </c-row>

    <div class="line" />
    <hr />

    <c-row>
      <c-col :span="12">
        <c-row>
          <m-ptsadr
            :model="model"
            :argadr="{
              title: '交单行',
              url: 'bddgrp.prb.pts',
              rol: 'bddgrp.rec.docprbrol',
            }"
          ></m-ptsadr>
        </c-row>
        <br />
        <c-row>
          <m-ptsadr
            :model="model"
            :argadr="{
              title: '付款人',
              url: 'bdtp.oth.pts',
              rol: 'bddgrp.rec.payrol',
            }"
          ></m-ptsadr>
        </c-row>
      </c-col>

      <c-col :span="12">
        <c-col>
          <el-form-item label="通知日期" prop="bddgrp.rec.orddat">
            <c-date-picker
              type="date"
              v-model="model.bddgrp.rec.orddat"
              style="width: 100%"
              placeholder=""
            ></c-date-picker>
          </el-form-item>

          <el-form-item label="SWIFT发送时间" prop="swtdat">
            <c-date-picker
              type="date"
              v-model="model.swtdat"
              style="width: 100%"
              placeholder="请选择SWIFT发送时间"
            ></c-date-picker>
          </el-form-item>

          <el-form-item label="寄单索款编号" prop="bddgrp.rec.sndref">
            <c-input
              v-model="model.bddgrp.rec.sndref"
              maxlength="20"
              placeholder="请输入寄单索款编号"
            ></c-input>
          </el-form-item>

          <c-row>
            <c-col :span="10">
              <el-form-item label="" prop="advrefflg">
                <c-checkbox v-model="model.advrefflg">出具拒付函</c-checkbox>
              </el-form-item>
            </c-col>

            <c-col :span="14">
              <el-form-item label="单据处理类型" prop="bddgrp.rec.bilpro">
                <c-select
                  v-model="model.bddgrp.rec.bilpro"
                  placeholder="请选择单据处理类型"
                >
                  <el-option
                    v-for="item in codes.test"
                    :key="item.value"
                    :label="item.label"
                    :value="item.value"
                  >
                  </el-option>
                </c-select>
              </el-form-item>
            </c-col>
          </c-row>

          <c-row>
            <c-col :span="7">
              <el-form-item label="" prop="advbwdflg">
                <c-checkbox style="width: 100%" v-model="model.advbwdflg"
                  >是否发送213拒付报文</c-checkbox
                >
              </el-form-item>
            </c-col>
            <c-col :span="6">
              <el-form-item label="" prop="advdisflg">
                <c-checkbox style="width: 100%" v-model="model.advdisflg"
                  >收到电提不符点</c-checkbox
                >
              </el-form-item>
            </c-col>
            <c-col :span="8">
              <el-form-item label="" prop="mtabut.clsflg">
                <c-checkbox v-model="model.mtabut.clsflg">闭卷</c-checkbox>
              </el-form-item>
            </c-col>
          </c-row>

          <c-row>
            <c-col :span="6">
              <el-form-item label="" prop="">
                <c-checkbox
                  style="width: 100%"
                  v-model="model.bddgrp.rec.advdocflg"
                  @change="changed"
                  >退单</c-checkbox
                >
              </el-form-item>
            </c-col>

            <c-col :span="24 - 6">
              <el-form-item label="退单方式" prop="rejtype">
                <c-select
                  v-model="model.rejtype"
                  style="width: 100%"
                  placeholder="请选择退单方式"
                >
                  <el-option
                    v-for="item in codes.rejtype"
                    :key="item.value"
                    :label="item.label"
                    :value="item.value"
                  >
                  </el-option>
                </c-select>
              </el-form-item>
            </c-col>
          </c-row>

          <el-form-item label="拒付声明">
            <c-input
              type="textarea"
              :cols="35"
              :rows="3"
              v-model="model.bddgrp.blk.disdoc"
              maxlength="105"
              show-word-limit
              placeholder="请输入拒付声明"
            ></c-input>
          </el-form-item>

          <c-row>
            <c-col :span="7">
              <el-form-item label="" prop="bddgrp.blk.disdocflg">
                <c-checkbox
                  style="width: 100%"
                  v-model="model.bddgrp.blk.disdocflg"
                  >拒付声明修改</c-checkbox
                >
              </el-form-item>
            </c-col>
            <c-col :span="6">
              <el-form-item label="" prop="rejpenins">
                <c-checkbox style="width: 100%" v-model="model.rejpenins"
                  >拒付且听候处理</c-checkbox
                >
              </el-form-item>
            </c-col>
          </c-row>
        </c-col>
      </c-col>
    </c-row>
  </div>
</template>
<script>
import Api from "~/service/Api";
import CommonProcess from "~/mixin/CommonProcess";
import CodeTable from "~/config/CodeTable";
import Event from "~/model/Bdtdcr/Event";

import Ptsmsg from "~/views/Public/Ptsmsg";
import Ptsadr from "~/views/Public/Ptsadr";
import Amtpanl from "~/views/Public/Amtpanl";
//import Utils from "~/utils";
import Ptap from "~/views/Public/Ptap";

export default {
  components: {
    "c-ptap": Ptap,
    "m-ptsmsg": Ptsmsg,
    "m-ptsadr": Ptsadr,
    "c-amtpanl": Amtpanl,
  },
  inject: ["root"],
  props: ["model", "codes"],
  mixins: [CommonProcess],
  data() {
    return {};
  },
  methods: {
    ...Event,
    opn1CurEvent() {
      this.executeDefault("didgrp.cbs.opn1.cur").then((res) => {
        if ((res.respCode == SUCCESS)) {
          Utils.copyValueFromVO(this.model, res.data);
        }
      });
    },

    changed(e) {},
  },
  created: function () {},
};
</script>
<style>
</style>
