浏览代码

Merge remote-tracking branch 'origin/test' into termLink0615

# Conflicts:
#	src/api/config.js
zhouna 4 年之前
父节点
当前提交
5d07260719

+ 88 - 4
src/api/cdss.js

@@ -279,10 +279,6 @@ export default {
     });
   },
 
-  getNursePage(param) {
-    //输血列表-列表
-    return axios.post(urls.getNursePage, param);
-  },
   getNursePage(param) {
     //护理列表-列表
     return axios.post(urls.getNursePage, param);
@@ -324,6 +320,94 @@ export default {
     });
   },
 
+  getTcmdiseasePage(param) {
+    //中医疾病列表-列表
+    return axios.post(urls.getTcmdiseasePage, param);
+  },
+  tcmIsExistRecord(param) {
+    //中医疾病-映射关系是否已存在
+    return axios.post(urls.tcmIsExistRecord, param);
+  },
+  saveOrUpdateRecordTcm(param) {
+    //中医疾病-保存
+    return axios.post(urls.saveOrUpdateRecordTcm, param);
+  },
+  deleteTcmRecord(param) {
+    //中医疾病-删除
+    return axios.post(urls.deleteTcmRecord, param);
+  },
+  exportTcmRecord(param) {
+    //中医疾病-数据导出
+    return axios.post(urls.exportTcmRecord, param, {
+      responseType: 'blob',
+    });
+  },
+  importTcmRecord(param) {
+    //中医疾病-数据导入
+    return axios.post(urls.importTcmRecord, param);
+  },
+  dataTcmVerify(param) {
+    return axios.post(urls.dataTcmVerify, param);
+  },
+  precTcmDataMatch(param) {
+    return axios.post(urls.precTcmDataMatch, param, {
+      responseType: 'blob',
+    });
+  },
+  exportTcmModule(param) {
+    //中医疾病-数据导入模板导出
+    return axios.post(urls.exportTcmModule, param, {
+      responseType: 'blob',
+    });
+  },
+
+
+  getTcmsyndromePage(param) {
+    //中医症候列表-列表
+    return axios.post(urls.getTcmsyndromePage, param);
+  },
+
+  tcmdromeIsExistRecord(param) {
+    //中医症候-映射关系是否已存在
+    return axios.post(urls.tcmdromeIsExistRecord, param);
+  },
+  saveOrUpdateRecordTcmdrome(param) {
+    //中医症候-保存
+    return axios.post(urls.saveOrUpdateRecordTcmdrome, param);
+  },
+  deleteTcmdromeRecord(param) {
+    //中医症候-删除
+    return axios.post(urls.deleteTcmdromeRecord, param);
+  },
+  exportTcmdromeRecord(param) {
+    //中医症候-数据导出
+    return axios.post(urls.exportTcmdromeRecord, param, {
+      responseType: 'blob',
+    });
+  },
+  importTcmdromeRecord(param) {
+    //中医疾病-数据导入
+    return axios.post(urls.importTcmdromeRecord, param);
+  },
+  dataTcmdromeVerify(param) {
+    return axios.post(urls.dataTcmdromeVerify, param);
+  },
+  precTcmdromeDataMatch(param) {
+    return axios.post(urls.precTcmdromeDataMatch, param, {
+      responseType: 'blob',
+    });
+  },
+  exportTcmdromeModule(param) {
+    //中医疾病-数据导入模板导出
+    return axios.post(urls.exportTcmdromeModule, param, {
+      responseType: 'blob',
+    });
+  },
+
+
+
+
+
   getHospitalInfo(param) {
     return axios.post(urls.getHospitalInfoCDSS, param);
   },

+ 59 - 35
src/api/config.js

