Browse Source

术语类型

wyq 4 years ago
parent
commit
37a0cf4239

+ 6 - 0
src/api/config.js

@@ -585,6 +585,12 @@ export default {
     'ruleExportExcel':'/api/cdssman/test/rule/ruleExportExcel',
     'autoRuleTest':'/api/cdssman/test/rule/ruleTest',
     'clearDrug':'/api/cdssman/cache/clearDrug',
+    //药品维护
+    'getPageList': '/api/cdssman/klDrugRegister/getPage',
+    'getsearchDrug': '/api/cdssman/klDrugRegister/searchDrug',
+    'saveOrUpdate': '/api/cdssman/klDrugRegister/saveOrUpdate',
+    'getByParam': '/api/cdssman/klDrugRegister/getByParam',
+    'paramDelete': '/api/cdssman/klDrugRegister/delete',
   },
   menuIconList: { //菜单对应图标
     'YH-KZT': 'el-icon-menu',

+ 16 - 0
src/api/icss.js

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

+ 248 - 284
src/components/basicKnow/AddTerm.vue

@@ -4,6 +4,7 @@
     <div class="contents">
       <div class="content">
         <h3>添加术语:</h3>
+
         <p class="titl">医学标准术语:</p>
         <table class="deptbox" v-if="id == ''">
           <tr>
@@ -21,14 +22,14 @@
           </tr>
           <tr>
             <td class="ind">1</td>
-            <td :title="data.name&&data.name.length>9?data.name:''">
+            <td :title="data.libName&&data.libName.length>9?data.libName:''">
               <!-- 修改时标准词不能修改,修改了会当做新增处理 4-17 -->
-              <p v-if="id">{{data.name}}</p>
+              <p v-if="id">{{data.libName}}</p>
               <!-- 4-18 需求变更 -->
               <input
                 v-else
                 type="text"
-                v-model.trim="data.name"
+                v-model.trim="data.libName"
                 placeholder="请输入术语"
                 maxlength="50"
                 @blur="handleBlur(1)"
@@ -103,7 +104,7 @@
                 <!-- <el-input v-model="item.name" placeholder="请输入术语" maxlength="30" size="small" @input.native="handleInput(2,index)"></el-input> -->
                 <input
                   type="text"
-                  v-model.trim="item.name"
+                  v-model.trim="item.libName"
                   :title="item.name"
                   placeholder="请输入术语"
                   maxlength="50"
@@ -165,23 +166,7 @@
               <td colspan="7" class="addSpan">+</td>
             </tr>
           </table>
-          <div class="actionDo">
-            <!-- <div class="btnWrap"> -->
-            <!-- <el-button type="primary" size="mini" v-if="show" @click="comfirn(14)">确认修改</el-button> -->
-            <!-- <el-button plain size="mini" v-if="show" @click="toggleShow(1)">放弃修改</el-button>
-            <el-button plain size="mini" @click="toggleShow(2)" v-if="!show">修改标准词</el-button>-->
-            <!-- </div> -->
-            <div class="radioWrap" v-if="show">
-              <el-radio-group v-model="radioVal" size="mini">
-                <el-radio
-                  v-for="(item,index) in allwords"
-                  :label="index"
-                  :key="index"
-                  :disabled="index == 0"
-                >选为标准词</el-radio>
-              </el-radio-group>
-            </div>
-          </div>
+          <div class="actionDo"></div>
         </div>
         <p class="titl" v-if="id == ''">同义词:</p>
         <table class="deptbox" v-if="id == ''">
@@ -311,6 +296,7 @@
               v-if="data.type=='辅助检查项目' || data.type=='辅助检查子项目'"
               class="marT"
             >
+              <span class="address-placeholder">请输入</span>
               <div
                 class="test_box"
                 ref="Maincontent"
@@ -417,18 +403,17 @@
             </el-form-item>
             <el-form-item label="疾病就诊科室:" v-if="data.type=='疾病'" class="marT">
               <el-select
-                v-model="value"
-                multiple
+                clearable
+                remote
                 filterable
-                allow-create
-                default-first-option
-                placeholder="请选择文章标签"
+                :remote-method="searchConcept"
+                v-model.trim="value"
               >
                 <el-option
-                  v-for="item in options"
-                  :key="item.value"
-                  :label="item.label"
-                  :value="item.value"
+                  v-for="item in conceptList"
+                  :key="item.conceptId"
+                  :label="item.conceptName"
+                  :value="item.conceptId"
                 ></el-option>
               </el-select>
             </el-form-item>
@@ -576,6 +561,68 @@
                 type="textarea"
               ></el-input>
             </el-form-item>
+            <el-form-item v-if="data.type=='体格检查结果'" label="科室:" prop="description" class="marT">
+              <searchTerm v-model="klVitalResultVO.deptList" :type="115"></searchTerm>
+              <!-- <el-select
+                v-model="klVitalResultVO.deptList"
+                multiple
+                filterable
+                remote
+                reserve-keyword
+                placeholder="请输入关键词"
+                :remote-method="searchConcept"
+              >
+                <el-option
+                  v-for="item in conceptList"
+                  :key="item.conceptId"
+                  :label="item.conceptName"
+                  :value="item.conceptId"
+                ></el-option>
+              </el-select> -->
+            </el-form-item>
+            <el-form-item v-if="data.type=='体格检查结果'" label="部位:" prop="description" class="marT">
+              <el-select
+                v-model="klVitalResultVO.partList"
+                multiple
+                filterable
+                remote
+                reserve-keyword
+                placeholder="请输入关键词"
+                :remote-method="searchConcept"
+              >
+                <el-option
+                  v-for="item in conceptList"
+                  :key="item.conceptId"
+                  :label="item.conceptName"
+                  :value="item.conceptId"
+                ></el-option>
+              </el-select>
+            </el-form-item>
+            <el-form-item v-if="data.type=='体格检查结果'" label="不适宜人群:" prop="description" class="marT">
+              <div-editable v-model="klVitalResultVO.suitablePopNo" :Maincontent="'Maincontent1'"></div-editable>
+            </el-form-item>
+            <el-form-item v-if="data.type=='体格检查结果'" label="操作方法:" prop="description" class="marT">
+              <el-input
+                v-model.trim="klVitalResultVO.checkMethod"
+                maxlength="200"
+                placeholder="请输入编码"
+                row="3"
+                type="textarea"
+              ></el-input>
+            </el-form-item>
+            <el-form-item v-if="data.type=='手术和操作'" label="级别分类:" prop="description" class="marT">
+              <el-select v-model="klOperationVO.operationLevel" placeholder="请选择">
+                <el-option
+                  v-for="item in operationLevelList"
+                  :key="item.id"
+                  :label="item.label"
+                  :value="item.id"
+                ></el-option>
+              </el-select>
+            </el-form-item>
+            <el-form-item v-if="data.type=='手术和操作'" label="手术操作代码:" prop="description" class="marT">
+              <div-editable v-model="klOperationVO.operationCode" :Maincontent="'Maincontent'"></div-editable>
+            </el-form-item>
             <!-- <el-form-item
               v-if="data.type=='症状'"
               label="填写单患者界面展示通俗内容:"
@@ -604,6 +651,8 @@
   </div>
 </template>
 <script type="text/javascript">
+import DivEditable from './DivEditable';
+import searchTerm from './searchTerm';
 import api from '@api/knowledgeTree.js';
 import pinyin from '../../js/Convert_Pinyin.js';
 import utils from '@api/utils.js';
@@ -614,14 +663,51 @@ export default {
     return {
       minTitle: '基础术语维护-添加',
       data: {
-        name: '',
+        libName: '',
         type: '',
-        code: '',
+        libType: '',
         remark: '',
         isConcept: 1,
-        spell: ''
+        spell: '',
+        libId: '',
+        isHasCommon: ''
+      },
+      klOperationVO: {
+        conceptId: null,
+        remark: null,
+        operationLevel: 0, //手术级别
+        operationCode: '' //手术操作码
       },
-      radioVal: '',
+      klVitalResultVO: {
+        conceptId: null,
+        remark: null,
+        deptList: [],//科室
+        partList:[],//部位
+        suitablePopNo: '', //不适宜人群
+        checkMethod: '' //操作方法
+      },
+      operationLevelList: [
+        {
+          id: '0',
+          label: '0'
+        },
+        {
+          id: '1',
+          label: '1'
+        },
+        {
+          id: '2',
+          label: '2'
+        },
+        {
+          id: '3',
+          label: '3'
+        },
+        {
+          id: '4',
+          label: '4'
+        }
+      ],
       typeList: [],
       id: '',
       synonymous: [], //同义词
@@ -631,7 +717,6 @@ export default {
       colspans: 6,
       currentPage: 1,
       pageSize: 10,
-      show: false,
       tmpSynonymous: [],
       sexType: '通用',
       rangeSelect: '内',
@@ -686,98 +771,45 @@ export default {
       description: '',
       explains: '',
       composing: false,
-      critical: '' //危急标识
+      critical: '', //危急标识
+      conceptList: []
     };
   },
   created() {
     this.getTypeList();
     const id = this.$route.params.id;
+    const libType = this.$route.params.libType;
     const copy = this.$route.params.copy || '';
     this.copy = copy;
     if (id) {
       this.minTitle = copy ? '基础术语维护-复制' : '基础术语维护-修改';
       this.id = id;
       this.colspan = 5;
-      this.getDetail(id);
-    }
-  },
-  watch: {
-    radioVal(newVal, preVal) {
-      if (newVal && newVal != preVal) {
-        this.changeState(newVal);
-      }
+      this.getDetail(id, libType);
     }
   },
   methods: {
-    handleInput(event) {
-      let text = event.target.innerText;
-      this.valueHandle(event, text);
-    },
-    //长度计算
-    validateTextLength(value) {
-      // 中文、中文标点、全角字符按1长度,英文、英文符号、数字按1长度计算
-      let cnReg = /([\u4e00-\u9fa5]|[\u3000-\u303F]|[\uFF00-\uFF60])/g;
-      let mat = value.match(cnReg);
-      let length;
-      if (mat) {
-        length = mat.length + (value.length - mat.length);
-        return length;
-      } else {
-        return value.length;
-      }
-    },
-    valueHandle(event, strVale) {
-      let _this = this;
-      let text = strVale;
-      this.sendContent = text;
-      if (this.composing) {
-        return;
-      }
-      let len = this.validateTextLength(text);
-      if (len > 200) {
-        this.$refs.Maincontent.innerHTML = text.substr(0, 200);
-        this.$refs.Maincontent.focus();
-      }
-      setTimeout(() => {
-        _this.keepLastIndex(event.target);
-      }, 5);
-      // 拓展 如果想要只需要前100位数据
-      // this.content = this.content.substring(0, 100)
-    },
-    handleStart() {
-      this.composing = true;
-    },
-    /**
-     * 中文输入结束
-     */
-    handleEnd($event) {
-      this.composing = false;
-      let text = $event.target.innerHTML;
-      // console.log($event.target.innerHTML)
-      this.valueHandle($event, text);
-    },
-    handleInput(event) {
-      let text = event.target.innerText;
-      this.valueHandle(event, text);
-    },
-    keepLastIndex(obj) {
-      if (window.getSelection) {
-        // ie11 10 9 ff safari
-        obj.focus(); // 解决ff不获取焦点无法定位问题
-        let range = window.getSelection(); // 创建range
-        range.selectAllChildren(obj); // range 选择obj下所有子内容
-        range.collapseToEnd(); // 光标移至最后
-      } else if (document.selection) {
-        // ie10 9 8 7 6 5
-        let range = document.selection.createRange(); // 创建选择对象
-        // var range = document.body.createTextRange();
-        range.moveToElementText(obj); // range定位到obj
-        range.collapse(false); // 光标移至最后
-        range.select();
-      }
+    //获取科室
+    searchConcept(val) {
+      const param = {
+        excludedConceptIds: [],
+        libType: '115',
+        name: val
+      };
+      api
+        .searchConcept(param)
+        .then(res => {
+          if (res.data.code == '0') {
+            const data = res.data.data;
+            this.conceptList = data;
+          }
+        })
+        .catch(error => {
+          console.log(error);
+        });
     },
     clearDataCi() {
-      this.data.code = '';
+      this.data.libType = '';
     },
     dragAdd(ev) {
       utils.dragBox('dragModalWrap', 'dragModalTitle', 'add');
@@ -798,7 +830,6 @@ export default {
           // 修改时无需赋值
           if (!flag) {
             this.dioType = this.dioTypeList[0].val;
-            console.log(this.dioTypeList[0].val);
           }
         }
       });
@@ -842,96 +873,80 @@ export default {
         }
       });
     },
-    changeState(val) {
-      let tmpAllwords = JSON.parse(JSON.stringify(this.synonymous));
-      for (let i = 0; i < tmpAllwords.length; i++) {
-        if (i + 1 == val) {
-          tmpAllwords[i].isConcept = 1;
-          tmpAllwords[i].type = this.data.type;
-        } else {
-          tmpAllwords[i].isConcept = 0;
-        }
-      }
-      this.tmpSynonymous = tmpAllwords;
-      this.synonymous = tmpAllwords;
-    },
-    toggleShow(num) {
-      let tmpShow = this.show;
-      this.show = !tmpShow;
-      if (num == 1) {
-        this.changeState(-1);
-        this.radioVal = '';
-      }
-    },
     reViewData(data) {
       let tmpObj = [
         {
           isConcept: data.isConcept,
-          name: data.libName,
+          libName: data.libName,
           remark: data.remark,
           spell: data.spell,
           type: data.typeName,
           conceptId: data.conceptId,
-          libId: data.libId,
+          libId: this.copy ? '' : data.libId,
           isHasCommon: data.isHasCommon,
           synonymName: data.synonymName,
           status: data.status,
-          typeId: data.libType
+          libType: data.libType
         }
       ];
       for (let i = 0; i < data.klConceptSub.length; i++) {
         let tmp = data.klConceptSub[i];
         tmp.name = tmp.synonymName;
         tmp.type = tmp.typeName;
-        tmp.typeId = tmp.libType;
+        tmp.libType = tmp.libType;
       }
+
       data.libName = tmpObj;
       data.otherNames = data.klConceptSub;
       return data;
     },
-    getDetail(ids) {
+    getDetail(ids, libType) {
       if (ids) {
-        api.getBaseConceptAll({ conceptId: ids }).then(res => {
-          const result = res.data;
-          let redata = this.reViewData(result.data);
-          if (result.code == 0) {
-            this.data = redata.libName[0];
-            this.singleword = redata.libName;
-            this.synonymous = redata.otherNames;
-            this.allwords = redata.libName.concat(redata.otherNames);
-            this.showMore = redata.isHasCommon; //是否支持通用扩展
-            this.maxAge = redata.maxAge;
-            this.minAge = redata.minAge;
-            this.maxValue = redata.maxVal;
-            this.minValue = redata.minVal;
-            this.unit = redata.unit;
-            this.rangeSelect = redata.scopeType == '1' ? '外' : '内';
-            this.icdCode = redata.icdCode;
-            this.description = redata.description;
-            this.explains = redata.explains;
-            this.drug = redata.drug;
-            const type = redata.type;
+        api
+          .getBaseConceptAll({ conceptId: ids, libType: libType })
+          .then(res => {
+            const result = res.data;
+            let redata = this.reViewData(result.data);
+            if (result.code == 0) {
+              this.data = redata.libName[0];
+              this.klOperationVO = redata.klOperationDTO?redata.klOperationDTO:this.klOperationVO
+              this.klVitalResultVO = redata.klVitalResultDTO?redata.klVitalResultDTO:this.klVitalResultVO
+              this.singleword = redata.libName;
+              this.synonymous = redata.otherNames;
+              this.allwords = redata.libName.concat(redata.otherNames);
+              this.showMore = redata.isHasCommon; //是否支持通用扩展
+              this.maxAge = redata.maxAge;
+              this.minAge = redata.minAge;
+              this.maxValue = redata.maxVal;
+              this.minValue = redata.minVal;
+              this.unit = redata.unit;
+              this.rangeSelect = redata.scopeType == '1' ? '外' : '内';
+              this.icdCode = redata.icdCode;
+              this.description = redata.description;
+              this.explains = redata.explains;
+              this.drug = redata.drug;
+              const type = redata.type;
 
-            if (type == '诊断') {
-              this.dioType = redata.classify || 'Ⅰ'; //类型,默认展示Ⅰ类
-              const deptConptId = redata.deptId;
-              this.getDioType(true);
-              this.getDdeptList(deptConptId);
-            }
-            // this.sexType = result.data.sexType;
-            let sexType = redata.sexType;
-            this.sex.map((v, i) => {
-              if (v.value == sexType) {
-                this.sexType = v.name;
+              if (type == '诊断') {
+                this.dioType = redata.classify || 'Ⅰ'; //类型,默认展示Ⅰ类
+                const deptConptId = redata.deptId;
+                this.getDioType(true);
+                this.getDdeptList(deptConptId);
               }
-            });
-          } else {
-            this.$message({
-              message: result.msg,
-              type: 'warning'
-            });
-          }
-        });
+              // this.sexType = result.data.sexType;
+              let sexType = redata.sexType;
+              this.sex.map((v, i) => {
+                if (v.value == sexType) {
+                  this.sexType = v.name;
+                }
+              });
+            } else {
+              this.$message({
+                message: result.msg,
+                type: 'warning'
+              });
+            }
+          });
       }
     },
     getTypeList() {
@@ -975,16 +990,6 @@ export default {
           console.log(error);
         });
     },
-    // handleInput(index,name){
-    /* handleInput(type,index){
-        // 可输入内容:字母、数字、汉字、特殊字符:%  ——  其余不可输入;
-        // if(!name){//标准词输入
-        if(type==1){//标准词输入
-          this.data.name = this.data.name.replace(/[^%0-9a-zA-Z\u4e00-\u9fa5]/g,'');
-        }else{
-          this.synonymous[index].name = this.synonymous[index].name.replace(/[^%0-9a-zA-Z\u4e00-\u9fa5]/g,'');
-        }
-      },*/
     handleBlur(type, index, flg) {
       // 不能为纯数字、纯字符、纯数字加字符 4-18
       // const pattern = /[^~@#$%^&*_\-+=,,.。::"“??”;;、!!0-9]/g;
@@ -992,20 +997,20 @@ export default {
       const pattern = /[^0-9]/g;
       if (type == 1) {
         //标准词输入
-        if (this.data.name && !pattern.test(this.data.name)) {
+        if (this.data.libName && !pattern.test(this.data.libName)) {
           this.$message({
             // message:'无法输入纯数字或者纯字符,请输入正确数据!',
             message: '无法输入纯数字,请输入正确数据!',
             type: 'warning'
           });
-          // this.data.name = '';
+          // this.data.libName = '';
           this.unfit = true;
         } else {
           let data = this.data;
-          data.spell = pinyin.getCamelChars(data.name);
+          data.spell = pinyin.getCamelChars(data.libName);
           this.unfit = false;
           this.searchType = 'standard';
-          this.getSimilarList(this.data.name);
+          this.getSimilarList(this.data.libName);
         }
       } else if (type == 2) {
         // 修改时术语名称、拼音和类型均不能修改
@@ -1136,19 +1141,14 @@ export default {
     },
     // 保存基础术语
     comfirn(flg) {
-      if (!this.data.name) {
+      if (!this.data.libName) {
         this.warning('请输入医学标准术语名称');
         return;
       }
-      if (!this.data.code && !this.unfit && !this.data.type) {
+      if (!this.data.libType && !this.unfit && !this.data.type) {
         this.warning('请选择术语类型');
         return;
       }
-      // 处于修改标准词状态且没有选中,不能保存
-      if (this.show && !this.radioVal) {
-        this.warning('请先选择标准词');
-        return;
-      }
       if (this.data.type == '疾病' && !this.icdCode) {
         this.warning('请输入ICD10编码');
         return;
@@ -1192,7 +1192,6 @@ export default {
           }
         }
       }
-      console.log(this.drug);
       if (
         this.data.type == '药品通用名' &&
         (this.drug === '' || this.drug === null)
@@ -1227,10 +1226,9 @@ export default {
       for (let i = 0; i < realData.length; i++) {
         let obj = {};
         realData[i].synonymName = realData[i].name;
-        realData[i].typeId = undefined;
         realData[i].conceptId = undefined;
         realData[i].status = undefined;
-        realData[i].libType = this.data.code || this.data.typeId;
+        realData[i].libType = this.data.libType;
         if (this.copy) {
           realData[i].libId = undefined;
         }
@@ -1243,7 +1241,7 @@ export default {
       }
       // 校验是否有名称全为数字
       const pattern = /[^0-9]/g;
-      const tmpData = this.data.name;
+      const tmpData = this.data.libName;
       if (tmpData && !tmpData.match(pattern)) {
         this.$message({
           message: '无法输入纯数字,请输入正确数据!',
@@ -1271,63 +1269,48 @@ export default {
       //   this.warning('请输入填写单患者界面展示通俗内容');
       //   return;
       // }
-      console.log(this.data.typeId, this.data.code);
       let params,
         sexCode = null;
-      if (this.showMore == 1) {
-        // 下拉文字转code
-        this.sex.map((v, i) => {
-          if (v.name == this.sexType) {
-            sexCode = v.value;
-          }
-        });
-        params = {
-          conceptId: this.copy ? '' : this.id,
-          isConcept: this.data.isConcept,
-          libName: this.data.name,
-          remark: this.data.remark,
-          spell: this.data.spell,
-          status: this.data.status || 1,
-          libType: this.data.code || this.data.typeId,
-          drug: this.drug,
-          synonymName: this.data.synonymName,
-          isHasCommon: 1,
-          libId: this.copy ? '' : this.data.libId,
-          klConceptSub: detailList || [],
-          sexType: sexCode,
-          scopeType: this.rangeSelect == '外' ? '1' : '0',
-          maxAge: this.maxAge,
-          minAge: this.minAge,
-          maxVal: this.maxValue || null,
-          minVal: this.minValue || null,
-          unit: this.unit || null,
-          icdCode: this.icdCode || undefined
-        };
-      } else {
-        params = {
-          conceptId: this.copy ? '' : this.id,
-          isConcept: this.data.isConcept || 1,
-          libName: this.data.name,
-          remark: this.data.remark,
-          spell: this.data.spell,
-          status: this.data.status || 1,
-          drug: this.drug,
-          libType: this.data.code || this.data.typeId,
-          // typeId:this.data.typeId||this.data.code,
-          libId: this.copy ? '' : this.data.libId,
-          isHasCommon: this.data.isHasCommon || 0,
-          synonymName: '',
-          klConceptSub: detailList || [],
-          sexType: sexCode,
-          scopeType: this.rangeSelect == '外' ? 1 : 0,
-          maxAge: this.maxAge,
-          minAge: this.minAge,
-          maxVal: this.maxValue || null,
-          minVal: this.minValue || null,
-          unit: this.unit || null,
-          icdCode: this.icdCode || undefined
-        };
-      }
+      this.sex.map((v, i) => {
+        if (v.name == this.sexType) {
+          sexCode = v.value;
+        }
+      });
+      params =
+        this.data.libType == 106
+          ? {
+              ...this.data,
+              klOperationVO: this.klOperationVO,
+              klConceptSub: detailList || [],
+              sexType: sexCode,
+              maxAge: this.maxAge,
+              minAge: this.minAge,
+              status: this.data.status || 1
+            }
+          : this.data.libType == 105
+          ? {
+              ...this.data,
+              klVitalResultVO: this.klVitalResultVO,
+              klConceptSub: detailList || [],
+              sexType: sexCode,
+              maxAge: this.maxAge,
+              minAge: this.minAge,
+              status: this.data.status || 1
+            }
+          : {
+              ...this.data,
+              klConceptSub: detailList || [],
+              status: this.data.status || 1,
+              sexType: sexCode,
+              scopeType: this.rangeSelect == '外' ? '1' : '0',
+              maxAge: this.maxAge,
+              minAge: this.minAge,
+              maxVal: this.maxValue || null,
+              minVal: this.minValue || null,
+              unit: this.unit || null,
+              icdCode: this.icdCode || undefined
+            };
+      console.log(params);
       // return false
       this.saveDisable = true; //提交保存按钮不可点击,返回结果时才可点击,防止频繁发送请求
       api.saveBaseConceptInfo(params).then(res => {
@@ -1339,13 +1322,6 @@ export default {
             name: 'BasicTermsMaintenance',
             params: Object.assign({}, this.$route.params, { currentPage: 1 })
           });
-          /*if(flg == 14){
-              this.getDetail(this.id)
-              this.radioVal = ''
-              this.show = false
-            }else{
-              this.$router.push({name:'MedicalName'});
-            }*/
         } else {
           this.warning(res.data.msg);
         }
@@ -1356,11 +1332,13 @@ export default {
       // console.log("输入年龄")
     },
     selectType(e) {
-      console.log(e);
       this.typeList.map((v, i) => {
         if (v.name == e) {
+          console.log(v.code);
           this.showMore = v.isHasCommon;
-          this.data.code = v.code;
+          this.data.libType = v.code;
+          this.data.isHasCommon = v.isHasCommon;
+          this.conceptList = [];
         }
       });
       if (e == '诊断') {
@@ -1373,7 +1351,9 @@ export default {
     }
   },
   components: {
-    SimilarListDrag
+    SimilarListDrag,
+    DivEditable,
+    searchTerm
   }
 };
 </script>
@@ -1384,23 +1364,7 @@ tr,
 td {
   list-style: none;
 }
-.test_box {
-  min-height: 38px;
-  max-height: 300px;
-  _height: 120px;
-  margin-left: auto;
-  margin-right: auto;
-  padding: 3px;
-  outline: 0;
-  border: 1px solid #dcdfe6;
-  font-size: 12px;
-  line-height: 24px;
-  padding: 2px;
-  word-wrap: break-word;
-  overflow-x: hidden;
-  overflow-y: auto;
-  border-radius: 4px;
-}
+
 /deep/ .radioWrap .el-radio {
   display: block;
   height: 41px;

+ 46 - 50
src/components/basicKnow/BasicTermsMaintenance.vue

@@ -18,16 +18,16 @@
         <el-form-item label="同义词:">
           <el-input size="mini" v-model="filter.libName" placeholder="输入同义词"></el-input>
         </el-form-item>
-                <el-form-item label="状态:">
-                    <el-select v-model="filter.isState" clearable placeholder="请选择" size="mini">
-                        <el-option
-                                v-for="item in stateSelect"
-                                :key="item.id"
-                                :label="item.name"
-                                :value="item.id">
-                        </el-option>
-                    </el-select>
-                </el-form-item>
+        <el-form-item label="状态:">
+          <el-select v-model="filter.isState" clearable placeholder="请选择" size="mini">
+            <el-option
+              v-for="item in stateSelect"
+              :key="item.id"
+              :label="item.name"
+              :value="item.id"
+            ></el-option>
+          </el-select>
+        </el-form-item>
         <el-form-item>
           <el-button size="mini" @click="filterDatas">确认</el-button>
         </el-form-item>
@@ -35,10 +35,7 @@
       <el-form class="secLine">
         <el-form-item>
           <el-button size="mini" type="warning" @click="addMedicalName" style="margin:0 10px">+ 新增术语</el-button>
-          <el-button
-            size="mini"
-            @click="reloadLib"
-          >更新数据</el-button>
+          <el-button size="mini" @click="reloadLib">更新数据</el-button>
         </el-form-item>
       </el-form>
     </crumbs>
@@ -57,17 +54,9 @@
         <el-table-column prop="gmtModified" label="操作时间" :show-overflow-tooltip="true"></el-table-column>
         <el-table-column label="操作" width="160">
           <template slot-scope="scope">
-            <el-button
-              type="text"
-              size="small"
-              @click="toEditProduct(scope.row)"
-            >修改</el-button>
+            <el-button type="text" size="small" @click="toEditProduct(scope.row)">修改</el-button>
             <span style="margin:0 3px;">|</span>
-            <el-button
-              type="text"
-              size="small"
-              @click="toEditProduct(scope.row,true)"
-            >复制</el-button>
+            <el-button type="text" size="small" @click="toEditProduct(scope.row,true)">复制</el-button>
             <span style="margin:0 3px;">|</span>
             <el-button
               type="text"
@@ -102,9 +91,9 @@ export default {
   data: function() {
     return {
       list: [],
-      stateSelect:[
-          {id:'N',name:'启用'},
-          {id:'Y',name:'禁用'},
+      stateSelect: [
+        { id: 'N', name: '启用' },
+        { id: 'Y', name: '禁用' }
       ],
       // isState:'',
       cacheData: {}, //因为删除和恢复要及时更新,所以不做缓存
@@ -117,7 +106,7 @@ export default {
       filter: {
         term: '',
         type: '',
-        libName: '',
+        libName: ''
       },
       typeList: [],
       reloadFlag: true
@@ -125,18 +114,18 @@ export default {
   },
   created() {
     const param = this.$route.params;
-    if(param.currentPage){
-      this.inCurrentPage = param.currentPage
+    if (param.currentPage) {
+      this.inCurrentPage = param.currentPage;
     }
-    if(param.filter){
-      this.filter = param.filter
+    if (param.filter) {
+      this.filter = param.filter;
     }
-    
+
     this.getTypeList();
     //返回时避免参数未赋值就获取列表
-    this.$nextTick(()=>{
+    this.$nextTick(() => {
       this.getDataList();
-    })
+    });
   },
   watch: {
     filter: {
@@ -176,9 +165,9 @@ export default {
           this.getDataList();
           if (res.data.code == 0) {
             this.reloadFlag = true;
-              this.warning('更新成功','success');
-          }else{
-              this.warning(res.data.msg||'更新失败,请重试');
+            this.warning('更新成功', 'success');
+          } else {
+            this.warning(res.data.msg || '更新失败,请重试');
           }
         });
       }
@@ -204,7 +193,7 @@ export default {
       this.$router.push({
         name: 'AddTerm',
         // params: {info:row}
-        params: Object.assign(pam, { id: row.conceptId, copy: copy })
+        params: Object.assign(pam, { id: row.conceptId,libType:row.libType, copy: copy })
       });
     },
     filterDatas() {
@@ -220,14 +209,15 @@ export default {
         spinner: 'el-icon-loading',
         background: 'rgba(0, 0, 0, 0.7)'
       });
-      api.getBaseConceptInfoPage(param)
+      api
+        .getBaseConceptInfoPage(param)
         .then(res => {
           loading.close();
           if (res.data.code == '0') {
             const data = res.data.data;
             const templis = data.records;
-            for(let i = 0;i < templis.length;i++){
-              templis[i].isDeleted = templis[i].status=='1'?'N':'Y'
+            for (let i = 0; i < templis.length; i++) {
+              templis[i].isDeleted = templis[i].status == '1' ? 'N' : 'Y';
             }
             this.list = templis;
             // this.cacheData[param.current] = data.records;
@@ -244,11 +234,11 @@ export default {
     },
     getTypeList() {
       api
-        .baseTypeGetPage({ name: '',size: 1000 })
+        .baseTypeGetPage({ name: '', size: 1000 })
         .then(res => {
           const data = res.data;
           if (data.code == 0) {
-            this.typeList = data.data.records||[];
+            this.typeList = data.data.records || [];
           } else {
             console.log(res.msg);
           }
@@ -266,10 +256,15 @@ export default {
         this.clearFilter();
       }
       const param = {
-        "libName": this.filter.term.trim(),
-        "libType": this.filter.type,
-        "status": this.filter.isState=='N'?'1':this.filter.isState=='Y'?'0':'',
-        "synonymName": this.filter.libName.trim(),
+        libName: this.filter.term.trim(),
+        libType: this.filter.type,
+        status:
+          this.filter.isState == 'N'
+            ? '1'
+            : this.filter.isState == 'Y'
+            ? '0'
+            : '',
+        synonymName: this.filter.libName.trim(),
         current: this.inCurrentPage || this.currentPage,
         size: this.pageSize,
         isDeleted: this.filter.isState
@@ -313,7 +308,7 @@ export default {
       const param = {
         conceptId: item.conceptId
       };
-      let url = item.isDeleted === 'N'?'disableConcept':'startConcept'
+      let url = item.isDeleted === 'N' ? 'disableConcept' : 'startConcept';
       let waringTxt =
         item.isDeleted === 'N'
           ? '是否禁用该标准术语?'
@@ -332,7 +327,8 @@ export default {
               } else {
                 if (this.filter.isState !== '' && this.list.length === 1) {
                   //有启用状态筛选条件且当前页只有最后一条数据删除时,删除成功后跳转到前一页
-                  this.currentPage = this.currentPage === 1 ? 1 : this.currentPage - 1;
+                  this.currentPage =
+                    this.currentPage === 1 ? 1 : this.currentPage - 1;
                 }
               }
               this.warning(res.data.msg || '操作成功', 'success');

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

@@ -0,0 +1,126 @@
+<template>
+  <div
+    class="test_box"
+    contenteditable="true"
+    v-html="innerText"
+    :ref='Maincontent'
+    @input="handleInput"
+    @compositionstart="handleStart"
+    @compositionend="handleEnd"
+    @focus="isChange = false"
+  ></div>
+</template>
+
+<script>
+export default {
+  name: 'DivEditable',
+  props: ['value','Maincontent'],
+  data() {
+    return {
+      innerText: this.value,
+      isChange: true,
+      composing: false
+    };
+  },
+  watch: {
+    value() {
+      if (this.isChange) {
+        this.innerText = this.value;
+      }
+    }
+  },
+  methods: {
+    handleInput(event) {
+      let text = event.target.innerText;
+      this.valueHandle(event, text);
+      this.$emit('input', this.$el.innerHTML);
+    },
+    //长度计算
+    validateTextLength(value) {
+      // 中文、中文标点、全角字符按1长度,英文、英文符号、数字按1长度计算
+      let cnReg = /([\u4e00-\u9fa5]|[\u3000-\u303F]|[\uFF00-\uFF60])/g;
+      let mat = value.match(cnReg);
+      let length;
+      if (mat) {
+        length = mat.length + (value.length - mat.length);
+        return length;
+      } else {
+        return value.length;
+      }
+    },
+    valueHandle(event, strVale) {
+      let _this = this;
+      let text = strVale;
+      if (this.composing) {
+        return;
+      }
+      let len = this.validateTextLength(text);
+      if (len > 200) {
+        this.$refs[this.Maincontent].innerHTML = text.substr(0, 200)
+        this.$refs[this.Maincontent].focus();
+      }
+      setTimeout(() => {
+        _this.keepLastIndex(event.target);
+      }, 5);
+      // 拓展 如果想要只需要前100位数据
+      // this.content = this.content.substring(0, 100)
+    },
+    handleStart() {
+      this.composing = true;
+    },
+    /**
+     * 中文输入结束
+     */
+    handleEnd($event) {
+      this.composing = false;
+      let text = $event.target.innerHTML;
+      // console.log($event.target.innerHTML)
+      this.valueHandle($event, text);
+    },
+    keepLastIndex(obj) {
+      if (window.getSelection) {
+        // ie11 10 9 ff safari
+        obj.focus(); // 解决ff不获取焦点无法定位问题
+        let range = window.getSelection(); // 创建range
+        range.selectAllChildren(obj); // range 选择obj下所有子内容
+        range.collapseToEnd(); // 光标移至最后
+      } else if (document.selection) {
+        // ie10 9 8 7 6 5
+        let range = document.selection.createRange(); // 创建选择对象
+        // var range = document.body.createTextRange();
+        range.moveToElementText(obj); // range定位到obj
+        range.collapse(false); // 光标移至最后
+        range.select();
+      }
+    }
+  }
+};
+</script>
+
+<style lang="less" scoped>
+.address-placeholder {
+  line-height: 27px;
+  height: 27px;
+  color: #a2a2a2;
+  position: absolute;
+  left: 16px;
+  top: 0;
+  opacity: 0.7;
+  font-size: 12px;
+}
+.test_box {
+  width: 300px;
+  min-height: 40px;
+  max-height: 300px;
+  outline: 0;
+  border: 1px solid #dcdfe6;
+  font-size: 14px;
+  line-height: 40px;
+  padding: 0 16px;
+  word-wrap: break-word;
+  overflow-x: hidden;
+  overflow-y: auto;
+  border-radius: 4px;
+  margin-top: 6px;
+}
+</style>

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

@@ -0,0 +1,168 @@
+<template>
+  <div>
+    <!-- <div
+      class="test_box"
+      contenteditable="true"
+      v-html="innerText"
+      @input="handleInput"
+      @focus="isChange = false"
+    ></div> -->
+    <ul class="list">
+      <li class="item" v-for="(item,index) in conceptList" :key="index">{{item.conceptName}}</li>
+    </ul>
+    <div class="source">
+      <transition-group name="flip-list">
+        <span
+          v-for="item in conceptList"
+          :key="item"
+          draggable="true"
+          class="items"
+          @dragstart="dragstart(item)"
+          @dragenter="dragenter(item)"
+          @dragend="dragend(item)"
+        >
+          <span class="tag">{{item}}</span>
+        </span>
+      </transition-group>
+      <input />
+    </div>
+  </div>
+</template>
+
+<script>
+import api from '@api/knowledgeTree.js';
+export default {
+  name: 'searchTerm',
+  props: ['value', 'type'],
+  data() {
+    return {
+      innerText: this.value,
+      conceptList: [],
+      oldNum: 0,
+      newNum: 0
+    };
+  },
+  watch: {
+    value() {
+      if (this.isChange) {
+        this.innerText = this.value;
+      }
+    }
+  },
+  methods: {
+    handleInput(event) {
+      const param = {
+        excludedConceptIds: [],
+        libType: this.type,
+        name: event.target.innerText
+      };
+      api
+        .searchConcept(param)
+        .then(res => {
+          if (res.data.code == '0') {
+            const data = res.data.data;
+            this.conceptList = data;
+          }
+        })
+        .catch(error => {
+          console.log(error);
+        });
+    },
+    shuffle: function() {
+      this.items = _.shuffle(this.items);
+    },
+    // 记录初始信息
+    dragstart: function(value) {
+      this.oldNum = value;
+    },
+    // 做最终操作
+    dragend: function(value) {
+      if (this.oldNum != this.newNum) {
+        let oldIndex = this.items.indexOf(this.oldNum);
+        let newIndex = this.items.indexOf(this.newNum);
+        let newItems = [...this.items];
+        // 删除老的节点
+        newItems.splice(oldIndex, 1);
+        // 在列表中目标位置增加新的节点
+        newItems.splice(newIndex, 0, this.oldNum);
+        // this.items一改变,transition-group就起了作用
+        this.items = [...newItems];
+      }
+    },
+    // 记录移动过程中信息
+    dragenter: function(value) {
+      this.newNum = value;
+    }
+  }
+};
+</script>
+
+<style lang="less" scoped>
+.address-placeholder {
+  line-height: 27px;
+  height: 27px;
+  color: #a2a2a2;
+  position: absolute;
+  left: 16px;
+  top: 0;
+  opacity: 0.7;
+  font-size: 12px;
+}
+.test_box {
+  width: 300px;
+  min-height: 40px;
+  max-height: 300px;
+  outline: 0;
+  border: 1px solid #dcdfe6;
+  font-size: 14px;
+  line-height: 40px;
+  padding: 0 16px;
+  word-wrap: break-word;
+  overflow-x: hidden;
+  overflow-y: auto;
+  border-radius: 4px;
+  margin-top: 6px;
+}
+.list {
+  width: 318px;
+  height: 200px;
+  position: absolute;
+  z-index: 1001;
+  border: 1px solid #e4e7ed;
+  border-radius: 4px;
+  background-color: #fff;
+  -webkit-box-shadow: 0 2px 12px 0 rgb(0 0 0 / 10%);
+  box-shadow: 0 2px 12px 0 rgb(0 0 0 / 10%);
+  -webkit-box-sizing: border-box;
+  box-sizing: border-box;
+  margin: 5px 0;
+  overflow-y: auto;
+  .item {
+    padding: 0 10px;
+  }
+  .item:hover {
+    background: #f5f7fa;
+  }
+}
+
+.source {
+  width: 300px;
+  min-height: 40px;
+  outline: 0;
+  border: 1px solid #dcdfe6;
+  font-size: 14px;
+  line-height: 40px;
+  padding: 0 16px;
+  word-wrap: break-word;
+  overflow-x: hidden;
+  overflow-y: auto;
+  border-radius: 4px;
+  margin-top: 6px;
+  .items{
+    border-radius:5px ;
+    padding: 3px 4px;
+    background: #48C5D7;
+    margin: 0 5px;
+  }
+}
+</style>

+ 143 - 26
src/components/knowledgeExtra/AddZskRegisteredDrug.vue

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

+ 46 - 158
src/components/knowledgeExtra/RegisteredDrug.vue

@@ -3,13 +3,13 @@
     <crumbs title="注册药品维护" :minWidth="titleWidth" class="knowledgeTitle">
       <el-form :inline="true" class="demo-form-inline">
         <el-form-item label="通用名:">
-          <el-input size="mini" v-model="filter.conceptName" placeholder="输入通用名" clearable></el-input>
+          <el-input size="mini" v-model="filter.commonName" placeholder="输入通用名" clearable></el-input>
         </el-form-item>
         <el-form-item label="注册名:">
-          <el-input size="mini" v-model="filter.description" placeholder="输入注册名" clearable></el-input>
+          <el-input size="mini" v-model="filter.name" placeholder="输入注册名" clearable></el-input>
         </el-form-item>
         <el-form-item label="企业:">
-          <el-input size="mini" v-model="filter.description" placeholder="输入企业" clearable></el-input>
+          <el-input size="mini" v-model="filter.company" placeholder="输入企业名称" clearable></el-input>
         </el-form-item>
         <el-form-item>
           <el-button size="mini" @click="filterDatas">确认</el-button>
@@ -25,60 +25,27 @@
     <div class="contents knowledgeContents">
       <el-table :data="list" border style="width: 100%">
         <el-table-column type="index" :index="indexMethod" label="编号" width="60"></el-table-column>
-        <el-table-column prop="conceptName" label="疾病名称" width="160">
-          <template slot-scope="scope">
-            <el-tooltip
-              v-if="scope.row.conceptName.length>8"
-              class="item"
-              effect="dark"
-              :content="scope.row.conceptName"
-              placement="top"
-            >
-              <span>{{scope.row.conceptName.slice(0,8)+'...'}}</span>
-            </el-tooltip>
-            <span v-if="scope.row.conceptName.length<9">{{scope.row.conceptName}}</span>
-          </template>
-        </el-table-column>
-        <el-table-column prop="description" label="描述" width="160">
-          <template slot-scope="scope">
-            <el-tooltip
-              v-if="scope.row.description.length>8"
-              class="item"
-              effect="dark"
-              :content="scope.row.description"
-              placement="top"
-            >
-              <span>{{scope.row.description.slice(0,8)+'...'}}</span>
-            </el-tooltip>
-            <span v-if="scope.row.description.length<9">{{scope.row.description}}</span>
-          </template>
-        </el-table-column>
-        <el-table-column label="状态">
-          <template slot-scope="scope">
-            <span>{{scope.row.status === 0?'禁用':'启用'}}</span>
-          </template>
-        </el-table-column>
-        <el-table-column prop="modifierName" label="操作人"></el-table-column>
+        <el-table-column prop="drugCode" label="药品代码" show-overflow-tooltip></el-table-column>
+        <el-table-column prop="name" label="注册名称" show-overflow-tooltip></el-table-column>
+        <el-table-column prop="drugName" label="关联的通用名" show-overflow-tooltip></el-table-column>
+        <el-table-column prop="enName" label="英文名称" show-overflow-tooltip></el-table-column>
+        <el-table-column prop="tradeName" label="商品名称" show-overflow-tooltip></el-table-column>
+        <el-table-column prop="form" label="药品剂型" show-overflow-tooltip></el-table-column>
+        <el-table-column prop="specification" label="注册规格" show-overflow-tooltip></el-table-column>
+        <el-table-column prop="minPackQuantity" label="最小包装量" show-overflow-tooltip></el-table-column>
+        <el-table-column prop="minPackUnit" label="最小包单位" show-overflow-tooltip></el-table-column>
+        <el-table-column prop="company" label="药品企业" show-overflow-tooltip></el-table-column>
+        <el-table-column prop="approval" label="批准文号" show-overflow-tooltip></el-table-column>
+        <el-table-column prop="standardCode" label="药品本位码" show-overflow-tooltip></el-table-column>
+        <el-table-column prop="insuranceType" label="医保类型" show-overflow-tooltip></el-table-column>
+        <el-table-column prop="insuranceRemrk" label="医保备注" show-overflow-tooltip></el-table-column>
+        <el-table-column prop="modifierName" label="操作人" show-overflow-tooltip></el-table-column>
         <el-table-column prop="gmtModified" label="操作时间" width="180"></el-table-column>
-        <el-table-column label="操作" width="180" fixed="right">
+        <el-table-column label="操作" width="120" fixed="right">
           <template slot-scope="scope">
             <el-button type="text" size="small" @click="editData(scope.row)">修改</el-button>
             <span style="margin:0 3px;">|</span>
-            <el-button type="text" size="small" @click="editData(scope.row,true)">复制</el-button>
-            <span style="margin:0 3px;">|</span>
-            <el-button
-              type="text"
-              size="small"
-              :class="scope.row.status === 0?'':'unvailable'"
-              @click="showDelDialog(scope.row)"
-            >{{scope.row.status === 0?'启用':'禁用'}}</el-button>
-            <span style="margin:0 3px;">|</span>
-            <el-button
-              type="text"
-              size="small"
-              class="delete"
-              @click="showDelDialog(scope.row,1)"
-            >删除</el-button>
+            <el-button type="text" size="small" class="delete" @click="showDelDialog(scope.row)">删除</el-button>
           </template>
         </el-table-column>
       </el-table>
@@ -97,12 +64,12 @@
 </template>
 
 <script>
-import api from '@api/zskDiagBase.js';
+import api from '@api/icss.js';
 import config from '@api/config.js';
 import utils from '@api/utils.js';
 
 export default {
-  name: 'ZskDiagBase',
+  name: 'ZskRegisteredDrug',
   data: function() {
     return {
       list: [],
@@ -113,9 +80,9 @@ export default {
       ruleTypeList: [],
       searched: false,
       filter: {
-        conceptName: '',
-        description: '',
-        status: ''
+        commonName: '',
+        name: '',
+        company: ''
       },
       cacheData: {},
       currentPage: 1,
@@ -127,17 +94,7 @@ export default {
     };
   },
   created() {
-    const param = this.$route.params;
-    if (param.currentPage) {
-      this.inCurrentPage = param.currentPage;
-      this.filter = param.filter;
-    }
-    this.getTypeList();
-    const that = this;
-    //返回时避免参数未赋值就获取列表
-    setTimeout(function() {
-      that.getDataList();
-    });
+    this.getDataList();
   },
   watch: {
     filter: {
@@ -147,44 +104,7 @@ export default {
       deep: true
     }
   },
-  // beforeRouteEnter(to, from, next) {
-  //     next(vm => {
-  //         //const pm = to.param;
-  //         Object.assign(vm, to.params);
-  //         vm.inCurrentPage=to.params.currentPage;
-  //     })
-  // },
   methods: {
-    getDict() {
-      api
-        .zskgetDict()
-        .then(res => {
-          if (res.data.code == '0') {
-            const data = res.data.data;
-            localStorage.setItem(
-              'zskDiagDicts',
-              `{"onlyNum":"${data['24'][0].val}","onlyTxt":"${data['25'][0].val}"}`
-            );
-          }
-        })
-        .catch(error => {
-          console.log(error);
-        });
-    },
-    getTypeList() {
-      this.getDict();
-      api
-        .getTypesList({ planCode: 'dis' })
-        .then(res => {
-          if (res.data.code == '0') {
-            const data = res.data.data;
-            localStorage.setItem('zskDiagList', JSON.stringify(data));
-          }
-        })
-        .catch(error => {
-          console.log(error);
-        });
-    },
     handleSizeChange(val) {
       this.pageSize = val;
       this.currentPage = utils.getCurrentPage(
@@ -218,7 +138,7 @@ export default {
         background: 'rgba(0, 0, 0, 0.7)'
       });
       api
-        .diagBasePage(params)
+        .getPageList(params)
         .then(res => {
           loading.close();
           if (res.data.code == '0') {
@@ -256,9 +176,9 @@ export default {
       const param = {
         current: this.inCurrentPage || this.currentPage,
         size: this.pageSize,
-        conceptName: this.filter.conceptName,
-        description: this.filter.description,
-        status: this.filter.status
+        commonName: this.filter.commonName,
+        name: this.filter.name,
+        company: this.filter.company
       };
       return param;
     },
@@ -267,11 +187,7 @@ export default {
     },
     currentChange(next) {
       this.currentPage = next;
-      /*if (this.cacheData[next]) {       //如果已请求过该页数据,则使用缓存不重复请求
-                  this.list = this.cacheData[next];
-                } else {*/
       this.getDataList(1, true);
-      //}
     },
     warning(msg, type) {
       this.$message({
@@ -290,7 +206,7 @@ export default {
         })
         .catch(() => {});
     },
-    editData(row, isCopy) {
+    editData(row) {
       const pam = this.searched
         ? {
             currentPage: this.currentPage,
@@ -298,56 +214,28 @@ export default {
             filter: this.filter
           }
         : { currentPage: this.currentPage, pageSize: this.pageSize };
-      api
-        .diagBaseGetDetail({ id: row.id })
-        .then(res => {
-          if (res.data.code == '0') {
-            const data = res.data.data;
-            this.$router.push({
-              name: 'AddZskDiagBase',
-              params: {
-                ...pam,
-                data: { ...row, klDiagnoseTypeVO: data },
-                copy: isCopy
-              }
-            });
-          }
-        })
-        .catch(error => {
-          this.warning('获取详情失败,请重试');
-        });
+      this.$router.push({
+        name: 'AddZskRegisteredDrug',
+        params: {
+          id: row.id,
+          type: 2
+        }
+      });
     },
-    showDelDialog(row, isDelete) {
+    showDelDialog(row) {
       const params = {
         id: row.id
       };
-      const txt = row.status === 0 ? '重新启用' : '禁用';
-      const warningTxt = isDelete
-        ? '是否删除该诊断依据?可能对现有系统造成影响'
-        : '是否' + txt + '该诊断依据?';
-      const handleFn = isDelete
-        ? api.diagBaseDelete
-        : row.status === 0
-        ? api.diagBaseApply
-        : api.diagBaseStop;
+      const warningTxt = '是否删除该诊断依据?可能对现有系统造成影响';
       this.showConfirmDialog(warningTxt, () => {
-        handleFn(params)
+        api.paramDelete(params)
           .then(res => {
             if (res.data.code == '0') {
               if (!this.searched) {
                 //未点确认时清空搜索条件
                 this.clearFilter();
               }
-              if (isDelete) {
-                //恢复成功后跳转到筛选条件的首页
-                this.currentPage = 1;
-              } else {
-                if (this.filter.status !== '' && this.list.length === 1) {
-                  //有启用状态筛选条件且当前页只有最后一条数据删除时,删除成功后跳转到前一页
-                  this.currentPage =
-                    this.currentPage === 1 ? 1 : this.currentPage - 1;
-                }
-              }
+              this.currentPage = 1;
               this.warning(res.data.msg || '操作成功', 'success');
               this.getDataList();
             } else {
@@ -361,9 +249,9 @@ export default {
     },
     clearFilter() {
       this.filter = {
-        conceptName: '',
-        description: '',
-        status: ''
+        commonName: '',
+        name: '',
+        company: ''
       };
     },
     update() {
@@ -374,7 +262,7 @@ export default {
         background: 'rgba(0, 0, 0, 0.7)'
       });
       api
-        .updateDiagBase()
+        .getPageList()
         .then(res => {
           loading.close();
           if (res.data.code == '0') {

+ 2 - 2
vue.config.js

@@ -1,7 +1,7 @@
 const path = require('path');
 // const proxy_path = 'http://192.168.2.236:80';
-const proxy_path = 'http://192.168.2.241:88';
-// const proxy_path = 'http://192.168.2.236:88';
+// const proxy_path = 'http://192.168.2.241:88';
+const proxy_path = 'http://192.168.2.236:5050';
 // const proxy_path = 'http://192.168.3.101:5050';
 // const proxy_path = 'http://192.168.3.117:5050';//周铁刚
 // const proxy_path = 'http://192.168.3.113:5050'; //王峰