<template>
  <div class="eibs-tab">
    <c-collapse v-model="activeNames">
      <el-collapse-item title="Basic Parties" name="bisptyp">
        <m-bisptyp :model="model" :codes="codes" />
      </el-collapse-item>
      <el-collapse-item title="Overview" name="ovwp1">
        <m-ovwp1 :model="model" :codes="codes" ref="ovwp1" />
      </el-collapse-item>
      <el-collapse-item title="Other Parties" name="ptyp">
        <!-- 当事人 -->
        <m-ptyp :model="model" :codes="codes" />
      </el-collapse-item>
    </c-collapse>
  </div>
</template>
<script>
import Api from "~/service/Api";
import CodeTable from "~/config/CodeTable";
import Event from "../event";
import Ovwp1 from "./Ovwp1";
import Detp from "./Detp";
import Ptyp from "./Ptyp";
import Adcp from "./Adcp";
import Bisptyp from "./Bisptyp";

export default {
  components: {
    "m-ovwp1": Ovwp1,
    "m-detp": Detp,
    "m-ptyp": Ptyp,
    "m-adcp": Adcp,
    "m-bisptyp": Bisptyp,
  },
  inject: ["root"],
  props: ["model", "codes"],
  mixins: [Event],
  data() {
    return {
      activeNames: ["bisptyp", "ovwp1", "ptyp"],
    };
  },
  methods: {
    open(val) {
      if (
        val === "" &&
        !(
          this.model.lidgrp.cbs.max2.amt == "0.000" &&
          this.model.lidgrp.cbs.opn2.amt == "0.000" &&
          this.model.lidgrp.blk.addamtcov === ""
        )
      ) {
        this.$confirm("是否确定要删除此合同的附加金额?", "提示", {
          confirmButtonText: "是",
          cancelButtonText: "否",
          type: "warning",
          showClose: false,
        })
          .then(() => {
            //yes的执行在这里写
            this.model.lidgrp.cbs.max2.amt = "0.000";
            this.model.lidgrp.blk.addamtcov = "";
            this.model.lidgrp.cbs.opn2.amt = "0.000";
            this.$message({
              type: "success",
              message: "删除成功!",
            });
          })
          .catch(() => {
            //No的功能在这里写
            this.model.litp.aamp.aammod.addamtflg = "X";
            this.$message({
              type: "info",
              message: "已取消删除",
            });
          });
      }
    },
    handleChange(val) {
      console.log(val);
    },
  },
  created: function () {},
};
</script>
<style>
.marginLable {
  padding-left: 160px;
}
</style>