symptom.js 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. var Request = GetRequest();
  2. new Vue({
  3. el: '#app',
  4. data: {
  5. symptoms:[
  6. {key:"NO_SYMPTOM",name:'无症状',value:'',code:'0'},
  7. {key:"HEADACHE",name:'头痛头晕',value:'',code:'1'},
  8. {key:"NAUSEA",name:'恶心呕吐',value:'',code:'1'},
  9. {key:"VERTIGO_TINNITUS",name:'眼花耳鸣',value:'',code:'1'},
  10. {key:"DIFFICULTY_BREATHING",name:'呼吸困难',value:'',code:'1'},
  11. {key:"PALPITATIONS",name:'心悸胸闷',value:'',code:'1'},
  12. {key:"EPISTAXIS_BLEEDING",name:'鼻衄出血不止',value:'',code:'1'},
  13. {key:"LIMBS_NUMB",name:'四肢发麻',value:'',code:'1'},
  14. {key:"EXTREMITY_EDEMA",name:'下肢水肿',value:'',code:'1'},
  15. {key:"POLYDIPSIA",name:'多饮',value:'',code:'1'},
  16. {key:"MORE_FOOD",name:'多食',value:'',code:'1'},
  17. {key:"MORE_URINE",name:'多尿',value:'',code:'1'},
  18. {key:"BLURRED_VISION",name:'视力模糊',value:'',code:'1'},
  19. {key:"INFECTION",name:'感染',value:'',code:'1'},
  20. {key:"NUMB_HANDS",name:'四肢麻痹',value:'',code:'1'},
  21. {key:"WEIGHT_LOSS",name:'体重下降',value:'',code:'1'}
  22. ],//症状
  23. hypoglycemia:"",//低血糖反应
  24. remark: "",//其他
  25. readonly:false,
  26. objData:''
  27. },
  28. mounted: function() {
  29. var vm = this
  30. var Request = GetRequest();
  31. recordAPI.getFollowupProjectData({id:Request["id"],followupProject:1}).then(function(res){
  32. if(res.status==200){
  33. var data = res.data;
  34. vm.objData = res.data
  35. // delete data["create_time"];delete data["followup_id"];delete data["followup_project"];delete data["id"];
  36. var allData = vm.symptoms;
  37. for(var key in data){
  38. if(key == "HYPOG_REACT_CODE"){
  39. vm.hypoglycemia = data[key]
  40. }else if(key == "SYMPTOM_OTHER"){
  41. vm.remark = data[key]
  42. }else{
  43. for(var j=0;j<allData.length;j++){
  44. if(allData[j].key == key){
  45. allData[j].value = data[key]
  46. break;
  47. }
  48. }
  49. }
  50. }
  51. }
  52. })
  53. },
  54. methods:{
  55. //修改症状
  56. saveButton:function(){
  57. var vm = this;
  58. params = {id: Request["id"], followupProject:1}
  59. var checkID = {}
  60. $(".inline-container-l input:checked").each(function(i,v){//把所有被选中的复选框的值存入数组
  61. checkID[$(this).attr('name')] = $(this).attr('code')
  62. });
  63. $(".row-line-item-2 input:checked").each(function(i,v){//把所有被选中的复选框的值存入数组
  64. checkID[$(this).attr('name')] = $(this).val()
  65. });
  66. checkID['SYMPTOM_OTHER'] = $("textarea").val()
  67. console.log(checkID)
  68. params.followupProjectData = JSON.stringify(checkID);
  69. recordAPI.ModifyFollowupResult(params).then(function(res){
  70. if(res.status==200){
  71. toastr.info("保存成功")
  72. }else{
  73. toastr.error(res.msg)
  74. }
  75. })
  76. }
  77. }
  78. })