import request from '@/utils/request'

// 获取标准配置下拉
export function getStandardConfigList(data = {}) {
    return request({
        url: '/material/select/getConfigList',
        method: 'post',
        data
    })
}

// 获取当前标准配置-列表
export function getListsByConfigId(query) {
    return request({
        url: '/material/standardConfig/getListsByConfigId',
        method: 'get',
        params: query
    })
}

// 领用申请
export function addLeaseTask(data) {
    return request({
        url: '/material/leaseTask',
        method: 'post',
        data
    })
}

// 领用申请-编辑
export function editLeaseTask(data) {
    return request({
        url: '/material/leaseTask',
        method: 'put',
        data
    })
}

// 领用记录查询-列表
export function getLeaseTaskList(query) {
    return request({
        url: '/material/leaseTask/list',
        method: 'get',
        params: query
    })
}

// 领用记录编辑/查看-详情
export function getLeaseTaskDetail(id) {
    return request({
        url: '/material/leaseTask/' + id,
        method: 'get'
    })
}

// 领用记录-删除
export function deleteLeaseTask(id) {
    return request({
        url: '/material/leaseTask/' + id,
        method: 'delete'
    })
}

// 根据协议id查再用列表
export function getUseringData(query) {
    return request({
        url: '/material/directRotation/getUseringData',
        method: 'get',
        params: query
    })
}

// 领用申请提交-新增
export function receiveSubmit(data) {
    return request({
        url: '/material/directRotation/submitNew',
        method: 'post',
        data
    })
}

// 领用申请提交-新增
export function receiveSubmitTwo(data) {
    return request({
        url: '/material/directRotation/submit',
        method: 'post',
        data
    })
}

// 领用申请提交-编辑
export function receiveEdit(data) {
    return request({
        url: '/material/directRotation/edit',
        method: 'post',
        data
    })
}

// 领用申请提交-详情
export function receiveDetail(query) {
    return request({
        url: '/material/directRotation/getInfo',
        method: 'get',
        params: query
    })
}

// 领用申请提交-删除
export function receiveDelete(id) {
    return request({
        url: '/material/directRotation/' + id,
        method: 'delete'
    })
}

// 领用申请查询-列表
export function getReceiveList(query) {
    return request({
        url: '/material/directRotation/list',
        method: 'get',
        params: query
    })
}

// 物资类型-3级tree
export function getEquipmentThreeTypes(query) {
    return request({
        url: '/material/ma_type/equipmentThreeTypes',
        method: 'get',
        params: query
    })
}

// 业务单号
export function getCode() {
    return request({
        url: '/material/leaseTask/getCode',
        method: 'get'
    })
}

// 结算记录查询-列表
export function getSltRecord(query) {
    return request({
        url: '/material/sltRecordQuery/getList',
        method: 'get',
        params: query
    })
}

// 结算记录查询-详情
export function getSltRecordInfo(data) {
    return request({
        url: '/material/slt_agreement_info/getSltRecordDetailsList',
        method: 'post',
        data
    })
}

// 减免记录查询-列表
export function getReliefRecordList(query) {
    return request({
        url: '/material/derateRecordQuery/getList',
        method: 'get',
        params: query
    })
}

// 减免记录-删除
export function deleteRedif(id) {
    return request({
        url: '/material/derateRecordQuery/' + id,
        method: 'delete'
    })
}

// 直转审核-列表
export function getDirectAuditListApi(query) {
    return request({
        url: '/material/directAudit/list',
        method: 'get',
        params: query
    })
}

// 直转审核-详情
export function getInfoById(query) {
    return request({
        url: '/material/directAudit/getInfoById',
        method: 'get',
        params: query
    })
}

// 直转审核-流程信息
export function getAuditInfo(query) {
    return request({
        url: '/material/directAudit/getAuditInfo',
        method: 'get',
        params: query
    })
}

// 直转审核-审核
export function auditDir(data) {
    return request({
        url: '/material/directAudit/auditDir',
        method: 'post',
        data
    })
}

// 业务联系单
export function getLeaseTask(id) {
    return request({
        url: '/material/leaseTask/' + id,
        method: 'get'
    })
}

// 业务联系单-pdf
export function getCodePDF(id) {
    return request({
        url: `/material/leaseTask/getCodePDF/${id}`,
        method: 'get'
    })
}

// 撤回
export function revokeApi(data) {
    return request({
        url: '/material/leaseTask/revoke',
        method: 'get',
        params: data
    })
}


// 根据协议id查编码在用列表
export function getUseringLoseData(query) {
    return request({
        url: '/material/LossAssign/getUseData',
        method: 'get',
        params: query
    })
}

// 报备丢失物资类型-3级tree
export function getEquipmentLoseThreeTypes(query) {
    return request({
        url: '/material/LossAssign/equipmentThreeTypes',
        method: 'get',
        params: query
    })
}

// 报备丢失申请提交-新增
export function receiveLoseSubmitTwo(data) {
    return request({
        url: '/material/LossAssign/add',
        method: 'post',
        data
    })
}

// 报备丢失审核-列表
export function getLoseAuditListApi(query) {
    return request({
        url: '/material/LossAssign/list',
        method: 'get',
        params: query
    })
}

// 报备丢失申请提交-详情
export function getLoseDetail(query) {
    return request({
        url: '/material/LossAssign/getInfo',
        method: 'get',
        params: query
    })
}

// 报备丢失申请提交-编辑
export function receiveLoseEdit(data) {
    return request({
        url: '/material/LossAssign/edit',
        method: 'post',
        data
    })
}

// 报备丢失申请提交-删除
export function receiveLoseDelete(data) {
    return request({
        url: '/material/LossAssign/delete',
        method: 'post',
        data
    })
}

// 业务联单下拉框
export function getBusinessCodeList(query) {
  return request({
    url: '/material/directRotation/getCodeList',
    method: 'get',
    params: query
  })
}