Переглянути джерело

总后台优化不适合用药统计

cgp 1 день тому
батько
коміт
6bbfddf210

+ 8 - 1
src/views/his/statistics/doctorNotPrescribeStats/doctorNotPrescribeDetail.vue

@@ -108,6 +108,11 @@
         </el-table>
       </el-form-item>
 
+      <!-- 不建议使用复选框 -->
+      <el-form-item label="不建议使用" label-width="120px">
+        <el-checkbox v-model="formData.notRecommendUse" readonly disabled size="small">不建议使用</el-checkbox>
+      </el-form-item>
+
       <el-divider content-position="left">医生及药师信息</el-divider>
       <el-row :gutter="20">
         <el-col :span="12">
@@ -176,7 +181,8 @@ export default {
         facialDiagnosis: '',
         foodAndExerciseGuidance: '',
         healingList: [],
-        noteTaboos: ''
+        noteTaboos: '',
+        notRecommendUse: false
       },
       signInfo: {
         doctorPosition: '',
@@ -299,6 +305,7 @@ export default {
           this.formData.facialDiagnosis = data.facialDiagnosis || '';
           this.formData.foodAndExerciseGuidance = data.foodAndExerciseGuidance || '';
           this.formData.noteTaboos = data.noteTaboos || '';
+          this.formData.notRecommendUse = data.notRecommendUse || false;
           if (data.healingAreaJson) {
             try {
               const list = JSON.parse(data.healingAreaJson);

+ 1 - 1
src/views/his/statistics/doctorNotPrescribeStats/doctorNotPrescribeList.vue

@@ -100,7 +100,7 @@
       <el-table-column label="销售姓名" align="center" prop="companyUserName" width="100" />
       <el-table-column label="患者姓名" align="center" prop="patientName" width="100" />
       <el-table-column label="患者年龄" align="center" prop="patientAge" width="80" />
-      <el-table-column label="患者电话" align="center" prop="patientTel" width="80" />
+      <el-table-column label="患者电话" align="center" prop="patientTel" width="180" />
       <el-table-column label="订单编号" align="center" prop="orderCode" width="160" show-overflow-tooltip>
         <template slot-scope="scope">
           <span>{{ scope.row.orderCode || '-' }}</span>

+ 420 - 0
src/views/his/statistics/notRecommendUseStats/notRecommendUseDetail.vue

@@ -0,0 +1,420 @@
+<template>
+  <el-dialog
+    title="详情"
+    :visible.sync="dialogVisible"
+    width="1000px"
+    top="5vh"
+    :close-on-click-modal="false"
+    @close="handleClose"
+  >
+    <!-- 患者基本信息 -->
+    <div v-if="customerInfo && Object.keys(customerInfo).length" class="customer-info-section">
+      <div class="section-title">患者信息</div>
+      <el-row :gutter="20">
+        <el-col :span="4">
+          <span class="info-label">姓名:</span>
+          <span class="info-value">{{ customerInfo.customerName || '-' }}</span>
+        </el-col>
+        <el-col :span="4">
+          <span class="info-label">性别:</span>
+          <span class="info-value">{{ sexText }}</span>
+        </el-col>
+        <el-col :span="4">
+          <span class="info-label">年龄:</span>
+          <span class="info-value">{{ customerInfo.age || '-' }}</span>
+        </el-col>
+        <el-col :span="6">
+          <span class="info-label">电话:</span>
+          <span class="info-value">{{ customerInfo.phone || '-' }}</span>
+        </el-col>
+        <el-col :span="6">
+          <span class="info-label">会诊时间:</span>
+          <span class="info-value">{{ customerInfo.createTime | formatDate }}</span>
+        </el-col>
+      </el-row>
+      <el-row :gutter="20">
+        <el-col :span="24">
+          <span class="info-label">现病史:</span>
+          <span class="info-value">{{ customerInfo.presentIllness || '-' }}</span>
+        </el-col>
+      </el-row>
+      <el-row :gutter="20">
+        <el-col :span="24">
+          <span class="info-label">过敏史:</span>
+          <span class="info-value">{{ customerInfo.allergyHistory || '-' }}</span>
+        </el-col>
+      </el-row>
+      <el-row :gutter="20">
+        <el-col :span="24">
+          <span class="info-label">现用药:</span>
+          <span class="info-value">{{ customerInfo.currentMedication || '-' }}</span>
+        </el-col>
+      </el-row>
+      <el-row :gutter="20">
+        <el-col :span="24">
+          <span class="info-label">患者主诉:</span>
+          <span class="info-value">{{ customerInfo.patientMainComplaint || '-' }}</span>
+        </el-col>
+      </el-row>
+      <el-divider />
+    </div>
+
+    <!-- 客户问答 -->
+    <div v-if="questionAnswers.length > 0" class="question-answer-section">
+      <div class="section-title">患者病情问答</div>
+      <div class="qa-list" style="max-height: 120px; overflow-y: auto;">
+        <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>
+
+    <!-- 医生建议及处置(只读) -->
+    <div class="section-title">医生建议及处置</div>
+    <el-form :model="formData" label-width="120px" size="small">
+      <el-row :gutter="20">
+        <el-col :span="12">
+          <el-form-item label="诊断">
+            <el-input v-model="formData.diagnose" type="textarea" :rows="4" readonly disabled />
+          </el-form-item>
+        </el-col>
+        <el-col :span="12">
+          <el-form-item label="舌诊,面诊,手诊">
+            <el-input v-model="formData.facialDiagnosis" type="textarea" :rows="4" readonly disabled />
+          </el-form-item>
+        </el-col>
+      </el-row>
+
+      <el-row :gutter="20">
+        <el-col :span="12">
+          <el-form-item label="饮食运动建议">
+            <el-input v-model="formData.foodAndExerciseGuidance" type="textarea" :rows="4" readonly disabled />
+          </el-form-item>
+        </el-col>
+        <el-col :span="12">
+          <el-form-item label="注意禁忌">
+            <el-input v-model="formData.noteTaboos" type="textarea" :rows="4" readonly disabled />
+          </el-form-item>
+        </el-col>
+      </el-row>
+
+      <el-form-item label="治疗方面">
+        <el-table :data="formData.healingList" border stripe max-height="300">
+          <el-table-column label="诊断内容" prop="diagnosisContent" min-width="200" />
+          <el-table-column label="建议治疗" prop="suggestTreatment" min-width="200" />
+        </el-table>
+      </el-form-item>
+
+      <!-- 不建议使用复选框 -->
+      <el-form-item label="不建议使用" label-width="120px">
+        <el-checkbox v-model="formData.notRecommendUse" readonly disabled size="small">不建议使用</el-checkbox>
+      </el-form-item>
+
+      <el-divider content-position="left">医生及药师信息</el-divider>
+      <el-row :gutter="20">
+        <el-col :span="12">
+          <el-form-item label="医生职称" label-width="80px">
+            <el-input v-model="signInfo.doctorPosition" readonly disabled size="small" />
+          </el-form-item>
+        </el-col>
+        <el-col :span="12">
+          <el-form-item label="执业医师证号" label-width="100px">
+            <el-input :value="displayLicenseNumber" readonly disabled size="small" />
+          </el-form-item>
+        </el-col>
+      </el-row>
+      <el-row :gutter="20">
+        <el-col :span="12">
+          <el-form-item label="执业医师签字" label-width="100px">
+            <div v-if="signInfo.doctorSignUrl" style="display: flex; align-items: center;">
+              <el-image :src="signInfo.doctorSignUrl" style="width: 80px; height: 30px;" fit="contain" />
+              <span style="margin-left: 6px; color: #606266; font-size: 12px;">({{ signInfo.doctorName || '' }})</span>
+            </div>
+            <el-input v-else :value="signInfo.doctorName || '暂无医生签名'" readonly disabled size="small" />
+          </el-form-item>
+        </el-col>
+        <el-col :span="12">
+          <el-form-item label="药师签字" label-width="80px">
+            <div v-if="signInfo.drugDoctorSignUrl" style="display: flex; align-items: center;">
+              <el-image :src="signInfo.drugDoctorSignUrl" style="width: 80px; height: 30px;" fit="contain" />
+              <span style="margin-left: 6px; color: #606266; font-size: 12px;">({{ signInfo.drugDoctorName || '' }})</span>
+            </div>
+            <el-input v-else :value="signInfo.drugDoctorName || '暂无药师签名'" readonly disabled size="small" />
+          </el-form-item>
+        </el-col>
+      </el-row>
+    </el-form>
+
+    <div slot="footer" class="dialog-footer">
+      <el-button @click="dialogVisible = false">关闭</el-button>
+    </div>
+  </el-dialog>
+</template>
+
+<script>
+import {
+  getDoctorSignInfo,
+  getCustomerInfoAndQuestionAnswer,
+  getDoctorAdvice
+} from "@/api/his/scrmPrescribe";
+
+export default {
+  name: "NotRecommendUseDetail",
+  props: {
+    visible: Boolean,
+    prescribeId: Number,
+    doctorId: Number,
+    drugDoctorId: Number,
+    companyCustomerId: Number,
+    notPrescribeReason: String   // 如果不需要可以忽略
+  },
+  data() {
+    return {
+      dialogVisible: false,
+      customerInfo: {},
+      questionAnswers: [],
+      formData: {
+        diagnose: '',
+        facialDiagnosis: '',
+        foodAndExerciseGuidance: '',
+        healingList: [],
+        noteTaboos: '',
+        notRecommendUse: false
+      },
+      signInfo: {
+        doctorPosition: '',
+        doctorPractiseCode: '',
+        doctorCertificateCode: '',
+        doctorName: '',
+        drugDoctorName: '',
+        doctorSignUrl: '',
+        drugDoctorSignUrl: '',
+      }
+    };
+  },
+  computed: {
+    displayLicenseNumber() {
+      return this.signInfo.doctorPractiseCode || this.signInfo.doctorCertificateCode || '暂无证号';
+    },
+    sexText() {
+      const sex = this.customerInfo.sex;
+      if (sex === '1') return '男';
+      if (sex === '0') return '女';
+      return '未知';
+    }
+  },
+  filters: {
+    formatDate(val) {
+      if (!val) return '-';
+      const date = new Date(val);
+      if (isNaN(date)) return '-';
+      const pad = n => String(n).padStart(2, '0');
+      return `${date.getFullYear()}-${pad(date.getMonth() + 1)}-${pad(date.getDate())} ${pad(date.getHours())}:${pad(date.getMinutes())}:${pad(date.getSeconds())}`;
+    }
+  },
+  watch: {
+    visible(val) {
+      this.dialogVisible = val;
+      if (val) {
+        if (!this.prescribeId) {
+          this.$message.error('处方ID无效,请刷新页面重试');
+          this.dialogVisible = false;
+          this.$emit('update:visible', false);
+          return;
+        }
+        this.resetFormData();
+        this.fetchSignInfo();
+        this.fetchCustomerInfoAndQuestions();
+        this.fetchDoctorAdvice();
+      }
+    }
+  },
+  methods: {
+    resetFormData() {
+      this.formData = {
+        diagnose: '',
+        facialDiagnosis: '',
+        foodAndExerciseGuidance: '',
+        healingList: [],
+        noteTaboos: ''
+      };
+    },
+    fetchSignInfo() {
+      const ids = [];
+      if (this.doctorId) ids.push(this.doctorId);
+      if (this.drugDoctorId) ids.push(this.drugDoctorId);
+      if (ids.length === 0) {
+        this.$message.warning('缺少医生或药师信息,无法获取签名');
+        return;
+      }
+      getDoctorSignInfo(ids).then(response => {
+        const data = response.data;
+        this.signInfo = {
+          doctorPosition: data.position || '',
+          doctorPractiseCode: data.PractiseCode || '',
+          doctorCertificateCode: data.certificateCode || '',
+          doctorName: data.doctorName || '',
+          drugDoctorName: data.drugDoctorName || '',
+          doctorSignUrl: data.doctorSignUrl || '',
+          drugDoctorSignUrl: data.drugDoctorSignUrl || ''
+        };
+      }).catch(error => {
+        console.error('获取签名信息失败', error);
+        this.$message.error('获取医生签名信息失败');
+      });
+    },
+    fetchCustomerInfoAndQuestions() {
+      if (!this.companyCustomerId) {
+        this.customerInfo = {};
+        this.questionAnswers = [];
+        return;
+      }
+      getCustomerInfoAndQuestionAnswer(this.companyCustomerId).then(response => {
+        const data = response.data;
+        if (data) {
+          this.customerInfo = {
+            customerName: data.customerName,
+            sex: data.sex,
+            age: data.age,
+            phone: data.phone,
+            createTime: data.createTime,
+            patientMainComplaint: data.patientMainComplaint,
+            presentIllness: data.presentIllness,
+            allergyHistory: data.allergyHistory,
+            currentMedication: data.currentMedication
+          };
+          this.questionAnswers = data.customerQuestionAnswerVOList || [];
+        } else {
+          this.customerInfo = {};
+          this.questionAnswers = [];
+        }
+      }).catch(error => {
+        console.error('获取客户信息及问答失败', error);
+        this.customerInfo = {};
+        this.questionAnswers = [];
+      });
+    },
+    fetchDoctorAdvice() {
+      getDoctorAdvice(this.prescribeId).then(response => {
+        const data = response.data;
+        if (data) {
+          this.formData.diagnose = data.diagnose || '';
+          this.formData.facialDiagnosis = data.facialDiagnosis || '';
+          this.formData.foodAndExerciseGuidance = data.foodAndExerciseGuidance || '';
+          this.formData.noteTaboos = data.noteTaboos || '';
+          this.formData.notRecommendUse = data.notRecommendUse || false;
+          if (data.healingAreaJson) {
+            try {
+              const list = JSON.parse(data.healingAreaJson);
+              if (Array.isArray(list) && list.length > 0) {
+                this.formData.healingList = list;
+              }
+            } catch (e) {
+              console.error('解析治疗方面JSON失败', e);
+            }
+          }
+        }
+      }).catch(error => {
+        console.error('获取医生建议信息失败', error);
+      });
+    },
+    handleClose() {
+      this.$emit('update:visible', false);
+      this.$emit('close');
+    }
+  }
+};
+</script>
+
+<style scoped>
+.dialog-footer {
+  text-align: right;
+}
+
+.not-prescribe-reason-section {
+  margin-bottom: 14px;
+  background-color: #fdf6ec;
+  padding: 10px 16px;
+  border-radius: 8px;
+  border-left: 4px solid #e6a23c;
+}
+
+.customer-info-section {
+  margin-bottom: 14px;
+  background-color: #f5f7fa;
+  padding: 10px 16px;
+  border-radius: 8px;
+}
+
+.question-answer-section {
+  margin-bottom: 14px;
+  background-color: #f9f9f9;
+  padding: 10px 16px;
+  border-radius: 8px;
+}
+
+.section-title {
+  font-weight: bold;
+  font-size: 15px;
+  margin-bottom: 10px;
+  color: #303133;
+}
+
+.qa-list {
+  display: flex;
+  flex-direction: column;
+  gap: 6px;
+}
+
+.qa-item {
+  display: flex;
+  align-items: baseline;
+  font-size: 13px;
+}
+
+.qa-title {
+  width: 45%;
+  color: #606266;
+  font-weight: 500;
+}
+
+.qa-answer {
+  width: 55%;
+  color: #409EFF;
+  font-weight: normal;
+}
+
+.info-label {
+  display: inline-block;
+  width: 70px;
+  color: #606266;
+  font-weight: 500;
+  font-size: 13px;
+}
+
+.info-value {
+  color: #303133;
+  word-break: break-all;
+  font-size: 13px;
+}
+
+.el-row {
+  margin-bottom: 4px;
+}
+
+/* 只读输入框样式 */
+.el-input__inner,
+.el-textarea__inner {
+  color: #1a1a1a !important;
+}
+
+.el-input.is-disabled .el-input__inner,
+.el-textarea.is-disabled .el-textarea__inner {
+  color: #1a1a1a !important;
+  -webkit-text-fill-color: #1a1a1a !important;
+  background-color: #f5f7fa !important;
+  cursor: default;
+}
+</style>

+ 40 - 7
src/views/his/statistics/notRecommendUseStats/notRecommendUseList.vue

@@ -78,13 +78,18 @@
     <!-- 数据表格 -->
     <el-table v-loading="loading" :data="prescribeList" stripe border>
       <el-table-column label="处方编号" align="center" prop="prescribeCode" width="180" show-overflow-tooltip />
-      <el-table-column label="医生姓名" align="center" prop="doctorName" width="100" />
-      <el-table-column label="销售姓名" align="center" prop="companyUserName" width="100" />
-      <el-table-column label="患者姓名" align="center" prop="patientName" width="100" />
+      <el-table-column label="医生姓名" align="center" prop="doctorName" width="180" />
+      <el-table-column label="销售姓名" align="center" prop="companyUserName" width="180" />
+      <el-table-column label="患者姓名" align="center" prop="patientName" width="180" />
       <el-table-column label="患者年龄" align="center" prop="patientAge" width="80" />
-      <el-table-column label="患者电话" align="center" prop="patientTel" width="100" />
-      <el-table-column label="归属组别" align="center" prop="deptName" width="100"/>
+      <el-table-column label="患者电话" align="center" prop="patientTel" width="180" />
+      <el-table-column label="归属组别" align="center" prop="deptName" width="180"/>
       <el-table-column label="创建时间" align="center" prop="createTime" width="160" />
+      <el-table-column label="操作" align="center" width="100" class-name="small-padding fixed-width">
+        <template slot-scope="scope">
+          <el-button type="text" size="mini" icon="el-icon-document" @click="handleViewDetail(scope.row)">详情</el-button>
+        </template>
+      </el-table-column>
     </el-table>
 
     <!-- 分页 -->
@@ -95,6 +100,16 @@
       :limit.sync="queryParams.pageSize"
       @pagination="getList"
     />
+
+    <!-- ========== 详情弹窗 ========== -->
+    <not-recommend-use-detail
+      :visible.sync="detailDialogVisible"
+      :prescribe-id="currentPrescribeId"
+      :doctor-id="currentDoctorId"
+      :drug-doctor-id="currentDrugDoctorId"
+      :company-customer-id="currentCompanyCustomerId"
+      :not-prescribe-reason="currentNotPrescribeReason"
+    />
   </div>
 </template>
 
@@ -104,10 +119,11 @@ import { getDoctorList } from "@/api/his/doctor";
 import { treeselect } from "@/api/company/companyDept";
 import Treeselect from "@riophae/vue-treeselect";
 import "@riophae/vue-treeselect/dist/vue-treeselect.css";
+import NotRecommendUseDetail from "./notRecommendUseDetail.vue";
 
 export default {
   name: "NotRecommendUseList",
-  components: { Treeselect },
+  components: { Treeselect,NotRecommendUseDetail },
   data() {
     return {
       loading: true,
@@ -124,7 +140,15 @@ export default {
         endTime: null
       },
       doctorList: [],
-      deptOptions: []
+      deptOptions: [],
+
+      // ========== 弹窗相关数据 ==========
+      detailDialogVisible: false,
+      currentPrescribeId: null,
+      currentDoctorId: null,
+      currentDrugDoctorId: null,
+      currentCompanyCustomerId: null,
+      currentNotPrescribeReason: null
     };
   },
   created() {
@@ -178,6 +202,15 @@ export default {
       this.queryParams.endTime = null;
       this.queryParams.deptId = null;
       this.handleQuery();
+    },
+    // ========== 查看详情方法 ==========
+    handleViewDetail(row) {
+      this.currentPrescribeId = row.prescribeId;
+      this.currentDoctorId = row.doctorId;
+      this.currentDrugDoctorId = row.drugDoctorId;
+      this.currentCompanyCustomerId = row.companyCustomerId;
+      this.currentNotPrescribeReason = row.notPrescribeReason || '';
+      this.detailDialogVisible = true;
     }
   }
 };