Преглед изворни кода

Merge branch 'test' into dragTerm1025-zsw

zsw007 пре 3 година
родитељ
комит
d8547c0ded

+ 93 - 85
src/api/config.js

@@ -21,90 +21,98 @@ export default {
 
     'retrievalSearch': '/demo/retrieval/index', //术语检索
     'getLisMappingPage': '/tran/mappingConfig/getPage', //诊断列表
-    'diseaseIsExistRecord': '/tran/mappingConfig/isExistRecord', //诊断-映射关系是否已存在
-    'saveOrUpdateDiseaseRecord': '/tran/mappingConfig/saveOrUpdateRecord', //诊断-保存或修改映射关系
-    'deleteDiseaseRecord': '/tran/mappingConfig/deleteRecord', //诊断-删除映射关系
-    'exportDiseaseRecord': '/tran/mappingConfig/exportExcel', //诊断-数据导出
-    'importDiseaseRecord': '/tran/mappingConfig/importExcel', //诊断-数据导入
-    'exportDiseaseModule': '/tran/mappingConfig/exportExcelModule', //诊断-数据导入模板导出
-
-    'getLisPage': '/tran/mappingConfig/getPage', //检验列表
-    'lisIsExistRecord': '/tran/mappingConfig/isExistRecord', //检验-映射关系是否已存在
-    'saveOrUpdateLisRecord': '/tran/mappingConfig/saveOrUpdateRecord', //检验-保存或修改映射关系
-    'deleteLisRecord': '/tran/mappingConfig/deleteRecord', //检验-删除映射关系
-    'exportLisRecord': '/tran/mappingConfig/exportExcel', //检验-数据导出
-    'importLisRecord': '/tran/mappingConfig/importExcel', //检验-数据导入
-    'exportLisModule': '/tran/mappingConfig/exportExcelModule', //科室-数据导入模板导出
-
-    'getpacsPage': '/tran/mappingConfig/getPage', //检查列表
-    'pacsIsExistRecord': '/tran/mappingConfig/isExistRecord', //检查-映射关系是否已存在
-    'saveOrUpdatePacsRecord': '/tran/mappingConfig/saveOrUpdateRecord', //检查-保存或修改映射关系
-    'deletePacsRecord': '/tran/mappingConfig/deleteRecord', //检查-删除映射关系
-    'exportPacsRecord': '/tran/mappingConfig/exportExcel', //检查-数据导出
-    'importPacsRecord': '/tran/mappingConfig/importExcel', //检查-数据导入
-    'exportPacsModule': '/tran/mappingConfig/exportExcelModule', //科室-数据导入模板导出
-
-    'getDrugPage': '/tran/mappingConfig/getPage', //药品列表
-    'drugIsExistRecord': '/tran/mappingConfig/isExistRecord', //药品-映射关系是否已存在
-    'saveOrUpdateDrugRecord': '/tran/mappingConfig/saveOrUpdateRecord', //药品-保存或修改映射关系
-    'deleteDrugRecord': '/tran/mappingConfig/deleteRecord', //药品-删除映射关系
-    'exportDrugRecord': '/tran/mappingConfig/exportExcel', //药品-数据导出
-    'importDrugRecord': '/tran/mappingConfig/importExcel', //药品-数据导入
-    'exportDrugModule': '/tran/mappingConfig/exportExcelModule', //科室-数据导入模板导出
-
-    'getScalePageCDSS': '/tran/mappingConfig/getPage', //量表列表
-    'scaleIsExistRecordCDSS': '/tran/mappingConfig/isExistRecord', //量表-映射关系是否已存在
-    'saveOrUpdateScaleRecordCDSS': '/tran/mappingConfig/saveOrUpdateRecord', //量表-保存或修改映射关系
-    'deleteScaleRecordCDSS': '/tran/mappingConfig/deleteRecord', //量表-删除映射关系
-    'exportScaleRecordCDSS': '/tran/mappingConfig/exportExcel', //量表-数据导出
-    'importScaleRecordCDSS': '/tran/mappingConfig/importExcel', //量表-数据导入
-    'exportScaleModuleCDSS': '/tran/mappingConfig/exportExcelModule',
-
-
-    'getOperationPage': '/tran/mappingConfig/getPage', //手术/操作列表
-    'operationIsExistRecord': '/tran/mappingConfig/isExistRecord', //手术/操作-映射关系是否已存在
-    'saveOrUpdateOperationRecord': '/tran/mappingConfig/saveOrUpdateRecord', //手术/操作-保存或修改映射关系
-    'deleteOperationRecord': '/tran/mappingConfig/deleteRecord', //手术/操作-删除映射关系
-    'exportOperationRecord': '/tran/mappingConfig/exportExcel', //手术/操作-数据导出
-    'importOperationRecord': '/tran/mappingConfig/importExcel', //手术/操作-数据导入
-    'exportOperationModule': '/tran/mappingConfig/exportExcelModule', //科室-数据导入模板导出
-
-    'getFusionPage': '/tran/mappingConfig/getPage', //输血列表
-    'fusionIsExistRecord': '/tran/mappingConfig/isExistRecord', //输血-映射关系是否已存在
-    'saveOrUpdateFusionRecord': '/tran/mappingConfig/saveOrUpdateRecord', //输血-保存或修改映射关系
-    'deleteFusionRecord': '/tran/mappingConfig/deleteRecord', //输血-删除映射关系
-    'exportFusionRecord': '/tran/mappingConfig/exportExcel', //输血-数据导出
-    'importFusionRecord': '/tran/mappingConfig/importExcel', //输血-数据导入
-    'exportFusionModule': '/tran/mappingConfig/exportExcelModule', //科室-数据导入模板导出
-
-    'getDeptPage': '/tran/mappingConfig/getPage', //科室列表
-    'deptIsExistRecord': '/tran/mappingConfig/isExistRecord', //科室-映射关系是否已存在
-    'saveOrUpdateDeptRecord': '/tran/mappingConfig/saveOrUpdateRecord', //科室-保存或修改映射关系
-    'deleteDeptRecord': '/tran/mappingConfig/deleteRecord', //科室-删除映射关系
-    'exportDeptRecord': '/tran/mappingConfig/exportExcel', //科室-数据导出
-    'importDeptRecord': '/tran/mappingConfig/importExcel', //科室-数据导入
-    'exportDeptModule': '/tran/mappingConfig/exportExcelModule', //科室-数据导入模板导出
-
-
-    'getNursePage': '/tran/mappingConfig/getPage', //护理列表
-    'nurseIsExistRecord': '/tran/mappingConfig/isExistRecord', //护理-映射关系是否已存在
-    'saveOrUpdateRecord': '/tran/mappingConfig/saveOrUpdateRecord', //护理列表添加
-    'deleteNurseRecord': '/tran/mappingConfig/deleteRecord', //护理-删除映射关系
-    'exportNurseRecord': '/tran/mappingConfig/exportExcel', //护理-数据导出
-    'importNurseRecord': '/tran/mappingConfig/importExcel', //检验-数据导入
-    'exportNurseModule': '/tran/mappingConfig/exportExcelModule', //护理-数据导入模板导出
-
-    'getTcmdiseasePage': '/tran/mappingConfig/getPage', //中医疾病列表
-    'tcmIsExistRecord': '/tran/mappingConfig/isExistRecord', //中医疾病-映射关系是否已存在
-    'saveOrUpdateRecordTcm': '/tran/mappingConfig/saveOrUpdateRecord', //护理列表添加
-    'deleteTcmRecord': '/tran/mappingConfig/deleteRecord', //中医疾病-删除映射关系
-    'exportTcmRecord': '/tran/mappingConfig/exportExcel', //中医疾病-数据导出
-    'importTcmRecord': '/tran/mappingConfig/importExcel', //中医疾病-数据导入
-    'exportTcmModule': '/tran/mappingConfig/exportExcelModule', //护理-数据导入模板导出
-
-    'getTcmsyndromePage': '/tran/mappingConfig/getPage', //中医证候列表
-    'tcmdromeIsExistRecord': '/tran/mappingConfig/isExistRecord', //中医证候-映射关系是否已存在
-    'saveOrUpdateRecordTcmdrome': '/tran/mappingConfig/saveOrUpdateRecord', //中医证候列表添加
+    'diseaseIsExistRecord': '/tran/mappingConfig/isExistRecord',   //诊断-映射关系是否已存在
+    'saveOrUpdateDiseaseRecord': '/tran/mappingConfig/saveOrUpdateRecord',   //诊断-保存或修改映射关系
+    'deleteDiseaseRecord': '/tran/mappingConfig/deleteRecord',   //诊断-删除映射关系
+    'exportDiseaseRecord': '/tran/mappingConfig/exportExcel',   //诊断-数据导出
+    'importDiseaseRecord': '/tran/mappingConfig/importExcel',   //诊断-数据导入
+    'exportDiseaseModule': '/tran/mappingConfig/exportExcelModule',   //诊断-数据导入模板导出
+
+    'getLisPage': '/tran/mappingConfig/getPage',   //检验列表
+    'lisIsExistRecord': '/tran/mappingConfig/isExistRecord',   //检验-映射关系是否已存在
+    'saveOrUpdateLisRecord': '/tran/mappingConfig/saveOrUpdateRecord',   //检验-保存或修改映射关系
+    'deleteLisRecord': '/tran/mappingConfig/deleteRecord',   //检验-删除映射关系
+    'exportLisRecord': '/tran/mappingConfig/exportExcel',   //检验-数据导出
+    'importLisRecord': '/tran/mappingConfig/importExcel',   //检验-数据导入
+    'exportLisModule': '/tran/mappingConfig/exportExcelModule',   //科室-数据导入模板导出
+
+    'getpacsPage': '/tran/mappingConfig/getPage',   //检查列表
+    'pacsIsExistRecord': '/tran/mappingConfig/isExistRecord',   //检查-映射关系是否已存在
+    'saveOrUpdatePacsRecord': '/tran/mappingConfig/saveOrUpdateRecord',   //检查-保存或修改映射关系
+    'deletePacsRecord': '/tran/mappingConfig/deleteRecord',   //检查-删除映射关系
+    'exportPacsRecord': '/tran/mappingConfig/exportExcel',   //检查-数据导出
+    'importPacsRecord': '/tran/mappingConfig/importExcel',   //检查-数据导入
+    'exportPacsModule': '/tran/mappingConfig/exportExcelModule',   //科室-数据导入模板导出
+
+    'getDrugPage': '/tran/mappingConfig/getPage',   //药品列表
+    'drugIsExistRecord': '/tran/mappingConfig/isExistRecord',   //药品-映射关系是否已存在
+    'saveOrUpdateDrugRecord': '/tran/mappingConfig/saveOrUpdateRecord',   //药品-保存或修改映射关系
+    'deleteDrugRecord': '/tran/mappingConfig/deleteRecord',   //药品-删除映射关系
+    'exportDrugRecord': '/tran/mappingConfig/exportExcel',   //药品-数据导出
+    'importDrugRecord': '/tran/mappingConfig/importExcel',   //药品-数据导入
+    'exportDrugModule': '/tran/mappingConfig/exportExcelModule',   //科室-数据导入模板导出
+
+      'getScalePageCDSS': '/tran/mappingConfig/getPage',   //量表列表
+      'scaleIsExistRecordCDSS': '/tran/mappingConfig/isExistRecord',   //量表-映射关系是否已存在
+      'saveOrUpdateScaleRecordCDSS': '/tran/mappingConfig/saveOrUpdateRecord',   //量表-保存或修改映射关系
+      'deleteScaleRecordCDSS': '/tran/mappingConfig/deleteRecord',   //量表-删除映射关系
+      'exportScaleRecordCDSS': '/tran/mappingConfig/exportExcel',   //量表-数据导出
+      'importScaleRecordCDSS': '/tran/mappingConfig/importExcel',   //量表-数据导入
+      'exportScaleModuleCDSS': '/tran/mappingConfig/exportExcelModule',
+
+
+      'getOperationPage': '/tran/mappingConfig/getPage',   //手术/操作列表
+    'operationIsExistRecord': '/tran/mappingConfig/isExistRecord',   //手术/操作-映射关系是否已存在
+    'saveOrUpdateOperationRecord': '/tran/mappingConfig/saveOrUpdateRecord',   //手术/操作-保存或修改映射关系
+    'deleteOperationRecord': '/tran/mappingConfig/deleteRecord',   //手术/操作-删除映射关系
+    'exportOperationRecord': '/tran/mappingConfig/exportExcel',   //手术/操作-数据导出
+    'importOperationRecord': '/tran/mappingConfig/importExcel',   //手术/操作-数据导入
+    'exportOperationModule': '/tran/mappingConfig/exportExcelModule',   //科室-数据导入模板导出
+
+    'getFusionPage': '/tran/mappingConfig/getPage',   //输血列表
+    'fusionIsExistRecord': '/tran/mappingConfig/isExistRecord',   //输血-映射关系是否已存在
+    'saveOrUpdateFusionRecord': '/tran/mappingConfig/saveOrUpdateRecord',   //输血-保存或修改映射关系
+    'deleteFusionRecord': '/tran/mappingConfig/deleteRecord',   //输血-删除映射关系
+    'exportFusionRecord': '/tran/mappingConfig/exportExcel',   //输血-数据导出
+    'importFusionRecord': '/tran/mappingConfig/importExcel',   //输血-数据导入
+    'exportFusionModule': '/tran/mappingConfig/exportExcelModule',   //科室-数据导入模板导出
+
+    'getDeptPage': '/tran/mappingConfig/getPage',   //科室列表
+    'deptIsExistRecord': '/tran/mappingConfig/isExistRecord',   //科室-映射关系是否已存在
+    'saveOrUpdateDeptRecord': '/tran/mappingConfig/saveOrUpdateRecord',   //科室-保存或修改映射关系
+    'deleteDeptRecord': '/tran/mappingConfig/deleteRecord',   //科室-删除映射关系
+    'exportDeptRecord': '/tran/mappingConfig/exportExcel',   //科室-数据导出
+    'importDeptRecord': '/tran/mappingConfig/importExcel',   //科室-数据导入
+    'exportDeptModule': '/tran/mappingConfig/exportExcelModule',   //科室-数据导入模板导出
+
+
+    'getNursePage': '/tran/mappingConfig/getPage',   //护理列表
+    'nurseIsExistRecord': '/tran/mappingConfig/isExistRecord',   //护理-映射关系是否已存在
+    'saveOrUpdateRecord': '/tran/mappingConfig/saveOrUpdateRecord',   //护理列表添加
+    'deleteNurseRecord': '/tran/mappingConfig/deleteRecord',   //护理-删除映射关系
+    'exportNurseRecord': '/tran/mappingConfig/exportExcel',   //护理-数据导出
+    'importNurseRecord': '/tran/mappingConfig/importExcel',   //检验-数据导入
+    'exportNurseModule': '/tran/mappingConfig/exportExcelModule',   //护理-数据导入模板导出
+	
+	'getRoutePage': '/tran/mappingConfig/getPage',   //给药途径列表
+	'RouteIsExistRecord': '/tran/mappingConfig/isExistRecord',   //给药途径-映射关系是否已存在
+	'saveOrUpdateRecordRT': '/tran/mappingConfig/saveOrUpdateRecord',   //给药途径列表添加
+	'deleteRouteRecord': '/tran/mappingConfig/deleteRecord',   //给药途径-删除映射关系
+	'exportRouteRecord': '/tran/mappingConfig/exportExcel',   //给药途径-数据导出
+	'importRouteRecord': '/tran/mappingConfig/importExcel',   //给药途径-数据导入
+	'exportRouteModule': '/tran/mappingConfig/exportExcelModule',   //给药途径-数据导入模板导出
+
+    'getTcmdiseasePage': '/tran/mappingConfig/getPage',   //中医疾病列表
+    'tcmIsExistRecord': '/tran/mappingConfig/isExistRecord',   //中医疾病-映射关系是否已存在
+    'saveOrUpdateRecordTcm': '/tran/mappingConfig/saveOrUpdateRecord',   //护理列表添加
+    'deleteTcmRecord': '/tran/mappingConfig/deleteRecord',   //中医疾病-删除映射关系
+    'exportTcmRecord': '/tran/mappingConfig/exportExcel',   //中医疾病-数据导出
+    'importTcmRecord': '/tran/mappingConfig/importExcel',   //中医疾病-数据导入
+    'exportTcmModule': '/tran/mappingConfig/exportExcelModule',   //护理-数据导入模板导出
+
+    'getTcmsyndromePage': '/tran/mappingConfig/getPage',   //中医证候列表
+    'tcmdromeIsExistRecord': '/tran/mappingConfig/isExistRecord',   //中医证候-映射关系是否已存在
+    'saveOrUpdateRecordTcmdrome': '/tran/mappingConfig/saveOrUpdateRecord',   //中医证候列表添加
     'deleteTcmdromeRecord': '/tran/mappingConfig/deleteRecord',
     'exportTcmdromeRecord': '/tran/mappingConfig/exportExcel', //中医证候-数据导出
     'importTcmdromeRecord': '/tran/mappingConfig/importExcel', //中医证候-数据导入
@@ -112,7 +120,7 @@ export default {
 
     'precDiseaseDataMatch': '/tran/mappingConfig/precDataMatch',
     'dataDiseaseVerify': '/tran/mappingConfig/dataVerify',
-    'getRelatedMapping': '/tran/mappingConfig/getRelatedMapping', //查询映射关联
+    'getRelatedMapping': '/tran/mappingConfig/getRelatedMapping',//查询映射关联
     'getTermMatching': '/term/termMatching', //查询推荐匹配
 
 

+ 39 - 0
src/api/icss.js

@@ -319,6 +319,45 @@ export default {
     });
   },
   
