From b4579a3f9fe41990f278e1a9a4ebda8bc46e221c Mon Sep 17 00:00:00 2001 From: kola-web Date: Tue, 14 Jul 2026 18:39:14 +0800 Subject: [PATCH] =?UTF-8?q?2.0=20bug=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/app.json | 3 +- src/doctor/pages/d_patientDetail/index.scss | 2 +- src/doctor/pages/d_patientDetail/index.ts | 33 +++-- src/doctor/pages/d_patientDetail/index.wxml | 2 +- src/doctor/pages/d_recordDetail/index.json | 7 + src/doctor/pages/d_recordDetail/index.scss | 196 ++++++++++++++++++++++++++++ src/doctor/pages/d_recordDetail/index.ts | 175 +++++++++++++++++++++++++ src/doctor/pages/d_recordDetail/index.wxml | 53 ++++++++ src/doctor/pages/d_taskDetail/index.ts | 2 + src/doctor/pages/d_taskList/index.ts | 2 + src/gift/pages/record/index.ts | 7 +- src/gift/pages/recordDetail/index.wxml | 6 - src/gift/pages/recordList/index.scss | 2 +- 13 files changed, 466 insertions(+), 24 deletions(-) create mode 100644 src/doctor/pages/d_recordDetail/index.json create mode 100644 src/doctor/pages/d_recordDetail/index.scss create mode 100644 src/doctor/pages/d_recordDetail/index.ts create mode 100644 src/doctor/pages/d_recordDetail/index.wxml diff --git a/src/app.json b/src/app.json index 1ca41f9..aff671f 100644 --- a/src/app.json +++ b/src/app.json @@ -95,7 +95,8 @@ "pages/d_transfer/index", "pages/d_transferLog/index", "pages/d_transferDetail/index", - "pages/d_caseReport/index" + "pages/d_caseReport/index", + "pages/d_recordDetail/index" ] }, { diff --git a/src/doctor/pages/d_patientDetail/index.scss b/src/doctor/pages/d_patientDetail/index.scss index 7af568e..25c2754 100644 --- a/src/doctor/pages/d_patientDetail/index.scss +++ b/src/doctor/pages/d_patientDetail/index.scss @@ -347,7 +347,7 @@ page { align-items: baseline; line-height: 84rpx; .num { - font-size: 72rpx; + font-size: 58rpx; color: rgba(34, 34, 34, 1); font-weight: bold; } diff --git a/src/doctor/pages/d_patientDetail/index.ts b/src/doctor/pages/d_patientDetail/index.ts index 2072235..e046058 100644 --- a/src/doctor/pages/d_patientDetail/index.ts +++ b/src/doctor/pages/d_patientDetail/index.ts @@ -372,16 +372,19 @@ Page({ if (!res) return const chartList = res.list || [] const chartEmpty = !chartList.length - this.setData({ - chartUnit: res.unit || 'mg/dL', - chartList, - chartEmpty, - }, () => { - if (!chartEmpty) { - this.ecDataTrendComponent = null - this.initChart(chartList.reverse() || []) - } - }) + this.setData( + { + chartUnit: res.unit || 'mg/dL', + chartList, + chartEmpty, + }, + () => { + if (!chartEmpty) { + this.ecDataTrendComponent = null + this.initChart(chartList.reverse() || []) + } + }, + ) }) }, @@ -421,7 +424,9 @@ Page({ if (!res) return const list = (res.list || []).map((item: any) => ({ ...item, - medicationLabels: (item.medicationsUsed || []).map((id: number) => this.data.medicationsMap[id]).filter(Boolean), + medicationLabels: (item.medicationsUsed || []) + .map((id: number) => this.data.medicationsMap[id]) + .filter(Boolean), immunosuppressantLabels: (item.immunosuppressantName || []) .map((id: number) => this.data.immunosuppressantMap[id]) .filter(Boolean), @@ -603,6 +608,12 @@ Page({ }, // ========== 病历报告导航 ========== + handleRecordDetail(e) { + const { id } = e.currentTarget.dataset + wx.navigateTo({ + url: `/doctor/pages/d_recordDetail/index?id=${id}&pid=${this.data.id}`, + }) + }, handleDetail(e: any) { const { name, imagefield } = e.currentTarget.dataset diff --git a/src/doctor/pages/d_patientDetail/index.wxml b/src/doctor/pages/d_patientDetail/index.wxml index e22887e..e740883 100644 --- a/src/doctor/pages/d_patientDetail/index.wxml +++ b/src/doctor/pages/d_patientDetail/index.wxml @@ -131,7 +131,7 @@ - + diff --git a/src/doctor/pages/d_recordDetail/index.json b/src/doctor/pages/d_recordDetail/index.json new file mode 100644 index 0000000..018eb95 --- /dev/null +++ b/src/doctor/pages/d_recordDetail/index.json @@ -0,0 +1,7 @@ +{ + "navigationBarTitleText": "就诊记录详情页", + "navigationBarBackgroundColor": "#F6F6F6", + "usingComponents": { + "van-icon": "@vant/weapp/icon/index" + } +} diff --git a/src/doctor/pages/d_recordDetail/index.scss b/src/doctor/pages/d_recordDetail/index.scss new file mode 100644 index 0000000..89f340f --- /dev/null +++ b/src/doctor/pages/d_recordDetail/index.scss @@ -0,0 +1,196 @@ +page { + background-color: #f6f6f6; +} +.page { + padding: 32rpx 32rpx 120rpx; + .banner { + padding: 28rpx 32rpx; + border-radius: 24rpx; + background-color: #fff; + .b-header { + margin-bottom: 24rpx; + font-size: 36rpx; + color: rgba(34, 34, 34, 1); + font-weight: bold; + display: flex; + align-items: center; + gap: 24rpx; + margin-left: -32rpx; + &::before { + content: ''; + width: 8rpx; + height: 36rpx; + border-radius: 0 8rpx 8rpx 0; + background: rgba(22, 121, 203, 1); + } + } + .row { + display: flex; + gap: 32rpx; + &:last-of-type { + margin-top: 22rpx; + } + .icon { + flex-shrink: 0; + width: 96rpx; + height: 96rpx; + } + .col { + .name { + font-size: 32rpx; + color: rgba(34, 34, 34, 1); + } + .date { + margin-top: 12rpx; + font-size: 40rpx; + color: rgba(34, 34, 34, 1); + font-weight: bold; + } + } + } + } + .switch-wrap { + margin-top: 32rpx; + padding: 28rpx 32rpx; + border-radius: 24rpx; + background-color: #fff; + display: flex; + align-items: center; + justify-content: space-between; + .name { + font-size: 32rpx; + color: rgba(34, 34, 34, 1); + } + .switch { + transform: scale(0.8); + } + } + .photos { + margin-top: 32rpx; + padding: 28rpx 32rpx; + border-radius: 24rpx; + background-color: #fff; + .p-header { + font-size: 36rpx; + color: rgba(34, 34, 34, 1); + font-weight: bold; + display: flex; + align-items: center; + gap: 24rpx; + margin-left: -32rpx; + &::before { + content: ''; + width: 8rpx; + height: 36rpx; + border-radius: 0 8rpx 8rpx 0; + background: rgba(22, 121, 203, 1); + } + } + .p-container { + margin-top: 24rpx; + display: grid; + grid-template-columns: repeat(2, 1fr); + gap: 22rpx; + .photo { + display: block; + width: 100%; + height: 168rpx; + border-radius: 16rpx; + } + } + } + .container { + margin-top: 32rpx; + padding: 0 32rpx 28rpx; + border-radius: 24rpx; + background-color: #fff; + .row { + padding-top: 32rpx; + border-bottom: 1px solid rgba(34, 34, 34, 0.08); + &:last-of-type { + border: none; + } + .name { + font-size: 36rpx; + color: rgba(34, 34, 34, 1); + font-weight: bold; + display: flex; + align-items: center; + gap: 24rpx; + margin-left: -32rpx; + &::before { + content: ''; + width: 8rpx; + height: 36rpx; + border-radius: 0 8rpx 8rpx 0; + background: rgba(22, 121, 203, 1); + } + } + .content { + margin-top: 16rpx; + padding-bottom: 28rpx; + font-size: 36rpx; + color: rgba(34, 34, 34, 1); + display: flex; + align-items: center; + gap: 16rpx; + .icon { + width: 32rpx; + height: 37rpx; + } + } + } + } + .footer { + display: flex; + align-items: center; + justify-content: center; + .col { + flex: 1; + padding: 50rpx; + display: flex; + align-items: center; + justify-content: center; + gap: 12rpx; + .icon { + width: 44rpx; + height: 44rpx; + } + .name { + font-size: 36rpx; + color: #222222; + &.name1 { + color: rgba(22, 121, 203, 1); + } + } + } + .line { + width: 1px; + height: 36rpx; + background: rgba(34, 34, 34, 0.1); + } + } +} + +#drug-page { + .banner { + .b-header::before { + background: rgba(89, 86, 233, 1); + } + } + .photos { + .p-header::before { + background: rgba(89, 86, 233, 1); + } + } + .container { + .name::before { + background: rgba(89, 86, 233, 1); + } + } + .footer { + .name1 { + color: rgba(89, 86, 233, 1); + } + } +} diff --git a/src/doctor/pages/d_recordDetail/index.ts b/src/doctor/pages/d_recordDetail/index.ts new file mode 100644 index 0000000..e7bc2d0 --- /dev/null +++ b/src/doctor/pages/d_recordDetail/index.ts @@ -0,0 +1,175 @@ +const app = getApp() + +Page({ + data: { + id: 0, + visitDate: '', + nextVisitDate: '', + displayIgG4Value: '' as string | number | null, + medicationsLabel: '', + oralHormoneDosageMg: '' as string | number | null, + immunosuppressantLabel: '', + reminderEnabled: 2, + imageGroups: [] as { type: string; label: string; list: string[] }[], + change: 0, + + // 枚举 + medicationsMap: {} as Record, + immunosuppressantMap: {} as Record, + imageTypeLabels: {} as Record, + + patientId: '', + }, + + onLoad(options: any) { + app.waitLogin().then(() => { + app.mpBehavior({ PageName: 'PG_PatientRecordDetail', detailId: String(options.id) }) + this.getEnums().then(() => { + if (options.id) { + this.setData({ id: Number(options.id), patientId: options.pid }) + this.getDetail() + this.getReminderConfig() + } + }) + }) + }, + onShow() { + if (typeof this.__loaded === 'undefined') { + this.__loaded = true + return + } + this.getDetail() + this.getReminderConfig() + }, + + // ========== API ========== + + getEnums(): Promise { + return wx + .ajax({ + method: 'GET', + url: '?r=igg4/medical-visit/get-enums', + }) + .then((res: any) => { + if (!res) return + const medicationsMap: Record = {} + for (const item of res.medicationsUsed || []) { + medicationsMap[item.value] = item.label + } + const immunosuppressantMap: Record = {} + for (const item of res.immunosuppressantName || []) { + immunosuppressantMap[item.value] = item.label + } + const imageTypeLabels: Record = {} + for (const item of res.imageType || []) { + imageTypeLabels[item.value] = item.label + } + this.setData({ medicationsMap, immunosuppressantMap, imageTypeLabels }) + }) + }, + + getDetail() { + wx.ajax({ + method: 'GET', + url: '?r=igg4/doctor/medical-visit/detail', + data: { id: this.data.id, patientId: this.data.patientId }, + }).then((res: any) => { + if (!res) return + const { medicationsMap, immunosuppressantMap, imageTypeLabels } = this.data + const medicationsLabel = (res.medicationsUsed || []) + .map((id: number) => { + if (id === 99 && res.medicationsUsedOtherText) return `其他:${res.medicationsUsedOtherText}` + if (id === 99) return '' + return medicationsMap[id] + }) + .filter(Boolean) + .join('、') + const immunosuppressantLabel = (res.immunosuppressantName || []) + .map((id: number) => { + if (id === 99 && res.immunosuppressantNameOtherText) return `其他:${res.immunosuppressantNameOtherText}` + if (id === 99) return '' + return immunosuppressantMap[id] + }) + .filter(Boolean) + .join('、') + + const imageGroups: { type: string; label: string; list: string[] }[] = [] + const images = res.images || {} + for (const type of Object.keys(imageTypeLabels)) { + const list = (images[type] || []).map((img: any) => img.maskedImageUrl || img.imageUrl) + if (list.length) { + imageGroups.push({ type, label: imageTypeLabels[type], list }) + } + } + + this.setData({ + visitDate: res.visitDate || '', + nextVisitDate: res.nextVisitDate || '', + displayIgG4Value: res.displayIgG4Value, + medicationsLabel, + oralHormoneDosageMg: res.oralHormoneDosageMg, + immunosuppressantLabel, + imageGroups, + change: res.change, + }) + }) + }, + + getReminderConfig() { + wx.ajax({ + method: 'GET', + url: '?r=igg4/medical-visit/get-reminder-config', + }).then((res: any) => { + if (!res) return + this.setData({ reminderEnabled: res.reminderEnabled || 2 }) + }) + }, + + saveReminderConfig(e: any) { + const val = e.detail.value ? 1 : 2 + this.setData({ reminderEnabled: val }) + wx.ajax({ + method: 'POST', + url: '?r=igg4/medical-visit/save-reminder-config', + data: { reminderEnabled: val }, + }) + }, + + // ========== 操作 ========== + + handleDelete() { + wx.showModal({ + title: `删除${this.data.visitDate || ''}记录`, + content: `删除后将无法恢复`, + confirmText: '确认删除', + confirmColor: '#ee0a24', + success: (res) => { + if (!res.confirm) return + wx.ajax({ + method: 'POST', + url: '?r=igg4/medical-visit/delete', + data: { id: this.data.id }, + }).then((res: any) => { + if (!res) return + wx.navigateBack() + }) + }, + }) + }, + + handleEdit() { + wx.navigateTo({ url: `/gift/pages/record/index?id=${this.data.id}` }) + }, + + handlePreviewImage(e: any) { + const { url, type } = e.currentTarget.dataset + const group = this.data.imageGroups.find((g) => g.type === type) + if (!group) return + wx.previewImage({ + current: url, + urls: group.list, + }) + }, +}) + +export {} diff --git a/src/doctor/pages/d_recordDetail/index.wxml b/src/doctor/pages/d_recordDetail/index.wxml new file mode 100644 index 0000000..a63cfc2 --- /dev/null +++ b/src/doctor/pages/d_recordDetail/index.wxml @@ -0,0 +1,53 @@ + + + + {{item.label}} + + + + + + + IgG4值 + {{displayIgG4Value}} mg/dL + + + 本次就诊已使用的药物 + {{medicationsLabel}} + + + 最近一周,每日激素使用剂量 + {{oralHormoneDosageMg}}mg/天 + + + 正在使用的免疫抑制剂名称 + {{immunosuppressantLabel}} + + + diff --git a/src/doctor/pages/d_taskDetail/index.ts b/src/doctor/pages/d_taskDetail/index.ts index 572972c..0c5f616 100644 --- a/src/doctor/pages/d_taskDetail/index.ts +++ b/src/doctor/pages/d_taskDetail/index.ts @@ -24,10 +24,12 @@ Page({ }, MedicationTypeObj: { 0: '全部', + 1: '没有使用激素', 2: '激素', 3: '免疫抑制剂', 4: '靶向CD19生物制剂(伊奈利珠单抗)', 5: '靶向CD20生物制剂(利妥昔单抗等)', + 99: '其他', }, TemplateTypeObj: { 1: '复诊提醒', diff --git a/src/doctor/pages/d_taskList/index.ts b/src/doctor/pages/d_taskList/index.ts index 5768b3b..fc41655 100644 --- a/src/doctor/pages/d_taskList/index.ts +++ b/src/doctor/pages/d_taskList/index.ts @@ -25,10 +25,12 @@ Page({ }, MedicationTypeObj: { 0: '全部', + 1: '没有使用激素', 2: '激素', 3: '免疫抑制剂', 4: '靶向CD19生物制剂(伊奈利珠单抗)', 5: '靶向CD20生物制剂(利妥昔单抗等)', + 99: '其他', }, TemplateTypeObj: { 1: '复诊提醒', diff --git a/src/gift/pages/record/index.ts b/src/gift/pages/record/index.ts index bccb12e..9ebc76a 100644 --- a/src/gift/pages/record/index.ts +++ b/src/gift/pages/record/index.ts @@ -84,7 +84,7 @@ Page({ if (this.data.submitted || !this._hasFilledData()) { wx.disableAlertBeforeUnload() } else { - wx.enableAlertBeforeUnload({ message: '已填写信息将被保存为草稿', }) + wx.enableAlertBeforeUnload({ message: '已填写信息将被保存为草稿' }) } }, @@ -173,7 +173,7 @@ Page({ }) }, - saveDraft(): Promise { + saveDraft(loading = false): Promise { if (this.data.saving) return Promise.reject(new Error('saving')) if (!this.data.visitDate) return Promise.reject(new Error('no visitDate')) @@ -218,6 +218,7 @@ Page({ method: 'POST', url: '?r=igg4/medical-visit/save-draft', data, + loading, }) .then((res: any) => { if (res && res.id && !this.data.draftId) { @@ -479,7 +480,7 @@ Page({ this.setData({ toastShow: true, toastType: 'oneWrite', toastParams: {} }) return } - this.saveDraft().then(() => { + this.saveDraft(true).then(() => { // 编辑已提交的记录,无需再调用提交接口 if (this.data.recordStatus === 2) { this.setData({ submitted: true }) diff --git a/src/gift/pages/recordDetail/index.wxml b/src/gift/pages/recordDetail/index.wxml index bdc521f..95c273a 100644 --- a/src/gift/pages/recordDetail/index.wxml +++ b/src/gift/pages/recordDetail/index.wxml @@ -46,12 +46,6 @@ IgG4值 {{displayIgG4Value}} mg/dL - - diff --git a/src/gift/pages/recordList/index.scss b/src/gift/pages/recordList/index.scss index 3a890e6..025e2e2 100644 --- a/src/gift/pages/recordList/index.scss +++ b/src/gift/pages/recordList/index.scss @@ -217,7 +217,7 @@ page { align-items: baseline; line-height: 84rpx; .num { - font-size: 72rpx; + font-size: 58rpx; color: rgba(34, 34, 34, 1); font-weight: bold; }