inspect.js 2.1 KB

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