nodrug-therapy.ts 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. // module/health/components/field-ruler/field-ruler.ts
  2. import { getOfflineTreatmentListMethod } from "../../request";
  3. Component({
  4. behaviors: ["wx://form-field-group"],
  5. lifetimes: {
  6. attached() {
  7. this.getOfflineTreatmentList();
  8. },
  9. },
  10. methods: {
  11. onRecord(e: any) {
  12. const id = e.currentTarget.dataset.id;
  13. if (id) {
  14. // 跳转核销记录
  15. wx.navigateTo({
  16. url: `/module/care/pages/care/verifyRecord?id=${id}`,
  17. success: () => {},
  18. fail: (error) => {
  19. console.error("跳转失败:", error);
  20. },
  21. });
  22. } else {
  23. wx.showToast({
  24. title: "暂无核销记录",
  25. icon: "none",
  26. });
  27. }
  28. },
  29. // 更多记录
  30. onMore() {
  31. wx.navigateTo({
  32. url: "/module/care/pages/offlineTreatment/offlineTreatment",
  33. });
  34. },
  35. async getOfflineTreatmentList() {
  36. // 0 进行中 1 已完成
  37. const res = await getOfflineTreatmentListMethod("0");
  38. if (res && res.data && res.data.length > 0) {
  39. this.setData({
  40. offlineTreatmentList: res.data,
  41. });
  42. } else {
  43. this.setData({
  44. offlineTreatmentList: [],
  45. });
  46. }
  47. },
  48. },
  49. properties: {},
  50. /**
  51. * 组件的初始数据
  52. */
  53. data: {
  54. loading: false,
  55. offlineTreatmentList: [],
  56. },
  57. observers: {},
  58. });