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

      <c-amtpanl
        :model="model"
        :message="{
          title: '信用证余额',
          cur: 'didgrp.cbs.opn1.cur',
          amt: 'didgrp.cbs.opn1.amt',
        }"
      ></c-amtpanl>

      <c-col :span="12">
        <el-form-item label="单据参考号" prop="bddgrp.rec.ownref">
          <c-input
            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
            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-amtpanl
            :model="model"
            :span="24"
            :message="{
              title: '单据金额',
              cur: 'bddgrp.cbs.max.cur',
              amt: 'bddgrp.cbs.max.amt',
            }"
          ></c-amtpanl>

          <c-amtpanl
            :model="model"
            :span="24"
            :message="{
              title: '单据余额',
              cur: 'bddgrp.cbs.opn1.cur',
              amt: 'bddgrp.cbs.opn1.amt',
            }"
          ></c-amtpanl>
        </c-row>
      </c-col>

      <c-col :span="12">
        <m-ptsmsg
          :model="model"
          :argadr="{ title: '申请人', url: 'bddgrp.apl.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.matdat">
              <c-date-picker
                type="date"
                v-model="model.bddgrp.rec.matdat"
                style="width: 100%"
                placeholder="请选择单据到期日"
              ></c-date-picker>
            </el-form-item>
          </c-col>

          <c-col :span="24">
            <el-form-item label="到期日" prop="didgrp.rec.expdat">
              <c-date-picker
                type="date"
                v-model="model.didgrp.rec.expdat"
                style="width: 100%"
                placeholder="请选择到期日"
              ></c-date-picker>
            </el-form-item>
          </c-col>
        </c-row>
      </c-col>

      <c-col :span="12">
        <m-ptsmsg
          :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
                v-model="model.bddgrp.rec.docflg"
                style="width: 100%"
                placeholder="请选择单据类型"
              >
              </c-select>
            </el-form-item>
          </c-col>
          <c-col :span="24">
            <el-form-item label="单据状态" prop="bddgrp.rec.docsta">
              <c-select
                v-model="model.bddgrp.rec.docsta"
                style="width: 100%"
                placeholder="请选择单据状态"
              >
              </c-select>
            </el-form-item>
          </c-col>
        </c-row>
      </c-col>

      <c-col :span="12">
        <m-ptsmsg
          :model="model"
          :argadr="{ title: '交单行', url: 'bddgrp.prb.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
                v-model="model.bddgrp.rec.docflg"
                style="width: 100%"
                placeholder="请选择单据类型"
              >
              </c-select>
            </el-form-item>
          </c-col>

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

          <c-col :span="24">
            <el-form-item label="交单日期" prop="bddgrp.rec.predat">
              <c-date-picker
                type="date"
                v-model="model.bddgrp.rec.predat"
                style="width: 100%"
                placeholder="请选择交单日期"
              ></c-date-picker>
            </el-form-item>
          </c-col>

          <c-amtpanl
            :span="24"
            :model="model"
            :message="{
              title: '承兑金额',
              cur: 'setmod.doccur',
              amt: 'setmod.docamt',
            }"
          ></c-amtpanl>

          <c-amtpanl
            :model="model"
            :span="24"
            :message="{
              title: '单据金额',
              cur: 'bddgrp.cbs.opn2.cur',
              amt: 'aamset.utlamt',
            }"
          ></c-amtpanl>
        </c-row>
      </c-col>

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

    <c-row>
      <c-col :span="12">
        <c-row>
          <c-amtpanl
            :model="model"
            :span="24"
            :message="{
              title: '附加金额',
              cur: 'bddgrp.cbs.opn2.cur',
              amt: 'aamset.utlamt2',
            }"
          ></c-amtpanl>

          <c-col :span="24">
            <el-form-item label="发送承付电" prop="sftmt">
              <c-select
                v-model="model.sftmt"
                style="width: 100%"
                placeholder="请选择发送承付电"
              >
              </c-select>
            </el-form-item>
          </c-col>

          <c-col :span="24">
            <el-form-item label="TAG72">
              <c-input
                type="textarea"
                :rows="5"
                v-model="model.bddgrp.tag72add"
                maxlength="50"
                show-word-limit
                placeholder="请输入TAG72"
              ></c-input>
            </el-form-item>
          </c-col>
        </c-row>
      </c-col>

      <c-col :span="12">
        <m-ptsadr
          :model="model"
          :argadr="{
            title: '付款人',
            url: 'bdtp.oth.pts',
            rol: 'bddgrp.rec.payrol',
          }"
        ></m-ptsadr>
      </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/Bdtudp/Event";
import Ptsmsg from "~/views/Public/Ptsmsg";
import Ptsadr from "~/views/Public/Ptsadr";
import Amtpanl from "~/views/Public/Amtpanl";

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