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) {
  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
  })
}





