<template>
  <div class="responsible-person-dialog">
    <el-form ref="ruleForm" :model="ruleForm" :rules="rules" label-position="top" class="rule-form-orange">
      <el-form-item label="身份类别" prop="arlpIdType">
        <el-select v-model="ruleForm.arlpIdType" :disabled="disabled" placeholder="请选择身份类别">
          <el-option
            v-for="item in constant.idType"
            :key="item.code"
            :label="item.name"
            :value="item.code"
          >
          </el-option>
        </el-select>
      </el-form-item>
      <el-form-item label="责任人名称" prop="arlpName">
        <el-input v-model="ruleForm.arlpName" :disabled="disabled" placeholder="请输入责任人名称" clearable />
      </el-form-item>
      <el-form-item label="责任人身份标识类型" prop="arlpCertType">
        <el-select v-model="ruleForm.arlpCertType" :disabled="disabled" placeholder="请选择责任人身份标识类型">
          <el-option
            v-for="item in arlpTypeList"
            :key="item.code"
            :label="item.name"
            :value="item.code"
          >
          </el-option>
        </el-select>
      </el-form-item>
      <el-form-item label="责任人身份标识号码" prop="arlpCertNum">
        <el-input v-model="ruleForm.arlpCertNum" :disabled="disabled" placeholder="请输入责任人身份标识号码" clearable />
      </el-form-item>
      <el-form-item label="联系方式" prop="responsiblePhone">
        <el-input v-model="ruleForm.responsiblePhone" :disabled="disabled" placeholder="请输入联系方式" clearable />
      </el-form-item>
      <el-form-item label="邮箱" prop="responsibleEmail">
        <el-input v-model="ruleForm.responsibleEmail" :disabled="disabled" placeholder="请输入邮箱" clearable />
      </el-form-item>
      <el-form-item label="上报方式" prop="responsibleReportMethod" style="width: 100%">
        <el-radio-group v-model="ruleForm.responsibleReportMethod" :disabled="disabled">
          <el-radio :label="1">A类</el-radio>
          <el-radio :label="0">B类</el-radio>
        </el-radio-group>
      </el-form-item>
      <el-form-item label="还款责任人类型" prop="arlpType">
        <el-select v-model="ruleForm.arlpType" :disabled="disabled" placeholder="请选择还款责任人类型">
          <el-option
            v-for="item in constant.quotaDisburseArlpType"
            :key="item.code"
            :label="item.name"
            :value="item.code"
          >
          </el-option>
        </el-select>
      </el-form-item>
      <el-form-item v-if="ruleForm.arlpType !== 'arlpType_GTJKR'" label="还款责任金额" prop="arlpAmt">
        <cy-amount-input v-model="ruleForm.arlpAmt" :disabled="disabled" placeholder="请输入还款责任金额" clearable />
      </el-form-item>
      <template v-if="ruleForm.arlpType === 'arlpType_BZR'">
        <el-form-item label="联保标识" prop="wartySign">
          <el-radio-group v-model="ruleForm.wartySign" :disabled="disabled">
            <el-radio :label="1">联保</el-radio>
            <el-radio :label="0">单人保证/多人分保</el-radio>
          </el-radio-group>
        </el-form-item>
        <el-form-item label="担保对象" prop="guaranteeObject">
          <el-input v-model="guaranteeObject" disabled placeholder="请输入担保对象" clearable />
          <!-- <el-select v-model="ruleForm.guaranteeObject" placeholder="请选择担保对象">
            <el-option
              v-for="item in [{value: '01', label: '债权人'},{value: '02', label: '债务人', }]"
              :key="item.value"
              :label="item.label"
              :value="item.value"
            >
            </el-option>
          </el-select> -->
        </el-form-item>
        <el-form-item label="住所地(身份证地址)" prop="address">
          <el-input v-model="ruleForm.address" :disabled="disabled" placeholder="请输入住所地(身份证地址)" clearable />
        </el-form-item>
        <el-form-item label="实际地址(实际住址)" prop="actualAddress">
          <el-input v-model="ruleForm.actualAddress" :disabled="disabled" placeholder="请输入实际地址(实际住址)" clearable />
        </el-form-item>
        <el-form-item v-if="ruleForm.arlpIdType === 'idType_2'" label="法定代表人" prop="legalRepresentative">
          <el-input v-model="ruleForm.legalRepresentative" :disabled="disabled" placeholder="请输入法定代表人" clearable />
        </el-form-item>
        <template v-if="ruleForm.arlpIdType === 'idType_1'">
          <el-form-item label="担保人证照正面" class="form-required">
            <cy-upload
              ref="guaranteeCardFrontFileStorage"
              :upload-params="{}"
              :file-data="guaranteeCardFrontFileStorage"
              :upload-from-orange-status="true"
              placeholder="请上传附件"
              :disabled="disabled"
            />
          </el-form-item>
          <el-form-item label="担保人证照反面" class="form-required">
            <cy-upload
              ref="guaranteeCardReverseFileStorage"
              :upload-params="{}"
              :file-data="guaranteeCardReverseFileStorage"
              :upload-from-orange-status="true"
              placeholder="请上传附件"
              :disabled="disabled"
            />
          </el-form-item>
          <el-form-item label="担保人配偶" prop="spouseName">
            <el-input v-model="ruleForm.spouseName" :disabled="disabled" placeholder="请输入担保人配偶" clearable />
          </el-form-item>
          <el-form-item
            label="配偶证件类型"
            prop="spouseCardType"
            :rules="[
              { required: ruleForm.spouseName != '', message: '请选择配偶证件类型', trigger:['blur', 'change'] }
            ]"
          >
            <el-select v-model="ruleForm.spouseCardType" :disabled="disabled" placeholder="请选择配偶证件类型">
              <el-option
                v-for="item in constant.certType"
                :key="item.code"
                :label="item.name"
                :value="item.code"
              >
              </el-option>
            </el-select>
          </el-form-item>
          <el-form-item
            label="配偶证件号码"
            prop="spouseIdCard"
            :rules="[
              { required: ruleForm.spouseName != '', message: '请选择配偶证件号码', trigger: ['blur', 'change'] }
            ]"
          >
            <el-input v-model="ruleForm.spouseIdCard" :disabled="disabled" placeholder="请输入配偶证件号码" clearable />
          </el-form-item>
          <el-form-item
            label="配偶联系方式"
            prop="spouseContactNumber"
            :rules="[
              { required: ruleForm.spouseName != '', message: '请选择配偶联系方式', trigger: ['blur', 'change'] }
            ]"
          >
            <el-input v-model="ruleForm.spouseContactNumber" :disabled="disabled" placeholder="请输入配偶联系方式" clearable />
          </el-form-item>
          <el-form-item label="配偶证照正面" :class="{'form-required': ruleForm.spouseName}">
            <cy-upload
              ref="spouseCardFrontFileStorage"
              :upload-params="{}"
              :file-data="spouseCardFrontFileStorage"
              :upload-from-orange-status="true"
              placeholder="请上传配偶证照正面"
              :disabled="disabled"
            />
          </el-form-item>
          <el-form-item label="配偶证照反面" :class="{'form-required': ruleForm.spouseName}">
            <cy-upload
              ref="spouseCardReverseFileStorage"
              :upload-params="{}"
              :file-data="spouseCardReverseFileStorage"
              :upload-from-orange-status="true"
              placeholder="请上传配偶证照反面"
              :disabled="disabled"
            />
          </el-form-item>
        </template>
        <el-form-item label="附件">
          <cy-upload
            ref="fileStorage"
            :upload-params="{}"
            :file-data="fileStorages"
            :upload-from-orange-status="true"
            placeholder="请上传附件"
            :disabled="disabled"
          />
        </el-form-item>
        <el-form-item label="担保函类型" prop="guaranteeClassify">
          <el-radio-group v-model="ruleForm.guaranteeClassify" :disabled="disabled">
            <el-radio :label="1">最高额保证合同</el-radio>
            <el-radio :label="0">常规担保函</el-radio>
          </el-radio-group>
        </el-form-item>
        <el-form-item label="是否有财产清单" prop="propertyList">
          <el-radio-group v-model="ruleForm.propertyList" :disabled="disabled">
            <el-radio :label="1">是</el-radio>
            <el-radio :label="0">否</el-radio>
          </el-radio-group>
        </el-form-item>
      </template>
    </el-form>
    <template v-if="ruleForm.propertyList === 1">
      <cy-info-title style="margin: 10px 0px 20px 0px">
        不动产清单（房产）
        <div v-if="!disabled" slot="right">
          <el-button type="text" @click="addClick('realEstateData')">新增</el-button>
        </div>
      </cy-info-title>
      <cy-comm-table
        ref="commTable"
        :columns="realEstateColumns"
        :data="realEstateData"
        :count="0"
      />
      <template v-if="ruleForm.arlpIdType === 'idType_2'">
        <cy-info-title style="margin: 20px 0px">
          不动产清单（土地）
          <div v-if="!disabled" slot="right">
            <el-button type="text" @click="addClick('realEstateLandData')">新增</el-button>
          </div>
        </cy-info-title>
        <cy-comm-table
          ref="commTable"
          :columns="realEstateLandColumns"
          :data="realEstateLandData"
          :count="0"
        />
      </template>
      <cy-info-title style="margin: 20px 0px">
        动产（车辆）清单
        <div v-if="!disabled" slot="right">
          <el-button type="text" @click="addClick('movableVehicleData')">新增</el-button>
        </div>
      </cy-info-title>
      <cy-comm-table
        ref="commTable"
        :columns="movableVehicleColumns"
        :data="movableVehicleData"
        :count="0"
      />
      <cy-info-title style="margin: 20px 0px">
        股权资产
        <div v-if="!disabled" slot="right">
          <el-button type="text" @click="addClick('stockRightData')">新增</el-button>
        </div>
      </cy-info-title>
      <cy-comm-table
        ref="commTable"
        :columns="stockRightColumns"
        :data="stockRightData"
        :count="0"
      />
      <cy-info-title style="margin: 20px 0px">
        其他资产
        <div v-if="!disabled" slot="right">
          <el-button type="text" @click="addClick('otherData')">新增</el-button>
        </div>
      </cy-info-title>
      <cy-comm-table
        ref="commTable"
        :columns="otherColumns"
        :data="otherData"
        :count="0"
      />
    </template>
  </div>
