Opnp.vue 10.8 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
<template>
  <div class="eibs-tab">
    <c-col :span="24">
      <c-col :span="12" style="padding-right: 20px">
        <c-col :span="24">
          <el-form-item label="业务编号" prop="cpdgrp.rec.ownref" style="width: 100%">
            <c-fullbox>
              <c-input v-model="model.cpdgrp.rec.ownref" maxlength="16" placeholder="请输入业务编号" disabled>
              </c-input>
              <template slot="footer">
                <c-button style="margin: 0 10px 0 10px; padding: 0 12px; height: 32px" size="small" type="primary"
                  icon="el-icon-search">
                </c-button>
                <c-button style="margin: 0 0" size="small" type="primary" :disabled="model.cpdgrp.orc.pts.ptainr == ''"
                  @click="getOwnref()">
                  获取
                </c-button>
              </template>
            </c-fullbox>
          </el-form-item>
        </c-col>
        <c-col :span="24">
          <c-col :span="24" class="custom-box-wrap">
            <div style="width: 200px;">
              <el-form-item label="汇款金额" prop="cpdgrp.cbs.nom1.cur">
                <c-select-cur dbCode="CURTXT" placeholder="请选择币种" style="width: 100%;"
                  v-model="model.cpdgrp.cbs.nom1.cur" :filterKey="['CNY','HKD']" @change="nom1CurCipsChange()">
                </c-select-cur>
              </el-form-item>
            </div>
            <div style="width: calc(100% - 200px);">
              <el-form-item label-width="5px" prop="cpdgrp.cbs.nom1.amt">
                <c-input-currency :currency="model.cpdgrp.cbs.nom1.cur" v-model="model.cpdgrp.cbs.nom1.amt"
                  placeholder="" @blur="nom1AmtCipsBlur()"></c-input-currency>
              </el-form-item>
            </div>
          </c-col>
        </c-col>
        <c-col :span="24">
          <el-form-item label="费用承担方" prop="cpdgrp.rec.detchgcod">
            <c-select placeholder="请选择费用承担方" style="width:100%" v-model="model.cpdgrp.rec.detchgcod" dbCode="FEECOD"
              uil="CN" sort="SRT" :filterKey="['DEBT','CRED','SHAR','SLEV']" :isShowKeyAndLabel="true"
              @change="detchgcodCipsChange()">
            </c-select>
          </el-form-item>
        </c-col>
        <c-col :span="24" v-if="model.cpdgrp.rec.swftyp == 'CIU'">
          <el-form-item label="业务种类" prop="cptp.bustyp">
            <c-select placeholder="请选择业务种类" style="width:100%" v-model="model.cptp.bustyp" dbCode="CBUTYP"
              :filterKey="['GODX','STRX','CTFX','OTFX']" uil="CN" sort="SRT" :isShowKeyAndLabel="true">
            </c-select>
          </el-form-item>
        </c-col>
        <c-col :span="24" v-if="model.cpdgrp.rec.swftyp == 'CIV'">
          <el-form-item label="业务种类" prop="cptp.bustyp">
            <c-select placeholder="请选择业务种类" style="width:100%" v-model="model.cptp.bustyp" dbCode="CBUTYP" uil="CN"
              sort="SRT" :isShowKeyAndLabel="true">
            </c-select>
          </el-form-item>
        </c-col>
        <c-col :span="24" v-if="model.cpdgrp.rec.swftyp == 'CIVCOV'">
          <el-form-item label="是否需要核验" prop="cpdgrp.rec.ischktyp">
            <c-select v-model="model.cpdgrp.rec.ischktyp" style="width:100%" @change="ischktypCipsChange()"
              placeholder="请选择是否需要核验" dbCode="ISYN" uil="CN" sort="SRT">
            </c-select>
          </el-form-item>
        </c-col>
        <c-col :span="24" v-if="model.cpdgrp.rec.swftyp == 'CIU' || model.cpdgrp.rec.swftyp == 'CIV'">
          <c-col :span="24" class="custom-box-wrap">
            <div style="width: 200px;">
              <el-form-item label="原始金额" prop="cpdgrp.rec.curf33b">
                <c-select-cur v-model="model.cpdgrp.rec.curf33b" style="width:100%" dbCode="CURTXT" sort="SRT"
                  disabled placeholder="请选择币种" :filterKey="['CNY','HKD']">
                </c-select-cur>
              </el-form-item>
            </div>
            <div style="width: calc(100% - 200px);">
              <el-form-item label-width="5px" prop="cpdgrp.rec.amtf33b">
                <c-input-currency :currency="model.cpdgrp.rec.curf33b" v-model="model.cpdgrp.rec.amtf33b"
                  :maxlength="18" style="width:100%;" placeholder="请输入原始金额" disabled>
                </c-input-currency>
              </el-form-item>
            </div>
          </c-col>
        </c-col>
        <c-col :span="24" v-if="model.cpdgrp.rec.swftyp == 'CIU' || model.cpdgrp.rec.swftyp == 'CIV'">
          <c-col :span="24" class="custom-box-wrap">
            <div style="width: 200px;">
              <el-form-item label="发报行扣费金额" prop="cpdgrp.rec.cur71f">
                <c-select-cur v-model="model.cpdgrp.rec.cur71f" style="width:100%" dbCode="CURTXT" sort="SRT"
                  placeholder="请选择币种" :filterKey="['CNY','HKD']" disabled>
                </c-select-cur>
              </el-form-item>
            </div>
            <div style="width: calc(100% - 200px);">
              <el-form-item label-width="5px" prop="cpdgrp.rec.amt71f">
                <c-input-currency :currency="model.cpdgrp.rec.cur71f" v-model="model.cpdgrp.rec.amt71f" :maxlength="18"
                  style="width:100%;" placeholder="请输入发报行扣费金额"
                  disabled>
                </c-input-currency>
              </el-form-item>
            </div>
          </c-col>
        </c-col>

      </c-col>

      <!-- ======================= 右边 ========================= -->
      <c-col :span="12" style="padding-left: 20px">
        <c-col :span="24">
          <el-form-item label="汇款方式" prop="cpdgrp.rec.paytype">
            <c-select v-model="model.cpdgrp.rec.paytype" style="width:100%" placeholder="请选择汇款方式" dbCode="CPATYP"
              uil="CN" sort="SRT">
            </c-select>
          </el-form-item>
        </c-col>
        <c-col :span="24">
          <el-form-item label="汇款性质" prop="cpdgrp.rec.trntyp">
            <c-select v-model="model.cpdgrp.rec.trntyp" style="width:100%" placeholder="请选择汇款性质" dbCode="CTRTYE"
              uil="CN" sort="SRT" :filterKey="['01','02','03','04','05','06','07','08','09','10']">
            </c-select>
          </el-form-item>
        </c-col>
        <c-col :span="24" v-if="model.cpdgrp.rec.swftyp == 'CIU' || model.cpdgrp.rec.swftyp == 'CIV'">
          <el-form-item label="是否需要核验" prop="cpdgrp.rec.ischktyp">
            <c-select v-model="model.cpdgrp.rec.ischktyp" style="width:100%" @change="ischktypCipsChange()"
              placeholder="请选择是否需要核验" dbCode="ISYN" uil="CN" sort="SRT">
            </c-select>
          </el-form-item>
        </c-col>
        <c-col :span="24">
          <el-form-item label="预计核验日期" prop="cpdgrp.rec.prechkdat"
            :rules="[{required: model.cpdgrp.rec.ischktyp == 'Y'}]">
            <c-date-picker type="date" v-model="model.cpdgrp.rec.prechkdat" style="width:100%" placeholder="请选择预计核验日期"
              :disabled="model.cpdgrp.rec.ischktyp != 'Y'">
            </c-date-picker>
          </el-form-item>
        </c-col>
        <c-col :span="24">
          <el-form-item label="汇款语种" prop="cptp.payuil">
            <c-select placeholder="请选择汇款语种" style="width:100%" v-model="model.cptp.payuil" dbCode="PAYUIL" uil="CN"
              sort="SRT">
            </c-select>
          </el-form-item>
        </c-col>
        <c-col :span="24">
          <c-business-code
            v-model="model.boprem.dbbgrp.dcl.txcode"
            label="交易编码"
            prop="boprem.dbbgrp.dcl.txcode"
