import request from '@/utils/require'
import { cwbb,baseServer,dict,irpt } from '@/api/index'
//列表页
export function financeReportPage(data) {
    return request({
      url: `${cwbb}/finance-report/${data.type}/page/${data.pageNum}/${data.pageSize}`,
      method: 'post',
      data:data
    })
  }

  //新增财务报表
  // /finance-report/{type}/save
  export function financeReportSave(type,data) {
      return request({
        url: `${cwbb}/finance-report/${type}/save`,
        method: 'post',
        data:data
      })
    }
//修改报表
  export function financeReportUpdate(type,data) {
      return request({
        url: `${cwbb}/finance-report/update`,
        method: 'post',
        data:data
      })
    }
//查看详情
 export function financeReportInfo(data) {
      return request({
        url: `${cwbb}/finance-report/info/${data.id}`,
        method: 'get'
      })
    }

//删除
export function financeReportDelete(data) {
      return request({
        url: `${cwbb}/finance-report/delete/${data.id}`,
        method: 'delete'
      })
    }


//承储企业列表
export function enterpriseList() {
  return request({
    url: `${cwbb}/enterprise/enterprise/list`,
    method: 'post',
    data: {}
  })
}
//承储企业列表-分页
export function enterprisePage(data) {
  return request({
    url: `${cwbb}/enterprise/enterprise/page/${data.pageNum}/${data.pageSize}`,
    method: 'post',
    data: {}
  })
}
//承储企业列表
export function enterpriseSort(data) {
  return request({
    url: `${cwbb}/enterprise/sort/${data.enterpriseCode}/${data.startIndex}/${data.endIndex}`,
    method: 'post',
    // data:{}
  })
}
//库点下拉
export function selectkdxxList() {
  return request({
      url: `${baseServer}/sinkpointList`,
      method: 'post',
      data: {}
  })
}
//添加库点接口
export function enterpriseSave(data) {
  return request({
    url: `${cwbb}/enterprise/enterprise/save`,
    method: 'post',
    data: data
  })
}
//修改库点接口
export function enterpriseUpdate(data) {
  return request({
    url: `${cwbb}/enterprise/enterprise/update`,
    method: 'put',
    data: data
  })
}
//删除
export function enterpriseDelete(ccqybm) {
  return request({
    url: `${cwbb}/enterprise/enterprise/delete/${ccqybm}`,
    method: 'delete',
  })
}

//市级储备粮油储存费用补贴标准-列表查询接口
export function subsidyList(data) {
  return request({
    url: `${cwbb}/subsidy-standard/list`,
    method: 'post',
    data:data
  })
}
//市级储备粮油储存费用补贴标准-分页列表查询接口
// export function subsidyList(data) {
//   return request({
//     url: `${cwbb}/subsidy-standard/page/${data.pageNum}/${data.pageSize}`,
//     method: 'post',
//     data:{}
//   })
// }
//新增接口
export function subsidySave(data) {
  return request({
    url: `${cwbb}/subsidy-standard/save`,
    method: 'post',
    data:data
  })
}
//修改接口
export function subsidyUpdate(data) {
  return request({
    url: `${cwbb}/subsidy-standard/update`,
    method: 'put',
    data: data,
  })
}

// 财务报表-报表类型
export function findReport() {
  return request({
    url: `${dict}/dataDictionary/getDataGroupId/CWBBLX`,
    method: 'get'
  })
}
// 财务报表-补贴类型
export function findSubsidy() {
  return request({
    url: `${dict}/dataDictionary/getDataGroupId/CWBBFLLX`,
    method: 'get'
  })
}
//进销存接口
//列表
export function purchaseStockList(data) {
  return request({
    url: `${cwbb}/reserve-report/purchase-stock/list/${data.pageNum}/${data.pageSize}`,
    method: 'post',
    data:data
  })
}
//查看详情

export function reserveReportInfo(data) {
  return request({
    url: `${cwbb}/reserve-report/purchase-stock/info/${data.psId}`,
    method: 'get'
  })
}
//进销存报表接收/撤销
export function purchaseStockUpdate(data,type) {
  return request({
    url: `${cwbb}/reserve-report/purchase-stock/update/${type}`,
    method: 'put',
    data:data
  })
}
//管理端--补贴列表

