import request from '@/utils/request'

// 查询挂架位置详情列表
export function listDetail(query) {
  return request({
    url: '/mapi/cloth/detail/list',
    method: 'get',
    params: query
  })
}

// 查询挂架位置详情详细
export function getDetail(id) {
  return request({
    url: '/mapi/cloth/detail/' + id,
    method: 'get'
  })
}

// 新增挂架位置详情
export function addDetail(data) {
  return request({
    url: '/mapi/cloth/detail',
    method: 'post',
    data: data
  })
}

// 修改挂架位置详情
export function updateDetail(data) {
  return request({
    url: '/mapi/cloth/detail',
    method: 'put',
    data: data
  })
}

// 删除挂架位置详情
export function delDetail(id) {
  return request({
    url: '/mapi/cloth/detail/' + id,
    method: 'delete'
  })
}


// 修改挂架位置详情状态
export function updateDetailStatus(id,status) {
  const data = {
    id,
    status
  }
  return request({
    url: '/mapi/cloth/detail/updateStatus',
    method: 'post',
    data: data
  })
}
// 查询挂架位置详情列表
export function getIsHangerList(hangerId) {
  return request({
    url: '/mapi/cloth/detail/getIsHangerList',
    method: 'get',
    params: { hangerId: hangerId }
  })
}

// 查询挂架位置详情列表
export function getClothOrderInfoByHangerCodeAndId(hangerId, code) {
  return request({
    url: '/mapi/cloth/detail/getClothOrderInfoByHangerCodeAndId',
    method: 'get',
    params: {
      hangerId: hangerId ,
      hangerCode: code
    }
  })
}


// 上挂
export function upHanger(orderClothItemId, hangerId, code) {
  return request({
    url: '/mapi/cloth/detail/upHanger',
    method: 'get',
    params: {
      orderClothItemId:orderClothItemId,
      hangerId: hangerId ,
      hangerCode: code
    }
  })
}

// 查询挂架位置详情
export function getHangerInfoByHangerCodeAndId(hangerId, code) {
  return request({
    url: '/mapi/cloth/detail/getHangerInfoByHangerCodeAndId',
    method: 'get',
    params: {
      hangerId: hangerId ,
      hangerCode: code
    }
  })
}
