diff --git a/api.md b/api.md index 21e7245..a7f9ddb 100644 --- a/api.md +++ b/api.md @@ -398,8 +398,9 @@ |------|------|------|------| | page | int | 否 | 页码,默认 1 | | pageSize | int | 否 | 每页条数,默认 10 | -| year | int | 否 | 按就诊年份筛选 | -| count | int | 否 | 取最近 N 次就诊记录 | +| year | int | 否 | 按就诊年份筛选(快捷方式,等同于yearStart=year&yearEnd=year) | +| yearStart | int | 否 | 按就诊年份范围筛选-起始年份,优先级高于year | +| yearEnd | int | 否 | 按就诊年份范围筛选-结束年份,优先级高于year | #### 响应示例 @@ -451,6 +452,8 @@ - `medicationsUsedOtherText`:本次就诊已使用药物选择"其他"(99)时的补充文本,未选择"其他"时为 null - `immunosuppressantNameOtherText`:正在使用的免疫抑制剂名称选择"其他"(99)时的补充文本,未选择"其他"时为 null +- 年份筛选优先级:传入 `yearStart`+`yearEnd` 时优先按范围筛选,忽略 `year` 参数;仅传 `yearStart` 取 >= 起始年份;仅传 `yearEnd` 取 <= 结束年份;仅传 `year` 则按单年份筛选 + --- ### 1.5 删除就诊记录 @@ -494,8 +497,11 @@ | 参数 | 类型 | 必填 | 说明 | |------|------|------|------| | imageField | string | 是 | 图片类型标识 | -| year | int | 否 | 按就诊年份筛选 | -| count | int | 否 | 取最近 N 次就诊记录 | +| year | int | 否 | 按就诊年份筛选(快捷方式,等同于yearStart=year&yearEnd=year) | +| yearStart | int | 否 | 按就诊年份范围筛选-起始年份,优先级高于year | +| yearEnd | int | 否 | 按就诊年份范围筛选-结束年份,优先级高于year | +| page | int | 否 | 页码,默认 1 | +| pageSize | int | 否 | 每页条数,默认 10 | #### imageField 枚举 @@ -514,6 +520,9 @@ "code": 0, "message": "success", "data": { + "page": 1, + "pages": 5, + "totalCount": 50, "list": [ { "visitDate": "2026-06-29", @@ -530,6 +539,8 @@ } ``` +- 分页按就诊记录维度,每页包含对应就诊记录中该类型的所有图片 + --- ### 1.7 指标字段历史列表 @@ -543,8 +554,9 @@ | 参数 | 类型 | 必填 | 说明 | |------|------|------|------| | indicatorField | string | 是 | 指标字段标识 | -| year | int | 否 | 按就诊年份筛选 | -| count | int | 否 | 取最近 N 次就诊记录 | +| year | int | 否 | 按就诊年份筛选(快捷方式,等同于yearStart=year&yearEnd=year) | +| yearStart | int | 否 | 按就诊年份范围筛选-起始年份,优先级高于year | +| yearEnd | int | 否 | 按就诊年份范围筛选-结束年份,优先级高于year | #### indicatorField 枚举 @@ -799,8 +811,9 @@ | patientId | int | 是 | 患者 ID | | page | int | 否 | 页码,默认 1 | | pageSize | int | 否 | 每页条数,默认 10 | -| year | int | 否 | 按就诊年份筛选 | -| count | int | 否 | 取最近 N 次就诊记录 | +| year | int | 否 | 按就诊年份筛选(快捷方式,等同于yearStart=year&yearEnd=year) | +| yearStart | int | 否 | 按就诊年份范围筛选-起始年份,优先级高于year | +| yearEnd | int | 否 | 按就诊年份范围筛选-结束年份,优先级高于year | #### 响应示例 @@ -839,8 +852,9 @@ |------|------|------|------| | patientId | int | 是 | 患者 ID | | imageField | string | 是 | 图片类型标识 | -| year | int | 否 | 按就诊年份筛选 | -| count | int | 否 | 取最近 N 次就诊记录 | +| year | int | 否 | 按就诊年份筛选(快捷方式,等同于yearStart=year&yearEnd=year) | +| yearStart | int | 否 | 按就诊年份范围筛选-起始年份,优先级高于year | +| yearEnd | int | 否 | 按就诊年份范围筛选-结束年份,优先级高于year | #### imageField 枚举 @@ -864,8 +878,9 @@ |------|------|------|------| | patientId | int | 是 | 患者 ID | | indicatorField | string | 是 | 指标字段标识 | -| year | int | 否 | 按就诊年份筛选 | -| count | int | 否 | 取最近 N 次就诊记录 | +| year | int | 否 | 按就诊年份筛选(快捷方式,等同于yearStart=year&yearEnd=year) | +| yearStart | int | 否 | 按就诊年份范围筛选-起始年份,优先级高于year | +| yearEnd | int | 否 | 按就诊年份范围筛选-结束年份,优先级高于year | #### indicatorField 枚举 diff --git a/src/app.json b/src/app.json index e5e5de8..1ca41f9 100644 --- a/src/app.json +++ b/src/app.json @@ -94,7 +94,8 @@ "pages/d_patientList/index", "pages/d_transfer/index", "pages/d_transferLog/index", - "pages/d_transferDetail/index" + "pages/d_transferDetail/index", + "pages/d_caseReport/index" ] }, { diff --git a/src/doctor/pages/d_caseReport/index.json b/src/doctor/pages/d_caseReport/index.json new file mode 100644 index 0000000..cd76e72 --- /dev/null +++ b/src/doctor/pages/d_caseReport/index.json @@ -0,0 +1,8 @@ +{ + "navigationBarTitleText": "病例报告", + "usingComponents": { + "pagination": "/components/pagination/index", + "van-divider": "@vant/weapp/divider/index", + "van-loading": "@vant/weapp/loading/index" + } +} diff --git a/src/doctor/pages/d_caseReport/index.scss b/src/doctor/pages/d_caseReport/index.scss new file mode 100644 index 0000000..55982c1 --- /dev/null +++ b/src/doctor/pages/d_caseReport/index.scss @@ -0,0 +1,72 @@ +page { + background-color: rgba(246, 246, 246, 1); +} + +.page { + padding: 32rpx 32rpx 300rpx; + .list { + .card { + display: flex; + gap: 20rpx; + .aside { + display: flex; + flex-direction: column; + align-items: center; + flex-shrink: 0; + .line-top, + .line-bottom { + border-right: 1px dashed rgba(34, 34, 34, 0.2); + } + .line-top { + flex-shrink: 0; + } + .line-bottom { + flex: 1; + } + .circle { + flex-shrink: 0; + width: 20rpx; + height: 20rpx; + border-radius: 50%; + background-color: rgba(22, 121, 203, 1); + background-clip: content-box; + border: 6rpx solid rgba(22, 121, 203, 0.10); + } + } + .wrap { + flex: 1; + min-width: 0; + padding-bottom: 48rpx; + .date { + font-size: 36rpx; + color: rgba(34, 34, 34, 1); + line-height: 1; + } + .container { + margin-top: 20rpx; + padding: 32rpx; + background-color: #fff; + border-radius: 12rpx; + display: grid; + grid-template-columns: repeat(2, 1fr); + gap: 24rpx; + .photo { + display: block; + width: 100%; + height: 154rpx; + border-radius: 12rpx; + } + } + } + } + } + .empty { + padding: 200rpx 0; + text-align: center; + .text { + font-size: 28rpx; + color: rgba(34, 34, 34, 0.4); + } + } +} + diff --git a/src/doctor/pages/d_caseReport/index.ts b/src/doctor/pages/d_caseReport/index.ts new file mode 100644 index 0000000..d2e0c87 --- /dev/null +++ b/src/doctor/pages/d_caseReport/index.ts @@ -0,0 +1,73 @@ +Page({ + data: { + imageField: '', + patientId: '', + list: [] as { visitDate: string; images: string[] }[], + pagination: { count: 0, page: 1, pages: 1 }, + }, + + onLoad(options: any) { + if (options.name) { + wx.setNavigationBarTitle({ title: options.name }) + } + if (options.imageField) { + this.setData({ imageField: options.imageField, patientId: options.patientId || '' }) + this.getImageHistory(true) + } + }, + + onReachBottom() { + const { page, pages } = this.data.pagination + if (page < pages) { + this.setData({ 'pagination.page': page + 1 }) + this.getImageHistory() + } + }, + + getImageHistory(reset = false) { + const page = reset ? 1 : this.data.pagination.page + const data: Record = { imageField: this.data.imageField, page, pageSize: 10 } + data.patientId = this.data.patientId + wx.ajax({ + method: 'GET', + url: '?r=igg4/doctor/medical-visit/image-history', + data, + }).then((res: any) => { + if (!res || !res.list) return + // 按就诊日期分组 + const groupMap: Record = {} + for (const item of res.list) { + if (!groupMap[item.visitDate]) { + groupMap[item.visitDate] = [] + } + groupMap[item.visitDate].push(item.imageUrl) + } + const newList = Object.keys(groupMap) + .sort((a, b) => b.localeCompare(a)) + .map((visitDate) => ({ + visitDate, + images: groupMap[visitDate], + })) + this.setData({ + list: reset ? newList : [...this.data.list, ...newList], + pagination: { + count: res.totalCount || 0, + page: res.page || 1, + pages: res.pages || 1, + }, + }) + }) + }, + + handlePreviewImage(e: WechatMiniprogram.CustomEvent) { + const { url, date } = e.currentTarget.dataset + const group = this.data.list.find((item) => item.visitDate === date) + if (!group) return + wx.previewImage({ + current: url, + urls: group.images, + }) + }, +}) + +export {} diff --git a/src/doctor/pages/d_caseReport/index.wxml b/src/doctor/pages/d_caseReport/index.wxml new file mode 100644 index 0000000..089a6fa --- /dev/null +++ b/src/doctor/pages/d_caseReport/index.wxml @@ -0,0 +1,30 @@ + + + + + + + + + + {{item.visitDate}} + + + + + + + + 暂无记录 + + diff --git a/src/doctor/pages/d_createTask/index.ts b/src/doctor/pages/d_createTask/index.ts index ade58ee..ca2ed55 100644 --- a/src/doctor/pages/d_createTask/index.ts +++ b/src/doctor/pages/d_createTask/index.ts @@ -101,8 +101,6 @@ Page({ if (typeof e === 'object') { btn = e?.currentTarget?.dataset?.btn } - if (btn == 1) { - } return wx .ajax({ diff --git a/src/doctor/pages/d_interactive/index.scss b/src/doctor/pages/d_interactive/index.scss index 16ef107..b5d7171 100644 --- a/src/doctor/pages/d_interactive/index.scss +++ b/src/doctor/pages/d_interactive/index.scss @@ -13,9 +13,12 @@ page { .wrap { display: flex; align-items: center; + gap: 16rpx; .search { flex: 1; padding: 16rpx 32rpx; + height: 76rpx; + box-sizing: border-box; display: flex; align-items: center; gap: 16rpx; @@ -34,6 +37,23 @@ page { color: rgba(173, 179, 180, 1); } } + .send { + flex-shrink: 0; + padding: 16rpx 28rpx; + background: linear-gradient(96deg, #293b9f 0%, #1679cb 100%); + border-radius: 48rpx; + font-size: 32rpx; + color: #ffffff; + display: flex; + align-items: center; + gap: 12rpx; + height: 76rpx; + box-sizing: border-box; + .icon { + width: 40rpx; + height: 40rpx; + } + } .clear { margin-left: 32rpx; width: 56rpx; diff --git a/src/doctor/pages/d_interactive/index.ts b/src/doctor/pages/d_interactive/index.ts index 02f2e0c..760b8e1 100644 --- a/src/doctor/pages/d_interactive/index.ts +++ b/src/doctor/pages/d_interactive/index.ts @@ -107,4 +107,9 @@ Page({ }, }) }, + handleSendGroup() { + wx.navigateTo({ + url: '/doctor/pages/d_taskList/index', + }) + }, }) diff --git a/src/doctor/pages/d_interactive/index.wxml b/src/doctor/pages/d_interactive/index.wxml index 9b578ec..6c387f5 100644 --- a/src/doctor/pages/d_interactive/index.wxml +++ b/src/doctor/pages/d_interactive/index.wxml @@ -7,26 +7,19 @@ type="text" class="input" placeholder-class="input-place" - placeholder="可根据姓名、手机号搜索患者" + placeholder="搜索姓名、手机号" model:value="{{search}}" confirm-type="search" bindconfirm="handleSearch" bind:tap="handleTapSearch" /> + + + 群发 + - - - - - - - - - - - diff --git a/src/doctor/pages/d_patientDetail/index.scss b/src/doctor/pages/d_patientDetail/index.scss index eb8ce68..4265196 100644 --- a/src/doctor/pages/d_patientDetail/index.scss +++ b/src/doctor/pages/d_patientDetail/index.scss @@ -376,6 +376,7 @@ page { position: fixed; bottom: 0; left: 0; + z-index: 10; width: 100%; box-sizing: border-box; display: flex; diff --git a/src/doctor/pages/d_patientDetail/index.ts b/src/doctor/pages/d_patientDetail/index.ts index bf56b52..8b1a28c 100644 --- a/src/doctor/pages/d_patientDetail/index.ts +++ b/src/doctor/pages/d_patientDetail/index.ts @@ -4,6 +4,27 @@ const app = getApp() let echarts: any = null +const MEDICATIONS_MAP: Record = { + 1: '没有使用激素', + 2: '激素', + 3: '免疫抑制剂', + 4: '靶向CD19生物制剂', + 5: '靶向CD20生物制剂', + 99: '其他', +} + +const IMMUNOSUPPRESSANT_MAP: Record = { + 1: '吗替麦考酚酯', + 2: '替唑嘌呤', + 3: '环磷酰胺', + 4: '来氟米特', + 5: '甲氨蝶呤', + 6: '环孢素A', + 7: '他克莫司', + 8: '艾拉莫德', + 99: '其他', +} + Page({ data: { toastShow: false, @@ -109,17 +130,56 @@ Page({ 3: '3年以上', }, + // 图表筛选 + yearOptions: [ + { label: '按年', value: 1 }, + { label: '按次', value: 2 }, + ] as { label: string; value: number }[], + selected: 1, + selectedLabel: '按年', + BeginMonth: dayjs().subtract(1, 'year').add(1, 'month').format('YYYY-MM'), + EndMonth: dayjs().format('YYYY-MM'), + chartUnit: '', + chartList: [] as any[], + + // 病历报告 caseReportList: [ { icon: 'icon142.png', name: '门诊病历及处方', content: '医生手写或电脑打印的病历、处方', + imageField: 'outpatientRecord', + }, + { icon: 'icon127.png', name: '检验报告', content: '抽血检测的IgG4、IgG、ESR等', imageField: 'labReport' }, + { + icon: 'icon128.png', + name: '影像学检查', + content: '超声/CT/MRI的描述结论、电子胶片', + imageField: 'imagingExam', + }, + { + icon: 'icon129.png', + name: '病理诊断及活检', + content: '受累组织穿刺或切除免疫组化报告', + imageField: 'pathology', + }, + { + icon: 'icon130.png', + name: '外周血免疫功能评估', + content: '免疫细胞亚群、淋巴细胞比例测定', + imageField: 'immuneFunction', }, - { icon: 'icon127.png', name: '检验报告', content: '抽血检测的IgG4、IgG、ESR等' }, - { icon: 'icon128.png', name: '影像学检查', content: '超声/CT/MRI的描述结论、电子胶片' }, - { icon: 'icon129.png', name: '病理诊断及活检', content: '受累组织穿刺或切除免疫组化报告' }, - { icon: 'icon130.png', name: '外周血免疫功能评估', content: '免疫细胞亚群、淋巴细胞比例测定' }, ], + + // Tab 切换 + currentTab: 0, + + // 就诊记录列表 + recordList: [] as any[], + recordPagination: { count: 0, page: 1, pages: 1 }, + + // 导出PPT + pptGenerating: false, }, ecDataTrendComponent: null as any, async onLoad(option) { @@ -128,150 +188,246 @@ Page({ }) echarts = await require.async('../../../resource/components/echart/echarts.js') this.ecDataTrendComponent = this.selectComponent('#chart1') - this.initChart() app.waitLogin().then(async (_res) => { this.getDoctorDetail() await this.getDetail() + this.getIndicatorHistory() + this.getRecordList(true) }) }, - initChart(defaultList = []) { - const list: any = [ - ...defaultList, - { Date: '2026-7-7', TotalScore: 100, InjectionBottles: false }, - { Date: '2026-7-8', TotalScore: 1000, InjectionBottles: false }, - ] - return new Promise((reslove) => { - this.ecDataTrendComponent.init((canvas, width, height, dpr) => { - const chart = echarts.init(canvas, null, { - width, - height, - devicePixelRatio: dpr, // new - }) - canvas.setChart(chart) - - const option: any = { - tooltip: { - show: false, - trigger: 'axis', - axisPointer: { - type: 'shadow', - }, - confine: true, - backgroundColor: 'rgba(0, 0, 0, 0.5)', - textStyle: { - color: '#fff', - fontSize: 10, + // ========== Tab 切换 ========== + + handleTabChange(e: any) { + const { index } = e.currentTarget.dataset + const tab = Number(index) + if (tab === this.data.currentTab) return + this.setData({ currentTab: tab }) + wx.pageScrollTo({ scrollTop: 0, duration: 200 }) + // 切换到就诊记录时如果列表为空则请求 + if (tab === 1 && !this.data.recordList.length) { + this.getRecordList(true) + } + // 切换到基本信息时重新获取图表组件并渲染 + if (tab === 0 && this.data.chartList.length) { + setTimeout(() => { + this.ecDataTrendComponent = this.selectComponent('#chart1') + this.initChart(this.data.chartList) + }, 100) + } + }, + + // ========== 图表筛选 ========== + + handleChange(e: any) { + const idx = Number(e.detail.value) + const selected = this.data.yearOptions[idx] + if (!selected) return + const isByYear = selected.value === 1 + this.setData({ + selected: selected.value, + selectedLabel: selected.label, + BeginMonth: isByYear ? dayjs().subtract(1, 'year').add(1, 'month').format('YYYY-MM') : '', + EndMonth: isByYear ? dayjs().format('YYYY-MM') : '', + }) + this.getIndicatorHistory() + }, + + handleBeginDateChange(e: any) { + const BeginMonth = e.detail.value + this.setData({ BeginMonth }) + if (this.data.EndMonth) { + this.getIndicatorHistory() + } + }, + + handleEndDateChange(e: any) { + const EndMonth = e.detail.value + this.setData({ EndMonth }) + if (this.data.BeginMonth) { + this.getIndicatorHistory() + } + }, + + // ========== 指标趋势图表 ========== + + initChart(defaultList: any[] = []) { + if (!defaultList.length) return + if (!echarts || !this.ecDataTrendComponent) { + this.ecDataTrendComponent = this.selectComponent('#chart1') + if (!echarts || !this.ecDataTrendComponent) return + } + + const list = defaultList + + this.ecDataTrendComponent.init((canvas: any, width: number, height: number, dpr: number) => { + const chart = echarts.init(canvas, null, { + width, + height, + devicePixelRatio: dpr, + }) + canvas.setChart(chart) + + const color = 'rgba(22, 121, 203, 1)' + + const option: any = { + tooltip: { + show: false, + trigger: 'axis', + axisPointer: { type: 'shadow' }, + confine: true, + backgroundColor: 'rgba(0, 0, 0, 0.5)', + textStyle: { color: '#fff', fontSize: 10 }, + order: 'seriesDesc', + }, + grid: { + top: '30', + left: '0', + right: '0', + bottom: '10', + containLabel: true, + }, + xAxis: [ + { + type: 'category', + axisTick: { alignWithLabel: true }, + axisLine: { + lineStyle: { color: 'rgba(34, 34, 34, 0.20)', type: 'dashed' }, }, - order: 'seriesDesc', + data: list.map((item: any) => dayjs(item.visitDate).format('MM-DD')), }, - grid: { - top: '30', - left: '0', - right: '0', - bottom: '10', - containLabel: true, + ], + yAxis: [ + { + type: 'value', + minInterval: 1, + axisLabel: { color: 'rgba(34, 34, 34, 0.40)' }, + splitLine: { + lineStyle: { color: 'rgba(34, 34, 34, 0.20)', type: 'dashed' }, + }, }, - xAxis: [ - { - type: 'category', - axisTick: { - alignWithLabel: true, - }, - axisLine: { - lineStyle: { - color: 'rgba(34, 34, 34, 0.20)', - type: 'dashed', - }, - }, - data: list.map((item) => dayjs(item.Date).format('MM-DD')), + ], + series: [ + { + name: 'IgG4', + data: list.length ? list.map((item: any) => item.value) : [0], + barWidth: '16', + label: { + show: true, + position: 'top', + color, }, - ], - yAxis: [ - { - type: 'value', - minInterval: 1, - axisLabel: { - color: 'rgba(34, 34, 34, 0.40)', - }, - splitLine: { - lineStyle: { - color: 'rgba(34, 34, 34, 0.20)', - type: 'dashed', - }, - }, + type: 'line', + symbol: 'circle', + symbolSize: 8, + showSymbol: list.length >= 1, + connectNulls: true, + z: 10, + itemStyle: { + color, }, - ], - series: [ - { - name: '总分', - data: list.length ? list.map((item) => item.TotalScore) : [25], - barWidth: '16', - label: { - show: true, - position: 'top', - color: 'rgba(22, 121, 203, 1)', - }, - type: 'line', - symbol: 'circle', - symbolSize: 8, - showSymbol: list.length >= 1, - connectNulls: true, - z: 10, - itemStyle: { - color: 'rgba(22, 121, 203, 1)', - }, - markLine: { - symbol: ['none', 'none'], - data: [ - { - name: '135 安全区', - yAxis: 135, - label: { - formatter: '{b}', - position: 'insideMiddle', - color: 'rgba(22, 121, 203, 1)', - fontSize: '10', - }, - lineStyle: { - cap: '', - color: 'rgba(22, 121, 203, 1)', - type: 'dashed', - }, + markLine: { + symbol: ['none', 'none'], + data: [ + { + name: '135 安全区', + yAxis: 135, + label: { + formatter: '{b}', + position: 'insideMiddle', + color, + fontSize: '10', + }, + lineStyle: { + cap: '', + color, + type: 'dashed', }, - ], - }, - markArea: { - itemStyle: { - color: 'rgba(22, 121, 203, 0.16)', }, - data: [ - [ - { - yAxis: 0, - }, - { - yAxis: 135, - }, - ], - ], + ], + }, + markArea: { + itemStyle: { + color: 'rgba(22, 121, 203, 0.16)', }, + data: [[{ yAxis: 0 }, { yAxis: 135 }]], }, - ], - dataZoom: { - type: 'inside', // 有type这个属性,滚动条在最下面,也可以不行,写y:36,这表示距离顶端36px,一般就是在图上面。 - startValue: 0, - endValue: 4, - filterMode: 'none', }, - } + ], + dataZoom: { + type: 'inside', + startValue: 0, + endValue: 4, + filterMode: 'none', + }, + } + + chart.setOption(option) + return chart + }) + }, + + getIndicatorHistory() { + const data: Record = { + patientId: this.data.id, + indicatorField: 'igG4', + } + const { BeginMonth, EndMonth, selected } = this.data + + if (BeginMonth && EndMonth && selected === 1) { + data.yearStart = Number(BeginMonth.substring(0, 4)) + data.yearEnd = Number(EndMonth.substring(0, 4)) + } - chart.setOption(option) - reslove(chart) - return chart + wx.ajax({ + method: 'GET', + url: '?r=igg4/doctor/medical-visit/indicator-history', + data, + }).then((res: any) => { + if (!res) return + this.setData({ + chartUnit: res.unit || 'mg/dL', + chartList: res.list || [], }) + this.initChart(res.list || []) }) }, + + // ========== 就诊记录列表 ========== + + getRecordList(reset = false) { + const page = reset ? 1 : this.data.recordPagination.page + wx.ajax({ + method: 'GET', + url: '?r=igg4/doctor/medical-visit/list', + data: { + patientId: this.data.id, + page, + pageSize: 10, + }, + }).then((res: any) => { + if (!res) return + const list = (res.list || []).map((item: any) => ({ + ...item, + medicationLabels: (item.medicationsUsed || []).map((id: number) => MEDICATIONS_MAP[id]).filter(Boolean), + immunosuppressantLabels: (item.immunosuppressantName || []) + .map((id: number) => IMMUNOSUPPRESSANT_MAP[id]) + .filter(Boolean), + })) + + this.setData({ + recordList: reset ? list : [...this.data.recordList, ...list], + recordPagination: { + count: res.totalCount || 0, + page: res.page || 1, + pages: res.pages || 1, + }, + }) + }) + }, + + // ========== 患者详情 ========== + getDoctorDetail() { wx.ajax({ method: 'GET', @@ -434,4 +590,58 @@ Page({ handleToastCancel() { wx.navigateBack() }, + + // ========== 病历报告导航 ========== + + handleDetail(e: any) { + const { name, imagefield } = e.currentTarget.dataset + wx.navigateTo({ + url: `/doctor/pages/d_caseReport/index?name=${name}&imageField=${imagefield}&patientId=${this.data.id}`, + }) + }, + + // ========== 导出PPT ========== + + handleGeneratePdf() { + if (this.data.pptGenerating) return + this.setData({ pptGenerating: true }) + const patientId = this.data.id + const downloadUrl = `${app.globalData.url}?r=igg4/doctor/medical-visit/export-ppt&loginState=${app.globalData.loginState}&patientId=${patientId}` + wx.downloadFile({ + url: downloadUrl, + success: (res) => { + if (res.statusCode === 200) { + wx.shareFileMessage({ + filePath: res.tempFilePath, + fileName: 'medical-visit.pptx', + success: () => { + wx.showToast({ title: '分享成功', icon: 'success' }) + this.setData({ pptGenerating: false }) + }, + fail: () => { + wx.showToast({ title: '分享失败', icon: 'none' }) + this.setData({ pptGenerating: false }) + }, + }) + } else { + wx.showToast({ title: '下载失败', icon: 'none' }) + this.setData({ pptGenerating: false }) + } + }, + fail: () => { + wx.showToast({ title: '下载失败', icon: 'none' }) + this.setData({ pptGenerating: false }) + }, + }) + }, + + // ========== 分页加载 ========== + + onReachBottom() { + const { page, pages } = this.data.recordPagination + if (page < pages) { + this.setData({ 'recordPagination.page': page + 1 }) + this.getRecordList() + } + }, }) diff --git a/src/doctor/pages/d_patientDetail/index.wxml b/src/doctor/pages/d_patientDetail/index.wxml index d240823..a981d50 100644 --- a/src/doctor/pages/d_patientDetail/index.wxml +++ b/src/doctor/pages/d_patientDetail/index.wxml @@ -1,9 +1,9 @@