|
@@ -1375,25 +1375,7 @@ export default {
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
mounted() {
|
|
mounted() {
|
|
|
- this._getPreNumber();
|
|
|
|
|
- setTimeout(() => {
|
|
|
|
|
- this.inferRecipe(4, "1");
|
|
|
|
|
- this.inferRecipe(4, "3");
|
|
|
|
|
- }, 1000);
|
|
|
|
|
-
|
|
|
|
|
- return;
|
|
|
|
|
- if (this.$route.query.recipeID) {
|
|
|
|
|
- this.getRecipeDataByid(this.$route.query.recipeID);
|
|
|
|
|
- } else if (this.$route.query.doctorCase) {
|
|
|
|
|
- setTimeout(() => {
|
|
|
|
|
- this.changeAndJoin();
|
|
|
|
|
- }, 1000);
|
|
|
|
|
- } else if (this.$route.query.type == "tuidao") {
|
|
|
|
|
- this.isTuiDaoZy = true;
|
|
|
|
|
- this.inferRecipe();
|
|
|
|
|
- } else {
|
|
|
|
|
- this.getRecipeShowData();
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ this._processRouteQuery();
|
|
|
},
|
|
},
|
|
|
beforeRouteLeave(to, from, next) {
|
|
beforeRouteLeave(to, from, next) {
|
|
|
if (to.path == "/index/recipe") {
|
|
if (to.path == "/index/recipe") {
|
|
@@ -1416,11 +1398,35 @@ export default {
|
|
|
methods: {
|
|
methods: {
|
|
|
// 处理路由参数
|
|
// 处理路由参数
|
|
|
async _processRouteQuery() {
|
|
async _processRouteQuery() {
|
|
|
- const query = this.$route.query;
|
|
|
|
|
- if (!query) return;
|
|
|
|
|
|
|
+ const query = this.$route.query || {};
|
|
|
|
|
+ // 暂存处方数据(不含药品)
|
|
|
|
|
+ if (sessionStorage.getItem("prescr" + this.getPatiensInfo.pid)) await this._showDataFromStorage(true);
|
|
|
|
|
+
|
|
|
|
|
+ // 名医名方 —> 方剂查询
|
|
|
if (query.recipeID && query.kjType === "kj-fj") await this.getPreDetal(query.recipeID);
|
|
if (query.recipeID && query.kjType === "kj-fj") await this.getPreDetal(query.recipeID);
|
|
|
|
|
+ // 名医名方 —> 名医医案
|
|
|
else if (query.doctorCase) await this.changeAndJoin();
|
|
else if (query.doctorCase) await this.changeAndJoin();
|
|
|
- },
|
|
|
|
|
|
|
+ // 中医诊疗 -> 智能辩证
|
|
|
|
|
+ else if (query.type === "tuidao") {
|
|
|
|
|
+ await Promise.all([
|
|
|
|
|
+ this.inferRecipe(4, "1"),
|
|
|
|
|
+ this.inferRecipe(4, "3"),
|
|
|
|
|
+ this.inferRecipe(),
|
|
|
|
|
+ ])
|
|
|
|
|
+ this.isTuiDaoZy = true;
|
|
|
|
|
+ }
|
|
|
|
|
+ // 处方编辑 recipeType
|
|
|
|
|
+ else if (this.getEditPreNo()) await this.getRecipeDataByid(this.getEditPreNo());
|
|
|
|
|
+ // 暂存处方
|
|
|
|
|
+ else if (sessionStorage.getItem("prescr" + this.getPatiensInfo.pid)) await this._showDataFromStorage();
|
|
|
|
|
+ // 历史处方
|
|
|
|
|
+ else {
|
|
|
|
|
+ // 跟据就诊记录id获取处方号
|
|
|
|
|
+ let res = await getPreNumber({pid: this.getPatiensInfo.pid}).catch(() => void 0);
|
|
|
|
|
+ const has = res && res.ResultCode == 0 && res.Data.length > 0;
|
|
|
|
|
+ if (has) await this.getRecipeShowData();
|
|
|
|
|
+ }
|
|
|
|
|
+ },
|
|
|
// 参考医案
|
|
// 参考医案
|
|
|
// 中医诊断推导点击
|
|
// 中医诊断推导点击
|
|
|
tcmClick(isauto = true) {
|
|
tcmClick(isauto = true) {
|
|
@@ -1512,7 +1518,7 @@ export default {
|
|
|
// getPatiensInfo
|
|
// getPatiensInfo
|
|
|
},
|
|
},
|
|
|
// 展示系统缓存数据
|
|
// 展示系统缓存数据
|
|
|
- _showDataFromStorage() {
|
|
|
|
|
|
|
+ async _showDataFromStorage(ignoreTable = false) {
|
|
|
let storageData = JSON.parse(
|
|
let storageData = JSON.parse(
|
|
|
sessionStorage.getItem("prescr" + this.getPatiensInfo.pid)
|
|
sessionStorage.getItem("prescr" + this.getPatiensInfo.pid)
|
|
|
);
|
|
);
|
|
@@ -1527,6 +1533,8 @@ export default {
|
|
|
let child2 = children[1];
|
|
let child2 = children[1];
|
|
|
let child3 = children[2];
|
|
let child3 = children[2];
|
|
|
|
|
|
|
|
|
|
+ if (typeof child1.loaded === 'function') await child1.loaded(storageData.child1);
|
|
|
|
|
+
|
|
|
if (storageData.child1.recipe_tabs[0].totalTableD.length > 1) {
|
|
if (storageData.child1.recipe_tabs[0].totalTableD.length > 1) {
|
|
|
this.isTuiDaoZy = true;
|
|
this.isTuiDaoZy = true;
|
|
|
}
|
|
}
|
|
@@ -1535,14 +1543,24 @@ export default {
|
|
|
this.isTuiDaoZy = true;
|
|
this.isTuiDaoZy = true;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ if (ignoreTable) {
|
|
|
|
|
+ for (const recipe of storageData.child1.recipe_tabs) {
|
|
|
|
|
+ recipe.tableData = [];
|
|
|
|
|
+ recipe.tableData1 = [];
|
|
|
|
|
+ recipe.totalTableD = [];
|
|
|
|
|
+ }
|
|
|
|
|
+ storageData.child2.tableData3 = [];
|
|
|
|
|
+ storageData.child3.tableData4 = [];
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
this.container_i = storageData.container_i;
|
|
this.container_i = storageData.container_i;
|
|
|
child1.recipe_tabs = storageData.child1.recipe_tabs;
|
|
child1.recipe_tabs = storageData.child1.recipe_tabs;
|
|
|
child1.recipe_tabs_c = storageData.child1.recipe_tabs_c;
|
|
child1.recipe_tabs_c = storageData.child1.recipe_tabs_c;
|
|
|
- child1.getSelectType("剂型", 0);
|
|
|
|
|
- child1.getSelectType("处方用法");
|
|
|
|
|
- child1.getSelectType("中药服药时间");
|
|
|
|
|
- child1.getSelectType("中药频次");
|
|
|
|
|
- child1.getPharmacyID();
|
|
|
|
|
|
|
+ // child1.getSelectType("剂型", 0);
|
|
|
|
|
+ // child1.getSelectType("处方用法");
|
|
|
|
|
+ // child1.getSelectType("中药服药时间");
|
|
|
|
|
+ // child1.getSelectType("中药频次");
|
|
|
|
|
+ // child1.getPharmacyID();
|
|
|
child2.tableData3 = storageData.child2.tableData3;
|
|
child2.tableData3 = storageData.child2.tableData3;
|
|
|
child2.bottom_form = storageData.child2.bottom_form;
|
|
child2.bottom_form = storageData.child2.bottom_form;
|
|
|
|
|
|
|
@@ -3024,43 +3042,6 @@ export default {
|
|
|
this.setDrugsInfo(this.preInfo.items);
|
|
this.setDrugsInfo(this.preInfo.items);
|
|
|
this.changeAndJoin(1);
|
|
this.changeAndJoin(1);
|
|
|
},
|
|
},
|
|
|
- // 跟据就诊记录id获取处方号
|
|
|
|
|
- async _getPreNumber() {
|
|
|
|
|
- let res = await getPreNumber({
|
|
|
|
|
- pid: this.getPatiensInfo.pid
|
|
|
|
|
- });
|
|
|
|
|
- if (res.ResultCode == 0) {
|
|
|
|
|
- setTimeout(() => {
|
|
|
|
|
- this.inferRecipe();
|
|
|
|
|
- }, 800);
|
|
|
|
|
- if (res.Data.length == 0) {
|
|
|
|
|
- // 没有处方号
|
|
|
|
|
- let hasStorage = sessionStorage.getItem(
|
|
|
|
|
- "prescr" + this.getPatiensInfo.pid
|
|
|
|
|
- )
|
|
|
|
|
- ? true
|
|
|
|
|
- : false;
|
|
|
|
|
- if (hasStorage) {
|
|
|
|
|
- this._showDataFromStorage();
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- const recipeID = this.getEditPreNo();
|
|
|
|
|
- debugger
|
|
|
|
|
- if (!!recipeID && !this.$route.query.kjType) {
|
|
|
|
|
- await this.getRecipeDataByid(recipeID);
|
|
|
|
|
- } else if (this.$route.query.type == "tuidao") {
|
|
|
|
|
- this.isTuiDaoZy = true;
|
|
|
|
|
- // setTimeout(() => {
|
|
|
|
|
- // this.inferRecipe()
|
|
|
|
|
- // }, 800)
|
|
|
|
|
- }
|
|
|
|
|
- } else {
|
|
|
|
|
- // 有处方号
|
|
|
|
|
- await this.getRecipeShowData();
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
- await this._processRouteQuery();
|
|
|
|
|
- },
|
|
|
|
|
// 药方是否支付
|
|
// 药方是否支付
|
|
|
async _recipeIsPay(id, type, index) {
|
|
async _recipeIsPay(id, type, index) {
|
|
|
let res = await recipeIsPay({
|
|
let res = await recipeIsPay({
|