Prechádzať zdrojové kódy

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

# Conflicts:
#	src/api/index.js
#	src/components/icss/drug/DrugManage.vue
zhouna 3 rokov pred
rodič
commit
7e069ccdb5

+ 3 - 0
src/api/config.js

@@ -162,6 +162,9 @@ export default {
     'zskSearchConcept': '/klDisease/searchConceptRuleClass', //知识库搜索术语
     'zskUpdateAll': '/cache/clearRuleAll', //更新数据
     'zskgetDict': '/kl/dictionary/getDictionarys', //禁止修改基础规则类型
+	
+	'zskgetRulePage': '/klRule/getRulePage',//查询所有有效的规则
+	'zskgetRuleDetail': '/klRule/getRuleDetail',//根据录入内容查询有效规则的明细
 
     'importExcelDataVerify': '/tran/mappingConfig/importExcelDataVerify', //数据导入校验
   },

+ 3 - 1
src/api/index.js

@@ -4,7 +4,9 @@ import config from './config.js';
 axios.default.timeout = 500000;
 axios.defaults.headers.post['Content-Type'] = "application/json;charset=utf-8";
 //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.241:84';
+//axios.defaults.baseURL = 'http://192.168.2.236:6060';
+// axios.defaults.baseURL = 'http://192.168.2.241';
 // axios.defaults.baseURL = 'http://192.168.3.113:6060';
 
 

+ 6 - 0
src/api/knowledgeLib.js

@@ -33,6 +33,12 @@ export default {
     zskgetDict(){
         return axios.post(urls.zskgetDict)
     },
+	zskgetRulePage(param) {
+	    return axios.post(urls.zskgetRulePage, param);
+	},
+	zskgetRuleDetail(param) {
+	    return axios.post(urls.zskgetRuleDetail, param);
+	},
     getCallRecord(param){
         return axios.post(urls.getCallRecord, param)
     }

+ 231 - 144
src/components/icss/drug/DrugManage.vue

@@ -1,9 +1,18 @@
 <template>
   <div>
-    <crumbs title="药品关联维护" style="min-width: 980px" class="knowledgeTitle">
+    <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-select
+            size="mini"
+            v-model="filter.status"
+            placeholder="请选择"
+            clearable
+          >
             <el-option
               v-for="item in statusList"
               :label="item.name"
@@ -13,7 +22,12 @@
           </el-select>
         </el-form-item>
         <el-form-item label="剂型术语状态:" class="selectMedicine">
-          <el-select size="mini" v-model="filter.formStatus" placeholder="请选择" clearable>
+          <el-select
+            size="mini"
+            v-model="filter.formStatus"
+            placeholder="请选择"
+            clearable
+          >
             <el-option
               v-for="item in formstatusList"
               :label="item.name"
@@ -23,69 +37,132 @@
           </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
+            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-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)" />
+          <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="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 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-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="form" label="药品剂型" show-overflow-tooltip></el-table-column>
+        <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="form"
+          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>
+            <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
-              v-if="scope.row.form && scope.row.form!=''"
-            >{{scope.row.formStatus == 0?'禁用':'启用'}}</span>
+            <span v-if="scope.row.form && scope.row.form != ''">{{
+              scope.row.formStatus == 0 ? "禁用" : "启用"
+            }}</span>
           </template>
         </el-table-column>
         <el-table-column :resizable="false" prop="operate" label="匹配状态">
           <template slot-scope="scope">
-            <span>{{scope.row.isMatch == 0?'未匹配':'已匹配'}}</span>
+            <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="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>
+              >删除</el-button
+            >
           </template>
         </el-table-column>
       </el-table>
@@ -115,51 +192,51 @@
 </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';
