Просмотр исходного кода

Merge branch 'openIm_ysy' of http://1.14.104.71:10880/root/ylrz_his_scrm_doctorUI into openIm_ysy

wjj 1 неделя назад
Родитель
Сommit
b06001b426

+ 26 - 22
src/views/components/collection/collectionDetail.vue

@@ -1,6 +1,5 @@
 <template>
   <div class="app-container">
-    <!-- 可选:添加 loading 提示 -->
     <el-form ref="form" :model="form" label-width="140px" v-loading="loading">
       <div v-for="(answer, index) in form.answers" :key="index">
         <div style="margin-bottom: 20px; margin-top: 20px;">
@@ -9,24 +8,22 @@
           </span>
         </div>
         <div style="margin-left: 31px;">
-          <!-- flag 控制是否可编辑 -->
           <el-checkbox-group
-            :disabled="answer.flag || false"
             v-model="form.answers[index].value"
             size="mini"
+            :disabled="true"
           >
             <el-checkbox
-              v-for="dict in answer.options"
+              v-for="dict in getSelectedOptions(answer)"
               :key="dict.value"
               :label="dict.value"
             >
-              {{ dict.name }}
+            {{ dict.name }}
             </el-checkbox>
           </el-checkbox-group>
         </div>
       </div>
 
-      <!-- 如果没有数据 -->
       <div v-if="!form.answers || form.answers.length === 0" style="text-align: center; color: #999; padding: 20px;">
         暂无采集信息
       </div>
@@ -35,8 +32,8 @@
 </template>
 
 <script>
-//根据 userId 获取采集信息的接口
 import { getCollectionByUserId } from "@/api/collection";
+
 export default {
   name: "CollectionDetail",
   props: {
@@ -54,10 +51,7 @@ export default {
       form: {
         answers: []
       },
-      loading: false,
-      questionOptions: [],
-      privatePackageOptions: [],
-      codeImage: null
+      loading: false
     };
   },
   watch: {
@@ -71,22 +65,29 @@ export default {
     }
   },
   methods: {
+    getSelectedOptions(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));
+    },
+
     fetchCollectionInfo(userId) {
       this.loading = true;
-      console.log("传入的用户信息:", userId)
       getCollectionByUserId(userId)
         .then(res => {
           const data = res.data;
           if (data && Array.isArray(data.answers)) {
-            this.form = data;
+            this.form.answers = data.answers;
           } else {
-            this.form = { answers: [] };
+            this.form.answers = [];
           }
         })
         .catch(err => {
           console.error("获取采集信息失败:", err);
           this.$message.warning("暂无采集信息");
-          this.form = { answers: [] };
+          this.form.answers = [];
         })
         .finally(() => {
           this.loading = false;
@@ -97,14 +98,17 @@ export default {
 </script>
 
 <style scoped>
-::v-deep .el-checkbox__input.is-disabled + span.el-checkbox__label {
-    color: #1890ff;
+.app-container >>> .el-checkbox.is-disabled .el-checkbox__input.is-checked .el-checkbox__inner {
+  background-color: #409eff !important;
+  border-color: #409eff !important;
 }
-::v-deep .el-checkbox-button.is-disabled.is-checked .el-checkbox-button__inner {
-    color: #1890ff;
+
+.app-container >>> .el-checkbox.is-disabled .el-checkbox__input.is-checked .el-checkbox__inner::after {
+  border-color: #fff !important;
 }
-::v-deep .el-checkbox__input.is-disabled.is-checked .el-checkbox__inner::after {
-    border-color: #1890ff;
+
+/*让已选中禁用状态的文字也高亮为蓝色 */
+.app-container >>> .el-checkbox.is-disabled .el-checkbox__input.is-checked + .el-checkbox__label {
+  color: #409eff !important;
 }
-/* 可添加一些样式优化 */
 </style>

+ 2 - 2
src/views/his/prescribe/index.vue

@@ -958,11 +958,11 @@ export default {
       })
     },
     confirmPrescribe(){
+      //确认处方的同时保存处方
+      this.submitForm();
       confirmPrescribe(this.form).then(response => {
         if(response.code === 200) {
           this.$message.success("确认成功!");
-          //确认处方的同时保存处方
-          this.submitForm();
           this.open = false;
         } else {
           this.$message.error(response.message);