@@ -4,7 +4,7 @@ const testUrl = ''
 export default {
   host: 'http://192.168.2.121:5050',
   // imgHost: 'http://192.168.2.121:82',      //富文本编辑器图片回传地址
-  imgHost:'http://192.168.2.121:82',      //富文本编辑器图片回传地址
+  imgHost:'http://192.168.2.241:82',      //富文本编辑器图片回传地址
   delayTime: 500,
   urls: {
     /* 登录注册相关接口 */
@@ -455,6 +455,28 @@ export default {
     'precNurseDataMatch': '/api/cdssman/tran/nurseConfig/precDataMatch',
     'dataNurseVerify': '/api/cdssman/tran/nurseConfig/dataVerify',
 
+
+    'getTcmdiseasePage': '/api/cdssman/tran/tcmdiseaseConfig/getPage',   //中医疾病列表
+    'tcmIsExistRecord': '/api/cdssman/tran/tcmdiseaseConfig/isExistRecord',   //中医疾病-映射关系是否已存在
+    'saveOrUpdateRecordTcm': '/api/cdssman//tran/tcmdiseaseConfig/saveOrUpdateRecord',   //护理列表添加
+    'deleteTcmRecord': '/api/cdssman/tran/tcmdiseaseConfig/deleteRecord',   //中医疾病-删除映射关系
+    'exportTcmRecord': '/api/cdssman/tran/tcmdiseaseConfig/exportExcel',   //中医疾病-数据导出
+    'importTcmRecord': '/api/cdssman/tran/tcmdiseaseConfig/importExcel',   //检验-数据导入
+    'exportTcmModule': '/api/cdssman/tran/tcmdiseaseConfig/exportExcelModule',   //护理-数据导入模板导出
+    'precTcmDataMatch': '/api/cdssman/tran/tcmdiseaseConfig/precDataMatch',
+    'dataTcmVerify': '/api/cdssman/tran/tcmdiseaseConfig/dataVerify',
+
+    'getTcmsyndromePage': '/api/cdssman/tran/tcmsyndromeConfig/getPage',   //中医证候列表
+    'tcmdromeIsExistRecord': '/api/cdssman/tran/tcmsyndromeConfig/isExistRecord',   //中医证候-映射关系是否已存在
+    'saveOrUpdateRecordTcmdrome': '/api/cdssman//tran/tcmsyndromeConfig/saveOrUpdateRecord',   //中医证候列表添加
+    'deleteTcmdromeRecord': '/api/cdssman/tran/tcmsyndromeConfig/deleteRecord',
+    'exportTcmdromeRecord': '/api/cdssman/tran/tcmsyndromeConfig/exportExcel',   //中医证候-数据导出
+    'importTcmdromeRecord': '/api/cdssman/tran/tcmsyndromeConfig/importExcel',   //中医证候-数据导入
+    'exportTcmdromeModule': '/api/cdssman/tran/tcmsyndromeConfig/exportExcelModule',   //中医证候-数据导入模板导出
+    'precTcmdromeDataMatch': '/api/cdssman/tran/tcmsyndromeConfig/precDataMatch',
+    'dataTcmdromeVerify': '/api/cdssman/tran/tcmsyndromeConfig/dataVerify',
+
+
     // 'saveHospitalInfoRecordCDSS': '/api/cdssman/tran/hospitalInfo/saveRecord',   //医院信息——修改医院信息
 
     'modifyConnectStatusCDSS': '/api/cdssman/hospitalInfo/modifyConnectStatus',   //医院信息——修改医院信息 
@@ -539,44 +561,46 @@ export default {
     'getRunningStatus': '/api/cdssman/test/running/getStatus',   //查看测试用例运行状态
     'getRunningStatusByHospitalId': '/api/cdssman/test/running/getStatusByHospitalId',   //查拉面所有测试用例运行状态
     'updateRunningStatus': '/api/cdssman/test/running/updateStatus',   //更新测试用例运行状态
-      //知识库规则维护
-      'zskRuleList':'/api/cdssman/klRule/getKlRuleInfoPage',//规则列表
-      'zskAddRule':'/api/cdssman//klRule/saveRuleInfo',//添加规则
-      'zskActiveRule':'/api/cdssman/klRule/startRuleInfo',//启用规则
-      'zskDisableRule':'/api/cdssman/klRule/disableRuleInfo',//禁用规则
-      'zskDelRule':'/api/cdssman/klRule/clearRuleInfo',//删除规则
-      'zskRuleDetail':'/api/cdssman/klRule/getByIdRuleInfo',//规则详情
-      'zskTypeList':'/api/cdssman/klRulePlan/getMenu',//类型列表
-      'zskSearchConcept':'/api/cdssman/klDisease/searchConcept',//知识库搜索术语
-      'zskUpdateAll':'/api/cdssman/cache/clearRuleAll',//更新数据
-      'zskgetDict':'/api/cdssman/kl/dictionary/getDictionarys',//
+    //知识库规则维护
+    'zskRuleList': '/api/cdssman/klRule/getKlRuleInfoPage',//规则列表
+    'zskAddRule': '/api/cdssman//klRule/saveRuleInfo',//添加规则
+    'zskActiveRule': '/api/cdssman/klRule/startRuleInfo',//启用规则
+    'zskDisableRule': '/api/cdssman/klRule/disableRuleInfo',//禁用规则
+    'zskDelRule': '/api/cdssman/klRule/clearRuleInfo',//删除规则
+    'zskRuleDetail': '/api/cdssman/klRule/getByIdRuleInfo',//规则详情
+    'zskTypeList': '/api/cdssman/klRulePlan/getMenu',//类型列表
+    'zskSearchConcept': '/api/cdssman/klDisease/searchConcept',//知识库搜索术语
+    'zskUpdateAll': '/api/cdssman/cache/clearRuleAll',//更新数据
+    'zskgetDict': '/api/cdssman/kl/dictionary/getDictionarys',//
     //知识库树形图
-    'getTree':'/api/cdssman/multContact/getTree',//获取当前type数据
-    'searchTreeItem':'/api/cdssman/multContact/getAllForRelation',//检索树元素
-    'addTreeRelation':'/api/cdssman/multContact/addRelation',//保存树元素
+    'getTree': '/api/cdssman/multContact/getTree',//获取当前type数据
+    'searchTreeItem': '/api/cdssman/multContact/getAllForRelation',//检索树元素
+    'addTreeRelation': '/api/cdssman/multContact/addRelation',//保存树元素
     //知识库基础维护
-    'getBaseConceptInfoPage':'/api/cdssman/graph/klConcept/getConceptInfoPage',
-    'startConcept':'/api/cdssman/graph/klConcept/startConcept',
-    'disableConcept':'/api/cdssman/graph/klConcept/disableConcept',
-    'baseTypeGetPage':'/api/cdssman/kl/lexicon/getPage',
-    'baseRelationTypeGetPage':'/api/cdssman/kl/lexiconRelationship/getPage',
-    'clearStandRuleDrug':'/api/cdssman/cache/clearStandRuleDrug',
-    'saveBaseConceptInfo':'/api/cdssman/graph/klConcept/saveConceptInfo',
-    'getBaseConceptAll':'/api/cdssman/graph/klConcept/getConceptAll',
-    'clearConceptInfo':'/api/cdssman/graph/klConcept/clearConceptInfo',
+    'getBaseConceptInfoPage': '/api/cdssman/graph/klConcept/getConceptInfoPage',
+    'startConcept': '/api/cdssman/graph/klConcept/startConcept',
+    'disableConcept': '/api/cdssman/graph/klConcept/disableConcept',
+    'baseTypeGetPage': '/api/cdssman/kl/lexicon/getPage',
+    'baseRelationTypeGetPage': '/api/cdssman/kl/lexiconRelationship/getPage',
+    'clearStandRuleDrug': '/api/cdssman/cache/clearStandRuleDrug',
+    'saveBaseConceptInfo': '/api/cdssman/graph/klConcept/saveConceptInfo',
+    'getBaseConceptAll': '/api/cdssman/graph/klConcept/getConceptAll',
+    'clearConceptInfo': '/api/cdssman/graph/klConcept/clearConceptInfo',
     //疾病相关维护
-    'getDiseasePage':'/api/cdssman/klDisease/getDiseasePage',
-    'diseaseDelete':'/api/cdssman/klDisease/delete',
-    'getBaseDetail':'/api/cdssman/klDisease/getDetail',
-    'searchConcept':'/api/cdssman/klDisease/searchConcept',
-    'findDisName':'/api/cdssman/klDisease/findDisName',
-    'diseaseBaseSave':'/api/cdssman/klDisease/save',
+    'getDiseasePage': '/api/cdssman/klDisease/getDiseasePage',
+    'diseaseDelete': '/api/cdssman/klDisease/delete',
+    'getBaseDetail': '/api/cdssman/klDisease/getDetail',
+    'searchConcept': '/api/cdssman/klDisease/searchConcept',
+    'findDisName': '/api/cdssman/klDisease/findDisName',
+    'diseaseBaseSave': '/api/cdssman/klDisease/save',
+    'exportExcelTemplates': '/api/cdssman/importConcept/exportExcelTemplates',
+    'exportTermExcel': '/api/cdssman/importConcept/exportTermExcel',
     //静态知识术语
-    'staticBaseKnowledge':'/api/cdssman/kl/conceptInfo/getPage',
-    'changeBaseStatus':'/api/cdssman/kl/conceptInfo/changeStatus',
-    'getBaseRecordById':'/api/cdssman/kl/conceptInfo/getRecordById',
-    'saveBaseOrUpdateRecord':'/api/cdssman/kl/conceptInfo/saveOrUpdateRecord',
-    'staticKnowledgeBaseInfo':'/api/cdssman/kl/conceptInfo/staticKnowledgeIndexWithoutInfo',
+    'staticBaseKnowledge': '/api/cdssman/kl/conceptInfo/getPage',
+    'changeBaseStatus': '/api/cdssman/kl/conceptInfo/changeStatus',
+    'getBaseRecordById': '/api/cdssman/kl/conceptInfo/getRecordById',
+    'saveBaseOrUpdateRecord': '/api/cdssman/kl/conceptInfo/saveOrUpdateRecord',
+    'staticKnowledgeBaseInfo': '/api/cdssman/kl/conceptInfo/staticKnowledgeIndexWithoutInfo',
     //规则测试相关
     'allRuleTest':'/api/cdssman/test/rule/allRuleTest',
     'autoGetCaseResultList':'/api/cdssman/test/rule/getCaseResultList',

+ 33 - 13
src/api/knowledgeTree.js

@@ -76,13 +76,13 @@ export default {
     return axios.post(urls.allRuleTest, param);
   },
   autoExportExcel(param) {
-      return axios({
-          method:'post',
-          url:urls.exportRuleExcel,
-          data: param,
-          contentType: "application/vnd.ms-excel" ,
-          responseType: 'blob'//必须添加,否则会乱码
-      })
+    return axios({
+      method: 'post',
+      url: urls.exportRuleExcel,
+      data: param,
+      contentType: "application/vnd.ms-excel",
+      responseType: 'blob'//必须添加,否则会乱码
+    })
   },
   autoGetCaseResultList(param) {
     return axios.post(urls.autoGetCaseResultList, param);
@@ -93,14 +93,14 @@ export default {
   getResultRulePage(param) {
     return axios.post(urls.getResultRulePage, param);
   },
-  ruleExportExcel(param) {     
+  ruleExportExcel(param) {
     return axios({
-      method:'post',
-      url:urls.ruleExportExcel,
+      method: 'post',
+      url: urls.ruleExportExcel,
       data: param,
-      contentType: "application/vnd.ms-excel" ,
+      contentType: "application/vnd.ms-excel",
       responseType: 'blob'//必须添加,否则会乱码
-  })
+    })
   },
   autoRuleTest(param) {
     return axios.post(urls.autoRuleTest, param);
@@ -126,4 +126,24 @@ export default {
   findDisName(param) {
     return axios.post(urls.findDisName, param);
   },
-};
+  exportExcelTemplates(param) {
+    return axios({
+      method: 'post',
+      url: urls.exportExcelTemplates,
+      data: param,
+      contentType: "application/vnd.ms-excel",
+      responseType: 'blob'//必须添加,否则会乱码
+    })
+  },
+  // /importConcept/exportTermExcel
+  exportTermExcel(param) {
+    // return axios.post(urls.exportTermExcel, param);
+    return axios({
+      method: 'post',
+      url: urls.exportTermExcel,
+      data: param,
+      contentType: "multipart/form-data",
+      responseType: 'blob'//必须添加,否则会乱码
+    })
+  }
+};

+ 131 - 128
src/api/utils.js

@@ -1,34 +1,34 @@
 import $ from 'jquery';
 
-function getWindowInnerHeight(){
-  if(window.innerHeight!=undefined){
+function getWindowInnerHeight() {
+  if (window.innerHeight != undefined) {
     return window.innerHeight;
-  }else{
+  } else {
     let by = document.body, ele = document.documentElement;
-    return Math.min(by.clientHeight,ele.clientHeight);
+    return Math.min(by.clientHeight, ele.clientHeight);
   }
 };
-function getWindowInnerWidth(){
+function getWindowInnerWidth() {
   let width = window.innerWidth || document.body.clientWidth || document.documentElement.clientWidth
   return width
 };
-function getPageCoordinate(event,stic){//获取鼠标点击的位置
+function getPageCoordinate(event, stic) {//获取鼠标点击的位置
   let e = event || window.event;
   var scrollX = document.documentElement.scrollLeft || document.body.scrollLeft;
   var scrollY = document.documentElement.scrollTop || document.body.scrollTop;
   var x = e.pageX || (e.clientX + scrollX);
-  var y = (e.pageY+(stic?25:0)) || (e.clientY + scrollY + (stic?25:0));//弹窗位置偏下25
+  var y = (e.pageY + (stic ? 25 : 0)) || (e.clientY + scrollY + (stic ? 25 : 0));//弹窗位置偏下25
   let obj = {
-    boxLeft : x ,
-    boxTop : y+18
+    boxLeft: x,
+    boxTop: y + 18
   }
   return obj;
 }
 
- /**
- * @param {拖动元素/清除拖动事件监听} type add:添加事件监听  del:移除事件监听
- * @param {展开元素id} addDom 
- */
+/**
+* @param {拖动元素/清除拖动事件监听} type add:添加事件监听  del:移除事件监听
+* @param {展开元素id} addDom 
+*/
 let width = '',//屏幕宽度
   height = '', //屏幕高度
   dragWrapper = '',//拖拽元素
@@ -45,10 +45,10 @@ let width = '',//屏幕宽度
  * @param {可拖动的区域} dragModalTitle 
  */
 function handleMove(event) {
-  let wrap = $("#"+dragWrapper); //被拖拽的元素
-  let dragDes = $("#"+addPart); //展開区域
+  let wrap = $("#" + dragWrapper); //被拖拽的元素
+  let dragDes = $("#" + addPart); //展開区域
   let page = getPageCoordinate(event, '0');//获取鼠标位置
-  let maxDragX = 0,dragDesWidth = 0;
+  let maxDragX = 0, dragDesWidth = 0;
   let wrapHeight = wrap[0].offsetHeight;//直接用.height()获取的高度不准确
   let wrapWidth = wrap[0].offsetWidth;
   let maxDragY = height - wrapHeight; //最大可拖拽y方向距离
@@ -85,15 +85,15 @@ function handleMove(event) {
       marginLeft: 0 + 'px',
       marginTop: 0 + 'px',
       top: dragY + 'px',
-      bottom:'auto',
-      right:'inherit',
+      bottom: 'auto',
+      right: 'inherit',
     })
   }
 }
 /**
  * 鼠标弹起弹窗不在跟随鼠标移动
  */
-function handleUp(){
+function handleUp() {
   isDrag = false;
   return
 }
@@ -114,26 +114,26 @@ export default {
       }
     }
   },
-  tranformDate(time,str,flag='-'){
-    if(!time){
+  tranformDate(time, str, flag = '-') {
+    if (!time) {
       return time;
     }
-    const year=time.getFullYear();
-    const month = time.getMonth()+1;
+    const year = time.getFullYear();
+    const month = time.getMonth() + 1;
     const day = time.getDate();
-    return year+flag+(month>9?month:'0'+month)+flag+(day>9?day:'0'+day)+str;
+    return year + flag + (month > 9 ? month : '0' + month) + flag + (day > 9 ? day : '0' + day) + str;
   },
   //获取两个时间间隔天数
   getTimeRangeDay(timeArr) {
-    if(!timeArr||timeArr.length==0){
+    if (!timeArr || timeArr.length == 0) {
       return null;
     }
     return (new Date(timeArr[1]) - new Date(timeArr[0])) / (1000 * 60 * 60 * 24);
   },
   //导出接口返回流下载
   downloadExportedData(data, fileName) {
-    var blob = new Blob([data], 
-      {type: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet;charset=utf-8'}
+    var blob = new Blob([data],
+      { type: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet;charset=utf-8' }
     ); //application/vnd.openxmlformats-officedocument.spreadsheetml.sheet这里表示xlsx类型
     var downloadElement = document.createElement('a');
     var href = window.URL.createObjectURL(blob); //创建下载的链接
@@ -148,14 +148,14 @@ export default {
   // pswReg: /^(?![0-9]+$)(?![a-zA-Z]+$)/,
   pswReg: /^(?![0-9]+$)(?![a-zA-Z]+$)[0-9A-Za-z\W_]{6,16}$/,//与后台保持一致
   phoneReg: new RegExp(/^((13|14|15|16|17|18|19)\d{9})$/),
-  url:/[a-zA-z]+:\/\/[^\s]*/,
-	getDateStr(string,str){
-	  var str_before = string.split(str)[0];
-	  var str_after = string.split(str)[1];
-	},
-  exportCondition(time){
+  url: /[a-zA-z]+:\/\/[^\s]*/,
+  getDateStr(string, str) {
+    var str_before = string.split(str)[0];
+    var str_after = string.split(str)[1];
+  },
+  exportCondition(time) {
     const rangeDay = this.getTimeRangeDay(time);
-    if (!time||time.length==0) {
+    if (!time || time.length == 0) {
       return '请先选择导出时间';
     }
     if (rangeDay > 30) {
@@ -171,18 +171,18 @@ export default {
    * @param {des} 1数組元素是对象
    * 
    */
-  filterArr(arr,val,type,des){  //数组剔除指定元素 
-    if(type == 1){
-      if(des){
+  filterArr(arr, val, type, des) {  //数组剔除指定元素 
+    if (type == 1) {
+      if (des) {
         return arr.filter(item => item.id != val)  //判断id
-      }else{
+      } else {
         return arr.filter(item => item != val)    //判断值
       }
-    }else{
+    } else {
       let tmp = arr.filter(item => JSON.stringify(item) == JSON.stringify(val))   //判读是否存在
-      if(JSON.stringify(tmp) == '[]'){
+      if (JSON.stringify(tmp) == '[]') {
         return false;
-      }else{
+      } else {
         return true;
       }
     }
@@ -194,10 +194,10 @@ export default {
    * @param {tmpArrAdd} 既往史自动生成的组合标签的id存储 
    * @param {type} 填写单类型 
    */
-  dataRecombination(dataArr,type,tmpArrAdd){
+  dataRecombination(dataArr, type, tmpArrAdd) {
     // console.log(11111,tmpArrAdd,dataArr)
     let tmpArr = [];
-    for(let i = 0;i < dataArr.length;i++){
+    for (let i = 0; i < dataArr.length; i++) {
       let tmpData = dataArr[i];
       let mapping = {
         "sonQuestion": "",
@@ -208,23 +208,23 @@ export default {
         "symptomType": 0,           //0:默认值 1:主症状特有 2:伴随症状特有
       }
       let sonQuestionMap = {     //目前只在既往史中用到,同层数据置空
-          "id": "",
-          "questionMappings": []
+        "id": "",
+        "questionMappings": []
       }
-  
-      if(type == 6 && tmpData.length > 0){//既往史
-        let sonMappingArr=[]; 
-        for(let j = 0; j < tmpData.length;j++){        //多个标签
+
+      if (type == 6 && tmpData.length > 0) {//既往史
+        let sonMappingArr = [];
+        for (let j = 0; j < tmpData.length; j++) {        //多个标签
           let sonMappingObj = {};
-          if(i == 0){
+          if (i == 0) {
             mapping.formPosition = 1;
             mapping.exclusionType = 1;
             mapping.sonQuestion = tmpData[j];
-          }else if(i == 1){
+          } else if (i == 1) {
             mapping.formPosition = 0;
             mapping.exclusionType = 0;
             mapping.sonQuestion = tmpData[j];
-          }else{
+          } else {
             mapping.formPosition = 0;
             mapping.exclusionType = 0;
             mapping.sonQuestion = tmpArrAdd[i][0] || ''; //既往史新增标签的id
@@ -234,26 +234,26 @@ export default {
             mapping.questionMappingSon = sonQuestionMap;
           }
           sonMappingArr.push(sonMappingObj);         //[{sonQuestion:18},{sonQuestion:19}]
-          
+
         }
         tmpArr.push(mapping)
-      }else if(type == 2 && tmpData.length > 0){//杂音
-        if(i == 0){
+      } else if (type == 2 && tmpData.length > 0) {//杂音
+        if (i == 0) {
           mapping.formPosition = 1;
           mapping.exclusionType = 1;
-        }else{
+        } else {
           mapping.formPosition = 0;
           mapping.exclusionType = 0;
         }
         mapping.sonQuestion = tmpData[0];    //{sonQuestion:18}
         tmpArr.push(mapping)
-      }else if (type == 4 || type == 3 || type == 7) { //横铺展开(如咳嗽)
+      } else if (type == 4 || type == 3 || type == 7) { //横铺展开(如咳嗽)
         mapping.formPosition = 0;
         mapping.exclusionType = 0;
         mapping.symptomType = dataArr[i].symptomType
-        if(dataArr[i].type){
-          if(dataArr[i].type === 'input') {
-            if(dataArr[i].text) { //过滤掉输入框未输入内容项
+        if (dataArr[i].type) {
+          if (dataArr[i].type === 'input') {
+            if (dataArr[i].text) { //过滤掉输入框未输入内容项
               mapping.text = dataArr[i].text
               tmpArr.push(mapping)
             }
@@ -262,7 +262,7 @@ export default {
             tmpArr.push(mapping)
           }
         }
-      } else if(type == 11) {    //推送症状类型(添加症状)
+      } else if (type == 11) {    //推送症状类型(添加症状)
         mapping.formPosition = 0;
         mapping.exclusionType = 0;
         mapping.sonQuestion = dataArr[i].id
@@ -274,22 +274,22 @@ export default {
   /**
    * 单选数据转换提交
    * **/
-  simpleOptionData(data){
+  simpleOptionData(data) {
     let arr = [];
-    data.map((it,i)=>{
+    data.map((it, i) => {
       let code = '';
       let abnormal = 0
-      if(it.isError){
+      if (it.isError) {
         abnormal = 1;
       }
-      if(it.isNone){
+      if (it.isNone) {
         code = '2';
       }
-      if(it.isBan){
+      if (it.isBan) {
         code = '1';
       }
-      if(it.name){
-        arr.push({name:it.name,defaultSelect:it.defaultSelect?'1':'0',code,abnormal,remark:'单选项-'+it.name});
+      if (it.name) {
+        arr.push({ name: it.name, defaultSelect: it.defaultSelect ? '1' : '0', code, abnormal, remark: '单选项-' + it.name });
       }
     });
     return arr;
@@ -298,7 +298,7 @@ export default {
    *将提交的参数转换成对应的组件form中的key
    *
    */
-  transformKeys(data, tagFlag){   //tagFlag:独立标签还是标签组 (2是标签组)
+  transformKeys(data, tagFlag) {   //tagFlag:独立标签还是标签组 (2是标签组)
     const maps = {
       "controlType": 'region2',                            //控件类型(0:默认值 1:下拉单选 2:下拉多选 6:文本框 7:数字键盘文本框 99:联合推送)
       // "tagType": 'region2',(这个注释掉,不要解开了!!!!)
@@ -311,45 +311,45 @@ export default {
       "sexType": 'region7',             //1:男,2:女,3:通用
       "ageBegin": 'region8',       		 //最小年龄
       "ageEnd": 'region9',              //最大年龄
-      "copyType":'region10',          //是否复制主标签  
-      "showAdd":'region11',           //是否复制当前模块
+      "copyType": 'region10',          //是否复制主标签  
+      "showAdd": 'region11',           //是否复制当前模块
       "itemType": 'region12',
       "disType": 'region13',
-      "labelPrefix":'prefix',                                 //前缀
-      "labelSuffix":'suffix',                                 //后缀
-      "maxValue":'maxNormalVal',                                 //前缀
-      "minValue":'minNormalVal',                                 //后缀
+      "labelPrefix": 'prefix',                                 //前缀
+      "labelSuffix": 'suffix',                                 //后缀
+      "maxValue": 'maxNormalVal',                                 //前缀
+      "minValue": 'minNormalVal',                                 //后缀
       "specFlag": 'specFlag', //标记状态(0:没有标记,1:主诉高亮,2:诱因记录)
-      "selFlag":'selFlag',
+      "selFlag": 'selFlag',
     };
     if (tagFlag == 2) {
       maps["tagType"] = 'region2'
     }
     let obj = {};
-    for(let it in maps){
-      obj[maps[it]] = typeof data[it]=='number'?data[it]+'':data[it];
+    for (let it in maps) {
+      obj[maps[it]] = typeof data[it] == 'number' ? data[it] + '' : data[it];
     }
     return obj;
   },
   /**
    * 模板数据提交转化函数
    */
-  orderTemplateData(data){
+  orderTemplateData(data) {
     let tmpArr = [];
-    for(let i =0;i<data.length;i++){
-      let obj={
+    for (let i = 0; i < data.length; i++) {
+      let obj = {
         "flag": '',
         "questionId": '',
         "relationModule": '',
         "text": ""
       };
-      if(data[i].type == 'sub'){      //这是子模板
+      if (data[i].type == 'sub') {      //这是子模板
         obj.relationModule = parseInt(data[i].id)
-      }else if(data[i].type == 'input'){     //这个是输入框文字
-        if(data[i].text){   //去掉空输入框
+      } else if (data[i].type == 'input') {     //这个是输入框文字
+        if (data[i].text) {   //去掉空输入框
           obj.text = data[i].text
         }
-      }else{    //这个是标签
+      } else {    //这个是标签
         obj.questionId = data[i].id
       }
       obj.flag = data[i].flag || ''
@@ -362,12 +362,12 @@ export default {
   * row:Object
   * orderName:编号字段名称,默认orderNo
    */
-  getInitRow(row,n,orderName){
+  getInitRow(row, n, orderName) {
     let arr = [];
     let obj = {};
-    for(let i=0;i<n;i++){
-      obj = Object.assign({},row);
-      obj[orderName||'orderNo'] = i;
+    for (let i = 0; i < n; i++) {
+      obj = Object.assign({}, row);
+      obj[orderName || 'orderNo'] = i;
       arr.push(obj);
     }
     return arr;
@@ -376,45 +376,45 @@ export default {
    * 预问诊-字段转换
    *
    * **/
-  transPretreatKeys(org,isDpt){
+  transPretreatKeys(org, isDpt) {
     let maps = {
-      name:'region4',
-      description:'region5',
-      itemType:'region12',
-      sexType:'region7',
-      ageBegin:'region8',
-      ageEnd:'region9',
-      tagName:'region3',
+      name: 'region4',
+      description: 'region5',
+      itemType: 'region12',
+      sexType: 'region7',
+      ageBegin: 'region8',
+      ageEnd: 'region9',
+      tagName: 'region3',
       //tagType:isDpt?'':'region2',
       //controlType:isDpt?'region2':'',
-      type:'region1',
-      url:'region13',
-      specFlag:'specFlag',
+      type: 'region1',
+      url: 'region13',
+      specFlag: 'specFlag',
       required: 'required',
-      explains:'explains',
-      flag:'flag'
+      explains: 'explains',
+      flag: 'flag'
     };
-    isDpt?maps.controlType = 'region2':maps.tagType = 'region2';
+    isDpt ? maps.controlType = 'region2' : maps.tagType = 'region2';
     let obj = {};
-    for(let i in org){
-      if(maps[i]){
-        obj[maps[i]] = org[i]+''==='null'?'':org[i]+'';
+    for (let i in org) {
+      if (maps[i]) {
+        obj[maps[i]] = org[i] + '' === 'null' ? '' : org[i] + '';
       }
     }
     return obj;
   },
   //获取图片名称
-  getImgName(url){
+  getImgName(url) {
     const arr = url.split("/");
-    return arr[arr.length-1];
+    return arr[arr.length - 1];
   },
- 
-  dragBox(dragWrap,dragTop,type,addDom,img) {
-    let drag = $("#"+dragTop); //拖拽区域
-    let wrap = $("#"+dragWrap); //被拖拽的元素
-    width = getWindowInnerWidth(); 
+
+  dragBox(dragWrap, dragTop, type, addDom, img) {
+    let drag = $("#" + dragTop); //拖拽区域
+    let wrap = $("#" + dragWrap); //被拖拽的元素
+    width = getWindowInnerWidth();
     height = getWindowInnerHeight();
-    addPart = addDom||null;
+    addPart = addDom || null;
     dragWrapper = dragWrap;
     if (type === 'del') {
       $(document).off('mousemove', handleMove)
@@ -422,9 +422,9 @@ export default {
     } else {
       drag.on('mousedown', function (event) {
         let lenHeight = wrap.height()
-        if(img){
-          $("#preImg").css("height",(lenHeight)+'px')
-          $("#dragModalWrap").css("height",(lenHeight)+'px')
+        if (img) {
+          $("#preImg").css("height", (lenHeight) + 'px')
+          $("#dragModalWrap").css("height", (lenHeight) + 'px')
         }
         let page = getPageCoordinate(event, '0');
         mouseX = page.boxLeft - wrap.offset().left; //鼠标到拖拽元素的左边界的距离
@@ -436,17 +436,20 @@ export default {
     }
   },
   getCurrentPage(currentChange, total, pageSize) {
-    const currentPage =  currentChange > Math.ceil(total/pageSize) ? Math.ceil(total/pageSize) : currentChange
+    const currentPage = currentChange > Math.ceil(total / pageSize) ? Math.ceil(total / pageSize) : currentChange
     return currentPage;
   },
-  formatObj(data,key){
-        let obj={};
-        data.map((it)=>{
-            obj[it[key]]=it.subMenuList;
-        });
-        return obj;
-    },
-    delNullObj(arr){
-      return arr.filter((it)=>it!==null);
-    }
+  formatObj(data, key) {
+    let obj = {};
+    data.map((it) => {
+      obj[it[key]] = it.subMenuList;
+    });
+    return obj;
+  },
+  delNullObj(arr) {
+    return arr.filter((it) => it !== null);
+  },
+  importExcel(){
+    
+  }
 }

+ 6 - 3
src/components/basicKnow/AddTerm.vue

@@ -64,6 +64,7 @@
                   v-model="data.type"
                   filterable
                   clearable
+                  popper-class="horizontal-drop"
                   placeholder="请选择"
                   @clear="clearDataCi"
                   size="small"
@@ -136,6 +137,7 @@
                   <el-select
                     v-model="data.type"
                     filterable
+                    popper-class="horizontal-drop"
                     placeholder="请选择"
                     size="small"
                     @clear="clearDataCi"
@@ -1309,9 +1311,10 @@ export default {
           if (data.code == 0) {
             let types = data.data.records;
             this.typeList = types;
+              // 类型改成平铺
+              this.options.push({ label: 1, options: types })
             // this.typeList = data.data;
-            // 类型改成平铺
-            if (types.length > 0) {
+            /*if (types.length > 0) {
               const total = types.length;
               const average = parseInt(total / 3);
               const mod = total % 3; //余数
@@ -1330,7 +1333,7 @@ export default {
                 { label: 2, options: secGroup },
                 { label: 3, options: thirdGroup }
               );
-            }
+            }*/
           } else {
             this.$message({
               message: data.msg,

+ 216 - 72
src/components/basicKnow/BasicTermsMaintenance.vue

@@ -3,10 +3,20 @@
     <crumbs title="基础术语维护" minWidth="995px" class="knowledgeTitle">
       <el-form :inline="true" class="demo-form-inline">
         <el-form-item label="医学标准术语:">
-          <el-input size="mini" v-model="filter.term" placeholder="请输入术语"></el-input>
+          <el-input
+            size="mini"
+            v-model="filter.term"
+            placeholder="请输入术语"
+          ></el-input>
         </el-form-item>
         <el-form-item label="术语类型:">
-          <el-select v-model="filter.type" clearable filterable placeholder="请选择" size="mini">
+          <el-select
+            v-model="filter.type"
+            clearable
+            filterable
+            placeholder="请选择"
+            size="mini"
+          >
             <el-option
               v-for="item in typeList"
               :key="item.id"
@@ -16,10 +26,19 @@
           </el-select>
         </el-form-item>
         <el-form-item label="同义词:">
-          <el-input size="mini" v-model="filter.libName" placeholder="输入同义词"></el-input>
+          <el-input
+            size="mini"
+            v-model="filter.libName"
+            placeholder="输入同义词"
+          ></el-input>
         </el-form-item>
         <el-form-item label="状态:">
-          <el-select v-model="filter.isState" clearable placeholder="请选择" size="mini">
+          <el-select
+            v-model="filter.isState"
+            clearable
+            placeholder="请选择"
+            size="mini"
+          >
             <el-option
               v-for="item in stateSelect"
               :key="item.id"
@@ -34,36 +53,86 @@
       </el-form>
       <el-form class="secLine">
         <el-form-item>
-          <el-button size="mini" type="warning" @click="addMedicalName" style="margin:0 10px">+ 新增术语</el-button>
+          <span @click="handleDownLoad" class="link_to_downLoad"
+            >导入模板下载</span
+          >
+          <el-button
+            :disabled="uploadLodding"
+            @click="handleUploadBtn"
+            size="mini"
+            >{{ uploadLodding ? "导入中..." : "导入" }}</el-button
+          >
+          <input
+            style="display: none"
+            type="file"
+            name="uploadfile "
+            id="upFileInp"
+            @change="uploadFile($event)"
+          />
+          <el-button
+            size="mini"
+            type="warning"
+            @click="addMedicalName"
+            style="margin: 0 10px"
+            >+ 新增术语</el-button
+          >
           <el-button size="mini" @click="reloadLib">更新数据</el-button>
         </el-form-item>
       </el-form>
     </crumbs>
     <div class="contents knowledgeContents">
       <el-table :data="list" border style="width: 100%">
-        <el-table-column type="index" :index="indexMethod" label="编号" width="60"></el-table-column>
-        <el-table-column prop="libName" label="医学标准术语" show-overflow-tooltip></el-table-column>
+        <el-table-column
+          type="index"
+          :index="indexMethod"
+          label="编号"
+          width="60"
+        ></el-table-column>
+        <el-table-column
+          prop="libName"
+          label="医学标准术语"
+          show-overflow-tooltip
+        ></el-table-column>
         <el-table-column prop="typeName" label="术语类型"></el-table-column>
-        <el-table-column prop="synonymName" label="同义词" show-overflow-tooltip></el-table-column>
+        <el-table-column
+          prop="synonymName"
+          label="同义词"
+          show-overflow-tooltip
+        ></el-table-column>
         <el-table-column label="状态" width="100">
           <template slot-scope="scope">
-            <span>{{scope.row.isDeleted == 'N'?'启用':'禁用'}}</span>
+            <span>{{ scope.row.isDeleted == "N" ? "启用" : "禁用" }}</span>
           </template>
         </el-table-column>
         <el-table-column prop="modifierName" label="操作人"></el-table-column>
-        <el-table-column prop="gmtModified" label="操作时间" :show-overflow-tooltip="true"></el-table-column>
+        <el-table-column
+          prop="gmtModified"
+          label="操作时间"
+          :show-overflow-tooltip="true"
+        ></el-table-column>
         <el-table-column label="操作" width="160">
           <template slot-scope="scope">
-            <el-button type="text" size="small" @click="toEditProduct(scope.row)">修改</el-button>
-            <span style="margin:0 3px;">|</span>
-            <el-button type="text" size="small" @click="toEditProduct(scope.row,true)">复制</el-button>
-            <span style="margin:0 3px;">|</span>
             <el-button
               type="text"
               size="small"
-              :class="scope.row.isDeleted == 'N'?'delete':'review'"
+              @click="toEditProduct(scope.row)"
+              >修改</el-button
+            >
+            <span style="margin: 0 3px">|</span>
+            <el-button
+              type="text"
+              size="small"
+              @click="toEditProduct(scope.row, true)"
+              >复制</el-button
+            >
+            <span style="margin: 0 3px">|</span>
+            <el-button
+              type="text"
+              size="small"
+              :class="scope.row.isDeleted == 'N' ? 'delete' : 'review'"
               @click="showDelDialog(scope.row)"
-            >{{scope.row.isDeleted == 'Y'?'启用':'禁用'}}</el-button>
+              >{{ scope.row.isDeleted == "Y" ? "启用" : "禁用" }}</el-button
+            >
           </template>
         </el-table-column>
       </el-table>
@@ -82,18 +151,18 @@
 </template>
 
 <script>
-import api from '@api/knowledgeTree.js';
-import config from '@api/config.js';
-import utils from '@api/utils.js';
+import api from "@api/knowledgeTree.js";
+import config from "@api/config.js";
+import utils from "@api/utils.js";
 
 export default {
-  name: 'BasicTermsMaintenance',
-  data: function() {
+  name: "BasicTermsMaintenance",
+  data: function () {
     return {
       list: [],
       stateSelect: [
-        { id: 'N', name: '启用' },
-        { id: 'Y', name: '禁用' }
+        { id: "N", name: "启用" },
+        { id: "Y", name: "禁用" }
       ],
       // isState:'',
       cacheData: {}, //因为删除和恢复要及时更新,所以不做缓存
@@ -104,12 +173,13 @@ export default {
       total: 0,
       searched: false,
       filter: {
-        term: '',
-        type: '',
-        libName: ''
+        term: "",
+        type: "",
+        libName: ""
       },
       typeList: [],
-      reloadFlag: true
+      reloadFlag: true,
+      uploadLodding: false
     };
   },
   created() {
@@ -129,7 +199,7 @@ export default {
   },
   watch: {
     filter: {
-      handler: function() {
+      handler: function () {
         this.searched = false;
       },
       deep: true
@@ -143,6 +213,71 @@ export default {
   //   });
   // },
   methods: {
+    handleUploadBtn() {
+      let inp = document.getElementById("upFileInp");
+      inp.click();
+    },
+    // 导入数据
+    uploadFile(e) {
+      let that = this;
+      this.uploadLodding = true;
+      let fileInfo = e.target.files[0];
+      e.preventDefault();
+      let formData = new FormData();
+      formData.append("termfile", fileInfo);
+      this.uploadText = "导入中...";
+      api
+        .exportTermExcel(formData)
+        .then((res) => {
+          let r = new FileReader();
+          r.onload = function () {
+            const exsetCode = this.result.indexOf("code") !== -1;
+            if (!exsetCode) {
+              utils.downloadExportedData(res.data, "基础术语导入模板.xls");
+              that.getDataList();
+            } else {
+              const code = JSON.parse(this.result);
+              if (code.code === "00000001") {
+                that
+                  .$alert(`数据存在异常,导入失败,请修改后再试`, "提示", {
+                    confirmButtonText: "确定",
+                    type: "warning"
+                  })
+                  .then(() => {})
+                  .catch(() => {});
+              } else {
+                that
+                  .$alert(`${code.msg}`, "提示", {
+                    confirmButtonText: "确定",
+                    type: "warning"
+                  })
+                  .then(() => {})
+                  .catch(() => {});
+              }
+            }
+            setTimeout(() => {
+              that.uploadLodding = false;
+            }, 300);
+          };
+          r.readAsText(res.data);
+        })
+        .catch((error) => {
+          console.error(error);
+          that.uploadLodding = false;
+        });
+      //解决上传相同文件不触发change
+      let inp = document.getElementById("upFileInp");
+      inp.value = "";
+    },
+    handleDownLoad() {
+      api.exportExcelTemplates().then((res) => {
+        if (res.status === 200) {
+          setTimeout(() => {
+            utils.downloadExportedData(res.data, "基础术语导入模板.xls");
+          }, 1500);
+        }
+      });
+    },
     handleSizeChange(val) {
       this.pageSize = val;
       this.currentPage = utils.getCurrentPage(
@@ -155,19 +290,19 @@ export default {
     reloadLib() {
       const loading = this.$loading({
         lock: true,
-        text: 'Loading',
-        spinner: 'el-icon-loading',
-        background: 'rgba(0, 0, 0, 0.7)'
+        text: "Loading",
+        spinner: "el-icon-loading",
+        background: "rgba(0, 0, 0, 0.7)"
       });
       if (this.reloadFlag) {
         this.reloadFlag = false;
-        api.clearStandRuleDrug().then(res => {
+        api.clearStandRuleDrug().then((res) => {
           this.getDataList();
           if (res.data.code == 0) {
             this.reloadFlag = true;
-            this.warning('更新成功', 'success');
+            this.warning("更新成功", "success");
           } else {
-            this.warning(res.data.msg || '更新失败,请重试');
+            this.warning(res.data.msg || "更新失败,请重试");
           }
         });
       }
@@ -180,7 +315,7 @@ export default {
             filter: this.filter
           }
         : { currentPage: this.currentPage, pageSize: this.pageSize };
-      this.$router.push({ name: 'AddTerm', params: pam });
+      this.$router.push({ name: "AddTerm", params: pam });
     },
     toEditProduct(row, copy) {
       const pam = this.searched
@@ -191,9 +326,13 @@ export default {
           }
         : { currentPage: this.currentPage, pageSize: this.pageSize };
       this.$router.push({
-        name: 'AddTerm',
+        name: "AddTerm",
         // params: {info:row}
-        params: Object.assign(pam, { id: row.conceptId,libType:row.libType, copy: copy })
+        params: Object.assign(pam, {
+          id: row.conceptId,
+          libType: row.libType,
+          copy: copy
+        })
       });
     },
     filterDatas() {
@@ -205,19 +344,19 @@ export default {
       this.searched = true;
       const loading = this.$loading({
         lock: true,
-        text: 'Loading',
-        spinner: 'el-icon-loading',
-        background: 'rgba(0, 0, 0, 0.7)'
+        text: "Loading",
+        spinner: "el-icon-loading",
+        background: "rgba(0, 0, 0, 0.7)"
       });
       api
         .getBaseConceptInfoPage(param)
-        .then(res => {
+        .then((res) => {
           loading.close();
-          if (res.data.code == '0') {
+          if (res.data.code == "0") {
             const data = res.data.data;
             const templis = data.records;
             for (let i = 0; i < templis.length; i++) {
-              templis[i].isDeleted = templis[i].status == '1' ? 'N' : 'Y';
+              templis[i].isDeleted = templis[i].status == "1" ? "N" : "Y";
             }
             this.list = templis;
             // this.cacheData[param.current] = data.records;
@@ -228,14 +367,14 @@ export default {
             }
           }
         })
-        .catch(error => {
+        .catch((error) => {
           console.log(error);
         });
     },
     getTypeList() {
       api
-        .baseTypeGetPage({ name: '', size: 1000 })
-        .then(res => {
+        .baseTypeGetPage({ name: "", size: 1000 })
+        .then((res) => {
           const data = res.data;
           if (data.code == 0) {
             this.typeList = data.data.records || [];
@@ -243,7 +382,7 @@ export default {
             console.log(res.msg);
           }
         })
-        .catch(error => {
+        .catch((error) => {
           console.log(error);
         });
     },
@@ -259,11 +398,11 @@ export default {
         libName: this.filter.term.trim(),
         libType: this.filter.type,
         status:
-          this.filter.isState == 'N'
-            ? '1'
-            : this.filter.isState == 'Y'
-            ? '0'
-            : '',
+          this.filter.isState == "N"
+            ? "1"
+            : this.filter.isState == "Y"
+            ? "0"
+            : "",
         synonymName: this.filter.libName.trim(),
         current: this.inCurrentPage || this.currentPage,
         size: this.pageSize,
@@ -286,13 +425,13 @@ export default {
       this.$message({
         showClose: true,
         message: msg,
-        type: type || 'warning'
+        type: type || "warning"
       });
     },
     showConfirmDialog(msg, resolve) {
-      this.$alert(msg, '提示', {
-        confirmButtonText: '确定',
-        type: 'warning'
+      this.$alert(msg, "提示", {
+        confirmButtonText: "确定",
+        type: "warning"
       })
         .then(() => {
           resolve();
@@ -308,46 +447,46 @@ export default {
       const param = {
         conceptId: item.conceptId
       };
-      let url = item.isDeleted === 'N' ? 'disableConcept' : 'startConcept';
+      let url = item.isDeleted === "N" ? "disableConcept" : "startConcept";
       let waringTxt =
-        item.isDeleted === 'N'
-          ? '是否禁用该标准术语?'
-          : '是否重新启用该条数据?';
+        item.isDeleted === "N"
+          ? "是否禁用该标准术语?"
+          : "是否重新启用该条数据?";
       this.showConfirmDialog(waringTxt, () => {
         api[url](param)
-          .then(res => {
-            if (res.data.code == '0') {
+          .then((res) => {
+            if (res.data.code == "0") {
               if (!this.searched) {
                 //未点确认时清空搜索条件
                 this.clearFilter();
               }
-              if (item.isDeleted !== 'N') {
+              if (item.isDeleted !== "N") {
                 //恢复成功后跳转到筛选条件的首页
                 this.currentPage = 1;
               } else {
-                if (this.filter.isState !== '' && this.list.length === 1) {
+                if (this.filter.isState !== "" && this.list.length === 1) {
                   //有启用状态筛选条件且当前页只有最后一条数据删除时,删除成功后跳转到前一页
                   this.currentPage =
                     this.currentPage === 1 ? 1 : this.currentPage - 1;
                 }
               }
-              this.warning(res.data.msg || '操作成功', 'success');
+              this.warning(res.data.msg || "操作成功", "success");
               this.getDataList();
             } else {
               this.warning(res.data.msg);
             }
           })
-          .catch(error => {
+          .catch((error) => {
             this.warning(error);
           });
       });
     },
     clearFilter() {
       this.filter = {
-        term: '',
-        type: '',
-        libName: '',
-        isState: ''
+        term: "",
+        type: "",
+        libName: "",
+        isState: ""
       };
     }
   }
@@ -355,7 +494,7 @@ export default {
 </script>
 
 <style lang="less" scoped>
-@import '../../less/admin.less';
+@import "../../less/admin.less";
 /deep/ .container.knowledgeTitle {
   height: 80px;
 }
@@ -386,7 +525,12 @@ export default {
   overflow: hidden;
   white-space: nowrap;
 }
-#upFile {
+#upFileInp {
   display: none !important;
 }
+.link_to_downLoad {
+  color: #02a7f0;
+  cursor: pointer;
+  margin-right: 10px;
+}
 </style>

+ 16 - 0
src/components/cdssManage/MedicalTerm.vue

@@ -94,6 +94,22 @@
             >{{scope.row.nurseNum}}</span>
           </template>
         </el-table-column>
+        <el-table-column :resizable="false" prop="tcmdiseaseNum" label="中医疾病关联">
+          <template slot-scope="scope">
+            <span
+              class="relation"
+              @click="goRelationPage('Tcmdisease',scope.row)"
+            >{{scope.row.tcmdiseaseNum}}</span>
+          </template>
+        </el-table-column>
+        <el-table-column :resizable="false" prop="Tcmdrome" label="中医证候关联">
+          <template slot-scope="scope">
+            <span
+              class="relation"
+              @click="goRelationPage('Tcmdrome',scope.row)"
+            >{{scope.row.tcmsyndromeNum}}</span>
+          </template>
+        </el-table-column>
       </el-table>
       <div class="pagination">
         <el-pagination

文件差异内容过多而无法显示
+ 588 - 744
src/components/cdssManage/plan/AddPlan.vue


+ 435 - 0
src/components/cdssManage/tcmdisease/Addtcmdisease.vue

@@ -0,0 +1,435 @@
+<template>
+  <div class="AddChemicalAndCommonMappingWrapper clearfix">
+    <crumbs
+      :title="isEdit ? '中医疾病关联维护--修改关联' : '中医疾病关联维护--添加关联'"
+      class="topBack"
+      :param="$route.params"
+      linkTo="Tcmdisease"
+    ></crumbs>
+    <el-form
+      :model="form"
+      :rules="rules"
+      label-position="right"
+      label-width="140px"
+      ref="relationForm"
+    >
+      <div class="AddChemicalAndCommonMappingBox clearfix">
+        <div class="titleBox clearfix">
+          <p class="title">医院术语</p>
+          <p class="title">标准术语</p>
+        </div>
+        <div class="leftBox clearfix">
+          <el-row>
+            <el-col :span="16">
+              <el-form-item label="中医疾病名称:" prop="hisName">
+                <el-input v-model="form.hisName" clearable style="minWidth: 240px"></el-input>
+              </el-form-item>
+              <el-form-item label="中医疾病名称预览:">
+                <span class="previewInfo" style="minWidth: 240px">{{form.hisName}}</span>
+              </el-form-item>
+            </el-col>
+          </el-row>
+        </div>
+        <div class="midBox">
+          <img class="midLogo" src="../../../images/relation.png" alt />
+          <p class="midTitle">相互关联</p>
+        </div>
+        <div class="rightBox">
+          <el-row>
+            <el-col :span="16">
+              <el-form-item label="中医疾病名称:" prop="searchText">
+                <el-select
+                  style="width:100%; minWidth: 240px"
+                  v-model="form.searchText"
+                  filterable
+                  remote
+                  clearable
+                  :loading="showDrop"
+                  loading-text="加载中..."
+                  @change="changeWord"
+                  @visible-change="handleVisible"
+                  placeholder="搜索"
+                  :remote-method="searchTerms"
+                  reserve-keyword
+                >
+                  <el-option
+                    v-for="(item,idx) in uniqueNameList"
+                    :key="idx"
+                    :label="item.name"
+                    :value="item"
+                    :title="item.name"
+                  ></el-option>
+                </el-select>
+              </el-form-item>
+              <el-form-item label="中医疾病名称预览:">
+                <span class="previewInfo" style="minWidth: 240px">{{form.searchText}}</span>
+              </el-form-item>
+              <el-form-item label="中医疾病代码:">
+                <span class="previewInfo" style="minWidth: 240px">{{form.uniqueCode}}</span>
+              </el-form-item>
+            </el-col>
+          </el-row>
+        </div>
+      </div>
+      <div class="btn">
+        <el-form-item>
+          <el-button type="primary" :disabled="saveDisable" @click="submitForm">确定</el-button>
+        </el-form-item>
+      </div>
+    </el-form>
+  </div>
+</template>
+<script>
+import api from '@api/cdss.js';
+export default {
+  name: 'AddTcmdisease',
+  data() {
+    return {
+      isEdit: false,
+      editId: '',
+      uniqueNameList: [],
+      form: {
+        searchText: '', //搜索字段
+        hisName: '',
+        uniqueCode: ''
+      },
+      rules: {
+        hisName: [
+          { required: true, message: '请输入中医疾病名称', trigger: 'change' },
+          { max: 80, message: '中医疾病名称最多80字', trigger: 'change' }
+        ],
+        searchText: [
+          { required: true, message: '请选择中医疾病名称', trigger: 'change' }
+        ]
+      },
+      saveDisable: false, //保存按钮禁止点击
+      showDrop: false, //下拉框显示文字
+      searchInfo: ''
+    };
+  },
+  created() {
+    //修改
+    const { isEdit, data, hospitaiName } = this.$route.params;
+    this.hospitaiName = hospitaiName;
+    this.hospitalId = data && data.hospitalId;
+    if (isEdit) {
+      this.isEdit = isEdit;
+      this.editId = data.id;
+      this.form.hisName = data.hisName;
+      this.form.searchText = data.uniqueName;
+      this.form.uniqueCode = data.uniqueCode;
+    }
+  },
+  methods: {
+    // 搜索列表
+    searchTerms(query) {
+      if (!query) {
+        this.uniqueNameList = [];
+        return;
+      }
+      this.searchInfo = query;
+      this.showDrop = true;
+      let params = {
+        type: 12, //中医疾病
+        inputStr: query,
+        sex: 3,
+        age: 0
+      };
+      api.retrievalSearch(params).then(res => {
+        this.showDrop = false;
+        if (res.data.code === '0') {
+          this.uniqueNameList = res.data.data.tcmdiseaseNames;
+        }
+      });
+    },
+    changeWord(newVal) {
+      this.form.searchText = newVal.name
+      this.form.uniqueCode = newVal.code
+    },
+    handleVisible(flag) {
+      if (!flag) {
+        this.uniqueNameList = [];
+      }
+    },
+
+    // 初始化表单数据
+    initForm() {
+      this.form.hisName = '';
+      this.form.searchText = '';
+      this.form.uniqueCode = '';
+    },
+
+    // 建立关联-参数处理
+    submitForm() {
+      this.$refs.relationForm.validate(valid => {
+        if (valid) {
+          const { searchText, hisName, uniqueCode } = this.form;
+          let params = {
+            hisName: hisName,
+            uniqueName: searchText,
+            uniqueCode: uniqueCode,
+            hospitalId: this.hospitalId
+          };
+          this.showSaveDialog(params);
+        } else {
+          console.log('error submit!!');
+          return false;
+        }
+      });
+    },
+    // 建立关联-映射关系是否已存在
+    showSaveDialog(params) {
+      this.saveDisable = true; //提交保存按钮不可点击,返回结果时才可点击,防止频繁发送请求
+      api
+        .tcmIsExistRecord(params)
+        .then(res => {
+          if (!res.data.data) {
+            // 不存在,创建新的关联
+            // 如果是编辑时,需要携带id
+            if (this.isEdit) {
+              params = { ...params, id: this.editId };
+            }
+            this.saveLisMapping(params, '保存成功', 'success');
+          } else {
+            // 已存在,提示修改
+            this.warning('该条关联已存在,无法添加');
+            this.saveDisable = false;
+          }
+        })
+        .catch(err => {
+          if (err.code === '900010001') {
+            return false;
+          }
+          this.warning(err);
+        });
+    },
+
+    // 映射关系不存在-建立关联
+    saveLisMapping(params, msg, type) {
+      api.saveOrUpdateRecordTcm(params).then(res => {
+        if (res.data.code === '0') {
+          this.warning(res.data.msg || msg, type);
+          this.initForm();
+          this.$router.push({
+            name: 'Tcmdisease',
+            params: Object.assign({}, this.$route.params, {
+              currentPage: 1
+            })
+          });
+        } else {
+          this.warning(res.data.msg);
+        }
+        this.saveDisable = false;
+      });
+    },
+    // 关联已存在模态框
+    showConfirmDialog(msg, resolve) {
+      this.$confirm(msg, '提示', {
+        customClass: 'confirmRealation',
+        confirmButtonText: '是',
+        cancelButtonText: '否',
+        cancelButtonClass: 'cancelButton',
+        type: 'warning'
+      })
+        .then(() => {
+          resolve();
+        })
+        .catch(() => {
+          this.saveDisable = false;
+          this.warning('建立失败', 'error');
+        });
+    },
+    warning(msg, type) {
+      this.$message({
+        showClose: true,
+        message: msg,
+        type: type || 'warning'
+      });
+    }
+  }
+};
+</script>
+<style lang="less">
+.AddChemicalAndCommonMappingWrapper {
+  .AddChemicalAndCommonMappingBox {
+    min-width: 940px;
+  }
+  color: #606266;
+  .topBack {
+    top: 0;
+  }
+  .titleBox {
+    padding: 0 0 10px 0px;
+  }
+  .title {
+    width: 50%;
+    float: left;
+    font-size: 14px;
+  }
+  .AddChemicalAndCommonMappingBox {
+    padding: 20px 30px 20px 30px;
+    margin: 70px 20px 0 20px;
+    background: #fff;
+  }
+  .leftBox,
+  .midBox,
+  .rightBox {
+    width: 40%;
+    float: left;
+    min-height: 200px;
+    font-size: 14px;
+  }
+  .midBox {
+    width: 6%;
+    padding: 50px 0 0 0;
+    text-align: center;
+  }
+  .midTitle {
+    width: 40px;
+    margin: 0 auto;
+  }
+  .midLogo {
+    margin: 0 auto;
+  }
+  .leftBox,
+  .rightBox {
+    border: 1px solid #dcdfe6;
+    padding: 20px 20px;
+  }
+  .itemLabel {
+    width: 100%;
+    min-height: 50px;
+    line-height: 50px;
+    position: relative;
+  }
+  .itemLabelName,
+  .searchInput,
+  .searchName {
+    float: left;
+    color: #606266;
+  }
+  .itemLabelName {
+    width: 150px;
+  }
+  .isRequired::before {
+    content: '*';
+    color: red;
+  }
+  .searchInput,
+  .mealNameItem {
+    padding: 0 5px;
+  }
+  .searchInput,
+  .searchName {
+    display: inline-block;
+    height: 32px;
+    line-height: 32px;
+    border: 1px solid #a9a9a9;
+    margin: 8px 0 0 0;
+  }
+
+  .searchName {
+    text-align: center;
+    border-left: none;
+    cursor: pointer;
+    padding: 0 12px;
+    font-size: 16px;
+  }
+  .itemList {
+    position: absolute;
+    background: #fff;
+    width: 162px;
+    max-height: 150px;
+    border: 1px solid #a9a9a9;
+    left: 150px;
+    top: 42px;
+    z-index: 2;
+    overflow-y: auto;
+  }
+  .itemList {
+    width: calc(100% - 131px);
+  }
+  .mealNameItem {
+    height: 30px;
+    line-height: 30px;
+    font-size: 14px;
+    cursor: pointer;
+  }
+  .mealNameItem:hover {
+    background: #f5f7fa;
+  }
+  // .selectItemName {
+  //   padding-left: 4px;
+  //   display: inline-block;
+  //   margin-top: 8px;
+  //   // width: calc(100% - 160px);s
+  //   line-height: 24px;
+  //   overflow: hidden;
+  //   word-wrap: break-word;
+  //   word-break: break-all;
+  // }
+  .previewInfo {
+    padding-left: 4px;
+    display: inline-block;
+    margin-top: 8px;
+    // width: calc(100% - 160px);s
+    line-height: 24px;
+    overflow: hidden;
+    word-wrap: break-word;
+    word-break: break-all;
+  }
+  .btn {
+    position: relative;
+    background-color: #fff;
+    margin: 0px 20px;
+    padding: 20px;
+    min-width: 960px;
+    height: 80px;
+    .el-button {
+      position: absolute;
+      right: 80px;
+      top: 20px;
+    }
+  }
+  .sumbit {
+    position: absolute;
+    display: inline-block;
+    width: 80px;
+    height: 30px;
+    line-height: 30px;
+    border: 1px solid #a9a9a9;
+    text-align: center;
+    right: 100px;
+  }
+}
+.confirmRealation {
+  .cancelButton {
+    border: 1px solid #a9a9a9;
+    span {
+      color: #606266;
+    }
+  }
+}
+body {
+  .el-select-dropdown {
+    /deep/ .el-select-dropdown__item {
+      span {
+        color: #333;
+      }
+    }
+    ul {
+      max-width: 300px;
+    }
+
+    /deep/ .el-scrollbar {
+      border: 1px solid #dcdfe6;
+    }
+    /deep/ .popper__arrow {
+      border-bottom-color: #a5a5a5 !important;
+    }
+  }
+  /deep/ .el-popper[x-placement^='bottom'] {
+    margin-top: 8px !important;
+  }
+}
+</style>

+ 531 - 0
src/components/cdssManage/tcmdisease/tcmdisease.vue

@@ -0,0 +1,531 @@
+<template>
+  <div>
+    <crumbs :title="title + hospitaiName" linkTo="MedicalTermCDSS">
+      <el-form :inline="true" class="demo-form-inline">
+        <el-form-item style="marginBottom: 0px">
+          <el-button type="text" class="downTemplate" @click="exportModule">导入模板下载</el-button>
+          <input type="file" name="uploadfile " id="upFile" @change="uploadFile($event)" />
+          <el-button size="mini" @click="importPage">{{uploadInfo}}</el-button>
+          <input type="file" name="uploadfile " id="upFileMatch" @change="uploadFileMatch($event)" />
+          <el-button size="mini" @click="handleMatchData" style="marginLeft: 10px">预匹配</el-button>
+          <el-button size="mini" @click="exportData">导出</el-button>
+        </el-form-item>
+      </el-form>
+    </crumbs>
+    <div class="searchBar">
+      <div class="searchContent">
+        <el-form :inline="true" class="demo-form-inline">
+          <el-form-item label="医院中医疾病名称:">
+            <el-input size="mini" v-model="filter.hisName" placeholder="请输入" clearable></el-input>
+          </el-form-item>
+          <el-form-item label="标准中医疾病名称:">
+            <el-input size="mini" v-model="filter.uniqueName" placeholder="请输入" clearable></el-input>
+          </el-form-item>
+          <el-form-item class="dododo">
+            <el-button size="mini" @click="filterDatas">检索</el-button>
+            <el-button size="mini" type="warning" @click="addRelation">添加关联</el-button>
+          </el-form-item>
+        </el-form>
+      </div>
+    </div>
+    <div class="contentsOther">
+      <el-table :data="list" border style="width: 100%">
+        <el-table-column :resizable="false" type="index" :index="indexMethod" label="编号" width="80"></el-table-column>
+        <el-table-column :resizable="false" prop="gmtModified" label="操作时间" width="180"></el-table-column>
+        <el-table-column :resizable="false" prop="hisName" label="医院中医疾病名称" show-overflow-tooltip></el-table-column>
+        <el-table-column :resizable="false" prop="uniqueCode" label="中医疾病代码" show-overflow-tooltip></el-table-column>
+        <el-table-column :resizable="false" prop="uniqueName" label="标准中医疾病名称" show-overflow-tooltip></el-table-column>
+        <el-table-column :resizable="false" prop="operate" label="操作">
+          <template slot-scope="scope">
+            <el-button @click="modifyRelation(scope.row)" type="text" size="small">修改</el-button>
+            <span style="margin:0 3px;">|</span>
+            <el-button
+              @click="showDelDialog(scope.row.id)"
+              class="delete"
+              type="text"
+              size="small"
+            >删除</el-button>
+          </template>
+        </el-table-column>
+      </el-table>
+      <div class="pagination pagepage">
+        <el-pagination
+          :current-page.sync="currentPage"
+          @current-change="currentChange"
+          background
+          :page-size="pageSize"
+          :page-sizes="pageSizeArr"
+          @size-change="handleSizeChange"
+          :layout="pageLayout"
+          :total="total"
+        ></el-pagination>
+      </div>
+    </div>
+  </div>
+</template>
+
+<script>
+import api from '@api/cdss.js';
+import config from '@api/config.js';
+import utils from '@api/utils.js';
+
+export default {
+  name: 'Tcmdisease', //化验大小项和公表维护
+  data: function() {
+    return {
+      list: [],
+      searched: false,
+      filter: {
+        hisName: '', // 医院诊断名称
+        uniqueName: '' //标准诊断名称
+      },
+      currentPage: 1,
+      pageSize: config.pageSize,
+      pageSizeArr: config.pageSizeArr,
+      pageLayout: config.pageLayout,
+      total: 0,
+      uploadInfo: '导入',
+      title: '中医疾病关联维护 | ',
+      hospitaiName: '',
+      hospitalId: ''
+    };
+  },
+  created() {
+    const { data } = this.$route.params;
+    this.hospitaiName = (data && data.name) || '';
+    this.hospitalId = data && data.hospitalId;
+    const that = this;
+    //返回时避免参数未赋值就获取列表
+    setTimeout(function() {
+      that.getDataList();
+    });
+    // 非首页 编辑页返回 设置 this.currentPage
+    if (Object.keys(this.$route.params).length !== 0) {
+      this.currentPage = this.$route.params.currentPage;
+    }
+  },
+  watch: {
+    filter: {
+      handler: function() {
+        this.searched = false;
+      },
+      deep: true
+    }
+  },
+  beforeRouteEnter(to, from, next) {
+    next(vm => {
+      //const pm = to.param;
+      Object.assign(vm, to.params);
+      vm.inCurrentPage = to.params.currentPage;
+    });
+  },
+  methods: {
+    // 预匹配
+    handleMatchData() {
+      let inp = document.getElementById('upFileMatch');
+      inp.click();
+    },
+    // 导入数据
+    uploadFileMatch(e) {
+      let fileInfo = e.target.files[0];
+      e.preventDefault();
+      let formData = new FormData();
+      formData.append('file', fileInfo);
+      const header = {
+        headers: {
+          'Content-Type': 'multipart/form-data'
+        }
+      };
+      const loading = this.$loading({
+        lock: true,
+        text: '预匹配中...',
+        spinner: 'el-icon-loading',
+        background: 'rgba(0, 0, 0, 0.7)'
+      });
+      api.dataTcmVerify(formData, header).then(res => {
+        if (res.data.code === '00020007') {
+          loading.close();
+          this.$alert(`${res.data.msg}`, '提示', {
+            confirmButtonText: '确定',
+            type: 'warning'
+          })
+            .then(() => {})
+            .catch(() => {});
+        } else {
+          api.precTcmDataMatch(formData, header).then(res => {
+            setTimeout(() => {
+              loading.close();
+            }, 800);
+            if (res.status === 200) {
+              utils.downloadExportedData(
+                res.data,
+                '中医疾病关联数据(预匹配).xls'
+              );
+            }
+          });
+        }
+      });
+
+      let inp = document.getElementById('upFileMatch');
+      inp.value = '';
+    },
+    handleSizeChange(val) {
+      this.pageSize = val;
+      this.currentPage = utils.getCurrentPage(
+        this.currentPage,
+        this.total,
+        this.pageSize
+      );
+      this.getDataList();
+    },
+
+    // 获取列表数据
+    getDataList(isTurnPage) {
+      const params = this.getFilterItems(isTurnPage);
+      this.searched = true;
+      const loading = this.$loading({
+        lock: true,
+        text: 'Loading',
+        spinner: 'el-icon-loading',
+        background: 'rgba(0, 0, 0, 0.7)'
+      });
+      api.getTcmdiseasePage(params).then(res => {
+        loading.close();
+        if (res.data.code === '0') {
+          this.list = res.data.data && res.data.data.records;
+        }
+        this.total = res.data.data && res.data.data.total;
+        if (this.inCurrentPage !== undefined) {
+          this.currentPage = this.inCurrentPage;
+          this.inCurrentPage = undefined;
+        }
+      });
+    },
+
+    // 处理列表请求数据参数
+    getFilterItems(isTurnPage) {
+      const { data } = this.$route.params;
+      //翻页时筛选条件没点确定则清空
+      if (isTurnPage && !this.searched) {
+        this.clearFilter();
+      }
+      const param = {
+        current: this.inCurrentPage || this.currentPage,
+        size: this.pageSize,
+        hisName: this.filter.hisName.trim(),
+        uniqueName: this.filter.uniqueName.trim(),
+        uniqueCode: '',
+        hospitalId: data && data.hospitalId
+      };
+      return param;
+    },
+
+    filterDatas() {
+      this.currentPage = 1;
+      this.getDataList();
+    },
+    addRelation() {
+      console.log(11)
+      const pam = this.searched
+        ? {
+            currentPage: this.currentPage,
+            pageSize: this.pageSize,
+            filter: this.filter
+          }
+        : { currentPage: this.currentPage, pageSize: this.pageSize };
+      this.$router.push({
+        name: 'AddTcmdisease',
+        params: Object.assign(pam, {
+          isEdit: false,
+          data: { hospitalId: this.hospitalId },
+          hospitaiName: this.hospitaiName
+        })
+      });
+    },
+    // 修改诊断关联-跳转至编辑页面
+    modifyRelation(row) {
+      const item = Object.assign({}, row);
+      const pam = this.searched
+        ? {
+            currentPage: this.currentPage,
+            pageSize: this.pageSize,
+            filter: this.filter
+          }
+        : { currentPage: this.currentPage, pageSize: this.pageSize };
+      this.$router.push({
+        name: 'AddTcmdisease',
+        params: Object.assign(pam, {
+          isEdit: true,
+          data: { ...item, hospitalId: this.hospitalId },
+          hospitaiName: this.hospitaiName
+        })
+      });
+    },
+    currentChange(next) {
+      this.currentPage = next;
+      this.getDataList(true);
+      // if (this.cacheData[next]) {       //如果已请求过该页数据,则使用缓存不重复请求
+      //     this.list = this.cacheData[next];
+      // } else {
+      //     this.getDataList();
+      // }
+    },
+    // 清空搜索参数
+    clearFilter() {
+      this.filter = {
+        hisName: '',
+        uniqueName: ''
+      };
+    },
+
+    indexMethod(index) {
+      return (this.currentPage - 1) * this.pageSize + index + 1;
+    },
+    getTagType(val) {
+      return val;
+    },
+    warning(msg, type) {
+      this.$message({
+        showClose: true,
+        message: msg,
+        type: type || 'warning'
+      });
+    },
+    showConfirmDialog(msg, resolve) {
+      this.$alert(msg, '提示', {
+        confirmButtonText: '删除',
+        // cancelButtonText: '取消',
+        // cancelButtonClass: 'cancelBtn',
+        // confirmButtonClass: 'confirmC',
+        type: 'warning'
+      })
+        .then(() => {
+          resolve();
+        })
+        .catch(() => {});
+    },
+    // 删除关联
+    showDelDialog(id) {
+      this.showConfirmDialog('是否删除该关联?', () => {
+        api
+          .deleteTcmRecord({ id: id })
+          .then(res => {
+            if (res.data.code == '0') {
+              if (!this.searched) {
+                //未点确认时清空搜索条件
+                this.clearFilter();
+              }
+              if (this.list.length == 1) {
+                //当前在最后一页且只有一条数据时,删除后跳到前一页
+                this.currentPage =
+                  this.currentPage === 1 ? 1 : this.currentPage - 1;
+              }
+              this.getDataList();
+              this.warning(res.data.msg || '操作成功', 'success');
+            } else {
+              this.warning(res.data.msg);
+            }
+          })
+          .catch(error => {
+            if (error.code === '900010001') {
+              return false;
+            }
+            this.warning(error);
+          });
+      });
+    },
+
+    // 导出数据
+    exportData() {
+      this.$alert('确定要导出全部中医疾病关联数据吗?', '', {
+        confirmButtonText: '确定',
+        // cancelButtonText: '取消',
+        // cancelButtonClass: 'leftbtn',
+        // customClass: 'exportBox6',
+        title: '提示',
+        type: 'warning'
+        // beforeClose: (action, instance, done) => {
+        //   if (action === 'confirm') {
+        //     // instance.confirmButtonLoading = true;
+        //     instance.confirmButtonText = '导出中...';
+        //     api.exportFusionRecord().then(res => {
+        //       if (res.status === 200) {
+        //         setTimeout(() => {
+        //           utils.downloadExportedData(res.data, '输血关联数据.xls');
+        //           done();
+        //         }, 1500);
+        //       }
+        //     });
+        //   } else {
+        //     done();
+        //   }
+        // }
+      })
+        .then(() => {
+          api.exportTcmRecord({ hospitalId: this.hospitalId }).then(res => {
+            if (res.status === 200) {
+              this.$message({ message: '导出成功', type: 'success' });
+              utils.downloadExportedData(res.data, '中医疾病关联数据.xls');
+            }
+          });
+        })
+        .catch(() => {
+          // this.$message({ message: '导出失败', type: 'waring' });
+        });
+    },
+    // 导入模板
+    exportModule() {
+      api.exportTcmModule().then(res => {
+        if (res.status === 200) {
+          setTimeout(() => {
+            utils.downloadExportedData(res.data, '中医疾病导入模板.xls');
+          }, 1500);
+        }
+      });
+    },
+
+    // 点击导入
+    importPage() {
+      let inp = document.getElementById('upFile');
+      inp.click();
+    },
+    // 导入数据
+    uploadFile(e) {
+      let fileInfo = e.target.files[0];
+      e.preventDefault();
+      let formData = new FormData();
+      formData.append('file', fileInfo);
+      formData.append('hospitalId', this.hospitalId);
+      const header = {
+        headers: {
+          'Content-Type': 'multipart/form-data'
+        }
+      };
+      this.uploadInfo = '导入中...';
+      api.importTcmRecord(formData, header).then(res => {
+        if (res.data.code === '00000001') {
+          this.$alert(`数据存在异常,导入失败,请修改后再试`, '提示', {
+            confirmButtonText: '确定',
+            // cancelButtonText: '取消',
+            // cancelButtonClass: 'cancelSure',
+            // confirmButtonClass: 'sure',
+            // customClass: 'exportConfirm',
+            type: 'warning'
+          })
+            .then(() => {})
+            .catch(() => {});
+          this.getDataList(); // 重新获取列表
+          setTimeout(() => {
+            this.uploadInfo = '导入';
+          }, 300);
+        } else if (res.data === '' && res.status === 200) {
+          this.$alert(`导入成功`, '提示', {
+            confirmButtonText: '确定',
+            // cancelButtonText: '取消',
+            // cancelButtonClass: 'cancelSure',
+            // confirmButtonClass: 'sure',
+            // customClass: 'exportConfirm',
+            type: 'success'
+          })
+            .then(() => {})
+            .catch(() => {});
+          this.getDataList(); // 重新获取列表
+          setTimeout(() => {
+            this.uploadInfo = '导入';
+          }, 300);
+        } else {
+          this.$alert(`${res.data.msg}`, '提示', {
+            confirmButtonText: '确定',
+            // cancelButtonText: '取消',
+            // cancelButtonClass: 'cancelSure',
+            // confirmButtonClass: 'sure',
+            // customClass: 'exportConfirm',
+            type: 'warning'
+          })
+            .then(() => {})
+            .catch(() => {});
+
+          setTimeout(() => {
+            this.uploadInfo = '导入';
+          }, 300);
+        }
+      });
+      //解决上传相同文件不触发change
+      let inp = document.getElementById('upFile');
+      inp.value = '';
+    }
+  }
+};
+</script>
+
+
+<style lang="less" scoped>
+@import '../../../less/admin.less';
+.delete {
+  color: red;
+}
+.delete:hover {
+  color: red;
+}
+.pagination {
+  min-width: 1010px;
+}
+.downTemplate {
+  margin-right: 8px;
+  span {
+    color: #02a7f0;
+  }
+}
+#upFile {
+  display: none !important;
+}
+#upFileMatch {
+  display: none;
+}
+.el-message-box {
+  /deep/.cancelBtn {
+    background-color: #d7d7d7;
+    border-color: transparent;
+  }
+  /deep/.confirmC {
+    background-color: #ff545b !important;
+    border-color: transparent !important;
+  }
+}
+.exportBox6 {
+  /deep/ .el-message-box__btns {
+    margin-top: 20px;
+  }
+  /deep/ .el-message-box__message {
+    // text-align: center;
+  }
+  /deep/.leftbtn {
+    background-color: #d7d7d7;
+    border-color: transparent !important;
+  }
+  /deep/ .el-message-box__header {
+    border-bottom: 1px solid #dcdfe6;
+  }
+}
+.searchBar {
+  min-width: 980px;
+  height: 60px;
+  display: flex;
+  justify-content: center;
+  align-items: center;
+  background-color: #dee2ea;
+  z-index: 9999;
+  padding: 40px 20px 0;
+  .searchContent {
+    height: 40px;
+    flex: 1;
+    background-color: #fff;
+    display: flex;
+    justify-content: flex-end;
+    float: right;
+  }
+}
+.contentsOther {
+  padding: 0 20px;
+}
+</style>

+ 436 - 0
src/components/cdssManage/tcmdrome/AddTcmdrome.vue

@@ -0,0 +1,436 @@
+<template>
+  <div class="AddChemicalAndCommonMappingWrapper clearfix">
+    <crumbs
+      :title="isEdit ? '中医证候关联维护--修改关联' : '中医证候关联维护--添加关联'"
+      class="topBack"
+      :param="$route.params"
+      linkTo="Tcmdrome"
+    ></crumbs>
+    <el-form
+      :model="form"
+      :rules="rules"
+      label-position="right"
+      label-width="140px"
+      ref="relationForm"
+    >
+      <div class="AddChemicalAndCommonMappingBox clearfix">
+        <div class="titleBox clearfix">
+          <p class="title">医院术语</p>
+          <p class="title">标准术语</p>
+        </div>
+        <div class="leftBox clearfix">
+          <el-row>
+            <el-col :span="16">
+              <el-form-item label="中医证候名称:" prop="hisName">
+                <el-input v-model="form.hisName" clearable style="minWidth: 240px"></el-input>
+              </el-form-item>
+              <el-form-item label="中医证候名称预览:">
+                <span class="previewInfo" style="minWidth: 240px">{{form.hisName}}</span>
+              </el-form-item>
+            </el-col>
+          </el-row>
+        </div>
+        <div class="midBox">
+          <img class="midLogo" src="../../../images/relation.png" alt />
+          <p class="midTitle">相互关联</p>
+        </div>
+        <div class="rightBox">
+          <el-row>
+            <el-col :span="16">
+              <el-form-item label="中医证候名称:" prop="searchText">
+                <el-select
+                  style="width:100%; minWidth: 240px"
+                  v-model="form.searchText"
+                  filterable
+                  remote
+                  clearable
+                  :loading="showDrop"
+                  loading-text="加载中..."
+                  @change="changeWord"
+                  @visible-change="handleVisible"
+                  placeholder="搜索"
+                  :remote-method="searchTerms"
+                  reserve-keyword
+                >
+                  <el-option
+                    v-for="(item,idx) in uniqueNameList"
+                    :key="idx"
+                    :label="item.name"
+                    :value="item"
+                    :title="item.name"
+                  ></el-option>
+                </el-select>
+              </el-form-item>
+              <el-form-item label="中医证候名称预览:">
+                <span class="previewInfo" style="minWidth: 240px">{{form.searchText}}</span>
+              </el-form-item>
+              <el-form-item label="中医证候代码:">
+                <span class="previewInfo" style="minWidth: 240px">{{form.uniqueCode}}</span>
+              </el-form-item>
+            </el-col>
+          </el-row>
+        </div>
+      </div>
+      <div class="btn">
+        <el-form-item>
+          <el-button type="primary" :disabled="saveDisable" @click="submitForm">确定</el-button>
+        </el-form-item>
+      </div>
+    </el-form>
+  </div>
+</template>
+<script>
+import api from '@api/cdss.js';
+export default {
+  name: 'AddTcmdrome',
+  data() {
+    return {
+      isEdit: false,
+      editId: '',
+      uniqueNameList: [],
+      form: {
+        searchText: '', //搜索字段
+        hisName: '',
+        uniqueCode: ''
+      },
+      rules: {
+        hisName: [
+          { required: true, message: '请输入中医证候名称', trigger: 'change' },
+          { max: 80, message: '中医证候名称最多80字', trigger: 'change' }
+        ],
+        searchText: [
+          { required: true, message: '请选择中医证候名称', trigger: 'change' }
+        ]
+      },
+      saveDisable: false, //保存按钮禁止点击
+      showDrop: false, //下拉框显示文字
+      searchInfo: ''
+    };
+  },
+  created() {
+    //修改
+    const { isEdit, data, hospitaiName } = this.$route.params;
+    this.hospitaiName = hospitaiName;
+    this.hospitalId = data && data.hospitalId;
+    if (isEdit) {
+      console.log(data)
+      this.isEdit = isEdit;
+      this.editId = data.id;
+      this.form.hisName = data.hisName;
+      this.form.searchText = data.uniqueName;
+      this.form.uniqueCode = data.uniqueCode;
+    }
+  },
+  methods: {
+    // 搜索列表
+    searchTerms(query) {
+      if (!query) {
+        this.uniqueNameList = [];
+        return;
+      }
+      this.searchInfo = query;
+      this.showDrop = true;
+      let params = {
+        type: 13, //中医证候
+        inputStr: query,
+        sex: 3,
+        age: 0
+      };
+      api.retrievalSearch(params).then(res => {
+        this.showDrop = false;
+        if (res.data.code === '0') {
+          this.uniqueNameList = res.data.data.tcmsyndromeNames;
+        }
+      });
+    },
+    changeWord(newVal) {
+      this.form.searchText = newVal.name
+      this.form.uniqueCode = newVal.code
+    },
+    handleVisible(flag) {
+      if (!flag) {
+        this.uniqueNameList = [];
+      }
+    },
+
+    // 初始化表单数据
+    initForm() {
+      this.form.hisName = '';
+      this.form.searchText = '';
+      this.form.uniqueCode = '';
+    },
+
+    // 建立关联-参数处理
+    submitForm() {
+      this.$refs.relationForm.validate(valid => {
+        if (valid) {
+          const { searchText, hisName, uniqueCode } = this.form;
+          let params = {
+            hisName: hisName,
+            uniqueName: searchText,
+            uniqueCode: uniqueCode,
+            hospitalId: this.hospitalId
+          };
+          this.showSaveDialog(params);
+        } else {
+          console.log('error submit!!');
+          return false;
+        }
+      });
+    },
+    // 建立关联-映射关系是否已存在
+    showSaveDialog(params) {
+      this.saveDisable = true; //提交保存按钮不可点击,返回结果时才可点击,防止频繁发送请求
+      api
+        .tcmdromeIsExistRecord(params)
+        .then(res => {
+          if (!res.data.data) {
+            // 不存在,创建新的关联
+            // 如果是编辑时,需要携带id
+            if (this.isEdit) {
+              params = { ...params, id: this.editId };
+            }
+            this.saveLisMapping(params, '保存成功', 'success');
+          } else {
+            // 已存在,提示修改
+            this.warning('该条关联已存在,无法添加');
+            this.saveDisable = false;
+          }
+        })
+        .catch(err => {
+          if (err.code === '900010001') {
+            return false;
+          }
+          this.warning(err);
+        });
+    },
+
+    // 映射关系不存在-建立关联
+    saveLisMapping(params, msg, type) {
+      api.saveOrUpdateRecordTcmdrome(params).then(res => {
+        if (res.data.code === '0') {
+          this.warning(res.data.msg || msg, type);
+          this.initForm();
+          this.$router.push({
+            name: 'Tcmdrome',
+            params: Object.assign({}, this.$route.params, {
+              currentPage: 1
+            })
+          });
+        } else {
+          this.warning(res.data.msg);
+        }
+        this.saveDisable = false;
+      });
+    },
+    // 关联已存在模态框
+    showConfirmDialog(msg, resolve) {
+      this.$confirm(msg, '提示', {
+        customClass: 'confirmRealation',
+        confirmButtonText: '是',
+        cancelButtonText: '否',
+        cancelButtonClass: 'cancelButton',
+        type: 'warning'
+      })
+        .then(() => {
+          resolve();
+        })
+        .catch(() => {
+          this.saveDisable = false;
+          this.warning('建立失败', 'error');
+        });
+    },
+    warning(msg, type) {
+      this.$message({
+        showClose: true,
+        message: msg,
+        type: type || 'warning'
+      });
+    }
+  }
+};
+</script>
+<style lang="less">
+.AddChemicalAndCommonMappingWrapper {
+  .AddChemicalAndCommonMappingBox {
+    min-width: 940px;
+  }
+  color: #606266;
+  .topBack {
+    top: 0;
+  }
+  .titleBox {
+    padding: 0 0 10px 0px;
+  }
+  .title {
+    width: 50%;
+    float: left;
+    font-size: 14px;
+  }
+  .AddChemicalAndCommonMappingBox {
+    padding: 20px 30px 20px 30px;
+    margin: 70px 20px 0 20px;
+    background: #fff;
+  }
+  .leftBox,
+  .midBox,
+  .rightBox {
+    width: 40%;
+    float: left;
+    min-height: 200px;
+    font-size: 14px;
+  }
+  .midBox {
+    width: 6%;
+    padding: 50px 0 0 0;
+    text-align: center;
+  }
+  .midTitle {
+    width: 40px;
+    margin: 0 auto;
+  }
+  .midLogo {
+    margin: 0 auto;
+  }
+  .leftBox,
+  .rightBox {
+    border: 1px solid #dcdfe6;
+    padding: 20px 20px;
+  }
+  .itemLabel {
+    width: 100%;
+    min-height: 50px;
+    line-height: 50px;
+    position: relative;
+  }
+  .itemLabelName,
+  .searchInput,
+  .searchName {
+    float: left;
+    color: #606266;
+  }
+  .itemLabelName {
+    width: 150px;
+  }
+  .isRequired::before {
+    content: '*';
+    color: red;
+  }
+  .searchInput,
+  .mealNameItem {
+    padding: 0 5px;
+  }
+  .searchInput,
+  .searchName {
+    display: inline-block;
+    height: 32px;
+    line-height: 32px;
+    border: 1px solid #a9a9a9;
+    margin: 8px 0 0 0;
+  }
+
+  .searchName {
+    text-align: center;
+    border-left: none;
+    cursor: pointer;
+    padding: 0 12px;
+    font-size: 16px;
+  }
+  .itemList {
+    position: absolute;
+    background: #fff;
+    width: 162px;
+    max-height: 150px;
+    border: 1px solid #a9a9a9;
+    left: 150px;
+    top: 42px;
+    z-index: 2;
+    overflow-y: auto;
+  }
+  .itemList {
+    width: calc(100% - 131px);
+  }
+  .mealNameItem {
+    height: 30px;
+    line-height: 30px;
+    font-size: 14px;
+    cursor: pointer;
+  }
+  .mealNameItem:hover {
+    background: #f5f7fa;
+  }
+  // .selectItemName {
+  //   padding-left: 4px;
+  //   display: inline-block;
+  //   margin-top: 8px;
+  //   // width: calc(100% - 160px);s
+  //   line-height: 24px;
+  //   overflow: hidden;
+  //   word-wrap: break-word;
+  //   word-break: break-all;
+  // }
+  .previewInfo {
+    padding-left: 4px;
+    display: inline-block;
+    margin-top: 8px;
+    // width: calc(100% - 160px);s
+    line-height: 24px;
+    overflow: hidden;
+    word-wrap: break-word;
+    word-break: break-all;
+  }
+  .btn {
+    position: relative;
+    background-color: #fff;
+    margin: 0px 20px;
+    padding: 20px;
+    min-width: 960px;
+    height: 80px;
+    .el-button {
+      position: absolute;
+      right: 80px;
+      top: 20px;
+    }
+  }
+  .sumbit {
+    position: absolute;
+    display: inline-block;
+    width: 80px;
+    height: 30px;
+    line-height: 30px;
+    border: 1px solid #a9a9a9;
+    text-align: center;
+    right: 100px;
+  }
+}
+.confirmRealation {
+  .cancelButton {
+    border: 1px solid #a9a9a9;
+    span {
+      color: #606266;
+    }
+  }
+}
+body {
+  .el-select-dropdown {
+    /deep/ .el-select-dropdown__item {
+      span {
+        color: #333;
+      }
+    }
+    ul {
+      max-width: 300px;
+    }
+
+    /deep/ .el-scrollbar {
+      border: 1px solid #dcdfe6;
+    }
+    /deep/ .popper__arrow {
+      border-bottom-color: #a5a5a5 !important;
+    }
+  }
+  /deep/ .el-popper[x-placement^='bottom'] {
+    margin-top: 8px !important;
+  }
+}
+</style>

+ 531 - 0
src/components/cdssManage/tcmdrome/tcmdrome.vue

@@ -0,0 +1,531 @@
+<template>
+  <div>
+    <crumbs :title="title + hospitaiName" linkTo="MedicalTermCDSS">
+      <el-form :inline="true" class="demo-form-inline">
+        <el-form-item style="marginBottom: 0px">
+          <el-button type="text" class="downTemplate" @click="exportModule">导入模板下载</el-button>
+          <input type="file" name="uploadfile " id="upFile" @change="uploadFile($event)" />
+          <el-button size="mini" @click="importPage">{{uploadInfo}}</el-button>
+          <input type="file" name="uploadfile " id="upFileMatch" @change="uploadFileMatch($event)" />
+          <el-button size="mini" @click="handleMatchData" style="marginLeft: 10px">预匹配</el-button>
+          <el-button size="mini" @click="exportData">导出</el-button>
+        </el-form-item>
+      </el-form>
+    </crumbs>
+    <div class="searchBar">
+      <div class="searchContent">
+        <el-form :inline="true" class="demo-form-inline">
+          <el-form-item label="医院中医证候名称:">
+            <el-input size="mini" v-model="filter.hisName" placeholder="请输入" clearable></el-input>
+          </el-form-item>
+          <el-form-item label="标准中医证候名称:">
+            <el-input size="mini" v-model="filter.uniqueName" placeholder="请输入" clearable></el-input>
+          </el-form-item>
+          <el-form-item class="dododo">
+            <el-button size="mini" @click="filterDatas">检索</el-button>
+            <el-button size="mini" type="warning" @click="addRelation">添加关联</el-button>
+          </el-form-item>
+        </el-form>
+      </div>
+    </div>
+    <div class="contentsOther">
+      <el-table :data="list" border style="width: 100%">
+        <el-table-column :resizable="false" type="index" :index="indexMethod" label="编号" width="80"></el-table-column>
+        <el-table-column :resizable="false" prop="gmtModified" label="操作时间" width="180"></el-table-column>
+        <el-table-column :resizable="false" prop="hisName" label="医院中医证候名称" show-overflow-tooltip></el-table-column>
+        <el-table-column :resizable="false" prop="uniqueCode" label="中医证候代码" show-overflow-tooltip></el-table-column>
+        <el-table-column :resizable="false" prop="uniqueName" label="标准中医证候名称" show-overflow-tooltip></el-table-column>
+        <el-table-column :resizable="false" prop="operate" label="操作">
+          <template slot-scope="scope">
+            <el-button @click="modifyRelation(scope.row)" type="text" size="small">修改</el-button>
+            <span style="margin:0 3px;">|</span>
+            <el-button
+              @click="showDelDialog(scope.row.id)"
+              class="delete"
+              type="text"
+              size="small"
+            >删除</el-button>
+          </template>
+        </el-table-column>
+      </el-table>
+      <div class="pagination pagepage">
+        <el-pagination
+          :current-page.sync="currentPage"
+          @current-change="currentChange"
+          background
+          :page-size="pageSize"
+          :page-sizes="pageSizeArr"
+          @size-change="handleSizeChange"
+          :layout="pageLayout"
+          :total="total"
+        ></el-pagination>
+      </div>
+    </div>
+  </div>
+</template>
+
+<script>
+import api from '@api/cdss.js';
+import config from '@api/config.js';
+import utils from '@api/utils.js';
+
+export default {
+  name: 'Tcmdrome', //化验大小项和公表维护
+  data: function() {
+    return {
+      list: [],
+      searched: false,
+      filter: {
+        hisName: '', // 医院诊断名称
+        uniqueName: '' //标准诊断名称
+      },
+      currentPage: 1,
+      pageSize: config.pageSize,
+      pageSizeArr: config.pageSizeArr,
+      pageLayout: config.pageLayout,
+      total: 0,
+      uploadInfo: '导入',
+      title: '中医证候关联维护 | ',
+      hospitaiName: '',
+      hospitalId: ''
+    };
+  },
+  created() {
+    const { data } = this.$route.params;
+    this.hospitaiName = (data && data.name) || '';
+    this.hospitalId = data && data.hospitalId;
+    const that = this;
+    //返回时避免参数未赋值就获取列表
+    setTimeout(function() {
+      that.getDataList();
+    });
+    // 非首页 编辑页返回 设置 this.currentPage
+    if (Object.keys(this.$route.params).length !== 0) {
+      this.currentPage = this.$route.params.currentPage;
+    }
+  },
+  watch: {
+    filter: {
+      handler: function() {
+        this.searched = false;
+      },
+      deep: true
+    }
+  },
+  beforeRouteEnter(to, from, next) {
+    next(vm => {
+      //const pm = to.param;
+      Object.assign(vm, to.params);
+      vm.inCurrentPage = to.params.currentPage;
+    });
+  },
+  methods: {
+    // 预匹配
+    handleMatchData() {
+      let inp = document.getElementById('upFileMatch');
+      inp.click();
+    },
+    // 导入数据
+    uploadFileMatch(e) {
+      let fileInfo = e.target.files[0];
+      e.preventDefault();
+      let formData = new FormData();
+      formData.append('file', fileInfo);
+      const header = {
+        headers: {
+          'Content-Type': 'multipart/form-data'
+        }
+      };
+      const loading = this.$loading({
+        lock: true,
+        text: '预匹配中...',
+        spinner: 'el-icon-loading',
+        background: 'rgba(0, 0, 0, 0.7)'
+      });
+      api.dataTcmdromeVerify(formData, header).then(res => {
+        if (res.data.code === '00020007') {
+          loading.close();
+          this.$alert(`${res.data.msg}`, '提示', {
+            confirmButtonText: '确定',
+            type: 'warning'
+          })
+            .then(() => {})
+            .catch(() => {});
+        } else {
+          api.precTcmdromeDataMatch(formData, header).then(res => {
+            setTimeout(() => {
+              loading.close();
+            }, 800);
+            if (res.status === 200) {
+              utils.downloadExportedData(
+                res.data,
+                '中医证候关联数据(预匹配).xls'
+              );
+            }
+          });
+        }
+      });
+
+      let inp = document.getElementById('upFileMatch');
+      inp.value = '';
+    },
+    handleSizeChange(val) {
+      this.pageSize = val;
+      this.currentPage = utils.getCurrentPage(
+        this.currentPage,
+        this.total,
+        this.pageSize
+      );
+      this.getDataList();
+    },
+
+    // 获取列表数据
+    getDataList(isTurnPage) {
+      const params = this.getFilterItems(isTurnPage);
+      this.searched = true;
+      const loading = this.$loading({
+        lock: true,
+        text: 'Loading',
+        spinner: 'el-icon-loading',
+        background: 'rgba(0, 0, 0, 0.7)'
+      });
+      api.getTcmsyndromePage(params).then(res => {
+        loading.close();
+        if (res.data.code === '0') {
+          this.list = res.data.data && res.data.data.records;
+        }
+        this.total = res.data.data && res.data.data.total;
+        if (this.inCurrentPage !== undefined) {
+          this.currentPage = this.inCurrentPage;
+          this.inCurrentPage = undefined;
+        }
+      });
+    },
+
+    // 处理列表请求数据参数
+    getFilterItems(isTurnPage) {
+      const { data } = this.$route.params;
+      //翻页时筛选条件没点确定则清空
+      if (isTurnPage && !this.searched) {
+        this.clearFilter();
+      }
+      const param = {
+        current: this.inCurrentPage || this.currentPage,
+        size: this.pageSize,
+        hisName: this.filter.hisName.trim(),
+        uniqueName: this.filter.uniqueName.trim(),
+        uniqueCode: '',
+        hospitalId: data && data.hospitalId
+      };
+      return param;
+    },
+
+    filterDatas() {
+      this.currentPage = 1;
+      this.getDataList();
+    },
+    addRelation() {
+      console.log(11)
+      const pam = this.searched
+        ? {
+            currentPage: this.currentPage,
+            pageSize: this.pageSize,
+            filter: this.filter
+          }
+        : { currentPage: this.currentPage, pageSize: this.pageSize };
+      this.$router.push({
+        name: 'AddTcmdrome',
+        params: Object.assign(pam, {
+          isEdit: false,
+          data: { hospitalId: this.hospitalId },
+          hospitaiName: this.hospitaiName
+        })
+      });
+    },
+    // 修改诊断关联-跳转至编辑页面
+    modifyRelation(row) {
+      const item = Object.assign({}, row);
+      const pam = this.searched
+        ? {
+            currentPage: this.currentPage,
+            pageSize: this.pageSize,
+            filter: this.filter
+          }
+        : { currentPage: this.currentPage, pageSize: this.pageSize };
+      this.$router.push({
+        name: 'AddTcmdrome',
+        params: Object.assign(pam, {
+          isEdit: true,
+          data: { ...item, hospitalId: this.hospitalId },
+          hospitaiName: this.hospitaiName
+        })
+      });
+    },
+    currentChange(next) {
+      this.currentPage = next;
+      this.getDataList(true);
+      // if (this.cacheData[next]) {       //如果已请求过该页数据,则使用缓存不重复请求
+      //     this.list = this.cacheData[next];
+      // } else {
+      //     this.getDataList();
+      // }
+    },
+    // 清空搜索参数
+    clearFilter() {
+      this.filter = {
+        hisName: '',
+        uniqueName: ''
+      };
+    },
+
+    indexMethod(index) {
+      return (this.currentPage - 1) * this.pageSize + index + 1;
+    },
+    getTagType(val) {
+      return val;
+    },
+    warning(msg, type) {
+      this.$message({
+        showClose: true,
+        message: msg,
+        type: type || 'warning'
+      });
+    },
+    showConfirmDialog(msg, resolve) {
+      this.$alert(msg, '提示', {
+        confirmButtonText: '删除',
+        // cancelButtonText: '取消',
+        // cancelButtonClass: 'cancelBtn',
+        // confirmButtonClass: 'confirmC',
+        type: 'warning'
+      })
+        .then(() => {
+          resolve();
+        })
+        .catch(() => {});
+    },
+    // 删除关联
+    showDelDialog(id) {
+      this.showConfirmDialog('是否删除该关联?', () => {
+        api
+          .deleteTcmdromeRecord({ id: id })
+          .then(res => {
+            if (res.data.code == '0') {
+              if (!this.searched) {
+                //未点确认时清空搜索条件
+                this.clearFilter();
+              }
+              if (this.list.length == 1) {
+                //当前在最后一页且只有一条数据时,删除后跳到前一页
+                this.currentPage =
+                  this.currentPage === 1 ? 1 : this.currentPage - 1;
+              }
+              this.getDataList();
+              this.warning(res.data.msg || '操作成功', 'success');
+            } else {
+              this.warning(res.data.msg);
+            }
+          })
+          .catch(error => {
+            if (error.code === '900010001') {
+              return false;
+            }
+            this.warning(error);
+          });
+      });
+    },
+
+    // 导出数据
+    exportData() {
+      this.$alert('确定要导出全部中医证候关联数据吗?', '', {
+        confirmButtonText: '确定',
+        // cancelButtonText: '取消',
+        // cancelButtonClass: 'leftbtn',
+        // customClass: 'exportBox6',
+        title: '提示',
+        type: 'warning'
+        // beforeClose: (action, instance, done) => {
+        //   if (action === 'confirm') {
+        //     // instance.confirmButtonLoading = true;
+        //     instance.confirmButtonText = '导出中...';
+        //     api.exportFusionRecord().then(res => {
+        //       if (res.status === 200) {
+        //         setTimeout(() => {
+        //           utils.downloadExportedData(res.data, '输血关联数据.xls');
+        //           done();
+        //         }, 1500);
+        //       }
+        //     });
+        //   } else {
+        //     done();
+        //   }
+        // }
+      })
+        .then(() => {
+          api.exportTcmdromeRecord({ hospitalId: this.hospitalId }).then(res => {
+            if (res.status === 200) {
+              this.$message({ message: '导出成功', type: 'success' });
+              utils.downloadExportedData(res.data, '中医证候关联数据.xls');
+            }
+          });
+        })
+        .catch(() => {
+          // this.$message({ message: '导出失败', type: 'waring' });
+        });
+    },
+    // 导入模板
+    exportModule() {
+      api.exportTcmdromeModule().then(res => {
+        if (res.status === 200) {
+          setTimeout(() => {
+            utils.downloadExportedData(res.data, '中医证候导入模板.xls');
+          }, 1500);
+        }
+      });
+    },
+
+    // 点击导入
+    importPage() {
+      let inp = document.getElementById('upFile');
+      inp.click();
+    },
+    // 导入数据
+    uploadFile(e) {
+      let fileInfo = e.target.files[0];
+      e.preventDefault();
+      let formData = new FormData();
+      formData.append('file', fileInfo);
+      formData.append('hospitalId', this.hospitalId);
+      const header = {
+        headers: {
+          'Content-Type': 'multipart/form-data'
+        }
+      };
+      this.uploadInfo = '导入中...';
+      api.importTcmdromeRecord(formData, header).then(res => {
+        if (res.data.code === '00000001') {
+          this.$alert(`数据存在异常,导入失败,请修改后再试`, '提示', {
+            confirmButtonText: '确定',
+            // cancelButtonText: '取消',
+            // cancelButtonClass: 'cancelSure',
+            // confirmButtonClass: 'sure',
+            // customClass: 'exportConfirm',
+            type: 'warning'
+          })
+            .then(() => {})
+            .catch(() => {});
+          this.getDataList(); // 重新获取列表
+          setTimeout(() => {
+            this.uploadInfo = '导入';
+          }, 300);
+        } else if (res.data === '' && res.status === 200) {
+          this.$alert(`导入成功`, '提示', {
+            confirmButtonText: '确定',
+            // cancelButtonText: '取消',
+            // cancelButtonClass: 'cancelSure',
+            // confirmButtonClass: 'sure',
+            // customClass: 'exportConfirm',
+            type: 'success'
+          })
+            .then(() => {})
+            .catch(() => {});
+          this.getDataList(); // 重新获取列表
+          setTimeout(() => {
+            this.uploadInfo = '导入';
+          }, 300);
+        } else {
+          this.$alert(`${res.data.msg}`, '提示', {
+            confirmButtonText: '确定',
+            // cancelButtonText: '取消',
+            // cancelButtonClass: 'cancelSure',
+            // confirmButtonClass: 'sure',
+            // customClass: 'exportConfirm',
+            type: 'warning'
+          })
+            .then(() => {})
+            .catch(() => {});
+
+          setTimeout(() => {
+            this.uploadInfo = '导入';
+          }, 300);
+        }
+      });
+      //解决上传相同文件不触发change
+      let inp = document.getElementById('upFile');
+      inp.value = '';
+    }
+  }
+};
+</script>
+
+
+<style lang="less" scoped>
+@import '../../../less/admin.less';
+.delete {
+  color: red;
+}
+.delete:hover {
+  color: red;
+}
+.pagination {
+  min-width: 1010px;
+}
+.downTemplate {
+  margin-right: 8px;
+  span {
+    color: #02a7f0;
+  }
+}
+#upFile {
+  display: none !important;
+}
+#upFileMatch {
+  display: none;
+}
+.el-message-box {
+  /deep/.cancelBtn {
+    background-color: #d7d7d7;
+    border-color: transparent;
+  }
+  /deep/.confirmC {
+    background-color: #ff545b !important;
+    border-color: transparent !important;
+  }
+}
+.exportBox6 {
+  /deep/ .el-message-box__btns {
+    margin-top: 20px;
+  }
+  /deep/ .el-message-box__message {
+    // text-align: center;
+  }
+  /deep/.leftbtn {
+    background-color: #d7d7d7;
+    border-color: transparent !important;
+  }
+  /deep/ .el-message-box__header {
+    border-bottom: 1px solid #dcdfe6;
+  }
+}
+.searchBar {
+  min-width: 980px;
+  height: 60px;
+  display: flex;
+  justify-content: center;
+  align-items: center;
+  background-color: #dee2ea;
+  z-index: 9999;
+  padding: 40px 20px 0;
+  .searchContent {
+    height: 40px;
+    flex: 1;
+    background-color: #fff;
+    display: flex;
+    justify-content: flex-end;
+    float: right;
+  }
+}
+.contentsOther {
+  padding: 0 20px;
+}
+</style>

+ 327 - 250
src/components/knowledgeExtra/AddDiagBase.vue

@@ -12,7 +12,7 @@
         :rules="rules"
       >
         <div class="content">
-          <el-form-item label="疾病名称:" prop="conceptId">
+          <el-form-item label="疾病名称:" class="item" prop="conceptId" :rules="rules.conceptId">
             <el-select
               clearable
               remote
@@ -28,10 +28,10 @@
               ></el-option>
             </el-select>
           </el-form-item>
-          <el-form-item label="诊断依据描述:" class="description">
+          <el-form-item label="诊断依据描述:" prop="description" class="item">
             <el-input
               class="inps"
-              max-length="200"
+              maxlength="200"
               placeholder="请输入诊断依据描述"
               v-model.trim="form.description"
             ></el-input>
@@ -49,12 +49,14 @@
             :span-method="dataSpanMethod"
             :data="form.klDiagnoseTypeVO"
             border
-            max-height="500"
+            ref="tableList"
+            style="min-height: 200px"
+            height="calc(100vh - 450px)"
             :header-cell-style="{background:'#E3EAF4'}"
           >
-            <el-table-column label="依据" width="100">
+            <el-table-column label="依据" width="100" fixed>
               <template slot="header" slot-scope="scope">
-                <span>依据</span>
+                <span class="name">依据</span>
               </template>
               <template slot-scope="scope">
                 <el-form-item>
@@ -63,7 +65,7 @@
                     height="18"
                     width="18"
                     class="icon"
-                    @click="copyDiag(scope.row.depart_id,scope.$index)"
+                    @click="copyDiag(scope.row.depart_id)"
                   />
                   <img
                     src="../../images/icon-add.png"
@@ -86,15 +88,16 @@
             <el-table-column label="诊断依据类型" width="130">
               <template slot="header" slot-scope="scope">
                 <span class="star">*</span>
-                <span>诊断依据类型</span>
+                <span class="name">诊断依据类型</span>
               </template>
               <template slot-scope="scope">
                 <el-form-item
                   class="is-request"
                   :prop="'klDiagnoseTypeVO.'+scope.$index+'.conditionType'"
-                  :rules="[{ required: true, message: '请选择诊断依据类型',trigger: ['change'] }]"
+                  :rules="rules.conditionType"
                 >
                   <el-select
+                    ref="aa"
                     v-model="form.klDiagnoseTypeVO[scope.$index].conditionType"
                     @change="(val)=>basTypeChange(val,scope.$index)"
                   >
@@ -111,7 +114,7 @@
             <el-table-column label="组" width="130">
               <template slot="header" slot-scope="scope">
                 <span class="star">*</span>
-                <span>组</span>
+                <span class="name">组</span>
               </template>
               <template slot-scope="scope">
                 <el-form-item>
@@ -128,7 +131,7 @@
                     width="18"
                     class="icon"
                     @click="delGroup(scope.row.depart_id,scope.$index)"
-                    v-show="groupL[scope.row.depart_id].id>1"
+                    v-show="isMax(scope.row.depart_id)"
                   />
                 </el-form-item>
               </template>
@@ -136,12 +139,12 @@
             <el-table-column label="符合条件数量" width="150">
               <template slot="header" slot-scope="scope">
                 <span class="star">*</span>
-                <span>符合条件数量</span>
+                <span class="name">符合条件数量</span>
               </template>
               <template slot-scope="scope">
                 <el-form-item
                   :prop="'klDiagnoseTypeVO.'+scope.$index+'.groupVO.'+0+'.fitNo'"
-                  :rules="[{required:true,message:'请选择符合条件的数量',trigger:'change'}]"
+                  :rules="rules.fitNo"
                 >
                   <el-select v-model="scope.row.groupVO[0].fitNo">
                     <el-option
@@ -157,7 +160,7 @@
             <el-table-column v-for="(v,i) in columns" :width="v.width" :key="i">
               <template slot="header" slot-scope="scope">
                 <span class="star" v-if="v.istar">*</span>
-                <span>{{v.title}}</span>
+                <span class="name">{{v.title}}</span>
               </template>
               <template slot-scope="scope">
                 <div v-for="(item,index) in scope.row.groupVO" :key="index">
@@ -184,11 +187,11 @@
                     <div class="box-2" v-if="v.title == '基础依据名称'">
                       <el-form-item
                         :prop="'klDiagnoseTypeVO.' +
-                          scope.$index +
-                          '.groupVO.' +
-                          index +
-                          '.klDiagnoseDetail.'+i+'.basDescription'"
-                        :rules="[{required:true,message:'请输入基础依据名称',trigger:'blur'}]"
+                        scope.$index +
+                        '.groupVO.' +
+                        index +
+                        '.klDiagnoseDetail.'+i+'.basDescription'"
+                        :rules="rules.basDescription"
                       >
                         <el-input
                           class="inp-name"
@@ -205,6 +208,7 @@
                         '.groupVO.' +
                         index +
                         '.klDiagnoseDetail.'+i+'.basType'"
+                        :rules="rules.basType"
                       >
                         <el-select
                           v-model="items.basType"
@@ -226,6 +230,7 @@
                       index +
                       '.klDiagnoseDetail.'+i+'.basLibType'"
                       v-if="!items.basNameType && v.title == '基础依据术语类型'"
+                      :rules="rules.basLibType"
                     >
                       <el-select
                         v-model="items.basLibType"
@@ -255,7 +260,7 @@
                         '.groupVO.' +
                         index +
                         '.klDiagnoseDetail.'+i+'.basConceptId'"
-                        :rules="[{required:true,message:'请输入医学标准术语',trigger:'change'}]"
+                        :rules="rules.subConceptId"
                       >
                         <el-select
                           clearable
@@ -282,6 +287,7 @@
                         index +
                         '.klDiagnoseDetail.'+i+'.dataType'"
                         v-if="items.basType===2&&!items.onlyNumType&&!items.onlyTxtType"
+                        :rules="rules.dataType"
                       >
                         <el-select
                           class="box-1"
@@ -311,6 +317,14 @@
                             '.groupVO.' +
                             index +
                             '.klDiagnoseDetail.'+i+'.maxOperator'"
+                            :rules="[
+                              {
+                                validator: (rule, value, callback) => {
+                                  maxOperator(items, rule, value, callback);
+                                },
+                                trigger: ['change']
+                              }
+                            ]"
                           >
                             <el-select
                               v-model="items.maxOperator"
@@ -328,11 +342,20 @@
                           </el-form-item>
 
                           <el-form-item
+                            class="num"
                             :prop="'klDiagnoseTypeVO.' +
-                              scope.$index +
-                              '.groupVO.' +
-                              index +
-                              '.klDiagnoseDetail.'+i+'.maxVal'"
+                            scope.$index +
+                            '.groupVO.' +
+                            index +
+                            '.klDiagnoseDetail.'+i+'.maxVal'"
+                            :rules="[
+                              {
+                                validator: (rule, value, callback) => {
+                                  maxVal(items, rule, value, callback);
+                                },
+                                trigger: ['blur']
+                              }
+                            ]"
                           >
                             <el-input v-model="items.maxVal" placeholder="填写数值"></el-input>
                           </el-form-item>
@@ -353,6 +376,14 @@
                             '.groupVO.' +
                             index +
                             '.klDiagnoseDetail.'+i+'.minOperator'"
+                            :rules="[
+                              {
+                                validator: (rule, value, callback) => {
+                                  minOperator(items, rule, value, callback);
+                                },
+                                trigger: ['change']
+                              }
+                            ]"
                           >
                             <el-select
                               v-model="items.minOperator"
@@ -368,48 +399,75 @@
                               ></el-option>
                             </el-select>
                           </el-form-item>
-
                           <el-form-item
+                            class="minnum"
                             :prop="'klDiagnoseTypeVO.' +
-                              scope.$index +
-                              '.groupVO.' +
-                              index +
-                              '.klDiagnoseDetail.'+i+'.minVal'"
+                            scope.$index +
+                            '.groupVO.' +
+                            index +
+                            '.klDiagnoseDetail.'+i+'.minVal'"
+                            :rules="[
+                              {
+                                validator: (rule, value, callback) => {
+                                  minVal(items, rule, value, callback);
+                                },
+                                trigger: ['blur']
+                              }
+                            ]"
                           >
                             <el-input v-model="items.minVal" placeholder="填写数值"></el-input>
                           </el-form-item>
-
                           <el-form-item prop="minUnit">
                             <el-input v-model.trim="items.minUnit" placeholder="填写单位"></el-input>
                           </el-form-item>
                         </div>
                       </el-form-item>
-                      <el-form-item
-                        :prop="'klDiagnoseTypeVO.' +
+                      <div>
+                        <el-form-item
+                          :prop="'klDiagnoseTypeVO.' +
                         scope.$index +
                         '.groupVO.' +
                         index +
                         '.klDiagnoseDetail.'+i+'.eqValue'"
-                        v-if="items.basType===4 || items.basType===3"
-                        maxlength="200"
-                        label="正则表达式:"
-                        class="discDesc"
-                      >
-                        <el-input class="inp" placeholder="请输入正则表达式" v-model.trim="items.eqValue"></el-input>
-                      </el-form-item>
-                      <el-form-item
-                        :prop="'klDiagnoseTypeVO.' +
+                          v-if="items.basType===4 || items.basType===3"
+                          maxlength="200"
+                          label="正则表达式:"
+                          class="discDesc"
+                          :rules="[
+                          {
+                            required: true,
+                            message: '请输入正则表达式',
+                            trigger: 'blur'
+                          },
+
+                        ]"
+                        >
+                          <el-input class="inp" placeholder="请输入正则表达式" v-model.trim="items.eqValue"></el-input>
+                        </el-form-item>
+                      </div>
+                      <div>
+                        <el-form-item
+                          :prop="'klDiagnoseTypeVO.' +
                         scope.$index +
                         '.groupVO.' +
                         index +
                         '.klDiagnoseDetail.'+i+'.eqValue'"
-                        maxlength="200"
-                        v-if="(!items.onlyNumType&&!items.basNameType&&(items.basType===2 || items.basType===1)&&items.dataType==='2')||items.onlyTxtType"
-                        label="医学内容:"
-                        class="discDesc"
-                      >
-                        <el-input v-model.trim="items.eqValue" class="inp" placeholder="请输入医学内容"></el-input>
-                      </el-form-item>
+                          maxlength="200"
+                          v-if="(!items.onlyNumType&&!items.basNameType&&(items.basType===2 || items.basType===1)&&items.dataType==='2')||items.onlyTxtType"
+                          label="医学内容:"
+                          class="discDesc"
+                          :rules="[
+                          {
+                            required: true,
+                            message: '请输入医学内容',
+                            trigger: 'blur'
+                          }
+                          
+                        ]"
+                        >
+                          <el-input v-model.trim="items.eqValue" class="inp" placeholder="请输入医学内容"></el-input>
+                        </el-form-item>
+                      </div>
                     </div>
                   </div>
                 </div>
@@ -427,7 +485,7 @@
 <script type="text/javascript">
 import util from '../../api/utils.js';
 import api from '@api/zskDiagBase.js';
-
+import { tableRules } from './rules';
 export default {
   name: 'AddZskDiagBase',
   data() {
@@ -474,7 +532,7 @@ export default {
                     basDescription: '',
                     basLename: '',
                     basLibName: '',
-                    basLibType: '',
+                    basLibType: null,
                     basType: '',
                     eqOperator: '',
                     eqUnit: '',
@@ -493,40 +551,7 @@ export default {
         ]
       },
       id: null,
-      rules: {
-        conceptId: [
-          { required: true, message: '请输入疾病名称', trigger: ['change'] }
-        ],
-        description: [
-          {
-            validator: (rule, value, callback) => {
-              if (value && value.length > 100) {
-                callback(new Error('诊断依据描述不能超过100字'));
-              } else {
-                callback();
-              }
-            },
-            trigger: 'change'
-          }
-        ],
-        conditionType: [
-          { required: true, message: '请选择基础规则类型', trigger: ['change'] }
-        ],
-        subEqValue: [
-          {
-            validator: (rule, value, callback) => {
-              if (value === '') {
-                callback(new Error('请输入' + this.textName));
-              } else if (value.length > 200) {
-                callback(new Error(this.textName + '不能超过200字'));
-              } else {
-                callback();
-              }
-            },
-            trigger: 'blur'
-          }
-        ]
-      },
+      rules: tableRules,
       dataTypes: [
         { id: '1', name: '数值类型' },
         { id: '2', name: '文本类型' }
@@ -540,7 +565,6 @@ export default {
         { name: '>=', key: '>=' }
       ],
       basType: '',
-      basLibType: '',
       dataType: '',
       spanArr: [],
       list: [], //提交数据数组,
@@ -660,11 +684,9 @@ export default {
           }
         }
       }
+      this.i = this.form.klDiagnoseTypeVO.slice(-1)[0].depart_id + 1;
     }
-    console.log(this.form);
-    this.setRules();
   },
-
   computed: {
     numArr() {
       let arr = [];
@@ -709,40 +731,91 @@ export default {
         }
       }
       return dest;
-    },
-    groupL() {
-      console.log(this.form);
-      let map = {},
-        dest = [];
-      let arr = [];
-      var formData = JSON.parse(JSON.stringify(this.form));
-      for (let i = 0; i < formData.klDiagnoseTypeVO.length; i++) {
-        let ai = formData.klDiagnoseTypeVO[i];
-        if (!map[ai.depart_id]) {
-          dest.push({
-            depart_id: ai.depart_id,
-            conditionType: ai.conditionType,
-            groupVO: ai.groupVO
-          });
-          map[ai.depart_id] = ai;
-        } else {
-          for (let j = 0; j < dest.length; j++) {
-            var dj = dest[j];
-            if (dj.depart_id == ai.depart_id) {
-              dj.groupVO = dj.groupVO.concat(ai.groupVO);
-              break;
-            }
-          }
-        }
-      }
-      dest.forEach((item, index) => {
-        let arr1 = { id: item.groupVO.length };
-        arr.push(arr1);
-      });
-      return arr;
     }
   },
+  // mounted() {
+  //   this.onscroll();
+  // },
   methods: {
+    // onscroll() {
+    //   this.$nextTick(function() {
+    //     // 监听当前组件的滚动事件
+    //     this.box = this.$refs.tableList.bodyWrapper;
+    //     this.box.addEventListener(
+    //       'scroll',
+    //       () => {
+    //         // select组件层级太高,滚动隐藏
+    //         if (this.$refs.tableList.bodyWrapper.scrollLeft > 0) {
+    //           console.log(this.$refs.aa.handleClose)
+    //           // this.$refs.aa.handleClose()
+    //           // this.$refs.aa.blur()
+    //           // const SELECTWRAP_BODY = document.body; // body
+    //           // const SELECTWRAP_DOWNALL = document.querySelectorAll(
+    //           //   '.el-select-dropdown'
+    //           // ); // select下拉框
+    //           // SELECTWRAP_BODY.click();
+
+    //           // SELECTWRAP_DOWNALL.forEach(item => {
+    //           //   item.blur();
+    //           // });
+    //         }
+    //       },
+    //       false
+    //     );
+    //   });
+    // },
+    // 最大值 选择rule
+    maxOperator(items, rule, value, callback) {
+      const { maxVal, minOperator, minVal } = items;
+      const val = value + minOperator + minVal + maxVal;
+      if (!val || (!value && maxVal !== '')) {
+        callback(new Error('最大值和最小值至少完整填写一个,单位不必填'));
+      } else {
+        callback();
+      }
+    },
+    // 最大值 数值rule
+    maxVal(items, rule, value, callback) {
+      const { maxOperator, minOperator, minVal } = items;
+      const val = value + maxOperator + minOperator + minVal;
+      const isNum = /^(\-|\+)?\d+(\.\d+)?$/.test(value);
+      if (!val || (value == '' && maxOperator)) {
+        callback(new Error('最大值和最小值至少完整填写一个,单位不必填'));
+      } else if (value !== '' && !isNum) {
+        callback(new Error('只能输入数字'));
+      } else {
+        callback();
+      }
+    },
+    // 最小值 选择rule
+    minOperator(items, rule, value, callback) {
+      const { maxVal, maxOperator, minVal } = items;
+      const val = value + maxVal + maxOperator + minVal;
+      if (!val || (!value && minVal !== '')) {
+        callback(new Error('最大值和最小值至少完整填写一个,单位不必填'));
+      } else {
+        callback();
+      }
+    },
+    // 最小值 数值rule
+    minVal(items, rule, value, callback) {
+      const { maxVal, minOperator, maxOperator } = items;
+      const val = value + maxVal + minOperator + maxOperator;
+      const isNum = /^(\-|\+)?\d+(\.\d+)?$/.test(value);
+      if (!val || (value == '' && minOperator)) {
+        callback(new Error('最大值和最小值至少完整填写一个,单位不必填'));
+      } else if (value !== '' && !isNum) {
+        callback(new Error('只能输入数字'));
+      } else {
+        callback();
+      }
+    },
+    isMax(id) {
+      const typeNum = this.form.klDiagnoseTypeVO.filter(
+        item => item.depart_id === id
+      ).length;
+      return typeNum > 1;
+    },
     getData(data) {
       let arr = data;
       let str = [];
@@ -798,9 +871,10 @@ export default {
       }
     },
     getInitData() {
+      this.i++
       return {
         conditionType: '',
-        depart_id: this.i++,
+        depart_id: this.i,
         groupVO: [
           {
             baseGroup: '',
@@ -817,7 +891,7 @@ export default {
                 basDescription: '',
                 basLename: '',
                 basLibName: '',
-                basLibType: '',
+                basLibType: null,
                 basType: '',
                 eqOperator: '',
                 eqUnit: '',
@@ -843,75 +917,71 @@ export default {
           i = inx;
         }
       });
+      this.$nextTick(() => {
+        this.$refs.tableList.bodyWrapper.scrollLeft = 0;
+      });
       this.form.klDiagnoseTypeVO.splice(i + 1, 0, temp);
-      this.setRules();
     },
     //复制依据
-    copyDiag(id, inx) {
-      this.i++;
+    copyDiag(id) {
+      this.i++
       const formData = JSON.parse(JSON.stringify(this.form));
-      let map = {},
-        dest = [];
-      for (let i = 0; i < formData.klDiagnoseTypeVO.length; i++) {
-        let ai = formData.klDiagnoseTypeVO[i];
-        if (!map[ai.depart_id]) {
-          dest.push({
-            depart_id: ai.depart_id,
-            conditionType: ai.conditionType,
-            groupVO: ai.groupVO
-          });
-          map[ai.depart_id] = ai;
-        } else {
-          for (let j = 0; j < dest.length; j++) {
-            var dj = dest[j];
-            if (dj.depart_id == ai.depart_id) {
-              dj.groupVO = dj.groupVO.concat(ai.groupVO);
-              break;
-            }
-          }
+      let i = -1;
+      let arr = [];
+      formData.klDiagnoseTypeVO.forEach((item, inx) => {
+        if (item.depart_id == id) {
+          arr.push(item);
+          i = inx;
         }
-      }
-      var index = dest.findIndex(item => {
-        return item.depart_id == id;
       });
-
-      dest.splice(index + 1, 0, JSON.parse(JSON.stringify(dest[index])));
-      dest.forEach((item, i) => {
-        item.depart_id = i;
+      arr.forEach((item, index) => {
+        item.depart_id = this.i;
+        this.form.klDiagnoseTypeVO.splice(i + index + 1, 0, item);
       });
-      this.form.klDiagnoseTypeVO = dest;
-      this.setRules();
+      // console.log(this.form.klDiagnoseTypeVO);
+
+      
+      // let map = {},
+      //   dest = [];
+      // for (let i = 0; i < formData.klDiagnoseTypeVO.length; i++) {
+      //   let ai = formData.klDiagnoseTypeVO[i];
+      //   if (!map[ai.depart_id]) {
+      //     dest.push({
+      //       depart_id: ai.depart_id,
+      //       conditionType: ai.conditionType,
+      //       groupVO: ai.groupVO
+      //     });
+      //     map[ai.depart_id] = ai;
+      //   } else {
+      //     for (let j = 0; j < dest.length; j++) {
+      //       var dj = dest[j];
+      //       if (dj.depart_id == ai.depart_id) {
+      //         dj.groupVO = dj.groupVO.concat(ai.groupVO);
+      //         break;
+      //       }
+      //     }
+      //   }
+      // }
+      // var index = dest.findIndex(item => {
+      //   return item.depart_id == id;
+      // });
+      // JSON.parse(JSON.stringify(dest[index])).depart_id=this.i
+      // dest.splice(index + 1, 0, JSON.parse(JSON.stringify(dest[index])));
+      // dest.forEach((item, i) => {
+      //   item.depart_id = i;
+      // });
+      // this.form.klDiagnoseTypeVO = JSON.parse(JSON.stringify(dest));
     },
     //删除依据
-    delDiag(id, i) {
-      const formData = JSON.parse(JSON.stringify(this.form));
-      let map = {},
-        dest = [];
-      for (let i = 0; i < formData.klDiagnoseTypeVO.length; i++) {
-        let ai = formData.klDiagnoseTypeVO[i];
-        if (!map[ai.depart_id]) {
-          dest.push({
-            depart_id: ai.depart_id,
-            conditionType: ai.conditionType,
-            groupVO: ai.groupVO
-          });
-          map[ai.depart_id] = ai;
-        } else {
-          for (let j = 0; j < dest.length; j++) {
-            var dj = dest[j];
-            if (dj.depart_id == ai.depart_id) {
-              dj.groupVO = dj.groupVO.concat(ai.groupVO);
-              break;
-            }
-          }
+    delDiag(id, inx) {
+      this.form.klDiagnoseTypeVO = this.form.klDiagnoseTypeVO.filter(
+        item => item.depart_id !== id
+      );
+      this.form.klDiagnoseTypeVO.forEach((item, index) => {
+        if (item.depart_id > id) {
+          item.depart_id = item.depart_id - 1;
         }
-      }
-      var index = dest.findIndex(item => {
-        return item.depart_id == id;
       });
-      dest.splice(index, 1);
-      this.form.klDiagnoseTypeVO = dest;
-      this.setRules();
     },
     //新增组
     addGroup(i) {
@@ -930,7 +1000,7 @@ export default {
             basDescription: '',
             basLename: '',
             basLibName: '',
-            basLibType: '',
+            basLibType: null,
             basType: '',
             eqOperator: '',
             eqUnit: '',
@@ -945,33 +1015,9 @@ export default {
         ]
       };
       this.form.klDiagnoseTypeVO[i].groupVO.splice(i + 1, 0, temp);
-      this.setRules();
     },
     delGroup(id, i) {
-      const formData = JSON.parse(JSON.stringify(this.form));
-      let map = {},
-        dest = [];
-      for (let i = 0; i < formData.klDiagnoseTypeVO.length; i++) {
-        let ai = formData.klDiagnoseTypeVO[i];
-        if (!map[ai.depart_id]) {
-          dest.push({
-            depart_id: ai.depart_id,
-            conditionType: ai.conditionType,
-            groupVO: ai.groupVO
-          });
-          map[ai.depart_id] = ai;
-        } else {
-          for (let j = 0; j < dest.length; j++) {
-            var dj = dest[j];
-            if (dj.depart_id == ai.depart_id) {
-              dj.groupVO = dj.groupVO.concat(ai.groupVO);
-              break;
-            }
-          }
-        }
-      }
       this.form.klDiagnoseTypeVO.splice(i, 1);
-      this.setRules();
     },
     //新增基础依据
     addRule(row, index, i) {
@@ -983,7 +1029,7 @@ export default {
         basDescription: '',
         basLename: '',
         basLibName: '',
-        basLibType: '',
+        basLibType: null,
         basType: '',
         eqOperator: '',
         eqUnit: '',
@@ -997,7 +1043,6 @@ export default {
         dataType: ''
       };
       this.form.klDiagnoseTypeVO[index].groupVO[i].klDiagnoseDetail.push(temp);
-      this.setRules();
     },
     delRule(row, inx, index, i) {
       if (
@@ -1011,7 +1056,6 @@ export default {
           1
         );
       }
-      this.setRules();
     },
     //诊断依据类型修改
     basTypeChange(val, inx) {
@@ -1024,7 +1068,6 @@ export default {
     },
     //基础依据类型修改
     baseTermTypeChange(val, inx, index, i) {
-      console.log(val);
       if (!val) {
         return;
       }
@@ -1038,6 +1081,9 @@ export default {
       this.form.klDiagnoseTypeVO[inx].groupVO[index].klDiagnoseDetail[
         i
       ].dataType = '';
+      this.form.klDiagnoseTypeVO[inx].groupVO[index].klDiagnoseDetail[
+        i
+      ].conceptList = [];
       this.clearConcept(val, inx, index, i); //清空医学标准术语
       this.clearNumText(val, inx, index, i); //清空数值、医学内容
       var index2 = this.baseTermTypeList.findIndex(item => item.type === val);
@@ -1057,6 +1103,15 @@ export default {
         this.form.klDiagnoseTypeVO[inx].groupVO[index].klDiagnoseDetail[
           i
         ].basNameType = true;
+        this.$refs['form'].clearValidate([
+          'klDiagnoseTypeVO.' +
+            inx +
+            '.groupVO.' +
+            index +
+            '.klDiagnoseDetail.' +
+            i +
+            '.basLibType'
+        ]);
       } else {
         this.form.klDiagnoseTypeVO[inx].groupVO[index].klDiagnoseDetail[
           i
@@ -1074,6 +1129,10 @@ export default {
       // this.form.klDiagnoseTypeVO[inx].groupVO[index].klDiagnoseDetail[
       //   i
       // ].dataType = '';
+
+      this.form.klDiagnoseTypeVO[inx].groupVO[index].klDiagnoseDetail[
+        i
+      ].basConceptId = '';
       if ((this.numTypes + ',').indexOf(val + ',') > -1) {
         this.form.klDiagnoseTypeVO[inx].groupVO[index].klDiagnoseDetail[
           i
@@ -1097,8 +1156,8 @@ export default {
       this.form.klDiagnoseTypeVO[inx].groupVO[index].klDiagnoseDetail[
         i
       ].onlyTxtType = type && code.indexOf(a + ',') > -1;
-      // this.clearConcept(val, inx, index, i);
-      // this.clearNumText(val, inx, index, i);
+      this.clearConcept(val, inx, index, i);
+      this.clearNumText2(val, inx, index, i);
     },
     //医学标准术语
     conceptChange(val, inx, index, i) {
@@ -1166,7 +1225,35 @@ export default {
       this.form.klDiagnoseTypeVO[inx].groupVO[index].klDiagnoseDetail[
         i
       ].basLibName = '';
-      this.conceptList = [];
+      this.form.klDiagnoseTypeVO[inx].groupVO[index].klDiagnoseDetail[
+        i
+      ].conceptList = [];
+    },
+    clearNumText2(val, inx, index, i) {
+      this.form.klDiagnoseTypeVO[inx].groupVO[index].klDiagnoseDetail[
+        i
+      ].maxOperator = '';
+      this.form.klDiagnoseTypeVO[inx].groupVO[index].klDiagnoseDetail[
+        i
+      ].maxVal = '';
+      this.form.klDiagnoseTypeVO[inx].groupVO[index].klDiagnoseDetail[
+        i
+      ].maxUnit = '';
+      this.form.klDiagnoseTypeVO[inx].groupVO[index].klDiagnoseDetail[
+        i
+      ].minOperator = '';
+      this.form.klDiagnoseTypeVO[inx].groupVO[index].klDiagnoseDetail[
+        i
+      ].minVal = '';
+      this.form.klDiagnoseTypeVO[inx].groupVO[index].klDiagnoseDetail[
+        i
+      ].minUnit = '';
+      this.form.klDiagnoseTypeVO[inx].groupVO[index].klDiagnoseDetail[
+        i
+      ].eqValue = '';
+      this.form.klDiagnoseTypeVO[inx].groupVO[index].klDiagnoseDetail[
+        i
+      ].eqOperator = '';
     },
     clearNumText(val, inx, index, i) {
       this.form.klDiagnoseTypeVO[inx].groupVO[index].klDiagnoseDetail[
@@ -1247,20 +1334,6 @@ export default {
                   x +
                   '.klDiagnoseDetail.' +
                   j;
-                that.rules[keyTxt + '.basType'] = [
-                  {
-                    required: true,
-                    message: '请选择基础依据类型',
-                    trigger: ['change']
-                  }
-                ];
-                that.rules[keyTxt + '.basLibType'] = [
-                  {
-                    required: true,
-                    message: '请选择基础依据术语类型',
-                    trigger: ['change']
-                  }
-                ];
                 that.rules[keyTxt + '.dataType'] = [
                   {
                     required: true,
@@ -1346,19 +1419,6 @@ export default {
                     trigger: 'blur'
                   }
                 ];
-                that.rules[keyTxt + '.eqValue'] = [
-                  { required: true, message: '不能为空~', trigger: 'blur' },
-                  {
-                    validator: (rule, value, callback) => {
-                      if (value && value.length > 200) {
-                        callback(new Error('不能超过200字'));
-                      } else {
-                        callback();
-                      }
-                    },
-                    trigger: 'blur'
-                  }
-                ];
               }
             });
           });
@@ -1394,6 +1454,7 @@ export default {
       });
     },
     confirm() {
+      
       const formData = JSON.parse(JSON.stringify(this.form));
       const _this = this;
       for (let i = 0; i < formData.klDiagnoseTypeVO.length; i++) {
@@ -1456,7 +1517,7 @@ export default {
   height: 100%;
   .content {
     background: #fff;
-    padding: 20px 20px 50px;
+    padding: 20px 20px;
     color: #545455;
     min-width: 980px;
     position: relative;
@@ -1473,6 +1534,9 @@ export default {
         background: #ebedf1;
       }
     }
+    .el-table--scrollable-y .el-table__body-wrapper {
+      height: calc(100vh - 370px);
+    }
     /deep/ .el-input {
       height: 30px;
       line-height: 30px;
@@ -1484,15 +1548,25 @@ export default {
     }
     .inps {
       width: 500px !important;
-      .el-input__inner {
+      font-size: 14px;
+      /deep/ .el-input__inner {
         width: 500px !important;
+        font-size: 14px;
+      }
+    }
+    .item {
+      /deep/.el-form-item__label {
+        font-size: 14px;
+      }
+      /deep/.el-input__inner {
+        font-size: 14px;
       }
     }
   }
   .content-2 {
     margin-top: 10px;
     padding: 20px 20px;
-    max-height: 650px;
+    height: calc(100vh - 370px);
     .cell {
       overflow: initial;
     }
@@ -1517,10 +1591,10 @@ export default {
     }
     .discDesc {
       margin-bottom: 20px;
-      .el-form-item__error {
+      /deep/ .el-form-item__error {
         top: 38px;
+        left: 100px !important;
         white-space: nowrap;
-        background: #fff;
       }
     }
     .el-popper[x-placement^='bottom'] {
@@ -1565,7 +1639,7 @@ export default {
         font-size: 12px;
         margin-right: 15px;
       }
-       /deep/ .el-form-item__content {
+      /deep/ .el-form-item__content {
         position: inherit !important;
       }
       .last-box-1 {
@@ -1574,7 +1648,7 @@ export default {
           top: 38px;
           left: 10px;
           white-space: nowrap;
-          background: #fff;
+          width: 360px;
         }
       }
       .last-box-s {
@@ -1583,14 +1657,13 @@ export default {
           top: 38px;
           left: 0px;
           white-space: nowrap;
-          background: #fff;
+          width: 260px;
         }
       }
       /deep/ .el-form-item__error {
         top: 38px;
         left: 10px;
         white-space: nowrap;
-        background: #fff;
       }
       /deep/ .inp {
         width: 600px !important;
@@ -1632,9 +1705,6 @@ export default {
       color: #ff545b;
     }
   }
-  .description .el-form-item__error {
-    top: auto;
-  }
   .Butn {
     display: flex;
     justify-content: center;
@@ -1643,5 +1713,12 @@ export default {
       margin: 15px 0;
     }
   }
+  .name {
+    font-size: 14px;
+
+    font-weight: 400;
+    color: #333333;
+    line-height: 20px;
+  }
 }
 </style>

+ 150 - 27
src/components/knowledgeExtra/AddNewRule.vue

@@ -1,6 +1,6 @@
 <style lang="less" scoped>
-@import "../../less/admin.less";
-.AddRuleContent {
+// @import "../../less/admin.less";
+#AddRuleContent {
   width: 100%;
   min-width: 1000px;
   padding: 20px;
@@ -12,6 +12,7 @@
     box-sizing: border-box;
     background: #fff;
     padding: 20px;
+    padding-bottom: 0;
     display: flex;
     flex-wrap: wrap;
     .table_cell {
@@ -22,6 +23,7 @@
   /deep/ .el-input--mini .el-input__inner,
   .el-select {
     width: 100%;
+    font-size: 14px;
   }
   .tip_text {
     // margin-top: -8px;
@@ -36,6 +38,38 @@
     padding-bottom: 20px;
     text-align: center;
   }
+  /deep/ .el-form-item.is-success .el-input__inner,
+  .el-form-item.is-success .el-textarea__inner {
+    border-color: #c9c9c9 !important;
+  }
+  /deep/ .el-form-item.is-success .el-textarea__inner {
+    border-color: #c9c9c9 !important;
+  }
+  /deep/ .el-form-item.is-success .el-textarea__inner {
+    border-color: #c9c9c9 !important;
+  }
+  .my_error {
+    position: absolute;
+    top: 0;
+    left: -16px;
+    img {
+      width: 12px;
+      height: 12px;
+      cursor: pointer;
+    }
+  }
+}
+</style>
+<style lang="less">
+.popper_class {
+  // background: #fff !important;
+  border: 1px solid #ffa0a0 !important;
+  color: #999999 !important;
+  padding: 3px 50px 3px 10px !important;
+  margin-left: -10px;
+}
+.popper__arrow {
+  border-top-color: #ffa0a0 !important;
 }
 </style>
 <template>
@@ -45,7 +79,7 @@
       :param="$route.params"
       linkTo="ZskRuleManager"
     ></crumbs>
-    <div class="AddRuleContent">
+    <div id="AddRuleContent">
       <el-form size="mini" :model="form" ref="ruleForm">
         <div class="table_form">
           <div class="table_cell">
@@ -84,6 +118,19 @@
                 >
                 </el-option>
               </el-select>
+              <template slot="error" slot-scope="scope">
+                <div class="my_error">
+                  <el-tooltip
+                    class="item"
+                    effect="light"
+                    :content="scope.error"
+                    placement="top-start"
+                    popper-class="popper_class"
+                  >
+                    <img src="../../images/exclamationpoint.png" alt="" />
+                  </el-tooltip>
+                </div>
+              </template>
               <div class="tip_text">
                 注:更改规则类型,将会清空已填写的规则内容~
               </div>
@@ -97,6 +144,19 @@
               :rules="rules.parLenCode"
               prop="parLenCode"
             >
+              <template slot="error" slot-scope="scope">
+                <div class="my_error">
+                  <el-tooltip
+                    class="item"
+                    effect="light"
+                    :content="scope.error"
+                    placement="top-start"
+                    popper-class="popper_class"
+                  >
+                    <img src="../../images/exclamationpoint.png" alt="" />
+                  </el-tooltip>
+                </div>
+              </template>
               <el-select
                 v-model="form.parLenCode"
                 placeholder="请选择"
@@ -180,6 +240,7 @@
         </div>
         <!-- 表格 -->
         <AddNewRuleTable
+          ref="tableView"
           v-if="form.parHasSub && tableShow"
           :klRuleByIdSub="form.klRuleByIdSub"
           :maxNum="subRuleMaxNum"
@@ -189,6 +250,12 @@
           @delGroup="delGroup"
           @delGroupChild="delGroupChild"
           @setFormData="setFormData"
+          @editKlRuleByIdSub="editKlRuleByIdSub"
+          @clearValidate="clearValidate"
+          @childClearConcept="childClearConcept"
+          @childClearNumText="childClearNumText"
+          @ChildDataTypeChange="ChildDataTypeChange"
+          @childSubCodeChange="childSubCodeChange"
         />
         <el-form-item>
           <div class="form_btn">
@@ -253,6 +320,9 @@ export default {
     }
   },
   methods: {
+    clearValidate(data) {
+      this.$refs.ruleForm.clearValidate(data);
+    },
     // 编辑初始化
     async initEdidData() {
       // 规则术语类型初始化
@@ -317,6 +387,7 @@ export default {
     },
     // 提交
     submitForm(formName) {
+      console.log(this.form);
       this.$refs[formName].validate((valid) => {
         if (valid) {
           let params = JSON.parse(JSON.stringify(this.form));
@@ -353,7 +424,7 @@ export default {
     },
     // 子集修改父级的数组
     setFormData(index, data) {
-      this.form.klRuleByIdSub[index].conceptList = data;
+      this.$set(this.form.klRuleByIdSub[index], "conceptList", data);
     },
     // table_form 规则类型选中
     ruleTypeChange(val) {
@@ -452,6 +523,7 @@ export default {
         if (!init) {
           this.form.parConceptId = ""; //医学标准术语清空
           this.conceptList = []; //下拉列表清空
+          this.firstPlace = null;
         }
         this.tableShow = true;
       });
@@ -468,25 +540,35 @@ export default {
     subTypeChange(val, index) {
       // index
       const obj = this.baseTypeList.find((it) => it.type === val);
-      this.form.klRuleByIdSub[index].baseTermTypeList = obj.subMenuList;
-      this.form.klRuleByIdSub[index].subLenCode = "";
-      this.form.klRuleByIdSub[index].dataType = "";
+
+      this.$set(
+        this.form.klRuleByIdSub[index],
+        "baseTermTypeList",
+        obj.subMenuList
+      );
+      this.$set(this.form.klRuleByIdSub[index], "subLenCode", "");
+      this.$set(this.form.klRuleByIdSub[index], "dataType", "");
+
       this.clearConcept(index);
       this.clearNumText(index);
     },
     clearConcept(index) {
-      this.form.klRuleByIdSub[index].subConceptId = "";
+      this.$set(this.form.klRuleByIdSub[index], "subConceptId", "");
       this.conceptList = [];
     },
     clearNumText(index) {
-      this.form.klRuleByIdSub[index].subMaxOperator = "";
-      this.form.klRuleByIdSub[index].subMaxValue = "";
-      this.form.klRuleByIdSub[index].subMaxUnit = "";
-      this.form.klRuleByIdSub[index].subMinOperator = "";
-      this.form.klRuleByIdSub[index].subMinValue = "";
-      this.form.klRuleByIdSub[index].subMinUnit = "";
-      this.form.klRuleByIdSub[index].subEqValue = "";
-      this.form.klRuleByIdSub[index].subEqOperator = "";
+      this.$set(this.form.klRuleByIdSub[index], "subMaxOperator", "");
+      this.$set(this.form.klRuleByIdSub[index], "subMaxValue", "");
+      this.$set(this.form.klRuleByIdSub[index], "subMaxUnit", "");
+      this.$set(this.form.klRuleByIdSub[index], "subMinOperator", "");
+      this.$set(this.form.klRuleByIdSub[index], "subMinValue", "");
+      this.$set(this.form.klRuleByIdSub[index], "subMinUnit", "");
+      this.$set(this.form.klRuleByIdSub[index], "subEqValue", "");
+      this.$set(this.form.klRuleByIdSub[index], "subEqOperator", "");
+    },
+    editKlRuleByIdSub(data) {
+      this.$set(this.form, "klRuleByIdSub", data);
+      // this.form.klRuleByIdSub = data;
     },
     // 添加分组 || 规则
     addGroup(date, arg = { index: null, groupId: null }) {
@@ -549,6 +631,10 @@ export default {
         });
         this.form.klRuleByIdSub.splice(i + 1, 0, obj);
       }
+      this.$nextTick(() => {
+        this.$refs.tableView.scrollFun();
+        
+      });
     },
     // 删除分组
     delGroup(groupId) {
@@ -618,6 +704,54 @@ export default {
           });
         }
       });
+    },
+    /**
+     * 子组件调用方法
+     */
+    childClearConcept(index) {
+      this.$set(this.form.klRuleByIdSub[index], "subConceptId", "");
+      this.$set(this.form.klRuleByIdSub[index], "conceptList", []);
+    },
+    childClearNumText(index) {
+      let obj = JSON.parse(JSON.stringify(this.form.klRuleByIdSub));
+
+      obj[index].subMaxOperator = "";
+      obj[index].subMaxValue = "";
+      obj[index].subMaxUnit = "";
+      obj[index].subMinOperator = "";
+      obj[index].subMinValue = "";
+      obj[index].subMinUnit = "";
+      obj[index].subEqValue = "";
+      // this.$set(obj[index], "subEqValue", "");
+      obj[index].subEqOperator = "";
+      // this.klRuleByIdSub = obj;
+      // this.$emit("editKlRuleByIdSub", obj);
+      this.editKlRuleByIdSub(obj);
+    },
+    ChildDataTypeChange(val, index) {
+      this.form.klRuleByIdSub[index].subEqOperator = val === "2" ? "=" : "";
+      this.$set(
+        this.form.klRuleByIdSub[index],
+        "subEqOperator",
+        val === "2" ? "=" : ""
+      );
+
+      this.childClearNumText(index);
+      // TODO 新增的内容追踪不到
+      this.form.klRuleByIdSub.forEach((item, i) => {
+        if (index === i) {
+          this.$set(item, "dataType", val);
+        }
+      });
+    },
+    childSubCodeChange(val, index, numTypes) {
+      if ((numTypes + ",").indexOf(val + ",") > -1) {
+        this.$set(this.form.klRuleByIdSub[index], "dataType", "1");
+      } else {
+        this.$set(this.form.klRuleByIdSub[index], "dataType", "");
+      }
+      this.childClearConcept(index);
+      this.childClearNumText(index);
     }
   },
   watch: {
@@ -634,16 +768,6 @@ export default {
         });
       },
       deep: true
-    },
-    "form.parHasSub"(val) {
-      console.log(val);
-      console.log(this.form);
-      // if (!val || val == 0) {
-      //   // this.form.klRuleByIdSub = [];
-      //   this.$set(this.form, "klRuleByIdSub", []);
-
-      //   console.log(this.form);
-      // }
     }
   },
   computed: {
@@ -658,7 +782,6 @@ export default {
       return str;
     },
     showMsg: function () {
-      console.log(this.ruleTermCodeStr, "???", this.msgDict);
       return (
         this.ruleTermCodeStr.length > 2 &&
         this.msgDict.indexOf(this.ruleTermCodeStr) > -1

+ 233 - 107
src/components/knowledgeExtra/AddNewRuleTable.vue

@@ -1,13 +1,14 @@
 <style lang="less" scoped>
-.AddNewRuleTable {
+#AddNewRuleTable {
   width: 100%;
   background: #fff;
   margin-top: 10px;
   padding: 20px;
   box-sizing: border-box;
-  /deep/ .el-input--mini .el-input__inner,
+  /deep/ .el-table .el-input--mini .el-input__inner,
   .el-select {
     width: 100%;
+    font-size: 12px;
   }
   .btn_box {
     width: 100%;
@@ -74,9 +75,6 @@
       margin-right: 4px;
     }
   }
-  ::v-deep .el-table tbody tr:hover > td {
-    background-color: transparent;
-  }
   /deep/ .el-table th {
     background: transparent;
   }
@@ -86,9 +84,6 @@
   .table_cell_cls {
     vertical-align: top;
   }
-  /deep/ .el-table__body .el-table__row.hover-row td {
-    background-color: transparent;
-  }
   /deep/ .el-form-item__label {
     font-size: 12px;
   }
@@ -96,24 +91,33 @@
     font-size: 14px;
     font-weight: 400;
   }
+  /deep/ .el-select {
+    font-size: 12px;
+  }
+  /deep/ .el-table--mini,
+  .el-table--small,
+  .el-table__expand-icon {
+    font-size: 14px;
+  }
 }
 </style>
 
 <template>
   <!-- :prop="`klRuleByIdSub[${scope.$index}].subDescription`" -->
-  <div class="AddNewRuleTable">
+  <div id="AddNewRuleTable">
     <h4 style="margin-bottom: 24px">规则内容:</h4>
+    <!-- 隔行换色  :row-style="rowStyle" -->
     <el-table
       border
       :data="klRuleByIdSub"
       size="mini"
       style="min-height: 200px"
-      height="calc(100vh - 403px)"
-      :row-style="rowStyle"
+      height="calc(100vh - 393px)"
       :header-row-style="{ background: '#E3EAF4' }"
       :cell-style="cellStyle"
       :span-method="ObjectSpanMethod"
       ref="table"
+      row-key="groupChildId"
     >
       <el-table-column width="80px" label="组" prop="groupType" fixed="left">
         <template slot-scope="scope">
@@ -164,8 +168,8 @@
           </div>
         </template>
       </el-table-column>
-      <el-table-column width="170px" prop="subDescription">
-        <template slot="header">
+      <el-table-column width="170px" prop="subDescription" label="基础规则名称">
+        <template slot="header" slot-scope="scope">
           <div class="custom_table_header">基础规则名称</div>
         </template>
         <template slot-scope="scope">
@@ -184,8 +188,8 @@
           </el-form-item>
         </template>
       </el-table-column>
-      <el-table-column width="170px" prop="subType">
-        <template slot="header">
+      <el-table-column width="170px" prop="subType" label="基础规则类型">
+        <template slot="header" slot-scope="scope">
           <div class="custom_table_header">基础规则类型</div>
         </template>
         <template slot-scope="scope">
@@ -199,6 +203,10 @@
               :disabled="scope.row.disabled"
               placeholder="请选择"
               @change="subTypeChange($event, scope.$index)"
+              @focus="
+                setTheRef($event, `klRuleByIdSub[${scope.$index}].subType`)
+              "
+              :ref="`klRuleByIdSub[${scope.$index}].subType`"
             >
               <el-option
                 v-for="item in scope.row.baseTypes"
@@ -211,8 +219,8 @@
           </el-form-item>
         </template>
       </el-table-column>
-      <el-table-column width="170px" prop="subLenCode">
-        <template slot="header">
+      <el-table-column width="170px" prop="subLenCode" label="基础规则术语类型">
+        <template slot="header" slot-scope="scope">
           <div class="custom_table_header">基础规则术语类型</div>
         </template>
         <template slot-scope="scope">
@@ -225,7 +233,11 @@
               :disabled="scope.row.disabled"
               v-model="scope.row.subLenCode"
               placeholder="请选择"
+              :ref="`klRuleByIdSub[${scope.$index}].subLenCode`"
               @change="subCodeChange($event, scope.$index)"
+              @focus="
+                setTheRef($event, `klRuleByIdSub[${scope.$index}].subLenCode`)
+              "
             >
               <el-option
                 v-for="item in scope.row.baseTermTypeList"
@@ -239,7 +251,7 @@
         </template>
       </el-table-column>
       <el-table-column width="170px" label="医学标准术语" prop="subConceptId">
-        <template slot="header">
+        <template slot="header" slot-scope="scope">
           <div class="custom_table_header">医学标准术语</div>
         </template>
         <template slot-scope="scope">
@@ -256,6 +268,7 @@
               @focus="subConceptIdfocus(scope.$index)"
               :remote-method="searchConcept"
               v-model.trim="scope.row.subConceptId"
+              :ref="`klRuleByIdSub[${scope.$index}].subConceptId`"
             >
               <el-option
                 v-for="item in scope.row.conceptList"
@@ -281,6 +294,10 @@
                 v-model="scope.row.dataType"
                 placeholder="选择类型"
                 @change="dataTypeChange($event, scope.$index)"
+                @focus="
+                  setTheRef($event, `klRuleByIdSub[${scope.$index}].dataType`)
+                "
+                :ref="`klRuleByIdSub[${scope.$index}].dataType`"
               >
                 <el-option label="数值类型" value="1"> </el-option>
                 <el-option label="文本类型" value="2"> </el-option>
@@ -303,7 +320,7 @@
                         validator: (rule, value, callback) => {
                           subMaxOperator(scope, rule, value, callback);
                         },
-                        trigger: ['blur']
+                        trigger: ['change']
                       }
                     ]"
                   >
@@ -311,6 +328,14 @@
                       v-model="scope.row.subMaxOperator"
                       placeholder="请选择"
                       clearable
+                      @change="maxChange($event, scope.$index, 's')"
+                      @focus="
+                        setTheRef(
+                          $event,
+                          `klRuleByIdSub[${scope.$index}].subMaxOperator`
+                        )
+                      "
+                      :ref="`klRuleByIdSub[${scope.$index}].subMaxOperator`"
                     >
                       <el-option
                         v-for="item in operMaxList"
@@ -330,12 +355,14 @@
                         validator: (rule, value, callback) => {
                           subMaxValue(scope, rule, value, callback);
                         },
-                        trigger: ['blur']
+                        trigger: ['change']
                       }
                     ]"
                   >
                     <el-input
                       type="text"
+                      @focus="maxChange($event, scope.$index, 'i')"
+                      :ref="`klRuleByIdSub[${scope.$index}].subMaxValue`"
                       v-model="scope.row.subMaxValue"
                       placeholder="填写数值"
                     />
@@ -344,10 +371,10 @@
                 <el-col :span="6">
                   <el-form-item
                     :prop="`klRuleByIdSub[${scope.$index}].subMaxUnit`"
-                    :rules="rules.subMaxUnit"
                   >
                     <el-input
                       type="text"
+                      @focus="setScrollRight"
                       v-model.trim="scope.row.subMaxUnit"
                       placeholder="填写单位"
                     />
@@ -371,7 +398,7 @@
                         validator: (rule, value, callback) => {
                           subMinOperatorRule(scope, rule, value, callback);
                         },
-                        trigger: ['blur']
+                        trigger: ['change']
                       }
                     ]"
                   >
@@ -379,6 +406,14 @@
                       v-model="scope.row.subMinOperator"
                       placeholder="请选择"
                       clearable
+                      :ref="`klRuleByIdSub[${scope.$index}].subMinOperator`"
+                      @change="minChange($event, scope.$index, 's')"
+                      @focus="
+                        setTheRef(
+                          $event,
+                          `klRuleByIdSub[${scope.$index}].subMinOperator`
+                        )
+                      "
                     >
                       <el-option
                         v-for="item in operMinList"
@@ -398,12 +433,14 @@
                         validator: (rule, value, callback) => {
                           subMinValueRule(scope, rule, value, callback);
                         },
-                        trigger: ['blur']
+                        trigger: ['change']
                       }
                     ]"
                   >
                     <el-input
                       type="text"
+                      :ref="`klRuleByIdSub[${scope.$index}].subMinValue`"
+                      @focus="minChange($event, scope.$index, 'i')"
                       v-model="scope.row.subMinValue"
                       placeholder="填写数值"
                     />
@@ -412,10 +449,10 @@
                 <el-col :span="6">
                   <el-form-item
                     :prop="`klRuleByIdSub[${scope.$index}].subMinUnit`"
-                    :rules="rules.subMinUnit"
                   >
                     <el-input
                       type="text"
+                      @focus="setScrollRight"
                       v-model.trim="scope.row.subMinUnit"
                       placeholder="填写单位"
                     />
@@ -424,63 +461,71 @@
               </el-row>
             </el-form-item>
             <!-- v-if="klRuleByIdSub[scope.$index].subType !== 6 && klRuleByIdSub[scope.$index].dataType === '2'" -->
-            <el-form-item
-              class="type_content_item"
+            <div
               style="flex: 2"
-              v-if="scope.row.subType !== 6 && scope.row.dataType === '2'"
-              label="医学内容:"
-              label-width="100px"
-              :prop="`klRuleByIdSub[${scope.$index}].subEqValue`"
-              :rules="[
-                {
-                  required: true,
-                  message: '请输入' + textName(scope.$index),
-                  trigger: 'blur'
-                },
-                {
-                  validator: (rule, value, callback) => {
-                    subEqValue(scope, rule, value, callback);
-                  },
-                  trigger: 'blur'
-                }
-              ]"
+              v-if="scope.row.subType != 6 && scope.row.dataType == '2'"
             >
-              <el-input
-                type="textarea"
-                rows="1"
-                placeholder="请输入医学内容"
-                v-model.trim="scope.row.subEqValue"
-              ></el-input>
-            </el-form-item>
+              <el-form-item
+                class="type_content_item"
+                style="width: 100%"
+                label="医学内容:"
+                label-width="100px"
+                :prop="`klRuleByIdSub[${scope.$index}].subEqValue`"
+                :rules="[
+                  {
+                    required: true,
+                    message: '请输入' + textName(scope.$index),
+                    trigger: 'blur'
+                  },
+                  {
+                    validator: (rule, value, callback) => {
+                      subEqValue(scope, rule, value, callback);
+                    },
+                    trigger: 'blur'
+                  }
+                ]"
+              >
+                <el-input
+                  type="textarea"
+                  rows="1"
+                  placeholder="请输入医学内容"
+                  @focus="setScrollRight"
+                  v-model.trim="scope.row.subEqValue"
+                ></el-input>
+              </el-form-item>
+            </div>
+
             <!-- v-if="groupData.subType === 6" -->
-            <el-form-item
-              class="type_content_item"
-              label="正则表达式:"
-              label-width="120px"
-              style="flex: 2"
-              v-if="scope.row.subType === 6"
-              :prop="`klRuleByIdSub[${scope.$index}].subEqValue1`"
-              :rules="[
-                {
-                  required: true,
-                  message: '请输入' + textName(scope.$index),
-                  trigger: 'blur'
-                },
-                {
-                  validator: (rule, value, callback) => {
-                    subEqValue(scope, rule, value, callback);
+            <div style="flex: 2" v-if="scope.row.subType == 6">
+              <el-form-item
+                class="type_content_item"
+                label="正则表达式:"
+                label-width="120px"
+                style="width: 100%"
+                :prop="`klRuleByIdSub[${scope.$index}].subEqValue`"
+                :rules="[
+                  {
+                    required: true,
+                    message: '请输入' + textName(scope.$index),
+                    trigger: 'blur'
                   },
-                  trigger: 'blur'
-                }
-              ]"
-            >
-              <el-input
-                type="textarea"
-                rows="1"
-                placeholder="请输入正则表达式"
-                v-model.trim="scope.row.subEqValue"
-              ></el-input>
-            </el-form-item>
+                  {
+                    validator: (rule, value, callback) => {
+                      subEqValue(scope, rule, value, callback);
+                    },
+                    trigger: 'blur'
+                  }
+                ]"
+              >
+                <el-input
+                  type="textarea"
+                  rows="1"
+                  placeholder="请输入正则表达式"
+                  @focus="setScrollRight"
+                  v-model.trim="scope.row.subEqValue"
+                ></el-input>
+              </el-form-item>
+            </div>
           </div>
         </template>
       </el-table-column>
@@ -505,10 +550,60 @@ export default {
         { name: ">", key: ">" },
         { name: ">=", key: ">=" }
       ],
-      rules: tableRules
+      rules: tableRules,
+      theRef: null
     };
   },
   methods: {
+    setScrollRight() {
+      this.$nextTick(() => {
+        this.$refs.table.bodyWrapper.scrollLeft = this.$refs.table.bodyWrapper.scrollWidth;
+      });
+    },
+    maxChange(e, val, type) {
+      if (
+        type === "i" &&
+        this.klRuleByIdSub[val].subMaxOperator &&
+        this.klRuleByIdSub[val].subMaxOperator != ""
+      ) {
+        this.$emit("clearValidate", [
+          `klRuleByIdSub[${val}].subMinValue`,
+          `klRuleByIdSub[${val}].subMinOperator`
+        ]);
+      } else if (
+        type === "s" &&
+        this.klRuleByIdSub[val].subMaxValue &&
+        this.klRuleByIdSub[val].subMaxValue != ""
+      ) {
+        this.$emit("clearValidate", [
+          `klRuleByIdSub[${val}].subMinValue`,
+          `klRuleByIdSub[${val}].subMinOperator`
+        ]);
+      }
+      this.setScrollRight();
+    },
+    minChange(e, val, type) {
+      if (
+        type === "i" &&
+        this.klRuleByIdSub[val].subMinOperator &&
+        this.klRuleByIdSub[val].subMinOperator != ""
+      ) {
+        this.$emit("clearValidate", [
+          `klRuleByIdSub[${val}].subMaxOperator`,
+          `klRuleByIdSub[${val}].subMaxValue`
+        ]);
+      } else if (
+        type === "s" &&
+        this.klRuleByIdSub[val].subMinValue &&
+        this.klRuleByIdSub[val].subMinValue != ""
+      ) {
+        this.$emit("clearValidate", [
+          `klRuleByIdSub[${val}].subMaxOperator`,
+          `klRuleByIdSub[${val}].subMaxValue`
+        ]);
+      }
+      this.setScrollRight();
+    },
     addGroup(scope) {
       this.$emit("addGroup", null, { groupId: scope.row.groupId });
       this.$refs.table.bodyWrapper.scrollLeft = 0;
@@ -517,14 +612,18 @@ export default {
       this.$emit("addGroup", scope.row.groupId, { index: scope.$index });
       this.$refs.table.bodyWrapper.scrollLeft = 0;
     },
-    // table 隔行换色
-    rowStyle({ row }) {
-      if (row.rowIndex % 2 == 0) {
-        return {
-          background: "#DFF7EF"
-        };
-      }
+    scrollFun() {
+      this.$refs.table.bodyWrapper.scrollTop =
+        this.$refs.table.bodyWrapper.scrollTop + 60;
     },
+    // table 隔行换色
+    // rowStyle({ row }) {
+    //   if (row.rowIndex % 2 == 0) {
+    //     return {
+    //       background: "#DFF7EF"
+    //     };
+    //   }
+    // },
     // cellStyle
     cellStyle({ row, column, rowIndex, columnIndex }) {
       if (column.label == "组" || column.label == "基础规则") return {};
@@ -603,35 +702,26 @@ export default {
     subTypeChange(e, index) {
       this.$emit("subTypeChange", e, index);
     },
+    //
+    setTheRef(e, val) {
+      this.theRef = val;
+    },
     // 规则术语类型
     subCodeChange(val, index) {
       //基础规则术语类型修改
-      if ((this.numTypes + ",").indexOf(val + ",") > -1) {
-        this.klRuleByIdSub[index].dataType = "1";
-      } else {
-        this.klRuleByIdSub[index].dataType = "";
-      }
-      this.clearConcept(index);
-      this.clearNumText(index);
+      this.$emit("childSubCodeChange", val, index, this.numTypes);
     },
     clearConcept(index) {
-      this.klRuleByIdSub[index].subConceptId = "";
-      this.klRuleByIdSub[index].conceptList = [];
+      this.$emit("childClearConcept", index);
     },
     clearNumText(index) {
-      this.klRuleByIdSub[index].subMaxOperator = "";
-      this.klRuleByIdSub[index].subMaxValue = "";
-      this.klRuleByIdSub[index].subMaxUnit = "";
-      this.klRuleByIdSub[index].subMinOperator = "";
-      this.klRuleByIdSub[index].subMinValue = "";
-      this.klRuleByIdSub[index].subMinUnit = "";
-      this.klRuleByIdSub[index].subEqValue = "";
-      this.klRuleByIdSub[index].subEqOperator = "";
+      this.$emit("childClearNumText", index);
     },
     //医学标准术语change
     subConceptIdfocus(index) {
       this.subConceptIdIndex = "";
       this.subConceptIdIndex = index;
+      this.setTheRef(1, `klRuleByIdSub[${index}].subConceptId`);
     },
     // 医学标准术语
     searchConcept(val) {
@@ -655,10 +745,7 @@ export default {
         });
     },
     dataTypeChange(val, index) {
-      this.klRuleByIdSub[index].subEqOperator = val === "2" ? "=" : "";
-      this.clearNumText(index);
-      delete this.klRuleByIdSub[index].dataType; //触发更新
-      this.$set(this.klRuleByIdSub[index], "dataType", val);
+      this.$emit("ChildDataTypeChange", val, index);
     },
     // 处理要合并相同行的列
     getSpanArr(data) {
@@ -709,12 +796,32 @@ export default {
     },
     textName(index) {
       return this.klRuleByIdSub[index].subType !== 6 &&
-        this.klRuleByIdSub[index].dataType === "2"
+        this.klRuleByIdSub[index].dataType == "2"
         ? "医学内容"
         : "正则表达式";
+    },
+    blurRef() {
+      console.log("scroll");
+      console.log(this.$refs[this.theRef]);
+      if (this.theRef) {
+        this.$refs[this.theRef].blur();
+        // console.log(document.getElementById(this.theRef).blur,'hehehe');
+        // document.getElementById(this.theRef).focus()
+        // document.getElementById(this.theRef).value = 123
+      }
     }
   },
   components: {},
+  mounted() {
+    // this.theRef
+    // console.log('mounted');
+    // let that = this;
+    // this.$refs.table.bodyWrapper.addEventListener(
+    //   "scroll",
+    //   that.blurRef,
+    //   false
+    // );
+  },
   created() {
     this.numTypes = localStorage.getItem("zskNumDict");
     this.getSpanArr(this.klRuleByIdSub);
@@ -722,6 +829,25 @@ export default {
   beforeUpdate() {
     this.getSpanArr(this.klRuleByIdSub);
   },
+
+  updated() {
+    // let that = this;
+    // this.$nextTick(() => {
+    //   // FIX 滚动添加事件
+    //   this.$refs.table.bodyWrapper.removeEventListener(
+    //     "scroll",
+    //     that.blurRef,
+    //     false
+    //   );
+    //   setTimeout(() => {
+    //     that.$refs.table.bodyWrapper.addEventListener(
+    //       "scroll",
+    //       that.blurRef,
+    //       false
+    //     );
+    //   }, 300);
+    // });
+  },
   props: {
     klRuleByIdSub: {
       type: Array,

+ 26 - 2
src/components/knowledgeExtra/rules.js

@@ -41,8 +41,11 @@ export const formRules = {
 }
 
 export const tableRules = {
+  conceptId: [
+    { required: true, message: '请输入疾病名称', trigger: ['change'] }
+  ],
   subDescription: [
-    { required: true, message: "请输入基础规则名称", trigger: ["change","blur"] },
+    { required: true, message: "请输入基础规则名称", trigger: ["change", "blur"] },
     {
       validator: (rule, value, callback) => {
         if (value && value.length > 100) {
@@ -51,12 +54,25 @@ export const tableRules = {
           callback();
         }
       },
-      trigger: ["change","blur"]
+      trigger: ["change", "blur"]
     }
   ],
+  conditionType: [
+    { required: true, message: "请选择诊断依据类型", trigger: ["blur"] }
+  ],
+  fitNo: [
+    { required: true, message: "请选择符合条件的数量", trigger: ["blur"] }
+  ],
+
+  basDescription: [
+    { required: true, message: "请输入基础依据名称", trigger: ["blur"] }
+  ],
   subType: [
     { required: true, message: "请选择基础规则类型", trigger: ["change"] }
   ],
+  basType: [
+    { required: true, message: "请选择基础依据类型", trigger: ["blur"] }
+  ],
   subLenCode: [
     {
       required: true,
@@ -64,9 +80,17 @@ export const tableRules = {
       trigger: ["blur"]
     }
   ],
+  basLibType: [
+    {
+      required: true,
+      message: "请选择基础依据术语类型",
+      trigger: ["blur"]
+    }
+  ],
   subConceptId: [
     { required: true, message: "请输入医学标准术语", trigger: ["blur"] }
   ],
+  
   dataType: [
     { required: true, message: "请选择类型", trigger: ["change"] }
   ],

二进制
src/images/exclamationpoint.png


+ 12 - 0
src/less/admin.less

@@ -185,6 +185,18 @@
 }
 
 body {
+  .horizontal-drop.el-select-dropdown{
+    .el-select-group__wrap {
+      width: 518px;
+    }
+    ul{
+      max-width: 600px;
+    }
+    .el-select-group li{
+      width: 168px;
+      display: inline-block;
+    }
+  }
   .el-select-dropdown {
     /deep/ .el-select-dropdown__item {
       span {

+ 10 - 1
src/routes.js

@@ -169,7 +169,10 @@ import DeptManage from '@components/cdssManage/dept/DeptManage.vue'; //科室关
 import AddDept from '@components/cdssManage/dept/AddDept.vue'; //科室关联维护--添加关联
 import Nursing from '@components/cdssManage/nursing/nursing.vue';  //护理关联维护
 import AddNursing from '@components/cdssManage/nursing/Addnursing.vue';  //护理关联维护--添加关联
-
+import Tcmdisease from '@components/cdssManage/tcmdisease/tcmdisease.vue';  //中医疾病关联维护
+import AddTcmdisease from '@components/cdssManage/tcmdisease/Addtcmdisease.vue';  //中医疾病关联维护--添加关联
+import Tcmdrome from '@components/cdssManage/tcmdrome/tcmdrome.vue';  //中医疾病关联维护
+import AddTcmdrome from '@components/cdssManage/tcmdrome/AddTcmdrome.vue';  //中医疾病关联维护--添加关联
 
 // import Correlation from '@components/icss/correlation/Correlation.vue';  //关联维护设置
 import Plan from '@components/cdssManage/plan/Plan.vue'; //关联维护设置
@@ -505,6 +508,12 @@ export default [
             { path: 'LT-KSGLWH-TJHYDXXYGBXDY', component: AddDept, name: 'AddDept' }, //科室关联维护--添加关联
             { path: 'YXSYK-HLGLWH', component: Nursing, name: 'Nursing' }, //护理关联维护
             { path: 'LT-HLGLWH-TJHYDXXYGBXDY', component: AddNursing, name: 'AddNursing' }, //护理关联维护--添加关联
+            { path: 'YXSYK-ZYJBGLWH', component: Tcmdisease, name: 'Tcmdisease' }, //中医疾病关联维护
+            { path: 'LT-ZYJBGLWH-TJHYDXXYGBXDY', component: AddTcmdisease, name: 'AddTcmdisease' }, //中医疾病关联维护
+            { path: 'YXSYK-ZYZHGLWH', component: Tcmdrome, name: 'Tcmdrome' }, //中医疾病关联维护
+            { path: 'LT-ZYZHGLWH-TJHYDXXYGBXDY', component: AddTcmdrome, name: 'AddTcmdrome' }, //中医疾病关联维护
+
+            
             // { path: 'YXSYK-GLWH', component: Correlation, name: 'Correlation' }, //关联维护设置
             { path: 'LT-CDSSSJWH-DZBLFAPZ', component: Plan, name: 'Plan' }, //电子病历方案配置
             { path: 'LT-CDSSSJWH-DZBLFAPZEDIT', component: AddPlan, name: 'AddPlan' }, //电子病历方案配置--新增编辑

+ 3 - 4
vue.config.js

@@ -1,7 +1,6 @@
 const path = require('path');
-// const proxy_path = 'http://192.168.2.236:80';
-// const proxy_path = 'http://192.168.2.241:88';
-const proxy_path = 'http://192.168.2.236:5050';
+const proxy_path = 'http://192.168.2.241:88';
+// const proxy_path = 'http://192.168.2.236:88';
 // const proxy_path = 'http://192.168.3.101:5050';
 // const proxy_path = 'http://192.168.3.117:5050';//周铁刚
 // const proxy_path = 'http://192.168.3.113:5050'; //王峰
@@ -29,4 +28,4 @@ module.exports = {
       },
     },
   },
-};
+};