index.vue 12.8 KB
<template>
  <div class="eibs">
    <!-- <c-col :span="24" style="margin-bottom:18px">
        Liability
    </c-col> -->
        <c-col :span="24" style="">
          <c-table
            :list="model.liaall.liaallg"
            style="width:100%,text-align:center,margin-bottom:18px"
            :border="true"
            :total="model.liaall.liaallg.length"
          >
            <el-table-column prop="bussec" label="业务" width="70px">
            </el-table-column>
            <el-table-column prop="cbtpfx" label="类型" width="70px">
            </el-table-column>
            <el-table-column prop="matdat" label="到期日" width="150px">
              <template slot-scope="scope">
                <el-form-item
                  label-width="0"
                  :prop="'liaall.liaallg.' + scope.$index + '.matdat'"
                >
                  <c-date-picker
                    type="date"
                    v-model="scope.row.matdat"
                    value-format="yyyy-MM-dd"
                    placeholder="请选择日期"
                    style="width: 100%"
                    @change="executeDefault('liaall.liaallg.matdat')"
                    :disabled="root.trnName == 'letopn'"
                  >
                  </c-date-picker>
                </el-form-item>
              </template>
            </el-table-column>
            <el-table-column prop="tenday" label="效期" width="70px">
              <template slot-scope="scope">
                <el-form-item
                  label-width="0"
                  :prop="'liaall.liaallg.' + scope.$index + '.tenday'"
                >
                  <c-input
                    v-model="scope.row.tenday"
                    style="width: 100%"
                    placeholder="请输入"
                  >
                  </c-input>
                </el-form-item>
              </template>
            </el-table-column>
            <el-table-column prop="rol" label="债务人" width="70px">
            </el-table-column>
            <!--
        <el-table-column prop="nam" label="Name" width="300"> </el-table-column>
        -->
            <el-table-column prop="cdtrol" label="债权人" width="70px">
            </el-table-column>
            <el-table-column prop="cur" label="币种" width="70px">
            </el-table-column>
            <el-table-column prop="oldamt" label="原始金额" width="110px">
              <!-- <template slot-scope="scope">
                  <c-input-currency
                  v-model="scope.row.oldamt"
                  placeholder="0.00"
                ></c-input-currency>
              </template> -->
              <!-- <template slot-scope="scope">
                  {{moneyFormat(scope.row.oldamt)}}
                  </template> -->
            </el-table-column>
            <el-table-column prop="amt" label="记账金额" width="110px">
              <!-- <template slot-scope="scope">
                  {{moneyFormat(scope.row.amt)}}
                </template> -->
         <!-- <template slot-scope="scope">
            <c-input-currency
            v-model="scope.row.amt"
            placeholder="0.00"
          ></c-input-currency>
          </template> -->
            </el-table-column>
            <el-table-column prop="tenpct" label="%" width="70px">
            </el-table-column>
            <el-table-column prop="acc" label="核心账号" width="200px">
              <!-- check,需用el-form-item标签包起来 -->
              <template slot-scope="scope">
                <el-form-item
                  label-width="0"
                  :prop="'liaall.liaallg.' + scope.$index + '.acc'"
                >
                {{scope.row.acc}}
                  <!-- <c-input
                v-model="scope.row.acc"
                style="width: 100%"
                placeholder="请输入"
              >
              </c-input> -->
                </el-form-item>
              </template>
            </el-table-column>
            <el-table-column prop="valdat" label="起息日" width="auto">
              <template slot-scope="scope">
                <!-- {{ dateFormat(scope.row.valdat) }} -->
              </template>
            </el-table-column>
            <el-table-column label="" prop="det" width="150px" height="0px" fixed="right" >
              <template slot-scope="scope" slot="header">
                <c-button
                  circle
                  style="padding: 4px"
                  class="el-icon-plus"
                  size="mini"
                  @click="addRow(scope)"
                >
                </c-button>
                <c-button
                  style="padding: 4px"
                  circle
                  class="el-icon-minus"
                  size="mini"
                  @click="removeRow(scope)"
                >
                </c-button>
              </template>
              <template slot-scope="scoped">
                <c-button
                  style="margin-left: 0"
                  size="small"
                  type="primary"
                  icon="el-icon-info"
                  @click="detail1(scoped.$index, scoped.row)"
                ></c-button>
              </template>
            </el-table-column>
          </c-table>
        </c-col>

        <div style="height=500px">
          <engp-dialog
            ref="engpDialog"
            :model="model"
            :idx="index"
            :codes="codes"
          />
        </div>

        <!-- <c-col :span="12">
        <el-form-item label="Sight Amount">
            <c-input style="width:50%"  v-model="model.liaall.outamt"  placeholder="请输入Sight Amount"></c-input>
        </el-form-item>
       </c-col>                 
                  
       <c-col :span="12">
        <el-form-item label="Sight Amount Percentage">
            <c-input style="width:50%"  v-model="model.liaall.outpct"  placeholder="请输入Sight Amount Percentage"></c-input>
        </el-form-item>
       </c-col>             
                                                    
       <c-col :span="12">
        <el-form-item label="External Booking Amount">
            <c-input style="width:70%"  v-model="model.liaall.concur" maxlength="3"  placeholder="请输入External Booking Amount"></c-input>
        </el-form-item>
       </c-col>              -->

        <c-col :span="16" style="margin-top: 10px">
          <el-form-item label="未分配金额">
            <c-input
              style="width: 15%"
              disabled
              v-model="model.liaall.concur"
              maxlength="3"
              placeholder=""
            ></c-input>
            <c-input
              style="width: 40%;margin-left:10px;"
              disabled
              v-model="model.liaall.misamt"
              placeholder="请输入金额"
            ></c-input>
            <c-button
              style="width: 20%"
              size="small"
              disabled
              type="primary"
              @click="onLiaallButmisamt"
            >
              添加到当前行
            </c-button>
          </el-form-item>
        </c-col>

        <!-- <c-col :span="1" style="text-align:left;margin-left:0">
           <el-form-item label="">
            <c-button size="small" disabled type="primary"  @click="onLiaallButmisamt">
                Add to Current Line
            </c-button>
           </el-form-item>
       </c-col> -->

        <!-- <c-col :span="12">
        <el-form-item label="">
            <c-button size="small" type="primary"  @click="onLiaallButmissig">
                Add to Sight Amount
            </c-button>
        </el-form-item>
       </c-col>
                                   
       <c-col :span="12">
        <el-form-item label="Old Amount booked externally">
            <c-input style="width:50%"  v-model="model.liaall.exttotoldamt"  placeholder="请输入Old Amount booked externally"></c-input>
        </el-form-item>
       </c-col>                 
                                   
       <c-col :span="12">
        <el-form-item label="Total booking amount external assinged">
            <c-input style="width:50%"  v-model="model.liaall.exttotamt"  placeholder="请输入Total booking amount external assinged"></c-input>
        </el-form-item>
       </c-col>                  -->
  </div>
