
import request from '@/config/axios'

export interface SOPVo {
  id: number,
  sopId: number,
  stepId: 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
}

// 查询SOP步骤列表
export const getSopWorkflowStepPage = async (params: PageParam) => {
  return await request.get({ url: '/iscs/sop-workflow-step/getSopWorkflowStepPage', params })
}

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


// 新增SOP步骤
export const insertSopWorkflowStep = async (data: SOPVo) => {
  return await request.post({ url: '/iscs/sop-workflow-step/insertSopWorkflowStep', data })
}

// 修改SOP步骤
export const updateSopWorkflowStep= async (data: SOPVo) => {
  return await request.put({ url: '/iscs/sop-workflow-step/updateSopWorkflowStep', data })
}

// 删除SOP步骤
export const deleteSopWorkflowStepList = async (ids: number) => {
  return await request.delete({
    url: '/iscs/sop-workflow-step/deleteSopWorkflowStepList?ids='+ids,
  })
}
