import request from '@/axios';

export const getList = (current, size, params) => {
  return request({
    url: '/blade-transport/customer-archive/list',
    method: 'get',
    params: {
      ...params,
      current,
      size,
    },
  });
};

export const getDetail = id => {
  return request({
    url: '/blade-transport/customer-archive/detail',
    method: 'get',
    params: {
      id,
    },
  });
};

export const submit = row => {
  return request({
    url: '/blade-transport/customer-archive/submit',
    method: 'post',
    data: row,
  });
};

export const submitApproval = id => {
  return request({
    url: '/blade-transport/customer-archive/submit-approval',
    method: 'post',
    params: {
      id,
    },
  });
};

export const withdrawApproval = id => {
  return request({
    url: '/blade-transport/customer-archive/withdraw-approval',
    method: 'post',
    params: {
      id,
    },
  });
};

export const approve = id => {
  return request({
    url: '/blade-transport/customer-archive/approve',
    method: 'post',
    params: {
      id,
    },
  });
};

export const reject = id => {
  return request({
    url: '/blade-transport/customer-archive/reject',
    method: 'post',
    params: {
      id,
    },
  });
};

export const changeStatus = (id, status) => {
  return request({
    url: '/blade-transport/customer-archive/status',
    method: 'post',
    params: {
      id,
      status,
    },
  });
};

export const remove = ids => {
  return request({
    url: '/blade-transport/customer-archive/remove',
    method: 'post',
    params: {
      ids,
    },
  });
};

export const getScoreTemplate = quantificationId => {
  return request({
    url: '/blade-transport/customer-archive/score-template',
    method: 'get',
    params: {
      quantificationId,
    },
  });
};
