import request from '@/utils/request'

// 标准配置清单-tree
export function getConfigTreeSelect(query) {
  return request({
    url: '/material/standardConfig/getConfigTreeSelect',
    method: 'get',
    params: query
  })
}

// 标准配置清单-tree新增
export function addConfig(data) {
  return request({
    url: '/material/standardConfig/add',
    method: 'post',
    data
  })
}

// 标准配置清单-tree修改
export function editConfig(data) {
  return request({
    url: '/material/standardConfig/edit',
    method: 'post',
    data
  })
}

// 标准配置清单-tree删除
export function delConfig(data) {
  return request({
    url: '/material/standardConfig/del',
    method: 'post',
    data
  })
}

// 标准配置清单-列表
export function getListByConfigId(query) {
  return request({
    url: '/material/standardConfig/getListByConfigId',
    method: 'get',
    params: query
  })
}

// 标准配置清单-select
export function getConfigList(data = {}) {
  return request({
    url: '/material/standardConfig/getConfigLevelTwoList',
    method: 'post',
    data
  })
}

// 物资名称-tree
export function getEquipmentThreeType(query) {
  return request({
    url: '/material/ma_type/equipmentThreeType',
    method: 'get',
    params: query
  })
}

// 物资名称-tree-3
export function getEquipmentThreeTypeThree() {
  return request({
    url: '/material/leaseTask/equipmentThreeType',
    method: 'get'
  })
}

// 规格型号-select
export function getMaTypeOpt(data) {
  return request({
    url: '/material/select/getMaType',
    method: 'post',
    data
  })
}

// 新增配置明细
export function addConfigDetails(data) {
  return request({
    url: '/material/standardConfig/addConfigDetails',
    method: 'post',
    data
  })
}

// 修改配置明细
export function editConfigDetails(data) {
  return request({
    url: '/material/standardConfig/editConfigDetails',
    method: 'post',
    data
  })
}

// 删除配置明细
export function delConfigDetails(data) {
  return request({
    url: '/material/standardConfig/delConfigDetails',
    method: 'post',
    data
  })
}

// 项目部管理-列表/ 班组下拉
export const getBmProDepartApi = data => {
  return request({
    url: '/material/bmProDepart/list',
    method: 'get',
    params: data
  })
}

// 项目部管理-新增
export const addBmProDepartApi = data => {
  return request({
    url: '/material/bmProDepart/add',
    method: 'post',
    data
  })
}

// 项目部管理-修改
export const editBmProDepartApi = data => {
  return request({
    url: '/material/bmProDepart/edit',
    method: 'post',
    data
  })
}

// 项目部管理-删除
export const delBmProDepartApi = data => {
  return request({
    url: '/material/bmProDepart/delete',
    method: 'post',
    data
  })
}

// 班组管理-列表
export const getBmTeamApi = data => {
  return request({
    url: '/material/bmTeam/list',
    method: 'get',
    params: data
  })
}

// 班组管理-列表-退料
export const getTeamListApi = data => {
  return request({
    url: '/material/bmTeam/getTeamList',
    method: 'get',
    params: data
  })
}

// 班组管理-新增
export const addBmTeamApi = data => {
  return request({
    url: '/material/bmTeam/add',
    method: 'post',
    data
  })
}

// 班组管理-修改
export const editBmTeamApi = data => {
  return request({
    url: '/material/bmTeam/edit',
    method: 'post',
    data
  })
}

// 班组管理-删除
export const delBmTeamApi = data => {
  return request({
    url: '/material/bmTeam/delete',
    method: 'post',
    data
  })
}

// 实施单位类型-列表
export function impUnitTypeList(query) {
  return request({
    url: '/system/dept/list',
    method: 'get',
    params: query
  })
}

//工程项目--新增
export function addProject(data) {
  return request({
    url: '/material/bm_project',
    method: 'post',
    data
  })
}

// 工程项目--删除
export function delProject(proId) {
  return request({
    url: '/material/bm_project/' + proId,
    method: 'delete'
  })
}

