|
@@ -6,6 +6,8 @@
|
|
|
<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="importPage">{{uploadInfo}}</el-button>
|
|
|
+ <input type="file" name="uploadfile " id="upFileMatch" @change="uploadFileMatch($event)" />
|
|
|
+ <el-button size="mini" @click="handleMatchData" style="marginLeft: 10px">预匹配</el-button>
|
|
|
<el-button size="mini" @click="exportData">导出</el-button>
|
|
|
</el-form-item>
|
|
|
<el-form-item label class="selectMedicine">
|
|
@@ -134,6 +136,56 @@ export default {
|
|
|
});
|
|
|
},
|
|
|
methods: {
|
|
|
+ // 预匹配
|
|
|
+ handleMatchData() {
|
|
|
+ let inp = document.getElementById('upFileMatch');
|
|
|
+ inp.click();
|
|
|
+ },
|
|
|
+ // 导入数据
|
|
|
+ uploadFileMatch(e) {
|
|
|
+ let fileInfo = e.target.files[0];
|
|
|
+ e.preventDefault();
|
|
|
+ let formData = new FormData();
|
|
|
+ formData.append('file', fileInfo);
|
|
|
+ formData.append('type', 10);
|
|
|
+ const header = {
|
|
|
+ headers: {
|
|
|
+ 'Content-Type': 'multipart/form-data'
|
|
|
+ }
|
|
|
+ };
|
|
|
+ const loading = this.$loading({
|
|
|
+ lock: true,
|
|
|
+ text: '预匹配中...',
|
|
|
+ spinner: 'el-icon-loading',
|
|
|
+ background: 'rgba(0, 0, 0, 0.7)'
|
|
|
+ });
|
|
|
+ api.dataDiseaseVerify(formData, header).then(res => {
|
|
|
+ if (res.data.code === '00020007') {
|
|
|
+ loading.close();
|
|
|
+ this.$alert(`${res.data.msg}`, '提示', {
|
|
|
+ confirmButtonText: '确定',
|
|
|
+ type: 'warning'
|
|
|
+ })
|
|
|
+ .then(() => {})
|
|
|
+ .catch(() => {});
|
|
|
+ } else {
|
|
|
+ api.precDiseaseDataMatch(formData, header).then(res => {
|
|
|
+ setTimeout(() => {
|
|
|
+ loading.close();
|
|
|
+ }, 800);
|
|
|
+ if (res.status === 200) {
|
|
|
+ utils.downloadExportedData(
|
|
|
+ res.data,
|
|
|
+ '诊断关联数据(预匹配).xls'
|
|
|
+ );
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
+ });
|
|
|
+
|
|
|
+ let inp = document.getElementById('upFileMatch');
|
|
|
+ inp.value = '';
|
|
|
+ },
|
|
|
handleSizeChange(val) {
|
|
|
this.pageSize = val;
|
|
|
this.currentPage = utils.getCurrentPage(
|
|
@@ -492,4 +544,7 @@ export default {
|
|
|
border-bottom: 1px solid #dcdfe6;
|
|
|
}
|
|
|
}
|
|
|
+#upFileMatch{
|
|
|
+ display: none;
|
|
|
+}
|
|
|
</style>
|