wyq hace 4 años
padre
commit
1f253cae29

+ 213 - 105
src/components/basicKnow/AddTerm.vue

@@ -187,7 +187,7 @@
         <table class="deptbox" v-if="id == ''">
           <tr>
             <td class="ind">序号</td>
-            <td >医学标准术语</td>
+            <td>医学标准术语</td>
             <td>拼音</td>
             <td>术语类型</td>
             <td class="desc">说明</td>
@@ -246,12 +246,18 @@
               <span class="ageLine">~</span>
               <el-input v-model.number="maxAge" type="number" @input="inputAge"></el-input>
             </el-form-item>
-            <el-form-item
-              v-if="data.type=='实验室检查子项目'" label="最大值与最小值:" class="ages">
+            <el-form-item v-if="data.type=='实验室检查子项目'" label="最大值与最小值:" class="ages">
               <el-input v-model.trim="minValue" type="number" @input="inputAge"></el-input>
               <span class="ageLine">~</span>
               <el-input v-model.trim="maxValue" type="number" @input="inputAge"></el-input>
-              <el-input class="inp" v-model.trim="unit" placeholder="输入单位" maxlength="6" type="text" @input="inputAge"></el-input>
+              <el-input
+                class="inp"
+                v-model.trim="unit"
+                placeholder="输入单位"
+                maxlength="6"
+                type="text"
+                @input="inputAge"
+              ></el-input>
             </el-form-item>
             <el-form-item v-if="data.type=='实验室检查子项目'" label="范围:" class="range">
               <el-select v-model="rangeSelect">
@@ -290,6 +296,86 @@
                 <el-option v-for="(it,i) in drugTypeList" :key="i" :label="it.name" :value="it.val"></el-option>
               </el-select>
             </el-form-item>
+            <el-form-item
+              label="危急标识:"
+              v-if="data.type=='辅助检查项目' || data.type=='辅助检查子项目'"
+              class="marT is-required"
+            >
+              <el-radio-group v-model="critical">
+                <el-radio :label="3">是</el-radio>
+                <el-radio :label="6">否</el-radio>
+              </el-radio-group>
+            </el-form-item>
+            <el-form-item
+              label="方法:"
+              v-if="data.type=='辅助检查项目' || data.type=='辅助检查子项目'"
+              class="marT"
+            >
+              <el-input v-model.trim="unit" placeholder="请输入" maxlength="6" type="text"></el-input>
+            </el-form-item>
+            <el-form-item
+              label="检查技术:"
+              v-if="data.type=='辅助检查项目' || data.type=='辅助检查子项目'"
+              class="marT"
+            >
+              <el-input v-model.trim="unit" placeholder="请输入" maxlength="6" type="text"></el-input>
+            </el-form-item>
+            <el-form-item
+              label="项目定义:"
+              v-if="data.type=='辅助检查项目' || data.type=='辅助检查子项目'"
+              class="marT"
+            >
+              <el-input type="textarea" v-model.trim="unit" placeholder="请输入" maxlength="6"></el-input>
+            </el-form-item>
+            <el-form-item
+              label="检查目的:"
+              v-if="data.type=='辅助检查项目' || data.type=='辅助检查子项目'"
+              class="marT"
+            >
+              <el-input type="textarea" v-model.trim="unit" placeholder="请输入" maxlength="6"></el-input>
+            </el-form-item>
+            <el-form-item
+              label="禁忌症和局限性:"
+              v-if="data.type=='辅助检查项目' || data.type=='辅助检查子项目'"
+              class="marT"
+            >
+              <el-input type="textarea" v-model.trim="unit" placeholder="请输入" maxlength="6"></el-input>
+            </el-form-item>
+            <el-form-item
+              label="适应症:"
+              v-if="data.type=='辅助检查项目' || data.type=='辅助检查子项目'"
+              class="marT"
+            >
+              <el-input type="textarea" v-model.trim="unit" placeholder="请输入" maxlength="6"></el-input>
+            </el-form-item>
+            <el-form-item
+              label="检查前准备:"
+              v-if="data.type=='辅助检查项目' || data.type=='辅助检查子项目'"
+              class="marT"
+            >
+              <el-input type="textarea" v-model.trim="unit" placeholder="请输入" maxlength="6"></el-input>
+            </el-form-item>
+            <el-form-item v-if="data.type=='疾病'" label="发病率:" prop="description">
+              <el-input v-model.trim="icdCode" maxlength="30" placeholder="请输入编码"></el-input>
+            </el-form-item>
+            <el-form-item label="遗传性:" v-if="data.type=='疾病'" class="marT">
+              <el-radio-group v-model="critical">
+                <el-radio :label="3">是</el-radio>
+                <el-radio :label="6">否</el-radio>
+              </el-radio-group>
+            </el-form-item>
+            <el-form-item label="常见病:" v-if="data.type=='疾病'" class="marT">
+              <el-radio-group v-model="critical">
+                <el-radio :label="3">是</el-radio>
+                <el-radio :label="6">否</el-radio>
+              </el-radio-group>
+            </el-form-item>
+            <el-form-item label="传染性:" v-if="data.type=='疾病'" class="marT">
+              <el-radio-group v-model="critical">
+                <el-radio :label="3">是</el-radio>
+                <el-radio :label="6">否</el-radio>
+              </el-radio-group>
+            </el-form-item>
             <!-- <el-form-item
               v-if="data.type=='症状'"
               label="填写单患者界面展示通俗内容:"
