index.js 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. import history from '../../utils/history';
  2. import { getDailyBill } from './service';
  3. Component({
  4. data: {
  5. dailyBillList: [],
  6. tabs: [],
  7. activeIndex: 0,
  8. showInventoryDay: 'false',
  9. admissionShowOther: 'false',
  10. // 无住院人:押金缴纳与日清单查询的提示
  11. attention: ''
  12. },
  13. props: {
  14. componentData: {}
  15. },
  16. didMount() {
  17. this.getDailyBillData();
  18. const {
  19. inpatientIndexTab,
  20. showInventoryDay,
  21. admissionShowOther,
  22. attention
  23. } = this.props.componentData.componentExtInfo;
  24. this.setData({
  25. tabs: inpatientIndexTab ? JSON.parse(inpatientIndexTab) : [],
  26. showInventoryDay,
  27. admissionShowOther,
  28. attention
  29. });
  30. },
  31. methods: {
  32. handleTabClick({
  33. index,
  34. tabsName
  35. }) {
  36. this.setData({
  37. [tabsName]: index,
  38. activeIndex: index
  39. });
  40. },
  41. // 获取首页日清列表
  42. async getDailyBillData() {
  43. const dailyBillList = await getDailyBill();
  44. this.setData({
  45. dailyBillList
  46. });
  47. },
  48. // 功能选项点击
  49. onClickFunction(e) {
  50. const {
  51. itemName,
  52. pagePath
  53. } = e.target.dataset.item;
  54. history.push({
  55. title: itemName,
  56. pageType: pagePath,
  57. query: {
  58. admissionShowOther: this.data.admissionShowOther,
  59. attention: this.data.attention
  60. }
  61. });
  62. },
  63. // 跳转日清单查询
  64. toDailyBill(e) {
  65. const {
  66. inpatientId,
  67. checkInDate
  68. } = e.target.dataset.item;
  69. history.push({
  70. query: {
  71. inpatientId,
  72. billDate: checkInDate.slice(0, 11),
  73. color: '#000',
  74. backBtnColor: '#000',
  75. background: '#fff'
  76. },
  77. title: '日清单查询',
  78. pageType: 'inventory-day'
  79. });
  80. }
  81. }
  82. });