import http from '@/service'

// 分页获取资讯列表
export function getListApi(data: any) {
  return http.post(`/admin/plan/app/page`, data)
}

// 获取cso列表
export function getListCsoApi() {
  return http.get(`/admin/wmdaagent/listCso`)
}

// 获取药品列表
export function getListDrugApi() {
  return http.get(`/admin/wmdadrugentdrugtable/list-drug`)
}

// 创建计划
export function createListApi(data: any) {
  return http.post(`/admin/plan/create`, data)
}

// 审核计划
export function planCheckApi(data: any) {
  return http.post(`/admin/plan/check`, data)
}

// 获取计划详情
export function getPlanInfoApi(plan_id: string) {
  return http.get(`/admin/plan/info/${plan_id}`)
}

// 获取计划详情
export function getPlanChildrenApi(params: any) {
  return http.get(`/admin/plan/children/list`, { params })
}

// 获取任务类型
export function getWmtasktypePageApi(params: any) {
  return http.get(`/admin/wmtasktype/page`, { params })
}

// 创建计划详情
export function planDetailCreateApi(data: any) {
  return http.post(`/admin/plan/details/create`, data)
}

// 获取拆解详情
export function getPlanDetailsApi(id: string) {
  return http.get(`/admin/plan/details/${id}`)
}

// 获取拆解详情
export function checkPlanDetailsApi(data: any) {
  return http.post(`/admin/plan/details/check`, data)
}

// 编辑
export function updatePlanApi(data: any) {
  return http.post(`/admin/plan/update`, data)
}

// 获取csolist 排除自己的

// 获取cso列表
export function getListDescendant() {
  return http.get(`/admin/dept/list/descendant`)
}
