فهرست منبع

医生端新增个微处方菜单

cgp 1 هفته پیش
والد
کامیت
e575f3dd81
3فایلهای تغییر یافته به همراه922 افزوده شده و 2 حذف شده
  1. 25 0
      src/api/his/prescribe.js
  2. 8 2
      src/router/index.js
  3. 889 0
      src/views/his/personalPrescribe/index.vue

+ 25 - 0
src/api/his/prescribe.js

@@ -25,6 +25,31 @@ export function confirmPrescribe(payload) {
   })
 }
 
+
+// 查询处方列表
+export function waitPrescribeAfterPaymentList(query) {
+
+  return request({
+    url: '/his/prescribe/waitPrescribeAfterPaymentList',
+    method: 'post',
+    data: query
+  })
+}
+
+/**
+ * 确认处方
+ * @param payload
+ * @returns {*}
+ */
+export function confirmPrescribeAfterPayment(payload) {
+
+  return request({
+    url: '/his/prescribe/confirmPrescribeAfterPayment',
+    method: 'post',
+    data: payload
+  })
+}
+
 /**
  * 拒方
  * @param payload

+ 8 - 2
src/router/index.js

@@ -162,17 +162,23 @@ export const constantRoutes = [
         name: '患者评价',
         meta: { title: '患者评价', icon: 'job', noCache: true, affix: false }
       },
+      {
+        path: 'personalPrescribe',
+        component: (resolve) => require(['@/views/his/personalPrescribe/index'], resolve),
+        name: '个微处方',
+        meta: { title: '个微处方', icon: 'user', noCache: true, affix: false }
+      },
       {
         path: 'prescribe',
         component: (resolve) => require(['@/views/his/prescribe/index'], resolve),
         name: '用户处方',
-        meta: { title: '用户处方', icon: 'job', noCache: true, affix: false }
+        meta: { title: '用户处方', icon: 'form', noCache: true, affix: false }
       },
       {
         path: 'refuse',
         component: (resolve) => require(['@/views/his/refuse/index'], resolve),
         name: '拒方列表',
-        meta: { title: '拒方列表', icon: 'job', noCache: true, affix: false }
+        meta: { title: '拒方列表', icon: 'server', noCache: true, affix: false }
       },
     ]
   },

+ 889 - 0
src/views/his/personalPrescribe/index.vue

@@ -0,0 +1,889 @@
+<template>
+  <div class="app-container">
+    <!-- 查询表单 -->
+    <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
+      <el-form-item label="处方类型" prop="prescribeType">
+        <el-select v-model="queryParams.prescribeType" placeholder="请选择处方类型" clearable>
+          <el-option label="西药" :value="1"></el-option>
+          <el-option label="中药" :value="2"></el-option>
+          <el-option label="OTC" :value="3"></el-option>
+        </el-select>
+      </el-form-item>
+      <el-form-item label="处方单号" prop="prescribeCode">
+        <el-input v-model="queryParams.prescribeCode" placeholder="请输入处方单号" clearable @keyup.enter.native="handleQuery" />
+      </el-form-item>
+      <el-form-item label="患者姓名" prop="patientName">
+        <el-input v-model="queryParams.patientName" placeholder="请输入患者姓名" clearable @keyup.enter.native="handleQuery" />
+      </el-form-item>
+      <el-form-item label="医生姓名" prop="doctorName">
+        <el-input v-model="queryParams.doctorName" placeholder="请输入医生姓名" clearable @keyup.enter.native="handleQuery" />
+      </el-form-item>
+      <el-form-item label="创建时间" prop="dateRange">
+        <el-date-picker v-model="dateRange" type="daterange" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" value-format="yyyy-MM-dd" @change="handleDateRangeChange" />
+      </el-form-item>
+      <el-form-item label="审核时间" prop="auditRange">
+        <el-date-picker v-model="auditRange" type="daterange" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" value-format="yyyy-MM-dd" @change="handleAuditDateRangeChange" />
+      </el-form-item>
+      <el-form-item>
+        <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
+        <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
+      </el-form-item>
+    </el-form>
+
+    <el-row :gutter="10" class="mb8">
+      <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
+    </el-row>
+
+    <!-- 处方列表 -->
+    <el-table v-loading="loading" :data="prescribeList" @selection-change="handleSelectionChange">
+      <el-table-column type="selection" width="55" align="center" />
+      <el-table-column label="处方ID" align="center" prop="prescribeId" />
+      <el-table-column label="处方单号" align="center" prop="prescribeCode" />
+      <el-table-column label="处方类型" align="center" prop="prescribeType">
+        <template slot-scope="scope">
+          <dict-tag :options="prescribeTypeOptions" :value="scope.row.prescribeType" />
+        </template>
+      </el-table-column>
+      <el-table-column label="患者姓名" align="center" prop="patientName" />
+      <el-table-column label="医生姓名" align="center" prop="doctorName" />
+      <el-table-column label="是否确认" align="center" prop="doctorConfirm">
+        <template slot-scope="scope">
+          <dict-tag :options="doctorConfirmOptions" :value="scope.row.doctorConfirm" />
+        </template>
+      </el-table-column>
+      <el-table-column label="拒方次数" align="center" prop="refuseCount" />
+      <el-table-column label="操作时间" align="center" prop="operateTime" />
+      <el-table-column label="审核时间" align="center" prop="auditTime" width="180">
+        <template slot-scope="scope">
+          <span>{{ parseTime(scope.row.auditTime, '{y}-{m}-{d}') }}</span>
+        </template>
+      </el-table-column>
+      <el-table-column label="处方图片" align="center" prop="prescribePic">
+        <template slot-scope="scope">
+          <el-image v-if="scope.row.doctorConfirm == 1" style="width: 100px; height: 100px" :src="scope.row.prescribeImgUrl" :preview-src-list="[scope.row.prescribeImgUrl]" />
+        </template>
+      </el-table-column>
+      <el-table-column label="创建时间" align="center" prop="createTime" width="180">
+        <template slot-scope="scope">
+          <span>{{ parseTime(scope.row.createTime, '{y}-{m}-{d} {h}:{i}:{s}') }}</span>
+        </template>
+      </el-table-column>
+      <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
+        <template slot-scope="scope">
+          <el-button v-if="scope.row.doctorConfirm == 0" size="mini" type="text" icon="el-icon-edit" @click="handleViewOrPrescribe(scope.row)">开方</el-button>
+          <el-button v-if="scope.row.doctorConfirm == 1" size="mini" type="text" @click="handleViewOrPrescribe(scope.row)">查看</el-button>
+          <el-button v-if="scope.row.doctorConfirm == 1" size="mini" type="text" @click="handleRecord(scope.row)">审核记录</el-button>
+        </template>
+      </el-table-column>
+    </el-table>
+
+    <pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNum" :limit.sync="queryParams.pageSize" @pagination="getList" />
+
+    <!-- 处方详情/开方弹窗 -->
+    <el-dialog :title="title" :visible.sync="open" width="90%" append-to-body @close="handleDialogClose">
+      <el-tabs v-model="activeTab" type="border-card">
+        <!-- 基本信息 -->
+        <el-tab-pane label="基本信息" name="basic">
+          <el-form ref="form" :model="form" :rules="rules" label-width="120px">
+            <el-form-item label="处方类型" prop="prescribeType">
+              <el-radio-group v-model="form.prescribeType" :disabled="currentConfirm === 1">
+                <el-radio :label="1">西药</el-radio>
+                <el-radio :label="2">中药</el-radio>
+                <el-radio :label="3">OTC</el-radio>
+              </el-radio-group>
+            </el-form-item>
+            <el-form-item label="订单ID" prop="inquiryOrderId">
+              <el-input v-model="form.inquiryOrderId" placeholder="请输入订单ID" disabled />
+            </el-form-item>
+            <el-form-item label="店铺订单ID" prop="storeOrderId">
+              <el-input v-model="form.storeOrderId" placeholder="请输入店铺订单ID" disabled />
+            </el-form-item>
+            <el-form-item label="患者姓名" prop="patientName">
+              <el-input v-model="form.patientName" placeholder="请输入患者姓名" :disabled="currentConfirm === 1" />
+            </el-form-item>
+            <el-form-item label="患者年龄" prop="patientAge">
+              <el-input v-model="form.patientAge" placeholder="请输入患者年龄" :disabled="currentConfirm === 1" />
+            </el-form-item>
+            <el-form-item label="患者性别" prop="patientGender">
+              <el-select v-model="form.patientGender" placeholder="请选择患者性别" :disabled="currentConfirm === 1">
+                <el-option label="男" value="1"></el-option>
+                <el-option label="女" value="2"></el-option>
+              </el-select>
+            </el-form-item>
+            <el-form-item label="体重" prop="weight">
+              <el-input v-model="form.weight" placeholder="请输入体重" :disabled="currentConfirm === 1" />
+            </el-form-item>
+            <el-form-item label="是否有过敏史" prop="isHistoryAllergic">
+              <el-radio-group v-model="form.isHistoryAllergic" :disabled="currentConfirm === 1">
+                <el-radio label="是">是</el-radio>
+                <el-radio label="否">否</el-radio>
+              </el-radio-group>
+            </el-form-item>
+            <el-form-item label="过敏史" prop="historyAllergic" :required="form.isHistoryAllergic === '是'">
+              <el-input v-model="form.historyAllergic" placeholder="请输入过敏史" :disabled="currentConfirm === 1 || form.isHistoryAllergic === '否'" />
+            </el-form-item>
+            <el-button type="success" size="mini" style="position: absolute; bottom: 5px; right: 180px;" @click="openDoctorAdviceDialog" :disabled="!form.prescribeId || !form.userId">
+              查看医生建议
+            </el-button>
+            <el-button type="primary" size="mini" style="position: absolute; bottom: 5px; right: 20px;" @click="openCollectionInfo">
+              查看采集信息
+            </el-button>
+          </el-form>
+        </el-tab-pane>
+
+        <!-- 处方药品信息 -->
+        <el-tab-pane label="处方药品信息" name="drug">
+          <div class="drug-split-layout">
+            <div class="drug-left-panel">
+              <el-form ref="drugFormRef" :model="form" :rules="rules" label-width="120px">
+                <el-form-item label="诊断" prop="diagnose">
+                  <el-input v-model="form.diagnose" placeholder="请输入诊断" :disabled="currentConfirm === 1">
+                    <i slot="suffix" class="el-icon-search el-input__icon" style="cursor: pointer;" @click="handleCommonlyDiagnoseWorlds" v-if="currentConfirm === 0"></i>
+                  </el-input>
+                </el-form-item>
+                <el-form-item label="医嘱" prop="remark">
+                  <el-input v-model="form.remark" type="textarea" placeholder="请输入医嘱" :disabled="currentConfirm === 1" />
+                </el-form-item>
+              </el-form>
+              <el-row :gutter="10" class="mb8" v-if="currentConfirm === 0">
+                <el-col :span="1.5">
+                  <el-button type="primary" icon="el-icon-plus" size="mini" @click="handleAddDrug" :disabled="!form.prescribeId">新增药品</el-button>
+                </el-col>
+                <el-col :span="2.5">
+                  <el-button type="success" icon="el-icon-search" size="mini" @click="openCommonPrescribeDialog" :disabled="!form.prescribeId">常用药品</el-button>
+                </el-col>
+              </el-row>
+              <el-table v-loading="drugLoading" :data="drugList" border max-height="400">
+                <el-table-column label="药品名称" align="center" prop="drugName" />
+                <el-table-column label="规格" align="center" prop="drugSpec" width="100" />
+                <el-table-column label="使用方法" align="center" prop="usageMethod" width="100" />
+                <el-table-column label="频次" align="center" prop="usageFrequencyUnit" width="80" />
+                <el-table-column label="每次用药数量" align="center" width="120">
+                  <template slot-scope="scope">
+                    {{ scope.row.usagePerUseCount }}{{ scope.row.usagePerUseUnit }}
+                  </template>
+                </el-table-column>
+                <el-table-column v-if="currentConfirm === 0" label="操作" align="center" width="150">
+                  <template slot-scope="scope">
+                    <el-button size="mini" type="text" icon="el-icon-edit" @click="handleUpdateDrug(scope.row)">编辑</el-button>
+                    <el-button size="mini" type="text" icon="el-icon-delete" @click="handleDeleteDrug(scope.row)">删除</el-button>
+                  </template>
+                </el-table-column>
+              </el-table>
+              <pagination v-show="drugTotal > 0" :total="drugTotal" :page.sync="drugQueryParams.pageNum" :limit.sync="drugQueryParams.pageSize" @pagination="getDrugList" />
+            </div>
+            <div class="drug-right-panel">
+              <div v-if="form.prescribeImgUrl" class="real-prescription-wrapper">
+                <img :src="form.prescribeImgUrl" class="prescription-image-small" alt="处方图片" />
+              </div>
+              <div v-else class="prescription-preview-container-wrapper">
+                <div class="prescription-preview-container">
+                  <img src="/ysy_prescribe.jpg" class="prescription-bg-image" alt="处方背景" />
+                  <div class="prescription-overlay">
+                    <div class="prescribe-code-row">
+                      <div class="prescribe-code-content">{{ form.prescribeCode }}</div>
+                    </div>
+                    <div class="patient-info-row">
+                      <div class="prescribe-patientName">{{ form.patientName }}</div>
+                      <div class="prescribe-patientGender">{{ form.patientGender === '1' ? '男' : form.patientGender === '2' ? '女' : '—' }}</div>
+                      <div class="prescribe-patientAge">{{ form.patientAge }}</div>
+                    </div>
+                    <div class="field diagnose">{{ form.diagnose }}</div>
+                    <div class="field drugs">
+                      <template v-if="drugList.length > 0">
+                        <div v-for="(drug, index) in drugList" :key="drug.id || index" class="drug-item">
+                          {{ drug.drugName }} {{ drug.drugSpec ? `(${drug.drugSpec})\n` : '' }}
+                          <span class="usage-amount">用法用量:{{ drug.usageMethod }} {{ drug.usageFrequencyUnit }} {{ drug.usagePerUseCount }}{{ drug.usagePerUseUnit }}</span>
+                        </div>
+                      </template>
+                      <span v-else>(暂无药品)</span>
+                    </div>
+                    <div class="field remark">{{ form.remark }}</div>
+                  </div>
+                </div>
+              </div>
+            </div>
+          </div>
+        </el-tab-pane>
+
+        <!-- 采集信息详情 -->
+        <el-tab-pane label="采集信息详情" name="userCollection">
+          <el-row :gutter="20" style="margin-bottom: 20px;">
+            <el-col :span="8"><div class="info-item"><span class="label">患者姓名:</span><span class="value">{{ form.patientName || '—' }}</span></div></el-col>
+            <el-col :span="8"><div class="info-item"><span class="label">患者年龄:</span><span class="value">{{ form.patientAge || '—' }}</span></div></el-col>
+            <el-col :span="8"><div class="info-item"><span class="label">患者性别:</span><span class="value">{{ form.patientGender === '1' ? '男' : form.patientGender === '2' ? '女' : '—' }}</span></div></el-col>
+          </el-row>
+          <el-row :gutter="20">
+            <el-col :span="8"><div class="info-item"><span class="label">体重:</span><span class="value">{{ form.weight ? form.weight + ' kg' : '—' }}</span></div></el-col>
+            <el-col :span="8"><div class="info-item"><span class="label">是否有过敏史:</span><span class="value">{{ form.isHistoryAllergic || '—' }}</span></div></el-col>
+            <el-col :span="8"><div class="info-item"><span class="label">过敏史:</span><span class="value">{{ form.isHistoryAllergic === '是' ? (form.historyAllergic || '—') : '无' }}</span></div></el-col>
+          </el-row>
+          <collectionDetail :userId="form.userId" :thirdPartyUserId="form.thirdPartyUserId" :prescribeId="form.prescribeId" v-if="form.userId || form.thirdPartyUserId" />
+        </el-tab-pane>
+      </el-tabs>
+
+      <span slot="footer" class="dialog-footer">
+        <el-button @click="open = false">关 闭</el-button>
+        <el-button type="primary" @click="handleConfirmPrescribe" v-if="currentConfirm === 0">确认处方</el-button>
+      </span>
+    </el-dialog>
+
+    <!-- 药品新增/编辑对话框 -->
+    <el-dialog :title="drugTitle" :visible.sync="drugOpen" width="700px" append-to-body>
+      <el-form ref="drugForm" :model="drugForm" label-width="120px">
+        <el-form-item label="药品名称" prop="drugName"><el-input v-model="drugForm.drugName" placeholder="请输入药品名称" /></el-form-item>
+        <el-form-item label="规格" prop="drugSpec"><el-input v-model="drugForm.drugSpec" placeholder="请输入规格" /></el-form-item>
+        <el-form-item label="使用方法" prop="usageMethod"><el-input v-model="drugForm.usageMethod" placeholder="请输入使用方法" /></el-form-item>
+        <el-form-item label="每次用药数量" prop="usagePerUseCount"><el-input v-model="drugForm.usagePerUseCount" placeholder="请输入每次用药数量" /></el-form-item>
+        <el-form-item label="药品频次" prop="usageFrequencyUnit"><el-input v-model="drugForm.usageFrequencyUnit" placeholder="请输入药品频次,如:每日3次" /></el-form-item>
+      </el-form>
+      <span slot="footer" class="dialog-footer">
+        <el-button @click="drugOpen = false">取 消</el-button>
+        <el-button type="primary" @click="submitDrugForm">确 定</el-button>
+      </span>
+    </el-dialog>
+
+    <!-- 常用诊断语对话框 -->
+    <el-dialog :title="suggestDialogTitle" :visible.sync="showSuggestDialog" width="600px" append-to-body @closed="clearSuggestList">
+      <el-table :data="suggestList" height="300" border @row-click="handleSuggestRowClick">
+        <el-table-column type="index" width="50" />
+        <el-table-column label="内容" prop="diagnose" show-overflow-tooltip />
+        <el-table-column label="操作" width="80" align="center">
+          <template slot-scope="scope">
+            <el-button type="text" size="small" @click.stop="handleAddSuggest(scope.row)">添加</el-button>
+          </template>
+        </el-table-column>
+      </el-table>
+      <pagination v-show="suggestTotal > 0" :total="suggestTotal" :page.sync="suggestQuery.pageNum" :limit.sync="suggestQuery.pageSize" @pagination="getSuggestList" />
+    </el-dialog>
+
+    <!-- 常用药品选择对话框 -->
+    <el-dialog title="选择常用药品" :visible.sync="commonPrescribeDialogVisible" width="800px" append-to-body @open="handleOpenCommonPrescribeDialog">
+      <el-form :model="commonDrugQuery" :inline="true" size="small" label-width="80px">
+        <el-form-item label="药品名称" prop="drugName"><el-input v-model="commonDrugQuery.drugName" placeholder="请输入药品名称" clearable @keyup.enter.native="handleCommonPrescribeQuery" /></el-form-item>
+        <el-form-item>
+          <el-button type="primary" icon="el-icon-search" size="mini" @click="handleCommonPrescribeQuery">搜索</el-button>
+          <el-button icon="el-icon-refresh" size="mini" @click="resetCommonPrescribeQuery">重置</el-button>
+        </el-form-item>
+      </el-form>
+      <el-table v-loading="commonPrescribeLoading" :data="commonDrugList" border max-height="400">
+        <el-table-column label="药品名称" align="center" prop="drugName" show-overflow-tooltip />
+        <el-table-column label="规格" align="center" prop="drugSpec" width="100" />
+        <el-table-column label="用法" align="center" prop="usageMethod" width="100" />
+        <el-table-column label="频次" align="center" prop="usageFrequencyUnit" width="100" />
+        <el-table-column label="每次用量" align="center" prop="usagePerUseCount" width="100" />
+        <el-table-column label="操作" align="center" width="100">
+          <template slot-scope="scope">
+            <el-button size="mini" type="text" icon="el-icon-check" @click="applyCommonPrescribe(scope.row)">应用</el-button>
+          </template>
+        </el-table-column>
+      </el-table>
+      <pagination v-show="commonPrescribeTotal > 0" :total="commonPrescribeTotal" :page.sync="commonDrugQuery.pageNum" :limit.sync="commonDrugQuery.pageSize" @pagination="getCommonPrescribeList" />
+    </el-dialog>
+
+    <!-- 审核记录对话框 -->
+    <el-dialog title="审核记录" :visible.sync="recordDialogVisible" width="1000px" append-to-body>
+      <el-table v-loading="recordLoading" :data="recordList" border max-height="400">
+        <el-table-column label="审核药师" align="center" prop="drugDoctorName" />
+        <el-table-column label="拒方原因" align="center" prop="auditReason" show-overflow-tooltip />
+        <el-table-column label="处方图片" align="center" width="140">
+          <template slot-scope="scope">
+            <el-image v-if="scope.row.prescribeImgUrl" :src="scope.row.prescribeImgUrl" :preview-src-list="[scope.row.prescribeImgUrl]" style="width: 120px; height: 120px" fit="cover" />
+            <span v-else>无</span>
+          </template>
+        </el-table-column>
+        <el-table-column label="审核时间" align="center" prop="createTime" />
+        <el-table-column label="审核状态" align="center" width="120">
+          <template slot-scope="scope">
+            {{ statusFormat(scope.row.auditStatus != null ? scope.row.auditStatus : scope.row.status) }}
+          </template>
+        </el-table-column>
+      </el-table>
+    </el-dialog>
+  </div>
+</template>
+
+<script>
+import { getCommonDrugList } from '@/api/commonlyDrug';
+import { getCommonDiagnoseList } from '@/api/commonlyDiagnose';
+import collectionDetail from '@/views/components/collection/collectionDetail.vue';
+import { waitPrescribeAfterPaymentList, confirmPrescribeAfterPayment, recordList } from '@/api/his/prescribe';
+import { listPrescribeDrug, addPrescribeDrug, updatePrescribeDrug, deletePrescribeDrug } from "@/api/his/prescribeDrug";
+import { getCollectionByUserId } from "@/api/collection";
+
+export default {
+  components: { collectionDetail },
+  data() {
+    const validateAllergyHistory = (rule, value, callback) => {
+      if (this.form.isHistoryAllergic === '是' && !value) {
+        callback(new Error('请填写过敏史'));
+      } else {
+        callback();
+      }
+    };
+    return {
+      loading: false,
+      ids: [],
+      showSearch: true,
+      total: 0,
+      prescribeList: [],
+      title: "",
+      open: false,
+      dateRange: [],
+      auditRange: [],
+      currentConfirm: null,
+      doctorConfirmOptions: [
+        { dictValue: '0', dictLabel: "未确认" },
+        { dictValue: '1', dictLabel: "已确认" }
+      ],
+      prescribeTypeOptions: [
+        { dictValue: '1', dictLabel: "西药" },
+        { dictValue: '2', dictLabel: "中药" },
+        { dictValue: '3', dictLabel: "OTC" }
+      ],
+      queryParams: {
+        pageNum: 1,
+        pageSize: 10,
+        prescribeType: undefined,
+        prescribeCode: undefined,
+        patientName: undefined,
+        doctorName: undefined,
+        beginCreateTime: undefined,
+        endCreateTime: undefined,
+        beginAuditTime: undefined,
+        endAuditTime: undefined
+      },
+      form: {},
+      rules: {
+        prescribeType: [{ required: true, message: "处方类型不能为空", trigger: "change" }],
+        patientName: [{ required: true, message: "患者姓名不能为空", trigger: "blur" }],
+        patientAge: [{ required: true, message: "患者年龄不能为空", trigger: "blur" }],
+        patientGender: [{ required: true, message: "患者性别不能为空", trigger: "change" }],
+        isHistoryAllergic: [{ required: true, message: "患者是否有过敏史不能为空", trigger: "change" }],
+        historyAllergic: [{ validator: validateAllergyHistory, trigger: ["blur", "change"] }],
+        diagnose: [{ required: true, message: "诊断不能为空", trigger: "blur" }],
+        remark: [{ required: true, message: "医嘱不能为空", trigger: "blur" }]
+      },
+      activeTab: 'basic',
+      drugLoading: false,
+      drugList: [],
+      drugTotal: 0,
+      drugOpen: false,
+      drugTitle: "",
+      drugForm: {},
+      drugQueryParams: {
+        pageNum: 1,
+        pageSize: 10,
+        prescribeId: undefined
+      },
+      // 医生建议
+      doctorAdviceContent: '',
+      doctorAdviceDialogVisible: false,
+      collectionDialogVisible: false,
+      // 常用诊断
+      suggestList: [],
+      suggestTotal: 0,
+      showSuggestDialog: false,
+      suggestQuery: { pageNum: 1, pageSize: 10 },
+      // 常用药品
+      commonPrescribeDialogVisible: false,
+      commonPrescribeLoading: false,
+      commonDrugList: [],
+      commonPrescribeTotal: 0,
+      commonDrugQuery: { pageNum: 1, pageSize: 10, drugName: undefined },
+      // 审核记录
+      recordLoading: false,
+      recordList: [],
+      recordDialogVisible: false
+    };
+  },
+  computed: {
+    suggestDialogTitle() {
+      return '选择常用诊断内容';
+    }
+  },
+  created() {
+    this.getList();
+  },
+  watch: {
+    activeTab(newVal) {
+      if (newVal === 'drug' && this.form.prescribeId) {
+        this.getDrugList();
+      }
+    },
+    'form.isHistoryAllergic': function(newVal) {
+      if (newVal === '否') this.form.historyAllergic = '';
+      this.$nextTick(() => { if (this.$refs.form) this.$refs.form.validateField('historyAllergic'); });
+    }
+  },
+  methods: {
+    statusFormat(val) {
+      if (val === 0 || val === '0') return '待审核';
+      if (val === 1 || val === '1') return '审核通过';
+      if (val === 2 || val === '2') return '审核不通过';
+      return '-';
+    },
+    handleRecord(row) {
+      this.recordDialogVisible = true;
+      this.recordLoading = true;
+      recordList(row.prescribeId).then(res => {
+        this.recordLoading = false;
+        this.recordList = res.data;
+      }).catch(() => { this.recordLoading = false; });
+    },
+    getList() {
+      this.loading = true;
+      let userId = this.$store.state.user.userId;
+      let query = this.addDateRange(this.queryParams, this.dateRange, 'Create');
+      query.doctorId = userId.toString().replaceAll("D-", "").toString();
+      waitPrescribeAfterPaymentList(query).then(response => {
+        this.prescribeList = response.rows;
+        this.total = response.total;
+        this.loading = false;
+      }).catch(() => { this.loading = false; });
+    },
+    getDrugList() {
+      if (!this.form.prescribeId) return;
+      this.drugLoading = true;
+      this.drugQueryParams.prescribeId = this.form.prescribeId;
+      listPrescribeDrug(this.drugQueryParams).then(response => {
+        this.drugList = response.rows;
+        this.drugTotal = response.total;
+        this.drugLoading = false;
+      }).catch(() => { this.drugLoading = false; });
+    },
+    addDateRange(params, dateRange, type) {
+      let obj = { ...params };
+      if (dateRange && dateRange.length) {
+        if (type === 'Create') {
+          obj.beginCreateTime = dateRange[0];
+          obj.endCreateTime = dateRange[1];
+        } else if (type === 'Audit') {
+          obj.beginAuditTime = dateRange[0];
+          obj.endAuditTime = dateRange[1];
+        }
+      }
+      return obj;
+    },
+    handleDateRangeChange(val) {
+      this.queryParams.beginCreateTime = val ? val[0] : undefined;
+      this.queryParams.endCreateTime = val ? val[1] : undefined;
+    },
+    handleAuditDateRangeChange(val) {
+      this.queryParams.beginAuditTime = val ? val[0] : undefined;
+      this.queryParams.endAuditTime = val ? val[1] : undefined;
+    },
+    resetQuery() {
+      this.dateRange = [];
+      this.auditRange = [];
+      this.resetForm("queryForm");
+      this.handleQuery();
+    },
+    handleQuery() {
+      this.queryParams.pageNum = 1;
+      this.getList();
+    },
+    handleSelectionChange(selection) {
+      this.ids = selection.map(item => item.prescribeId);
+    },
+    handleViewOrPrescribe(row) {
+      if (row.prescribeSource === 1 && row.completeStatus === 0) {
+        this.$message.warning('请联系销售完善患者采集信息!');
+        return;
+      }
+      this.resetFormData();
+      const prescribeId = row.prescribeId || this.ids[0];
+      this.currentConfirm = row.doctorConfirm;
+      getPrescribe(prescribeId).then(response => {
+        this.form = response.data;
+        if (this.form.historyAllergic) {
+          this.form.isHistoryAllergic = "是";
+        } else {
+          this.form.isHistoryAllergic = "否";
+        }
+        this.open = true;
+        this.title = this.currentConfirm == 0 ? "修改处方" : "查看处方";
+        this.activeTab = 'basic';
+        if (this.form.prescribeId) {
+          this.drugQueryParams.prescribeId = this.form.prescribeId;
+        }
+      });
+    },
+    async handleConfirmPrescribe() {
+      const missingField = this.getFirstMissingField();
+      if (missingField) {
+        this.$message.error(`请填写${missingField}`);
+        return;
+      }
+      try {
+        const response = await confirmPrescribeAfterPayment(this.form);
+        if (response.code === 200) {
+          this.$message.success("确认成功!");
+          this.open = false;
+          this.getList();
+        } else {
+          this.$message.error(response.message || "确认失败");
+        }
+      } catch (error) {
+        console.error('确认处方失败:', error);
+        this.$message.error("操作失败,请重试");
+      }
+    },
+    getFirstMissingField() {
+      const fieldConfig = {
+        'prescribeType': '处方类型',
+        'patientName': '患者姓名',
+        'patientAge': '患者年龄',
+        'patientGender': '患者性别',
+        'isHistoryAllergic': '是否有过敏史',
+        'diagnose': '诊断',
+        'remark': '医嘱'
+      };
+      for (let [key, name] of Object.entries(fieldConfig)) {
+        const value = this.form[key];
+        if (value === undefined || value === null || value === '') return name;
+        if (key === 'isHistoryAllergic' && value === '是' && !this.form.historyAllergic) return '过敏史';
+      }
+      return null;
+    },
+    handleDialogClose() {
+      this.drugList = [];
+      this.currentConfirm = null;
+      this.drugTotal = 0;
+      this.drugQueryParams.pageNum = 1;
+      this.activeTab = 'basic';
+    },
+    handleAddDrug() {
+      if (!this.form.prescribeId) {
+        this.$message.warning("请先保存处方基本信息后再添加药品");
+        return;
+      }
+      this.resetDrugForm();
+      this.drugOpen = true;
+      this.drugTitle = "新增药品";
+    },
+    handleUpdateDrug(row) {
+      this.resetDrugForm();
+      this.drugForm = { ...row };
+      this.drugOpen = true;
+      this.drugTitle = "修改药品";
+    },
+    submitDrugForm() {
+      this.$refs["drugForm"].validate(valid => {
+        if (valid) {
+          this.drugForm.prescribeId = this.form.prescribeId;
+          const request = this.drugForm.drugId != undefined ? updatePrescribeDrug(this.drugForm) : addPrescribeDrug(this.drugForm);
+          request.then(() => {
+            this.$message.success(this.drugForm.drugId ? "修改成功" : "新增成功");
+            this.drugOpen = false;
+            this.getDrugList();
+          });
+        }
+      });
+    },
+    handleDeleteDrug(row) {
+      this.$confirm('是否确认删除药品"' + row.drugName + '"?').then(() => {
+        return deletePrescribeDrug(row.drugId);
+      }).then(() => {
+        this.$message.success("删除成功");
+        if (this.drugList.length === 1 && this.drugQueryParams.pageNum > 1) this.drugQueryParams.pageNum--;
+        this.getDrugList();
+      });
+    },
+    openDoctorAdviceDialog() {
+      const userId = this.form.userId;
+      if (!userId) return this.$message.warning("缺少患者用户ID。");
+      this.doctorAdviceContent = '';
+      getCollectionByUserId(userId).then(res => {
+        this.doctorAdviceContent = res.data?.doctorAdvice || '';
+        if (!this.doctorAdviceContent) this.$message.info("暂无医生建议内容。");
+        this.doctorAdviceDialogVisible = true;
+      }).catch(() => { this.$message.error("获取医生建议信息失败"); });
+    },
+    openCollectionInfo() {
+      if (!this.form.userId && !this.form.thirdPartyUserId) {
+        this.$message.warning("患者ID信息缺失!");
+        return;
+      }
+      this.collectionDialogVisible = true;
+    },
+    resetFormData() {
+      this.form = {
+        prescribeId: undefined, prescribeCode: undefined, prescribeType: 1, inquiryOrderId: undefined,
+        patientName: undefined, patientAge: undefined, patientGender: "1", patientTel: undefined,
+        weight: undefined, isHistoryAllergic: "否", historyAllergic: undefined, diagnose: undefined,
+        doctorId: undefined, doctorName: undefined, status: 0, remark: undefined, thirdPartyUserId: undefined,
+      };
+      this.$nextTick(() => { if (this.$refs.form) this.$refs.form.clearValidate(); });
+    },
+    resetDrugForm() {
+      this.drugForm = { drugId: undefined, prescribeId: undefined, drugName: undefined, drugSpec: undefined, usageMethod: undefined, usageFrequencyUnit: undefined, usagePerUseCount: undefined, usagePerUseUnit: undefined };
+      this.$nextTick(() => { if (this.$refs.drugForm) this.$refs.drugForm.clearValidate(); });
+    },
+    // 常用诊断
+    handleCommonlyDiagnoseWorlds() {
+      this.suggestQuery.pageNum = 1;
+      this.getSuggestList().then(() => { if (this.suggestList.length) this.showSuggestDialog = true; else this.$message.info('未找到相关常用诊断'); });
+    },
+    async getSuggestList() {
+      try {
+        const response = await getCommonDiagnoseList(this.suggestQuery);
+        this.suggestList = response.data.list || [];
+        this.suggestTotal = response.data.total || 0;
+      } catch { this.suggestList = []; }
+    },
+    handleSuggestRowClick(row) { this.handleAddSuggest(row); },
+    handleAddSuggest(row) {
+      const text = row.diagnose;
+      if (!text) return;
+      let current = (this.form.diagnose || '').trim();
+      if (current && !current.endsWith(',')) current += ', ';
+      this.form.diagnose = current + text;
+      this.showSuggestDialog = false;
+      this.clearSuggestList();
+    },
+    clearSuggestList() { this.suggestList = []; this.suggestTotal = 0; },
+    // 常用药品
+    openCommonPrescribeDialog() { this.commonPrescribeDialogVisible = true; },
+    handleOpenCommonPrescribeDialog() { this.commonDrugQuery.pageNum = 1; this.getCommonPrescribeList(); },
+    handleCommonPrescribeQuery() { this.commonDrugQuery.pageNum = 1; this.getCommonPrescribeList(); },
+    resetCommonPrescribeQuery() { this.commonDrugQuery.drugName = undefined; this.handleCommonPrescribeQuery(); },
+    getCommonPrescribeList() {
+      this.commonPrescribeLoading = true;
+      const doctorId = this.form.doctorId || this.$store.state.user.userId?.replace('D-', '');
+      getCommonDrugList({ ...this.commonDrugQuery, doctorId }).then(response => {
+        this.commonDrugList = response.data.list || [];
+        this.commonPrescribeTotal = response.data.total || 0;
+      }).finally(() => { this.commonPrescribeLoading = false; });
+    },
+    applyCommonPrescribe(row) {
+      if (!this.form.prescribeId) return this.$message.warning('请先保存处方基本信息');
+      const drugData = { prescribeId: this.form.prescribeId, drugName: row.drugName, drugSpec: row.drugSpec, usageMethod: row.usageMethod, usageFrequencyUnit: row.usageFrequencyUnit, usagePerUseCount: row.usagePerUseCount, usagePerUseUnit: '' };
+      addPrescribeDrug(drugData).then(() => { this.getDrugList(); this.commonPrescribeDialogVisible = false; this.$message.success('添加成功'); }).catch(() => { this.$message.error('添加失败'); });
+    },
+    // 辅助方法
+    getTagType(source) { return source === 1 ? 'success' : source === 2 ? 'danger' : 'info'; },
+    getTagEffect(source) { return source === 1 || source === 2 ? 'dark' : 'plain'; },
+    getSourceText(source) { return source === 1 ? '信息采集表' : source === 2 ? '超拼网' : '其他'; },
+    parseTime(time, pattern) { /* 项目中已有全局方法,直接调用即可 */ return this.$options.filters?.parseTime?.(time, pattern) || time; }
+  }
+};
+</script>
+
+<style scoped>
+.detail-item .label {
+  min-width: 100px;
+  font-weight: bold;
+}
+
+/*------------这里开始是Tab3字体样式------------------*/
+.info-item {
+  display: flex;
+  align-items: center;
+  min-height: 32px;
+}
+
+.info-item .label {
+  font-family: SimHei, "Microsoft YaHei", sans-serif;
+  /* 黑体优先 */
+  font-weight: bold;
+  color: #333;
+}
+
+.info-item .value {
+  color: #666;
+  margin-left: 6px;
+}
+
+/* -----------Tab3字体样式结束-----------------*/
+
+
+/*----------------实时渲染处方背景图片----------------------*/
+/* 左右分栏布局 */
+.drug-split-layout {
+  display: flex;
+  gap: 20px;
+  height: calc(100vh - 220px); /* 根据实际高度调整,避免溢出 */
+}
+.drug-left-panel, .drug-right-panel {
+  flex: 1; /* 让左右两个面板都均匀分配空间 */
+  overflow-y: auto; /* 允许内容超出时显示滚动条 */
+}
+.drug-left-panel {
+  padding-right: 10px;
+}
+
+.drug-right-panel {
+  /* 示例:给右侧板添加左边距 */
+  padding-left: 10px;
+  display: flex;
+  justify-content: center;
+  align-items: flex-start;
+}
+
+/* --- 处方预览相关样式 (新的) --- */
+.prescription-preview-container-wrapper {
+  width: 100%;
+  height: 100%;
+  display: flex;
+  justify-content: center;
+  align-items: flex-start; /* 顶部对齐 */
+  padding: 10px; /* 可选:添加内边距 */
+  background-color: #f9f9f9; /* 与 .real-prescription-wrapper 背景色保持一致 */
+  overflow: auto; /* 允许滚动 */
+}
+
+.prescription-preview-container {
+  position: relative;
+  width: 100%;
+  max-width: 800px; /* 最大宽度限制 */
+  aspect-ratio: 8 / 10.5; /* 维持原始处方图的宽高比 (例如 800x1050 -> 8:10.5) */
+  min-height: 1000px; /* 一个合理的最小高度 */
+  /* 不再设置 background-image */
+}
+
+.prescription-bg-image {
+  width: 100%;
+  height: 100%;
+  object-fit: contain; /* 保持图片比例,完整显示 */
+  display: block; /* 去除图片下方可能的空隙 */
+}
+
+.prescription-overlay {
+  position: absolute;
+  top: 0;
+  left: 0;
+  width: 100%;
+  height: 100%;
+  pointer-events: none; /* 使覆盖层不影响下方元素的点击 */
+}
+
+.field {
+  position: absolute;
+  font-family: "SimSun", "宋体", serif;
+  font-size: clamp(10px, 1.5vw, 14px); /* 响应式字体大小 */
+  color: #000;
+  white-space: pre-line; /* 保留换行符 */
+  line-height: 1.4; /* 行高 */
+  pointer-events: auto;
+  box-sizing: border-box;
+  overflow-wrap: break-word; /* 防止长单词溢出 */
+  word-wrap: break-word; /* 同上,兼容性 */
+}
+
+
+/* ========== 第一行:处方编号 ========== */
+.prescribe-code-row {
+  position: absolute;
+  top: 5.6%; /* 相对于容器高度 */
+  left: 0;
+  width: 100%;
+  height: 4%; /* 估算高度 */
+  display: flex;
+}
+
+.prescribe-code-content {
+  flex: 1;
+  display: flex;
+  align-items: center;
+  justify-content: flex-start;
+  padding-left: 19%; /* 相对于容器宽度 */
+  font-size: clamp(10px, 1.5vw, 14px);
+}
+
+/* ========== 第二行:患者信息 ========== */
+.patient-info-row {
+  position: absolute;
+  top: 10%; /* 相对于容器高度 */
+  left: 0;
+  width: 100%;
+  height: 4%; /* 估算高度 */
+  display: flex;
+}
+
+
+.prescribe-patientName {
+  flex: 2;
+  display: flex;
+  align-items: center;
+  justify-content: center;
+  padding-left: 2%;
+  font-size: clamp(10px, 1.5vw, 14px);
+}
+
+.prescribe-patientGender {
+  flex: 1;
+  display: flex;
+  align-items: center;
+  justify-content: center;
+  font-size: clamp(10px, 1.5vw, 14px);
+}
+
+.prescribe-patientAge {
+  flex: 3;
+  display: flex;
+  align-items: center;
+  justify-content: flex-start;
+  padding-left: 5%; /* 相对于容器宽度 */
+  font-size: clamp(10px, 1.5vw, 14px);
+}
+
+
+/* 诊断字段 */
+.diagnose {
+  top: 19%;
+  left: 15%;
+  width: 70%;
+  height: 10%;
+  overflow: hidden; /* 防止内容溢出 */
+}
+
+/* 药品列表字段 */
+.drugs {
+  top: 27%;
+  left: 10%;
+  width: 80%;
+  height: 45%;
+  overflow-y: auto; /* 如果药品多,允许滚动 */
+}
+
+.drug-item {
+  margin-bottom: 1.5%; /* 相对于 .drugs 高度 */
+  font-size: clamp(9px, 1.2vw, 12px); /* 药品列表字体稍小 */
+}
+
+.usage-amount {
+  display: block; /* 独占一行 */
+  font-size: clamp(9px, 1.2vw, 12px); /* 药品列表字体稍小 */
+}
+
+/* 医嘱字段 */
+.remark {
+  top: 52%;
+  left: 12%;
+  width: 70%;
+  height: 10%;
+  overflow: hidden; /* 防止内容溢出 */
+}
+
+
+/* 真实处方图片容器 */
+.real-prescription-wrapper {
+  width: 100%;
+  height: 100%;
+  overflow: auto;
+  padding: 10px;
+  background-color: #f9f9f9;
+  display: flex;
+  justify-content: flex-start;
+  align-items: flex-start;
+}
+
+.prescription-image-small {
+  max-width: 100%;
+  max-height: 100%;
+  width: auto;
+  height: auto;
+  object-fit: contain;
+}
+</style>