소스 검색

建议诊断回填默认显示第一个,其余的让用户自己再下拉选择

张田田 1 주 전
부모
커밋
6a77f5cea7
1개의 변경된 파일9개의 추가작업 그리고 18개의 파일을 삭제
  1. 9 18
      src/views/diagnosis/Prescribing.vue

+ 9 - 18
src/views/diagnosis/Prescribing.vue

@@ -1411,9 +1411,9 @@ export default {
       patiensMsg: {}, // 患者信息
       patientMsgPreviewImages: [], // 患者信息预览图片
       dianosisMsg: [], // 诊断信息
-      westernDiag: '', // 西医主诊断(接口返回,只读)
-      suggestDiag: [], // 建议诊断(已选,多选,提交用)
-      suggestDiagAll: [], // 建议诊断候选(后端返回的全部,对象数组 {westcode, westname})
+      westernDiag: '', // 西医主诊断
+      suggestDiag: [], // 建议诊断
+      suggestDiagAll: [], // 建议诊断候选
       // 西医诊断搜索相关
       westernDiseaseOptions: [],
       westernDiseaseNameMap: {},
@@ -1573,10 +1573,8 @@ export default {
     // 处理路由参数
     async _processRouteQuery() {
       const query = this.$route.query || {};
-      // console.log('query======', sessionStorage.getItem("prescr" + this.getPatiensInfo.pid));
       // 暂存处方数据(不含药品)
       if (sessionStorage.getItem("prescr" + this.getPatiensInfo.pid)) await this._showDataFromStorage(true);
-      // console.log(query,"query获取的缓存的数据")
       // 名医名方 —> 方剂查询
       if (query.recipeID && query.kjType === "kj-fj") await this.getPreDetal(query.recipeID);
       // 就诊记录转方
@@ -1607,9 +1605,7 @@ export default {
       else {
         // 跟据就诊记录id获取处方号
         let res = await getPreNumber({pid: this.getPatiensInfo.pid}).catch(() => void 0);
-        // console.log('获取处方id的数据', res);
         const has = res && res.ResultCode == 0 && res.Data.length > 0;
-        // console.log('是否有处方', has);
         if (has) await this.getRecipeShowData();
 
         else if (this.getEditPreNo()) await this.getRecipeDataByid(this.getEditPreNo());
@@ -1764,7 +1760,6 @@ export default {
       let storageData = JSON.parse(
         sessionStorage.getItem("prescr" + this.getPatiensInfo.pid)
       );
-      // console.log(storageData, "storageData");
       let children = this.$children.filter(item => {
         return (
           item.name == "中药处方" ||
@@ -2238,7 +2233,7 @@ export default {
           return !data || (!data.isPay && data.paystate != 1);
         });
 
-      // 校验操作指南(只检查未付费的处方)
+      // 校验操作指南
       const hasOperationGuide = unpaidPrescriptions.every(({ index }) => {
         const d = acupointTable.prescriptionDataMap[index];
         return d && d.operationGuide && d.operationGuide.trim();
@@ -2248,7 +2243,7 @@ export default {
         return [];
       }
 
-      // 校验单次数量(只检查未付费的处方)
+      // 校验单次数量
       const hasSingleCount = unpaidPrescriptions.every(({ index }) => {
         const d = acupointTable.prescriptionDataMap[index];
         return d && d.singleCount > 0;
@@ -2258,15 +2253,13 @@ export default {
         return [];
       }
 
-      // 获取治疗列表(每个prescription对应一个治疗项)
+      // 获取治疗列表
       const treatmentList = acupointTable.buildTreatmentList();
       if (!treatmentList || treatmentList.length === 0) {
         this.$message.error({ message: '请完善适宜技术处方信息', showClose: true });
         return [];
       }
 
-      // 为每个prescription创建独立的项目对象
-      // sourceId和accordPid都传recordid(患者pid)
       const recordid = this.getPatiensInfo.pid || "";
 
       const result = unpaidPrescriptions.map(({ p, index }, treatmentIndex) => {
@@ -3129,7 +3122,6 @@ export default {
         this.westernDiseaseLoading = false;
       }
     },
-    // 候选来源为后端 suggestDiagAll,打开下拉不再搜全库、不再滚动加载
     onWesternDiseaseVisible(show) {
       if (!show) {
         const wrap = document.querySelector(
@@ -3194,7 +3186,7 @@ export default {
       if (item.id === '0') {
         try { this.tjRecipeId = child.recipe_tabs[child.recipe_tabs_c].id; } catch (e) { this.tjRecipeId = "" }
       } else if (item.id === '2') {
-        // 适宜技术高亮由独立变量 suitTjRecipeId 管理(fillSuitTechOnInfer/onSuitRecommendSelect 设置),切tab无需在此处理
+        // 适宜技术高亮由独立变量 suitTjRecipeId 管理
       }
     },
     checked(item1) {
@@ -3765,7 +3757,6 @@ export default {
       let res = await getRecipeDataByid(params).catch(err => {
         loading.close();
       });
-console.log(res, "处方回显数据==处方管理",res.Data.type); 
       if (res.ResultCode == 0) {
         if (res.Data.type == 0) {
           res.Data.zhongdetail = res.Data.detail;
@@ -4227,8 +4218,8 @@ console.log(res, "处方回显数据==处方管理",res.Data.type);
         wdCodes.forEach((code, i) => {
           if (code && wdNames[i]) this.westernDiseaseNameMap[code] = wdNames[i];
         });
-        // 已选 + 候选都用本次数据替换,避免与之前推导/转方的西医诊断累加
-        this.suggestDiag = wdCodes;
+        // 默认只取第一个,其余让用户在下拉里自选
+        this.suggestDiag = wdCodes.length ? [wdCodes[0]] : [];
         this.suggestDiagAll = wdCodes.map((code, i) => ({ westcode: code, westname: wdNames[i] || this.westernDiseaseNameMap[code] || code }));
       }
     },