|
@ -79,7 +79,7 @@ |
|
|
</el-select> |
|
|
</el-select> |
|
|
<el-upload :show-file-list="false" v-model="fileOriData" :before-upload="beforeAvatarUpload" |
|
|
<el-upload :show-file-list="false" v-model="fileOriData" :before-upload="beforeAvatarUpload" |
|
|
:http-request="successSubmit" accept=".xls,.xlsx,.csv" |
|
|
:http-request="successSubmit" accept=".xls,.xlsx,.csv" |
|
|
style="display: inline-block;position: relative;top: 3px;left: 12px;margin-right: 24px;"> |
|
|
style="display: inline-block;position: relative;top: 3px;left: 12px;margin-right: 24px;" multiple> |
|
|
<el-button type="success" size="large"> |
|
|
<el-button type="success" size="large"> |
|
|
<el-icon> |
|
|
<el-icon> |
|
|
<Upload /> |
|
|
<Upload /> |
|
@ -91,7 +91,9 @@ |
|
|
<template #footer> |
|
|
<template #footer> |
|
|
<div> |
|
|
<div> |
|
|
<el-button @click="cancelDialog">取消</el-button> |
|
|
<el-button @click="cancelDialog">取消</el-button> |
|
|
<el-button type="primary" @click="submitImport"> 确认 </el-button> |
|
|
<el-button type="primary" @click="submitImport" :disabled="importCount === 0"> |
|
|
|
|
|
确认({{ importCount }}) |
|
|
|
|
|
</el-button> |
|
|
</div> |
|
|
</div> |
|
|
</template> |
|
|
</template> |
|
|
</el-dialog> |
|
|
</el-dialog> |
|
@ -268,10 +270,13 @@ export default { |
|
|
tableName: "", |
|
|
tableName: "", |
|
|
loading: false, |
|
|
loading: false, |
|
|
fileOriData: null, |
|
|
fileOriData: null, |
|
|
|
|
|
importCount: 0, |
|
|
} |
|
|
} |
|
|
}, |
|
|
}, |
|
|
methods: { |
|
|
methods: { |
|
|
openImport() { |
|
|
openImport() { |
|
|
|
|
|
this.importCount = 0 |
|
|
|
|
|
this.fileData = [] |
|
|
this.importShow = true |
|
|
this.importShow = true |
|
|
}, |
|
|
}, |
|
|
beforeAvatarUpload(rawFile) { |
|
|
beforeAvatarUpload(rawFile) { |
|
@ -291,14 +296,13 @@ export default { |
|
|
let file = opts.file |
|
|
let file = opts.file |
|
|
this.fileDealData = [] |
|
|
this.fileDealData = [] |
|
|
let fileReader = new FileReader() |
|
|
let fileReader = new FileReader() |
|
|
|
|
|
|
|
|
fileReader.onload = async function (e) { |
|
|
fileReader.onload = async function (e) { |
|
|
let data = this.result |
|
|
let data = this.result |
|
|
let workbook = XLSX.read(data, { type: 'binary' }) |
|
|
let workbook = XLSX.read(data, { type: 'binary' }) |
|
|
let sheetName = workbook.SheetNames[0] |
|
|
let sheetName = workbook.SheetNames[0] |
|
|
let sheetData = XLSX.utils.sheet_to_json(workbook.Sheets[sheetName]) |
|
|
let sheetData = XLSX.utils.sheet_to_json(workbook.Sheets[sheetName]) |
|
|
that.fileData = _.cloneDeep(sheetData) |
|
|
that.fileData = _.concat(that.fileData, sheetData) |
|
|
|
|
|
that.importCount++ |
|
|
} |
|
|
} |
|
|
fileReader.onerror = function (error) { |
|
|
fileReader.onerror = function (error) { |
|
|
ElMessage({ |
|
|
ElMessage({ |
|
@ -363,11 +367,12 @@ export default { |
|
|
async pageChange({ pageSize, currentPage }) { |
|
|
async pageChange({ pageSize, currentPage }) { |
|
|
this.pageVO.currentPage = currentPage |
|
|
this.pageVO.currentPage = currentPage |
|
|
this.pageVO.pageSize = pageSize |
|
|
this.pageVO.pageSize = pageSize |
|
|
console.log(186, this.pageVO); |
|
|
|
|
|
await this.updateSeach() |
|
|
await this.updateSeach() |
|
|
}, |
|
|
}, |
|
|
//关闭模态框 |
|
|
//关闭模态框 |
|
|
cancelDialog() { |
|
|
cancelDialog() { |
|
|
|
|
|
this.importCount = 0 |
|
|
|
|
|
this.fileData = [] |
|
|
this.importShow = false |
|
|
this.importShow = false |
|
|
this.dialogFrom = { |
|
|
this.dialogFrom = { |
|
|
visible: false, |
|
|
visible: false, |
|
|