Ovwp1.vue 17.4 KB
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 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478
<template>
  <div class="eibs">
      <c-col :span="24">
        <!-- ====================左边======================= -->
        <c-col :span="12" style="padding-right: 20px;">
          <c-col :span="24" >
            <el-form-item
                    label="Reference"
                    prop="ledgrp.rec.ownref"
                    style="width: 100%"
            >
              <c-fullbox>
                <c-input
                        v-model="model.ledgrp.rec.ownref"
                        maxlength="16"
                        placeholder=""
                        style="width: 98%"
                        :disabled="true"
                >
                </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.ledgrp.ben.pts.adrblk && !model.ledgrp.rec.ownref? false: true"
                          @click="onLetpButgetref('LETNOT')"
                  >
                    获取
                  </c-button>
                </template>
              </c-fullbox>
            </el-form-item>
          </c-col>
          <!-- Form of L/C -->
          <c-col :span="24">
            <el-form-item label="Form of L/C(40B)" prop="ledgrp.rec.lcrtyp">
              <c-select
                      v-model="model.ledgrp.rec.lcrtyp"
                      style="width: 100%"
                      placeholder=""
                      :filterKey="['I','IT']" dbCode="LCRTYP"
              >
              </c-select>
            </el-form-item>
          </c-col>

          <!-- responsible user -->
          <c-col :span="24" >
              <el-form-item label="Responsible User" prop="letp.usr.extkey">
                <c-fullbox>
                  <c-input
                          v-model="model.letp.usr.extkey"
                          maxlength="8"
                          placeholder=""
                          disabled
                  ></c-input>
                </c-fullbox>
              </el-form-item>
          </c-col>

          <!-- nominal amount -->
          <c-col :span="24" class="custom-box-wrap">
                <el-form-item label="Nominal Amount(32B)" prop="ledgrp.cbs.nom1.cur">
                  <c-select-cur v-model="model.ledgrp.cbs.nom1.cur" style="width: 115px" @change="nom1curChange" placeholder="" dbCode="curtxt" sort="SRT">
                  </c-select-cur>
                </el-form-item>
              <div class="box-3">
                <el-form-item label-width="5px" prop="ledgrp.cbs.nom1.amt">
                  <c-input-currency v-model="model.ledgrp.cbs.nom1.amt" :currency="model.ledgrp.cbs.nom1.cur"
                                    @change="calculateMaxamt"
                                    @keyup.enter.native="$event.target.blur()" style="width:100%" placeholder="">
                  </c-input-currency>
                </el-form-item>
              </div>
            <div class="box-2">
              <c-checkbox v-model="model.letp.addamtflg" true-label="X" false-label=""    @change="openAddAmount" class="checkbox-left">
                Add. Amount
              </c-checkbox>
            </div>
          </c-col>

          <!-- Amount Tolerance +/- -->
          <c-col :span="24" >
            <c-col :span="13">
              <el-form-item label="Amount Tolerance +/-(39A)" prop="ledgrp.rec.nomtop">
                <c-input
                        v-model.number="model.ledgrp.rec.nomtop"
                        maxlength="2"
                        @change="nomtopChange"
                        placeholder=""
                        style="min-width: 100px"
                        @keyup.enter.native="$event.target.blur()"
                        class="m-input-currency"
                ></c-input>
              </el-form-item>
            </c-col>
            <c-col :span="11">
              <el-form-item label-width="5px" prop="ledgrp.rec.nomton">
                <c-input
                        v-model.number="model.ledgrp.rec.nomton"
                        maxlength="2"
                        @change="nomtonChange"
                        placeholder=""
                        style="min-width: 100px"
                        @keyup.enter.native="$event.target.blur()"
                        class="m-input-currency"
                ></c-input>
              </el-form-item>
            </c-col>
          </c-col>

          <c-col :span="24">
              <el-form-item label="Amount Specification(39B)" prop="ledgrp.rec.nomspc">
                <c-select
                        v-model="model.ledgrp.rec.nomspc"
                        placeholder="Amount Specification"
                        dbCode="NOMSPC"
                        disabled
                >
                </c-select>
              </el-form-item>
          </c-col>

          <!-- Maximum Amount -->
          <c-col :span="13">
            <el-form-item label="Maximum Amount" prop="ledgrp.cbs.max.cur">
              <c-select-cur
                      v-model="maxcur"
                      style="width: 100%"
                      placeholder=""
                      dbCode="curtxt"  sort="SRT"
                      disabled
              >
              </c-select-cur>
            </el-form-item>
          </c-col>
          <c-col :span="11">
            <el-form-item label="" label-width="5px" prop="ledgrp.cbs.max.amt">
              <c-input-currency
                      disabled
                      v-model="model.ledgrp.cbs.max.amt"
                      :currency="maxcur"
                      placeholder=""
                      class="m-input-currency"
              ></c-input-currency>
            </el-form-item>
          </c-col>
          <!-- Additional Amount, 附加金额-->
          <div v-if="model.letp.addamtflg == 'X'">
            <c-col :span="24">
              <c-col :span="13">
                <el-form-item label="Additional Amount" prop="ledgrp.cbs.max2.cur">
                  <c-select v-model="max2cur" style="width:100%" disabled>
                  </c-select>
                </el-form-item>
              </c-col>
              <c-col :span="11">
                <el-form-item label="" label-width="5px" prop="ledgrp.cbs.max2.amt">
                  <c-input-currency v-model="model.ledgrp.cbs.max2.amt" :currency="max2cur" placeholder="" @change="changeBlkAddamtcov"></c-input-currency>

                </el-form-item>
              </c-col>
            </c-col>

            <c-col :span="24">
              <c-col :span="13">
                <el-form-item label="Open Add. Amount" prop="ledgrp.cbs.opn2.cur">
                  <c-select v-model="opn2cur" style="width:100%" placeholder="" disabled>
                  </c-select>
                </el-form-item>
              </c-col>
              <c-col :span="11">
                <el-form-item label="" label-width="5px" prop="ledgrp.cbs.opn2.amt">
                  <c-input-currency v-model="opn2amt" :currency="opn2cur" placeholder="" disabled></c-input-currency>
                </el-form-item>
              </c-col>
            </c-col>

            <c-col :span="24">
              <el-form-item label="Amounts Covered(39C)" prop="ledgrp.blk.addamtcov">
                <c-input type="textarea" v-model="model.ledgrp.blk.addamtcov" maxlength="140" show-word-limit
                         placeholder="" rows="4"></c-input>
              </el-form-item>
            </c-col>
          </div>

          <!-- Confirmation Instruct.Received -->
          <c-col :span="24">
            <el-form-item label="Confirmation Instruct.Received(49)" prop="ledgrp.rec.cnfdet">
              <c-select
                      v-model="model.ledgrp.rec.cnfdet"
                      style="width: 100%"
                      placeholder=""
                      dbCode="CNFFLG"
              >
              </c-select>
            </el-form-item>
          </c-col>
          <!-- Applicable Rules -->
          <c-col :span="24">
            <el-form-item label="Applicable Rules(40E)" prop="ledgrp.rec.apprul">
              <c-select
                      v-model="model.ledgrp.rec.apprul"
                      style="width: 100%"
                      placeholder=""
                      dbCode="APPRL1" sort="SRT"
                      @change="apprulChange"
              >
              </c-select>
            </el-form-item>
          </c-col>
          <!-- Other Applicable rules -->
          <c-col :span="24">
            <el-form-item :rules="[{required:model.ledgrp.rec.apprul === 'OTHR',message:'This field is mandatory',trigger:'change'}]" label="Other Applicable Rules(40E)" prop="ledgrp.rec.apprultxt">
              <c-input
                      v-model="model.ledgrp.rec.apprultxt"
                      maxlength="35"
                      placeholder=""
                      :disabled="model.ledgrp.rec.apprul === 'OTHR' ? false : true"
              ></c-input>
            </el-form-item>
          </c-col>

          <!-- Partial Shipment -->
          <c-col :span="24">
            <el-form-item label="Partial Shipment(43P)" prop="ledgrp.rec.shppars18">
              <c-select
                      v-model="model.ledgrp.rec.shppars18"
                      style="width: 100%"
                      placeholder=""
                      dbCode="SHPPA1"

              >
              </c-select>
            </el-form-item>
          </c-col>
          <!-- TransShipment -->
          <c-col :span="24">
            <el-form-item label="TranShipment(43T)" prop="ledgrp.rec.shptrss18">
              <c-select
                      v-model="model.ledgrp.rec.shptrss18"
                      style="width: 100%"
                      placeholder=""
                      dbCode="SHPTRS"
              >
              </c-select>
            </el-form-item>
          </c-col>

        </c-col>

        <!-- ========================右边======================= -->
        <c-col :span="12" style="padding-left: 20px;">
          <c-col :span="24">
              <el-form-item
                      prop="ledgrp.rec.preadvdt" label="Date Pre-advised(23)"
              >
                <c-date-picker
                        type="date"
                        v-model="model.ledgrp.rec.preadvdt"
                        style="min-width: 130px"
                        value-format="yyyy-MM-dd"
                        placeholder=""
                >
                </c-date-picker>
              </el-form-item>
          </c-col>

          <!-- Issued on -->
          <c-col :span="24">
            <div >
                <el-form-item label="Issued on(31C)" prop="ledgrp.rec.opndat">
                  <c-date-picker
                          disabled
                          type="date"
                          v-model="model.ledgrp.rec.opndat"
                          style="min-width: 130px"
                          value-format="yyyy-MM-dd"
                          placeholder=""
                  >
                  </c-date-picker>
                </el-form-item>
            </div>
          </c-col>


          <!-- expiring on -->
          <c-col :span="24">
            <el-form-item label="Expiring on(31D)" prop="ledgrp.rec.expdat">
              <c-date-picker
                      type="date"
                      v-model="model.ledgrp.rec.expdat"
                      style="width: 100%;min-width: 130px"
                      value-format="yyyy-MM-dd"
                      placeholder="please select a date"
              >
              </c-date-picker>
            </el-form-item>
          </c-col>

          <!-- in (place)/counters of -->
          <c-col :span="24">
            <el-form-item label="in (Place)/ counters of(31D)" prop="ledgrp.rec.expplc">
              <c-input
                      v-model="model.ledgrp.rec.expplc"
                      maxlength="29"
                      placeholder=""
              ></c-input>
            </el-form-item>
          </c-col>

          <!-- Shipment date -->
          <c-col :span="24">
            <div style="width: 100%;display: flex;align-items: center;justify-content: flex-start;">
              <div   style="width: 100%;">
                <el-form-item label="Shipment Date(44C)" prop="ledgrp.rec.shpdat">
                  <c-date-picker
                          type="date"
                          v-model="model.ledgrp.rec.shpdat"
                          style="min-width: 130px"
                          placeholder=""
                          value-format="yyyy-MM-dd"
                          :disabled="model.ledgrp.blk.shpper!==''"
                  >
                  </c-date-picker>
                </el-form-item>
              </div>
            </div>

          </c-col>

          <!-- Shipment Period -->
          <c-col :span="24">
            <el-form-item label="Shipment Period(44D)" prop="ledgrp.blk.shpper">
              <!-- maxlength 65*6, view-lines 4 -->
              <c-input
                      type="textarea"
                      v-model="model.ledgrp.blk.shpper"
                      :rows="4"
                      maxlength="390"
                      show-word-limit
                      placeholder=""
                      :disabled="model.ledgrp.rec.shpdat!=null&&model.ledgrp.rec.shpdat!==''"
              ></c-input>
            </el-form-item>
          </c-col>

          <!-- 交单期限 Days of Presentation period-->
          <c-col :span="24">
            <el-form-item label="Presentation Period(48)" prop="ledgrp.rec.prepers18">
              <c-input
                      v-model.number="model.ledgrp.rec.prepers18"
                      maxlength="3"
                      placeholder=""
                      @change="prepers18Change"
              ></c-input>
            </el-form-item>
          </c-col>

          <!-- Presentation period text -->
          <c-col :span="24">
            <el-form-item
                    label=""
                    prop="ledgrp.rec.prepertxts18"
            >
              <c-input
                      v-model="model.ledgrp.rec.prepertxts18"
                      maxlength="35"
                      placeholder=""
              ></c-input>
            </el-form-item>
          </c-col>

          <!-- country or region code -->
          <c-col :span="24">
            <el-form-item label="Country or Region Code"  prop="ledgrp.rec.stacty">
              <c-select
                      v-model="model.ledgrp.rec.stacty"
                      style="width: 100%"
                      placeholder=""
                      dbCode="CTYTXT"
              >
              </c-select>
            </el-form-item>
          </c-col>


          <!-- Revolving L/C -->
