Преглед изворни кода

完善医生端开方时信息采集校验逻辑

cgp пре 2 недеља
родитељ
комит
a76f4fd9e8

+ 33 - 25
src/views/components/collection/collectionDetail.vue

@@ -8,20 +8,24 @@
           </span>
         </div>
         <div style="margin-left: 31px;">
-          <el-checkbox-group v-model="form.answers[index].value" size="mini" :disabled="true">
-            <el-checkbox v-for="dict in getSelectedOptions(answer)" :key="dict.value" :label="dict.value">
-              {{ dict.name }}
-            </el-checkbox>
-          </el-checkbox-group>
+          <!-- 改为自定义渲染,以便显示备注 -->
+          <div v-for="(option, optIdx) in getSelectedOptionsWithRemarks(answer)" :key="optIdx"
+               style="margin-bottom: 8px;">
+            <el-checkbox :value="true" disabled>{{ option.name }}</el-checkbox>:
+            <span v-if="option.remarkText"
+                  style="margin-left: 6px; display: inline-block; color: #606266; font-size: 13px; border-bottom: 1px dashed #dcdfe6; padding-bottom: 2px;">
+                  {{ option.remarkText }}
+            </span>
+          </div>
         </div>
       </div>
-      <div>
+      <div v-if="form.allergy || form.remark">
         <el-form-item label="过敏情况" prop="allergy">
-          <el-input type="textarea" :rows="2" placeholder="请输入过敏情况" v-model="form.allergy">
+          <el-input type="textarea" :rows="2" placeholder="请输入过敏情况" v-model="form.allergy" disabled>
           </el-input>
         </el-form-item>
         <el-form-item label="备注" prop="remark">
-          <el-input type="textarea" :rows="2" placeholder="请输入备注" v-model="form.remark">
+          <el-input type="textarea" :rows="2" placeholder="请输入备注" v-model="form.remark" disabled>
           </el-input>
         </el-form-item>
       </div>
