symptom.js 2.7 KB

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