
import request from '@/config/axios'

export interface jobVO {
  id: number,
  sopStepId: number,
  stepIndex: number,
  stepName: string,
  stepIcon: string,
  stepTitle: string,
  stepTitleShort: string,
  stepDescription: string,
  confirmType: number,
  confirmRoleCode: string,
  confirmUser: number,
  enableCancelJob: boolean,
  enableSetLocker: boolean,
  enableSetColocker: boolean,
  enableAddColocker: boolean,
  gotoStepAfterAddingColocker: number,
  enableReduceColocker: boolean,
  enableLock: boolean,
  enableColock: boolean,
  enableReleaseColock: boolean,
  enableUnlock: boolean,
  enableEndJob: boolean
}

export interface PageParam {
  pageNo: number
  pageSize: number
  sopStepId: number,
  stepIndex: number,
  stepName: string,
  stepIcon: string,
  stepTitle: string,
  stepTitleShort: string,
  stepDescription: string,
}

// 查询Job步骤列表
export const getJobTicketStepPage = async (params: PageParam) => {
  return await request.get({ url: '/iscs/job-ticket-step/getJobTicketStepPage', params })
}

// 获取Job步骤详细信息
export const selectJobTicketStepById = async (id: number) => {
  return await request.get({ url: '/iscs/job-ticket-step/selectJobTicketStepById', params: { id: id } })
}

// 新增Job 步骤
export const insertJobTicketStep = async (data: jobVO) => {
  return await request.post({ url: '/iscs/job-ticket-step/insertJobTicketStep', data })
}
// 修改Job步骤
export const updateJobTicketStep = async (data: jobVO) => {
  return await request.put({ url: '/iscs/job-ticket-step/updateJobTicketStep', data })
}

// 删除Job步骤
export const deleteJobTicketStepList = async (ids: number) => {
  return await request.delete({
    url: '/iscs/job-ticket-step/deleteJobTicketStepList?ids='+ids,
  })
}
