index.vue 11.2 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 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322
<template>
  <div class="eContainer">
    <c-page title="出口融资融资放款">
      <el-form :model="model" :rules="rules" :validate-on-rule-change="false" label-position="right" label-width="120px" ref="modelForm" size="small">
        <c-tabs @tab-click="tabClick" ref="elment" type="card" v-model="tabVal">
          <el-tab-pane :label="$t('commonModels.业务信息')" name="ovwp">
            <c-content>
              <m-ovwp :codes="codes" :model="model" />
            </c-content>
          </el-tab-pane>

          <el-tab-pane label="定价系统" name="dinpan" v-if="model.bpdgrp.rec.fortyp != '2' && model.bpdgrp.rec.ffttyp != '0' && model.bpdgrp.rec.ffttyp != '1'">
            <m-dinpan :codes="codes" :model="model" />
          </el-tab-pane>

          <el-tab-pane label="委托方代付" name="dftcre" v-if="model.dftcre.dfflag === 'X'">
            <c-content>
              <m-dftcre :codes="codes" :model="model" />
            </c-content>
          </el-tab-pane>

          <el-tab-pane :label="$t('commonModels.费用/账务')" name="setpan">
            <c-content>
              <m-setmod :codes="codes" :model="model" />
            </c-content>
          </el-tab-pane>

          <el-tab-pane label="付款途径" name="fktj" v-if="isVisibleFktj">
            <m-fktj :codes="codes" :model="model" />
          </el-tab-pane>

          <el-tab-pane label="发票核验" name="invchkpan" v-if="model.bpdgrp.rec.fintyp === 'M' || model.bpdgrp.rec.fintyp === 'T' || model.bpdgrp.rec.fintyp === 'G'">
            <m-invchkpan :codes="codes" :model="model" />
          </el-tab-pane>

          <el-tab-pane :label="$t('commonModels.授信/表外')" name="liacombo">
            <c-content>
              <div class="eibs-tab">
                <c-collapse ref="liacombo" style="margin-bottom: 5px;" v-model="activeNames">
                  <el-collapse-item :title="$t('commonCollapse.统一授信')" name="limitbody">
                    <m-limitbody :codes="codes" :model="model" />
                  </el-collapse-item>

                  <el-collapse-item :title="$t('commonCollapse.表外信息')" name="engp">
                    <m-engp :codes="codes" :model="model" ref="engps" />
                  </el-collapse-item>
                </c-collapse>
              </div>
            </c-content>
          </el-tab-pane>

          <el-tab-pane label="报文/面函" name="docpan">
            <c-content>
              <m-docpan :codes="codes" :model="model" />
            </c-content>
          </el-tab-pane>

          <el-tab-pane label="资本项目" name="cfabop">
            <c-content>
              <m-cfabop :codes="codes" :model="model" ref="cfabop" />
            </c-content>
          </el-tab-pane>

          <!-- <el-tab-pane label="外管信息" name="wg">
                        <m-wg :codes="codes" :model="model"/>
                    </el-tab-pane> -->
          <el-tab-pane label="外管信息" name="bopgat">
            <c-content>
              <m-bopgat :codes="codes" :model="model" />
            </c-content>
          </el-tab-pane>

          <!-- <el-tab-pane label="国内外汇款数据采集" name="cfap">
            <m-cfap :codes="codes" :model="model" />
          </el-tab-pane> -->

          <!-- 跨境人民币申报 -->
          <el-tab-pane label="跨境人民币申报" name="rmbbop">
            <c-content>
              <m-rmbbop :codes="codes" :model="model" ref="rmbbop" />
            </c-content>
          </el-tab-pane>
        </c-tabs>
      </el-form>
      <c-function-btn :handleCheck="handleCheck" :handleStash="handleStash" :handleSubmit="handleSubmit" @handleSureWarning="handleSureWarning" ref="commonBtn"></c-function-btn>
    </c-page>
  </div>
