ivus测量值添加导入数据功能
parent
0dcee2c84b
commit
68179f4214
|
@ -209,3 +209,11 @@ export function getIVUSTemplate(param) {
|
||||||
data: param
|
data: param
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
export function uploadIVUSTemplate(param) {
|
||||||
|
return request({
|
||||||
|
url: `/IVUSCalculate/uploadIVUSTemplate`,
|
||||||
|
method: 'post',
|
||||||
|
data: param
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
|
|
@ -49,7 +49,7 @@
|
||||||
<div class="add-icon" @click.prevent="downloadTpl">
|
<div class="add-icon" @click.prevent="downloadTpl">
|
||||||
<i class="el-icon-download" />
|
<i class="el-icon-download" />
|
||||||
</div>
|
</div>
|
||||||
<div class="add-icon" style="margin: 0 5px;">
|
<div class="add-icon" style="margin: 0 5px;" @click.prevent="uploadTpl">
|
||||||
<i class="el-icon-upload2" />
|
<i class="el-icon-upload2" />
|
||||||
</div>
|
</div>
|
||||||
<div class="add-icon" @click.prevent="handleAddOrEdit('add',item)">
|
<div class="add-icon" @click.prevent="handleAddOrEdit('add',item)">
|
||||||
|
@ -198,6 +198,19 @@
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-form>
|
</el-form>
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
|
<!-- 导入 -->
|
||||||
|
<el-dialog
|
||||||
|
v-if="upload.visible"
|
||||||
|
:visible.sync="upload.visible"
|
||||||
|
:close-on-click-modal="false"
|
||||||
|
:title="upload.title"
|
||||||
|
width="500px"
|
||||||
|
>
|
||||||
|
<UploadExcel
|
||||||
|
:visit-task-id="visitTaskId"
|
||||||
|
@close="uploadDlgClose"
|
||||||
|
/>
|
||||||
|
</el-dialog>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
@ -209,11 +222,13 @@ import store from '@/store'
|
||||||
import { mapGetters } from 'vuex'
|
import { mapGetters } from 'vuex'
|
||||||
import Questions from './../Questions'
|
import Questions from './../Questions'
|
||||||
import QuestionTableFormItem from './QuestionTableFormItem'
|
import QuestionTableFormItem from './QuestionTableFormItem'
|
||||||
|
import UploadExcel from './UploadExcel'
|
||||||
export default {
|
export default {
|
||||||
name: 'MeasurementList',
|
name: 'MeasurementList',
|
||||||
components: {
|
components: {
|
||||||
Questions,
|
Questions,
|
||||||
QuestionTableFormItem
|
QuestionTableFormItem,
|
||||||
|
UploadExcel
|
||||||
},
|
},
|
||||||
props: {
|
props: {
|
||||||
isShow: {
|
isShow: {
|
||||||
|
@ -254,6 +269,7 @@ export default {
|
||||||
formChanged: false,
|
formChanged: false,
|
||||||
digitPlaces: 2,
|
digitPlaces: 2,
|
||||||
addOrEdit: { visible: false, title: '' },
|
addOrEdit: { visible: false, title: '' },
|
||||||
|
upload: { visible: false, title: '导入' },
|
||||||
qsList: [],
|
qsList: [],
|
||||||
answersList: [],
|
answersList: [],
|
||||||
qsForm: {},
|
qsForm: {},
|
||||||
|
@ -669,6 +685,9 @@ export default {
|
||||||
console.log(e)
|
console.log(e)
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
uploadTpl() {
|
||||||
|
this.upload.visible = true
|
||||||
|
},
|
||||||
async downloadTpl() {
|
async downloadTpl() {
|
||||||
try {
|
try {
|
||||||
const params = {
|
const params = {
|
||||||
|
@ -679,6 +698,11 @@ export default {
|
||||||
console.log(e)
|
console.log(e)
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
async uploadDlgClose() {
|
||||||
|
await this.getReadingQuestionAndAnswer(this.visitTaskId)
|
||||||
|
DicomEvent.$emit('getReportInfo', true)
|
||||||
|
this.upload.visible = false
|
||||||
|
},
|
||||||
renderHeader(h, { column, $index }) {
|
renderHeader(h, { column, $index }) {
|
||||||
const span = document.createElement('span')
|
const span = document.createElement('span')
|
||||||
span.innerText = column.label
|
span.innerText = column.label
|
||||||
|
|
|
@ -0,0 +1,117 @@
|
||||||
|
<template>
|
||||||
|
<el-form
|
||||||
|
ref="uploadExcel"
|
||||||
|
class="upload-excel-file"
|
||||||
|
>
|
||||||
|
<!-- 文件 -->
|
||||||
|
<el-form-item :label="$t('trials:consistencyCheck:label:file')">
|
||||||
|
<div class="upload-container">
|
||||||
|
<el-upload
|
||||||
|
class="upload-demo"
|
||||||
|
action
|
||||||
|
accept=".xlsx,.xls,.csv"
|
||||||
|
:before-upload="beforeUpload"
|
||||||
|
:http-request="handleUploadFile"
|
||||||
|
:on-preview="handlePreview"
|
||||||
|
:show-file-list="true"
|
||||||
|
:limit="1"
|
||||||
|
:on-exceed="handleExceed"
|
||||||
|
>
|
||||||
|
<el-button size="small" type="primary">
|
||||||
|
{{ $t('trials:consistencyCheck:dialogButton:upload') }}
|
||||||
|
</el-button>
|
||||||
|
<span
|
||||||
|
slot="tip"
|
||||||
|
style="margin-left:10px;"
|
||||||
|
class="el-upload__tip"
|
||||||
|
>
|
||||||
|
({{ $t('trials:consistencyCheck:message:excelFileOnly') }})
|
||||||
|
</span>
|
||||||
|
</el-upload>
|
||||||
|
</div>
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
|
</template>
|
||||||
|
<script>
|
||||||
|
import { uploadIVUSTemplate } from '@/api/reading'
|
||||||
|
export default {
|
||||||
|
props: {
|
||||||
|
visitTaskId: {
|
||||||
|
type: String,
|
||||||
|
required: true
|
||||||
|
}
|
||||||
|
},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
}
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
beforeUpload(file) {
|
||||||
|
// 检测文件类型是否符合要求
|
||||||
|
if (this.checkFileSuffix(file.name)) {
|
||||||
|
return true
|
||||||
|
} else {
|
||||||
|
// Must be xls or xlsx format
|
||||||
|
this.$alert(this.$t('trials:consistencyCheck:message:xlsx'))
|
||||||
|
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
},
|
||||||
|
async handleUploadFile(param) {
|
||||||
|
const loading = this.$loading({ fullscreen: true })
|
||||||
|
try {
|
||||||
|
var data = new FormData()
|
||||||
|
data.append('file', param.file)
|
||||||
|
data.append('visitTaskId', this.visitTaskId)
|
||||||
|
await uploadIVUSTemplate(data)
|
||||||
|
this.$emit('close')
|
||||||
|
this.$message.success('导入成功!')
|
||||||
|
loading.close()
|
||||||
|
} catch (e) {
|
||||||
|
loading.close()
|
||||||
|
console.log(e)
|
||||||
|
}
|
||||||
|
},
|
||||||
|
handlePreview(file) {
|
||||||
|
if (file.fullPath) {
|
||||||
|
window.open(file.fullPath, '_blank')
|
||||||
|
}
|
||||||
|
},
|
||||||
|
handleExceed(files, fileList) {
|
||||||
|
// Upload is currently limited to 1 file
|
||||||
|
this.$message.warning(this.$t('trials:consistencyCheck:message:onlyOneFile'))
|
||||||
|
},
|
||||||
|
checkFileSuffix(fileName) {
|
||||||
|
var typeArr = ['xls', 'xlsx', 'csv']
|
||||||
|
var extendName = fileName.substring(fileName.lastIndexOf('.') + 1).toLocaleLowerCase()
|
||||||
|
if (typeArr.indexOf(extendName) !== -1) {
|
||||||
|
return true
|
||||||
|
} else {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="scss">
|
||||||
|
.upload-excel-file{
|
||||||
|
.upload-container .el-upload--text {
|
||||||
|
border: none;
|
||||||
|
width: 80px;
|
||||||
|
height: 40px;
|
||||||
|
}
|
||||||
|
.upload-container .el-input--small {
|
||||||
|
margin-bottom: 5px;
|
||||||
|
}
|
||||||
|
.upload-container .el-icon-circle-check {
|
||||||
|
color: #428bca;
|
||||||
|
font-size: 13px;
|
||||||
|
}
|
||||||
|
.account_item_clear{
|
||||||
|
.el-tag__close{
|
||||||
|
display: none !important;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
Loading…
Reference in New Issue