inspect.js 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. var Request = GetRequest();
  2. new Vue({
  3. el: '#app',
  4. data: {
  5. inspects:[
  6. {key:"EXAM_DATE",name:'检查时间',value:"",unit:'',code:'1'},
  7. {key:"BS_FPG",name:'空腹血糖',value:"",unit:'mmol/L',code:'2'},
  8. {key:"NO_BS_FPG",name:'餐后血糖',value:"",unit:'mmol/L',code:'3'},
  9. {key:"RANDOM_BLOOD_SUGAR",name:'随机血糖',value:"",unit:'mmol/L',code:'4'},
  10. {key:"BLOOD_FAT_TRIGLYCERIDE",name:'甘油三酯',value:"",unit:'mmol/L',code:'5'},
  11. {key:"BLOOD_FAT_TC",name:'总胆固醇',value:"",unit:'mmol/L',code:'6'},
  12. {key:"RENAL_FUNCTION_CREATININE",name:'血清肌酐',value:"",unit:'umol/L',code:'7'},
  13. {key:"RENAL_FUNCTION_BUN",name:'血尿素氮',value:"",unit:'mmol/L',code:'28'},
  14. {key:"GHB",name:'糖化血红蛋白',value:"",unit:'%',code:'9'},
  15. {key:"BLOOD_FAT_LDLC",name:'低密度脂蛋白',value:"",unit:'mmol/L',code:'10'},
  16. {key:"MICROALBUMINURIA",name:'尿微量白蛋白',value:"",unit:'μg/min',code:'11'}
  17. ],
  18. objData:''
  19. },
  20. mounted: function() {
  21. var vm = this
  22. var Request = GetRequest();
  23. recordAPI.getFollowupProjectData({id:Request["id"],followupProject:3}).then(function(res){
  24. if(res.status==200){
  25. var data = res.data;
  26. vm.objData = res.data
  27. // delete data["create_time"];delete data["followup_id"];delete data["followup_project"];delete data["id"];
  28. var allData = vm.inspects;
  29. for(var key in data){
  30. for(var j=0;j<allData.length;j++){
  31. if(allData[j].key == key){
  32. allData[j].value = data[key]
  33. break;
  34. }
  35. }
  36. }
  37. }
  38. })
  39. },
  40. methods:{
  41. saveButton:function(){
  42. var vm = this;
  43. params = {id: Request["id"], followupProject:3}
  44. var checkID = {}
  45. $(".row-inline-item input").each(function(i,v){//把所有被选中的复选框的值存入数组
  46. checkID[$(this).attr('name')] = $(this).val()
  47. });
  48. console.log(checkID)
  49. params.followupProjectData = JSON.stringify(checkID);
  50. recordAPI.ModifyFollowupResult(params).then(function(res){
  51. if(res.status==200){
  52. toastr.info("保存成功")
  53. }else{
  54. toastr.error(res.msg)
  55. }
  56. })
  57. }
  58. }
  59. })