</template>
<script>
import CodeTable from "~/config/CodeTable";
import Bptopn from "../model/index.js";
import event from "../event";
import Check from "../model/check";
import Default from "../model/default";
import buildFn from "../event/buildCommons.js";
import operationFunc from "~/mixin/operationFunc";
import commonDepend from "~/mixin/commonDepend";
import moment from "moment";

import Ovwp from "./Ovwp";
import Wg from "./Wg";
import Cfap from "./Cfap";
import Invchkpan from "~/components/business/Invchkpan/views";
import Dinpan from "./Dinpan";
import Cnyp1 from "./Cnyp1";
import Fktj from "./Fktj";

import Setmod from "~/components/business/setmod/views";
import Docpan from "~/components/business/docpan/views";
import Limitbody from "~/components/business/limitbody/views";
import Engp from "~/components/business/engp/views";
import Rmbbop from "~/components/business/rmb/rmbbop/views";
import Dftcre from "~/components/business/dftcre/views";
import Cfabop from "~/components/business/cfa/cfabop/views";
import Bopgat from "~/components/business/Bopgat/views";

export default {
  name: "Bptopn",
  components: {
    "m-setmod": Setmod,
    "m-limitbody": Limitbody,
    "m-docpan": Docpan,
    "m-engp": Engp,
    "m-rmbbop": Rmbbop,
    "m-cnyp1": Cnyp1,
    "m-ovwp": Ovwp,
    "m-wg": Wg,
    "m-cfap": Cfap,
    "m-invchkpan": Invchkpan,
    "m-dinpan": Dinpan,
    "m-fktj": Fktj,
    "m-dftcre": Dftcre,
    "m-cfabop": Cfabop,
    "m-bopgat": Bopgat
  },
  provide() {
    return {
      root: this
    };
  },
  mixins: [Default, operationFunc, event, commonDepend, buildFn],
  data() {
    return {
      tabVal: "ovwp",
      activeNames: ["limitbody", "engp"],
      trnName: "bptopn",
      trnType: "",
      model: new Bptopn().data,
      codes: {
        ...CodeTable
      }
    };
  },
  methods: {
    clearFktj() {
      this.model.bpdgrp.rec.fkzh = "";
      this.model.bpdgrp.rec.fkr = "";
      this.model.bpdgrp.rec.modifySet &&
        (this.model.bpdgrp.rec.modifySet = this.model.bpdgrp.rec.modifySet.filter(
          value => value != "fkr"
        ));
      this.model.bpdgrp.rec.fkhnam = "";
      this.model.bpdgrp.rec.fkhnum = "";
      this.model.bpdgrp.rec.qxr = "";
      this.model.bpdgrp.rec.skr = "";
      this.model.bpdgrp.rec.skzh = "";
      this.model.bpdgrp.rec.skhnam = "";
      this.model.bpdgrp.rec.skhnum = "";
      this.model.bpdgrp.rec.setrmk = "";
    }
  },
  computed: {
    rules() {
      return Check.apply(this);
    },
    isVisibleFktj() {
      //一级福费廷,finance type是国内证包买单据或议付也要显示
      if (
        this.model.bpdgrp.rec.fintyp == "T" ||
        this.model.bpdgrp.rec.fintyp == "M" ||
        (this.model.bpdgrp.rec.fortyp == "1" &&
          this.model.bpdgrp.rec.fintyp == "G") ||
        (this.model.bpdgrp.rec.fortyp == "2" &&
          (this.model.bpdgrp.rec.fintyp == "F" ||
            this.model.bpdgrp.rec.fintyp == "G"))
      ) {
        let clearFlag = true;
        let num = this.model.setmod.setglg.setgll.length;
        for (let i = 0; i < num; i++) {
          if (
            this.model.setmod.setglg.setgll[i].debcdtflg == "C" &&
            (this.model.setmod.setglg.setgll[i].dsp == "SPC" ||
              this.model.setmod.setglg.setgll[i].dsp == "ARC")
          ) {
            let act = this.model.setmod.setglg.setgll[i].act;
            let typ =
              this.model.setmod.setglg.setgll[i].acttrmtyp +
              "-" +
              act.substring(act.length - 1);
            let fkr = "";
            switch (typ) {
              case "2120-1":
                fkr = "国结系统结算款项";
                break;
              case "2120-2":
                fkr = "国结系统结算款项(国内)";
                break;
              case "2149-1":
                fkr = "国结系统汇入汇出款";
                break;
              case "2149-2":
                fkr = "待结转国结融资款项";
                break;
              case "2149-3":
                fkr = "待结转国结其他款项";
                break;
            }
            this.model.bpdgrp.rec.fkzh = act;
            if (!this.isModifyBpd("fkr")) {
              this.model.bpdgrp.rec.fkr = fkr;
            }
            if (this.model.bpdgrp.rec.fkhnam == "") {
              this.model.bpdgrp.rec.fkhnam = this.$store.state.UserContext.accbch.dzlhmc;
            }
            if (this.model.bpdgrp.rec.fkhnum == "") {
              this.model.bpdgrp.rec.fkhnum = this.$store.state.UserContext.accbch.dzlhhh;
            }
            if (this.model.bpdgrp.rec.qxr == "") {
              this.model.bpdgrp.rec.qxr = moment(new Date()).format(
                "YYYY-MM-DD"
              );
            }
            if (
              this.model.bpdgrp.rec.fortyp == "1" ||
              this.model.bpdgrp.rec.fortyp == "T"
            ) {
              if (
                this.model.bpdgrp.rec.skr == "" &&
                this.isModifyBpd("skr") &&
                this.model.dedgrp.ben.pts.inr != ""
              ) {
                this.model.bpdgrp.rec.skr = this.model.dedgrp.ben.pts.nam;
              }
              if (
                this.model.bpdgrp.rec.skzh == "" &&
                this.isModifyBpd("skzh") &&
                this.model.dedgrp.ben.pts.extact != ""
              ) {
                this.model.bpdgrp.rec.skzh = this.model.dedgrp.ben.pts.extact;
              }
              if (
                this.model.bpdgrp.rec.skhnam == "" &&
                this.isModifyBpd("skhnam") &&
                this.model.dedgrp.beb.pts.jigomc != ""
              ) {
                this.model.bpdgrp.rec.skhnam = this.model.dedgrp.beb.pts.extact;
              }
              if (
                this.model.bpdgrp.rec.skhnum == "" &&
                !this.isModifyBpd("skhnum") &&
                this.model.dedgrp.beb.pts.bankno != ""
              ) {
                this.model.bpdgrp.rec.skhnum = this.model.dedgrp.beb.pts.bankno;
              }
            }
            if (!this.isModifyBpd("setrmk")) {
              let ownref = this.model.bpdgrp.rec.ownref;
              // if (ownref == "") {
              //   if (this.model.bpdgrp.rec.fintyp == "T") {
              //     ownref = this.model.bpdgrp.rec.pntref + "D";
              //   } else {
              //     ownref = this.model.bpdgrp.rec.pntref + "F";
              //   }
              // }
              if (this.model.bpdgrp.rec.fintyp == "T") {
                this.model.bpdgrp.rec.setrmk = "议付融资款项" + ownref;
              } else {
                this.model.bpdgrp.rec.setrmk = "福费廷融资款项" + ownref;
              }
            }
            clearFlag = false;
            break;
          }
        }
        if (!clearFlag) {
          return true;
        } else {
          this.clearFktj();
        }
      } else {
        this.clearFktj();
      }
      return false;
    }
  },
  created() {
    console.log("进入bptopn交易");
    let params = {
      transName: this.trnName,
      bpdgrp: {
        rec: {
          pnttyp: this.$route.query.pnttyp,
          pntinr: this.$route.query.inr,
          fintyp: this.$route.query.fintyp,
          fortyp: this.$route.query.fortyp
        }
      }
    };
    this.init(params).then(async () => {
      if (this.$store.state.Status.mode !== "display") {
        this.$refs.engps
          .initEngp(await this.buildCommonData(this.model, this.trnName))
          .then(() => {
            this.defaultDefaultPctfinN1000(this.model);
          });
      }
    });
  }
};
</script>
<style>
</style>