浏览代码

Merge remote-tracking branch 'origin/master' into referMaster

# Conflicts:
#	src/api/config.js
zhouna 4 年之前
父节点
当前提交
3b9472e916
共有 66 个文件被更改,包括 24180 次插入4289 次删除
  1. 1 0
      .gitignore
  2. 5 0
      package-lock.json
  3. 1 0
      package.json
  4. 91 4
      src/api/cdss.js
  5. 16 0
      src/api/icss.js
  6. 48 12
      src/api/knowledgeTree.js
  7. 131 128
      src/api/utils.js
  8. 44 23
      src/components/autoTest/AutoKnowledgeMapRuleTest.vue
  9. 342 0
      src/components/base/LinkContent.vue
  10. 98 0
      src/components/base/LtModal.vue
  11. 1109 289
      src/components/basicKnow/AddTerm.vue
  12. 236 96
      src/components/basicKnow/BasicTermsMaintenance.vue
  13. 137 0
      src/components/basicKnow/DivEditable.vue
  14. 241 0
      src/components/basicKnow/searchTerm.vue
  15. 16 0
      src/components/cdssManage/MedicalTerm.vue
  16. 0 17
      src/components/cdssManage/disease/AddDisease.vue
  17. 105 10
      src/components/cdssManage/disease/Disease.vue
  18. 89 18
      src/components/cdssManage/drug/DrugManage.vue
  19. 588 744
      src/components/cdssManage/plan/AddPlan.vue
  20. 435 0
      src/components/cdssManage/tcmdisease/Addtcmdisease.vue
  21. 531 0
      src/components/cdssManage/tcmdisease/tcmdisease.vue
  22. 436 0
      src/components/cdssManage/tcmdrome/AddTcmdrome.vue
  23. 531 0
      src/components/cdssManage/tcmdrome/tcmdrome.vue
  24. 1 1
      src/components/common/Crumbs.vue
  25. 332 243
      src/components/common/HomePage.vue
  26. 288 0
      src/components/knowledgeExtra/AddAssess/ScoreResultsTable.vue
  27. 1314 0
      src/components/knowledgeExtra/AddAssess/index.vue
  28. 53 0
      src/components/knowledgeExtra/AddAssess/rules.js
  29. 751 0
      src/components/knowledgeExtra/AddAssess/scale-table.vue
  30. 21 0
      src/components/knowledgeExtra/AddAssess/util.js
  31. 706 275
      src/components/knowledgeExtra/AddDevKnow.vue
  32. 1683 377
      src/components/knowledgeExtra/AddDiagBase.vue
  33. 784 478
      src/components/knowledgeExtra/AddNewRule.vue
  34. 862 0
      src/components/knowledgeExtra/AddNewRuleTable.vue
  35. 245 0
      src/components/knowledgeExtra/AddZskRegisteredDrug.vue
  36. 236 65
      src/components/knowledgeExtra/DevInfo.vue
  37. 426 382
      src/components/knowledgeExtra/DiagBase.vue
  38. 3 0
      src/components/knowledgeExtra/DiagBaseGroup.vue
  39. 430 366
      src/components/knowledgeExtra/DiagBaseItem.vue
  40. 149 140
      src/components/knowledgeExtra/DiagBaseType.vue
  41. 305 0
      src/components/knowledgeExtra/RegisteredDrug.vue
  42. 2 2
      src/components/knowledgeExtra/RuleManager.vue
  43. 0 449
      src/components/knowledgeExtra/SubConditions.vue
  44. 0 117
      src/components/knowledgeExtra/SubRulesGroup.vue
  45. 635 0
      src/components/knowledgeExtra/_AddNewRule.vue
  46. 635 0
      src/components/knowledgeExtra/_SubConditions.vue
  47. 129 0
      src/components/knowledgeExtra/_SubRulesGroup.vue
  48. 113 0
      src/components/knowledgeExtra/rules.js
  49. 125 0
      src/components/knowledgeExtra/table.vue
  50. 17 2
      src/components/testManager/staticKnowledgeMap/StaticKnowledgeMapTest.vue
  51. 二进制
      src/images/add-new-rule-del.png
  52. 二进制
      src/images/add-new-rule-sub.png
  53. 二进制
      src/images/exclamationpoint.png
  54. 二进制
      src/images/icon-add.png
  55. 二进制
      src/images/icon-collect-left.png
  56. 二进制
      src/images/icon-collect-right.png
  57. 二进制
      src/images/icon-copy.png
  58. 二进制
      src/images/icon-delete.png
  59. 二进制
      src/images/msg_close.png
  60. 二进制
      src/images/tab_add.png
  61. 二进制
      src/images/tab_close.png
  62. 二进制
      src/images/tips.png
  63. 12 0
      src/less/admin.less
  64. 69 49
      src/routes.js
  65. 1 2
      vue.config.js
  66. 8622 0
      yarn.lock

+ 1 - 0
.gitignore

@@ -1,6 +1,7 @@
 .DS_Store
 node_modules
 /dist
+vue.config.js
 
 # local env files
 .env.local

+ 5 - 0
package-lock.json

@@ -10761,6 +10761,11 @@
         }
       }
     },
+    "vue-fragment": {
+      "version": "1.5.2",
+      "resolved": "https://registry.npm.taobao.org/vue-fragment/download/vue-fragment-1.5.2.tgz",
+      "integrity": "sha1-MQAXFwxWTEqtldoUwYXJLGeE/Tw="
+    },
     "vue-hot-reload-api": {
       "version": "2.3.1",
       "resolved": "https://registry.npmjs.org/vue-hot-reload-api/-/vue-hot-reload-api-2.3.1.tgz",

+ 1 - 0
package.json

@@ -11,6 +11,7 @@
     "js-md5": "^0.7.3",
     "quill-image-extend-module": "^1.1.2",
     "vue": "^2.5.17",
+    "vue-fragment": "^1.5.2",
     "vue-quill-editor": "^3.0.6"
   },
   "eslintConfig": {

+ 91 - 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);
   },
@@ -621,6 +705,9 @@ export default {
   getRunningStatus(param) {
     return axios.post(urls.getRunningStatus, param);
   },
+  getRunningState(param) {
+    return axios.post(urls.getRunningState, param);
+  },
   getRunningStatusByHospitalId(param) {
     return axios.post(urls.getRunningStatusByHospitalId, param);
   },

+ 16 - 0
src/api/icss.js

@@ -421,4 +421,20 @@ export default {
     getDeptList(param) {    //医学术语命名维护-添加-获取科室
         return axios.post(urls.getDeptList,param)
     },
+
+    getPageList(param) {    //注册药品列表
+        return axios.post(urls.getPageList, param)
+    },
+    getsearchDrug(param) {    //药品关联通用名
+        return axios.post(urls.getsearchDrug, param)
+    },
+    saveOrUpdate(param) {    //药品保存
+        return axios.post(urls.saveOrUpdate, param)
+    },
+    getByParam(param) {    //药品详情
+        return axios.post(urls.getByParam, param)
+    },
+    paramDelete(param) {    //药品删除
+        return axios.post(urls.paramDelete, param)
+    },
 }

+ 48 - 12
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,40 @@ 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'//必须添加,否则会乱码
+    })
+  },
+  // /klRegulation/index
+  searchRuleCode(param) {
+    return axios.post(urls.klRegulation, param);
+  },
+  getRunningState(param) {
+    return axios.post(urls.getRunningState, param);
+  },
+  uploadFile(param) {
+    return axios({
+      url: urls.promptServer,
+      method: 'post',
+      contentType: "multipart/form-data",
+      data: param,
+    })
+  }
 };
+

+ 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(){
+    
+  }
 }

+ 44 - 23
src/components/autoTest/AutoKnowledgeMapRuleTest.vue

@@ -16,7 +16,7 @@
           <el-button size="mini" @click="exportData">导出规则中未涉及到的医院术语</el-button>
         </el-form-item>
         <el-form-item style="marginbottom: 0px">
-          <el-button size="mini" @click="handleAllTest" :disabled="!runningStatus">所有规则测试</el-button>
+          <el-button size="mini" @click="handleAllTest" :disabled="!runningStatus || implement">所有规则测试</el-button>
         </el-form-item>
       </el-form>
     </crumbs>
@@ -52,21 +52,21 @@
             <el-button
               type="text"
               size="small"
-              @click="handleTest(scope.row, scope.$index)"
-              :disabled="!runningStatus"
+              @click="handleTest(scope.row, scope.row.caseId-1)"
+              :disabled="!runningStatus || implement"
             >
               {{
-              runningStatusArr[scope.$index] === 1
+              runningStatusArr[scope.row.caseId-1] === 1 || implement
               ? '执行测试中'
               : '执行测试'
               }}
             </el-button>
-            <span v-if="runningStatusArr[scope.$index] === 1">|</span>
+            <span v-if="runningStatusArr[scope.row.caseId-1] === 1">|</span>
             <el-button
-              v-if="runningStatusArr[scope.$index] === 1"
+              v-if="runningStatusArr[scope.row.caseId-1] === 1"
               type="text"
               size="small"
-              @click="handleUpdateStatus(scope.row, scope.$index)"
+              @click="handleUpdateStatus(scope.row, scope.row.caseId-1)"
             >重置</el-button>
           </template>
         </el-table-column>
@@ -86,7 +86,8 @@ export default {
       list: [],
       hospitalData: [],
       hospitalId: '', //选中医院
-      runningStatusArr: [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0] //知识图谱规则 测试状态
+      runningStatusArr: [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], //知识图谱规则 测试状态
+      implement: false
     };
   },
   computed: {
@@ -98,7 +99,7 @@ export default {
   },
   created() {
     this._getHospitalInfoCDSS();
-    this.zskgetDict()
+    this.zskgetDict();
     // this._getRunningStatus()   // 进入页面立即确认状态
     this.timer = setInterval(this._getRunningStatus, 20 * 1000);
   },
@@ -115,15 +116,30 @@ export default {
     });
   },
   methods: {
-    zskgetDict(){
-        api.zskgetDict().then((res) => {
-            if (res.data.code == '0') {
-                const data = res.data.data;
-                const arr =data['31'];
-                localStorage.setItem("zskDicts",JSON.stringify(arr));
-            }
-        }).catch((error) => {
-            console.log(error);
+    getRunningState() {
+      api
+        .getRunningState({ caseGroup: 1 })
+        .then(res => {
+          if (res.data.code == '0') {
+            this.implement = res.data.data
+          }
+        })
+        .catch(error => {
+          console.log(error);
+        });
+    },
+    zskgetDict() {
+      api
+        .zskgetDict()
+        .then(res => {
+          if (res.data.code == '0') {
+            const data = res.data.data;
+            const arr = data['31'];
+            localStorage.setItem('zskDicts', JSON.stringify(arr));
+          }
+        })
+        .catch(error => {
+          console.log(error);
         });
     },
     _getRunningStatus() {
@@ -154,9 +170,11 @@ export default {
               type: 'success'
             });
             this.getDataList(this.hospitalId); // 重新获取列表
+            this.getRunningState()
           } else {
             this.$message.error(res.data.msg || '重置失败');
             this.getDataList(this.hospitalId); // 重新获取列表
+            this.getRunningState()
           }
           this.runningStatusArr = statusTempArr;
         });
@@ -222,15 +240,17 @@ export default {
     // 跳转至失败/成功条数页面
     goToFailedOrSuccessPage(row, type) {
       const page = this.handleGoPage(row.caseName);
-      let hospital = this.hospitalData.find(item => item.id === this.hospitalId);
+      let hospital = this.hospitalData.find(
+        item => item.id === this.hospitalId
+      );
       let hospitalName = hospital.name;
       let localAuto = {
-        resultId:row.resultId,
+        resultId: row.resultId,
         type,
         hospitalName,
-        caseName:row.caseName.replace(/\_/,'-')
-      }
-      localStorage.setItem('localAuto',JSON.stringify(localAuto))
+        caseName: row.caseName.replace(/\_/, '-')
+      };
+      localStorage.setItem('localAuto', JSON.stringify(localAuto));
       this.$router.push({
         name: 'AutoBillCommonTest',
         params: {
@@ -281,6 +301,7 @@ export default {
       if (val === '') return;
       this.getDataList(val);
       this._getRunningStatus(); // 选中后立即请求状态
+      this.getRunningState();
     },
 
     // 获取列表数据

+ 342 - 0
src/components/base/LinkContent.vue

@@ -0,0 +1,342 @@
+<!----关联维护弹窗内容组件---->
+<template>
+    <el-form
+            :model="form"
+            :rules="rules"
+            label-position="right"
+            label-width="110px"
+            ref="innerForm"
+    >
+        <div class="AddChemicalAndCommonMappingBox clearfix">
+            <div class="titleBox clearfix">
+                <p class="title">医院术语</p>
+                <p class="title">标准术语</p>
+            </div>
+            <div class="leftBox clearfix">
+                <el-form-item :label="labelName+':'" prop="hisName">
+                    <el-input v-model.trim="form.hisName" clearable></el-input>
+                </el-form-item>
+                <el-form-item :label="labelName+'预览:'">
+                    <span class="previewInfo">{{form.hisName}}</span>
+                </el-form-item>
+            </div>
+            <div class="midBox">
+                <img class="midLogo" src="../../images/relation.png" alt />
+                <p class="midTitle">相互关联</p>
+            </div>
+            <div class="rightBox">
+                <el-form-item :label="labelName+':'" class="top-label" prop="searchText">
+                    <el-select
+                            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 in uniqueNameList"
+                                :key="item.icd10Code"
+                                :label="item.name"
+                                :value="item"
+                                :title="item.name"
+                        ></el-option>
+                    </el-select>
+                </el-form-item>
+                <div v-if="similarWords.length" class="similar-term">
+                    <table>
+                        <thead>
+                            <th>词名</th>
+                            <th>来源</th>
+                        </thead>
+                        <tbody>
+                            <tr v-for="word in similarWords">
+                                <td>{{word.name}}</td>
+                                <td>{{word.source}}</td>
+                            </tr>
+                        </tbody>
+                    </table>
+                </div>
+                <el-form-item :label="labelName+'预览:'">
+                    <!-- <span class="previewInfo">{{!isEdit ? form.searchText.name : form.searchText}}</span> -->
+                    <span class="previewInfo" style="minWidth: 240px">{{form.searchText}}</span>
+                </el-form-item>
+                <el-form-item label="ICD编码:">
+                    <span class="previewInfo" style="minWidth: 240px">{{form.icdCode}}</span>
+                </el-form-item>
+            </div>
+        </div>
+        <div class="linked-words">
+            <label>已关联术语:</label>
+            <span>{{linkedWords}}</span>
+        </div>
+    </el-form>
+</template>
+<style lang="less" scoped>
+    .AddChemicalAndCommonMappingBox{
+    /deep/ .el-form-item{
+        /*height: 30px;*/
+        margin-bottom: 18px;
+    .el-form-item__content,.el-form-item__label,.el-input,.el-input__inner{
+        height: 30px;
+        line-height: initial;
+        border-radius: 0;
+    }
+    .el-form-item__label[for]{
+        line-height: 30px;
+    }
+    .el-form-item__content{
+        color: #333;
+    }
+    }
+    /deep/ .top-label{
+        .el-form-item__label,.el-form-item__content{
+            float: none;
+        }
+        .el-form-item__content,.el-select{
+            margin-left:0!important;
+            width: 314px;
+        }
+    }
+    .leftBox /deep/ .el-input__suffix{
+        top:-4px;
+    }
+    .rightBox /deep/ .el-input__suffix{
+        top:5px;
+    }
+    }
+
+    .topBack {
+        top: 0;
+    }
+    .titleBox {
+        padding: 0 0 10px 0px;
+    }
+    .title {
+        width: 50%;
+        float: left;
+        font-size: 14px;
+    }
+    .leftBox,
+    .midBox,
+    .rightBox {
+        width: 336px;
+        float: left;
+        height: 330px;
+        font-size: 14px;
+    }
+    .midBox {
+        width: 59px;
+        padding: 50px 0 0 0;
+        text-align: center;
+    }
+    .midTitle {
+        width: 40px;
+        margin: 0 auto;
+        color: #8B8B8B;
+    }
+    .midLogo {
+        margin: 0 auto;
+    }
+    .leftBox,
+    .rightBox {
+        border: 1px solid #dcdfe6;
+        padding: 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;
+    }
+    .previewInfo {
+        padding-left: 4px;
+        display: inline-block;
+        overflow: hidden;
+        word-wrap: break-word;
+        word-break: break-all;
+    }
+    .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;
+    }
+    }
+    }
+    .linked-words{
+        font-size: 14px;
+        color: #333;
+        font-weight: bold;
+    }
+    .similar-term{
+        width: 314px;
+        border: 1px solid #DCDFE6;
+        margin-bottom: 7px;
+        table{
+            width: 100%;
+            border-collapse: collapse;
+        }
+        thead{
+            background: #F7F7F7;
+        }
+        tr{
+            cursor: pointer;
+            &.active{
+                background: #ECF9FB;
+            }
+        }
+        th,td{
+            height: 34px;
+            line-height: 34px;
+            text-align: center;
+            &:first-child{
+                border-right: 1px solid #DCDFE6;
+
+            }
+        }
+    }
+</style>
+<script>
+    import api from '@api/cdss.js';
+    export default {
+        props:['labelName','form','termType','valName'],
+        data:function () {
+            return {
+                linkedWords:'',   //已关联术语
+                isEdit: false,
+                editId: '',
+                uniqueNameList: [],
+                similarWords:[{name:'aaa',source:'sss'}],
+                /*form: {
+                    searchText: '', //搜索字段
+                    hisName: '',
+                    icdCode: ''
+                },*/
+
+                rules: {
+                    hisName: [
+                        { required: true, message: '请输入诊断名称', trigger: 'change' },
+                        { max: 80, message: '诊断名称最多80字', trigger: 'change' }
+                    ],
+                    searchText: [
+                        { required: true, message: '请选择诊断名称', trigger: 'change' }
+                    ]
+                },
+                saveDisable: false, //保存按钮禁止点击
+                showDrop: false, //下拉框显示文字
+            }
+        },
+        methods:{
+
+            // 搜索列表
+            searchTerms(query) {
+                if (!query) {
+                    this.uniqueNameList = [];
+                    return;
+                }
+                this.showDrop = true;
+                let params = {
+                    type: this.termType, //诊断
+                    inputStr: query,
+                    sex: 3,
+                    age: 0
+                };
+                api.retrievalSearch(params).then(res => {
+                    this.showDrop = false;
+                    if (res.data.code === '0') {
+                        this.uniqueNameList = res.data.data[this.valName];
+                    }
+                });
+            },
+            changeWord(newValue) {
+                this.form.searchText = newValue.name;
+                this.form.icdCode = newValue.icd10Code;
+            },
+
+            handleVisible(flag) {
+                if (!flag) {
+                    this.uniqueNameList = [];
+                }
+            },
+            warning(msg, type) {
+                this.$message({
+                    showClose: true,
+                    message: msg,
+                    type: type || 'warning'
+                });
+            }
+        }
+    }
+</script>

+ 98 - 0
src/components/base/LtModal.vue

@@ -0,0 +1,98 @@
+<!----通用弹窗组件---->
+<template>
+    <div class="modal-container">
+        <div class="cover"></div>
+        <div class="modal-box">
+            <div class="modal-title">
+                <a class="close" @click="close()">×</a>
+            </div>
+            <div class="modal-body">
+                <slot></slot>
+            </div>
+            <div class="modal-footer">
+                <a class="confirm btn" @click="confirm()">确定</a>
+                <a class="cancel btn" @click="close()">取消</a>
+            </div>
+        </div>
+    </div>
+</template>
+<script>
+    export default {
+        name:'lt-modal',
+        data:function(){
+            return{
+            }
+        },
+        methods:{
+            close(){
+                this.$emit("close");
+            },
+            confirm(){
+                this.$emit("confirm");
+            }
+        }
+    }
+</script>
+<style lang="less" scoped>
+.modal-container{
+    position: fixed;
+    top:0;
+    left: 0;
+    width: 100%;
+    height: 100%;
+    z-index: 21;
+    .cover{
+        background: #000;
+        opacity: .2;
+        width: 100%;
+        height: 100%;
+    }
+    .modal-box{
+        width: 860px;
+        height: 564px;
+        background: #fff;
+        position: absolute;
+        left: 50%;
+        top:50%;
+        margin-left: -430px;
+        margin-top: -282px;
+        .modal-title{
+            height: 40px;
+            background: #E3EAF4;
+            .close{
+                float: right;
+                margin:3px 13px 0 0;
+                font-size: 22px;
+                color: #979797;
+                cursor: pointer;
+            }
+        }
+        .btn{
+            display: inline-block;
+            width: 70px;
+            height: 34px;
+            line-height: 34px;
+            background: #48C5D7;
+            border-radius: 4px;
+            color: #fff;
+            text-align: center;
+            cursor: pointer;
+        }
+        .cancel{
+            background: #fff;
+            color: #48C5D7;
+            border:1px #48C5D7 solid;
+            margin-left: 40px;
+        }
+        .modal-body{
+            padding:20px 22px ;
+        }
+        .modal-footer{
+            /*position: absolute;
+            bottom: 32px;*/
+            width: 100%;
+            text-align: center;
+        }
+    }
+}
+</style>

文件差异内容过多而无法显示
+ 1109 - 289
src/components/basicKnow/AddTerm.vue


+ 236 - 96
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,65 +26,113 @@
           </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-option
+              v-for="item in stateSelect"
+              :key="item.id"
+              :label="item.name"
+              :value="item.id"
+            ></el-option>
+          </el-select>
         </el-form-item>
-                <el-form-item label="状态:">
-                    <el-select v-model="filter.isState" clearable placeholder="请选择" size="mini">
-                        <el-option
-                                v-for="item in stateSelect"
-                                :key="item.id"
-                                :label="item.name"
-                                :value="item.id">
-                        </el-option>
-                    </el-select>
-                </el-form-item>
         <el-form-item>
           <el-button size="mini" @click="filterDatas">确认</el-button>
         </el-form-item>
       </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"
-            @click="reloadLib"
-          >更新数据</el-button>
+            >{{ 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
+            >
+            <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>
+              @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'"
+              :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>
@@ -93,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:'禁用'},
+      stateSelect: [
+        { id: "N", name: "启用" },
+        { id: "Y", name: "禁用" }
       ],
       // isState:'',
       cacheData: {}, //因为删除和恢复要及时更新,所以不做缓存
@@ -115,32 +173,33 @@ export default {
       total: 0,
       searched: false,
       filter: {
-        term: '',
-        type: '',
-        libName: '',
+        term: "",
+        type: "",
+        libName: ""
       },
       typeList: [],
-      reloadFlag: true
+      reloadFlag: true,
+      uploadLodding: false
     };
   },
   created() {
     const param = this.$route.params;
-    if(param.currentPage){
-      this.inCurrentPage = param.currentPage
+    if (param.currentPage) {
+      this.inCurrentPage = param.currentPage;
     }
-    if(param.filter){
-      this.filter = param.filter
+    if (param.filter) {
+      this.filter = param.filter;
     }
-    
+
     this.getTypeList();
     //返回时避免参数未赋值就获取列表
-    this.$nextTick(()=>{
+    this.$nextTick(() => {
       this.getDataList();
-    })
+    });
   },
   watch: {
     filter: {
-      handler: function() {
+      handler: function () {
         this.searched = false;
       },
       deep: true
@@ -154,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(
@@ -166,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');
-          }else{
-              this.warning(res.data.msg||'更新失败,请重试');
+            this.warning("更新成功", "success");
+          } else {
+            this.warning(res.data.msg || "更新失败,请重试");
           }
         });
       }
@@ -191,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
@@ -202,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, copy: copy })
+        params: Object.assign(pam, {
+          id: row.conceptId,
+          libType: row.libType,
+          copy: copy
+        })
       });
     },
     filterDatas() {
@@ -216,18 +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 => {
+      api
+        .getBaseConceptInfoPage(param)
+        .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'
+            for (let i = 0; i < templis.length; i++) {
+              templis[i].isDeleted = templis[i].status == "1" ? "N" : "Y";
             }
             this.list = templis;
             // this.cacheData[param.current] = data.records;
@@ -238,22 +367,22 @@ 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||[];
+            this.typeList = data.data.records || [];
           } else {
             console.log(res.msg);
           }
         })
-        .catch(error => {
+        .catch((error) => {
           console.log(error);
         });
     },
@@ -266,10 +395,15 @@ export default {
         this.clearFilter();
       }
       const param = {
-        "libName": this.filter.term.trim(),
-        "libType": this.filter.type,
-        "status": this.filter.isState=='N'?'1':this.filter.isState=='Y'?'0':'',
-        "synonymName": this.filter.libName.trim(),
+        libName: this.filter.term.trim(),
+        libType: this.filter.type,
+        status:
+          this.filter.isState == "N"
+            ? "1"
+            : this.filter.isState == "Y"
+            ? "0"
+            : "",
+        synonymName: this.filter.libName.trim(),
         current: this.inCurrentPage || this.currentPage,
         size: this.pageSize,
         isDeleted: this.filter.isState
@@ -291,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();
@@ -313,45 +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.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: ""
       };
     }
   }
@@ -359,7 +494,7 @@ export default {
 </script>
 
 <style lang="less" scoped>
-@import '../../less/admin.less';
+@import "../../less/admin.less";
 /deep/ .container.knowledgeTitle {
   height: 80px;
 }
@@ -390,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>

+ 137 - 0
src/components/basicKnow/DivEditable.vue

@@ -0,0 +1,137 @@
+<template>
+  <div>
+    <span class="address-placeholder" v-show="onshow" @click="getfouce">{{title}}</span>
+    <div
+      class="test_box"
+      contenteditable="true"
+      v-html="innerText"
+      :ref="Maincontent"
+      @input="handleInput"
+      @blur="unblur"
+      @focus="changeColor"
+      @compositionstart="handleStart"
+      @compositionend="handleEnd"
+    ></div>
+  </div>
+</template>
+
+<script>
+// import { Fragment } from 'vue-fragment'
+export default {
+  name: 'DivEditable',
+  props: ['value', 'Maincontent','title'],
+  data() {
+    return {
+      innerText: this.value,
+      isChange: true,
+      composing: false,
+      onshow: true,
+    };
+  },
+  // components: { Fragment },
+  watch: {
+    value() {
+      if (this.isChange) {
+        this.innerText = this.value;
+      }
+    }
+  },
+  mounted() {
+    let len = this.value.length;
+    this.onshow = len > 0 ? false : true;
+  },
+  methods: {
+    changeColor(){
+      this.isChange = false
+      this.$refs[this.Maincontent].style.border = '1px solid #48C5D7'
+    },
+    unblur() {
+      this.$refs[this.Maincontent].style.border = '1px solid #dcdfe6'
+    },
+    getfouce() {
+       this.$refs[this.Maincontent].focus()
+    },
+    handleInput(event) {
+      let text = event.target.innerText;
+      let len = text.length;
+      this.onshow = len > 0 ? false : true;
+      this.valueHandle(event, text);
+      
+    },
+    valueHandle(event, strVale) {
+      let _this = this;
+      let text = strVale;
+      if (this.composing) {
+        return;
+      }
+      let len = text.length;
+      this.onshow = len > 0 ? false : true;
+      if (len > 200) {
+        this.$refs[this.Maincontent].innerHTML = text.substr(0, 200);
+        this.$refs[this.Maincontent].focus();
+      }
+      this.$emit('input', this.$refs[this.Maincontent].innerHTML);
+      setTimeout(() => {
+        _this.keepLastIndex(event.target);
+      }, 5);
+      // 拓展 如果想要只需要前100位数据
+      // this.content = this.content.substring(0, 100)
+    },
+    handleStart() {
+      this.composing = true;
+    },
+    /**
+     * 中文输入结束
+     */
+    handleEnd($event) {
+      this.composing = false;
+      let text = $event.target.innerHTML;
+      // console.log($event.target.innerHTML)
+      this.valueHandle($event, text);
+    },
+    keepLastIndex(obj) {
+      if (window.getSelection) {
+        // ie11 10 9 ff safari
+        obj.focus(); // 解决ff不获取焦点无法定位问题
+        let range = window.getSelection(); // 创建range
+        range.selectAllChildren(obj); // range 选择obj下所有子内容
+        range.collapseToEnd(); // 光标移至最后
+      } else if (document.selection) {
+        // ie10 9 8 7 6 5
+        let range = document.selection.createRange(); // 创建选择对象
+        // var range = document.body.createTextRange();
+        range.moveToElementText(obj); // range定位到obj
+        range.collapse(false); // 光标移至最后
+        range.select();
+      }
+    }
+  }
+};
+</script>
+
+<style lang="less" scoped>
+.address-placeholder {
+  line-height: 42px;
+  height: 42px;
+  color: #a2a2a2;
+  position: absolute;
+  left: 16px;
+  top: 6px;
+  opacity: 0.7;
+  font-size: 14px;
+}
+.test_box {
+  min-height: 20px;
+  max-height: 300px;
+  outline: 0;
+  border: 1px solid #dcdfe6;
+  font-size: 14px;
+  line-height: 1.5;
+  word-wrap: break-word;
+  overflow-x: hidden;
+  overflow-y: auto;
+  border-radius: 4px;
+  margin-top: 6px;
+  padding: 10px 15px;
+}
+</style>

+ 241 - 0
src/components/basicKnow/searchTerm.vue

@@ -0,0 +1,241 @@
+<template>
+  <div>
+    <div class="address-placeholder" v-show="!onshow && items.length == 0" @click="getfouce">请搜索</div>
+    
+    <div class="source" @click="getfouce" ref="source">
+      <div class="select">
+        <transition-group name="flip-list">
+          <span
+            v-for="(item,index) in items"
+            :key="item.conceptName"
+            draggable="true"
+            class="items"
+            @dragstart="dragstart(item)"
+            @dragenter="dragenter(item)"
+            @dragend="dragend(item)"
+          >
+            {{item.conceptName}}
+            <i class="el-icon-close" @click.stop="delTag(index)"></i>
+          </span>
+        </transition-group>
+        <input
+          class="inp"
+          @mousedown.stop
+          ref="inputVal"
+          @blur="unblur"
+          @focus="changeColor"
+          v-model="value"
+          @input="handleInput"
+        />
+      </div>
+      <ul class="list" v-if="conceptList.length>0 && onshow">
+        <li
+          @mousedown.prevent
+          class="item"
+          @click="getTag(item,index)"
+          v-for="(item,index) in conceptList"
+          :key="index"
+        >
+          {{item.conceptName}}
+          <img src />
+        </li>
+      </ul>
+    </div>
+  </div>
+</template>
+
+<script>
+import api from '@api/knowledgeTree.js';
+export default {
+  name: 'searchTerm',
+  props: ['type', 'refbool', 'id'],
+  data() {
+    return {
+      conceptList: [],
+      oldNum: 0,
+      newNum: 0,
+      value: '',
+      items: [],
+      onshow: false
+    };
+  },
+  created() {
+    if (this.id != '') {
+      this.items = this.formatData(this.refbool);
+    }
+  },
+  watch: {
+    items(newVal, oldVal) {
+      // TO DO
+      let arr = [];
+      newVal.forEach(item => {
+        arr.push(item.conceptId);
+      });
+      this.$emit('update:refbool', arr);
+    }
+  },
+  methods: {
+    changeColor() {
+      this.$refs.source.style.border = '1px solid #48C5D7';
+    },
+    handleInput(event) {
+      let excludedConceptIds = [];
+      let text = event.target.innerText;
+      let len = text.length;
+      this.onshow = len > 0 ? false : true;
+      if (this.id == '') {
+        excludedConceptIds = [];
+      } else {
+        excludedConceptIds = [this.id];
+      }
+      const param = {
+        excludedConceptIds: excludedConceptIds,
+        libType: this.type,
+        name: this.value
+      };
+      api
+        .searchConcept(param)
+        .then(res => {
+          if (res.data.code == '0') {
+            const data = res.data.data;
+            this.conceptList = data;
+            this.onshow = true;
+            this.items.forEach(item => {
+              this.conceptList = this.conceptList.filter(
+                it => it.conceptId !== item.conceptId
+              );
+            });
+          }
+        })
+        .catch(error => {
+          console.log(error);
+        });
+    },
+    getfouce() {
+      this.$refs.inputVal.focus();
+    },
+    getTag(item, index) {
+      var v = this.items.some(el => {
+        return el.conceptName == item.conceptName;
+      });
+      if (v) {
+        return;
+      }
+      this.conceptList.splice(index, 1);
+      this.items.push(item);
+      this.onshow = true;
+    },
+    delTag(index) {
+      this.items.splice(index, 1);
+    },
+    unblur() {
+      this.onshow = false;
+      this.conceptList = [];
+      this.value = '';
+      this.$refs.source.style.border = '1px solid #dcdfe6';
+    },
+    shuffle() {
+      this.items = _.shuffle(this.items);
+    },
+    // 记录初始信息
+    dragstart(value) {
+      this.oldNum = value;
+    },
+    // 做最终操作
+    dragend(value) {
+      if (this.oldNum != this.newNum) {
+        let oldIndex = this.items.indexOf(this.oldNum);
+        let newIndex = this.items.indexOf(this.newNum);
+        let newItems = [...this.items];
+        console.log(oldIndex);
+        // 删除老的节点
+        newItems.splice(oldIndex, 1);
+        // 在列表中目标位置增加新的节点
+        newItems.splice(newIndex, 0, this.oldNum);
+        // this.items一改变,transition-group就起了作用
+        this.items = [...newItems];
+      }
+    },
+    // 记录移动过程中信息
+    dragenter: function(value) {
+      this.newNum = value;
+    },
+    formatData(data) {
+      //转换字段名
+      let str = JSON.stringify(data)
+        .replace(/id/g, 'conceptId')
+        .replace(/libName/g, 'conceptName');
+      //console.log(JSON.parse(str))
+      return JSON.parse(str);
+    }
+  }
+};
+</script>
+
+<style lang="less" scoped>
+.address-placeholder {
+  line-height: 42px;
+  height: 42px;
+  color: #a2a2a2;
+  position: absolute;
+  left: 16px;
+  top: 6px;
+  opacity: 0.7;
+  font-size: 14px;
+}
+.list {
+  width: 318px;
+  height: 200px;
+  position: absolute;
+  z-index: 1001;
+  border: 1px solid #e4e7ed;
+  border-radius: 4px;
+  background-color: #fff;
+  -webkit-box-shadow: 0 2px 12px 0 rgb(0 0 0 / 10%);
+  box-shadow: 0 2px 12px 0 rgb(0 0 0 / 10%);
+  -webkit-box-sizing: border-box;
+  box-sizing: border-box;
+  margin: 5px 0;
+  overflow-y: auto;
+  .item {
+    padding: 0 10px;
+  }
+  .item:hover {
+    background: #f5f7fa;
+  }
+}
+
+.source {
+  min-height: 40px;
+  outline: 0;
+  border: 1px solid #dcdfe6;
+  font-size: 14px;
+  line-height: 40px;
+  padding: 0 16px;
+  word-wrap: break-word;
+  overflow-x: hidden;
+  overflow-y: auto;
+  border-radius: 4px;
+  margin-top: 6px;
+  .select {
+    .items {
+      height: 30px;
+      line-height: 30px;
+      font-size: 12px;
+      border-radius: 5px;
+      padding: 3px 4px;
+      background: #48c5d7;
+      margin: 0 5px;
+      display: inline-block;
+    }
+    .inp {
+      width: 80px;
+      height: 30px;
+      border: none;
+    }
+    .source:target {
+      border: 1px solid #51c9ff;
+    }
+  }
+}
+</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

+ 0 - 17
src/components/cdssManage/disease/AddDisease.vue

@@ -229,23 +229,6 @@ export default {
         this.saveDisable = false;
       });
     },
