Compare commits
No commits in common. "06c56889d04fc1942fec899360d9da089a95de2c" and "2b5ee56e6b73a315509cca4d7e6c1a0a54250b82" have entirely different histories.
06c56889d0
...
2b5ee56e6b
|
@ -209,11 +209,3 @@ 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;" @click.prevent="uploadTpl">
|
<div class="add-icon" style="margin: 0 5px;">
|
||||||
<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,19 +198,6 @@
|
||||||
</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>
|
||||||
|
@ -222,13 +209,11 @@ 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: {
|
||||||
|
@ -269,7 +254,6 @@ 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: {},
|
||||||
|
@ -685,9 +669,6 @@ export default {
|
||||||
console.log(e)
|
console.log(e)
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
uploadTpl() {
|
|
||||||
this.upload.visible = true
|
|
||||||
},
|
|
||||||
async downloadTpl() {
|
async downloadTpl() {
|
||||||
try {
|
try {
|
||||||
const params = {
|
const params = {
|
||||||
|
@ -698,11 +679,6 @@ 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
|
||||||
|
|
|
@ -1,117 +0,0 @@
|
||||||
<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