소스 검색

完善展示信息

cgp 19 시간 전
부모
커밋
2dcfb44629
3개의 변경된 파일115개의 추가작업 그리고 5개의 파일을 삭제
  1. 25 0
      src/api/his/scrmPrescribe.js
  2. 57 1
      src/views/his/scrmPrescribe/DoctorAdviceDialog.vue
  3. 33 4
      src/views/his/scrmPrescribe/index.vue

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

@@ -76,3 +76,28 @@ export function submitPrescribeScrm(data) {
     data: data
   })
 }
+
+/**
+ * 医生拒方
+ * @param {Object} data - { prescribeId, auditReason }
+ * @returns {Promise}
+ */
+export function doctorRejectPrescribe(data) {
+  return request({
+    url: '/his/prescribeDataScrm/doctorRejectScrmPrescribe',
+    method: 'post',
+    data: data
+  })
+}
+
+/**
+ * 获取客户问答信息
+ * @param {number} prescribeId 处方ID
+ * @returns {Promise}
+ */
+export function getCustomerQuestionAnswer(prescribeId) {
+  return request({
+    url: `/his/prescribeDataScrm/getCustomerQuestionAnswer/${prescribeId}`,
+    method: 'get'
+  })
+}

+ 57 - 1
src/views/his/scrmPrescribe/DoctorAdviceDialog.vue

@@ -6,6 +6,17 @@
     :close-on-click-modal="false"
     @close="handleClose"
   >
+    <!-- 客户问答信息展示区域 -->
+    <div v-if="questionAnswers.length > 0" class="question-answer-section">
+      <div class="section-title">患者病情</div>
+      <div class="qa-list">
+        <div v-for="(item, idx) in questionAnswers" :key="idx" class="qa-item">
+          <span class="qa-title">{{ item.title }}</span>
+          <span class="qa-answer">{{ item.answerText || '未回答' }}</span>
+        </div>
+      </div>
+      <el-divider />
+    </div>
     <el-form :model="formData" :rules="formRules" ref="adviceForm" label-width="150px">
       <!-- 诊断 -->
       <el-form-item label="诊断" prop="diagnose">
@@ -90,7 +101,7 @@
 </template>
 
 <script>
-import { getDoctorSignInfo, submitDoctorAdvice } from "@/api/his/scrmPrescribe";
+import { getDoctorSignInfo, submitDoctorAdvice,getCustomerQuestionAnswer } from "@/api/his/scrmPrescribe";
 
 export default {
   name: "DoctorAdviceDialog",
@@ -116,6 +127,7 @@ export default {
     return {
       dialogVisible: false,
       submitLoading: false,
+      questionAnswers: [], // 存储问答数据
       formData: {
         diagnose: '',
         facialDiagnosis: '',
@@ -170,6 +182,7 @@ export default {
         }
         this.resetFormData();
         this.fetchSignInfo();
+        this.fetchQuestionAnswers(); //获取问答信息
       }
     }
   },
@@ -226,6 +239,15 @@ export default {
         this.$message.error('获取医生签名信息失败');
       });
     },
+    //获取问答信息
+    fetchQuestionAnswers() {
+      getCustomerQuestionAnswer(this.prescribeId).then(response => {
+        this.questionAnswers = response.data || [];
+      }).catch(error => {
+        console.error('获取问答信息失败', error);
+        // 不阻断流程,仅提示
+      });
+    },
     submitAdvice() {
       if (!this.prescribeId) {
         this.$message.error('处方ID无效,无法提交');
@@ -267,4 +289,38 @@ export default {
 .dialog-footer {
   text-align: right;
 }
+
+/* 新增样式 */
+.question-answer-section {
+  margin-bottom: 20px;
+  background-color: #f9f9f9;
+  padding: 12px 16px;
+  border-radius: 8px;
+}
+.section-title {
+  font-weight: bold;
+  font-size: 16px;
+  margin-bottom: 12px;
+  color: #303133;
+}
+.qa-list {
+  display: flex;
+  flex-direction: column;
+  gap: 10px;
+}
+.qa-item {
+  display: flex;
+  align-items: baseline;
+  font-size: 14px;
+}
+.qa-title {
+  width: 45%;
+  color: #606266;
+  font-weight: 500;
+}
+.qa-answer {
+  width: 55%;
+  color: #409EFF;
+  font-weight: normal;
+}
 </style>

+ 33 - 4
src/views/his/scrmPrescribe/index.vue

@@ -104,22 +104,29 @@
         </template>
       </el-table-column>
       <el-table-column label="创建时间" align="center" prop="createTime" width="160" />
-      <el-table-column label="操作" align="center" width="120">
+      <el-table-column label="操作" align="center" width="180">
         <template slot-scope="scope">
           <el-button
             type="primary"
             size="small"
             icon="el-icon-edit"
-            v-if="scope.row.doctorConfirm === 0&&scope.row.status!==2&&scope.row.isDocument===0"
+            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)"
+            v-if="scope.row.isDocument===0 && (scope.row.doctorConfirm === 0 || scope.row.status===1)"
             @click="handleOpenPrescribe(scope.row)"
           >开方</el-button>
+          <el-button
+            type="danger"
+            size="small"
+            icon="el-icon-close"
+            v-if="scope.row.doctorConfirm === 0 && scope.row.isDocument===0"
+            @click="handleRejectPrescribe(scope.row)"
+          >拒方</el-button>
         </template>
       </el-table-column>
     </el-table>
@@ -154,7 +161,7 @@
 </template>
 
 <script>
-import { waitOpenPrescribeList } from "@/api/his/scrmPrescribe";
+import { waitOpenPrescribeList,doctorRejectPrescribe } from "@/api/his/scrmPrescribe";
 import DoctorAdviceDialog from "./DoctorAdviceDialog.vue";
 import DoctorPrescribeDialog from "./DoctorPrescribeDialog.vue";
 export default {
@@ -234,6 +241,28 @@ export default {
       }).then(() => {
         this.prescribeDialogVisible = true;
       }).catch(() => {});
+    },
+    // 拒方
+    handleRejectPrescribe(row) {
+      this.$prompt('请输入拒绝原因', '拒方确认', {
+        confirmButtonText: '确定',
+        cancelButtonText: '取消',
+        inputType: 'textarea',
+        inputValidator: (value) => {
+          if (!value || !value.trim()) return '拒绝原因不能为空';
+          return true;
+        }
+      }).then(({ value }) => {
+        doctorRejectPrescribe({
+          prescribeId: row.prescribeId,
+          auditReason: value
+        }).then(() => {
+          this.$message.success('拒方成功');
+          this.getList(); // 刷新列表
+        }).catch(error => {
+          this.$message.error(error.message || '拒方失败');
+        });
+      }).catch(() => {});
     }
   }
 };