Browse Source

导入校验

wyq 3 năm trước cách đây
mục cha
commit
6915c5ac64

+ 2 - 0
src/api/config.js

@@ -149,6 +149,8 @@ export default {
     'zskSearchConcept': '/klDisease/searchConceptRuleClass',//知识库搜索术语
     'zskUpdateAll':'/cache/clearRuleAll',//更新数据
     'zskgetDict':'/kl/dictionary/getDictionarys',//禁止修改基础规则类型
+
+    'importExcelDataVerify': '/tran/mappingConfig/importExcelDataVerify',//数据导入校验
   },
 	menuIconList: { //菜单对应图标
 		'YH-KZT': 'el-icon-menu',

+ 5 - 0
src/api/icss.js

@@ -442,4 +442,9 @@ export default {
       responseType: 'blob',
     });
   },
+
+  importExcelDataVerify(param) {
+    //数据导入校验
+    return axios.post(urls.importExcelDataVerify, param);
+  },
 };

+ 48 - 29
src/components/icss/dept/DeptManage.vue

@@ -4,13 +4,8 @@
       <el-form :inline="true" class="demo-form-inline">
         <el-form-item>
           <el-button type="text" class="downTemplate" @click="exportModule">导入模板下载</el-button>
-          <input
-            type="file"
-            name="uploadfile "
-            id="upFile"
-            @change="uploadFile($event)"
-          />
-                      <!-- accept=".csv, application/vnd.ms-excel, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet" -->
+          <input type="file" name="uploadfile " id="upFile" @change="uploadFile($event)" />
+          <!-- accept=".csv, application/vnd.ms-excel, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet" -->
           <el-button size="mini" @click="handleMatchData">预匹配</el-button>
           <el-button size="mini" @click="importPage" style="margin:0 10px">{{uploadInfo}}</el-button>
           <input type="file" name="uploadfile " id="upFileMatch" @change="uploadFileMatch($event)" />
@@ -106,7 +101,7 @@ export default {
       filter: {
         hisName: '', // 医院诊断名称
         uniqueName: '', //标准诊断名称
-        match:''
+        match: ''
       },
       currentPage: 1,
       pageSize: config.pageSize,
@@ -121,19 +116,19 @@ export default {
       data: {}
     };
   },
