import service from '@/utils/request'

/** 员工基本资料管理 */
//1.获取部门列表
export const getDepartment = (data) => {
    return service({
        url: '/mes_server/Staff/getDepartment',
        method: 'get',
        data
    })
}
//2.获取员工信息列表
export const getStaffList = (params) => {
    return service({
        url: '/mes_server/Staff/getStaffList',
        method: 'get',
        params
    })
}
// 3.获取员工资料
export const getStaffInfo = (params) => {
    return service({
        url: '/mes_server/staff/getStaffInfo',
        method: 'get',
        params
    })
}
//3.修改员工资料
export const ygjbzledit = (data) => {
    return service({
        url: '/mes_server/staff/edit',
        method: 'post',
        data
    })
}

/** 产品管理 */
//1.获取客户信息
export const getCustom = (data) => {
    return service({
        url: '/mes_server/Custom/getCustom',
        method: 'get',
        data
    })
}
//2.获取产品资料列表
export const getProduct = (params) => {
    return service({
        url: '/mes_server/Product/getProduct',
        method: 'get',
        params
    })
}
//3.获取单个产品基础数据
export const getProductData = (params) => {
    return service({
        url: '/mes_server/Product/getProductData',
        method: 'get',
        params
    })
}
//4.获取单个工艺数据（排产参数调整）
export const getProductGy = (params) => {
    return service({
        url: '/mes_server/product/getProductGy',
        method: 'get',
        params
    })
}
//5.修改产品工艺(排产参数调整)
export const editGy = (data) => {
    return service({
        url: '/mes_server/product/editGy',
        method: 'post',
        data
    })
}
//6.修改产品基本资料
export const editProduct = (data) => {
    return service({
        url: '/mes_server/product/editProduct',
        method: 'post',
        data
    })
}
//7.设置产品状态
export const setProductStatus = (data) => {
    return service({
        url: '/mes_server/product/setProductStatus',
        method: 'post',
        data
    })
}
//8.1获取产品工艺数量
export const getGyTotal = (data) => {
    return service({
        url: '/mes_server/product/getGyTotal',
        method: 'get',
        data
    })
}
//8.2产品工艺复制(数据库不支持插入数据)
// export const copyProductGy = (data) => {
//     return service({
//         url: '/mes_server/product/copyProductGy',
//         method: 'post',
//         data
//     })
// }
//9.工艺方案更名
export const editGyName = (data) => {
    return service({
        url: '/mes_server/product/editGyName',
        method: 'post',
        data
    })
}
//10.工艺方案附加
export const editGyNo = (data) => {
    return service({
        url: '/mes_server/product/editGyNo',
        method: 'post',
        data
    })
}
//11.计损色数修正
export const editGyMs = (data) => {
    return service({
        url: '/mes_server/product/editGyMs',
        method: 'post',
        data
    })
}
//12.质检废品系数
export const editGyWaste = (data) => {
    return service({
        url: '/mes_server/product/editGyWaste',
        method: 'post',
        data
    })
}

/** 生产管理 工单资料管理*/
// 1.工单资料菜单列表
export const DataList = (params) => {
    return service({
        url: '/mes_server/work_order/DataList',
        method: 'get',
        params
    })
}
// 工单资料
export const WorkList = (params) => {
    return service({
        url: '/mes_server/work_order/WorkList',
        method: 'get',
        params
    })
}
//工单印件、工艺、BOM详情
export const workOrderListDetail = (params) => {
    return service({
        url: '/mes_server/work_order/workOrderListDetail',
        method: 'get',
        params
    })
}
// // 工艺资料
// export const Craft = (params) => {
//     return service({
//         url: '/mes_server/work_order/Craft',
//         method: 'get',
//         params
//     })
// }
// // 印件资料
// export const Printed = (params) => {
//     return service({
//         url: '/mes_server/work_order/Printed',
//         method: 'get',
//         params
//     })
// }
// // BOM资料
// export const Bom = (params) => {
//     return service({
//         url: '/mes_server/work_order/Bom',
//         method: 'get',
//         params
//     })
// }

