import request from '@/utils/request'
//获取维修任务列表
export function getRepairTaskListApi(query) {
  return request({
    url: '/material/base/repair/getRepairTaskList',
    method: 'get',
    params: query
  })
}
//维修任务机具列表
export function getRepairMaTypeListApi(query) {
  return request({
    url: '/material/base/repair/getRepairMaTypeList',
    method: 'get',
    params: query
  })
}
//机具设备管理-列表
// export function listMaPartType(query) {
//   return request({
//     url: '/material/base/maPartType/list',
//     method: 'get',
//     params: query
//   })
// }
// //配件管理-列表
export function listPartType(query) {
  return request({
    url: '/material/base/maPartType/list',
    method: 'get',
    params: query
  })
}
// 单位下拉选
export function getUnitInfoSelectApi() {
  return request({
    url: '/material/base/bmUnitInfo/getUnitInfoSelect',
    method: 'get',
  })
}
//内部维修提交
//机具设备管理--新增
export function submitRepairApplyApi(data) {
  return request({
    url: '/material/base/repair/submitRepairApply',
    method: 'post',
    contentType: 'application/json',
    data: data
  })
}
// 用户下拉选
export function getUserSelectApi() {
  return request({
    url: '/system/user/getUserByRoleList',
    method: 'get',
  })
}
// 工程下拉选
export function getProjectSelectApi() {
  return request({
    url: '/material/base/bmProjectInfo/getProjectSelect',
    method: 'get',
  })
}
// 工程下拉选
export function getSupplierSelectApi() {
  return request({
    url: '/material/base/supplierInfo/getSupplierSelect',
    method: 'get',
  })
}
// 报废原因下拉选
export function getDictTypeApi() {
  return request({
    url: '/sgzb-system/dict/type/81',
    method: 'get',
  })
}

// 维修合格的数据提交
export function addFastRepairApplyApi(json) {
  return request({
    url: '/material/base/repair/fastRepairApply',
    method: 'post',
    // contentType: 'application/json',
    data: json
  })
}
// 完成维修的数据提交
export function addCompleteRepairApi(json) {
  return request({
    url: '/material/base/repair/completeRepair',
    method: 'post',
    // contentType: 'application/json',
    data: json
  })
}
// 提交审核的数据提交
export function addEndRepairTaskApi(json) {
  return request({
    url: '/material/base/repair/endRepairTask',
    method: 'post',
    // contentType: 'application/json',
    data: json
  })
}
// 工机具类型
export function listPartTypeApi() {
  return request({
    url: '/material/base/type/getMaTypeList',
    method: 'get',
  })
}
// 维修状态下拉选
export function getDicSelectApi(query) {
  return request({
    url: '/material/base/repair/getDicSelect',
    method: 'get',
    params: query
  })
}
// 规格型号下拉数
export function getMaTypeSelectApi(query) {
  return request({
    url: '/material/base/type/getMaTypeSelect',
    method: 'get',
    params: query
  })
}