<template>
  <div>
    <el-button type="text" @click="goBack">返回</el-button>
    <div>
      <el-collapse v-model="activeNames">

        <el-collapse-item title="基本信息" name="1">
          <div>
            <h2 style="float:left">基本信息</h2>
            <el-button style="float:right;margin-right:65px" type="primary" @click="addQuestion">新增反馈记录</el-button>
            <br/>
          </div>

          <br/>
          <br/>
          <el-row :gutter="20" type="flex" :data="basicInfo" style="margin-left:50px">
            <el-col :span="8">
              <div class="grid-content bg-purple">姓名：{{basicInfo.name}}</div>
            </el-col>
            <el-col :span="8">
              <div class="grid-content bg-purple">身份证号：{{basicInfo.idCard}}</div>
            </el-col>
            <el-col :span="8">
              <div class="grid-content bg-purple">手机号：{{basicInfo.phone}}</div>
            </el-col>
          </el-row>
          <br/>

          <h2>认证信息</h2>
          <br/>

          <el-row :gutter="20" style="margin-left:50px">
            <el-col :span="8">
              <div class="grid-content bg-purple">实名认证：{{basicInfo.isIdentity}}</div>
            </el-col>
            <el-col :span="8">
              <div class="grid-content bg-purple">基础信息认证：{{basicInfo.isBasicInfo}}</div>
            </el-col>
            <el-col :span="8">
              <div class="grid-content bg-purple">活体认证：{{basicInfo.isFace}}</div>
            </el-col>
          </el-row>
          <br/>


          <el-row :gutter="20" type="flex" style="margin-left:50px;">

            <el-col :span="8">
              <div class="grid-content bg-purple">客户单位名称：{{basicInfo.companyName}}</div>
            </el-col>
            <el-col :span="8">
              <div class="grid-content bg-purple">客户单位地址：{{basicInfo.companyAddress}}</div>
            </el-col>
            <el-col :span="8">
              <div class="grid-content bg-purple">住宅地址：{{basicInfo.houseAddress}}</div>
            </el-col>

          </el-row>
          <br/>

          <el-row :gutter="20" type="flex" :data="basicInfo" style="margin-left:50px">
            <el-col :span="8">
              <div class="grid-content bg-purple">第一联系人姓名：{{basicInfo.firstName}}</div>
            </el-col>
            <el-col :span="8">
              <div class="grid-content bg-purple">第一联系人电话：{{basicInfo.firstPhone}}</div>
            </el-col>

          </el-row>
          <!-- 当前用户认证的银行卡列表 -->
          <el-table :data="ownerBank" stripe style="width: 100%;">
            <el-table-column prop="bankAccount" label="银行卡号"></el-table-column>
            <el-table-column prop="openBankName" label="银行名称"></el-table-column>
            <el-table-column prop="ownerName" label="姓名"></el-table-column>
            <el-table-column prop="payChannelApi" label="渠道名称"></el-table-column>
            <el-table-column prop="gmtCreated" label="绑定时间" :formatter="dateFormat"></el-table-column>
            <el-table-column label="操作">
              <template scope="scope">

                <el-button type="text" size="small" @click="ownerBankBind(scope.row)">绑卡记录</el-button>
              </template>
            </el-table-column>

          </el-table>

        </el-collapse-item>

        <el-collapse-item  name="2">
          <h2>借款信息</h2>
          <br/>

          <el-table :data="loanResultLists" stripe style="width: 100%;">
            <el-table-column prop="loanNo" label="借款编号"></el-table-column>
            <el-table-column prop="gmtCreated" label="申请日期" :formatter="dateFormats"></el-table-column>
            <el-table-column prop="startDate" label="放款日期" :formatter="dateFormats"></el-table-column>
            <el-table-column prop="raiseAmt" label="放款本金"></el-table-column>
            <el-table-column prop="status" label="借款单状态" :formatter="loanStatusFormat"></el-table-column>
            <!--<el-table-column prop="memo" label="备注"></el-table-column>-->
            <el-table-column label="查看详情">
              <template scope="scope">
                <el-button type="text" size="small" @click="addLoanDetail(scope.row)">详情</el-button>
              </template>
            </el-table-column>
          </el-table>

        </el-collapse-item>

        <el-collapse-item title="申请信息" name="3">

          <p style="margin-left:50px"><strong>当前借款</strong></p>
          <br/>
          <div v-if="this.loanModel !=null">
            <el-row :gutter="20" :data="loanModel" style="margin-left:50px">
              <el-col :span="6">
                <div class="grid-content bg-purple">申请日期：{{loanModel.gmtCreated | dateFilter}}</div>
              </el-col>
              <el-col :span="6">
                <div class="grid-content bg-purple">放款日期：{{loanModel.raiseDate | dateFilter}}</div>
              </el-col>
              <el-col :span="6">
                <div class="grid-content bg-purple">项目名称：{{loanModel.bizTypeStr}}</div>
              </el-col>


            </el-row>
            <br/>
            <el-row :gutter="20" :data="loanModel" style="margin-left:50px">
              <el-col :span="6">
                <div class="grid-content bg-purple">总应还金额：{{loanModel.loanAmt}}</div>
              </el-col>

              <el-col :span="6">
                <div class="grid-content bg-purple">申请期数：{{loanModel.loanLimit}}</div>
              </el-col>

              <el-col :span="6">
                <div class="grid-content bg-purple" v-if="loanModel.cardBankAccount">
                  放款银行卡（所属银行）：{{loanModel.cardBankAccount}}（{{loanModel.cardBankCodeStr}}）
                </div>
                <div class="grid-content bg-purple" v-else>放款银行卡（所属银行）：{{loanModel.bankAccount}}</div>
              </el-col>
            </el-row>
            <br/>
            <el-row :gutter="20" :data="loanModel" style="margin-left:50px">

              <el-col :span="6">
                <div class="grid-content bg-purple">本金：{{loanModel.raiseAmt}}</div>
              </el-col>
              <el-col :span="6">
                <div class="grid-content bg-purple">总服务费：{{loanModel.serviceAmt}}</div>
              </el-col>
              <el-col :span="6">
                <div class="grid-content bg-purple">总利息：{{loanModel.rateAmt}}</div>
              </el-col>

            </el-row>
          </div>
        </el-collapse-item>


        <el-collapse-item title="账单详情" name="4">

          <br/>
          <div style="margin-left:10px">
            <strong>
              <el-row :gutter="20" :data="loanModel" style="margin-left:20px">
                <el-col :span="6">
                  <div class="grid-content bg-purple">借款编号：{{ this.advanceLoanAmt.loanNo }}</div>
                </el-col>
                <el-col :span="6">
                  <div class="grid-content bg-purple">账单剩余应还：{{ this.loanVo.surAmt }}</div>
                </el-col>
                <el-col :span="6">
                  <div class="grid-content bg-purple">账单已还款：{{ this.loanVo.alrAmt }}</div>
                </el-col>
                <el-col :span="6">
                  <!-- <el-button type="primary" size="small" @click="advanceLoanAmt()" v-if="this.loanModel.status=='BACKING'">提前结清</el-button> -->
                  <el-button type="primary" size="small" @click="advanceLoanAmt()" v-if="isNeedAudit">提前结清</el-button>
                </el-col>
              </el-row>
            </strong>
          </div>
          <br/>

          <el-table :data="loanApplyList" stripe style="width: 100%;">
            <el-table-column prop="planNo" label="计划编号"></el-table-column>
            <el-table-column prop="planIndex" label="计划期数"></el-table-column>
            <el-table-column prop="planAmt" label="计划应还总金额"></el-table-column>
            <el-table-column prop="planBen" label="计划本金"></el-table-column>
            <el-table-column prop="planFu" label="计划服务费"></el-table-column>
            <el-table-column prop="planXi" label="计划利息"></el-table-column>
            <el-table-column prop="planDate" label="计划还款时间" :formatter="dateFormat"></el-table-column>
            <el-table-column prop="backedAmt" label="已还金额" :formatter="planMoneyFormat"></el-table-column>
            <el-table-column prop="derateAmt" label="减免金额"></el-table-column>
            <el-table-column prop="remainAmt" label="待还金额"></el-table-column>
            <el-table-column prop="statusStr" label="还款状态"></el-table-column>
            <el-table-column label="操作">
              <template scope="scope">

                <el-button type="text" size="small" v-if=" scope.row.status=='SETTLED' " disabled
                           @click="offineTransfer(scope.row)">线下转账
                </el-button>
                <el-button type="text" size="small" v-else @click="offineTransfer(scope.row)">线下转账</el-button>
              </template>
            </el-table-column>
          </el-table>

        </el-collapse-item>


        <el-collapse-item title="还款情况" name="5">

          <el-table :data="loanBackedList" stripe style="width: 100%;">
            <el-table-column prop="backedNo" label="还款编号"></el-table-column>
            <el-table-column prop="planIndex" label="期数"></el-table-column>
            <el-table-column prop="backedAmt" label="还款金额"></el-table-column>
            <el-table-column prop="backedTypeStr" label="还款方式"></el-table-column>
            <!-- <el-table-column prop="backedXi" label="还款利息"></el-table-column> -->
            <el-table-column prop="statusStr" label="还款单状态"></el-table-column>
            <el-table-column prop="cardOwnerName" label="银行账号户主名称"></el-table-column>
            <el-table-column prop="cardOwnerMobile" label="银行账号户主电话号码"></el-table-column>
            <el-table-column prop="cardBankAccount" label="银行账号" :formatter="cardBankFormat"></el-table-column>
            <el-table-column prop="bankAccount" label="还款银行账号"></el-table-column>
            <el-table-column prop="bankOwner" label="还款银行账户"></el-table-column>
            <el-table-column prop="backedDate" label="还款时间" :formatter="dateCompare"></el-table-column>
            <el-table-column prop="resultStr" label="还款结果" :formatter="resultBankFormat"></el-table-column>
            <el-table-column prop="creator" label="创建人"></el-table-column>
            <el-table-column prop="memo" label="备注"></el-table-column>
          </el-table>
        </el-collapse-item>


        <el-collapse-item title="反馈问题记录" name="6">

          <el-table :data="loanQuestionList" stripe style="width: 100%;">
            <el-table-column prop="id" label="问题编号"></el-table-column>
            <el-table-column prop="gmtCreated" label="记录时间" :formatter="dateFormat"></el-table-column>
            <el-table-column prop="creator" label="跟进人"></el-table-column>
            <el-table-column prop="pointName" label="功能点"></el-table-column>
            <el-table-column prop="pointTitle" label="问题标题"></el-table-column>
            <el-table-column prop="problemDescription" label="问题描述"></el-table-column>
            <el-table-column prop="pointSolve" label="解决方式"></el-table-column>
            <el-table-column prop="pointStatus" label="状态" :formatter="serviceFormat"></el-table-column>
            <el-table-column label="操作">
              <template scope="scope">
                <el-button type="text" size="small" @click="updateQueDialog(scope.row)">修改</el-button>
              </template>
            </el-table-column>
          </el-table>
        </el-collapse-item>

        <el-collapse-item title="操作日志" name="7">

          <el-table :data="loanLogCustom" stripe style="width: 100%;">
            <!-- <el-table-column prop="id" label="操作人员"></el-table-column> -->
            <el-table-column prop="typeStr" label="操作类型"></el-table-column>
            <!-- <el-table-column prop="memo" label="操作结果"></el-table-column> -->
            <el-table-column prop="gmtCreated" label="操作时间" :formatter="dateFormat"></el-table-column>
            <el-table-column prop="memo" label="备注"></el-table-column>
          </el-table>
        </el-collapse-item>

      </el-collapse>


    </div>


    <!--窗口组件-->
    <template>
      <!--新增窗口-->
      <addQuestion
        v-if="ui.addQuestion.visible"
        :clientNo="ui.addQuestion.clientNo"
        :dialogVisible.sync="ui.addQuestion.visible"
      >
      </addQuestion>
    </template>

    <!--窗口组件-->
    <template>

      <!--提前结清-->
      <advanceLoanAmt
        v-if="ui.advanceLoanAmt.visible"
        :loanNo="ui.advanceLoanAmt.loanNo"
        :dialogVisible.sync="ui.advanceLoanAmt.visible"
      >
      </advanceLoanAmt>
      <!--修改窗口-->
      <updateQueDialog
        v-if="ui.updateQueDialog.visible"
        :id="ui.updateQueDialog.id"
        :pointName="ui.updateQueDialog.pointName"
        :pointTitle="ui.updateQueDialog.pointTitle"
        :problemDescription="ui.updateQueDialog.problemDescription"
        :pointSolve="ui.updateQueDialog.pointSolve"
        :pointStatus="ui.updateQueDialog.pointStatus"
        :creator="ui.updateQueDialog.creator"
        :dialogVisible.sync="ui.updateQueDialog.visible">
      </updateQueDialog>
    </template>

    <!-- 详情组件 -->

    <template>
      <readDetail
        v-if="ui.readDetail.visible"
        :planNo="ui.readDetail.planNo"
        :planIndex="ui.readDetail.planIndex"
        :planAmt="ui.readDetail.planAmt"
        :backedBen="ui.readDetail.backedBen"
        :backedFu="ui.readDetail.backedFu"
        :planXi="ui.readDetail.planXi"
        :planFu="ui.readDetail.planFu"
        :planBen="ui.readDetail.planBen"
        :backedXi="ui.readDetail.backedXi"
        :loanLimit="ui.readDetail.loanLimit"
        :dialogVisible.sync="ui.readDetail.visible">
      </readDetail>
    </template>
    <!-- 线下转账 -->
    <template>
      <offineTransfer
        v-if="ui.offineTransfer.visible"
        :orderNo="ui.offineTransfer.orderNo"
        :loanNo="ui.offineTransfer.loanNo"
        :periodNo="ui.offineTransfer.periodNo"
        :planNo="ui.offineTransfer.planNo"
        :planAmt="ui.offineTransfer.planAmt"
        :planFu="ui.offineTransfer.planFu"
        :planBen="ui.offineTransfer.planBen"
        :planXi="ui.offineTransfer.planXi"
        :dialogVisible.sync="ui.offineTransfer.visible">
      </offineTransfer>
    </template>
    <!-- 绑卡记录 -->
    <template>
      <ownerBankBind
        v-if="ui.ownerBankBind.visible"
        :cardLogList="ui.ownerBankBind.cardLogList"
        :dialogVisible.sync="ui.ownerBankBind.visible">
      </ownerBankBind>
    </template>


  </div>