//工单查改->获取工单信息
export const DataCorrection = (params) => {
    return service({
        url: '/mes_server/work_order/DataCorrection',
        method: 'get',
        params
    })
}

//工单差改->修改工单信息
export const WorkOrderEdit = (data) => {
    return service({
        url: '/mes_server/work_order/WorkOrderEdit',
        method: 'post',
        data
    })
}


//引用产品资料->获取产品资料
export const ProductInformation = (params) => {
    return service({
        url: '/mes_server/work_order/ProductInformation',
        method: 'get',
        params
    })
}

//引用产品资料->修改产品资料
export const ProductInformationEdit = (params) => {
    return service({
        url: '/mes_server/work_order/ProductInformationEdit',
        method: 'post',
        params
    })
}
//工艺流程调整->获取当前工单工艺资料
export const ProcessFlow = (params) => {
    return service({
        url: '/mes_server/work_order/ProcessFlow',
        method: 'get',
        params
    })
}
//工艺流程调整->参照工单列表获取
export const ReferenceWorkOrder = (params) => {
    return service({
        url: '/mes_server/work_order/ReferenceWorkOrder',
        method: 'get',
        params
    })
}
//工艺流程调整->工艺资料修改
export const ProcessCopy = (params) => {
    return service({
        url: '/mes_server/work_order/ProcessCopy',
        method: 'post',
        params
    })
}
// 查改U8工单（工单删除）
export const U8DataCorrection = (params) => {
    return service({
        url: '/mes_server/work_order/U8DataCorrection',
        method: 'get',
        params
    })
}
//质检废品系数->质检工艺数据获取
export const TestCoefficient = (params) => {
    return service({
        url: '/mes_server/work_order/TestCoefficient',
        method: 'get',
        params
    })
}
//质检废品系数->质检系数更新
export const TestCoefficientEdit = (params) => {
    return service({
        url: '/mes_server/work_order/TestCoefficientEdit',
        method: 'post',
        params
    })
}
//修正工单核算参数->数据获取
export const AccountingParameter = (params) => {
    return service({
        url: '/mes_server/work_order/AccountingParameter',
        method: 'get',
        params
    })
}
//修正工单核算参数->参数修改
export const AccountingParameterEdit = (data) => {
    return service({
        url: '/mes_server/work_order/AccountingParameterEdit',
        method: 'post',
        data
    })
}
//U8投料试算
export const U8Trial = (params) => {
    return service({
        url: '/mes_server/work_order/U8Trial',
        method: 'get',
        params
    })
}
//查改U8工单->工单列表
export const U8workOrder = (params) => {
    return service({
        url: '/mes_server/work_order/U8workOrder',
        method: 'get',
        params
    })
}

//印件资料修改
export const PrintedEdit = (data) => {
    return service({
        url: '/mes_server/work_order/PrintedEdit',
        method: 'post',
        data
    })
}

//工艺资料修改
export const ProcessDetailEdit = (data) => {
    return service({
        url: '/mes_server/work_order/ProcessDetailEdit',
        method: 'post',
        data
    })
}

//打印作业通知单
export const PrintJobOrder = (data) => {
    return service({
        url: '/mes_server/work_order/PrintJobOrder',
        method: 'post',
        data
    })
}

//工艺资料编辑->机台列表获取
export const gdzl_MachineList = (params) => {
    return service({
        url: '/mes_server/work_order/MachineList',
        method: 'get',
        params
    })
}