-  components:{
+  components: {
     LtModal
   },
   created() {
     const param = this.$route.params;
-    if(param.currentPage){
-      this.inCurrentPage = param.currentPage
+    if (param.currentPage) {
+      this.inCurrentPage = param.currentPage;
     }
-    if(param.filter){
-      this.filter = param.filter
+    if (param.filter) {
+      this.filter = param.filter;
     }
     //返回时避免参数未赋值就获取列表
-    setTimeout(()=> {
+    setTimeout(() => {
       this.getDataList();
     });
     // 非首页 编辑页返回 设置 this.currentPage
@@ -263,8 +258,8 @@ export default {
           }
         : { currentPage: this.currentPage, pageSize: this.pageSize };
       // this.$router.push({ name: 'AddDept', params: pam });
-      this.data = {}
-      this.showModal()
+      this.data = {};
+      this.showModal();
     },
     // 修改诊断关联-跳转至编辑页面
     modifyRelation(row) {
@@ -280,8 +275,8 @@ export default {
       //   name: 'AddDept',
       //   params: Object.assign(pam, { isEdit: true, data: item })
       // });
-      this.data = item
-      this.showModal()
+      this.data = item;
+      this.showModal();
     },
     currentChange(next) {
       this.currentPage = next;
@@ -385,19 +380,21 @@ export default {
         // }
       })
         .then(() => {
-          api.exportDeptRecord({type:7,isMatch:this.filter.match}).then(res => {
-            if (res.status === 200) {
-              this.$message({ message: '导出成功', type: 'success' });
-              utils.downloadExportedData(res.data, '科室关联数据.xls');
-            }
-          });
+          api
+            .exportDeptRecord({ type: 7, isMatch: this.filter.match })
+            .then(res => {
+              if (res.status === 200) {
+                this.$message({ message: '导出成功', type: 'success' });
+                utils.downloadExportedData(res.data, '科室关联数据.xls');
+              }
+            });
         })
         .catch(() => {});
     },
 
     // 导入模板
     exportModule() {
-      api.exportDeptModule({type:7}).then(res => {
+      api.exportDeptModule({ type: 7 }).then(res => {
         if (res.status === 200) {
           setTimeout(() => {
             utils.downloadExportedData(res.data, '科室导入模板.xls');
@@ -430,6 +427,31 @@ export default {
         }
       };
       this.uploadInfo = '导入中...';
+      api.importExcelDataVerify(formData, header).then(res => {
+        if (res.data.code === '00020001') {
+          this.$confirm(`${res.data.msg}`, '提示1', {
+            confirmButtonText: '确定',
+            cancelButtonText: '取消',
+            type: 'warning'
+          })
+            .then(() => {
+              this.importDeptRecord(formData, header);
+            })
+            .catch(() => {
+              setTimeout(() => {
+                this.uploadInfo = '导入';
+              }, 300);
+            });
+        } else if (res.data.data === true) {
+          this.importDeptRecord(formData, header);
+        }
+      });
+
+      //解决上传相同文件不触发change
+      let inp = document.getElementById('upFile');
+      inp.value = '';
+    },
+    importDeptRecord(formData, header) {
       api.importDeptRecord(formData, header).then(res => {
         // console.log('导入文件结果', '===================', res);
         if (res.data.code === '00000001') {
@@ -479,9 +501,6 @@ export default {
           }, 300);
         }
       });
-      //解决上传相同文件不触发change
-      let inp = document.getElementById('upFile');
-      inp.value = '';
     },
     /********新增编辑弹窗**********/
     showModal() {
@@ -565,7 +584,7 @@ export default {
     display: none;
   }
 }
-#upFileMatch{
+#upFileMatch {
   display: none;
 }
 </style>

+ 36 - 15
src/components/icss/disease/ChemicalAndCommonMapping.vue

@@ -426,14 +426,38 @@ export default {
         }
       };
       this.uploadInfo = '导入中...';
+      api.importExcelDataVerify(formData, header).then(res => {
+        if (res.data.code === '00020001') {
+          this.$confirm(`${res.data.msg}`, '提示1', {
+            confirmButtonText: '确定',
+            cancelButtonText: '取消',
+            type: 'warning'
+          })
+            .then(() => { 
+              this.importDiseaseRecord(formData, header)
+            })
+            .catch(() => {
+              setTimeout(() => {
+                this.uploadInfo = '导入';
+              }, 300);
+            });
+        } else if (res.data.data === true) {
+          this.importDiseaseRecord(formData, header)
+        }
+      });
+      //解决上传相同文件不触发change
+      let inp = document.getElementById('upFile');
+      inp.value = '';
+    },
+    importDiseaseRecord(formData, header) {
       api.importDiseaseRecord(formData, header).then(res => {
         if (res.data.code === '00000001') {
-          this.$confirm(`数据存在异常,导入失败,请修改后再试`, '提示', {
+          this.$alert(`数据存在异常,导入失败,请修改后再试`, '提示', {
             confirmButtonText: '确定',
             // cancelButtonText: '取消',
-            cancelButtonClass: 'cancelSure',
-            confirmButtonClass: 'sure',
-            customClass: 'exportConfirm',
+            // cancelButtonClass: 'cancelSure',
+            // confirmButtonClass: 'sure',
+            // customClass: 'exportConfirm',
             type: 'warning'
           })
             .then(() => {})
@@ -443,12 +467,12 @@ export default {
             this.uploadInfo = '导入';
           }, 300);
         } else if (res.data.data === true && res.status === 200) {
-          this.$confirm(`导入成功`, '提示', {
+          this.$alert(`导入成功`, '提示', {
             confirmButtonText: '确定',
             // cancelButtonText: '取消',
-            cancelButtonClass: 'cancelSure',
-            confirmButtonClass: 'sure',
-            customClass: 'exportConfirm',
+            // cancelButtonClass: 'cancelSure',
+            // confirmButtonClass: 'sure',
+            // customClass: 'exportConfirm',
             type: 'success'
           })
             .then(() => {})
@@ -458,12 +482,12 @@ export default {
             this.uploadInfo = '导入';
           }, 300);
         } else {
-          this.$confirm(`${res.data.msg}`, '提示', {
+          this.$alert(`${res.data.msg}`, '提示', {
             confirmButtonText: '确定',
             // cancelButtonText: '取消',
-            cancelButtonClass: 'cancelSure',
-            confirmButtonClass: 'sure',
-            customClass: 'exportConfirm',
+            // cancelButtonClass: 'cancelSure',
+            // confirmButtonClass: 'sure',
+            // customClass: 'exportConfirm',
             type: 'warning'
           })
             .then(() => {})
@@ -474,9 +498,6 @@ export default {
           }, 300);
         }
       });
-      //解决上传相同文件不触发change
-      let inp = document.getElementById('upFile');
-      inp.value = '';
     },
     /********新增编辑弹窗**********/
     showModal() {

+ 48 - 29
src/components/icss/drug/DrugManage.vue

@@ -4,12 +4,7 @@
       <el-form :inline="true" class="demo-form-inline">
         <el-form-item>
           <el-button type="text" class="downTemplate" @click="exportModule">导入模板下载</el-button>
-          <input
-            type="file"
-            name="uploadfile "
-            id="upFile"
-            @change="uploadFile($event)"
-          />
+          <input type="file" name="uploadfile " id="upFile" @change="uploadFile($event)" />
           <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)" />
@@ -104,7 +99,7 @@ export default {
       filter: {
         hisName: '', // 医院诊断名称
         uniqueName: '', //标准诊断名称
-        match:''
+        match: ''
       },
       currentPage: 1,
       pageSize: config.pageSize,
@@ -116,19 +111,19 @@ export default {
       data: {}
     };
   },
-  components:{
+  components: {
     LtModal
   },
   created() {
     const param = this.$route.params;
-    if(param.currentPage){
-      this.inCurrentPage = param.currentPage
+    if (param.currentPage) {
+      this.inCurrentPage = param.currentPage;
     }
-    if(param.filter){
-      this.filter = param.filter
+    if (param.filter) {
+      this.filter = param.filter;
     }
     //返回时避免参数未赋值就获取列表
-    setTimeout(()=> {
+    setTimeout(() => {
       this.getDataList();
     });
   },
@@ -237,7 +232,7 @@ export default {
         uniqueName: this.filter.uniqueName.trim(),
         uniqueCode: '',
         type: 5,
-        isMatch:this.filter.match
+        isMatch: this.filter.match
       };
       return param;
     },
@@ -255,8 +250,8 @@ export default {
           }
         : { currentPage: this.currentPage, pageSize: this.pageSize };
 
-        this.data = {};
-        this.showModal()
+      this.data = {};
+      this.showModal();
       // this.$router.push({ name: 'AddDrug', params: pam });
     },
     // 修改诊断关联-跳转至编辑页面
@@ -273,8 +268,8 @@ export default {
       //   name: 'AddDrug',
       //   params: Object.assign(pam, { isEdit: true, data: item })
       // });
-      this.data = item
-      this.showModal()
+      this.data = item;
+      this.showModal();
     },
     currentChange(next) {
       this.currentPage = next;
@@ -377,12 +372,14 @@ export default {
         // }
       })
         .then(() => {
-          api.exportDrugRecord({type:5,isMatch:this.filter.match}).then(res => {
-            if (res.status === 200) {
-              this.$message({ message: '导出成功', type: 'success' });
-              utils.downloadExportedData(res.data, '药品关联数据.xls');
-            }
-          });
+          api
+            .exportDrugRecord({ 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' });
@@ -391,7 +388,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');
@@ -423,6 +420,31 @@ export default {
         }
       };
       this.uploadInfo = '导入中...';
+      api.importExcelDataVerify(formData, header).then(res => {
+        if (res.data.code === '00020001') {
+          this.$confirm(`${res.data.msg}`, '提示1', {
+            confirmButtonText: '确定',
+            cancelButtonText: '取消',
+            type: 'warning'
+          })
+            .then(() => {
+              this.importDrugRecord(formData, header);
+            })
+            .catch(() => {
+              setTimeout(() => {
+                this.uploadInfo = '导入';
+              }, 300);
+            });
+        } else if (res.data.data === true) {
+          this.importDrugRecord(formData, header);
+        }
+      });
+
+      //解决上传相同文件不触发change
+      let inp = document.getElementById('upFile');
+      inp.value = '';
+    },
+    importDrugRecord(formData, header) {
       api.importDrugRecord(formData, header).then(res => {
         // console.log(res, '======================res导入结果');
         if (res.data.code === '00000001') {
@@ -472,9 +494,6 @@ export default {
           }, 300);
         }
       });
-      //解决上传相同文件不触发change
-      let inp = document.getElementById('upFile');
-      inp.value = '';
     },
     /********新增编辑弹窗**********/
     showModal() {
@@ -550,7 +569,7 @@ export default {
     border-bottom: 1px solid #dcdfe6;
   }
 }
-#upFileMatch{
+#upFileMatch {
   display: none;
 }
 </style>

+ 47 - 28
src/components/icss/fusion/Fusion.vue

@@ -4,12 +4,7 @@
       <el-form :inline="true" class="demo-form-inline">
         <el-form-item>
           <el-button type="text" class="downTemplate" @click="exportModule">导入模板下载</el-button>
-          <input
-            type="file"
-            name="uploadfile "
-            id="upFile"
-            @change="uploadFile($event)"
-          />
+          <input type="file" name="uploadfile " id="upFile" @change="uploadFile($event)" />
           <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)" />
@@ -103,7 +98,7 @@ export default {
       filter: {
         hisName: '', // 医院诊断名称
         uniqueName: '', //标准诊断名称
-        match:''
+        match: ''
       },
       currentPage: 1,
       pageSize: config.pageSize,
@@ -115,19 +110,19 @@ export default {
       data: {}
     };
   },
-  components:{
+  components: {
     LtModal
   },
   created() {
     const param = this.$route.params;
-    if(param.currentPage){
-      this.inCurrentPage = param.currentPage
+    if (param.currentPage) {
+      this.inCurrentPage = param.currentPage;
     }
-    if(param.filter){
-      this.filter = param.filter
+    if (param.filter) {
+      this.filter = param.filter;
     }
     //返回时避免参数未赋值就获取列表
-    setTimeout(()=> {
+    setTimeout(() => {
       this.getDataList();
     });
   },
@@ -255,8 +250,8 @@ export default {
           }
         : { currentPage: this.currentPage, pageSize: this.pageSize };
       // this.$router.push({ name: 'AddFusion', params: pam });
-      this.data = {}
-      this.showModal()
+      this.data = {};
+      this.showModal();
     },
     // 修改诊断关联-跳转至编辑页面
     modifyRelation(row) {
@@ -272,8 +267,8 @@ export default {
       //   name: 'AddFusion',
       //   params: Object.assign(pam, { isEdit: true, data: item })
       // });
-      this.data = item
-      this.showModal()
+      this.data = item;
+      this.showModal();
     },
     currentChange(next) {
       this.currentPage = next;
@@ -376,12 +371,14 @@ export default {
         // }
       })
         .then(() => {
-          api.exportFusionRecord({type:8,isMatch:this.filter.match}).then(res => {
-            if (res.status === 200) {
-              this.$message({ message: '导出成功', type: 'success' });
-              utils.downloadExportedData(res.data, '输血关联数据.xls');
-            }
-          });
+          api
+            .exportFusionRecord({ type: 8, 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' });
@@ -389,7 +386,7 @@ export default {
     },
     // 导入模板
     exportModule() {
-      api.exportFusionModule({type:8}).then(res => {
+      api.exportFusionModule({ type: 8 }).then(res => {
         if (res.status === 200) {
           setTimeout(() => {
             utils.downloadExportedData(res.data, '输血导入模板.xls');
@@ -421,6 +418,31 @@ export default {
         }
       };
       this.uploadInfo = '导入中...';
+      api.importExcelDataVerify(formData, header).then(res => {
+        if (res.data.code === '00020001') {
+          this.$confirm(`${res.data.msg}`, '提示1', {
+            confirmButtonText: '确定',
+            cancelButtonText: '取消',
+            type: 'warning'
+          })
+            .then(() => {
+              this.importFusionRecord(formData, header);
+            })
+            .catch(() => {
+              setTimeout(() => {
+                this.uploadInfo = '导入';
+              }, 300);
+            });
+        } else if (res.data.data === true) {
+          this.importFusionRecord(formData, header);
+        }
+      });
+
+      //解决上传相同文件不触发change
+      let inp = document.getElementById('upFile');
+      inp.value = '';
+    },
+    importFusionRecord(formData, header) {
       api.importFusionRecord(formData, header).then(res => {
         if (res.data.code === '00000001') {
           this.$confirm(`数据存在异常,导入失败,请修改后再试`, '提示', {
@@ -469,9 +491,6 @@ export default {
           }, 300);
         }
       });
-      //解决上传相同文件不触发change
-      let inp = document.getElementById('upFile');
-      inp.value = '';
     },
     /********新增编辑弹窗**********/
     showModal() {
@@ -547,7 +566,7 @@ export default {
     border-bottom: 1px solid #dcdfe6;
   }
 }
-#upFileMatch{
+#upFileMatch {
   display: none;
 }
 </style>

+ 36 - 15
src/components/icss/lis/Lis.vue

@@ -429,14 +429,38 @@ export default {
         }
       };
       this.uploadInfo = '导入中...';
+      api.importExcelDataVerify(formData, header).then(res => {
+        if (res.data.code === '00020001') {
+          this.$confirm(`${res.data.msg}`, '提示1', {
+            confirmButtonText: '确定',
+            cancelButtonText: '取消',
+            type: 'warning'
+          })
+            .then(() => {
+              this.importLisRecord(formData, header)
+            })
+            .catch(() => {
+              setTimeout(() => {
+                this.uploadInfo = '导入';
+              }, 300);
+            });
+        } else if (res.data.data === true) {
+          this.importLisRecord(formData, header)
+        }
+      });
+      //解决上传相同文件不触发change
+      let inp = document.getElementById('upFile');
+      inp.value = '';
+    },
+    importLisRecord(formData, header) {
       api.importLisRecord(formData, header).then(res => {
         if (res.data.code === '00000001') {
-          this.$confirm(`数据存在异常,导入失败,请修改后再试`, '提示', {
+          this.$alert(`数据存在异常,导入失败,请修改后再试`, '提示', {
             confirmButtonText: '确定',
             // cancelButtonText: '取消',
-            cancelButtonClass: 'cancelSure',
-            confirmButtonClass: 'sure',
-            customClass: 'exportConfirm',
+            // cancelButtonClass: 'cancelSure',
+            // confirmButtonClass: 'sure',
+            // customClass: 'exportConfirm',
             type: 'warning'
           })
             .then(() => {})
@@ -446,12 +470,12 @@ export default {
             this.uploadInfo = '导入';
           }, 300);
         } else if (res.data.data === true && res.status === 200) {
-          this.$confirm(`导入成功`, '提示', {
+          this.$alert(`导入成功`, '提示', {
             confirmButtonText: '确定',
             // cancelButtonText: '取消',
-            cancelButtonClass: 'cancelSure',
-            confirmButtonClass: 'sure',
-            customClass: 'exportConfirm',
+            // cancelButtonClass: 'cancelSure',
+            // confirmButtonClass: 'sure',
+            // customClass: 'exportConfirm',
             type: 'success'
           })
             .then(() => {})
@@ -461,12 +485,12 @@ export default {
             this.uploadInfo = '导入';
           }, 300);
         } else {
-          this.$confirm(`${res.data.msg}`, '提示', {
+          this.$alert(`${res.data.msg}`, '提示', {
             confirmButtonText: '确定',
             // cancelButtonText: '取消',
-            cancelButtonClass: 'cancelSure',
-            confirmButtonClass: 'sure',
-            customClass: 'exportConfirm',
+            // cancelButtonClass: 'cancelSure',
+            // confirmButtonClass: 'sure',
+            // customClass: 'exportConfirm',
             type: 'warning'
           })
             .then(() => {})
@@ -477,9 +501,6 @@ export default {
           }, 300);
         }
       });
-      //解决上传相同文件不触发change
-      let inp = document.getElementById('upFile');
-      inp.value = '';
     },
     /********新增编辑弹窗**********/
     showModal() {

+ 49 - 30
src/components/icss/nursing/nursing.vue

@@ -4,13 +4,8 @@
       <el-form :inline="true" class="demo-form-inline">
         <el-form-item>
           <el-button type="text" class="downTemplate" @click="exportModule">导入模板下载</el-button>
-          <input
-            type="file"
-            name="uploadfile "
-            id="upFile"
-            @change="uploadFile($event)"
-          />
-                      <!-- accept=".csv, application/vnd.ms-excel, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet" -->
+          <input type="file" name="uploadfile " id="upFile" @change="uploadFile($event)" />
+          <!-- accept=".csv, application/vnd.ms-excel, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet" -->
           <el-button size="mini" @click="handleMatchData">预匹配</el-button>
           <el-button size="mini" @click="importPage" style="margin:0 10px">{{uploadInfo}}</el-button>
           <input type="file" name="uploadfile " id="upFileMatch" @change="uploadFileMatch($event)" />
@@ -105,7 +100,7 @@ export default {
       filter: {
         hisName: '', // 医院诊断名称
         uniqueName: '', //标准诊断名称
-        match:''
+        match: ''
       },
       currentPage: 1,
       pageSize: config.pageSize,
@@ -120,19 +115,19 @@ export default {
       data: {}
     };
   },
-  components:{
+  components: {
     LtModal
   },
   created() {
     const param = this.$route.params;
-    if(param.currentPage){
-      this.inCurrentPage = param.currentPage
+    if (param.currentPage) {
+      this.inCurrentPage = param.currentPage;
     }
-    if(param.filter){
-      this.filter = param.filter
+    if (param.filter) {
+      this.filter = param.filter;
     }
     //返回时避免参数未赋值就获取列表
-    setTimeout(()=> {
+    setTimeout(() => {
       this.getDataList();
     });
     // 非首页 编辑页返回 设置 this.currentPage
@@ -245,7 +240,7 @@ export default {
         uniqueName: this.filter.uniqueName.trim(),
         uniqueCode: '',
         type: 11,
-        isMatch:this.filter.match
+        isMatch: this.filter.match
       };
       return param;
     },
@@ -263,8 +258,8 @@ export default {
           }
         : { currentPage: this.currentPage, pageSize: this.pageSize };
       // this.$router.push({ name: 'AddNursing', params: pam });
-      this.data={}
-      this.showModal()
+      this.data = {};
+      this.showModal();
     },
     // 修改诊断关联-跳转至编辑页面
     modifyRelation(row) {
@@ -280,8 +275,8 @@ export default {
       //   name: 'AddNursing',
       //   params: Object.assign(pam, { isEdit: true, data: item })
       // });
-      this.data=item
-      this.showModal()
+      this.data = item;
+      this.showModal();
     },
     currentChange(next) {
       this.currentPage = next;
@@ -385,19 +380,21 @@ export default {
         // }
       })
         .then(() => {
-          api.exportNurseRecord({type:11,isMatch:this.filter.match}).then(res => {
-            if (res.status === 200) {
-              this.$message({ message: '导出成功', type: 'success' });
-              utils.downloadExportedData(res.data, '护理关联数据.xls');
-            }
-          });
+          api
+            .exportNurseRecord({ type: 11, isMatch: this.filter.match })
+            .then(res => {
+              if (res.status === 200) {
+                this.$message({ message: '导出成功', type: 'success' });
+                utils.downloadExportedData(res.data, '护理关联数据.xls');
+              }
+            });
         })
         .catch(() => {});
     },
 
     // 导入模板
     exportModule() {
-      api.exportNurseModule({type:11}).then(res => {
+      api.exportNurseModule({ type: 11 }).then(res => {
         if (res.status === 200) {
           setTimeout(() => {
             utils.downloadExportedData(res.data, '护理导入模板.xls');
@@ -430,6 +427,31 @@ export default {
         }
       };
       this.uploadInfo = '导入中...';
+      api.importExcelDataVerify(formData, header).then(res => {
+        if (res.data.code === '00020001') {
+          this.$confirm(`${res.data.msg}`, '提示1', {
+            confirmButtonText: '确定',
+            cancelButtonText: '取消',
+            type: 'warning'
+          })
+            .then(() => {
+              this.importNurseRecord(formData, header);
+            })
+            .catch(() => {
+              setTimeout(() => {
+                this.uploadInfo = '导入';
+              }, 300);
+            });
+        } else if (res.data.data === true) {
+          this.importNurseRecord(formData, header);
+        }
+      });
+
+      //解决上传相同文件不触发change
+      let inp = document.getElementById('upFile');
+      inp.value = '';
+    },
+    importNurseRecord(formData, header) {
       api.importNurseRecord(formData, header).then(res => {
         // console.log('导入文件结果', '===================', res);
         if (res.data.code === '00000001') {
@@ -479,9 +501,6 @@ export default {
           }, 300);
         }
       });
-      //解决上传相同文件不触发change
-      let inp = document.getElementById('upFile');
-      inp.value = '';
     },
     /********新增编辑弹窗**********/
     showModal() {
@@ -565,7 +584,7 @@ export default {
     display: none;
   }
 }
-#upFileMatch{
+#upFileMatch {
   display: none;
 }
 </style>

+ 26 - 3
src/components/icss/operation/Operation.vue

@@ -427,6 +427,32 @@ export default {
         }
       };
       this.uploadInfo = '导入中...';
+
+      api.importExcelDataVerify(formData, header).then(res => {
+        if (res.data.code === '00020001') {
+          this.$confirm(`${res.data.msg}`, '提示1', {
+            confirmButtonText: '确定',
+            cancelButtonText: '取消',
+            type: 'warning'
+          })
+            .then(() => {
+              this.importOperationRecord(formData, header);
+            })
+            .catch(() => {
+              setTimeout(() => {
+                this.uploadInfo = '导入';
+              }, 300);
+            });
+        } else if (res.data.data === true) {
+          this.importOperationRecord(formData, header);
+        }
+      });
+
+      //解决上传相同文件不触发change
+      let inp = document.getElementById('upFile');
+      inp.value = '';
+    },
+    importOperationRecord(formData, header) {
       api.importOperationRecord(formData, header).then(res => {
         if (res.data.code === '00000001') {
           this.$confirm(`数据存在异常,导入失败,请修改后再试`, '提示', {
@@ -475,9 +501,6 @@ export default {
           }, 300);
         }
       });
-      //解决上传相同文件不触发change
-      let inp = document.getElementById('upFile');
-      inp.value = '';
     },
     /********新增编辑弹窗**********/
     showModal() {

+ 43 - 24
src/components/icss/pacs/Pacs.vue

@@ -4,12 +4,7 @@
       <el-form :inline="true" class="demo-form-inline">
         <el-form-item>
           <el-button type="text" class="downTemplate" @click="exportModule">导入模板下载</el-button>
-          <input
-            type="file"
-            name="uploadfile "
-            id="upFile"
-            @change="uploadFile($event)"
-          />
+          <input type="file" name="uploadfile " id="upFile" @change="uploadFile($event)" />
           <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)" />
@@ -104,7 +99,7 @@ export default {
       filter: {
         hisName: '', // 医院诊断名称
         uniqueName: '', //标准诊断名称
-        match:''
+        match: ''
       },
       currentPage: 1,
       pageSize: config.pageSize,
@@ -116,7 +111,7 @@ export default {
       data: {}
     };
   },
-  components:{
+  components: {
     LtModal
   },
   created() {
@@ -243,7 +238,7 @@ export default {
         uniqueName: this.filter.uniqueName.trim(),
         uniqueCode: '',
         type: 3,
-        isMatch:this.filter.match
+        isMatch: this.filter.match
       };
       return param;
     },
@@ -260,8 +255,8 @@ export default {
             filter: this.filter
           }
         : { currentPage: this.currentPage, pageSize: this.pageSize };
-        this.data = {}
-        this.showModal()
+      this.data = {};
+      this.showModal();
       // this.$router.push({ name: 'AddPacs', params: pam });
     },
     // 修改诊断关联-跳转至编辑页面
@@ -274,8 +269,8 @@ export default {
             filter: this.filter
           }
         : { currentPage: this.currentPage, pageSize: this.pageSize };
-        this.data = item
-        this.showModal()
+      this.data = item;
+      this.showModal();
       // this.$router.push({
       //   name: 'AddPacs',
       //   params: Object.assign(pam, { isEdit: true, data: item })
@@ -382,12 +377,14 @@ export default {
         // }
       })
         .then(() => {
-          api.exportPacsRecord({type:3,isMatch:this.filter.match}).then(res => {
-            if (res.status === 200) {
-              this.$message({ message: '导出成功', type: 'success' });
-              utils.downloadExportedData(res.data, '检查关联数据.xls');
-            }
-          });
+          api
+            .exportPacsRecord({ 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' });
@@ -395,7 +392,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');
@@ -427,6 +424,31 @@ export default {
         }
       };
       this.uploadInfo = '导入中...';
+      api.importExcelDataVerify(formData, header).then(res => {
+        if (res.data.code === '00020001') {
+          this.$confirm(`${res.data.msg}`, '提示1', {
+            confirmButtonText: '确定',
+            cancelButtonText: '取消',
+            type: 'warning'
+          })
+            .then(() => {
+              this.importPacsRecord(formData, header);
+            })
+            .catch(() => {
+              setTimeout(() => {
+                this.uploadInfo = '导入';
+              }, 300);
+            });
+        } else if (res.data.data === true) {
+          this.importPacsRecord(formData, header);
+        }
+      });
+
+      //解决上传相同文件不触发change
+      let inp = document.getElementById('upFile');
+      inp.value = '';
+    },
+    importPacsRecord(formData, header) {
       api.importPacsRecord(formData, header).then(res => {
         // code === '00000001'  导入失败统一提示 数据存在异常,导入失败,请修改后再试
         if (res.data.code === '00000001') {
@@ -476,9 +498,6 @@ export default {
           }, 300);
         }
       });
-      //解决上传相同文件不触发change
-      let inp = document.getElementById('upFile');
-      inp.value = '';
     },
     /********新增编辑弹窗**********/
     showModal() {
@@ -554,7 +573,7 @@ export default {
     border-bottom: 1px solid #dcdfe6;
   }
 }
-#upFileMatch{
+#upFileMatch {
   display: none;
 }
 </style>

+ 36 - 12
src/components/icss/scale/ScaleManage.vue

@@ -93,7 +93,7 @@ export default {
       filter: {
         hisName: '', // 医院诊断名称
         uniqueName: '', //标准诊断名称
-        match:''
+        match: ''
       },
       matchList: [
         { id: '', name: '全部' },
@@ -377,12 +377,14 @@ export default {
         // }
       })
         .then(() => {
-          api.exportScaleRecord({type:10,isMatch:this.filter.match}).then(res => {
-            if (res.status === 200) {
-              this.$message({ message: '导出成功', type: 'success' });
-              utils.downloadExportedData(res.data, '量表关联数据.xls');
-            }
-          });
+          api
+            .exportScaleRecord({ 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' });
@@ -391,7 +393,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');
@@ -423,6 +425,31 @@ export default {
         }
       };
       this.uploadInfo = '导入中...';
+      api.importExcelDataVerify(formData, header).then(res => {
+        if (res.data.code === '00020001') {
+          this.$confirm(`${res.data.msg}`, '提示1', {
+            confirmButtonText: '确定',
+            cancelButtonText: '取消',
+            type: 'warning'
+          })
+            .then(() => {
+              this.importScaleRecord(formData, header);
+            })
+            .catch(() => {
+              setTimeout(() => {
+                this.uploadInfo = '导入';
+              }, 300);
+            });
+        } else if (res.data.data === true) {
+          this.importScaleRecord(formData, header);
+        }
+      });
+
+      //解决上传相同文件不触发change
+      let inp = document.getElementById('upFile');
+      inp.value = '';
+    },
+    importScaleRecord(formData, header) {
       api.importScaleRecord(formData, header).then(res => {
         // console.log(res, '======================res导入结果');
         if (res.data.code === '00000001') {
@@ -472,9 +499,6 @@ export default {
           }, 300);
         }
       });
-      //解决上传相同文件不触发change
-      let inp = document.getElementById('upFile');
-      inp.value = '';
     },
     /********新增编辑弹窗**********/
     showModal() {
@@ -550,7 +574,7 @@ export default {
     border-bottom: 1px solid #dcdfe6;
   }
 }
-#upFileMatch{
+#upFileMatch {
   display: none;
 }
 </style>

+ 53 - 29
src/components/icss/tcmdisease/tcmdisease.vue

@@ -4,13 +4,8 @@
       <el-form :inline="true" class="demo-form-inline">
         <el-form-item>
           <el-button type="text" class="downTemplate" @click="exportModule">导入模板下载</el-button>
-          <input
-            type="file"
-            name="uploadfile "
-            id="upFile"
-            @change="uploadFile($event)"
-          />
-                      <!-- accept=".csv, application/vnd.ms-excel, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet" -->
+          <input type="file" name="uploadfile " id="upFile" @change="uploadFile($event)" />
+          <!-- accept=".csv, application/vnd.ms-excel, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet" -->
           <el-button size="mini" @click="handleMatchData">预匹配</el-button>
           <el-button size="mini" @click="importPage" style="margin:0 10px">{{uploadInfo}}</el-button>
           <input type="file" name="uploadfile " id="upFileMatch" @change="uploadFileMatch($event)" />
@@ -41,7 +36,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="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="uniqueName"
+          label="标准中医疾病名称"
+          show-overflow-tooltip
+        ></el-table-column>
         <el-table-column :resizable="false" prop="operate" label="状态">
           <template slot-scope="scope">
             <span>{{scope.row.isMatch == 0?'未匹配':'已匹配'}}</span>
@@ -101,7 +101,7 @@ export default {
       filter: {
         hisName: '', // 医院诊断名称
         uniqueName: '', //标准诊断名称
-        match:''
+        match: ''
       },
       matchList: [
         { id: '', name: '全部' },
@@ -127,14 +127,14 @@ export default {
   },
   created() {
     const param = this.$route.params;
-    if(param.currentPage){
-      this.inCurrentPage = param.currentPage
+    if (param.currentPage) {
+      this.inCurrentPage = param.currentPage;
     }
-    if(param.filter){
-      this.filter = param.filter
+    if (param.filter) {
+      this.filter = param.filter;
     }
     //返回时避免参数未赋值就获取列表
-    setTimeout(()=> {
+    setTimeout(() => {
       this.getDataList();
     });
     // 非首页 编辑页返回 设置 this.currentPage
@@ -265,8 +265,8 @@ export default {
           }
         : { currentPage: this.currentPage, pageSize: this.pageSize };
       // this.$router.push({ name: 'AddTcmdisease', params: pam });
-      this.data = {}
-      this.showModal()
+      this.data = {};
+      this.showModal();
     },
     // 修改诊断关联-跳转至编辑页面
     modifyRelation(row) {
@@ -282,8 +282,8 @@ export default {
       //   name: 'AddTcmdisease',
       //   params: Object.assign(pam, { isEdit: true, data: item })
       // });
-      this.data = item
-      this.showModal()
+      this.data = item;
+      this.showModal();
     },
     currentChange(next) {
       this.currentPage = next;
@@ -387,19 +387,21 @@ export default {
         // }
       })
         .then(() => {
-          api.exportTcmRecord({type:12,isMatch:this.filter.match}).then(res => {
-            if (res.status === 200) {
-              this.$message({ message: '导出成功', type: 'success' });
-              utils.downloadExportedData(res.data, '中医疾病关联数据.xls');
-            }
-          });
+          api
+            .exportTcmRecord({ type: 12, isMatch: this.filter.match })
+            .then(res => {
+              if (res.status === 200) {
+                this.$message({ message: '导出成功', type: 'success' });
+                utils.downloadExportedData(res.data, '中医疾病关联数据.xls');
+              }
+            });
         })
         .catch(() => {});
     },
 
     // 导入模板
     exportModule() {
-      api.exportTcmModule({type:12}).then(res => {
+      api.exportTcmModule({ type: 12 }).then(res => {
         if (res.status === 200) {
           setTimeout(() => {
             utils.downloadExportedData(res.data, '中医疾病导入模板.xls');
@@ -432,6 +434,31 @@ export default {
         }
       };
       this.uploadInfo = '导入中...';
+      api.importExcelDataVerify(formData, header).then(res => {
+        if (res.data.code === '00020001') {
+          this.$confirm(`${res.data.msg}`, '提示1', {
+            confirmButtonText: '确定',
+            cancelButtonText: '取消',
+            type: 'warning'
+          })
+            .then(() => {
+              this.importTcmRecord(formData, header);
+            })
+            .catch(() => {
+              setTimeout(() => {
+                this.uploadInfo = '导入';
+              }, 300);
+            });
+        } else if (res.data.data === true) {
+          this.importTcmRecord(formData, header);
+        }
+      });
+
+      //解决上传相同文件不触发change
+      let inp = document.getElementById('upFile');
+      inp.value = '';
+    },
+    importTcmRecord(formData, header) {
       api.importTcmRecord(formData, header).then(res => {
         // console.log('导入文件结果', '===================', res);
         if (res.data.code === '00000001') {
@@ -481,9 +508,6 @@ export default {
           }, 300);
         }
       });
-      //解决上传相同文件不触发change
-      let inp = document.getElementById('upFile');
-      inp.value = '';
     },
     /********新增编辑弹窗**********/
     showModal() {
@@ -567,7 +591,7 @@ export default {
     display: none;
   }
 }
-#upFileMatch{
+#upFileMatch {
   display: none;
 }
 </style>

+ 52 - 28
src/components/icss/tcmdrome/tcmdrome.vue

@@ -4,13 +4,8 @@
       <el-form :inline="true" class="demo-form-inline">
         <el-form-item>
           <el-button type="text" class="downTemplate" @click="exportModule">导入模板下载</el-button>
-          <input
-            type="file"
-            name="uploadfile "
-            id="upFile"
-            @change="uploadFile($event)"
-          />
-                      <!-- accept=".csv, application/vnd.ms-excel, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet" -->
+          <input type="file" name="uploadfile " id="upFile" @change="uploadFile($event)" />
+          <!-- accept=".csv, application/vnd.ms-excel, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet" -->
           <el-button size="mini" @click="handleMatchData">预匹配</el-button>
           <el-button size="mini" @click="importPage" style="margin:0 10px">{{uploadInfo}}</el-button>
           <input type="file" name="uploadfile " id="upFileMatch" @change="uploadFileMatch($event)" />
@@ -41,7 +36,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="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="uniqueName"
+          label="标准中医证候名称"
+          show-overflow-tooltip
+        ></el-table-column>
         <el-table-column :resizable="false" prop="operate" label="状态">
           <template slot-scope="scope">
             <span>{{scope.row.isMatch == 0?'未匹配':'已匹配'}}</span>
@@ -127,14 +127,14 @@ export default {
   },
   created() {
     const param = this.$route.params;
-    if(param.currentPage){
-      this.inCurrentPage = param.currentPage
+    if (param.currentPage) {
+      this.inCurrentPage = param.currentPage;
     }
-    if(param.filter){
-      this.filter = param.filter
+    if (param.filter) {
+      this.filter = param.filter;
     }
     //返回时避免参数未赋值就获取列表
-    setTimeout(()=> {
+    setTimeout(() => {
       this.getDataList();
     });
     // 非首页 编辑页返回 设置 this.currentPage
@@ -264,8 +264,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: pam });
     },
     // 修改诊断关联-跳转至编辑页面
@@ -278,8 +278,8 @@ export default {
             filter: this.filter
           }
         : { currentPage: this.currentPage, pageSize: this.pageSize };
-        this.data = item
-        this.showModal()
+      this.data = item;
+      this.showModal();
       // this.$router.push({
       //   name: 'AddTcmdrome',
       //   params: Object.assign(pam, { isEdit: true, data: item })
@@ -387,19 +387,21 @@ export default {
         // }
       })
         .then(() => {
-          api.exportTcmdromeRecord({type:13,isMatch:this.filter.match}).then(res => {
-            if (res.status === 200) {
-              this.$message({ message: '导出成功', type: 'success' });
-              utils.downloadExportedData(res.data, '中医证候关联数据.xls');
-            }
-          });
+          api
+            .exportTcmdromeRecord({ type: 13, isMatch: this.filter.match })
+            .then(res => {
+              if (res.status === 200) {
+                this.$message({ message: '导出成功', type: 'success' });
+                utils.downloadExportedData(res.data, '中医证候关联数据.xls');
+              }
+            });
         })
         .catch(() => {});
     },
 
     // 导入模板
     exportModule() {
-      api.exportTcmdromeModule({type:13}).then(res => {
+      api.exportTcmdromeModule({ type: 13 }).then(res => {
         if (res.status === 200) {
           setTimeout(() => {
             utils.downloadExportedData(res.data, '中医证候导入模板.xls');
@@ -432,6 +434,31 @@ export default {
         }
       };
       this.uploadInfo = '导入中...';
+      api.importExcelDataVerify(formData, header).then(res => {
+        if (res.data.code === '00020001') {
+          this.$confirm(`${res.data.msg}`, '提示1', {
+            confirmButtonText: '确定',
+            cancelButtonText: '取消',
+            type: 'warning'
+          })
+            .then(() => {
+              this.importTcmdromeRecord(formData, header);
+            })
+            .catch(() => {
+              setTimeout(() => {
+                this.uploadInfo = '导入';
+              }, 300);
+            });
+        } else if (res.data.data === true) {
+          this.importTcmdromeRecord(formData, header);
+        }
+      });
+
+      //解决上传相同文件不触发change
+      let inp = document.getElementById('upFile');
+      inp.value = '';
+    },
+    importTcmdromeRecord(formData, header) {
       api.importTcmdromeRecord(formData, header).then(res => {
         // console.log('导入文件结果', '===================', res);
         if (res.data.code === '00000001') {
@@ -481,9 +508,6 @@ export default {
           }, 300);
         }
       });
-      //解决上传相同文件不触发change
-      let inp = document.getElementById('upFile');
-      inp.value = '';
     },
     /********新增编辑弹窗**********/
     showModal() {
@@ -567,7 +591,7 @@ export default {
     display: none;
   }
 }
-#upFileMatch{
+#upFileMatch {
   display: none;
 }
 </style>

+ 1 - 1
src/less/admin.less

@@ -117,7 +117,7 @@
 .cell .el-button:focus, .cell .el-button:hover{
   border-color: transparent;
 }
-.el-message-box__btns .el-button--default{
+.el-message-box__btns .el-button--primary {
   color: #fff;
 
 }