-    // 关联已存在模态框
-    showConfirmDialog(msg, resolve) {
-      this.$alert(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,

+ 105 - 10
src/components/cdssManage/disease/Disease.vue

@@ -15,6 +15,16 @@
     <div class="searchBar">
       <div class="searchContent">
         <el-form :inline="true" class="demo-form-inline">
+          <el-form-item label="" class="selectMedicine">
+            <el-select size="mini" v-model="filter.match" placeholder="请选择" clearable>
+              <el-option
+                      v-for="item in matchList"
+                      :label="item.name"
+                      :value="item.name"
+                      :key="item.id"
+              ></el-option>
+            </el-select>
+          </el-form-item>
           <el-form-item label="医院诊断名称:">
             <el-input size="mini" v-model="filter.hisName" placeholder="请输入" clearable></el-input>
           </el-form-item>
@@ -61,6 +71,9 @@
         ></el-pagination>
       </div>
     </div>
+    <LtModal v-if="modalVisiable" :disabled="saveDisable" @confirm="submitForm" @close="closeModal">
+      <LinkContent :form="form" ref="relationForm" labelName="诊断名称" termType="4" valName="diseaseNames"/>
+    </LtModal>
   </div>
 </template>
 
@@ -68,11 +81,14 @@
 import api from '@api/cdss.js';
 import config from '@api/config.js';
 import utils from '@api/utils.js';
+import LtModal from '@base/LtModal';
+import LinkContent from '@base/LinkContent';
 
 export default {
   name: 'Disease', //化验大小项和公表维护
   data: function() {
     return {
+      matchList:[{id:-1,name:'全部'},{id:1,name:'已匹配'},{id:2,name:'未匹配'},{id:3,name:'多项匹配'}],
       list: [],
       searched: false,
       filter: {
@@ -86,10 +102,19 @@ export default {
       total: 0,
       uploadInfo: '导入',
       title: '诊断关联维护 | ',
-      hospitaiName: '',
-      hospitalId: ''
+      modalVisiable:false,  //弹窗显示状态
+      saveDisable:false,    //确定按钮禁用状态
+      form:{
+          searchText: '', //搜索字段
+          hisName: '',
+          icdCode: ''
+      }
     };
   },
+  components:{
+      LtModal,
+      LinkContent
+  },
   created() {
     const { data } = this.$route.params;
     this.hospitaiName = (data && data.name) || '';
@@ -232,14 +257,15 @@ export default {
             filter: this.filter
           }
         : { currentPage: this.currentPage, pageSize: this.pageSize };
-      this.$router.push({
+      this.showModal()
+      /*this.$router.push({
         name: 'AddDisease',
         params: Object.assign(pam, {
           isEdit: false,
           data: { hospitalId: this.hospitalId },
           hospitaiName: this.hospitaiName
         })
-      });
+      });*/
     },
     // 修改诊断关联-跳转至编辑页面
     modifyRelation(row) {
@@ -251,14 +277,15 @@ export default {
             filter: this.filter
           }
         : { currentPage: this.currentPage, pageSize: this.pageSize };
-      this.$router.push({
+      /*this.$router.push({
         name: 'AddDisease',
         params: Object.assign(pam, {
           isEdit: true,
           data: { ...item, hospitalId: this.hospitalId },
           hospitaiName: this.hospitaiName
         })
-      });
+      });*/
+      this.showModal();
     },
     currentChange(next) {
       this.currentPage = next;
@@ -438,16 +465,84 @@ export default {
       //解决上传相同文件不触发change
       let inp = document.getElementById('upFile');
       inp.value = '';
-    }
+    },
+    showModal(){
+        this.modalVisiable=true
+    },
+    closeModal(){
+        this.modalVisiable=false
+    },
+    // 建立关联-参数处理
+    submitForm() {
+        console.log(this.$refs)
+        this.$refs.relationForm.$refs.innerForm.validate(valid => {
+            if (valid) {
+                const { searchText, hisName, icdCode } = this.form;
+                let params = {
+                    hisName: hisName,
+                    uniqueName: searchText,
+                    icdCode: icdCode,
+                    hospitalId: this.hospitalId
+                };
+                this.showSaveDialog(params);
+            } else {
+                console.log('error submit!!');
+                return false;
+            }
+        });
+    },
+      // 建立关联-映射关系是否已存在
+      showSaveDialog(params) {
+          this.saveDisable = true; //提交保存按钮不可点击,返回结果时才可点击,防止频繁发送请求
+          api
+              .diseaseIsExistRecord(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.saveOrUpdateDiseaseRecord(params).then(res => {
+              if (res.data.code === '0') {
+                  this.warning(res.data.msg || msg, type);
+                  this.initForm();
+                  this.$router.push({
+                      name: 'Disease',
+                      params: Object.assign({}, this.$route.params, {
+                          currentPage: 1
+                      })
+                  });
+              } else {
+                  this.warning(res.data.msg);
+              }
+              this.saveDisable = false;
+          });
+      },
   }
 };
 </script>
 
-<style lang="less">
+<style lang="less" scoped>
 @import '../../../less/admin.less';
-</style>
 
-<style lang="less" scoped>
 .delete {
   color: red;
 }

+ 89 - 18
src/components/cdssManage/drug/DrugManage.vue

@@ -61,6 +61,9 @@
         ></el-pagination>
       </div>
     </div>
+    <LtModal v-if="modalVisiable" :disabled="saveDisable" @confirm="submitForm" @close="closeModal">
+      <LinkContent :form="form" ref="relationForm" labelName="药品名称" termType="5" valName="drugNames"/>
+    </LtModal>
   </div>
 </template>
 
@@ -68,9 +71,15 @@
 import api from '@api/cdss.js';
 import config from '@api/config.js';
 import utils from '@api/utils.js';
+import LtModal from '@base/LtModal';
+import LinkContent from '@base/LinkContent';
 
 export default {
   name: 'DrugManage', //化验大小项和公表维护
+  components:{
+      LtModal,
+      LinkContent
+  },
   data: function() {
     return {
       list: [],
@@ -87,7 +96,14 @@ export default {
       uploadInfo: '导入',
       title: '药品关联维护 | ',
       hospitaiName: '',
-      hospitalId: ''
+      hospitalId: '',
+      modalVisiable:false,  //弹窗显示状态
+      saveDisable:false,    //确定按钮禁用状态
+      form:{
+          searchText: '', //搜索字段
+          hisName: '',
+          icdCode: ''
+      }
     };
   },
   created() {
@@ -233,14 +249,7 @@ export default {
             filter: this.filter
           }
         : { currentPage: this.currentPage, pageSize: this.pageSize };
-      this.$router.push({
-        name: 'AddDrug',
-        params: Object.assign(pam, {
-          isEdit: false,
-          data: { hospitalId: this.hospitalId },
-          hospitaiName: this.hospitaiName
-        })
-      });
+        this.showModal()
     },
     // 修改诊断关联-跳转至编辑页面
     modifyRelation(row) {
@@ -252,14 +261,7 @@ export default {
             filter: this.filter
           }
         : { currentPage: this.currentPage, pageSize: this.pageSize };
-      this.$router.push({
-        name: 'AddDrug',
-        params: Object.assign(pam, {
-          isEdit: true,
-          data: { ...item, hospitalId: this.hospitalId },
-          hospitaiName: this.hospitaiName
-        })
-      });
+        this.showModal()
     },
     currentChange(next) {
       this.currentPage = next;
@@ -455,7 +457,76 @@ export default {
       //解决上传相同文件不触发change
       let inp = document.getElementById('upFile');
       inp.value = '';
-    }
+    },
+    showModal(){
+        this.modalVisiable=true
+    },
+    closeModal(){
+        this.modalVisiable=false
+    },
+    // 建立关联-参数处理
+    submitForm() {
+        this.$refs.relationForm.$refs.innerForm.validate(valid => {
+            if (valid) {
+                const { searchText, hisName, form } = this.form;
+                let params = {
+                    hisName: hisName,
+                    uniqueName: searchText,
+                    form: form,
+                    hospitalId: this.hospitalId
+                };
+                this.showSaveDialog(params);
+            } else {
+                console.log('error submit!!');
+                return false;
+            }
+        });
+    },
+    // 建立关联-映射关系是否已存在
+    showSaveDialog(params) {
+        this.saveDisable = true; //提交保存按钮不可点击,返回结果时才可点击,防止频繁发送请求
+        api
+            .drugIsExistRecord(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.saveOrUpdateDrugRecord(params).then(res => {
+            if (res.data.code === '0') {
+                this.warning(res.data.msg || msg, type);
+                this.initForm();
+                this.$router.push({
+                    name: 'DrugManage',
+                    params: Object.assign({}, this.$route.params, {
+                        currentPage: 1
+                    })
+                });
+            } else {
+                this.warning(res.data.msg);
+            }
+            this.saveDisable = false;
+        });
+    },
   }
 };
 </script>

文件差异内容过多而无法显示
+ 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>

+ 1 - 1
src/components/common/Crumbs.vue

@@ -1,5 +1,5 @@
 <template>
-  <div class="container clearfix" :style="{'minWidth':minWidth?minWidth:'980px',position:fix?fix:'absolute'}">
+  <div class="container clearfix" :style="{'minWidth':minWidth?minWidth:'950px',position:fix?fix:'absolute'}">
     <img
       v-if="linkTo"
       class="return-btn fl"

+ 332 - 243
src/components/common/HomePage.vue

@@ -1,286 +1,375 @@
 <template>
-    <el-container :class="getRole">
-        <el-aside>
-            <div class="logo">
-                <p v-if="userLoginDTO&&userLoginDTO.type=='1'"><b>朗通后台管理系统</b></p>
-                <p v-if="userLoginDTO&&userLoginDTO.type=='0'"><b>DiagbotCloud</b></p>
-                <p v-if="userLoginDTO&&userLoginDTO.type=='0'"><b>后台管理系统</b></p>
-            </div>
-                 <lt-menu v-if="menuWrappers&&menuWrappers.length" v-bind:role="getRole"
-                 v-bind:data="menuWrappers"></lt-menu>
-            <div class="version">
-                <p>
-                    <span>版本信息:</span>
-                    <a href="javascript:void(0)" @click="showVersion">{{versionName}}</a>
-                    <i v-if="isNewV"><img src="../../images/new.png" alt=""/></i>
-                </p>
-            </div>
-        </el-aside>
-        <el-container>
-            <el-header class="clearfix">
-                <div class="title fl">
-                    <h2>{{organization&&organization.name}}</h2>
-                </div>
-                <div class="userInfo fr">
-                    <span class="username" @click="goCenter">{{userLoginDTO&&userLoginDTO.linkman}}</span>
-                    <lt-badge v-if="getRole=='user'" class="green" :authStatus="authStatus">
-                        {{authStatusName}}
-                    </lt-badge>
-                    <el-button type="info" size="small" plain @click="logout">退出</el-button>
-                </div>
-            </el-header>
-            <el-main>
-              <router-view v-if="ok" v-on:status-change="changeStatus"></router-view>
-            </el-main>
-        </el-container>
-        <el-dialog
-                title="版本信息"
-                :visible.sync="versionVisible"
-                width="50%"
-                class="version-info">
-            <div v-html="versionInfo"></div>
-        </el-dialog>
+  <el-container :class="getRole">
+    <el-aside v-show="onshow">
+      <div class="logo">
+        <p v-if="userLoginDTO && userLoginDTO.type == '1'">
+          <b>朗通后台管理系统</b>
+        </p>
+        <p v-if="userLoginDTO && userLoginDTO.type == '0'">
+          <b>DiagbotCloud</b>
+        </p>
+        <p v-if="userLoginDTO && userLoginDTO.type == '0'">
+          <b>后台管理系统</b>
+        </p>
+      </div>
+
+      <lt-menu
+        v-if="menuWrappers && menuWrappers.length"
+        v-bind:role="getRole"
+        v-bind:data="menuWrappers"
+      ></lt-menu>
+      <div class="version">
+        <p>
+          <span>版本信息:</span>
+          <a href="javascript:void(0)" @click="showVersion">{{
+            versionName
+          }}</a>
+          <i v-if="isNewV">
+            <img src="../../images/new.png" alt />
+          </i>
+        </p>
+      </div>
+    </el-aside>
+    <img
+      src="../../images/icon-collect-right.png"
+      v-show="!onshow"
+      class="collect"
+      @click="collect"
+    />
+    <img
+      src="../../images/icon-collect-left.png"
+      v-show="onshow"
+      class="collect-left"
+      @click="collect"
+    />
+    <el-container>
+      <el-header class="clearfix">
+        <div class="title fl">
+          <h2>{{ organization && organization.name }}</h2>
+        </div>
+        <div class="userInfo fr">
+          <span class="username" @click="goCenter">{{
+            userLoginDTO && userLoginDTO.linkman
+          }}</span>
+          <lt-badge
+            v-if="getRole == 'user'"
+            class="green"
+            :authStatus="authStatus"
+            >{{ authStatusName }}</lt-badge
+          >
+          <el-button type="info" size="small" plain @click="logout"
+            >退出</el-button
+          >
+        </div>
+      </el-header>
+      <el-main>
+        <router-view v-if="ok" v-on:status-change="changeStatus"></router-view>
+      </el-main>
     </el-container>
+    <el-dialog
+      title="版本信息"
+      :visible.sync="versionVisible"
+      width="50%"
+      class="version-info"
+    >
+      <div v-html="versionInfo"></div>
+    </el-dialog>
+  </el-container>
 </template>
 
 <script>
-  import LtMenu from '../common/Menu.vue';
-  import LtBadge from '@base/LtBadge.vue';
-  import api from '@api/index.js';
-  import userApi from '@api/user.js';
-  import Console from '@components/user/Console.vue';
-  import newIcon from '../../images/new.png';
-  export default {
-    name: 'homepage',
-    components: {
-      'lt-badge': LtBadge,
-      'lt-menu': LtMenu,
-      'console': Console
-    },
-    data: function () {
-      return {
-        menuWrappers: null,
-        organization: null,
-        userLoginDTO: null,
-        authStatus: null,
-        authStatusName:'',
-        ok:false,           //是否已获取到菜单
-        versionName:'',
-        versionVisible:false,
-        versionInfo:'',
-        isNewV:false,
-        version:null,       //版本信息接口返回的数据
+import LtMenu from "../common/Menu.vue";
+import LtBadge from "@base/LtBadge.vue";
+import api from "@api/index.js";
+import userApi from "@api/user.js";
+import Console from "@components/user/Console.vue";
+import newIcon from "../../images/new.png";
+export default {
+  name: "homepage",
+  components: {
+    "lt-badge": LtBadge,
+    "lt-menu": LtMenu,
+    console: Console
+  },
+  data: function () {
+    return {
+      menuWrappers: null,
+      organization: null,
+      userLoginDTO: null,
+      authStatus: null,
+      authStatusName: "",
+      ok: false, //是否已获取到菜单
+      versionName: "",
+      versionVisible: false,
+      versionInfo: "",
+      isNewV: false,
+      version: null, //版本信息接口返回的数据
+      onshow: true
+    };
+  },
+  computed: {
+    getRole: function () {
+      return this.userLoginDTO && this.userLoginDTO.type == "0"
+        ? "user"
+        : "admin";
+    }
+  },
+  created() {
+    //获取菜单
+    this.getMenuList();
+  },
+  watch: {
+    $route: function (to, from) {
+      if (from.name == "login") {
+        this.getMenuList();
       }
-    },
-    computed: {
-      getRole: function () {
-        return this.userLoginDTO && this.userLoginDTO.type == '0' ? 'user' : 'admin';
+      if (to.path == "/") {
+        // 退出时清空菜单
+        this.menuWrappers = [];
+        this.isNewV = false;
       }
+    }
+  },
+  mounted() {
+    let elSide = document.querySelector(".el-aside"),
+      tabWidth = document.querySelector(".collect-left");
+    tabWidth.style.left = elSide.offsetWidth - 36 + "px";
+    window.onresize = () => {
+      return (() => {
+        tabWidth.style.left = elSide.offsetWidth - 36 + "px";
+      })();
+    };
+  },
+  methods: {
+    collect() {
+      this.onshow = !this.onshow;
     },
-    created () {
-      //获取菜单
-      this.getMenuList();
-    },
-    watch:{
-      '$route': function(to,from){
-            if(from.name=='login'){
-              this.getMenuList();
-            }
-            if(to.path=='/'){       // 退出时清空菜单
-              this.menuWrappers=[];
-              this.isNewV = false;
-            }
-        }
-    },
-    methods: {
-      getMenuList(){
-        api.getAccessdMenu().then((res) => {
-          if (res.data.code == '0') {
+    getMenuList() {
+      api
+        .getAccessdMenu()
+        .then((res) => {
+          if (res.data.code == "0") {
             const data = res.data.data;
             this.ok = true;
-            const hasConcole=data.menuWrappers.find((it)=>{
-              return it.code.indexOf('-KZT')>-1;
+            const hasConcole = data.menuWrappers.find((it) => {
+              return it.code.indexOf("-KZT") > -1;
             });
             //this.hasConcole = hasConcole!=-1;
             this.menuWrappers = data.menuWrappers;
             this.organization = data.organization;
             this.userLoginDTO = data.userLoginDTO;
-            localStorage.setItem('userLoginDTO', JSON.stringify(data.userLoginDTO));
-            this.getRole=='user' && this.getAuthStatus();
-            if(hasConcole){
-              const url = this.getRole=='user'?'/user/YH-KZT':'/admin/LT-KZT';
-              this.$router.push({path:url});
+            localStorage.setItem(
+              "userLoginDTO",
+              JSON.stringify(data.userLoginDTO)
+            );
+            this.getRole == "user" && this.getAuthStatus();
+            if (hasConcole) {
+              const url =
+                this.getRole == "user" ? "/user/YH-KZT" : "/admin/LT-KZT";
+              this.$router.push({ path: url });
             }
             this.getVersionInfo();
           }
-        }).catch((error) => {
+        })
+        .catch((error) => {
           console.log(error);
         });
-      },
-      isNewVersion(){           //判断是否为新版
-
-      },
-      getVersionInfo(){
-        const getInfo = this.getRole=='user'?api.getVersionOuter:api.getVersionInner;
-        getInfo().then((res)=>{
-          if (res.data.code == '0') {
-            const data = res.data.data;
-            this.fillVersionInfo(data);
-          }else{
-            this.$message(res.data.msg);
-          }
-        });
-      },
-      fillVersionInfo(data){
-        //进入时获取版本信息,如版本时间与localStorage中不一致或者一致但localStorage中未被点过,
-        // 则要显示更新图标
-        let htl = data.refreshTime?'<h3>当前版本:'+data.name+'<span>'+data.refreshTime.substr(0,10)+'</span></h3>':'<h3>当前版本:'+data.name+'</h3>';
-        let prags = data.detail||[];
-        this.versionName = data.name;
-        const versionTime = JSON.parse(localStorage.getItem('versionInfo-'+this.userLoginDTO.username));
-        if(!versionTime||(data.refreshTime===versionTime.date&&!versionTime.showed)){
-          this.isNewV = true;
-        }else{
-          this.isNewV = false
-        }
-        for(let i=0;i<prags.length;i++){
-            htl += '<p>'+prags[i].title+'</p><p>'+prags[i].description+'</p>';
+    },
+    isNewVersion() {
+      //判断是否为新版
+    },
+    getVersionInfo() {
+      const getInfo =
+        this.getRole == "user" ? api.getVersionOuter : api.getVersionInner;
+      getInfo().then((res) => {
+        if (res.data.code == "0") {
+          const data = res.data.data;
+          this.fillVersionInfo(data);
+        } else {
+          this.$message(res.data.msg);
         }
-        this.versionInfo = htl;
-        this.version = {date:data.refreshTime};
-      },
-      showVersion(){
-        this.versionVisible = true;
-        this.version.showed = true;
+      });
+    },
+    fillVersionInfo(data) {
+      //进入时获取版本信息,如版本时间与localStorage中不一致或者一致但localStorage中未被点过,
+      // 则要显示更新图标
+      let htl = data.refreshTime
+        ? "<h3>当前版本:" +
+          data.name +
+          "<span>" +
+          data.refreshTime.substr(0, 10) +
+          "</span></h3>"
+        : "<h3>当前版本:" + data.name + "</h3>";
+      let prags = data.detail || [];
+      this.versionName = data.name;
+      const versionTime = JSON.parse(
+        localStorage.getItem("versionInfo-" + this.userLoginDTO.username)
+      );
+      if (
+        !versionTime ||
+        (data.refreshTime === versionTime.date && !versionTime.showed)
+      ) {
+        this.isNewV = true;
+      } else {
         this.isNewV = false;
-        localStorage.setItem('versionInfo-'+this.userLoginDTO.username,JSON.stringify(this.version));
-      },
-      /*redirectPage(){
+      }
+      for (let i = 0; i < prags.length; i++) {
+        htl +=
+          "<p>" + prags[i].title + "</p><p>" + prags[i].description + "</p>";
+      }
+      this.versionInfo = htl;
+      this.version = { date: data.refreshTime };
+    },
+    showVersion() {
+      this.versionVisible = true;
+      this.version.showed = true;
+      this.isNewV = false;
+      localStorage.setItem(
+        "versionInfo-" + this.userLoginDTO.username,
+        JSON.stringify(this.version)
+      );
+    },
+    /*redirectPage(){
         const url = this.getRole=='user'?'/user':'/admin';
         this.$router.push({path:url});
       },*/
-      changeStatus(text){       //账号信息中提交认证后修改状态
-        this.authStatus = 2;
-        this.authStatusName = text;
-      },
-      goCenter(){
-        const url = this.getRole=='user'?'':'/admin/LT-GRZX';
-        this.$router.push({path:url});
-      },
-      getAuthStatus() {
-        //获取用户认证状态
-        userApi.getUserAuthStatus().then((res) => {
-          if (res.data.code == '0') {
+    changeStatus(text) {
+      //账号信息中提交认证后修改状态
+      this.authStatus = 2;
+      this.authStatusName = text;
+    },
+    goCenter() {
+      const url = this.getRole == "user" ? "" : "/admin/LT-GRZX";
+      this.$router.push({ path: url });
+    },
+    getAuthStatus() {
+      //获取用户认证状态
+      userApi
+        .getUserAuthStatus()
+        .then((res) => {
+          if (res.data.code == "0") {
             const data = res.data.data;
             // this.authStatus = data[0];
             this.authStatusName = data.authStatusName;
             this.authStatus = data.authStatus;
           }
-        }).catch((error) => {
-          console.log(error)
+        })
+        .catch((error) => {
+          console.log(error);
         });
-      },
-      logout(){//退出
-        localStorage.removeItem('token');
-        localStorage.removeItem('menuPath');
-        this.$router.push({path:'/'});
-      }
+    },
+    logout() {
+      //退出
+      localStorage.removeItem("token");
+      localStorage.removeItem("menuPath");
+      this.$router.push({ path: "/" });
     }
   }
+};
 </script>
 
 <style lang="less">
+@import "../../less/common.less";
+.collect {
+  width: 36px;
+  height: 32px;
+  position: fixed;
+  left: 0;
+  top: 70%;
+  z-index: 20;
+}
+.collect-left {
+  width: 36px;
+  height: 32px;
+  position: fixed;
+  // left: calc(20% - 36px);
+  top: 65%;
+  z-index: 20;
+}
+.user .el-menu-item.is-active {
+  color: @userBase;
+}
 
-    @import '../../less/common.less';
-
-    .user .el-menu-item.is-active {
-        color: @userBase;
-    }
-
-    .admin .el-menu-item.is-active {
-        color: @adminBase;
-    }
-    .admin .username{
-        cursor: pointer;
-    }
-    .version-info h3{
-        font-size: 14px;
-        margin-bottom: 20px;
-        span{
-            float: right;
-            font-weight: normal;
-        }
-    }
+.admin .el-menu-item.is-active {
+  color: @adminBase;
+}
+.admin .username {
+  cursor: pointer;
+}
+.version-info h3 {
+  font-size: 14px;
+  margin-bottom: 20px;
+  span {
+    float: right;
+    font-weight: normal;
+  }
+}
 </style>
 <style lang="less" scoped>
-    @import '../../less/common.less';
-    .el-menu-vertical-demo.el-menu{
-        height: calc(100% - 120px);
-        overflow-y: auto;
-    }
-    .version{
-        position: fixed;
-        bottom: 0;
-        width: @aside-width;
-        min-width: 270px;
-        font-size: 12px;
-        /*text-indent: 50px;*/
-        text-align: center;
-        height:54px;
-        line-height: 54px;
-        background: #fff;
-        i{
-            display: inline-block;
-            width: 20px;
-            height: 16px;
-            img{
-                vertical-align: text-top;
-            }
-        }
-    }
-    .user .version a{
-        color: @userBase;
-    }
-    .admin .version a{
-        color: @adminBase;
-    }
-    .user .logo {
-        background: @userBase;
-
-    p {
-        font-size: 16px;
-        line-height: normal
+@import "../../less/common.less";
+.el-menu-vertical-demo.el-menu {
+  height: calc(100% - 120px);
+  overflow-y: auto;
+}
+.version {
+  position: fixed;
+  bottom: 0;
+  width: @aside-width;
+  min-width: 270px;
+  font-size: 12px;
+  /*text-indent: 50px;*/
+  text-align: center;
+  height: 54px;
+  line-height: 54px;
+  background: #fff;
+  i {
+    display: inline-block;
+    width: 20px;
+    height: 16px;
+    img {
+      vertical-align: text-top;
     }
+  }
+}
+.user .version a {
+  color: @userBase;
+}
+.admin .version a {
+  color: @adminBase;
+}
+.user .logo {
+  background: @userBase;
 
-    }
-    .admin .logo {
-        background: @adminBase;
-
-    p {
-        font-size: 18px;
-        line-height: 40px;
-    }
-
-    }
-    .title {
-
-    h2 {
-        display: inline-block;
-        line-height: 60px;
-        font-size: 18px;
-    }
+  p {
+    font-size: 16px;
+    line-height: normal;
+  }
+}
+.admin .logo {
+  background: @adminBase;
 
-    }
-    .block {
-        height: 40px;
-        width: 100%;
-        background: #fff;
-        box-shadow: 0px 1px 2px #c9c9c9;
-    }
-		.el-main{
-			padding: 0;
-		}
-    .el-button{
-      margin-left: 15px;
-    }
+  p {
+    font-size: 18px;
+    line-height: 40px;
+  }
+}
+.title {
+  h2 {
+    display: inline-block;
+    line-height: 60px;
+    font-size: 18px;
+  }
+}
+.block {
+  height: 40px;
+  width: 100%;
+  background: #fff;
+  box-shadow: 0px 1px 2px #c9c9c9;
+}
+.el-main {
+  padding: 0;
+}
+.el-button {
+  margin-left: 15px;
+}
 </style>

+ 288 - 0
src/components/knowledgeExtra/AddAssess/ScoreResultsTable.vue

@@ -0,0 +1,288 @@
+<style lang="less" scoped>
+.ScoreResults {
+  width: 100%;
+  // padding: 30px 30px 0 30px;
+  box-sizing: border-box;
+  border-top: 10px solid rgba(203, 207, 212, 0.3);
+  h4 {
+    font-size: 14px;
+    border-bottom: 1px solid rgba(203, 207, 212, 0.3);
+    padding: 10px 35px;
+  }
+  .table_box {
+    padding: 0 35px;
+    margin-top: -10px;
+  }
+  /deep/.el-table th,
+  .el-table tr {
+    height: 50px;
+    background: #e3eaf4;
+  }
+  /deep/.el-table th {
+    padding: 0;
+  }
+  .btn_box {
+    width: 100%;
+    height: 100%;
+    padding: 20px 0;
+    display: flex;
+    align-items: center;
+    justify-content: space-around;
+    .btn_div {
+      flex: 1;
+      display: flex;
+      align-items: center;
+      justify-content: center;
+    }
+    img {
+      width: 16px;
+      height: 16px;
+      cursor: pointer;
+    }
+  }
+  .range_box {
+    display: flex;
+    position: relative;
+    .range_child {
+      flex: 1;
+      &:nth-child(1) {
+        margin-right: 20px;
+      }
+      /deep/.el-form-item__content {
+        position: static;
+      }
+      /deep/ .is-error .el-form-item__error {
+        left: 70px;
+      }
+    }
+  }
+  /deep/.el-input--mini .el-input__inner {
+    width: 100%;
+  }
+  /deep/.el-form-item--mini.el-form-item,
+  .el-form-item--small.el-form-item {
+    padding: 18px 0;
+  }
+  .custom_table_header {
+    vertical-align: middle;
+    &::before {
+      content: "*";
+      color: red;
+      font-size: 12px;
+      margin-right: 4px;
+    }
+  }
+}
+/deep/ .el-textarea__inner {
+  overflow-y: hidden;
+}
+.showScroll {
+  /deep/ .el-textarea__inner {
+    overflow-y: auto;
+  }
+}
+/deep/ .el-input--mini {
+  font-size: 14px;
+}
+/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;
+}
+</style>
+<template>
+  <div class="ScoreResults">
+    <h4>得分结果:</h4>
+    <div class="table_box">
+      <el-table
+        :data="list"
+        header-row-class-name="header_row_class_name"
+        border
+        style="width: 100%; margin: 20px 0"
+      >
+        <el-table-column prop="orderNo" width="70px" label="">
+          <template slot-scope="scope">
+            <div class="btn_box">
+              <div class="btn_div">
+                <img
+                  @click="$emit('CHANEG_SCORE_RESULT', 1, scope.$index)"
+                  src="@/images/add-new-rule-sub.png"
+                  alt=""
+                />
+              </div>
+              <div class="btn_div" v-if="list.length > 1">
+                <img
+                  @click="$emit('CHANEG_SCORE_RESULT', 0, scope.$index)"
+                  src="@/images/add-new-rule-del.png"
+                  alt=""
+                />
+              </div>
+            </div>
+          </template>
+        </el-table-column>
+        <el-table-column prop="content" label="得分范围">
+          <template slot="header">
+            <div class="custom_table_header">得分范围</div>
+          </template>
+          <template slot-scope="scope">
+            <!-- <div>{{ scope.row.content.max }},{{ scope.row.content.min }}</div> -->
+            <div class="range_box">
+              <div class="range_child">
+                <el-form-item
+                  label="大于等于:"
+                  label-width="80px"
+                  :prop="`scoreresultsdatas[${scope.$index}].content.min`"
+                  :rules="[
+                    {
+                      validator: (rule, value, callback) => {
+                        validateMinMax(scope, rule, value, callback);
+                      },
+                      trigger: ['blur']
+                    }
+                  ]"
+                >
+                  <el-input
+                    type="number"
+                    :id="`scoreresultsdatas[${scope.$index}].content.min`"
+                    @input="
+                      handleInput($event, scope.$index);
+                      scope.row.content.min = numInputInput(
+                        scope.row.content.min
+                      );
+                    "
+                    v-model.number="scope.row.content.min"
+                    clearable
+                    placeholder="请输入"
+                  ></el-input>
+                </el-form-item>
+              </div>
+              <div class="range_child">
+                <el-form-item
+                  label="小于等于:"
+                  label-width="80px"
+                  :prop="`scoreresultsdatas[${scope.$index}].content.max`"
+                  :rules="[
+                    {
+                      validator: (rule, value, callback) => {
+                        validateMinMax(scope, rule, value, callback);
+                      },
+                      trigger: ['blur']
+                    }
+                  ]"
+                >
+                  <el-input
+                    type="number"
+                    :id="`scoreresultsdatas[${scope.$index}].content.max`"
+                    @input="
+                      handleInput($event, scope.$index);
+                      scope.row.content.max = numInputInput(
+                        scope.row.content.max
+                      );
+                    "
+                    v-model.number="scope.row.content.max"
+                    clearable
+                    placeholder="请输入"
+                  ></el-input>
+                </el-form-item>
+              </div>
+            </div>
+          </template>
+        </el-table-column>
+        <el-table-column prop="result" label="结果">
+          <template slot="header">
+            <div class="custom_table_header">结果</div>
+          </template>
+          <template slot-scope="scope">
+            <el-form-item
+              :prop="`scoreresultsdatas[${scope.$index}].result`"
+              :rules="rules.soureResult"
+            >
+              <el-input
+                :id="`scoreresultsdatas[${scope.$index}].result`"
+                type="textarea"
+                rows="1"
+                :autosize="true"
+                resize="none"
+                v-model="scope.row.result"
+                clearable
+                maxlength="10"
+                placeholder="请输入"
+              ></el-input>
+            </el-form-item>
+          </template>
+        </el-table-column>
+        <el-table-column prop="pushInfo" label="建议">
+          <template slot-scope="scope">
+            <el-form-item
+              :prop="`scoreresultsdatas[${scope.$index}].pushInfo`"
+              :rules="rules.sourePushInfo"
+              class="showScroll"
+            >
+              <el-input
+                :id="`scoreresultsdatas[${scope.$index}].pushInfo`"
+                type="textarea"
+                rows="2"
+                resize="none"
+                v-model="scope.row.pushInfo"
+                clearable
+                maxlength="500"
+                placeholder="请输入"
+              ></el-input>
+            </el-form-item>
+          </template>
+        </el-table-column>
+      </el-table>
+    </div>
+  </div>
+</template>
+
+<script>
+import rules from "./rules";
+import { numInputInput } from "./util";
+export default {
+  data() {
+    return {
+      rules: rules
+    };
+  },
+  methods: {
+    numInputInput,
+    handleInput(val, i) {
+      // `scoreresultsdatas[${scope.$index}].content.min`
+      this.$emit("clearValidate", [
+        `scoreresultsdatas[${i}].content.max`,
+        `scoreresultsdatas[${i}].content.min`
+      ]);
+    },
+    resizeTable() {
+      setTimeout(() => {
+        this.list.forEach((item, index) => {
+          this.$refs[`scoreresultsdatas[${index}].pushInfo`] &&
+            this.$refs[`scoreresultsdatas[${index}].pushInfo`].resizeTextarea();
+          this.$refs[`scoreresultsdatas[${index}].result`] &&
+            this.$refs[`scoreresultsdatas[${index}].result`].resizeTextarea();
+        });
+      }, 500);
+    },
+    validateMinMax(scope, rule, value, callback) {
+      const { min, max } = scope.row.content;
+      if (min || max) {
+        callback();
+      } else {
+        callback(new Error("大于和小于至少完整填写一个"));
+      }
+    }
+  },
+  props: {
+    list: {
+      default: []
+    }
+  }
+};
+</script>
+

文件差异内容过多而无法显示
+ 1314 - 0
src/components/knowledgeExtra/AddAssess/index.vue


+ 53 - 0
src/components/knowledgeExtra/AddAssess/rules.js

@@ -0,0 +1,53 @@
+export default {
+  title: [
+    { required: true, message: "请输入标题", trigger: ["blur"] },
+  ],
+  tableFactor: [
+    { required: true, message: "请输入系数", trigger: ["blur"] },
+  ],
+  tableConstant: [
+    { required: true, message: "请输入常数", trigger: ["blur"] },
+  ],
+  // 问题选项
+  issueContent: [
+    { required: true, message: "请输入问题内容", trigger: ["blur"] },
+  ],
+  issueFactor: [
+    { required: true, message: "请输入系数", trigger: ["blur"] },
+  ],
+  issueConstant: [
+    { required: true, message: "请输入常数", trigger: ["blur"] },
+  ],
+  content: [
+    { required: true, message: "请输入选项内容", trigger: ["blur"] },
+  ],
+  score: [
+    { required: true, message: "请输入分值", trigger: ["blur"] },
+  ],
+  ruleCode:[
+    { required: true, message: "请输入编码", trigger: ["change"] },
+  ],
+  result: [
+    { required: true, message: "请输入结果", trigger: ["blur"] },
+  ],
+  pushInfo: [
+    { required: true, message: "请输入建议", trigger: ["blur"] },
+  ],
+  // 概述
+  fwbContent: [
+    { required: true, message: "请输入概述", trigger: ["blur"] },
+  ],
+  // 得分结果
+  max: [
+    { required: true, message: "请输入大于值", trigger: ["blur"] },
+  ],
+  min: [
+    { required: true, message: "请输入小于值", trigger: ["blur"] },
+  ],
+  soureResult: [
+    { required: true, message: "请输入结果", trigger: ["blur"] },
+  ],
+  sourePushInfo: [
+    { required: true, message: "请输入建议", trigger: ["blur"] },
+  ],
+}

+ 751 - 0
src/components/knowledgeExtra/AddAssess/scale-table.vue

@@ -0,0 +1,751 @@
+
+<style lang="less" scoped>
+.scaleTable {
+  min-height: 100px;
+  margin-top: -10px;
+  .table_box {
+    padding: 0 35px;
+  }
+  .btn_box {
+    width: 100%;
+    height: 100%;
+    display: flex;
+    align-items: center;
+    justify-content: space-around;
+    .btn_div {
+      flex: 1;
+      display: flex;
+      align-items: center;
+      justify-content: center;
+    }
+    img {
+      width: 16px;
+      height: 16px;
+      cursor: pointer;
+    }
+  }
+  .table_select_btn {
+    display: flex;
+    flex-direction: column;
+    justify-content: center;
+    align-items: center;
+    /deep/ .el-button--text {
+      padding: 3px 0;
+      margin: 0;
+    }
+  }
+  /deep/.el-input--mini .el-input__inner {
+    width: 100%;
+  }
+  /deep/.el-table th {
+    padding: 0;
+  }
+}
+/deep/.el-table th,
+.el-table tr {
+  height: 50px;
+  background: #e3eaf4;
+}
+/deep/.el-table th {
+  padding: 0;
+}
+.custom_table_header {
+  vertical-align: middle;
+  &::before {
+    content: "*";
+    color: red;
+    font-size: 12px;
+    margin-right: 4px;
+  }
+}
+/deep/.el-form-item--mini.el-form-item,
+.el-form-item--small.el-form-item {
+  padding: 18px 0;
+  position: static;
+}
+/deep/ .el-textarea__inner {
+  overflow-y: hidden;
+}
+.showScroll {
+  /deep/ .el-textarea__inner {
+    overflow-y: auto;
+  }
+}
+.cell_center_box {
+  /deep/ .el-input__inner {
+    // width: 40px;
+    text-align: center;
+  }
+}
+/deep/.el-select--mini {
+  width: 100%;
+}
+/deep/ .el-input--mini {
+  font-size: 14px;
+}
+/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;
+}
+</style>
+<template>
+  <div class="scaleTable" :id="`scaleTableRef[${tableIndex}]`">
+    <div class="table_box">
+      <el-table
+        v-if="tableShow"
+        :data="tableData"
+        header-row-class-name="header_row_class_name"
+        border
+        style="width: 100%; margin: 20px 0"
+        :span-method="objectSpanMethod"
+        :ref="`scaleTableRef[${tableIndex}]`"
+      >
+        <el-table-column prop="issueId" label="组" width="90px">
+          <template slot-scope="scope">
+            <div class="btn_box">
+              <div class="btn_div">
+                <img
+                  @click="
+                    $emit('CHANGE_TABLE_ROW', {
+                      type: 4,
+                      tableIndex,
+                      rowIndex: scope.$index,
+                      groupId: scope.row.groupId
+                    })
+                  "
+                  src="@/images/icon-copy.png"
+                  alt=""
+                  title="复制"
+                />
+              </div>
+              <div class="btn_div">
+                <img
+                  @click="
+                    $emit('CHANGE_TABLE_ROW', {
+                      type: 1,
+                      tableIndex,
+                      rowIndex: scope.$index,
+                      groupId: scope.row.groupId
+                    })
+                  "
+                  src="@/images/add-new-rule-sub.png"
+                  alt=""
+                  title="添加"
+                />
+              </div>
+              <div
+                class="btn_div"
+                v-if="imposeRestrictionsRemoveOnGroup(scope.row.groupId)"
+              >
+                <img
+                  @click="
+                    $emit('CHANGE_TABLE_ROW', {
+                      type: -1,
+                      tableIndex,
+                      groupId: scope.row.groupId
+                    })
+                  "
+                  src="@/images/add-new-rule-del.png"
+                  alt=""
+                  title="删除"
+                />
+              </div>
+            </div>
+          </template>
+        </el-table-column>
+        <el-table-column prop="groupId" label="问题" width="90px">
+          <template slot-scope="scope">
+            <div class="btn_box">
+              <div class="btn_div">
+                <img
+                  @click="
+                    $emit('CHANGE_TABLE_ROW', {
+                      type: 5,
+                      tableIndex,
+                      rowIndex: scope.$index,
+                      groupId: scope.row.groupId,
+                      issueId: scope.row.issueId
+                    })
+                  "
+                  src="@/images/icon-copy.png"
+                  alt=""
+                  title="复制"
+                />
+              </div>
+              <div class="btn_div">
+                <img
+                  @click="
+                    $emit('CHANGE_TABLE_ROW', {
+                      type: 2,
+                      tableIndex,
+                      rowIndex: scope.$index,
+                      groupId: scope.row.groupId,
+                      issueId: scope.row.issueId
+                    })
+                  "
+                  src="@/images/add-new-rule-sub.png"
+                  alt=""
+                  title="添加"
+                />
+              </div>
+              <div
+                class="btn_div"
+                v-if="
+                  imposeRestrictionsRemoveOnIssue({
+                    groupId: scope.row.groupId,
+                    issueId: scope.row.issueId
+                  })
+                "
+              >
+                <img
+                  @click="
+                    $emit('CHANGE_TABLE_ROW', {
+                      type: -2,
+                      tableIndex,
+                      issueId: scope.row.issueId
+                    })
+                  "
+                  src="@/images/add-new-rule-del.png"
+                  alt=""
+                  title="删除"
+                />
+              </div>
+            </div>
+          </template>
+        </el-table-column>
+        <el-table-column prop="two_selectType" label="选择" width="70px">
+          <template slot-scope="scope">
+            <div class="table_select_btn">
+              <el-button
+                @click="handleSelectTypeBtn(scope.$index, 21)"
+                :style="scope.row.two_selectType != 21 ? { color: '#999' } : ''"
+                type="text"
+                >单选</el-button
+              >
+              <el-button
+                :style="scope.row.two_selectType != 22 ? { color: '#999' } : ''"
+                @click="handleSelectTypeBtn(scope.$index, 22)"
+                type="text"
+                >多选</el-button
+              >
+            </div>
+          </template>
+        </el-table-column>
+        <el-table-column prop="two_content" label="问题内容">
+          <template slot="header">
+            <div class="custom_table_header">问题内容</div>
+          </template>
+          <template slot-scope="scope">
+            <el-form-item
+              :prop="`klScaleParent[${tableIndex}].klScaleSaveGroup[${scope.$index}].two_content`"
+              :rules="rules.issueContent"
+            >
+              <el-input
+                :ref="`klScaleParent[${tableIndex}].klScaleSaveGroup[${scope.$index}].two_content`"
+                :id="`klScaleParent[${tableIndex}].klScaleSaveGroup[${scope.$index}].two_content`"
+                type="textarea"
+                rows="1"
+                :autosize="true"
+                resize="none"
+                v-model="scope.row.two_content"
+                clearable
+                maxlength="300"
+                placeholder="请输入"
+                @input="
+                  changeDataFun($event, tableIndex, scope.$index, 'two_content')
+                "
+              ></el-input>
+            </el-form-item>
+          </template>
+        </el-table-column>
+        <el-table-column
+          prop="two_factor"
+          label="系数"
+          width="60px"
+          v-if="tableResultType === 1"
+        >
+          <template slot="header">
+            <div class="custom_table_header">系数</div>
+          </template>
+          <template slot-scope="scope">
+            <div class="cell_center_box">
+              <el-form-item
+                :prop="`klScaleParent[${tableIndex}].klScaleSaveGroup[${scope.$index}].two_factor`"
+                :rules="rules.issueFactor"
+                :show-message="false"
+              >
+                <el-input
+                  :id="`klScaleParent[${tableIndex}].klScaleSaveGroup[${scope.$index}].two_factor`"
+                  type="number"
+                  v-model.number="scope.row.two_factor"
+                  placeholder="请输入"
+                  title=""
+                  @input="
+                    changeDataFun(
+                      $event,
+                      tableIndex,
+                      scope.$index,
+                      'two_factor'
+                    );
+                    scope.row.two_factor = numInputInput(scope.row.two_factor);
+                  "
+                ></el-input>
+              </el-form-item>
+            </div>
+          </template>
+        </el-table-column>
+        <el-table-column
+          prop="two_constant"
+          label="常数"
+          width="60px"
+          v-if="tableResultType === 1"
+        >
+          <template slot="header">
+            <div class="custom_table_header">常数</div>
+          </template>
+          <template slot-scope="scope">
+            <div class="cell_center_box">
+              <el-form-item
+                :prop="`klScaleParent[${tableIndex}].klScaleSaveGroup[${scope.$index}].two_constant`"
+                :rules="rules.issueConstant"
+                :show-message="false"
+              >
+                <el-input
+                  type="number"
+                  :id="`klScaleParent[${tableIndex}].klScaleSaveGroup[${scope.$index}].two_constant`"
+                  v-model.number="scope.row.two_constant"
+                  placeholder="请输入"
+                  style="text-align: center"
+                  @input="
+                    changeDataFun(
+                      $event,
+                      tableIndex,
+                      scope.$index,
+                      'two_constant'
+                    );
+                    scope.row.two_constant = numInputInput(
+                      scope.row.two_constant
+                    );
+                  "
+                ></el-input>
+              </el-form-item>
+            </div>
+          </template>
+        </el-table-column>
+        <el-table-column prop="issueId" label="选项个数" width="80px">
+          <template slot-scope="scope">
+            <div>
+              {{ optionLength(scope.row.issueId) }}
+            </div>
+          </template>
+        </el-table-column>
+        <el-table-column prop="orderNo" label="选项" width="70px">
+          <template slot-scope="scope">
+            <div class="btn_box">
+              <div class="btn_div">
+                <img
+                  @click="
+                    $emit('CHANGE_TABLE_ROW', {
+                      type: 3,
+                      tableIndex,
+                      rowIndex: scope.$index,
+                      groupId: scope.row.groupId,
+                      issueId: scope.row.issueId
+                    })
+                  "
+                  src="@/images/add-new-rule-sub.png"
+                  alt=""
+                  title="添加"
+                />
+              </div>
+              <div
+                class="btn_div"
+                v-if="imposeRestrictionsRemoveOnOption(scope.row.issueId)"
+              >
+                <img
+                  @click="
+                    $emit('CHANGE_TABLE_ROW', {
+                      type: -3,
+                      tableIndex,
+                      rowIndex: scope.$index
+                    })
+                  "
+                  src="@/images/add-new-rule-del.png"
+                  alt=""
+                  title="删除"
+                />
+              </div>
+            </div>
+          </template>
+        </el-table-column>
+        <el-table-column
+          prop="content"
+          label="选项内容"
+          :width="tableResultType === 1 ? '200px' : ''"
+        >
+          <template slot="header">
+            <div class="custom_table_header">选项内容</div>
+          </template>
+          <template slot-scope="scope">
+            <el-form-item
+              :prop="`klScaleParent[${tableIndex}].klScaleSaveGroup[${scope.$index}].content`"
+              :rules="rules.content"
+            >
+              <el-input
+                :id="`klScaleParent[${tableIndex}].klScaleSaveGroup[${scope.$index}].content`"
+                type="textarea"
+                rows="1"
+                :autosize="true"
+                resize="none"
+                v-model="scope.row.content"
+                clearable
+                maxlength="300"
+                placeholder="请输入"
+              ></el-input>
+            </el-form-item>
+          </template>
+        </el-table-column>
+        <el-table-column
+          prop="content"
+          label="编码"
+          :width="tableResultType === 2 ? '200px' : '100px'"
+          v-if="tableResultType === 1"
+        >
+          <template slot-scope="scope">
+            <el-form-item
+              ><el-select
+                clearable
+                remote
+                filterable
+                :remote-method="searchRuleCode"
+                @focus="ruleCodeFocus(scope.$index)"
+                v-model.trim="scope.row.ruleCode"
+              >
+                <el-option
+                  v-for="item in scope.row.ruleCodeList"
+                  :key="item.code"
+                  :value="item.code"
+                >
+                  <span>{{ item.name }}</span>
+                  <span>({{ item.code }})</span>
+                </el-option>
+              </el-select>
+            </el-form-item>
+          </template>
+        </el-table-column>
+        <el-table-column
+          prop="content"
+          label="分值"
+          width="90px"
+          v-if="tableResultType === 1"
+        >
+          <template slot="header">
+            <div class="custom_table_header">分值</div>
+          </template>
+          <template slot-scope="scope">
+            <el-form-item
+              :prop="`klScaleParent[${tableIndex}].klScaleSaveGroup[${scope.$index}].score`"
+              :rules="rules.score"
+            >
+              <el-input
+                :id="`klScaleParent[${tableIndex}].klScaleSaveGroup[${scope.$index}].score`"
+                type="number"
+                maxlength="6"
+                @input="scope.row.score = numInputInput(scope.row.score)"
+                v-model.number="scope.row.score"
+                clearable
+                placeholder="请输入"
+              ></el-input>
+            </el-form-item>
+          </template>
+        </el-table-column>
+        <el-table-column
+          prop="result"
+          label="结果"
+          width="200px"
+          v-if="tableResultType === 2"
+        >
+          <template slot="header">
+            <div class="custom_table_header">结果</div>
+          </template>
+          <template slot-scope="scope">
+            <el-form-item
+              :prop="`klScaleParent[${tableIndex}].klScaleSaveGroup[${scope.$index}].result`"
+              :rules="rules.result"
+            >
+              <el-input
+                :id="`klScaleParent[${tableIndex}].klScaleSaveGroup[${scope.$index}].result`"
+                type="textarea"
+                rows="1"
+                :autosize="true"
+                resize="none"
+                v-model="scope.row.result"
+                clearable
+                maxlength="10"
+                placeholder="请输入"
+              ></el-input>
+            </el-form-item>
+          </template>
+        </el-table-column>
+        <el-table-column
+          prop="pushInfo"
+          label="建议"
+          v-if="tableResultType === 2"
+        >
+          <template slot-scope="scope">
+            <el-form-item
+              :prop="`klScaleParent[${tableIndex}].klScaleSaveGroup[${scope.$index}].pushInfo`"
+              :rules="rules.pushInfo"
+              class="showScroll"
+            >
+              <el-input
+                :id="`klScaleParent[${tableIndex}].klScaleSaveGroup[${scope.$index}].pushInfo`"
+                type="textarea"
+                rows="2"
+                resize="none"
+                v-model="scope.row.pushInfo"
+                clearable
+                maxlength="500"
+                placeholder="请输入"
+              ></el-input>
+            </el-form-item>
+          </template>
+        </el-table-column>
+      </el-table>
+    </div>
+  </div>
+</template>
+
+<script>
+import rules from "./rules";
+import api from "@api/knowledgeTree.js";
+import { numInputInput } from "./util";
+export default {
+  name: "scaleTable",
+  data() {
+    return {
+      tableShow: true,
+      rules: rules,
+      ruleCodeIndex: null
+    };
+  },
+  methods: {
+    numInputInput,
+    changeDataFun(val, tableIndex, rowIndex, name) {
+      this.$emit("CHANGE_ISSUE_CONTENT", {
+        value: val,
+        tableIndex,
+        rowIndex,
+        name
+      });
+    },
+    resizeTable() {
+      setTimeout(() => {
+        this.tableData.forEach((item, index) => {
+          this.$refs[
+            `klScaleParent[${this.tableIndex}].klScaleSaveGroup[${index}].content`
+          ] &&
+            this.$refs[
+              `klScaleParent[${this.tableIndex}].klScaleSaveGroup[${index}].content`
+            ].resizeTextarea();
+          this.$refs[
+            `klScaleParent[${this.tableIndex}].klScaleSaveGroup[${index}].two_content`
+          ] &&
+            this.$refs[
+              `klScaleParent[${this.tableIndex}].klScaleSaveGroup[${index}].two_content`
+            ].resizeTextarea();
+          this.$refs[
+            `klScaleParent[${this.tableIndex}].klScaleSaveGroup[${index}].result`
+          ] &&
+            this.$refs[
+              `klScaleParent[${this.tableIndex}].klScaleSaveGroup[${index}].result`
+            ].resizeTextarea();
+          this.$refs[
+            `klScaleParent[${this.tableIndex}].klScaleSaveGroup[${index}].pushInfo`
+          ] &&
+            this.$refs[
+              `klScaleParent[${this.tableIndex}].klScaleSaveGroup[${index}].pushInfo`
+            ].resizeTextarea();
+        });
+      }, 100);
+    },
+    ruleCodeFocus(index) {
+      this.ruleCodeIndex = index;
+    },
+    searchRuleCode(val) {
+      api
+        .searchRuleCode({ name: val === "" ? null : val, type: 1 })
+        .then((res) => {
+          if (res.data.code == "0") {
+            this.$emit(
+              "CHANGE_FORM_DATA",
+              this.tableIndex,
+              this.ruleCodeIndex,
+              "ruleCodeList",
+              res.data.data
+            );
+          }
+        });
+    },
+    addGroup() {},
+    // 单选、多选
+    handleSelectTypeBtn(index, type) {
+      this.$emit(
+        "CHANGE_FORM_DATA",
+        this.tableIndex,
+        index,
+        "two_selectType",
+        type
+      );
+      this.changeDataFun(type, this.tableIndex, index, "two_selectType");
+    },
+    // 计算表格选项内容的值
+    optionLength(val) {
+      if (val || val === 0) {
+        const accordWithThis = this.tableData.filter(
+          (item) => item.issueId === val
+        );
+        return accordWithThis.length ? accordWithThis.length : 0;
+      }
+    },
+    // 表格合并单元格逻辑
+    getSpanArr(data) {
+      this.spanArr = [];
+      this.spanArr1 = [];
+      for (var i = 0; i < data.length; i++) {
+        if (i === 0) {
+          // 如果是第一条记录(即索引是0的时候),向数组中加入1
+          /** *
+           * 例子:
+           * name:1
+           * name:1
+           * name:2
+           * name:2
+           * 最终结果:spanArr = [2,0,2,0]
+           */
+          this.spanArr.push(1);
+          this.pos = 0;
+          this.spanArr1.push(1);
+          this.pos1 = 0;
+        } else {
+          if (data[i].groupId === data[i - 1].groupId) {
+            // 如果remark相等就累加,并且push 0
+            this.spanArr[this.pos] += 1;
+            this.spanArr.push(0);
+          } else {
+            // 不相等push 1,并且pos 要换成当前下标
+            this.spanArr.push(1);
+            this.pos = i;
+          }
+
+          if (data[i].issueId === data[i - 1].issueId) {
+            // 如果remark相等就累加,并且push 0
+            this.spanArr1[this.pos1] += 1;
+            this.spanArr1.push(0);
+          } else {
+            // 不相等push 1,并且pos 要换成当前下标
+            this.spanArr1.push(1);
+            this.pos1 = i;
+          }
+        }
+      }
+    },
+    objectSpanMethod({ row, column, rowIndex, columnIndex }) {
+      if (columnIndex == 0) {
+        const _row = this.spanArr[rowIndex];
+        const _col = _row > 0 ? 1 : 0;
+        return {
+          rowspan: _row,
+          colspan: _col
+        };
+      } else if (
+        column.label == "问题" ||
+        column.label == "选择" ||
+        column.label == "问题内容" ||
+        column.label == "系数" ||
+        column.label == "常数" ||
+        column.label == "选项个数"
+      ) {
+        const _row = this.spanArr1[rowIndex];
+        const _col = _row > 0 ? 1 : 0;
+        return {
+          rowspan: _row,
+          colspan: _col
+        };
+      }
+    },
+    // 删除组限制:剩余一组时隐藏删除按钮
+    imposeRestrictionsRemoveOnGroup(groupId) {
+      // 查找有没有其他组存在 如果为0的话则不存在
+      const otherGroupLength = this.tableData.filter(
+        (item) => item.groupId !== groupId
+      ).length;
+      return otherGroupLength;
+    },
+    // 删除问题限制:该组剩余一个问题时隐藏删除按钮
+    imposeRestrictionsRemoveOnIssue(val) {
+      const { groupId, issueId } = val;
+      // 获取该组所有的issus
+      const thisGroups = this.tableData.filter(
+        (item) => item.groupId === groupId
+      );
+      // 查找该组有没有其他问题 otherIssueLength为0表示只有当前一个问题存在 所以隐藏删除按钮
+      const otherIssueLength = thisGroups.filter(
+        (item) => item.issueId !== issueId
+      ).length;
+
+      if (otherIssueLength) {
+        return true;
+      }
+      return false;
+    },
+    // 删除选项限制:该问题剩余一个选项时隐藏删除按钮
+    imposeRestrictionsRemoveOnOption(issueId) {
+      // 查找同组的问题,如果只有一个问题则隐藏删除按钮
+      const thisOptionByissueIdLenth = this.tableData.filter(
+        (item) => item.issueId === issueId
+      ).length;
+      if (thisOptionByissueIdLenth > 1) {
+        return true;
+      }
+      return false;
+    }
+  },
+  created() {
+    this.getSpanArr(this.tableData);
+  },
+  watch: {
+    tableData: {
+      handler() {
+        this.getSpanArr(this.tableData);
+      },
+      deep: true
+    },
+    tableResultType() {
+      this.tableShow = false;
+
+      setTimeout(() => {
+        this.tableShow = true;
+      });
+    }
+  },
+  props: {
+    tableData: {
+      default: []
+    },
+    tableIndex: {
+      required: true
+    },
+    tableResultType: {
+      required: true,
+      default: 2
+    }
+  }
+};
+</script>

+ 21 - 0
src/components/knowledgeExtra/AddAssess/util.js

@@ -0,0 +1,21 @@
+export const numInputInput = (value, len = 5, decimals = 1) => {
+  // value:修改的数字  len 总长度   decimals:允许小数点后几位
+  //todo 5位整数数加一位小数
+  value += "";
+  if (value.length == 0) return null;
+  let index = value.lastIndexOf(".");
+  if (index != -1) {
+    let [int, dec] = value.split(".");
+    if (dec.length > decimals) {
+      dec = dec.slice(0, dec.length - 1);
+    }
+    if (int.length > len) {
+      int = int.slice(0, int.length - 1);
+    }
+    return parseFloat(int + "." + dec);
+  }
+  if (value.length > len) {
+    value = value.slice(0, value.length - 1);
+  }
+  return parseFloat(value);
+}

文件差异内容过多而无法显示
+ 706 - 275
src/components/knowledgeExtra/AddDevKnow.vue


文件差异内容过多而无法显示
+ 1683 - 377
src/components/knowledgeExtra/AddDiagBase.vue


文件差异内容过多而无法显示
+ 784 - 478
src/components/knowledgeExtra/AddNewRule.vue


+ 862 - 0
src/components/knowledgeExtra/AddNewRuleTable.vue

@@ -0,0 +1,862 @@
+<style lang="less" scoped>
+#AddNewRuleTable {
+  width: 100%;
+  background: #fff;
+  margin-top: 10px;
+  padding: 20px;
+  box-sizing: border-box;
+  /deep/ .el-table .el-input--mini .el-input__inner,
+  .el-select {
+    width: 100%;
+    font-size: 12px;
+  }
+  .btn_box {
+    width: 100%;
+    height: 100%;
+    display: flex;
+    align-items: center;
+    justify-content: space-around;
+    .btn_div {
+      flex: 1;
+      display: flex;
+      align-items: center;
+      justify-content: center;
+    }
+    img {
+      width: 16px;
+      height: 16px;
+      cursor: pointer;
+    }
+  }
+  .inp_box {
+    // width: 100px;
+    height: 100%;
+    margin: 0 auto;
+  }
+  /deep/ .el-form-item__error {
+    // position: absolute;
+    top: 28px;
+  }
+  .type_content {
+    /deep/ .el-form-item--mini.el-form-item,
+    .el-form-item--small.el-form-item {
+      margin: 0;
+      width: 100%;
+    }
+    display: flex;
+    .type_content_item1 {
+      /deep/ .el-form-item__content {
+        padding-bottom: 8px;
+      }
+      .row_box {
+        .el-col {
+          /deep/ .el-form-item__content {
+            position: static;
+          }
+          /deep/ .el-form-item__error {
+            position: absolute;
+            width: 260px;
+            left: 72px;
+            white-space: normal;
+          }
+        }
+      }
+    }
+    /deep/ .el-input.is-disabled .el-input__inner {
+      color: #888;
+    }
+  }
+  .custom_table_header {
+    vertical-align: middle;
+    &::before {
+      content: "*";
+      color: red;
+      font-size: 12px;
+      margin-right: 4px;
+    }
+  }
+  /deep/ .el-table th {
+    background: transparent;
+  }
+  /deep/ .el-form-item__content {
+    padding-bottom: 14px;
+  }
+  .table_cell_cls {
+    vertical-align: top;
+  }
+  /deep/ .el-form-item__label {
+    font-size: 12px;
+  }
+  h4 {
+    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 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 - 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">
+          <div class="btn_box">
+            <div class="btn_div">
+              <img
+                @click="addGroup(scope)"
+                src="../../images/add-new-rule-sub.png"
+                alt=""
+              />
+            </div>
+            <div class="btn_div" v-if="!isLastDate(scope.row.groupId)">
+              <img
+                @click="$emit('delGroup', scope.row.groupId)"
+                src="../../images/add-new-rule-del.png"
+                alt=""
+              />
+            </div>
+          </div>
+        </template>
+      </el-table-column>
+      <el-table-column
+        width="80px"
+        v-if="maxNum && maxNum > 1"
+        fixed="left"
+        label="基础规则"
+        prop="groupType"
+      >
+        <template slot-scope="scope">
+          <div class="btn_box">
+            <div class="btn_div" v-if="!isMax(scope.row.groupId)">
+              <img
+                @click="addChildGroup(scope)"
+                src="../../images/add-new-rule-sub.png"
+                alt=""
+              />
+            </div>
+            <div
+              class="btn_div"
+              v-if="klRuleByIdSub.length > 1 && !scope.row.disabled"
+            >
+              <img
+                @click="$emit('delGroupChild', scope.row.groupChildId)"
+                src="../../images/add-new-rule-del.png"
+                alt=""
+              />
+            </div>
+          </div>
+        </template>
+      </el-table-column>
+      <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">
+          <el-form-item
+            class="inp_box"
+            :prop="`klRuleByIdSub[${scope.$index}].subDescription`"
+            :rules="rules.subDescription"
+          >
+            <el-input
+              type="text"
+              :disabled="scope.row.disabled"
+              v-model="scope.row.subDescription"
+              clearable
+              placeholder="请输入"
+            ></el-input>
+          </el-form-item>
+        </template>
+      </el-table-column>
+      <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">
+          <el-form-item
+            class="inp_box"
+            :prop="`klRuleByIdSub[${scope.$index}].subType`"
+            :rules="rules.subType"
+          >
+            <el-select
+              v-model="scope.row.subType"
+              :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"
+                :key="item.id"
+                :label="item.name"
+                :value="item.type"
+              >
+              </el-option>
+            </el-select>
+          </el-form-item>
+        </template>
+      </el-table-column>
+      <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">
+          <el-form-item
+            class="inp_box"
+            :prop="`klRuleByIdSub[${scope.$index}].subLenCode`"
+            :rules="rules.subLenCode"
+          >
+            <el-select
+              :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"
+                :key="item.id"
+                :label="item.name"
+                :value="item.code"
+              >
+              </el-option>
+            </el-select>
+          </el-form-item>
+        </template>
+      </el-table-column>
+      <el-table-column width="170px" label="医学标准术语" prop="subConceptId">
+        <template slot="header" slot-scope="scope">
+          <div class="custom_table_header">医学标准术语</div>
+        </template>
+        <template slot-scope="scope">
+          <el-form-item
+            class="inp_box"
+            :prop="`klRuleByIdSub[${scope.$index}].subConceptId`"
+            :rules="rules.subConceptId"
+          >
+            <el-select
+              clearable
+              remote
+              filterable
+              :disabled="scope.row.disabled"
+              @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"
+                :key="item.conceptId"
+                :label="item.conceptName"
+                :value="item.conceptId"
+              >
+              </el-option>
+            </el-select>
+          </el-form-item>
+        </template>
+      </el-table-column>
+      <el-table-column label="规则具体内容" min-width="900px" prop="">
+        <template slot-scope="scope">
+          <div class="type_content">
+            <el-form-item
+              style="width: 100px; margin-right: 20px"
+              :prop="`klRuleByIdSub[${scope.$index}].dataType`"
+              :rules="rules.dataType"
+              v-if="scope.row.subType === 2 && showDataType(scope.$index)"
+            >
+              <el-select
+                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>
+              </el-select>
+            </el-form-item>
+            <!-- v-if="klRuleByIdSub[scope.$index].dataType === '1'" -->
+            <el-form-item
+              class="type_content_item type_content_item1"
+              style="flex: 2; margin: 0 10px"
+              label="最大值:"
+              v-if="scope.row.dataType === '1'"
+            >
+              <!-- <div> -->
+              <el-row :gutter="10" class="row_box">
+                <el-col :span="6">
+                  <el-form-item
+                    :prop="`klRuleByIdSub[${scope.$index}].subMaxOperator`"
+                    :rules="[
+                      {
+                        validator: (rule, value, callback) => {
+                          subMaxOperator(scope, rule, value, callback);
+                        },
+                        trigger: ['change']
+                      }
+                    ]"
+                  >
+                    <el-select
+                      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"
+                        :key="item.key"
+                        :label="item.name"
+                        :value="item.key"
+                      >
+                      </el-option>
+                    </el-select>
+                  </el-form-item>
+                </el-col>
+                <el-col :span="6">
+                  <el-form-item
+                    :prop="`klRuleByIdSub[${scope.$index}].subMaxValue`"
+                    :rules="[
+                      {
+                        validator: (rule, value, callback) => {
+                          subMaxValue(scope, rule, value, callback);
+                        },
+                        trigger: ['change']
+                      }
+                    ]"
+                  >
+                    <el-input
+                      type="text"
+                      @focus="maxChange($event, scope.$index, 'i')"
+                      :ref="`klRuleByIdSub[${scope.$index}].subMaxValue`"
+                      v-model="scope.row.subMaxValue"
+                      placeholder="填写数值"
+                    />
+                  </el-form-item>
+                </el-col>
+                <el-col :span="6">
+                  <el-form-item
+                    :prop="`klRuleByIdSub[${scope.$index}].subMaxUnit`"
+                  >
+                    <el-input
+                      type="text"
+                      @focus="setScrollRight"
+                      v-model.trim="scope.row.subMaxUnit"
+                      placeholder="填写单位"
+                    />
+                  </el-form-item>
+                </el-col>
+              </el-row>
+              <!-- </div> -->
+            </el-form-item>
+            <el-form-item
+              class="type_content_item type_content_item1"
+              style="flex: 2"
+              label="最小值:"
+              v-if="scope.row.dataType === '1'"
+            >
+              <el-row :gutter="10" class="row_box">
+                <el-col :span="6">
+                  <el-form-item
+                    :prop="`klRuleByIdSub[${scope.$index}].subMinOperator`"
+                    :rules="[
+                      {
+                        validator: (rule, value, callback) => {
+                          subMinOperatorRule(scope, rule, value, callback);
+                        },
+                        trigger: ['change']
+                      }
+                    ]"
+                  >
+                    <el-select
+                      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"
+                        :key="item.name"
+                        :label="item.name"
+                        :value="item.name"
+                      >
+                      </el-option>
+                    </el-select>
+                  </el-form-item>
+                </el-col>
+                <el-col :span="6">
+                  <el-form-item
+                    :prop="`klRuleByIdSub[${scope.$index}].subMinValue`"
+                    :rules="[
+                      {
+                        validator: (rule, value, callback) => {
+                          subMinValueRule(scope, rule, value, callback);
+                        },
+                        trigger: ['change']
+                      }
+                    ]"
+                  >
+                    <el-input
+                      type="text"
+                      :ref="`klRuleByIdSub[${scope.$index}].subMinValue`"
+                      @focus="minChange($event, scope.$index, 'i')"
+                      v-model="scope.row.subMinValue"
+                      placeholder="填写数值"
+                    />
+                  </el-form-item>
+                </el-col>
+                <el-col :span="6">
+                  <el-form-item
+                    :prop="`klRuleByIdSub[${scope.$index}].subMinUnit`"
+                  >
+                    <el-input
+                      type="text"
+                      @focus="setScrollRight"
+                      v-model.trim="scope.row.subMinUnit"
+                      placeholder="填写单位"
+                    />
+                  </el-form-item>
+                </el-col>
+              </el-row>
+            </el-form-item>
+            <!-- v-if="klRuleByIdSub[scope.$index].subType !== 6 && klRuleByIdSub[scope.$index].dataType === '2'" -->
+            <div
+              style="flex: 2"
+              v-if="scope.row.subType != 6 && scope.row.dataType == '2'"
+            >
+              <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" -->
+            <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'
+                  },
+                  {
+                    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>
+    </el-table>
+  </div>
+</template>
+
+<script>
+import api from "@api/knowledgeLib.js";
+import { tableRules } from "./rules";
+export default {
+  name: "AddNewRuleTable",
+  data() {
+    return {
+      numTypes: "",
+      subConceptIdIndex: "",
+      operMaxList: [
+        { name: "<=", key: "<=" },
+        { name: "<", key: "<" }
+      ],
+      operMinList: [
+        { name: ">", key: ">" },
+        { name: ">=", key: ">=" }
+      ],
+      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;
+    },
+    addChildGroup(scope) {
+      this.$emit("addGroup", scope.row.groupId, { index: scope.$index });
+      this.$refs.table.bodyWrapper.scrollLeft = 0;
+    },
+    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 {};
+      return { "vertical-align": "top", "padding-top": "14px" };
+    },
+    // 最大值 选择rule
+    subMaxOperator(scope, rule, value, callback) {
+      const { subMaxValue, subMinOperator, subMinValue } = scope.row;
+      const val = value + subMinOperator + subMinValue + subMaxValue;
+      if (!val || (!value && subMaxValue !== "")) {
+        callback(new Error("最大值和最小值至少完整填写一个,单位不必填"));
+      } else {
+        callback();
+      }
+    },
+    // 最大值 数值rule
+    subMaxValue(scope, rule, value, callback) {
+      const { subMaxOperator, subMinOperator, subMinValue } = scope.row;
+      const val = value + subMaxOperator + subMinValue + subMinOperator;
+      const isNum = /^(\-|\+)?\d+(\.\d+)?$/.test(value);
+      if (!val || (value == "" && subMaxOperator)) {
+        callback(new Error("最大值和最小值至少完整填写一个,单位不必填"));
+      } else if (value !== "" && !isNum) {
+        callback(new Error("只能输入数字"));
+      } else {
+        callback();
+      }
+    },
+    // 最小值 选择rule
+    subMinOperatorRule(scope, rule, value, callback) {
+      const { subMaxValue, subMaxOperator, subMinValue } = scope.row;
+      const val = value + subMaxOperator + subMinValue + subMaxValue;
+      if (!val || (!value && subMinValue !== "")) {
+        callback(new Error("最大值和最小值至少完整填写一个,单位不必填"));
+      } else {
+        callback();
+      }
+    },
+    // 最小值 数值rule
+    subMinValueRule(scope, rule, value, callback) {
+      const { subMaxValue, subMinOperator, subMaxOperator } = scope.row;
+      const val = value + subMaxOperator + subMaxValue + subMinOperator;
+      const isNum = /^(\-|\+)?\d+(\.\d+)?$/.test(value);
+      if (!val || (value == "" && subMinOperator)) {
+        callback(new Error("最大值和最小值至少完整填写一个,单位不必填"));
+      } else if (value !== "" && !isNum) {
+        callback(new Error("只能输入数字"));
+      } else {
+        callback();
+      }
+    },
+    // 医学内容rule
+    subEqValue(scope, rule, value, callback) {
+      if (value === "") {
+        callback(new Error("请输入" + this.textName(scope.$index)));
+      } else if (value.length > 200) {
+        callback(new Error(this.textName(scope.$index) + "不能超过200字"));
+      } else {
+        callback();
+      }
+    },
+    // 判断是否为最后一条规则
+    isLastDate(id) {
+      const tableLength = this.klRuleByIdSub.filter(
+        (item) => item.groupId !== id
+      ).length;
+      return tableLength === 0;
+    },
+    // 是否超出最大规则数
+    isMax(id) {
+      const typeNum = this.klRuleByIdSub.filter((item) => item.groupId === id)
+        .length;
+      return typeNum >= this.maxNum;
+    },
+    // 基础规则类型选择
+    subTypeChange(e, index) {
+      this.$emit("subTypeChange", e, index);
+    },
+    //
+    setTheRef(e, val) {
+      this.theRef = val;
+    },
+    // 规则术语类型
+    subCodeChange(val, index) {
+      //基础规则术语类型修改
+      this.$emit("childSubCodeChange", val, index, this.numTypes);
+    },
+    clearConcept(index) {
+      this.$emit("childClearConcept", index);
+    },
+    clearNumText(index) {
+      this.$emit("childClearNumText", index);
+    },
+    //医学标准术语change
+    subConceptIdfocus(index) {
+      this.subConceptIdIndex = "";
+      this.subConceptIdIndex = index;
+      this.setTheRef(1, `klRuleByIdSub[${index}].subConceptId`);
+    },
+    // 医学标准术语
+    searchConcept(val) {
+      const param = {
+        excludedConceptIds: [
+          this.klRuleByIdSub[this.subConceptIdIndex].subType
+        ],
+        libType: this.klRuleByIdSub[this.subConceptIdIndex].subLenCode,
+        name: val
+      };
+      api
+        .searchConcept(param)
+        .then((res) => {
+          if (res.data.code == "0") {
+            const data = res.data.data;
+            this.$emit("setFormData", this.subConceptIdIndex, data);
+          }
+        })
+        .catch((error) => {
+          console.log(error);
+        });
+    },
+    dataTypeChange(val, index) {
+      this.$emit("ChildDataTypeChange", val, index);
+    },
+    // 处理要合并相同行的列
+    getSpanArr(data) {
+      this.spanArr = [];
+      for (var i = 0; i < data.length; i++) {
+        if (i === 0) {
+          // 如果是第一条记录(即索引是0的时候),向数组中加入1
+          /** *
+           * 例子:
+           * name:1
+           * name:1
+           * name:2
+           * name:2
+           * 最终结果:spanArr = [2,0,2,0]
+           */
+          this.spanArr.push(1);
+          this.pos = 0;
+        } else {
+          if (data[i].groupId === data[i - 1].groupId) {
+            // 如果remark相等就累加,并且push 0
+            this.spanArr[this.pos] += 1;
+            this.spanArr.push(0);
+          } else {
+            // 不相等push 1,并且pos 要换成当前下标
+            this.spanArr.push(1);
+            this.pos = i;
+          }
+        }
+      }
+    },
+    // 合并单元格
+    ObjectSpanMethod({ row, column, rowIndex, columnIndex }) {
+      if (columnIndex == 0) {
+        const _row = this.spanArr[rowIndex];
+        const _col = _row > 0 ? 1 : 0;
+        return {
+          rowspan: _row,
+          colspan: _col
+        };
+      }
+    },
+    showDataType(index) {
+      return (
+        (this.numTypes + ",").indexOf(
+          this.klRuleByIdSub[index].subLenCode + ","
+        ) === -1
+      );
+    },
+    textName(index) {
+      return this.klRuleByIdSub[index].subType !== 6 &&
+        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);
+  },
+  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,
+      required: true
+    },
+    maxNum: {
+      default: null
+    }
+  }
+};
+</script>
+

+ 245 - 0
src/components/knowledgeExtra/AddZskRegisteredDrug.vue

@@ -0,0 +1,245 @@
+<template>
+  <div style="min-height:100%" ref="viewBox">
+    <crumbs :title="title" :param="$route.params" linkTo="ZskRegisteredDrug"></crumbs>
+    <div class="contents">
+      <div class="content">
+        <el-form
+          :inline="true"
+          ref="formInline"
+          :rules="rules"
+          :model="formInline"
+          class="demo-form-inline"
+          label-width="100px"
+        >
+          <el-form-item label="药品代码:" prop="drugCode">
+            <el-input v-model.trim="formInline.drugCode" maxlength="200" placeholder="请输入"></el-input>
+          </el-form-item>
+          <el-form-item label="最小包装单位:">
+            <el-input v-model.trim="formInline.minPackUnit" maxlength="200" placeholder="请输入"></el-input>
+          </el-form-item>
+          <el-form-item label="注册名称:" prop="name">
+            <el-input v-model.trim="formInline.name" maxlength="200" placeholder="请输入"></el-input>
+          </el-form-item>
+          <el-form-item label="药品企业:">
+            <el-input v-model.trim="formInline.company" maxlength="200" placeholder="请输入"></el-input>
+          </el-form-item>
+          <el-form-item label="英文名称:">
+            <el-input v-model.trim="formInline.enName" maxlength="200" placeholder="请输入"></el-input>
+          </el-form-item>
+          <el-form-item label="批准文号:">
+            <el-input v-model.trim="formInline.approval" maxlength="200" placeholder="请输入"></el-input>
+          </el-form-item>
+          <el-form-item label="商品名称:">
+            <el-input v-model.trim="formInline.tradeName" maxlength="200" placeholder="请输入"></el-input>
+          </el-form-item>
+          <el-form-item label="药品本位码:">
+            <el-input v-model.trim="formInline.standardCode" maxlength="200" placeholder="请输入"></el-input>
+          </el-form-item>
+          <el-form-item label="药品剂型:">
+            <el-input v-model.trim="formInline.form" maxlength="200" placeholder="请输入"></el-input>
+          </el-form-item>
+          <el-form-item label="医保类型:">
+            <el-input v-model.trim="formInline.insuranceType" maxlength="200" placeholder="请输入"></el-input>
+          </el-form-item>
+          <el-form-item label="注册规格:">
+            <el-input v-model.trim="formInline.specification" maxlength="200" placeholder="请输入"></el-input>
+          </el-form-item>
+          <el-form-item label="医保备注:">
+            <el-input v-model.trim="formInline.insuranceRemrk" maxlength="200" placeholder="请输入"></el-input>
+          </el-form-item>
+          <el-form-item label="最小包装数量:">
+            <el-input v-model.trim="formInline.minPackQuantity" maxlength="200" placeholder="请输入"></el-input>
+          </el-form-item>
+          <el-form-item label="药品类别:">
+            <el-input v-model.trim="formInline.drugType" maxlength="200" placeholder="请输入"></el-input>
+          </el-form-item>
+          <el-form-item label="关联通用名:">
+            <el-select
+              clearable
+              remote
+              filterable
+              @focus="getfocus"
+              :remote-method="searchConcept"
+              v-model.trim="formInline.drugConceptId"
+            >
+              <el-option
+                v-for="item in conceptList"
+                :key="item.id"
+                :label="item.libName"
+                :value="item.id"
+              ></el-option>
+            </el-select>
+          </el-form-item>
+        </el-form>
+        <div class="Butn">
+          <el-button class="disclButn" size="small" type="primary" @click="confirm">确定</el-button>
+        </div>
+      </div>
+    </div>
+  </div>
+</template>
+<script type="text/javascript">
+import api from '@api/icss.js';
+import config from '@api/config.js';
+import utils from '@api/utils.js';
+
+export default {
+  name: 'AddZskDiagBase',
+  data() {
+    return {
+      formInline: {
+        id: '',
+        drugCode: '', //药品代码
+        name: '', //注册名称
+        enName: '', //英文名称
+        tradeName: '', //商品名称
+        form: '', //药品剂型
+        specification: '', //注册规格
+        minPackQuantity: '', //最小包装数量
+        minPackUnit: '', //最小包装单位
+        company: '', //药品企业
+        approval: '', //批准文号
+        standardCode: '', //药品本位码
+        insuranceType: '', //医保类型
+        insuranceRemrk: '', //医保备注
+        drugType: '', //药品类别
+        drugConceptId: '' //药品通用名Id
+      },
+      rules: {
+        drugCode: [
+          { required: true, message: '请输入药品代码', trigger: 'blur' }
+        ],
+        name: [{ required: true, message: '请输入注册名称', trigger: 'change' }]
+      },
+      conceptList: [],
+      value: '',
+      isEdit: false,
+      title: '注册药品维护-添加注册药品'
+    };
+  },
+  created() {
+    let type = this.$route.params.type;
+    if (type == 2) {
+      this.title = '注册药品维护-修改注册药品';
+      api.getByParam({ id: this.$route.params.id }).then(res => {
+        if (res.data.code == 0) {
+          const data = res.data.data;
+          this.formInline.id = data.id;
+          this.formInline.drugCode = data.drugCode;
+          this.formInline.name = data.name;
+          this.formInline.enName = data.enName;
+          this.formInline.tradeName = data.tradeName;
+          this.formInline.form = data.form;
+          this.formInline.specification = data.specification;
+          this.formInline.minPackQuantity = data.minPackQuantity;
+          this.formInline.minPackUnit = data.minPackUnit;
+          this.formInline.company = data.company;
+          this.formInline.approval = data.approval;
+          this.formInline.standardCode = data.standardCode;
+          this.formInline.insuranceType = data.insuranceType;
+          this.formInline.insuranceRemrk = data.insuranceRemrk;
+          this.formInline.drugType = data.drugType;
+          this.formInline.drugConceptId = data.drugConceptId;
+          this.conceptList = [
+            { id: data.drugConceptId, libName: data.drugName }
+          ];
+        } else {
+          this.$message({
+            message: res.data.msg,
+            type: 'warning'
+          });
+        }
+      });
+    }
+  },
+  methods: {
+    searchConcept(val) {
+      if (val == '') {
+        return;
+      }
+      api
+        .getsearchDrug({ name: val })
+        .then(res => {
+          if (res.data.code == '0') {
+            const data = res.data.data;
+            this.$nextTick(() => {
+              // dom元素更新后执行,因此这里能正确打印更改之后的值
+              this.conceptList = data; // 改变了的值
+            });
+          }
+        })
+        .catch(error => {
+          console.log(error);
+        });
+    },
+    validateForms(callBack) {
+      this.$refs['formInline'].validate(valid => {
+        if (valid) {
+          callBack();
+        } else {
+          return false;
+        }
+      });
+    },
+    saveOrUpdate(params) {
+      api.saveOrUpdate(params).then(res => {
+        if (res.data.code == 0) {
+          this.$message({
+            message: '操作成功',
+            type: 'success'
+          });
+          this.$router.push({
+            name: 'ZskRegisteredDrug',
+            params: this.$route.params
+          });
+        } else {
+          this.$message({
+            message: res.data.msg,
+            type: 'warning'
+          });
+        }
+      });
+    },
+    getfocus() {
+      this.conceptList = [];
+    },
+    confirm() {
+      let _this = this;
+      this.validateForms(function() {
+        let params = _this.formInline;
+        _this.saveOrUpdate(params);
+      });
+    }
+  }
+};
+</script>
+<style lang="less" scoped>
+@import '../../less/admin.less';
+.container {
+  top: 0;
+}
+.contents {
+  height: 100%;
+  .content {
+    height: 600px;
+    background: #fff;
+    padding: 20px 20px 0;
+    color: #545455;
+    min-width: 980px;
+    position: relative;
+    /deep/ .el-form-item {
+      width: 45%;
+      margin-bottom: 20px;
+      .el-form-item__label {
+        margin-right: 20px;
+      }
+
+      .el-input {
+        .el-input__inner {
+          width: 300px;
+        }
+      }
+    }
+  }
+}
+</style>

+ 236 - 65
src/components/knowledgeExtra/DevInfo.vue

@@ -4,6 +4,7 @@
     :model="data"
     ref="form"
     class="sub-form"
+    size="mini"
     :validate-on-rule-change="false"
   >
     <!--<el-input v-model="form.orderNo" :value="index" type="hidden"></el-input>-->
@@ -13,12 +14,19 @@
                 <el-option label="是" :value="1"></el-option>
             </el-select>
     </el-form-item>-->
-    <el-form-item label="段落标题:" prop="title" label-width="160px" class="is-required">
+    <el-form-item
+      label="段落标题:"
+      prop="title"
+      label-width="160px"
+      class="is-required"
+    >
       <el-input v-model="data.title"></el-input>
     </el-form-item>
     <el-form-item label="内容类型:" prop="position" label-width="160px">
       <el-checkbox-group v-model="data.position">
-        <el-checkbox v-for="it in positions" :key="it.key" :label="it.key">{{it.name}}</el-checkbox>
+        <el-checkbox v-for="it in positions" :key="it.key" :label="it.key">{{
+          it.name
+        }}</el-checkbox>
       </el-checkbox-group>
     </el-form-item>
     <el-form-item label="内容" prop="content" label-width="160px" ref="editor">
@@ -29,41 +37,94 @@
         ref="quillEditor"
       ></quillEditor>
     </el-form-item>
-    <div class="order-btn">
-      <a v-if="index!==0" :class="index===total-1?'order-spc':'order-up'" @click="reOrder(1)">上升</a>
-      <a v-if="index!==total-1" :class="index===0?'order-spc':'order-down'" @click="reOrder(0)">下降</a>
+    <!-- <div class="order-btn">
+      <a
+        v-if="index !== 0"
+        :class="index === total - 1 ? 'order-spc' : 'order-up'"
+        @click="reOrder(1)"
+        >上升</a
+      >
+      <a
+        v-if="index !== total - 1"
+        :class="index === 0 ? 'order-spc' : 'order-down'"
+        @click="reOrder(0)"
+        >下降</a
+      >
+    </div> -->
+    <div class="move_btn">
+      <div
+        v-if="index !== 0"
+        @mouseover="moveTopHover = true"
+        @mouseout="moveTopHover = false"
+        title="上升"
+        @click="reOrder(1)"
+      >
+        <img
+          :src="
+            moveTopHover
+              ? require('@/images/icon_hover_top.png')
+              : require('@/images/icon_default_top.png')
+          "
+          alt=""
+        />
+      </div>
+      <div
+        v-if="index !== total - 1"
+        @mouseover="moveBottomHover = true"
+        @mouseout="moveBottomHover = false"
+        title="下降"
+        @click="reOrder(0)"
+      >
+        <img
+          :src="
+            moveBottomHover
+              ? require('@/images/icon_hover_down.png')
+              : require('@/images/icon_default_down.png')
+          "
+          alt=""
+        />
+      </div>
     </div>
     <el-form-item label-width="160px" class="btns">
-      <el-button @click="addEmit">添加段落</el-button>
-      <el-button @click="delEmit" type="info">删除本段落</el-button>
+      <!-- <el-button size="small" @click="addEmit">添加段落</el-button>
+      <el-button size="small" @click="delEmit" type="info"
+        >删除本段落</el-button
+      > -->
+      <div class="change_btns">
+        <div @click="addEmit">添加段落</div>
+        <div @click="delEmit">删除本段落</div>
+      </div>
     </el-form-item>
   </el-form>
 </template>
 
 <script>
-import 'quill/dist/quill.core.css';
-import 'quill/dist/quill.snow.css';
-import 'quill/dist/quill.bubble.css';
-import { quillEditor, Quill } from 'vue-quill-editor';
-import config from '@api/config';
-import { container, ImageExtend, QuillWatch } from 'quill-image-extend-module';
-Quill.register('modules/ImageExtend', ImageExtend);
+import api from "@api/knowledgeTree.js";
+import "quill/dist/quill.core.css";
+import "quill/dist/quill.snow.css";
+import "quill/dist/quill.bubble.css";
+import { quillEditor, Quill } from "vue-quill-editor";
+import config from "@api/config";
+import { container, ImageExtend, QuillWatch } from "quill-image-extend-module";
+Quill.register("modules/ImageExtend", ImageExtend);
 export default {
-  props: ['data', 'index', 'isEdit', 'isCopy', 'total', 'showType'],
-  name: 'DevInfo',
+  props: ["data", "index", "isEdit", "isCopy", "total", "showType"],
+  name: "DevInfo",
   components: {
     quillEditor
   },
   data() {
     return {
+      moveTopHover: false,
+      moveBottomHover: false,
       toolbars: [
         [
-          ['bold', 'underline', 'strike'],
-          [{ list: 'ordered' }, { list: 'bullet' }],
-          [{ script: 'sub' }, { script: 'super' }],
+          ["bold", "underline", "strike"],
+          [{ list: "ordered" }, { list: "bullet" }],
+          [{ script: "sub" }, { script: "super" }],
           [{ color: [] }, { background: [] }],
           [{ align: [] }],
-          ['image']
+          ["image"]
         ]
       ],
       toolbarMode: 0,
@@ -71,24 +132,24 @@ export default {
         modules: {
           ImageExtend: {
             loading: true,
-            name: 'upfile',
+            name: "upfile",
             size: 1,
             sizeError: () => {
               this.$message({
                 showClose: true,
-                message: '请上传 1M 以内的图片!',
-                type: 'warning'
+                message: "请上传 1M 以内的图片!",
+                type: "warning"
               });
             },
             action: config.urls.promptServer,
-            response: res => {
-              if (res.code == '0') {
+            response: (res) => {
+              if (res.code == "0") {
                 return config.imgHost + res.data.url;
               } else {
                 this.$message({
                   showClose: true,
                   message: res.msg,
-                  type: 'warning'
+                  type: "warning"
                 });
               }
             }
@@ -96,7 +157,7 @@ export default {
           toolbar: {
             container: container,
             handlers: {
-              image: function() {
+              image: function () {
                 QuillWatch.emit(this.quill.id);
               }
             }
@@ -112,103 +173,150 @@ export default {
     };
   },
   watch: {
-    'data.content': function() {
-      if (this.data.content !== '') {
+    "data.content": function () {
+      if (this.data.content !== "") {
         this.$refs.editor && this.$refs.editor.clearValidate(); // 清除校验
       }
-      if (this.data.content === '') {
+      if (this.data.content === "") {
         // console.log('内容为空');
-        this.$refs['form'].validateField('content'); // 手动校验
+        this.$refs["form"].validateField("content"); // 手动校验
       }
       this.data.text = this.$refs.quillEditor.quill.root.innerText;
-    },
+    }
   },
   created() {
     // console.log(this.showType, 'showType','需要显示的类型');
-    this.editorOption.modules.toolbar.container = this.toolbars[
-      this.toolbarMode
-    ];
+    this.editorOption.modules.toolbar.container =
+      this.toolbars[this.toolbarMode];
     this.renderPositions();
-    if (this.isEdit||this.isCopy) {
+    if (this.isEdit || this.isCopy) {
       setTimeout(() => {
         this.rules = {
           position: [
-            { required: true, message: '请选择内容类型', trigger: 'change' }
+            { required: true, message: "请选择内容类型", trigger: "change" }
           ],
           title: [
             {
               validator: (rule, value, callback) => {
                 if (!value.trim()) {
-                  callback(new Error('请输入段落标题'));
+                  callback(new Error("请输入段落标题"));
                 } else {
                   callback();
                 }
               },
-              trigger: 'change'
+              trigger: "change"
             },
-            { max: 30, message: '标题名称不能超过30字', trigger: 'change' }
+            { max: 30, message: "标题名称不能超过30字", trigger: "change" }
           ],
           content: [
-            { required: true, message: '请输入段落内容', trigger: 'change' }
+            { required: true, message: "请输入段落内容", trigger: "change" }
           ]
         };
       }, 100);
     } else {
       this.rules = {
         position: [
-          { required: true, message: '请选择内容类型', trigger: 'change' }
+          { required: true, message: "请选择内容类型", trigger: "change" }
         ],
         title: [
           {
             validator: (rule, value, callback) => {
               if (!value.trim()) {
-                callback(new Error('请输入段落标题'));
+                callback(new Error("请输入段落标题"));
               } else {
                 callback();
               }
             },
-            trigger: 'change'
+            trigger: "change"
           },
-          { max: 30, message: '标题名称不能超过30字', trigger: 'change' }
+          { max: 30, message: "标题名称不能超过30字", trigger: "change" }
         ],
         content: [
-          { required: true, message: '请输入段落内容', trigger: 'change' }
+          { required: true, message: "请输入段落内容", trigger: "change" }
         ]
       };
     }
-      setTimeout(()=>{
-          this.filterHiddenPosition();
-      },200)
+    setTimeout(() => {
+      this.filterHiddenPosition();
+    }, 200);
   },
   mounted() {
+    let quill = this.$refs.quillEditor.quill;
+    console.log(quill);
+    quill.root.addEventListener(
+      "paste",
+      (evt) => {
+        console.log("evt", evt);
+        if (
+          evt.clipboardData &&
+          evt.clipboardData.files &&
+          evt.clipboardData.files.length
+        ) {
+          console.log("ddadada");
+          evt.preventDefault();
+          [].forEach.call(evt.clipboardData.files, (file) => {
+            console.log("file", file);
+            if (!file.type.match(/^image\/(gif|jpe?g|a?png|bmp)/i)) return;
+            if (file.size > 1024 * 1000) return;
+            let formData = new FormData();
+            formData.append("upfile", file);
+            api.uploadFile(formData).then((res) => {
+              console.log("formData", res);
+              if (res.data.code == "0") {
+                let imgUrl = config.imgHost + res.data.data.url;
+                var range = quill.getSelection();
+                console.log("range", range);
+                if (range) {
+                  // this.uploadAttachment(res, file, null);
+                  let length = quill.getSelection().index;
+                  quill.insertEmbed(length, "image", imgUrl);
+                  quill.setSelection(length + 1);
+                  //  将光标移动到图片后面
+                  this.$refs.quillEditor.quill.setSelection(range.index + 1);
+                }
+              } else {
+                this.$message({
+                  showClose: true,
+                  message: res.msg,
+                  type: "warning"
+                });
+              }
+            });
+          });
+        }
+      },
+      false
+    );
   },
   methods: {
     reOrder(i) {
-      this.$emit('reOrder', i, this.index);
+      this.$emit("reOrder", i, this.index);
     },
     addEmit() {
-      this.$emit('add');
+      this.$emit("add");
     },
     delEmit() {
-      this.$emit('del', this.index);
+      this.$emit("del", this.index);
     },
-    filterHiddenPosition(){
-        const pos = this.data.position;
-        const pArr = this.positions.map((it)=>{return it.key});
-        const pStr = pArr.join(",");
-        const arr=pos.filter((it)=>{
-            return pStr.indexOf(it)>-1;
-        });
-        this.data.position=arr;
+    filterHiddenPosition() {
+      const pos = this.data.position;
+      const pArr = this.positions.map((it) => {
+        return it.key;
+      });
+      const pStr = pArr.join(",");
+      const arr = pos.filter((it) => {
+        return pStr.indexOf(it) > -1;
+      });
+      this.data.position = arr;
     },
     // 渲染内容类型
     renderPositions() {
       //显示位置枚举列表
-      const pos = localStorage.getItem('knowledgeEnumsData');
+      const pos = localStorage.getItem("knowledgeEnumsData");
       let positions = config.contentTypes;
       if (this.showType == 1) {
         // 诊断
-        this.positions = positions.filter(item => item.key !== 2);
+        this.positions = positions.filter((item) => item.key !== 2);
       } else if (
         this.showType == 3 ||
         this.showType == 4 ||
@@ -216,12 +324,17 @@ export default {
         this.showType == 6
       ) {
         // 检验/检查
-        this.positions = positions.filter(item => {
+        this.positions = positions.filter((item) => {
           return item.key <= 2;
         });
-      } else if (this.showType == 2 || this.showType == 7 || this.showType == 8 || this.showType == 9) {
+      } else if (
+        this.showType == 2 ||
+        this.showType == 7 ||
+        this.showType == 8 ||
+        this.showType == 9
+      ) {
         // 药品/手术
-        this.positions = positions.filter(item => item.key === 1);
+        this.positions = positions.filter((item) => item.key === 1);
       } else {
         this.positions = positions;
       }
@@ -294,4 +407,62 @@ it .ql-editor,
 .btns {
   margin-top: 20px;
 }
+.move_btn {
+  position: absolute;
+  top: 12px;
+  right: 0;
+  font-size: 14px;
+  margin-left: 10px;
+  display: flex;
+  div {
+    width: 12px;
+    height: 16px;
+    margin-right: 8px;
+    img {
+      width: 100%;
+      height: 100%;
+      cursor: pointer;
+    }
+  }
+}
+/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;
+}
+.change_btns {
+  // width: 100%;
+  margin-top: 10px;
+  display: flex;
+  box-sizing: border-box;
+  div {
+    width: 90px;
+    height: 30px;
+    line-height: 30px;
+    text-align: center;
+    border-radius: 2px;
+    border: 1px solid #21cbc7;
+    color: #21cbc7;
+    font-size: 14px;
+    margin-right: 30px;
+    cursor: pointer;
+    &:nth-child(1) {
+      &:hover {
+        background: rgba(97, 218, 215, 0.1);
+      }
+    }
+    &:nth-child(2) {
+      border-color: #ff5b5b;
+      color: #ff5b5b;
+      &:hover {
+        background: rgba(255, 91, 91, 0.1);
+      }
+    }
+  }
+}
 </style>

+ 426 - 382
src/components/knowledgeExtra/DiagBase.vue

@@ -1,398 +1,442 @@
 <template>
-    <div>
-        <crumbs title="诊断依据维护" :minWidth="titleWidth" class="knowledgeTitle">
-            <el-form :inline="true" class="demo-form-inline">
-                <el-form-item label="疾病名称:">
-                    <el-input size="mini" v-model="filter.conceptName" placeholder="输入疾病名称" clearable></el-input>
-                </el-form-item>
-                <el-form-item label="描述:">
-                    <el-input size="mini" v-model="filter.description" placeholder="输入描述" clearable></el-input>
-                </el-form-item>
-                <el-form-item label="状态:">
-                    <el-select v-model="filter.status" clearable placeholder="请选择" size="mini">
-                        <el-option
-                                v-for="item in stateSelect"
-                                :key="item.id"
-                                :label="item.name"
-                                :value="item.id">
-                        </el-option>
-                    </el-select>
-                </el-form-item>
-                <el-form-item>
-                    <el-button size="mini" @click="filterDatas">确认</el-button>
-                </el-form-item>
-                <el-form class="secLine">
-                    <el-form-item>
-                        <el-button size="mini" @click="addRule" type="warning" style="margin:0 10px">+ 新增诊断依据</el-button>
-                        <el-button size="mini" @click="update">更新数据</el-button>
-                    </el-form-item>
-                </el-form>
-            </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="conceptName"
-                        label="疾病名称"
-                        width="160">
-                    <template slot-scope="scope">
-                        <el-tooltip v-if="scope.row.conceptName.length>8" class="item" effect="dark" :content="scope.row.conceptName" placement="top">
-                            <span>{{scope.row.conceptName.slice(0,8)+'...'}}</span>
-                        </el-tooltip>
-                        <span v-if="scope.row.conceptName.length<9">{{scope.row.conceptName}}</span>
-                    </template>
-                </el-table-column>
-                <el-table-column
-                        prop="description"
-                        label="描述"
-                        width="160">
-                    <template slot-scope="scope">
-                        <el-tooltip v-if="scope.row.description.length>8" class="item" effect="dark" :content="scope.row.description" placement="top">
-                            <span>{{scope.row.description.slice(0,8)+'...'}}</span>
-                        </el-tooltip>
-                        <span v-if="scope.row.description.length<9">{{scope.row.description}}</span>
-                    </template>
-                </el-table-column>
-                <el-table-column
-                        label="状态">
-                    <template slot-scope="scope">
-                          <span>
-                            {{scope.row.status === 0?'禁用':'启用'}}
-                          </span>
-                    </template>
-                </el-table-column>
-                <el-table-column
-                        prop="modifierName"
-                        label="操作人">
-                </el-table-column>
-                <el-table-column
-                        prop="gmtModified"
-                        label="操作时间"
-                        width="180">
-                </el-table-column>
-                <el-table-column
-                        label="操作"
-                        width="180" fixed="right">
-                    <template slot-scope="scope">
-                        <el-button type="text" size="small" @click="editData(scope.row)">修改</el-button>
-                        <span style="margin:0 3px;">|</span>
-                        <el-button type="text" size="small" @click="editData(scope.row,true)">复制</el-button>
-                        <span style="margin:0 3px;">|</span>
-                        <el-button type="text" size="small" :class="scope.row.status === 0?'':'unvailable'" @click="showDelDialog(scope.row)">{{scope.row.status === 0?'启用':'禁用'}}</el-button>
-                        <span style="margin:0 3px;">|</span>
-                        <el-button type="text" size="small" class="delete" @click="showDelDialog(scope.row,1)">删除</el-button>
-                    </template>
-                </el-table-column>
-            </el-table>
-            <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>
+    <crumbs title="诊断依据维护" :minWidth="titleWidth" class="knowledgeTitle">
+      <el-form :inline="true" class="demo-form-inline">
+        <el-form-item label="疾病名称:">
+          <el-input size="mini" v-model="filter.conceptName" placeholder="输入疾病名称" clearable></el-input>
+        </el-form-item>
+        <el-form-item label="描述:">
+          <el-input size="mini" v-model="filter.description" placeholder="输入描述" clearable></el-input>
+        </el-form-item>
+        <el-form-item label="状态:">
+          <el-select v-model="filter.status" clearable placeholder="请选择" size="mini">
+            <el-option
+              v-for="item in stateSelect"
+              :key="item.id"
+              :label="item.name"
+              :value="item.id"
+            ></el-option>
+          </el-select>
+        </el-form-item>
+        <el-form-item>
+          <el-button size="mini" @click="filterDatas">确认</el-button>
+        </el-form-item>
+        <el-form class="secLine">
+          <el-form-item>
+            <el-button size="mini" @click="addRule" type="warning" style="margin:0 10px">+ 新增诊断依据</el-button>
+            <el-button size="mini" @click="update">更新数据</el-button>
+          </el-form-item>
+        </el-form>
+      </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="conceptName" label="疾病名称" width="160">
+          <template slot-scope="scope">
+            <el-tooltip
+              v-if="scope.row.conceptName.length>8"
+              class="item"
+              effect="dark"
+              :content="scope.row.conceptName"
+              placement="top"
+            >
+              <span>{{scope.row.conceptName.slice(0,8)+'...'}}</span>
+            </el-tooltip>
+            <span v-if="scope.row.conceptName.length<9">{{scope.row.conceptName}}</span>
+          </template>
+        </el-table-column>
+        <el-table-column prop="description" label="描述" width="160">
+          <template slot-scope="scope">
+            <el-tooltip
+              v-if="scope.row.description.length>8"
+              class="item"
+              effect="dark"
+              :content="scope.row.description"
+              placement="top"
+            >
+              <span>{{scope.row.description.slice(0,8)+'...'}}</span>
+            </el-tooltip>
+            <span v-if="scope.row.description.length<9">{{scope.row.description}}</span>
+          </template>
+        </el-table-column>
+        <el-table-column label="状态">
+          <template slot-scope="scope">
+            <span>{{scope.row.status === 0?'禁用':'启用'}}</span>
+          </template>
+        </el-table-column>
+        <el-table-column prop="modifierName" label="操作人"></el-table-column>
+        <el-table-column prop="gmtModified" label="操作时间" width="180"></el-table-column>
+        <el-table-column label="操作" width="180" fixed="right">
+          <template slot-scope="scope">
+            <el-button type="text" size="small" @click="editData(scope.row)">修改</el-button>
+            <span style="margin:0 3px;">|</span>
+            <el-button type="text" size="small" @click="editData(scope.row,true)">复制</el-button>
+            <span style="margin:0 3px;">|</span>
+            <el-button
+              type="text"
+              size="small"
+              :class="scope.row.status === 0?'':'unvailable'"
+              @click="showDelDialog(scope.row)"
+            >{{scope.row.status === 0?'启用':'禁用'}}</el-button>
+            <span style="margin:0 3px;">|</span>
+            <el-button
+              type="text"
+              size="small"
+              class="delete"
+              @click="showDelDialog(scope.row,1)"
+            >删除</el-button>
+          </template>
+        </el-table-column>
+      </el-table>
+      <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>
 </template>
 
 <script>
-    import api from '@api/zskDiagBase.js';
-    import config from '@api/config.js';
-    import utils from '@api/utils.js';
+import api from '@api/zskDiagBase.js';
+import config from '@api/config.js';
+import utils from '@api/utils.js';
 
-    export default {
-        name: 'ZskDiagBase',
-        data: function () {
-            return {
-                list: [],
-                stateSelect:[
-                    {id:1,name:'启用'},
-                    {id:0,name:'禁用'},
-                ],
-                ruleTypeList:[],
-                searched: false,
-                filter:{
-                    conceptName:'',
-                    description:'',
-                    status:''
-                },
-                cacheData: {},
-                currentPage: 1,
-                pageSize: config.pageSize,
-                pageSizeArr:config.pageSizeArr,
-                pageLayout:config.pageLayout,
-                total: 0,
-                titleWidth:'1070px' //头部最小宽度
+export default {
+  name: 'ZskDiagBase',
+  data: function() {
+    return {
+      list: [],
+      stateSelect: [
+        { id: 1, name: '启用' },
+        { id: 0, name: '禁用' }
+      ],
+      ruleTypeList: [],
+      searched: false,
+      filter: {
+        conceptName: '',
+        description: '',
+        status: ''
+      },
+      cacheData: {},
+      currentPage: 1,
+      pageSize: config.pageSize,
+      pageSizeArr: config.pageSizeArr,
+      pageLayout: config.pageLayout,
+      total: 0,
+      titleWidth: '1070px' //头部最小宽度
+    };
+  },
+  created() {
+    const param = this.$route.params;
+    if (param.currentPage) {
+      this.inCurrentPage = param.currentPage;
+      this.filter = param.filter;
+    }
+    this.getTypeList();
+    const that = this;
+    //返回时避免参数未赋值就获取列表
+    setTimeout(function() {
+      that.getDataList();
+    });
+  },
+  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: {
+    getDict() {
+      api
+        .zskgetDict()
+        .then(res => {
+          if (res.data.code == '0') {
+            const data = res.data.data;
+            localStorage.setItem(
+              'zskDiagDicts',
+              `{"onlyNum":"${data['24'][0].val}","onlyTxt":"${data['25'][0].val}"}`
+            );
+          }
+        })
+        .catch(error => {
+          console.log(error);
+        });
+    },
+    getTypeList() {
+      this.getDict();
+      api
+        .getTypesList({ planCode: 'dis' })
+        .then(res => {
+          if (res.data.code == '0') {
+            const data = res.data.data;
+            localStorage.setItem('zskDiagList', JSON.stringify(data));
+          }
+        })
+        .catch(error => {
+          console.log(error);
+        });
+    },
+    handleSizeChange(val) {
+      this.pageSize = val;
+      this.currentPage = utils.getCurrentPage(
+        this.currentPage,
+        this.total,
+        this.pageSize
+      );
+      this.getDataList();
+    },
+    addRule() {
+      const pam = this.searched
+        ? {
+            currentPage: this.currentPage,
+            pageSize: this.pageSize,
+            filter: this.filter
+          }
+        : { currentPage: this.currentPage, pageSize: this.pageSize };
+      this.$router.push({ name: 'AddZskDiagBase', params: pam });
+    },
+    filterDatas() {
+      this.currentPage = 1;
+      this.getDataList(1);
+    },
+    getDataList(flag, 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
+        .diagBasePage(params)
+        .then(res => {
+          loading.close();
+          if (res.data.code == '0') {
+            const data = res.data.data;
+            for (let j = 0; j < data.records.length; j++) {
+              data.records[j].condition =
+                data.records[j].parStatus == '1' ? '启用' : '禁用';
             }
-        },
-        created() {
-            const param = this.$route.params;
-            if(param.currentPage){
-                this.inCurrentPage = param.currentPage;
-                this.filter = param.filter
+            this.list = data.records;
+            if (!flag) {
+              //搜索时不缓存
+              this.cacheData[params.current] = data.records;
+            } else {
+              this.cacheData = {};
             }
-            this.getTypeList();
-            const that = this;
-            //返回时避免参数未赋值就获取列表
-            setTimeout(function(){
-                that.getDataList();
-            });
-        },
-        watch: {
-            'filter': {
-                handler: function () {
-                    this.searched = false;
-                },
-                deep: true
+            this.total = data.total;
+            if (this.inCurrentPage !== undefined) {
+              this.currentPage = this.inCurrentPage;
+              this.inCurrentPage = undefined;
             }
-        },
-        // beforeRouteEnter(to, from, next) {
-        //     next(vm => {
-        //         //const pm = to.param;
-        //         Object.assign(vm, to.params);
-        //         vm.inCurrentPage=to.params.currentPage;
-        //     })
-        // },
-        methods: {
-            getDict(){
-                api.zskgetDict().then((res) => {
-                    if (res.data.code == '0') {
-                        const data = res.data.data;
-                        localStorage.setItem("zskDiagDicts",`{"onlyNum":"${data['24'][0].val}","onlyTxt":"${data['25'][0].val}"}`);
-                    }
-                }).catch((error) => {
-                    console.log(error);
-                });
-            },
-            getTypeList(){
-                this.getDict();
-                api.getTypesList({planCode:'dis'}).then((res) => {
-                    if (res.data.code == '0') {
-                        const data = res.data.data;
-                        localStorage.setItem("zskDiagList",JSON.stringify(data));
-                    }
-                }).catch((error) => {
-                    console.log(error);
-                });
-            },
-            handleSizeChange(val){
-                this.pageSize = val;
-                this.currentPage = utils.getCurrentPage(this.currentPage, this.total, this.pageSize);
-                this.getDataList();
-            },
-            addRule(){
-                const pam = this.searched ? {
-                    currentPage: this.currentPage,
-                    pageSize:this.pageSize,
-                    filter: this.filter
-                } : {currentPage: this.currentPage,
-                    pageSize:this.pageSize};
-                this.$router.push({name: 'AddZskDiagBase', params: pam});
-            },
-            filterDatas(){
-                this.currentPage = 1;
-                this.getDataList(1);
-            },
-            getDataList(flag,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.diagBasePage(params).then((res) => {
-                    loading.close();
-                    if (res.data.code == '0') {
-                        const data = res.data.data;
-                        for(let j = 0;j < data.records.length;j++){
-                            data.records[j].condition = (data.records[j].parStatus == '1'?'启用':'禁用')
-                        }
-                        this.list = data.records;
-                        if(!flag){//搜索时不缓存
-                            this.cacheData[params.current] = data.records;
-                        }else{
-                            this.cacheData = {}
-                        }
-                        this.total = data.total;
-                        if(this.inCurrentPage!==undefined){
-                            this.currentPage=this.inCurrentPage;
-                            this.inCurrentPage = undefined;
-                        }
-                    }else{
-                        this.warning(res.data.msg||'获取列表数据失败');
-                    }
-                }).catch((error) => {
-                    loading.close();
-                    console.log(error);
-                });
-            },
-            getFilterItems(isTurnPage) {
-                //翻页时筛选条件没点确定则清空
-                if(isTurnPage&&!this.searched){
-                    this.clearFilter();
-                };
-                const param = {
-                    current: this.inCurrentPage||this.currentPage,
-                    size: this.pageSize,
-                    conceptName: this.filter.conceptName,
-                    description: this.filter.description,
-                    status:this.filter.status
-                };
-                return param;
-            },
-            indexMethod(index) {
-                return ((this.currentPage - 1) * this.pageSize) + index + 1;
-            },
-            currentChange(next) {
-                this.currentPage = next;
-                /*if (this.cacheData[next]) {       //如果已请求过该页数据,则使用缓存不重复请求
+          } else {
+            this.warning(res.data.msg || '获取列表数据失败');
+          }
+        })
+        .catch(error => {
+          loading.close();
+          console.log(error);
+        });
+    },
+    getFilterItems(isTurnPage) {
+      //翻页时筛选条件没点确定则清空
+      if (isTurnPage && !this.searched) {
+        this.clearFilter();
+      }
+      const param = {
+        current: this.inCurrentPage || this.currentPage,
+        size: this.pageSize,
+        conceptName: this.filter.conceptName,
+        description: this.filter.description,
+        status: this.filter.status
+      };
+      return param;
+    },
+    indexMethod(index) {
+      return (this.currentPage - 1) * this.pageSize + index + 1;
+    },
+    currentChange(next) {
+      this.currentPage = next;
+      /*if (this.cacheData[next]) {       //如果已请求过该页数据,则使用缓存不重复请求
                   this.list = this.cacheData[next];
                 } else {*/
-                this.getDataList(1,true);
-                //}
-            },
-            warning(msg,type){
-                this.$message({
-                    showClose: true,
-                    message:msg,
-                    type:type||'warning'
-                })
-            },
-            showConfirmDialog(msg,resolve){
-                this.$alert(msg, '提示', {
-                    confirmButtonText: '确定',
-                    type: 'warning'
-                }).then(() => {
-                    resolve();
-                }).catch(() => {});
-            },
-            editData(row,isCopy){
-                const pam = this.searched ? {
-                    currentPage: this.currentPage,
-                    pageSize:this.pageSize,
-                    filter: this.filter
-                } : {currentPage: this.currentPage,
-                    pageSize:this.pageSize};
-                api.diagBaseGetDetail({id:row.id}).then((res) => {
-                    if (res.data.code == '0') {
-                        const data = res.data.data;
-                        this.$router.push({name:'AddZskDiagBase',params:{...pam,data:{...row,klDiagnoseTypeVO:data},copy:isCopy}});
-                    }
-                }).catch((error) => {
-                    this.warning('获取详情失败,请重试')
-                });
-            },
-            showDelDialog(row,isDelete){
-                const params = {
-                    id:row.id
-                };
-                const txt=row.status===0?'重新启用':'禁用';
-                const warningTxt = isDelete?'是否删除该诊断依据?可能对现有系统造成影响':'是否'+txt+'该诊断依据?';
-                const handleFn = isDelete?api.diagBaseDelete:(row.status===0?api.diagBaseApply:api.diagBaseStop);
-                this.showConfirmDialog(warningTxt,()=>{
-                    handleFn(params).then((res)=>{
-                        if(res.data.code=='0'){
-                            if(!this.searched){
-                                //未点确认时清空搜索条件
-                                this.clearFilter();
-                            }
-                            if(isDelete){       //恢复成功后跳转到筛选条件的首页
-                                this.currentPage = 1;
-                            } else {
-                                if (this.filter.status!==''&&this.list.length === 1){
-                                    //有启用状态筛选条件且当前页只有最后一条数据删除时,删除成功后跳转到前一页
-                                    this.currentPage = this.currentPage===1?1:this.currentPage-1;
-                                }
-                            }
-                            this.warning(res.data.msg||'操作成功','success');
-                            this.getDataList();
-                        }else{
-                            this.warning(res.data.msg);
-                        }
-                    }).catch((error)=>{
-                        this.warning(error);
-                    })
-                });
-            },
-            clearFilter(){
-                this.filter={
-                    conceptName:'',
-                    description:'',
-                    status:''
-                };
-            },
-            update(){
-                const loading = this.$loading({
-                    lock: true,
-                    text: 'Loading',
-                    spinner: 'el-icon-loading',
-                    background: 'rgba(0, 0, 0, 0.7)'
-                });
-                api.updateDiagBase().then((res) => {
-                    loading.close();
-                    if (res.data.code == '0') {
-                        this.warning('更新成功','success');
-                        this.getDataList();
-                    }else{
-                        this.warning(res.data.msg||'更新失败,请重试');
-                    }
-                }).catch((error) => {
-                    loading.close();
-                    this.warning('更新失败,请重试')
-                });
-            },
-        }
+      this.getDataList(1, true);
+      //}
+    },
+    warning(msg, type) {
+      this.$message({
+        showClose: true,
+        message: msg,
+        type: type || 'warning'
+      });
+    },
+    showConfirmDialog(msg, resolve) {
+      this.$alert(msg, '提示', {
+        confirmButtonText: '确定',
+        type: 'warning'
+      })
+        .then(() => {
+          resolve();
+        })
+        .catch(() => {});
+    },
+    editData(row, isCopy) {
+      const pam = this.searched
+        ? {
+            currentPage: this.currentPage,
+            pageSize: this.pageSize,
+            filter: this.filter
+          }
+        : { currentPage: this.currentPage, pageSize: this.pageSize };
+      api
+        .diagBaseGetDetail({ id: row.id })
+        .then(res => {
+          if (res.data.code == '0') {
+            const data = res.data.data;
+            this.$router.push({
+              name: 'AddZskDiagBase',
+              params: {
+                ...pam,
+                data: { ...row, klDiagnoseTypeVO: data },
+                copy: isCopy
+              }
+            });
+          }
+        })
+        .catch(error => {
+          this.warning('获取详情失败,请重试');
+        });
+    },
+    showDelDialog(row, isDelete) {
+      const params = {
+        id: row.id
+      };
+      const txt = row.status === 0 ? '重新启用' : '禁用';
+      const warningTxt = isDelete
+        ? '是否删除该诊断依据?可能对现有系统造成影响'
+        : '是否' + txt + '该诊断依据?';
+      const handleFn = isDelete
+        ? api.diagBaseDelete
+        : row.status === 0
+        ? api.diagBaseApply
+        : api.diagBaseStop;
+      this.showConfirmDialog(warningTxt, () => {
+        handleFn(params)
+          .then(res => {
+            if (res.data.code == '0') {
+              if (!this.searched) {
+                //未点确认时清空搜索条件
+                this.clearFilter();
+              }
+              if (isDelete) {
+                //恢复成功后跳转到筛选条件的首页
+                this.currentPage = 1;
+              } else {
+                if (this.filter.status !== '' && this.list.length === 1) {
+                  //有启用状态筛选条件且当前页只有最后一条数据删除时,删除成功后跳转到前一页
+                  this.currentPage =
+                    this.currentPage === 1 ? 1 : this.currentPage - 1;
+                }
+              }
+              this.warning(res.data.msg || '操作成功', 'success');
+              this.getDataList();
+            } else {
+              this.warning(res.data.msg);
+            }
+          })
+          .catch(error => {
+            this.warning(error);
+          });
+      });
+    },
+    clearFilter() {
+      this.filter = {
+        conceptName: '',
+        description: '',
+        status: ''
+      };
+    },
+    update() {
+      const loading = this.$loading({
+        lock: true,
+        text: 'Loading',
+        spinner: 'el-icon-loading',
+        background: 'rgba(0, 0, 0, 0.7)'
+      });
+      api
+        .updateDiagBase()
+        .then(res => {
+          loading.close();
+          if (res.data.code == '0') {
+            this.warning('更新成功', 'success');
+            this.getDataList();
+          } else {
+            this.warning(res.data.msg || '更新失败,请重试');
+          }
+        })
+        .catch(error => {
+          loading.close();
+          this.warning('更新失败,请重试');
+        });
     }
+  }
+};
 </script>
 
 <style lang="less" scoped>
-    @import "../../less/admin.less";
-    /deep/ .container.knowledgeTitle {
-        height: 40px;
-        min-width: 970px!important;
-    }
-    .demo-form-inline{
-        margin: 0 20px 0 0;
-    }
-    /deep/ .contents.knowledgeContents {
-        padding: 64px 20px 0;
-    }
-    /deep/ .secLine.el-form {
-        float: right;
-        display: block;
-        position: relative;
-        top: -1px;
-    }
-    .delete{
-        color: red;
-    }
-    .review{
-        color: #22ccc8;
-    }
-    .el-table .cell{
-        overflow: hidden;
-        white-space: nowrap;
-    }
-    #upFile{
-        display: none !important;
-    }
-    .unvailable{
-        color: #FE7D3D;
-        &:hover,&:active,&:focus{
-            color: #f19061;
-        }
-    }
+@import '../../less/admin.less';
+/deep/ .container.knowledgeTitle {
+  height: 40px;
+  min-width: 970px !important;
+}
+.demo-form-inline {
+  margin: 0 20px 0 0;
+}
+/deep/ .contents.knowledgeContents {
+  padding: 64px 20px 0;
+}
+/deep/ .secLine.el-form {
+  float: right;
+  display: block;
+  position: relative;
+  top: -1px;
+}
+.delete {
+  color: red;
+}
+.review {
+  color: #22ccc8;
+}
+.el-table .cell {
+  overflow: hidden;
+  white-space: nowrap;
+}
+#upFile {
+  display: none !important;
+}
+.unvailable {
+  color: #fe7d3d;
+  &:hover,
+  &:active,
+  &:focus {
+    color: #f19061;
+  }
+}
 </style>

+ 3 - 0
src/components/knowledgeExtra/DiagBaseGroup.vue

@@ -47,6 +47,9 @@
             return {
             }
         },
+        mounted(){
+            console.log(this.data)
+        },
         computed:{
             len:function(){
                 return util.delNullObj(this.data.klDiagnoseDetail).length;

+ 430 - 366
src/components/knowledgeExtra/DiagBaseItem.vue

@@ -1,385 +1,449 @@
 <template>
-    <div class="groups-cont" v-if="groupData">
-        <!--<el-form ref="groupData" label-width="150px" class="sub-condition-form" :model="groupData" :rules="rules">-->
-        <div class="sub-condition-form">
-        <span v-if="!hideDel" class="del-btn"  @click="delRule">删除</span><!--:class="isLast?'disable del-btn':'del-btn'"-->
-            <el-form-item label="基础依据名称:" :key="0" :prop="ruleLine+ind+'.basDescription'">
-                <el-input v-model.trim = "groupData.basDescription" clearable></el-input>
+  <div class="groups-cont" v-if="groupData">
+    <!--<el-form ref="groupData" label-width="150px" class="sub-condition-form" :model="groupData" :rules="rules">-->
+    <div class="sub-condition-form">
+      <span v-if="!hideDel" class="del-btn" @click="delRule">删除</span>
+      <!--:class="isLast?'disable del-btn':'del-btn'"-->
+      <el-form-item label="基础依据名称:" :key="0" :prop="ruleLine+ind+'.basDescription'">
+        <el-input v-model.trim="groupData.basDescription" clearable></el-input>
+      </el-form-item>
+      <el-form-item label="基础依据类型:" :key="1" :prop="ruleLine+ind+'.basType'">
+        <el-select
+          v-model="groupData.basType"
+          id="basTypeRef"
+          placeholder="请选择"
+          size="small"
+          @change="basTypeChange"
+        >
+          <el-option v-for="item in baseTypes" :key="item.id" :label="item.name" :value="item.type"></el-option>
+        </el-select>
+      </el-form-item>
+      <el-form-item v-if="!showRegx" :key="2" label="基础依据术语类型:" :prop="ruleLine+ind+'.basLibType'">
+        <el-select
+          v-model="groupData.basLibType"
+          placeholder="请选择"
+          size="small"
+          :disabled="showRegx"
+          @change="basLibTypeChange"
+        >
+          <el-option
+            v-for="item in baseTermTypeList"
+            :key="item.id"
+            :label="item.name"
+            :value="Number(item.code)"
+          ></el-option>
+        </el-select>
+      </el-form-item>
+      <el-form-item v-if="showRegx" :key="3" label="基础依据术语类型:" class="is-required">
+        <el-input disabled v-model="basTypeName"></el-input>
+      </el-form-item>
+      <el-form-item
+        v-if="!showRegx"
+        :key="4"
+        class="addDepartFormItem"
+        label="医学标准术语:"
+        :prop="ruleLine+ind+'.basConceptId'"
+      >
+        <el-select
+          clearable
+          remote
+          filterable
+          :remote-method="searchConcept"
+          v-model.trim="groupData.basConceptId"
+          @change="conceptChange"
+        >
+          <el-option
+            v-for="item in conceptList"
+            :key="item.conceptId"
+            :label="item.conceptName"
+            :value="item.conceptId"
+          ></el-option>
+        </el-select>
+      </el-form-item>
+      <el-form-item
+        :key="5"
+        v-if="groupData.basType===2&&!onlyNum&&!onlyTxt"
+        label="选择类型:"
+        :prop="ruleLine+ind+'.dataType'"
+      >
+        <el-select
+          v-model="groupData.dataType"
+          placeholder="请选择"
+          size="small"
+          @change="dataTypeChange"
+        >
+          <el-option v-for="item in dataTypes" :key="item.id" :label="item.name" :value="item.id"></el-option>
+        </el-select>
+      </el-form-item>
+      <el-form-item
+        class="min-margin"
+        :key="6"
+        v-if="(!showRegx&&groupData.dataType==='1')||onlyNum"
+        label="最大值:"
+      >
+        <div class="select-item clearfix">
+          <el-col :span="3">
+            <el-form-item :prop="ruleLine+ind+'.maxOperator'">
+              <el-select v-model="groupData.maxOperator" placeholder="请选择" size="small" clearable>
+                <el-option
+                  v-for="item in operMaxList"
+                  :key="item.key"
+                  :label="item.name"
+                  :value="item.key"
+                ></el-option>
+              </el-select>
             </el-form-item>
-            <el-form-item label="基础依据类型:" :key="1" :prop="ruleLine+ind+'.basType'">
-                <el-select v-model="groupData.basType"
-                           id="basTypeRef"
-                           placeholder="请选择"
-                           size="small"
-                           @change="basTypeChange">
-                    <el-option
-                            v-for="item in baseTypes"
-                            :key="item.id"
-                            :label="item.name"
-                            :value="item.type">
-                    </el-option>
-                </el-select>
+          </el-col>
+          <el-col :span="3">
+            <el-form-item :prop="ruleLine+ind+'.maxVal'">
+              <el-input type="text" v-model="groupData.maxVal" placeholder="填写数值" />
             </el-form-item>
-            <el-form-item v-if="!showRegx" :key="2" label="基础依据术语类型:" :prop="ruleLine+ind+'.basLibType'">
-                <el-select v-model="groupData.basLibType"
-                           placeholder="请选择"
-                           size="small"
-                           :disabled="showRegx" @change="basLibTypeChange">
-                    <el-option
-                            v-for="item in baseTermTypeList"
-                            :key="item.id"
-                            :label="item.name"
-                            :value="Number(item.code)">
-                    </el-option>
-                </el-select>
+          </el-col>
+          <el-col :span="3">
+            <el-form-item prop="maxUnit">
+              <el-input type="text" v-model.trim="groupData.maxUnit" placeholder="填写单位" />
             </el-form-item>
-            <el-form-item v-if="showRegx" :key="3" label="基础依据术语类型:" class="is-required">
-                <el-input disabled v-model="basTypeName"></el-input>
-            </el-form-item>
-            <el-form-item v-if="!showRegx" :key="4" class="addDepartFormItem" label="医学标准术语:" :prop="ruleLine+ind+'.basConceptId'">
-                <el-select clearable remote filterable :remote-method="searchConcept" v-model.trim="groupData.basConceptId" @change="conceptChange">
-                    <el-option
-                            v-for="item in conceptList"
-                            :key="item.conceptId"
-                            :label="item.conceptName"
-                            :value="item.conceptId">
-                    </el-option>
-                </el-select>
-            </el-form-item>
-            <el-form-item :key="5" v-if="groupData.basType===2&&!onlyNum&&!onlyTxt" label="选择类型:" :prop="ruleLine+ind+'.dataType'">
-                <el-select v-model="groupData.dataType"
-                           placeholder="请选择"
-                           size="small" @change="dataTypeChange">
-                    <el-option
-                            v-for="item in dataTypes"
-                            :key="item.id"
-                            :label="item.name"
-                            :value="item.id">
-                    </el-option>
-                </el-select>
-            </el-form-item>
-            <el-form-item class="min-margin" :key="6" v-if="(!showRegx&&groupData.dataType==='1')||onlyNum" label="最大值:">
-                <div class="select-item clearfix">
-                    <el-col :span="3">
-                        <el-form-item :prop="ruleLine+ind+'.maxOperator'">
-                            <el-select v-model="groupData.maxOperator"
-                                       placeholder="请选择"
-                                       size="small" clearable>
-                                <el-option
-                                        v-for="item in operMaxList"
-                                        :key="item.key"
-                                        :label="item.name"
-                                        :value="item.key">
-                                </el-option>
-                            </el-select>
-                        </el-form-item>
-                    </el-col>
-                    <el-col :span="3">
-                        <el-form-item :prop="ruleLine+ind+'.maxVal'">
-                            <el-input type="text" v-model="groupData.maxVal" placeholder="填写数值"/>
-                        </el-form-item>
-                    </el-col>
-                    <el-col :span="3">
-                        <el-form-item prop="maxUnit">
-                            <el-input  type="text" v-model.trim="groupData.maxUnit" placeholder="填写单位"/>
-                        </el-form-item>
-                    </el-col>
-                </div>
-            </el-form-item>
-            <el-form-item class="min-margin" v-if="(!showRegx&&groupData.dataType==='1')||onlyNum" label="最小值:">
-                <div class="select-item clearfix">
-                    <el-col :span="3">
-                        <el-form-item :prop="ruleLine+ind+'.minOperator'">
-                            <el-select v-model="groupData.minOperator"
-                                       placeholder="请选择"
-                                       size="small" clearable>
-                                <el-option
-                                        v-for="item in operMinList"
-                                        :key="item.name"
-                                        :label="item.name"
-                                        :value="item.name">
-                                </el-option>
-                            </el-select>
-                        </el-form-item>
-                    </el-col>
-                    <el-col :span="3">
-                        <el-form-item :prop="ruleLine+ind+'.minVal'">
-                            <el-input type="text" v-model="groupData.minVal" placeholder="填写数值"/>
-                        </el-form-item>
-                    </el-col>
-                    <el-col :span="3">
-                        <el-form-item prop="minUnit">
-                            <el-input  type="text" v-model.trim="groupData.minUnit" placeholder="填写单位"/>
-                        </el-form-item>
-                    </el-col>
-                </div>
+          </el-col>
+        </div>
+      </el-form-item>
+      <el-form-item
+        class="min-margin"
+        v-if="(!showRegx&&groupData.dataType==='1')||onlyNum"
+        label="最小值:"
+      >
+        <div class="select-item clearfix">
+          <el-col :span="3">
+            <el-form-item :prop="ruleLine+ind+'.minOperator'">
+              <el-select v-model="groupData.minOperator" placeholder="请选择" size="small" clearable>
+                <el-option
+                  v-for="item in operMinList"
+                  :key="item.name"
+                  :label="item.name"
+                  :value="item.name"
+                ></el-option>
+              </el-select>
             </el-form-item>
-            <el-form-item v-if="showRegx" key="v11" label="正则表达式:" :prop="ruleLine+ind+'.eqValue'" class="discDesc">
-                <el-input type="textarea" rows="3" placeholder="请输入正则表达式" v-model.trim="groupData.eqValue"></el-input>
+          </el-col>
+          <el-col :span="3">
+            <el-form-item :prop="ruleLine+ind+'.minVal'">
+              <el-input type="text" v-model="groupData.minVal" placeholder="填写数值" />
             </el-form-item>
-            <el-form-item key="v13" v-if="(!onlyNum&&!showRegx&&groupData.basType===2&&groupData.dataType==='2')||onlyTxt" label="医学内容:" :prop="ruleLine+ind+'.eqValue'" class="discDesc">
-                <el-input placeholder="请输入医学内容" v-model.trim="groupData.eqValue"></el-input>
-                <span class="tip-text">注:可输入升高、降低、阴性、阳性等~</span>
+          </el-col>
+          <el-col :span="3">
+            <el-form-item prop="minUnit">
+              <el-input type="text" v-model.trim="groupData.minUnit" placeholder="填写单位" />
             </el-form-item>
+          </el-col>
         </div>
-        <!--</el-form>-->
+      </el-form-item>
+      <el-form-item
+        v-if="showRegx"
+        key="v11"
+        label="正则表达式:"
+        :prop="ruleLine+ind+'.eqValue'"
+        class="discDesc"
+      >
+        <el-input type="textarea" rows="3" placeholder="请输入正则表达式" v-model.trim="groupData.eqValue"></el-input>
+      </el-form-item>
+      <el-form-item
+        key="v13"
+        v-if="(!onlyNum&&!showRegx&&groupData.basType===2&&groupData.dataType==='2')||onlyTxt"
+        label="医学内容:"
+        :prop="ruleLine+ind+'.eqValue'"
+        class="discDesc"
+      >
+        <el-input placeholder="请输入医学内容" v-model.trim="groupData.eqValue"></el-input>
+        <span class="tip-text">注:可输入升高、降低、阴性、阳性等~</span>
+      </el-form-item>
     </div>
+    <!--</el-form>-->
+  </div>
 </template>
 <script>
-    import api from '@api/zskDiagBase.js';
-    export default {
-        name:'DiagBaseItem',
-        props:['groupData','ind','baseTypes','parInx','inx','hideDel'],
-        data(){
-            return {
-                dicts:{},
-                baseTermTypeList:[],
-                typeList:[],
-                numTypes:'',    //只有数值类型的类型id
-                //basTypeName:'',
-                operMaxList:[
-                    {name:'<=',key:'<='},
-                    {name:'<',key:'<'},
-                ],
-                operMinList:[{name:'>',key:'>'},
-                    {name:'>=',key:'>='},
-                ],
-                dataTypes:[{id:'1',name:'数值类型'},{id:'2',name:'文本类型'}],
-                conceptList:[],
-            }
-        },
-        created(){
-            this.dicts=JSON.parse(localStorage.getItem("zskDiagDicts")||'{}');
-            if(this.groupData){
-                if(this.groupData.maxOperator||this.groupData.minOperator){
-                    this.groupData.dataType='1';
-                }else if(this.groupData.eqValue){
-                    this.groupData.dataType='2';
-                }
-            }
-            this.conceptList=[{conceptName:this.groupData.basLibName,conceptId:this.groupData.basConceptId}];
-            if(this.groupData.basType){
-                const obj = this.baseTypes.find((it)=>it.type===this.groupData.basType);
-                this.baseTermTypeList = obj.subMenuList;
-            }
-        },
-        computed:{
-            basTypeName:function(){
-                return (this.baseTypes.find((it)=>it.type===this.groupData.basType)||{}).name;
-            },
-            onlyNum:function(){
-                const onlyNum =this.dicts['onlyNum']||'&';
-                const codes=onlyNum+',';
-                const type=this.groupData.basLibType;
-                return type&&codes.indexOf(this.groupData.basLibType+',')>-1;
-            },
-            onlyTxt:function(){
-                const onlyTxt =this.dicts['onlyTxt']||'&';
-                const codes=onlyTxt+',';
-                const type=this.groupData.basLibType;
-                return type&&codes.indexOf(this.groupData.basLibType+',')>-1;
-            },
-            ruleLine:function(){
-              return 'klDiagnoseTypeVO.'+this.parInx+'.groupVO.'+this.inx+'.klDiagnoseDetail.';
-            },
-            showRegx:function(){
-              return this.groupData.basType===3||this.groupData.basType===4;
-            },
-        },
-        methods:{
-            dataTypeChange(val){
-                this.groupData.eqOperator=(val==='2'?'=':'');
-                this.clearNumText();
-                delete this.groupData.dataType;     //触发更新
-                this.$set(this.groupData,'dataType',val);
-            },
-            basTypeChange(val){        //基础依据类型修改
-                if(!val){
-                    this.baseTermTypeList =[];
-                    return;
-                }
-                this.groupData.basLibType='';
-                this.groupData.dataType='';
-                this.clearConcept();    //清空医学标准术语
-                this.clearNumText();    //清空数值、医学内容
-                const obj = this.baseTypes.find((it)=>it.type===val);
-                this.baseTermTypeList = obj.subMenuList;
-            },
-            basLibTypeChange(val){        //基础依据术语类型修改
-                this.groupData.basLibType=val;
-                if((this.numTypes+',').indexOf(val+',')>-1){
-                    this.groupData.dataType='1';
-                }else{
-                    this.groupData.dataType='';
-                }
-                this.clearConcept();
-                this.clearNumText();
-            },
-            conceptChange(val){
-                this.groupData.basConceptId=val;
-                if(val){
-                    this.groupData.basLibName=this.conceptList.find((it)=>it.conceptId===val).conceptName;
-                }else{
-                    this.groupData.basLibName='';
-                }
-            },
-            clearConcept(){
-                this.groupData.basConceptId='';
-                this.groupData.basLibName='';
-                this.conceptList=[];
-            },
-            clearNumText(){
-                this.groupData.maxOperator='';
-                this.groupData.maxVal='';
-                this.groupData.maxUnit='';
-                this.groupData.minOperator='';
-                this.groupData.minVal='';
-                this.groupData.minUnit='';
-                this.groupData.eqValue='';
-                this.groupData.eqOperator='';
-            },
-            searchConcept(val){
-                const param = {
-                    excludedConceptIds:[this.groupData.basType],
-                    libType:this.groupData.basLibType,
-                    name:val,
-                };
-                api.searchConcept(param).then((res) => {
-                    if (res.data.code == '0') {
-                        const data = res.data.data;
-                        this.conceptList = data;
-                    }
-                }).catch((error) => {
-                    console.log(error);
-                });
-            },
-            /*addRule(){
+import api from '@api/zskDiagBase.js';
+export default {
+  name: 'DiagBaseItem',
+  props: ['groupData', 'ind', 'baseTypes', 'parInx', 'inx', 'hideDel'],
+  data() {
+    return {
+      dicts: {},
+      baseTermTypeList: [],
+      typeList: [],
+      numTypes: '', //只有数值类型的类型id
+      //basTypeName:'',
+      operMaxList: [
+        { name: '<=', key: '<=' },
+        { name: '<', key: '<' }
+      ],
+      operMinList: [
+        { name: '>', key: '>' },
+        { name: '>=', key: '>=' }
+      ],
+      dataTypes: [
+        { id: '1', name: '数值类型' },
+        { id: '2', name: '文本类型' }
+      ],
+      conceptList: []
+    };
+  },
+  created() {
+    this.dicts = JSON.parse(localStorage.getItem('zskDiagDicts') || '{}');
+    if (this.groupData) {
+      if (this.groupData.maxOperator || this.groupData.minOperator) {
+        this.groupData.dataType = '1';
+      } else if (this.groupData.eqValue) {
+        this.groupData.dataType = '2';
+      }
+    }
+    this.conceptList = [
+      {
+        conceptName: this.groupData.basLibName,
+        conceptId: this.groupData.basConceptId
+      }
+    ];
+    if (this.groupData.basType) {
+      const obj = this.baseTypes.find(it => it.type === this.groupData.basType);
+      this.baseTermTypeList = obj.subMenuList;
+    }
+  },
+  computed: {
+    basTypeName: function() {
+      return (
+        this.baseTypes.find(it => it.type === this.groupData.basType) || {}
+      ).name;
+    },
+    onlyNum: function() {
+      const onlyNum = this.dicts['onlyNum'] || '&';
+      const codes = onlyNum + ',';
+      const type = this.groupData.basLibType;
+      return type && codes.indexOf(this.groupData.basLibType + ',') > -1;
+    },
+    onlyTxt: function() {
+      const onlyTxt = this.dicts['onlyTxt'] || '&';
+      const codes = onlyTxt + ',';
+      const type = this.groupData.basLibType;
+      return type && codes.indexOf(this.groupData.basLibType + ',') > -1;
+    },
+    ruleLine: function() {
+      return (
+        'klDiagnoseTypeVO.' +
+        this.parInx +
+        '.groupVO.' +
+        this.inx +
+        '.klDiagnoseDetail.'
+      );
+    },
+    showRegx: function() {
+      return this.groupData.basType === 3 || this.groupData.basType === 4;
+    }
+  },
+  methods: {
+    dataTypeChange(val) {
+      this.groupData.eqOperator = val === '2' ? '=' : '';
+      this.clearNumText();
+      delete this.groupData.dataType; //触发更新
+      this.$set(this.groupData, 'dataType', val);
+    },
+    basTypeChange(val) {
+      //基础依据类型修改
+      if (!val) {
+        this.baseTermTypeList = [];
+        return;
+      }
+      this.groupData.basLibType = '';
+      this.groupData.dataType = '';
+      this.clearConcept(); //清空医学标准术语
+      this.clearNumText(); //清空数值、医学内容
+      const obj = this.baseTypes.find(it => it.type === val);
+      this.baseTermTypeList = obj.subMenuList;
+    },
+    basLibTypeChange(val) {
+      console.log(val)
+      //基础依据术语类型修改
+      this.groupData.basLibType = val;
+      console.log((this.numTypes + ',').indexOf(val + ','))
+      if ((this.numTypes + ',').indexOf(val + ',') > -1) {
+        this.groupData.dataType = '1';
+      } else {
+        this.groupData.dataType = '';
+      }
+      this.clearConcept();
+      this.clearNumText();
+    },
+    conceptChange(val) {
+      this.groupData.basConceptId = val;
+      if (val) {
+        this.groupData.basLibName = this.conceptList.find(
+          it => it.conceptId === val
+        ).conceptName;
+      } else {
+        this.groupData.basLibName = '';
+      }
+    },
+    clearConcept() {
+      this.groupData.basConceptId = '';
+      this.groupData.basLibName = '';
+      this.conceptList = [];
+    },
+    clearNumText() {
+      this.groupData.maxOperator = '';
+      this.groupData.maxVal = '';
+      this.groupData.maxUnit = '';
+      this.groupData.minOperator = '';
+      this.groupData.minVal = '';
+      this.groupData.minUnit = '';
+      this.groupData.eqValue = '';
+      this.groupData.eqOperator = '';
+    },
+    searchConcept(val) {
+      const param = {
+        excludedConceptIds: [this.groupData.basType],
+        libType: this.groupData.basLibType,
+        name: val
+      };
+      api
+        .searchConcept(param)
+        .then(res => {
+          if (res.data.code == '0') {
+            const data = res.data.data;
+            this.conceptList = data;
+          }
+        })
+        .catch(error => {
+          console.log(error);
+        });
+    },
+    /*addRule(){
                 this.$emit("addRule");
                 this.$emit('setRules');
             },*/
-            delRule(){
-                this.$emit("delRule",this.ind);
-                this.$emit('setRules');
-            },
-            warning(msg,type){
-                this.$message({
-                    showClose: true,
-                    message:msg,
-                    type:type||'warning'
-                })
-            },
-            showConfirmDialog(msg,resolve){
-                this.$alert(msg, '提示', {
-                    confirmButtonText: '确定',
-                    type: 'warning'
-                }).then(() => {
-                    resolve();
-                }).catch(() => {});
-            },
-        }
+    delRule() {
+      this.$emit('delRule', this.ind);
+      this.$emit('setRules');
+    },
+    warning(msg, type) {
+      this.$message({
+        showClose: true,
+        message: msg,
+        type: type || 'warning'
+      });
+    },
+    showConfirmDialog(msg, resolve) {
+      this.$alert(msg, '提示', {
+        confirmButtonText: '确定',
+        type: 'warning'
+      })
+        .then(() => {
+          resolve();
+        })
+        .catch(() => {});
     }
+  }
+};
 </script>
 <style lang="less">
-    .groups-cont{
-        background: #fff;
-        border-bottom:2px solid #F5F5F5;
-        .conceptItem{
-            padding: 0 10px;
-            cursor: pointer;
-            height: 32px;
-            line-height: 32px;
-            &:hover{
-                background: #ebedf1;
-            }
-        }
-        .sub-condition-form{
-            padding:10px 20px 9px;
-            position: relative;
-            border-bottom:1px solid #F5F5F5;
-            .del-btn{
-                color: #FF5B5B;
-                cursor: pointer;
-                position: absolute;
-                right: 20px;
-                top:20px;
-                z-index: 1;
-                &.disable{
-                    color: #B8B8B8;
-                }
-            }
-        }
-        .el-input__icon{
-            line-height: 32px;
-        }
-        .select-item{
-            &>div{
-                float: left;
-                margin-right: 10px;
-            }
-            .el-input{
-                width: auto;
-            }
-            input{
-                width: 95px;
-                line-height: 32px;
-                height: 32px;
-            }
-        }
-        .el-input,.el-input__inner{
-            width: 190px;
-            line-height: 32px;
-            height: 32px;
-        }
-        .el-button--danger.is-plain{
-            background: none;
-        }
-        .itemList {
-            position: absolute;
-            // display: none;
-            background: #fff;
-            width: 188px;
-            max-height: 160px;
-            border: 1px solid #DCDFE6;
-            left: 0;
-            top: 37px;
-            z-index: 2;
-            overflow-y: auto;
-        }
-        .el-form-item{
-            margin-bottom: 6px;
-            &.min-margin{
-                margin-bottom: 0;
-                position: relative;
-                .el-form-item__content{
-                    position: unset;
-                }
-                .el-form-item__error{
-                    top:10px;
-                    left: 460px;
-                    white-space: normal;
-                    width: 260px;
-                }
-            }
-            .el-textarea + .el-form-item__error{
-                top:80px;
-                left: 0;
-            }
-            .tip-text + .el-form-item__error{
-                top:40px;
-                left: 0;
-            }
-        }
-
-        .el-input-number{
-            width: 95px;
-        }
-        .el-input-number.is-controls-right .el-input-number__decrease, .el-input-number.is-controls-right .el-input-number__increase{
-            width: 25px;
-            height: 15px;
-            line-height: 16px;
-        }
-        .el-col-3 {
-            width: 94px;
-        }
+.groups-cont {
+  background: #fff;
+  border-bottom: 2px solid #f5f5f5;
+  .conceptItem {
+    padding: 0 10px;
+    cursor: pointer;
+    height: 32px;
+    line-height: 32px;
+    &:hover {
+      background: #ebedf1;
+    }
+  }
+  .sub-condition-form {
+    padding: 10px 20px 9px;
+    position: relative;
+    border-bottom: 1px solid #f5f5f5;
+    .del-btn {
+      color: #ff5b5b;
+      cursor: pointer;
+      position: absolute;
+      right: 20px;
+      top: 20px;
+      z-index: 1;
+      &.disable {
+        color: #b8b8b8;
+      }
+    }
+  }
+  .el-input__icon {
+    line-height: 32px;
+  }
+  .select-item {
+    & > div {
+      float: left;
+      margin-right: 10px;
+    }
+    .el-input {
+      width: auto;
+    }
+    input {
+      width: 95px;
+      line-height: 32px;
+      height: 32px;
     }
+  }
+  .el-input,
+  .el-input__inner {
+    width: 190px;
+    line-height: 32px;
+    height: 32px;
+  }
+  .el-button--danger.is-plain {
+    background: none;
+  }
+  .itemList {
+    position: absolute;
+    // display: none;
+    background: #fff;
+    width: 188px;
+    max-height: 160px;
+    border: 1px solid #dcdfe6;
+    left: 0;
+    top: 37px;
+    z-index: 2;
+    overflow-y: auto;
+  }
+  .el-form-item {
+    margin-bottom: 6px;
+    &.min-margin {
+      margin-bottom: 0;
+      position: relative;
+      .el-form-item__content {
+        position: unset;
+      }
+      .el-form-item__error {
+        top: 10px;
+        left: 460px;
+        white-space: normal;
+        width: 260px;
+      }
+    }
+    .el-textarea + .el-form-item__error {
+      top: 80px;
+      left: 0;
+    }
+    .tip-text + .el-form-item__error {
+      top: 40px;
+      left: 0;
+    }
+  }
+
+  .el-input-number {
+    width: 95px;
+  }
+  .el-input-number.is-controls-right .el-input-number__decrease,
+  .el-input-number.is-controls-right .el-input-number__increase {
+    width: 25px;
+    height: 15px;
+    line-height: 16px;
+  }
+  .el-col-3 {
+    width: 94px;
+  }
+}
 </style>

+ 149 - 140
src/components/knowledgeExtra/DiagBaseType.vue

@@ -1,148 +1,157 @@
 <template>
-    <!--<el-form ref="form" class="add-new-form" label-width="130px" :model="data">-->
-   <div class="add-new-form">
-        <el-form-item label="诊断依据类型:" :prop="'klDiagnoseTypeVO.'+inx+'.conditionType'" class="diag-type">
-            <el-select v-model="data.conditionType"
-                       placeholder="请选择"
-                       size="small">
-                <el-option
-                        v-for="item in typeList"
-                        :key="item.ruleType"
-                        :label="item.name"
-                        :value="item.ruleType">
-                </el-option>
-            </el-select>
-            <span class="tip-text">注:选择诊断依据类型后才能展示基础依据类型~</span>
-        </el-form-item>
-        <DiagBaseGroup v-for="(group,i) in data.groupVO"
-                   ref="groups"
-                   :data="group"
-                   :diagTypeList="baseTypeList"
-                   :inx="i"
-                   :parInx="inx"
-                   :isLast="isLast&&data.groupVO.length===1"
-                   @setRules="setRules"
-                   @addGroup="addGroup"
-                   @delGroup="delGroup"></DiagBaseGroup>
+  <!--<el-form ref="form" class="add-new-form" label-width="130px" :model="data">-->
+  <div class="add-new-form">
+    <el-form-item
+      label="诊断依据类型:"
+      :prop="'klDiagnoseTypeVO.'+inx+'.conditionType'"
+      class="diag-type"
+    >
+      <el-select v-model="data.conditionType" placeholder="请选择" size="small">
+        <el-option
+          v-for="item in typeList"
+          :key="item.ruleType"
+          :label="item.name"
+          :value="item.ruleType"
+        ></el-option>
+      </el-select>
+      <span class="tip-text">注:选择诊断依据类型后才能展示基础依据类型~</span>
+    </el-form-item>
+    <DiagBaseGroup
+      v-for="(group,i) in data.groupVO"
+      ref="groups"
+      :data="group"
+      :diagTypeList="baseTypeList"
+      :inx="i"
+      :parInx="inx"
+      :isLast="isLast&&data.groupVO.length===1"
+      @setRules="setRules"
+      @addGroup="addGroup"
+      @delGroup="delGroup"
+    ></DiagBaseGroup>
     <div class="group-oper">
-        <el-button size="small" @click="addDiag">+新增依据</el-button>
-        <el-button size="small" class="copy-btn" @click="copyDiag"><img src="../../images/copy.png" alt="">复制依据</el-button>
-        <el-button :disabled="isLast" size="small" type="danger" plain @click="delDiag">-删除依据</el-button>
+      <el-button size="small" @click="addDiag">+新增依据</el-button>
+      <el-button size="small" class="copy-btn" @click="copyDiag">
+        <img src="../../images/copy.png" alt />复制依据
+      </el-button>
+      <el-button :disabled="isLast" size="small" type="danger" plain @click="delDiag">-删除依据</el-button>
     </div>
-          </div>
-       <!-- </el-form>-->
-      </template>
+  </div>
+  <!-- </el-form>-->
+</template>
       <script>
-          import DiagBaseGroup from './DiagBaseGroup';
-          import util from '../../api/utils.js'
-          export default {
-              name:'DiagBaseType',
-              props:['data','isLast','inx'],
-              data(){
-                  return {
-                      form:{},
-                      conditionType:'',
-                      typeObj:{},
-                      typeList:[],
-                      /*rules:{
+import DiagBaseGroup from './DiagBaseGroup';
+import util from '../../api/utils.js';
+export default {
+  name: 'DiagBaseType',
+  props: ['data', 'isLast', 'inx'],
+  data() {
+    return {
+      form: {},
+      conditionType: '',
+      typeObj: {},
+      typeList: []
+      /*rules:{
                           conditionType:[]
                       }*/
-                  }
-              },
-              computed:{
-                baseTypeList:function(){
-                    return this.typeObj[this.data.conditionType];
-                }
-              },
-              created(){
-                  this.getTypeList();
-              },
-              methods:{
-                  setRules(){
-                      this.$emit('setRules');
-                  },
-                  getTypeList(){
-                      const typeListData = JSON.parse(localStorage.getItem("zskDiagList"));
-                      this.typeObj=util.formatObj(typeListData,'ruleType');
-                      this.typeList = typeListData;
-                  },
-                  addDiag(){
-                      this.$emit("addDiag",this.inx);
-                  },
-                  delDiag(){
-                      this.$emit("delDiag",this.inx);
-                  },
-                  copyDiag(){
-                      this.$emit("copyDiag",this.inx);
-                  },
-                  addGroup(i){
-                      const temp={
-                          "baseGroup": '',
-                          "conditionGroup": '',
-                          "fitNo": '',
-                          "klDiagnoseDetail": [{
-                              "basConceptId": '',
-                              "basDescription": "",
-                              "basLename": "",
-                              "basLibName": "",
-                              "basLibType": null,
-                              "basType": '',
-                              "eqOperator": "",
-                              "eqUnit": "",
-                              "eqValue": "",
-                              "maxOperator": "",
-                              "maxUnit": "",
-                              "maxVal": "",
-                              "minOperator": "",
-                              "minUnit": "",
-                              "minVal": ""
-                          }]
-                      };
-                      this.data.groupVO.splice(i+1,0,temp);
-                      this.$emit('setRules');
-                  },
-                  delGroup(i){
-                      if(i===0&&this.data.groupVO.length===1){
-                          this.$emit("delDiag",this.inx);
-                          return;
-                      }
-                      this.data.groupVO.splice(i,1);
-                  }
-              },
-              components:{
-                  DiagBaseGroup
-              }
+    };
+  },
+  computed: {
+    baseTypeList: function() {
+      return this.typeObj[this.data.conditionType];
+    }
+  },
+  created() {
+    console.log(this.data)
+    this.getTypeList();
+  },
+  methods: {
+    setRules() {
+      this.$emit('setRules');
+    },
+    getTypeList() {
+      const typeListData = JSON.parse(localStorage.getItem('zskDiagList'));
+      this.typeObj = util.formatObj(typeListData, 'ruleType');
+      this.typeList = typeListData;
+    },
+    addDiag() {
+      this.$emit('addDiag', this.inx);
+    },
+    delDiag() {
+      this.$emit('delDiag', this.inx);
+    },
+    copyDiag() {
+      this.$emit('copyDiag', this.inx);
+    },
+    addGroup(i) {
+      const temp = {
+        baseGroup: '',
+        conditionGroup: '',
+        fitNo: '',
+        klDiagnoseDetail: [
+          {
+            basConceptId: '',
+            basDescription: '',
+            basLename: '',
+            basLibName: '',
+            basLibType: null,
+            basType: '',
+            eqOperator: '',
+            eqUnit: '',
+            eqValue: '',
+            maxOperator: '',
+            maxUnit: '',
+            maxVal: '',
+            minOperator: '',
+            minUnit: '',
+            minVal: ''
           }
-      </script>
+        ]
+      };
+      this.data.groupVO.splice(i + 1, 0, temp);
+      this.$emit('setRules');
+    },
+    delGroup(i) {
+      if (i === 0 && this.data.groupVO.length === 1) {
+        this.$emit('delDiag', this.inx);
+        return;
+      }
+      this.data.groupVO.splice(i, 1);
+    }
+  },
+  components: {
+    DiagBaseGroup
+  }
+};
+</script>
       <style lang="less" scoped>
-          .add-new-form{
-              background: #E3EAF4;
-              padding: 20px 0;
-          }
-          /deep/ .diag-type .el-form-item__error{
-              top: 35px!important;
-              left: 0!important;
-              background: none!important;
-          }
-          .diag-type{
-              background: #fff;
-              margin: 0 20px;
-              padding: 8px 0 15px;
-          }
-          .group-oper{
-              margin: 20px 20px 0 20px;
-              background: #fff;
-              padding: 8px 0 8px 205px;;
-              /*text-align: center;*/
-              .el-button{
-                  margin-right: 60px;
-              }
-              .copy-btn{
-                  border-color:#666;
-                  color: #666;
-                  img{
-                      margin-right: 5px;
-                  }
-              }
-          }
-      </style>
+.add-new-form {
+  background: #e3eaf4;
+  padding: 20px 0;
+}
+/deep/ .diag-type .el-form-item__error {
+  top: 35px !important;
+  left: 0 !important;
+  background: none !important;
+}
+.diag-type {
+  background: #fff;
+  margin: 0 20px;
+  padding: 8px 0 15px;
+}
+.group-oper {
+  margin: 20px 20px 0 20px;
+  background: #fff;
+  padding: 8px 0 8px 205px;
+  /*text-align: center;*/
+  .el-button {
+    margin-right: 60px;
+  }
+  .copy-btn {
+    border-color: #666;
+    color: #666;
+    img {
+      margin-right: 5px;
+    }
+  }
+}
+</style>

+ 305 - 0
src/components/knowledgeExtra/RegisteredDrug.vue

@@ -0,0 +1,305 @@
+<template>
+  <div>
+    <crumbs title="注册药品维护" :minWidth="titleWidth" class="knowledgeTitle">
+      <el-form :inline="true" class="demo-form-inline">
+        <el-form-item label="通用名:">
+          <el-input size="mini" v-model="filter.commonName" placeholder="输入通用名" clearable></el-input>
+        </el-form-item>
+        <el-form-item label="注册/商品名称:">
+          <el-input size="mini" v-model="filter.name" placeholder="输入注册/商品名称" clearable></el-input>
+        </el-form-item>
+        <el-form-item label="企业:">
+          <el-input size="mini" v-model="filter.company" placeholder="输入企业名称" clearable></el-input>
+        </el-form-item>
+        <el-form-item>
+          <el-button size="mini" @click="filterDatas">确认</el-button>
+        </el-form-item>
+        <el-form class="secLine">
+          <el-form-item>
+            <el-button size="mini" @click="addRule" type="warning" style="margin:0 10px">+ 新增药品</el-button>
+          </el-form-item>
+        </el-form>
+      </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="drugCode" label="药品代码" show-overflow-tooltip></el-table-column>
+        <el-table-column prop="name" label="注册名称" show-overflow-tooltip></el-table-column>
+        <el-table-column prop="drugName" label="通用名" width="110" show-overflow-tooltip></el-table-column>
+        <el-table-column prop="enName" label="英文名称" show-overflow-tooltip></el-table-column>
+        <el-table-column prop="tradeName" label="商品名称" show-overflow-tooltip></el-table-column>
+        <el-table-column prop="form" label="药品剂型" show-overflow-tooltip></el-table-column>
+        <el-table-column prop="specification" label="注册规格" width="70" show-overflow-tooltip></el-table-column>
+        <el-table-column prop="minPackQuantity" label="最小包装数量" width="80" show-overflow-tooltip></el-table-column>
+        <el-table-column prop="minPackUnit" label="最小包装单位" width="80" show-overflow-tooltip></el-table-column>
+        <el-table-column prop="company" label="企业" show-overflow-tooltip></el-table-column>
+        <el-table-column prop="approval" label="批准文号" show-overflow-tooltip></el-table-column>
+        <el-table-column prop="standardCode" label="药品本位码" width="100" show-overflow-tooltip></el-table-column>
+        <el-table-column prop="insuranceType" label="医保类型" show-overflow-tooltip></el-table-column>
+        <el-table-column prop="insuranceRemrk" label="医保备注" show-overflow-tooltip></el-table-column>
+        <el-table-column prop="modifier" label="操作人" show-overflow-tooltip></el-table-column>
+        <el-table-column prop="gmtModified" label="操作时间" width="180"></el-table-column>
+        <el-table-column label="操作" width="120" fixed="right">
+          <template slot-scope="scope">
+            <el-button type="text" size="small" @click="editData(scope.row)">修改</el-button>
+            <span style="margin:0 3px;">|</span>
+            <el-button type="text" size="small" class="delete" @click="showDelDialog(scope.row)">删除</el-button>
+          </template>
+        </el-table-column>
+      </el-table>
+      <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>
+</template>
+
+<script>
+import api from '@api/icss.js';
+import config from '@api/config.js';
+import utils from '@api/utils.js';
+
+export default {
+  name: 'ZskRegisteredDrug',
+  data: function() {
+    return {
+      list: [],
+      stateSelect: [
+        { id: 1, name: '启用' },
+        { id: 0, name: '禁用' }
+      ],
+      ruleTypeList: [],
+      searched: false,
+      filter: {
+        commonName: '',
+        name: '',
+        company: ''
+      },
+      cacheData: {},
+      currentPage: 1,
+      pageSize: config.pageSize,
+      pageSizeArr: config.pageSizeArr,
+      pageLayout: config.pageLayout,
+      total: 0,
+      titleWidth: '1070px' //头部最小宽度
+    };
+  },
+  created() {
+    this.getDataList();
+  },
+  watch: {
+    filter: {
+      handler: function() {
+        this.searched = false;
+      },
+      deep: true
+    }
+  },
+  methods: {
+    handleSizeChange(val) {
+      this.pageSize = val;
+      this.currentPage = utils.getCurrentPage(
+        this.currentPage,
+        this.total,
+        this.pageSize
+      );
+      this.getDataList();
+    },
+    addRule() {
+      const pam = this.searched
+        ? {
+            currentPage: this.currentPage,
+            pageSize: this.pageSize,
+            filter: this.filter
+          }
+        : { currentPage: this.currentPage, pageSize: this.pageSize };
+      this.$router.push({ name: 'AddZskRegisteredDrug', params: pam });
+    },
+    filterDatas() {
+      this.currentPage = 1;
+      this.getDataList(1);
+    },
+    getDataList(flag, 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
+        .getPageList(params)
+        .then(res => {
+          loading.close();
+          if (res.data.code == '0') {
+            const data = res.data.data;
+            for (let j = 0; j < data.records.length; j++) {
+              data.records[j].condition =
+                data.records[j].parStatus == '1' ? '启用' : '禁用';
+            }
+            this.list = data.records;
+            if (!flag) {
+              //搜索时不缓存
+              this.cacheData[params.current] = data.records;
+            } else {
+              this.cacheData = {};
+            }
+            this.total = data.total;
+            if (this.inCurrentPage !== undefined) {
+              this.currentPage = this.inCurrentPage;
+              this.inCurrentPage = undefined;
+            }
+          } else {
+            this.warning(res.data.msg || '获取列表数据失败');
+          }
+        })
+        .catch(error => {
+          loading.close();
+          console.log(error);
+        });
+    },
+    getFilterItems(isTurnPage) {
+      //翻页时筛选条件没点确定则清空
+      if (isTurnPage && !this.searched) {
+        this.clearFilter();
+      }
+      const param = {
+        current: this.inCurrentPage || this.currentPage,
+        size: this.pageSize,
+        commonName: this.filter.commonName,
+        name: this.filter.name,
+        company: this.filter.company
+      };
+      return param;
+    },
+    indexMethod(index) {
+      return (this.currentPage - 1) * this.pageSize + index + 1;
+    },
+    currentChange(next) {
+      this.currentPage = next;
+      this.getDataList(1, true);
+    },
+    warning(msg, type) {
+      this.$message({
+        showClose: true,
+        message: msg,
+        type: type || 'warning'
+      });
+    },
+    showConfirmDialog(msg, resolve) {
+      this.$alert(msg, '提示', {
+        confirmButtonText: '确定',
+        type: 'warning'
+      })
+        .then(() => {
+          resolve();
+        })
+        .catch(() => {});
+    },
+    editData(row) {
+      const pam = this.searched
+        ? {
+            currentPage: this.currentPage,
+            pageSize: this.pageSize,
+            filter: this.filter
+          }
+        : { currentPage: this.currentPage, pageSize: this.pageSize };
+      this.$router.push({
+        name: 'AddZskRegisteredDrug',
+        params: {
+          id: row.id,
+          type: 2
+        }
+      });
+    },
+    showDelDialog(row) {
+      const params = {
+        id: row.id
+      };
+      const warningTxt = '是否删除该注册药品?可能对现有系统造成影响';
+      this.showConfirmDialog(warningTxt, () => {
+        api.paramDelete(params)
+          .then(res => {
+            if (res.data.code == '0') {
+              if (!this.searched) {
+                //未点确认时清空搜索条件
+                this.clearFilter();
+              }
+              this.currentPage = 1;
+              this.warning(res.data.msg || '操作成功', 'success');
+              this.getDataList();
+            } else {
+              this.warning(res.data.msg);
+            }
+          })
+          .catch(error => {
+            this.warning(error);
+          });
+      });
+    },
+    clearFilter() {
+      this.filter = {
+        commonName: '',
+        name: '',
+        company: ''
+      };
+    },
+  }
+};
+</script>
+
+<style lang="less" scoped>
+@import '../../less/admin.less';
+/deep/ .container.knowledgeTitle {
+  height: 40px;
+  min-width: 970px !important;
+}
+/deep/.demo-form-inline .el-input--mini .el-input__inner {
+    width: 115px;
+}
+.demo-form-inline {
+  margin: 0 20px 0 0;
+}
+/deep/ .contents.knowledgeContents {
+  padding: 64px 20px 0;
+}
+/deep/ .secLine.el-form {
+  float: right;
+  display: block;
+  position: relative;
+  top: -1px;
+}
+/deep/ .cell{
+  line-height: 20px;
+}
+.delete {
+  color: red;
+}
+.review {
+  color: #22ccc8;
+}
+.el-table .cell {
+  overflow: hidden;
+  white-space: nowrap;
+}
+#upFile {
+  display: none !important;
+}
+.unvailable {
+  color: #fe7d3d;
+  &:hover,
+  &:active,
+  &:focus {
+    color: #f19061;
+  }
+}
+</style>

+ 2 - 2
src/components/knowledgeExtra/RuleManager.vue

@@ -89,7 +89,7 @@
                         label="有无子条件"
                         width="100">
                     <template slot-scope="scope">
-                        {{scope.row.parHasSub === '0'?'无':'有'}}
+                        {{scope.row.parHasSub == '0'?'无':'有'}}
                     </template>
                 </el-table-column>
                 <el-table-column
@@ -171,7 +171,7 @@
                 pageSizeArr:config.pageSizeArr,
                 pageLayout:config.pageLayout,
                 total: 0,
-                titleWidth:'1070px' //头部最小宽度
+                titleWidth:'970px' //头部最小宽度
             }
         },
         created() {

+ 0 - 449
src/components/knowledgeExtra/SubConditions.vue

@@ -1,449 +0,0 @@
-<template>
-    <div class="groups-cont">
-        <el-form ref="groupData" label-width="150px" class="sub-condition-form" :model="groupData" :rules="rules">
-            <span v-if="!disabled&&!isLast" class="del-btn"  @click="delRule">删除</span><!--:class="isLast?'disable del-btn':'del-btn'"-->
-            <el-form-item label="基础规则名称:" prop="subDescription">
-                <el-input v-model.trim = "groupData.subDescription" :disabled="disabled"></el-input>
-            </el-form-item>
-            <el-form-item label="基础规则类型:" prop="subType">
-                <el-select v-model="groupData.subType"
-                           :disabled="disabled"
-                           placeholder="请选择"
-                           size="small"
-                           @change="subTypeChange">
-                    <el-option
-                            v-for="item in baseTypes"
-                            :key="item.id"
-                            :label="item.name"
-                            :value="item.type">
-                    </el-option>
-                </el-select>
-            </el-form-item>
-            <el-form-item label="基础规则术语类型:" prop="subLenCode">
-                <el-select v-model="groupData.subLenCode"
-                           :disabled="disabled"
-                           placeholder="请选择"
-                           size="small" @change="subCodeChange">
-                    <el-option
-                            v-for="item in baseTermTypeList"
-                            :key="item.id"
-                            :label="item.name"
-                            :value="item.code">
-                    </el-option>
-                </el-select>
-            </el-form-item>
-            <el-form-item  class="addDepartFormItem" label="医学标准术语:" prop="subConceptId">
-                <el-select clearable remote filterable :disabled="disabled" :remote-method="searchConcept" v-model.trim="groupData.subConceptId">
-                    <el-option
-                            v-for="item in conceptList"
-                            :key="item.conceptId"
-                            :label="item.conceptName"
-                            :value="item.conceptId">
-                    </el-option>
-                </el-select>
-            </el-form-item>
-            <el-form-item v-if="groupData.subType===2&&showDataType" label="选择类型:" prop="dataType">
-                <el-select v-model="groupData.dataType"
-                           placeholder="请选择"
-                           size="small" @change="dataTypeChange">
-                    <el-option
-                            v-for="item in dataTypes"
-                            :key="item.id"
-                            :label="item.name"
-                            :value="item.id">
-                    </el-option>
-                </el-select>
-            </el-form-item>
-            <el-form-item class="min-margin" v-if="groupData.dataType==='1'" label="最大值:">
-                <div class="select-item clearfix">
-                    <el-col :span="3">
-                        <el-form-item prop="subMaxOperator">
-                            <el-select v-model="groupData.subMaxOperator"
-                                       placeholder="请选择"
-                                       size="small" clearable>
-                                <el-option
-                                        v-for="item in operMaxList"
-                                        :key="item.key"
-                                        :label="item.name"
-                                        :value="item.key">
-                                </el-option>
-                            </el-select>
-                        </el-form-item>
-                    </el-col>
-                    <el-col :span="3">
-                        <el-form-item prop="subMaxValue">
-                            <el-input type="text" v-model="groupData.subMaxValue" placeholder="填写数值"/>
-                        </el-form-item>
-                    </el-col>
-                    <el-col :span="3">
-                        <el-form-item prop="subMaxUnit">
-                            <el-input  type="text" v-model.trim="groupData.subMaxUnit" placeholder="填写单位"/>
-                        </el-form-item>
-                    </el-col>
-                </div>
-            </el-form-item>
-            <el-form-item class="min-margin" v-if="groupData.dataType==='1'" label="最小值:">
-                <div class="select-item clearfix">
-                    <el-col :span="3">
-                        <el-form-item prop="subMinOperator">
-                            <el-select v-model="groupData.subMinOperator"
-                                       placeholder="请选择"
-                                       size="small" clearable>
-                                <el-option
-                                        v-for="item in operMinList"
-                                        :key="item.name"
-                                        :label="item.name"
-                                        :value="item.name">
-                                </el-option>
-                            </el-select>
-                        </el-form-item>
-                    </el-col>
-                    <el-col :span="3">
-                        <el-form-item prop="subMinValue">
-                            <el-input type="text" v-model="groupData.subMinValue" placeholder="填写数值"/>
-                        </el-form-item>
-                    </el-col>
-                    <el-col :span="3">
-                        <el-form-item prop="subMinUnit">
-                            <el-input  type="text" v-model.trim="groupData.subMinUnit" placeholder="填写单位"/>
-                        </el-form-item>
-                    </el-col>
-                </div>
-            </el-form-item>
-            <el-form-item v-if="groupData.subType!==6&&groupData.dataType==='2'" label="医学内容:" prop="subEqValue" class="discDesc is-required">
-                <el-input type="textarea" rows="3" placeholder="请输入医学内容" v-model.trim="groupData.subEqValue"></el-input>
-            </el-form-item>
-            <el-form-item v-if="groupData.subType===6" label="正则表达式:" prop="subEqValue" class="discDesc is-required">
-                <el-input type="textarea" rows="3" placeholder="请输入正则表达式" v-model.trim="groupData.subEqValue"></el-input>
-            </el-form-item>
-        </el-form>
-        <div class="inner-oper" v-if="showAdd">
-            <span>新增规则:</span>
-            <span class="add-btn" @click="addRule"><img src="../../images/add.png" alt="新增规则"></span>
-        </div>
-    </div>
-</template>
-<script>
-    import api from '@api/knowledgeLib.js';
-    export default {
-        name:'subCondititons',
-        props:['groupData','ind','isLast','baseTypes','firstPlace','disabled','showAdd'],
-        data(){
-            return {
-                //baseTermTypeList:[],
-                typeList:[],
-                numTypes:'',    //只有数值类型的类型id
-                operMaxList:[
-                    {name:'<=',key:'<='},
-                    {name:'<',key:'<'},
-                ],
-                operMinList:[{name:'>',key:'>'},
-                    {name:'>=',key:'>='},
-                ],
-                dataTypes:[{id:'1',name:'数值类型'},{id:'2',name:'文本类型'}],
-                conceptList:[],
-                rules:{
-                    subDescription:[{ required: true, message: '请输入基础规则名称',trigger: ['blur'] },{
-                        validator: (rule,value,callback)=>{
-                            if(value&&value.length>100){
-                                callback(new Error('规则名称不能超过100字'));
-                            }else{
-                                callback();
-                            }}, trigger: 'change'
-                    }],
-                    subType:[{ required: true, message: '请选择基础规则类型',trigger: ['change'] }],
-                    subLenCode:[{ required: true, message: '请选择基础规则术语类型',trigger: ['change'] }],
-                    subConceptId:[{ required: true, message: '请输入医学标准术语',trigger: ['blur'] }],
-                    dataType:[{ required: true, message: '请选择类型',trigger: ['change'] }],
-                    subMaxOperator:[{
-                        validator: (rule,value,callback)=>{
-                            const {subMaxValue,subMinOperator,subMinValue}=this.groupData;
-                            const val=value+subMinOperator+subMinValue+subMaxValue;
-                            if(!val||(!value&&subMaxValue!=='')){
-                                callback(new Error('最大值和最小值至少完整填写一个,单位不必填'));
-                            }else{
-                                callback();
-                            }}, trigger: 'blur'
-                    }],
-                    subMinOperator:[{
-                        validator: (rule,value,callback)=>{
-                            const {subMaxValue,subMaxOperator,subMinValue}=this.groupData;
-                            const val=value+subMaxOperator+subMinValue+subMaxValue;
-                            if(!val||(!value&&subMinValue!=='')){
-                                callback(new Error('最大值和最小值至少完整填写一个,单位不必填'));
-                            }else{
-                                callback();
-                            }}, trigger: 'blur'
-                    }],
-                    subMaxValue:[{
-                        validator: (rule,value,callback)=>{
-                            const {subMaxOperator,subMinOperator,subMinValue}=this.groupData;
-                            const val=value+subMaxOperator+subMinValue+subMinOperator;
-                            const isNum=/^(\-|\+)?\d+(\.\d+)?$/.test(value);
-                            if(!val||(value==''&&subMaxOperator)){
-                                callback(new Error('最大值和最小值至少完整填写一个,单位不必填'));
-                            }else if(value!==''&&!isNum){
-                                callback(new Error('只能输入数字'));
-                            }else{
-                                callback();
-                            }}, trigger: 'blur'
-                    }],
-                    subMinValue:[{
-                        validator: (rule,value,callback)=>{
-                            const {subMaxValue,subMinOperator,subMaxOperator}=this.groupData;
-                            const val=value+subMaxOperator+subMaxValue+subMinOperator;
-                            const isNum=/^(\-|\+)?\d+(\.\d+)?$/.test(value);
-                            if(!val||(value==''&&subMinOperator)){
-                                callback(new Error('最大值和最小值至少完整填写一个,单位不必填'));
-                            }else if(value!==''&&!isNum){
-                                callback(new Error('只能输入数字'));
-                            }else{
-                                callback();
-                            }}, trigger: 'blur'
-                    }],
-                    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'
-                    }],
-                },
-            }
-        },
-        watch:{
-            'groupData':{
-                handler:function(val){
-                    this.$emit("changeVal",val,this.ind);
-                },
-                deep:true
-            },
-            /*'baseTypes':{
-                handler:function(val){
-                    if(!this.groupData.subType){
-                        this.baseTermTypeList =[];
-                        return;
-                    }
-                    const obj = val.find((it)=>it.type===this.groupData.subType);
-                    this.baseTermTypeList = obj.subMenuList;
-                },
-                deep:true
-            },*/
-            'firstPlace':{
-                handler:function(val) {
-                    if (this.ind!==0||!val) return;
-                    const dict = localStorage.getItem("zskDicts").match(new RegExp(val.checkedType+'-\\d+','g'))||[];
-                    const types = dict[0].split("-");
-                    this.groupData.subType = +types[2];
-                    this.groupData.subLenCode = types[1];
-                    this.conceptList = [val];
-                    this.groupData.subDescription = val.conceptName;
-                    this.groupData.subConceptId = val.conceptId;
-                    this.groupData.subConceptName = val.conceptName;
-                },
-                deep:true
-            }
-        },
-        created(){
-            this.numTypes = localStorage.getItem("zskNumDict");
-            this.conceptList=[{conceptName:this.groupData.subLibName||this.groupData.subConceptName,conceptId:this.groupData.subConceptId}];
-        },
-        computed:{
-            baseTermTypeList:function(){
-                if(!this.baseTypes.length){
-                    return [];
-                }
-                const sub = this.baseTypes.find((it) => it.type === this.groupData.subType)||{};
-                return sub.subMenuList;
-            },
-            showDataType:function(){
-               return (this.numTypes+',').indexOf(this.groupData.subLenCode+',')===-1;
-            },
-            textName:function(){
-                return this.groupData.subType!==6&&this.groupData.dataType==='2'?'医学内容':'正则表达式';
-            }
-        },
-        methods:{
-            dataTypeChange(val){
-                this.groupData.subEqOperator=(val==='2'?'=':'');
-                this.clearNumText();
-                delete this.groupData.dataType;     //触发更新
-                this.$set(this.groupData,'dataType',val);
-            },
-            subTypeChange(val){        //基础规则类型修改
-                this.groupData.subLenCode='';
-                this.groupData.dataType='';
-                this.clearConcept();
-                this.clearNumText();
-            },
-            subCodeChange(val){        //基础规则术语类型修改
-                this.groupData.subLenCode=val;
-                if((this.numTypes+',').indexOf(val+',')>-1){
-                    this.groupData.dataType='1';
-                }else{
-                    this.groupData.dataType='';
-                }
-                this.clearConcept();
-                this.clearNumText();
-            },
-            clearConcept(){
-              this.groupData.subConceptId='';
-              this.conceptList=[];
-            },
-            clearNumText(){
-                this.groupData.subMaxOperator='';
-                this.groupData.subMaxValue='';
-                this.groupData.subMaxUnit='';
-                this.groupData.subMinOperator='';
-                this.groupData.subMinValue='';
-                this.groupData.subMinUnit='';
-                this.groupData.subEqValue='';
-                this.groupData.subEqOperator='';
-            },
-            searchConcept(val){
-                const param = {
-                    excludedConceptIds:[this.groupData.subType],
-                    libType:this.groupData.subLenCode,
-                    name:val,
-                };
-                api.searchConcept(param).then((res) => {
-                    if (res.data.code == '0') {
-                        const data = res.data.data;
-                        this.conceptList = data;
-                    }
-                }).catch((error) => {
-                    console.log(error);
-                });
-            },
-            addRule(){
-                this.$emit("addRule");
-            },
-            delRule(){
-                if(this.isLast){
-                    this.warning("初始状态规则不能删除~");
-                    return;
-                }
-                //this.showConfirmDialog("是否删除该条规则,可能对现有系统会造成影响",()=>{
-                    this.$emit("delRule",this.ind);
-                //});
-
-            },
-            warning(msg,type){
-                this.$message({
-                    showClose: true,
-                    message:msg,
-                    type:type||'warning'
-                })
-            },
-            showConfirmDialog(msg,resolve){
-                this.$alert(msg, '提示', {
-                    confirmButtonText: '确定',
-                    type: 'warning'
-                }).then(() => {
-                    resolve();
-                }).catch(() => {});
-            },
-        }
-    }
-</script>
-<style lang="less">
-    .groups-cont{
-        background: #fff;
-        .conceptItem{
-            padding: 0 10px;
-            cursor: pointer;
-            height: 32px;
-            line-height: 32px;
-            &:hover{
-                background: #ebedf1;
-            }
-        }
-        .inner-oper{
-            padding: 15px 0 15px 21px;
-            .add-btn {
-                cursor: pointer;
-                img {
-                    vertical-align: middle;
-                }
-            }
-        }
-        .sub-condition-form{
-            padding: 20px;
-            position: relative;
-            border-bottom:2px solid #F5F5F5;
-            .del-btn{
-                color: #FF5B5B;
-                cursor: pointer;
-                position: absolute;
-                right: 20px;
-                top:20px;
-                z-index: 1;
-                &.disable{
-                    color: #B8B8B8;
-                }
-            }
-        }
-        .el-input__icon{
-            line-height: 32px;
-        }
-        .select-item{
-            &>div{
-                float: left;
-                margin-right: 10px;
-            }
-            .el-input{
-                width: auto;
-            }
-            input{
-                width: 95px;
-                line-height: 32px;
-                height: 32px;
-            }
-        }
-        .el-input,.el-input__inner{
-            width: 190px;
-            line-height: 32px;
-            height: 32px;
-        }
-        .el-button--danger.is-plain{
-            background: none;
-        }
-        .itemList {
-            position: absolute;
-            // display: none;
-            background: #fff;
-            width: 188px;
-            max-height: 160px;
-            border: 1px solid #DCDFE6;
-            left: 0;
-            top: 37px;
-            z-index: 2;
-            overflow-y: auto;
-        }
-        .el-form-item{
-            margin-bottom: 22px;
-            &.min-margin{
-                margin-bottom: 0;
-            }
-        }
-        .el-form-item__error{
-            top: auto;
-            white-space: nowrap;
-            background: #fff;
-        }
-        .el-input-number{
-            width: 95px;
-        }
-        .el-input-number.is-controls-right .el-input-number__decrease, .el-input-number.is-controls-right .el-input-number__increase{
-            width: 25px;
-            height: 15px;
-            line-height: 16px;
-        }
-        .el-col-3 {
-            width: 94px;
-        }
-    }
-</style>

+ 0 - 117
src/components/knowledgeExtra/SubRulesGroup.vue

@@ -1,117 +0,0 @@
-<template>
-    <div class="sub-groups" v-if="data">
-        <SubConditions v-for="(rules,i) in data"
-                       ref="group"
-                       :groupData="rules"
-                       :isLast="data.length===1"
-                       :ind="i"
-                       :showAdd="data.length<maxNum"
-                       :baseTypes="baseTypes"
-                       :firstPlace="firstPlace"
-                       :disabled="i===0&&disable"
-                       @changeVal="handleInput"
-                       @addRule="addRule"
-                       @delRule="delRule"></SubConditions>
-        <div class="group-oper">
-            <el-button size="small" @click="addGroup">+新增分组</el-button>
-            <el-button :disabled="isLast" size="small" type="danger" plain @click="delGroup">-删除分组</el-button>
-        </div>
-    </div>
-</template>
-<script>
-    import SubConditions from './SubConditions.vue';
-    export default {
-        name:'SubRulesGroup',
-        props:['data','inx','isLast','baseTypes','maxNum','firstPlace'],
-        data(){
-            return {
-            }
-        },
-        computed:{
-          'disable':function(){
-              return Object.keys(this.firstPlace||{}).length>0;
-          }
-        },
-        methods:{
-            handleInput(val,i){
-                this.data[i]=val;
-            },
-            addRule(){
-                let temp={
-                    subDescription:'',
-                    subConceptId:'',
-                    subType:'',
-                    subLenName:'',
-                    subLenCode:'',
-                    subLibName:'',
-                    subMaxOperator:'',
-                    subMaxUnit:'',
-                    subMaxValue:'',
-                    subMinOperator:'',
-                    subMinUnit:'',
-                    subMinValue:'',
-                    subEqValue:'',
-                    dataType:'',
-                };
-                this.data.push(temp);
-            },
-            delRule(i){
-                if(i===0&&this.data.length===1){
-                    this.$emit("delGroup",this.inx);
-                    return;
-                }
-                this.data.splice(i,1);
-            },
-            addGroup(){
-                this.$emit("addGroup");
-            },
-            delGroup(){
-               this.$emit("delGroup",this.inx);
-            },
-            warning(msg,type){
-                this.$message({
-                    showClose: true,
-                    message:msg,
-                    type:type||'warning'
-                })
-            },
-            showConfirmDialog(msg,resolve){
-                this.$alert(msg, '提示', {
-                    confirmButtonText: '确定',
-                    type: 'warning'
-                }).then(() => {
-                    resolve();
-                }).catch(() => {
-                    this.warning("删除失败,请重试!")
-                });
-            },
-        },
-        components:{
-            SubConditions
-        }
-    }
-</script>
-<style lang="less" scoped>
-    .sub-groups{
-        background: #F5F5F5;
-        padding: 20px;
-    }
-    .group-oper{
-        text-align: center;
-        padding: 11px 0;
-        border-top: 4px solid #F5F5F5;
-        background: #fff;
-    }
-    .el-button--danger.is-plain:focus, .el-button--danger.is-plain:hover{
-        color: #fbc4c4;
-        border-color:#fbc4c4;
-    }
-    .el-button--danger.is-plain{
-        background: none;
-        &.is-disabled{
-            color: #f9a7a7;
-            background-color: #fef0f0;
-            border-color: #fde2e2;
-        }
-    }
-</style>

+ 635 - 0
src/components/knowledgeExtra/_AddNewRule.vue

@@ -0,0 +1,635 @@
+<template>
+  <div>
+    <crumbs
+      :title="title"
+      :param="$route.params"
+      linkTo="ZskRuleManager"
+    ></crumbs>
+    <div class="contents">
+      <div class="content2">
+        <el-form
+          ref="form"
+          :label-position="labelPosition"
+          class="add-new-form"
+          label-width="130px"
+          :model="form"
+          :rules="rules"
+        >
+          <div class="table_header">
+            <el-form-item label="规则名称:" prop="parDescription">
+              <el-input v-model.trim="form.parDescription"></el-input>
+            </el-form-item>
+            <el-form-item label="规则类型:" prop="parRuleType">
+              <el-select
+                v-model="form.parRuleType"
+                placeholder="请选择"
+                size="small"
+                @change="ruleTypeChange"
+              >
+                <el-option
+                  v-for="item in ruleTypeList"
+                  :key="item.id"
+                  :label="item.name"
+                  :value="item.id"
+                >
+                </el-option>
+              </el-select>
+              <div class="tip-text">
+                注:更改规则类型,将会清空已填写的规则内容~
+              </div>
+            </el-form-item>
+            <el-form-item label="规则术语类型:" prop="parLenCode">
+              <el-select
+                v-model="form.parLenCode"
+                placeholder="请选择"
+                size="small"
+                @change="ruleTermChange"
+              >
+                <el-option
+                  v-for="item in ruleTermTypeList"
+                  :key="item.id"
+                  :label="item.name"
+                  :value="item.code"
+                >
+                </el-option>
+              </el-select>
+              <div class="tip-text">
+                注:更改规则术语类型,将会清空已填写的规则内容~
+              </div>
+            </el-form-item>
+            <el-form-item
+              class="addDepartFormItem"
+              label="医学标准术语:"
+              prop="parConceptId"
+            >
+              <el-select
+                clearable
+                filterable
+                remote
+                :remote-method="searchConcept"
+                v-model.trim="form.parConceptId"
+              >
+                <el-option
+                  v-for="item in conceptList"
+                  :key="item.conceptId"
+                  :label="item.conceptName"
+                  :value="item.conceptId"
+                >
+                </el-option>
+              </el-select>
+            </el-form-item>
+            <el-form-item
+              v-if="showHasSub"
+              label="有无子条件:"
+              prop="parHasSub"
+            >
+              <el-select
+                v-model="form.parHasSub"
+                placeholder="请选择"
+                size="small"
+                @change="hasSubChange"
+              >
+                <el-option
+                  v-for="item in hasSub"
+                  :key="item.id"
+                  :label="item.name"
+                  :value="item.id"
+                >
+                </el-option>
+              </el-select>
+            </el-form-item>
+            <el-form-item
+              v-if="showMsg"
+              label="附加信息:"
+              prop="parMsg"
+              class="parMsg"
+              style="flex: 1"
+            >
+              <el-input
+                type="textarea"
+                :rows="3"
+                placeholder="请输入附加信息"
+                v-model.trim="form.parMsg"
+              ></el-input>
+            </el-form-item>
+          </div>
+
+          <el-form-item
+            v-if="form.parHasSub === 1"
+            prop="remind"
+            label-width="0"
+            class="discDesc"
+          >
+            <h4>规则内容</h4>
+            <SubRulesGroup
+              v-for="(group, i) in subGroups"
+              ref="groups"
+              :key="i"
+              :data="group"
+              :baseTypes="baseTypeList"
+              :inx="i"
+              :maxNum="subRuleMaxNum"
+              :firstPlace="firstPlace"
+              :isLast="subGroups.length === 1"
+              @addGroup="addGroup"
+              @delGroup="delGroup"
+            ></SubRulesGroup>
+          </el-form-item>
+          <el-button
+            class="disclButn"
+            size="small"
+            type="primary"
+            @click="confirm"
+            >保存</el-button
+          >
+        </el-form>
+      </div>
+    </div>
+  </div>
+</template>
+<script type="text/javascript">
+import api from "@api/knowledgeLib.js";
+import SubRulesGroup from "./SubRulesGroup";
+import ComTable from "./table";
+export default {
+  name: "AddRule",
+  data() {
+    return {
+      labelPosition: "left",
+      isFirst: true,
+      isCopy: false,
+      dict: "", //规则内容固定的类型
+      msgDict: "", //显示附加信息的类型
+      title: "规则维护-添加规则",
+      ruleTermTypeList: [],
+      ruleTypeList: [],
+      conceptList: [],
+      baseTypeList: [],
+      conceptName: "",
+      subRuleMaxNum: null, //规则内容中规则的限制个数
+      firstPlace: null,
+      subGroups: [
+        [
+          {
+            subDescription: "",
+            parRuleType: "",
+            subConceptId: "",
+            subType: "",
+            subMaxOperator: "",
+            subMaxUnit: "",
+            subMaxValue: "",
+            subMinOperator: "",
+            subMinUnit: "",
+            subMinValue: "",
+            subEqValue: "",
+            subLenCode: "",
+            dataType: ""
+          }
+        ]
+      ],
+      form: {
+        parDescription: "",
+        parRuleType: "",
+        parConceptId: "",
+        parlibName: "",
+        parLenName: "",
+        parHasSub: undefined,
+        parLenCode: "",
+        parMsg: "",
+        klRuleInfoSaveSub: []
+      },
+      parId: null,
+      rules: {
+        parDescription: [
+          { required: true, message: "请输入规则名称", trigger: ["blur"] },
+          {
+            validator: (rule, value, callback) => {
+              if (value.length > 100) {
+                callback(new Error("规则名称不能超过100字"));
+              } else {
+                callback();
+              }
+            },
+            trigger: "change"
+          }
+        ],
+        parRuleType: [
+          { required: true, message: "请选择规则类型", trigger: ["change"] }
+        ],
+        parLenCode: [
+          { required: true, message: "请选择规则术语类型", trigger: ["change"] }
+        ],
+        parConceptId: [
+          { required: true, message: "请输入医学标准术语", trigger: ["blur"] }
+        ],
+        parHasSub: [
+          { required: true, message: "请选择有无子条件", trigger: ["change"] }
+        ],
+        parMsg: [
+          { required: true, message: "请输入附加信息", trigger: ["change"] },
+          {
+            validator: (rule, value, callback) => {
+              if (value.length > 100) {
+                callback(new Error("附加信息不能超过100字"));
+              } else {
+                callback();
+              }
+            },
+            trigger: "change"
+          }
+        ]
+      },
+      hasSub: [
+        { name: "有", id: 1 },
+        { name: "无", id: 0 }
+      ]
+    };
+  },
+  updated() {
+    console.log(JSON.stringify(this.subGroups));
+  },
+  created() {
+    this.getTypeList();
+    this.setDict();
+    const param = this.$route.params;
+    let info = param.data;
+    if (info) {
+      this.parId = info.parId;
+      this.isCopy = param.copy;
+      this.title = "规则维护-" + (this.isCopy ? "复制" : "修改") + "规则";
+      this.form = Object.assign({}, this.form, info);
+      this.conceptList = [
+        { conceptName: this.form.parlibName, conceptId: this.form.parConceptId }
+      ];
+      this.subGroups = this.formatGroupDatas(info.klRuleByIdSub);
+    }
+  },
+  watch: {
+    "form.parRuleType": function (val) {
+      const obj = this.ruleTypeList.find((it) => it.id === val);
+      this.ruleTermTypeList = obj.subMenuList;
+    },
+    "form.parLenCode": function (val) {
+      if (!val) {
+        this.baseTypeList = [];
+        return;
+      }
+      const obj = this.ruleTermTypeList.find((it) => it.code === val);
+      this.baseTypeList = obj.subMenuList;
+      this.subRuleMaxNum = obj.number;
+    },
+    "form.parConceptId": function (val) {
+      if (val && this.checkFirstPlace && this.conceptList) {
+        this.firstPlace = this.conceptList.find((it) => it.conceptId === val);
+        this.firstPlace["checkedType"] = this.ruleTermCodeStr;
+      } else if (!val) {
+        this.setInitGroupData();
+        this.firstPlace = null;
+      } else {
+        this.firstPlace = null;
+      }
+    }
+  },
+  components: {
+    SubRulesGroup,
+    ComTable
+  },
+  computed: {
+    ruleTermCodeStr: function () {
+      return this.form.parRuleType + "-" + this.form.parLenCode;
+    },
+    checkFirstPlace: function () {
+      return this.dict.indexOf(this.ruleTermCodeStr) > -1;
+    },
+    showMsg: function () {
+      return (
+        this.ruleTermCodeStr.length > 1 &&
+        this.msgDict.indexOf(this.ruleTermCodeStr) > -1
+      );
+    },
+    showHasSub: function () {
+      return this.subDict.indexOf(this.ruleTermCodeStr) > -1;
+    }
+  },
+  methods: {
+    hasSubChange(val) {
+      if (val) {
+        this.subGroups = [
+          [
+            {
+              subDescription: "",
+              parRuleType: "",
+              subConceptId: "",
+              subType: "",
+              subMaxOperator: "",
+              subMaxUnit: "",
+              subMaxValue: "",
+              subMinOperator: "",
+              subMinUnit: "",
+              subMinValue: "",
+              subEqValue: "",
+              subLenCode: "",
+              dataType: ""
+            }
+          ]
+        ];
+      }
+    },
+    setDict() {
+      this.dict = localStorage.getItem("zskDicts");
+      this.msgDict = localStorage.getItem("zskMsgDict");
+      this.subDict = localStorage.getItem("zskSubDict");
+    },
+    showConfirmDialog(msg, resolve) {
+      this.$alert(msg, "提示", {
+        confirmButtonText: "确定",
+        type: "warning"
+      })
+        .then(() => {
+          resolve();
+        })
+        .catch(() => {});
+    },
+    formatGroupDatas(data) {
+      let arr = [];
+      data.map((it) => {
+        if (!arr[it.groupType]) {
+          arr[it.groupType] = [];
+        }
+        if (it.subMaxOperator || it.subMinOperator) {
+          it.dataType = "1";
+        } else if (it.subEqValue) {
+          it.dataType = "2";
+        }
+        arr[it.groupType].push(it);
+      });
+      arr = arr.filter((it) => {
+        if (it) return it;
+      });
+      return arr;
+    },
+    searchConcept(val) {
+      const param = {
+        excludedConceptIds: [this.form.parRuleType],
+        libType: this.form.parLenCode,
+        name: val
+      };
+      api
+        .searchConcept(param)
+        .then((res) => {
+          if (res.data.code == "0") {
+            const data = res.data.data;
+            this.conceptList = data;
+          }
+        })
+        .catch((error) => {
+          console.log(error);
+        });
+    },
+    ruleTypeChange(val) {
+      //规则类型选中
+      this.form.parRuleType = val;
+      this.form.parLenCode = "";
+      this.form.parMsg = "";
+      const obj = this.ruleTypeList.find((it) => it.id === val); //console.log(val)
+      this.ruleTermTypeList = obj.subMenuList;
+      this.setInitGroupData();
+    },
+    ruleTermChange(val) {
+      //规则术语类型选中
+      this.form.parLenCode = val;
+      this.form.parMsg = "";
+      const obj = this.ruleTermTypeList.find((it) => it.code === val);
+      this.form.parLenName = obj.name;
+      this.baseTypeList = obj.subMenuList;
+      this.subRuleMaxNum = obj.number;
+      this.setInitGroupData();
+      this.form.parHasSub = obj.subMenuList.length ? 1 : 0;
+    },
+    getTypeList() {
+      const typeListData = JSON.parse(localStorage.getItem("zskTypesList"));
+      this.ruleTypeList = typeListData;
+    },
+    setInitGroupData() {
+      this.subGroups = [
+        [
+          {
+            subDescription: "",
+            parRuleType: "",
+            subConceptId: "",
+            subType: "",
+            subMaxOperator: "",
+            subMaxUnit: "",
+            subMaxValue: "",
+            subMinOperator: "",
+            subMinUnit: "",
+            subMinValue: "",
+            subEqValue: "",
+            subLenCode: "",
+            dataType: ""
+          }
+        ]
+      ];
+      this.form.parConceptId = ""; //医学标准术语清空
+      this.conceptList = []; //下拉列表清空
+    },
+    addGroup() {
+      let temp = {
+        subDescription: "",
+        subConceptId: "",
+        subType: "",
+        subLenCode: "",
+        dataType: "",
+        subMaxOperator: "",
+        subMaxUnit: "",
+        subMaxValue: "",
+        subMinOperator: "",
+        subMinUnit: "",
+        subMinValue: "",
+        subEqValue: ""
+      };
+      if (this.checkFirstPlace) {
+        const obj = this.subGroups[0][0];
+        temp = {
+          subDescription: obj.subConceptName,
+          subConceptId: obj.subConceptId,
+          subConceptName: obj.subConceptName,
+          subLenCode: this.form.parLenCode,
+          subLenName: this.form.parLenName,
+          subLibName: this.form.parlibName,
+          subType: obj.subType,
+          dataType: "",
+          subMaxOperator: "",
+          subMaxUnit: "",
+          subMaxValue: "",
+          subMinOperator: "",
+          subMinUnit: "",
+          subMinValue: "",
+          subEqValue: ""
+        };
+      }
+      this.subGroups.push([temp]);
+    },
+    delGroup(i) {
+      //this.subGroups.splice(i,1);
+      this.$set(this.subGroups, i, null);
+    },
+    saveRule(params) {
+      api.saveRule(params).then((res) => {
+        if (res.data.code == 0) {
+          this.$message({
+            message: "操作成功",
+            type: "success"
+          });
+          this.$router.push({
+            name: "ZskRuleManager",
+            params: Object.assign({}, this.$route.params, { currentPage: 1 })
+          });
+        } else {
+          this.$message({
+            message: res.data.msg,
+            type: "warning"
+          });
+        }
+      });
+    },
+    formatGroups() {
+      let obj = [];
+      this.subGroups.map((item, i) => {
+        item &&
+          item.map((it) => {
+            obj.push({ ...it, groupType: i + 1 });
+          });
+      });
+      return obj;
+    },
+    validateForms(callBack) {
+      this.$refs["form"].validate((valid) => {
+        if (valid) {
+          const groupsRef = this.$refs["groups"];
+          if (!groupsRef || groupsRef.length === 0) {
+            callBack();
+            return;
+          }
+          let groupRef = null,
+            goOn = true;
+          for (let i = 0; i < groupsRef.length; i++) {
+            groupRef = groupsRef[i].$refs["group"];
+            for (let j = 0; j < groupRef.length; j++) {
+              groupRef[j].$refs["groupData"].validate((valid) => {
+                if (!valid) {
+                  goOn = false;
+                }
+              });
+            }
+          }
+          if (goOn) {
+            callBack();
+          }
+        } else {
+          return false;
+        }
+      });
+    },
+    confirm() {
+      const _this = this;
+      this.validateForms(function () {
+        delete _this.form.klRuleByIdSub;
+        _this.form.klRuleInfoSaveSub = _this.form.parHasSub
+          ? _this.formatGroups()
+          : undefined;
+        let params = _this.form;
+        if (_this.parId) {
+          //修改/复制
+          params = Object.assign({}, _this.form, {
+            parId: _this.isCopy ? undefined : _this.parId,
+            parStatus: _this.isCopy ? 1 : _this.form.parStatus
+          });
+        }
+        console.log(params);
+        _this.saveRule(params);
+      });
+    }
+  }
+};
+</script>
+<style lang="less" scoped>
+@import "../../less/admin.less";
+.content2 {
+  background-color: #dee2ea;
+  // padding: 20px 20px 30px;
+  //   padding: 20px 20px 50px;
+  color: #545455;
+  min-width: 980px;
+  position: relative;
+  .tip-text {
+    color: #f56c6c;
+    font-size: 12px;
+    margin-left: -80px;
+  }
+  .conceptItem {
+    padding: 0 10px;
+    cursor: pointer;
+    height: 32px;
+    line-height: 32px;
+    &:hover {
+      background: #ebedf1;
+    }
+  }
+  .discDesc {
+    margin-bottom: 20px;
+  }
+  .disclButn {
+    position: absolute;
+    right: 80px;
+    bottom: 10px;
+  }
+}
+.add-new-form {
+  .el-form-item__label {
+    text-align: right;
+  }
+  .addDepartFormItem {
+    position: relative;
+  }
+  .itemList {
+    position: absolute;
+    // display: none;
+    background: #fff;
+    width: 188px;
+    max-height: 160px;
+    border: 1px solid #dcdfe6;
+    left: 0;
+    top: 37px;
+    z-index: 2;
+    overflow-y: auto;
+  }
+  .indexList {
+    left: 42px;
+    top: 78px;
+  }
+  .el-input__prefix,
+  .el-input__suffix {
+    /*top:-2px;*/
+    right: 3px;
+  }
+  .el-input--suffix .el-input__inner {
+    padding-right: 22px;
+  }
+  .el-input,
+  .el-input__inner {
+    width: 190px;
+    line-height: 32px;
+    height: 32px;
+  }
+  .el-input__icon {
+    line-height: 32px;
+  }
+}
+.table_header {
+  background: #fff;
+  padding: 20px;
+  display: flex;
+  flex-wrap: wrap;
+}
+</style>

+ 635 - 0
src/components/knowledgeExtra/_SubConditions.vue

@@ -0,0 +1,635 @@
+<template>
+  <div class="groups-cont">
+    <el-form
+      ref="groupData"
+      label-width="150px"
+      class="sub-condition-form"
+      :model="groupData"
+      :rules="rules"
+    >
+      <span v-if="!disabled && !isLast" class="del-btn" @click="delRule"
+        >删除</span
+      ><!--:class="isLast?'disable del-btn':'del-btn'"-->
+      <el-form-item label="基础规则名称:" prop="subDescription">
+        <el-input
+          v-model.trim="groupData.subDescription"
+          :disabled="disabled"
+        ></el-input>
+      </el-form-item>
+      <el-form-item label="基础规则类型:" prop="subType">
+        <el-select
+          v-model="groupData.subType"
+          :disabled="disabled"
+          placeholder="请选择"
+          size="small"
+          @change="subTypeChange"
+        >
+          <el-option
+            v-for="item in baseTypes"
+            :key="item.id"
+            :label="item.name"
+            :value="item.type"
+          >
+          </el-option>
+        </el-select>
+      </el-form-item>
+      <el-form-item label="基础规则术语类型:" prop="subLenCode">
+        <el-select
+          v-model="groupData.subLenCode"
+          :disabled="disabled"
+          placeholder="请选择"
+          size="small"
+          @change="subCodeChange"
+        >
+          <el-option
+            v-for="item in baseTermTypeList"
+            :key="item.id"
+            :label="item.name"
+            :value="item.code"
+          >
+          </el-option>
+        </el-select>
+      </el-form-item>
+      <el-form-item
+        class="addDepartFormItem"
+        label="医学标准术语:"
+        prop="subConceptId"
+      >
+        <el-select
+          clearable
+          remote
+          filterable
+          :disabled="disabled"
+          :remote-method="searchConcept"
+          v-model.trim="groupData.subConceptId"
+        >
+          <el-option
+            v-for="item in conceptList"
+            :key="item.conceptId"
+            :label="item.conceptName"
+            :value="item.conceptId"
+          >
+          </el-option>
+        </el-select>
+      </el-form-item>
+      <el-form-item
+        v-if="groupData.subType === 2 && showDataType"
+        label="选择类型:"
+        prop="dataType"
+      >
+        <el-select
+          v-model="groupData.dataType"
+          placeholder="请选择"
+          size="small"
+          @change="dataTypeChange"
+        >
+          <el-option
+            v-for="item in dataTypes"
+            :key="item.id"
+            :label="item.name"
+            :value="item.id"
+          >
+          </el-option>
+        </el-select>
+      </el-form-item>
+      <el-form-item
+        class="min-margin"
+        v-if="groupData.dataType === '1'"
+        label="最大值:"
+      >
+        <div class="select-item clearfix">
+          <el-col :span="3">
+            <el-form-item prop="subMaxOperator">
+              <el-select
+                v-model="groupData.subMaxOperator"
+                placeholder="请选择"
+                size="small"
+                clearable
+              >
+                <el-option
+                  v-for="item in operMaxList"
+                  :key="item.key"
+                  :label="item.name"
+                  :value="item.key"
+                >
+                </el-option>
+              </el-select>
+            </el-form-item>
+          </el-col>
+          <el-col :span="3">
+            <el-form-item prop="subMaxValue">
+              <el-input
+                type="text"
+                v-model="groupData.subMaxValue"
+                placeholder="填写数值"
+              />
+            </el-form-item>
+          </el-col>
+          <el-col :span="3">
+            <el-form-item prop="subMaxUnit">
+              <el-input
+                type="text"
+                v-model.trim="groupData.subMaxUnit"
+                placeholder="填写单位"
+              />
+            </el-form-item>
+          </el-col>
+        </div>
+      </el-form-item>
+      <el-form-item
+        class="min-margin"
+        v-if="groupData.dataType === '1'"
+        label="最小值:"
+      >
+        <div class="select-item clearfix">
+          <el-col :span="3">
+            <el-form-item prop="subMinOperator">
+              <el-select
+                v-model="groupData.subMinOperator"
+                placeholder="请选择"
+                size="small"
+                clearable
+              >
+                <el-option
+                  v-for="item in operMinList"
+                  :key="item.name"
+                  :label="item.name"
+                  :value="item.name"
+                >
+                </el-option>
+              </el-select>
+            </el-form-item>
+          </el-col>
+          <el-col :span="3">
+            <el-form-item prop="subMinValue">
+              <el-input
+                type="text"
+                v-model="groupData.subMinValue"
+                placeholder="填写数值"
+              />
+            </el-form-item>
+          </el-col>
+          <el-col :span="3">
+            <el-form-item prop="subMinUnit">
+              <el-input
+                type="text"
+                v-model.trim="groupData.subMinUnit"
+                placeholder="填写单位"
+              />
+            </el-form-item>
+          </el-col>
+        </div>
+      </el-form-item>
+      <el-form-item
+        v-if="groupData.subType !== 6 && groupData.dataType === '2'"
+        label="医学内容:"
+        prop="subEqValue"
+        class="discDesc is-required"
+      >
+        <el-input
+          type="textarea"
+          rows="3"
+          placeholder="请输入医学内容"
+          v-model.trim="groupData.subEqValue"
+        ></el-input>
+      </el-form-item>
+      <el-form-item
+        v-if="groupData.subType === 6"
+        label="正则表达式:"
+        prop="subEqValue"
+        class="discDesc is-required"
+      >
+        <el-input
+          type="textarea"
+          rows="3"
+          placeholder="请输入正则表达式"
+          v-model.trim="groupData.subEqValue"
+        ></el-input>
+      </el-form-item>
+    </el-form>
+    <div class="inner-oper" v-if="showAdd">
+      <span>新增规则:</span>
+      <span class="add-btn" @click="addRule"
+        ><img src="../../images/add.png" alt="新增规则"
+      /></span>
+    </div>
+  </div>
+</template>
+<script>
+import api from "@api/knowledgeLib.js";
+export default {
+  name: "subCondititons",
+  props: [
+    "groupData",
+    "ind",
+    "isLast",
+    "baseTypes",
+    "firstPlace",
+    "disabled",
+    "showAdd"
+  ],
+  data() {
+    return {
+      //baseTermTypeList:[],
+      typeList: [],
+      numTypes: "", //只有数值类型的类型id
+      operMaxList: [
+        { name: "<=", key: "<=" },
+        { name: "<", key: "<" }
+      ],
+      operMinList: [
+        { name: ">", key: ">" },
+        { name: ">=", key: ">=" }
+      ],
+      dataTypes: [
+        { id: "1", name: "数值类型" },
+        { id: "2", name: "文本类型" }
+      ],
+      conceptList: [],
+      rules: {
+        subDescription: [
+          { required: true, message: "请输入基础规则名称", trigger: ["blur"] },
+          {
+            validator: (rule, value, callback) => {
+              if (value && value.length > 100) {
+                callback(new Error("规则名称不能超过100字"));
+              } else {
+                callback();
+              }
+            },
+            trigger: "change"
+          }
+        ],
+        subType: [
+          { required: true, message: "请选择基础规则类型", trigger: ["change"] }
+        ],
+        subLenCode: [
+          {
+            required: true,
+            message: "请选择基础规则术语类型",
+            trigger: ["change"]
+          }
+        ],
+        subConceptId: [
+          { required: true, message: "请输入医学标准术语", trigger: ["blur"] }
+        ],
+        dataType: [
+          { required: true, message: "请选择类型", trigger: ["change"] }
+        ],
+        subMaxOperator: [
+          {
+            validator: (rule, value, callback) => {
+              const {
+                subMaxValue,
+                subMinOperator,
+                subMinValue
+              } = this.groupData;
+              const val = value + subMinOperator + subMinValue + subMaxValue;
+              if (!val || (!value && subMaxValue !== "")) {
+                callback(
+                  new Error("最大值和最小值至少完整填写一个,单位不必填")
+                );
+              } else {
+                callback();
+              }
+            },
+            trigger: "blur"
+          }
+        ],
+        subMinOperator: [
+          {
+            validator: (rule, value, callback) => {
+              const {
+                subMaxValue,
+                subMaxOperator,
+                subMinValue
+              } = this.groupData;
+              const val = value + subMaxOperator + subMinValue + subMaxValue;
+              if (!val || (!value && subMinValue !== "")) {
+                callback(
+                  new Error("最大值和最小值至少完整填写一个,单位不必填")
+                );
+              } else {
+                callback();
+              }
+            },
+            trigger: "blur"
+          }
+        ],
+        subMaxValue: [
+          {
+            validator: (rule, value, callback) => {
+              const {
+                subMaxOperator,
+                subMinOperator,
+                subMinValue
+              } = this.groupData;
+              const val = value + subMaxOperator + subMinValue + subMinOperator;
+              const isNum = /^(\-|\+)?\d+(\.\d+)?$/.test(value);
+              if (!val || (value == "" && subMaxOperator)) {
+                callback(
+                  new Error("最大值和最小值至少完整填写一个,单位不必填")
+                );
+              } else if (value !== "" && !isNum) {
+                callback(new Error("只能输入数字"));
+              } else {
+                callback();
+              }
+            },
+            trigger: "blur"
+          }
+        ],
+        subMinValue: [
+          {
+            validator: (rule, value, callback) => {
+              const {
+                subMaxValue,
+                subMinOperator,
+                subMaxOperator
+              } = this.groupData;
+              const val = value + subMaxOperator + subMaxValue + subMinOperator;
+              const isNum = /^(\-|\+)?\d+(\.\d+)?$/.test(value);
+              if (!val || (value == "" && subMinOperator)) {
+                callback(
+                  new Error("最大值和最小值至少完整填写一个,单位不必填")
+                );
+              } else if (value !== "" && !isNum) {
+                callback(new Error("只能输入数字"));
+              } else {
+                callback();
+              }
+            },
+            trigger: "blur"
+          }
+        ],
+        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"
+          }
+        ]
+      }
+    };
+  },
+  watch: {
+    groupData: {
+      handler: function (val) {
+        this.$emit("changeVal", val, this.ind);
+      },
+      deep: true
+    },
+    /*'baseTypes':{
+                handler:function(val){
+                    if(!this.groupData.subType){
+                        this.baseTermTypeList =[];
+                        return;
+                    }
+                    const obj = val.find((it)=>it.type===this.groupData.subType);
+                    this.baseTermTypeList = obj.subMenuList;
+                },
+                deep:true
+            },*/
+    firstPlace: {
+      handler: function (val) {
+        if (this.ind !== 0 || !val) return;
+        const dict =
+          localStorage
+            .getItem("zskDicts")
+            .match(new RegExp(val.checkedType + "-\\d+", "g")) || [];
+        const types = dict[0].split("-");
+        this.groupData.subType = +types[2];
+        this.groupData.subLenCode = types[1];
+        this.conceptList = [val];
+        this.groupData.subDescription = val.conceptName;
+        this.groupData.subConceptId = val.conceptId;
+        this.groupData.subConceptName = val.conceptName;
+      },
+      deep: true
+    }
+  },
+  created() {
+    this.numTypes = localStorage.getItem("zskNumDict");
+    this.conceptList = [
+      {
+        conceptName: this.groupData.subLibName || this.groupData.subConceptName,
+        conceptId: this.groupData.subConceptId
+      }
+    ];
+  },
+  computed: {
+    baseTermTypeList: function () {
+      if (!this.baseTypes.length) {
+        return [];
+      }
+      const sub =
+        this.baseTypes.find((it) => it.type === this.groupData.subType) || {};
+      return sub.subMenuList;
+    },
+    showDataType: function () {
+      return (
+        (this.numTypes + ",").indexOf(this.groupData.subLenCode + ",") === -1
+      );
+    },
+    textName: function () {
+      return this.groupData.subType !== 6 && this.groupData.dataType === "2"
+        ? "医学内容"
+        : "正则表达式";
+    }
+  },
+  methods: {
+    dataTypeChange(val) {
+      this.groupData.subEqOperator = val === "2" ? "=" : "";
+      this.clearNumText();
+      delete this.groupData.dataType; //触发更新
+      this.$set(this.groupData, "dataType", val);
+    },
+    subTypeChange(val) {
+      //基础规则类型修改
+      this.groupData.subLenCode = "";
+      this.groupData.dataType = "";
+      this.clearConcept();
+      this.clearNumText();
+    },
+    subCodeChange(val) {
+      //基础规则术语类型修改
+      this.groupData.subLenCode = val;
+      if ((this.numTypes + ",").indexOf(val + ",") > -1) {
+        this.groupData.dataType = "1";
+      } else {
+        this.groupData.dataType = "";
+      }
+      this.clearConcept();
+      this.clearNumText();
+    },
+    clearConcept() {
+      this.groupData.subConceptId = "";
+      this.conceptList = [];
+    },
+    clearNumText() {
+      this.groupData.subMaxOperator = "";
+      this.groupData.subMaxValue = "";
+      this.groupData.subMaxUnit = "";
+      this.groupData.subMinOperator = "";
+      this.groupData.subMinValue = "";
+      this.groupData.subMinUnit = "";
+      this.groupData.subEqValue = "";
+      this.groupData.subEqOperator = "";
+    },
+    searchConcept(val) {
+      const param = {
+        excludedConceptIds: [this.groupData.subType],
+        libType: this.groupData.subLenCode,
+        name: val
+      };
+      api
+        .searchConcept(param)
+        .then((res) => {
+          if (res.data.code == "0") {
+            const data = res.data.data;
+            this.conceptList = data;
+          }
+        })
+        .catch((error) => {
+          console.log(error);
+        });
+    },
+    addRule() {
+      this.$emit("addRule");
+    },
+    delRule() {
+      if (this.isLast) {
+        this.warning("初始状态规则不能删除~");
+        return;
+      }
+      //this.showConfirmDialog("是否删除该条规则,可能对现有系统会造成影响",()=>{
+      this.$emit("delRule", this.ind);
+      //});
+    },
+    warning(msg, type) {
+      this.$message({
+        showClose: true,
+        message: msg,
+        type: type || "warning"
+      });
+    },
+    showConfirmDialog(msg, resolve) {
+      this.$alert(msg, "提示", {
+        confirmButtonText: "确定",
+        type: "warning"
+      })
+        .then(() => {
+          resolve();
+        })
+        .catch(() => {});
+    }
+  }
+};
+</script>
+<style lang="less">
+.groups-cont {
+  background: #fff;
+  .conceptItem {
+    padding: 0 10px;
+    cursor: pointer;
+    height: 32px;
+    line-height: 32px;
+    &:hover {
+      background: #ebedf1;
+    }
+  }
+  .inner-oper {
+    padding: 15px 0 15px 21px;
+    .add-btn {
+      cursor: pointer;
+      img {
+        vertical-align: middle;
+      }
+    }
+  }
+  .sub-condition-form {
+    padding: 20px;
+    position: relative;
+    border-bottom: 2px solid #f5f5f5;
+    .del-btn {
+      color: #ff5b5b;
+      cursor: pointer;
+      position: absolute;
+      right: 20px;
+      top: 20px;
+      z-index: 1;
+      &.disable {
+        color: #b8b8b8;
+      }
+    }
+  }
+  .el-input__icon {
+    line-height: 32px;
+  }
+  .select-item {
+    & > div {
+      float: left;
+      margin-right: 10px;
+    }
+    .el-input {
+      width: auto;
+    }
+    input {
+      width: 95px;
+      line-height: 32px;
+      height: 32px;
+    }
+  }
+  .el-input,
+  .el-input__inner {
+    width: 190px;
+    line-height: 32px;
+    height: 32px;
+  }
+  .el-button--danger.is-plain {
+    background: none;
+  }
+  .itemList {
+    position: absolute;
+    // display: none;
+    background: #fff;
+    width: 188px;
+    max-height: 160px;
+    border: 1px solid #dcdfe6;
+    left: 0;
+    top: 37px;
+    z-index: 2;
+    overflow-y: auto;
+  }
+  .el-form-item {
+    margin-bottom: 22px;
+    &.min-margin {
+      margin-bottom: 0;
+    }
+  }
+  .el-form-item__error {
+    top: auto;
+    white-space: nowrap;
+    background: #fff;
+  }
+  .el-input-number {
+    width: 95px;
+  }
+  .el-input-number.is-controls-right .el-input-number__decrease,
+  .el-input-number.is-controls-right .el-input-number__increase {
+    width: 25px;
+    height: 15px;
+    line-height: 16px;
+  }
+  .el-col-3 {
+    width: 94px;
+  }
+}
+</style>

+ 129 - 0
src/components/knowledgeExtra/_SubRulesGroup.vue

@@ -0,0 +1,129 @@
+<template>
+  <div class="sub-groups" v-if="data">
+    <SubConditions
+      v-for="(rules, i) in data"
+      :key="i"
+      ref="group"
+      :groupData="rules"
+      :isLast="data.length === 1"
+      :ind="i"
+      :showAdd="data.length < maxNum"
+      :baseTypes="baseTypes"
+      :firstPlace="firstPlace"
+      :disabled="i === 0 && disable"
+      @changeVal="handleInput"
+      @addRule="addRule"
+      @delRule="delRule"
+    ></SubConditions>
+    <div class="group-oper">
+      <el-button size="small" @click="addGroup">+新增分组</el-button>
+      <el-button
+        :disabled="isLast"
+        size="small"
+        type="danger"
+        plain
+        @click="delGroup"
+        >-删除分组</el-button
+      >
+    </div>
+  </div>
+</template>
+<script>
+import SubConditions from "./_SubConditions.vue";
+export default {
+  name: "SubRulesGroup",
+  props: ["data", "inx", "isLast", "baseTypes", "maxNum", "firstPlace"],
+  data() {
+    return {};
+  },
+  computed: {
+    disable: function () {
+      return Object.keys(this.firstPlace || {}).length > 0;
+    }
+  },
+  methods: {
+    handleInput(val, i) {
+      this.data[i] = val;
+    },
+    addRule() {
+      let temp = {
+        subDescription: "",
+        subConceptId: "",
+        subType: "",
+        subLenName: "",
+        subLenCode: "",
+        subLibName: "",
+        subMaxOperator: "",
+        subMaxUnit: "",
+        subMaxValue: "",
+        subMinOperator: "",
+        subMinUnit: "",
+        subMinValue: "",
+        subEqValue: "",
+        dataType: ""
+      };
+      this.data.push(temp);
+    },
+    delRule(i) {
+      if (i === 0 && this.data.length === 1) {
+        this.$emit("delGroup", this.inx);
+        return;
+      }
+      this.data.splice(i, 1);
+    },
+    addGroup() {
+      this.$emit("addGroup");
+    },
+    delGroup() {
+      this.$emit("delGroup", this.inx);
+    },
+    warning(msg, type) {
+      this.$message({
+        showClose: true,
+        message: msg,
+        type: type || "warning"
+      });
+    },
+    showConfirmDialog(msg, resolve) {
+      this.$alert(msg, "提示", {
+        confirmButtonText: "确定",
+        type: "warning"
+      })
+        .then(() => {
+          resolve();
+        })
+        .catch(() => {
+          this.warning("删除失败,请重试!");
+        });
+    }
+  },
+  components: {
+    SubConditions
+  }
+};
+</script>
+<style lang="less" scoped>
+.sub-groups {
+  background: #f5f5f5;
+  padding: 20px;
+}
+.group-oper {
+  text-align: center;
+  padding: 11px 0;
+  border-top: 4px solid #f5f5f5;
+  background: #fff;
+}
+.el-button--danger.is-plain:focus,
+.el-button--danger.is-plain:hover {
+  color: #fbc4c4;
+  border-color: #fbc4c4;
+}
+.el-button--danger.is-plain {
+  background: none;
+  &.is-disabled {
+    color: #f9a7a7;
+    background-color: #fef0f0;
+    border-color: #fde2e2;
+  }
+}
+</style>

+ 113 - 0
src/components/knowledgeExtra/rules.js

@@ -0,0 +1,113 @@
+export const formRules = {
+  parDescription: [
+    { required: true, message: "请输入规则名称", trigger: ["blur"] },
+    {
+      validator: (rule, value, callback) => {
+        if (value.length > 100) {
+          callback(new Error("规则名称不能超过100字"));
+        } else {
+          callback();
+        }
+      },
+      trigger: ["change"]
+    }
+  ],
+  parRuleType: [
+    { required: true, message: "请选择规则类型", trigger: ["change"] }
+  ],
+  parLenCode: [
+    { required: true, message: "请选择规则术语类型", trigger: ["change"] }
+  ],
+  parConceptId: [
+    { required: true, message: "请输入医学标准术语", trigger: ["change"] }
+  ],
+  parHasSub: [
+    { required: true, message: "请选择有无子条件", trigger: ["change"] }
+  ],
+  parMsg: [
+    { required: true, message: "请输入附加信息", trigger: ["change"] },
+    {
+      validator: (rule, value, callback) => {
+        if (value.length > 100) {
+          callback(new Error("附加信息不能超过100字"));
+        } else {
+          callback();
+        }
+      },
+      trigger: "change"
+    }
+  ],
+
+}
+
+export const tableRules = {
+  conceptId: [
+    { required: true, message: '请输入疾病名称', trigger: ['change'] }
+  ],
+  subDescription: [
+    { required: true, message: "请输入基础规则名称", trigger: ["change", "blur"] },
+    {
+      validator: (rule, value, callback) => {
+        if (value && value.length > 100) {
+          callback(new Error("规则名称不能超过100字"));
+        } else {
+          callback();
+        }
+      },
+      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,
+      message: "请选择基础规则术语类型",
+      trigger: ["blur"]
+    }
+  ],
+  basLibType: [
+    {
+      required: true,
+      message: "请选择基础依据术语类型",
+      trigger: ["blur"]
+    }
+  ],
+  subConceptId: [
+    { required: true, message: "请输入医学标准术语", trigger: ["blur"] }
+  ],
+  
+  dataType: [
+    { 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"
+    }
+  ]
+}

+ 125 - 0
src/components/knowledgeExtra/table.vue

@@ -0,0 +1,125 @@
+<template>
+  <!-- <el-form
+    ref="groupData"
+    label-width="150px"
+    class="sub-condition-form"
+    :model="groupData"
+    :rules="rules"
+  >
+    <el-table :data="formatList" style="width: 100%">
+      <el-table-column prop="TableId" label="TableId" width="180">
+      </el-table-column>
+      <el-table-column prop="TableRowId" label="TableRowId" width="180">
+      </el-table-column>
+    </el-table>
+  </el-form> -->
+  <div>
+    <table border="1">
+      <thead>
+        <tr>
+          <th>头</th>
+          <th>头</th>
+          <th>头</th>
+          <th>头</th>
+          <th>头</th>
+        </tr>
+      </thead>
+      <tbody>
+        <form action=""> 
+          <tr>
+            <td>com</td>
+            <td>com1</td>
+            <td>com2</td>
+            <td>com3</td>
+            <td>com4</td>
+          </tr>
+        </form>
+        <form action="">
+          <tr>
+            <td>com</td>
+            <td>com1</td>
+            <td>com2</td>
+            <td>com3</td>
+            <td>com4</td>
+          </tr>
+        </form>
+      </tbody>
+    </table>
+    <div class="c_table">
+      <div class="c_row">
+        <form action="">
+          <div class="c_cell">张三</div>
+          <div class="c_cell">李四</div>
+          <div class="c_cell">王五</div>
+          <div class="c_cell">王五</div>
+        </form>
+      </div>
+      <form action="">
+        <div>
+          <div>
+            <ul>
+              <li>
+                <div class="c_row">
+                  <div class="c_cell">
+                    <div>
+                      <input type="text" name="" id="" />
+                    </div>
+                  </div>
+                  <div class="c_cell">张三</div>
+                  <div class="c_cell">李四</div>
+                  <div class="c_cell">王五</div>
+                </div>
+              </li>
+            </ul>
+          </div>
+        </div>
+      </form>
+    </div>
+  </div>
+</template>
+
+<script>
+export default {
+  props: ["list"],
+  data() {
+    return {};
+  },
+  computed: {
+    formatList() {
+      let list = JSON.parse(JSON.stringify(this.list));
+      let newList = [];
+      list.forEach((item, index) => {
+        item.forEach((ite, i) => {
+          ite.TableId = index + 1;
+          ite.TableRowId = i + 1;
+        });
+        newList.push(...item);
+      });
+      console.log("newList", newList);
+      return newList;
+    }
+  }
+};
+</script>
+
+<style lang="less" scoped>
+.c_table {
+  display: table;
+  border: 1px solid #cccccc;
+  margin: 5px;
+  /*display: table时padding会失效*/
+}
+
+.c_row {
+  display: table-row;
+  border: 1px solid #cccccc;
+  /*display: table-row时margin、padding同时失效*/
+}
+
+.c_cell {
+  display: table-cell;
+  border: 1px solid #cccccc;
+  padding: 5px;
+  /*display: table-cell时margin会失效*/
+}
+</style>

+ 17 - 2
src/components/testManager/staticKnowledgeMap/StaticKnowledgeMapTest.vue

@@ -83,10 +83,10 @@
             <el-button
               type="text"
               size="small"
-              :disabled="!runningStatus"
+              :disabled="!runningStatus || implement"
               @click="handleTest(scope.row, scope.$index)"
               >{{
-                runningStatusArr[scope.$index] === 1
+                runningStatusArr[scope.$index] === 1 || implement
                   ? '执行测试中...'
                   : '执行测试'
               }}</el-button
@@ -122,6 +122,7 @@ export default {
       caseId: '',
       runningStatusArr: [0, 0, 0, 0, 0],
       statusIndex: '',
+      implement: false
     };
   },
   computed: {
@@ -147,6 +148,18 @@ export default {
     });
   },
   methods: {
+    getRunningState() {
+      api
+        .getRunningState({ caseGroup: 1 })
+        .then(res => {
+          if (res.data.code == '0') {
+            this.implement = res.data.data
+          }
+        })
+        .catch(error => {
+          console.log(error);
+        });
+    },
     _getRunningStatus() {
       const { hospitalId } = this;
       if (this.hospitalId === '') return;
@@ -199,9 +212,11 @@ export default {
               type: 'success',
             });
             this.getDataList(this.hospitalId); // 重新获取列表
+            this.getRunningState()
           } else {
             this.$message.error(res.data.msg || '重置失败');
             this.getDataList(this.hospitalId); // 重新获取列表
+            this.getRunningState()
           }
           this.runningStatusArr = [0, 0, 0, 0, 0];
         });

二进制
src/images/add-new-rule-del.png


二进制
src/images/add-new-rule-sub.png


二进制
src/images/exclamationpoint.png


二进制
src/images/icon-add.png


二进制
src/images/icon-collect-left.png


二进制
src/images/icon-collect-right.png


二进制
src/images/icon-copy.png


二进制
src/images/icon-delete.png


二进制
src/images/msg_close.png


二进制
src/images/tab_add.png


二进制
src/images/tab_close.png


二进制
src/images/tips.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 {

+ 69 - 49
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'; //关联维护设置
@@ -211,14 +214,15 @@ import AddDevKnow from '@components/knowledgeExtra/AddDevKnow.vue'   //知识库
 import ZskRuleManager from '@components/knowledgeExtra/RuleManager.vue';  //知识库规则维护
 import AddZskRule from '@components/knowledgeExtra/AddNewRule.vue';   //知识库添加规则
 import KnowledgeAll from '@components/knowledgeExtra/KnowledgeAll.vue'   //知识库树
-import KnowledgeBaseType from '@components/knowledgeExtra/KnowledgeBaseType.vue'   
-import AboutDisease from '@components/knowledgeExtra/AboutDisease.vue'   
-import DiseaseTree from '@components/knowledgeExtra/DiseaseTree.vue'   
+import KnowledgeBaseType from '@components/knowledgeExtra/KnowledgeBaseType.vue'
+import AboutDisease from '@components/knowledgeExtra/AboutDisease.vue'
+import DiseaseTree from '@components/knowledgeExtra/DiseaseTree.vue'
 import AutoKnowledgeMapRuleTest from '@components/autoTest/AutoKnowledgeMapRuleTest.vue';
 import AutoBillCommonTest from '@components/autoTest/AutoBillCommonTest.vue';
 import ZskDiagBase from '@components/knowledgeExtra/DiagBase.vue';      //知识库拓展-诊断依据维护
 import AddZskDiagBase from '@components/knowledgeExtra/AddDiagBase.vue';
-
+import ZskRegisteredDrug from '@components/knowledgeExtra/RegisteredDrug.vue';
+import AddZskRegisteredDrug from '@components/knowledgeExtra/AddZskRegisteredDrug.vue';
 export default [
     {
         path: '/',
@@ -493,9 +497,9 @@ export default [
             { path: 'YXSYK-JCGLWH', component: Pacs, name: 'Pacs' }, //检查关联维护
             { path: 'LT-JCGLWH-TJHYDXXYGBXDY', component: AddPacs, name: 'AddPacs' }, //检查关联维护--添加关联
             { path: 'YXSYK-YPGLWH', component: DrugManage, name: 'DrugManage' }, //药品关联维护
-            { path: 'LT-YPGLWH-TJHYDXXYGBXDY', component: AddScale, name: 'AddDrug' }, //药品关联维护--添加关联
-            { path: 'YXSYK-YPGLWH', component: ScaleManage, name: 'ScaleManage' }, //药品关联维护
-            { path: 'LT-YPGLWH-TJHYDXXYGBXDY', component: AddScale, name: 'AddScale' }, //药品关联维护--添加关联
+            { path: 'LT-YPGLWH-TJHYDXXYGBXDY', component: AddDrug, name: 'AddDrug' }, //药品关联维护--添加关联
+            { path: 'YXSYK-LBGLWH', component: ScaleManage, name: 'ScaleManage' }, //量表关联维护
+            { path: 'LT-LBGLWH-TJHYDXXYGBXDY', component: AddScale, name: 'AddScale' }, //量表关联维护--添加关联
             { path: 'YXSYK-SSCZGLWH', component: Operation, name: 'Operation' }, //手术/操作关联维护
             { path: 'LT-SSCZGLWH-TJHYDXXYGBXDY', component: AddOperation, name: 'AddOperation' }, //手术/操作关联维护--添加关联
             { path: 'YXSYK-SXGLWH', component: Fusion, name: 'Fusion' }, //输血关联维护
@@ -504,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' }, //电子病历方案配置--新增编辑
@@ -618,46 +628,56 @@ export default [
                 component: AddZskDiagBase,
                 name: 'AddZskDiagBase',
             },
-    {
-        path: 'LT-ZSKKZWH-JTXXWH',
-        component: StaticInfo,
-        name: 'StaticInfo',
-    },
-    {
-        path: 'LT-ZSKKZWH-JTXXWH-EDIT',
-        component: AddDevKnow,
-        name: 'AddDevKnow',
-    },
-    {
-        path: 'LT-ZSKKZWH-SXJGWH',
-        component: KnowledgeAll,
-        name: 'KnowledgeAll',
-    }, //树形结构维护
-    {
-        path: 'LT-ZSKJCWH-JCSYLXWH',
-        component: KnowledgeBaseType,
-        name: 'KnowledgeBaseType',
-    }, //基础术语类型维护
-    {
-        path: 'LT-ZSKKZWH-JBXGWH',
-        component: AboutDisease,
-        name: 'AboutDisease',
-    }, //疾病相关维护
-    {
-        path: 'LT-ZSKKZWH-JBXGWH-EDIT',
-        component: DiseaseTree,
-        name: 'DiseaseTree',
-    }, //疾病相关维护, 
-    {
-        path: 'LT-YYSYZDHCS-ZSTPGZCS',
-        component: AutoKnowledgeMapRuleTest,
-        name: 'AutoKnowledgeMapRuleTest',
-    }, 
-    {
-        path: 'LT-YYSYZDHCS-ZSTPGZCS-TYGZCS',
-        component: AutoBillCommonTest,
-        name: 'AutoBillCommonTest',
+            {
+                path: 'LT-ZSKKZWH-JTXXWH',
+                component: StaticInfo,
+                name: 'StaticInfo',
+            },
+            {
+                path: 'LT-ZSKKZWH-JTXXWH-EDIT',
+                component: AddDevKnow,
+                name: 'AddDevKnow',
+            },
+            {
+                path: 'LT-ZSKKZWH-SXJGWH',
+                component: KnowledgeAll,
+                name: 'KnowledgeAll',
+            }, //树形结构维护
+            {
+                path: 'LT-ZSKJCWH-JCSYLXWH',
+                component: KnowledgeBaseType,
+                name: 'KnowledgeBaseType',
+            }, //基础术语类型维护
+            {
+                path: 'LT-ZSKKZWH-JBXGWH',
+                component: AboutDisease,
+                name: 'AboutDisease',
+            }, //疾病相关维护
+            {
+                path: 'LT-ZSKKZWH-JBXGWH-EDIT',
+                component: DiseaseTree,
+                name: 'DiseaseTree',
+            }, //疾病相关维护, 
+            {
+                path: 'LT-YYSYZDHCS-ZSTPGZCS',
+                component: AutoKnowledgeMapRuleTest,
+                name: 'AutoKnowledgeMapRuleTest',
+            },
+            {
+                path: 'LT-YYSYZDHCS-ZSTPGZCS-TYGZCS',
+                component: AutoBillCommonTest,
+                name: 'AutoBillCommonTest',
+            },
+            {
+                path: 'LT-ZSKKZWH-ZCYPWH',
+                component: ZskRegisteredDrug,
+                name: 'ZskRegisteredDrug',
+            },
+            {
+                path: 'LT-ZSKKZWH-TJZCYPWH',
+                component: AddZskRegisteredDrug,
+                name: 'AddZskRegisteredDrug',
+            },
+        ],
     },
-],
-},
 ];

+ 1 - 2
vue.config.js

@@ -1,5 +1,4 @@
 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:88';
 // const proxy_path = 'http://192.168.3.101:5050';
@@ -29,4 +28,4 @@ module.exports = {
       },
     },
   },
-};
+};

文件差异内容过多而无法显示
+ 8622 - 0
yarn.lock