guidance.js 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. new Vue({
  2. el: '#app',
  3. data: {
  4. guidances:[
  5. {name:'日吸烟量',type:1,value:"",unit:'支',key:"DAILY_SMOKING"},
  6. {name:'日吸烟量期望',type:1,value:"",unit:'支',key:"SOMKING_EXP"},
  7. {name:'心理调整',type:2,value:"",unit:'',key:"PSY_ADJUST_RESULT_CODE",
  8. options:[{key: "1",value:"理想"},{key: "2",value: "良好"},{key: "3",value: "一般"},{key: "4",value: "差"}]
  9. },
  10. {name:'日饮酒量',type:1,value:"",unit:'两',key:"DAILY_DRINKING"},
  11. {name:'日饮酒量期望',type:1,value:"",unit:'两',key:"DRINK_EXP"},
  12. {name:'医德行为',type:2,value:"",unit:'',key:"COMPLIANCE_RESULT_CODE",
  13. options:[{key: "1",value:"理想"},{key: "2",value: "良好"},{key: "3",value: "一般"},{key: "4",value: "差"}]
  14. },
  15. {name:'摄盐情况',type:2,value:"",unit:'',key:"SALT_TAKEN_LEVEL_CODE",
  16. options:[{key: "1",value:"轻"},{key: "2",value: "中"},{key: "3",value: "重"}]
  17. },
  18. {name:'摄盐情况期望',type:2,value:"",unit:'',key:"SALT_TAKEN_LEVEL_EXP",
  19. options:[{key: "1",value:"轻"},{key: "2",value: "中"},{key: "3",value: "重"}]
  20. },
  21. {name:'主食',type:1,value:"",unit:'克/天',key:"DAILY_STAPLE"},
  22. {name:'运动频率',type:2,value:"",unit:'',key:"EXERCISE_FREQ_CODE",
  23. options:[{key: "1",value:"每周 <= 三次"},{key: "2",value: "每周 > 三次"},{key: "3",value: "极少运动"},{key: "4",value: "残疾、关节等原因不能运动"},{key: "99",value: "不详"}]
  24. },
  25. {name:'运动时长',type:1,value:"",unit:'分钟/次',key:"EXERCISE_DURATION_MINS"},
  26. {name:'运动频率期望',type:2,value:"",unit:'',key:"EXERCISE_FREQ_CODE_EXP",
  27. options:[{key: "1",value:"每周 <= 三次"},{key: "2",value: "每周 > 三次"},{key: "3",value: "极少运动"},{key: "4",value: "残疾、关节等原因不能运动"},{key: "99",value: "不详"}]
  28. },
  29. {name:'运动时长期望',type:1,value:"",unit:'分钟/次',key:"EXERCISE_DURATION_MINS_EXP"},
  30. ]
  31. },
  32. mounted: function() {
  33. var vm = this
  34. var Request = GetRequest();
  35. recordAPI.getFollowupProjectData({id:Request["id"],followupProject:4}).then(function(res){
  36. if(res.status==200){
  37. var data = res.data;
  38. delete data["create_time"];delete data["followup_id"];delete data["followup_project"];delete data["id"];
  39. var allData = vm.guidances;
  40. for(var key in data){
  41. for(var j=0;j<allData.length;j++){
  42. if(allData[j].key == key){
  43. allData[j].value = data[key]
  44. break;
  45. }
  46. }
  47. }
  48. }
  49. })
  50. }
  51. })