Ovwp.vue 2.69 KB
Newer Older
fukai committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84
<template>
  <div class="eibs">
    <c-collapse v-model="activeNames">
      <el-collapse-item title="Extend Usance" name="brteus">
        <m-brteus :model="model" :codes="codes" />
      </el-collapse-item>
      <el-collapse-item title="Liabilities" name="acceptlinep">
        <m-acceptlinep ref="setp" :model="model" :codes="codes" @changeMatdat="changeMatdat" />
      </el-collapse-item>
      <el-collapse-item title="Parties" name="ptyp">
        <m-ptyp :model="model" :codes="codes" />
      </el-collapse-item>
    </c-collapse>
  </div>
</template>

<script>
import event from "../event";
import Brteus from "./BrteusPanel";
import Ptyp from "./Ptyp";
import AcceptLine from "~/components/business/engp/views/AcceptLine.vue";
import moment from "moment";

export default {
  components: {
    "m-brteus": Brteus,
    "m-ptyp": Ptyp,
    "m-acceptlinep": AcceptLine,
  },
  inject: ["root"],
  props: ["model", "codes"],
  mixins: [event],
  data() {
    return {
      activeNames: ["brteus", "acceptlinep", "ptyp"],
      matdatChangeMap: {},
    };
  },
  methods: {
    changeMatdat(liaallg) {
      console.log("liaallg", liaallg);
      let matdat = liaallg.matdat;
      let pteinr = liaallg.pteinr;
      let cur = liaallg.cur;
      let amt = Number(liaallg.oldamt).toFixed(2);
      if (matdat !== "") {
        if (this.model.modifySet && this.model.modifySet.includes("strinf")) {
        } else {
          let oldMatdat = this.root.oldMatdatMap.get(pteinr);
          if (oldMatdat !== matdat) {
            let olddat = moment(oldMatdat).format("DD.MMMM.yyyy");
            let newdat = "";
            if (matdat !== null && matdat !== "") {
              newdat = moment(matdat).format("DD.MMMM.yyyy");
            }
            let str = "Maturity for " + cur + " " + amt + " has been changed from " + olddat + " to " + newdat + "\n";
            // 将变化信息保存到matdatChangeArray中
            this.matdatChangeMap.set(pteinr, str);
          } else {
            this.matdatChangeMap.delete(pteinr);
          }
          if (this.matdatChangeMap.size > 0) {
            let changeStr = "";
            for (let val of this.matdatChangeMap.values()) {
              changeStr = changeStr + val;
            }
            this.model.strinf = changeStr + this.root.oldStrinf;
          } else {
            this.model.strinf = this.root.oldStrinf;
          }
        }
        this.model.brdgrp.rec.matdat = matdat;
        let matDate = new Date(this.model.brdgrp.rec.matdat);
        this.model.brdgrp.rec.stadat = matDate.setDate(matDate.getDate() - Number(this.model.brdgrp.rec.tenmaxday));
      }
    },
  },
  created: function () {
    this.matdatChangeMap = new Map();
  },
};
</script>

<style></style>