Przeglądaj źródła

商城处方药师拒方功能

cgp 20 godzin temu
rodzic
commit
97c4d121c9

+ 19 - 0
src/api/his/scrmPrescribeAudit.js

@@ -0,0 +1,19 @@
+import request from '@/utils/request'
+
+// 查询待审核商城处方列表
+export function getPendingStorePrescribeList(query) {
+  return request({
+    url: '/his/prescribeDataScrm/pendingStorePrescribeList',
+    method: 'get',
+    params: query
+  })
+}
+
+// 审核商城处方
+export function auditStorePrescribe(data) {
+  return request({
+    url: '/his/prescribeDataScrm/auditProcess',
+    method: 'get',
+    params: data
+  })
+}

+ 4 - 4
src/api/his/scrmPrescribeDrug.js

@@ -1,7 +1,7 @@
 import request from '@/utils/request'
 
 // 查询药品列表
-export function listPrescribeDrug(query) {
+export function listScrmPrescribeDrug(query) {
   return request({
     url: '/his/prescribeDrugDataScrm/list',
     method: 'get',
@@ -10,7 +10,7 @@ export function listPrescribeDrug(query) {
 }
 
 // 新增药品
-export function addPrescribeDrug(data) {
+export function addScrmPrescribeDrug(data) {
   return request({
     url: '/his/prescribeDrugDataScrm',
     method: 'post',
@@ -19,7 +19,7 @@ export function addPrescribeDrug(data) {
 }
 
 // 修改药品
-export function updatePrescribeDrug(data) {
+export function updateScrmPrescribeDrug(data) {
   return request({
     url: '/his/prescribeDrugDataScrm',
     method: 'put',
@@ -28,7 +28,7 @@ export function updatePrescribeDrug(data) {
 }
 
 // 删除药品
-export function deletePrescribeDrug(drugId) {
+export function deleteScrmPrescribeDrug(drugId) {
   return request({
     url: `/his/prescribeDrugDataScrm/${drugId}`,
     method: 'delete'

+ 154 - 78
src/views/his/scrmPrescribe/DoctorPrescribeDialog.vue

@@ -1,10 +1,18 @@
 <template>
   <el-dialog title="医生开方" :visible.sync="dialogVisible" width="95%" top="5vh" :close-on-click-modal="false" @close="handleClose" append-to-body>
-    <!-- 步骤导航 -->
+    <!-- 步骤导航,带类型提示 -->
     <el-steps :active="activeStep" finish-status="success" align-center style="margin-bottom: 30px;">
       <el-step title="选择处方类型" />
-      <el-step title="填写处方内容" />
-      <el-step v-if="isCombined && secondPartActive" title="填写另一部分处方" />
+      <el-step title="填写处方内容">
+        <template slot="title" v-if="isCombined && activeStep === 1">
+          <span>填写处方内容(<span style="color: #409EFF;">西药处方</span>)</span>
+        </template>
+      </el-step>
+      <el-step v-if="isCombined && secondPartActive" title="填写中药处方">
+        <template slot="title">
+          <span>填写中药处方(<span style="color: #67C23A;">中药处方</span>)</span>
+        </template>
+      </el-step>
     </el-steps>
 
     <!-- 步骤1:选择处方类型 -->
@@ -96,7 +104,7 @@
               <pagination v-show="drugTotal > 0" :total="drugTotal" :page.sync="drugQuery.pageNum" :limit.sync="drugQuery.pageSize" @pagination="getDrugList" />
             </div>
 
-            <!-- 右侧处方图片渲染(支持滚动,采用绝对定位样式) -->
+            <!-- 右侧处方图片渲染 -->
             <div class="drug-right-panel">
               <div class="prescription-scroll-wrapper">
                 <div v-if="prescribeForm.prescribeImgUrl" class="real-prescription-wrapper">
@@ -105,7 +113,7 @@
                 <div v-else class="prescription-preview-container">
                   <img src="/ysy_prescribe.jpg" class="prescription-bg-image" alt="处方背景" />
                   <div class="prescription-overlay">
-                    <div class="prescribe-code">{{ prescribeForm.prescribeCode}}</div>
+                    <div class="prescribe-code">{{ prescribeForm.prescribeCode }}</div>
                     <div class="patient-info">
                       <div class="prescribe-patientName">{{ prescribeForm.patientName }}</div>
                       <div class="prescribe-patientGender">{{ patientGenderText }}</div>
@@ -128,10 +136,10 @@
       </el-tabs>
     </div>
 
-    <!-- 步骤3(组合处方专用) -->
+    <!-- 步骤3(组合处方专用:中药处方) -->
     <div v-show="activeStep === 2 && isCombined">
       <el-tabs v-model="secondActiveTab" type="border-card">
-        <el-tab-pane label="另一部分处方" name="drugSecond">
+        <el-tab-pane label="中药处方" name="drugSecond">
           <div class="drug-split-layout">
             <div class="drug-left-panel">
               <el-form label-width="80px">
@@ -193,8 +201,9 @@
     <div slot="footer" class="dialog-footer">
       <el-button @click="dialogVisible = false">取消</el-button>
       <el-button v-if="activeStep === 0" type="primary" @click="nextStep" :disabled="!selectedPrescribeType">下一步</el-button>
-      <el-button v-if="activeStep === 1" type="primary" @click="submitCurrentPart" :loading="submitLoading">确认处方</el-button>
-      <el-button v-if="activeStep === 2 && isCombined" type="primary" @click="submitSecondPart" :loading="submitLoading">确认另一部分处方</el-button>
+      <el-button v-if="activeStep === 1 && isCombined" type="primary" @click="goToSecondPart" :loading="submitLoading">下一步</el-button>
+      <el-button v-if="activeStep === 1 && !isCombined" type="primary" @click="submitCurrentPart" :loading="submitLoading">确认处方</el-button>
+      <el-button v-if="activeStep === 2 && isCombined" type="primary" @click="submitSecondPart" :loading="submitLoading">确认中药处方</el-button>
       <el-button v-if="activeStep > 0" @click="prevStep">上一步</el-button>
     </div>
 
@@ -246,8 +255,8 @@
 </template>
 
 <script>
-import { getPrescribeScrmDetail, updatePrescribeScrm, submitPrescribeScrm } from "@/api/his/scrmPrescribe";
-import { listPrescribeDrug, addPrescribeDrug, updatePrescribeDrug, deletePrescribeDrug } from "@/api/his/prescribeDrug";
+import { getPrescribeScrmDetail, submitBasicInfo, submitPrescribeScrm } from "@/api/his/scrmPrescribe";
+import { listScrmPrescribeDrug,addScrmPrescribeDrug,updateScrmPrescribeDrug,deleteScrmPrescribeDrug } from "@/api/his/scrmPrescribeDrug";
 import { getCommonDrugList } from "@/api/commonlyDrug";
 import { getCommonDiagnoseList } from '@/api/commonlyDiagnose';
 
@@ -284,21 +293,21 @@ export default {
         prescribeImgStoreUrl: ''
       },
       basicRules: {
-        patientName: [{required: true, message: '请输入患者姓名', trigger: 'blur'}],
-        patientAge: [{required: true, message: '请输入患者年龄', trigger: 'blur'}],
-        patientGender: [{required: true, message: '请选择患者性别', trigger: 'change'}],
-        isHistoryAllergic: [{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' }]
       },
       drugRules: {
-        diagnose: [{required: true, message: '请输入诊断', trigger: 'blur'}],
-        remark: [{required: true, message: '请输入医嘱', trigger: 'blur'}]
+        diagnose: [{ required: true, message: '请输入诊断', trigger: 'blur' }],
+        remark: [{ required: true, message: '请输入医嘱', trigger: 'blur' }]
       },
       drugList: [],
       drugTotal: 0,
-      drugQuery: {pageNum: 1, pageSize: 10, prescribeId: null},
+      drugQuery: { pageNum: 1, pageSize: 10, prescribeId: null, drugType: null },
       secondDrugList: [],
       secondDrugTotal: 0,
-      secondDrugQuery: {pageNum: 1, pageSize: 10, prescribeId: null},
+      secondDrugQuery: { pageNum: 1, pageSize: 10, prescribeId: null, drugType: 2 },
       drugDialogVisible: false,
       drugDialogTitle: '',
       currentDrug: {},
@@ -306,11 +315,11 @@ export default {
       diagnoseDialogVisible: false,
       commonDiagnoseList: [],
       diagnoseTotal: 0,
-      diagnoseQuery: {pageNum: 1, pageSize: 10},
+      diagnoseQuery: { pageNum: 1, pageSize: 10 },
       commonDrugDialogVisible: false,
       commonDrugList: [],
       commonDrugTotal: 0,
-      commonDrugQuery: {pageNum: 1, pageSize: 10, drugName: '', doctorId: null},
+      commonDrugQuery: { pageNum: 1, pageSize: 10, drugName: '', doctorId: null },
       commonDrugForSecond: false,
       submitLoading: false,
       isViewMode: false
@@ -367,6 +376,22 @@ export default {
         this.$message.error('获取处方信息失败');
       }
     },
+    // 获取当前步骤对应的药品类型(1:西药, 2:中药)
+    getCurrentDrugType() {
+      if (this.commonDrugForSecond) {
+        return 2; // 组合处方的第二部分(中药)
+      }
+      if (this.isCombined && !this.secondPartActive && this.activeStep === 1) {
+        return 1; // 组合处方第一步(西药)
+      }
+      if (this.isCombined && this.secondPartActive && this.activeStep === 2) {
+        return 2; // 组合处方第二步(中药)
+      }
+      // 非组合处方
+      if (this.selectedPrescribeType === 1) return 1;
+      if (this.selectedPrescribeType === 2) return 2;
+      return 1; // 默认西药
+    },
     onPrescribeTypeChange(val) {
       this.isCombined = (val === 3);
       if (!this.isCombined) this.secondPartActive = false;
@@ -384,7 +409,12 @@ export default {
       }
     },
     prevStep() {
-      if (this.activeStep > 0) this.activeStep--;
+      if (this.activeStep > 0) {
+        this.activeStep--;
+        if (this.activeStep === 1 && this.isCombined) {
+          this.loadDrugsForCurrentPart();
+        }
+      }
     },
     loadDrugsForCurrentPart() {
       if (!this.prescribeId) return;
@@ -395,35 +425,82 @@ export default {
       }
     },
     getDrugList() {
+      // 确定当前要查询的药品类型
+      let drugType = null;
+      if (this.isCombined && !this.secondPartActive) {
+        drugType = 1; // 组合处方第一步,西药
+      } else if (this.selectedPrescribeType === 1) {
+        drugType = 1;
+      } else if (this.selectedPrescribeType === 2) {
+        drugType = 2;
+      } else {
+        drugType = this.selectedPrescribeType;
+      }
       this.drugQuery.prescribeId = this.prescribeId;
-      listPrescribeDrug(this.drugQuery).then(res => {
+      this.drugQuery.drugType = drugType;
+      listScrmPrescribeDrug(this.drugQuery).then(res => {
         this.drugList = res.rows || [];
         this.drugTotal = res.total || 0;
+      }).catch(() => {
+        this.$message.error('获取药品列表失败');
       });
     },
     getSecondDrugList() {
-      if (this.secondDrugQuery.prescribeId !== this.prescribeId) {
-        this.secondDrugQuery.prescribeId = this.prescribeId;
+      this.secondDrugQuery.prescribeId = this.prescribeId;
+      this.secondDrugQuery.drugType = 2;
+      listScrmPrescribeDrug(this.secondDrugQuery).then(res => {
+        this.secondDrugList = res.rows || [];
+        this.secondDrugTotal = res.total || 0;
+      }).catch(() => {
+        this.$message.error('获取中药列表失败');
+      });
+    },
+    async goToSecondPart() {
+      let valid = true;
+      await this.$refs.basicForm.validate().catch(() => valid = false);
+      await this.$refs.drugForm.validate().catch(() => valid = false);
+      if (!valid) return;
+      if (this.drugList.length === 0) {
+        this.$message.warning('请至少添加一种西药药品');
+        return;
+      }
+      this.submitLoading = true;
+      try {
+        await submitBasicInfo(this.prescribeId, {
+          diagnose: this.prescribeForm.diagnose,
+          remark: this.prescribeForm.remark,
+          isHistoryAllergic: this.prescribeForm.isHistoryAllergic,
+          historyAllergic: this.prescribeForm.historyAllergic
+        });
+        this.$message.success('西药处方信息已保存');
+        this.secondPartActive = true;
+        this.activeStep = 2;
+        this.getSecondDrugList();
+      } catch (error) {
+        this.$message.error('保存失败');
+      } finally {
+        this.submitLoading = false;
       }
-      // TODO: 实际应调用带 drugType 参数的接口,此处简化
     },
     handleAddDrug() {
       this.isEditingSecond = false;
-      this.currentDrug = {drugType: this.selectedPrescribeType === 1 ? 1 : 2};
-      this.drugDialogTitle = '新增药品';
+      this.currentDrug = { drugType: 1 };
+      this.drugDialogTitle = '新增药品(西药)';
       this.drugDialogVisible = true;
     },
     handleEditDrug(row) {
       this.isEditingSecond = false;
-      this.currentDrug = {...row};
+      this.currentDrug = { ...row };
       this.drugDialogTitle = '编辑药品';
       this.drugDialogVisible = true;
     },
     handleDeleteDrug(row) {
       this.$confirm('确认删除该药品吗?').then(() => {
-        deletePrescribeDrug(row.drugId).then(() => {
+        deleteScrmPrescribeDrug(row.drugId).then(() => {
           this.$message.success('删除成功');
           this.getDrugList();
+        }).catch(() => {
+          this.$message.error('删除失败');
         });
       });
     },
@@ -433,7 +510,7 @@ export default {
         this.$message.warning('请填写药品名称');
         return;
       }
-      const request = this.currentDrug.drugId ? updatePrescribeDrug(this.currentDrug) : addPrescribeDrug(this.currentDrug);
+      const request = this.currentDrug.drugId ? updateScrmPrescribeDrug(this.currentDrug) : addScrmPrescribeDrug(this.currentDrug);
       request.then(() => {
         this.$message.success('保存成功');
         this.drugDialogVisible = false;
@@ -448,21 +525,23 @@ export default {
     },
     handleAddDrugSecond() {
       this.isEditingSecond = true;
-      this.currentDrug = {drugType: 2};
-      this.drugDialogTitle = '新增药品(另一部分)';
+      this.currentDrug = { drugType: 2 };
+      this.drugDialogTitle = '新增药品(中药)';
       this.drugDialogVisible = true;
     },
     handleEditDrugSecond(row) {
       this.isEditingSecond = true;
-      this.currentDrug = {...row};
+      this.currentDrug = { ...row };
       this.drugDialogTitle = '编辑药品';
       this.drugDialogVisible = true;
     },
     handleDeleteDrugSecond(row) {
       this.$confirm('确认删除该药品吗?').then(() => {
-        deletePrescribeDrug(row.drugId).then(() => {
+        deleteScrmPrescribeDrug(row.drugId).then(() => {
           this.$message.success('删除成功');
           this.getSecondDrugList();
+        }).catch(() => {
+          this.$message.error('删除失败');
         });
       });
     },
@@ -504,26 +583,32 @@ export default {
       });
     },
     applyCommonDrug(drug) {
+      // 明确当前药品类型
+      const drugType = this.getCurrentDrugType();
       const newDrug = {
         drugName: drug.drugName,
         drugSpec: drug.drugSpec,
         usageMethod: drug.usageMethod,
         usageFrequencyUnit: drug.usageFrequencyUnit,
         usagePerUseCount: drug.usagePerUseCount,
-        usagePerUseUnit: '',
+        usagePerUseUnit: drug.usagePerUseUnit || '',
         prescribeId: this.prescribeId,
-        drugType: this.selectedPrescribeType === 1 ? 1 : 2
+        drugType: drugType
       };
-      addPrescribeDrug(newDrug).then(() => {
+      addScrmPrescribeDrug(newDrug).then(() => {
         this.$message.success('添加成功');
+        // 添加成功后重置分页为第一页并刷新对应列表
         if (!this.commonDrugForSecond) {
+          this.drugQuery.pageNum = 1;
           this.getDrugList();
         } else {
+          this.secondDrugQuery.pageNum = 1;
           this.getSecondDrugList();
         }
         this.commonDrugDialogVisible = false;
-      }).catch(() => {
-        this.$message.error('添加失败');
+      }).catch((error) => {
+        console.error('添加常用药品失败', error);
+        this.$message.error('添加药品失败,请重试');
       });
     },
     async submitCurrentPart() {
@@ -535,31 +620,11 @@ export default {
         this.$message.warning('请至少添加一种药品');
         return;
       }
-      if (this.isCombined && !this.secondPartActive) {
-        this.submitLoading = true;
-        try {
-          await updatePrescribeScrm(this.prescribeId, {
-            diagnose: this.prescribeForm.diagnose,
-            remark: this.prescribeForm.remark,
-            isHistoryAllergic: this.prescribeForm.isHistoryAllergic,
-            historyAllergic: this.prescribeForm.historyAllergic
-          });
-          this.$message.success('第一部分信息已保存,请继续填写第二部分');
-          this.secondPartActive = true;
-          this.activeStep = 2;
-          this.getSecondDrugList();
-        } catch (error) {
-          this.$message.error('保存失败');
-        } finally {
-          this.submitLoading = false;
-        }
-      } else {
-        this.submitFullPrescribe();
-      }
+      this.submitFullPrescribe();
     },
     submitSecondPart() {
       if (this.secondDrugList.length === 0) {
-        this.$message.warning('请至少添加一种药品');
+        this.$message.warning('请至少添加一种中药药品');
         return;
       }
       this.submitFullPrescribe(true);
@@ -576,9 +641,16 @@ export default {
           isHistoryAllergic: this.prescribeForm.isHistoryAllergic,
           historyAllergic: this.prescribeForm.historyAllergic,
           diagnose: this.prescribeForm.diagnose,
-          remark: this.prescribeForm.remark,
-          drugs: this.isCombined ? [...this.drugList, ...this.secondDrugList] : this.drugList
+          remark: this.prescribeForm.remark
         };
+        if (this.isCombined) {
+          params.mapDrugs = {
+            1: this.drugList,
+            2: this.secondDrugList
+          };
+        } else {
+          params.drugs = this.drugList;
+        }
         await submitPrescribeScrm(params);
         this.$message.success('处方提交成功');
         this.dialogVisible = false;
@@ -598,7 +670,6 @@ export default {
 </script>
 
 <style scoped>
-/* 左右分栏布局 */
 .drug-split-layout {
   display: flex;
   gap: 20px;
@@ -613,17 +684,25 @@ export default {
   flex: 1;
   overflow-y: auto;
   max-height: 70vh;
+  background: #fff;
+  border-radius: 4px;
+  display: flex;
+  flex-direction: column;
 }
 
 .prescription-scroll-wrapper {
   width: 100%;
-  min-height: 100%;
-  overflow-y: auto;
+  flex: 1;
+  display: flex;
+  justify-content: center;
+  align-items: flex-start;
 }
 
 .prescription-preview-container {
   position: relative;
   width: 100%;
+  max-width: 500px;
+  margin: 0 auto;
   background: #f5f5f5;
   border-radius: 8px;
   overflow: hidden;
@@ -632,9 +711,9 @@ export default {
 .prescription-bg-image {
   width: 100%;
   display: block;
+  height: auto;
 }
 
-/* 覆盖层 - 绝对定位所有文字内容 */
 .prescription-overlay {
   position: absolute;
   top: 0;
@@ -646,7 +725,6 @@ export default {
   pointer-events: none;
 }
 
-/* 处方编号 */
 .prescription-overlay .prescribe-code {
   position: absolute;
   top: 5.6%;
@@ -662,15 +740,15 @@ export default {
   color: #000;
 }
 
-/* 患者信息 */
 .patient-info {
   position: absolute;
-  top: 10%; /* 相对于容器高度 */
+  top: 10%;
   left: 0;
   width: 100%;
-  height: 4%; /* 估算高度 */
+  height: 4%;
   display: flex;
 }
+
 .prescribe-patientName {
   flex: 2;
   display: flex;
@@ -693,11 +771,10 @@ export default {
   display: flex;
   align-items: center;
   justify-content: flex-start;
-  padding-left: 5%; /* 相对于容器宽度 */
+  padding-left: 5%;
   font-size: clamp(10px, 1.5vw, 14px);
 }
 
-/* 诊断字段 */
 .prescription-overlay .diagnose {
   position: absolute;
   top: 19%;
@@ -711,7 +788,6 @@ export default {
   line-height: 1.4;
 }
 
-/* 药品列表字段 - 可滚动 */
 .prescription-overlay .drugs {
   position: absolute;
   top: 27%;
@@ -733,7 +809,6 @@ export default {
   color: #666;
 }
 
-/* 医嘱字段 */
 .prescription-overlay .remark {
   position: absolute;
   top: 52%;
@@ -747,15 +822,16 @@ export default {
   line-height: 1.4;
 }
 
-/* 真实处方图片容器 */
 .real-prescription-wrapper {
   width: 100%;
-  overflow: auto;
+  display: flex;
+  justify-content: center;
 }
 
 .real-prescription-wrapper img {
   max-width: 100%;
   height: auto;
+  object-fit: contain;
 }
 
 .dialog-footer {

+ 14 - 6
src/views/his/scrmPrescribe/index.vue

@@ -66,9 +66,9 @@
       </el-table-column>
       <el-table-column label="处方状态" align="center" prop="doctorConfirm" width="120">
         <template slot-scope="scope">
-          <span v-if="scope.row.doctorConfirm === 0" class="warning">待医生开方</span>
-          <span v-else-if="scope.row.doctorConfirm === 1" class="success">已开方待审核</span>
-          <span v-else-if="scope.row.doctorConfirm === -1" class="danger">医生拒方</span>
+          <span v-if="scope.row.doctorConfirm === 0" class="warning">待开方</span>
+          <span v-else-if="scope.row.doctorConfirm === 1" class="success">待审核</span>
+          <span v-else-if="scope.row.doctorConfirm === -1" class="danger">拒方</span>
           <span v-else>-</span>
         </template>
       </el-table-column>
@@ -97,6 +97,12 @@
           <span v-else class="empty-text">无</span>
         </template>
       </el-table-column>
+      <el-table-column label="拒方原因" align="center" prop="auditReason" width="80">
+        <template slot-scope="scope">
+          <span v-if="scope.row.status===2" class="danger">{{ scope.row.auditReason }}</span>
+          <span v-else class="empty-text">无</span>
+        </template>
+      </el-table-column>
       <el-table-column label="创建时间" align="center" prop="createTime" width="160" />
       <el-table-column label="操作" align="center" width="120">
         <template slot-scope="scope">
@@ -104,12 +110,14 @@
             type="primary"
             size="small"
             icon="el-icon-edit"
+            v-if="scope.row.doctorConfirm === 0&&scope.row.status!==2&&scope.row.isDocument===0"
             @click="handlePerfectPrescription(scope.row)"
           >完善处方</el-button>
           <el-button
             type="success"
             size="small"
             icon="el-icon-plus"
+            v-if="scope.row.isDocument===0&&(scope.row.doctorConfirm === 0||scope.row.status===1)"
             @click="handleOpenPrescribe(scope.row)"
           >开方</el-button>
         </template>
@@ -168,9 +176,9 @@ export default {
         prescribeCode: null
       },
       prescribeTypeOptions: [
-        { dictLabel: "西药", dictValue: 1 },
-        { dictLabel: "中药", dictValue: 2 },
-        { dictLabel: "中药+西药", dictValue: 3 }
+        { dictLabel: "西药", dictValue: "1" },
+        { dictLabel: "中药", dictValue: "2" },
+        { dictLabel: "中药+西药", dictValue: "3" }
       ],
       dialogVisible: false,//完善处方弹窗
       prescribeDialogVisible: false, // 开方弹窗

+ 367 - 4
src/views/prescribeAudit/scrmPrescribeAudit/index.vue

@@ -1,11 +1,374 @@
-<script setup>
+<template>
+  <div class="app-container">
+    <!-- 查询表单 -->
+    <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="90px">
+      <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="status">
+        <el-select v-model="queryParams.status" placeholder="请选择审核状态" clearable>
+          <el-option label="待审核" :value="0" />
+          <el-option label="审核通过" :value="1" />
+          <el-option label="审核不通过" :value="2" />
+        </el-select>
+      </el-form-item>
+      <el-form-item label="创建时间" prop="dateRange">
+        <el-date-picker
+          v-model="dateRange"
+          type="datetimerange"
+          range-separator="至"
+          start-placeholder="开始日期"
+          end-placeholder="结束日期"
+          value-format="yyyy-MM-dd HH:mm:ss"
+          style="width: 350px"
+        />
+      </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-button type="warning" icon="el-icon-time" size="mini" @click="quickFilter(0)">待审核</el-button>
+      </el-form-item>
+    </el-form>
 
-</script>
+    <!-- 处方列表 -->
+    <el-table v-loading="loading" :data="list" border>
+      <el-table-column label="处方ID" prop="prescribeId" align="center" width="100" />
+      <el-table-column label="处方编号" prop="prescribeCode" align="center" width="140" />
+      <el-table-column label="医生姓名" prop="doctorName" align="center" width="120" />
+      <el-table-column label="患者姓名" prop="patientName" align="center" width="120" />
+      <el-table-column label="患者性别" align="center" width="100">
+        <template slot-scope="scope">
+          {{ genderFormat(scope.row.patientGender) }}
+        </template>
+      </el-table-column>
+      <el-table-column label="患者年龄" prop="patientAge" align="center" width="100" />
+      <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" width="140">
+        <template slot-scope="scope">
+          <el-image
+            v-if="scope.row.prescribeImgStoreUrl"
+            :src="scope.row.prescribeImgStoreUrl"
+            :preview-src-list="[scope.row.prescribeImgStoreUrl]"
+            style="width: 120px; height: 120px"
+            fit="cover"
+          />
+          <span v-else>无</span>
+        </template>
+      </el-table-column>
+      <el-table-column label="诊断信息" prop="diagnose" align="center" min-width="180" />
+      <el-table-column label="拒绝原因" prop="auditReason" align="center" min-width="160" />
+      <el-table-column label="审核时间" prop="auditTime" align="center" width="160" />
+      <el-table-column label="审核状态" align="center" width="120">
+        <template slot-scope="scope">
+          {{ statusFormat(scope.row.status) }}
+        </template>
+      </el-table-column>
+      <el-table-column label="操作" align="center" class-name="small-padding fixed-width" width="220">
+        <template slot-scope="scope">
+          <el-button
+            size="mini"
+            type="text"
+            :disabled="scope.row.status !== 0"
+            @click="handleAudit(scope.row)"
+          >审核</el-button>
+          <el-divider direction="vertical" />
+          <el-button size="mini" type="text" @click="viewDrugs(scope.row)">处方药品</el-button>
+          <el-divider direction="vertical" />
+          <el-button size="mini" type="text" @click="handleRecord(scope.row)">审核记录</el-button>
+        </template>
+      </el-table-column>
+    </el-table>
 
-<template>
+    <pagination
+      v-show="total > 0"
+      :total="total"
+      :page.sync="queryParams.pageNum"
+      :limit.sync="queryParams.pageSize"
+      @pagination="getList"
+    />
+
+    <!-- 审核弹窗 -->
+    <el-dialog title="处方审核" :visible.sync="auditDialog.open" width="500px" append-to-body>
+      <el-form :model="auditForm" ref="auditFormRef" label-width="90px">
+        <el-form-item label="审核状态" prop="status">
+          <el-radio-group v-model="auditForm.status">
+            <el-radio :label="1">审核通过</el-radio>
+            <el-radio :label="2">审核不通过</el-radio>
+          </el-radio-group>
+        </el-form-item>
+        <el-form-item v-if="auditForm.status === 2" label="拒绝原因" prop="auditReason">
+          <el-input
+            type="textarea"
+            v-model="auditForm.auditReason"
+            placeholder="请填写拒绝原因"
+            :rows="3"
+          />
+        </el-form-item>
+      </el-form>
+      <div slot="footer" class="dialog-footer">
+        <el-button @click="auditDialog.open = false">取消</el-button>
+        <el-button type="primary" @click="submitAudit">确定</el-button>
+      </div>
+    </el-dialog>
 
+    <!-- 处方药品弹窗 -->
+    <el-dialog title="处方药品" :visible.sync="drugsDialog.open" width="720px" append-to-body>
+      <div v-if="drugsList && drugsList.length">
+        <el-table :data="drugsList" border size="mini">
+          <el-table-column label="药品图片" width="120" align="center">
+            <template slot-scope="scope">
+              <el-image
+                v-if="scope.row.drugImgUrl"
+                :src="scope.row.drugImgUrl"
+                :preview-src-list="[scope.row.drugImgUrl]"
+                style="width: 80px; height: 80px"
+                fit="cover"
+              />
+              <span v-else>无</span>
+            </template>
+          </el-table-column>
+<!--          <el-table-column label="药品类型" prop="drugType" min-width="180" align="center" >-->
+<!--            <template slot-scope="scope">-->
+<!--              {{ scope.row.drugType === 1 ? '西' : '中' }}-->
+<!--            </template>-->
+<!--          </el-table-column>-->
+          <el-table-column label="药品名称" prop="drugName" min-width="180" align="center" />
+          <el-table-column label="药品规格" prop="drugSpec" min-width="160" align="center" />
+          <el-table-column label="使用方法" prop="usageMethod" min-width="160" align="center" />
+          <el-table-column label="频次" prop="usageFrequencyUnit" width="100" align="center" />
+          <el-table-column label="每次用量" prop="usagePerUseCount" width="100" align="center" />
+          <el-table-column label="药品数量" prop="drugNum" width="120" align="center" />
+        </el-table>
+      </div>
+      <el-empty v-else description="暂无药品数据" />
+      <div slot="footer" class="dialog-footer">
+        <el-button @click="drugsDialog.open = false">关闭</el-button>
+      </div>
+    </el-dialog>
+
+    <!-- 审核记录弹窗 -->
+    <el-dialog title="审核记录" :visible.sync="recordDialogVisible" width="1000px" append-to-body>
+      <el-table
+        v-loading="recordLoading"
+        :data="recordList"
+        border
+        style="width: 100%; margin-top: 10px"
+        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" width="160" />
+        <el-table-column label="审核状态" align="center" width="120">
+          <template slot-scope="scope">
+            {{ statusFormat(scope.row.status) }}
+          </template>
+        </el-table-column>
+      </el-table>
+      <div slot="footer" class="dialog-footer">
+        <el-button @click="recordDialogVisible = false">关闭</el-button>
+      </div>
+    </el-dialog>
+  </div>
 </template>
 
-<style scoped lang="stylus">
+<script>
+import { getPendingStorePrescribeList, auditStorePrescribe } from '@/api/his/scrmPrescribeAudit'
+import { recordList } from '@/api/his/prescribe'
+import Pagination from '@/components/Pagination'
+
+export default {
+  name: 'ScrmPrescribeAudit',
+  components: { Pagination },
+  data() {
+    return {
+      loading: false,
+      showSearch: true,
+      total: 0,
+      list: [],
+      dateRange: [],
+      queryParams: {
+        pageNum: 1,
+        pageSize: 10,
+        patientName: undefined,
+        status: 0, // 默认待审核
+        beginTime: undefined,
+        endTime: undefined
+      },
+      auditDialog: { open: false },
+      auditForm: {
+        prescribeId: undefined,
+        status: 1,
+        auditReason: ''
+      },
+      drugsDialog: { open: false },
+      drugsList: [],
+      recordDialogVisible: false,
+      recordLoading: false,
+      recordList: []
+    }
+  },
+  created() {
+    this.getList()
+  },
+  methods: {
+    // 性别格式化
+    genderFormat(val) {
+      if (val === 1 || val === '1') return '男'
+      if (val === 0 || val === '0') return '女'
+      return '-'
+    },
+    // 审核状态格式化
+    statusFormat(val) {
+      if (val === 0 || val === '0') return '待审核'
+      if (val === 1 || val === '1') return '审核通过'
+      if (val === 2 || val === '2') return '审核不通过'
+      return '-'
+    },
+    // 查询
+    handleQuery() {
+      this.queryParams.pageNum = 1
+      this.getList()
+    },
+    // 重置
+    resetQuery() {
+      this.dateRange = []
+      this.queryParams = {
+        pageNum: 1,
+        pageSize: 10,
+        patientName: undefined,
+        status: 0,
+        beginTime: undefined,
+        endTime: undefined
+      }
+      this.getList()
+    },
+    // 快捷筛选待审核
+    quickFilter(status) {
+      this.queryParams.status = status
+      this.handleQuery()
+    },
+    // 获取列表数据(调用新接口)
+    getList() {
+      this.loading = true
+      const params = { ...this.queryParams }
+      // 处理时间范围
+      if (this.dateRange && this.dateRange.length === 2) {
+        params.beginTime = this.dateRange[0]
+        params.endTime = this.dateRange[1]
+      } else {
+        delete params.beginTime
+        delete params.endTime
+      }
+      // 删除可能为空的字段
+      Object.keys(params).forEach(key => {
+        if (params[key] === undefined || params[key] === '') delete params[key]
+      })
+      getPendingStorePrescribeList(params)
+        .then(response => {
+          this.list = response.rows || []
+          this.total = response.total || 0
+        })
+        .finally(() => {
+          this.loading = false
+        })
+    },
+    // 打开审核弹窗
+    handleAudit(row) {
+      this.auditForm.prescribeId = row.prescribeId
+      this.auditForm.status = 1
+      this.auditForm.auditReason = ''
+      this.auditDialog.open = true
+    },
+    // 提交审核
+    submitAudit() {
+      if (this.auditForm.status === 2 && (!this.auditForm.auditReason || !this.auditForm.auditReason.trim())) {
+        this.$message.error('请填写拒绝原因')
+        return
+      }
+      const payload = {
+        prescribeId: this.auditForm.prescribeId,
+        status: this.auditForm.status,
+        auditReason: this.auditForm.auditReason
+      }
+      auditStorePrescribe(payload)
+        .then(() => {
+          this.$message.success('审核成功')
+          this.auditDialog.open = false
+          this.getList()
+        })
+        .catch(() => {
+          this.$message.error('审核失败')
+        })
+    },
+    // 查看处方药品(直接使用列表返回的 drugsList 字段)
+    viewDrugs(row) {
+      // 优先使用后端返回的药品列表
+      let drugData = row.drugsList || []
+      // 如果 drugsList 不存在或为空,可降级调用接口(可选,这里仅展示直接使用)
+      if (!drugData.length && row.prescribeId) {
+        this.$message.warning('该处方暂无药品数据')
+        this.drugsList = []
+        this.drugsDialog.open = true
+        return
+      }
+      // 映射表格所需字段
+      this.drugsList = drugData.map(d => ({
+        drugImgUrl: d.drugImgUrl || '',
+        drugName: d.drugName || '-',
+        drugSpec: d.drugSpec || '-',
+        usageMethod: d.usageMethod || '-',
+        usageFrequencyUnit: d.usageFrequencyUnit || '-',
+        usagePerUseCount: d.usagePerUseCount || '-',
+        drugNum: d.drugNum || d.num || '-'
+      }))
+      this.drugsDialog.open = true
+    },
+    // 查看审核记录
+    handleRecord(row) {
+      this.recordDialogVisible = true
+      this.recordLoading = true
+      recordList(row.prescribeId)
+        .then(res => {
+          this.recordList = res.data || []
+        })
+        .finally(() => {
+          this.recordLoading = false
+        })
+    }
+  }
+}
+</script>
 
+<style scoped>
+.app-container {
+  padding: 20px;
+}
 </style>