</template>
<script>
import Api from "~/service/Api";
import commonProcess from "~/mixin/commonProcess";
import Utils from "~/utils/index";
import Factory from "./Factory";
import EngpDialog from "../EngpDialog.vue";
import Gitopn from "~/page/Business/Gitopn/model/index";


export default {
  inject: ["root"],
  props: ["codes"],
  mixins: [commonProcess],
  components: {
    EngpDialog,
  },
  data() {
    return {
      dialogVisible: false,
      dialog: {},
      index: 0,
      model: new Gitopn().data,
    };
  },
  methods: {
    async processEngp() {
        console.log("111111sss")
      this.model.gidgrp.transName = "gitopn";
      this.model.gidgrp.userId = "742549";
      this.model.gidgrp.rec.objtyp = "GID";
      this.model.gidgrp.rec.ownref = "LG3500230625AA";
      this.model.gidgrp.rec.branchInr = "";
      this.model.gidgrp.rec.detchgcod = "OUR";
      this.model.gidgrp.rec.paytyp = "O";
      this.model.gidgrp.rec.swftyp = "103";
      this.model.gidgrp.rec.valdat = "";
      this.model.gidgrp.rec.gartyp = "1";
      this.model.gidgrp.cbs.opc2.cur = "";
      this.model.gidgrp.cbs.opc2.amt = "0.000";
      this.model.gidgrp.cbs.opn1.cur = "USD";
      this.model.gidgrp.cbs.opn1.amt = "1000.000";
      // this.model.gidgrp.cbs.opn2.cur = "USD";
      // this.model.gidgrp.cbs.opn2.amt = "1000.000";
      this.model.gidgrp.cbs.max.cur = "USD";
      this.model.gidgrp.cbs.max.amt = "1000.000";
      this.model.gidgrp.cbs.mac2.cur = "";
      this.model.gidgrp.cbs.mac2.amt = "0.000";
      this.model.gidgrp.cbs.mac.cur = "";
      this.model.gidgrp.cbs.mac.amt = "0.000";
      // this.model.gidgrp.cbs.cnf.cur = "USD";
      // this.model.gidgrp.cbs.cnf.amt = "1000.000";
      let pts = {
        rol: "BEN",
        nam: "",
        ptyinr: "",
        ptainr: "",
        extkey: "999900000009",
        dftdsp: "",
        dftcur: "",
        dftact: "",
        dftfeecur: "",
        dftactptainr: "",
        glggrpflg: "",
        adrblk: "T2342342324234 22342342"
      };
      
      this.model.gidgrp.ben.pts=pts;
      let pts2 = {
        rol: "ADV",
        nam: "",
        ptyinr: "",
        ptainr: "",
        extkey: "EVERCNBJBUS-001",
        dftdsp: "",
        dftcur: "",
        dftact: "",
        dftfeecur: "",
        dftactptainr: "",
        glggrpflg: "",
        adrblk: "CHINA EVERBRIGHT BANK 100031 BEIJING CHINA"
      };
      this.model.gidgrp.adv.pts=pts2;
      let pts3 = {
        rol: "APL",
        nam: "",
        ptyinr: "",
        ptainr: "11593263",
        extkey: "2000017770-001",
        dftdsp: "",
        dftcur: "",
        dftact: "",
        dftfeecur: "",
        dftactptainr: "",
        glggrpflg: "",
        adrblk:
          "Brilliance Technology Co., Ltd. 8 / F, block B, building 2, Jinyuan East lantianchang Road,Haidian Dist 100087BEIJING, CHINA"
      };
      this.model.gidgrp.apl.pts=pts3;
      this.model.liaall.setglg.setgll = [];
      this.model.liaall.setfog.setfol = [];
      this.model.liaall.setfeg.setfel = [];
        console.log("11222221111sss")
        console.log(this.model)



      let transName = "gitopn";
      let buildData = Factory[transName];
    //   if (!buildData) {
    //     //提示未注册的费用计算处理
    //     this.$notify.error({ title: "错误", message: "未注册的费用计算处理!" });
    //   }
      let engpBuildObj = new buildData(this.model);
      engpBuildObj.buildEngp();
    //   let liaall = ccvpanBuildObj.liaall;
    //   //发出API请求
      const loading = this.loading("正在请求数据");
      const rulePath = "/business/liaall/assertLiaall";
      let rtnmsg = await Api.post(rulePath, this.model.liaall);
      if (rtnmsg.respCode == SUCCESS) {
        Utils.copyValueFromVO(this.model.liaall, rtnmsg.data);
        console.log(this.model.liaall);
        this.model.liaall.liaallg = this.model.liaall.liaallg;
      }
      loading.close();
    },
    async onLiaallButmisamt() {
      let rtnmsg = await this.executeRule("liaall_butmisamt");
      if (rtnmsg.respCode == SUCCESS) {
        //TODO 处理数据逻辑
      } else {
        this.$notify.error({ title: "错误", message: "服务请求失败!" });
      }
    },

    detail1(index, row) {
      const that = this;
      const rule = "liaall.liaallg(" + (index + 1) + ").det";
      that.executeRule(rule).then((res) => {
        that.$refs.engpDialog.visiable = true;
        that.$refs.engpDialog.formData = Object.assign(
          {},
          that.model.liaall.liaallg[index]
        );
        that.index = index;
        that.dialog = row;
      });
    },
  },
  created: function() {}
};
</script>