// 工程项目-列表
export function getProjectList(data) {
  return request({
    url: '/material/select/getProjectList',
    method: 'post',
    data
  })
}

// 获取i8工程类型
export function getI8ProjectList(params) {
  return request({
    url: '/material/bm_project/getProjectList',
    method: 'get',
    params
  })
}

// 工程项目详情
export function getProjectListDetail(id) {
  return request({
    url: '/material/bm_project/' + id,
    method: 'get'
  })
}

// 工程项目--修改
export function updateProject(data) {
  return request({
    url: '/material/bm_project',
    method: 'put',
    data
  })
}

// 工程管理下拉框
export function queryProDataApi(dictType) {
  return request({
    url: '/system/dict/data/type/' + dictType,
    method: 'get'
  })
}

//领料申请-列表
export function getListLeaseApply(query) {
  return request({
    url: '/material/material_lease_apply_info/list',
    method: 'get',
    params: query
  })
}

// 领料申请-详情信息
export function getApplyInfo(id) {
  return request({
    url: '/material/material_lease_apply_info/' + id,
    method: 'get'
  })
}

// 获取领料单
export function getPickListApi(data) {
  return request({
    url: '/material/material_lease_apply_info/getPickList',
    method: 'get',
    params: data
  })
}

// 领料申请-删除
export function applyRemove(data) {
  return request({
    url: '/material/material_lease_apply_info/delete',
    method: 'post',
    data
  })
}

// 获取机具类型树
export function equipmentTypeTree(data) {
  return request({
    url: '/material/material_lease_apply_info/equipmentType',
    method: 'post',
    data
  })
}

// 领料申请租赁工程下拉框
export function getListProject(data = {}) {
  return request({
    url: '/material/select/getProjectInfo',
    method: 'post',
    data
  })
}

// 领料申请-新增
export function addApplyInfo(data) {
  return request({
    url: '/material/material_lease_apply_info',
    method: 'post',
    data
  })
}

// 领料申请-编辑
export function updateApplyInfo(data) {
  return request({
    url: '/material/material_lease_apply_info',
    method: 'put',
    data
  })
}

// 领料申请获取协议单id
export function getAgreement(data) {
  return request({
    url: '/material/select/getAgreementInfoById',
    method: 'post',
    data
  })
}
export function getAgreementInfoByIdBackApi(data) {
  return request({
    url: '/material/select/getAgreementInfoByIdBack',
    method: 'post',
    data
  })
}

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

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

// 工器具领料记录-列表
export const getLeaseInfoDetailsApi = data => {
  return request({
    url: '/material/material_lease_apply_info/getLeaseInfoDetails',
    method: 'get',
    params: data
  })
}

// 工器具领料记录-合计
export const getLeaseInfoDetailsNoPageListApi = data => {
  return request({
    url: '/material/material_lease_apply_info/getLeaseInfoDetailsNoPageList',
    method: 'get',
    params: data
  })
}

// 工器具领料记录-详情
export const getSecondLeaseInfoApi = data => {
  return request({
    url: '/material/material_lease_apply_info/getSecondLeaseInfo',
    method: 'get',
    params: data
  })
}

// 领料申请租赁单位下拉框
export function getListUnite(data) {
  return request({
    url: '/material/select/getUnitList',
    method: 'post',
    data
  })
}

// 出库详情
export const getOutDetailsByIdApi = data => {
  return request({
    url: '/material/material_lease_apply_info/outDetailsById',
    method: 'get',
    params: data
  })
}

// 工器具退料记录-列表
export const getBackInfoDetailsApi = data => {
  return request({
    url: '/material/material_back_apply_info/getBackInfoDetails',
    method: 'get',
    params: data
  })
}

// 工器具退料记录-合计
export const getBackInfoDetailsNoPageListApi = data => {
  return request({
    url: '/material/material_back_apply_info/getBackInfoDetailsNoPageList',
    method: 'get',
    params: data
  })
}

