index.js 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. import { getDischargeSettlementDetails, getDischargeInstructions } from './service';
  2. import { reportApi } from '../../utils/cloudMonitorHelper';
  3. Component({
  4. data: {
  5. dischargeSettlementDetails: {},
  6. // 出院详情内容
  7. dischargeInstructions: '',
  8. // 出院须知内容
  9. inpatientId: '',
  10. // 住院记录id
  11. settlementType: 'supportMedicalPreSettlement' // 页面类型
  12. // supportMedicalPreSettlement - 支持医保,预结算,有退款 / notSupportMedicalRefund - 不支持医保, 有退款 / notSupportMedicalSupplementary - 不支持医保,需补缴
  13. },
  14. didMount() {
  15. // 获取参数住院IDhospitalDistrictId
  16. const optionsValue = JSON.parse(JSON.stringify(this.$page.data.query));
  17. const {
  18. inpatientId,
  19. settlementType
  20. } = optionsValue;
  21. this.setData({
  22. inpatientId,
  23. settlementType: settlementType || 'supportMedicalPreSettlement'
  24. }, () => {
  25. // 获取出院详情
  26. this.getDischargeSettlementDetails();
  27. }); // 获取出院须知
  28. this.getDischargeInstructionsInfo();
  29. /* 服务办结,出院结算成功 */
  30. reportApi('出院结算成功');
  31. },
  32. methods: {
  33. /**
  34. * 获取出院详情
  35. */
  36. async getDischargeSettlementDetails() {
  37. const {
  38. inpatientId
  39. } = this.data; // 调用方法 - 获取出院详情接口
  40. const params = {
  41. inpatientId
  42. };
  43. const dischargeSettlementDetails = await getDischargeSettlementDetails(params);
  44. this.setData({
  45. dischargeSettlementDetails
  46. });
  47. },
  48. /**
  49. * 获取出院须知
  50. */
  51. async getDischargeInstructionsInfo() {
  52. // 调用方法 - 获取出院须知接口
  53. const res = await getDischargeInstructions();
  54. this.setData({
  55. dischargeInstructions: res.dischargeNotice || ''
  56. });
  57. },
  58. /**
  59. * 返回首页
  60. */
  61. onReturnHome() {
  62. const len = getCurrentPages().length;
  63. my.navigateBack({
  64. delta: len + 1
  65. }); // my.redirectTo({
  66. // url: '/pages/inpatient-service-index/index'
  67. // });
  68. }
  69. }
  70. });