index.js 1.04 KB
import Api from '~/service/Api';
import commonFunctions from '~/mixin/commonFunctions.js';

export default {
  mixins: [commonFunctions],
  methods: {
    async queryOwnref() {
      let params = {
        ownref: this.model.fcngrp.rec.ownref,
        ptainr: this.model.fcngrp.apl.pts.ptainr,
      };
      const loading = this.loading();
      let res = await Api.post('/business/fcnopn/getOwnRef', params);
      if (res.respCode == SUCCESS) {
        this.model.fcngrp.rec.ownref = res.data;
      } else {
        this.$message.error(res.respMsg);
      }
      loading.close();
    },

    async changeApl() {
      if (!!this.model.fcngrp.apl.pts.ptainr) {
        let param = {
          ptainr: this.model.fcngrp.apl.pts.ptainr,
        }
        let res = await Api.post('/business/fcnopn/getIdcode', param);
        if (res.respCode == SUCCESS) {
          this.model.fcngrp.rec.idcode = res.data;
        } else {
          this.$message.error(res.respMsg)
        }
        this.model.fcngrp.rec.cusnam = this.model.fcngrp.apl.pts.cnnam
      }
    }
  }
}