var Request = GetRequest();
var serveFollowupDate=JSON.parse(window.localStorage.getItem('serveFollowupDate')) 			
new Vue({
  el: '#app',
  data: {
		DRUG_ADVERSE_MARK:"",
		ADR_REMARK:"",
		REFUSE_REFERRAL:"",
		REFUSE_REFERRAL_WHY:"",
		TRANSFER_RESON:"",
		TRANSFER_ORG_DEPT:"",
		readonly:false,
		objData:'',
		status:'',	//3进行2计划中1完成
		isFinsh:false
  },
  mounted: function() {
  	var vm = this
	var Request = GetRequest();
	if(serveFollowupDate.status=='1'){
		this.isFinsh=true
	}else{
		this.isFinsh=false
	}
	
  	recordAPI.getFollowupProjectData({id:Request["id"],followupProject:9}).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:9}
		  var checkID = {};
		  checkID['DRUG_ADVERSE_MARK'] = vm.DRUG_ADVERSE_MARK
		  checkID['ADR_REMARK'] = vm.ADR_REMARK
		  checkID['REFUSE_REFERRAL'] = vm.REFUSE_REFERRAL
		  checkID['REFUSE_REFERRAL_WHY'] = vm.REFUSE_REFERRAL_WHY
		  checkID['TRANSFER_RESON'] = vm.TRANSFER_RESON
		  checkID['TRANSFER_ORG_DEPT'] = vm.TRANSFER_ORG_DEPT
		  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)
			  }
		  })
	  },
	  finishFollowup: function () {
		  var params={id:Request["id"]}
		  var vm=this
		  recordAPI.finishFollowup(params).then(function (res) {
			  if (res.status == 200) {
					vm.isFinsh = true
				  toastr.info("操作成功")
			  } else {
				  toastr.error(res.msg)
			  }
		  })

	  }
  }
})