|
@@ -2,20 +2,27 @@
|
|
|
<div>
|
|
|
<crumbs title="药品关联维护" style="min-width: 980px" class="knowledgeTitle">
|
|
|
<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)"
|
|
|
- />
|
|
|
- <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>
|
|
|
+ <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-form-item label="匹配状态:" class="selectMedicine">
|
|
|
<el-select size="mini" v-model="filter.match" placeholder="请选择" clearable>
|
|
|
<el-option v-for="item in matchList" :label="item.name" :value="item.id" :key="item.id"></el-option>
|
|
|
</el-select>
|
|
@@ -23,11 +30,20 @@
|
|
|
<el-form-item label="医院药品名称:">
|
|
|
<el-input size="mini" v-model="filter.hisName" placeholder="请输入" clearable></el-input>
|
|
|
</el-form-item>
|
|
|
+ </el-form>
|
|
|
+ <el-form class="secLine" :inline="true">
|
|
|
+ <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" -->
|
|
|
+ <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>
|
|
|
+ </el-form-item>
|
|
|
<el-form-item label="标准药品名称:">
|
|
|
<el-input size="mini" v-model="filter.uniqueName" placeholder="请输入" clearable></el-input>
|
|
|
</el-form-item>
|
|
|
- </el-form>
|
|
|
- <el-form class="secLine">
|
|
|
<el-form-item>
|
|
|
<el-button size="mini" @click="filterDatas">检索</el-button>
|
|
|
<el-button size="mini" type="warning" @click="addRelation">添加关联</el-button>
|
|
@@ -41,7 +57,21 @@
|
|
|
<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>
|
|
@@ -100,11 +130,23 @@ export default {
|
|
|
{ id: 0, name: '未匹配' },
|
|
|
{ id: 2, name: '多项匹配' }
|
|
|
],
|
|
|
+ statusList: [
|
|
|
+ { id: '', name: '全部' },
|
|
|
+ { id: 1, name: '启用' },
|
|
|
+ { id: 0, name: '禁用' }
|
|
|
+ ],
|
|
|
+ formstatusList: [
|
|
|
+ { id: '', name: '全部' },
|
|
|
+ { id: 1, name: '启用' },
|
|
|
+ { id: 0, name: '禁用' }
|
|
|
+ ],
|
|
|
searched: false,
|
|
|
filter: {
|
|
|
hisName: '', // 医院诊断名称
|
|
|
uniqueName: '', //标准诊断名称
|
|
|
- match:''
|
|
|
+ match: '',
|
|
|
+ status: '',
|
|
|
+ formStatus: ''
|
|
|
},
|
|
|
currentPage: 1,
|
|
|
pageSize: config.pageSize,
|
|
@@ -116,19 +158,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();
|
|
|
});
|
|
|
},
|
|
@@ -149,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);
|
|
@@ -237,7 +284,9 @@ export default {
|
|
|
uniqueName: this.filter.uniqueName.trim(),
|
|
|
uniqueCode: '',
|
|
|
type: 5,
|
|
|
- isMatch:this.filter.match
|
|
|
+ isMatch: this.filter.match,
|
|
|
+ status: this.filter.status,
|
|
|
+ formStatus: this.filter.formStatus
|
|
|
};
|
|
|
return param;
|
|
|
},
|
|
@@ -255,8 +304,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 +322,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 +426,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 +442,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');
|
|
@@ -408,6 +459,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);
|
|
@@ -422,60 +478,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.$confirm(`数据存在异常,导入失败,请修改后再试`, '提示', {
|
|
|
- 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.$confirm(`导入成功`, '提示', {
|
|
|
- confirmButtonText: '确定',
|
|
|
- // cancelButtonText: '取消',
|
|
|
- cancelButtonClass: 'cancelSure',
|
|
|
- confirmButtonClass: 'sure',
|
|
|
- customClass: 'exportConfirm',
|
|
|
- type: 'success'
|
|
|
- })
|
|
|
- .then(() => {})
|
|
|
- .catch(() => {});
|
|
|
- this.getDataList(); // 重新获取列表
|
|
|
- setTimeout(() => {
|
|
|
- this.uploadInfo = '导入';
|
|
|
- }, 300);
|
|
|
- } else {
|
|
|
- this.$confirm(`${res.data.msg}`, '提示', {
|
|
|
- confirmButtonText: '确定',
|
|
|
- // cancelButtonText: '取消',
|
|
|
- cancelButtonClass: 'cancelSure',
|
|
|
- confirmButtonClass: 'sure',
|
|
|
- customClass: 'exportConfirm',
|
|
|
- type: 'warning'
|
|
|
- })
|
|
|
- .then(() => {})
|
|
|
- .catch(() => {});
|
|
|
+ this.importDrugRecord(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.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);
|
|
|
- }
|
|
|
- });
|
|
|
//解决上传相同文件不触发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() {
|
|
|
+ if (this.result) {
|
|
|
+ const code = JSON.parse(this.result);
|
|
|
+ if (code.code === '00020004' || 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 === '00000001') {
|
|
|
+ // this.$confirm(`医院术语字符数超出最大数量,请修改后再试`, '提示', {
|
|
|
+ // 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.$confirm(`导入成功`, '提示', {
|
|
|
+ // confirmButtonText: '确定',
|
|
|
+ // // cancelButtonText: '取消',
|
|
|
+ // cancelButtonClass: 'cancelSure',
|
|
|
+ // confirmButtonClass: 'sure',
|
|
|
+ // customClass: 'exportConfirm',
|
|
|
+ // type: 'success'
|
|
|
+ // })
|
|
|
+ // .then(() => {})
|
|
|
+ // .catch(() => {});
|
|
|
+ // this.getDataList(); // 重新获取列表
|
|
|
+ // setTimeout(() => {
|
|
|
+ // this.uploadInfo = '导入';
|
|
|
+ // }, 300);
|
|
|
+ // } else {
|
|
|
+ // this.$confirm(`${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;
|
|
@@ -550,7 +691,7 @@ export default {
|
|
|
border-bottom: 1px solid #dcdfe6;
|
|
|
}
|
|
|
}
|
|
|
-#upFileMatch{
|
|
|
+#upFileMatch {
|
|
|
display: none;
|
|
|
}
|
|
|
</style>
|