/**工单生产排单(排产管理)*/
//计划中工单
export const Project = (params) => {
    return service({
        url: '/mes_server/manufacture/Project',
        method: 'get',
        params
    })
}
//计划中工单->工艺资料
export const projectCraft = (params) => {
    return service({
        url: '/mes_server/manufacture/projectCraft',
        method: 'get',
        params
    })
}
//计划中工单->印件资料
export const projectPrint = (params) => {
    return service({
        url: '/mes_server/manufacture/projectPrint',
        method: 'get',
        params
    })
}
//左侧车间机台菜单
export const workbench = (data) => {
    return service({
        url: '/mes_server/manufacture/workbench',
        method: 'get',
        data
    })
}
//生产中工单工序接口
export const scheduleProcess = (params) => {
    return service({
        url: '/mes_server/manufacture/scheduleProcess',
        method: 'get',
        params
    })
}
//工序完工
export const complete = (params) => {
    return service({
        url: '/mes_server/manufacture/complete',
        method: 'get',
        params
    })
}
//加入排产
export const ProductionSchedulingAdd = (data) => {
    return service({
        url: '/mes_server/manufacture/ProductionSchedulingAdd',
        method: 'post',
        data
    })
}
//暂停排产
export const ProductionSchedulingPause = (data) => {
    return service({
        url: '/mes_server/manufacture/ProductionSchedulingPause',
        method: 'post',
        data
    })
}
//工序状态更正
export const ProcessStatusCorrection = (params) => {
    return service({
        url: '/mes_server/manufacture/ProcessStatusCorrection',
        method: 'get',
        params
    })
}
//班次选择列表
export const ScheduleSelection = (data) => {
    return service({
        url: '/mes_server/manufacture/ScheduleSelection',
        method: 'get',
        data
    })
}
//车间设备排程->数据展示
export const EquipmentScheduling = (params) => {
    return service({
        url: '/mes_server/manufacture/EquipmentScheduling',
        method: 'get',
        params
    })
}
//车间设备排程->数据编辑
export const EquipmentSchedulingEdit = (data) => {
    return service({
        url: '/mes_server/manufacture/EquipmentSchedulingEdit',
        method: 'post',
        data
    })
}

//排程/制程中工单
export const Schedule = (params) => {
    return service({
        url: '/mes_server/Manufacture/Schedule',
        method: 'get',
        params
    })
}

//工单状态设置
export const StatusEdit = (data) => {
    return service({
        url: '/mes_server/manufacture/StatusEdit',
        method: 'post',
        data
    })
}

//工序状态更正->编辑
export const ProcessStatusCorrectionEdit = (data) => {
    return service({
        url: '/mes_server/manufacture/ProcessStatusCorrectionEdit',
        method: 'post',
        data
    })
}

//机台制程/排程工单列表
export const MachineWorkOrderList = (params) => {
    return service({
        url: '/mes_server/manufacture/MachineWorkOrderList',
        method: 'get',
        params
    })
}


/** 7.设备运行跟踪*/
//左侧菜单
export const getTab = (params) => {
    return service({
        url: '/mes_server/facility/getTab',
        method: 'get',
        params
    })
}
//当日上报产量
export const chanLiang = (params) => {
    return service({
        url: '/mes_server/facility/chanLiang',
        method: 'get',
        params
    })
}
//当日制程检验记录
export const Inspect = (params) => {
    return service({
        url: '/mes_server/facility/Inspect',
        method: 'get',
        params
    })
}
//当前生产订单
export const Production = (params) => {
    return service({
        url: '/mes_server/facility/Production',
        method: 'get',
        params
    })
}
//设备工作清单
export const EquipmentWorklist = (params) => {
    return service({
        url: '/mes_server/facility/EquipmentWorklist',
        method: 'get',
        params
    })
}
//印件、工序、完成数量
export const Procedure = (params) => {
    return service({
        url: '/mes_server/facility/Procedure',
        method: 'get',
        params
    })
}
//班组人员及分配比例
export const Team = (params) => {
    return service({
        url: '/mes_server/facility/Team',
        method: 'get',
        params
    })
}
//当班产量明细
export const OutputDetail = (params) => {
    return service({
        url: '/mes_server/facility/OutputDetail',
        method: 'get',
        params
    })
}
//检验记录
export const InspectionRecord = (params) => {
    return service({
        url: '/mes_server/facility/InspectionRecord',
        method: 'get',
        params
    })
}
//班组维护->机台编号下拉框
export const MachineList = (params) => {
    return service({
        url: '/mes_server/facility/MachineList',
        method: 'get',
        params
    })
}
//班组维护->删除当前班组
export const teamDel = (params) => {
    return service({
        url: '/mes_server/facility/teamDel',
        method: 'get',
        params
    })
}

//获取机台编号
export const getMachineMac = (data) => {
    return service({
        url:'/mes_server/reporting_work/getMachineMac',
        method: 'get',
        data
    })
}