import request from '@/utils/request'

/**
 * 获取客户详情
 * @param {string} id 客户编号
 * @returns 客户信息
 */
export const getPatientInfo = (id) => {
    return request({
      url: `/patient/patient/${id}`,
      method: 'get',
    })
}

/**
 * 获取客户变更日志
 * @param {object} query 
 * @returns 
 */
export const getPatientLogs = (params) => {
    return request({
      url: `/patient/patientlog`,
      method: 'get',
      params,
    })
}

/**
 * 设置标签
 */
export const setLabel = (ids, label) => {
    return request({
      url: `/patient/patientlabel/batchadd`,
      data: {
        labelName: label,
        patientids: ids,
      },
      method: 'post',
    })
}

/**
 * 取消标签
 */
export const cancelLabel = (ids, label) => {
  return request({
    url: `/patient/patientlabel`,
    data: {
      labelName: label,
      patientids: ids,
    },
    method: 'delete',
  })
}
  