151
            :required="false"
fukai committed
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
            placeholder="请输入交易编码"
          ></c-business-code>
        </c-col>
        <c-col :span="24">
          <c-col :span="5">
            <el-form-item prop="trtcre.crefinflg" class="checkbox-left">
              <c-checkbox v-model="model.trtcre.crefinflg" @change="onCrefinflgChangeCips" true-label="X" false-label="">融资</c-checkbox>
            </el-form-item>
          </c-col>
          <c-col :span="5">
            <el-form-item prop="dftcre.dfflag" class="checkbox-left">
              <c-checkbox v-model="model.dftcre.dfflag" :disabled="model.trtcre.crefinflg !== 'X'" true-label="X" false-label="">委托方代付</c-checkbox>
            </el-form-item>
          </c-col>
          <c-col :span="5">
            <el-form-item prop="cpdgrp.rec.tsnflg" class="checkbox-left">
              <c-checkbox v-model="model.cpdgrp.rec.tsnflg" true-label="X" false-label="">同名划转</c-checkbox>
            </el-form-item>
          </c-col>
          <c-col :span="5">
            <el-form-item prop="cptp.flg" class="checkbox-left">
              <c-checkbox v-model="model.cptp.flg" true-label="X" false-label="" @change="flgCipsChange()">电汇凭证
              </c-checkbox>
            </el-form-item>
          </c-col>
        </c-col>
      </c-col>
    </c-col>
    {{calcCuramt71f}}
    {{calcCuramt33b}}
  </div>
