import request from '@/utils/request'



export function checkBadCauseUniqueField(data){
  return request({
    url: '/basic/badCause/field/unique/check',
    method: 'post',
    data: data
  })
}


// 查询制程不良原因列表
export function listBadCause(query) {
  return request({
    url: '/basic/badCause/list',
    method: 'get',
    params: query
  })
}




// 查询制程不良原因列表
export function listAllBadCauseByOpCode(code) {
  return request({
    url: '/basic/badCause/all/list/' + code,
    method: 'get',
  })
}

// 查询制程不良原因列表
export function listAllBadCauseByOpCodeList(codeList) {
  return request({
    url: '/basic/badCause/all/list/cl/' + codeList,
    method: 'get',
  })
}


// 高级查询制程不良原因列表
export function advListBadCause(query) {
  return request({
    url: '/basic/badCause/advList',
    method: 'get',
    params: query
  })
}

// 查询制程不良原因详细
export function getBadCause(id) {
  return request({
    url: '/basic/badCause/' + id,
    method: 'get'
  })
}

// 新增制程不良原因
export function addBadCause(data) {
  return request({
    url: '/basic/badCause',
    method: 'post',
    data: data
  })
}

// 修改制程不良原因
export function updateBadCause(data) {
  return request({
    url: '/basic/badCause',
    method: 'put',
    data: data
  })
}
// 修改制程不良原因
export function updateBadCauseList(data) {
  return request({
    url: '/basic/badCause/list',
    method: 'put',
    data: data
  })
}
// 删除制程不良原因
export function delBadCause(id) {
  return request({
    url: '/basic/badCause/' + id,
    method: 'delete'
  })
}
