cc12458 пре 1 година
родитељ
комит
f7116b6bcf

+ 37 - 22
src/pages/index/patient/room@default.vue

@@ -1,21 +1,23 @@
 <script setup lang="ts">
-import ReportAnalysisEdit                                  from '@/components/ReportAnalysisEdit.vue';
-import ReportHistoryPreview                                from '@/components/ReportHistoryPreview.vue';
-import type { ReportModel }                                from '@/model';
-import { patientMethod }                                   from '@/request/api/patient.api';
-import { reportMethod, reportSchemeMethod, reportsMethod } from '@/request/api/report.api';
-import PatientCardWidget                                   from '@/widgets/PatientCardWidget.vue';
-import PatientTagWidget                                    from '@/widgets/PatientTagWidget.vue';
-import ReportCardWidget                                    from '@/widgets/ReportCardWidget.vue';
-import ReportSchemeCardWidget                              from '@/widgets/ReportSchemeCardWidget.vue';
-import { useElementSize }                                  from '@vueuse/core';
-import { useRouteQuery }                                   from '@vueuse/router';
-import { invalidateCache }                                 from 'alova';
-import { useWatcher }                                      from 'alova/client';
-import { h }                                               from 'vue';
-import { useRouter }                                       from 'vue-router';
-import { RecycleScroller }                                 from 'vue-virtual-scroller';
-import { VxeUI }                                           from 'vxe-pc-ui';
+import ReportAnalysisEdit   from '@/components/ReportAnalysisEdit.vue';
+import ReportHistoryPreview from '@/components/ReportHistoryPreview.vue';
+import type { ReportModel } from '@/model';
+
+import { patientMethod }                                                        from '@/request/api/patient.api';
+import { confirmSchemeMethod, reportMethod, reportSchemeMethod, reportsMethod } from '@/request/api/report.api';
+
+import PatientCardWidget          from '@/widgets/PatientCardWidget.vue';
+import PatientTagWidget           from '@/widgets/PatientTagWidget.vue';
+import ReportCardWidget           from '@/widgets/ReportCardWidget.vue';
+import ReportSchemeCardWidget     from '@/widgets/ReportSchemeCardWidget.vue';
+import { useElementSize }         from '@vueuse/core';
+import { useRouteQuery }          from '@vueuse/router';
+import { invalidateCache }        from 'alova';
+import { useRequest, useWatcher } from 'alova/client';
+import { h }                      from 'vue';
+import { useRouter }              from 'vue-router';
+import { RecycleScroller }        from 'vue-virtual-scroller';
+import { VxeUI }                  from 'vxe-pc-ui';
 
 
 const patientId = useRouteQuery<string>('patientId');
@@ -39,7 +41,7 @@ const { data: reports, loading: reportsLoading } = useWatcher(
   },
 );
 