// 工器具退料记录-详情
export const getSecondBackInfoApi = data => {
  return request({
    url: '/material/material_back_apply_info/getSecondBackInfo',
    method: 'get',
    params: data
  })
}

// 退料申请-列表
export function getBackApplyList(query) {
  return request({
    url: '/material/material_back_apply_info/list',
    method: 'get',
    params: query
  })
}

// 退料--删除
export function backApplyRemove(data) {
  return request({
    url: '/material/material_back_apply_info/deleteById',
    method: 'post',
    data
  })
}

// 退料提交
export function submitBackApply(data) {
  return request({
    url: '/material/material_back_apply_info/submitBackApply',
    method: 'post',
    data
  })
}

// 可退料设备类型-根据协议查询
export function getDeviceTreeByAgreementId(data) {
  return request({
    url: '/material/material_back_apply_info/getUseTypeTree',
    method: 'post',
    data
  })
}

// 退料新增
export function addBackApply(data) {
  return request({
    url: '/material/material_back_apply_info',
    method: 'post',
    data
  })
}

// 退料编辑
export function editBackApply(data) {
  return request({
    url: '/material/material_back_apply_info/edit',
    method: 'post',
    data
  })
}

// 新增编辑-编码类型-获取所有编码
export function getMachineById(query) {
  return request({
    url: '/material/material_back_apply_info/getMachineById',
    method: 'get',
    params: query
  })
}

// 查询详情
export function getBackApplyInfo(id) {
  return request({
    url: '/material/material_back_apply_info/' + id,
    method: 'get'
  })
}

// 更新打印状态
export function updatePrintStatus(id) {
  return request({
    url: '/material/material_back_apply_info/editPrint',
    method: 'post',
    data: { id: id }
  })
}

// 保有设备总量查询
export function getRetainedEquipmentListApi(query) {
  return request({
    url: '/material/material_maMachine/getRetainedEquipmentList',
    method: 'get',
    params: query
  })
}
export function getStoreNumAndUseListApi(query) {
  return request({
    url: '/material/material_maMachine/getStoreNumAndUseList',
    method: 'get',
    params: query
  })
}

// 保有设备总量查询-无分页
export function getRetainedEquipmentListNoPageApi(query) {
  return request({
    url: '/material/material_maMachine/getRetainedEquipmentListNoPage',
    method: 'get',
    params: query
  })
}

// 在用详情查询
export function getUserRecordListApi(query) {
  return request({
    url: '/material/material_maMachine/getUserRecordList',
    method: 'get',
    params: query
  })
}

// 在库详情查询
export function getStorageInfoListApi(query) {
  return request({
    url: '/material/material_maMachine/getStorageInfoList',
    method: 'get',
    params: query
  })
}

// 机具追溯-列表
export const getMachineInfoApi = data => {
  return request({
    url: '/material/material_maMachine/getMachineInfo',
    method: 'get',
    params: data
  })
}

// 设备类型
export const getLevelListApi = data => {
  return request({
    url: '/material/ma_type/getLevelList',
    method: 'get',
    params: data
  })
}

// 安全工器具预警-列表
export const getSafetyListApi = data => {
  return request({
    url: '/material/material_maMachine/getSafeDetailsList',
    method: 'get',
    params: data
  })
}

// 安全工器具预警数量展示
export const getSafeNumListApi = data => {
  return request({
    url: '/material/material_maMachine/getSafeNumList',
    method: 'get',
    params: data
  })
}

// 安全工器具
export const getAgreementIdApi = data => {
  return request({
    url: '/material/material_maMachine/getAgreementId',
    method: 'get',
    params: data
  })
}
// 班组库存日志-列表
export const getTeamNumListApi = data => {
  return request({
    url: '/material/material_maMachine/getTeamNumList',
    method: 'get',
    params: data
  })
}