</template>
<script>
  import event from "../../event";
  import Default from "../../model/default";
  import BigNumber from 'bignumber.js';

  export default {
    inject: ["root"],
    props: ["model", "codes", "rules"],
    mixins: [event, Default],
    data() {
      return {};
    },
    methods: {
      onCrefinflgChangeCips() {
      if (this.model.trtcre.crefinflg !== "X") {
          this.model.dftcre.dfflag = "";
        }
      },
    },
    created() {},
    computed: {
      calcCuramt71f(){
        let amt71f = 0;
        let cur71f = "";
        if (this.model.cpdgrp.rec.swftyp == 'CIU' && this.model.cpdgrp.rec.detchgcod == 'CRED') {
          for(let index in this.model.setmod.setfeg.setfel) {
              let setfel = this.model.setmod.setfeg.setfel[index];
              if (setfel.rol === 'PYE' && setfel.dsp === 'X' && setfel.cur === this.model.cpdgrp.cbs.nom1.cur && Number(setfel.amt) > 0) {
                  amt71f = new BigNumber(amt71f).plus(setfel.amt);
              }
          }
          cur71f = this.model.cpdgrp.cbs.nom1.cur;
        }
        this.model.cpdgrp.rec.amt71f = amt71f;
        this.model.cpdgrp.rec.cur71f = cur71f;
      },
      calcCuramt33b(){
        let amt33b = 0;
        let cur33b = "";
        if (this.model.cpdgrp.rec.swftyp == 'CIU' && this.model.cpdgrp.rec.detchgcod == 'CRED') {
          amt33b = this.model.cpdgrp.cbs.nom1.amt;
          cur33b = this.model.cpdgrp.cbs.nom1.cur;
        }
        this.model.cpdgrp.rec.amtf33b = amt33b;
        this.model.cpdgrp.rec.curf33b = cur33b;
      },
    },
  };
</script>
<style scoped lang="less">
  .box-card {
    margin-bottom: 10px;

    /deep/ .el-form-item--mini.el-form-item,
    .el-form-item--small.el-form-item {
      margin-bottom: 10px;
    }

    /deep/ .el-card__body {
      padding: 10px 10px 10px 0px;
    }
  }

  .el-textarea .el-textarea__inner {
    height: 100px;
  }
</style>