</template>

<script>
import { mapGetters } from 'vuex'
export default {
  props: {
    disabled: {
      type: Boolean,
      default: false
    },
    detailsInfo: {
      type: Object,
      default: () => {}
    },
    guaranteeObject: {
      type: String,
      default: ''
    }
  },
  data() {
    return {
      ruleForm: {},
      rules: {
        arlpIdType: [
          { required: true, message: '请选择身份类别', trigger: 'change' }
        ],
        arlpName: [
          { required: true, message: '请输入责任人名称', trigger: 'blur' }
        ],
        arlpCertType: [
          { required: true, message: '请选择责任人身份标识类型', trigger: 'change' }
        ],
        arlpCertNum: [
          { required: true, message: '请输入责任人身份标识号码', trigger: 'blur' }
        ],
        responsiblePhone: [
          { required: true, message: '请输入联系方式', trigger: 'blur' }
        ],
        responsibleReportMethod: [
          { required: true, message: '请选择上报方式', trigger: 'change' }
        ],
        arlpType: [
          { required: true, message: '请选择还款责任人类型', trigger: 'change' }
        ],
        arlpAmt: [
          { required: true, message: '请输入还款责任金额', trigger: 'blur' }
        ],
        wartySign: [
          { required: true, message: '请选择联保标识', trigger: 'change' }
        ],
        // guaranteeObject: [
        //   { required: true, message: '请选择担保对象', trigger: 'change' }
        // ],
        address: [
          { required: true, message: '请输入住所地(身份证地址)', trigger: 'blur' }
        ],
        actualAddress: [
          { required: true, message: '请输入实际地址(实际住址)', trigger: 'blur' }
        ],
        guaranteeClassify: [
          { required: true, message: '请选择担保函类型', trigger: 'change' }
        ],
        propertyList: [
          { required: true, message: '请选择是否有财产清单', trigger: 'change' }
        ]
      },
      guaranteeCardFrontFileStorage: [],
      guaranteeCardReverseFileStorage: [],
      spouseCardFrontFileStorage: [],
      spouseCardReverseFileStorage: [],
      fileStorages: [],
      realEstateData: [],
      realEstateLandData: [],
      movableVehicleData: [],
      stockRightData: [],
      otherData: []
    }
  },
  computed: {
    ...mapGetters(['constant']),
    arlpTypeList() {
      return this.constant.certType.filter(item => item.code.includes(this.ruleForm.arlpIdType))
    },
    realEstateColumns() {
      return [
        {
          label: '序号',
          index: true
        },
        {
          label: '房产地址及门牌号',
          prop: 'houseAddressDoorNumber',
          render: (h, row) => {
            return <el-input disabled={this.disabled} v-model={row.houseAddressDoorNumber} placeholder='请输入房产地址及门牌号'/>
          }
        },
        {
          label: '购买合同',
          prop: 'purchaseContract',
          render: (h, row) => {
            return <el-input disabled={this.disabled} v-model={row.purchaseContract} placeholder='请输入购买合同'/>
          }
        },
        {
          label: '房产证号',
          prop: 'housePropertyNo',
          render: (h, row) => {
            return <el-input disabled={this.disabled} v-model={row.housePropertyNo} placeholder='请输入房产证号'/>
          }
        },
        {
          label: '房产证号',
          prop: 'postName',
          render: (h, row) => {
            return (
              <el-radio-group disabled={this.disabled} v-model={row.loan}>
                <el-radio label={1}>是</el-radio>
                <el-radio label={0}>否</el-radio>
              </el-radio-group>)
          }
        },
        {
          label: '贷款余额（元）',
          prop: 'loanBalance',
          render: (h, row) => {
            return <el-input disabled={this.disabled} v-model={row.loanBalance} placeholder='请输入贷款余额'/>
          }
        },
        {
          label: '是否出租',
          prop: 'postName',
          render: (h, row) => {
            return (
              <el-radio-group disabled={this.disabled} v-model={row.rent}>
                <el-radio label={1}>是</el-radio>
                <el-radio label={0}>否</el-radio>
              </el-radio-group>)
          }
        },
        {
          label: '操作',
          show: !this.disabled,
          render: (h, row, index) => {
            const btnList = [
              {
                msg: '删除',
                category: 'delete'
              }
            ]
            const options = btnList.map(item => {
              return (
                <span class='table-icon-box' style='font-size: 12px;' onClick={() => { this.handlerOperate(index, 'realEstateData') }}>
                  { item.msg }
                </span>
              )
            })
            return <div>{ options }</div>
          },
          width: 130
        }
      ]
    },
    realEstateLandColumns() {
      return [
        {
          label: '序号',
          index: true
        },
        {
          label: '具体位置',
          prop: 'location',
          render: (h, row) => {
            return <el-input disabled={this.disabled} v-model={row.location} placeholder='请输入具体位置'/>
          }
        },
        {
          label: '土地证号或土地租地合同',
          prop: 'landNo',
          render: (h, row) => {
            return <el-input disabled={this.disabled} v-model={row.landNo} placeholder='请输入土地证号或土地租地合同'/>
          }
        },
        {
          label: '账面原值',
          prop: 'originalBookValue',
          render: (h, row) => {
            return <el-input disabled={this.disabled} v-model={row.originalBookValue} placeholder='请输入账面原值'/>
          }
        },
        {
          label: '面积',
          prop: 'area',
          render: (h, row) => {
            return <el-input disabled={this.disabled} v-model={row.area} placeholder='请输入面积'/>
          }
        },
        {
          label: '土地性质',
          prop: 'landNature',
          render: (h, row) => {
            return <el-input disabled={this.disabled} v-model={row.landNature} placeholder='请输入土地性质'/>
          }
        },
        {
          label: '抵押/按揭',
          prop: 'postName',
          render: (h, row) => {
            return (
              <el-radio-group disabled={this.disabled} v-model={row.mortgageInstallment}>
                <el-radio label='mortgage'>抵押</el-radio>
                <el-radio label='installment'>按揭</el-radio>
              </el-radio-group>)
          }
        },
        {
          label: '状况描述',
          prop: 'reamrk',
          render: (h, row) => {
            return <el-input disabled={this.disabled} v-model={row.reamrk} placeholder='请输入状况描述'/>
          }
        },
        {
          label: '操作',
          show: !this.disabled,
          render: (h, row, index) => {
            const btnList = [
              {
                msg: '删除',
                category: 'delete'
              }
            ]
            const options = btnList.map(item => {
              return (
                <span class='table-icon-box' style='font-size: 12px;' onClick={() => { this.handlerOperate(index, 'realEstateLandData') }}>
                  { item.msg }
                </span>
              )
            })
            return <div>{ options }</div>
          },
          width: 130
        }
      ]
    },
    movableVehicleColumns() {
      return [
        {
          label: '序号',
          index: true
        },
        {
          label: '名称型号及牌照号',
          prop: 'vehicleNameLicenseNo',
          render: (h, row) => {
            return <el-input disabled={this.disabled} v-model={row.vehicleNameLicenseNo} placeholder='请输入名称型号及牌照号'/>
          }
        },
        {
          label: '购买日期',
          prop: 'purchaseDate',
          render: (h, row) => {
            return <el-date-picker
              v-model={row.purchaseDate}
              disabled={this.disabled}
              type='datetime'
              value-format='yyyy-MM-dd'
              placeholder='请选择购买日期'>
            </el-date-picker>
          }
        },
        {
          label: '发动机号',
          prop: 'engineNo',
          render: (h, row) => {
            return <el-input disabled={this.disabled} v-model={row.engineNo} placeholder='请输入发动机号'/>
          }
        },
        {
          label: '行驶证号',
          prop: 'drivingLicenseNo',
          render: (h, row) => {
            return <el-input disabled={this.disabled} v-model={row.drivingLicenseNo} placeholder='请输入行驶证号'/>
          }
        },
        {
          label: '是否有贷款',
          prop: 'postName',
          render: (h, row) => {
            return (
              <el-radio-group disabled={this.disabled} v-model={row.name}>
                <el-radio label='pass'>抵押</el-radio>
                <el-radio label='back'>按揭</el-radio>
              </el-radio-group>)
          }
        },
        {
          label: '贷款余额（元）',
          prop: 'loanBalance',
          render: (h, row) => {
            return <el-input disabled={this.disabled} v-model={row.loanBalance} placeholder='请输入贷款余额（元）'/>
          }

        },
        {
          label: '操作',
          show: !this.disabled,
          render: (h, row, index) => {
            const btnList = [
              {
                msg: '删除',
                category: 'delete'
              }
            ]
            const options = btnList.map(item => {
              return (
                <span class='table-icon-box' style='font-size: 12px;' onClick={() => { this.handlerOperate(index, 'movableVehicleData') }}>
                  { item.msg }
                </span>
              )
            })
            return <div>{ options }</div>
          },
          width: 130
        }
      ]
    },
    stockRightColumns() {
      return [
        {
          label: '序号',
          index: true
        },
        {
          label: '被投资企业名称',
          prop: 'companyName',
          render: (h, row) => {
            return <el-input disabled={this.disabled} v-model={row.companyName} placeholder='请输入被投资企业名称'/>
          }

        },
        {
          label: '注册资金（元）',
          prop: 'registeredCapital',
          render: (h, row) => {
            return <el-input disabled={this.disabled} v-model={row.registeredCapital} placeholder='请输入注册资金'/>
          }
        },
        {
          label: '投资日期',
          prop: 'investmentDate',
          render: (h, row) => {
            return <el-date-picker
              v-model={row.investmentDate}
              type='datetime'
              value-format='yyyy-MM-dd'
              disabled={this.disabled}
              placeholder='请选择投资日期'>
            </el-date-picker>
          }
        },
        {
          label: '出资比例（%）',
          prop: 'ratio',
          render: (h, row) => {
            return <el-input disabled={this.disabled} v-model={row.ratio} placeholder='请输入出资比例'/>
          }
        },
        {
          label: '实物/现金出资（元）',
          prop: 'investmentAmount',
          render: (h, row) => {
            return <el-input disabled={this.disabled} v-model={row.investmentAmount} placeholder='请输入实物/现金出资'/>
          }
        },
        {
          label: '有无验收报告',
          prop: 'report',
          render: (h, row) => {
            return (
              <el-radio-group disabled={this.disabled} v-model={row.report}>
                <el-radio label={1}>有</el-radio>
                <el-radio label={0}>无</el-radio>
              </el-radio-group>)
          }
        },
        {
          label: '操作',
          show: !this.disabled,
          render: (h, row, index) => {
            const btnList = [
              {
                msg: '删除',
                category: 'delete'
              }
            ]
            const options = btnList.map(item => {
              return (
                <span class='table-icon-box' style='font-size: 12px;' onClick={() => { this.handlerOperate(index, 'stockRightData') }}>
                  { item.msg }
                </span>
              )
            })
            return <div>{ options }</div>
          },
          width: 130
        }
      ]
    },
    otherColumns() {
      return [
        {
          label: '序号',
          index: true
        },
        {
          label: '其他资产',
          prop: 'otherAssets',
          render: (h, row) => {
            return <el-input disabled={this.disabled} v-model={row.otherAssets} placeholder='请输入其他资产'/>
          }
        },
        {
          label: '操作',
          show: !this.disabled,
          render: (h, row, index) => {
            const btnList = [
              {
                msg: '删除',
                category: 'add'
              }
            ]
            const options = btnList.map(item => {
              return (
                <span class='table-icon-box' style='font-size: 12px;' onClick={() => { this.handlerOperate(index, 'otherData') }}>
                  { item.msg }
                </span>
              )
            })
            return <div>{ options }</div>
          },
          width: 130
        }
      ]
    }
  },
  watch: {
    'ruleForm.spouseName'() {
      if (this.ruleForm.spouseName === '') {
        this.$refs.ruleForm.clearValidate()
      }
    },
    detailsInfo: {
      handler(newV) {
        if (newV === undefined) return
        const {
          reviewRltRepayEstates,
          reviewRltRepayLands,
          reviewRltRepayVehicles,
          reviewRltRepayEquityAssets,
          reviewRltRepayOtherAssets,
          guaranteeCardFrontFileStorage,
          guaranteeCardReverseFileStorage,
          spouseCardFrontFileStorage,
          spouseCardReverseFileStorage,
          fileStorages

        } = JSON.parse(JSON.stringify(newV))
        this.ruleForm = {
          spouseName: '',
          ...JSON.parse(JSON.stringify(newV))
        }
        this.realEstateData = reviewRltRepayEstates || []
        this.realEstateLandData = reviewRltRepayLands || []
        this.movableVehicleData = reviewRltRepayVehicles || []
        this.stockRightData = reviewRltRepayEquityAssets || []
        this.otherData = reviewRltRepayOtherAssets || []
        this.guaranteeCardFrontFileStorage = this.getFileType(guaranteeCardFrontFileStorage)

        this.guaranteeCardReverseFileStorage = this.getFileType(guaranteeCardReverseFileStorage)

        this.spouseCardFrontFileStorage = this.getFileType(spouseCardFrontFileStorage)

        this.spouseCardReverseFileStorage = this.getFileType(spouseCardReverseFileStorage)

        this.fileStorages = fileStorages || []

        console.log(this.ruleForm, 999)
      },
      immediate: true,
      deep: true
    }
  },
  created() {
    this.$store.dispatch('getConstant', ['idType', 'certType', 'quotaDisburseArlpType'])
  },
  methods: {
    getFileType(type) {
      if (Object.prototype.toString.call(type) === '[object Object]') {
        return [type]
      } else if (Object.prototype.toString.call(type) === '[object Array]') {
        return type
      } else {
        return []
      }
    },
    addClick(type) {
      const obj = {
        realEstateData: {
          houseAddressDoorNumber: '',
          purchaseContract: '',
          housePropertyNo: '',
          loan: '',
          loanBalance: '',
          rent: '',
          id: ''
        },
        realEstateLandData: {
          location: '',
          landNo: '',
          originalBookValue: '',
          area: '',
          landNature: '',
          mortgageInstallment: '',
          reamrk: '',
          id: ''
        },
        movableVehicleData: {
          vehicleNameLicenseNo: '',
          purchaseDate: '',
          engineNo: '',
          drivingLicenseNo: '',
          loan: '',
          loanBalance: '',
          id: ''
        },
        stockRightData: {
          companyName: '',
          registeredCapital: '',
          investmentDate: '',
          ratio: '',
          investmentAmount: '',
          position: '',
          report: '',
          id: ''
        },
        otherData: {
          otherAssets: '',
          id: ''
        }
      }
      this[type].push(obj[type])
    },
    handlerOperate(index, type) {
      this[type].splice(index, 1)
    },
    getParams() {
      return new Promise((resolve, reject) => {
        this.$refs.ruleForm.validate(valid => {
          if (valid) {
            var params = {
              ...this.ruleForm,
              reviewRltRepayEstates: this.realEstateData,
              reviewRltRepayLands: this.realEstateLandData,
              reviewRltRepayVehicles: this.movableVehicleData,
              reviewRltRepayEquityAssets: this.stockRightData,
              reviewRltRepayOtherAssets: this.otherData,
              guaranteeObject: this.guaranteeObject
            }
            if (this.ruleForm.arlpType === 'arlpType_BZR') {
              params = {
                ...params,
                guaranteeCardFrontFileStorage: this.$refs.guaranteeCardFrontFileStorage && this.$refs.guaranteeCardFrontFileStorage.getFileLists || [],
                guaranteeCardReverseFileStorage: this.$refs.guaranteeCardReverseFileStorage && this.$refs.guaranteeCardReverseFileStorage.getFileLists || [],
                spouseCardFrontFileStorage: this.$refs.spouseCardFrontFileStorage && this.$refs.spouseCardFrontFileStorage.getFileLists || [],
                spouseCardReverseFileStorage: this.$refs.spouseCardReverseFileStorage && this.$refs.spouseCardReverseFileStorage.getFileLists || [],
                fileStorages: this.$refs.fileStorage && this.$refs.fileStorage.getFileLists || []
              }
              if (this.ruleForm.arlpIdType === 'idType_1') {
                if (!params.guaranteeCardFrontFileStorage.length) {
                  this.$message.warning('请上传担保人证照正面')
                  return
                }
                if (!params.guaranteeCardReverseFileStorage.length) {
                  this.$message.warning('请上传担保人证照反面')
                  return
                }
                if (this.ruleForm.spouseName) {
                  if (!params.spouseCardFrontFileStorage.length) {
                    this.$message.warning('请上传配偶证照正面')
                    return
                  }
                  if (!params.spouseCardReverseFileStorage.length) {
                    this.$message.warning('请上传配偶证照反面')
                    return
                  }
                }
              }
            }
            resolve(params)
          } else {
            reject()
            return
          }
        })
      })
    }
  }
}
</script>

<style lang="scss" scoped>

</style>
