Ovwp1.vue 14.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 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360
<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="bpdgrp.rec.pntref">
            <c-input v-model="model.bpdgrp.rec.pntref" maxlength="16" disabled placeholder="请输入基础交易编号"></c-input>
          </el-form-item>
        </c-col>

        <c-col :span="24">
          <el-form-item label="融资业务编号" prop="bpdgrp.rec.ownref">
            <c-fullbox>
              <c-input v-model="model.bpdgrp.rec.ownref" disabled @change="defaultFinCodN1000" placeholder="请输入融资业务编号"></c-input>
              <template slot="footer">
                <c-button :disabled="model.bpdgrp.rec.fintyp=='' || model.bpdgrp.fia.pts.ptyinr==''" style="margin-left: 10px" size="small" type="primary" @click="queryOwnref">获取</c-button>
              </template>
            </c-fullbox>
          </el-form-item>
        </c-col>

        <!-- <c-col :span="24" v-if="model.bpdgrp.rec.fintyp=='F' || model.bpdgrp.rec.fintyp=='G'">
					<el-form-item label="福费廷业务编号" prop="fpdgrp.rec.ownref">
						<c-input v-model="model.fpdgrp.rec.ownref" maxlength="16" disabled placeholder="请输入福费廷业务编号"></c-input>
					</el-form-item>
				</c-col> -->

        <c-col :span="24">
          <el-form-item label="经办柜员" prop="bptp.usr.extkey">
            <c-input v-model="model.bptp.usr.extkey" maxlength="8" disabled placeholder="请输入经办柜员"></c-input>
          </el-form-item>
        </c-col>

        <c-col :span="24">
          <el-form-item label="抵押标志" prop="bpdgrp.rec.guaflg">
            <c-select dbCode="guaflg" v-model="model.bpdgrp.rec.guaflg" style="width:100%" placeholder="请选择抵押标志">
            </c-select>
          </el-form-item>
        </c-col>

        <c-col :span="24">
          <c-col :span="12">
            <el-form-item label="融资类型" prop="bpdgrp.rec.fintyp">
              <c-select v-model="model.bpdgrp.rec.fintyp" dbCode="BPDTYP" sort="SRT" :filterKey="model.fintypCT" @change="fintypChange" style="width:100%" placeholder="请选择融资类型">
              </c-select>
            </el-form-item>
          </c-col>
          <c-col :span="12" v-if="model.bpdgrp.rec.fintyp=='P' || model.bpdgrp.rec.fintyp=='M'">
            <el-form-item label-width="5px" prop="bptp.purtyp">
              <c-select dbCode="PURTYP" :filterKey="setPurtyp" sort="SRT" v-model="model.bptp.purtyp" @change="purtypChange" style="width:100%" placeholder="请选择">
              </c-select>
            </el-form-item>
          </c-col>
          <c-col :span="12" v-if="model.bpdgrp.rec.fintyp=='D' || model.bpdgrp.rec.fintyp=='T'">
            <el-form-item label-width="5px" prop="bptp.distyp">
              <c-select dbCode="DISTYP" v-model="model.bptp.distyp" @change="distypChange" style="width:100%" placeholder="请选择">
              </c-select>
            </el-form-item>
          </c-col>
        </c-col>

        <c-col :span="24" v-if="model.finmod.intprd=='7' && (model.bpdgrp.rec.fintyp=='F' || model.bpdgrp.rec.fintyp=='G')">
          <el-form-item label="福费廷转卖类型" prop="bpdgrp.rec.ffttyp">
            <c-select v-model="model.bpdgrp.rec.ffttyp" dbCode="FFTTYP" :filterKey="['0']" @change="ffttypChange" maxlength="16" placeholder="请选择福费廷转卖类型"></c-select>
          </el-form-item>
        </c-col>

        <c-col :span="24" v-if="model.bpdgrp.rec.fortyp=='2' && model.bpdgrp.rec.fintyp=='F'">
          <c-col :span="12">
            <el-form-item label="信用证金额" prop="ledgrp.cbs.nom1.cur">
              <c-select-cur v-model="model.ledgrp.cbs.nom1.cur" dbCode="curtxt" sort="SRT" style="width:100%" placeholder="请选择信用证币种">
              </c-select-cur>
            </el-form-item>
          </c-col>
          <c-col :span="12">
            <el-form-item label-width="5px" prop="ledgrp.cbs.nom1.amt">
              <c-input-currency v-model="model.ledgrp.cbs.nom1.amt" placeholder="请输入信用证金额"></c-input-currency>
            </el-form-item>
          </c-col>
        </c-col>

        <c-col :span="24" v-if="model.bpdgrp.rec.fortyp=='2' && model.bpdgrp.rec.fintyp=='G'">
          <c-col :span="12">
            <el-form-item label="信用证金额" prop="dedgrp.cbs.nom1.cur">
              <c-select-cur v-model="model.dedgrp.cbs.nom1.cur" dbCode="curtxt" sort="SRT" style="width:100%" placeholder="请选择信用证币种">
              </c-select-cur>
            </el-form-item>
          </c-col>
          <c-col :span="12">
            <el-form-item label-width="5px" prop="dedgrp.cbs.nom1.amt">
              <c-input-currency v-model="model.dedgrp.cbs.nom1.amt" placeholder="请输入信用证金额"></c-input-currency>
            </el-form-item>
          </c-col>
        </c-col>

        <c-col :span="24" v-if="isDisableCur">
          <c-col :span="12">
            <el-form-item label="可融资单据余额" prop="tensetcur">
              <c-select disabled dbCode="curtxt" v-model="model.tensetcur" style="width:100%" placeholder="请选择币种">
              </c-select>
            </el-form-item>
          </c-col>
          <c-col :span="12">
            <el-form-item label-width="5px" prop="tensetamt">
              <c-input-currency disabled v-model="model.tensetamt" placeholder="请输入金额"></c-input-currency>
            </el-form-item>
          </c-col>
        </c-col>

        <c-col :span="24" v-if="model.bpdgrp.rec.fintyp=='F' || (model.bpdgrp.rec.fintyp=='D' && model.bptp.distyp=='DIS') || (model.bpdgrp.rec.fintyp=='P' && model.bptp.purtyp=='NB0')">
          <el-form-item label="基础贸易是/否跨境货物贸易" prop="bpdgrp.rec.iscrotra">
            <c-select dbCode="ISCROT" v-model="model.bpdgrp.rec.iscrotra" maxlength="16" placeholder="请输入基础贸易是/否跨境货物贸易"></c-select>
          </el-form-item>
        </c-col>

        <c-col :span="24" v-if="model.bpdgrp.rec.pnttyp=='' && ((model.bpdgrp.rec.fintyp=='P' && model.bptp.purtyp!='BO') || model.bpdgrp.rec.fintyp=='D')">
          <el-form-item label="基础交易编号" prop="bedgrp.rec.ownref">
            <c-input v-model="model.bedgrp.rec.ownref" maxlength="16" placeholder="请输入基础交易编号"></c-input>
          </el-form-item>
        </c-col>

        <c-col :span="24" v-if="model.bpdgrp.rec.pnttyp=='' && model.bpdgrp.rec.fintyp=='P' && model.bptp.purtyp=='BO'">
          <el-form-item label="基础交易编号" prop="bodgrp.rec.ownref">
            <c-input v-model="model.bodgrp.rec.ownref" maxlength="16" placeholder="请输入基础交易编号"></c-input>
          </el-form-item>
        </c-col>

        <c-col :span="24" v-if="model.onlybptflg=='Y' && model.bpdgrp.rec.fintyp=='G' && model.bptp.fortyp=='1'">
          <el-form-item label="基础交易编号" prop="bodgrp.rec.ownref">
            <c-input v-model="model.bfdgrp.rec.ownref" maxlength="16" placeholder="请输入基础交易编号"></c-input>
          </el-form-item>
        </c-col>

        <!-- <c-col :span="24" v-if="model.bpdgrp.rec.pnttyp!=''">
					<c-istream-table ref="table" :list="model.liaall.tenstm.rows || []" :columns="stmData.columns" :showSelection="true" prop="liaall.tenstm">
					</c-istream-table>
				</c-col> -->

      </c-col>

      <!-- ============右边================= -->
      <c-col :span="12" style="padding-left: 20px">
        <c-col :span="24">
          <c-ptap :model="model" :argadr="{title:'融资申请人', grp: 'bpdgrp', rol: 'fia'}" ptytyp="C" :disabledExtkey="model.onlybptflg!='Y'" :disabled="model.onlybptflg!='Y'" @handleChange="partyChange" @clear="partyChange" v-if="model.bpdgrp.rec.pnttyp!='BFD'"></c-ptap>
          <el-card class="box-card" v-if="model.bpdgrp.rec.pnttyp==='BFD'">
            <c-ptap3 :model="model" :argadr="{
              title: '融资申请人',
							grp: 'bpdgrp',
							rol: 'fia'
						}" @handleChange="partyChange" @clear="partyChange" :isShowCard="false" :requiredExtkey="true" :isShowNam="true" :isShowAdr="true" :disabledExtkey="model.onlybptflg!='Y'" :isDisabled="true" :disabledNamelc="true" :disabledAdrelc="true" ptytyp='C'>
            </c-ptap3>
          </el-card>
        </c-col>

        <c-col :span="24" v-if="model.bpdgrp.rec.fintyp!='T' && model.bpdgrp.rec.fintyp!='M' && model.bpdgrp.rec.fintyp!='G' && model.bpdgrp.rec.fintyp!='F' && model.bpdgrp.rec.fortyp!='2'">
          <el-form-item label="" prop="dftcre.dfflag">
            <c-checkbox class="checkbox-left" true-label="X" false-label="" v-model="model.dftcre.dfflag">委托方代付</c-checkbox>
          </el-form-item>
        </c-col>

        <c-col :span="24" v-if="model.bpdgrp.rec.pntref==''">
          <el-form-item label="贸易合同号" prop="bpdgrp.rec.mycontno">
            <c-input v-model="model.bpdgrp.rec.mycontno" maxlength="35" placeholder="请输入贸易合同号"></c-input>
          </el-form-item>
        </c-col>

        <c-col :span="24">
          <el-form-item label="中文货物描述" prop="bpdgrp.rec.goddspcn">
            <c-input v-model="model.bpdgrp.rec.goddspcn" type="textarea" show-word-limit maxlength="100" placeholder="请输入中文货物描述"></c-input>
          </el-form-item>
        </c-col>

      </c-col>

      <c-col :span="24" v-if="model.bpdgrp.rec.pnttyp!='' && !this.isInfo">
        <el-table :data="model.liaall.tenorSettles" :columns="columns" :showButtonFlg="true">
          <!-- <el-table-column label="Cur" prop="cur" align="left" min-width="150" :show-overflow-tooltip="true" sortable>
        </el-table-column> -->
          <el-table-column v-for="(item, key) in columns" :key="key" :label="item.label" :width="item.width">
            <template slot-scope="scope">
              <span>{{ ['oldamt'].includes(item.prop) ? moneyFormat(scope.row[item.prop], scope.row.cur) : scope.row[item.prop] }}</span>
            </template>
          </el-table-column>
        </el-table>
        <!-- <c-istream-table ref="table" :list="model.liaall.tenstm.rows || []" :columns="stmData.columns" :showSelection="true" prop="liaall.tenstm">
				</c-istream-table> -->
      </c-col>
    </c-col>
  </div>
