<template>
  <c-row>
    <c-col :span="24">
      <c-col :span="7">
        <el-form-item label="信用证编号" prop="ledgrp.rec.ownref">
          <c-input
            v-model="model.ledgrp.rec.ownref"
            maxlength="16"
            style="width: 96%"
            placeholder="请输入出口信用证编号"
            @keyup.enter.native="showGridPromptDialog('ledgrp.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="ledgrp.rec.nam">
          <c-input
            v-model="model.ledgrp.rec.nam"
            maxlength="40"
            placeholder="请输入简略信息"
            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="ledgrp.cbs.nom1.cur">
            <c-input
              v-model="model.ledgrp.cbs.nom1.cur"
              maxlength="3"
              placeholder="请输入信用证金额"
              disabled
            ></c-input>
          </el-form-item>
        </c-col>
        <c-col :span="24">
          <el-form-item label="信用证余额" prop="ledgrp.cbs.opn1.cur">
            <c-input
              v-model="model.ledgrp.cbs.opn1.cur"
              maxlength="3"
              placeholder="请输入信用证余额"
              disabled
            ></c-input>
          </el-form-item>
        </c-col>
        <c-col :span="24">
          <el-form-item label="可用银行" prop="ledgrp.avbnam">
            <c-input
              v-model="model.ledgrp.avbnam"
              maxlength="40"
              placeholder="请输入可用银行"
              disabled
            ></c-input>
          </el-form-item>
        </c-col>
        <c-col :span="24">
          <el-form-item label="兑付方式" prop="ledgrp.rec.avbby">
            <c-select
              v-model="model.ledgrp.rec.avbby"
              style="width: 100%"
              placeholder="请选择兑付方式"
              disabled
            >
            </c-select>
          </el-form-item>
        </c-col>
        <c-col :span="13">
          <el-form-item label="开立日期" prop="ledgrp.rec.opndat">
            <c-date-picker
              type="date"
              v-model="model.ledgrp.rec.opndat"
              style="width: 95%"
              placeholder="请选择日期"
              disabled
            ></c-date-picker>
          </el-form-item>
        </c-col>

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

        <c-col :span="13">
          <el-form-item label="生效日期" prop="ledgrp.rec.expdat">
            <c-date-picker
              type="date"
              v-model="model.ledgrp.rec.expdat"
              style="width: 95%"
              placeholder="请选择生效地点/日期"
              disabled
            ></c-date-picker>
          </el-form-item>
        </c-col>
        <c-col :span="11">
          <el-form-item label="" label-width="0px" prop="ledgrp.rec.expplc">
            <c-input
              v-model="model.ledgrp.rec.expplc"
              maxlength="29"
              placeholder="请输入生效地点"
              disabled
            ></c-input>
          </el-form-item>
        </c-col>
        <c-col :span="24">
          <el-form-item label="信用证类型" prop="ledgrp.rec.lcrtyp">
            <c-select
              v-model="model.ledgrp.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="ledgrp.ben.pts.ref">
            <c-input
              v-model="model.ledgrp.ben.pts.ref"
              maxlength="16"
              placeholder="请输受益人"
              disabled
            ></c-input>
          </el-form-item>
        </c-col>

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

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

        <c-col :span="24">
          <el-form-item label="申请人参考号" prop="ledgrp.apl.pts.ref">
            <c-input
              v-model="model.ledgrp.apl.pts.ref"
              maxlength="16"
              placeholder="请输入"
              disabled
            ></c-input>
          </el-form-item>
        </c-col>
        <c-col :span="24">
          <el-form-item label="申请人名称" prop="ledgrp.apl.pts.nam">
            <c-input
              v-model="model.ledgrp.apl.pts.nam"
              maxlength="40"
              placeholder="请输入名称"
              disabled
            ></c-input>
          </el-form-item>
        </c-col>
        <c-col :span="24">
          <el-form-item label="确认文本" prop="cnftxt">
            <c-input
              v-model="model.cnftxt"
              maxlength="40"
              placeholder="请输入确认文本"
              disabled
            ></c-input>
          </el-form-item>
        </c-col>
      </c-col>
    </c-col>

    <!-- ========================操作菜单================== -->
    <c-col :span="24">
      <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: "L/C",
          item: [
            {
              title: "Pre-Advising/Notifying",
              url: "/business/letrsv",
              disabled: this.model.ledgrp.rec.ownref ? true : false,
            },
            {
              title: "Advising/Confirming",
              url: "/business/letopn",
              hotsubx: "6",
              disabled: this.model.ledgrp.rec.ownref ? true : 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: this.model.ledgrp.rec.ownref ? false : true,
            },
            {
              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>
</style>