<template>
    <el-tabs type="border-card">
      <!-- 全部-->
      <el-tab-pane label="全部">
      <el-card class="fiche">
        <right-toolbar :showSearch.sync="showSearch" @queryTable="getList">收起</right-toolbar>
        <span style="margin-bottom: 10px;color:#333333;font:14px Helvetica Neue, Helvetica, PingFang SC, Tahoma, Arial,sans-serif">所选条件:</span>
          <div  style="float: right;margin-right:1%">
            <el-button type="cyan"  icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
            <el-button icon="el-icon-refresh" size="mini" @click="resetQuery"  style="float: ;">重置</el-button>
          </div>
          <hr  style="margin-top: 16px;">
          <el-form :model="queryParams" ref="queryForm" :inline="true" v-if="showSearch" label-width="68px">
              <el-form-item label="融信编码" prop="zfiNumber">
                  <el-input
                  v-model.trim="queryParams.zfiNumber"
                  placeholder="请输入融信编码"
                  clearable
                  size="small"
                  maxlength="25"
                  @keyup.enter.native="handleQuery"
                  />
          </el-form-item>
          <el-form-item label="开立企业" prop="openCompany">
              <el-input
              v-model.trim="queryParams.openCompany"
              placeholder="请输入开立企业"
              clearable
              size="small"
              maxlength="25"
              @keyup.enter.native="handleQuery"
              />
          </el-form-item>
          <el-form-item label="接收企业" prop="receiveCompany">
              <el-input
              v-model.trim="queryParams.receiveCompany"
              placeholder="请输入接收企业"
              clearable
              size="small"
              maxlength="25"
              @keyup.enter.native="handleQuery"
              />
          </el-form-item>
          <el-form-item label="融信产品" prop="zfpName">
            <el-input
            v-model.trim="queryParams.zfpName"
            placeholder="请输入融信产品"
            clearable
            size="small"
            maxlength="25"
            @keyup.enter.native="handleQuery"
            />
          </el-form-item>
          <el-form-item label="融信金额">
              <el-input
              v-model="queryParams.startAmt"
              placeholder="请输入融信金额"
              clearable
              size="small"
              maxlength="20"
            />
          </el-form-item>
          <el-form-item>
              ~
          </el-form-item>
          <el-form-item>
              <el-input
              v-model="queryParams.endAmt"
              placeholder="请输入融信金额"
              clearable
              size="small"
              @keyup.enter.native="handleQuery"
              maxlength="20"
            />
          </el-form-item>
          <el-form-item label="签收日期" prop="zfiSignDate">
                <el-date-picker  size="small"
                v-model="queryParams.zfiSignDate"
                style="width: 240px" 
                unlink-panels
                value-format="yyyy-MM-dd" 
                type="daterange" 
                range-separator="-" 
                start-placeholder="开始日期" 
                end-placeholder="结束日期">
                </el-date-picker>
            </el-form-item>
            <el-form-item label="承诺日期" prop="zfiExpireDate">
                <el-date-picker  size="small"
                v-model="queryParams.zfiExpireDate"
                style="width: 240px" 
                unlink-panels
                value-format="yyyy-MM-dd" 
                type="daterange" 
                range-separator="-" 
                start-placeholder="开始日期" 
                end-placeholder="结束日期">
                </el-date-picker>
            </el-form-item>
            <el-form-item label="融信利率" prop="zfiRate">
              <el-input
              v-model.trim="queryParams.zfiRate"
              placeholder="请输入融信利率"
              clearable
              size="small"
              maxlength="25"
              @keyup.enter.native="handleQuery"
              />
            </el-form-item>
            <!-- <el-form-item label="状态" prop="zfiStatus">
              <el-select v-model="queryParams.zfiStatus" placeholder="请选择状态" clearable size="small">
                <el-option
                  v-for="dict in stateOptions"
                  :key="dict.dictValue"
                  :label="dict.dictLabel"
                  :value="dict.dictValue"
                />
              </el-select>
          </el-form-item> -->
    </el-form>
  </el-card>
  <el-row :gutter="10" class="mb8">
      <el-col :span="1.5">
        <el-button
          type="primary"
          icon="el-icon-plus"
          size="mini"
          @click="handleAdd"
          v-hasPermi="['credit:credit:add']"
        >开立融信</el-button>
        <el-button
          type="primary"
          icon="el-icon-plus"
          size="mini"
          @click="finanOpening"
          v-hasPermi="['finanOpening:finanOpening:add']"
        >融资开立</el-button>
        <el-button
          type="primary"
          icon="el-icon-plus"
          size="mini"
          @click="apply"
          v-hasPermi="['finanOpening:finanOpening:apply']"
        >融资申请</el-button>
      </el-col>
    </el-row>
    <el-table v-loading="loading" :data="infList" @selection-change="handleSelectionChange" border>
     <el-table-column label="序号" type="index" width="50" align="center">
        <template slot-scope="scope">
          <span>{{(queryParams.pageNum - 1) * queryParams.pageSize + scope.$index + 1}}</span>
        </template>
      </el-table-column>
      <el-table-column label="融信编号" align="center" prop="zfiNumber" :show-overflow-tooltip="true"/>
      <el-table-column label="开立方"  align="center" prop="openName"   :show-overflow-tooltip="true"/>
      <el-table-column label="接收方"  align="center" prop="receiveName"   :show-overflow-tooltip="true"/>
      <el-table-column label="融信类型" :formatter="typeFormat" align="center" prop="zfiCreateType"   :show-overflow-tooltip="true"/>
      <el-table-column label="融信产品" align="center" prop="zfpName"   :show-overflow-tooltip="true"/>
      <el-table-column label="融信金额" align="center" :formatter="moneyFormat" prop="zfiAmount" :show-overflow-tooltip="true" />
      <el-table-column label="融信利率(%)" align="center" width="100px;" prop="zfiRate" :show-overflow-tooltip="true"/>
      <el-table-column label="签发有效期" align="center" width="100px;" prop="zfiEffectiveDate" :show-overflow-tooltip="true" />
      <el-table-column label="承诺还款日" align="center" width="100px;" prop="zfiExpireDate" :show-overflow-tooltip="true" />
      <el-table-column label="签收日期" align="center" prop="zfiSignDate" :show-overflow-tooltip="true" />
      <el-table-column label="承诺函编号" align="center" width="100px;" prop="zfiPaymentNumber" :show-overflow-tooltip="true"/>
      <el-table-column label="平台审批状态" :formatter="platformStatusFormat"  align="center" width="100px;" prop="zfiPlatformStatus" :show-overflow-tooltip="true"/>
      <el-table-column label="融资方审批状态" :formatter="supplierStatusFormat"  align="center" width="110px;" prop="zfiSupplierStatus" :show-overflow-tooltip="true"/>
      <el-table-column label="核心审批状态" :formatter="coreStatusFormat" align="center" width="100px;" prop="zfiCoreStatus" :show-overflow-tooltip="true"/>
      <el-table-column label="状态" :formatter="stateFormat" align="center" prop="zfiStatus" :show-overflow-tooltip="true" />
      <el-table-column label="操作" align="center" class-name="small-padding fixed-width" width='300' fixed="right" >
        <template slot-scope="scope">
          <el-button
            size="mini"
            type="text"
            icon="el-icon-view"
            @click="handleDetail(scope.row)"
            v-hasPermi="['credit:credit:query']"
          >详情</el-button>
          <!--
            融资状态审批拒绝+核心状态为空+平台状态为空+融信状态为空||
            融资状态审批通过+核心状态为空+平台状态审批通过+融信平台退回||
            融资审批通过+核心审批拒绝+平台审批通过+融信待确权
            融资审批状态空+核心审批拒绝+平台空+融信空||
            融资审批状态审批拒绝+核心审批通过+平台空+融信待签收||
            融资审批审批通过+核心审批通过+平台拒绝+融信待签收
          -->
           <el-button
            size="mini"
            type="text"
            icon="el-icon-edit"
            @click="handleUpdate(scope.row)"
            v-hasPermi="['credit:credit:update']"
            v-if="(scope.row.zfiSupplierStatus == '02' && (scope.row.zfiCoreStatus == '' || scope.row.zfiCoreStatus == 'null' ||  scope.row.zfiCoreStatus == null) && (scope.row.zfiPlatformStatus == '' || scope.row.zfiPlatformStatus == 'null' ||  scope.row.zfiPlatformStatus == null) && (scope.row.zfiStatus == '' || scope.row.zfiStatus == 'null' ||  scope.row.zfiStatus == null))||
                  (scope.row.zfiSupplierStatus == '01' && (scope.row.zfiCoreStatus == '' || scope.row.zfiCoreStatus == 'null' ||  scope.row.zfiCoreStatus == null) && scope.row.zfiPlatformStatus == '02' && scope.row.zfiStatus == '06')||
                  (scope.row.zfiSupplierStatus == '01' && scope.row.zfiCoreStatus == '02' && scope.row.zfiPlatformStatus == '01' && scope.row.zfiStatus == '00')||
                  ((scope.row.zfiSupplierStatus == '' || scope.row.zfiSupplierStatus == 'null' ||  scope.row.zfiSupplierStatus == null) && scope.row.zfiCoreStatus == '02' && (scope.row.zfiPlatformStatus == '' || scope.row.zfiPlatformStatus == 'null' ||  scope.row.zfiPlatformStatus == null) && (scope.row.zfiStatus == '' || scope.row.zfiStatus == 'null' ||  scope.row.zfiStatus == null))||
                  (scope.row.zfiSupplierStatus == '02' && scope.row.zfiCoreStatus == '01' && (scope.row.zfiPlatformStatus == '' || scope.row.zfiPlatformStatus == 'null' ||  scope.row.zfiPlatformStatus == null) && scope.row.zfiStatus == '01')||
                  (scope.row.zfiSupplierStatus == '01' && scope.row.zfiCoreStatus == '01' && scope.row.zfiPlatformStatus == '02'&& scope.row.zfiStatus == '01')"
          >修改</el-button>
          <!--融资申请/开立+融信状态待确权+核心审批状态为空-->
           <el-button
            size="mini"
            type="text"
            icon="el-icon-edit"
            @click="handleApprove(scope.row)"
            v-hasPermi="['credit:credit:approve']"
            v-if="(scope.row.zfiCreateType == '0' || scope.row.zfiCreateType == '2' ) && scope.row.zfiStatus == '00' && (scope.row.zfiCoreStatus == '' || scope.row.zfiCoreStatus == null || scope.row.zfiCoreStatus =='null' ||scope.row.zfiCoreStatus =='02' )"
          >确权</el-button>
          <!--原补充资料-->
          <!--核心开立+融信状态为待签收+(融资审批状态不是审批中并且不是审批通过)或者(平台审批状态不是审批中并且不是审批通过)-->
          <el-button
            size="mini"
            type="text"
            icon="el-icon-edit"
            @click="handleAddInformation(scope.row)"
            v-hasPermi="['credit:credit:addInfor']"
            v-if="scope.row.zfiCreateType == '1' && scope.row.zfiStatus=='01' &&((scope.row.zfiSupplierStatus != '00' && scope.row.zfiSupplierStatus != '01') || (scope.row.zfiPlatformStatus != '00' && scope.row.zfiPlatformStatus != '01'))"
          >签收</el-button>
          <!--融资申请+融信状态待签收+融资审批状态不是审批中并且不是审批通过-->
          <el-button
            size="mini"
            type="text"
            icon="el-icon-edit"
            @click="handleSignFor(scope.row)"
            v-hasPermi="['credit:credit:signFor']"
            v-if="scope.row.zfiCreateType == '0' && scope.row.zfiStatus=='01' &&(scope.row.zfiSupplierStatus != '00' && scope.row.zfiSupplierStatus != '01')"
          >签收</el-button>
          <!--(融资申请+融信状态待签收+融资审批状态不是审批中并且不是审批通过)||
              (核心开立+融信状态为待签收+(融资审批状态不是审批中并且不是审批通过)或者(平台审批状态不是审批中并且不是审批通过))
          -->
          <el-button
            size="mini"
            type="text"
            icon="el-icon-edit"
            @click="handleRefuse(scope.row)"
            v-hasPermi="['credit:credit:refuse']"
            v-if="(scope.row.zfiCreateType == '0' && scope.row.zfiStatus=='01' &&(scope.row.zfiSupplierStatus != '00' && scope.row.zfiSupplierStatus != '01'))||
            (scope.row.zfiCreateType == '1' && scope.row.zfiStatus=='01' &&((scope.row.zfiSupplierStatus != '00' && scope.row.zfiSupplierStatus != '01') || (scope.row.zfiPlatformStatus != '00' && scope.row.zfiPlatformStatus != '01')))"
          >拒签</el-button>
          <!--生效-->
          <el-button
            size="mini"
            type="text"
            icon="el-icon-edit"
            @click="handleGoFinance(scope.row)"
            v-hasPermi="['finance:record:add']"
            v-if="(scope.row.zfiCreateType == '1' ||scope.row.zfiCreateType == '0' || scope.row.zfiCreateType == '2') && scope.row.zfiStatus == '02'"
          >去融资</el-button>
         <!--核心开立:核心审批通过+其他状态为空||
            补充资料：融资方通过+核心通过+平台通过+待签收||
            融资开立:融资方通过+平台通过+其他为空||
            确权:融资方通过+核心通过+平台通过+待确权
         -->
          <el-button
            size="mini"
            type="text"
            icon="el-icon-edit"
            @click="seal(scope.row)"
            v-hasPermi="['credit:credit:seal']"
            v-if="(scope.row.zfiCoreStatus == '01' && (scope.row.zfiSupplierStatus == '' || scope.row.zfiSupplierStatus == null || scope.row.zfiSupplierStatus == 'null') && (scope.row.zfiPlatformStatus == '' || scope.row.zfiPlatformStatus == null || scope.row.zfiPlatformStatus == 'null') && (scope.row.zfiStatus == '' || scope.row.zfiStatus == 'null' ||  scope.row.zfiStatus == null))||
                  (scope.row.zfiSupplierStatus == '01' && scope.row.zfiCoreStatus == '01' && scope.row.zfiPlatformStatus == '01' &&  scope.row.zfiStatus == '01')||
                  (scope.row.zfiSupplierStatus == '01' && scope.row.zfiPlatformStatus == '01' && (scope.row.zfiCoreStatus == '' || scope.row.zfiCoreStatus == null || scope.row.zfiCoreStatus =='null') && (scope.row.zfiStatus == '' || scope.row.zfiStatus == 'null' ||  scope.row.zfiStatus == null))||
                  (scope.row.zfiSupplierStatus == '01' && scope.row.zfiCoreStatus == '01' && scope.row.zfiPlatformStatus == '01' &&  scope.row.zfiStatus == '00')"
          >盖章</el-button>
          <el-button
            size="mini"
            type="text"
            icon="el-icon-delete"
            @click="handleDelete(scope.row)"
            v-hasPermi="['credit:credit:del']"
            v-if="scope.row.zfiStatus == '' || scope.row.zfiStatus == 'null' || scope.row.zfiStatus == null || scope.row.zfiStatus == '06'"
          >删除</el-button>
        </template>
      </el-table-column>
    </el-table>
    <pagination
      v-show="total>0"
      :total="total"
      :page.sync="queryParams.pageNum"
      :limit.sync="queryParams.pageSize"
      @pagination="getList"
    />
    <!--开立中-->
    </el-tab-pane>
         <el-tab-pane label="开立中">
      <el-card class="fiche">
        <right-toolbar :showSearch.sync="showSearch" @queryTable="getListOpening">收起</right-toolbar>
        <span style="margin-bottom: 10px;color:#333333;font:14px Helvetica Neue, Helvetica, PingFang SC, Tahoma, Arial,sans-serif">所选条件:</span>
          <div  style="float: right;margin-right:1%">
            <el-button type="cyan"  icon="el-icon-search" size="mini" @click="handleQueryOpening">搜索</el-button>
            <el-button icon="el-icon-refresh" size="mini" @click="resetQueryOpening"  style="float: ;">重置</el-button>
          </div>
          <hr  style="margin-top: 16px;">
          <el-form :model="queryParamsOpening" ref="queryFormOpening" :inline="true" v-if="showSearch" label-width="68px">
              <el-form-item label="融信编码" prop="zfiNumber">
                  <el-input
                  v-model.trim="queryParamsOpening.zfiNumber"
                  placeholder="请输入融信编码"
                  clearable
                  size="small"
                  maxlength="25"
                  @keyup.enter.native="handleQueryOpening"
                  />
          </el-form-item>
          <el-form-item label="开立企业" prop="openCompany">
              <el-input
              v-model.trim="queryParamsOpening.openCompany"
              placeholder="请输入开立企业"
              clearable
              size="small"
              maxlength="25"
              @keyup.enter.native="handleQueryOpening"
              />
          </el-form-item>
          <el-form-item label="接收企业" prop="receiveCompany">
              <el-input
              v-model.trim="queryParamsOpening.receiveCompany"
              placeholder="请输入接收企业"
              clearable
              size="small"
              maxlength="25"
              @keyup.enter.native="handleQueryOpening"
              />
          </el-form-item>
          <el-form-item label="融信产品" prop="zfpName">
            <el-input
            v-model.trim="queryParamsOpening.zfpName"
            placeholder="请输入融信产品"
            clearable
            size="small"
            maxlength="25"
            @keyup.enter.native="handleQueryOpening"
            />
          </el-form-item>
          <el-form-item label="融信金额">
              <el-input
              v-model="queryParamsOpening.startAmt"
              placeholder="请输入融信金额"
              clearable
              size="small"
              maxlength="20"
            />
          </el-form-item>
          <el-form-item>
              ~
          </el-form-item>
          <el-form-item>
              <el-input
              v-model="queryParamsOpening.endAmt"
              placeholder="请输入融信金额"
              clearable
              size="small"
              @keyup.enter.native="handleQueryOpening"
              maxlength="20"
            />
          </el-form-item>
          <el-form-item label="签收日期" prop="zfiSignDate">
                <el-date-picker  size="small"
                v-model="queryParamsOpening.zfiSignDate"
                style="width: 240px" 
                unlink-panels
                value-format="yyyy-MM-dd" 
                type="daterange" 
                range-separator="-" 
                start-placeholder="开始日期" 
                end-placeholder="结束日期">
                </el-date-picker>
            </el-form-item>
            <el-form-item label="承诺日期" prop="zfiExpireDate">
                <el-date-picker  size="small"
                v-model="queryParamsOpening.zfiExpireDate"
                style="width: 240px" 
                unlink-panels
                value-format="yyyy-MM-dd" 
                type="daterange" 
                range-separator="-" 
                start-placeholder="开始日期" 
                end-placeholder="结束日期">
                </el-date-picker>
            </el-form-item>
            <el-form-item label="融信利率" prop="zfiRate">
              <el-input
              v-model.trim="queryParamsOpening.zfiRate"
              placeholder="请输入融信利率"
              clearable
              size="small"
              maxlength="25"
              @keyup.enter.native="handleQueryOpening"
              />
            </el-form-item>
            <!-- <el-form-item label="状态" prop="zfiStatus">
              <el-select v-model="queryParams.zfiStatus" placeholder="请选择状态" clearable size="small">
                <el-option
                  v-for="dict in stateOptions"
                  :key="dict.dictValue"
                  :label="dict.dictLabel"
                  :value="dict.dictValue"
                />
              </el-select>
          </el-form-item> -->
    </el-form>
  </el-card>
  <el-row :gutter="10" class="mb8">
      <el-col :span="1.5">
        <el-button
          type="primary"
          icon="el-icon-plus"
          size="mini"
          @click="handleAdd"
          v-hasPermi="['credit:credit:add']"
        >开立融信</el-button>
        <el-button
          type="primary"
          icon="el-icon-plus"
          size="mini"
          @click="finanOpening"
          v-hasPermi="['finanOpening:finanOpening:add']"
        >融资开立</el-button>
        <el-button
          type="primary"
          icon="el-icon-plus"
          size="mini"
          @click="apply"
          v-hasPermi="['finanOpening:finanOpening:apply']"
        >融资申请</el-button>
      </el-col>
    </el-row>
    <el-table v-loading="loading" :data="infOpeningList" @selection-change="handleSelectionChange" border>
     <el-table-column label="序号" type="index" width="50" align="center">
        <template slot-scope="scope">
          <span>{{(queryParamsOpening.pageNum - 1) * queryParamsOpening.pageSize + scope.$index + 1}}</span>
        </template>
      </el-table-column>
      <el-table-column label="融信编号" align="center" prop="zfiNumber" :show-overflow-tooltip="true"/>
      <el-table-column label="开立方"  align="center" prop="openName"   :show-overflow-tooltip="true"/>
      <el-table-column label="接收方"  align="center" prop="receiveName"   :show-overflow-tooltip="true"/>
      <el-table-column label="融信类型" :formatter="typeFormat" align="center" prop="zfiCreateType"   :show-overflow-tooltip="true"/>
      <el-table-column label="融信产品" align="center" prop="zfpName"   :show-overflow-tooltip="true"/>
      <el-table-column label="融信金额" align="center" :formatter="moneyFormat" prop="zfiAmount" :show-overflow-tooltip="true" />
      <el-table-column label="融信利率(%)" align="center" width="100px;" prop="zfiRate" :show-overflow-tooltip="true"/>
      <el-table-column label="签发有效期" align="center" width="100px;" prop="zfiEffectiveDate" :show-overflow-tooltip="true" />
      <el-table-column label="承诺还款日" align="center" width="100px;" prop="zfiExpireDate" :show-overflow-tooltip="true" />
      <el-table-column label="签收日期" align="center" prop="zfiSignDate" :show-overflow-tooltip="true" />
      <el-table-column label="承诺函编号" align="center" width="100px;" prop="zfiPaymentNumber" :show-overflow-tooltip="true"/>
      <el-table-column label="平台审批状态" :formatter="platformStatusFormat"  align="center" width="100px;" prop="zfiPlatformStatus" :show-overflow-tooltip="true"/>
      <el-table-column label="融资方审批状态" :formatter="supplierStatusFormat"  align="center" width="110px;" prop="zfiSupplierStatus" :show-overflow-tooltip="true"/>
      <el-table-column label="核心审批状态" :formatter="coreStatusFormat" align="center" width="100px;" prop="zfiCoreStatus" :show-overflow-tooltip="true"/>
      <el-table-column label="状态" :formatter="stateFormat" align="center" prop="zfiStatus" :show-overflow-tooltip="true" />
      <el-table-column label="操作" align="center" class-name="small-padding fixed-width" width='300' fixed="right" >
        <template slot-scope="scope">
          <el-button
            size="mini"
            type="text"
            icon="el-icon-view"
            @click="handleDetail(scope.row)"
            v-hasPermi="['credit:credit:query']"
          >详情</el-button>
           <!--
            融资状态审批拒绝+核心状态为空+平台状态为空+融信状态为空||
            融资状态审批通过+核心状态为空+平台状态审批通过+融信平台退回||
            融资审批通过+核心审批拒绝+平台审批通过+融信待确权
            融资审批状态空+核心审批拒绝+平台空+融信空||
            融资审批状态审批拒绝+核心审批通过+平台空+融信待签收||
            融资审批审批通过+核心审批通过+平台拒绝+融信待签收
          -->
           <el-button
            size="mini"
            type="text"
            icon="el-icon-edit"
            @click="handleUpdate(scope.row)"
            v-hasPermi="['credit:credit:update']"
            v-if="(scope.row.zfiSupplierStatus == '02' && (scope.row.zfiCoreStatus == '' || scope.row.zfiCoreStatus == 'null' ||  scope.row.zfiCoreStatus == null) && (scope.row.zfiPlatformStatus == '' || scope.row.zfiPlatformStatus == 'null' ||  scope.row.zfiPlatformStatus == null) && (scope.row.zfiStatus == '' || scope.row.zfiStatus == 'null' ||  scope.row.zfiStatus == null))||
                  (scope.row.zfiSupplierStatus == '01' && (scope.row.zfiCoreStatus == '' || scope.row.zfiCoreStatus == 'null' ||  scope.row.zfiCoreStatus == null) && scope.row.zfiPlatformStatus == '02' && scope.row.zfiStatus == '06')||
                  (scope.row.zfiSupplierStatus == '01' && scope.row.zfiCoreStatus == '02' && scope.row.zfiPlatformStatus == '01' && scope.row.zfiStatus == '00')||
                  ((scope.row.zfiSupplierStatus == '' || scope.row.zfiSupplierStatus == 'null' ||  scope.row.zfiSupplierStatus == null) && scope.row.zfiCoreStatus == '02' && (scope.row.zfiPlatformStatus == '' || scope.row.zfiPlatformStatus == 'null' ||  scope.row.zfiPlatformStatus == null) && (scope.row.zfiStatus == '' || scope.row.zfiStatus == 'null' ||  scope.row.zfiStatus == null))||
                  (scope.row.zfiSupplierStatus == '02' && scope.row.zfiCoreStatus == '01' && (scope.row.zfiPlatformStatus == '' || scope.row.zfiPlatformStatus == 'null' ||  scope.row.zfiPlatformStatus == null) && scope.row.zfiStatus == '01')||
                  (scope.row.zfiSupplierStatus == '01' && scope.row.zfiCoreStatus == '01' && scope.row.zfiPlatformStatus == '02'&& scope.row.zfiStatus == '01')"
          >修改</el-button>
            <!--融资申请/开立+融信状态待确权+核心审批状态为空-->
           <el-button
            size="mini"
            type="text"
            icon="el-icon-edit"
            @click="handleApprove(scope.row)"
            v-hasPermi="['credit:credit:approve']"
            v-if="(scope.row.zfiCreateType == '0' || scope.row.zfiCreateType == '2' ) && scope.row.zfiStatus == '00' && (scope.row.zfiCoreStatus == '' || scope.row.zfiCoreStatus == null || scope.row.zfiCoreStatus =='null' ||scope.row.zfiCoreStatus =='02' )"
          >确权</el-button>
          <!--原补充资料-->
          <!--核心开立+融信状态为待签收+(融资审批状态不是审批中并且不是审批通过)或者(平台审批状态不是审批中并且不是审批通过)-->
          <el-button
            size="mini"
            type="text"
            icon="el-icon-edit"
            @click="handleAddInformation(scope.row)"
            v-hasPermi="['credit:credit:addInfor']"
            v-if="scope.row.zfiCreateType == '1' && scope.row.zfiStatus=='01' &&((scope.row.zfiSupplierStatus != '00' && scope.row.zfiSupplierStatus != '01') || (scope.row.zfiPlatformStatus != '00' && scope.row.zfiPlatformStatus != '01'))"
          >签收</el-button>
          <!--融资申请+融信状态待签收+融资审批状态不是审批中并且不是审批通过-->
          <el-button
            size="mini"
            type="text"
            icon="el-icon-edit"
            @click="handleSignFor(scope.row)"
            v-hasPermi="['credit:credit:signFor']"
            v-if="scope.row.zfiCreateType == '0' && scope.row.zfiStatus=='01' &&(scope.row.zfiSupplierStatus != '00' && scope.row.zfiSupplierStatus != '01')"
          >签收</el-button>
          <!--(融资申请+融信状态待签收+融资审批状态不是审批中并且不是审批通过)||
              (核心开立+融信状态为待签收+(融资审批状态不是审批中并且不是审批通过)或者(平台审批状态不是审批中并且不是审批通过))
          -->
          <el-button
            size="mini"
            type="text"
            icon="el-icon-edit"
            @click="handleRefuse(scope.row)"
            v-hasPermi="['credit:credit:refuse']"
            v-if="(scope.row.zfiCreateType == '0' && scope.row.zfiStatus=='01' &&(scope.row.zfiSupplierStatus != '00' && scope.row.zfiSupplierStatus != '01'))||
            (scope.row.zfiCreateType == '1' && scope.row.zfiStatus=='01' &&((scope.row.zfiSupplierStatus != '00' && scope.row.zfiSupplierStatus != '01') || (scope.row.zfiPlatformStatus != '00' && scope.row.zfiPlatformStatus != '01')))"
          >拒签</el-button>
          <el-button
            size="mini"
            type="text"
            icon="el-icon-edit"
            @click="handleGoFinance(scope.row)"
            v-hasPermi="['credit:credit:goFinance']"
            v-if="(scope.row.zfiCreateType == '1' ||scope.row.zfiCreateType == '0' || scope.row.zfiCreateType == '2') && scope.row.zfiStatus == '02'"
          >去融资</el-button>
           <!--核心开立:核心审批通过+其他状态为空||
            补充资料：融资方通过+核心通过+平台通过+待签收||
            融资开立:融资方通过+平台通过+其他为空||
            确权:融资方通过+核心通过+平台通过+待确权
         -->
          <el-button
            size="mini"
            type="text"
            icon="el-icon-edit"
            @click="seal(scope.row)"
            v-hasPermi="['credit:credit:seal']"
            v-if="(scope.row.zfiCoreStatus == '01' && (scope.row.zfiSupplierStatus == '' || scope.row.zfiSupplierStatus == null || scope.row.zfiSupplierStatus == 'null') && (scope.row.zfiPlatformStatus == '' || scope.row.zfiPlatformStatus == null || scope.row.zfiPlatformStatus == 'null') && (scope.row.zfiStatus == '' || scope.row.zfiStatus == 'null' ||  scope.row.zfiStatus == null))||
                  (scope.row.zfiSupplierStatus == '01' && scope.row.zfiCoreStatus == '01' && scope.row.zfiPlatformStatus == '01' &&  scope.row.zfiStatus == '01')||
                  (scope.row.zfiSupplierStatus == '01' && scope.row.zfiPlatformStatus == '01' && (scope.row.zfiCoreStatus == '' || scope.row.zfiCoreStatus == null || scope.row.zfiCoreStatus =='null') && (scope.row.zfiStatus == '' || scope.row.zfiStatus == 'null' ||  scope.row.zfiStatus == null))||
                  (scope.row.zfiSupplierStatus == '01' && scope.row.zfiCoreStatus == '01' && scope.row.zfiPlatformStatus == '01' &&  scope.row.zfiStatus == '00')"
          >盖章</el-button>
          <el-button
            size="mini"
            type="text"
            icon="el-icon-delete"
            @click="handleDelete(scope.row)"
            v-hasPermi="['credit:credit:del']"
            v-if="scope.row.zfiStatus == '' || scope.row.zfiStatus == 'null' || scope.row.zfiStatus == null || scope.row.zfiStatus == '06'"
          >删除</el-button>
        </template>
      </el-table-column>
    </el-table>
    <pagination
      v-show="totalOpening>0"
      :total="totalOpening"
      :page.sync="queryParamsOpening.pageNum"
      :limit.sync="queryParamsOpening.pageSize"
      @pagination="getListOpening"
    />
    </el-tab-pane>
    <!--已签收-->
     <el-tab-pane label="已签收">
      <el-card class="fiche">
        <right-toolbar :showSearch.sync="showSearch" @queryTable="getListSign">收起</right-toolbar>
        <span style="margin-bottom: 10px;color:#333333;font:14px Helvetica Neue, Helvetica, PingFang SC, Tahoma, Arial,sans-serif">所选条件:</span>
          <div  style="float: right;margin-right:1%">
            <el-button type="cyan"  icon="el-icon-search" size="mini" @click="handleQuerySign">搜索</el-button>
            <el-button icon="el-icon-refresh" size="mini" @click="resetQuerySign"  style="float: ;">重置</el-button>
          </div>
          <hr  style="margin-top: 16px;">
          <el-form :model="queryParamsSign" ref="queryFormSign" :inline="true" v-if="showSearch" label-width="68px">
              <el-form-item label="融信编码" prop="zfiNumber">
                  <el-input
                  v-model.trim="queryParamsSign.zfiNumber"
                  placeholder="请输入融信编码"
                  clearable
                  size="small"
                  maxlength="25"
                  @keyup.enter.native="handleQuerySign"
                  />
          </el-form-item>
          <el-form-item label="开立企业" prop="openCompany">
              <el-input
              v-model.trim="queryParamsSign.openCompany"
              placeholder="请输入开立企业"
              clearable
              size="small"
              maxlength="25"
              @keyup.enter.native="handleQuerySign"
              />
          </el-form-item>
          <el-form-item label="接收企业" prop="receiveCompany">
              <el-input
              v-model.trim="queryParamsSign.receiveCompany"
              placeholder="请输入接收企业"
              clearable
              size="small"
              maxlength="25"
              @keyup.enter.native="handleQuerySign"
              />
          </el-form-item>
          <el-form-item label="融信产品" prop="zfpName">
            <el-input
            v-model.trim="queryParamsSign.zfpName"
            placeholder="请输入融信产品"
            clearable
            size="small"
            maxlength="25"
            @keyup.enter.native="handleQuerySign"
            />
          </el-form-item>
          <el-form-item label="融信金额">
              <el-input
              v-model="queryParamsSign.startAmt"
              placeholder="请输入融信金额"
              clearable
              size="small"
              maxlength="20"
            />
          </el-form-item>
          <el-form-item>
              ~
          </el-form-item>
          <el-form-item>
              <el-input
              v-model="queryParamsSign.endAmt"
              placeholder="请输入融信金额"
              clearable
              size="small"
              @keyup.enter.native="handleQuerySign"
              maxlength="20"
            />
          </el-form-item>
          <el-form-item label="签收日期" prop="zfiSignDate">
                <el-date-picker  size="small"
                v-model="queryParamsSign.zfiSignDate"
                style="width: 240px" 
                unlink-panels
                value-format="yyyy-MM-dd" 
                type="daterange" 
                range-separator="-" 
                start-placeholder="开始日期" 
                end-placeholder="结束日期">
                </el-date-picker>
            </el-form-item>
            <el-form-item label="承诺日期" prop="zfiExpireDate">
                <el-date-picker  size="small"
                v-model="queryParamsSign.zfiExpireDate"
                style="width: 240px" 
                unlink-panels
                value-format="yyyy-MM-dd" 
                type="daterange" 
                range-separator="-" 
                start-placeholder="开始日期" 
                end-placeholder="结束日期">
                </el-date-picker>
            </el-form-item>
            <el-form-item label="融信利率" prop="zfiRate">
              <el-input
              v-model.trim="queryParamsSign.zfiRate"
              placeholder="请输入融信利率"
              clearable
              size="small"
              maxlength="25"
              @keyup.enter.native="handleQuerySign"
              />
            </el-form-item>
            <!-- <el-form-item label="状态" prop="zfiStatus">
              <el-select v-model="queryParams.zfiStatus" placeholder="请选择状态" clearable size="small">
                <el-option
                  v-for="dict in stateOptions"
                  :key="dict.dictValue"
                  :label="dict.dictLabel"
                  :value="dict.dictValue"
                />
              </el-select>
          </el-form-item> -->
    </el-form>
  </el-card>
  <el-row :gutter="10" class="mb8">
      <el-col :span="1.5">
        <el-button
          type="primary"
          icon="el-icon-plus"
          size="mini"
          @click="handleAdd"
          v-hasPermi="['credit:credit:add']"
        >开立融信</el-button>
        <el-button
          type="primary"
          icon="el-icon-plus"
          size="mini"
          @click="finanOpening"
          v-hasPermi="['finanOpening:finanOpening:add']"
        >融资开立</el-button>
        <el-button
          type="primary"
          icon="el-icon-plus"
          size="mini"
          @click="apply"
          v-hasPermi="['finanOpening:finanOpening:apply']"
        >融资申请</el-button>
      </el-col>
    </el-row>
    <el-table v-loading="loading" :data="infSignList" @selection-change="handleSelectionChange" border>
     <el-table-column label="序号" type="index" width="50" align="center">
        <template slot-scope="scope">
          <span>{{(queryParamsSign.pageNum - 1) * queryParamsSign.pageSize + scope.$index + 1}}</span>
        </template>
      </el-table-column>
      <el-table-column label="融信编号" align="center" prop="zfiNumber"  :show-overflow-tooltip="true"/>
      <el-table-column label="开立方"  align="center" prop="openName"  :show-overflow-tooltip="true"/>
      <el-table-column label="接收方"  align="center" prop="receiveName"   :show-overflow-tooltip="true"/>
      <el-table-column label="融信类型" :formatter="typeFormat" align="center" prop="zfiCreateType"  :show-overflow-tooltip="true"/>
      <el-table-column label="融信产品" align="center" prop="zfpName"   :show-overflow-tooltip="true"/>
      <el-table-column label="融信金额" align="center" :formatter="moneyFormat" prop="zfiAmount" :show-overflow-tooltip="true" />
      <el-table-column label="融信利率(%)" align="center" width="100px;" prop="zfiRate" :show-overflow-tooltip="true" />
      <el-table-column label="签发有效期" align="center" width="100px;" prop="zfiEffectiveDate" :show-overflow-tooltip="true" />
      <el-table-column label="承诺还款日" align="center" width="100px;" prop="zfiExpireDate" :show-overflow-tooltip="true"/>
      <el-table-column label="签收日期" align="center" prop="zfiSignDate" :show-overflow-tooltip="true" />
      <el-table-column label="承诺函编号" align="center" width="100px;" prop="zfiPaymentNumber" :show-overflow-tooltip="true" />
      <el-table-column label="平台审批状态" :formatter="platformStatusFormat"  align="center" width="100px;" prop="zfiPlatformStatus" :show-overflow-tooltip="true"/>
      <el-table-column label="融资方审批状态" :formatter="supplierStatusFormat"  align="center" width="110px;" prop="zfiSupplierStatus" :show-overflow-tooltip="true"/>
      <el-table-column label="核心审批状态" :formatter="coreStatusFormat" align="center" width="100px;" prop="zfiCoreStatus" :show-overflow-tooltip="true"/>
      <el-table-column label="状态" :formatter="stateFormat" align="center" prop="zfiStatus" :show-overflow-tooltip="true"/>
      <el-table-column label="操作" align="center" class-name="small-padding fixed-width" width='300' fixed="right" >
        <template slot-scope="scope">
          <el-button
            size="mini"
            type="text"
            icon="el-icon-view"
            @click="handleDetail(scope.row)"
            v-hasPermi="['credit:credit:query']"
          >详情</el-button>
         <!--
            融资状态审批拒绝+核心状态为空+平台状态为空+融信状态为空||
            融资状态审批通过+核心状态为空+平台状态审批通过+融信平台退回||
            融资审批通过+核心审批拒绝+平台审批通过+融信待确权
            融资审批状态空+核心审批拒绝+平台空+融信空||
            融资审批状态审批拒绝+核心审批通过+平台空+融信待签收||
            融资审批审批通过+核心审批通过+平台拒绝+融信待签收
          -->
           <el-button
            size="mini"
            type="text"
            icon="el-icon-edit"
            @click="handleUpdate(scope.row)"
            v-hasPermi="['credit:credit:update']"
            v-if="(scope.row.zfiSupplierStatus == '02' && (scope.row.zfiCoreStatus == '' || scope.row.zfiCoreStatus == 'null' ||  scope.row.zfiCoreStatus == null) && (scope.row.zfiPlatformStatus == '' || scope.row.zfiPlatformStatus == 'null' ||  scope.row.zfiPlatformStatus == null) && (scope.row.zfiStatus == '' || scope.row.zfiStatus == 'null' ||  scope.row.zfiStatus == null))||
                  (scope.row.zfiSupplierStatus == '01' && (scope.row.zfiCoreStatus == '' || scope.row.zfiCoreStatus == 'null' ||  scope.row.zfiCoreStatus == null) && scope.row.zfiPlatformStatus == '02' && scope.row.zfiStatus == '06')||
                  (scope.row.zfiSupplierStatus == '01' && scope.row.zfiCoreStatus == '02' && scope.row.zfiPlatformStatus == '01' && scope.row.zfiStatus == '00')||
                  ((scope.row.zfiSupplierStatus == '' || scope.row.zfiSupplierStatus == 'null' ||  scope.row.zfiSupplierStatus == null) && scope.row.zfiCoreStatus == '02' && (scope.row.zfiPlatformStatus == '' || scope.row.zfiPlatformStatus == 'null' ||  scope.row.zfiPlatformStatus == null) && (scope.row.zfiStatus == '' || scope.row.zfiStatus == 'null' ||  scope.row.zfiStatus == null))||
                  (scope.row.zfiSupplierStatus == '02' && scope.row.zfiCoreStatus == '01' && (scope.row.zfiPlatformStatus == '' || scope.row.zfiPlatformStatus == 'null' ||  scope.row.zfiPlatformStatus == null) && scope.row.zfiStatus == '01')||
                  (scope.row.zfiSupplierStatus == '01' && scope.row.zfiCoreStatus == '01' && scope.row.zfiPlatformStatus == '02'&& scope.row.zfiStatus == '01')"
          >修改</el-button>
            <!--融资申请/开立+融信状态待确权+核心审批状态为空-->
           <el-button
            size="mini"
            type="text"
            icon="el-icon-edit"
            @click="handleApprove(scope.row)"
            v-hasPermi="['credit:credit:approve']"
            v-if="(scope.row.zfiCreateType == '0' || scope.row.zfiCreateType == '2' ) && scope.row.zfiStatus == '00' && (scope.row.zfiCoreStatus == '' || scope.row.zfiCoreStatus == null || scope.row.zfiCoreStatus =='null' ||scope.row.zfiCoreStatus =='02' )"
          >确权</el-button>
          <!--原补充资料-->
          <!--核心开立+融信状态为待签收+(融资审批状态不是审批中并且不是审批通过)或者(平台审批状态不是审批中并且不是审批通过)-->
          <el-button
            size="mini"
            type="text"
            icon="el-icon-edit"
            @click="handleAddInformation(scope.row)"
            v-hasPermi="['credit:credit:addInfor']"
            v-if="scope.row.zfiCreateType == '1' && scope.row.zfiStatus=='01' &&((scope.row.zfiSupplierStatus != '00' && scope.row.zfiSupplierStatus != '01') || (scope.row.zfiPlatformStatus != '00' && scope.row.zfiPlatformStatus != '01'))"
          >签收</el-button>
          <!--融资申请+融信状态待签收+融资审批状态不是审批中并且不是审批通过-->
          <el-button
            size="mini"
            type="text"
            icon="el-icon-edit"
            @click="handleSignFor(scope.row)"
            v-hasPermi="['credit:credit:signFor']"
            v-if="scope.row.zfiCreateType == '0' && scope.row.zfiStatus=='01' &&(scope.row.zfiSupplierStatus != '00' && scope.row.zfiSupplierStatus != '01')"
          >签收</el-button>
          <!--(融资申请+融信状态待签收+融资审批状态不是审批中并且不是审批通过)||
                  (核心开立+融信状态为待签收+(融资审批状态不是审批中并且不是审批通过)或者(平台审批状态不是审批中并且不是审批通过))
              -->
          <el-button
            size="mini"
            type="text"
            icon="el-icon-edit"
            @click="handleRefuse(scope.row)"
            v-hasPermi="['credit:credit:refuse']"
            v-if="(scope.row.zfiCreateType == '0' && scope.row.zfiStatus=='01' &&(scope.row.zfiSupplierStatus != '00' && scope.row.zfiSupplierStatus != '01'))||
            (scope.row.zfiCreateType == '1' && scope.row.zfiStatus=='01' &&((scope.row.zfiSupplierStatus != '00' && scope.row.zfiSupplierStatus != '01') || (scope.row.zfiPlatformStatus != '00' && scope.row.zfiPlatformStatus != '01')))"
          >拒签</el-button>
          <el-button
            size="mini"
            type="text"
            icon="el-icon-edit"
            @click="handleGoFinance(scope.row)"
            v-hasPermi="['credit:credit:goFinance']"
            v-if="(scope.row.zfiCreateType == '1' ||scope.row.zfiCreateType == '0' || scope.row.zfiCreateType == '2') && scope.row.zfiStatus == '02'"
          >去融资</el-button>
          <!--核心开立:核心审批通过+其他状态为空||
            补充资料：融资方通过+核心通过+平台通过+待签收||
            融资开立:融资方通过+平台通过+其他为空||
            确权:融资方通过+核心通过+平台通过+待确权
         -->
          <el-button
            size="mini"
            type="text"
            icon="el-icon-edit"
            @click="seal(scope.row)"
            v-hasPermi="['credit:credit:seal']"
            v-if="(scope.row.zfiCoreStatus == '01' && (scope.row.zfiSupplierStatus == '' || scope.row.zfiSupplierStatus == null || scope.row.zfiSupplierStatus == 'null') && (scope.row.zfiPlatformStatus == '' || scope.row.zfiPlatformStatus == null || scope.row.zfiPlatformStatus == 'null') && (scope.row.zfiStatus == '' || scope.row.zfiStatus == 'null' ||  scope.row.zfiStatus == null))||
                  (scope.row.zfiSupplierStatus == '01' && scope.row.zfiCoreStatus == '01' && scope.row.zfiPlatformStatus == '01' &&  scope.row.zfiStatus == '01')||
                  (scope.row.zfiSupplierStatus == '01' && scope.row.zfiPlatformStatus == '01' && (scope.row.zfiCoreStatus == '' || scope.row.zfiCoreStatus == null || scope.row.zfiCoreStatus =='null') && (scope.row.zfiStatus == '' || scope.row.zfiStatus == 'null' ||  scope.row.zfiStatus == null))||
                  (scope.row.zfiSupplierStatus == '01' && scope.row.zfiCoreStatus == '01' && scope.row.zfiPlatformStatus == '01' &&  scope.row.zfiStatus == '00')"
          >盖章</el-button>
            <el-button
            size="mini"
            type="text"
            icon="el-icon-delete"
            @click="handleDelete(scope.row)"
            v-hasPermi="['credit:credit:del']"
            v-if="scope.row.zfiStatus == '' || scope.row.zfiStatus == 'null' || scope.row.zfiStatus == null || scope.row.zfiStatus == '06'"
          >删除</el-button>
        </template>
      </el-table-column>
    </el-table>
    <pagination
      v-show="totalSign>0"
      :total="totalSign"
      :page.sync="handleQuerySign.pageNum"
      :limit.sync="handleQuerySign.pageSize"
      @pagination="getListSign"
    />
    </el-tab-pane>
    <!--融资中-->
     <el-tab-pane label="融资中">
      <el-card class="fiche">
        <right-toolbar :showSearch.sync="showSearch" @queryTable="getListFinancing">收起</right-toolbar>
        <span style="margin-bottom: 10px;color:#333333;font:14px Helvetica Neue, Helvetica, PingFang SC, Tahoma, Arial,sans-serif">所选条件:</span>
          <div  style="float: right;margin-right:1%">
            <el-button type="cyan"  icon="el-icon-search" size="mini" @click="handleQueryFinancing">搜索</el-button>
            <el-button icon="el-icon-refresh" size="mini" @click="resetQueryFinancing"  style="float: ;">重置</el-button>
          </div>
          <hr  style="margin-top: 16px;">
          <el-form :model="queryParamsFinancing" ref="queryFormFinancing" :inline="true" v-if="showSearch" label-width="68px">
              <el-form-item label="融信编码" prop="zfiNumber">
                  <el-input
                  v-model.trim="queryParamsFinancing.zfiNumber"
                  placeholder="请输入融信编码"
                  clearable
                  size="small"
                  maxlength="25"
                  @keyup.enter.native="handleQueryFinancing"
                  />
          </el-form-item>
          <el-form-item label="开立企业" prop="openCompany">
              <el-input
              v-model.trim="queryParamsFinancing.openCompany"
              placeholder="请输入开立企业"
              clearable
              size="small"
              maxlength="25"
              @keyup.enter.native="handleQueryFinancing"
              />
          </el-form-item>
          <el-form-item label="接收企业" prop="receiveCompany">
              <el-input
              v-model.trim="queryParamsFinancing.receiveCompany"
              placeholder="请输入接收企业"
              clearable
              size="small"
              maxlength="25"
              @keyup.enter.native="handleQueryFinancing"
              />
          </el-form-item>
          <el-form-item label="融信产品" prop="zfpName">
            <el-input
            v-model.trim="queryParamsFinancing.zfpName"
            placeholder="请输入融信产品"
            clearable
            size="small"
            maxlength="25"
            @keyup.enter.native="handleQueryFinancing"
            />
          </el-form-item>
          <el-form-item label="融信金额">
              <el-input
              v-model="queryParamsFinancing.startAmt"
              placeholder="请输入融信金额"
              clearable
              size="small"
              maxlength="20"
            />
          </el-form-item>
          <el-form-item>
              ~
          </el-form-item>
          <el-form-item>
              <el-input
              v-model="queryParamsFinancing.endAmt"
              placeholder="请输入融信金额"
              clearable
              size="small"
              @keyup.enter.native="handleQueryFinancing"
              maxlength="20"
            />
          </el-form-item>
          <el-form-item label="签收日期" prop="zfiSignDate">
                <el-date-picker  size="small"
                v-model="queryParamsFinancing.zfiSignDate"
                style="width: 240px" 
                unlink-panels
                value-format="yyyy-MM-dd" 
                type="daterange" 
                range-separator="-" 
                start-placeholder="开始日期" 
                end-placeholder="结束日期">
                </el-date-picker>
            </el-form-item>
            <el-form-item label="承诺日期" prop="zfiExpireDate">
                <el-date-picker  size="small"
                v-model="queryParamsFinancing.zfiExpireDate"
                style="width: 240px" 
                unlink-panels
                value-format="yyyy-MM-dd" 
                type="daterange" 
                range-separator="-" 
                start-placeholder="开始日期" 
                end-placeholder="结束日期">
                </el-date-picker>
            </el-form-item>
            <el-form-item label="融信利率" prop="zfiRate">
              <el-input
              v-model.trim="queryParamsFinancing.zfiRate"
              placeholder="请输入融信利率"
              clearable
              size="small"
              maxlength="25"
              @keyup.enter.native="handleQueryFinancing"
              />
            </el-form-item>
            <!-- <el-form-item label="状态" prop="zfiStatus">
              <el-select v-model="queryParams.zfiStatus" placeholder="请选择状态" clearable size="small">
                <el-option
                  v-for="dict in stateOptions"
                  :key="dict.dictValue"
                  :label="dict.dictLabel"
                  :value="dict.dictValue"
                />
              </el-select>
          </el-form-item> -->
    </el-form>
  </el-card>
  <el-row :gutter="10" class="mb8">
      <el-col :span="1.5">
        <el-button
          type="primary"
          icon="el-icon-plus"
          size="mini"
          @click="handleAdd"
          v-hasPermi="['credit:credit:add']"
        >开立融信</el-button>
        <el-button
          type="primary"
          icon="el-icon-plus"
          size="mini"
          @click="finanOpening"
          v-hasPermi="['finanOpening:finanOpening:add']"
        >融资开立</el-button>
        <el-button
          type="primary"
          icon="el-icon-plus"
          size="mini"
          @click="apply"
          v-hasPermi="['finanOpening:finanOpening:apply']"
        >融资申请</el-button>
      </el-col>
    </el-row>
    <el-table v-loading="loading" :data="infFinancingList" @selection-change="handleSelectionChange" border>
     <el-table-column label="序号" type="index" width="50" align="center">
        <template slot-scope="scope">
          <span>{{(queryParamsFinancing.pageNum - 1) * queryParamsFinancing.pageSize + scope.$index + 1}}</span>
        </template>
      </el-table-column>
      <el-table-column label="融信编号" align="center" prop="zfiNumber"  :show-overflow-tooltip="true"/>
      <el-table-column label="开立方"  align="center" prop="openName"  :show-overflow-tooltip="true"/>
      <el-table-column label="接收方"  align="center" prop="receiveName"   :show-overflow-tooltip="true"/>
      <el-table-column label="融信类型" :formatter="typeFormat" align="center" prop="zfiCreateType"  :show-overflow-tooltip="true"/>
      <el-table-column label="融信产品" align="center" prop="zfpName"   :show-overflow-tooltip="true"/>
      <el-table-column label="融信金额" align="center" :formatter="moneyFormat" prop="zfiAmount" :show-overflow-tooltip="true" />
      <el-table-column label="融信利率(%)" align="center" width="100px;" prop="zfiRate" :show-overflow-tooltip="true" />
      <el-table-column label="签发有效期" align="center" width="100px;" prop="zfiEffectiveDate" :show-overflow-tooltip="true" />
      <el-table-column label="承诺还款日" align="center" width="100px;" prop="zfiExpireDate" :show-overflow-tooltip="true"/>
      <el-table-column label="签收日期" align="center" prop="zfiSignDate" :show-overflow-tooltip="true" />
      <el-table-column label="承诺函编号" align="center" width="100px;" prop="zfiPaymentNumber" :show-overflow-tooltip="true" />
      <el-table-column label="平台审批状态" :formatter="platformStatusFormat"  align="center" width="100px;" prop="zfiPlatformStatus" :show-overflow-tooltip="true"/>
      <el-table-column label="融资方审批状态" :formatter="supplierStatusFormat"  align="center" width="110px;" prop="zfiSupplierStatus" :show-overflow-tooltip="true"/>
      <el-table-column label="核心审批状态" :formatter="coreStatusFormat" align="center" width="100px;" prop="zfiCoreStatus" :show-overflow-tooltip="true"/>
      <el-table-column label="状态" :formatter="stateFormat" align="center" prop="zfiStatus" :show-overflow-tooltip="true"/>
      <el-table-column label="操作" align="center" class-name="small-padding fixed-width" width='300' fixed="right" >
        <template slot-scope="scope">
          <el-button
            size="mini"
            type="text"
            icon="el-icon-view"
            @click="handleDetail(scope.row)"
            v-hasPermi="['credit:credit:query']"
          >详情</el-button>
         <!--
            融资状态审批拒绝+核心状态为空+平台状态为空+融信状态为空||
            融资状态审批通过+核心状态为空+平台状态审批通过+融信平台退回||
            融资审批通过+核心审批拒绝+平台审批通过+融信待确权
            融资审批状态空+核心审批拒绝+平台空+融信空||
            融资审批状态审批拒绝+核心审批通过+平台空+融信待签收||
            融资审批审批通过+核心审批通过+平台拒绝+融信待签收
          -->
           <el-button
            size="mini"
            type="text"
            icon="el-icon-edit"
            @click="handleUpdate(scope.row)"
            v-hasPermi="['credit:credit:update']"
            v-if="(scope.row.zfiSupplierStatus == '02' && (scope.row.zfiCoreStatus == '' || scope.row.zfiCoreStatus == 'null' ||  scope.row.zfiCoreStatus == null) && (scope.row.zfiPlatformStatus == '' || scope.row.zfiPlatformStatus == 'null' ||  scope.row.zfiPlatformStatus == null) && (scope.row.zfiStatus == '' || scope.row.zfiStatus == 'null' ||  scope.row.zfiStatus == null))||
                  (scope.row.zfiSupplierStatus == '01' && (scope.row.zfiCoreStatus == '' || scope.row.zfiCoreStatus == 'null' ||  scope.row.zfiCoreStatus == null) && scope.row.zfiPlatformStatus == '02' && scope.row.zfiStatus == '06')||
                  (scope.row.zfiSupplierStatus == '01' && scope.row.zfiCoreStatus == '02' && scope.row.zfiPlatformStatus == '01' && scope.row.zfiStatus == '00')||
                  ((scope.row.zfiSupplierStatus == '' || scope.row.zfiSupplierStatus == 'null' ||  scope.row.zfiSupplierStatus == null) && scope.row.zfiCoreStatus == '02' && (scope.row.zfiPlatformStatus == '' || scope.row.zfiPlatformStatus == 'null' ||  scope.row.zfiPlatformStatus == null) && (scope.row.zfiStatus == '' || scope.row.zfiStatus == 'null' ||  scope.row.zfiStatus == null))||
                  (scope.row.zfiSupplierStatus == '02' && scope.row.zfiCoreStatus == '01' && (scope.row.zfiPlatformStatus == '' || scope.row.zfiPlatformStatus == 'null' ||  scope.row.zfiPlatformStatus == null) && scope.row.zfiStatus == '01')||
                  (scope.row.zfiSupplierStatus == '01' && scope.row.zfiCoreStatus == '01' && scope.row.zfiPlatformStatus == '02'&& scope.row.zfiStatus == '01')"
          >修改</el-button>
            <!--融资申请/开立+融信状态待确权+核心审批状态为空-->
           <el-button
            size="mini"
            type="text"
            icon="el-icon-edit"
            @click="handleApprove(scope.row)"
            v-hasPermi="['credit:credit:approve']"
            v-if="(scope.row.zfiCreateType == '0' || scope.row.zfiCreateType == '2' ) && scope.row.zfiStatus == '00' && (scope.row.zfiCoreStatus == '' || scope.row.zfiCoreStatus == null || scope.row.zfiCoreStatus =='null' ||scope.row.zfiCoreStatus =='02' )"
          >确权</el-button>
          <!--原补充资料-->
          <!--核心开立+融信状态为待签收+(融资审批状态不是审批中并且不是审批通过)或者(平台审批状态不是审批中并且不是审批通过)-->
          <el-button
            size="mini"
            type="text"
            icon="el-icon-edit"
            @click="handleAddInformation(scope.row)"
            v-hasPermi="['credit:credit:addInfor']"
            v-if="scope.row.zfiCreateType == '1' && scope.row.zfiStatus=='01' &&((scope.row.zfiSupplierStatus != '00' && scope.row.zfiSupplierStatus != '01') || (scope.row.zfiPlatformStatus != '00' && scope.row.zfiPlatformStatus != '01'))"
          >签收</el-button>
          <!--融资申请+融信状态待签收+融资审批状态不是审批中并且不是审批通过-->
          <el-button
            size="mini"
            type="text"
            icon="el-icon-edit"
            @click="handleSignFor(scope.row)"
            v-hasPermi="['credit:credit:signFor']"
            v-if="scope.row.zfiCreateType == '0' && scope.row.zfiStatus=='01' &&(scope.row.zfiSupplierStatus != '00' && scope.row.zfiSupplierStatus != '01')"
          >签收</el-button>
           <!--(融资申请+融信状态待签收+融资审批状态不是审批中并且不是审批通过)||
              (核心开立+融信状态为待签收+(融资审批状态不是审批中并且不是审批通过)或者(平台审批状态不是审批中并且不是审批通过))
          -->
          <el-button
            size="mini"
            type="text"
            icon="el-icon-edit"
            @click="handleRefuse(scope.row)"
            v-hasPermi="['credit:credit:refuse']"
            v-if="(scope.row.zfiCreateType == '0' && scope.row.zfiStatus=='01' &&(scope.row.zfiSupplierStatus != '00' && scope.row.zfiSupplierStatus != '01'))||
            (scope.row.zfiCreateType == '1' && scope.row.zfiStatus=='01' &&((scope.row.zfiSupplierStatus != '00' && scope.row.zfiSupplierStatus != '01') || (scope.row.zfiPlatformStatus != '00' && scope.row.zfiPlatformStatus != '01')))"
          >拒签</el-button>
          <el-button
            size="mini"
            type="text"
            icon="el-icon-edit"
            @click="handleGoFinance(scope.row)"
            v-hasPermi="['credit:credit:goFinance']"
            v-if="(scope.row.zfiCreateType == '1' ||scope.row.zfiCreateType == '0' || scope.row.zfiCreateType == '2') && scope.row.zfiStatus == '02'"
          >去融资</el-button>
         <!--核心开立:核心审批通过+其他状态为空||
            补充资料：融资方通过+核心通过+平台通过+待签收||
            融资开立:融资方通过+平台通过+其他为空||
            确权:融资方通过+核心通过+平台通过+待确权
         -->
          <el-button
            size="mini"
            type="text"
            icon="el-icon-edit"
            @click="seal(scope.row)"
            v-hasPermi="['credit:credit:seal']"
            v-if="(scope.row.zfiCoreStatus == '01' && (scope.row.zfiSupplierStatus == '' || scope.row.zfiSupplierStatus == null || scope.row.zfiSupplierStatus == 'null') && (scope.row.zfiPlatformStatus == '' || scope.row.zfiPlatformStatus == null || scope.row.zfiPlatformStatus == 'null') && (scope.row.zfiStatus == '' || scope.row.zfiStatus == 'null' ||  scope.row.zfiStatus == null))||
                  (scope.row.zfiSupplierStatus == '01' && scope.row.zfiCoreStatus == '01' && scope.row.zfiPlatformStatus == '01' &&  scope.row.zfiStatus == '01')||
                  (scope.row.zfiSupplierStatus == '01' && scope.row.zfiPlatformStatus == '01' && (scope.row.zfiCoreStatus == '' || scope.row.zfiCoreStatus == null || scope.row.zfiCoreStatus =='null') && (scope.row.zfiStatus == '' || scope.row.zfiStatus == 'null' ||  scope.row.zfiStatus == null))||
                  (scope.row.zfiSupplierStatus == '01' && scope.row.zfiCoreStatus == '01' && scope.row.zfiPlatformStatus == '01' &&  scope.row.zfiStatus == '00')"
          >盖章</el-button>
          <el-button
            size="mini"
            type="text"
            icon="el-icon-delete"
            @click="handleDelete(scope.row)"
            v-hasPermi="['credit:credit:del']"
            v-if="scope.row.zfiStatus == '' || scope.row.zfiStatus == 'null' || scope.row.zfiStatus == null || scope.row.zfiStatus == '06'"
          >删除</el-button>
        </template>
      </el-table-column>
    </el-table>
    <pagination
      v-show="totalFinancing>0"
      :total="totalFinancing"
      :page.sync="handleQueryFinancing.pageNum"
      :limit.sync="handleQueryFinancing.pageSize"
      @pagination="getListFinancing"
    />
    </el-tab-pane>
      <!--已融资-->
     <el-tab-pane label="已融资">
      <el-card class="fiche">
        <right-toolbar :showSearch.sync="showSearch" @queryTable="getListFinanced">收起</right-toolbar>
        <span style="margin-bottom: 10px;color:#333333;font:14px Helvetica Neue, Helvetica, PingFang SC, Tahoma, Arial,sans-serif">所选条件:</span>
          <div  style="float: right;margin-right:1%">
            <el-button type="cyan"  icon="el-icon-search" size="mini" @click="handleQueryFinanced">搜索</el-button>
            <el-button icon="el-icon-refresh" size="mini" @click="resetQueryFinanced"  style="float: ;">重置</el-button>
          </div>
          <hr  style="margin-top: 16px;">
          <el-form :model="queryParamsFinanced" ref="queryFormFinanced" :inline="true" v-if="showSearch" label-width="68px">
              <el-form-item label="融信编码" prop="zfiNumber">
                  <el-input
                  v-model.trim="queryParamsFinanced.zfiNumber"
                  placeholder="请输入融信编码"
                  clearable
                  size="small"
                  maxlength="25"
                  @keyup.enter.native="handleQueryFinanced"
                  />
          </el-form-item>
          <el-form-item label="开立企业" prop="openCompany">
              <el-input
              v-model.trim="queryParamsFinanced.openCompany"
              placeholder="请输入开立企业"
              clearable
              size="small"
              maxlength="25"
              @keyup.enter.native="handleQueryFinanced"
              />
          </el-form-item>
          <el-form-item label="接收企业" prop="receiveCompany">
              <el-input
              v-model.trim="queryParamsFinanced.receiveCompany"
              placeholder="请输入接收企业"
              clearable
              size="small"
              maxlength="25"
              @keyup.enter.native="handleQueryFinanced"
              />
          </el-form-item>
          <el-form-item label="融信产品" prop="zfpName">
            <el-input
            v-model.trim="queryParamsFinanced.zfpName"
            placeholder="请输入融信产品"
            clearable
            size="small"
            maxlength="25"
            @keyup.enter.native="handleQueryFinanced"
            />
          </el-form-item>
          <el-form-item label="融信金额">
              <el-input
              v-model="queryParamsFinanced.startAmt"
              placeholder="请输入融信金额"
              clearable
              size="small"
              maxlength="20"
            />
          </el-form-item>
          <el-form-item>
              ~
          </el-form-item>
          <el-form-item>
              <el-input
              v-model="queryParamsFinanced.endAmt"
              placeholder="请输入融信金额"
              clearable
              size="small"
              @keyup.enter.native="handleQueryFinanced"
              maxlength="20"
            />
          </el-form-item>
          <el-form-item label="签收日期" prop="zfiSignDate">
                <el-date-picker  size="small"
                v-model="queryParamsFinanced.zfiSignDate"
                style="width: 240px" 
                unlink-panels
                value-format="yyyy-MM-dd" 
                type="daterange" 
                range-separator="-" 
                start-placeholder="开始日期" 
                end-placeholder="结束日期">
                </el-date-picker>
            </el-form-item>
            <el-form-item label="承诺日期" prop="zfiExpireDate">
                <el-date-picker  size="small"
                v-model="queryParamsFinanced.zfiExpireDate"
                style="width: 240px" 
                unlink-panels
                value-format="yyyy-MM-dd" 
                type="daterange" 
                range-separator="-" 
                start-placeholder="开始日期" 
                end-placeholder="结束日期">
                </el-date-picker>
            </el-form-item>
            <el-form-item label="融信利率" prop="zfiRate">
              <el-input
              v-model.trim="queryParamsFinanced.zfiRate"
              placeholder="请输入融信利率"
              clearable
              size="small"
              maxlength="25"
              @keyup.enter.native="handleQueryFinanced"
              />
            </el-form-item>
            <!-- <el-form-item label="状态" prop="zfiStatus">
              <el-select v-model="queryParams.zfiStatus" placeholder="请选择状态" clearable size="small">
                <el-option
                  v-for="dict in stateOptions"
                  :key="dict.dictValue"
                  :label="dict.dictLabel"
                  :value="dict.dictValue"
                />
              </el-select>
          </el-form-item> -->
    </el-form>
  </el-card>
  <el-row :gutter="10" class="mb8">
      <el-col :span="1.5">
        <el-button
          type="primary"
          icon="el-icon-plus"
          size="mini"
          @click="handleAdd"
          v-hasPermi="['credit:credit:add']"
        >开立融信</el-button>
        <el-button
          type="primary"
          icon="el-icon-plus"
          size="mini"
          @click="finanOpening"
          v-hasPermi="['finanOpening:finanOpening:add']"
        >融资开立</el-button>
        <el-button
          type="primary"
          icon="el-icon-plus"
          size="mini"
          @click="apply"
          v-hasPermi="['finanOpening:finanOpening:apply']"
        >融资申请</el-button>
      </el-col>
    </el-row>
    <el-table v-loading="loading" :data="infFinancedList" @selection-change="handleSelectionChange" border>
     <el-table-column label="序号" type="index" width="50" align="center">
        <template slot-scope="scope">
          <span>{{(queryParamsFinanced.pageNum - 1) * queryParamsFinanced.pageSize + scope.$index + 1}}</span>
        </template>
      </el-table-column>
      <el-table-column label="融信编号" align="center" prop="zfiNumber"  :show-overflow-tooltip="true"/>
      <el-table-column label="开立方"  align="center" prop="openName"  :show-overflow-tooltip="true"/>
      <el-table-column label="接收方"  align="center" prop="receiveName"   :show-overflow-tooltip="true"/>
      <el-table-column label="融信类型" :formatter="typeFormat" align="center" prop="zfiCreateType"  :show-overflow-tooltip="true"/>
      <el-table-column label="融信产品" align="center" prop="zfpName"   :show-overflow-tooltip="true"/>
      <el-table-column label="融信金额" align="center" :formatter="moneyFormat" prop="zfiAmount" :show-overflow-tooltip="true" />
      <el-table-column label="融信利率(%)" align="center" width="100px;" prop="zfiRate" :show-overflow-tooltip="true" />
      <el-table-column label="签发有效期" align="center" width="100px;" prop="zfiEffectiveDate" :show-overflow-tooltip="true" />
      <el-table-column label="承诺还款日" align="center" width="100px;" prop="zfiExpireDate" :show-overflow-tooltip="true"/>
      <el-table-column label="签收日期" align="center" prop="zfiSignDate" :show-overflow-tooltip="true" />
      <el-table-column label="承诺函编号" align="center" width="100px;" prop="zfiPaymentNumber" :show-overflow-tooltip="true" />
      <el-table-column label="平台审批状态" :formatter="platformStatusFormat"  align="center" width="100px;" prop="zfiPlatformStatus" :show-overflow-tooltip="true"/>
      <el-table-column label="融资方审批状态" :formatter="supplierStatusFormat"  align="center" width="110px;" prop="zfiSupplierStatus" :show-overflow-tooltip="true"/>
      <el-table-column label="核心审批状态" :formatter="coreStatusFormat" align="center" width="100px;" prop="zfiCoreStatus" :show-overflow-tooltip="true"/>
      <el-table-column label="状态" :formatter="stateFormat" align="center" prop="zfiStatus" :show-overflow-tooltip="true"/>
      <el-table-column label="操作" align="center" class-name="small-padding fixed-width" width='300' fixed="right" >
        <template slot-scope="scope">
          <el-button
            size="mini"
            type="text"
            icon="el-icon-view"
            @click="handleDetail(scope.row)"
            v-hasPermi="['credit:credit:query']"
          >详情</el-button>
         <!--
            融资状态审批拒绝+核心状态为空+平台状态为空+融信状态为空||
            融资状态审批通过+核心状态为空+平台状态审批通过+融信平台退回||
            融资审批通过+核心审批拒绝+平台审批通过+融信待确权
            融资审批状态空+核心审批拒绝+平台空+融信空||
            融资审批状态审批拒绝+核心审批通过+平台空+融信待签收||
            融资审批审批通过+核心审批通过+平台拒绝+融信待签收
          -->
           <el-button
            size="mini"
            type="text"
            icon="el-icon-edit"
            @click="handleUpdate(scope.row)"
            v-hasPermi="['credit:credit:update']"
            v-if="(scope.row.zfiSupplierStatus == '02' && (scope.row.zfiCoreStatus == '' || scope.row.zfiCoreStatus == 'null' ||  scope.row.zfiCoreStatus == null) && (scope.row.zfiPlatformStatus == '' || scope.row.zfiPlatformStatus == 'null' ||  scope.row.zfiPlatformStatus == null) && (scope.row.zfiStatus == '' || scope.row.zfiStatus == 'null' ||  scope.row.zfiStatus == null))||
                  (scope.row.zfiSupplierStatus == '01' && (scope.row.zfiCoreStatus == '' || scope.row.zfiCoreStatus == 'null' ||  scope.row.zfiCoreStatus == null) && scope.row.zfiPlatformStatus == '02' && scope.row.zfiStatus == '06')||
                  (scope.row.zfiSupplierStatus == '01' && scope.row.zfiCoreStatus == '02' && scope.row.zfiPlatformStatus == '01' && scope.row.zfiStatus == '00')||
                  ((scope.row.zfiSupplierStatus == '' || scope.row.zfiSupplierStatus == 'null' ||  scope.row.zfiSupplierStatus == null) && scope.row.zfiCoreStatus == '02' && (scope.row.zfiPlatformStatus == '' || scope.row.zfiPlatformStatus == 'null' ||  scope.row.zfiPlatformStatus == null) && (scope.row.zfiStatus == '' || scope.row.zfiStatus == 'null' ||  scope.row.zfiStatus == null))||
                  (scope.row.zfiSupplierStatus == '02' && scope.row.zfiCoreStatus == '01' && (scope.row.zfiPlatformStatus == '' || scope.row.zfiPlatformStatus == 'null' ||  scope.row.zfiPlatformStatus == null) && scope.row.zfiStatus == '01')||
                  (scope.row.zfiSupplierStatus == '01' && scope.row.zfiCoreStatus == '01' && scope.row.zfiPlatformStatus == '02'&& scope.row.zfiStatus == '01')"
          >修改</el-button>
             <!--融资申请/开立+融信状态待确权+核心审批状态为空-->
           <el-button
            size="mini"
            type="text"
            icon="el-icon-edit"
            @click="handleApprove(scope.row)"
            v-hasPermi="['credit:credit:approve']"
            v-if="(scope.row.zfiCreateType == '0' || scope.row.zfiCreateType == '2' ) && scope.row.zfiStatus == '00' && (scope.row.zfiCoreStatus == '' || scope.row.zfiCoreStatus == null || scope.row.zfiCoreStatus =='null' ||scope.row.zfiCoreStatus =='02' )"
          >确权</el-button>
          <!--原补充资料-->
          <!--核心开立+融信状态为待签收+(融资审批状态不是审批中并且不是审批通过)或者(平台审批状态不是审批中并且不是审批通过)-->
          <el-button
            size="mini"
            type="text"
            icon="el-icon-edit"
            @click="handleAddInformation(scope.row)"
            v-hasPermi="['credit:credit:addInfor']"
            v-if="scope.row.zfiCreateType == '1' && scope.row.zfiStatus=='01' &&((scope.row.zfiSupplierStatus != '00' && scope.row.zfiSupplierStatus != '01') || (scope.row.zfiPlatformStatus != '00' && scope.row.zfiPlatformStatus != '01'))"
          >签收</el-button>
          <!--融资申请+融信状态待签收+融资审批状态不是审批中并且不是审批通过-->
          <el-button
            size="mini"
            type="text"
            icon="el-icon-edit"
            @click="handleSignFor(scope.row)"
            v-hasPermi="['credit:credit:signFor']"
            v-if="scope.row.zfiCreateType == '0' && scope.row.zfiStatus=='01' &&(scope.row.zfiSupplierStatus != '00' && scope.row.zfiSupplierStatus != '01')"
          >签收</el-button>
          <!--(融资申请+融信状态待签收+融资审批状态不是审批中并且不是审批通过)||
              (核心开立+融信状态为待签收+(融资审批状态不是审批中并且不是审批通过)或者(平台审批状态不是审批中并且不是审批通过))
          -->
          <el-button
            size="mini"
            type="text"
            icon="el-icon-edit"
            @click="handleRefuse(scope.row)"
            v-hasPermi="['credit:credit:refuse']"
            v-if="(scope.row.zfiCreateType == '0' && scope.row.zfiStatus=='01' &&(scope.row.zfiSupplierStatus != '00' && scope.row.zfiSupplierStatus != '01'))||
            (scope.row.zfiCreateType == '1' && scope.row.zfiStatus=='01' &&((scope.row.zfiSupplierStatus != '00' && scope.row.zfiSupplierStatus != '01') || (scope.row.zfiPlatformStatus != '00' && scope.row.zfiPlatformStatus != '01')))"
          >拒签</el-button>
          <el-button
            size="mini"
            type="text"
            icon="el-icon-edit"
            @click="handleGoFinance(scope.row)"
            v-hasPermi="['credit:credit:goFinance']"
            v-if="(scope.row.zfiCreateType == '1' ||scope.row.zfiCreateType == '0' || scope.row.zfiCreateType == '2') && scope.row.zfiStatus == '02'"
          >去融资</el-button>
           <!--核心开立:核心审批通过+其他状态为空||
            补充资料：融资方通过+核心通过+平台通过+待签收||
            融资开立:融资方通过+平台通过+其他为空||
            确权:融资方通过+核心通过+平台通过+待确权
         -->
          <el-button
            size="mini"
            type="text"
            icon="el-icon-edit"
            @click="seal(scope.row)"
            v-hasPermi="['credit:credit:seal']"
            v-if="(scope.row.zfiCoreStatus == '01' && (scope.row.zfiSupplierStatus == '' || scope.row.zfiSupplierStatus == null || scope.row.zfiSupplierStatus == 'null') && (scope.row.zfiPlatformStatus == '' || scope.row.zfiPlatformStatus == null || scope.row.zfiPlatformStatus == 'null') && (scope.row.zfiStatus == '' || scope.row.zfiStatus == 'null' ||  scope.row.zfiStatus == null))||
                  (scope.row.zfiSupplierStatus == '01' && scope.row.zfiCoreStatus == '01' && scope.row.zfiPlatformStatus == '01' &&  scope.row.zfiStatus == '01')||
                  (scope.row.zfiSupplierStatus == '01' && scope.row.zfiPlatformStatus == '01' && (scope.row.zfiCoreStatus == '' || scope.row.zfiCoreStatus == null || scope.row.zfiCoreStatus =='null') && (scope.row.zfiStatus == '' || scope.row.zfiStatus == 'null' ||  scope.row.zfiStatus == null))||
                  (scope.row.zfiSupplierStatus == '01' && scope.row.zfiCoreStatus == '01' && scope.row.zfiPlatformStatus == '01' &&  scope.row.zfiStatus == '00')"
          >盖章</el-button>
          <el-button
            size="mini"
            type="text"
            icon="el-icon-delete"
            @click="handleDelete(scope.row)"
            v-hasPermi="['credit:credit:del']"
            v-if="scope.row.zfiStatus == '' || scope.row.zfiStatus == 'null' || scope.row.zfiStatus == null || scope.row.zfiStatus == '06'"
          >删除</el-button>
        </template>
      </el-table-column>
    </el-table>
    <pagination
      v-show="totalFinanced>0"
      :total="totalFinanced"
      :page.sync="handleQueryFinanced.pageNum"
      :limit.sync="handleQueryFinanced.pageSize"
      @pagination="getListFinanced"
    />
    </el-tab-pane>
      <!--已失效-->
     <el-tab-pane label="已失效">
      <el-card class="fiche">
        <right-toolbar :showSearch.sync="showSearch" @queryTable="getListInvalid">收起</right-toolbar>
        <span style="margin-bottom: 10px;color:#333333;font:14px Helvetica Neue, Helvetica, PingFang SC, Tahoma, Arial,sans-serif">所选条件:</span>
          <div  style="float: right;margin-right:1%">
            <el-button type="cyan"  icon="el-icon-search" size="mini" @click="handleQueryInvalid">搜索</el-button>
            <el-button icon="el-icon-refresh" size="mini" @click="resetQueryInvalid"  style="float: ;">重置</el-button>
          </div>
          <hr  style="margin-top: 16px;">
          <el-form :model="queryParamsInvalid" ref="queryFormInvalid" :inline="true" v-if="showSearch" label-width="68px">
              <el-form-item label="融信编码" prop="zfiNumber">
                  <el-input
                  v-model.trim="queryParamsInvalid.zfiNumber"
                  placeholder="请输入融信编码"
                  clearable
                  size="small"
                  maxlength="25"
                  @keyup.enter.native="handleQueryInvalid"
                  />
          </el-form-item>
          <el-form-item label="开立企业" prop="openCompany">
              <el-input
              v-model.trim="queryParamsInvalid.openCompany"
              placeholder="请输入开立企业"
              clearable
              size="small"
              maxlength="25"
              @keyup.enter.native="handleQueryInvalid"
              />
          </el-form-item>
          <el-form-item label="接收企业" prop="receiveCompany">
              <el-input
              v-model.trim="queryParamsInvalid.receiveCompany"
              placeholder="请输入接收企业"
              clearable
              size="small"
              maxlength="25"
              @keyup.enter.native="handleQueryInvalid"
              />
          </el-form-item>
          <el-form-item label="融信产品" prop="zfpName">
            <el-input
            v-model.trim="queryParamsInvalid.zfpName"
            placeholder="请输入融信产品"
            clearable
            size="small"
            maxlength="25"
            @keyup.enter.native="handleQueryInvalid"
            />
          </el-form-item>
          <el-form-item label="融信金额">
              <el-input
              v-model="queryParamsInvalid.startAmt"
              placeholder="请输入融信金额"
              clearable
              size="small"
              maxlength="20"
            />
          </el-form-item>
          <el-form-item>
              ~
          </el-form-item>
          <el-form-item>
              <el-input
              v-model="queryParamsInvalid.endAmt"
              placeholder="请输入融信金额"
              clearable
              size="small"
              @keyup.enter.native="handleQueryInvalid"
              maxlength="20"
            />
          </el-form-item>
          <el-form-item label="签收日期" prop="zfiSignDate">
                <el-date-picker  size="small"
                v-model="queryParamsInvalid.zfiSignDate"
                style="width: 240px" 
                unlink-panels
                value-format="yyyy-MM-dd" 
                type="daterange" 
                range-separator="-" 
                start-placeholder="开始日期" 
                end-placeholder="结束日期">
                </el-date-picker>
            </el-form-item>
            <el-form-item label="承诺日期" prop="zfiExpireDate">
                <el-date-picker  size="small"
                v-model="queryParamsInvalid.zfiExpireDate"
                style="width: 240px" 
                unlink-panels
                value-format="yyyy-MM-dd" 
                type="daterange" 
                range-separator="-" 
                start-placeholder="开始日期" 
                end-placeholder="结束日期">
                </el-date-picker>
            </el-form-item>
            <el-form-item label="融信利率" prop="zfiRate">
              <el-input
              v-model.trim="queryParamsInvalid.zfiRate"
              placeholder="请输入融信利率"
              clearable
              size="small"
              maxlength="25"
              @keyup.enter.native="handleQueryInvalid"
              />
            </el-form-item>
            <!-- <el-form-item label="状态" prop="zfiStatus">
              <el-select v-model="queryParams.zfiStatus" placeholder="请选择状态" clearable size="small">
                <el-option
                  v-for="dict in stateOptions"
                  :key="dict.dictValue"
                  :label="dict.dictLabel"
                  :value="dict.dictValue"
                />
              </el-select>
          </el-form-item> -->
    </el-form>
  </el-card>
  <el-row :gutter="10" class="mb8">
      <el-col :span="1.5">
        <el-button
          type="primary"
          icon="el-icon-plus"
          size="mini"
          @click="handleAdd"
          v-hasPermi="['credit:credit:add']"
        >开立融信</el-button>
        <el-button
          type="primary"
          icon="el-icon-plus"
          size="mini"
          @click="finanOpening"
          v-hasPermi="['finanOpening:finanOpening:add']"
        >融资开立</el-button>
        <el-button
          type="primary"
          icon="el-icon-plus"
          size="mini"
          @click="apply"
          v-hasPermi="['finanOpening:finanOpening:apply']"
        >融资申请</el-button>
      </el-col>
    </el-row>
    <el-table v-loading="loading" :data="infInvalidList" @selection-change="handleSelectionChange" border>
     <el-table-column label="序号" type="index" width="50" align="center">
        <template slot-scope="scope">
          <span>{{(queryParamsInvalid.pageNum - 1) * queryParamsInvalid.pageSize + scope.$index + 1}}</span>
        </template>
      </el-table-column>
      <el-table-column label="融信编号" align="center" prop="zfiNumber"  :show-overflow-tooltip="true"/>
      <el-table-column label="开立方"  align="center" prop="openName"  :show-overflow-tooltip="true"/>
      <el-table-column label="接收方"  align="center" prop="receiveName"   :show-overflow-tooltip="true"/>
      <el-table-column label="融信类型" :formatter="typeFormat" align="center" prop="zfiCreateType"  :show-overflow-tooltip="true"/>
      <el-table-column label="融信产品" align="center" prop="zfpName"   :show-overflow-tooltip="true"/>
      <el-table-column label="融信金额" align="center" :formatter="moneyFormat" prop="zfiAmount" :show-overflow-tooltip="true" />
      <el-table-column label="融信利率(%)" align="center" width="100px;" prop="zfiRate" :show-overflow-tooltip="true" />
      <el-table-column label="签发有效期" align="center" width="100px;" prop="zfiEffectiveDate" :show-overflow-tooltip="true" />
      <el-table-column label="承诺还款日" align="center" width="100px;" prop="zfiExpireDate" :show-overflow-tooltip="true"/>
      <el-table-column label="签收日期" align="center" prop="zfiSignDate" :show-overflow-tooltip="true" />
      <el-table-column label="承诺函编号" align="center" width="100px;" prop="zfiPaymentNumber" :show-overflow-tooltip="true" />
      <el-table-column label="平台审批状态" :formatter="platformStatusFormat"  align="center" width="100px;" prop="zfiPlatformStatus" :show-overflow-tooltip="true"/>
      <el-table-column label="融资方审批状态" :formatter="supplierStatusFormat"  align="center" width="110px;" prop="zfiSupplierStatus" :show-overflow-tooltip="true"/>
      <el-table-column label="核心审批状态" :formatter="coreStatusFormat" align="center" width="100px;" prop="zfiCoreStatus" :show-overflow-tooltip="true"/>
      <el-table-column label="状态" :formatter="stateFormat" align="center" prop="zfiStatus" :show-overflow-tooltip="true"/>
      <el-table-column label="操作" align="center" class-name="small-padding fixed-width" width='300' fixed="right" >
        <template slot-scope="scope">
          <el-button
            size="mini"
            type="text"
            icon="el-icon-view"
            @click="handleDetail(scope.row)"
            v-hasPermi="['credit:credit:query']"
          >详情</el-button>
         <!--
            融资状态审批拒绝+核心状态为空+平台状态为空+融信状态为空||
            融资状态审批通过+核心状态为空+平台状态审批通过+融信平台退回||
            融资审批通过+核心审批拒绝+平台审批通过+融信待确权
            融资审批状态空+核心审批拒绝+平台空+融信空||
            融资审批状态审批拒绝+核心审批通过+平台空+融信待签收||
            融资审批审批通过+核心审批通过+平台拒绝+融信待签收
          -->
           <el-button
            size="mini"
            type="text"
            icon="el-icon-edit"
            @click="handleUpdate(scope.row)"
            v-hasPermi="['credit:credit:update']"
            v-if="(scope.row.zfiSupplierStatus == '02' && (scope.row.zfiCoreStatus == '' || scope.row.zfiCoreStatus == 'null' ||  scope.row.zfiCoreStatus == null) && (scope.row.zfiPlatformStatus == '' || scope.row.zfiPlatformStatus == 'null' ||  scope.row.zfiPlatformStatus == null) && (scope.row.zfiStatus == '' || scope.row.zfiStatus == 'null' ||  scope.row.zfiStatus == null))||
                  (scope.row.zfiSupplierStatus == '01' && (scope.row.zfiCoreStatus == '' || scope.row.zfiCoreStatus == 'null' ||  scope.row.zfiCoreStatus == null) && scope.row.zfiPlatformStatus == '02' && scope.row.zfiStatus == '06')||
                  (scope.row.zfiSupplierStatus == '01' && scope.row.zfiCoreStatus == '02' && scope.row.zfiPlatformStatus == '01' && scope.row.zfiStatus == '00')||
                  ((scope.row.zfiSupplierStatus == '' || scope.row.zfiSupplierStatus == 'null' ||  scope.row.zfiSupplierStatus == null) && scope.row.zfiCoreStatus == '02' && (scope.row.zfiPlatformStatus == '' || scope.row.zfiPlatformStatus == 'null' ||  scope.row.zfiPlatformStatus == null) && (scope.row.zfiStatus == '' || scope.row.zfiStatus == 'null' ||  scope.row.zfiStatus == null))||
                  (scope.row.zfiSupplierStatus == '02' && scope.row.zfiCoreStatus == '01' && (scope.row.zfiPlatformStatus == '' || scope.row.zfiPlatformStatus == 'null' ||  scope.row.zfiPlatformStatus == null) && scope.row.zfiStatus == '01')||
                  (scope.row.zfiSupplierStatus == '01' && scope.row.zfiCoreStatus == '01' && scope.row.zfiPlatformStatus == '02'&& scope.row.zfiStatus == '01')"
          >修改</el-button>
          <!--融资申请/开立+融信状态待确权+核心审批状态为空-->
           <el-button
            size="mini"
            type="text"
            icon="el-icon-edit"
            @click="handleApprove(scope.row)"
            v-hasPermi="['credit:credit:approve']"
            v-if="(scope.row.zfiCreateType == '0' || scope.row.zfiCreateType == '2' ) && scope.row.zfiStatus == '00' && (scope.row.zfiCoreStatus == '' || scope.row.zfiCoreStatus == null || scope.row.zfiCoreStatus =='null' ||scope.row.zfiCoreStatus =='02' )"
          >确权</el-button>
          <!--原补充资料-->
          <!--核心开立+融信状态为待签收+(融资审批状态不是审批中并且不是审批通过)或者(平台审批状态不是审批中并且不是审批通过)-->
          <el-button
            size="mini"
            type="text"
            icon="el-icon-edit"
            @click="handleAddInformation(scope.row)"
            v-hasPermi="['credit:credit:addInfor']"
            v-if="scope.row.zfiCreateType == '1' && scope.row.zfiStatus=='01' &&((scope.row.zfiSupplierStatus != '00' && scope.row.zfiSupplierStatus != '01') || (scope.row.zfiPlatformStatus != '00' && scope.row.zfiPlatformStatus != '01'))"
          >签收</el-button>
          <!--融资申请+融信状态待签收+融资审批状态不是审批中并且不是审批通过-->
          <el-button
            size="mini"
            type="text"
            icon="el-icon-edit"
            @click="handleSignFor(scope.row)"
            v-hasPermi="['credit:credit:signFor']"
            v-if="scope.row.zfiCreateType == '0' && scope.row.zfiStatus=='01' &&(scope.row.zfiSupplierStatus != '00' && scope.row.zfiSupplierStatus != '01')"
          >签收</el-button>
         <!--(融资申请+融信状态待签收+融资审批状态不是审批中并且不是审批通过)||
              (核心开立+融信状态为待签收+(融资审批状态不是审批中并且不是审批通过)或者(平台审批状态不是审批中并且不是审批通过))
          -->
          <el-button
            size="mini"
            type="text"
            icon="el-icon-edit"
            @click="handleRefuse(scope.row)"
            v-hasPermi="['credit:credit:refuse']"
            v-if="(scope.row.zfiCreateType == '0' && scope.row.zfiStatus=='01' &&(scope.row.zfiSupplierStatus != '00' && scope.row.zfiSupplierStatus != '01'))||
            (scope.row.zfiCreateType == '1' && scope.row.zfiStatus=='01' &&((scope.row.zfiSupplierStatus != '00' && scope.row.zfiSupplierStatus != '01') || (scope.row.zfiPlatformStatus != '00' && scope.row.zfiPlatformStatus != '01')))"
          >拒签</el-button>
          <el-button
            size="mini"
            type="text"
            icon="el-icon-edit"
            @click="handleGoFinance(scope.row)"
            v-hasPermi="['credit:credit:goFinance']"
            v-if="(scope.row.zfiCreateType == '1' ||scope.row.zfiCreateType == '0' || scope.row.zfiCreateType == '2') && scope.row.zfiStatus == '02'"
          >去融资</el-button>
         <!--核心开立:核心审批通过+其他状态为空||
            补充资料：融资方通过+核心通过+平台通过+待签收||
            融资开立:融资方通过+平台通过+其他为空||
            确权:融资方通过+核心通过+平台通过+待确权
         -->
          <el-button
            size="mini"
            type="text"
            icon="el-icon-edit"
            @click="seal(scope.row)"
            v-hasPermi="['credit:credit:seal']"
            v-if="(scope.row.zfiCoreStatus == '01' && (scope.row.zfiSupplierStatus == '' || scope.row.zfiSupplierStatus == null || scope.row.zfiSupplierStatus == 'null') && (scope.row.zfiPlatformStatus == '' || scope.row.zfiPlatformStatus == null || scope.row.zfiPlatformStatus == 'null') && (scope.row.zfiStatus == '' || scope.row.zfiStatus == 'null' ||  scope.row.zfiStatus == null))||
                  (scope.row.zfiSupplierStatus == '01' && scope.row.zfiCoreStatus == '01' && scope.row.zfiPlatformStatus == '01' &&  scope.row.zfiStatus == '01')||
                  (scope.row.zfiSupplierStatus == '01' && scope.row.zfiPlatformStatus == '01' && (scope.row.zfiCoreStatus == '' || scope.row.zfiCoreStatus == null || scope.row.zfiCoreStatus =='null') && (scope.row.zfiStatus == '' || scope.row.zfiStatus == 'null' ||  scope.row.zfiStatus == null))||
                  (scope.row.zfiSupplierStatus == '01' && scope.row.zfiCoreStatus == '01' && scope.row.zfiPlatformStatus == '01' &&  scope.row.zfiStatus == '00')"
          >盖章</el-button>
          <el-button
            size="mini"
            type="text"
            icon="el-icon-delete"
            @click="handleDelete(scope.row)"
            v-hasPermi="['credit:credit:del']"
            v-if="scope.row.zfiStatus == '' || scope.row.zfiStatus == 'null' || scope.row.zfiStatus == null || scope.row.zfiStatus == '06'"
          >删除</el-button>
        </template>
      </el-table-column>
    </el-table>
    <pagination
      v-show="totalInvalid>0"
      :total="totalInvalid"
      :page.sync="handleQueryInvalid.pageNum"
      :limit.sync="handleQueryInvalid.pageSize"
      @pagination="getListInvalid"
    />
   </el-tab-pane>
  </el-tabs>