@@ -40,11 +44,11 @@ export default {
   props: {
     userId: {
       type: [String, Number],
-      default: null  // 改为非必填,因为可能使用thirdPartyUserId
+      default: null
     },
     thirdPartyUserId: {
       type: [String, Number],
-      default: null  // 新增thirdPartyUserId属性
+      default: null
     },
     prescribeId: {
       type: [String, Number],
@@ -62,7 +66,6 @@ export default {
     };
   },
   watch: {
-    // 监听userId变化
     userId: {
       handler(newVal) {
         if (newVal) {
@@ -71,10 +74,8 @@ export default {
       },
       immediate: true
     },
-    // 监听thirdPartyUserId变化
     thirdPartyUserId: {
       handler(newVal) {
-        // 只有当userId不存在且thirdPartyUserId有值时,才使用thirdPartyUserId查询
         if (!this.userId && newVal) {
           this.fetchCollectionInfo();
         }
@@ -83,18 +84,30 @@ export default {
     }
   },
   methods: {
-    getSelectedOptions(answer) {
+    // 获取选中的选项,并附带备注信息
+    getSelectedOptionsWithRemarks(answer) {
       if (!Array.isArray(answer.value) || !Array.isArray(answer.options)) {
         return [];
       }
       const selectedValues = new Set(answer.value);
-      return answer.options.filter(option => selectedValues.has(option.value));
+      // 构建备注映射
+      const remarksMap = new Map();
+      if (Array.isArray(answer.remarksList)) {
+        answer.remarksList.forEach(remark => {
+          remarksMap.set(remark.value, remark.text);
+        });
+      }
+      // 过滤出选中的选项,并附加备注
+      return answer.options
+        .filter(option => selectedValues.has(option.value))
+        .map(option => ({
+          ...option,
+          remarkText: remarksMap.get(option.value) || ''
+        }));
     },
 
     fetchCollectionInfo() {
-      // 确定使用哪个ID进行查询
       const queryId = this.userId || this.thirdPartyUserId;
-
       if (!queryId) {
         console.warn('没有可用的用户ID');
         this.form.answers = [];
@@ -103,13 +116,10 @@ export default {
 
       this.loading = true;
 
-      // 根据ID类型选择不同的接口
       let apiCall;
       if (this.userId) {
-        // 使用系统用户ID查询
         apiCall = getCollectionByUserId(this.userId);
       } else {
-        // 使用第三方用户ID查询,信息来源固定为2表示超拼网用户
         apiCall = getCollectionByInfoSourceAndThirdPartyUserId(2, this.thirdPartyUserId);
       }
 
@@ -117,7 +127,6 @@ export default {
         .then(res => {
           const data = res.data;
           if (data) {
-            // 赋值
             this.form.answers = data.answers || [];
             this.form.allergy = data.allergy || '';
             this.form.remark = data.remark || '';
@@ -139,17 +148,16 @@ export default {
 </script>
 
 <style scoped>
-.app-container>>>.el-checkbox.is-disabled .el-checkbox__input.is-checked .el-checkbox__inner {
+.app-container >>> .el-checkbox.is-disabled .el-checkbox__input.is-checked .el-checkbox__inner {
   background-color: #409eff !important;
   border-color: #409eff !important;
 }
 
-.app-container>>>.el-checkbox.is-disabled .el-checkbox__input.is-checked .el-checkbox__inner::after {
+.app-container >>> .el-checkbox.is-disabled .el-checkbox__input.is-checked .el-checkbox__inner::after {
   border-color: #fff !important;
 }
 
-/*让已选中禁用状态的文字也高亮为蓝色 */
-.app-container>>>.el-checkbox.is-disabled .el-checkbox__input.is-checked+.el-checkbox__label {
+.app-container >>> .el-checkbox.is-disabled .el-checkbox__input.is-checked + .el-checkbox__label {
   color: #409eff !important;
 }
 </style>

+ 9 - 1
src/views/his/prescribe/index.vue

@@ -104,7 +104,7 @@
           <span>{{ parseTime(scope.row.createTime, '{y}-{m}-{d} {h}:{i}:{s}') }}</span>
         </template>
       </el-table-column>
-      <el-table-column label="处方来源" align="center" prop="prescribeSource" width="180">
+      <el-table-column label="处方来源" align="center" prop="prescribeSource" width="270">
         <template slot-scope="scope">
           <el-tag
             :type="getTagType(scope.row.prescribeSource)"
@@ -113,6 +113,9 @@
           >
             {{ getSourceText(scope.row.prescribeSource) }}
           </el-tag>
+          <span v-if="scope.row.prescribeSource === 1 && scope.row.completeStatus === 0" style="margin-left: 5px; color: red;">
+      (待销售完善采集信息)
+    </span>
         </template>
       </el-table-column>
       <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
@@ -1023,6 +1026,11 @@ export default {
     },
     /** 修改按钮操作 */
     handleUpdate(row) {
+      // 如果是信息采集表且未完善,不允许开方,提示用户
+      if (row.prescribeSource === 1 && row.completeStatus === 0) {
+        this.$message.warning('请联系销售完善患者采集信息!');
+        return;
+      }
       this.reset();
       const prescribeId = row.prescribeId || this.ids[0];
       this.currentConfirm = row.doctorConfirm;

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

@@ -104,7 +104,7 @@
           <span>{{ parseTime(scope.row.createTime, '{y}-{m}-{d} {h}:{i}:{s}') }}</span>
         </template>
       </el-table-column>
-      <el-table-column label="处方来源" align="center" prop="prescribeSource" width="180">
+      <el-table-column label="处方来源" align="center" prop="prescribeSource" width="270">
         <template slot-scope="scope">
           <el-tag
             :type="getTagType(scope.row.prescribeSource)"
@@ -113,6 +113,9 @@
           >
             {{ getSourceText(scope.row.prescribeSource) }}
           </el-tag>
+          <span v-if="scope.row.prescribeSource === 1 && scope.row.completeStatus === 0" style="margin-left: 5px; color: red;">
+      (待销售完善采集信息)
+    </span>
         </template>
       </el-table-column>
       <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
@@ -476,12 +479,16 @@ export default {
     },
     /** 修改按钮操作 */
     handleUpdate(row) {
+      // 如果是信息采集表且未完善,不允许开方,提示用户
+      if (row.prescribeSource === 1 && row.completeStatus === 0) {
+        this.$message.warning('请联系销售完善患者采集信息!');
+        return;
+      }
       this.reset();
       const prescribeId = row.prescribeId || this.ids[0];
       this.currentConfirm = row.doctorConfirm;
 
       getPrescribe(prescribeId).then(response => {
-        console.log('从后端拿到的处方数据:', response.data);
         this.form = response.data;
         //根据historyAllergic设置isHistoryAllergic
         if (this.form.historyAllergic) {