<!--          <c-col :span="12">
            <el-form-item class="checkbox-left">
            <c-checkbox v-model="model.ledgrp.rec.revflg" true-label="X" false-label="">Revolving L/C</c-checkbox>
            </el-form-item>
          </c-col>-->

          <!-- Non-Bank Issuer -->
          <c-col :span="12">
            <el-form-item class="checkbox-left">
            <c-checkbox v-model="model.ledgrp.rec.nonban" true-label="X" false-label=""> Non-Bank Issuer</c-checkbox>
            </el-form-item>
          </c-col>

          <!-- Test Key Unconfirmity -->
          <c-col :span="12">
            <el-form-item class="checkbox-left">
            <c-checkbox v-model="model.ledgrp.rec.teskeyunc" true-label="X" false-label="">Test Key Unconfirmity</c-checkbox>
            </el-form-item>
          </c-col>
        </c-col>

      </c-col>

  </div>
</template>
<script>
import event from "../event";
import Api from "~/service/Api"
import BigNumber from "bignumber.js";

export default {
  // components: { 'c-ptap': Ptap },
  inject: ['root'],
  props: ['model', 'codes'],
  mixins: [event],
  data() {
    return {}
  },
  computed:{
    maxcur(){
      this.model.ledgrp.cbs.max.cur = this.model.ledgrp.cbs.nom1.cur
      return this.model.ledgrp.cbs.max.cur
    },
    maxamt() {
      // nom1.amt*(1+nomtop/100)
      let _maxamt =new BigNumber(this.model.ledgrp.cbs.nom1.amt).multipliedBy(new BigNumber(1).plus(new BigNumber(this.model.ledgrp.rec.nomtop).dividedBy(new BigNumber(100))) ) ;
      let _currency = this.model.ledgrp.cbs.max.cur;
      // 如果是 韩元或者日元,小数位不保留,其它保留两位小数
      // TD上,nom1:611.23,tolerance-top:2,maxamt 623.4546,letnot最后是623.46,letopn 最后是623.45,暂时以letopn为准
      if (_currency === "KRW" || _currency === "JPY") {
        _maxamt = _maxamt.toFixed(0);
      }else {
        _maxamt = _maxamt.toFixed(2);
      }
      this.model.ledgrp.cbs.max.amt = _maxamt;

      // 默认将将max的值赋值给opn1
      this.model.ledgrp.cbs.opn1.amt = this.model.ledgrp.cbs.max.amt;
      return this.model.ledgrp.cbs.max.amt
    },

    max2cur(){
      this.model.ledgrp.cbs.max2.cur = this.model.ledgrp.cbs.max.cur
      return this.model.ledgrp.cbs.max2.cur
    },
    opn2cur(){
      this.model.ledgrp.cbs.opn2.cur = this.model.ledgrp.cbs.max.cur
      return this.model.ledgrp.cbs.opn2.cur
    },

    opn2amt(){
      this.model.ledgrp.cbs.opn2.amt = this.model.ledgrp.cbs.max2.amt
      return this.model.ledgrp.cbs.opn2.amt
    },

  },
}
</script>
<style>

</style>