zhouna 4 anos atrás
pai
commit
d452211ebf

+ 1 - 0
src/css/cdssHorizontal.less

@@ -513,6 +513,7 @@
             overflow-y: hidden;
             position: relative;
             .go-push {
+                cursor: pointer;
                 width: 60px;
                 position: absolute;
                 left: 502px;

+ 1 - 1
src/html/cdss.html

@@ -92,7 +92,7 @@
                     <p class="title">
                         <img class="icon" src="./images/t2.png" alt="">
                         <span class="h2">中医处方推荐</span>
-                        <a class="go" href="">更多 <img class="icon" src="./images/g1.png" alt=""></a>
+                        <a class="go" id="goTreat">更多 <img class="icon" src="./images/g1.png" alt=""></a>
                     </p>
                     <div class="content">
                         <ul class="infos clearfix">

+ 1 - 1
src/html/cdssHorizontal.html

@@ -53,7 +53,7 @@
             <p class="title">
               <img class="icon" src="./images/t1.png" alt="">
               <span class="h2">病症推导:</span>
-              <a class="go go-btn" id="goPush" href="">去推导 <img class="icon" src="./images/go.png" alt=""></a>
+              <a class="go go-btn" id="goPush">去推导 <img class="icon" src="./images/go.png" alt=""></a>
             </p>
           </div>
           <div class="recipe tcm-item clearfix">

+ 6 - 7
src/js/cdss.js

@@ -37,7 +37,7 @@ let warnImgWhite = require('./../images/icon_waring_white.png').replace(/^undefi
 const $ = require("jquery");
 const { post,config,getUrlArgObject,openNewWin,titleConfig } = require('./promise.js');
 const { renderFollowUp, followEmpty } = require('./followUp.js');
-const {renderTcm, getTcmData} = require('./tcmiss.js');
+const {getTcmMr} = require('./tcmiss.js');
 
 const { transConf } = require('./util.js');
 
@@ -73,7 +73,7 @@ if(mrId){
     if(!(msg&&msg.diseaseName&&msg.diseaseName.name)){
       msg.diseaseName={}
     }
-    window.msg = msg
+      window.msg = msg;
     renderPage(data)
   })
 } else{
@@ -214,11 +214,14 @@ function renderPage(pageSet){
   const hasMedical = hasTab("医学知识",pageSet.sysSetInfo)
   const hasFollowUp = hasTab("随访计划",pageSet.sysSetInfo)
     const hasTcm = hasTab("中医辅助", pageSet.sysSetInfo);
-    console.log(hasTcm)
+
   if(!mrId){
     empty()
     return
   }
+    if (hasTcm) {
+        getTcmMr(mrId);
+    }
   if(hasAuxiliary){
     renderModuleWrapper(hasAuxiliary.planDetails)
     let needPush = isNeedPush(hasAuxiliary.planDetails)
@@ -240,10 +243,6 @@ function renderPage(pageSet){
   if(hasFollowUp){
     renderFollowUp(msg)
   }
-    if (hasTcm) {
-        console.log(msg)
-        getTcmData({tcmDiag: '咳嗽病', tcmSyndrome: '风寒袭肺证'});//msg.otherIndex)
-    }
 }
 
 function renderPushData(){

+ 5 - 5
src/js/cdssHorizontal.js

@@ -27,7 +27,7 @@ let collapseImg = require('./../images/collapse2.png').replace(/^undefined/g, ''
 let treatDisName,treatUniqueName
 let generalTreatInfo
 const { renderFollowUp } = require('./followUp.js');
-require('./tcmiss.js');
+const {getTcmMr} = require('./tcmiss.js');
 
 setWidth()
 let moduleConfig={
@@ -105,7 +105,10 @@ function renderPage(pageSet){
   const hasMedical = hasTab("医学知识",pageSet.sysSetInfo)
   const hasFollowUp = hasTab("随访计划",pageSet.sysSetInfo)
     const hasTcm = hasTab("中医辅助", pageSet.sysSetInfo)
- 
+
+    if (hasTcm) {
+        getTcmMr(mrId);
+    }
   if(hasAuxiliary){
     renderModuleWrapper(hasAuxiliary.planDetails)
     let needPush = isNeedPush(hasAuxiliary.planDetails)
@@ -126,9 +129,6 @@ function renderPage(pageSet){
       if (hasFollowUp) {
           renderFollowUp(msg, 1)
       }
-      if (hasTcm) {
-          getTcmData({tcmDiag: '咳嗽病', tcmSyndrome: '风寒袭肺证'});//msg.otherIndex)
-      }
   }
  }
  function renderTab(tabList){

+ 24 - 3
src/js/promise.js

@@ -101,6 +101,26 @@ const getUrlArgObject = function getQueryString(name) {
   }
 }
 
+const get = function (url, data) {
+    return new Promise((resolve, reject) => {
+        $.ajax({
+            method: 'get',
+            url: url,
+            //data: data,
+            contentType: "application/json; charset=UTF-8",
+            beforeSend: function (xmlHttp) {
+                xmlHttp.setRequestHeader("If-Modified-Since", "0");
+                xmlHttp.setRequestHeader("Cache-Control", "no-cache");
+            },
+            success: function (res) {
+                resolve({data: res});
+            },
+            error: function (error) {
+                reject(error);
+            },
+        });
+    });
+}
 const post = function (url, data) {
   return new Promise((resolve, reject) => {
     $.ajax({
@@ -128,10 +148,10 @@ const newinConf = {
   top: '0',    //窗口的 y 坐标。以像素计。
   openMode: "_blank"  //每次都是新窗口打开为_blank,打开同一窗口填写任意字符串
 }
-
+const newWindowLocationTcm = `width=800, height=600, left=${newinConf.left}, top=${newinConf.top},resizable=yes, scrollbars=yes`
 const newWindowLocation = `width=${newinConf.width}, height=${newinConf.height}, left=${newinConf.left}, top=${newinConf.top},resizable=yes, scrollbars=yes`
-const openNewWin = function (url) {
-  window.open(url, newinConf.openMode, newWindowLocation)
+const openNewWin = function (url, isTcm) {
+    window.open(url, newinConf.openMode, isTcm ? newWindowLocationTcm : newWindowLocation)
 }
 
 //判断浏览器是否为Ie8
@@ -319,6 +339,7 @@ const titleConfigH = {
 }
 module.exports = {
   config,
+    get,
   post,
   getUrlArgObject,
   imageUrlPrefix,

+ 44 - 15
src/js/tcmiss.js

@@ -1,25 +1,46 @@
 const $ = require("jquery");
-const {post, config, getUrlArgObject, openNewWin, titleConfig} = require('./promise.js');
+const {get, post, config, getUrlArgObject, openNewWin, titleConfig} = require('./promise.js');
 const targetUrl = 'http://114.55.109.16:81/lantone/index';
-
 $(function () {
     let mrId = getUrlArgObject('mrId')
     $(".knowledge .a-link").click(function () {
         const code = $(this).attr("code");
-        openNewWin(targetUrl + '?page=' + code);
+        openNewWin(targetUrl + '?page=' + code, true);
     })
     $("#goPush").on("click", function () {
-        openNewWin(targetUrl + '?page=bztd');
+        openNewWin(targetUrl + '?page=bztd', true);
     });
-
 });
 
-//获取参数
+function getTcmMr(mrId) {
+    post('/sys/mr/getTcmMr', {mrId: mrId}).then((res) => {
+        console.log(res)
+        let data = res.data.data || {}
+        const {tcmdisease, tcmsyndrome} = data;
+        if (!tcmdisease) {
+            $(".recipe").hide();
+            return;
+        }
+        if (res.data.code === '0') {
+            getTcmData({tcmDiag: tcmdisease.uniqueName, tcmSyndrome: tcmsyndrome.uniqueName})
+        } else {
+
+        }
+    })
+}
+
+//获取处方推荐
 function getTcmData(param) {
-    $("#jibing").text(param.tcmDiag + "-" + param.tcmSyndrome);
-    $('#bingming').text(param.tcmDiag);
-    $('#zhenghou').text(param.tcmSyndrome);
-    post('/lantone/private/zycftj?jibing=' + param.tcmDiag + "&zhengxing=" + param.tcmSyndrome).then((res) => {
+    $(".recipe").show();
+    const {tcmDiag, tcmSyndrome} = param;
+    $("#jibing").text(tcmDiag + "-" + tcmSyndrome);
+    $('#bingming').text(tcmDiag);
+    $('#zhenghou').text(tcmSyndrome);
+    $("#goTreat").on("click", function () {
+        openNewWin(targetUrl + '?page=xftj&jibing=' + tcmDiag + "&zhengxing=" + tcmSyndrome, true);
+    });
+    //处方推荐
+    get('/lantone/private/zycftj?jibing=' + tcmDiag + "&zhengxing=" + tcmSyndrome).then((res) => {
         console.log(res)
         let data = res.data.data || {}
         if (res.data.status) {
@@ -27,7 +48,16 @@ function getTcmData(param) {
         } else {
 
         }
+    })
+    //治法推荐
+    get('/lantone/private/zhongyizx?type=1&code=' + tcmDiag + '&value=' + tcmSyndrome).then((res) => {
+        console.log(res)
+        let data = res.data.data || {}
+        if (res.data.status) {
+            //renderTcm(data)
+        } else {
 
+        }
     })
 }
 
@@ -42,16 +72,15 @@ function renderTcm(data) {
 
     })
     if (data.length > 3) {
-        str += `<a class="go go-push" id="goTreat" href="">更多 <img class="icon" src="./images/go.png" alt=""></a>`;
+        str += `<a class="go go-push" id="goTreat">更多 <img class="icon" src="./images/go.png" alt=""></a>`;
     }
     $('.detail ul').html(str);
-
+    //更多治法
     $("#goTreat").on('click', function () {
-        openNewWin(targetUrl + '?page=fjcx');
+        openNewWin(targetUrl, true);
     });
 }
 
 module.exports = {
-    renderTcm,
-    getTcmData
+    getTcmMr
 }