-const { data: report, loading: reportLoading } = useWatcher(
+const { data: report, loading: reportLoading, send: loadReport } = useWatcher(
   () => reportMethod(reportId.value!),
   [ reportId ],
   {
@@ -56,6 +58,12 @@ const { data: scheme, loading: schemeLoading, send: schemeRefresh } = useWatcher
     middleware: (_, next) => { if ( reportId.value ) next(); },
   },
 );
+const { loading: confirmSchemeLoading, send: confirmScheme } = useRequest(
+  () => confirmSchemeMethod(reportId.value),
+  { immediate: false },
+).onSuccess(() => {
+  loadReport(reportId.value!);
+});
 
 watchEffect(() => {
   if ( !reportId.value ) {
@@ -149,15 +157,22 @@ const { height } = useElementSize(patientCardRef);
               :loading="analysisReportPreviewOpening"
               @click="analysisReportPreviewOpening = true;openAnalysisEditHandle()"
             >
-              信息采集-{{ height }}
+              信息采集
             </a-button>
           </template>
         </ReportCardWidget>
       </div>
       <div class="area flex-auto" v-if="report?.scheme?.show">
-        <ReportSchemeCardWidget :dataset="scheme" :loading="schemeLoading" :editable="report.scheme.editable"
-                                @refresh="schemeRefreshHandle()"
-        />
+        <ReportSchemeCardWidget
+          :dataset="scheme" :loading="schemeLoading" :editable="report.scheme.editable"
+          @refresh="schemeRefreshHandle()"
+        >
+          <template #footer v-if="report?.scheme?.editable">
+            <div style="padding: 8px;background-color: #fff;text-align: center;">
+              <a-button type="primary" :loading="confirmSchemeLoading" @click="confirmScheme()">确认</a-button>
+            </div>
+          </template>
+        </ReportSchemeCardWidget>
       </div>
       <a-result class="area" v-if="!patientId" style="background-color: #fff;" status="warning" title="未选择用户">
         <template #extra>

+ 17 - 1
src/request/api/report.api.ts

@@ -32,6 +32,7 @@ export function reportsMethod(patientId: string) {
 
 export function reportMethod(id: string) {
   return request.Get<ReportModel, any>(`/fdhb-pc/analysisManage/getHealRepDetailById`, {
+    hitSource: 'confirm-scheme',
     params: { healthAnalysisReportId: id },
     transform(data, headers) {
       return {
@@ -39,7 +40,10 @@ export function reportMethod(id: string) {
         id: data.healthAnalysisReportId,
         time: data.reportTime,
 
-        scheme: { show: data.isHaveConditioningProgram === 'Y', editable: data.isConfirmConditioningProgram !== 'Y' },
+        scheme: {
+          show: data.isHaveConditioningProgram === 'Y',
+          editable: data.isConfirmConditioningProgram !== 'Y',
+        },
       };
     },
   });
@@ -93,6 +97,18 @@ export function deleteSchemeMethod(reportId: string, scheme: ReportSchemeItemMod
   });
 }
 
+/**
+ * 确认调理方案
+ * @param reportId 报告 ID
+ */
+export function confirmSchemeMethod(reportId: string) {
+  return request.Get(`/fdhb-pc/analysisManage/condProgramConfirm`, {
+    name: 'confirm-scheme',
+    params: { healthAnalysisReportId: reportId },
+    cacheFor: null,
+  });
+}
+
 /**
  * 报告指标
  * @param reportId 报告 ID

+ 7 - 3
src/widgets/ReportSchemeCardWidget.vue

@@ -152,8 +152,8 @@ function openSchemeHandle(mode: 'edit' | 'preview', item?: ReportSchemeItemModel
 }
 </script>
 <template>
-  <div class="card report-card" ref="container">
-    <div class="card__header sticky flex justify-between items-center">
+  <div class="card report-card flex flex-col" ref="container">
+    <div class="card__header flex-none sticky flex justify-between items-center">
       <div class="card__title">
         <span>{{ props.title }}</span>
         <a-spin v-if="props.loading" size="small" style="margin-left: 4px;" />
@@ -172,7 +172,7 @@ function openSchemeHandle(mode: 'edit' | 'preview', item?: ReportSchemeItemModel
         </a-space>
       </div>
     </div>
-    <div class="card__content">
+    <div class="card__content flex-auto">
       <a-collapse
         v-model:activeKey="panelKeys"
         :bordered="false"
@@ -211,12 +211,16 @@ function openSchemeHandle(mode: 'edit' | 'preview', item?: ReportSchemeItemModel
         </template>
       </a-collapse>
     </div>
+    <div class="cart__footer flex-none sticky bottom-0">
+      <slot name="footer"></slot>
+    </div>
   </div>
 </template>
 <style scoped lang="scss">
 @import "@/themes/report-card";
 
 .report-card {
+  min-height: var(--page-main-container);
   :deep(.ant-descriptions-item-label) {
     text-align: center;
   }