/*
 * @Author: micky
 * @Date: 2024-08-15 15:02:28
 * @LastEditors: micky
 * @LastEditTime: 2024-10-28 17:21:37
 * @FilePath: \chargingpile-uniapp\src\api\repair.ts
 */
import request from '@/utils/request'

// 维修单列表
export const apiRepairList = (params: any) => {
    return request.get({ url: '/order/parentRepairOrder/list', data: params })
}
export const apiRepairStaffList = (params: any) => {
    return request.get({ url: '/order/repairOrder/repairModulePageList', data: params })
}

// 维修单绑定维修员
export const apiBind = (params: any) => {
    return request.post({ url: '/order/repairOrder/sweep', data: params })
}

// 维修单工单池
export const apiPoolList = (params: any) => {
    return request.get({ url: '/order/repairOrder/list', data: params })
}

// 创建维修单
export function apiCreateOrder(params: any) {
    return request.post({ url: '/order/parentRepairOrder/add', data: params })
}

// 维修单抢单
export function apiRepairGrabOrder(params: any) {
    return request.post({ url: '/order/repairOrder/grabTheOrder', data: params })
}

// 维修单退单
export function apiRepairBackOrder(params: any) {
    return request.post({ url: '/order/repairOrder/refundOrder', data: params })
}

// 维修单接单
export function apiRepairReceive(params: any) {
    return request.post({ url: '/order/repairOrder/receivingOrder', data: params })
}

// 维修单详情
export const apiRepairDetail = (params: any) => {
    if (params.isClient == undefined) params.isClient = 1 //维修员
    return request.get({ url: '/order/repairOrder/detail', data: params })
}

// 维修单上传维修图片
export function apiUploadImage(params: any) {
    return request.post({ url: '/order/repairOrder/uploadPictures', data: params })
}

// 故障检测
export function apiFaultDetect(params: any) {
    return request.post({ url: '/order/repairOrder/faultDetect', data: params })
}

// 工单状态统计
export function apiOrderStatusCount(params: any) {
    return request.get({ url: '/order/repairOrder/orderStatusCount', data: params })
}

// 填写报废单
export function apiFillScrap(params: any) {
    return request.post({ url: '/order/repairOrder/scrapForm', data: params })
}

// 填写回单
export function apiFillInReceipt(params: any) {
    return request.post({ url: '/order/repairOrder/fillInReceipt', data: params })
}

// 配件申请
export function apiApplySpareParts(params: any) {
    return request.post({ url: '/order/repairOrder/sparePartsRequisition', data: params })
}

// 确认收货
export function apiConfirmGet(params: any) {
    return request.post({ url: '/order/repairOrder/confirmReceipt', data: params })
}

// 审核改派
export function apiConfirmDispatch(params: any) {
    return request.post({ url: '/order/repairOrder/auditReassignment', data: params })
}

// 拆机
export function apiDismantle(params: any) {
    return request.post({ url: '/order/repairOrder/dismantle', data: params })
}

// 申请改派
export function apiReassignment(params: any) {
    return request.post({ url: '/order/repairOrder/applyForReassignment', data: params })
}

// 公共步骤
export function apiCommonStep(params: any) {
    return request.post({ url: '/order/repairOrder/maintenanceProcedure', data: params })
}
// 退仓申请
export function apiReturnStashApply(params: any) {
    return request.post({ url: '/order/repairOrder/cancellationRequest', data: params })
}

// 退仓列表
export function apiReturnStashList(params: any) {
    return request.get({ url: '/order/repairOrderAudit/myCancellationRequestList', data: params })
}

// 领料申请
export function apiMaterial(params: any) {
    return request.post({ url: '/order/repairOrder/sparePartsRequisition', data: params })
}

// 取消领料
export function apiReturnMaterial(params: any) {
    return request.post({ url: '/order/repairOrder/cancelMaterialRequisition', data: params })
}

// 自定义入库
export function apiCustomInStorage(params: any) {
    return request.post({ url: '/order/repairOrder/cancellationRequest', data: params })
}

// 配料申请列表
export function apiApplyMaterialList(params: any) {
    return request.get({ url: '/order/repairOrderAudit/myCancellationRequestList', data: params })
}

// 维修单根据工单号和审核id查出配件列表
export function apiRepairPartsList(params: any) {
    return request.get({ url: '/order/repairOrder/partsList', data: params })
}

// 维修单根据工单号和审核id查出配件使用列表
export function apiRepairPartsUseList(params: any) {
    return request.get({ url: '/order/repairOrder/partsUseList', data: params })
}
