import request from '@/utils/request';


// 列表
export async function finPayablePageListAPI(data) {
  const res = await request.post(`/eom/finpayable/page` , data);
  if (res.data.code == 0) {
    return res.data.data;
  }
  return Promise.reject(new Error(res.data.message));
}


//保存收款记录
export async function finPayableSaveAPI(data) {
  const res = await request.post(`/eom/finpayable/saveDetail`, data);
  if (res.data.code == 0) {
    return res.data.data;
  }
  return Promise.reject(new Error(res.data.message));
}

// 信息
export async function getFinPayableInfoAPI(id) {
  const res = await request.get(`/eom/finpayable/getById/${id}`);
  if (res.data.code == 0) {
    return res.data.data;
  }
  return Promise.reject(new Error(res.data.message));
}

// 删除付款记录
export async function finPayableRemoveAPI(data) {
  const res = await request.delete('/eom/finpayable/deleteDetail', {data});
  if (res.data.code == 0) {
    return res.data;
  }
  return Promise.reject(new Error(res.data.message));
}