// 班组库存日志二级页面-列表
export const getTeamNumSecondListApi = data => {
  return request({
    url: '/material/material_maMachine/getTeamNumSecondList',
    method: 'get',
    params: data
  })
}

// 班组库存日志二级页面-列表
export const getTeamNumSecondListNoPageApi = data => {
  return request({
    url: '/material/material_maMachine/getTeamNumSecondListNoPage',
    method: 'get',
    params: data
  })
}


// 班组库存日志三级页面-列表
export const getTeamNumThirdApi = data => {
  return request({
    url: '/material/material_maMachine/getTeamNumThirdList',
    method: 'get',
    params: data
  })
}

// 总站点领料-列表
export const getTotalListApi = data => {
  return request({
    url: '/material/material_lease_apply_info/getTotalList',
    method: 'get',
    params: data
  })
}

// 总站点领料-详情
export const getDetailsListApi = data => {
  return request({
    url: '/material/material_lease_apply_info/getDetailsList',
    method: 'get',
    params: data
  })
}

// 领料记录添加备注
export function addRemarkApi(data) {
  return request({
    url: '/material/material_lease_apply_info/addRemark',
    method: 'post',
    data
  })
}

// 总站点退料-列表
export const getBackTotalListApi = data => {
  return request({
    url: '/material/material_back_apply_info/getTotalList',
    method: 'get',
    params: data
  })
}

// 总站点退料-详情
export const getBackDetailsListApi = data => {
  return request({
    url: '/material/material_back_apply_info/getDetailsList',
    method: 'get',
    params: data
  })
}

// 领料出库-编码出库详情信息
export function getDetailsByTypeId(query) {
  return request({
    url: '/material/material_lease_apply_info/getMachineById',
    method: 'get',
    params: query
  })
}

// 根据用户名查询用户信息
export function getUserInfoByUserNameApi(data) {
  return request({
    url: '/material/app/iwsTeamUser/selectUserInfoByUserName',
    method: 'get',
    params: data
  })
}

// 根据身份证号查询用户信息
export function getUserInfoByIdCardApi(data) {
  return request({
    url: '/material/app/iwsTeamUser/selectProjectTeamInfoByIdCard',
    method: 'get',
    params: data
  })
}

// 获取工程ids
export function getProjectInfoApi(data) {
  return request({
    url: '/material/select/getProjectInfo',
    method: 'post',
    data
  })
}

// 获取项目信息
export function getProTotalListApi(data) {
  return request({
    url: '/material/material_maMachine/getTotalList',
    method: 'get',
    params: data
  })
}

// 班组进出场查询
export function getTeamInOrOutInfoApi(data) {
  return request({
    url: '/material/material_maMachine/getTeamInOrOutInfo',
    method: 'get',
    params: data
  })
}

// 材料站退料预约-列表
export function getBackApplyListApi(data) {
  return request({
    url: '/material/material_back_appointment/list',
    method: 'get',
    params: data
  })
}

// 材料站退料预约详情-列表
export function getUseTypeListApi(data) {
  return request({
    url: '/material/material_back_appointment/getUseTypeList',
    method: 'get',
    params: data
  })
}

// 退料单位-下拉
export function getProDepartmentByProApi(data) {
  return request({
    url: '/material/material_back_appointment/getProDepartmentByPro',
    method: 'get',
    params: data
  })
}

// 材料站退料预约-新增
export function addBackAppointmentApi(data) {
  return request({
    url: '/material/material_back_appointment/addBackAppointment',
    method: 'post',
    data
  })
}

// 材料站退料预约-编辑
export function editBackAppointmentApi(data) {
  return request({
    url: '/material/material_back_appointment/edit',
    method: 'post',
    data
  })
}

// 材料站退料预约-删除
export function deleteTask(data) {
  return request({
    url: '/material/material_back_appointment/deleteById',
    method: 'post',
    data
  })
}

// 材料站退料预约-详情
export function getListDetailsApi(data) {
  return request({
    url: '/material/material_back_appointment/getListDetails',
    method: 'get',
    params: data
  })
}

