|
@@ -1503,7 +1503,7 @@ export default {
|
|
|
// 就诊记录转方
|
|
// 就诊记录转方
|
|
|
else if (query.recipeID) await this.getRecipeDataByid(this.$route.query.recipeID);
|
|
else if (query.recipeID) await this.getRecipeDataByid(this.$route.query.recipeID);
|
|
|
// 适宜技术病历转方
|
|
// 适宜技术病历转方
|
|
|
- else if (query.suitRecordId) await this.suitTechRecordTurn(query.suitRecordId);
|
|
|
|
|
|
|
+ else if (query.suitRecordId) await this.suitTechRecordTurn(query.suitRecordId,this.getPatiensInfo.pid);
|
|
|
// 处方管理 适宜技术转方
|
|
// 处方管理 适宜技术转方
|
|
|
// else if (query.suitRecipeId) await this.suitRecipeIdTurn(query.suitRecipeId);
|
|
// else if (query.suitRecipeId) await this.suitRecipeIdTurn(query.suitRecipeId);
|
|
|
// 名医名方 —> 名医医案
|
|
// 名医名方 —> 名医医案
|
|
@@ -2155,8 +2155,16 @@ export default {
|
|
|
return [];
|
|
return [];
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- // 校验操作指南
|
|
|
|
|
- const hasOperationGuide = acupointTable.prescriptions.every((_, index) => {
|
|
|
|
|
|
|
+ // 过滤掉已付费的处方
|
|
|
|
|
+ const unpaidPrescriptions = acupointTable.prescriptions
|
|
|
|
|
+ .map((p, index) => ({ p, index }))
|
|
|
|
|
+ .filter(({ index }) => {
|
|
|
|
|
+ const data = acupointTable.prescriptionDataMap[index];
|
|
|
|
|
+ return !data || (!data.isPay && data.paystate != 1);
|
|
|
|
|
+ });
|
|
|
|
|
+
|
|
|
|
|
+ // 校验操作指南(只检查未付费的处方)
|
|
|
|
|
+ const hasOperationGuide = unpaidPrescriptions.every(({ index }) => {
|
|
|
const d = acupointTable.prescriptionDataMap[index];
|
|
const d = acupointTable.prescriptionDataMap[index];
|
|
|
return d && d.operationGuide && d.operationGuide.trim();
|
|
return d && d.operationGuide && d.operationGuide.trim();
|
|
|
});
|
|
});
|
|
@@ -2165,8 +2173,8 @@ export default {
|
|
|
return [];
|
|
return [];
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- // 校验单次数量
|
|
|
|
|
- const hasSingleCount = acupointTable.prescriptions.every((_, index) => {
|
|
|
|
|
|
|
+ // 校验单次数量(只检查未付费的处方)
|
|
|
|
|
+ const hasSingleCount = unpaidPrescriptions.every(({ index }) => {
|
|
|
const d = acupointTable.prescriptionDataMap[index];
|
|
const d = acupointTable.prescriptionDataMap[index];
|
|
|
return d && d.singleCount > 0;
|
|
return d && d.singleCount > 0;
|
|
|
});
|
|
});
|
|
@@ -2175,11 +2183,6 @@ export default {
|
|
|
return [];
|
|
return [];
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- // 已支付则跳过
|
|
|
|
|
- if (acupointTable.paystate == 1) {
|
|
|
|
|
- return [];
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
// 获取治疗列表(每个prescription对应一个治疗项)
|
|
// 获取治疗列表(每个prescription对应一个治疗项)
|
|
|
const treatmentList = acupointTable.buildTreatmentList();
|
|
const treatmentList = acupointTable.buildTreatmentList();
|
|
|
if (!treatmentList || treatmentList.length === 0) {
|
|
if (!treatmentList || treatmentList.length === 0) {
|
|
@@ -2191,8 +2194,8 @@ export default {
|
|
|
// sourceId和accordPid都传recordid(患者pid)
|
|
// sourceId和accordPid都传recordid(患者pid)
|
|
|
const recordid = this.getPatiensInfo.pid || "";
|
|
const recordid = this.getPatiensInfo.pid || "";
|
|
|
|
|
|
|
|
- const result = acupointTable.prescriptions.map((p, index) => {
|
|
|
|
|
- const treatmentItem = treatmentList[index];
|
|
|
|
|
|
|
+ const result = unpaidPrescriptions.map(({ p, index }, treatmentIndex) => {
|
|
|
|
|
+ const treatmentItem = treatmentList[treatmentIndex];
|
|
|
const d = acupointTable.prescriptionDataMap[index] || {};
|
|
const d = acupointTable.prescriptionDataMap[index] || {};
|
|
|
|
|
|
|
|
// 计算该项目的总金额
|
|
// 计算该项目的总金额
|
|
@@ -2618,20 +2621,6 @@ export default {
|
|
|
westernDiag: techData.westernDiag || "",
|
|
westernDiag: techData.westernDiag || "",
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
- // 处方状态
|
|
|
|
|
- if (this.getEditPreNo()) {
|
|
|
|
|
- if (techData.revierwstate == 1) {
|
|
|
|
|
- acupointTable.prescribed = 0;
|
|
|
|
|
- acupointTable.paystate = 0;
|
|
|
|
|
- } else {
|
|
|
|
|
- acupointTable.prescribed = techData.prescribed || 0;
|
|
|
|
|
- acupointTable.paystate = techData.paystate || 0;
|
|
|
|
|
- }
|
|
|
|
|
- } else {
|
|
|
|
|
- acupointTable.prescribed = techData.prescribed || 0;
|
|
|
|
|
- acupointTable.paystate = techData.paystate || 0;
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
// 西医主诊断(只读,接口返回)和建议诊断(用户输入)
|
|
// 西医主诊断(只读,接口返回)和建议诊断(用户输入)
|
|
|
this.westernDiag = techData.westernDiag || '';
|
|
this.westernDiag = techData.westernDiag || '';
|
|
|
// 建议诊断候选(后端返回的全部)→ 规范化成对象数组,并预填充 name 映射
|
|
// 建议诊断候选(后端返回的全部)→ 规范化成对象数组,并预填充 name 映射
|
|
@@ -2663,18 +2652,39 @@ export default {
|
|
|
return acc;
|
|
return acc;
|
|
|
}, []);
|
|
}, []);
|
|
|
// [临时诊断] 看治疗项各字段值(嘱托/金额等),定位完删除
|
|
// [临时诊断] 看治疗项各字段值(嘱托/金额等),定位完删除
|
|
|
- console.log('[assignRecipe3诊断] 治疗项0 完整数据:', mergedTreatmentList[0]);
|
|
|
|
|
|
|
+ console.log(mergedTreatmentList,'[assignRecipe3诊断] 治疗项0 完整数据:', mergedTreatmentList[0]);
|
|
|
// 使用 loadFromServerData 加载合并后的治疗列表数据
|
|
// 使用 loadFromServerData 加载合并后的治疗列表数据
|
|
|
if (mergedTreatmentList.length > 0) {
|
|
if (mergedTreatmentList.length > 0) {
|
|
|
acupointTable.loadFromServerData(mergedTreatmentList);
|
|
acupointTable.loadFromServerData(mergedTreatmentList);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- // 嘱托(command)在处方级(technologies[i].command),loadFromServerData 按治疗项取不到,补设到组件
|
|
|
|
|
|
|
+ // 处方状态(必须在 loadFromServerData 之后设置,因为 loadFromServerData 会调用 loadTabData 覆盖 paystate)
|
|
|
|
|
+ if (this.getEditPreNo()) {
|
|
|
|
|
+ if (techData.revierwstate == 1) {
|
|
|
|
|
+ acupointTable.prescribed = 0;
|
|
|
|
|
+ acupointTable.paystate = 0;
|
|
|
|
|
+ } else {
|
|
|
|
|
+ acupointTable.prescribed = techData.prescribed || 0;
|
|
|
|
|
+ acupointTable.paystate = techData.paystate || 0;
|
|
|
|
|
+ }
|
|
|
|
|
+ } else {
|
|
|
|
|
+ acupointTable.prescribed = techData.prescribed || 0;
|
|
|
|
|
+ acupointTable.paystate = techData.paystate || 0;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ // 嘱托(command)和支付状态(paystate)在处方级(technologies[i]),loadFromServerData 按治疗项取不到,补设到组件
|
|
|
const _prescriptionCommand = techData.command || "";
|
|
const _prescriptionCommand = techData.command || "";
|
|
|
acupointTable.command = _prescriptionCommand;
|
|
acupointTable.command = _prescriptionCommand;
|
|
|
if (acupointTable.prescriptionDataMap) {
|
|
if (acupointTable.prescriptionDataMap) {
|
|
|
Object.keys(acupointTable.prescriptionDataMap).forEach(idx => {
|
|
Object.keys(acupointTable.prescriptionDataMap).forEach(idx => {
|
|
|
acupointTable.prescriptionDataMap[idx].command = _prescriptionCommand;
|
|
acupointTable.prescriptionDataMap[idx].command = _prescriptionCommand;
|
|
|
|
|
+ // 为每个处方设置支付状态
|
|
|
|
|
+ const numIdx = Number(idx);
|
|
|
|
|
+ console.log('设置支付状态', { idx, numIdx, dataArrayItem: dataArray[numIdx], paystate: dataArray[numIdx]?.paystate });
|
|
|
|
|
+ if (dataArray[numIdx]) {
|
|
|
|
|
+ acupointTable.prescriptionDataMap[idx].paystate = dataArray[numIdx].paystate || 0;
|
|
|
|
|
+ acupointTable.prescriptionDataMap[idx].isPay = dataArray[numIdx].isPay || false;
|
|
|
|
|
+ }
|
|
|
});
|
|
});
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -3455,6 +3465,7 @@ export default {
|
|
|
preId: id,
|
|
preId: id,
|
|
|
visitId: JSON.parse(sessionStorage.getItem("patiensInfo")).pid
|
|
visitId: JSON.parse(sessionStorage.getItem("patiensInfo")).pid
|
|
|
});
|
|
});
|
|
|
|
|
+ console.log(res, "支付状态");
|
|
|
if (res.ResultCode == 0) {
|
|
if (res.ResultCode == 0) {
|
|
|
// 跟据id 回显
|
|
// 跟据id 回显
|
|
|
let children = this.$children.filter(item => {
|
|
let children = this.$children.filter(item => {
|
|
@@ -3585,6 +3596,8 @@ export default {
|
|
|
};
|
|
};
|
|
|
let res = await getRecipePriview(params).catch(err => {
|
|
let res = await getRecipePriview(params).catch(err => {
|
|
|
loading.close();
|
|
loading.close();
|
|
|
|
|
+ // 保存失败时恢复保存按钮状态
|
|
|
|
|
+ this.$refs.suitScience && this.$refs.suitScience.saveDone();
|
|
|
});
|
|
});
|
|
|
if (res.ResultCode == 0) {
|
|
if (res.ResultCode == 0) {
|
|
|
loading.close();
|
|
loading.close();
|
|
@@ -3602,6 +3615,10 @@ export default {
|
|
|
})
|
|
})
|
|
|
);
|
|
);
|
|
|
this.showPriview = true;
|
|
this.showPriview = true;
|
|
|
|
|
+ } else {
|
|
|
|
|
+ // 保存失败时恢复保存按钮状态
|
|
|
|
|
+ loading.close();
|
|
|
|
|
+ this.$refs.suitScience && this.$refs.suitScience.saveDone();
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
|
|
|
|
@@ -3627,9 +3644,7 @@ export default {
|
|
|
}
|
|
}
|
|
|
this.contentTabs[0].check = res.Data.zhongyao.length > 0;
|
|
this.contentTabs[0].check = res.Data.zhongyao.length > 0;
|
|
|
this.contentTabs[1].check = res.Data.zhongchengyao.chengDetail !== null;
|
|
this.contentTabs[1].check = res.Data.zhongchengyao.chengDetail !== null;
|
|
|
- // 适宜技术回显:后端字段由 technology(单数对象) 改为 technologies(复数/数组),兼容旧字段
|
|
|
|
|
- // const _techRaw = res.Data.technologies != null ? res.Data.technologies : res.Data.technology;
|
|
|
|
|
- // const techList = Array.isArray(_techRaw) ? _techRaw : (_techRaw ? [_techRaw] : []);
|
|
|
|
|
|
|
+ // 适宜技术回显
|
|
|
this.contentTabs[2].check = res.Data.technologies.length > 0;
|
|
this.contentTabs[2].check = res.Data.technologies.length > 0;
|
|
|
|
|
|
|
|
this.container_i = Math.max(this.contentTabs.findIndex(item => item.check), 0);
|
|
this.container_i = Math.max(this.contentTabs.findIndex(item => item.check), 0);
|
|
@@ -3707,7 +3722,7 @@ console.log(res, "处方回显数据==处方管理",res.Data.type);
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
// 适宜技术病历转方回显(getRecipeBySuitTech,入参 recordId=来源就诊记录id)
|
|
// 适宜技术病历转方回显(getRecipeBySuitTech,入参 recordId=来源就诊记录id)
|
|
|
- async suitTechRecordTurn(recordId) {
|
|
|
|
|
|
|
+ async suitTechRecordTurn(recordId,visitId) {
|
|
|
const loading = this.$loading({
|
|
const loading = this.$loading({
|
|
|
lock: true,
|
|
lock: true,
|
|
|
text: '正在处理转方数据',
|
|
text: '正在处理转方数据',
|
|
@@ -3715,7 +3730,8 @@ console.log(res, "处方回显数据==处方管理",res.Data.type);
|
|
|
background: 'rgba(0, 0, 0, 0.7)',
|
|
background: 'rgba(0, 0, 0, 0.7)',
|
|
|
});
|
|
});
|
|
|
try {
|
|
try {
|
|
|
- const res = await getRecipeBySuitTech({ recordId });
|
|
|
|
|
|
|
+ console.log('转方就诊id', recordId, "就诊id",visitId);
|
|
|
|
|
+ const res = await getRecipeBySuitTech({ recordId ,visitId});
|
|
|
console.log('适宜技术病历转方回显', res);
|
|
console.log('适宜技术病历转方回显', res);
|
|
|
if (res.ResultCode === 0 && res.Data) {
|
|
if (res.ResultCode === 0 && res.Data) {
|
|
|
console.log('获取数据', res.Data);
|
|
console.log('获取数据', res.Data);
|