</template>

<script>
import event from "../event";
import Default from "../model/default";

export default {
  inject: ["root"],
  props: ["model", "codes"],
  mixins: [event, Default],
  data() {
    return {
      columns: [
        {
          label: "Type",
          prop: "cbtpfx"
        },
        {
          label: "Dbt",
          prop: "rol"
        },
        {
          label: "Cbt",
          prop: "cdtrol"
        },
        {
          label: "Cur",
          prop: "cur"
        },
        {
          label: "Amt",
          prop: "oldamt"
        },
        {
          label: "Mat.Dat.",
          prop: "matdat"
        }
      ]
    };
  },
  methods: {
    iscrotraChange() {
      if (
        this.model.bpdgrp.rec.fintyp != "F" &&
        (this.model.bpdgrp.rec.fintyp != "D" ||
          this.model.bptp.distyp != "DIS") &&
        (this.model.bpdgrp.rec.fintyp != "P" || this.model.bptp.purtyp != "NB0")
      ) {
        this.model.bpdgrp.rec.iscrotra = "";
      }
    },
    defaultFinCodN1000() {
      // 事件
      // 一个业务参考号下只能对应一笔借据号,因此简单用业务参考号赋值即可
      this.finmod.fincod = this.model.bpdgrp.rec.ownref;
      this.model.bpdgrp.rec.fincod = this.finmod.fincod;
    },
    //客户变更
    async partyChange() {
      // if (this.isBundFftmsg) {
      //   this.$alert("请先解绑LOA/NOA报文", "提示", {
      //     confirmButtonText: "确定"
      //   });
      //   return;
      // }
      this.model.bpdgrp.rec.ownref = "";
      this.defaultAccountsN1100();
      await this.defaultFinmod();
      this.defaultBpdgrpRecTolratN1000();
    },
    //福费廷转卖类型变更
    async ffttypChange() {
      debugger;
      if (this.model.bpdgrp.rec.ffttyp == "") {
        this.model.bpdgrp.rec.bmhrat = "";
      }
      await this.defaultFinmod();
      this.defaultBpdgrpRecTolratN1000();
    },
    //融资类型变更
    async fintypChange() {
      // if (this.isBundFftmsg) {
      //   this.$alert("请先解绑LOA/NOA报文", "提示", {
      //     confirmButtonText: "确定"
      //   });
      //   return;
      // }
      this.model.bpdgrp.rec.ownref = "";
      this.model.bpdgrp.rec.ffttyp = "";
      if (this.model.dedgrp.rec.elcflg === "Y") {
        if (this.model.bpdgrp.rec.fintyp === "G") {
          this.model.bptp.rcssta = "WORE";
        } else {
          this.model.bptp.rcssta = "WIRE";
        }
      }
      this.defaultFinmodIntprdN1000();
      this.defaultForTypsN1000();
      this.defaultFinTypes();
      await this.defaultFinmod();
      this.defaultBpdgrpRecTolratN1000();
      this.defaultParties();
      this.changFintypSetInv();
    },
    //是否合格押汇变更
    purtypChange() {
      this.defaultFinTypes();
    },
    //是否合格贴现变更
    distypChange() {
      this.defaultFinTypes();
    }
  },
  computed: {
    isDisableCur() {
      if (
        this.model.bpdgrp.rec.pnttyp == "" &&
        this.model.bpdgrp.rec.fpdinr == ""
      ) {
        return false;
      } else {
        if (this.model.onlybptflg == "Y" && this.model.spt.sta != "") {
          return false;
        } else {
          return true;
        }
      }
    },
    changeFiaPtyTyp() {
      let ptytyp = "C";
      if (
        (this.model.bpdgrp.rec.fintyp == "F" ||
          this.model.bpdgrp.rec.fintyp == "G") &&
        this.model.bpdgrp.rec.fortyp == "2"
      ) {
        ptytyp = "B";
      }
      return ptytyp;
    },
    setPurtyp() {
      if (
        this.model.bpdgrp.rec.pnttyp === "BED" ||
        this.model.bpdgrp.rec.pnttyp === "BFD"
      ) {
        return ["NB0", "DSB"];
      } else {
        return ["DSB", "BO"];
      }
    }
  },
  watch: {
    "model.bpdgrp.rec.ownref": {
      handler(val, oldval) {
        this.model.finmod.fincod = val;
        this.model.bpdgrp.rec.fincod = this.model.finmod.fincod;
        this.model.blcgrp.rec.relref = val;
        this.model.zxbgrp.rec.relref = val;
      }
    }
  },
  created() {}
};
</script>

<style lang="less" scoped>
.eibs /deep/ .el-form-item__label {
  display: flex;
  justify-content: flex-end;
}
</style>