</template>

<script>
import { listCredit, coreApproval, confirmationApproval, informationApproval,approval,openApproval, getUser } from "@/api/service/credit/credit";
import {creditRefuse,creditDel} from "@/api/service/credit/creditHandle";
import Editor from '@/components/Editor';
import Cookies from 'js-cookie'
export default {
  name: "invoice",
  components: {
    Editor
  },
  data() {
    return {
      //当前登录企业Id
      companyId:'',
      // 遮罩层
      loading: true,
      // 选中数组
      ids: [],
      // 非单个禁用
      single: true,
      // 非多个禁用
      multiple: true,
      // 显示搜索条件
      showSearch: true,
      // 总条数
      total: 0,
      //待签收总条数
      totalSign:0,
      //融资中
      totalFinancing:0,
      //开立中
      totalOpening:0,
      //已融资
      totalFinanced:0,
      //已失效
      totalInvalid:0,
      // 弹出层标题
      title: "",
      // 是否显示弹出层
      open: false,
      //融信类型
      typeOptions: [],
      //状态
      stateOptions:[],
      //平台审批状态
      platformOptions:[],
      //核心审批状态
      coreOptions:[],
      //供应商审批状态
      supplierOptions:[],
       //开始金额
      startAmt:undefined,
      //结束金额
      endAmt:undefined,
      // 查询参数
      queryParams:{
       pageNum: 1,
        pageSize: 10,
        zfiNumber: null,
        zfiStatus:null,
        openCompany:null,
        receiveCompany:null,
        startAmt:null,
        endAmt:null,
        zfpName:null,
        zfiRate:null,
        zfiSignDate:[],
        zfiExpireDate:[]
      },
      // 待签收查询参数
      queryParamsSign:{
       pageNum: 1,
        pageSize: 10,
        zfiNumber: null,
        zfiStatus:"02",
        openCompany:null,
        receiveCompany:null,
        startAmt:null,
        endAmt:null,
        zfpName:null,
        zfiRate:null,
        zfiSignDate:[],
        zfiExpireDate:[]
      },
      //融资中查询参数
      queryParamsFinancing:{
       pageNum: 1,
        pageSize: 10,
        zfiNumber: null,
        zfiStatus:"04",
        openCompany:null,
        receiveCompany:null,
        startAmt:null,
        endAmt:null,
        zfpName:null,
        zfiRate:null,
        zfiSignDate:[],
        zfiExpireDate:[]
      },
      //开立中查询参数
      queryParamsOpening:{
       pageNum: 1,
        pageSize: 10,
        zfiNumber: null,
        zfiStatus:"00,01,06",
        openCompany:null,
        receiveCompany:null,
        startAmt:null,
        endAmt:null,
        zfpName:null,
        zfiRate:null,
        zfiSignDate:[],
        zfiExpireDate:[]
      },
      //已融资搜索
      queryParamsFinanced:{
       pageNum: 1,
        pageSize: 10,
        zfiNumber: null,
        zfiStatus:"05",
        openCompany:null,
        receiveCompany:null,
        startAmt:null,
        endAmt:null,
        zfpName:null,
        zfiRate:null,
        zfiSignDate:[],
        zfiExpireDate:[]
      },
      //已失效
      queryParamsInvalid:{
       pageNum: 1,
        pageSize: 10,
        zfiNumber: null,
        zfiStatus:"03,07",
        openCompany:null,
        receiveCompany:null,
        startAmt:null,
        endAmt:null,
        zfpName:null,
        zfiRate:null,
        zfiSignDate:[],
        zfiExpireDate:[]
      },
      //全部数据
      infList:[],
      //待签收
      infSignList:[],
      //融资中
      infFinancingList:[],
      //开立中
      infOpeningList:[],
      //已融资
      infFinancedList:[],
      //已失效
      infInvalidList:[],
      // 表单参数
      form: {
      }
    };
  },
  created() {
    this.getDicts("zfi_create_type").then(response => {
      this.typeOptions = response.data;
    });
    this.getDicts("zc_finance_state").then(response => {
      this.stateOptions = response.data;
    });

    this.getDicts("finance_platform_status").then(response => {
      this.platformOptions = response.data;
    });

    this.getDicts("finance_core_status").then(response => {
      this.coreOptions = response.data;
    });

    this.getDicts("finance_supplier_status").then(response => {
      this.supplierOptions = response.data;
    });
    this.getUser();
    this.getList();
    this.getListSign();
    this.getListFinancing();
    this.getListOpening();
    this.getListFinanced();
    this.getListInvalid();
  },
  activated () {
    this.getDicts("zfi_create_type").then(response => {
      this.typeOptions = response.data;
    });
    this.getDicts("zc_finance_state").then(response => {
      this.stateOptions = response.data;
    });
    this.getDicts("finance_platform_status").then(response => {
      this.platformOptions = response.data;
    });
    this.getDicts("finance_core_status").then(response => {
      this.coreOptions = response.data;
    });

    this.getDicts("finance_supplier_status").then(response => {
      this.supplierOptions = response.data;
    });
    this.getUser();
    this.getList();
    this.getListSign();
    this.getListFinancing();
    this.getListOpening();
    this.getListFinanced();
    this.getListInvalid();
  },  
  methods: {
    //获取操作员Id
    getUser(){
      getUser().then(response => {
        debugger
          this.companyId = response.data;
        })
    },
    /** 查询全部列表 */
    getList() {
      this.loading = true;
      listCredit(this.queryParams).then(response => {
        this.infList = response.data.records;
        this.total = response.data.total;
        this.loading = false;
      });
    },
    //查询待签收
    getListSign() {
      this.loading = true;
      listCredit(this.queryParamsSign).then(response => {
        this.infSignList = response.data.records;
        this.totalSign = response.data.total;
        this.loading = false;
      });
    },
    //融资中
    getListFinancing() {
      this.loading = true;
      listCredit(this.queryParamsFinancing).then(response => {
        this.infFinancingList = response.data.records;
        this.totalFinancing = response.data.total;
        this.loading = false;
      });
    },
    //开立中
    getListOpening(){
      this.loading = true;
      listCredit(this.queryParamsOpening).then(response => {
        this.infOpeningList = response.data.records;
        this.totalOpening = response.data.total;
        this.loading = false;
      });
    },
    //已融资
    getListFinanced() {
      this.loading = true;
      listCredit(this.queryParamsFinanced).then(response => {
        this.infFinancedList = response.data.records;
        this.totalFinanced = response.data.total;
        this.loading = false;
      });
    },
    //已失效
    getListInvalid(){
      this.loading = true;
      listCredit(this.queryParamsInvalid).then(response => {
        this.infInvalidList = response.data.records;
        this.totalInvalid = response.data.total;
        this.loading = false;
      });
    },
    // 表单重置
    reset() {
      this.form = {
        zfiNumber: null,
        zfiStatus:null,
        openCompany:null,
        receiveCompany:null,
        zfpName:null,
        zfiRate:null,
        zfiSignDate:[],
        zfiExpireDate:[],
        zfiCollectionAccount:null,
        zfiAmount:''

      };
      this.queryParams.startAmt = '';
      this.queryParams.endAmt = '';
      this.queryParamsSign.startAmt = '';
      this.queryParamsSign.endAmt = '';
      this.queryParamsFinancing.startAmt = '';
      this.queryParamsFinancing.endAmt = '';
      this.queryParamsOpening.startAmt = '';
      this.queryParamsOpening.endAmt = '';
      this.queryParamsFinanced.startAmt = '';
      this.queryParamsFinanced.endAmt = '';
      this.queryParamsInvalid.startAmt = '';
      this.queryParamsInvalid.endAmt = '';
      this.resetForm("form");
    },
    // 多选框选中数据
    handleSelectionChange(selection) {
      this.ids = selection.map(item => item.cifId)
      this.single = selection.length!==1
      this.multiple = !selection.length
    },
    /** 全部搜索按钮操作 */
    handleQuery() {
      this.queryParams.pageNum = 1;
      this.getList();
    },
    //待签收搜索
    handleQuerySign() {
      this.queryParamsSign.pageNum = 1;
      this.getListSign();
    },
    //融资中搜索
    handleQueryFinancing() {
      this.queryParamsFinancing.pageNum = 1;
      this.getListFinancing();
    },
    //开立中搜索
    handleQueryOpening() {
      this.queryParamsOpening.pageNum = 1;
      this.getListOpening();
    },
    //已融资搜索
    handleQueryFinanced() {
      this.queryParamsFinanced.pageNum = 1;
      this.getListFinanced();
    },
    //已失效搜索
    handleQueryInvalid() {
      this.queryParamsInvalid.pageNum = 1;
      this.getListInvalid();
    },
    /** 全部重置按钮操作 */
    resetQuery() {
      this.queryParams.startAmt = '';
      this.queryParams.endAmt = '';
      this.resetForm("queryForm");
      this.handleQuery();
    },
    //待签收重置
    resetQuerySign() {
      this.queryParamsSign.startAmt = '';
      this.queryParamsSign.endAmt = '';
      this.resetForm("queryFormSign");
      this.handleQuerySign();
    },
    //融资中重置
    resetQueryFinancing() {
      this.queryParamsFinancing.startAmt = '';
      this.queryParamsFinancing.endAmt = '';
      this.resetForm("queryFormFinancing");
      this.handleQueryFinancing();
    },
    //开立中重置
    resetQueryOpening() {
      this.queryParamsOpening.startAmt = '';
      this.queryParamsOpening.endAmt = '';
      this.resetForm("queryFormOpening");
      this.handleQueryOpening();
    },
    //已融资重置
    resetQueryFinanced() {
      this.queryParamsFinanced.startAmt = '';
      this.queryParamsFinanced.endAmt = '';
      this.resetForm("queryFormFinanced");
      this.handleQueryFinanced();
    },
    //已失效重置
    resetQueryInvalid() {
      this.queryParamsInvalid.startAmt = '';
      this.queryParamsInvalid.endAmt = '';
      this.resetForm("queryFormInvalid");
      this.handleQueryInvalid();
    },
    /** 新增按钮操作 */
    handleAdd() {
        this.reset();
        Cookies.set("/credit/addCredit/", this.$route.fullPath);
        this.$router.push({ path: "/credit/addCredit/" });
    },
    //详情
    handleDetail(row){
          const zfiId = row.zfiId || this.ids
          Cookies.set("/credit/creditDetail/"+zfiId + "/", this.$route.fullPath)
          this.$router.push({ path: "/credit/creditDetail/"+zfiId + "/" });
    },
    //修改
    handleUpdate(row){
          const zfiId = row.zfiId || this.ids;
          //获取融信类型
          const zfiCreateType = row.zfiCreateType;
          //核心开立
          if(zfiCreateType == '1'){
              Cookies.set("/credit/creditUpdate/"+zfiId + "/", this.$route.fullPath)
              this.$router.push({ path: "/credit/creditUpdate/"+zfiId + "/" });
          }else if(zfiCreateType == '2'){
              Cookies.set("/credit/financeOpenUpdate/"+zfiId + "/", this.$route.fullPath)
              this.$router.push({ path: "/credit/financeOpenUpdate/"+zfiId + "/" });
          }else if(zfiCreateType == '0'){
              Cookies.set("/credit/applyCreditEdit/"+zfiId + "/", this.$route.fullPath)
              this.$router.push({ path: "/credit/applyCreditEdit/"+zfiId + "/" });
          }

          
    },
    //审核
    handleApprove(row){
          const zfiId = row.zfiId || this.ids
          Cookies.set("/credit/confirmationAudit/"+zfiId + "/", this.$route.fullPath)
          this.$router.push({ path: "/credit/confirmationAudit/"+zfiId + "/" });
    },
    //补充资料
    handleAddInformation(row){
        const zfiId = row.zfiId || this.ids
        Cookies.set("/credit/addInformation/"+zfiId + "/", this.$route.fullPath)
        this.$router.push({ path: "/credit/addInformation/"+zfiId + "/" });
    },
    //签收
    handleSignFor(row){
        const zfiId = row.zfiId || this.ids
        Cookies.set("/credit/signFor/"+zfiId + "/", this.$route.fullPath)
        this.$router.push({ path: "/credit/signFor/"+zfiId + "/" });
    },
    //去融资
    handleGoFinance(row){
        const zfiId = row.zfiId || this.ids
        Cookies.set("/credit/goFinance/"+zfiId + "/", this.$route.fullPath)
        this.$router.push({ path: "/credit/goFinance/"+zfiId + "/" });
    },
    //盖章
    seal(row){
        const zfiId = row.zfiId || this.ids
        Cookies.set("/credit/creditSeal/"+zfiId + "/", this.$route.fullPath)
        this.$router.push({ path: "/credit/creditSeal/"+zfiId + "/" });
    },
    /**核心开立审批按钮操作*/
    handleExam(row){
      this.$confirm("是否确认提交开立审批?", "警告", {
          confirmButtonText: "确定",
          cancelButtonText: "取消",
          type: "warning"
        }).then(function() {
          return coreApproval(row);
        }).then(() => {
          this.getList();
          this.getListSign();
          this.getListFinancing();
          this.getListOpening();
          this.getListFinanced();
          this.getListInvalid();
          this.msgSuccess("提交审批成功");
        }).catch(() => {
          this.$message({
            type: "warning",
            message: "已取消提交审批",

          });
        });
    },
    //确权审批
    handleConfirmationExam(row){
      this.$confirm("是否确认提交确权审批?", "警告", {
          confirmButtonText: "确定",
          cancelButtonText: "取消",
          type: "warning"
        }).then(function() {
          return confirmationApproval(row);
        }).then(() => {
          this.getList();
          this.getListSign();
          this.getListFinancing();
          this.getListOpening();
          this.getListFinanced();
          this.getListInvalid();
          this.msgSuccess("提交审批成功");
        }).catch(() => {
          this.$message({
            type: "warning",
            message: "已取消提交审批",

          });
        });
    },
    //融资申请提交审批按钮
    handleApproval(row) {
      const zfiNumber = row.zfiNumber;
      this.$confirm(
        '是否确认提交审批融信编号为"' + zfiNumber + '"的数据项?',
        "警告",
        {
          confirmButtonText: "确定",
          cancelButtonText: "取消",
          type: "warning"
        }
      )
        .then(function() {
          //提交审批
          return approval(row);
        })
        .then(() => {
          this.getList();
          this.getListSign();
          this.getListFinancing();
          this.getListOpening();
          this.getListFinanced();
          this.getListInvalid();
          this.msgSuccess("提交审批成功");
        })
        .catch(() => {
          this.$message({
            type: "warning",
            message: "已取消提交审批"
          });
        });
    },
//融资开立提交审批按钮
    openApproval(row) {
      const zfiNumber = row.zfiNumber;
      this.$confirm(
        '是否确认提交审批融信编号为"' + zfiNumber + '"的数据项?',
        "警告",
        {
          confirmButtonText: "确定",
          cancelButtonText: "取消",
          type: "warning"
        }
      )
        .then(function() {
          //提交审批
          return openApproval(row);
        })
        .then(() => {
          this.getList();
          this.getListSign();
          this.getListFinancing();
          this.getListOpening();
          this.getListFinanced();
          this.getListInvalid();
          this.msgSuccess("提交审批成功");
        })
        .catch(() => {
          this.$message({
            type: "warning",
            message: "已取消提交审批"
          });
        });
    },
    //补充资料提交审批
    handleApprovals(row){
      const zfiNumber = row.zfiNumber;
      this.$confirm('是否确认提交审批融信编号为"' + zfiNumber + '"的数据项?', "警告",{
          confirmButtonText: "确定",
          cancelButtonText: "取消",
          type: "warning"
        }).then(function() {
          return informationApproval(row); 
        }).then(() => {
          this.getList();
          this.getListSign();
          this.getListFinancing();
          this.getListOpening();
          this.getListFinanced();
          this.getListInvalid();
          this.msgSuccess("提交审批成功");
        })
        .catch(() => {
          this.$message({
            type: "warning",
            message: "已取消提交审批",
           
          });
        });

    },
    //格式化类型
    typeFormat(row, column) {
      return this.selectDictLabel(this.typeOptions, row.zfiCreateType);
    },
    //格式化状态
    stateFormat(row, column) {
      return this.selectDictLabel(this.stateOptions, row.zfiStatus);
    },
    //格式化平台审批状态
    platformStatusFormat(row, column) {
      return this.selectDictLabel(this.platformOptions, row.zfiPlatformStatus);
    },
    //格式化核心审批
    coreStatusFormat(row, column) {
      return this.selectDictLabel(this.coreOptions, row.zfiCoreStatus);
    },
    //格式化融资方审批
    supplierStatusFormat(row, column) {
      return this.selectDictLabel(this.supplierOptions, row.zfiSupplierStatus);
    },
    //融资开立
    finanOpening(){
        this.reset();
        Cookies.set("/credit/financeOpen/", this.$route.fullPath);
        this.$router.push({ path: "/credit/financeOpen/" });
    },
    //融资申请
    apply(){
        this.reset();
        Cookies.set("/credit/creditApply/", this.$route.fullPath);
        this.$router.push({ path: "/credit/creditApply/" });
    },
    //拒签
    handleRefuse(row){
      const zfiNumber = row.zfiNumber ;
      this.$confirm('是否拒签融信编号为"' + zfiNumber + '"的数据项?', "警告",{
          confirmButtonText: "确定",
          cancelButtonText: "取消",
          type: "warning"
        }).then(function() {
          //拒签
          return creditRefuse(row); 
        }).then(() => {
          this.getList();
          this.getListSign();
          this.getListFinancing();
          this.getListOpening();
          this.getListFinanced();
          this.getListInvalid();
          this.msgSuccess("拒签成功");
        })
        .catch(() => {
          this.$message({
            type: "warning",
            message: "已取消",
           
          });
        });
    },
    //删除
    handleDelete(row){
        const zfiNumber = row.zfiNumber ;
        this.$confirm('是否删除融信编号为"' + zfiNumber + '"的数据项?', "警告",{
            confirmButtonText: "确定",
            cancelButtonText: "取消",
            type: "warning"
          }).then(function() {
            //删除
            return creditDel(row); 
          }).then(() => {
            this.getList();
            this.getListSign();
            this.getListFinancing();
            this.getListOpening();
            this.getListFinanced();
            this.getListInvalid();
            this.msgSuccess("删除成功");
          })
          .catch(() => {
            this.$message({
              type: "warning",
              message: "已取消",
            
            });
          });
    },
    //列表格式化金额
    moneyFormat(row, column, cellValue) {
        if(cellValue == null || cellValue== undefined || cellValue == ''){
            cellValue = '0.00'
        }
        cellValue += '';
        if (!cellValue.includes('.')) {
            cellValue += '.00';
        }
        return cellValue.replace(/(\d)(?=(\d{3})+\.)/g, function ($0, $1) {
            return $1 + ',';
          }).replace(/\.$/, '');
    },
    //input格式化金额
    amtFormat(cellValue) {
      if(cellValue == null || cellValue== undefined || cellValue == ''){
      cellValue = '0.00'
      }
      cellValue += '';
            if (!cellValue.includes('.')) {
      cellValue += '.00';
      }
      console.log(cellValue);
            return cellValue.replace(/(\d)(?=(\d{3})+\.)/g, function ($0, $1) {
              return $1 + ',';
            }).replace(/\.$/, '');
    },
    
    

  }
};
</script>