zhouna 4 years atrás
parent
commit
d15ce56d48
5 changed files with 27 additions and 10 deletions
  1. 1 0
      src/css/cdss.less
  2. 1 0
      src/css/cdssHorizontal.less
  3. 1 2
      src/js/cdss.js
  4. 1 1
      src/js/cdssHorizontal.js
  5. 23 7
      src/js/tcmiss.js

+ 1 - 0
src/css/cdss.less

@@ -465,6 +465,7 @@ body{
   overflow-y: auto;
 }
 .tcm-item {
+  display: none;
   margin: 0 15px 10px;
   border: 1px #EEF5FD solid;
   border-radius: 8px;

+ 1 - 0
src/css/cdssHorizontal.less

@@ -451,6 +451,7 @@
 
 /*******中医********/
 .tcm-item {
+    display: none;
     .title {
         float: left;
         height: 30px;

+ 1 - 2
src/js/cdss.js

@@ -221,8 +221,7 @@ function renderPage(pageSet){
   }
     if (hasTcm) {
         console.log(hasTcm)
-        const item = hasTcm.planDetails.find((it) => it.code === "treatment");
-        getTcmMr(mrId, (item || {}).number || 3);
+        getTcmMr(mrId, hasTcm);
     }
   if(hasAuxiliary){
     renderModuleWrapper(hasAuxiliary.planDetails)

+ 1 - 1
src/js/cdssHorizontal.js

@@ -107,7 +107,7 @@ function renderPage(pageSet){
     const hasTcm = hasTab("中医辅助", pageSet.sysSetInfo)
 
     if (hasTcm) {
-        getTcmMr(mrId);
+        getTcmMr(mrId, hasTcm);
     }
   if(hasAuxiliary){
     renderModuleWrapper(hasAuxiliary.planDetails)

+ 23 - 7
src/js/tcmiss.js

@@ -13,13 +13,27 @@ $(function () {
     });
 });
 
-function getTcmMr(mrId, num) {
+function renderConfig(config) {
+    const classMap = {
+        'conditionder': 'go-push',
+        'treatment': 'recipe',
+        'tcmknowledge': 'knowledge',
+    };
+    config.map((it) => {
+        if (+it.status === 1) {
+            $(".tcmWarp ." + classMap[it.code]).show();
+        }
+    })
+}
+
+function getTcmMr(mrId, config) {
+    renderConfig(config.planDetails || []);
     post('/sys/mr/getTcmMr', {mrId: mrId}).then((res) => {
         //console.log(res)
         let data = res.data.data || {}
         const {tcmdisease, tcmsyndrome} = data;
         if (res.data.code === '0') {
-            getTcmData({tcmDiag: (tcmdisease || {}).uniqueName, tcmSyndrome: (tcmsyndrome || {}).uniqueName}, num)
+            getTcmData({tcmDiag: (tcmdisease || {}).uniqueName, tcmSyndrome: (tcmsyndrome || {}).uniqueName}, config)
         } else {
 
         }
@@ -27,16 +41,18 @@ function getTcmMr(mrId, num) {
 }
 
 //获取处方推荐
-function getTcmData(param, num) {
-    $(".recipe").show();
+function getTcmData(param, config) {
+    const item = config.planDetails.find((it) => it.code === "treatment");
+    const num = (item || {}).number || 3;
     const {tcmDiag, tcmSyndrome} = param;
+    if (!tcmDiag) {
+        $(".recipe").hide();
+        return;
+    }
     $("#jibing").text(tcmDiag + "-" + tcmSyndrome);
     $('#bingming').text(tcmDiag);
     $('#zhenghou').text(tcmSyndrome);
     treatUrl = targetUrl + '?jibing=' + tcmDiag + "&zhengxing=" + tcmSyndrome;
-    /*$("#goTreat").on("click", function () {
-        openNewWin(targetUrl + '?jibing=' + tcmDiag + "&zhengxing=" + tcmSyndrome, true);
-    });*/
     //处方推荐
     get('/lantone/private/zycftj?jibing=' + tcmDiag + "&zhengxing=" + tcmSyndrome).then((res) => {
         //console.log(res)