import request from '@/router/axios';

export const getOrderList =
    (current, size, params) => {
      return request({
        url: '/api/jobslink-api/payment/businessOrder/manage/list',
        method: 'get',
        params: {
          ...params,
          current,
          size,
        }
      })
    }

export const getList =
    (payOrderId, payrollNo) => {
      return request({
        url: '/api/jobslink-api/payment/invoice/list',
        method: 'get',
        params: {
          payOrderId,
          payrollNo,
          current: 1,
          size: 2147483647,
        }
      })
    }

export const add =
    (data) => {
      return request(
          {url: '/api/jobslink-api/payment/invoice/save', method: 'post', data})
    }

export const remove =
    (invoiceNo) => {
      return request({
        url: '/api/jobslink-api/payment/invoice/remove',
        method: 'post',
        params: {invoiceNo}
      })
    }

export const getAddress =
    (id) => {
      return request({
        url: '/api/jobslink-api/tenant/fp/addressee/detail',
        method: 'get',
        params: {id}
      })
    }

export const update =
    (payOrderId) => {
      return request({
        url: '/api/jobslink-api/payment/businessOrder/update',
        method: 'post',
        data: {payOrderId, fpStatus: 1}
      })
    }

export const getTitleList =
    (current, size, params) => {
      return request({
        url: '/api/jobslink-api/tenant/fp/title/list',
        method: 'get',
        params: {
          ...params,
          current,
          size,
        }
      })
    }

export const getTitle =
    (id) => {
      return request({
        url: '/api/jobslink-api/tenant/fp/title/manage/detail',
        method: 'get',
        params: {id}
      })
    }

export const updateTitle = (data) => {
  return request(
      {url: '/api/jobslink-api/tenant/fp/title/update', method: 'post', data})
}