+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: 'DrugManage', //化验大小项和公表维护
-  data: function() {
+  name: "DrugManage", //化验大小项和公表维护
+  data: function () {
     return {
       list: [],
       matchList: [
-        { id: '', name: '全部' },
-        { id: 1, name: '已匹配' },
-        { id: 0, name: '未匹配' },
-        { id: 2, name: '多项匹配' }
+        { id: "", name: "全部" },
+        { id: 1, name: "已匹配" },
+        { id: 0, name: "未匹配" },
+        { id: 2, name: "多项匹配" },
       ],
       statusList: [
-        { id: '', name: '全部' },
-        { id: 1, name: '启用' },
-        { id: 0, name: '禁用' }
+        { id: "", name: "全部" },
+        { id: 1, name: "启用" },
+        { id: 0, name: "禁用" },
       ],
       formstatusList: [
-        { id: '', name: '全部' },
-        { id: 1, name: '启用' },
-        { id: 0, name: '禁用' }
+        { id: "", name: "全部" },
+        { id: 1, name: "启用" },
+        { id: 0, name: "禁用" },
       ],
       searched: false,
       filter: {
-        hisName: '', // 医院诊断名称
-        uniqueName: '', //标准诊断名称
-        match: '',
-        status: '',
-        formStatus: ''
+        hisName: "", // 医院诊断名称
+        uniqueName: "", //标准诊断名称
+        match: "",
+        status: "",
+        formStatus: "",
       },
       currentPage: 1,
       pageSize: config.pageSize,
       pageSizeArr: config.pageSizeArr,
       pageLayout: config.pageLayout,
       total: 0,
-      uploadInfo: '导入',
+      uploadInfo: "导入",
       modalVisiable: false,
-      data: {}
+      data: {},
     };
   },
   components: {
-    LtModal
+    LtModal,
   },
   created() {
     const param = this.$route.params;
@@ -176,68 +253,73 @@ export default {
   },
   watch: {
     filter: {
-      handler: function() {
+      handler: function () {
         this.searched = false;
       },
-      deep: true
-    }
+      deep: true, // watch中的高级用法 为true时  表示深度监听 这时候就能监听到filter中的值
+    },
   },
   methods: {
     // 预匹配
     handleMatchData() {
-      let inp = document.getElementById('upFileMatch');
+      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' });
+      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', 5);
+      formData.append("file", fileInfo);
+      formData.append("type", 5);
       const header = {
         headers: {
-          'Content-Type': 'multipart/form-data'
-        }
+          "Content-Type": "multipart/form-data",
+        },
       };
+      // 加载动画效果
       const loading = this.$loading({
         lock: true,
-        text: '预匹配中...',
-        spinner: 'el-icon-loading',
-        background: 'rgba(0, 0, 0, 0.7)'
+        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') {
+
+      // 导入数据接口
+      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'
+          this.$alert(`${res.data.msg}`, "提示", {
+            confirmButtonText: "确定",
+            type: "warning",
           })
             .then(() => {})
             .catch(() => {});
         } else {
-          api.precDiseaseDataMatch(formData, header).then(res => {
+          api.precDiseaseDataMatch(formData, header).then((res) => {
             setTimeout(() => {
               loading.close();
             }, 800);
             if (res.status === 200) {
               utils.downloadExportedData(
                 res.data,
-                '药品关联数据(预匹配).xls'
+                "药品关联数据(预匹配).xls"
               );
             }
           });
         }
       });
 
-      let inp = document.getElementById('upFileMatch');
-      inp.value = '';
+      let inp = document.getElementById("upFileMatch");
+      inp.value = "";
     },
+
     handleSizeChange(val) {
       this.pageSize = val;
       this.currentPage = utils.getCurrentPage(
@@ -252,15 +334,16 @@ export default {
     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)'
+        text: "Loading",
+        spinner: "el-icon-loading",
+        background: "rgba(0, 0, 0, 0.7)",
       });
-      api.getDrugPage(params).then(res => {
+      api.getDrugPage(params).then((res) => {
         loading.close();
-        if (res.data.code === '0') {
+        if (res.data.code === "0") {
           this.list = res.data.data && res.data.data.records;
         }
         this.total = res.data.data && res.data.data.total;
@@ -286,7 +369,7 @@ export default {
         type: 5,
         isMatch: this.filter.match,
         status: this.filter.status,
-        formStatus: this.filter.formStatus
+        formStatus: this.filter.formStatus,
       };
       return param;
     },
@@ -295,17 +378,19 @@ export default {
       this.currentPage = 1;
       this.getDataList();
     },
+
+    // 点击添加关联
     addRelation() {
       const pam = this.searched
         ? {
             currentPage: this.currentPage,
             pageSize: this.pageSize,
-            filter: this.filter
+            filter: this.filter,
           }
         : { currentPage: this.currentPage, pageSize: this.pageSize };
 
       this.data = {};
-      this.showModal();
+      this.showModal(); // 控制弹出框的显示隐藏
       // this.$router.push({ name: 'AddDrug', params: pam });
     },
     // 修改诊断关联-跳转至编辑页面
@@ -315,7 +400,7 @@ export default {
         ? {
             currentPage: this.currentPage,
             pageSize: this.pageSize,
-            filter: this.filter
+            filter: this.filter,
           }
         : { currentPage: this.currentPage, pageSize: this.pageSize };
       // this.$router.push({
@@ -334,11 +419,12 @@ export default {
       //     this.getDataList();
       // }
     },
+
     // 清空搜索参数
     clearFilter() {
       this.filter = {
-        hisName: '',
-        uniqueName: ''
+        hisName: "",
+        uniqueName: "",
       };
     },
 
@@ -352,16 +438,16 @@ export default {
       this.$message({
         showClose: true,
         message: msg,
-        type: type || 'warning'
+        type: type || "warning",
       });
     },
     showConfirmDialog(msg, resolve) {
-      this.$confirm(msg, '提示', {
-        confirmButtonText: '删除',
-        cancelButtonText: '取消',
-        cancelButtonClass: 'cancelBtn',
-        confirmButtonClass: 'confirmC',
-        type: 'warning'
+      this.$confirm(msg, "提示", {
+        confirmButtonText: "删除",
+        cancelButtonText: "取消",
+        cancelButtonClass: "cancelBtn",
+        confirmButtonClass: "confirmC",
+        type: "warning",
       })
         .then(() => {
           resolve();
@@ -370,11 +456,11 @@ export default {
     },
     // 删除关联
     showDelDialog(id) {
-      this.showConfirmDialog('是否删除该关联?', () => {
+      this.showConfirmDialog("是否删除该关联?", () => {
         api
           .deleteDrugRecord({ id: id })
-          .then(res => {
-            if (res.data.code == '0') {
+          .then((res) => {
+            if (res.data.code == "0") {
               if (!this.searched) {
                 //未点确认时清空搜索条件
                 this.clearFilter();
@@ -385,13 +471,13 @@ export default {
                   this.currentPage === 1 ? 1 : this.currentPage - 1;
               }
               this.getDataList();
-              this.warning(res.data.msg || '操作成功', 'success');
+              this.warning(res.data.msg || "操作成功", "success");
             } else {
               this.warning(res.data.msg);
             }
           })
-          .catch(error => {
-            if (error.code === '900010001') {
+          .catch((error) => {
+            if (error.code === "900010001") {
               return false;
             }
             this.warning(error);
@@ -401,13 +487,13 @@ export default {
 
     // 导出数据
     exportData() {
-      this.$confirm('确定要导出全部药品关联数据吗?', '', {
-        confirmButtonText: '确定',
-        cancelButtonText: '取消',
-        cancelButtonClass: 'leftbtn',
-        customClass: 'exportBox6',
-        title: '提示',
-        type: 'warning'
+      this.$confirm("确定要导出全部药品关联数据吗?", "", {
+        confirmButtonText: "确定",
+        cancelButtonText: "取消",
+        cancelButtonClass: "leftbtn",
+        customClass: "exportBox6",
+        title: "提示",
+        type: "warning",
         // beforeClose: (action, instance, done) => {
         //   if (action === 'confirm') {
         //     // instance.confirmButtonLoading = true;
@@ -428,10 +514,10 @@ export default {
         .then(() => {
           api
             .exportDrugRecord({ type: 5, isMatch: this.filter.match })
-            .then(res => {
+            .then((res) => {
               if (res.status === 200) {
-                this.$message({ message: '导出成功', type: 'success' });
-                utils.downloadExportedData(res.data, '药品关联数据.xls');
+                this.$message({ message: "导出成功", type: "success" });
+                utils.downloadExportedData(res.data, "药品关联数据.xls");
               }
             });
         })
@@ -442,10 +528,10 @@ export default {
 
     // 导入模板
     exportModule() {
-      api.exportDrugModule({ type: 5 }).then(res => {
+      api.exportDrugModule({ type: 5 }).then((res) => {
         if (res.status === 200) {
           setTimeout(() => {
-            utils.downloadExportedData(res.data, '药品导入模板.xls');
+            utils.downloadExportedData(res.data, "药品导入模板.xls");
           }, 1500);
         }
       });
@@ -453,30 +539,31 @@ export default {
 
     // 点击导入
     importPage() {
-      let inp = document.getElementById('upFile');
+      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' });
+      let extend = fileInfo.name.substring(fileInfo.name.lastIndexOf(".") + 1);
+      if (extend != "xls" && extend != "xlsx") {
+        this.$message({ message: "请根据模板进行导入", type: "error" });
         return;
       }
-      e.preventDefault();
+      e.preventDefault(); // 阻止默认行为
       let formData = new FormData();
-      formData.append('file', fileInfo);
-      formData.append('type', 5);
-      formData.append('uesrId', localStorage.getItem('uesrId'));
+      formData.append("file", fileInfo);
+      formData.append("type", 5);
+      formData.append("uesrId", localStorage.getItem("uesrId"));
       formData.append(
-        'hospitalId',
-        JSON.parse(localStorage.getItem('hospitalLoginDTO')).id
+        "hospitalId",
+        JSON.parse(localStorage.getItem("hospitalLoginDTO")).id
       );
       const header = {
         headers: {
-          'Content-Type': 'multipart/form-data'
-        }
+          "Content-Type": "multipart/form-data",
+        },
       };
       this.importDrugRecord(formData, header);
       // this.uploadInfo = '导入中...';
@@ -516,41 +603,41 @@ export default {
       // });
 
       //解决上传相同文件不触发change
-      let inp = document.getElementById('upFile');
-      inp.value = '';
+      let inp = document.getElementById("upFile");
+      inp.value = "";
     },
     importDrugRecord(formData, header) {
       let that = this;
-      api.importDrugRecord(formData, header).then(res => {
-        if (res.headers['content-disposition']) {
+      api.importDrugRecord(formData, header).then((res) => {
+        if (res.headers["content-disposition"]) {
           this.downloadUrl(res);
           this.getDataList();
         } else {
           let r = new FileReader();
-          r.onload = function() {
+          r.onload = function () {
             if (this.result) {
               const code = JSON.parse(this.result);
-              if (code.code === '00020004' || code.code === '00020007') {
+              if (code.code === "00020004" || code.code === "00020007") {
                 that
-                  .$alert(`${code.msg}`, '提示', {
-                    confirmButtonText: '确定',
+                  .$alert(`${code.msg}`, "提示", {
+                    confirmButtonText: "确定",
                     // cancelButtonText: '取消',
                     // cancelButtonClass: 'cancelSure',
                     // confirmButtonClass: 'sure',
                     // customClass: 'exportConfirm',
-                    type: 'warning'
+                    type: "warning",
                   })
                   .then(() => {})
                   .catch(() => {});
               }
             } else {
-              that.$alert(`导入成功`, '提示', {
-                confirmButtonText: '确定',
+              that.$alert(`导入成功`, "提示", {
+                confirmButtonText: "确定",
                 // cancelButtonText: '取消',
                 // cancelButtonClass: 'cancelSure',
                 // confirmButtonClass: 'sure',
                 // customClass: 'exportConfirm',
-                type: 'success'
+                type: "success",
               });
               that.getDataList();
             }
@@ -606,12 +693,12 @@ export default {
       });
     },
     downloadUrl(res) {
-      var disposition = res.headers['content-disposition'];
+      var disposition = res.headers["content-disposition"];
       var fileName = decodeURI(
-        disposition.split('filename=')[1].split(';filename*=')[0]
+        disposition.split("filename=")[1].split(";filename*=")[0]
       );
-      let blob = new Blob([res.data], { type: 'application/.xls' }); //.xls是我和后台约定好的文件格式
-      let link = document.createElement('a');
+      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();
@@ -622,20 +709,20 @@ export default {
       this.modalVisiable = true;
     },
     getMsgFormSon(data) {
-      if (data == 'close') {
+      if (data == "close") {
         this.modalVisiable = false;
       } else {
         this.modalVisiable = false;
         this.getDataList();
       }
-    }
-  }
+    },
+  },
 };
 </script>
 
 
 <style lang="less" scoped>
-@import '../../../less/admin.less';
+@import "../../../less/admin.less";
 /deep/ .container.knowledgeTitle {
   height: 80px;
 }

+ 174 - 0
src/components/knowledgeExtra/DiagCheckRule.vue

@@ -0,0 +1,174 @@
+<template>
+	<div>
+		<div style="margin-top: 10px;">
+			<span class="span1">规则类型:</span>{{row.ruleTypeName||'-'}}
+			<span class="span1" style="margin-left:100px;">规则术语类型:</span>{{row.libTypeName||'-'}}
+			<span class="span1" style="margin-left:100px;">医学标准术语:</span>{{row.libName||'-'}}
+			<el-form :inline="true" style="margin-top: 10px;height: 45px;">
+				<el-form-item label="基础规则术语类型:">
+					<el-select v-model="filter.baseLibType" clearable placeholder="请选择" size="mini">
+						<el-option v-for="item in baseTermTypeList2" :key="item.val" :label="item.name"
+							:value="item.val">
+						</el-option>
+					</el-select>
+				</el-form-item>
+				<el-form-item label="基础医学标准术语:">
+					<el-input size="mini" v-model="filter.baseLibName" placeholder="请输入" clearable></el-input>
+				</el-form-item>
+				<el-form-item>
+					<el-button size="mini" @click="getRuleDetail">确认</el-button>
+				</el-form-item>
+			</el-form>
+		</div>
+		<el-main>
+			<el-table :data="tableData" :span-method="objectSpanMethod" border style="width: 100%;" height="600px">
+				<el-table-column prop="id" :label="'组(共'+total+'组)'" width="100"></el-table-column>
+				<el-table-column prop="description" label="规则名称"></el-table-column>
+				<el-table-column prop="msg" label="附加信息" show-overflow-tooltip></el-table-column>
+				<el-table-column prop="baseType" label="基础规则类型">
+					<template slot-scope="scope">
+						{{tofind(scope.row,1)}}
+					</template>
+				</el-table-column>
+				<el-table-column prop="baseLibType" label="基础规则术语类型">
+					<template slot-scope="scope">
+						{{tofind(scope.row,2)}}
+					</template>
+				</el-table-column>
+				<el-table-column prop="baseLibName" label="基础医学标准术语"></el-table-column>
+				<el-table-column prop="baseMinOperator" label="最小域比较符" width="80"></el-table-column>
+				<el-table-column prop="baseMinValue" label="最小域值" width="80"></el-table-column>
+				<el-table-column prop="baseMinUnit" label="最小域单位" width="80"></el-table-column>
+				<el-table-column prop="baseMaxOperator" label="最大域比较符" width="80"></el-table-column>
+				<el-table-column prop="baseMaxValue" label="最大域值" width="80"></el-table-column>
+				<el-table-column prop="baseMaxUnit" label="最大域单位" width="80"></el-table-column>
+				<el-table-column prop="baseEqOperator" label="等于阈值" width="80"></el-table-column>
+				<el-table-column prop="baseEqUnit" label="等于域单位" width="80"></el-table-column>
+			</el-table>
+		</el-main>
+	</div>
+</template>
+
+<script>
+	import api from '@api/knowledgeLib.js';
+	import config from '@api/config.js';
+	import utils from '@api/utils.js';
+	export default {
+		name: 'CheckRule',
+		data: function() {
+			return {
+				tableData: [],
+				spanArr: [],
+				pos: 0,
+				filter: {
+					baseLibType: "",
+					baseLibName: ""
+				},
+				baseTermTypeList2: [],
+				total: 0
+			};
+		},
+		created() {
+			const list = this.$props.rulelist
+			const baseTermTypeList1 = this.$props.baseTermTypeList
+			this.baseTermTypeList2 = baseTermTypeList1
+			this.filter.baseLibName=this.$props.baseLibName
+			this.filter.baseLibType=this.$props.baseLibType
+			this.tableData = list
+			this.getSpanArr(this.tableData)
+			this.total = this.tableData.slice(-1)[0].id
+		},
+		props: ['rulelist', 'baseTypeList', 'baseTermTypeList', 'row', 'description','baseLibType','baseLibName'],
+		methods: {
+			tofind(row, a) {
+				let type = ''
+				if (a == 1) {
+					type = this.$props.baseTypeList.find(it => it.val == row.baseType)
+				} else {
+					type = this.$props.baseTermTypeList.find(it => it.val == row.baseLibType)
+				}
+				return type.name
+			},
+			objectSpanMethod({
+				row,
+				column,
+				rowIndex,
+				columnIndex
+			}) {
+				if (columnIndex === 1 || columnIndex === 0 || columnIndex === 2) {
+					const _row = this.spanArr[rowIndex];
+					const _col = _row > 0 ? 1 : 0;
+					return {
+						rowspan: _row,
+						colspan: _col
+					}
+				}
+			},
+			getSpanArr(data) {
+				for (var i = 0; i < data.length; i++) {
+					if (i === 0) {
+						this.spanArr.push(1);
+						this.pos = 0
+					} else {
+						// 判断当前元素与上一个元素是否相同
+						if (data[i].id === data[i - 1].id) {
+							this.spanArr[this.pos] += 1;
+							this.spanArr.push(0);
+						} else {
+							this.spanArr.push(1);
+							this.pos = i;
+						}
+					}
+				}
+			},
+			getRuleDetail() {
+				const param = {
+					baseLibName: this.filter.baseLibName,
+					baseLibType: this.filter.baseLibType,
+					description: this.$props.description,
+					libName: this.$props.row.libName,
+					libType: this.$props.row.libType,
+					ruleType: this.$props.row.ruleType,
+				}
+				api.zskgetRuleDetail(param).then((res) => {
+						if (res.data.code == "0") {
+							// this.rulelist = res.data.data
+							let datalist = []
+							const data = res.data.data.ruleConditionDTOList
+							for (let i in data) {
+								for (let j of data[i].ruleBaseDTOList) {
+									let a = parseInt(i)
+									datalist.push({
+										id: a + 1,
+										msg: data[i].msg,
+										description: data[i].description,
+										...j
+									})
+								}
+							}
+							this.tableData = datalist
+							this.getSpanArr(this.tableData)
+						}
+					})
+					.catch((error) => {
+						console.log(error);
+					});
+			},
+		}
+	};
+</script>
+
+<style scoped lang="less">
+	/deep/.el-table .cell {
+		line-height: 25px;
+	}
+
+	.span1 {
+		font-weight: bolder;
+	}
+
+	/deep/.el-form--inline .el-form-item__label {
+		font-weight: bolder;
+		font-size: 14px;
+	}
+</style>

+ 370 - 0
src/components/knowledgeExtra/RuleCheck.vue

@@ -0,0 +1,370 @@
+<template>
+	<div>
+		<crumbs title="规则维护" :minWidth="titleWidth" class="knowledgeTitle">
+			<el-form :inline="true" class="demo-form-inline">
+				<el-form-item label="规则名称:">
+					<el-input size="mini" v-model="filter.description" placeholder="请输入" clearable></el-input>
+				</el-form-item>
+				<el-form-item label="规则类型:">
+					<el-select v-model="filter.ruleType" clearable placeholder="请选择" size="mini">
+						<el-option v-for="item in ruleTypeList" :key="item.val" :label="item.name" :value="item.val">
+						</el-option>
+					</el-select>
+				</el-form-item>
+				<el-form-item label="规则术语类型:">
+					<el-select v-model="filter.libType" clearable placeholder="请选择" size="mini">
+						<el-option v-for="item in ruleTermTypeList" :key="item.val" :label="item.name"
+							:value="item.val">
+						</el-option>
+					</el-select>
+				</el-form-item>
+				<el-form-item label="医学标准术语:">
+					<el-input size="mini" v-model="filter.libName" placeholder="请输入" clearable></el-input>
+				</el-form-item>
+			</el-form>
+			<el-form class="secLine" :inline="true">
+				<el-form-item label="基础规则术语类型:">
+					<el-select v-model="filter.baseLibType" clearable placeholder="请选择" size="mini">
+						<el-option v-for="item in baseTermTypeList" :key="item.val" :label="item.name" :value="item.val">
+						</el-option>
+					</el-select>
+				</el-form-item>
+				<el-form-item label="基础医学标准术语:">
+					<el-input size="mini" v-model="filter.baseLibName" placeholder="请输入" clearable></el-input>
+				</el-form-item>
+				<el-form-item>
+					<el-button size="mini" @click="filterDatas">确认</el-button>
+				</el-form-item>
+			</el-form>
+		</crumbs>
+		<div class="contents knowledgeContents">
+			<el-table :data="list" border style="width: 100%">
+				<el-table-column type="index" :index="indexMethod" label="编号" width="120"></el-table-column>
+				<el-table-column prop="ruleTypeName" label="规则类型" width="240">
+				</el-table-column>
+				<el-table-column prop="libTypeName" label="规则术语类型"></el-table-column>
+				<el-table-column prop="libName" label="医学标准术语">
+				</el-table-column>
+				<el-table-column label="操作" width="120" fixed="right">
+					<template slot-scope="scope">
+						<el-button type="text" size="small" @click="checkData(scope.row)">查看</el-button>
+					</template>
+				</el-table-column>
+			</el-table>
+			<el-pagination :current-page.sync="currentPage" @current-change="currentChange" background
+				:page-size="pageSize" :page-sizes="pageSizeArr" @size-change="handleSizeChange" :layout="pageLayout"
+				:total="total"></el-pagination>
+		</div>
+		<el-dialog title="查看" :visible.sync="dialogVisible" :before-close="closecheckDialog" width="80rem"
+			v-if="dialogVisible" :close-on-click-modal="false" :fullscreen="true">
+			<CheckRule :rulelist="rulelist" :baseTypeList="baseTypeList" :baseTermTypeList="baseTermTypeList"
+				:row="row" :description="filter.description" :baseLibType="filter.baseLibType" :baseLibName="filter.baseLibName">
+			</CheckRule>
+			<div style="text-align: center;">
+				<el-button @click="closecheckDialog" style="width: 180px;">关闭</el-button>
+			</div>
+		</el-dialog>
+	</div>
+</template>
+
+<script>
+	import api from '@api/knowledgeLib.js';
+	import config from '@api/config.js';
+	import utils from '@api/utils.js';
+	import CheckRule from "./DiagCheckRule.vue";
+
+
+	export default {
+		name: 'ZskRuleCheck',
+		data: function() {
+			return {
+				list: [],
+				searched: false,
+				filter: {
+					// 	parStatus: '',
+					// 	parDescription: '',
+					// 	parConceptName: '',
+					// 	parRuleType: '',
+					description: '', //规则名称
+					ruleType: '', //规则类型
+					libType: '', //规则术语类型
+					libName: '', //医学标准术语
+					baseLibType: '', //基础规则术语类型
+					baseLibName: '', //基础医学标准术语
+				},
+				ruleTypeList: [], //规则类型列表  1
+				ruleTermTypeList: [], //规则术语类型列表  2
+				conceptList: [], //医学标准术语列表 3
+				baseTypeList: [], //基础规则类型列表  4
+				baseTermTypeList: [], //基础规则术语类型列表 5
+				rulelist: [], //查看
+				cacheData: {},
+				currentPage: 1,
+				pageSize: config.pageSize,
+				pageSizeArr: config.pageSizeArr,
+				pageLayout: config.pageLayout,
+				total: 0,
+				titleWidth: '970px', //头部最小宽度
+				dialogVisible: false,
+				row:{},
+			};
+		},
+		components: {
+			CheckRule
+		},
+		created() {
+			// const param = this.$route.params;
+			// console.log(param)
+			// if (param.currentPage) {
+			// 	this.inCurrentPage = param.currentPage;
+			// }
+			// if (param.filter) {
+			// 	this.filter = param.filter;
+			// }
+			const that = this;
+			//返回时避免参数未赋值就获取列表
+			setTimeout(function() {
+				that.getDataList();
+			});
+			this.getDict();
+		},
+		watch: {
+			filter: {
+				handler: function() {
+					this.searched = false;
+				},
+				deep: true
+			}
+		},
+		// beforeRouteEnter(to, from, next) {
+		//     next(vm => {
+		//         //const pm = to.param;
+		//         Object.assign(vm, to.params);
+		//         vm.inCurrentPage=to.params.currentPage;
+		//     })
+		// },
+		methods: {
+			getDict() {
+				api.zskgetDict().then(res => {
+						if (res.data.code == '0') {
+							const data = res.data.data;
+							this.ruleTypeList = data[-101]
+							this.ruleTermTypeList = data[-102]
+							this.baseTypeList = data[-103]
+							this.baseTermTypeList = data[-104]
+							// const arr = data['20'].map(it => it.val);
+							// //this.dict = arr.join(",");
+							// //this.msgDict=(data['21'].map((it)=>it.val)||[]).join(",");
+							// localStorage.setItem('zskDicts', arr.join(','));
+							// localStorage.setItem(
+							// 	'zskMsgDict',
+							// 	(data['21'].map(it => it.val) || []).join(',')
+							// );
+							// 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 => {
+						console.log(error);
+					});
+			},
+			statusTrans(type) {
+				const obj = this.ruleTypeList.find(it => it.type === type);
+				return obj && obj.name;
+			},
+			handleSizeChange(val) {
+				this.pageSize = val;
+				this.currentPage = utils.getCurrentPage(
+					this.currentPage,
+					this.total,
+					this.pageSize
+				);
+				this.getDataList();
+			},
+			filterDatas() {
+				this.currentPage = 1;
+				this.getDataList(1);
+			},
+			getDataList(flag, isTurnPage) {
+				const params = this.getFilterItems(isTurnPage);
+				this.searched = true;
+				const loading = this.$loading({
+					lock: true,
+					text: 'Loading',
+					spinner: 'el-icon-loading',
+					background: 'rgba(0, 0, 0, 0.7)'
+				});
+				api.zskgetRulePage(params).then(res => {
+						loading.close();
+						if (res.data.code == '0') {
+							const data = res.data.data;
+							this.list = data.records;
+							if (!flag) {
+								//搜索时不缓存
+								this.cacheData[params.current] = data.records;
+							} else {
+								this.cacheData = {};
+							}
+							this.total = data.total;
+							if (this.inCurrentPage !== undefined) {
+								this.currentPage = this.inCurrentPage;
+								this.inCurrentPage = undefined;
+							}
+						} else {
+							this.warning(res.data.msg || '获取列表数据失败');
+						}
+					})
+					.catch(error => {
+						loading.close();
+						console.log(error);
+					});
+			},
+			getFilterItems(isTurnPage) {
+				//翻页时筛选条件没点确定则清空
+				if (isTurnPage && !this.searched) {
+					this.clearFilter();
+				}
+				const param = {
+					current: this.inCurrentPage || this.currentPage,
+					size: this.pageSize,
+					libName: this.filter.libName.trim(),
+					libType: this.filter.libType,
+					ruleType: this.filter.ruleType,
+					baseLibName: this.filter.baseLibName.trim(),
+					baseLibType: this.filter.baseLibType,
+					description: this.filter.description.trim(),
+				};
+				return param;
+			},
+			indexMethod(index) {
+				return (this.currentPage - 1) * this.pageSize + index + 1;
+			},
+			currentChange(next) {
+				this.currentPage = next;
+				/*if (this.cacheData[next]) {       //如果已请求过该页数据,则使用缓存不重复请求
+				            this.list = this.cacheData[next];
+				          } else {*/
+				this.getDataList(1, true);
+				//}
+			},
+			warning(msg, type) {
+				this.$message({
+					showClose: true,
+					message: msg,
+					type: type || 'warning'
+				});
+			},
+			checkData(row) {
+				console.log(row)
+				this.row=row
+				if(!this.searched) {
+					this.clearFilter();
+				}
+				const param = {
+					baseLibName: this.filter.baseLibName,
+					baseLibType: this.filter.baseLibType,
+					description: this.filter.description,
+					libName: row.libName,
+					libType: row.libType,
+					ruleType: row.ruleType,
+				}
+				api.zskgetRuleDetail(param).then((res) => {
+						if (res.data.code == "0") {
+							// this.rulelist = res.data.data
+							console.log(res.data.data.ruleConditionDTOList)
+							let datalist =[]
+							const data=res.data.data.ruleConditionDTOList
+							for(let i in data){
+								for(let j of data[i].ruleBaseDTOList){
+									let a = parseInt(i)
+									datalist.push({
+										id:a+1,
+										msg:data[i].msg,
+										description:data[i].description,
+										...j
+									})
+								}
+							}
+							this.rulelist=datalist
+							console.log(datalist)
+							this.dialogVisible = true
+						}
+					})
+					.catch((error) => {
+						console.log(error);
+					});
+			},
+			closecheckDialog() {
+				this.dialogVisible = false
+			},
+			clearFilter() {
+				this.filter = {
+					description: '',
+					ruleType: '',
+					libType: '',
+					libName: '',
+					baseLibType: '',
+					baseLibName: '',
+				};
+			},
+		}
+	};
+</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;
+	}
+
+	.review {
+		color: #22ccc8;
+	}
+
+	.el-table .cell {
+		overflow: hidden;
+		white-space: nowrap;
+	}
+
+	#upFile {
+		display: none !important;
+	}
+
+	.unvailable {
+		color: #fe7d3d;
+
+		&:hover {
+			color: #f19061;
+		}
+	}
+
+	/deep/.el-dialog__body{
+		 padding-top:0px
+	}
+	/deep/.el-dialog__title{
+		color: #333333;
+		font-weight: bold;
+		font-size: 16px;
+	}
+	/deep/.el-dialog__header{
+		border-left:4px #48C5D7 solid
+	}
+</style>

+ 6 - 0
src/routes.js

@@ -36,6 +36,7 @@ import AddPlan from '@components/icss/plan/AddPlan.vue';  //关联维护设置
 import Bill from '@components/icss/bill/Bill.vue';  //开单
 import AddBill from '@components/icss/bill/AddBill.vue';  //开单-编辑
 import ZskRuleManager from '@components/knowledgeExtra/RuleManager.vue';  //知识库规则维护
+import ZskRuleCheck from '@components/knowledgeExtra/RuleCheck.vue';  //知识库规则维护
 import AddZskRule from '@components/knowledgeExtra/AddNewRule.vue';   //知识库添加规则
 import SonHospital from '@components/icss/sonhospital/SonHospital.vue';  //子医院维护
 import CallRecordManager from '@components/callRecord/CallRecordManager.vue';  //知识库规则维护
@@ -95,6 +96,11 @@ export default [
         component: ZskRuleManager,
         name: 'ZskRuleManager',
       },
+	  {
+	    path: 'GZWH-GZCX',
+	    component: ZskRuleCheck,
+	    name: 'ZskRuleCheck',
+	  },
       { // 接口管理-调用记录
         path: 'JKGL-DYJL',
         component: CallRecordManager,

+ 33 - 2
vue.config.js

@@ -1,6 +1,7 @@
 const path = require('path');
 //const proxy_path = 'http://192.168.2.241:80';
-const proxy_path = 'http://192.168.2.241:84';
+// const proxy_path = 'http://192.168.2.241:84';
+const proxy_path = 'http://192.168.2.236:6060';
 //const proxy_path = 'http://192.168.2.236:88';
 //const proxy_path = 'http://192.168.2.236:6060';
 //const proxy_path = 'http://192.168.2.241:6060';
@@ -33,7 +34,37 @@ module.exports = {
                 target: proxy_path,
                 changeOrigin: true,
                 secure: false
-            }
+            },
+		  '/klRule': {
+			target: proxy_path,
+			changeOrigin: true,
+			secure: false
+		  },
+		  '/tran': {
+			target: proxy_path,
+			changeOrigin: true,
+			secure: false
+		  },
+		  '/klRulePlan': {
+			target: proxy_path,
+			changeOrigin: true,
+			secure: false
+		  },
+		  '/kl': {
+			target: proxy_path,
+			changeOrigin: true,
+			secure: false
+		  },
+		  '/klDisease': {
+			target: proxy_path,
+			changeOrigin: true,
+			secure: false
+		  },
+		  '/cache': {
+			target: proxy_path,
+			changeOrigin: true,
+			secure: false
+		  }
         }
     },
     configureWebpack:{