jw-prescription-info.js 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. var request = getRequest(),
  2. code = request.code,
  3. patient = request.patient,
  4. fv_id = request.fv_id; //记录从随访跳转过来的数据
  5. var info; //保存处方信息
  6. $(function(){
  7. if(fv_id){
  8. $("#fvBtn").show();
  9. }
  10. var params = {
  11. code: code,
  12. patient: patient
  13. }
  14. jwPrescriptionAPI.getJwPrescriptionInfo({data: params}).then(function(res){
  15. if(res.status == 200){
  16. info = res.data;
  17. var html = template('tmp', res.data);
  18. $("#main").empty().append(html);
  19. }else{
  20. }
  21. });
  22. $("#backBtn").on('click', function(){
  23. history.go(-1);
  24. });
  25. $("#fvBtn").on('click', function(){
  26. //保存处方的药品信息
  27. var drugs = info.prescriptionInfo;
  28. window.sessionStorage.setItem("chooseDrugs", JSON.stringify(drugs));
  29. //触发填充药品信息
  30. top.fillChooseDrugs();
  31. //关闭当前的layer弹框
  32. setTimeout(function(){
  33. var index = parent.layer.getFrameIndex(window.name); //获取窗口索引
  34. parent.layer.close(index);
  35. }, 300);
  36. })
  37. });