import request from '@/utils/request'

export function createConfig(params) {
  console.log('params', params)
  return request({
    url: '/api/createconfig',
    method: 'post',
    data: params
  })
}

export function createChildConfig(params) {
  console.log('parasms22222', params)
  return request({
    url: '/api/createchildconfig',
    method: 'post',
    data: params
  })
}

export function updateChildConfig(params) {
  console.log('params', params)
  return request({
    url: '/api/updatechildconfig',
    method: 'post',
    data: params
  })
}

export function deleteChildConfig(params) {
  return request({
    url: '/api/deletechildconfig',
    method: 'post',
    data: params
  })
}

export function updateTemplate(params) {
  return request({
    url: '/api/updatetemplate',
    method: 'post',
    data: params
  })
}

export function updateFieldIsShow(id, is_show) {
  return request({
    url: '/api/filed/show?id=' + id + '&is_show=' + is_show,
    method: 'post'
  })
}

export function postPrintTemplate(params) {
  return request({
    url: '/api/print/template/commit?template_id=' + params,
    method: 'post'
  })
}

export function getPrintTemplate() {
  return request({
    url: '/api/print/template/get',
    method: 'get'
  })
}

export function createDictionaryConfig(params) {
  console.log('params', params)
  return request({
    url: '/api/dictionary/createconfig',
    method: 'post',
    data: params
  })
}

export function createDictionaryChildConfig(params) {
  return request({
    url: '/api/dictionary/createchildconfig',
    method: 'post',
    data: params
  })
}

export function updateDictionaryChildConfig(params) {
  console.log('params', params)
  return request({
    url: '/api/dictionary/updatechildconfig',
    method: 'post',
    data: params
  })
}

export function deleteDictionaryChildConfig(params) {
  return request({
    url: '/api/dictionary/deletechildconfig',
    method: 'post',
    data: params
  })
}

export function updateDictionaryTemplate(params) {
  return request({
    url: '/api/dictionary/updatetemplate',
    method: 'post',
    data: params
  })
}

export function createBaseDrugLib(params) {
  return request({
    url: '/api/basedruglib/create',
    method: 'post',
    params: params
  })
}

export function editBaseDrugLib(params, unit) {
  return request({
    url: '/api/basedruglib/edit?unit=' + unit,
    method: 'post',
    params: params
  })
}

export function getBaseDrugLib(params) {
  return request({
    url: '/api/basedruglib/get',
    method: 'get',
    params: params
  })
}

export function getBaseDrugLibList(params) {
  return request({
    url: '/api/basedruglib/list',
    method: 'get',
    params: params
  })
}

export function createMedicineInsurancePercent(params, module) {
  return request({
    url: '/api/medicineinsurancepercent/create?module=' + module,
    method: 'post',
    data: params
  })
}

export function getMedicineInsurancePercent(type_id, module) {
  return request({
    url: '/api/medicineinsurancepercent/get?type_id=' + type_id + '&module=' + module,
    method: 'get'
  })
}

export function createDrugUnitSafeguard(params) {
  return request({
    url: '/api/drugunitsafeguard/create',
    method: 'post',
    data: params
  })
}

export function deleteDurg(params) {
  return request({
    url: '/api/drug/basedruglib',
    method: 'get',
    params: params
  })
}

export function createMZSick(params) {
  return request({
    url: '/api/mz/sick/create',
    method: 'post',
    params: params
  })
}

export function modifyMZSick(params) {
  return request({
    url: '/api/mz/sick/modify',
    method: 'post',
    params: params
  })
}

export function getMZSickList(params) {
  return request({
    url: '/api/mz/sick/list',
    method: 'get',
    params: params
  })
}

export function deleteMZSick(params) {
  return request({
    url: '/api/mz/sick/delete',
    method: 'post',
    params: params
  })
}

export function GetMZSick(params) {
  return request({
    url: '/api/mz/sick/get',
    method: 'get',
    params: params
  })
}

export function createAddition(params) {
  return request({
    url: '/api/addition/create',
    method: 'post',
    params: params
  })
}

export function modifyAddition(params) {
  return request({
    url: '/api/addition/modify',
    method: 'post',
    params: params
  })
}

export function getAdditionList(params) {
  return request({
    url: '/api/addition/list',
    method: 'get',
    params: params
  })
}

export function deleteAddition(params) {
  return request({
    url: '/api/addition/delete',
    method: 'post',
    params: params
  })
}

export function GetAddition(params) {
  return request({
    url: '/api/addition/get',
    method: 'get',
    params: params
  })
}

export function createDiagnose(params) {
  return request({
    url: '/api/diagnose/create',
    method: 'post',
    params: params
  })
}

export function modifyDiagnose(params) {
  return request({
    url: '/api/diagnose/modify',
    method: 'post',
    params: params
  })
}

export function getDiagnoseList(params) {
  return request({
    url: '/api/diagnose/list',
    method: 'get',
    params: params
  })
}

export function deleteDiagnose(params) {
  return request({
    url: '/api/diagnose/delete',
    method: 'post',
    params: params
  })
}

export function GetDiagnose(params) {
  return request({
    url: '/api/diagnose/get',
    method: 'get',
    params: params
  })
}

export function getAllDrugList(params) {
  return request({
    url: '/api/drug/getalldruglist',
    method: 'Get',
    params: params
  })
}

export function postSearchDrugList(keyword, storehouse_id, params) {
  return request({
    url: '/api/drug/postsearchdruglist?keyword=' + keyword + '&storehouse_id=' + storehouse_id,
    method: 'get',
    params: params
  })
}

