import request from '@/utils/request'


// 查询作业票类型-列表
export function listJobTicket(query) {
  return request({
    url: '/iscs/ticket/getIsJobTicketPage',
    method: 'get',
    params: query
  })
}

// 获取作业票类型详细信息
export function getJobTicketInfo(repairId) {
  return request({
    url: '/iscs/ticket/selectIsJobTicketById?ticketId=' + repairId,
    method: 'get'
  })
}
// /iscs/sop/selectSopTypeByMachineryId  查询对应设备工艺下的 sop类型
export function selectSopTypeByMachineryId(repairId) {
  return request({
    url: '/iscs/sop/selectSopTypeByMachineryId?machineryId=' + repairId,
    method: 'get'
  })
}
// 获取八大步骤详细信息
export function getStepInfo(repairId) {
  return request({
    url: '/iscs/step/selectStepsByTicketId?ticketId=' + repairId,
    method: 'get'
  })
}
//查询作业区域列表
export function getworkareaList(repairId) {
  return request({
    url: '/dev-api/iscs/workarea/getIsWorkareaList?workshopId='+ repairId,
    method: 'get',
  })
}
//新增作业票类型
export function addJobTicket(query) {
  return request({
    url: '/iscs/ticket/insertIsJobTicket',
    method: 'post',
    data: query
  })
}

// 修改作业票信息
export function updateJobTicket(data) {
  return request({
    url: '/iscs/ticket/updateIsJobTicket',
    method: 'post',
    data: data
  })
}

// 删除作业票
export function deleteIsJobTicket(repairId) {
  return request({
    url: '/iscs/ticket/deleteIsJobTicketByTicketIds?ticketIds='+ repairId,
    method: 'post'
  })
}

//mars八大步骤作业票执行 第三步骤-新增人员
export function addJobUsers(data) {
  return request({
    url: '/iscs/step/addJobUsers',
    method: 'post',
    data:data
  })
}
//mars八大步骤作业票执行
export function updateJobStep(data) {
  return request({
    url: '/iscs/step/updateJobStep',
    method: 'post',
    data:data
  })
}
//mars八大步骤作业票执行 结束作业票
export function updateJobToFinish(data) {
  return request({
    url: '/iscs/ticket/updateJobToFinish',
    method: 'post',
    data:data
  })
}
//mars八大步骤作业票执行 取消作业票
export function updateJobToCancel(data) {
  return request({
    url: '/iscs/ticket/updateJobToCancel',
    method: 'post',
    data:data
  })
}
// 获取第八步有冲突的作业票新消息
export function getStepEight(data) {
  return request({
    url: '/iscs/step/getStepEight?ticketId='+ data,
    method: 'get',
  })
}
// 查看作业票-正在进行中的作业票

export function getWorkstationTicketList(query) {
  return request({
    url: '/iscs/ticket/getWorkstationTicketList',
    method: 'get',
    params: query
  })
}
