index.js 1.64 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
import Api from "~/service/Api";
import commonFunctions from "~/mixin/commonFunctions.js";
export default {
  mixins: [commonFunctions],
  methods: {
    handleChangeAmt () {
      let maxTotal = 0
      let max2Total = 0
      this.model.fitp.edidocm.edidoc.map((item) => {
        if (item.doctyp === '1' && item.amt) {
          maxTotal += Number(item.amt)
        }
        if (item.doctyp === '2' && item.amt) {
          max2Total += Number(item.amt)
        }
      })
      this.model.fidgrp.cbs.max.amt = maxTotal
      this.model.fidgrp.cbs.max2.amt = max2Total
      this.defaultNamN1000();
    },
    queryOwnref() {
      let params = this.model.fidgrp;
      const loading = this.loading();
      let trnName = this.root.trnName.toUpperCase();
fukai committed
25
      Api.post(`/${this.moduleRouter()}/ref/fit?trnName=${trnName}`, params).then(res => {
fukai committed
26 27 28 29 30 31 32 33 34 35 36
        loading.close();
        if (res.respCode === SUCCESS) {
          this.model.fidgrp.rec.ownref = res.data;
        }
      }).catch(() => {
        loading.close();
      });
    },
    defaultNamN1000() {
      let params = { fidgrp: this.model.fidgrp, lrdgrp: this.model.lrdgrp }
      const loading = this.loading();
fukai committed
37
      Api.post(`/${this.moduleRouter()}/fitepn/defaultFidgrpRecNamN1000`, params).then(res => {
fukai committed
38 39 40 41 42 43 44 45 46 47 48 49 50 51 52
        loading.close();
        if (res.respCode === SUCCESS) {
          this.model.fidgrp.rec.nam = res.data;
        }
      }).catch(() => {
        loading.close();
      });
    },
    clickInvchk() {
      if (this.model.invchk.chkflg === 'X') {
        this.$notify.error({title: this.$t('components.提示信息'), message: this.$t('components.发票查验接口接通中')});
      }
    }
  },
};