Explorar o código

修改安全合理用药检测提示方式

cc12458 hai 1 ano
pai
achega
979d376926
Modificáronse 1 ficheiros con 27 adicións e 14 borrados
  1. 27 14
      src/views/diagnosis/Prescribing.vue

+ 27 - 14
src/views/diagnosis/Prescribing.vue

@@ -2605,23 +2605,26 @@ export default {
         if (options.length) {
           const child = this.$children.find(item => item.name === "中药处方");
           const results = await Promise.all(child.recipe_tabs.map((_, index) => this.getRationalMed2(index)));
-          let i = 1;
-          for (const item of results) {
-            const rationalMed = options.map(i => item[i]).filter(Boolean);
-            if (!rationalMed.length) continue;
-
-            this.$message({
+          const tips = results.map((item, index) => {
+            const value = options.map(i => item[i] ? `<div class="title">${item[i].title}</div><div class="content">${item[i].collection.join('')}</div>` : '').join('');
+            return value ? `<div style="padding-top: ${index ? 12 : 0}px;border-bottom: 1px dashed #dcdcdc;"><h2 style="margin-bottom: 16px;">${item.title}</h2>${value}</div>` : '';
+          }).join('');
+          if (tips) {
+            if (!force) {
+              this.$message({
+                dangerouslyUseHTMLString: true,
+                customClass: 'message-rational-safe-use-wrapper',
+                message: tips,
+                duration: 1000 * 3,
+                showClose: true,
+              })
+            } else if (await this.$confirm(tips, '温馨提示:是否保存处方?', {
+              confirmButtonText: '保存',
+              cancelButtonText: '取消',
               dangerouslyUseHTMLString: true,
               customClass: 'message-rational-safe-use-wrapper',
-              message: `<h2 style="margin-bottom: 16px;">${item.title}</h2>` + rationalMed.map(item => {
-                return `<div class="title">${item.title}</div><div class="content">${item.collection.join('')}</div>`
-              }).join(''),
-              duration: 1000 * 3 * i++,
-              showClose: force,
-            })
+            }).then(() => /* 继续 */ false, () => /* 取消 */ true)) return;
           }
-
-          if (force) return;
         }
       } catch (e) {}
       this.saving = false;
@@ -5570,6 +5573,15 @@ export default {
   max-height: 80vh;
   overflow-y: auto;
 
+  &.el-message-box {
+    overflow-y: hidden;
+
+    .el-message-box__content {
+      max-height: calc(80vh - 45px - 48px);
+      overflow: auto;
+    }
+  }
+
   .title {
     font-size: 16px;
     font-weight: 700;
@@ -5584,6 +5596,7 @@ export default {
   }
 
   .el-message__content {
+    width: 100%;
     color: #333;
   }
 }