|
|
@@ -2595,8 +2595,37 @@ export default {
|
|
|
);
|
|
|
},
|
|
|
// 提交中药处方
|
|
|
- submitRecipe1() {
|
|
|
+ async submitRecipe1() {
|
|
|
let zhongPrescriptionVo = this.dealRecipe1();
|
|
|
+ if (!zhongPrescriptionVo.length) return;
|
|
|
+
|
|
|
+ this.saving = true;
|
|
|
+ try {
|
|
|
+ const {options, force} = await this.getRationalSafeUse();
|
|
|
+ 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({
|
|
|
+ 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,
|
|
|
+ })
|
|
|
+ }
|
|
|
+
|
|
|
+ if (force) return;
|
|
|
+ }
|
|
|
+ } catch (e) {}
|
|
|
+ this.saving = false;
|
|
|
+
|
|
|
let chengPrescriptionVo = {};
|
|
|
// setTimeout(() => {
|
|
|
// chengPrescriptionVo = this.dealRecipe2();
|
|
|
@@ -3421,6 +3450,108 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
// 获取右侧合理用药信息展示
|
|
|
+ async getRationalMed2(index) {
|
|
|
+ const child = this.$children.find(item => item.name === "中药处方");
|
|
|
+ if (index == null) index = child.recipe_tabs_c;
|
|
|
+ const gather = child.recipe_tabs[index].totalTableD.filter(item => item.name && item.medid).map(item => item.medid);
|
|
|
+
|
|
|
+ const request = (id, i, ids) => getRationalMed({
|
|
|
+ matID: id,
|
|
|
+ matIds: [...ids.slice(0, i), ...ids.slice(i + 1)],
|
|
|
+ orgId: this.getuserinfo.organizationid,
|
|
|
+ }).then(res => res.code === 0 ? Object.assign({matid: id}, res.data) : null).catch(err => null)
|
|
|
+
|
|
|
+ const rationalMed = await Promise.all(gather.map(request)).then(data => data.filter(Boolean));
|
|
|
+ return rationalMed.reduce((data, item) => {
|
|
|
+ const color = 'blue';
|
|
|
+
|
|
|
+ if (item.matdosage && item.showDose) {
|
|
|
+ const ref = {}, i = 1;
|
|
|
+ const child = data[i] || (data[i] = {title: '', collection: []});
|
|
|
+ child.collection.push(`<div>
|
|
|
+ <span class="met-name" style="color: ${color};">${item.matname}</span>
|
|
|
+ <span class="met-value">${ref[item.matdosage]}</span>
|
|
|
+ </div>`);
|
|
|
+ }
|
|
|
+ if (item.matsjj) {
|
|
|
+ const ref = {1: '慎用', 2: '忌用', 3: '禁用'}, i = 2;
|
|
|
+ const child = data[i] || (data[i] = {title: '慎忌禁用药', collection: []});
|
|
|
+ child.collection.push(`<div>
|
|
|
+ <span class="met-name" style="color: ${color};">${item.matname}</span>
|
|
|
+ <span class="met-value">${ref[item.matsjj]}</span>
|
|
|
+ </div>`);
|
|
|
+ }
|
|
|
+ if (item.matyfsjj) {
|
|
|
+ const color = item.matyfsjj === '3' ? 'red' : 'blue';
|
|
|
+ const ref = {1: '孕妇慎用', 2: '孕妇忌用', 3: '孕妇禁用'}, i = 3;
|
|
|
+ const child = data[i] || (data[i] = {title: '孕妇慎忌禁', collection: []});
|
|
|
+ child.collection.push(`<div>
|
|
|
+ <span class="met-name" style="color: ${color};">${item.matname}</span>
|
|
|
+ <span class="met-value">${ref[item.matyfsjj]}</span>
|
|
|
+ </div>`);
|
|
|
+ }
|
|
|
+ if (item.matysjj) {
|
|
|
+ const ref = {}, i = 4;
|
|
|
+ const child = data[i] || (data[i] = {title: '服药饮食禁忌', collection: []});
|
|
|
+ child.collection.push(`<div>
|
|
|
+ <span class="met-name" style="color: ${color};">${item.matname}</span>
|
|
|
+ <span class="met-value">${item.matysjj || '无'}</span>
|
|
|
+ </div>`);
|
|
|
+ }
|
|
|
+ if (item.matdxsm) {
|
|
|
+ const color = 'red';
|
|
|
+ const ref = {}, i = 5;
|
|
|
+ const child = data[i] || (data[i] = {title: '药物毒性说明', collection: []});
|
|
|
+ child.collection.push(`<div>
|
|
|
+ <span class="met-name" style="color: ${color};">${item.matname}</span>
|
|
|
+ <span class="met-value">${item.matdxsm || '无'}</span>
|
|
|
+ </div>`);
|
|
|
+ }
|
|
|
+ if (item.matbzjj) {
|
|
|
+ const ref = {}, i = 6;
|
|
|
+ const child = data[i] || (data[i] = {title: '病证用药禁忌', collection: []});
|
|
|
+ child.collection.push(`<div>
|
|
|
+ <span class="met-name" style="color: ${color};">${item.matname}</span>
|
|
|
+ <span class="met-value">${item.matbzjj || '无'}</span>
|
|
|
+ </div>`);
|
|
|
+ }
|
|
|
+ if (item.matsbf) {
|
|
|
+ const color = 'red';
|
|
|
+ const ref = {}, i = 7;
|
|
|
+ const child = data[i] || (data[i] = {title: '十八反', collection: []});
|
|
|
+ child.collection.push(`<div>
|
|
|
+ <span class="met-name" style="color: ${color};">${item.matname}</span>
|
|
|
+ <span class="met-value">反${item.matsbf}</span>
|
|
|
+ </div>`);
|
|
|
+ }
|
|
|
+ if (item.matsjw) {
|
|
|
+ const color = 'red';
|
|
|
+ const ref = {}, i = 8;
|
|
|
+ const child = data[i] || (data[i] = {title: '十九畏', collection: []});
|
|
|
+ child.collection.push(`<div>
|
|
|
+ <span class="met-name" style="color: ${color};">${item.matname}</span>
|
|
|
+ <span class="met-value">畏${item.matsjw}</span>
|
|
|
+ </div>`);
|
|
|
+ }
|
|
|
+ if (item.matby) {
|
|
|
+ const ref = {}, i = 9;
|
|
|
+ const child = data[i] || (data[i] = {title: '用药不宜', collection: []});
|
|
|
+ child.collection.push(`<div>
|
|
|
+ <span class="met-name" style="color: ${color};">${item.matname}</span>
|
|
|
+ <span class="met-value">不宜与${item.matby}同用</span>
|
|
|
+ </div>`);
|
|
|
+ }
|
|
|
+ if (item.matmindosage && item.matmaxdosage) {
|
|
|
+ const ref = {}, i = 10;
|
|
|
+ const child = data[i] || (data[i] = {title: '超剂量药品', collection: []});
|
|
|
+ child.collection.push(`<div>
|
|
|
+ <span class="met-name" style="color: ${color};">${item.matname}</span>
|
|
|
+ <span class="met-value" style="color: red;">(${item.matmindosage}-${item.matmaxdosage})</span>
|
|
|
+ </div>`);
|
|
|
+ }
|
|
|
+ return data;
|
|
|
+ }, {title: `中药处方${index + 1}`});
|
|
|
+ },
|
|
|
async getRationalMed(id) {
|
|
|
let ids = [];
|
|
|
// this.rationalMed = []
|
|
|
@@ -5427,10 +5558,33 @@ export default {
|
|
|
<style lang="scss" scoped>
|
|
|
@import "../../style/media/diagnosis/prescribing.scss";
|
|
|
</style>
|
|
|
-<style>
|
|
|
+<style lang="scss">
|
|
|
/* @media screen and (max-width: 768px) {
|
|
|
body {
|
|
|
width: 100% !important;
|
|
|
}
|
|
|
} */
|
|
|
+
|
|
|
+.message-rational-safe-use-wrapper {
|
|
|
+ align-items: flex-start;
|
|
|
+ max-height: 80vh;
|
|
|
+ overflow-y: auto;
|
|
|
+
|
|
|
+ .title {
|
|
|
+ font-size: 16px;
|
|
|
+ font-weight: 700;
|
|
|
+ }
|
|
|
+
|
|
|
+ .content {
|
|
|
+ margin: 12px 0;
|
|
|
+
|
|
|
+ > div {
|
|
|
+ margin: 8px 0;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ .el-message__content {
|
|
|
+ color: #333;
|
|
|
+ }
|
|
|
+}
|
|
|
</style>
|