departmentModal.js 934 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. import history from '../../utils/history';
  2. Component({
  3. props: {
  4. isShowModal: false,
  5. position: 'bottom',
  6. title: '请选择科室',
  7. departmentList: [],
  8. onClose: null,
  9. docId: ''
  10. },
  11. data: {},
  12. methods: {
  13. onTopBtnTap() {
  14. this.setData({
  15. isShowModal: true
  16. });
  17. },
  18. onPopupClose() {
  19. if (Object.prototype.toString.call(this.props.onClose) === '[object Function]') {
  20. this.props.onClose();
  21. }
  22. },
  23. /**
  24. * 选择科室
  25. */
  26. chooseBtn(e) {
  27. const {
  28. currentTarget: {
  29. dataset: {
  30. item: {
  31. departmentId
  32. }
  33. }
  34. }
  35. } = e;
  36. history.push({
  37. query: {
  38. depId: departmentId,
  39. // 科室id
  40. doctorId: this.props.docId // 医生唯一识别号
  41. },
  42. title: '医生主页',
  43. pageType: 'doctor-page'
  44. });
  45. }
  46. }
  47. });