medication.js 897 B

123456789101112131415161718192021222324252627282930313233343536
  1. new Vue({
  2. el: '#app',
  3. data: {
  4. frequency_dict:recipe_frequency_dict,
  5. unit_dict:measure_unit_dict,
  6. DRUG_COMPLIANCE_CODE:'',
  7. hasInsulin:[],//胰岛素药
  8. noInsulin:[]//其他药
  9. },
  10. mounted: function() {
  11. var vm = this
  12. var Request = GetRequest();
  13. recordAPI.getFollowupProjectData({id:Request["id"],followupProject:6}).then(function(res){
  14. if(res.status==200){
  15. var data = res.data;
  16. vm.DRUG_COMPLIANCE_CODE = data.DRUG_COMPLIANCE_CODE;
  17. }
  18. })
  19. recordAPI.getFollowupDrugs({id:Request["id"]}).then(function(res){
  20. if(res.status==200){
  21. var data = res.data.DRUG_LIST;
  22. if(data.length>0){
  23. for(var i=0;i<data.length;i++){
  24. if(data[i].drugsGroup == 'insulin'){//胰岛素药品
  25. vm.hasInsulin.push(data[i])
  26. }else{
  27. vm.noInsulin.push(data[i])
  28. }
  29. }
  30. }
  31. }else{
  32. toastr.error('获取数据失败')
  33. }
  34. })
  35. }
  36. })