index.js 1.23 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
import Api from '~/service/Api';
import commonFunctions from '~/mixin/commonFunctions.js';
import moment from "moment"
import BigNumber from "bignumber.js";
import Default from "../model/default";

export default {
  mixins: [commonFunctions,Default],
  methods: {

    calculteAmount(){
      this.model.setmod.setamt = new BigNumber(this.model.setmod.docamt).minus(new BigNumber(this.model.setmod.redamt)).toFixed(2);
    },


    clsflgCalculate(){
      // 试算表外,判断clsflg标志
      let tmpclsflg = true;
      if (this.model.setmod.dspflg === 'CG') {
        this.root.$refs.engps.initEngp(this.root.buildCommonData(this.model, this.root.trnName)).then(async () => {
          this.disableClsflg();
        });
      } else {
        this.model.clsflg = "O";
        this.model.disabledClsflg = "Y";
      }
      this.clsflgChange();
    },

    docamtChange(){
      this.defUtlamts();
      this.defaultsetmodRedamt();
      this.calculteAmount();
      this.clsflgCalculate()

    },
    frepayflgChange(){
      this.defaultsetmodRedamt();
      this.calculteAmount();
      this.defaultDocsta();
      this.clsflgCalculate();
    },

    redamtChange(){
      this.calculteAmount();
      this.clsflgCalculate();
    },


  },
};