فهرست منبع

增加超拼网医生开方、药师审核机制

cgp 4 ماه پیش
والد
کامیت
6309762b10

+ 12 - 0
src/api/collection.js

@@ -32,3 +32,15 @@ export function getCollectionByUserId(userId) {
     method: 'get'
   })
 }
+
+/**
+ * 根据第三方用户id和采集来源查询信息采集详情
+ * @param infoSource 信息来源
+ * @param thirdPartyUserId 第三方用户id
+ * */
+export function getCollectionByInfoSourceAndThirdPartyUserId(infoSource,thirdPartyUserId) {
+  return request({
+    url: '/app/collection/getCollectionByInfoSourceAndThirdPartyUserId/' + infoSource+'/'+thirdPartyUserId,
+    method: 'get'
+  })
+}

+ 1 - 9
src/api/prescribe.js

@@ -1,5 +1,5 @@
 import request from '@/utils/request'
- 
+
 export function getPrescribeList(query) {
   return request({
     url: '/app/prescribe/getPrescribeList',
@@ -87,11 +87,3 @@ export function auditPrescribe(data) {
     data: data
   })
 }
-
-
-
-
-
-
-
-

+ 48 - 9
src/views/components/collection/collectionDetail.vue

@@ -28,20 +28,23 @@
       <div v-if="!form.answers || form.answers.length === 0" style="text-align: center; color: #999; padding: 20px;">
         暂无采集信息
       </div>
-
     </el-form>
   </div>
 </template>
 
 <script>
-import { getCollectionByUserId } from "@/api/collection";
+import { getCollectionByUserId, getCollectionByInfoSourceAndThirdPartyUserId } from "@/api/collection";
 
 export default {
   name: "CollectionDetail",
   props: {
     userId: {
       type: [String, Number],
-      required: true
+      default: null  // 改为非必填,因为可能使用thirdPartyUserId
+    },
+    thirdPartyUserId: {
+      type: [String, Number],
+      default: null  // 新增thirdPartyUserId属性
     },
     prescribeId: {
       type: [String, Number],
@@ -51,16 +54,29 @@ export default {
   data() {
     return {
       form: {
-        answers: []
+        answers: [],
+        allergy: '',
+        remark: ''
       },
       loading: false
     };
   },
   watch: {
+    // 监听userId变化
     userId: {
       handler(newVal) {
         if (newVal) {
-          this.fetchCollectionInfo(newVal);
+          this.fetchCollectionInfo();
+        }
+      },
+      immediate: true
+    },
+    // 监听thirdPartyUserId变化
+    thirdPartyUserId: {
+      handler(newVal) {
+        // 只有当userId不存在且thirdPartyUserId有值时,才使用thirdPartyUserId查询
+        if (!this.userId && newVal) {
+          this.fetchCollectionInfo();
         }
       },
       immediate: true
@@ -75,13 +91,36 @@ export default {
       return answer.options.filter(option => selectedValues.has(option.value));
     },
 
-    fetchCollectionInfo(userId) {
+    fetchCollectionInfo() {
+      // 确定使用哪个ID进行查询
+      const queryId = this.userId || this.thirdPartyUserId;
+
+      if (!queryId) {
+        console.warn('没有可用的用户ID');
+        this.form.answers = [];
+        return;
+      }
+
       this.loading = true;
-      getCollectionByUserId(userId)
+
+      // 根据ID类型选择不同的接口
+      let apiCall;
+      if (this.userId) {
+        // 使用系统用户ID查询
+        apiCall = getCollectionByUserId(this.userId);
+      } else {
+        // 使用第三方用户ID查询,信息来源固定为2表示超拼网用户
+        apiCall = getCollectionByInfoSourceAndThirdPartyUserId(2, this.thirdPartyUserId);
+      }
+
+      apiCall
         .then(res => {
           const data = res.data;
-          if (data && Array.isArray(data.answers)) {
-            this.form.answers = data.answers;
+          if (data) {
+            // 赋值
+            this.form.answers = data.answers || [];
+            this.form.allergy = data.allergy || '';
+            this.form.remark = data.remark || '';
           } else {
             this.form.answers = [];
           }

+ 69 - 11
src/views/his/prescribe/index.vue

@@ -5,6 +5,7 @@
         <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">
@@ -103,13 +104,14 @@
           <span>{{ parseTime(scope.row.createTime, '{y}-{m}-{d} {h}:{i}:{s}') }}</span>
         </template>
       </el-table-column>
-      <el-table-column label="处方来源" align="prescribeSource" prop="createTime" width="180">
+      <el-table-column label="处方来源" align="center" prop="prescribeSource" width="180">
         <template slot-scope="scope">
           <el-tag
-            :type="scope.row.prescribeSource === 1 ? 'success' : 'info'"
+            :type="getTagType(scope.row.prescribeSource)"
+            :effect="getTagEffect(scope.row.prescribeSource)"
             size="small"
           >
-            {{ scope.row.prescribeSource === 1 ? '信息采集表' : '其他' }}
+            {{ getSourceText(scope.row.prescribeSource) }}
           </el-tag>
         </template>
       </el-table-column>
@@ -143,6 +145,7 @@
               <el-radio-group v-model="form.prescribeType">
                 <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">
@@ -350,7 +353,12 @@
               </div>
             </el-col>
           </el-row>
-          <collectionDetail :userId="form.userId" :prescribeId="form.prescribeId" v-if="form.userId"/>
+          <collectionDetail
+            :userId="form.userId"
+            :thirdPartyUserId="form.thirdPartyUserId"
+            :prescribeId="form.prescribeId"
+            v-if="form.userId || form.thirdPartyUserId"
+          />
         </el-tab-pane>
       </el-tabs>
 
@@ -413,7 +421,12 @@
           </el-col>
         </el-row>
 
-        <collectionDetail :userId="form.userId" :prescribeId="form.prescribeId" v-if="collectionDialogVisible"/>
+        <collectionDetail
+          :userId="form.userId"
+          :thirdPartyUserId="form.thirdPartyUserId"
+          :prescribeId="form.prescribeId"
+          v-if="collectionDialogVisible && (form.userId || form.thirdPartyUserId)"
+        />
         <span slot="footer" class="dialog-footer">
           <el-button @click="collectionDialogVisible = false">关 闭</el-button>
         </span>
@@ -1016,6 +1029,14 @@ export default {
 
       getPrescribe(prescribeId).then(response => {
         this.form = response.data;
+        //根据historyAllergic设置isHistoryAllergic
+        if (this.form.historyAllergic) {
+          // 如果historyAllergic有值,设置为"是"
+          this.form.isHistoryAllergic = "是";
+        } else {
+          // 如果historyAllergic没有值或为空,设置为"否"
+          this.form.isHistoryAllergic = "否";
+        }
         if(row.doctorConfirm === 0) {
         this.form.startOperateTime = new Date().getTime();
         }
@@ -1299,14 +1320,15 @@ export default {
     },
     /** 患者信息采集详情页面 */
     openCollectionInfo() {
-      if (!this.form.userId) {
-        this.$message.warning("患者ID未填写!");
-        return;
+      if (!this.form.userId) {//系统用户id
+        if (!this.form.thirdPartyUserId){//第三方用户id
+          this.$message.warning("患者ID信息缺失!");
+          return;
+        }
       }
       this.collectionDialogVisible = true;
     },
     // 表单重置
-    // 表单重置
     reset() {
       this.form = {
         prescribeId: undefined,
@@ -1322,13 +1344,14 @@ export default {
         patientGender: "1",
         patientTel: undefined,
         weight: undefined,
-        isHistoryAllergic: undefined,
+        isHistoryAllergic: "否",
         historyAllergic: undefined,
         diagnose: undefined,
         doctorId: undefined,
         doctorName: undefined,
         status: 0,
-        remark: undefined
+        remark: undefined,
+        thirdPartyUserId: undefined,
       };
       this.resetForm("form");
 
@@ -1373,6 +1396,41 @@ export default {
       }
       if (currentLine) lines.push(currentLine);
       return lines.join('\n');
+    },
+    // 获取标签类型(颜色)
+    getTagType(source) {
+      switch(source) {
+        case 1:
+          return 'success';    // 信息采集表 - 绿色
+        case 2:
+          return 'danger';    // 超拼网 - 橙色
+        default:
+          return 'info';       // 其他 - 灰色
+      }
+    },
+
+    // 获取标签效果(可选,让2有特殊效果)
+    getTagEffect(source) {
+      switch(source) {
+        case 1:
+          return 'dark';       // 信息采集表 - 深色效果
+        case 2:
+          return 'dark';      // 超拼网 - 深色效果
+        default:
+          return 'plain';      // 其他 - 朴素效果
+      }
+    },
+
+    // 获取显示的文本
+    getSourceText(source) {
+      switch(source) {
+        case 1:
+          return '信息采集表';
+        case 2:
+          return '超拼网';
+        default:
+          return '其他';
+      }
     }
   }
 };

+ 61 - 9
src/views/his/refuse/index.vue

@@ -5,6 +5,7 @@
         <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">
@@ -103,13 +104,14 @@
           <span>{{ parseTime(scope.row.createTime, '{y}-{m}-{d} {h}:{i}:{s}') }}</span>
         </template>
       </el-table-column>
-      <el-table-column label="处方来源" align="prescribeSource" prop="createTime" width="180">
+      <el-table-column label="处方来源" align="center" prop="prescribeSource" width="180">
         <template slot-scope="scope">
           <el-tag
-            :type="scope.row.prescribeSource === 1 ? 'success' : 'info'"
+            :type="getTagType(scope.row.prescribeSource)"
+            :effect="getTagEffect(scope.row.prescribeSource)"
             size="small"
           >
-            {{ scope.row.prescribeSource === 1 ? '信息采集表' : '其他' }}
+            {{ getSourceText(scope.row.prescribeSource) }}
           </el-tag>
         </template>
       </el-table-column>
@@ -227,7 +229,12 @@
       <!-- 查看采集信息的弹窗 -->
       <el-dialog :visible.sync="collectionDialogVisible" title="用户信息采集详情" width="800px" append-to-body>
 
-        <collectionDetail :userId="form.userId" :prescribeId="form.prescribeId" v-if="collectionDialogVisible" />
+        <collectionDetail
+          :userId="form.userId"
+          :thirdPartyUserId="form.thirdPartyUserId"
+          :prescribeId="form.prescribeId"
+          v-if="collectionDialogVisible && (form.userId || form.thirdPartyUserId)"
+        />
         <span slot="footer" class="dialog-footer">
           <el-button @click="collectionDialogVisible = false">关 闭</el-button>
         </span>
@@ -476,6 +483,14 @@ export default {
       getPrescribe(prescribeId).then(response => {
         console.log('从后端拿到的处方数据:', response.data);
         this.form = response.data;
+        //根据historyAllergic设置isHistoryAllergic
+        if (this.form.historyAllergic) {
+          // 如果historyAllergic有值,设置为"是"
+          this.form.isHistoryAllergic = "是";
+        } else {
+          // 如果historyAllergic没有值或为空,设置为"否"
+          this.form.isHistoryAllergic = "否";
+        }
         this.open = true;
         this.title = "开方";
         this.activeTab = 'basic';
@@ -495,7 +510,6 @@ export default {
           this.form.status = 0;
           confirmPrescribe(this.form).then(response => {
             if (response.code === 200) {
-              //打印提交的 数据
               console.log('提交的处方数据:', this.form);
               this.submitForm();
               this.$message.success("确认成功!");
@@ -660,7 +674,8 @@ export default {
         doctorId: undefined,
         doctorName: undefined,
         status: 0,
-        remark: undefined
+        remark: undefined,
+        thirdPartyUserId: undefined,
       };
       this.resetForm("form");
     },
@@ -685,12 +700,49 @@ export default {
     },
     /** 患者信息采集详情页面 */
     openCollectionInfo() {
-      if (!this.form.userId) {
-        this.$message.warning("患者ID未填写!");
-        return;
+      if (!this.form.userId) {//系统用户id
+        if (!this.form.thirdPartyUserId){//第三方用户id
+          this.$message.warning("患者ID信息缺失!");
+          return;
+        }
       }
       this.collectionDialogVisible = true;
     },
+    // 获取标签类型(颜色)
+    getTagType(source) {
+      switch(source) {
+        case 1:
+          return 'success';    // 信息采集表 - 绿色
+        case 2:
+          return 'danger';    // 超拼网 - 红色
+        default:
+          return 'info';       // 其他 - 灰色
+      }
+    },
+
+    // 获取标签效果(可选,让2有特殊效果)
+    getTagEffect(source) {
+      switch(source) {
+        case 1:
+          return 'dark';       // 信息采集表 - 深色效果
+        case 2:
+          return 'dark';      // 超拼网 - 深色效果
+        default:
+          return 'plain';      // 其他 - 朴素效果
+      }
+    },
+
+    // 获取显示的文本
+    getSourceText(source) {
+      switch(source) {
+        case 1:
+          return '信息采集表';
+        case 2:
+          return '超拼网';
+        default:
+          return '其他';
+      }
+    }
   },
 };
 </script>