</template>

<script>
  import * as moment from "moment";
  import addQuestion from "../byh/AddQuestion";
  import advanceLoanAmt from "./AdvanceLoanAmt";
  import updateQueDialog from "../byh/UpdateQueDialog";
  import readDetail from "../byh/readDetail";
  import offineTransfer from "../byh/offineTransfer";
  import ownerBankBind from "../byh/OwnerBankBind";

  export default {
    name: "ByhLoanBackedList",
    components: {
      addQuestion,
      advanceLoanAmt,
      updateQueDialog,
      readDetail,
      offineTransfer,
      ownerBankBind,
    },
    data() {
      return {
        flag: false,
        isShow: true,
        isNeedAudit: true,
        activeNames: ['1', '2'],
        page: {
          current: 1,
          size: 10,
          total: 0
        },
        loanBackedList: [],
        loanQuestionList: [],
        loanLogCustom: [],
        loanResultLists: [],
        ownerBank: [{
          bankAccount: '',
          clientNo: '',
          ownerName: '',
          cardLogList: [],
        }],
        loanUserBasicList: [{
          name: '',
          idCard: '',
          phone: '',
        }],
        basicInfo: [{
          houseAddress: '',
          firstName: '',
          firstPhone: '',
          clientNo: '',
          name: '',
          idCard: '',
          phone: '',
        }],
        identifyInfo: [{
          address: '',
          issuedBy: '',
          frontFile: '',
          backFile: '',
          natureFile: '',
          frontFile: '',
        }],
        loanApplyList: [{
          planNo: '',
          planIndex: '',
          planAmt: '',
          backedBen: '',
          backedFu: '',
          planXi: '',
          planDate: '',
          status: '',
          backedBen: '',
        }],
        companyInfo: [{
          companyName: '',
          companyAddress: '',
        }],
        loanModel: [{
          gmtCreated: '',
          raiseDate: '',
          bankAccount: '',
          loanAmt: '',
          serviceAmt: '',
          rateAmt: '',
          loanLife: '',
          contractAmt: '',
          cardBankAccount: '',
          cardBankCodeStr: '',
          status: '',
          loanNo: '',
          orderNo: '',
        }],
        loanVo: [{
          alrAmt: '',
          surAmt: ''
        }],
        formInline: {
          clientCell: '',
        },
        ui: {
          addQuestion: {
            clientNo: '',
            visible: false
          },
          updateQueDialog: {
            visible: false,
            id: '',
            pointName: '',
            pointTitle: '',
            problemDescription: '',
            pointSolve: '',
            creator: '',
            pointStatus: ''
          },
          ownerBankBind: {
            visible: false,
            cardLogList: [],
          },
          readDetail: {
            visible: false,
            planNo: '',
            planIndex: '',
            planAmt: '',
            backedBen: '',
            backedFu: '',
            planXi: '',
            loanLimit: '',
            planFu: '',
            backedXi: '',
            planBen: '',
          },
          offineTransfer: {
            visible: false,
            orderNo: '',
            loanNo: '',
            periodNo: '',
            planAmt: '',
            planFu: '',
            planBen: '',
            planXi: '',
            planNo: '',
          },
          advanceLoanAmt: {
            visible: false,
            loanNo: '',
          },
        },
      }
    },
    filters: {

      dateFilter: function (row) {

        var exp = row
        if (!exp || typeof(exp) === undefined || typeof(exp) === null) {
          return ''
        }
        return moment(exp).format("YYYY-MM-DD")
      },

    },
    created() {

      this.backedData(this.$route.query.loanNo, this.$route.query.clientNo)
    },
    methods: {
      // 反馈弹窗
      addQuestion() {
        this.ui.addQuestion = {
          clientNo: this.$route.query.clientNo,
          visible: true,
        };
      },
      readDetail(record) {
        this.ui.readDetail = {
          visible: true,
          planNo: record.planNo,
          planIndex: record.planIndex,
          planAmt: record.planAmt,
          backedBen: record.backedBen,
          backedFu: record.backedFu,
          planXi: record.planXi,
          planBen: record.planBen,
          loanLimit: record.loanLimit,
          planFu: record.planFu,
          backedXi: record.backedXi,
        };
      },
      offineTransfer(record) {
        // 取当前用户的信息
        record.loanNo = this.loanModel.loanNo
        record.orderNo = this.loanModel.orderNo
        this.ui.offineTransfer = {
          visible: true,
          orderNo: record.orderNo,
          loanNo: record.loanNo,
          planNo: record.planNo,
          periodNo: record.planIndex,
          planAmt: record.planAmt,
          planFu: record.planFu,
          planBen: record.planBen,
          planXi: record.planXi,
        };
      },
      // 提前结清
      advanceLoanAmt() {
        var loanNo = this.advanceLoanAmt.loanNo;
        this.ui.advanceLoanAmt = {
          visible: true,
          loanNo: loanNo,
        };
      },
      //返回上一页
      goBack() {
        this.$router.push({
          path: 'ByhService',
          query: {
            clientNo: this.$route.query.clientNo,
            clientName: this.$route.query.clientName,
            clientCell: this.$route.query.clientCell,
            productName: this.$route.query.productName,
            certNo: this.$route.query.certNo,
            loanNo: this.$route.query.loanNo,
            orderNo: this.$route.query.orderNo,
            page: this.$route.query.current
          }
        })
      },

      /** 加载数据 */
      backedData(loanNo, clientNo) {
        this.loanDetail(loanNo, clientNo)
      },

      loanDetail(loanNo, clientNo) {

        // 个人信息
        this.$$get('/detail/client/' + clientNo).then(res => {
          if (res.data.code != 200) {
            this.$message.error(res.data.message);
            return
          } else {
            if (res.data.result != null) {
              this.basicInfo = res.data.result ? res.data.result : '';
              // 多个用户银行卡信息
              if (res.data.result.cardList != null) {
                this.ownerBank = res.data.result.cardList ? res.data.result.cardList : '';
              }
            }
          }
        });

        // 请求当前日志
        this.$$post('/detail/getDaily', this.buildParam(clientNo)).then(res => {
          if (res.data.code != 200) {
            this.$message.error(res.data.message);
            return
          }
          if (res.data.result.data != null) {
            this.loanLogCustom = res.data.result.data ? res.data.result.data : '';
          }
        }).catch(error => {
          this.$Message.error(error || '系统异常');
        });

        // 请求当前的反馈问题/customer/getQuestionList/
        this.$$get('/customer/getQuestionList/' + clientNo).then(res => {
          if (res.data.code != 200) {
            // this.isShow = false;
            this.$message.error(res.data.message);
            return
          } else {
            if (res.data.result != null) {
              this.loanQuestionList = res.data.result ? res.data.result : '';
            }
          }
        }).catch(error => {
          this.$Message.error(error || '网络异常，请稍后。。。');
        });

        // 请求当前的反馈问题/customer/getQuestionList/
        this.$$post('/loan/getLoanListByClientNo/' + clientNo).then(res => {
          if (res.data.code != 200) {
            // this.isShow = false;
            this.$message.error(res.data.message);
            return
          } else {
            if (res.data.result != null) {
              this.loanResultLists = res.data.result ? res.data.result : '';
            }
          }
        }).catch(error => {
          this.$Message.error(error || '网络异常，请稍后。。。');
        });


      },

      //根据借款信息查借款所有信息
      addLoanDetail(record){
        var loanNo = record.loanNo
          this.$$get('/detail/customer/' + loanNo).then(res => {
            if (res.data.code != 200) {
              // this.isShow = false;
              this.$message.error(res.data.message);
              return
            } else {
              //打开借款的面板
              this.activeNames = ['1', '2', '3', '4' , '5' ];
              //还款计划
              if(res.data.result.planVo == null){
                this.loanApplyList = [];
                this.isNeedAudit = false;
              }else {
                this.loanApplyList = res.data.result.planVo ? res.data.result.planVo : '';
                this.advanceLoanAmt.loanNo = res.data.result.applyVo.loanNo;
              }
              //借款信息
              if(res.data.result.loanVo == null){
                this.loanVo = [];
              }else {
                this.loanVo = res.data.result.loanVo ? res.data.result.loanVo : '';
              }
              //借款信息放款信息
              this.loanModel = res.data.result.applyVo ? res.data.result.applyVo : '';
              //还款信息
              if(res.data.result.backedVo == null){
                this.loanBackedList = [];
              }else {
                this.loanBackedList = res.data.result.backedVo ? res.data.result.backedVo : '';
              }



            }

          }).catch(error => {
            this.$Message.error(error || '网络异常，请稍后。。。');
          });
      },

      //  绑卡记录
      ownerBankBind(record) {

        this.ui.ownerBankBind = {
          visible: true,
          cardLogList: record.cardLogList,
        };

      },
      // 修改用户的反馈问题
      updateQueDialog(record) {

        this.ui.updateQueDialog = {
          visible: true,
          id: record.id,
          pointName: record.pointName,
          pointTitle: record.pointTitle,
          pointStatus: record.pointStatus,
          problemDescription: record.problemDescription,
          pointSolve: record.pointSolve,
          creator: record.creator,
        };
      },

      /*搜索条件*/
      onSubmit() {
        this.backedData();
      },

      dateFormatText: function (param) {
        return moment(param).format("YYYY-MM-DD");
      },

      getDate(param, num) {
        if (param && param[num] !== '') {
          return moment(param[num]).format("YYYY-MM-DD")
        }
        return ""
      },

      //借款单状态
      loanStatusFormat: function (row, column) {
        var status = row['status'];
        return this.$enumUtils.toMsg('LoanStatuEnums', status);
      },

      /*日期*/
      dateFormats: function (row, column) {
        var date = row[column.property]
        if (date == undefined) {
          return ''
        }
        return moment(date).format("YYYY-MM-DD")
      },

      mergeDate(param1, param2) {
        if (param1 == "") {
          return ""
        }
        var array = new Array();
        array[0] = new Date(param1)
        array[1] = new Date(param2)
        return array;
      },
      //参数
      buildParam(clientNo) {
        var return_hash = {
          size: this.page.size,
          current: this.page.current,
        };
        if (clientNo != '') {
          return_hash['clientNo'] = clientNo
        }


        return return_hash;
      },
      // 合并日期
      dateCompare: function (row, column) {
        var date = row[column.property]
        if (date == undefined) {
          return ''
        }
        return moment(date).format("YYYY-MM-DD ") + row.backedTime
      },

      /*日期*/
      dateFormat: function (row, column) {
        var date = row[column.property]
        if (date == undefined) {
          return ''
        }
        return moment(date).format("YYYY-MM-DD HH:mm:ss")
      },
      // 计算已还金额
      planMoneyFormat: function (row, column) {
        return this.accAdd(this.accAdd(row.backedBen, row.backedFu), row.backedXi).toFixed(2)
      },
      // 银行信息拼接
      cardBankFormat: function (row, column) {
        return row.cardBankAccount + "(" + row.cardBankCodeStr + ")";
      },
      // 还款结果
      resultBankFormat: function (row, column) {
        return row.resultStr + "(" + row.confirmDesc + ")";
      },
      // 合同金额

      // 计算小数
      accAdd(arg1, arg2) {
        var r1, r2, m;
        try {
          r1 = arg1.toString().split(".")[1].length
        } catch (e) {
          r1 = 0
        }
        try {
          r2 = arg2.toString().split(".")[1].length
        } catch (e) {
          r2 = 0
        }
        m = Math.pow(10, Math.max(r1, r2))
        return (arg1 * m + arg2 * m) / m
      },

      //客服状态
      serviceFormat: function (row, column) {
        var status = row['pointStatus'];
        return this.$enumUtils.toMsg('ServiceStatus', status);
      },

      //结果状态
      resultFormat: function (row, column) {
        var result = row['result'];
        if (result != null) {
          return this.$enumUtils.toMsg('SuccessAndFail', result);
        } else {
          return '未处理';
        }

      },

      /** 处理分页操作*/
      handleCurrentChange() {
        this.loanBackedList = this.backedData()
      },

    }
  }


</script>

<style scoped>

</style>
