|
@@ -2605,23 +2605,26 @@ export default {
|
|
|
if (options.length) {
|
|
if (options.length) {
|
|
|
const child = this.$children.find(item => item.name === "中药处方");
|
|
const child = this.$children.find(item => item.name === "中药处方");
|
|
|
const results = await Promise.all(child.recipe_tabs.map((_, index) => this.getRationalMed2(index)));
|
|
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,
|
|
dangerouslyUseHTMLString: true,
|
|
|
customClass: 'message-rational-safe-use-wrapper',
|
|
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) {}
|
|
} catch (e) {}
|
|
|
this.saving = false;
|
|
this.saving = false;
|
|
@@ -5570,6 +5573,15 @@ export default {
|
|
|
max-height: 80vh;
|
|
max-height: 80vh;
|
|
|
overflow-y: auto;
|
|
overflow-y: auto;
|
|
|
|
|
|
|
|
|
|
+ &.el-message-box {
|
|
|
|
|
+ overflow-y: hidden;
|
|
|
|
|
+
|
|
|
|
|
+ .el-message-box__content {
|
|
|
|
|
+ max-height: calc(80vh - 45px - 48px);
|
|
|
|
|
+ overflow: auto;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
.title {
|
|
.title {
|
|
|
font-size: 16px;
|
|
font-size: 16px;
|
|
|
font-weight: 700;
|
|
font-weight: 700;
|
|
@@ -5584,6 +5596,7 @@ export default {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
.el-message__content {
|
|
.el-message__content {
|
|
|
|
|
+ width: 100%;
|
|
|
color: #333;
|
|
color: #333;
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|