export function storageSubsidyList(data) {
  return request({
    url: `${cwbb}/reserve-report/storage-subsidy/list/${data.pageNum}/${data.pageSize}`,
    method: 'post',
    data:data
  })
}
//进销存汇总页列表
export function purchaseStockSummaryPage(data) {
    return request({
      url: `${cwbb}/reserve-report/purchase-stock/summary/page/${data.pageNum}/${data.pageSize}`,
      method: 'post',
      data:data
    })
  }
//补贴汇总页列表
export function storageSubsidySummaryPage(data) {
    return request({
      url: `${cwbb}/reserve-report/storage-subsidy/summary/page/${data.pageNum}/${data.pageSize}`,
      method: 'post',
      data:data
    })
  }
  
// /reserve-report/storage-subsidy/info/{ssId}
  export function storageSubsidyInfo(data) {
    return request({
      url: `${cwbb}/reserve-report/storage-subsidy/info/${data.ssId}`,
      method: 'get'
    })
  }
  //补贴报表接收/撤销
  export function storageSubsidyUpdate(data,type) {
    return request({
      url: `${cwbb}/reserve-report/storage-subsidy/update/${type}`,
      method: 'put',
      data:data
    })
  }
  //进销存汇总表
  // /reserve-report/purchase-stock/summary/generate/{period}/{dataType}
  export function purchaseStockgenerate(data) {
    return request({
      url: `${cwbb}/reserve-report/purchase-stock/summary/generate/${data.dataType}`,
      method: 'get'
    })
  }
 // /reserve-report/purchase-stock/summary/save
 //储存费补贴保存---进销存
export function purchaseStockSummarySave(data) {
    return request({
        url: `${cwbb}/reserve-report/purchase-stock/summary/save`,
        method: 'post',
        data:data
    })
}

export function storageSubsidygenerate(data) {
    return request({
      url: `${cwbb}/reserve-report/storage-subsidy/summary/generate?dataType=${data.dataType}`,
      method: 'get',
	  data:data
    })
  }
  
  export function purchaseStocksummaryInfo(data) {
    return request({
      url: `${cwbb}/reserve-report/purchase-stock/summary/info`,
      method: 'post',
	  data:data
    })
  }
// /reserve-report/purchase-stock/summary/update
export function purchaseStockSummaryUpdate(data) {
    return request({
        url: `${cwbb}/reserve-report/purchase-stock/summary/update`,
        method: 'post',
        data:data
    })
}
//储存费汇总删除--进销存
// /reserve-report/purchase-stock/summary/delete/{id}
export function purchaseStockSummaryDelete(data) {
    return request({
        url: `${cwbb}/reserve-report/purchase-stock/summary/delete/${data.id}`,
        method: 'delete',
        data:data
    })
}
//储存费补贴保存---补贴
// /reserve-report/storage-subsidy/summary/save
export function storageSubsidySummarySave(data) {
    return request({
        url: `${cwbb}/reserve-report/storage-subsidy/summary/save`,
        method: 'post',
        data:data
    })
}
//储存费汇总补贴 -- 详情
// /reserve-report/storage-subsidy/summary/info/{id}
export function storageSummaryInfo(data) {
    return request({
      url: `${cwbb}/reserve-report/storage-subsidy/summary/info/${data.id}`,
      method: 'get'
    })
  }
//储存费汇总删除--补贴
  // /reserve-report/storage-subsidy/summary/delete/{id}
export function storageSummaryDelete(data) {
    return request({
        url: `${cwbb}/reserve-report/storage-subsidy/summary/delete/${data.id}`,
        method: 'delete',
        data:data
    })
}
//调节储备汇总补贴 -- 审批
// reserve-report/storage-subsidy/summary/update/{type}
 export function storageSubsidySummaryUpdate(data,type) {
    return request({
      url: `${cwbb}/reserve-report/storage-subsidy/summary/update/${type}`,
      method: 'put',
      data:data
    })
  }