@@ -298,7 +384,7 @@
             >
               <span class="necess">*</span>
               <el-input v-model.trim="description" maxlength="7" placeholder="请输入填写单患者界面展示通俗内容"></el-input>
-            </el-form-item> -->
+            </el-form-item>-->
             <!-- <el-form-item v-if="data.type=='症状'" label="医学教育说明:" prop="explains" class="marT">
               <el-input
                 type="textarea"
@@ -307,7 +393,7 @@
                 style="width: 500px;"
                 :rows="4"
               ></el-input>
-            </el-form-item> -->
+            </el-form-item>-->
           </el-form>
         </div>
         <div class="btn">
@@ -353,8 +439,8 @@ export default {
       minAge: 0,
       maxValue: null,
       minValue: null,
-      unit:null,
-      icdCode:'',
+      unit: null,
+      icdCode: '',
       showMore: '',
       sex: [
         {
@@ -384,8 +470,11 @@ export default {
       saveDisable: false, //保存按钮禁止点击
       options: [],
       copy: null,
-      drugTypeList:[{val:0,name:'西药'},{val:1,name:'中成药'}],//药品类型
-      drug:'',
+      drugTypeList: [
+        { val: 0, name: '西药' },
+        { val: 1, name: '中成药' }
+      ], //药品类型
+      drug: '',
       dioTypeList: [], //更多信息-类型
       dioType: '', //默认展示一类
       deptList: [], //更多信息-科室
@@ -395,7 +484,8 @@ export default {
       searchIndex: -1, //展示哪个的同义词
       searchType: '',
       description: '',
-      explains: ''
+      explains: '',
+      critical: '' //危急标识
     };
   },
   created() {
@@ -418,8 +508,8 @@ export default {
     }
   },
   methods: {
-    clearDataCi(){
-      this.data.code = ''
+    clearDataCi() {
+      this.data.code = '';
     },
     dragAdd(ev) {
       utils.dragBox('dragModalWrap', 'dragModalTitle', 'add');
@@ -505,34 +595,36 @@ export default {
       }
     },
     reViewData(data) {
-      let tmpObj = [{
-        isConcept: data.isConcept,
-        name: data.libName,
-        remark: data.remark,
-        spell: data.spell,
-        type: data.typeName,
-        conceptId: data.conceptId,
-        libId: data.libId,
-        isHasCommon: data.isHasCommon,
-        synonymName: data.synonymName,
-        status: data.status,
-        typeId: 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
+      let tmpObj = [
+        {
+          isConcept: data.isConcept,
+          name: data.libName,
+          remark: data.remark,
+          spell: data.spell,
+          type: data.typeName,
+          conceptId: data.conceptId,
+          libId: data.libId,
+          isHasCommon: data.isHasCommon,
+          synonymName: data.synonymName,
+          status: data.status,
+          typeId: 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;
       }
-      data.libName = tmpObj
-      data.otherNames = data.klConceptSub
-      return data
+      data.libName = tmpObj;
+      data.otherNames = data.klConceptSub;
+      return data;
     },
     getDetail(ids) {
       if (ids) {
         api.getBaseConceptAll({ conceptId: ids }).then(res => {
           const result = res.data;
-          let redata = this.reViewData(result.data)
+          let redata = this.reViewData(result.data);
           if (result.code == 0) {
             this.data = redata.libName[0];
             this.singleword = redata.libName;
@@ -543,12 +635,12 @@ export default {
             this.minAge = redata.minAge;
             this.maxValue = redata.maxVal;
             this.minValue = redata.minVal;
-            this.unit = redata.unit
-            this.rangeSelect = redata.scopeType == '1'?'外':'内'
+            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;
+            this.drug = redata.drug;
             const type = redata.type;
 
             if (type == '诊断') {
@@ -574,11 +666,12 @@ export default {
       }
     },
     getTypeList() {
-      api.baseTypeGetPage({ name: '',size: 1000 })
+      api
+        .baseTypeGetPage({ name: '', size: 1000 })
         .then(res => {
           const data = res.data;
           if (data.code == 0) {
-            let types = data.data.records
+            let types = data.data.records;
             this.typeList = types;
             // this.typeList = data.data;
             // 类型改成平铺
@@ -708,7 +801,7 @@ export default {
     },
     getSimilarList(name) {
       //不知道还有没有用
-      return
+      return;
       if (!name) {
         this.closeTable();
         return;
@@ -752,19 +845,19 @@ export default {
         })
         .catch(() => {});
     },
-    deleLine(index, type,item) {
+    deleLine(index, type, item) {
       // 只在界面删除数据,待点确认 后参才真正删除
       if (type == 55) {
-        const {libId} = item
-        if(libId){
-          api.clearConceptInfo({libId}).then((res)=>{
-            const result = res.data
-            if(result.code == 0){
+        const { libId } = item;
+        if (libId) {
+          api.clearConceptInfo({ libId }).then(res => {
+            const result = res.data;
+            if (result.code == 0) {
               this.synonymous.splice(index - 1, 1);
               this.allwords.splice(index, 1);
             }
-          })
-        }else{
+          });
+        } else {
           this.synonymous.splice(index - 1, 1);
           this.allwords.splice(index, 1);
         }
@@ -787,7 +880,7 @@ export default {
         this.warning('请先选择标准词');
         return;
       }
-      if(this.data.type == '疾病' && !this.icdCode){
+      if (this.data.type == '疾病' && !this.icdCode) {
         this.warning('请输入ICD10编码');
         return;
       }
@@ -806,25 +899,37 @@ export default {
           this.warning('年龄必须是0-200');
           return;
         }
-        if(this.minAge >= this.maxAge){
+        if (this.minAge >= this.maxAge) {
           this.warning('年龄最小值应该小于最大值');
           return;
         }
-        if(this.data.type=='实验室检查子项目'){
-          if(this.minValue<0||this.minValue>99999||this.maxValue<0||this.maxValue>99999){
+        if (this.data.type == '实验室检查子项目') {
+          if (
+            this.minValue < 0 ||
+            this.minValue > 99999 ||
+            this.maxValue < 0 ||
+            this.maxValue > 99999
+          ) {
             this.warning('取值范围必须是0-99999切单位不能为空');
             return;
           }
-          if(this.minValue&&this.maxValue&&this.minValue >= this.maxValue){
+          if (
+            this.minValue &&
+            this.maxValue &&
+            this.minValue >= this.maxValue
+          ) {
             this.warning('最小值应该小于最大值');
             return;
           }
         }
       }
-      console.log(this.drug)
-      if(this.data.type == '药品通用名'&&(this.drug===''||this.drug===null)){
-          this.warning('请选择药品类型');
-          return;
+      console.log(this.drug);
+      if (
+        this.data.type == '药品通用名' &&
+        (this.drug === '' || this.drug === null)
+      ) {
+        this.warning('请选择药品类型');
+        return;
       }
       // 过滤同义词空数据
       let realData = [];
@@ -851,14 +956,14 @@ export default {
       }
       let detailList = [];
       for (let i = 0; i < realData.length; i++) {
-        let obj = {}
+        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;
-        if(this.copy){
-          realData[i].libId = undefined
+        realData[i].libType = this.data.code || this.data.typeId;
+        if (this.copy) {
+          realData[i].libId = undefined;
         }
         // obj.isConcept=realData[i].isConcept
         // obj.remark=realData[i].remark
@@ -869,13 +974,13 @@ export default {
       }
       // 校验是否有名称全为数字
       const pattern = /[^0-9]/g;
-      const tmpData = this.data.name
-      if(tmpData&&!tmpData.match(pattern)){
-          this.$message({
-            message: '无法输入纯数字,请输入正确数据!',
-            type: 'warning'
-          });
-          return false;
+      const tmpData = this.data.name;
+      if (tmpData && !tmpData.match(pattern)) {
+        this.$message({
+          message: '无法输入纯数字,请输入正确数据!',
+          type: 'warning'
+        });
+        return false;
       }
       for (let d = 0; d < detailList.length; d++) {
         let dname = detailList[d].name;
@@ -897,9 +1002,11 @@ export default {
       //   this.warning('请输入填写单患者界面展示通俗内容');
       //   return;
       // }
-      console.log(this.data.typeId,this.data.code)
-      let params,sexCode=null;
-      if (this.showMore == 1) {// 下拉文字转code
+      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;
@@ -911,45 +1018,45 @@ export default {
           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,
+          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{
+          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,
+          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,
+          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,
+          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
+          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
         };
       }
       // return false
@@ -980,11 +1087,11 @@ export default {
       // console.log("输入年龄")
     },
     selectType(e) {
-      console.log(e)
+      console.log(e);
       this.typeList.map((v, i) => {
         if (v.name == e) {
           this.showMore = v.isHasCommon;
-          this.data.code = v.code
+          this.data.code = v.code;
         }
       });
       if (e == '诊断') {
@@ -1110,6 +1217,7 @@ td {
 .btn {
   text-align: right;
   margin-top: 20px;
+  margin-bottom: 20px;
 }
 .necess {
   display: inline-block;
@@ -1150,7 +1258,7 @@ td {
     display: inline-block;
     margin: 0 35px;
   }
-  .inp{
+  .inp {
     margin-left: 20px;
   }
 }

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

@@ -0,0 +1,82 @@
+<template>
+  <div style="min-height:100%" ref="viewBox">
+    <crumbs :title="title" :param="$route.params" linkTo="RegisteredDrug"></crumbs>
+    <div class="contents">
+      <div class="content">
+        <el-form :inline="true" :model="formInline" class="demo-form-inline">
+          <el-form-item label="审批人">
+            <el-input v-model="formInline.user" placeholder="审批人"></el-input>
+          </el-form-item>
+          <el-form-item label="活动区域">
+            <el-select v-model="formInline.region" placeholder="活动区域">
+              <el-option label="区域一" value="shanghai"></el-option>
+              <el-option label="区域二" value="beijing"></el-option>
+            </el-select>
+          </el-form-item>
+          <el-form-item label="审批人">
+            <el-input v-model="formInline.user" placeholder="审批人"></el-input>
+          </el-form-item>
+          <el-form-item label="活动区域">
+            <el-select v-model="formInline.region" placeholder="活动区域">
+              <el-option label="区域一" value="shanghai"></el-option>
+              <el-option label="区域二" value="beijing"></el-option>
+            </el-select>
+          </el-form-item>
+          <el-form-item label="审批人">
+            <el-input v-model="formInline.user" placeholder="审批人"></el-input>
+          </el-form-item>
+          <el-form-item label="活动区域">
+            <el-select v-model="formInline.region" placeholder="活动区域">
+              <el-option label="区域一" value="shanghai"></el-option>
+              <el-option label="区域二" value="beijing"></el-option>
+            </el-select>
+          </el-form-item>
+          <el-form-item label="审批人">
+            <el-input v-model="formInline.user" placeholder="审批人"></el-input>
+          </el-form-item>
+          <el-form-item label="活动区域">
+            <el-select v-model="formInline.region" placeholder="活动区域">
+              <el-option label="区域一" value="shanghai"></el-option>
+              <el-option label="区域二" value="beijing"></el-option>
+            </el-select>
+          </el-form-item>
+        </el-form>
+      </div>
+    </div>
+  </div>
+</template>
+<script type="text/javascript">
+import util from '../../api/utils.js';
+
+export default {
+  name: 'AddZskDiagBase',
+  data() {
+    return {
+      formInline: {
+        user: '',
+        region: ''
+      },
+      title: '注册药品维护-添加注册药品'
+    };
+  },
+  created() {},
+  methods: {}
+};
+</script>
+<style lang="less" scoped>
+@import '../../less/admin.less';
+.container {
+  top: 0;
+}
+.contents {
+  height: 100%;
+  .content {
+    height: 600px;
+    background: #fff;
+    padding: 20px 20px 0;
+    color: #545455;
+    min-width: 980px;
+    position: relative;
+  }
+}
+</style>

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

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