import { config, networkUtils } from '../../utils';

const { request } = networkUtils;
const { api } = config;
const { rfq } = api;
const { compare } = rfq;

export async function query(params: object) {
    return request({
        url: `${compare}/audit`,
        method: 'get',
        data: params,
    });
}

export async function getCreateDetial(params: object) {
  return request({
    url: `${compare}/create/detail`,
    method: 'get',
    data: params,
  });
}

export async function getAuditDetial(params: object) {
    return request({
        url: `${compare}/audit/detail`,
        method: 'get',
        data: params,
    });
}

//获取动态表单配置信息
export async function remoteCfg(params: object) {
    return request({
        url: `${compare}/config`,
        method: 'get',
        data: params,
    })
}

//提交，第一次为创建，之后为更新操作
export async function submit(params: object) {
    return request({
        url: `${compare}/saveOrSubmit`,
        method: 'post',
        data: params,
    })
}

//获取替代料信息
export async function substitutes(params: object) {
    return request({
        url: `${compare}/substitutes`,
        method: 'get',
        data: params,
    })
}

//删除流程
export async function deleteProcess(params: object) {
    return request({
        url: `${compare}/delete`,
        method: 'post',
        data: params,
    })
}

//批量审批
export async function batchApprove(params: object) {
  return request({
    url: `${compare}/batchApprove`,
    method: 'post',
    data: params,
  })
}
