<template>
  <c-row>
    <c-col :span="24">
      <c-col :span="7">
        <el-form-item label="信用证编号" prop="dedgrp.rec.ownref">
          <c-input
            v-model="model.dedgrp.rec.ownref"
            maxlength="16"
            style="width: 96%"
            placeholder="请输入信用证编号"
            @keyup.enter.native="showGridPromptDialog('dedgrp.rec.ownref')"
          ></c-input>
        </el-form-item>
      </c-col>
      <c-col :span="2">
        <c-button
          size="small"
          type="primary"
          @click="onSeainf"
          icon="el-icon-search"
        ></c-button>
      </c-col>
      <c-col :span="2" class="centerLable">
        <c-checkbox v-model="model.clsflg">Show closed</c-checkbox>
      </c-col>
      <c-col :span="11" :offset="1">
        <el-form-item label="摘要" prop="dedgrp.rec.nam">
          <c-input
            v-model="model.dedgrp.rec.nam"
            maxlength="40"
            placeholder="请输入Externally Displayed Name to Identify the Contract"
            disabled
          ></c-input>
        </el-form-item>
      </c-col>
    </c-col>

    <c-col :span="24">
      <c-col :span="11">
        <c-col :span="24">
          <el-form-item label="信用证金额" prop="dedgrp.cbs.nom1.cur">
            <c-input
              v-model="model.dedgrp.cbs.nom1.cur"
              maxlength="3"
              placeholder="请输入信用证金额"
              disabled
            ></c-input>
          </el-form-item>
        </c-col>
        <c-col :span="24">
          <el-form-item label="信用证余额" prop="dedgrp.cbs.opn1.cur">
            <c-input
              v-model="model.dedgrp.cbs.opn1.cur"
              maxlength="3"
              placeholder="请输入Open Amount"
              disabled
            ></c-input>
          </el-form-item>
        </c-col>
        <c-col :span="24">
          <el-form-item label="指定银行" prop="dedgrp.avbnam">
            <c-input
              v-model="model.dedgrp.avbnam"
              maxlength="40"
              placeholder="请输入Available with"
              disabled
            ></c-input>
          </el-form-item>
        </c-col>
        <c-col :span="24">
          <el-form-item label="兑付方式" prop="dedgrp.rec.avbby">
            <c-select
              v-model="model.dedgrp.rec.avbby"
              style="width: 100%"
              placeholder="请选择Available by "
              disabled
            >
            </c-select>
          </el-form-item>
        </c-col>
        <c-col :span="13">
          <el-form-item label="开证日期" prop="dedgrp.rec.opndat">
            <c-date-picker
              type="date"
              v-model="model.dedgrp.rec.opndat"
              style="width: 95%"
              placeholder="请选择Date Issued"
              disabled
            ></c-date-picker>
          </el-form-item>
        </c-col>

        <c-col :span="11">
          <el-form-item
            label="最迟装运日期"
            label-width="110px"
            prop="dedgrp.rec.shpdat"
          >
            <c-date-picker
              type="date"
              v-model="model.dedgrp.rec.shpdat"
              style="width: 100%"
              placeholder="请选择Shipment Date"
              disabled
            ></c-date-picker>
          </el-form-item>
        </c-col>

        <c-col :span="13">
          <el-form-item label="最迟交单日期/交单地" prop="dedgrp.rec.expdat">
            <c-date-picker
              type="date"
              v-model="model.dedgrp.rec.expdat"
              style="width: 95%"
              placeholder="请选择Date/Place of Expiry"
              disabled
            ></c-date-picker>
          </el-form-item>
        </c-col>
        <c-col :span="11">
          <el-form-item label="" label-width="0px" prop="dedgrp.rec.expplc">
            <c-input
              v-model="model.dedgrp.rec.expplc"
              maxlength="29"
              placeholder="请输入Date/Place of Expiry"
              disabled
            ></c-input>
          </el-form-item>
        </c-col>
        <c-col :span="24">
          <el-form-item label="信用证类型" prop="dedgrp.rec.lcrtyp">
            <c-select
              v-model="model.dedgrp.rec.lcrtyp"
              style="width: 100%"
              placeholder="请选择转让标志"
              disabled
              :code="codes.lcrtyp"
            >
            </c-select>
          </el-form-item>
        </c-col>
      </c-col>

      <c-col :span="11" :offset="1">
        <c-col :span="24">
          <el-form-item label="受益人参考号" prop="dedgrp.ben.pts.ref">
            <c-input
              v-model="model.dedgrp.ben.pts.ref"
              maxlength="16"
              placeholder="请输入Beneficiary"
              disabled
            ></c-input>
          </el-form-item>
        </c-col>

        <c-col :span="24">
          <el-form-item label="受益人名称" prop="dedgrp.ben.pts.nam">
            <c-input
              v-model="model.dedgrp.ben.pts.nam"
              maxlength="40"
              placeholder="请输入Name of Party"
              disabled
            ></c-input>
          </el-form-item>
        </c-col>

        <c-col :span="24">
          <el-form-item label="开证行参考号" prop="dedgrp.iss.pts.ref">
            <c-input
              v-model="model.dedgrp.iss.pts.ref"
              maxlength="16"
              placeholder="请输入Issuing Bank"
              disabled
            ></c-input>
          </el-form-item>
        </c-col>
        <c-col :span="24">
          <el-form-item label="开证行名称" prop="dedgrp.iss.pts.nam">
            <c-input
              v-model="model.dedgrp.iss.pts.nam"
              maxlength="40"
              placeholder="请输入Name of Party"
              disabled
            ></c-input>
          </el-form-item>
        </c-col>

        <c-col :span="24">
          <el-form-item label="申请人参考号" prop="dedgrp.apl.pts.ref">
            <c-input
              v-model="model.dedgrp.apl.pts.ref"
              maxlength="16"
              placeholder="请输入Applicant"
              disabled
            ></c-input>
          </el-form-item>
        </c-col>
        <c-col :span="24">
          <el-form-item label="申请人名称" prop="dedgrp.apl.pts.nam">
            <c-input
              v-model="model.dedgrp.apl.pts.nam"
              maxlength="40"
              placeholder="请输入Name of Party"
              disabled
            ></c-input>
          </el-form-item>
        </c-col>
        <c-col :span="24">
          <el-form-item label="Confirmation text" prop="cnftxt">
            <c-input
              v-model="model.cnftxt"
              maxlength="40"
              placeholder="请输入Confirmation text"
              disabled
            ></c-input>
          </el-form-item>
        </c-col>
      </c-col>
    </c-col>

    <!-- ========================操作菜单================== -->
    <c-col :span="23">
      <el-form-item>
        <el-divider />
      </el-form-item>
    </c-col>
    <c-col :offset="12" :span="10">
      <el-tabs tab-position="right" @tab-click="onTabClick">
        <el-tab-pane v-for="it in meum" :key="it.label" :label="it.label">
          <sel-mune :data="it.item" :model="model" />
        </el-tab-pane>
      </el-tabs>
    </c-col>
  </c-row>
