浏览代码

Merge remote-tracking branch 'origin/test'

zhouna 3 年之前
父节点
当前提交
8a6e61fbdf

+ 38 - 12
src/api/cdss.js

@@ -76,11 +76,12 @@ export default {
     });
   },
   importDiseaseRecord(param) {
-    return axios.post(urls.importDiseaseRecordCDSS, param);
+    return axios.post(urls.importDiseaseRecordCDSS, param, {
+      responseType: 'blob',
+    });
   },
 
 
-
   getLisPage(param) {
     //检验列表-列表
     return axios.post(urls.getLisPageCDSS, param);
@@ -100,7 +101,9 @@ export default {
     });
   },
   importLisRecord(param) {
-    return axios.post(urls.importLisRecordCDSS, param);
+    return axios.post(urls.importLisRecordCDSS, param, {
+      responseType: 'blob',
+    });
   },
   getpacsPage(param) {
     //检查列表-列表
@@ -121,7 +124,9 @@ export default {
     });
   },
   importPacsRecord(param) {
-    return axios.post(urls.importPacsRecordCDSS, param);
+    return axios.post(urls.importPacsRecordCDSS, param, {
+      responseType: 'blob',
+    });
   },
   getDrugPage(param) {
     //药品列表-列表
@@ -142,7 +147,9 @@ export default {
     });
   },
   importDrugRecord(param) {
-    return axios.post(urls.importDrugRecordCDSS, param);
+    return axios.post(urls.importDrugRecordCDSS, param, {
+      responseType: 'blob',
+    });
   },
   getScalePage(param) {
     //量表列表-列表
@@ -163,7 +170,9 @@ export default {
     });
   },
   importScaleRecord(param) {
-    return axios.post(urls.importScaleRecordCDSS, param);
+    return axios.post(urls.importScaleRecordCDSS, param, {
+      responseType: 'blob',
+    });
   },
   exportScaleModule(param) {
     return axios.post(urls.exportScaleModuleCDSS, param, {
@@ -198,7 +207,9 @@ export default {
     });
   },
   importOperationRecord(param) {
-    return axios.post(urls.importOperationRecordCDSS, param);
+    return axios.post(urls.importOperationRecordCDSS, param, {
+      responseType: 'blob',
+    });
   },
   getFusionPage(param) {
     //输血列表-列表
@@ -219,7 +230,9 @@ export default {
     });
   },
   importFusionRecord(param) {
-    return axios.post(urls.importFusionRecordCDSS, param);
+    return axios.post(urls.importFusionRecordCDSS, param, {
+      responseType: 'blob',
+    });
   },
   getDeptPage(param) {
     //科室列表-列表
@@ -240,7 +253,9 @@ export default {
     });
   },
   importDeptRecord(param) {
-    return axios.post(urls.importDeptRecordCDSS, param);
+    return axios.post(urls.importDeptRecordCDSS, param, {
+      responseType: 'blob',
+    });
   },
   exportDeptModule(param) {
     return axios.post(urls.exportDeptModuleCDSS, param, {
@@ -303,7 +318,9 @@ export default {
   },
   importNurseRecord(param) {
     //护理-数据导入
-    return axios.post(urls.importNurseRecord, param);
+    return axios.post(urls.importNurseRecord, param, {
+      responseType: 'blob',
+    });
   },
   exportNurseModule(param) {
     //护理-数据导入模板导出
@@ -344,7 +361,9 @@ export default {
   },
   importTcmRecord(param) {
     //中医疾病-数据导入
-    return axios.post(urls.importTcmRecord, param);
+    return axios.post(urls.importTcmRecord, param, {
+      responseType: 'blob',
+    });
   },
   dataTcmVerify(param) {
     return axios.post(urls.dataTcmVerify, param);
@@ -387,7 +406,9 @@ export default {
   },
   importTcmdromeRecord(param) {
     //中医疾病-数据导入
-    return axios.post(urls.importTcmdromeRecord, param);
+    return axios.post(urls.importTcmdromeRecord, param, {
+      responseType: 'blob',
+    });
   },
   dataTcmdromeVerify(param) {
     return axios.post(urls.dataTcmdromeVerify, param);
@@ -723,4 +744,9 @@ export default {
     //推荐匹配
     return axios.post(urls.getTermMatching, param);
   },
+  importExcelDataVerify(param) {
+    //数据导入校验
+    return axios.post(urls.importExcelDataVerify, param);
+  },
+
 };

+ 2 - 0
src/api/config.js

@@ -630,6 +630,8 @@ export default {
     'saveOrUpdateRecord': '/api/cdssman/kl/conceptCollection/saveOrUpdateRecord',
     'searchCollectionConceptVO': '/api/cdssman/klDisease/searchCollectionConceptVO',
     'collectionMatch': '/api/cdssman/kl/conceptCollection/collectionMatch',
+
+    'importExcelDataVerify': '/api/cdssman/tran/mappingConfig/importExcelDataVerify',
     
   },
   menuIconList: { //菜单对应图标

+ 8 - 7
src/components/base/LtModal.vue

@@ -151,10 +151,9 @@
       </div>
       <div class="mapList">
         已关联标准术语:
-        <span
-          v-for="item in mapList"
-          :key="item.id"
-        >{{item.uniqueName}}&nbsp;&nbsp;{{item.form}}{{item.hisCode}};</span>
+        <span v-for="item in mapList" :key="item.id">
+          <span v-if="item.uniqueName">{{item.uniqueName}}&nbsp;&nbsp;{{item.form}}{{item.hisCode}};</span>
+        </span>
       </div>
       <div class="modal-footer">
         <button class="confirm btns" :disabled="saveDisable" @click="submitForm">确定</button>
@@ -225,7 +224,9 @@ export default {
       this.isEdit = true;
       this.editId = this.data.id;
       this.form.hisName = this.data.hisName;
-      this.form.hisDetailName = this.data.hisDetailName?this.data.hisDetailName:'' ;
+      this.form.hisDetailName = this.data.hisDetailName
+        ? this.data.hisDetailName
+        : '';
       this.form.searchText = this.data.uniqueName;
       this.form.icdCode = this.data.code;
       this.form.conceptId = this.data.conceptId;
@@ -428,8 +429,8 @@ export default {
             source
           } = this.form;
           // 当标准术语是套餐时,细项必须为空
-        console.log(hisDetailName);
-        
+          console.log(hisDetailName);
+
           if (this.searchType === 1 && hisDetailName !== '') {
             console.log(123);
             this.warning('医院术语与标准术语类型不匹配,请修改');

+ 1 - 1
src/components/basicKnow/BasicTermsMaintenance.vue

@@ -239,7 +239,7 @@ export default {
               const code = JSON.parse(this.result);
               if (code.code === "00000001") {
                 that
-                  .$alert(`数据存在异常,导入失败,请修改后再试`, "提示", {
+                  .$alert(`医院术语字符数超出最大数量,请修改后再试`, "提示", {
                     confirmButtonText: "确定",
                     type: "warning"
                   })

+ 2 - 0
src/components/cdssManage/MedicalTerm.vue

@@ -230,6 +230,8 @@ export default {
     // 页面跳转
     goRelationPage(from, row) {
       const item = Object.assign({}, row);
+      localStorage.setItem('hospitalId',item.hospitalId)
+      localStorage.setItem('name',item.name)
       // const pam = this.searched
       //   ? {
       //       currentPage: this.currentPage,

+ 167 - 46
src/components/cdssManage/dept/DeptManage.vue

@@ -15,7 +15,17 @@
     <div class="searchBar">
       <div class="searchContent">
         <el-form :inline="true" class="demo-form-inline">
-          <el-form-item label class="selectMedicine">
+          <el-form-item class="selectMedicine" label="标准术语状态:">
+            <el-select size="mini" v-model="filter.status" placeholder="请选择" clearable>
+              <el-option
+                v-for="item in statusList"
+                :label="item.name"
+                :value="item.id"
+                :key="item.id"
+              ></el-option>
+            </el-select>
+          </el-form-item>
+          <el-form-item label="匹配状态:" class="selectMedicine">
             <el-select size="mini" v-model="filter.match" placeholder="请选择" clearable>
               <el-option
                 v-for="item in matchList"
@@ -45,7 +55,12 @@
         <el-table-column :resizable="false" prop="hisCode" label="医院科室编码" show-overflow-tooltip></el-table-column>
         <el-table-column :resizable="false" prop="hisName" label="医院科室名称" show-overflow-tooltip></el-table-column>
         <el-table-column :resizable="false" prop="uniqueName" label="标准科室名称" show-overflow-tooltip></el-table-column>
-        <el-table-column :resizable="false" prop="operate" label="状态">
+        <el-table-column :resizable="false" prop="operate" label="标准术语状态">
+          <template slot-scope="scope">
+            <span v-if="scope.row.uniqueName && scope.row.uniqueName!=''">{{scope.row.status == 0?'禁用':'启用'}}</span>
+          </template>
+        </el-table-column>
+        <el-table-column :resizable="false" prop="operate" label="匹配状态">
           <template slot-scope="scope">
             <span>{{scope.row.isMatch == 0?'未匹配':'已匹配'}}</span>
           </template>
@@ -103,7 +118,8 @@ export default {
       filter: {
         hisName: '', // 医院诊断名称
         uniqueName: '', //标准诊断名称
-        match: ''
+        match: '',
+        status:''
       },
       matchList: [
         { id: '', name: '全部' },
@@ -111,6 +127,11 @@ export default {
         { id: 0, name: '未匹配' },
         { id: 2, name: '多项匹配' }
       ],
+      statusList: [
+        { id: '', name: '全部' },
+        { id: 1, name: '启用' },
+        { id: 0, name: '禁用' },
+      ],
       currentPage: 1,
       pageSize: config.pageSize,
       pageSizeArr: config.pageSizeArr,
@@ -132,8 +153,8 @@ export default {
   },
   created() {
     const { data } = this.$route.params;
-    this.hospitaiName = (data && data.name) || '';
-    this.hospitalId = data && data.hospitalId;
+    this.hospitaiName = (data && data.name) || localStorage.getItem('name');
+    this.hospitalId = (data && data.hospitalId) || localStorage.getItem('hospitalId');
     const that = this;
     //返回时避免参数未赋值就获取列表
     setTimeout(function() {
@@ -168,6 +189,11 @@ export default {
     // 导入数据
     uploadFileMatch(e) {
       let fileInfo = e.target.files[0];
+      let extend = fileInfo.name.substring(fileInfo.name.lastIndexOf('.') + 1);
+      if (extend != 'xls' && extend != 'xlsx') {
+        this.$message({ message: '请根据模板进行导入', type: 'error' });
+        return;
+      }
       e.preventDefault();
       let formData = new FormData();
       formData.append('file', fileInfo);
@@ -184,7 +210,7 @@ export default {
         background: 'rgba(0, 0, 0, 0.7)'
       });
       api.dataDeptVerify(formData, header).then(res => {
-        if ((res.data.code === '00020007' || res.data.code === '00020004')) {
+        if (res.data.code === '00020007' || res.data.code === '00020004') {
           loading.close();
           this.$alert(`${res.data.msg}`, '提示', {
             confirmButtonText: '确定',
@@ -257,9 +283,10 @@ export default {
         hisName: this.filter.hisName.trim(),
         uniqueName: this.filter.uniqueName.trim(),
         uniqueCode: '',
-        hospitalId: data && data.hospitalId,
+        hospitalId: (data && data.hospitalId) || localStorage.getItem('hospitalId'),
         type: 7,
-        isMatch: this.filter.match
+        isMatch: this.filter.match,
+        status: this.filter.status,
       };
       return param;
     },
@@ -411,7 +438,11 @@ export default {
       })
         .then(() => {
           api
-            .exportDeptRecord({ hospitalId: this.hospitalId, type: 7,isMatch:this.filter.match })
+            .exportDeptRecord({
+              hospitalId: this.hospitalId,
+              type: 7,
+              isMatch: this.filter.match
+            })
             .then(res => {
               if (res.status === 200) {
                 this.$message({ message: '导出成功', type: 'success' });
@@ -424,7 +455,7 @@ export default {
 
     // 导入模板
     exportModule() {
-      api.exportDeptModule({type:7}).then(res => {
+      api.exportDeptModule({ type: 7 }).then(res => {
         if (res.status === 200) {
           setTimeout(() => {
             utils.downloadExportedData(res.data, '科室导入模板.xls');
@@ -441,6 +472,11 @@ export default {
     // 导入数据
     uploadFile(e) {
       let fileInfo = e.target.files[0];
+      let extend = fileInfo.name.substring(fileInfo.name.lastIndexOf('.') + 1);
+      if (extend != 'xls' && extend != 'xlsx') {
+        this.$message({ message: '请根据模板进行导入', type: 'error' });
+        return;
+      }
       // this.fileName = e.target.files[0].name; // 表单同步显示
       e.preventDefault();
       let formData = new FormData();
@@ -453,47 +489,132 @@ export default {
           'Content-Type': 'multipart/form-data'
         }
       };
-      this.uploadInfo = '导入中...';
-      api.importDeptRecord(formData, header).then(res => {
-        if (res.data.code === '00000001') {
-          this.$alert(`数据存在异常,导入失败,请修改后再试`, '提示', {
-            confirmButtonText: '确定',
-            type: 'warning'
-          })
-            .then(() => {})
-            .catch(() => {});
-          this.getDataList(); // 重新获取列表
-          setTimeout(() => {
-            this.uploadInfo = '导入';
-          }, 300);
-        } else if ((res.data.data === true && res.status === 200)) {
-          this.$alert(`导入成功`, '提示', {
-            confirmButtonText: '确定',
-            type: 'success'
-          })
-            .then(() => {})
-            .catch(() => {});
-          this.getDataList(); // 重新获取列表
-          setTimeout(() => {
-            this.uploadInfo = '导入';
-          }, 300);
-        } else {
-          this.$alert(`${res.data.msg}`, '提示', {
-            confirmButtonText: '确定',
-            type: 'warning'
-          })
-            .then(() => {})
-            .catch(() => {});
+      // this.uploadInfo = '导入中...';
+      // api.importExcelDataVerify(formData, header).then(res => {
+      //   if (res.data.code === '00020001') {
+      //     this.$confirm(`${res.data.msg}`, '提示', {
+      //       confirmButtonText: '确定',
+      //       cancelButtonText: '取消',
+      //       type: 'warning'
+      //     })
+      //       .then(() => {
+      //         this.importDeptRecord(formData, header);
+      //       })
+      //       .catch(() => {
+      //         setTimeout(() => {
+      //           this.uploadInfo = '导入';
+      //         }, 300);
+      //       });
+      //   } else if (res.data.data === true) {
+      //     this.importDeptRecord(formData, header);
+      //   } else {
+      //     this.$alert(`${res.data.msg}`, '提示', {
+      //       confirmButtonText: '确定',
+      //       // cancelButtonText: '取消',
+      //       // cancelButtonClass: 'cancelSure',
+      //       // confirmButtonClass: 'sure',
+      //       // customClass: 'exportConfirm',
+      //       type: 'warning'
+      //     })
+      //       .then(() => {})
+      //       .catch(() => {});
 
-          setTimeout(() => {
-            this.uploadInfo = '导入';
-          }, 300);
-        }
-      });
+      //     setTimeout(() => {
+      //       this.uploadInfo = '导入';
+      //     }, 300);
+      //   }
+      // });
+      this.importDeptRecord(formData, header)
       //解决上传相同文件不触发change
       let inp = document.getElementById('upFile');
       inp.value = '';
     },
+    importDeptRecord(formData, header) {
+      let that = this
+      api.importDeptRecord(formData, header).then(res => {
+        if (res.headers['content-disposition']) {
+          this.downloadUrl(res);
+          this.getDataList();
+        } else {
+          let r = new FileReader();
+          r.onload = function() {
+            if (this.result) {
+              const code = JSON.parse(this.result);
+              if (code.code === '00020007') {
+                that
+                  .$alert(`${code.msg}`, '提示', {
+                    confirmButtonText: '确定',
+                    // cancelButtonText: '取消',
+                    // cancelButtonClass: 'cancelSure',
+                    // confirmButtonClass: 'sure',
+                    // customClass: 'exportConfirm',
+                    type: 'warning'
+                  })
+                  .then(() => {})
+                  .catch(() => {});
+              }
+            } else {
+              that.$alert(`导入成功`, '提示', {
+                confirmButtonText: '确定',
+                // cancelButtonText: '取消',
+                // cancelButtonClass: 'cancelSure',
+                // confirmButtonClass: 'sure',
+                // customClass: 'exportConfirm',
+                type: 'success'
+              });
+              that.getDataList();
+            }
+          };
+          r.readAsText(res.data);
+        }
+        // if ((res.data.code === '00020007')) {
+        //   this.$alert(`医院术语字符数超出最大数量,请修改后再试`, '提示', {
+        //     confirmButtonText: '确定',
+        //     type: 'warning'
+        //   })
+        //     .then(() => {})
+        //     .catch(() => {});
+        //   this.getDataList(); // 重新获取列表
+        //   setTimeout(() => {
+        //     this.uploadInfo = '导入';
+        //   }, 300);
+        // } else if (res.data.data === true && res.status === 200) {
+        //   this.$alert(`导入成功`, '提示', {
+        //     confirmButtonText: '确定',
+        //     type: 'success'
+        //   })
+        //     .then(() => {})
+        //     .catch(() => {});
+        //   this.getDataList(); // 重新获取列表
+        //   setTimeout(() => {
+        //     this.uploadInfo = '导入';
+        //   }, 300);
+        // } else {
+        //   this.$alert(`${res.data.msg}`, '提示', {
+        //     confirmButtonText: '确定',
+        //     type: 'warning'
+        //   })
+        //     .then(() => {})
+        //     .catch(() => {});
+
+        //   setTimeout(() => {
+        //     this.uploadInfo = '导入';
+        //   }, 300);
+        // }
+      });
+    },
+    downloadUrl(res) {
+      var disposition = res.headers['content-disposition'];
+      var fileName = decodeURI(
+        disposition.split('filename=')[1].split(';filename*=')[0]
+      );
+      let blob = new Blob([res.data], { type: 'application/.xls' }); //.xls是我和后台约定好的文件格式
+      let link = document.createElement('a');
+      link.href = window.URL.createObjectURL(blob);
+      link.download = fileName;
+      link.click();
+      link.remove();
+    },
     /********新增编辑弹窗**********/
     showModal() {
       this.modalVisiable = true;

+ 209 - 72
src/components/cdssManage/disease/Disease.vue

@@ -4,10 +4,10 @@
       <el-form :inline="true" class="demo-form-inline">
         <el-form-item style="marginBottom: 0px">
           <el-button type="text" class="downTemplate" @click="exportModule">导入模板下载</el-button>
-          <input type="file" name="uploadfile " id="upFile" @change="uploadFile($event)" />
           <el-button size="mini" @click="handleMatchData">预匹配</el-button>
+          <input type="file" name="uploadfile " id="upFileMatch" @change="uploadFileMatch($event)" />
           <el-button size="mini" @click="importPage" style="margin:0 10px">{{uploadInfo}}</el-button>
-          <input type="file" name="uploadfile " id="upFileMatch"  @change="uploadFileMatch($event)" />
+          <input type="file" name="uploadfile " id="upFile" @change="uploadFile($event)" />
           <el-button size="mini" @click="exportData">导出</el-button>
         </el-form-item>
       </el-form>
@@ -15,7 +15,17 @@
     <div class="searchBar">
       <div class="searchContent">
         <el-form :inline="true" class="demo-form-inline">
-          <el-form-item label class="selectMedicine">
+          <el-form-item class="selectMedicine" label="标准术语状态:">
+            <el-select size="mini" v-model="filter.status" placeholder="请选择" clearable>
+              <el-option
+                v-for="item in statusList"
+                :label="item.name"
+                :value="item.id"
+                :key="item.id"
+              ></el-option>
+            </el-select>
+          </el-form-item>
+          <el-form-item label="匹配状态:" class="selectMedicine">
             <el-select size="mini" v-model="filter.match" placeholder="请选择" clearable>
               <el-option
                 v-for="item in matchList"
@@ -45,7 +55,14 @@
         <el-table-column :resizable="false" prop="hisName" label="医院诊断名称" show-overflow-tooltip></el-table-column>
         <el-table-column :resizable="false" prop="code" label="ICD-10编码" show-overflow-tooltip></el-table-column>
         <el-table-column :resizable="false" prop="uniqueName" label="标准诊断名称" show-overflow-tooltip></el-table-column>
-        <el-table-column :resizable="false" prop="operate" label="状态">
+        <el-table-column :resizable="false" prop="operate" label="标准术语状态">
+          <template slot-scope="scope">
+            <span
+              v-if="scope.row.uniqueName && scope.row.uniqueName!=''"
+            >{{scope.row.status == 0?'禁用':'启用'}}</span>
+          </template>
+        </el-table-column>
+        <el-table-column :resizable="false" prop="operate" label="匹配状态">
           <template slot-scope="scope">
             <span>{{scope.row.isMatch == 0?'未匹配':'已匹配'}}</span>
           </template>
@@ -104,12 +121,18 @@ export default {
         { id: 0, name: '未匹配' },
         { id: 2, name: '多项匹配' }
       ],
+      statusList: [
+        { id: '', name: '全部' },
+        { id: 1, name: '启用' },
+        { id: 0, name: '禁用' }
+      ],
       list: [],
       searched: false,
       filter: {
         hisName: '', // 医院诊断名称
-        uniqueName: '',//标准诊断名称
-        match: ''
+        uniqueName: '', //标准诊断名称
+        match: '',
+        status:''
       },
       currentPage: 1,
       pageSize: config.pageSize,
@@ -131,8 +154,9 @@ export default {
   },
   created() {
     const { data } = this.$route.params;
-    this.hospitaiName = (data && data.name) || '';
-    this.hospitalId = data && data.hospitalId;
+    this.hospitaiName = (data && data.name) || localStorage.getItem('name');
+    this.hospitalId =
+      (data && data.hospitalId) || localStorage.getItem('hospitalId');
     const that = this;
     //返回时避免参数未赋值就获取列表
     setTimeout(function() {
@@ -167,6 +191,11 @@ export default {
     // 导入数据
     uploadFileMatch(e) {
       let fileInfo = e.target.files[0];
+      let extend = fileInfo.name.substring(fileInfo.name.lastIndexOf('.') + 1);
+      if (extend != 'xls' && extend != 'xlsx') {
+        this.$message({ message: '请根据模板进行导入', type: 'error' });
+        return;
+      }
       e.preventDefault();
       let formData = new FormData();
       formData.append('file', fileInfo);
@@ -183,7 +212,7 @@ export default {
         background: 'rgba(0, 0, 0, 0.7)'
       });
       api.dataDiseaseVerify(formData, header).then(res => {
-        if ((res.data.code === '00020007' || res.data.code === '00020004')) {
+        if (res.data.code === '00020007' || res.data.code === '00020004') {
           loading.close();
           this.$alert(`${res.data.msg}`, '提示', {
             confirmButtonText: '确定',
@@ -255,9 +284,11 @@ export default {
         hisName: this.filter.hisName.trim(),
         uniqueName: this.filter.uniqueName.trim(),
         icdCode: '',
-        hospitalId: data && data.hospitalId,
+        hospitalId:
+          (data && data.hospitalId) || localStorage.getItem('hospitalId'),
         type: 4,
-        isMatch:this.filter.match
+        isMatch: this.filter.match,
+        status: this.filter.status
       };
       return param;
     },
@@ -274,7 +305,7 @@ export default {
             filter: this.filter
           }
         : { currentPage: this.currentPage, pageSize: this.pageSize };
-        this.data={}
+      this.data = {};
       this.showModal();
       /*this.$router.push({
         name: 'AddDisease',
@@ -392,21 +423,26 @@ export default {
         type: 'warning'
       })
         .then(() => {
-          api.exportDiseaseRecord({ hospitalId: this.hospitalId,type:4,isMatch:this.filter.match }).then(res => {
-            if (res.status === 200) {
-              this.$message({ message: '导出成功', type: 'success' });
-              utils.downloadExportedData(res.data, '诊断关联数据.xls');
-            }
-          });
+          api
+            .exportDiseaseRecord({
+              hospitalId: this.hospitalId,
+              type: 4,
+              isMatch: this.filter.match
+            })
+            .then(res => {
+              if (res.status === 200) {
+                this.$message({ message: '导出成功', type: 'success' });
+                utils.downloadExportedData(res.data, '诊断关联数据.xls');
+              }
+            });
         })
         .catch(() => {
           // this.$message({ message: '导出失败', type: 'waring' });
         });
     },
-
     // 导入模板
     exportModule() {
-      api.exportDiseaseModule({type:4}).then(res => {
+      api.exportDiseaseModule({ type: 4 }).then(res => {
         if (res.status === 200) {
           setTimeout(() => {
             utils.downloadExportedData(res.data, '诊断导入模板.xls');
@@ -414,16 +450,20 @@ export default {
         }
       });
     },
-
     // 点击导入
-    importPage() {
+    importPage(e) {
       let inp = document.getElementById('upFile');
       inp.click();
     },
     // 导入数据
     uploadFile(e) {
       let fileInfo = e.target.files[0];
-      e.preventDefault();
+      let extend = fileInfo.name.substring(fileInfo.name.lastIndexOf('.') + 1);
+      if (extend != 'xls' && extend != 'xlsx') {
+        this.$message({ message: '请根据模板进行导入', type: 'error' });
+        return;
+      }
+      // e.preventDefault();
       let formData = new FormData();
       formData.append('file', fileInfo);
       formData.append('hospitalId', this.hospitalId);
@@ -434,59 +474,156 @@ export default {
           'Content-Type': 'multipart/form-data'
         }
       };
-      this.uploadInfo = '导入中...';
-      api.importDiseaseRecord(formData, header).then(res => {
-        if (res.data.code === '00000001') {
-          this.$alert(`数据存在异常,导入失败,请修改后再试`, '提示', {
-            confirmButtonText: '确定',
-            // cancelButtonText: '取消',
-            // cancelButtonClass: 'cancelSure',
-            // confirmButtonClass: 'sure',
-            // customClass: 'exportConfirm',
-            type: 'warning'
-          })
-            .then(() => {})
-            .catch(() => {});
-          this.getDataList(); // 重新获取列表
-          setTimeout(() => {
-            this.uploadInfo = '导入';
-          }, 300);
-        } else if ((res.data.data === true && res.status === 200)) {
-          this.$alert(`导入成功`, '提示', {
-            confirmButtonText: '确定',
-            // cancelButtonText: '取消',
-            // cancelButtonClass: 'cancelSure',
-            // confirmButtonClass: 'sure',
-            // customClass: 'exportConfirm',
-            type: 'success'
-          })
-            .then(() => {})
-            .catch(() => {});
-          this.getDataList(); // 重新获取列表
-          setTimeout(() => {
-            this.uploadInfo = '导入';
-          }, 300);
-        } else {
-          this.$alert(`${res.data.msg}`, '提示', {
-            confirmButtonText: '确定',
-            // cancelButtonText: '取消',
-            // cancelButtonClass: 'cancelSure',
-            // confirmButtonClass: 'sure',
-            // customClass: 'exportConfirm',
-            type: 'warning'
-          })
-            .then(() => {})
-            .catch(() => {});
+      // this.uploadInfo = '导入中...';
+      // api.importExcelDataVerify(formData, header).then(res => {
+      //   if (res.data.code === '00020001') {
+      //     this.$confirm(`${res.data.msg}`, '提示', {
+      //       confirmButtonText: '确定',
+      //       cancelButtonText: '取消',
+      //       type: 'warning'
+      //     })
+      //       .then(() => {
+      //         this.importDiseaseRecord(formData, header);
+      //       })
+      //       .catch(() => {
+      //         setTimeout(() => {
+      //           this.uploadInfo = '导入';
+      //         }, 300);
+      //       });
+      //   } else if (res.data.data === true) {
+      //     this.importDiseaseRecord(formData, header);
+      //   } else {
+      //     this.$alert(`${res.data.msg}`, '提示', {
+      //       confirmButtonText: '确定',
+      //       // cancelButtonText: '取消',
+      //       // cancelButtonClass: 'cancelSure',
+      //       // confirmButtonClass: 'sure',
+      //       // customClass: 'exportConfirm',
+      //       type: 'warning'
+      //     })
+      //       .then(() => {})
+      //       .catch(() => {});
 
-          setTimeout(() => {
-            this.uploadInfo = '导入';
-          }, 300);
-        }
-      });
+      //     setTimeout(() => {
+      //       this.uploadInfo = '导入';
+      //     }, 300);
+      //   }
+      // });
+      this.importDiseaseRecord(formData, header);
       //解决上传相同文件不触发change
       let inp = document.getElementById('upFile');
       inp.value = '';
     },
+    importDiseaseRecord(formData, header) {
+      let that = this
+      api.importDiseaseRecord(formData, header).then(res => {
+        if (res.headers['content-disposition']) {
+          this.downloadUrl(res);
+          this.getDataList();
+        } else {
+          let r = new FileReader();
+          r.onload = function() {
+            if (this.result) {
+              const code = JSON.parse(this.result);
+              if (code.code === '00020007') {
+                that
+                  .$alert(`${code.msg}`, '提示', {
+                    confirmButtonText: '确定',
+                    // cancelButtonText: '取消',
+                    // cancelButtonClass: 'cancelSure',
+                    // confirmButtonClass: 'sure',
+                    // customClass: 'exportConfirm',
+                    type: 'warning'
+                  })
+                  .then(() => {})
+                  .catch(() => {});
+              }
+            } else {
+              that.$alert(`导入成功`, '提示', {
+                confirmButtonText: '确定',
+                // cancelButtonText: '取消',
+                // cancelButtonClass: 'cancelSure',
+                // confirmButtonClass: 'sure',
+                // customClass: 'exportConfirm',
+                type: 'success'
+              });
+              that.getDataList();
+            }
+          };
+          r.readAsText(res.data);
+        }
+        // if (res.headers['content-disposition']) {
+        //   this.downloadUrl(res);
+        // } else {
+        //   this.$alert(`导入成功`, '提示', {
+        //     confirmButtonText: '确定',
+        //     // cancelButtonText: '取消',
+        //     // cancelButtonClass: 'cancelSure',
+        //     // confirmButtonClass: 'sure',
+        //     // customClass: 'exportConfirm',
+        //     type: 'success'
+        //   });
+        // }
+        // if (res.data.code === '00020007') {
+        //   this.$alert(`医院术语字符数超出最大数量,请修改后再试`, '提示', {
+        //     confirmButtonText: '确定',
+        //     // cancelButtonText: '取消',
+        //     // cancelButtonClass: 'cancelSure',
+        //     // confirmButtonClass: 'sure',
+        //     // customClass: 'exportConfirm',
+        //     type: 'warning'
+        //   })
+        //     .then(() => {})
+        //     .catch(() => {});
+        //   this.getDataList(); // 重新获取列表
+        //   setTimeout(() => {
+        //     this.uploadInfo = '导入';
+        //   }, 300);
+        // } else if (res.data.data === true && res.status === 200) {
+        //   this.$alert(`导入成功`, '提示', {
+        //     confirmButtonText: '确定',
+        //     // cancelButtonText: '取消',
+        //     // cancelButtonClass: 'cancelSure',
+        //     // confirmButtonClass: 'sure',
+        //     // customClass: 'exportConfirm',
+        //     type: 'success'
+        //   })
+        //     .then(() => {})
+        //     .catch(() => {});
+        //   this.getDataList(); // 重新获取列表
+        //   setTimeout(() => {
+        //     this.uploadInfo = '导入';
+        //   }, 300);
+        // } else {
+        //   this.$alert(`${res.data.msg}`, '提示', {
+        //     confirmButtonText: '确定',
+        //     // cancelButtonText: '取消',
+        //     // cancelButtonClass: 'cancelSure',
+        //     // confirmButtonClass: 'sure',
+        //     // customClass: 'exportConfirm',
+        //     type: 'warning'
+        //   })
+        //     .then(() => {})
+        //     .catch(() => {});
+
+        //   setTimeout(() => {
+        //     this.uploadInfo = '导入';
+        //   }, 300);
+        // }
+      });
+    },
+    downloadUrl(res) {
+      var disposition = res.headers['content-disposition'];
+      var fileName = decodeURI(
+        disposition.split('filename=')[1].split(';filename*=')[0]
+      );
+      let blob = new Blob([res.data], { type: 'application/.xls' }); //.xls是我和后台约定好的文件格式
+      let link = document.createElement('a');
+      link.href = window.URL.createObjectURL(blob);
+      link.download = fileName;
+      link.click();
+      link.remove();
+    },
     /********新增编辑弹窗**********/
     showModal() {
       this.modalVisiable = true;
@@ -498,7 +635,7 @@ export default {
         this.modalVisiable = false;
         this.getDataList();
       }
-    },
+    }
   }
 };
 </script>

+ 231 - 75
src/components/cdssManage/drug/DrugManage.vue

@@ -5,7 +5,7 @@
         <el-form-item style="marginBottom: 0px">
           <el-button type="text" class="downTemplate" @click="exportModule">导入模板下载</el-button>
           <input type="file" name="uploadfile " id="upFile" @change="uploadFile($event)" />
-          <el-button size="mini" @click="handleMatchData" >预匹配</el-button>
+          <el-button size="mini" @click="handleMatchData">预匹配</el-button>
           <el-button size="mini" @click="importPage" style="margin:0 10px">{{uploadInfo}}</el-button>
           <input type="file" name="uploadfile " id="upFileMatch" @change="uploadFileMatch($event)" />
           <el-button size="mini" @click="exportData">导出</el-button>
@@ -15,7 +15,27 @@
     <div class="searchBar">
       <div class="searchContent">
         <el-form :inline="true" class="demo-form-inline">
-          <el-form-item label class="selectMedicine">
+          <el-form-item class="selectMedicine" label="标准术语状态:">
+            <el-select size="mini" v-model="filter.status" placeholder="请选择" clearable>
+              <el-option
+                v-for="item in statusList"
+                :label="item.name"
+                :value="item.id"
+                :key="item.id"
+              ></el-option>
+            </el-select>
+          </el-form-item>
+          <el-form-item label="剂型术语状态:" class="selectMedicine">
+            <el-select size="mini" v-model="filter.formStatus" placeholder="请选择" clearable>
+              <el-option
+                v-for="item in formstatusList"
+                :label="item.name"
+                :value="item.id"
+                :key="item.id"
+              ></el-option>
+            </el-select>
+          </el-form-item>
+          <el-form-item label="匹配状态:" class="selectMedicine">
             <el-select size="mini" v-model="filter.match" placeholder="请选择" clearable>
               <el-option
                 v-for="item in matchList"
@@ -31,6 +51,8 @@
           <el-form-item label="标准药品名称:">
             <el-input size="mini" v-model="filter.uniqueName" placeholder="请输入" clearable></el-input>
           </el-form-item>
+        </el-form>
+        <el-form :inline="true" class="demo-form-inline">
           <el-form-item class="dododo">
             <el-button size="mini" @click="filterDatas">检索</el-button>
             <el-button size="mini" type="warning" @click="addRelation">添加关联</el-button>
@@ -38,6 +60,7 @@
         </el-form>
       </div>
     </div>
+
     <div class="contentsOther">
       <el-table :data="list" border style="width: 100%">
         <el-table-column :resizable="false" type="index" :index="indexMethod" label="编号" width="80"></el-table-column>
@@ -45,7 +68,22 @@
         <el-table-column :resizable="false" prop="hisName" label="医院药品名称" show-overflow-tooltip></el-table-column>
         <el-table-column :resizable="false" prop="uniqueName" label="标准药品名称" show-overflow-tooltip></el-table-column>
         <el-table-column :resizable="false" prop="form" label="药品剂型" show-overflow-tooltip></el-table-column>
-        <el-table-column :resizable="false" prop="operate" label="状态">
+
+        <el-table-column :resizable="false" prop="operate" label="标准术语状态">
+          <template slot-scope="scope">
+            <span
+              v-if="scope.row.uniqueName && scope.row.uniqueName!=''"
+            >{{scope.row.status == 0?'禁用':'启用'}}</span>
+          </template>
+        </el-table-column>
+        <el-table-column :resizable="false" prop="operate" label="剂型术语状态">
+          <template slot-scope="scope">
+            <span
+              v-if="scope.row.form && scope.row.form!=''"
+            >{{scope.row.formStatus == 0?'禁用':'启用'}}</span>
+          </template>
+        </el-table-column>
+        <el-table-column :resizable="false" prop="operate" label="匹配状态">
           <template slot-scope="scope">
             <span>{{scope.row.isMatch == 0?'未匹配':'已匹配'}}</span>
           </template>
@@ -110,8 +148,20 @@ export default {
       filter: {
         hisName: '', // 医院诊断名称
         uniqueName: '', //标准诊断名称
-        match:''
+        match: '',
+        status: '',
+        formStatus: ''
       },
+      statusList: [
+        { id: '', name: '全部' },
+        { id: 1, name: '启用' },
+        { id: 0, name: '禁用' }
+      ],
+      formstatusList: [
+        { id: '', name: '全部' },
+        { id: 1, name: '启用' },
+        { id: 0, name: '禁用' }
+      ],
       currentPage: 1,
       pageSize: config.pageSize,
       pageSizeArr: config.pageSizeArr,
@@ -125,13 +175,14 @@ export default {
       data: {}
     };
   },
-  components:{
+  components: {
     LtModal
   },
   created() {
     const { data } = this.$route.params;
-    this.hospitaiName = (data && data.name) || '';
-    this.hospitalId = data && data.hospitalId;
+    this.hospitaiName = (data && data.name) || localStorage.getItem('name');
+    this.hospitalId =
+      (data && data.hospitalId) || localStorage.getItem('hospitalId');
     const that = this;
     //返回时避免参数未赋值就获取列表
     setTimeout(function() {
@@ -166,6 +217,11 @@ export default {
     // 导入数据
     uploadFileMatch(e) {
       let fileInfo = e.target.files[0];
+      let extend = fileInfo.name.substring(fileInfo.name.lastIndexOf('.') + 1);
+      if (extend != 'xls' && extend != 'xlsx') {
+        this.$message({ message: '请根据模板进行导入', type: 'error' });
+        return;
+      }
       e.preventDefault();
       let formData = new FormData();
       formData.append('file', fileInfo);
@@ -182,7 +238,7 @@ export default {
         background: 'rgba(0, 0, 0, 0.7)'
       });
       api.dataDrugVerify(formData, header).then(res => {
-        if ((res.data.code === '00020007' || res.data.code === '00020004')) {
+        if (res.data.code === '00020007' || res.data.code === '00020004') {
           loading.close();
           this.$alert(`${res.data.msg}`, '提示', {
             confirmButtonText: '确定',
@@ -255,9 +311,12 @@ export default {
         hisName: this.filter.hisName.trim(),
         uniqueName: this.filter.uniqueName.trim(),
         uniqueCode: '',
-        hospitalId: data && data.hospitalId,
+        hospitalId:
+          (data && data.hospitalId) || localStorage.getItem('hospitalId'),
         type: 5,
-        isMatch:this.filter.match
+        isMatch: this.filter.match,
+        status: this.filter.status,
+        formStatus: this.filter.formStatus
       };
       return param;
     },
@@ -282,8 +341,8 @@ export default {
       //     hospitaiName: this.hospitaiName
       //   })
       // });
-      this.data={}
-      this.showModal()
+      this.data = {};
+      this.showModal();
     },
     // 修改诊断关联-跳转至编辑页面
     modifyRelation(row) {
@@ -303,8 +362,8 @@ export default {
       //     hospitaiName: this.hospitaiName
       //   })
       // });
-      this.data = item
-      this.showModal()
+      this.data = item;
+      this.showModal();
     },
     currentChange(next) {
       this.currentPage = next;
@@ -407,12 +466,18 @@ export default {
         // }
       })
         .then(() => {
-          api.exportDrugRecord({ hospitalId: this.hospitalId,type:5,isMatch:this.filter.match }).then(res => {
-            if (res.status === 200) {
-              this.$message({ message: '导出成功', type: 'success' });
-              utils.downloadExportedData(res.data, '药品关联数据.xls');
-            }
-          });
+          api
+            .exportDrugRecord({
+              hospitalId: this.hospitalId,
+              type: 5,
+              isMatch: this.filter.match
+            })
+            .then(res => {
+              if (res.status === 200) {
+                this.$message({ message: '导出成功', type: 'success' });
+                utils.downloadExportedData(res.data, '药品关联数据.xls');
+              }
+            });
         })
         .catch(() => {
           // this.$message({ message: '导出失败', type: 'waring' });
@@ -421,7 +486,7 @@ export default {
 
     // 导入模板
     exportModule() {
-      api.exportDrugModule({type:5}).then(res => {
+      api.exportDrugModule({ type: 5 }).then(res => {
         if (res.status === 200) {
           setTimeout(() => {
             utils.downloadExportedData(res.data, '药品导入模板.xls');
@@ -438,6 +503,11 @@ export default {
     // 导入数据
     uploadFile(e) {
       let fileInfo = e.target.files[0];
+      let extend = fileInfo.name.substring(fileInfo.name.lastIndexOf('.') + 1);
+      if (extend != 'xls' && extend != 'xlsx') {
+        this.$message({ message: '请根据模板进行导入', type: 'error' });
+        return;
+      }
       e.preventDefault();
       let formData = new FormData();
       formData.append('file', fileInfo);
@@ -449,60 +519,145 @@ export default {
           'Content-Type': 'multipart/form-data'
         }
       };
-      this.uploadInfo = '导入中...';
-      api.importDrugRecord(formData, header).then(res => {
-        // console.log(res, '======================res导入结果');
-        if (res.data.code === '00000001') {
-          this.$alert(`数据存在异常,导入失败,请修改后再试`, '提示', {
-            confirmButtonText: '确定',
-            // cancelButtonText: '取消',
-            // cancelButtonClass: 'cancelSure',
-            // confirmButtonClass: 'sure',
-            // customClass: 'exportConfirm',
-            type: 'warning'
-          })
-            .then(() => {})
-            .catch(() => {});
-          this.getDataList(); // 重新获取列表
-          setTimeout(() => {
-            this.uploadInfo = '导入';
-          }, 300);
-        } else if ((res.data.data === true && res.status === 200)) {
-          this.$alert(`导入成功`, '提示', {
-            confirmButtonText: '确定',
-            // cancelButtonText: '取消',
-            // cancelButtonClass: 'cancelSure',
-            // confirmButtonClass: 'sure',
-            // customClass: 'exportConfirm',
-            type: 'success'
-          })
-            .then(() => {})
-            .catch(() => {});
-          this.getDataList(); // 重新获取列表
-          setTimeout(() => {
-            this.uploadInfo = '导入';
-          }, 300);
-        } else {
-          this.$alert(`${res.data.msg}`, '提示', {
-            confirmButtonText: '确定',
-            // // cancelButtonText: '取消',
-            // cancelButtonClass: 'cancelSure',
-            // confirmButtonClass: 'sure',
-            // customClass: 'exportConfirm',
-            type: 'warning'
-          })
-            .then(() => {})
-            .catch(() => {});
+      // this.uploadInfo = '导入中...';
+      // api.importExcelDataVerify(formData, header).then(res => {
+      //   if (res.data.code === '00020001') {
+      //     this.$confirm(`${res.data.msg}`, '提示', {
+      //       confirmButtonText: '确定',
+      //       cancelButtonText: '取消',
+      //       type: 'warning'
+      //     })
+      //       .then(() => {
+      //         this.importDrugRecord(formData, header)
+      //       })
+      //       .catch(() => {
+      //         setTimeout(() => {
+      //           this.uploadInfo = '导入';
+      //         }, 300);
+      //       });
+      //   } else if (res.data.data === true) {
+      //     this.importDrugRecord(formData, header)
+      //   } else {
+      //     this.$alert(`${res.data.msg}`, '提示', {
+      //       confirmButtonText: '确定',
+      //       // cancelButtonText: '取消',
+      //       // cancelButtonClass: 'cancelSure',
+      //       // confirmButtonClass: 'sure',
+      //       // customClass: 'exportConfirm',
+      //       type: 'warning'
+      //     })
+      //       .then(() => {})
+      //       .catch(() => {});
 
-          setTimeout(() => {
-            this.uploadInfo = '导入';
-          }, 300);
-        }
-      });
+      //     setTimeout(() => {
+      //       this.uploadInfo = '导入';
+      //     }, 300);
+      //   }
+      // });
+      this.importDrugRecord(formData, header);
       //解决上传相同文件不触发change
       let inp = document.getElementById('upFile');
       inp.value = '';
     },
+    importDrugRecord(formData, header) {
+      let that = this;
+      api.importDrugRecord(formData, header).then(res => {
+        if (res.headers['content-disposition']) {
+          this.downloadUrl(res);
+          this.getDataList();
+        } else {
+          let r = new FileReader();
+          r.onload = function() {
+            console.log(this.result);
+            if (this.result) {
+              const code = JSON.parse(this.result);
+              if (code.code === '00020007') {
+                that
+                  .$alert(`${code.msg}`, '提示', {
+                    confirmButtonText: '确定',
+                    // cancelButtonText: '取消',
+                    // cancelButtonClass: 'cancelSure',
+                    // confirmButtonClass: 'sure',
+                    // customClass: 'exportConfirm',
+                    type: 'warning'
+                  })
+                  .then(() => {})
+                  .catch(() => {});
+              }
+            } else {
+              that.$alert(`导入成功`, '提示', {
+                confirmButtonText: '确定',
+                // cancelButtonText: '取消',
+                // cancelButtonClass: 'cancelSure',
+                // confirmButtonClass: 'sure',
+                // customClass: 'exportConfirm',
+                type: 'success'
+              });
+              that.getDataList();
+            }
+          };
+          r.readAsText(res.data);
+        }
+        // if ((res.data.code === '00020007')) {
+        //   this.$alert(`医院术语字符数超出最大数量,请修改后再试`, '提示', {
+        //     confirmButtonText: '确定',
+        //     // cancelButtonText: '取消',
+        //     // cancelButtonClass: 'cancelSure',
+        //     // confirmButtonClass: 'sure',
+        //     // customClass: 'exportConfirm',
+        //     type: 'warning'
+        //   })
+        //     .then(() => {})
+        //     .catch(() => {});
+        //   this.getDataList(); // 重新获取列表
+        //   setTimeout(() => {
+        //     this.uploadInfo = '导入';
+        //   }, 300);
+        // } else if (res.data.data === true && res.status === 200) {
+        //   this.$alert(`导入成功`, '提示', {
+        //     confirmButtonText: '确定',
+        //     // cancelButtonText: '取消',
+        //     // cancelButtonClass: 'cancelSure',
+        //     // confirmButtonClass: 'sure',
+        //     // customClass: 'exportConfirm',
+        //     type: 'success'
+        //   })
+        //     .then(() => {})
+        //     .catch(() => {});
+        //   this.getDataList(); // 重新获取列表
+        //   setTimeout(() => {
+        //     this.uploadInfo = '导入';
+        //   }, 300);
+        // } else {
+        //   this.$alert(`${res.data.msg}`, '提示', {
+        //     confirmButtonText: '确定',
+        //     // // cancelButtonText: '取消',
+        //     // cancelButtonClass: 'cancelSure',
+        //     // confirmButtonClass: 'sure',
+        //     // customClass: 'exportConfirm',
+        //     type: 'warning'
+        //   })
+        //     .then(() => {})
+        //     .catch(() => {});
+
+        //   setTimeout(() => {
+        //     this.uploadInfo = '导入';
+        //   }, 300);
+        // }
+      });
+    },
+    downloadUrl(res) {
+      var disposition = res.headers['content-disposition'];
+      var fileName = decodeURI(
+        disposition.split('filename=')[1].split(';filename*=')[0]
+      );
+      let blob = new Blob([res.data], { type: 'application/.xls' }); //.xls是我和后台约定好的文件格式
+      let link = document.createElement('a');
+      link.href = window.URL.createObjectURL(blob);
+      link.download = fileName;
+      link.click();
+      link.remove();
+    },
     /********新增编辑弹窗**********/
     showModal() {
       this.modalVisiable = true;
@@ -570,7 +725,7 @@ export default {
 }
 .searchBar {
   min-width: 980px;
-  height: 60px;
+  height: 120px;
   display: flex;
   justify-content: center;
   align-items: center;
@@ -578,12 +733,13 @@ export default {
   z-index: 9999;
   padding: 40px 20px 0;
   .searchContent {
-    height: 40px;
+    height: 80px;
     flex: 1;
     background-color: #fff;
-    display: flex;
-    justify-content: flex-end;
-    float: right;
+    .demo-form-inline {
+      display: flex;
+      justify-content: flex-end;
+    }
   }
 }
 .contentsOther {

+ 172 - 55
src/components/cdssManage/fusion/Fusion.vue

@@ -15,7 +15,17 @@
     <div class="searchBar">
       <div class="searchContent">
         <el-form :inline="true" class="demo-form-inline">
-          <el-form-item label class="selectMedicine">
+          <el-form-item class="selectMedicine" label="标准术语状态:">
+            <el-select size="mini" v-model="filter.status" placeholder="请选择" clearable>
+              <el-option
+                v-for="item in statusList"
+                :label="item.name"
+                :value="item.id"
+                :key="item.id"
+              ></el-option>
+            </el-select>
+          </el-form-item>
+          <el-form-item label="匹配状态:" class="selectMedicine">
             <el-select size="mini" v-model="filter.match" placeholder="请选择" clearable>
               <el-option
                 v-for="item in matchList"
@@ -44,7 +54,12 @@
         <el-table-column :resizable="false" prop="gmtModified" label="操作时间" width="180"></el-table-column>
         <el-table-column :resizable="false" prop="hisName" label="医院输血类型" show-overflow-tooltip></el-table-column>
         <el-table-column :resizable="false" prop="uniqueName" label="标准输血类型" show-overflow-tooltip></el-table-column>
-        <el-table-column :resizable="false" prop="operate" label="状态">
+        <el-table-column :resizable="false" prop="operate" label="标准术语状态">
+          <template slot-scope="scope">
+            <span v-if="scope.row.uniqueName && scope.row.uniqueName!=''">{{scope.row.status == 0?'禁用':'启用'}}</span>
+          </template>
+        </el-table-column>
+        <el-table-column :resizable="false" prop="operate" label="匹配状态">
           <template slot-scope="scope">
             <span>{{scope.row.isMatch == 0?'未匹配':'已匹配'}}</span>
           </template>
@@ -103,7 +118,8 @@ export default {
       filter: {
         hisName: '', // 医院诊断名称
         uniqueName: '', //标准诊断名称
-        match:''
+        match:'',
+        status:''
       },
       matchList: [
         { id: '', name: '全部' },
@@ -111,6 +127,11 @@ export default {
         { id: 0, name: '未匹配' },
         { id: 2, name: '多项匹配' }
       ],
+      statusList: [
+        { id: '', name: '全部' },
+        { id: 1, name: '启用' },
+        { id: 0, name: '禁用' },
+      ],
       currentPage: 1,
       pageSize: config.pageSize,
       pageSizeArr: config.pageSizeArr,
@@ -129,8 +150,8 @@ export default {
   },
   created() {
     const { data } = this.$route.params;
-    this.hospitaiName = (data && data.name) || '';
-    this.hospitalId = data && data.hospitalId;
+    this.hospitaiName = (data && data.name) || localStorage.getItem('name');
+    this.hospitalId = (data && data.hospitalId) || localStorage.getItem('hospitalId');
     const that = this;
     //返回时避免参数未赋值就获取列表
     setTimeout(function() {
@@ -165,6 +186,11 @@ export default {
     // 导入数据
     uploadFileMatch(e) {
       let fileInfo = e.target.files[0];
+      let extend = fileInfo.name.substring(fileInfo.name.lastIndexOf('.') + 1);
+      if (extend != 'xls' && extend != 'xlsx') {
+        this.$message({ message: '请根据模板进行导入', type: 'error' });
+        return;
+      }
       e.preventDefault();
       let formData = new FormData();
       formData.append('file', fileInfo);
@@ -253,9 +279,10 @@ export default {
         hisName: this.filter.hisName.trim(),
         uniqueName: this.filter.uniqueName.trim(),
         uniqueCode: '',
-        hospitalId: data && data.hospitalId,
+        hospitalId: (data && data.hospitalId) || localStorage.getItem('hospitalId'),
         type: 8,
-        isMatch:this.filter.match
+        isMatch:this.filter.match,
+        status: this.filter.status,
       };
       return param;
     },
@@ -435,6 +462,11 @@ export default {
     // 导入数据
     uploadFile(e) {
       let fileInfo = e.target.files[0];
+      let extend = fileInfo.name.substring(fileInfo.name.lastIndexOf('.') + 1);
+      if (extend != 'xls' && extend != 'xlsx') {
+        this.$message({ message: '请根据模板进行导入', type: 'error' });
+        return;
+      }
       e.preventDefault();
       let formData = new FormData();
       formData.append('file', fileInfo);
@@ -446,59 +478,144 @@ export default {
           'Content-Type': 'multipart/form-data'
         }
       };
-      this.uploadInfo = '导入中...';
-      api.importFusionRecord(formData, header).then(res => {
-        if (res.data.code === '00000001') {
-          this.$alert(`数据存在异常,导入失败,请修改后再试`, '提示', {
-            confirmButtonText: '确定',
-            // cancelButtonText: '取消',
-            // cancelButtonClass: 'cancelSure',
-            // confirmButtonClass: 'sure',
-            // customClass: 'exportConfirm',
-            type: 'warning'
-          })
-            .then(() => {})
-            .catch(() => {});
-          this.getDataList(); // 重新获取列表
-          setTimeout(() => {
-            this.uploadInfo = '导入';
-          }, 300);
-        } else if ((res.data.data === true && res.status === 200)) {
-          this.$alert(`导入成功`, '提示', {
-            confirmButtonText: '确定',
-            // cancelButtonText: '取消',
-            // cancelButtonClass: 'cancelSure',
-            // confirmButtonClass: 'sure',
-            // customClass: 'exportConfirm',
-            type: 'success'
-          })
-            .then(() => {})
-            .catch(() => {});
-          this.getDataList(); // 重新获取列表
-          setTimeout(() => {
-            this.uploadInfo = '导入';
-          }, 300);
-        } else {
-          this.$alert(`${res.data.msg}`, '提示', {
-            confirmButtonText: '确定',
-            // cancelButtonText: '取消',
-            // cancelButtonClass: 'cancelSure',
-            // confirmButtonClass: 'sure',
-            // customClass: 'exportConfirm',
-            type: 'warning'
-          })
-            .then(() => {})
-            .catch(() => {});
+      // this.uploadInfo = '导入中...';
+      // api.importExcelDataVerify(formData, header).then(res => {
+      //   if (res.data.code === '00020001') {
+      //     this.$confirm(`${res.data.msg}`, '提示', {
+      //       confirmButtonText: '确定',
+      //       cancelButtonText: '取消',
+      //       type: 'warning'
+      //     })
+      //       .then(() => {
+      //         this.importFusionRecord(formData,header)
+      //       })
+      //       .catch(() => {
+      //         setTimeout(() => {
+      //           this.uploadInfo = '导入';
+      //         }, 300);
+      //       });
+      //   } else if (res.data.data === true) {
+      //     this.importFusionRecord(formData,header)
+      //   }else {
+      //     this.$alert(`${res.data.msg}`, '提示', {
+      //       confirmButtonText: '确定',
+      //       // cancelButtonText: '取消',
+      //       // cancelButtonClass: 'cancelSure',
+      //       // confirmButtonClass: 'sure',
+      //       // customClass: 'exportConfirm',
+      //       type: 'warning'
+      //     })
+      //       .then(() => {})
+      //       .catch(() => {});
 
-          setTimeout(() => {
-            this.uploadInfo = '导入';
-          }, 300);
-        }
-      });
+      //     setTimeout(() => {
+      //       this.uploadInfo = '导入';
+      //     }, 300);
+      //   }
+      // });
+      this.importFusionRecord(formData,header)
       //解决上传相同文件不触发change
       let inp = document.getElementById('upFile');
       inp.value = '';
     },
+    importFusionRecord(formData,header){
+      let that = this
+      api.importFusionRecord(formData, header).then(res => {
+        if (res.headers['content-disposition']) {
+          this.downloadUrl(res);
+          this.getDataList();
+        } else {
+          let r = new FileReader();
+          r.onload = function() {
+            if (this.result) {
+              const code = JSON.parse(this.result);
+              if (code.code === '00020007') {
+                that
+                  .$alert(`${code.msg}`, '提示', {
+                    confirmButtonText: '确定',
+                    // cancelButtonText: '取消',
+                    // cancelButtonClass: 'cancelSure',
+                    // confirmButtonClass: 'sure',
+                    // customClass: 'exportConfirm',
+                    type: 'warning'
+                  })
+                  .then(() => {})
+                  .catch(() => {});
+              }
+            } else {
+              that.$alert(`导入成功`, '提示', {
+                confirmButtonText: '确定',
+                // cancelButtonText: '取消',
+                // cancelButtonClass: 'cancelSure',
+                // confirmButtonClass: 'sure',
+                // customClass: 'exportConfirm',
+                type: 'success'
+              });
+              that.getDataList();
+            }
+          };
+          r.readAsText(res.data);
+        }
+        // if ((res.data.code === '00020007')) {
+        //   this.$alert(`医院术语字符数超出最大数量,请修改后再试`, '提示', {
+        //     confirmButtonText: '确定',
+        //     // cancelButtonText: '取消',
+        //     // cancelButtonClass: 'cancelSure',
+        //     // confirmButtonClass: 'sure',
+        //     // customClass: 'exportConfirm',
+        //     type: 'warning'
+        //   })
+        //     .then(() => {})
+        //     .catch(() => {});
+        //   this.getDataList(); // 重新获取列表
+        //   setTimeout(() => {
+        //     this.uploadInfo = '导入';
+        //   }, 300);
+        // } else if ((res.data.data === true && res.status === 200)) {
+        //   this.$alert(`导入成功`, '提示', {
+        //     confirmButtonText: '确定',
+        //     // cancelButtonText: '取消',
+        //     // cancelButtonClass: 'cancelSure',
+        //     // confirmButtonClass: 'sure',
+        //     // customClass: 'exportConfirm',
+        //     type: 'success'
+        //   })
+        //     .then(() => {})
+        //     .catch(() => {});
+        //   this.getDataList(); // 重新获取列表
+        //   setTimeout(() => {
+        //     this.uploadInfo = '导入';
+        //   }, 300);
+        // } else {
+        //   this.$alert(`${res.data.msg}`, '提示', {
+        //     confirmButtonText: '确定',
+        //     // cancelButtonText: '取消',
+        //     // cancelButtonClass: 'cancelSure',
+        //     // confirmButtonClass: 'sure',
+        //     // customClass: 'exportConfirm',
+        //     type: 'warning'
+        //   })
+        //     .then(() => {})
+        //     .catch(() => {});
+
+        //   setTimeout(() => {
+        //     this.uploadInfo = '导入';
+        //   }, 300);
+        // }
+      });
+    },
+    downloadUrl(res) {
+      var disposition = res.headers['content-disposition'];
+      var fileName = decodeURI(
+        disposition.split('filename=')[1].split(';filename*=')[0]
+      );
+      let blob = new Blob([res.data], { type: 'application/.xls' }); //.xls是我和后台约定好的文件格式
+      let link = document.createElement('a');
+      link.href = window.URL.createObjectURL(blob);
+      link.download = fileName;
+      link.click();
+      link.remove();
+    },
     /********新增编辑弹窗**********/
     showModal() {
       this.modalVisiable = true;

+ 199 - 68
src/components/cdssManage/lis/Lis.vue

@@ -15,7 +15,17 @@
     <div class="searchBar">
       <div class="searchContent">
         <el-form :inline="true" class="demo-form-inline">
-          <el-form-item label class="selectMedicine">
+          <el-form-item class="selectMedicine" label="标准术语状态:">
+            <el-select size="mini" v-model="filter.status" placeholder="请选择" clearable>
+              <el-option
+                v-for="item in statusList"
+                :label="item.name"
+                :value="item.id"
+                :key="item.id"
+              ></el-option>
+            </el-select>
+          </el-form-item>
+          <el-form-item class="selectMedicine" label="匹配状态:">
             <el-select size="mini" v-model="filter.match" placeholder="请选择" clearable>
               <el-option
                 v-for="item in matchList"
@@ -34,6 +44,8 @@
           <el-form-item label="标准检验项:">
             <el-input size="mini" v-model="filter.uniqueName" placeholder="请输入" clearable></el-input>
           </el-form-item>
+        </el-form>
+        <el-form :inline="true" class="demo-form-inline">
           <el-form-item class="dododo">
             <el-button size="mini" @click="filterDatas">检索</el-button>
             <el-button size="mini" type="warning" @click="addRelation">添加关联</el-button>
@@ -48,7 +60,14 @@
         <el-table-column :resizable="false" prop="hisName" label="检验套餐" show-overflow-tooltip></el-table-column>
         <el-table-column :resizable="false" prop="hisDetailName" label="检验细项" show-overflow-tooltip></el-table-column>
         <el-table-column :resizable="false" prop="uniqueName" label="标准检验项" show-overflow-tooltip></el-table-column>
-        <el-table-column :resizable="false" prop="operate" label="状态">
+        <el-table-column :resizable="false" prop="operate" label="标准术语状态">
+          <template slot-scope="scope">
+            <span
+              v-if="scope.row.uniqueName && scope.row.uniqueName!=''"
+            >{{scope.row.status == 0?'禁用':'启用'}}</span>
+          </template>
+        </el-table-column>
+        <el-table-column :resizable="false" prop="operate" label="匹配状态">
           <template slot-scope="scope">
             <span>{{scope.row.isMatch == 0?'未匹配':'已匹配'}}</span>
           </template>
@@ -108,7 +127,8 @@ export default {
         hisName: '', // 检验套餐
         hisDetailName: '', //检验细项
         uniqueName: '', //标准检验项
-        match: ''
+        match: '',
+        status: ''
       },
       matchList: [
         { id: '', name: '全部' },
@@ -116,6 +136,11 @@ export default {
         { id: 0, name: '未匹配' },
         { id: 2, name: '多项匹配' }
       ],
+      statusList: [
+        { id: '', name: '全部' },
+        { id: 1, name: '启用' },
+        { id: 0, name: '禁用' }
+      ],
       currentPage: 1,
       pageSize: config.pageSize,
       pageSizeArr: config.pageSizeArr,
@@ -134,8 +159,9 @@ export default {
   },
   created() {
     const { data } = this.$route.params;
-    this.hospitaiName = (data && data.name) || '';
-    this.hospitalId = data && data.hospitalId;
+    this.hospitaiName = (data && data.name) || localStorage.getItem('name');
+    this.hospitalId =
+      (data && data.hospitalId) || localStorage.getItem('hospitalId');
     const that = this;
     //返回时避免参数未赋值就获取列表
     setTimeout(function() {
@@ -170,6 +196,11 @@ export default {
     // 导入数据
     uploadFileMatch(e) {
       let fileInfo = e.target.files[0];
+      let extend = fileInfo.name.substring(fileInfo.name.lastIndexOf('.') + 1);
+      if (extend != 'xls' && extend != 'xlsx') {
+        this.$message({ message: '请根据模板进行导入', type: 'error' });
+        return;
+      }
       e.preventDefault();
       let formData = new FormData();
       formData.append('file', fileInfo);
@@ -186,7 +217,7 @@ export default {
         background: 'rgba(0, 0, 0, 0.7)'
       });
       api.dataLisVerify(formData, header).then(res => {
-        if ((res.data.code === '00020007' || res.data.code === '00020004')) {
+        if (res.data.code === '00020007' || res.data.code === '00020004') {
           loading.close();
           this.$alert(`${res.data.msg}`, '提示', {
             confirmButtonText: '确定',
@@ -259,9 +290,11 @@ export default {
         uniqueName: this.filter.uniqueName.trim(),
         uniqueCode: '',
         hisDetailName: this.filter.hisDetailName.trim(),
-        hospitalId: data && data.hospitalId,
+        hospitalId:
+          (data && data.hospitalId) || localStorage.getItem('hospitalId'),
         type: 1,
-        isMatch: this.filter.match
+        isMatch: this.filter.match,
+        status: this.filter.status
       };
       return param;
     },
@@ -412,12 +445,18 @@ export default {
         // }
       })
         .then(() => {
-          api.exportLisRecord({ hospitalId: this.hospitalId,type:1,isMatch:this.filter.match }).then(res => {
-            if (res.status === 200) {
-              this.$message({ message: '导出成功', type: 'success' });
-              utils.downloadExportedData(res.data, '检验数据.xls');
-            }
-          });
+          api
+            .exportLisRecord({
+              hospitalId: this.hospitalId,
+              type: 1,
+              isMatch: this.filter.match
+            })
+            .then(res => {
+              if (res.status === 200) {
+                this.$message({ message: '导出成功', type: 'success' });
+                utils.downloadExportedData(res.data, '检验数据.xls');
+              }
+            });
         })
         .catch(() => {
           // this.$message({ message: '导出失败', type: 'waring' });
@@ -425,7 +464,7 @@ export default {
     },
     // 导入模板
     exportModule() {
-      api.exportLisModule({type:1}).then(res => {
+      api.exportLisModule({ type: 1 }).then(res => {
         if (res.status === 200) {
           setTimeout(() => {
             utils.downloadExportedData(res.data, '检验导入模板.xls');
@@ -442,6 +481,11 @@ export default {
     // 导入数据
     uploadFile(e) {
       let fileInfo = e.target.files[0];
+      let extend = fileInfo.name.substring(fileInfo.name.lastIndexOf('.') + 1);
+      if (extend != 'xls' && extend != 'xlsx') {
+        this.$message({ message: '请根据模板进行导入', type: 'error' });
+        return;
+      }
       e.preventDefault();
       let formData = new FormData();
       formData.append('file', fileInfo);
@@ -453,59 +497,145 @@ export default {
           'Content-Type': 'multipart/form-data'
         }
       };
-      this.uploadInfo = '导入中...';
-      api.importLisRecord(formData, header).then(res => {
-        if (res.data.code === '00000001') {
-          this.$alert(`数据存在异常,导入失败,请修改后再试`, '提示', {
-            confirmButtonText: '确定',
-            // cancelButtonText: '取消',
-            // cancelButtonClass: 'cancelSure',
-            // confirmButtonClass: 'sure',
-            // customClass: 'exportConfirm',
-            type: 'warning'
-          })
-            .then(() => {})
-            .catch(() => {});
-          this.getDataList(); // 重新获取列表
-          setTimeout(() => {
-            this.uploadInfo = '导入';
-          }, 300);
-        } else if (res.data.data === true && res.status === 200) {
-          this.$alert(`导入成功`, '提示', {
-            confirmButtonText: '确定',
-            // cancelButtonText: '取消',
-            // cancelButtonClass: 'cancelSure',
-            // confirmButtonClass: 'sure',
-            // customClass: 'exportConfirm',
-            type: 'success'
-          })
-            .then(() => {})
-            .catch(() => {});
-          this.getDataList(); // 重新获取列表
-          setTimeout(() => {
-            this.uploadInfo = '导入';
-          }, 300);
-        } else {
-          this.$alert(`${res.data.msg}`, '提示', {
-            confirmButtonText: '确定',
-            // cancelButtonText: '取消',
-            // cancelButtonClass: 'cancelSure',
-            // confirmButtonClass: 'sure',
-            // customClass: 'exportConfirm',
-            type: 'warning'
-          })
-            .then(() => {})
-            .catch(() => {});
 
-          setTimeout(() => {
-            this.uploadInfo = '导入';
-          }, 300);
-        }
-      });
+      // this.uploadInfo = '导入中...';
+      // api.importExcelDataVerify(formData, header).then(res => {
+      //   if (res.data.code === '00020001') {
+      //     this.$confirm(`${res.data.msg}`, '提示', {
+      //       confirmButtonText: '确定',
+      //       cancelButtonText: '取消',
+      //       type: 'warning'
+      //     })
+      //       .then(() => {
+      //         this.importLisRecord(formData, header);
+      //       })
+      //       .catch(() => {
+      //         setTimeout(() => {
+      //           this.uploadInfo = '导入';
+      //         }, 300);
+      //       });
+      //   } else if (res.data.data === true) {
+      //     this.importLisRecord(formData, header);
+      //   } else {
+      //     this.$alert(`${res.data.msg}`, '提示', {
+      //       confirmButtonText: '确定',
+      //       // cancelButtonText: '取消',
+      //       // cancelButtonClass: 'cancelSure',
+      //       // confirmButtonClass: 'sure',
+      //       // customClass: 'exportConfirm',
+      //       type: 'warning'
+      //     })
+      //       .then(() => {})
+      //       .catch(() => {});
+
+      //     setTimeout(() => {
+      //       this.uploadInfo = '导入';
+      //     }, 300);
+      //   }
+      // });
+      this.importLisRecord(formData, header);
       //解决上传相同文件不触发change
       let inp = document.getElementById('upFile');
       inp.value = '';
     },
+    importLisRecord(formData, header) {
+      let that = this;
+      api.importLisRecord(formData, header).then(res => {
+        if (res.headers['content-disposition']) {
+          this.downloadUrl(res);
+          this.getDataList();
+        } else {
+          let r = new FileReader();
+          r.onload = function() {
+            if (this.result) {
+              const code = JSON.parse(this.result);
+              if (code.code === '00020007') {
+                that
+                  .$alert(`${code.msg}`, '提示', {
+                    confirmButtonText: '确定',
+                    // cancelButtonText: '取消',
+                    // cancelButtonClass: 'cancelSure',
+                    // confirmButtonClass: 'sure',
+                    // customClass: 'exportConfirm',
+                    type: 'warning'
+                  })
+                  .then(() => {})
+                  .catch(() => {});
+              }
+            } else {
+              that.$alert(`导入成功`, '提示', {
+                confirmButtonText: '确定',
+                // cancelButtonText: '取消',
+                // cancelButtonClass: 'cancelSure',
+                // confirmButtonClass: 'sure',
+                // customClass: 'exportConfirm',
+                type: 'success'
+              });
+              that.getDataList();
+            }
+          };
+          r.readAsText(res.data);
+        }
+        // if ((res.data.code === '00020007')) {
+        //   this.$alert(`医院术语字符数超出最大数量,请修改后再试`, '提示', {
+        //     confirmButtonText: '确定',
+        //     // cancelButtonText: '取消',
+        //     // cancelButtonClass: 'cancelSure',
+        //     // confirmButtonClass: 'sure',
+        //     // customClass: 'exportConfirm',
+        //     type: 'warning'
+        //   })
+        //     .then(() => {})
+        //     .catch(() => {});
+        //   this.getDataList(); // 重新获取列表
+        //   setTimeout(() => {
+        //     this.uploadInfo = '导入';
+        //   }, 300);
+        // } else if (res.data.data === true && res.status === 200) {
+        //   this.$alert(`导入成功`, '提示', {
+        //     confirmButtonText: '确定',
+        //     // cancelButtonText: '取消',
+        //     // cancelButtonClass: 'cancelSure',
+        //     // confirmButtonClass: 'sure',
+        //     // customClass: 'exportConfirm',
+        //     type: 'success'
+        //   })
+        //     .then(() => {})
+        //     .catch(() => {});
+        //   this.getDataList(); // 重新获取列表
+        //   setTimeout(() => {
+        //     this.uploadInfo = '导入';
+        //   }, 300);
+        // } else {
+        //   this.$alert(`${res.data.msg}`, '提示', {
+        //     confirmButtonText: '确定',
+        //     // cancelButtonText: '取消',
+        //     // cancelButtonClass: 'cancelSure',
+        //     // confirmButtonClass: 'sure',
+        //     // customClass: 'exportConfirm',
+        //     type: 'warning'
+        //   })
+        //     .then(() => {})
+        //     .catch(() => {});
+
+        //   setTimeout(() => {
+        //     this.uploadInfo = '导入';
+        //   }, 300);
+        // }
+      });
+    },
+    downloadUrl(res) {
+      var disposition = res.headers['content-disposition'];
+      var fileName = decodeURI(
+        disposition.split('filename=')[1].split(';filename*=')[0]
+      );
+      let blob = new Blob([res.data], { type: 'application/.xls' }); //.xls是我和后台约定好的文件格式
+      let link = document.createElement('a');
+      link.href = window.URL.createObjectURL(blob);
+      link.download = fileName;
+      link.click();
+      link.remove();
+    },
     /********新增编辑弹窗**********/
     showModal() {
       this.modalVisiable = true;
@@ -573,7 +703,7 @@ export default {
 }
 .searchBar {
   min-width: 980px;
-  height: 60px;
+  height: 120px;
   display: flex;
   justify-content: center;
   align-items: center;
@@ -581,12 +711,13 @@ export default {
   z-index: 9999;
   padding: 40px 20px 0;
   .searchContent {
-    height: 40px;
+    height: 80px;
     flex: 1;
     background-color: #fff;
-    display: flex;
-    justify-content: flex-end;
-    float: right;
+    .demo-form-inline {
+      display: flex;
+      justify-content: flex-end;
+    }
   }
 }
 .contentsOther {

+ 190 - 67
src/components/cdssManage/nursing/nursing.vue

@@ -15,7 +15,17 @@
     <div class="searchBar">
       <div class="searchContent">
         <el-form :inline="true" class="demo-form-inline">
-          <el-form-item label class="selectMedicine">
+          <el-form-item class="selectMedicine" label="标准术语状态:">
+            <el-select size="mini" v-model="filter.status" placeholder="请选择" clearable>
+              <el-option
+                v-for="item in statusList"
+                :label="item.name"
+                :value="item.id"
+                :key="item.id"
+              ></el-option>
+            </el-select>
+          </el-form-item>
+          <el-form-item label="匹配状态:" class="selectMedicine">
             <el-select size="mini" v-model="filter.match" placeholder="请选择" clearable>
               <el-option
                 v-for="item in matchList"
@@ -44,7 +54,12 @@
         <el-table-column :resizable="false" prop="gmtModified" label="操作时间" width="180"></el-table-column>
         <el-table-column :resizable="false" prop="hisName" label="医院护理名称" show-overflow-tooltip></el-table-column>
         <el-table-column :resizable="false" prop="uniqueName" label="标准护理名称" show-overflow-tooltip></el-table-column>
-        <el-table-column :resizable="false" prop="operate" label="状态">
+        <el-table-column :resizable="false" prop="operate" label="标准术语状态">
+          <template slot-scope="scope">
+            <span v-if="scope.row.uniqueName && scope.row.uniqueName!=''">{{scope.row.status == 0?'禁用':'启用'}}</span>
+          </template>
+        </el-table-column>
+        <el-table-column :resizable="false" prop="operate" label="匹配状态">
           <template slot-scope="scope">
             <span>{{scope.row.isMatch == 0?'未匹配':'已匹配'}}</span>
           </template>
@@ -106,10 +121,16 @@ export default {
         { id: 0, name: '未匹配' },
         { id: 2, name: '多项匹配' }
       ],
+      statusList: [
+        { id: '', name: '全部' },
+        { id: 1, name: '启用' },
+        { id: 0, name: '禁用' },
+      ],
       filter: {
         hisName: '', // 医院诊断名称
         uniqueName: '', //标准诊断名称
-        match:''
+        match: '',
+        status:''
       },
       currentPage: 1,
       pageSize: config.pageSize,
@@ -129,8 +150,8 @@ export default {
   },
   created() {
     const { data } = this.$route.params;
-    this.hospitaiName = (data && data.name) || '';
-    this.hospitalId = data && data.hospitalId;
+    this.hospitaiName = (data && data.name) || localStorage.getItem('name');
+    this.hospitalId = (data && data.hospitalId) || localStorage.getItem('hospitalId');
     const that = this;
     //返回时避免参数未赋值就获取列表
     setTimeout(function() {
@@ -165,6 +186,11 @@ export default {
     // 导入数据
     uploadFileMatch(e) {
       let fileInfo = e.target.files[0];
+      let extend = fileInfo.name.substring(fileInfo.name.lastIndexOf('.') + 1);
+      if (extend != 'xls' && extend != 'xlsx') {
+        this.$message({ message: '请根据模板进行导入', type: 'error' });
+        return;
+      }
       e.preventDefault();
       let formData = new FormData();
       formData.append('file', fileInfo);
@@ -181,7 +207,7 @@ export default {
         background: 'rgba(0, 0, 0, 0.7)'
       });
       api.dataNurseVerify(formData, header).then(res => {
-        if ((res.data.code === '00020007' || res.data.code === '00020004')) {
+        if (res.data.code === '00020007' || res.data.code === '00020004') {
           loading.close();
           this.$alert(`${res.data.msg}`, '提示', {
             confirmButtonText: '确定',
@@ -253,9 +279,10 @@ export default {
         hisName: this.filter.hisName.trim(),
         uniqueName: this.filter.uniqueName.trim(),
         uniqueCode: '',
-        hospitalId: data && data.hospitalId,
+        hospitalId: (data && data.hospitalId) || localStorage.getItem('hospitalId'),
         type: 11,
-        isMatch:this.filter.match
+        isMatch: this.filter.match,
+        status: this.filter.status,
       };
       return param;
     },
@@ -280,8 +307,8 @@ export default {
       //     hospitaiName: this.hospitaiName
       //   })
       // });
-      this.data={}
-      this.showModal()
+      this.data = {};
+      this.showModal();
     },
     // 修改诊断关联-跳转至编辑页面
     modifyRelation(row) {
@@ -301,8 +328,8 @@ export default {
       //     hospitaiName: this.hospitaiName
       //   })
       // });
-      this.data = item
-      this.showModal()
+      this.data = item;
+      this.showModal();
     },
     currentChange(next) {
       this.currentPage = next;
@@ -405,12 +432,18 @@ export default {
         // }
       })
         .then(() => {
-          api.exportNurseRecord({ hospitalId: this.hospitalId,type:11,isMatch:this.filter.match }).then(res => {
-            if (res.status === 200) {
-              this.$message({ message: '导出成功', type: 'success' });
-              utils.downloadExportedData(res.data, '护理关联数据.xls');
-            }
-          });
+          api
+            .exportNurseRecord({
+              hospitalId: this.hospitalId,
+              type: 11,
+              isMatch: this.filter.match
+            })
+            .then(res => {
+              if (res.status === 200) {
+                this.$message({ message: '导出成功', type: 'success' });
+                utils.downloadExportedData(res.data, '护理关联数据.xls');
+              }
+            });
         })
         .catch(() => {
           // this.$message({ message: '导出失败', type: 'waring' });
@@ -418,7 +451,7 @@ export default {
     },
     // 导入模板
     exportModule() {
-      api.exportNurseModule({type:11}).then(res => {
+      api.exportNurseModule({ type: 11 }).then(res => {
         if (res.status === 200) {
           setTimeout(() => {
             utils.downloadExportedData(res.data, '护理导入模板.xls');
@@ -435,6 +468,11 @@ export default {
     // 导入数据
     uploadFile(e) {
       let fileInfo = e.target.files[0];
+      let extend = fileInfo.name.substring(fileInfo.name.lastIndexOf('.') + 1);
+      if (extend != 'xls' && extend != 'xlsx') {
+        this.$message({ message: '请根据模板进行导入', type: 'error' });
+        return;
+      }
       e.preventDefault();
       let formData = new FormData();
       formData.append('file', fileInfo);
@@ -446,58 +484,143 @@ export default {
           'Content-Type': 'multipart/form-data'
         }
       };
-      this.uploadInfo = '导入中...';
+      // this.uploadInfo = '导入中...';
+      this.importNurseRecord(formData, header)
+      //解决上传相同文件不触发change
+      let inp = document.getElementById('upFile');
+      inp.value = '';
+      // api.importExcelDataVerify(formData, header).then(res => {
+      //   if (res.data.code === '00020001') {
+      //     this.$confirm(`${res.data.msg}`, '提示', {
+      //       confirmButtonText: '确定',
+      //       cancelButtonText: '取消',
+      //       type: 'warning'
+      //     })
+      //       .then(() => {
+      //         this.importNurseRecord(formData, header);
+      //       })
+      //       .catch(() => {
+      //         setTimeout(() => {
+      //           this.uploadInfo = '导入';
+      //         }, 300);
+      //       });
+      //   } else if (res.data.data === true) {
+      //     this.importNurseRecord(formData, header);
+      //   }else {
+      //     this.$alert(`${res.data.msg}`, '提示', {
+      //       confirmButtonText: '确定',
+      //       // cancelButtonText: '取消',
+      //       // cancelButtonClass: 'cancelSure',
+      //       // confirmButtonClass: 'sure',
+      //       // customClass: 'exportConfirm',
+      //       type: 'warning'
+      //     })
+      //       .then(() => {})
+      //       .catch(() => {});
+
+      //     setTimeout(() => {
+      //       this.uploadInfo = '导入';
+      //     }, 300);
+      //   }
+      // });
+    },
+    importNurseRecord(formData, header) {
+      let that = this
       api.importNurseRecord(formData, header).then(res => {
-        if (res.data.code === '00000001') {
-          this.$alert(`数据存在异常,导入失败,请修改后再试`, '提示', {
-            confirmButtonText: '确定',
-            // cancelButtonText: '取消',
-            // cancelButtonClass: 'cancelSure',
-            // confirmButtonClass: 'sure',
-            // customClass: 'exportConfirm',
-            type: 'warning'
-          })
-            .then(() => {})
-            .catch(() => {});
-          this.getDataList(); // 重新获取列表
-          setTimeout(() => {
-            this.uploadInfo = '导入';
-          }, 300);
-        } else if ((res.data.data === true && res.status === 200)) {
-          this.$alert(`导入成功`, '提示', {
-            confirmButtonText: '确定',
-            // cancelButtonText: '取消',
-            // cancelButtonClass: 'cancelSure',
-            // confirmButtonClass: 'sure',
-            // customClass: 'exportConfirm',
-            type: 'success'
-          })
-            .then(() => {})
-            .catch(() => {});
-          this.getDataList(); // 重新获取列表
-          setTimeout(() => {
-            this.uploadInfo = '导入';
-          }, 300);
+        if (res.headers['content-disposition']) {
+          this.downloadUrl(res);
+          this.getDataList();
         } else {
-          this.$alert(`${res.data.msg}`, '提示', {
-            confirmButtonText: '确定',
-            // cancelButtonText: '取消',
-            // cancelButtonClass: 'cancelSure',
-            // confirmButtonClass: 'sure',
-            // customClass: 'exportConfirm',
-            type: 'warning'
-          })
-            .then(() => {})
-            .catch(() => {});
-
-          setTimeout(() => {
-            this.uploadInfo = '导入';
-          }, 300);
+          let r = new FileReader();
+          r.onload = function() {
+            if (this.result) {
+              const code = JSON.parse(this.result);
+              if (code.code === '00020007') {
+                that
+                  .$alert(`${code.msg}`, '提示', {
+                    confirmButtonText: '确定',
+                    // cancelButtonText: '取消',
+                    // cancelButtonClass: 'cancelSure',
+                    // confirmButtonClass: 'sure',
+                    // customClass: 'exportConfirm',
+                    type: 'warning'
+                  })
+                  .then(() => {})
+                  .catch(() => {});
+              }
+            } else {
+              that.$alert(`导入成功`, '提示', {
+                confirmButtonText: '确定',
+                // cancelButtonText: '取消',
+                // cancelButtonClass: 'cancelSure',
+                // confirmButtonClass: 'sure',
+                // customClass: 'exportConfirm',
+                type: 'success'
+              });
+              that.getDataList();
+            }
+          };
+          r.readAsText(res.data);
         }
+        // if ((res.data.code === '00020007')) {
+        //   this.$alert(`医院术语字符数超出最大数量,请修改后再试`, '提示', {
+        //     confirmButtonText: '确定',
+        //     // cancelButtonText: '取消',
+        //     // cancelButtonClass: 'cancelSure',
+        //     // confirmButtonClass: 'sure',
+        //     // customClass: 'exportConfirm',
+        //     type: 'warning'
+        //   })
+        //     .then(() => {})
+        //     .catch(() => {});
+        //   this.getDataList(); // 重新获取列表
+        //   setTimeout(() => {
+        //     this.uploadInfo = '导入';
+        //   }, 300);
+        // } else if (res.data.data === true && res.status === 200) {
+        //   this.$alert(`导入成功`, '提示', {
+        //     confirmButtonText: '确定',
+        //     // cancelButtonText: '取消',
+        //     // cancelButtonClass: 'cancelSure',
+        //     // confirmButtonClass: 'sure',
+        //     // customClass: 'exportConfirm',
+        //     type: 'success'
+        //   })
+        //     .then(() => {})
+        //     .catch(() => {});
+        //   this.getDataList(); // 重新获取列表
+        //   setTimeout(() => {
+        //     this.uploadInfo = '导入';
+        //   }, 300);
+        // } else {
+        //   this.$alert(`${res.data.msg}`, '提示', {
+        //     confirmButtonText: '确定',
+        //     // cancelButtonText: '取消',
+        //     // cancelButtonClass: 'cancelSure',
+        //     // confirmButtonClass: 'sure',
+        //     // customClass: 'exportConfirm',
+        //     type: 'warning'
+        //   })
+        //     .then(() => {})
+        //     .catch(() => {});
+
+        //   setTimeout(() => {
+        //     this.uploadInfo = '导入';
+        //   }, 300);
+        // }
       });
-      //解决上传相同文件不触发change
-      let inp = document.getElementById('upFile');
-      inp.value = '';
+    },
+    downloadUrl(res) {
+      var disposition = res.headers['content-disposition'];
+      var fileName = decodeURI(
+        disposition.split('filename=')[1].split(';filename*=')[0]
+      );
+      let blob = new Blob([res.data], { type: 'application/.xls' }); //.xls是我和后台约定好的文件格式
+      let link = document.createElement('a');
+      link.href = window.URL.createObjectURL(blob);
+      link.download = fileName;
+      link.click();
+      link.remove();
     },
     /********新增编辑弹窗**********/
     showModal() {

+ 173 - 60
src/components/cdssManage/operation/Operation.vue

@@ -15,7 +15,17 @@
     <div class="searchBar">
       <div class="searchContent">
         <el-form :inline="true" class="demo-form-inline">
-          <el-form-item label class="selectMedicine">
+          <el-form-item class="selectMedicine" label="标准术语状态:">
+            <el-select size="mini" v-model="filter.status" placeholder="请选择" clearable>
+              <el-option
+                v-for="item in statusList"
+                :label="item.name"
+                :value="item.id"
+                :key="item.id"
+              ></el-option>
+            </el-select>
+          </el-form-item>
+          <el-form-item label="匹配状态:" class="selectMedicine">
             <el-select size="mini" v-model="filter.match" placeholder="请选择" clearable>
               <el-option
                 v-for="item in matchList"
@@ -43,19 +53,19 @@
         <el-table-column :resizable="false" type="index" :index="indexMethod" label="编号" width="80"></el-table-column>
         <el-table-column :resizable="false" prop="gmtModified" label="操作时间" width="180"></el-table-column>
         <el-table-column :resizable="false" prop="hisName" label="医院手术/操作名称" show-overflow-tooltip></el-table-column>
-        <el-table-column
-          :resizable="false"
-          prop="code"
-          label="手术/操作代码"
-          show-overflow-tooltip
-        ></el-table-column>
+        <el-table-column :resizable="false" prop="code" label="手术/操作代码" show-overflow-tooltip></el-table-column>
         <el-table-column
           :resizable="false"
           prop="uniqueName"
           label="标准手术/操作名称"
           show-overflow-tooltip
         ></el-table-column>
-        <el-table-column :resizable="false" prop="operate" label="状态">
+        <el-table-column :resizable="false" prop="operate" label="标准术语状态">
+          <template slot-scope="scope">
+            <span v-if="scope.row.uniqueName && scope.row.uniqueName!=''">{{scope.row.status == 0?'禁用':'启用'}}</span>
+          </template>
+        </el-table-column>
+        <el-table-column :resizable="false" prop="operate" label="匹配状态">
           <template slot-scope="scope">
             <span>{{scope.row.isMatch == 0?'未匹配':'已匹配'}}</span>
           </template>
@@ -115,7 +125,8 @@ export default {
       filter: {
         hisName: '', // 医院诊断名称
         uniqueName: '', //标准诊断名称
-        match: ''
+        match: '',
+        status:''
       },
       matchList: [
         { id: '', name: '全部' },
@@ -123,6 +134,11 @@ export default {
         { id: 0, name: '未匹配' },
         { id: 2, name: '多项匹配' }
       ],
+      statusList: [
+        { id: '', name: '全部' },
+        { id: 1, name: '启用' },
+        { id: 0, name: '禁用' },
+      ],
       currentPage: 1,
       pageSize: config.pageSize,
       pageSizeArr: config.pageSizeArr,
@@ -141,8 +157,8 @@ export default {
   },
   created() {
     const { data } = this.$route.params;
-    this.hospitaiName = (data && data.name) || '';
-    this.hospitalId = data && data.hospitalId;
+    this.hospitaiName = (data && data.name) || localStorage.getItem('name');
+    this.hospitalId = (data && data.hospitalId) || localStorage.getItem('hospitalId');
     const that = this;
     //返回时避免参数未赋值就获取列表
     setTimeout(function() {
@@ -177,6 +193,11 @@ export default {
     // 导入数据
     uploadFileMatch(e) {
       let fileInfo = e.target.files[0];
+      let extend = fileInfo.name.substring(fileInfo.name.lastIndexOf('.') + 1);
+      if (extend != 'xls' && extend != 'xlsx') {
+        this.$message({ message: '请根据模板进行导入', type: 'error' });
+        return;
+      }
       e.preventDefault();
       let formData = new FormData();
       formData.append('file', fileInfo);
@@ -265,9 +286,10 @@ export default {
         hisName: this.filter.hisName.trim(),
         uniqueName: this.filter.uniqueName.trim(),
         uniqueCode: '',
-        hospitalId: data && data.hospitalId,
+        hospitalId: (data && data.hospitalId) || localStorage.getItem('hospitalId'),
         type: 6,
-        isMatch: this.filter.match
+        isMatch: this.filter.match,
+        status: this.filter.status,
       };
       return param;
     },
@@ -454,6 +476,11 @@ export default {
     // 导入数据
     uploadFile(e) {
       let fileInfo = e.target.files[0];
+      let extend = fileInfo.name.substring(fileInfo.name.lastIndexOf('.') + 1);
+      if (extend != 'xls' && extend != 'xlsx') {
+        this.$message({ message: '请根据模板进行导入', type: 'error' });
+        return;
+      }
       e.preventDefault();
       let formData = new FormData();
       formData.append('file', fileInfo);
@@ -466,58 +493,144 @@ export default {
         }
       };
       this.uploadInfo = '导入中...';
-      api.importOperationRecord(formData, header).then(res => {
-        if (res.data.code === '00000001') {
-          this.$alert(`数据存在异常,导入失败,请修改后再试`, '提示', {
-            confirmButtonText: '确定',
-            // cancelButtonText: '取消',
-            // cancelButtonClass: 'cancelSure',
-            // confirmButtonClass: 'sure',
-            // customClass: 'exportConfirm',
-            type: 'warning'
-          })
-            .then(() => {})
-            .catch(() => {});
-          this.getDataList(); // 重新获取列表
-          setTimeout(() => {
-            this.uploadInfo = '导入';
-          }, 300);
-        } else if (res.data.data === true && res.status === 200) {
-          this.$alert(`导入成功`, '提示', {
-            confirmButtonText: '确定',
-            // cancelButtonText: '取消',
-            // cancelButtonClass: 'cancelSure',
-            // confirmButtonClass: 'sure',
-            // customClass: 'exportConfirm',
-            type: 'success'
-          })
-            .then(() => {})
-            .catch(() => {});
-          this.getDataList(); // 重新获取列表
-          setTimeout(() => {
-            this.uploadInfo = '导入';
-          }, 300);
-        } else {
-          this.$alert(`${res.data.msg}`, '提示', {
-            confirmButtonText: '确定',
-            // // cancelButtonText: '取消',
-            // cancelButtonClass: 'cancelSure',
-            // confirmButtonClass: 'sure',
-            // customClass: 'exportConfirm',
-            type: 'warning'
-          })
-            .then(() => {})
-            .catch(() => {});
+      // api.importExcelDataVerify(formData, header).then(res => {
+      //   if (res.data.code === '00020001') {
+      //     this.$confirm(`${res.data.msg}`, '提示', {
+      //       confirmButtonText: '确定',
+      //       cancelButtonText: '取消',
+      //       type: 'warning'
+      //     })
+      //       .then(() => {
+      //         this.importOperationRecord(formData, header);
+      //       })
+      //       .catch(() => {
+      //         setTimeout(() => {
+      //           this.uploadInfo = '导入';
+      //         }, 300);
+      //       });
+      //   } else if (res.data.data === true) {
+      //     this.importOperationRecord(formData, header);
+      //   } else {
+      //     this.$alert(`${res.data.msg}`, '提示', {
+      //       confirmButtonText: '确定',
+      //       // cancelButtonText: '取消',
+      //       // cancelButtonClass: 'cancelSure',
+      //       // confirmButtonClass: 'sure',
+      //       // customClass: 'exportConfirm',
+      //       type: 'warning'
+      //     })
+      //       .then(() => {})
+      //       .catch(() => {});
 
-          setTimeout(() => {
-            this.uploadInfo = '导入';
-          }, 300);
-        }
-      });
+      //     setTimeout(() => {
+      //       this.uploadInfo = '导入';
+      //     }, 300);
+      //   }
+      // });
+      this.importOperationRecord(formData, header)
+      this.getDataList();
       //解决上传相同文件不触发change
       let inp = document.getElementById('upFile');
       inp.value = '';
     },
+    importOperationRecord(formData, header) {
+      let that = this
+      api.importOperationRecord(formData, header).then(res => {
+        if (res.headers['content-disposition']) {
+          this.downloadUrl(res);
+          this.getDataList();
+        } else {
+          let r = new FileReader();
+          r.onload = function() {
+            if (this.result) {
+              const code = JSON.parse(this.result);
+              if (code.code === '00020007') {
+                that
+                  .$alert(`${code.msg}`, '提示', {
+                    confirmButtonText: '确定',
+                    // cancelButtonText: '取消',
+                    // cancelButtonClass: 'cancelSure',
+                    // confirmButtonClass: 'sure',
+                    // customClass: 'exportConfirm',
+                    type: 'warning'
+                  })
+                  .then(() => {})
+                  .catch(() => {});
+              }
+            } else {
+              that.$alert(`导入成功`, '提示', {
+                confirmButtonText: '确定',
+                // cancelButtonText: '取消',
+                // cancelButtonClass: 'cancelSure',
+                // confirmButtonClass: 'sure',
+                // customClass: 'exportConfirm',
+                type: 'success'
+              });
+              that.getDataList();
+            }
+          };
+          r.readAsText(res.data);
+        }
+        // if ((res.data.code === '00020007')) {
+        //   this.$alert(`医院术语字符数超出最大数量,请修改后再试`, '提示', {
+        //     confirmButtonText: '确定',
+        //     // cancelButtonText: '取消',
+        //     // cancelButtonClass: 'cancelSure',
+        //     // confirmButtonClass: 'sure',
+        //     // customClass: 'exportConfirm',
+        //     type: 'warning'
+        //   })
+        //     .then(() => {})
+        //     .catch(() => {});
+        //   this.getDataList(); // 重新获取列表
+        //   setTimeout(() => {
+        //     this.uploadInfo = '导入';
+        //   }, 300);
+        // } else if (res.data.data === true && res.status === 200) {
+        //   this.$alert(`导入成功`, '提示', {
+        //     confirmButtonText: '确定',
+        //     // cancelButtonText: '取消',
+        //     // cancelButtonClass: 'cancelSure',
+        //     // confirmButtonClass: 'sure',
+        //     // customClass: 'exportConfirm',
+        //     type: 'success'
+        //   })
+        //     .then(() => {})
+        //     .catch(() => {});
+        //   this.getDataList(); // 重新获取列表
+        //   setTimeout(() => {
+        //     this.uploadInfo = '导入';
+        //   }, 300);
+        // } else {
+        //   this.$alert(`${res.data.msg}`, '提示', {
+        //     confirmButtonText: '确定',
+        //     // // cancelButtonText: '取消',
+        //     // cancelButtonClass: 'cancelSure',
+        //     // confirmButtonClass: 'sure',
+        //     // customClass: 'exportConfirm',
+        //     type: 'warning'
+        //   })
+        //     .then(() => {})
+        //     .catch(() => {});
+
+        //   setTimeout(() => {
+        //     this.uploadInfo = '导入';
+        //   }, 300);
+        // }
+      });
+    },
+    downloadUrl(res) {
+      var disposition = res.headers['content-disposition'];
+      var fileName = decodeURI(
+        disposition.split('filename=')[1].split(';filename*=')[0]
+      );
+      let blob = new Blob([res.data], { type: 'application/.xls' }); //.xls是我和后台约定好的文件格式
+      let link = document.createElement('a');
+      link.href = window.URL.createObjectURL(blob);
+      link.download = fileName;
+      link.click();
+      link.remove();
+    },
     /********新增编辑弹窗**********/
     showModal() {
       this.modalVisiable = true;

+ 186 - 64
src/components/cdssManage/pacs/Pacs.vue

@@ -15,7 +15,17 @@
     <div class="searchBar">
       <div class="searchContent">
         <el-form :inline="true" class="demo-form-inline">
-          <el-form-item label class="selectMedicine">
+          <el-form-item class="selectMedicine" label="标准术语状态:">
+            <el-select size="mini" v-model="filter.status" placeholder="请选择" clearable>
+              <el-option
+                v-for="item in statusList"
+                :label="item.name"
+                :value="item.id"
+                :key="item.id"
+              ></el-option>
+            </el-select>
+          </el-form-item>
+          <el-form-item label="匹配状态:" class="selectMedicine">
             <el-select size="mini" v-model="filter.match" placeholder="请选择" clearable>
               <el-option
                 v-for="item in matchList"
@@ -44,7 +54,12 @@
         <el-table-column :resizable="false" prop="gmtModified" label="操作时间" width="180"></el-table-column>
         <el-table-column :resizable="false" prop="hisName" label="医院检查项目" show-overflow-tooltip></el-table-column>
         <el-table-column :resizable="false" prop="uniqueName" label="标准检查项目" show-overflow-tooltip></el-table-column>
-        <el-table-column :resizable="false" prop="operate" label="状态">
+        <el-table-column :resizable="false" prop="operate" label="标准术语状态">
+          <template slot-scope="scope">
+            <span v-if="scope.row.uniqueName && scope.row.uniqueName!=''">{{scope.row.status == 0?'禁用':'启用'}}</span>
+          </template>
+        </el-table-column>
+        <el-table-column :resizable="false" prop="operate" label="匹配状态">
           <template slot-scope="scope">
             <span>{{scope.row.isMatch == 0?'未匹配':'已匹配'}}</span>
           </template>
@@ -103,7 +118,8 @@ export default {
       filter: {
         hisName: '', // 医院诊断名称
         uniqueName: '', //标准诊断名称
-        match: ''
+        match: '',
+        status:''
       },
       matchList: [
         { id: '', name: '全部' },
@@ -111,6 +127,11 @@ export default {
         { id: 0, name: '未匹配' },
         { id: 2, name: '多项匹配' }
       ],
+      statusList: [
+        { id: '', name: '全部' },
+        { id: 1, name: '启用' },
+        { id: 0, name: '禁用' },
+      ],
       currentPage: 1,
       pageSize: config.pageSize,
       pageSizeArr: config.pageSizeArr,
@@ -129,8 +150,8 @@ export default {
   },
   created() {
     const { data } = this.$route.params;
-    this.hospitaiName = (data && data.name) || '';
-    this.hospitalId = data && data.hospitalId;
+    this.hospitaiName = (data && data.name) || localStorage.getItem('name');
+    this.hospitalId = (data && data.hospitalId) || localStorage.getItem('hospitalId');
     const that = this;
     //返回时避免参数未赋值就获取列表
     setTimeout(function() {
@@ -165,6 +186,11 @@ export default {
     // 导入数据
     uploadFileMatch(e) {
       let fileInfo = e.target.files[0];
+      let extend = fileInfo.name.substring(fileInfo.name.lastIndexOf('.') + 1);
+      if (extend != 'xls' && extend != 'xlsx') {
+        this.$message({ message: '请根据模板进行导入', type: 'error' });
+        return;
+      }
       e.preventDefault();
       let formData = new FormData();
       formData.append('file', fileInfo);
@@ -181,7 +207,7 @@ export default {
         background: 'rgba(0, 0, 0, 0.7)'
       });
       api.dataPacsVerify(formData, header).then(res => {
-        if ((res.data.code === '00020007' || res.data.code === '00020004')) {
+        if (res.data.code === '00020007' || res.data.code === '00020004') {
           loading.close();
           this.$alert(`${res.data.msg}`, '提示', {
             confirmButtonText: '确定',
@@ -253,9 +279,10 @@ export default {
         hisName: this.filter.hisName.trim(),
         uniqueName: this.filter.uniqueName.trim(),
         uniqueCode: '',
-        hospitalId: data && data.hospitalId,
+        hospitalId: (data && data.hospitalId) || localStorage.getItem('hospitalId'),
         type: 3,
-        isMatch: this.filter.match
+        isMatch: this.filter.match,
+        status: this.filter.status,
       };
       return param;
     },
@@ -405,12 +432,18 @@ export default {
         // }
       })
         .then(() => {
-          api.exportPacsRecord({ hospitalId: this.hospitalId,type:3 ,isMatch:this.filter.match}).then(res => {
-            if (res.status === 200) {
-              this.$message({ message: '导出成功', type: 'success' });
-              utils.downloadExportedData(res.data, '检查关联数据.xls');
-            }
-          });
+          api
+            .exportPacsRecord({
+              hospitalId: this.hospitalId,
+              type: 3,
+              isMatch: this.filter.match
+            })
+            .then(res => {
+              if (res.status === 200) {
+                this.$message({ message: '导出成功', type: 'success' });
+                utils.downloadExportedData(res.data, '检查关联数据.xls');
+              }
+            });
         })
         .catch(() => {
           // this.$message({ message: '导出失败', type: 'waring' });
@@ -418,7 +451,7 @@ export default {
     },
     // 导入模板
     exportModule() {
-      api.exportPacsModule({type:3}).then(res => {
+      api.exportPacsModule({ type: 3 }).then(res => {
         if (res.status === 200) {
           setTimeout(() => {
             utils.downloadExportedData(res.data, '检查导入模板.xls');
@@ -435,6 +468,11 @@ export default {
     // 导入数据
     uploadFile(e) {
       let fileInfo = e.target.files[0];
+      let extend = fileInfo.name.substring(fileInfo.name.lastIndexOf('.') + 1);
+      if (extend != 'xls' && extend != 'xlsx') {
+        this.$message({ message: '请根据模板进行导入', type: 'error' });
+        return;
+      }
       e.preventDefault();
       let formData = new FormData();
       formData.append('file', fileInfo);
@@ -446,60 +484,144 @@ export default {
           'Content-Type': 'multipart/form-data'
         }
       };
-      this.uploadInfo = '导入中...';
-      api.importPacsRecord(formData, header).then(res => {
-        // code === '00000001'  导入失败统一提示 数据存在异常,导入失败,请修改后再试
-        if (res.data.code === '00000001') {
-          this.$alert(`数据存在异常,导入失败,请修改后再试`, '提示', {
-            confirmButtonText: '确定',
-            // // cancelButtonText: '取消',
-            // cancelButtonClass: 'cancelSure',
-            // confirmButtonClass: 'sure',
-            // customClass: 'exportConfirm',
-            type: 'warning'
-          })
-            .then(() => {})
-            .catch(() => {});
-          this.getDataList(); // 重新获取列表
-          setTimeout(() => {
-            this.uploadInfo = '导入';
-          }, 300);
-        } else if ((res.data.data === true && res.status === 200)) {
-          this.$alert(`导入成功`, '提示', {
-            confirmButtonText: '确定',
-            // // cancelButtonText: '取消',
-            // cancelButtonClass: 'cancelSure',
-            // confirmButtonClass: 'sure',
-            // customClass: 'exportConfirm',
-            type: 'success'
-          })
-            .then(() => {})
-            .catch(() => {});
-          this.getDataList(); // 重新获取列表
-          setTimeout(() => {
-            this.uploadInfo = '导入';
-          }, 300);
-        } else {
-          this.$alert(`${res.data.msg}`, '提示', {
-            confirmButtonText: '确定',
-            // cancelButtonText: '取消',
-            // cancelButtonClass: 'cancelSure',
-            // confirmButtonClass: 'sure',
-            // customClass: 'exportConfirm',
-            type: 'warning'
-          })
-            .then(() => {})
-            .catch(() => {});
+      // this.uploadInfo = '导入中...';
+      // api.importExcelDataVerify(formData, header).then(res => {
+      //   if (res.data.code === '00020001') {
+      //     this.$confirm(`${res.data.msg}`, '提示', {
+      //       confirmButtonText: '确定',
+      //       cancelButtonText: '取消',
+      //       type: 'warning'
+      //     })
+      //       .then(() => {
+      //         this.importPacsRecord(formData, header);
+      //       })
+      //       .catch(() => {
+      //         setTimeout(() => {
+      //           this.uploadInfo = '导入';
+      //         }, 300);
+      //       });
+      //   } else if (res.data.data === true) {
+      //     this.importPacsRecord(formData, header);
+      //   } else {
+      //     this.$alert(`${res.data.msg}`, '提示', {
+      //       confirmButtonText: '确定',
+      //       // cancelButtonText: '取消',
+      //       // cancelButtonClass: 'cancelSure',
+      //       // confirmButtonClass: 'sure',
+      //       // customClass: 'exportConfirm',
+      //       type: 'warning'
+      //     })
+      //       .then(() => {})
+      //       .catch(() => {});
 
-          setTimeout(() => {
-            this.uploadInfo = '导入';
-          }, 300);
-        }
-      });
+      //     setTimeout(() => {
+      //       this.uploadInfo = '导入';
+      //     }, 300);
+      //   }
+      // });
+      this.importPacsRecord(formData, header)
       //解决上传相同文件不触发change
       let inp = document.getElementById('upFile');
       inp.value = '';
     },
+    importPacsRecord(formData, header) {
+      let that = this
+      api.importPacsRecord(formData, header).then(res => {
+        if (res.headers['content-disposition']) {
+          this.downloadUrl(res);
+          this.getDataList();
+        } else {
+          let r = new FileReader();
+          r.onload = function() {
+            if (this.result) {
+              const code = JSON.parse(this.result);
+              if (code.code === '00020007') {
+                that
+                  .$alert(`${code.msg}`, '提示', {
+                    confirmButtonText: '确定',
+                    // cancelButtonText: '取消',
+                    // cancelButtonClass: 'cancelSure',
+                    // confirmButtonClass: 'sure',
+                    // customClass: 'exportConfirm',
+                    type: 'warning'
+                  })
+                  .then(() => {})
+                  .catch(() => {});
+              }
+            } else {
+              that.$alert(`导入成功`, '提示', {
+                confirmButtonText: '确定',
+                // cancelButtonText: '取消',
+                // cancelButtonClass: 'cancelSure',
+                // confirmButtonClass: 'sure',
+                // customClass: 'exportConfirm',
+                type: 'success'
+              });
+              that.getDataList();
+            }
+          };
+          r.readAsText(res.data);
+        }
+        // if ((res.data.code === '00020007')) {
+        //   this.$alert(`医院术语字符数超出最大数量,请修改后再试`, '提示', {
+        //     confirmButtonText: '确定',
+        //     // // cancelButtonText: '取消',
+        //     // cancelButtonClass: 'cancelSure',
+        //     // confirmButtonClass: 'sure',
+        //     // customClass: 'exportConfirm',
+        //     type: 'warning'
+        //   })
+        //     .then(() => {})
+        //     .catch(() => {});
+        //   this.getDataList(); // 重新获取列表
+        //   setTimeout(() => {
+        //     this.uploadInfo = '导入';
+        //   }, 300);
+        // } else if (res.data.data === true && res.status === 200) {
+        //   this.$alert(`导入成功`, '提示', {
+        //     confirmButtonText: '确定',
+        //     // // cancelButtonText: '取消',
+        //     // cancelButtonClass: 'cancelSure',
+        //     // confirmButtonClass: 'sure',
+        //     // customClass: 'exportConfirm',
+        //     type: 'success'
+        //   })
+        //     .then(() => {})
+        //     .catch(() => {});
+        //   this.getDataList(); // 重新获取列表
+        //   setTimeout(() => {
+        //     this.uploadInfo = '导入';
+        //   }, 300);
+        // } else {
+        //   this.$alert(`${res.data.msg}`, '提示', {
+        //     confirmButtonText: '确定',
+        //     // cancelButtonText: '取消',
+        //     // cancelButtonClass: 'cancelSure',
+        //     // confirmButtonClass: 'sure',
+        //     // customClass: 'exportConfirm',
+        //     type: 'warning'
+        //   })
+        //     .then(() => {})
+        //     .catch(() => {});
+
+        //   setTimeout(() => {
+        //     this.uploadInfo = '导入';
+        //   }, 300);
+        // }
+      });
+    },
+    downloadUrl(res) {
+      var disposition = res.headers['content-disposition'];
+      var fileName = decodeURI(
+        disposition.split('filename=')[1].split(';filename*=')[0]
+      );
+      let blob = new Blob([res.data], { type: 'application/.xls' }); //.xls是我和后台约定好的文件格式
+      let link = document.createElement('a');
+      link.href = window.URL.createObjectURL(blob);
+      link.download = fileName;
+      link.click();
+      link.remove();
+    },
     /********新增编辑弹窗**********/
     showModal() {
       this.modalVisiable = true;

+ 0 - 1
src/components/cdssManage/plan/AddPlan.vue

@@ -611,7 +611,6 @@ export default {
     mergeDefaultPlans(data) {
       if (!this.form.planDetailSub) {
         this.form.planDetailSub = data;
-        return;
       }
       data.forEach((item) => {
         const oneIndex = this.form.planDetailSub.findIndex(

+ 192 - 69
src/components/cdssManage/scale/ScaleManage.vue

@@ -15,7 +15,17 @@
     <div class="searchBar">
       <div class="searchContent">
         <el-form :inline="true" class="demo-form-inline">
-          <el-form-item label class="selectMedicine">
+          <el-form-item class="selectMedicine" label="标准术语状态:">
+            <el-select size="mini" v-model="filter.status" placeholder="请选择" clearable>
+              <el-option
+                v-for="item in statusList"
+                :label="item.name"
+                :value="item.id"
+                :key="item.id"
+              ></el-option>
+            </el-select>
+          </el-form-item>
+          <el-form-item label="匹配状态:" class="selectMedicine">
             <el-select size="mini" v-model="filter.match" placeholder="请选择" clearable>
               <el-option
                 v-for="item in matchList"
@@ -44,7 +54,12 @@
         <el-table-column :resizable="false" prop="gmtModified" label="操作时间" width="180"></el-table-column>
         <el-table-column :resizable="false" prop="hisName" label="医院量表名称" show-overflow-tooltip></el-table-column>
         <el-table-column :resizable="false" prop="uniqueName" label="标准量表名称" show-overflow-tooltip></el-table-column>
-        <el-table-column :resizable="false" prop="operate" label="状态">
+        <el-table-column :resizable="false" prop="operate" label="标准术语状态">
+          <template slot-scope="scope">
+            <span v-if="scope.row.uniqueName && scope.row.uniqueName!=''">{{scope.row.status == 0?'禁用':'启用'}}</span>
+          </template>
+        </el-table-column>
+        <el-table-column :resizable="false" prop="operate" label="匹配状态">
           <template slot-scope="scope">
             <span>{{scope.row.isMatch == 0?'未匹配':'已匹配'}}</span>
           </template>
@@ -103,7 +118,8 @@ export default {
       filter: {
         hisName: '', // 医院诊断名称
         uniqueName: '', //标准诊断名称
-        match:''
+        match: '',
+        status:''
       },
       matchList: [
         { id: '', name: '全部' },
@@ -111,6 +127,11 @@ export default {
         { id: 0, name: '未匹配' },
         { id: 2, name: '多项匹配' }
       ],
+      statusList: [
+        { id: '', name: '全部' },
+        { id: 1, name: '启用' },
+        { id: 0, name: '禁用' },
+      ],
       currentPage: 1,
       pageSize: config.pageSize,
       pageSizeArr: config.pageSizeArr,
@@ -124,13 +145,13 @@ export default {
       data: {}
     };
   },
-  components:{
+  components: {
     LtModal
   },
   created() {
     const { data } = this.$route.params;
-    this.hospitaiName = (data && data.name) || '';
-    this.hospitalId = data && data.hospitalId;
+    this.hospitaiName = (data && data.name) || localStorage.getItem('name');
+    this.hospitalId = (data && data.hospitalId) || localStorage.getItem('hospitalId');
     const that = this;
     //返回时避免参数未赋值就获取列表
     setTimeout(function() {
@@ -165,6 +186,11 @@ export default {
     // 导入数据
     uploadFileMatch(e) {
       let fileInfo = e.target.files[0];
+      let extend = fileInfo.name.substring(fileInfo.name.lastIndexOf('.') + 1);
+      if (extend != 'xls' && extend != 'xlsx') {
+        this.$message({ message: '请根据模板进行导入', type: 'error' });
+        return;
+      }
       e.preventDefault();
       let formData = new FormData();
       formData.append('file', fileInfo);
@@ -181,7 +207,7 @@ export default {
         background: 'rgba(0, 0, 0, 0.7)'
       });
       api.dataScaleVerify(formData, header).then(res => {
-        if ((res.data.code === '00020007' || res.data.code === '00020004')) {
+        if (res.data.code === '00020007' || res.data.code === '00020004') {
           loading.close();
           this.$alert(`${res.data.msg}`, '提示', {
             confirmButtonText: '确定',
@@ -254,9 +280,10 @@ export default {
         hisName: this.filter.hisName.trim(),
         uniqueName: this.filter.uniqueName.trim(),
         uniqueCode: '',
-        hospitalId: data && data.hospitalId,
+        hospitalId: (data && data.hospitalId) || localStorage.getItem('hospitalId'),
         type: 10,
-        isMatch:this.filter.match
+        isMatch: this.filter.match,
+        status: this.filter.status,
       };
       return param;
     },
@@ -281,8 +308,8 @@ export default {
       //     hospitaiName: this.hospitaiName
       //   })
       // });
-      this.data={}
-      this.showModal()
+      this.data = {};
+      this.showModal();
     },
     // 修改诊断关联-跳转至编辑页面
     modifyRelation(row) {
@@ -302,8 +329,8 @@ export default {
       //     hospitaiName: this.hospitaiName
       //   })
       // });
-      this.data = item
-      this.showModal()
+      this.data = item;
+      this.showModal();
     },
     currentChange(next) {
       this.currentPage = next;
@@ -387,12 +414,18 @@ export default {
         type: 'warning'
       })
         .then(() => {
-          api.exportScaleRecord({ hospitalId: this.hospitalId,type:10,isMatch:this.filter.match }).then(res => {
-            if (res.status === 200) {
-              this.$message({ message: '导出成功', type: 'success' });
-              utils.downloadExportedData(res.data, '量表关联数据.xls');
-            }
-          });
+          api
+            .exportScaleRecord({
+              hospitalId: this.hospitalId,
+              type: 10,
+              isMatch: this.filter.match
+            })
+            .then(res => {
+              if (res.status === 200) {
+                this.$message({ message: '导出成功', type: 'success' });
+                utils.downloadExportedData(res.data, '量表关联数据.xls');
+              }
+            });
         })
         .catch(() => {
           // this.$message({ message: '导出失败', type: 'waring' });
@@ -401,7 +434,7 @@ export default {
 
     // 导入模板
     exportModule() {
-      api.exportScaleModule({type:10}).then(res => {
+      api.exportScaleModule({ type: 10 }).then(res => {
         if (res.status === 200) {
           setTimeout(() => {
             utils.downloadExportedData(res.data, '量表导入模板.xls');
@@ -418,6 +451,11 @@ export default {
     // 导入数据
     uploadFile(e) {
       let fileInfo = e.target.files[0];
+      let extend = fileInfo.name.substring(fileInfo.name.lastIndexOf('.') + 1);
+      if (extend != 'xls' && extend != 'xlsx') {
+        this.$message({ message: '请根据模板进行导入', type: 'error' });
+        return;
+      }
       e.preventDefault();
       let formData = new FormData();
       formData.append('file', fileInfo);
@@ -429,60 +467,145 @@ export default {
           'Content-Type': 'multipart/form-data'
         }
       };
-      this.uploadInfo = '导入中...';
-      api.importScaleRecord(formData, header).then(res => {
-        // console.log(res, '======================res导入结果');
-        if (res.data.code === '00000001') {
-          this.$alert(`数据存在异常,导入失败,请修改后再试`, '提示', {
-            confirmButtonText: '确定',
-            // cancelButtonText: '取消',
-            // cancelButtonClass: 'cancelSure',
-            // confirmButtonClass: 'sure',
-            // customClass: 'exportConfirm',
-            type: 'warning'
-          })
-            .then(() => {})
-            .catch(() => {});
-          this.getDataList(); // 重新获取列表
-          setTimeout(() => {
-            this.uploadInfo = '导入';
-          }, 300);
-        } else if ((res.data.data === true && res.status === 200)) {
-          this.$alert(`导入成功`, '提示', {
-            confirmButtonText: '确定',
-            // cancelButtonText: '取消',
-            // cancelButtonClass: 'cancelSure',
-            // confirmButtonClass: 'sure',
-            // customClass: 'exportConfirm',
-            type: 'success'
-          })
-            .then(() => {})
-            .catch(() => {});
-          this.getDataList(); // 重新获取列表
-          setTimeout(() => {
-            this.uploadInfo = '导入';
-          }, 300);
-        } else {
-          this.$alert(`${res.data.msg}`, '提示', {
-            confirmButtonText: '确定',
-            // // cancelButtonText: '取消',
-            // cancelButtonClass: 'cancelSure',
-            // confirmButtonClass: 'sure',
-            // customClass: 'exportConfirm',
-            type: 'warning'
-          })
-            .then(() => {})
-            .catch(() => {});
+      this.importScaleRecord(formData, header)
+      // this.uploadInfo = '导入中...';
+      // api.importExcelDataVerify(formData, header).then(res => {
+      //   if (res.data.code === '00020001') {
+      //     this.$confirm(`${res.data.msg}`, '提示', {
+      //       confirmButtonText: '确定',
+      //       cancelButtonText: '取消',
+      //       type: 'warning'
+      //     })
+      //       .then(() => {
+      //         this.importScaleRecord(formData, header)
+      //       })
+      //       .catch(() => {
+      //         setTimeout(() => {
+      //           this.uploadInfo = '导入';
+      //         }, 300);
+      //       });
+      //   } else if (res.data.data === true) {
+      //     this.importScaleRecord(formData, header)
+      //   }else {
+      //     this.$alert(`${res.data.msg}`, '提示', {
+      //       confirmButtonText: '确定',
+      //       // cancelButtonText: '取消',
+      //       // cancelButtonClass: 'cancelSure',
+      //       // confirmButtonClass: 'sure',
+      //       // customClass: 'exportConfirm',
+      //       type: 'warning'
+      //     })
+      //       .then(() => {})
+      //       .catch(() => {});
+
+      //     setTimeout(() => {
+      //       this.uploadInfo = '导入';
+      //     }, 300);
+      //   }
+      // });
 
-          setTimeout(() => {
-            this.uploadInfo = '导入';
-          }, 300);
-        }
-      });
       //解决上传相同文件不触发change
       let inp = document.getElementById('upFile');
       inp.value = '';
     },
+    importScaleRecord(formData, header) {
+      let that = this
+      api.importScaleRecord(formData, header).then(res => {
+        if (res.headers['content-disposition']) {
+          this.downloadUrl(res);
+          this.getDataList();
+        } else {
+          let r = new FileReader();
+          r.onload = function() {
+            if (this.result) {
+              const code = JSON.parse(this.result);
+              if (code.code === '00020007') {
+                that
+                  .$alert(`${code.msg}`, '提示', {
+                    confirmButtonText: '确定',
+                    // cancelButtonText: '取消',
+                    // cancelButtonClass: 'cancelSure',
+                    // confirmButtonClass: 'sure',
+                    // customClass: 'exportConfirm',
+                    type: 'warning'
+                  })
+                  .then(() => {})
+                  .catch(() => {});
+              }
+            } else {
+              that.$alert(`导入成功`, '提示', {
+                confirmButtonText: '确定',
+                // cancelButtonText: '取消',
+                // cancelButtonClass: 'cancelSure',
+                // confirmButtonClass: 'sure',
+                // customClass: 'exportConfirm',
+                type: 'success'
+              });
+              that.getDataList();
+            }
+          };
+          r.readAsText(res.data);
+        }
+        // if ((res.data.code === '00020007')) {
+        //   this.$alert(`医院术语字符数超出最大数量,请修改后再试`, '提示', {
+        //     confirmButtonText: '确定',
+        //     // cancelButtonText: '取消',
+        //     // cancelButtonClass: 'cancelSure',
+        //     // confirmButtonClass: 'sure',
+        //     // customClass: 'exportConfirm',
+        //     type: 'warning'
+        //   })
+        //     .then(() => {})
+        //     .catch(() => {});
+        //   this.getDataList(); // 重新获取列表
+        //   setTimeout(() => {
+        //     this.uploadInfo = '导入';
+        //   }, 300);
+        // } else if (res.data.data === true && res.status === 200) {
+        //   this.$alert(`导入成功`, '提示', {
+        //     confirmButtonText: '确定',
+        //     // cancelButtonText: '取消',
+        //     // cancelButtonClass: 'cancelSure',
+        //     // confirmButtonClass: 'sure',
+        //     // customClass: 'exportConfirm',
+        //     type: 'success'
+        //   })
+        //     .then(() => {})
+        //     .catch(() => {});
+        //   this.getDataList(); // 重新获取列表
+        //   setTimeout(() => {
+        //     this.uploadInfo = '导入';
+        //   }, 300);
+        // } else {
+        //   this.$alert(`${res.data.msg}`, '提示', {
+        //     confirmButtonText: '确定',
+        //     // // cancelButtonText: '取消',
+        //     // cancelButtonClass: 'cancelSure',
+        //     // confirmButtonClass: 'sure',
+        //     // customClass: 'exportConfirm',
+        //     type: 'warning'
+        //   })
+        //     .then(() => {})
+        //     .catch(() => {});
+
+        //   setTimeout(() => {
+        //     this.uploadInfo = '导入';
+        //   }, 300);
+        // }
+      });
+    },
+    downloadUrl(res) {
+      var disposition = res.headers['content-disposition'];
+      var fileName = decodeURI(
+        disposition.split('filename=')[1].split(';filename*=')[0]
+      );
+      let blob = new Blob([res.data], { type: 'application/.xls' }); //.xls是我和后台约定好的文件格式
+      let link = document.createElement('a');
+      link.href = window.URL.createObjectURL(blob);
+      link.download = fileName;
+      link.click();
+      link.remove();
+    },
     /********新增编辑弹窗**********/
     showModal() {
       this.modalVisiable = true;

+ 197 - 68
src/components/cdssManage/tcmdisease/tcmdisease.vue

@@ -15,7 +15,17 @@
     <div class="searchBar">
       <div class="searchContent">
         <el-form :inline="true" class="demo-form-inline">
-          <el-form-item label class="selectMedicine">
+          <el-form-item class="selectMedicine" label="标准术语状态:">
+            <el-select size="mini" v-model="filter.status" placeholder="请选择" clearable>
+              <el-option
+                v-for="item in statusList"
+                :label="item.name"
+                :value="item.id"
+                :key="item.id"
+              ></el-option>
+            </el-select>
+          </el-form-item>
+          <el-form-item label="匹配状态:" class="selectMedicine">
             <el-select size="mini" v-model="filter.match" placeholder="请选择" clearable>
               <el-option
                 v-for="item in matchList"
@@ -44,8 +54,18 @@
         <el-table-column :resizable="false" prop="gmtModified" label="操作时间" width="180"></el-table-column>
         <el-table-column :resizable="false" prop="hisName" label="医院中医疾病名称" show-overflow-tooltip></el-table-column>
         <el-table-column :resizable="false" prop="code" label="中医疾病代码" show-overflow-tooltip></el-table-column>
-        <el-table-column :resizable="false" prop="uniqueName" label="标准中医疾病名称" show-overflow-tooltip></el-table-column>
-        <el-table-column :resizable="false" prop="operate" label="状态">
+        <el-table-column
+          :resizable="false"
+          prop="uniqueName"
+          label="标准中医疾病名称"
+          show-overflow-tooltip
+        ></el-table-column>
+        <el-table-column :resizable="false" prop="operate" label="标准术语状态">
+          <template slot-scope="scope">
+            <span v-if="scope.row.uniqueName && scope.row.uniqueName!=''">{{scope.row.status == 0?'禁用':'启用'}}</span>
+          </template>
+        </el-table-column>
+        <el-table-column :resizable="false" prop="operate" label="匹配状态">
           <template slot-scope="scope">
             <span>{{scope.row.isMatch == 0?'未匹配':'已匹配'}}</span>
           </template>
@@ -105,7 +125,8 @@ export default {
       filter: {
         hisName: '', // 医院诊断名称
         uniqueName: '', //标准诊断名称
-        match:''
+        match: '',
+        status:''
       },
       matchList: [
         { id: '', name: '全部' },
@@ -113,6 +134,11 @@ export default {
         { id: 0, name: '未匹配' },
         { id: 2, name: '多项匹配' }
       ],
+      statusList: [
+        { id: '', name: '全部' },
+        { id: 1, name: '启用' },
+        { id: 0, name: '禁用' },
+      ],
       currentPage: 1,
       pageSize: config.pageSize,
       pageSizeArr: config.pageSizeArr,
@@ -131,8 +157,8 @@ export default {
   },
   created() {
     const { data } = this.$route.params;
-    this.hospitaiName = (data && data.name) || '';
-    this.hospitalId = data && data.hospitalId;
+    this.hospitaiName = (data && data.name) || localStorage.getItem('name');
+    this.hospitalId = (data && data.hospitalId) || localStorage.getItem('hospitalId');
     const that = this;
     //返回时避免参数未赋值就获取列表
     setTimeout(function() {
@@ -167,6 +193,11 @@ export default {
     // 导入数据
     uploadFileMatch(e) {
       let fileInfo = e.target.files[0];
+      let extend = fileInfo.name.substring(fileInfo.name.lastIndexOf('.') + 1);
+      if (extend != 'xls' && extend != 'xlsx') {
+        this.$message({ message: '请根据模板进行导入', type: 'error' });
+        return;
+      }
       e.preventDefault();
       let formData = new FormData();
       formData.append('file', fileInfo);
@@ -183,7 +214,7 @@ export default {
         background: 'rgba(0, 0, 0, 0.7)'
       });
       api.dataTcmVerify(formData, header).then(res => {
-        if ((res.data.code === '00020007' || res.data.code === '00020004')) {
+        if (res.data.code === '00020007' || res.data.code === '00020004') {
           loading.close();
           this.$alert(`${res.data.msg}`, '提示', {
             confirmButtonText: '确定',
@@ -255,9 +286,10 @@ export default {
         hisName: this.filter.hisName.trim(),
         uniqueName: this.filter.uniqueName.trim(),
         uniqueCode: '',
-        hospitalId: data && data.hospitalId,
+        hospitalId: (data && data.hospitalId) || localStorage.getItem('hospitalId'),
         type: 12,
-        isMatch:this.filter.match
+        isMatch: this.filter.match,
+        status: this.filter.status,
       };
       return param;
     },
@@ -274,8 +306,8 @@ export default {
             filter: this.filter
           }
         : { currentPage: this.currentPage, pageSize: this.pageSize };
-        this.data={}
-        this.showModal()
+      this.data = {};
+      this.showModal();
       // this.$router.push({
       //   name: 'AddTcmdisease',
       //   params: Object.assign(pam, {
@@ -303,8 +335,8 @@ export default {
       //     hospitaiName: this.hospitaiName
       //   })
       // });
-      this.data = item
-      this.showModal()
+      this.data = item;
+      this.showModal();
     },
     currentChange(next) {
       this.currentPage = next;
@@ -407,12 +439,18 @@ export default {
         // }
       })
         .then(() => {
-          api.exportTcmRecord({ hospitalId: this.hospitalId,type:12 ,isMatch:this.filter.match}).then(res => {
-            if (res.status === 200) {
-              this.$message({ message: '导出成功', type: 'success' });
-              utils.downloadExportedData(res.data, '中医疾病关联数据.xls');
-            }
-          });
+          api
+            .exportTcmRecord({
+              hospitalId: this.hospitalId,
+              type: 12,
+              isMatch: this.filter.match
+            })
+            .then(res => {
+              if (res.status === 200) {
+                this.$message({ message: '导出成功', type: 'success' });
+                utils.downloadExportedData(res.data, '中医疾病关联数据.xls');
+              }
+            });
         })
         .catch(() => {
           // this.$message({ message: '导出失败', type: 'waring' });
@@ -420,7 +458,7 @@ export default {
     },
     // 导入模板
     exportModule() {
-      api.exportTcmModule({type:12}).then(res => {
+      api.exportTcmModule({ type: 12 }).then(res => {
         if (res.status === 200) {
           setTimeout(() => {
             utils.downloadExportedData(res.data, '中医疾病导入模板.xls');
@@ -437,6 +475,11 @@ export default {
     // 导入数据
     uploadFile(e) {
       let fileInfo = e.target.files[0];
+      let extend = fileInfo.name.substring(fileInfo.name.lastIndexOf('.') + 1);
+      if (extend != 'xls' && extend != 'xlsx') {
+        this.$message({ message: '请根据模板进行导入', type: 'error' });
+        return;
+      }
       e.preventDefault();
       let formData = new FormData();
       formData.append('file', fileInfo);
@@ -448,59 +491,145 @@ export default {
           'Content-Type': 'multipart/form-data'
         }
       };
-      this.uploadInfo = '导入中...';
-      api.importTcmRecord(formData, header).then(res => {
-        if (res.data.code === '00000001') {
-          this.$alert(`数据存在异常,导入失败,请修改后再试`, '提示', {
-            confirmButtonText: '确定',
-            // cancelButtonText: '取消',
-            // cancelButtonClass: 'cancelSure',
-            // confirmButtonClass: 'sure',
-            // customClass: 'exportConfirm',
-            type: 'warning'
-          })
-            .then(() => {})
-            .catch(() => {});
-          this.getDataList(); // 重新获取列表
-          setTimeout(() => {
-            this.uploadInfo = '导入';
-          }, 300);
-        } else if ((res.data.data === true && res.status === 200)) {
-          this.$alert(`导入成功`, '提示', {
-            confirmButtonText: '确定',
-            // cancelButtonText: '取消',
-            // cancelButtonClass: 'cancelSure',
-            // confirmButtonClass: 'sure',
-            // customClass: 'exportConfirm',
-            type: 'success'
-          })
-            .then(() => {})
-            .catch(() => {});
-          this.getDataList(); // 重新获取列表
-          setTimeout(() => {
-            this.uploadInfo = '导入';
-          }, 300);
-        } else {
-          this.$alert(`${res.data.msg}`, '提示', {
-            confirmButtonText: '确定',
-            // cancelButtonText: '取消',
-            // cancelButtonClass: 'cancelSure',
-            // confirmButtonClass: 'sure',
-            // customClass: 'exportConfirm',
-            type: 'warning'
-          })
-            .then(() => {})
-            .catch(() => {});
+      this.importTcmRecord(formData, header);
+      // this.uploadInfo = '导入中...';
+      // api.importExcelDataVerify(formData, header).then(res => {
+      //   if (res.data.code === '00020001') {
+      //     this.$confirm(`${res.data.msg}`, '提示', {
+      //       confirmButtonText: '确定',
+      //       cancelButtonText: '取消',
+      //       type: 'warning'
+      //     })
+      //       .then(() => {
+      //         this.importTcmRecord(formData, header);
+      //       })
+      //       .catch(() => {
+      //         setTimeout(() => {
+      //           this.uploadInfo = '导入';
+      //         }, 300);
+      //       });
+      //   } else if (res.data.data === true) {
+      //     this.importTcmRecord(formData, header);
+      //   }else {
+      //     this.$alert(`${res.data.msg}`, '提示', {
+      //       confirmButtonText: '确定',
+      //       // cancelButtonText: '取消',
+      //       // cancelButtonClass: 'cancelSure',
+      //       // confirmButtonClass: 'sure',
+      //       // customClass: 'exportConfirm',
+      //       type: 'warning'
+      //     })
+      //       .then(() => {})
+      //       .catch(() => {});
+
+      //     setTimeout(() => {
+      //       this.uploadInfo = '导入';
+      //     }, 300);
+      //   }
+      // });
 
-          setTimeout(() => {
-            this.uploadInfo = '导入';
-          }, 300);
-        }
-      });
       //解决上传相同文件不触发change
       let inp = document.getElementById('upFile');
       inp.value = '';
     },
+    importTcmRecord(formData, header) {
+      let that = this
+      api.importTcmRecord(formData, header).then(res => {
+        if (res.headers['content-disposition']) {
+          this.downloadUrl(res);
+          this.getDataList();
+        } else {
+          let r = new FileReader();
+          r.onload = function() {
+            if (this.result) {
+              const code = JSON.parse(this.result);
+              if (code.code === '00020007') {
+                that
+                  .$alert(`${code.msg}`, '提示', {
+                    confirmButtonText: '确定',
+                    // cancelButtonText: '取消',
+                    // cancelButtonClass: 'cancelSure',
+                    // confirmButtonClass: 'sure',
+                    // customClass: 'exportConfirm',
+                    type: 'warning'
+                  })
+                  .then(() => {})
+                  .catch(() => {});
+              }
+            } else {
+              that.$alert(`导入成功`, '提示', {
+                confirmButtonText: '确定',
+                // cancelButtonText: '取消',
+                // cancelButtonClass: 'cancelSure',
+                // confirmButtonClass: 'sure',
+                // customClass: 'exportConfirm',
+                type: 'success'
+              });
+              that.getDataList();
+            }
+          };
+          r.readAsText(res.data);
+        }
+        // if ((res.data.code === '00020007')) {
+        //   this.$alert(`医院术语字符数超出最大数量,请修改后再试`, '提示', {
+        //     confirmButtonText: '确定',
+        //     // cancelButtonText: '取消',
+        //     // cancelButtonClass: 'cancelSure',
+        //     // confirmButtonClass: 'sure',
+        //     // customClass: 'exportConfirm',
+        //     type: 'warning'
+        //   })
+        //     .then(() => {})
+        //     .catch(() => {});
+        //   this.getDataList(); // 重新获取列表
+        //   setTimeout(() => {
+        //     this.uploadInfo = '导入';
+        //   }, 300);
+        // } else if (res.data.data === true && res.status === 200) {
+        //   this.$alert(`导入成功`, '提示', {
+        //     confirmButtonText: '确定',
+        //     // cancelButtonText: '取消',
+        //     // cancelButtonClass: 'cancelSure',
+        //     // confirmButtonClass: 'sure',
+        //     // customClass: 'exportConfirm',
+        //     type: 'success'
+        //   })
+        //     .then(() => {})
+        //     .catch(() => {});
+        //   this.getDataList(); // 重新获取列表
+        //   setTimeout(() => {
+        //     this.uploadInfo = '导入';
+        //   }, 300);
+        // } else {
+        //   this.$alert(`${res.data.msg}`, '提示', {
+        //     confirmButtonText: '确定',
+        //     // cancelButtonText: '取消',
+        //     // cancelButtonClass: 'cancelSure',
+        //     // confirmButtonClass: 'sure',
+        //     // customClass: 'exportConfirm',
+        //     type: 'warning'
+        //   })
+        //     .then(() => {})
+        //     .catch(() => {});
+
+        //   setTimeout(() => {
+        //     this.uploadInfo = '导入';
+        //   }, 300);
+        // }
+      });
+    },
+    downloadUrl(res) {
+      var disposition = res.headers['content-disposition'];
+      var fileName = decodeURI(
+        disposition.split('filename=')[1].split(';filename*=')[0]
+      );
+      let blob = new Blob([res.data], { type: 'application/.xls' }); //.xls是我和后台约定好的文件格式
+      let link = document.createElement('a');
+      link.href = window.URL.createObjectURL(blob);
+      link.download = fileName;
+      link.click();
+      link.remove();
+    },
     /********新增编辑弹窗**********/
     showModal() {
       this.modalVisiable = true;

+ 198 - 69
src/components/cdssManage/tcmdrome/tcmdrome.vue

@@ -15,7 +15,17 @@
     <div class="searchBar">
       <div class="searchContent">
         <el-form :inline="true" class="demo-form-inline">
-          <el-form-item label class="selectMedicine">
+          <el-form-item class="selectMedicine" label="标准术语状态:">
+            <el-select size="mini" v-model="filter.status" placeholder="请选择" clearable>
+              <el-option
+                v-for="item in statusList"
+                :label="item.name"
+                :value="item.id"
+                :key="item.id"
+              ></el-option>
+            </el-select>
+          </el-form-item>
+          <el-form-item label="匹配状态:" class="selectMedicine">
             <el-select size="mini" v-model="filter.match" placeholder="请选择" clearable>
               <el-option
                 v-for="item in matchList"
@@ -44,8 +54,18 @@
         <el-table-column :resizable="false" prop="gmtModified" label="操作时间" width="180"></el-table-column>
         <el-table-column :resizable="false" prop="hisName" label="医院中医证候名称" show-overflow-tooltip></el-table-column>
         <el-table-column :resizable="false" prop="code" label="中医证候代码" show-overflow-tooltip></el-table-column>
-        <el-table-column :resizable="false" prop="uniqueName" label="标准中医证候名称" show-overflow-tooltip></el-table-column>
-        <el-table-column :resizable="false" prop="operate" label="状态">
+        <el-table-column
+          :resizable="false"
+          prop="uniqueName"
+          label="标准中医证候名称"
+          show-overflow-tooltip
+        ></el-table-column>
+        <el-table-column :resizable="false" prop="operate" label="标准术语状态">
+          <template slot-scope="scope">
+            <span v-if="scope.row.uniqueName && scope.row.uniqueName!=''">{{scope.row.status == 0?'禁用':'启用'}}</span>
+          </template>
+        </el-table-column>
+        <el-table-column :resizable="false" prop="operate" label="匹配状态">
           <template slot-scope="scope">
             <span>{{scope.row.isMatch == 0?'未匹配':'已匹配'}}</span>
           </template>
@@ -104,7 +124,8 @@ export default {
       filter: {
         hisName: '', // 医院诊断名称
         uniqueName: '', //标准诊断名称
-        match:''
+        match: '',
+        status:''
       },
       matchList: [
         { id: '', name: '全部' },
@@ -112,6 +133,11 @@ export default {
         { id: 0, name: '未匹配' },
         { id: 2, name: '多项匹配' }
       ],
+      statusList: [
+        { id: '', name: '全部' },
+        { id: 1, name: '启用' },
+        { id: 0, name: '禁用' },
+      ],
       currentPage: 1,
       pageSize: config.pageSize,
       pageSizeArr: config.pageSizeArr,
@@ -130,8 +156,8 @@ export default {
   },
   created() {
     const { data } = this.$route.params;
-    this.hospitaiName = (data && data.name) || '';
-    this.hospitalId = data && data.hospitalId;
+    this.hospitaiName = (data && data.name) || localStorage.getItem('name');
+    this.hospitalId = (data && data.hospitalId) || localStorage.getItem('hospitalId');
     const that = this;
     //返回时避免参数未赋值就获取列表
     setTimeout(function() {
@@ -166,6 +192,11 @@ export default {
     // 导入数据
     uploadFileMatch(e) {
       let fileInfo = e.target.files[0];
+      let extend = fileInfo.name.substring(fileInfo.name.lastIndexOf('.') + 1);
+      if (extend != 'xls' && extend != 'xlsx') {
+        this.$message({ message: '请根据模板进行导入', type: 'error' });
+        return;
+      }
       e.preventDefault();
       let formData = new FormData();
       formData.append('file', fileInfo);
@@ -183,7 +214,7 @@ export default {
         background: 'rgba(0, 0, 0, 0.7)'
       });
       api.dataTcmdromeVerify(formData, header).then(res => {
-        if ((res.data.code === '00020007' || res.data.code === '00020004')) {
+        if (res.data.code === '00020007' || res.data.code === '00020004') {
           loading.close();
           this.$alert(`${res.data.msg}`, '提示', {
             confirmButtonText: '确定',
@@ -255,9 +286,10 @@ export default {
         hisName: this.filter.hisName.trim(),
         uniqueName: this.filter.uniqueName.trim(),
         uniqueCode: '',
-        hospitalId: data && data.hospitalId,
+        hospitalId: (data && data.hospitalId) || localStorage.getItem('hospitalId'),
         type: 13,
-        isMatch:this.filter.match
+        isMatch: this.filter.match,
+        status: this.filter.status,
       };
       return param;
     },
@@ -267,7 +299,7 @@ export default {
       this.getDataList();
     },
     addRelation() {
-      console.log(11)
+      console.log(11);
       const pam = this.searched
         ? {
             currentPage: this.currentPage,
@@ -275,8 +307,8 @@ export default {
             filter: this.filter
           }
         : { currentPage: this.currentPage, pageSize: this.pageSize };
-        this.data={}
-        this.showModal()
+      this.data = {};
+      this.showModal();
       // this.$router.push({
       //   name: 'AddTcmdrome',
       //   params: Object.assign(pam, {
@@ -304,8 +336,8 @@ export default {
       //     hospitaiName: this.hospitaiName
       //   })
       // });
-      this.data = item
-      this.showModal()
+      this.data = item;
+      this.showModal();
     },
     currentChange(next) {
       this.currentPage = next;
@@ -408,12 +440,18 @@ export default {
         // }
       })
         .then(() => {
-          api.exportTcmdromeRecord({ hospitalId: this.hospitalId,type:13 ,isMatch:this.filter.match}).then(res => {
-            if (res.status === 200) {
-              this.$message({ message: '导出成功', type: 'success' });
-              utils.downloadExportedData(res.data, '中医证候关联数据.xls');
-            }
-          });
+          api
+            .exportTcmdromeRecord({
+              hospitalId: this.hospitalId,
+              type: 13,
+              isMatch: this.filter.match
+            })
+            .then(res => {
+              if (res.status === 200) {
+                this.$message({ message: '导出成功', type: 'success' });
+                utils.downloadExportedData(res.data, '中医证候关联数据.xls');
+              }
+            });
         })
         .catch(() => {
           // this.$message({ message: '导出失败', type: 'waring' });
@@ -421,7 +459,7 @@ export default {
     },
     // 导入模板
     exportModule() {
-      api.exportTcmdromeModule({type:13}).then(res => {
+      api.exportTcmdromeModule({ type: 13 }).then(res => {
         if (res.status === 200) {
           setTimeout(() => {
             utils.downloadExportedData(res.data, '中医证候导入模板.xls');
@@ -438,6 +476,11 @@ export default {
     // 导入数据
     uploadFile(e) {
       let fileInfo = e.target.files[0];
+      let extend = fileInfo.name.substring(fileInfo.name.lastIndexOf('.') + 1);
+      if (extend != 'xls' && extend != 'xlsx') {
+        this.$message({ message: '请根据模板进行导入', type: 'error' });
+        return;
+      }
       e.preventDefault();
       let formData = new FormData();
       formData.append('file', fileInfo);
@@ -449,59 +492,145 @@ export default {
           'Content-Type': 'multipart/form-data'
         }
       };
-      this.uploadInfo = '导入中...';
-      api.importTcmdromeRecord(formData, header).then(res => {
-        if (res.data.code === '00000001') {
-          this.$alert(`数据存在异常,导入失败,请修改后再试`, '提示', {
-            confirmButtonText: '确定',
-            // cancelButtonText: '取消',
-            // cancelButtonClass: 'cancelSure',
-            // confirmButtonClass: 'sure',
-            // customClass: 'exportConfirm',
-            type: 'warning'
-          })
-            .then(() => {})
-            .catch(() => {});
-          this.getDataList(); // 重新获取列表
-          setTimeout(() => {
-            this.uploadInfo = '导入';
-          }, 300);
-        } else if ((res.data.data === true && res.status === 200)) {
-          this.$alert(`导入成功`, '提示', {
-            confirmButtonText: '确定',
-            // cancelButtonText: '取消',
-            // cancelButtonClass: 'cancelSure',
-            // confirmButtonClass: 'sure',
-            // customClass: 'exportConfirm',
-            type: 'success'
-          })
-            .then(() => {})
-            .catch(() => {});
-          this.getDataList(); // 重新获取列表
-          setTimeout(() => {
-            this.uploadInfo = '导入';
-          }, 300);
-        } else {
-          this.$alert(`${res.data.msg}`, '提示', {
-            confirmButtonText: '确定',
-            // cancelButtonText: '取消',
-            // cancelButtonClass: 'cancelSure',
-            // confirmButtonClass: 'sure',
-            // customClass: 'exportConfirm',
-            type: 'warning'
-          })
-            .then(() => {})
-            .catch(() => {});
+      this.importTcmdromeRecord(formData, header);
+      // this.uploadInfo = '导入中...';
+      // api.importExcelDataVerify(formData, header).then(res => {
+      //   if (res.data.code === '00020001') {
+      //     this.$confirm(`${res.data.msg}`, '提示', {
+      //       confirmButtonText: '确定',
+      //       cancelButtonText: '取消',
+      //       type: 'warning'
+      //     })
+      //       .then(() => {
+      //         this.importTcmdromeRecord(formData, header);
+      //       })
+      //       .catch(() => {
+      //         setTimeout(() => {
+      //           this.uploadInfo = '导入';
+      //         }, 300);
+      //       });
+      //   } else if (res.data.data === true) {
+      //     this.importTcmdromeRecord(formData, header);
+      //   }else {
+      //     this.$alert(`${res.data.msg}`, '提示', {
+      //       confirmButtonText: '确定',
+      //       // cancelButtonText: '取消',
+      //       // cancelButtonClass: 'cancelSure',
+      //       // confirmButtonClass: 'sure',
+      //       // customClass: 'exportConfirm',
+      //       type: 'warning'
+      //     })
+      //       .then(() => {})
+      //       .catch(() => {});
+
+      //     setTimeout(() => {
+      //       this.uploadInfo = '导入';
+      //     }, 300);
+      //   }
+      // });
 
-          setTimeout(() => {
-            this.uploadInfo = '导入';
-          }, 300);
-        }
-      });
       //解决上传相同文件不触发change
       let inp = document.getElementById('upFile');
       inp.value = '';
     },
+    importTcmdromeRecord(formData, header) {
+      let that = this
+      api.importTcmdromeRecord(formData, header).then(res => {
+        if (res.headers['content-disposition']) {
+          this.downloadUrl(res);
+          this.getDataList();
+        } else {
+          let r = new FileReader();
+          r.onload = function() {
+            if (this.result) {
+              const code = JSON.parse(this.result);
+              if (code.code === '00020007') {
+                that
+                  .$alert(`${code.msg}`, '提示', {
+                    confirmButtonText: '确定',
+                    // cancelButtonText: '取消',
+                    // cancelButtonClass: 'cancelSure',
+                    // confirmButtonClass: 'sure',
+                    // customClass: 'exportConfirm',
+                    type: 'warning'
+                  })
+                  .then(() => {})
+                  .catch(() => {});
+              }
+            } else {
+              that.$alert(`导入成功`, '提示', {
+                confirmButtonText: '确定',
+                // cancelButtonText: '取消',
+                // cancelButtonClass: 'cancelSure',
+                // confirmButtonClass: 'sure',
+                // customClass: 'exportConfirm',
+                type: 'success'
+              });
+              that.getDataList();
+            }
+          };
+          r.readAsText(res.data);
+        }
+        // if ((res.data.code === '00020007')) {
+        //   this.$alert(`医院术语字符数超出最大数量,请修改后再试`, '提示', {
+        //     confirmButtonText: '确定',
+        //     // cancelButtonText: '取消',
+        //     // cancelButtonClass: 'cancelSure',
+        //     // confirmButtonClass: 'sure',
+        //     // customClass: 'exportConfirm',
+        //     type: 'warning'
+        //   })
+        //     .then(() => {})
+        //     .catch(() => {});
+        //   this.getDataList(); // 重新获取列表
+        //   setTimeout(() => {
+        //     this.uploadInfo = '导入';
+        //   }, 300);
+        // } else if (res.data.data === true && res.status === 200) {
+        //   this.$alert(`导入成功`, '提示', {
+        //     confirmButtonText: '确定',
+        //     // cancelButtonText: '取消',
+        //     // cancelButtonClass: 'cancelSure',
+        //     // confirmButtonClass: 'sure',
+        //     // customClass: 'exportConfirm',
+        //     type: 'success'
+        //   })
+        //     .then(() => {})
+        //     .catch(() => {});
+        //   this.getDataList(); // 重新获取列表
+        //   setTimeout(() => {
+        //     this.uploadInfo = '导入';
+        //   }, 300);
+        // } else {
+        //   this.$alert(`${res.data.msg}`, '提示', {
+        //     confirmButtonText: '确定',
+        //     // cancelButtonText: '取消',
+        //     // cancelButtonClass: 'cancelSure',
+        //     // confirmButtonClass: 'sure',
+        //     // customClass: 'exportConfirm',
+        //     type: 'warning'
+        //   })
+        //     .then(() => {})
+        //     .catch(() => {});
+
+        //   setTimeout(() => {
+        //     this.uploadInfo = '导入';
+        //   }, 300);
+        // }
+      });
+    },
+    downloadUrl(res) {
+      var disposition = res.headers['content-disposition'];
+      var fileName = decodeURI(
+        disposition.split('filename=')[1].split(';filename*=')[0]
+      );
+      let blob = new Blob([res.data], { type: 'application/.xls' }); //.xls是我和后台约定好的文件格式
+      let link = document.createElement('a');
+      link.href = window.URL.createObjectURL(blob);
+      link.download = fileName;
+      link.click();
+      link.remove();
+    },
     /********新增编辑弹窗**********/
     showModal() {
       this.modalVisiable = true;

+ 29 - 0
src/components/knowledgeExtra/AddDevKnow.vue

@@ -136,6 +136,8 @@
                 :total="form.prags.length"
                 :isEdit="isEdit"
                 :isCopy="isCopy"
+                :positionMap="positionMap"
+                :positionList="positionList"
                 ref="subForm"
                 @add="addParagraph(i)"
                 @del="delParagraph"
@@ -229,6 +231,8 @@ export default {
       isFixedTop: true,
       isEdit: false,
       isCopy: false,
+      positionMap:[],   //各类型内容类型对象
+      positionList:[],   //各类型内容类型对象
       title: '添加',
       termTypes: [],
       terms: [], //术语列表
@@ -330,6 +334,7 @@ export default {
     }
   },
   created: function() {
+      this.zskgetDict();    //获取内容类型
     const { isEdit, data, isCopy } = this.$route.params;
     if (isEdit || isCopy) {
       const loading = this.$loading({
@@ -472,6 +477,30 @@ export default {
     }
   },
   methods: {
+      zskgetDict() {  //获取位置枚举
+          api
+              .zskgetDict()
+              .then(res => {
+                  if (res.data.code == '0') {
+                      const data = res.data.data;
+                      this.positionList = data['50'];
+                      this.positionMap=this.getPositionMap(data['50'],data['51']);
+                  }
+              })
+              .catch(error => {
+                  console.log(error);
+              });
+      },
+      getPositionMap(list,maps){    //各类型需要显示的内容类型map
+          let tempObj = {},arr=[];
+          maps.map((it)=>{
+              arr = it.val.split(",").map((i)=>{
+                  return list.find((t)=>t.val===i);
+              });
+              tempObj[it.name]=arr;
+          });
+          return tempObj;
+      },
     scrollTo(dom) {
       var div = this.$refs['elscrollbar'].$refs['wrap'];
       if (dom >= 0) {

+ 3 - 2
src/components/knowledgeExtra/AddDiagBase.vue

@@ -305,7 +305,7 @@
                         ]:[]"
                       >
                         <el-select
-                        v-show="items.basType != 1"
+                          v-show="items.basType != 1"
                           clearable
                           remote
                           filterable
@@ -1587,7 +1587,8 @@ export default {
     height: 30px !important;
   }
 }
-/deep/ .el-select-dropdown__list, .el-select-dropdown__item {
+/deep/ .el-select-dropdown__list,
+.el-select-dropdown__item {
   padding: 6px 33px 6px 6px;
 }
 /deep/ .searchselect {

+ 9 - 29
src/components/knowledgeExtra/DevInfo.vue

@@ -105,7 +105,7 @@ import config from '@api/config';
 import { container, ImageExtend, QuillWatch } from 'quill-image-extend-module';
 Quill.register('modules/ImageExtend', ImageExtend);
 export default {
-  props: ['data', 'index', 'isEdit', 'isCopy', 'total', 'showType'],
+  props: ['data', 'index', 'isEdit', 'isCopy', 'total', 'showType','positionMap','positionList'],
   name: 'DevInfo',
   components: {
     quillEditor
@@ -165,10 +165,17 @@ export default {
         position: [],
         orderNo: 0
       },
-      positions: [], //位置列表
       rules: {}
     };
   },
+    computed:{
+      'positions':function(){
+          if(this.showType!==-1){
+              return this.positionMap[this.showType];
+          }
+          return this.positionList||[];
+      }
+    },
   watch: {
     'data.content': function() {
       if (this.data.content !== '') {
@@ -186,7 +193,6 @@ export default {
     this.editorOption.modules.toolbar.container = this.toolbars[
       this.toolbarMode
     ];
-    this.zskgetDict();
 
     if (this.isEdit || this.isCopy) {
       setTimeout(() => {
@@ -287,20 +293,6 @@ export default {
     );
   },
   methods: {
-    zskgetDict() {
-      api
-        .zskgetDict()
-        .then(res => {
-          if (res.data.code == '0') {
-            const data = res.data.data;
-            this.positions = data['50'];
-            this.renderPositions(data['50'], data['51']);
-          }
-        })
-        .catch(error => {
-          console.log(error);
-        });
-    },
     reOrder(i) {
       this.$emit('reOrder', i, this.index);
     },
@@ -321,18 +313,6 @@ export default {
       });
       this.data.position = arr;
     },
-    // 渲染内容类型
-    renderPositions(data1, data2) {
-      //显示位置枚举列表
-      if (this.showType>0) {
-        data2 = data2.filter(item => item.name == this.showType);
-        let val = data2[0].val.split(',');
-        this.positions = data1.filter(it => {
-          let arr = val.map(v => v);
-          return arr.includes(it.val);
-        });
-      }
-    }
   }
 };
 </script>

+ 1 - 1
src/components/testManager/staticKnowledgeMap/StaticKnowledgeMapTest.vue

@@ -258,7 +258,7 @@ export default {
         },
       };
       api.staticKnowledgeTest(formData, header).then((res) => {
-        if (res.data.code === '00000001') {
+        if ((res.data.code === '00020007')) {
           this.$message.error(res.data.msg || '数据存在异常');
           this.getDataList(this.hospitalId); // 重新获取列表
         } else if (res.data.code === '0' && res.data.data) {