+  
+  getRoutePage(param) {
+    //给药途径列表-列表
+    return axios.post(urls.getRoutePage, param);
+  },
+  saveOrUpdateRecordRT(param) {
+    //给药途径列表添加
+    return axios.post(urls.saveOrUpdateRecordRT, param);
+  },
+  RouteIsExistRecord(param) {
+    //给药途径-映射关系是否已存在
+    return axios.post(urls.RouteIsExistRecord, param);
+  },
+  deleteRouteRecord(param) {
+    //给药途径-删除
+  
+    return axios.post(urls.deleteRouteRecord, param);
+  },
+  exportRouteRecord(param) {
+    //给药途径-数据导出
+    return axios.post(urls.exportRouteRecord, param, {
+      responseType: 'blob',
+    });
+  },
+  importRouteRecord(param) {
+    //给药途径-数据导入
+    return axios.post(urls.importRouteRecord, param, {
+      responseType: 'blob',
+    });
+  },
+  exportRouteModule(param) {
+    //给药途径-数据导入模板导出
+    return axios.post(urls.exportRouteModule, param, {
+      responseType: 'blob',
+    });
+  },
+  
+  
+  
   getTcmdiseasePage(param) {
     //中医疾病列表-列表
     return axios.post(urls.getTcmdiseasePage, param);

+ 5 - 0
src/api/index.js

@@ -3,8 +3,13 @@ import config from './config.js';
 
 axios.default.timeout = 500000;
 axios.defaults.headers.post['Content-Type'] = "application/json;charset=utf-8";
+<<<<<<< HEAD
 //axios.defaults.baseURL = 'http://192.168.2.236:6060';
 axios.defaults.baseURL = 'http://192.168.2.241:84';
+=======
+axios.defaults.baseURL = 'http://192.168.2.236:6060';
+// axios.defaults.baseURL = 'http://192.168.2.241';
+>>>>>>> test
 // axios.defaults.baseURL = 'http://192.168.3.113:6060';
 
 

+ 43 - 3
src/components/common/HomePage.vue

@@ -1,6 +1,6 @@
 <template>
   <el-container :class="getRole">
-    <el-aside>
+    <el-aside v-show="onshow">
       <div class="logo">
         <p v-if="userLoginDTO&&userLoginDTO.type=='0'">
           <b>医院知识库后台管理系统</b>
@@ -12,6 +12,18 @@
         v-bind:data="menuWrappers"
       ></lt-menu>
     </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">
@@ -135,7 +147,7 @@ export default {
       isNewV: false,
       version: null, //版本信息接口返回的数据
       changePassWord: false,
-
+      onshow:true,
       ruleForm2: {
         pass: '',
         checkPass: '',
@@ -175,7 +187,16 @@ export default {
     //获取菜单
     this.getMenuList();
   },
-  mounted() {},
+  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';
+      })();
+    };
+  },
   watch: {
     $route: function(to, from) {
       if (from.name == 'login') {
@@ -189,6 +210,9 @@ export default {
     }
   },
   methods: {
+    collect() {
+      this.onshow = !this.onshow;
+    },
     CalcuMD5(password) {
       password = md5(password);
       return password;
@@ -324,6 +348,22 @@ export default {
 </style>
 <style lang="less" scoped>
 @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;
+}
 .el-menu-vertical-demo.el-menu {
   height: calc(100% - 120px);
   overflow-y: auto;

+ 2 - 2
src/components/icss/bill/Bill.vue

@@ -231,8 +231,8 @@ export default {
       const param = {
         number: this.inCurrentPage - 1 || this.currentPage - 1,
         size: this.pageSize,
-        conditionName: this.filter.conditionName.trim(),
-        conceptName: this.filter.conceptName.trim(),
+        conditionName: this.filter.conditionName.trim().replace(/%/g,"\\%").replace(/_/g,"\\_"),
+        conceptName: this.filter.conceptName.trim().replace(/%/g,"\\%").replace(/_/g,"\\_"),
         relationStatus: this.filter.relationStatus
         // uniqueCode: ''
       };

+ 2 - 2
src/components/icss/dept/DeptManage.vue

@@ -266,8 +266,8 @@ export default {
       const param = {
         current: this.inCurrentPage || this.currentPage,
         size: this.pageSize,
-        hisName: this.filter.hisName.trim(),
-        uniqueName: this.filter.uniqueName.trim(),
+        hisName: this.filter.hisName.trim().replace(/%/g,"\\%").replace(/_/g,"\\_"),
+        uniqueName: this.filter.uniqueName.trim().replace(/%/g,"\\%").replace(/_/g,"\\_"),
         uniqueCode: '',
         type: 7,
         isMatch: this.filter.match,

+ 2 - 2
src/components/icss/disease/ChemicalAndCommonMapping.vue

@@ -267,8 +267,8 @@ export default {
       const param = {
         current: this.inCurrentPage || this.currentPage,
         size: this.pageSize,
-        hisName: this.filter.hisName.trim(),
-        uniqueName: this.filter.uniqueName.trim(),
+        hisName: this.filter.hisName.trim().replace(/%/g,"\\%").replace(/_/g,"\\_"),
+        uniqueName: this.filter.uniqueName.trim().replace(/%/g,"\\%").replace(/_/g,"\\_"),
         icdCode: '',
         type: 4,
         isMatch: this.filter.match,

+ 2 - 2
src/components/icss/drug/DrugManage.vue

@@ -368,8 +368,8 @@ export default {
       const param = {
         current: this.inCurrentPage || this.currentPage,
         size: this.pageSize,
-        hisName: this.filter.hisName.trim(),
-        uniqueName: this.filter.uniqueName.trim(),
+        hisName: this.filter.hisName.trim().replace(/%/g,"\\%").replace(/_/g,"\\_"),
+        uniqueName: this.filter.uniqueName.trim().replace(/%/g,"\\%").replace(/_/g,"\\_"),
         uniqueCode: "",
         type: 5,
         isMatch: this.filter.match,

+ 428 - 0
src/components/icss/drugroute/AddDrugroute.vue

@@ -0,0 +1,428 @@
+<<template>
+  <div class="AddChemicalAndCommonMappingWrapper clearfix">
+    <crumbs
+      :title="isEdit ? '给药途径关联维护--修改关联' : '给药途径关联维护--添加关联'"
+      class="topBack"
+      :param="$route.params"
+      linkTo="Drugroute"
+    ></crumbs>
+    <el-form
+      :model="form"
+      :rules="rules"
+      label-position="right"
+      label-width="120px"
+      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.name"
+                    :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-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/icss.js';
+export default {
+  name: 'AddDept',
+  data() {
+    return {
+      isEdit: false,
+      editId: '',
+      uniqueNameList: [],
+      form: {
+        searchText: '', //搜索字段
+        hisName: '',
+      },
+      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 } = this.$route.params;
+    // console.log(data, 'data');
+    if (isEdit) {
+      this.isEdit = isEdit;
+      this.editId = data.id;
+      this.form.hisName = data.hisName;
+      this.form.searchText = data.uniqueName;
+    }
+  },
+  methods: {
+    // 搜索列表
+    searchTerms(query) {
+      if (!query) {
+        this.uniqueNameList = [];
+        return;
+      }
+      this.searchInfo = query;
+      this.showDrop = true;
+      let params = {
+        type: 16, 
+        inputStr: query,
+        sex: 3,
+        age: 0
+      };
+      api.retrievalSearch(params).then(res => {
+		  console.log(res)
+        this.showDrop = false;
+        if (res.data.code === '0') {
+          this.uniqueNameList = res.data.data.nameList;
+        }
+      });
+    },
+    changeWord(newVal) {
+      console.log(newVal);
+    },
+    handleVisible(flag) {
+      if (!flag) {
+        this.uniqueNameList = [];
+      }
+    },
+
+    // 初始化表单数据
+    initForm() {
+      this.form.hisName = '';
+      this.form.searchText = '';
+    },
+
+    // 建立关联-参数处理
+    submitForm() {
+      this.$refs.relationForm.validate(valid => {
+        if (valid) {
+          const { searchText, hisName } = this.form;
+          let params = {
+            hisName: hisName,
+            uniqueName: searchText,
+          };
+          this.showSaveDialog(params);
+        } else {
+          console.log('error submit!!');
+          return false;
+        }
+      });
+    },
+    // 建立关联-映射关系是否已存在
+    showSaveDialog(params) {
+      this.saveDisable = true; //提交保存按钮不可点击,返回结果时才可点击,防止频繁发送请求
+      api
+        .RouteIsExistRecord(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.saveOrUpdateRecord(params).then(res => {
+		  console.log(res)
+        if (res.data.code === '0') {
+          this.warning(res.data.msg || msg, type);
+          this.initForm();
+          this.$router.push({
+            name: 'Drugroute',
+            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>
+>

+ 690 - 0
src/components/icss/drugroute/Drugroute.vue

@@ -0,0 +1,690 @@
+<template>
+  <div>
+    <crumbs title="给药途径关联维护" style="min-width: 980px" class="knowledgeTitle">
+      <el-form :inline="true" class="demo-form-inline">
+        <el-form-item class="selectMedicine" label="标准术语状态:">
+          <el-select size="mini" v-model="filter.status" placeholder="请选择" clearable>
+            <el-option
+              v-for="item in statusList"
+              :label="item.name"
+              :value="item.id"
+              :key="item.id"
+            ></el-option>
+          </el-select>
+        </el-form-item>
+        <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.id" :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>
+        <el-form-item label="标准给药途径名称:">
+          <el-input size="mini" v-model="filter.uniqueName" placeholder="请输入" clearable></el-input>
+        </el-form-item>
+        <el-form-item>
+          <el-button size="mini" @click="filterDatas">检索</el-button>
+        </el-form-item>
+      </el-form>
+      <el-form class="secLine" :inline="true">
+        <el-form-item>
+          <el-button type="text" class="downTemplate" @click="exportModule">导入模板下载</el-button>
+          <input type="file" name="uploadfile " id="upFile" @change="uploadFile($event)" />
+          <!-- accept=".csv, application/vnd.ms-excel, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet" -->
+          <el-button size="mini" @click="handleMatchData">预匹配</el-button>
+          <el-button size="mini" @click="importPage" style="margin:0 10px">{{uploadInfo}}</el-button>
+          <input type="file" name="uploadfile " id="upFileMatch" @change="uploadFileMatch($event)" />
+          <el-button size="mini" @click="exportData">导出</el-button>
+        </el-form-item>
+        <el-form-item>
+          <el-button size="mini" type="warning" @click="addRelation">添加关联</el-button>
+        </el-form-item>
+      </el-form>
+    </crumbs>
+    <div class="contents knowledgeContents">
+      <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="uniqueName" label="标准给药途径名称" show-overflow-tooltip></el-table-column>
+        <el-table-column :resizable="false" prop="operate" label="标准术语状态">
+          <template slot-scope="scope">
+            <span
+              v-if="scope.row.uniqueName && scope.row.uniqueName!=''"
+            >{{scope.row.status == 0?'禁用':'启用'}}</span>
+          </template>
+        </el-table-column>
+        <el-table-column :resizable="false" prop="operate" label="匹配状态">
+          <template slot-scope="scope">
+            <span>{{scope.row.isMatch == 0?'未匹配':'已匹配'}}</span>
+          </template>
+        </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>
+
+    <LtModal
+      v-if="modalVisiable"
+      @func="getMsgFormSon"
+      :meal="'给药途径名称'"
+      :standard="'给药途径名称'"
+      :tip="'给药途径关联'"
+      :type="16"
+      :data="data"
+    ></LtModal>
+  </div>
+</template>
+
+<script>
+import api from '@api/icss.js';
+import config from '@api/config.js';
+import utils from '@api/utils.js';
+import LtModal from '@components/common/LtModal';
+export default {
+  name: 'provide',
+  data: function() {
+    return {
+      list: [],
+      searched: false,
+      matchList: [
+        { id: '', name: '全部' },
+        { id: 1, name: '已匹配' },
+        { id: 0, name: '未匹配' },
+        { id: 2, name: '多项匹配' }
+      ],
+      statusList: [
+        { id: '', name: '全部' },
+        { id: 1, name: '启用' },
+        { id: 0, name: '禁用' }
+      ],
+      filter: {
+        hisName: '', // 医院诊断名称
+        uniqueName: '', //标准诊断名称
+        match: '',
+        status: ''
+      },
+      currentPage: 1,
+      pageSize: config.pageSize,
+      pageSizeArr: config.pageSizeArr,
+      pageLayout: config.pageLayout,
+      total: 0,
+      fileName: '',
+      formData: {},
+      headers: {},
+      uploadInfo: '导入',
+      modalVisiable: false,
+      data: {}
+    };
+  },
+  components: {
+    LtModal
+  },
+  created() {
+    const param = this.$route.params;
+    if (param.currentPage) {
+      this.inCurrentPage = param.currentPage;
+    }
+    if (param.filter) {
+      this.filter = param.filter;
+    }
+    //返回时避免参数未赋值就获取列表
+    setTimeout(() => {
+      this.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
+    }
+  },
+  methods: {
+    // 预匹配
+    handleMatchData() {
+      let inp = document.getElementById('upFileMatch');
+      inp.click();
+    },
+    // 导入数据
+    uploadFileMatch(e) {
+      let fileInfo = e.target.files[0];
+      let extend = fileInfo.name.substring(fileInfo.name.lastIndexOf('.') + 1);
+      if (extend != 'xls' && extend != 'xlsx') {
+        this.$message({ message: '请根据模板进行导入', type: 'error' });
+        return;
+      }
+      e.preventDefault();
+      let formData = new FormData();
+      formData.append('file', fileInfo);
+      formData.append('type', 16);
+      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.dataDiseaseVerify(formData, header).then(res => {
+        if (res.data.code === '00020007' || res.data.code === '00020004') {
+          loading.close();
+          this.$alert(`${res.data.msg}`, '提示', {
+            confirmButtonText: '确定',
+            type: 'warning'
+          })
+            .then(() => {})
+            .catch(() => {});
+        } else {
+          api.precDiseaseDataMatch(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.getRoutePage(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) {
+      //翻页时筛选条件没点确定则清空
+      if (isTurnPage && !this.searched) {
+        this.clearFilter();
+      }
+      const param = {
+        current: this.inCurrentPage || this.currentPage,
+        size: this.pageSize,
+        hisName: this.filter.hisName.trim().replace(/%/g,"\\%").replace(/_/g,"\\_"),
+        uniqueName: this.filter.uniqueName.trim().replace(/%/g,"\\%").replace(/_/g,"\\_"),
+        uniqueCode: '',
+        type: 16,
+        isMatch: this.filter.match,
+        status: this.filter.status
+      };
+      return param;
+    },
+
+    filterDatas() {
+      this.currentPage = 1;
+      this.getDataList();
+    },
+    addRelation() {
+      const pam = this.searched
+        ? {
+            currentPage: this.currentPage,
+            pageSize: this.pageSize,
+            filter: this.filter
+          }
+        : { currentPage: this.currentPage, pageSize: this.pageSize };
+      // this.$router.push({ name: 'AddDrugroute', params: pam });
+      this.data = {};
+      this.showModal();
+    },
+    // 修改诊断关联-跳转至编辑页面
+    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: 'AddDrugroute',
+      //   params: Object.assign(pam, { isEdit: true, data: item })
+      // });
+      this.data = item;
+      this.showModal();
+    },
+    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.$confirm(msg, '提示', {
+        confirmButtonText: '删除',
+        cancelButtonText: '取消',
+        cancelButtonClass: 'cancelBtn',
+        confirmButtonClass: 'confirmC',
+        type: 'warning'
+      })
+        .then(() => {
+          resolve();
+        })
+        .catch(() => {});
+    },
+    // 删除关联
+    showDelDialog(id) {
+      this.showConfirmDialog('是否删除该关联?', () => {
+        api
+          .deleteRouteRecord({ 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.$confirm('确定要导出全部给药途径关联数据吗?', '', {
+        confirmButtonText: '确定',
+        cancelButtonText: '取消',
+        cancelButtonClass: 'leftbtn',
+        customClass: 'exportBox6',
+        title: '提示',
+        type: 'warning'
+        // beforeClose: (action, instance, done) => {
+        //   if (action === 'confirm') {
+        //     // instance.confirmButtonLoading = true;
+        //     // instance.confirmButtonText = '导出中...';
+        //     done()
+        //     api.exportDeptRecord().then(res => {
+        //       if (res.status === 200) {
+        //         setTimeout(() => {
+        //           utils.downloadExportedData(res.data, '科室关联数据.xls');
+        //           // done();
+        //         }, 1500);
+        //       }
+        //     });
+        //   } else {
+        //     done();
+        //   }
+        // }
+      })
+        .then(() => {
+          api
+            .exportRouteRecord({ type: 16, isMatch: this.filter.match })//修改接口
+            .then(res => {
+			console.log(res)
+              if (res.status === 200) {
+                this.$message({ message: '导出成功', type: 'success' });
+                utils.downloadExportedData(res.data, '给药途径关联数据.xls');
+              }
+            });
+        })
+        .catch(() => {});
+    },
+
+    // 导入模板
+    exportModule() {
+      api.exportRouteModule({ type: 16 }).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];
+      let extend = fileInfo.name.substring(fileInfo.name.lastIndexOf('.') + 1);
+      if (extend != 'xls' && extend != 'xlsx') {
+        this.$message({ message: '请根据模板进行导入', type: 'error' });
+        return;
+      }
+      // this.fileName = e.target.files[0].name; // 表单同步显示
+      e.preventDefault();
+      let formData = new FormData();
+      formData.append('file', fileInfo);
+      formData.append('type', 16);
+      formData.append('uesrId', localStorage.getItem('uesrId'));
+      formData.append(
+        'hospitalId',
+        JSON.parse(localStorage.getItem('hospitalLoginDTO')).id
+      );
+      const header = {
+        headers: {
+          'Content-Type': 'multipart/form-data'
+        }
+      };
+      this.importRouteRecord(formData, header);//修改接口
+      // this.uploadInfo = '导入中...';
+      // api.importExcelDataVerify(formData, header).then(res => {
+      //   if (res.data.code === '00020001') {
+      //     this.$confirm(`${res.data.msg}`, '提示', {
+      //       confirmButtonText: '确定',
+      //       cancelButtonText: '取消',
+      //       type: 'warning'
+      //     })
+      //       .then(() => {
+      //         this.importRouteRecord(formData, header);
+      //       })
+      //       .catch(() => {
+      //         setTimeout(() => {
+      //           this.uploadInfo = '导入';
+      //         }, 300);
+      //       });
+      //   } else if (res.data.data === true) {
+      //     this.importRouteRecord(formData, header);
+      //   }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 = '';
+    },
+    importRouteRecord(formData, header) {//改名字
+      let that = this;
+      api.importRouteRecord(formData, header).then(res => {//修改接口
+        if (res.headers['content-disposition']) {
+          this.downloadUrl(res);
+          this.getDataList();
+        } else {
+          let r = new FileReader();
+          r.onload = function() {
+            if (this.result) {
+              const code = JSON.parse(this.result);
+              if (code.code === '00020004' || code.code === '00020007') {
+                that
+                  .$alert(`${code.msg}`, '提示', {
+                    confirmButtonText: '确定',
+                    // cancelButtonText: '取消',
+                    // cancelButtonClass: 'cancelSure',
+                    // confirmButtonClass: 'sure',
+                    // customClass: 'exportConfirm',
+                    type: 'warning'
+                  })
+                  .then(() => {})
+                  .catch(() => {});
+              }
+            } else {
+              that.$alert(`导入成功`, '提示', {
+                confirmButtonText: '确定',
+                // cancelButtonText: '取消',
+                // cancelButtonClass: 'cancelSure',
+                // confirmButtonClass: 'sure',
+                // customClass: 'exportConfirm',
+                type: 'success'
+              });
+              that.getDataList();
+            }
+          };
+          r.readAsText(res.data);
+        }
+        // if (res.data.code === '00000001') {
+        //   this.$confirm(`医院术语字符数超出最大数量,请修改后再试`, '提示', {
+        //     confirmButtonText: '确定',
+        //     // cancelButtonText: '取消',
+        //     cancelButtonClass: 'cancelSure',
+        //     confirmButtonClass: 'sure',
+        //     customClass: 'exportConfirm',
+        //     type: 'warning'
+        //   })
+        //     .then(() => {})
+        //     .catch(() => {});
+        //   this.getDataList(); // 重新获取列表
+        //   setTimeout(() => {
+        //     this.uploadInfo = '导入';
+        //   }, 300);
+        // } else if (res.data.data === true && res.status === 200) {
+        //   this.$confirm(`导入成功`, '提示', {
+        //     confirmButtonText: '确定',
+        //     // cancelButtonText: '取消',
+        //     cancelButtonClass: 'cancelSure',
+        //     confirmButtonClass: 'sure',
+        //     customClass: 'exportConfirm',
+        //     type: 'success'
+        //   })
+        //     .then(() => {})
+        //     .catch(() => {});
+        //   this.getDataList(); // 重新获取列表
+        //   setTimeout(() => {
+        //     this.uploadInfo = '导入';
+        //   }, 300);
+        // } else {
+        //   this.$confirm(`${res.data.msg}`, '提示', {
+        //     confirmButtonText: '确定',
+        //     // cancelButtonText: '取消',
+        //     cancelButtonClass: 'cancelSure',
+        //     confirmButtonClass: 'sure',
+        //     customClass: 'exportConfirm',
+        //     type: 'warning'
+        //   })
+        //     .then(() => {})
+        //     .catch(() => {});
+
+        //   setTimeout(() => {
+        //     this.uploadInfo = '导入';
+        //   }, 300);
+        // }
+      });
+    },
+    downloadUrl(res) {
+      var disposition = res.headers['content-disposition'];
+      var fileName = decodeURI(
+        disposition.split('filename=')[1].split(';filename*=')[0]
+      );
+      let blob = new Blob([res.data], { type: 'application/.xls' }); //.xls是我和后台约定好的文件格式
+      let link = document.createElement('a');
+      link.href = window.URL.createObjectURL(blob);
+      link.download = fileName;
+      link.click();
+      link.remove();
+    },
+    /********新增编辑弹窗**********/
+    showModal() {
+      this.modalVisiable = true;
+    },
+    getMsgFormSon(data) {
+      if (data == 'close') {
+        this.modalVisiable = false;
+      } else {
+        this.modalVisiable = false;
+        this.getDataList();
+      }
+    }
+  }
+};
+</script>
+
+
+<style lang="less" scoped>
+@import '../../../less/admin.less';
+/deep/ .container.knowledgeTitle {
+  height: 80px;
+}
+/deep/ .contents.knowledgeContents {
+  padding: 104px 20px 0;
+}
+/deep/ .secLine.el-form {
+  float: right;
+  display: block;
+  position: relative;
+  top: -5px;
+}
+.delete {
+  color: red;
+}
+.delete:hover {
+  color: red;
+}
+.pagination {
+  min-width: 1010px;
+}
+.downTemplate {
+  margin-right: 8px;
+  span {
+    color: #02a7f0;
+  }
+}
+#upFile {
+  display: none !important;
+}
+.el-message-box {
+  /deep/.cancelBtn {
+    background-color: #d7d7d7;
+    border-color: transparent;
+  }
+  /deep/.confirmC {
+    background-color: #ff545b !important;
+    border-color: transparent !important;
+  }
+  /deep/.el-message-box__header {
+    border-bottom: 1px solid #dcdfe6;
+  }
+}
+.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;
+  }
+}
+.exportConfirm {
+  .cancelSure {
+    display: none;
+  }
+}
+#upFileMatch {
+  display: none;
+}
+</style>

+ 2 - 2
src/components/icss/fusion/Fusion.vue

@@ -259,8 +259,8 @@ export default {
       const param = {
         current: this.inCurrentPage || this.currentPage,
         size: this.pageSize,
-        hisName: this.filter.hisName.trim(),
-        uniqueName: this.filter.uniqueName.trim(),
+        hisName: this.filter.hisName.trim().replace(/%/g,"\\%").replace(/_/g,"\\_"),
+        uniqueName: this.filter.uniqueName.trim().replace(/%/g,"\\%").replace(/_/g,"\\_"),
         uniqueCode: '',
         type: 8,
         isMatch: this.filter.match,

+ 403 - 0
src/components/icss/hemp/AddHemp.vue

@@ -1,3 +1,4 @@
+<<<<<<< .mine
 <template>
   <div class="AddChemicalAndCommonMappingWrapper clearfix">
     <crumbs
@@ -398,3 +399,405 @@ export default {
   }
 }
 </style>
+=======
+<template>
+  <div class="AddChemicalAndCommonMappingWrapper clearfix">
+    <crumbs
+      :title="isEdit ? '麻醉关联维护--修改关联' : '麻醉关联维护--添加关联'"
+      class="topBack"
+      :param="$route.params"
+      linkTo="Fusion"
+    ></crumbs>
+    <el-form
+      :model="form"
+      :rules="rules"
+      label-position="right"
+      label-width="120px"
+      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"
+                  @focus="handleFocus"
+                  @visible-change="handleVisible"
+                  placeholder="搜索"
+                  :remote-method="searchTerms"
+                  reserve-keyword
+                >
+                  <el-option
+                    v-for="(item,idx) in uniqueNameList"
+                    :key="idx"
+                    :label="item"
+                    :value="item"
+                    :title="item"
+                  ></el-option>
+                </el-select>
+              </el-form-item>
+              <el-form-item label="麻醉类型预览:">
+                <span class="previewInfo" style="minWidth: 240px">{{form.searchText}}</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/icss.js';
+export default {
+  name: 'AddFusion',
+  data() {
+    return {
+      isEdit: false,
+      editId: '',
+      uniqueNameList: [],
+      form: {
+        searchText: '', //搜索字段
+        hisName: ''
+      },
+      rules: {
+        hisName: [
+          { required: true, message: '请输入麻醉类型', trigger: 'change' },
+          { max: 80, message: '麻醉类型最多80字', trigger: 'change' }
+        ],
+        searchText: [
+          { required: true, message: '请选择麻醉类型', trigger: 'change' }
+        ]
+      },
+      saveDisable: false, //保存按钮禁止点击
+      showDrop: false //下拉框显示文字
+    };
+  },
+  created() {
+    //修改
+    const { isEdit, data } = this.$route.params;
+    if (isEdit) {
+      this.isEdit = isEdit;
+      this.editId = data.id;
+      this.form.hisName = data.hisName;
+      this.form.searchText = data.uniqueName;
+    }
+  },
+  methods: {
+    // 搜索列表
+    searchTerms(query) {
+      if (!query) {
+        this.uniqueNameList = [];
+        return;
+      }
+      this.showDrop = true;
+      let params = {
+        type: 14, //麻醉
+        inputStr: query,
+        sex: 3,
+        age: 0
+      };
+      api.retrievalSearch(params).then(res => {
+        this.showDrop = false;
+        if (res.data.code === '0') {
+          this.uniqueNameList = res.data.data.transfusionNames;
+        }
+      });
+    },
+    changeWord() {},
+    // 获取焦点
+    handleFocus() {},
+    handleVisible(flag) {
+      if (!flag) {
+        this.uniqueNameList = [];
+      }
+    },
+    // 初始化表单数据
+    initForm() {
+      this.form.hisName = '';
+      this.form.searchText = '';
+    },
+
+    // 建立关联-参数处理
+    submitForm() {
+      this.$refs.relationForm.validate(valid => {
+        if (valid) {
+          const { searchText, hisName } = this.form;
+          let params = {
+            hisName: hisName,
+            uniqueName: searchText
+          };
+          this.showSaveDialog(params);
+        } else {
+          console.log('error submit!!');
+          return false;
+        }
+      });
+    },
+    // 建立关联-映射关系是否已存在
+    showSaveDialog(params) {
+      this.saveDisable = true; //提交保存按钮不可点击,返回结果时才可点击,防止频繁发送请求
+      api
+        .fusionIsExistRecord(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.saveOrUpdateFusionRecord(params).then(res => {
+        if (res.data.code === '0') {
+          this.warning(res.data.msg || msg, type);
+          this.initForm();
+          this.$router.push({
+            name: 'Fusion',
+            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;
+    }
+  }
+}
+</style>
+>>>>>>> .theirs

+ 685 - 6
src/components/icss/hemp/Hemp.vue

@@ -1,3 +1,4 @@
+<<<<<<< .mine
 <template>
   <div>
     <crumbs title="麻醉关联维护" style="min-width: 980px" class="knowledgeTitle">
@@ -209,7 +210,7 @@ export default {
             if (res.status === 200) {
               utils.downloadExportedData(
                 res.data,
-                '输血关联数据(预匹配).xls'
+                '麻醉关联数据(预匹配).xls'
               );
             }
           });
@@ -381,7 +382,7 @@ export default {
 
     // 导出数据
     exportData() {
-      this.$confirm('确定要导出全部输血关联数据吗?', '', {
+      this.$confirm('确定要导出全部麻醉关联数据吗?', '', {
         confirmButtonText: '确定',
         cancelButtonText: '取消',
         cancelButtonClass: 'leftbtn',
@@ -395,7 +396,7 @@ export default {
         //     api.exportFusionRecord().then(res => {
         //       if (res.status === 200) {
         //         setTimeout(() => {
-        //           utils.downloadExportedData(res.data, '输血关联数据.xls');
+        //           utils.downloadExportedData(res.data, '麻醉关联数据.xls');
         //           done();
         //         }, 1500);
         //       }
@@ -411,7 +412,7 @@ export default {
             .then(res => {
               if (res.status === 200) {
                 this.$message({ message: '导出成功', type: 'success' });
-                utils.downloadExportedData(res.data, '输血关联数据.xls');
+                utils.downloadExportedData(res.data, '麻醉关联数据.xls');
               }
             });
         })
@@ -424,7 +425,7 @@ export default {
       api.exportFusionModule({ type: 14 }).then(res => {
         if (res.status === 200) {
           setTimeout(() => {
-            utils.downloadExportedData(res.data, '输血导入模板.xls');
+            utils.downloadExportedData(res.data, '麻醉导入模板.xls');
           }, 1500);
         }
       });
@@ -673,4 +674,682 @@ export default {
 #upFileMatch {
   display: none;
 }
-</style>
+</style>
+=======
+<template>
+  <div>
+    <crumbs title="麻醉关联维护" style="min-width: 980px" class="knowledgeTitle">
+      <el-form :inline="true" class="demo-form-inline">
+        <el-form-item class="selectMedicine" label="标准术语状态:">
+          <el-select size="mini" v-model="filter.status" placeholder="请选择">
+            <el-option
+              v-for="item in statusList"
+              :label="item.name"
+              :value="item.id"
+              :key="item.id"
+            ></el-option>
+          </el-select>
+        </el-form-item>
+        <el-form-item label="匹配状态:" class="selectMedicine">
+          <el-select size="mini" v-model="filter.match" placeholder="请选择">
+            <el-option v-for="item in matchList" :label="item.name" :value="item.id" :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>
+        <el-form-item label="标准麻醉名称:">
+          <el-input size="mini" v-model="filter.uniqueName" placeholder="请输入" clearable></el-input>
+        </el-form-item>
+        <el-form-item>
+          <el-button size="mini" @click="filterDatas">检索</el-button>
+        </el-form-item>
+      </el-form>
+      <el-form class="secLine" :inline="true">
+        <el-form-item>
+          <el-button type="text" class="downTemplate" @click="exportModule">导入模板下载</el-button>
+          <input type="file" name="uploadfile " id="upFile" @change="uploadFile($event)" />
+          <!-- accept=".csv, application/vnd.ms-excel, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet" -->
+          <el-button size="mini" @click="handleMatchData">预匹配</el-button>
+
+          <el-button size="mini" @click="importPage" style="margin:0 10px">{{uploadInfo}}</el-button>
+          <input type="file" name="uploadfile " id="upFileMatch" @change="uploadFileMatch($event)" />
+          <el-button size="mini" @click="exportData">导出</el-button>
+        </el-form-item>
+        <el-form-item>
+          <el-button size="mini" type="warning" @click="addRelation">添加关联</el-button>
+        </el-form-item>
+      </el-form>
+    </crumbs>
+    <div class="contents knowledgeContents">
+      <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="uniqueName" label="标准麻醉名称" show-overflow-tooltip></el-table-column>
+        <el-table-column :resizable="false" prop="operate" label="标准术语状态">
+          <template slot-scope="scope">
+            <span
+              v-if="scope.row.uniqueName && scope.row.uniqueName!=''"
+            >{{scope.row.status == 0?'禁用':'启用'}}</span>
+          </template>
+        </el-table-column>
+        <el-table-column :resizable="false" prop="operate" label="匹配状态">
+          <template slot-scope="scope">
+            <span>{{scope.row.isMatch == 0?'未匹配':'已匹配'}}</span>
+          </template>
+        </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>
+    <LtModal
+      v-if="modalVisiable"
+      @func="getMsgFormSon"
+      :meal="'麻醉类型'"
+      :standard="'麻醉类型'"
+      :tip="'麻醉关联'"
+      :type="14"
+      :data="data"
+    ></LtModal>
+  </div>
+</template>
+
+<script>
+import api from '@api/icss.js';
+import config from '@api/config.js';
+import utils from '@api/utils.js';
+import LtModal from '@components/common/LtModal';
+export default {
+  name: 'Fusion', //化验大小项和公表维护
+  data: function() {
+    return {
+      list: [],
+      matchList: [
+        { id: '', name: '全部' },
+        { id: 1, name: '已匹配' },
+        { id: 0, name: '未匹配' },
+        { id: 2, name: '多项匹配' }
+      ],
+      statusList: [
+        { id: '', name: '全部' },
+        { id: 1, name: '启用' },
+        { id: 0, name: '禁用' }
+      ],
+      searched: false,
+      filter: {
+        hisName: '', // 医院诊断名称
+        uniqueName: '', //标准诊断名称
+        match: '',
+        status: ''
+      },
+      currentPage: 1,
+      pageSize: config.pageSize,
+      pageSizeArr: config.pageSizeArr,
+      pageLayout: config.pageLayout,
+      total: 0,
+      uploadInfo: '导入',
+      modalVisiable: false,
+      data: {}
+    };
+  },
+  components: {
+    LtModal
+  },
+  created() {
+    const param = this.$route.params;
+    if (param.currentPage) {
+      this.inCurrentPage = param.currentPage;
+    }
+    if (param.filter) {
+      this.filter = param.filter;
+    }
+    //返回时避免参数未赋值就获取列表
+    setTimeout(() => {
+      this.getDataList();
+    });
+  },
+  watch: {
+    filter: {
+      handler: function() {
+        this.searched = false;
+      },
+      deep: true
+    }
+  },
+
+  methods: {
+    // 预匹配
+    handleMatchData() {
+      let inp = document.getElementById('upFileMatch');
+      inp.click();
+    },
+
+    // 导入数据
+    uploadFileMatch(e) {
+      let fileInfo = e.target.files[0];
+      let extend = fileInfo.name.substring(fileInfo.name.lastIndexOf('.') + 1);
+      if (extend != 'xls' && extend != 'xlsx') {
+        this.$message({ message: '请根据模板进行导入', type: 'error' });
+        return;
+      }
+      e.preventDefault();
+      let formData = new FormData();
+      formData.append('file', fileInfo);
+      formData.append('type', 14);
+      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.dataDiseaseVerify(formData, header).then(res => {
+        if (res.data.code === '00020007' || res.data.code === '00020004') {
+          loading.close();
+          this.$alert(`${res.data.msg}`, '提示', {
+            confirmButtonText: '确定',
+            type: 'warning'
+          })
+            .then(() => {})
+            .catch(() => {})
+        } else {
+          api.precDiseaseDataMatch(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.getFusionPage(params).then(res => {
+        loading.close();
+        if (res.data.code === '0') {
+          this.list = res.data.data && res.data.data.records;
+          console.log('麻醉列表数据:', this.list);
+        }
+        this.total = res.data.data && res.data.data.total;
+        if (this.inCurrentPage !== undefined) {
+          this.currentPage = this.inCurrentPage;
+          this.inCurrentPage = undefined;
+        }
+      });
+    },
+
+    // 处理列表请求数据参数
+    getFilterItems(isTurnPage) {
+      //翻页时筛选条件没点确定则清空
+      if (isTurnPage && !this.searched) {
+        this.clearFilter();
+      }
+      const param = {
+        current: this.inCurrentPage || this.currentPage,
+        size: this.pageSize,
+        hisName: this.filter.hisName.trim().replace(/%/g,"\\%").replace(/_/g,"\\_"),
+        uniqueName: this.filter.uniqueName.trim().replace(/%/g,"\\%").replace(/_/g,"\\_"),
+        uniqueCode: '',
+        type: 14,
+        isMatch: this.filter.match,
+        status: this.filter.status
+      };
+      return param;
+    },
+
+    filterDatas() {
+      this.currentPage = 1;
+      this.getDataList();
+    },
+    addRelation() {
+      const pam = this.searched
+        ? {
+            currentPage: this.currentPage,
+            pageSize: this.pageSize,
+            filter: this.filter
+          }
+        : { currentPage: this.currentPage, pageSize: this.pageSize };
+      // this.$router.push({ name: 'AddFusion', params: pam });
+      this.data = {};
+      this.showModal();
+    },
+    // 修改诊断关联-跳转至编辑页面
+    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: 'AddFusion',
+      //   params: Object.assign(pam, { isEdit: true, data: item })
+      // });
+      this.data = item;
+      this.showModal();
+    },
+    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.$confirm(msg, '提示', {
+        confirmButtonText: '删除',
+        cancelButtonText: '取消',
+        cancelButtonClass: 'cancelBtn',
+        confirmButtonClass: 'confirmC',
+        type: 'warning'
+      })
+        .then(() => {
+          resolve();
+        })
+        .catch(() => {});
+    },
+    // 删除关联
+    showDelDialog(id) {
+      this.showConfirmDialog('是否删除该关联?', () => {
+        api
+          .deleteFusionRecord({ 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.$confirm('确定要导出全部麻醉关联数据吗?', '', {
+        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
+            .exportFusionRecord({ type: 14, isMatch: this.filter.match })
+            .then(res => {
+              if (res.status === 200) {
+                this.$message({ message: '导出成功', type: 'success' });
+                utils.downloadExportedData(res.data, '麻醉关联数据.xls');
+              }
+            });
+        })
+        .catch(() => {
+          // this.$message({ message: '导出失败', type: 'waring' });
+        });
+    },
+    // 导入模板
+    exportModule() {
+      api.exportFusionModule({ type: 14 }).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];
+      let extend = fileInfo.name.substring(fileInfo.name.lastIndexOf('.') + 1);
+      if (extend != 'xls' && extend != 'xlsx') {
+        this.$message({ message: '请根据模板进行导入', type: 'error' });
+        return;
+      }
+      e.preventDefault();
+      let formData = new FormData();
+      formData.append('file', fileInfo);
+      formData.append('type', 14);
+      formData.append('uesrId', localStorage.getItem('uesrId'));
+      formData.append(
+        'hospitalId',
+        JSON.parse(localStorage.getItem('hospitalLoginDTO')).id
+      );
+      const header = {
+        headers: {
+          'Content-Type': 'multipart/form-data'
+        }
+      };
+      this.importFusionRecord(formData, header);
+      // this.uploadInfo = '导入中...';
+      // api.importExcelDataVerify(formData, header).then(res => {
+      //   if (res.data.code === '00020001') {
+      //     this.$confirm(`${res.data.msg}`, '提示', {
+      //       confirmButtonText: '确定',
+      //       cancelButtonText: '取消',
+      //       type: 'warning'
+      //     })
+      //       .then(() => {
+      //         this.importFusionRecord(formData, header);
+      //       })
+      //       .catch(() => {
+      //         setTimeout(() => {
+      //           this.uploadInfo = '导入';
+      //         }, 300);
+      //       });
+      //   } else if (res.data.data === true) {
+      //     this.importFusionRecord(formData, header);
+      //   }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 = '';
+    },
+    importFusionRecord(formData, header) {
+      let that = this;
+      api.importFusionRecord(formData, header).then(res => {
+        if (res.headers['content-disposition']) {
+          this.downloadUrl(res);
+          this.getDataList();
+        } else {
+          let r = new FileReader();
+          r.onload = function() {
+            if (this.result) {
+              const code = JSON.parse(this.result);
+              if (code.code === '00020004' || code.code === '00020007') {
+                that
+                  .$alert(`${code.msg}`, '提示', {
+                    confirmButtonText: '确定',
+                    // cancelButtonText: '取消',
+                    // cancelButtonClass: 'cancelSure',
+                    // confirmButtonClass: 'sure',
+                    // customClass: 'exportConfirm',
+                    type: 'warning'
+                  })
+                  .then(() => {})
+                  .catch(() => {});
+              }
+            } else {
+              that.$alert(`导入成功`, '提示', {
+                confirmButtonText: '确定',
+                // cancelButtonText: '取消',
+                // cancelButtonClass: 'cancelSure',
+                // confirmButtonClass: 'sure',
+                // customClass: 'exportConfirm',
+                type: 'success'
+              });
+              that.getDataList();
+            }
+          };
+          r.readAsText(res.data);
+        }
+        // if (res.data.code === '00000001') {
+        //   this.$confirm(`医院术语字符数超出最大数量,请修改后再试`, '提示', {
+        //     confirmButtonText: '确定',
+        //     // cancelButtonText: '取消',
+        //     cancelButtonClass: 'cancelSure',
+        //     confirmButtonClass: 'sure',
+        //     customClass: 'exportConfirm',
+        //     type: 'warning'
+        //   })
+        //     .then(() => {})
+        //     .catch(() => {});
+        //   this.getDataList(); // 重新获取列表
+        //   setTimeout(() => {
+        //     this.uploadInfo = '导入';
+        //   }, 300);
+        // } else if (res.data.data === true && res.status === 200) {
+        //   this.$confirm(`导入成功`, '提示', {
+        //     confirmButtonText: '确定',
+        //     // cancelButtonText: '取消',
+        //     cancelButtonClass: 'cancelSure',
+        //     confirmButtonClass: 'sure',
+        //     customClass: 'exportConfirm',
+        //     type: 'success'
+        //   })
+        //     .then(() => {})
+        //     .catch(() => {});
+        //   this.getDataList(); // 重新获取列表
+        //   setTimeout(() => {
+        //     this.uploadInfo = '导入';
+        //   }, 300);
+        // } else {
+        //   this.$confirm(`${res.data.msg}`, '提示', {
+        //     confirmButtonText: '确定',
+        //     // cancelButtonText: '取消',
+        //     cancelButtonClass: 'cancelSure',
+        //     confirmButtonClass: 'sure',
+        //     customClass: 'exportConfirm',
+        //     type: 'warning'
+        //   })
+        //     .then(() => {})
+        //     .catch(() => {});
+
+        //   setTimeout(() => {
+        //     this.uploadInfo = '导入';
+        //   }, 300);
+        // }
+      });
+    },
+    downloadUrl(res) {
+      var disposition = res.headers['content-disposition'];
+      var fileName = decodeURI(
+        disposition.split('filename=')[1].split(';filename*=')[0]
+      );
+      let blob = new Blob([res.data], { type: 'application/.xls' }); //.xls是我和后台约定好的文件格式
+      let link = document.createElement('a');
+      link.href = window.URL.createObjectURL(blob);
+      link.download = fileName;
+      link.click();
+      link.remove();
+    },
+    /********新增编辑弹窗**********/
+    showModal() {
+      this.modalVisiable = true;
+    },
+    getMsgFormSon(data) {
+      if (data == 'close') {
+        this.modalVisiable = false;
+      } else {
+        this.modalVisiable = false;
+        this.getDataList();
+      }
+    }
+  }
+};
+</script>
+
+
+<style lang="less" scoped>
+@import '../../../less/admin.less';
+/deep/ .container.knowledgeTitle {
+  height: 80px;
+}
+/deep/ .contents.knowledgeContents {
+  padding: 104px 20px 0;
+}
+/deep/ .secLine.el-form {
+  float: right;
+  display: block;
+  position: relative;
+  top: -5px;
+}
+.delete {
+  color: red;
+}
+.delete:hover {
+  color: red;
+}
+.pagination {
+  min-width: 1010px;
+}
+.downTemplate {
+  margin-right: 8px;
+  span {
+    color: #02a7f0;
+  }
+}
+#upFile {
+  display: none !important;
+}
+.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;
+  }
+}
+#upFileMatch {
+  display: none;
+}
+</style>
+>>>>>>> .theirs

+ 2 - 2
src/components/icss/lis/Lis.vue

@@ -267,9 +267,9 @@ export default {
         current: this.inCurrentPage || this.currentPage,
         size: this.pageSize,
         hisName: this.filter.hisName.trim(),
-        uniqueName: this.filter.uniqueName.trim(),
+        uniqueName: this.filter.uniqueName.trim().replace(/%/g,"\\%").replace(/_/g,"\\_"),
         uniqueCode: '',
-        hisDetailName: this.filter.hisDetailName.trim(),
+        hisDetailName: this.filter.hisDetailName.trim().replace(/%/g,"\\%").replace(/_/g,"\\_"),
         type: 1,
         isMatch: this.filter.match,
         status: this.filter.status

+ 2 - 2
src/components/icss/nursing/nursing.vue

@@ -266,8 +266,8 @@ export default {
       const param = {
         current: this.inCurrentPage || this.currentPage,
         size: this.pageSize,
-        hisName: this.filter.hisName.trim(),
-        uniqueName: this.filter.uniqueName.trim(),
+        hisName: this.filter.hisName.trim().replace(/%/g,"\\%").replace(/_/g,"\\_"),
+        uniqueName: this.filter.uniqueName.trim().replace(/%/g,"\\%").replace(/_/g,"\\_"),
         uniqueCode: '',
         type: 11,
         isMatch: this.filter.match,

+ 2 - 2
src/components/icss/operation/Operation.vue

@@ -267,8 +267,8 @@ export default {
       const param = {
         current: this.inCurrentPage || this.currentPage,
         size: this.pageSize,
-        hisName: this.filter.hisName.trim(),
-        uniqueName: this.filter.uniqueName.trim(),
+        hisName: this.filter.hisName.trim().replace(/%/g,"\\%").replace(/_/g,"\\_"),
+        uniqueName: this.filter.uniqueName.trim().replace(/%/g,"\\%").replace(/_/g,"\\_"),
         uniqueCode: '',
         type: 6,
         isMatch: this.filter.match,

+ 2 - 2
src/components/icss/pacs/Pacs.vue

@@ -265,8 +265,8 @@ export default {
       const param = {
         current: this.inCurrentPage || this.currentPage,
         size: this.pageSize,
-        hisName: this.filter.hisName.trim(),
-        uniqueName: this.filter.uniqueName.trim(),
+        hisName: this.filter.hisName.trim().replace(/%/g,"\\%").replace(/_/g,"\\_"),
+        uniqueName: this.filter.uniqueName.trim().replace(/%/g,"\\%").replace(/_/g,"\\_"),
         uniqueCode: '',
         type: 3,
         isMatch: this.filter.match,

+ 1 - 1
src/components/icss/plan/Plan.vue

@@ -166,7 +166,7 @@ export default {
       const param = {
         current: this.inCurrentPage || this.currentPage,
         size: this.pageSize,
-        planName: this.filter.planName.trim(),
+        planName: this.filter.planName.trim().replace(/%/g,"\\%").replace(/_/g,"\\_"),
         hospitalId: res.data.data.id
       };
       return param;

+ 2 - 2
src/components/icss/scale/ScaleManage.vue

@@ -265,8 +265,8 @@ export default {
       const param = {
         current: this.inCurrentPage || this.currentPage,
         size: this.pageSize,
-        hisName: this.filter.hisName.trim(),
-        uniqueName: this.filter.uniqueName.trim(),
+        hisName: this.filter.hisName.trim().replace(/%/g,"\\%").replace(/_/g,"\\_"),
+        uniqueName: this.filter.uniqueName.trim().replace(/%/g,"\\%").replace(/_/g,"\\_"),
         uniqueCode: '',
         type: 10,
         isMatch: this.filter.match,

+ 1 - 0
src/components/icss/sonhospital/SonHospital.vue

@@ -402,6 +402,7 @@ export default {
     display: flex;
     justify-content: center;
     align-items: center;
+    margin-bottom: 8px;
     & img {
       width: 16px;
       height: 16px;

+ 2 - 2
src/components/icss/tcmdisease/tcmdisease.vue

@@ -273,8 +273,8 @@ export default {
       const param = {
         current: this.inCurrentPage || this.currentPage,
         size: this.pageSize,
-        hisName: this.filter.hisName.trim(),
-        uniqueName: this.filter.uniqueName.trim(),
+        hisName: this.filter.hisName.trim().replace(/%/g,"\\%").replace(/_/g,"\\_"),
+        uniqueName: this.filter.uniqueName.trim().replace(/%/g,"\\%").replace(/_/g,"\\_"),
         uniqueCode: '',
         type: 12,
         isMatch: this.filter.match,

+ 2 - 2
src/components/icss/tcmdrome/tcmdrome.vue

@@ -273,8 +273,8 @@ export default {
       const param = {
         current: this.inCurrentPage || this.currentPage,
         size: this.pageSize,
-        hisName: this.filter.hisName.trim(),
-        uniqueName: this.filter.uniqueName.trim(),
+        hisName: this.filter.hisName.trim().replace(/%/g,"\\%").replace(/_/g,"\\_"),
+        uniqueName: this.filter.uniqueName.trim().replace(/%/g,"\\%").replace(/_/g,"\\_"),
         uniqueCode: '',
         type: 13,
         isMatch: this.filter.match,

+ 313 - 15
src/components/knowledgeExtra/AddNewRule.vue

@@ -196,7 +196,7 @@
           <div class="table_cell" style="flex: 3; max-width: 50%" v-if="showMsg">
             <!-- <el-form-item label-width="130px" label="附加信息:" :rules="rules.parMsg" prop="parMsg">
               <el-input type="textarea" :rows="1" placeholder="请输入附加信息" v-model.trim="form.parMsg"></el-input>
-            </el-form-item> -->
+            </el-form-item>-->
           </div>
         </div>
         <!-- 表格 -->
@@ -260,7 +260,9 @@ export default {
         parLenCode: '',
         klRuleByIdSub: []
       },
-      rules: formRules
+      rules: formRules,
+      dragVal: null,
+      dragArr: null
     };
   },
   created() {
@@ -332,15 +334,79 @@ export default {
         } else if (item.subEqValue) {
           item.dataType = '2';
         }
-
         // disable
         if (this.form.parHasSub && this.firstPlace) {
+          const del =
+            localStorage
+              .getItem('zskDelDict')
+              .match(
+                new RegExp(this.firstPlace.checkedType + '-\\d+' + '-\\d+', 'g')
+              ) || [];
           if (arr[i - 1] && arr[i - 1].groupId == item.groupId) {
             this.$set(item, 'disabled', false);
+            if (del.length > 0 && item.subType == del[0].split('-')[2]) {
+              const delType = del[0].split('-');
+              const types = del[0].split('-');
+              let baseTypeList = JSON.parse(JSON.stringify(this.baseTypeList));
+              const subobj = this.baseTypeList.find(it => it.type == types[2]);
+              const screenArr = subobj.subMenuList.filter(item => {
+                return !types[3].includes(item.code);
+              });
+              this.$set(item, 'baseTermTypeList', screenArr);
+            }
           } else {
             this.$set(item, 'disabled', true);
           }
         }
+        const dragDel =
+          localStorage
+            .getItem('zskDragDict')
+            .match(new RegExp(this.ruleTermCodeStrs, 'g')) || [];
+        //药品开单合理判断
+        if (dragDel.length > 0) {
+          const obj = this.baseTypeList.find(it => it.type === 1);
+          if (arr[i - 1] && arr[i - 1].groupId == item.groupId) {
+            let klRuleByIdSub = this.form.klRuleByIdSub;
+            klRuleByIdSub.forEach((item, i, arr) => {
+              if (arr[0].subType == 1) {
+                const arr = this.baseTypeList.filter(it => {
+                  return it.type == 1;
+                });
+                if (i > 0) {
+                  this.$set(item, 'baseTypes', arr);
+                }
+              }
+            });
+            if (i == 2) {
+              //获取互斥项code
+              const list = obj.subMenuList.filter(it => {
+                return (
+                  it.code == arr[i - 1].subLenCode &&
+                  it.remark.split('|')[0] == 3
+                );
+              });
+              const dragArr = list[0].remark.split('|')[1].split(',');
+              this.dragArr = dragArr;
+              this.dragVal = item.subLenCode;
+              //取出互斥项
+              const screenArr = obj.subMenuList.filter(item =>
+                dragArr.some(
+                  ele => ele === item.code && item.remark.split('|')[0] == 3
+                )
+              );
+              this.$set(item, 'baseTermTypeList', screenArr);
+            } else {
+              const screenArr = obj.subMenuList.filter(item => {
+                if (item.remark == '') {
+                  return item;
+                } else {
+                  return item.remark.split('|')[0] == i + 1;
+                }
+              });
+              this.$set(item, 'baseTermTypeList', screenArr);
+            }
+          }
+        }
       });
     },
     // 提交
@@ -421,11 +487,45 @@ export default {
               .getItem('zskDicts')
               .match(new RegExp(this.firstPlace.checkedType + '-\\d+', 'g')) ||
             [];
+          const del =
+            localStorage
+              .getItem('zskDelDict')
+              .match(
+                new RegExp(this.firstPlace.checkedType + '-\\d+' + '-\\d+', 'g')
+              ) || [];
           const types = dict[0].split('-');
           let obj = this.form.klRuleByIdSub;
           obj.forEach((item, i, arr) => {
             if (arr[i - 1] && arr[i - 1].groupId == item.groupId) {
               this.$set(item, 'disabled', false);
+              if (del.length > 0) {
+                const delType = del[0].split('-');
+                if (
+                  item.subType == delType[2] ||
+                  item.subLenCode == delType[3]
+                ) {
+                  this.$set(this.form.klRuleByIdSub, i, {
+                    groupId: item.groupId,
+                    groupChildId: 'child' + new Date().valueOf(),
+                    baseTypes: this.baseTypeList,
+                    baseTermTypeList: [],
+                    conceptList: [],
+                    subDescription: '',
+                    parRuleType: '',
+                    subConceptId: '',
+                    subType: '',
+                    subMaxOperator: '',
+                    subMaxUnit: '',
+                    subMaxValue: '',
+                    subMinOperator: '',
+                    subMinUnit: '',
+                    subMinValue: '',
+                    subEqValue: '',
+                    subLenCode: '',
+                    dataType: ''
+                  });
+                }
+              }
             } else {
               this.$set(item, 'disabled', true);
               this.$set(item, 'subType', parseInt(types[2]));
@@ -493,12 +593,75 @@ export default {
     // 基础规则类型切换
     subTypeChange(val, index) {
       // index
+      const dragDel =
+        localStorage
+          .getItem('zskDragDict')
+          .match(new RegExp(this.ruleTermCodeStrs, 'g')) || [];
       const obj = this.baseTypeList.find(it => it.type === val);
+      let dragType = false;
+      let isDel = false;
+      let screenArr;
+      //药品开单合理判断
+      if (dragDel.length > 0) {
+        dragType = true;
+        const types = dragDel[0].split('-');
+        if (this.dragArr && index > 0) {
+          //获取互斥项code
+          const list = obj.subMenuList.filter(it => {
+            return it.code == this.dragVal && it.remark.split('|')[0] == 3;
+          });
+          const dragArr = list[0].remark.split('|')[1].split(',');
+          this.dragArr = dragArr;
+          //取出互斥项
+          screenArr = obj.subMenuList.filter(item =>
+            dragArr.some(
+              ele => ele === item.code && item.remark.split('|')[0] == 3
+            )
+          );
+        } else {
+          screenArr = obj.subMenuList.filter(item => {
+            if (item.remark == '') {
+              return item;
+            } else {
+              return item.remark.split('|')[0] == index + 1;
+            }
+          });
+        }
+        let klRuleByIdSub = this.form.klRuleByIdSub;
+        klRuleByIdSub.forEach((item, i, arr) => {
+          if (arr[0].subType == 1) {
+            const arr = this.baseTypeList.filter(it => {
+              return it.type == 1;
+            });
+            if (i > 0) {
+              this.$set(item, 'baseTypes', arr);
+            }
+          }
+        });
+      }
+      //危急值实验室子项目已选医学标准术语判断
+      if (this.form.parHasSub && this.firstPlace) {
+        const del =
+          localStorage
+            .getItem('zskDelDict')
+            .match(
+              new RegExp(this.firstPlace.checkedType + '-\\d+' + '-\\d+', 'g')
+            ) || [];
+        if (del.length > 0) {
+          isDel = true;
+          const types = del[0].split('-');
+          let baseTypeList = JSON.parse(JSON.stringify(this.baseTypeList));
+          const subobj = this.baseTypeList.find(it => it.type == types[2]);
+          screenArr = subobj.subMenuList.filter(item => {
+            return !types[3].includes(item.code);
+          });
+        }
+      }
 
       this.$set(
         this.form.klRuleByIdSub[index],
         'baseTermTypeList',
-        obj.subMenuList
+        (isDel && val == 2) || dragType ? screenArr : obj.subMenuList
       );
       this.$set(this.form.klRuleByIdSub[index], 'subLenCode', '');
       this.$set(this.form.klRuleByIdSub[index], 'dataType', '');
@@ -532,6 +695,7 @@ export default {
        *    arg:{index:添加规则用索引,groupId:添加分组用确切id}
        */
       !date && (date = new Date().valueOf());
+
       const obj = {
         groupId: date,
         groupChildId: 'child' + new Date().valueOf(),
@@ -555,6 +719,23 @@ export default {
       if (typeof arg.index == 'number') {
         // 添加规则 直接在当前位置之后添加
         this.form.klRuleByIdSub.splice(arg.index + 1, 0, obj);
+        const dragDel =
+          localStorage
+            .getItem('zskDragDict')
+            .match(new RegExp(this.ruleTermCodeStrs, 'g')) || [];
+        if (dragDel.length > 0) {
+          let obj = this.form.klRuleByIdSub;
+          obj.forEach((item, i, arr) => {
+            if (arr[0].subType == 1) {
+              const arr = this.baseTypeList.filter(it => {
+                return it.type == 1;
+              });
+              if (i > 0) {
+                this.$set(item, 'baseTypes', arr);
+              }
+            }
+          });
+        }
       } else {
         // 添加分组 在列表中相同groupId之后添加
 
@@ -597,10 +778,52 @@ export default {
       this.form.klRuleByIdSub = list;
     },
     // 删除规则
-    delGroupChild(groupChildId) {
-      const newGroupList = this.form.klRuleByIdSub.filter(
-        item => item.groupChildId != groupChildId
-      );
+    delGroupChild(groupChildId, index) {
+      let newGroupList;
+      const dragDel =
+        localStorage
+          .getItem('zskDragDict')
+          .match(new RegExp(this.ruleTermCodeStrs, 'g')) || [];
+      let list;
+      if (dragDel.length > 0) {
+        if (index == 0) {
+          const date = new Date().valueOf();
+          newGroupList = [
+            {
+              groupId: date,
+              groupChildId: 'child' + new Date().valueOf(),
+              baseTypes: this.baseTypeList,
+              baseTermTypeList: [],
+              conceptList: [],
+              subDescription: '',
+              parRuleType: '',
+              subConceptId: '',
+              subType: '',
+              subMaxOperator: '',
+              subMaxUnit: '',
+              subMaxValue: '',
+              subMinOperator: '',
+              subMinUnit: '',
+              subMinValue: '',
+              subEqValue: '',
+              subLenCode: '',
+              dataType: ''
+            }
+          ];
+        } else if (index == 0 || index == 1) {
+          newGroupList = this.form.klRuleByIdSub.filter((item, i) => {
+            return i == 0;
+          });
+        } else {
+          newGroupList = this.form.klRuleByIdSub.filter(
+            item => item.groupChildId != groupChildId
+          );
+        }
+      } else {
+        newGroupList = this.form.klRuleByIdSub.filter(
+          item => item.groupChildId != groupChildId
+        );
+      }
       this.form.klRuleByIdSub = newGroupList;
     },
     setDict() {
@@ -622,7 +845,7 @@ export default {
       const param = {
         excludedConceptIds: [this.form.parRuleType],
         libType: this.form.parLenCode,
-        name: val,
+        name: val
       };
       api
         .searchConcept(param)
@@ -667,7 +890,6 @@ export default {
     },
     childClearNumText(index) {
       let obj = JSON.parse(JSON.stringify(this.form.klRuleByIdSub));
-
       obj[index].subMaxOperator = '';
       obj[index].subMaxValue = '';
       obj[index].subMaxUnit = '';
@@ -698,6 +920,75 @@ export default {
       });
     },
     childSubCodeChange(val, index, numTypes) {
+      const dragDel =
+        localStorage
+          .getItem('zskDragDict')
+          .match(new RegExp(this.ruleTermCodeStrs, 'g')) || [];
+      const inx = index == 1 ? index + 1 : index == 2 ? index - 1 : index;
+      const subobj = this.baseTypeList.find(it => it.type == 1);
+      let obj = this.form.klRuleByIdSub;
+      const mutex = obj.some((item, i, arr) => {
+        return item.subLenCode == '';
+      });
+      //判断药品合理性总条数是否大于1条,是否存在第二条或第三条类型为1,存在触发互斥
+      if (
+        //判断3条规则是否都已选中
+        dragDel.length > 0 &&
+        index > 0 &&
+        this.form.klRuleByIdSub.length > 1 &&
+        this.form.klRuleByIdSub[0].subType == 1
+      ) {
+        if (this.form.klRuleByIdSub.length == 3 && !mutex) {
+          //判断是否存在符合互斥条件的两条出具,若存在,置空另一条出具
+          if (this.dragArr.indexOf(this.dragVal) > -1) {
+            //剂型给药途径互斥判断
+            const arr = this.baseTypeList.filter(it => {
+              return it.type == 1;
+            });
+            this.$set(this.form.klRuleByIdSub, inx, {
+              groupId: this.form.klRuleByIdSub[inx].groupId,
+              groupChildId: 'child' + new Date().valueOf(),
+              baseTypes: arr,
+              baseTermTypeList: [],
+              conceptList: [],
+              subDescription: '',
+              parRuleType: '',
+              subConceptId: '',
+              subType: '',
+              subMaxOperator: '',
+              subMaxUnit: '',
+              subMaxValue: '',
+              subMinOperator: '',
+              subMinUnit: '',
+              subMinValue: '',
+              subEqValue: '',
+              subLenCode: '',
+              dataType: ''
+            });
+          }
+        } else {
+          const list = subobj.subMenuList.filter(it => {
+            return it.code == val && it.remark.split('|')[0] == 3;
+          });
+          //获取互斥项code
+          const dragArr = list[0].remark.split('|')[1].split(',');
+          this.dragArr = dragArr;
+          //获取互斥项
+          const screenArr = subobj.subMenuList.filter(item =>
+            dragArr.some(
+              ele => ele === item.code && item.remark.split('|')[0] == 3
+            )
+          );
+          if (this.form.klRuleByIdSub[inx]) {
+            this.$set(
+              this.form.klRuleByIdSub[inx],
+              'baseTermTypeList',
+              screenArr
+            );
+          }
+        }
+        this.dragVal = val;
+      }
       if ((numTypes + ',').indexOf(val + ',') > -1) {
         this.$set(this.form.klRuleByIdSub[index], 'dataType', '1');
       } else {
@@ -705,6 +996,13 @@ export default {
       }
       this.childClearConcept(index);
       this.childClearNumText(index);
+    },
+    // 去重
+    unique(arr, obj) {
+      return arr.reduce((cur, next) => {
+        obj[next] ? '' : (obj[next] = true && cur.push(next));
+        return cur;
+      }, []);
     }
   },
   watch: {
@@ -728,23 +1026,23 @@ export default {
       return Object.keys(this.firstPlace || {}).length > 0;
     },
     ruleTermCodeStr: function() {
-      const str = this.form.parRuleType + '-' + this.form.parLenCode+ "-" + 1;
+      const str = this.form.parRuleType + '-' + this.form.parLenCode + '-' + 1;
       if (str.length <= 1) {
         return '';
       }
       return str;
     },
     ruleTermCodeStr2: function() {
-      const str = this.form.parRuleType + '-' + this.form.parLenCode+ "-" + 0;
+      const str = this.form.parRuleType + '-' + this.form.parLenCode + '-' + 0;
       if (str.length <= 1) {
         return '';
       }
       return str;
     },
-    ruleTermCodeStrs: function () {
-      const str = this.form.parRuleType + "-" + this.form.parLenCode;
+    ruleTermCodeStrs: function() {
+      const str = this.form.parRuleType + '-' + this.form.parLenCode;
       if (str.length <= 1) {
-        return "";
+        return '';
       }
       return str;
     },

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

@@ -214,6 +214,8 @@ export default {
             );
             localStorage.setItem('zskNumDict', data['22'][0].val);
             localStorage.setItem('zskSubDict', (data['23'].map(it => it.val) || []).join(','));
+            localStorage.setItem('zskDragDict', (data['27'].map(it => it.val) || []).join(','));
+            localStorage.setItem('zskDelDict', data['26'][0].val);
           }
         })
         .catch(error => {

BIN
src/images/icon-collect-left.png


BIN
src/images/icon-collect-right.png


+ 5 - 0
src/routes.js

@@ -23,6 +23,9 @@ import AddDept from '@components/icss/dept/AddDept.vue';  //科室关联维护--
 import Correlation from '@components/icss/correlation/Correlation.vue';  //关联维护设置
 import Nursing from '@components/icss/nursing/nursing.vue';  //护理关联维护
 import AddNursing from '@components/icss/nursing/Addnursing.vue';  //护理关联维护--添加关联
+import Drugroute from '@components/icss/drugroute/Drugroute.vue';  //给药途径关联维护
+import AddDrugroute from '@components/icss/drugroute/AddDrugroute.vue';  //给药途径关联维护--添加关联
+
 import Tcmdisease from '@components/icss/tcmdisease/tcmdisease.vue';  //中医疾病关联维护
 import AddTcmdisease from '@components/icss/tcmdisease/Addtcmdisease.vue';  //中医疾病关联维护--添加关联
 import Tcmdrome from '@components/icss/tcmdrome/tcmdrome.vue';  //中医疾病关联维护
@@ -71,6 +74,8 @@ 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-GYTJGLWH', component: Drugroute, name: 'Drugroute' }, //给药途径关联维护
+	  { path: 'LT-GYTJGLWH-TJHYDXXYGBXDY', component: AddDrugroute, name: 'AddDrugroute' }, //给药途径关联维护--添加关联
       { path: 'YXSYK-ZYJBGLWH', component: Tcmdisease, name: 'Tcmdisease' }, //中医疾病关联维护
       { path: 'LT-ZYJBGLWH-TJHYDXXYGBXDY', component: AddTcmdisease, name: 'AddTcmdisease' }, //中医疾病关联维护
       { path: 'YXSYK-ZYZHGLWH', component: Tcmdrome, name: 'Tcmdrome' }, //中医疾病关联维护