import request from '@/utils/http/index';
// 资产列表
export const getCreditPage = (params) => {
  return request.get('/Loan/page', params);
};
// 资产列表
export const getCreditTotal = (params) => {
  return request.get('/Loan/total', params);
};
// 根据id获取资产详情
export const getCredit = (id) => {
  return request.get('/Loan/getById?id=' + id);
};
// 根据借款人查询所有的案件
export const listByBorrower = (id) => {
  return request.get('/Loan/listByBorrower?borrowerId=' + id);
};

// 根据借款人查询所有的跟进记录
export const getTrackRecordPage = (id) => {
  return request.get('/Loan/getTrackRecords?borrowerId=' + id);
};

// 根据借款人查询所有的减免记录
export const getReduces = (id) => {
  return request.get('/Loan/getReduces?borrowerId=' + id);
};

// 根据借款人查询所有的分期记录
export const getByStages = (id) => {
  return request.get('/Loan/getByStages?borrowerId=' + id);
};

// 根据借款人查询所有的联系人
export const getGuarantors = (id) => {
  return request.get('/Loan/getGuarantors?borrowerId=' + id);
};

// 根据借款人查询所有的还款记录
export const getRepayRecords = (id) => {
  return request.get('/Loan/getRepayRecords?borrowerId=' + id);
};

// 还款申请保存
export const saveRepayRecord = (data) => {
  return request.post('/repayRecord/save', data);
};
// 还款申请列表
export const getRepayRecordPage = (params) => {
  return request.get('/repayRecord/page', params);
};
export const getRepayRecordTotal = (params) => {
  return request.get('/repayRecord/flowStatusTotal', params);
};
// 还款申请批量
export const repayRecordFlowStatusByIds = (params) => {
  return request.get('/repayRecord/flowStatusByIds', params);
};

// 减免申请保存
export const saveReduce = (data) => {
  return request.post('/reduce/save', data);
};
// 减免申请列表
export const getReducePage = (params) => {
  return request.get('/reduce/page', params);
};
export const getReduceTotal = (params) => {
  return request.get('/reduce/flowStatusTotal', params);
};
// 减免申请批量
export const flowStatusByIds = (params) => {
  return request.get('/reduce/flowStatusByIds', params);
};

// 分期申请保存
export const savebyStages = (data) => {
  return request.post('/byStages/save', data);
};
// 分期审批修改金额
export const changeAmount = (data) => {
  return request.post('/byStages/changeAmount', data);
};
// 分期申请列表
export const getByStagesPage = (params) => {
  return request.get('/byStages/page', params);
};
// 分期申请列表
export const getByStagesTotal = (params) => {
  return request.get('/byStages/flowStatusTotal', params);
};
// 分期申请批量审核
export const byStagesflowStatusByIds = (params) => {
  return request.get('/byStages/flowStatusByIds', params);
};

// 保存案件跟踪记录
export const saveTrackRecord = (data) => {
  return request.post('/TrackRecord/save', data);
};
// 案件跟踪记录列表
export const getTrackRecord = (params) => {
  return request.get('/TrackRecord/page', params);
};
// 案件跟踪记录列表
export const getTrackRecordTotal = (params) => {
  return request.get('/TrackRecord/flowStatusTotal', params);
};
// 案件跟踪记录统计
export const getTrackRecordAuditTotal = (params) => {
  return request.get('/TrackRecord/auditStatusTotal', params);
};
// 联络人修复申请
export const saveRepairRecord = (data) => {
  return request.post('/RepairRecord/save', data);
};
// 联络人修复记录列表
export const getRepairRecord = (params) => {
  return request.get('/RepairRecord/page', params);
};
export const getRepairRecordTotal = (params) => {
  return request.get('/RepairRecord/flowStatusTotal', params);
};
export const importExcel = (params) => {
  return request.get('/RepairRecord/importExcel', params);
};
// 修复记录批量审批
export const RepairRecordStatusByIds = (params) => {
  return request.get('/RepairRecord/flowStatusByIds', params);
};
// 发起修复
export const sendRepairRecord = (params) => {
  return request.get('/RepairRecord/sendRepairRecord', params);
};
