import request from '@/utils/request'

export function outFactory(data) {
    return request({
        url: '/mapi/order/clothItem/outFactory',
        method: 'post',
        data: data
    })
}

export function findOutFactoryPageByFlowStatus(data) {
    return request({
        url: '/mapi/order/clothItem/findOutFactoryPageByFlowStatus',
        method: 'post',
        data: data
    })
}

export function setClothProblem(query) {
    return request({
        url: '/mapi/order/clothItem/setClothProblem',
        method: 'post',
        params: query
    })
}

export function checkCloth(query) {
    return request({
        url: '/mapi/order/clothItem/checkCloth',
        method: 'get',
        params: query
    })
}

export function rewashCloth(query) {
    return request({
        url: '/mapi/order/clothItem/rewashCloth',
        method: 'get',
        params: query
    })
}

export function inFactory(query) {
    return request({
        url: '/mapi/order/clothItem/inFactory',
        method: 'get',
        params: query
    })
}
//一键入厂
export function oneInFactory(query) {
  return request({
    url: '/mapi/order/clothItem/oneInFactory',
    method: 'get',
    params: query
  })
}

export function deleteInFactory(query) {
    return request({
        url: '/mapi/order/clothItem/deleteInFactory',
        method: 'get',
        params: query
    })
}


export function cancelOrderInFactory(query) {
  return request({
    url: '/mapi/order/clothItem/cancelOrderInFactory',
    method: 'get',
    params: query
  })
}

export function reFlowClothByStore(query) {
  return request({
    url: '/mapi/order/clothItem/reFlowClothByStore',
    method: 'get',
    params: query
  })
}



// 查询洗衣订单衣服明细列表
export function listOrderClothItem(query) {
    return request({
        url: '/mapi/order/clothItem/list',
        method: 'get',
        params: query
    })
}

// 查询洗衣订单衣服明细列表
export function getOrderClothDetail(orderSn) {
    return request({
        url: '/mapi/order/cloth/detail/'+orderSn,
        method: 'get'
    })
}

// 查询洗衣订单衣服明细详细
export function getClothItem(id) {
    return request({
        url: '/mapi/order/clothItem/' + id,
        method: 'get'
    })
}

// 新增洗衣订单衣服明细
export function addClothItem(data) {
    return request({
        url: '/mapi/order/clothItem',
        method: 'post',
        data: data
    })
}

// 修改洗衣订单衣服明细
export function updateClothItem(data) {
    return request({
        url: '/mapi/order/ClothItem',
        method: 'put',
        data: data
    })
}

// 删除洗衣订单衣服明细
export function delClothItem(id) {
    return request({
        url: '/mapi/order/ClothItem/' + id,
        method: 'delete'
    })
}

// 修改洗衣订单衣服明细状态
export function updateClothItemStatus(id, status) {
    const data = {
        id,
        status
    }
    return request({
        url: '/mapi/order/ClothItem/updateStatus',
        method: 'post',
        data: data
    })
}

// 查询洗衣订单-待上挂衣服列表
export function getOrderClothItemListByUpHanger(query) {
    return request({
        url: '/mapi/order/clothItem/getOrderClothItemListByUpHanger',
        method: 'get',
        params: query
    })
}

// 重洗衣服
export function reFlowCloth(orderClothItemId) {
    return request({
        url: '/mapi/order/clothItem/reFlowCloth',
        method: 'get',
        params: { orderClothItemId: orderClothItemId }
    })
}

// 充值打印
export function printRecharge(id) {
    return request({
        url: `/mapi/recharge/order/print/${id}`,
        method: 'get',
    })
}

// 洗衣打印
export function printCloth(id) {
    return request({
        url: `/mapi/order/cloth/print/${id}`,
        method: 'get',
    })
}

// 商品打印
export function printGoods(id) {
    return request({
        url: `/mapi/order/goods/print/${id}`,
        method: 'get',
    })
}