//分公司下拉
export function getImpUnitListApi(query) {
  return request({
    url: '/material/material_maMachine/getImpUnitNameList',
    method: 'get',
    params: query
  })
}

//项目部下拉
export function getDepartListByImpUnitApi(query) {
  return request({
    url: '/material/material_maMachine/getDepartNameList',
    method: 'get',
    params: query
  })
}

// 项目部下拉-工程联动
export function getPickDepartListApi(query) {
  return request({
    url: '/material/material_maMachine/getPickDepartList',
    method: 'get',
    params: query
  })
}

//工程下拉
export function getProListByDepartApi(query) {
  return request({
    url: '/material/material_maMachine/getProjectList',
    method: 'get',
    params: query
  })
}

//班组下拉
export function getTeamList(query) {
  return request({
    url: '/material/material_maMachine/getTeamList',
    method: 'get',
    params: query
  })
}

//分包单位下拉
export function getSubUnitList(query) {
  return request({
    url: '/material/material_maMachine/getSubUnitList',
    method: 'get',
    params: query
  })
}

// 获取领料单
export function getLeaseDataByCode(data) {
  return request({
    url: '/material/material_lease_apply_info/getLeaseDataByCode',
    method: 'get',
    params: data
  })
}

// 站内直转-列表
export function getUseDataApi(data) {
  return request({
    url: '/material/material_direct/getUseData',
    method: 'post',
    data
  })
}

// 站内直转-设备树
export function getUseThreeTreeApi(data) {
  return request({
    url: '/material/material_direct/getUseThreeTree',
    method: 'post',
    data
  })
}

// 站内直转-新增
export function addUseApi(data) {
  return request({
    url: '/material/material_direct/add',
    method: 'post',
    data
  })
}

// 站内直转审核
export function getUseListApi(data) {
  return request({
    url: '/material/material_direct/list',
    method: 'get',
    params: data
  })
}

// 站内直转-编辑详情
export function getInfoApi(query) {
  return request({
    url: '/material/material_direct/getInfo',
    method: 'get',
    params: query
  })
}

// 站内直转-编辑
export function editUseApi(data) {
  return request({
    url: '/material/material_direct/edit',
    method: 'post',
    data
  })
}

// 站内直转-删除
export function deleteUseApi(data) {
  return request({
    url: '/material/material_direct/delete',
    method: 'post',
    data
  })
}

// 站内直转-审核
export function directUpdateApi(data) {
  return request({
    url: '/material/material_direct/directUpdate',
    method: 'post',
    data
  })
}

// 供需平衡表-列表
export function getDemandAndSupplyApi(data) {
  return request({
    url: '/material/material_maMachine/getDemandAndSupply',
    method: 'get',
    params: data
  })
}

// 供需平衡表-合计
export function getDemandAndSupplyNoPageApi(data) {
  return request({
    url: '/material/material_maMachine/getDemandAndSupplyNoPage',
    method: 'get',
    params: data
  })
}

// 供需平衡表-在用
export function getUseDemandAndSupplyApi(data) {
  return request({
    url: '/material/material_maMachine/getUseDemandAndSupply',
    method: 'get',
    params: data
  })
}

// 直转单-签名
export function getApproveListApi(data) {
  return request({
    url: '/material/directRotation/getApproveList',
    method: 'get',
    params: data
  })
}


//材料站结算申请工程下拉
export function getClzProjectListApi(query) {
  return request({
    url: '/material/material_sltAgreementInfo/getClzProjectList',
    method: 'get',
    params: query
  })
}

//材料站结算申请班组下拉
export function getClzTeamListApi(query) {
  return request({
    url: '/material/material_sltAgreementInfo/getClzTeamList',
    method: 'get',
    params: query
  })
}
// 直转单-签名
export function getSignatureList(data) {
  return request({
    url: '/material/directRotation/getSignatureList',
    method: 'get',
    params: data
  })
}