</template>
<script>
import Api from "~/service/Api";
import CommonProcess from "~/mixin/CommonProcess";
import CodeTable from "~/config/CodeTable";
import Event from "~/model/Letsel/Event";
import SelMune from "./SelMune.vue";

export default {
  components: { SelMune },
  inject: ["root"],
  props: ["model", "codes"],
  mixins: [CommonProcess],
  data() {
    return {
      hotreg: "1",
      meum: [
        {
          label: "信用证",
          item: [
            {
              title: "Pre-Advising/Notifying",
              url: "/business/letrsv",
              disabled: false,
            },
            {
              title: "Advising/Confirming",
              url: "/business/letopn",
              hotsubx: "6",
              disabled: false,
            },
            { title: "Reservation", url: "#", disabled: false },
            { title: "Resevation & Receving Docs", url: "#", disabled: false },
            { title: "Confirmation an Export L/C", url: "#", disabled: true },
            {
              title: "Amending Issuing Bank",
              url: "/business/letame",
              hotsubx: "6",
              disabled: false,
            },
            {
              title: "Changing Issuing Bank",
              url: "#",
              disabled: true,
            },
            { title: "Receiving Docs", url: "#", disabled: true },
          ],
        },
        {
          label: "Others",
          item: [
            { title: "Charge Settlement", url: "#", disabled: true },
            { title: "Attachment", url: "#", disabled: true },
            { title: "Editing References", url: "#", disabled: true },
            { title: "Common Message", url: "#", disabled: true },
            { title: "Cancelling", url: "#", disabled: true },
            { title: "Re_Opening", url: "#", disabled: true },
          ],
        },
        {
          label: "Docs",
          item: [
            { title: "Correct Drawing", url: "#", disabled: true },
            { title: "Processing Discrepant Docs", url: "#", disabled: true },
            { title: "Sending Documents", url: "#", disabled: true },
            { title: "Changing Maturity", url: "#", disabled: true },
            { title: "Funds Settlement", url: "#", disabled: true },
            { title: "Reimbursement", url: "#", disabled: true },
          ],
        },
        {
          label: "Oth.Docs",
          item: [
            { title: "Charge Settlement", url: "#", disabled: true },
            { title: "Attachment", url: "#", disabled: true },
            { title: "Confirmation Limit Canclling", url: "#", disabled: true },
            { title: "Editing Reference", url: "#", disabled: true },
            { title: "Common Message", url: "#", disabled: true },
            { title: "Cancelling", url: "#", disabled: true },
            { title: "Re_Opening", url: "#", disabled: true },
          ],
        },
        {
          label: "Advance",
          item: [
            { title: "Creating an Advance", url: "#", disabled: true },
            { title: "Amending an Advance", url: "#", disabled: true },
            { title: "Setting an Advance", url: "#", disabled: true },
            { title: "递延收益冲销", url: "#", disabled: true },
            { title: "资产转卖收入或损失确认", url: "#", disabled: true },
            { title: "Cancelling", url: "#", disabled: true },
          ],
        },
        {
          label: "Oth.Advance",
          item: [
            { title: "Charge Settlement", url: "#", disabled: true },
            { title: "Attachment", url: "#", disabled: true },
            { title: "Editing References", url: "#", disabled: true },
            { title: "Engagement Adjustment", url: "#", disabled: true },
            { title: "Common Messages", url: "#", disabled: true },
          ],
        },
        {
          label: "Transfer",
          item: [
            {
              title: "Opening a Transfer L/C",
              url: "/business/lttopn",
              hotsubx: "1",
              disabled: false,
            },
            { title: "Amenting a Transfer L/C", url: "#", disabled: true },
            {
              title: "Receiving Docs from 2nd Benfic",
              url: "#",
              disabled: true,
            },
          ],
        },
        {
          label: "Oth.Transfer",
          item: [
            { title: "Charge Settlement", url: "#", disabled: true },
            { title: "Attachment", url: "#", disabled: true },
            { title: "Editing References", url: "#", disabled: true },
            { title: "Common Messages", url: "#", disabled: true },
            { title: "Cancelling", url: "#", disabled: true },
            { title: "Re_Opening", url: "#", disabled: true },
          ],
        },
        {
          label: "L/T Docs",
          item: [
            {
              title: "Receiving Docs from 1st Benfic",
              url: "#",
              disabled: true,
            },
            { title: "Correct Drawing", url: "#", disabled: true },
            { title: "Processing discrepant Docs", url: "#", disabled: true },
            { title: "Sending Documents", url: "#", disabled: true },
            { title: "Changing Maturity", url: "#", disabled: true },
            { title: "funds Settlement", url: "#", disabled: true },
            { title: "Reimbursement Clain", url: "#", disabled: true },
          ],
        },
        {
          label: "Oth.L/T Docs",
          item: [
            { title: "Charge Settlement", url: "#", disabled: true },
            { title: "Attachment", url: "#", disabled: true },
            { title: "Editing References", url: "#", disabled: true },
            { title: "Common Messages", url: "#", disabled: true },
            { title: "Cancelling", url: "#", disabled: true },
            { title: "Re_Opening", url: "#", disabled: true },
          ],
        },
      ],
    };
  },
  methods: {
    ...Event,
    //各入口按钮请求
    async onTabClick(tab, event) {
      switch (tab.label) {
        case "Transfer":
          this.hotreg = "9";
          break;
        default:
          this.hotreg = "1";
      }
      let rtnmsg = await this.executeRule(`cfgfil.hotreg${this.hotreg}`);
      if ((rtnmsg.respCode == SUCCESS)) {
        this.updateModel(rtnmsg.data);
      } else {
        this.$notify.error({ title: "错误", message: "服务请求失败！" });
      }
    },
  },
  created: function () {},
};
</script>
<style>
.centerLable {
  height: 28px;
  line-height: 28px;
}
</style>
