|
@@ -3558,7 +3558,6 @@ export default {
|
|
|
}, {title: `中药处方${index + 1}`});
|
|
}, {title: `中药处方${index + 1}`});
|
|
|
},
|
|
},
|
|
|
async getRationalMed(id) {
|
|
async getRationalMed(id) {
|
|
|
- let ids = [];
|
|
|
|
|
// this.rationalMed = []
|
|
// this.rationalMed = []
|
|
|
let children = this.$children.filter(item => {
|
|
let children = this.$children.filter(item => {
|
|
|
return (
|
|
return (
|
|
@@ -3568,21 +3567,9 @@ export default {
|
|
|
);
|
|
);
|
|
|
});
|
|
});
|
|
|
let child = children[0];
|
|
let child = children[0];
|
|
|
-
|
|
|
|
|
- child.recipe_tabs[child.recipe_tabs_c].totalTableD.forEach(item => {
|
|
|
|
|
- if (item.name) {
|
|
|
|
|
- ids.push(item.medid);
|
|
|
|
|
- }
|
|
|
|
|
- });
|
|
|
|
|
-
|
|
|
|
|
- let idsIndex = 0;
|
|
|
|
|
- ids.forEach((item, index) => {
|
|
|
|
|
- if (item == id) {
|
|
|
|
|
- idsIndex = index;
|
|
|
|
|
- }
|
|
|
|
|
- });
|
|
|
|
|
-
|
|
|
|
|
- ids.splice(idsIndex, 1);
|
|
|
|
|
|
|
+ const medicines = child.recipe_tabs[child.recipe_tabs_c].totalTableD || [];
|
|
|
|
|
+ const medicine = medicines.find(medicine => medicine.medid === id);
|
|
|
|
|
+ const ids = medicines.filter(medicine => medicine.name && medicine.medid !== id).map(medicine => medicine.medid);
|
|
|
// this.rationalMed = []
|
|
// this.rationalMed = []
|
|
|
let res = await getRationalMed({
|
|
let res = await getRationalMed({
|
|
|
matID: id,
|
|
matID: id,
|
|
@@ -3592,7 +3579,7 @@ export default {
|
|
|
if (res.code == 0 && res.message) {
|
|
if (res.code == 0 && res.message) {
|
|
|
res.data.reqID = id;
|
|
res.data.reqID = id;
|
|
|
|
|
|
|
|
- this.rationalMed.push(res.data);
|
|
|
|
|
|
|
+ this.rationalMed.push(Object.assign(res.data, {__medicine__: medicine}));
|
|
|
// 去重
|
|
// 去重
|
|
|
const removeRepeat = (arr, key) => {
|
|
const removeRepeat = (arr, key) => {
|
|
|
let obj = {};
|
|
let obj = {};
|
|
@@ -3678,6 +3665,10 @@ export default {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
if (item.matmaxdosage && item.matmindosage) {
|
|
if (item.matmaxdosage && item.matmindosage) {
|
|
|
|
|
+ try {
|
|
|
|
|
+ const dose = +item.__medicine__.dose;
|
|
|
|
|
+ if (dose && (dose < item.matmindosage || dose > item.matmaxdosage)) item.showDose = true;
|
|
|
|
|
+ } catch (e) {}
|
|
|
this.rationalMed10.push(item);
|
|
this.rationalMed10.push(item);
|
|
|
}
|
|
}
|
|
|
});
|
|
});
|
|
@@ -3695,7 +3686,6 @@ export default {
|
|
|
},
|
|
},
|
|
|
// 获取合理用药信息 平台
|
|
// 获取合理用药信息 平台
|
|
|
async getRationalMedForPlat(id) {
|
|
async getRationalMedForPlat(id) {
|
|
|
- let ids = [];
|
|
|
|
|
this.rationalMed = [];
|
|
this.rationalMed = [];
|
|
|
let children = this.$children.filter(item => {
|
|
let children = this.$children.filter(item => {
|
|
|
return (
|
|
return (
|
|
@@ -3705,21 +3695,9 @@ export default {
|
|
|
);
|
|
);
|
|
|
});
|
|
});
|
|
|
let child = children[0];
|
|
let child = children[0];
|
|
|
-
|
|
|
|
|
- child.recipe_tabs[child.recipe_tabs_c].totalTableD.forEach(item => {
|
|
|
|
|
- if (item.name) {
|
|
|
|
|
- ids.push(item.medid);
|
|
|
|
|
- }
|
|
|
|
|
- });
|
|
|
|
|
-
|
|
|
|
|
- let idsIndex = 0;
|
|
|
|
|
- ids.forEach((item, index) => {
|
|
|
|
|
- if (item == id) {
|
|
|
|
|
- idsIndex = index;
|
|
|
|
|
- }
|
|
|
|
|
- });
|
|
|
|
|
-
|
|
|
|
|
- ids.splice(idsIndex, 1);
|
|
|
|
|
|
|
+ const medicines = child.recipe_tabs[child.recipe_tabs_c].totalTableD || [];
|
|
|
|
|
+ const medicine = medicines.find(medicine => medicine.medid === id);
|
|
|
|
|
+ const ids = medicines.filter(medicine => medicine.name && medicine.medid !== id).map(medicine => medicine.medid);
|
|
|
|
|
|
|
|
let res = await getRationalMedForPlat({
|
|
let res = await getRationalMedForPlat({
|
|
|
matID: id,
|
|
matID: id,
|
|
@@ -3729,7 +3707,7 @@ export default {
|
|
|
if (res.code == 0 && res.message) {
|
|
if (res.code == 0 && res.message) {
|
|
|
res.data.reqID = id;
|
|
res.data.reqID = id;
|
|
|
|
|
|
|
|
- this.rationalMed.push(res.data);
|
|
|
|
|
|
|
+ this.rationalMed.push(Object.assign(res.data, {__medicine__: medicine}));
|
|
|
|
|
|
|
|
// 去重
|
|
// 去重
|
|
|
const removeRepeat = (arr, key) => {
|
|
const removeRepeat = (arr, key) => {
|
|
@@ -3791,6 +3769,10 @@ export default {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
if (item.matmaxdosage && item.matmindosage) {
|
|
if (item.matmaxdosage && item.matmindosage) {
|
|
|
|
|
+ try {
|
|
|
|
|
+ const dose = +item.__medicine__.dose;
|
|
|
|
|
+ if (dose < item.matmindosage || dose > item.matmaxdosage) item.showDose = true;
|
|
|
|
|
+ } catch (e) {}
|
|
|
this.rationalMed10.push(item);
|
|
this.rationalMed10.push(item);
|
|
|
}
|
|
}
|
|
|
});
|
|
});
|