var Request = GetRequest();

new Vue({
  el: '#app',
  data: {
  	CONTROL_DATE:'',
  	CONTROL_CONSTITUTOR:'',
  	CONTROL_BP_D:'',
  	CONTROL_BP_U:'',
  	CONTROL_BS_FPG:'',
  	CONTROL_NO_BS_FPG:'',
  	CONTROL_WEIGHT:'',
  	CONTROL_GHB:'',
  	CONTROL_TRIGLYCERIDE:'',
  	CONTROL_TOTAL_CHOLESTEROL:'',
  	CONTROL_LDL:'',
  	CONTROL_EXERCISE_FREQ_CODE:'',
  	CONTROL_EXERCISE_DURATION_MINS:'',
  	objData:''
  },
  mounted: function() {
  	var vm = this
  	var Request = GetRequest();
  	recordAPI.getFollowupProjectData({id:Request["id"],followupProject:7}).then(function(res){
			if(res.status==200){
				var data = res.data;
				vm.objData = res.data
//				delete data["create_time"];delete data["followup_id"];delete data["followup_project"];delete data["id"];
				for(var key in data){
					vm[key] = data[key]
				}
			}
		})
  },
  methods:{
  	saveButton:function(){
  		var vm = this;
      params = {id: Request["id"], followupProject:7}
      var checkID = {};
      checkID['CONTROL_DATE'] =vm.CONTROL_DATE
      checkID['CONTROL_CONSTITUTOR'] =vm.CONTROL_CONSTITUTOR
      checkID['CONTROL_BP_D'] =vm.CONTROL_BP_D
      checkID['CONTROL_BP_U'] =vm.CONTROL_BP_U
      checkID['CONTROL_BS_FPG'] =vm.CONTROL_BS_FPG
      checkID['CONTROL_NO_BS_FPG'] =vm.CONTROL_NO_BS_FPG
      checkID['CONTROL_WEIGHT'] =vm.CONTROL_WEIGHT
      checkID['CONTROL_GHB'] =vm.CONTROL_GHB
      checkID['CONTROL_TOTAL_CHOLESTEROL'] =vm.CONTROL_TOTAL_CHOLESTEROL
      checkID['CONTROL_LDL'] =vm.CONTROL_LDL
      checkID['CONTROL_EXERCISE_FREQ_CODE'] =vm.CONTROL_EXERCISE_FREQ_CODE
      checkID['CONTROL_EXERCISE_DURATION_MINS'] =vm.CONTROL_EXERCISE_DURATION_MINS
      console.log(checkID)
        params.followupProjectData = JSON.stringify(checkID);
        console.log(params.followupProjectData)
        console.log(params)
				recordAPI.ModifyFollowupResult(params).then(function(res){
				if(res.status==200){
					toastr.info("保存成功")
				}else{
					toastr.error(res.msg)
				}
			})
  	}
  }
})