index.js 3.44 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 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109
import Api from "~/service/Api";
import commonFunctions from "~/mixin/commonFunctions.js";
import buildFn from "./buildCommons.js";

export default {
  mixins: [commonFunctions],
  methods: {
    // 点击获取按钮拉取当前key字段下的表单数据
    queryFormData(key) {
      console.log(key);
    },
    // 获取提货担保编号
    async queryShgref() {
      let params = {
        ptainr: this.model.lidgrp.apl.pts.ptainr,
        ownref: this.model.brdgrp.rec.shgref,
      };
      const loading = this.loading();
      let res = await Api.post("/Lc/ref/getSgRef", params);
      loading.close();
      if (res.respCode == SUCCESS) {
        this.model.brdgrp.rec.shgref = res.data;
      } else {
        this.$message.error(res.respMsg);
      }
    },
    // 获取单据编号
    async Butgetref() {
      let params = {
        brdOwnRef: this.model.brdgrp.rec.ownref,
        lidOwnRef: this.model.lidgrp.rec.ownref,
        lidInr: this.model.lidgrp.rec.inr,
        utlNbr: this.model.lidgrp.rec.utlnbr,
        advNbr: this.model.lidgrp.rec.advnbr,
        delNbr: this.model.lidgrp.rec.delnbr,
      };
      const loading = this.loading();
      let res = await Api.post("/Lc/ref/getDocRef", params);
      if (res.respCode == SUCCESS) {
        loading.close();
        this.model.brdgrp.rec.ownref = res.data;
      }
    },
    // 获取gitopn弹框表格数据
    async queryGridEtyPromptDialogData(type, ptytyp) {
      let params = {
        userId: window.sessionStorage.userId || "ZL",
        ptytyp: ptytyp,
        extkey: this.model.brdgrp[type.toLowerCase()].pts.extkey,
      };
      let res = await Api.post("/service/ptspta/list", params);
      if (res.respCode == SUCCESS) {
        this.root.$refs["etyDialog"].show = true;
        this.root.promptData.data = res.data.ptaInfos;
        this.root.promptData.type = type;
      }
    },
    // 选中gitopn弹框表格的行数据
    async selectGridEtyPromptData(row) {
      let params = {
        ...row,
      };
      let res = await Api.post("/service/ptspta/fetch", params);
      if (res.respCode == SUCCESS) {
        this.$set(this.model.brdgrp, row.role.toLowerCase(), res.data);
      }
    },
    // 业务信息=》基本信息=》支出目的
    purposChange(key, value) {
      this.handleChangeForm(key, value);
    },
    buildLiaccv() {
      let params = {
        ...buildFn.buildCommonData(this.model, this.trnName),
        liaccvg: this.model.liaccv.liaccvg,
        oldamt: this.model.liaccv.oldamt,
        chgamt: this.model.liaccv.chgamt,
        concur: this.model.liaccv.concur,
      };

      return params;
    },
    // 公共组件setmod处理方式改变触发联动
    changeSetmodModel(emitParams) {
      let reqParams = {};
      switch (emitParams.code) {
        case "processMethods":
          reqParams = buildFn.buildSetglg(this.model, this.trnName);
          this.calcPayDetail(reqParams);
          break;
        case "changeDsp":
          let index = emitParams.index;
          let setglgRequest = buildFn.buildSetglg(this.model, this.trnName);
          setglgRequest.setglg = { setgll: emitParams.list };
          this.setgllAccts(setglgRequest, index);
          break;
        default:
          return;
      }
    },
    // 查询是否有通知到单数据
    async queryAdvData(lidinr) {
      let res = await Api.post("/Lc/litrog/queryAdvDataForLitrog", lidinr);
      if (res.respCode == SUCCESS) {
        return res.data;
      }
    },
  },
};