Commit 445456f8 by 李伟康 Committed by chenwq

众筹订单增加导入

1 parent a39a60a7
......@@ -32,7 +32,7 @@
class="default-blue-btn"
:size="size"
type="default"
@click="importVisible = true"
@click="visibleImportDialog(true)"
>导入</el-button>
<el-button
class="default-blue-btn"
......@@ -501,6 +501,7 @@
class="upload-input"
accept=".xlsx, .xls"
@change="e => handleXlsxChange(e)"
ref="uploadInput"
/>
</el-button>
<el-button
......@@ -1690,14 +1691,13 @@ export default {
},
handleXlsxChange (e) {
console.log(e)
var [file] = e.srcElement.files
if(!file) return
let [file] = e.srcElement.files,
reader = new FileReader()
if (!file) return
this.$notify({
title: '提示',
message: '文件上传中,请稍后'
})
var reader = new FileReader()
// 默认1MB
this.file.fileName = file.name
reader.readAsDataURL(file)
......@@ -1706,7 +1706,11 @@ export default {
const arrBase64 = imgFile.split(',')
const splitStr = file.name.split('.')
this.file.fileType = splitStr[splitStr.length - 1] + '@' + arrBase64[1]
console.log(el)
this.$notify({
title: '提示',
message: '图片上传成功',
type: 'success'
})
}
},
......@@ -1718,16 +1722,12 @@ export default {
if (fileType) this.$apis.orderManage.importCrowdFundingOrder({ file: fileType }).then(res => {
console.log(res)
if (res) {
this.importVisible = false
this.$notify({
title: '提示',
message: '订单导入成功',
type: 'success'
})
this.file = {
fileName: '',
fileType: ''
}
this.visibleImportDialog()
this.searchForm.requestSource != 0 ? this.handleSearch() : this.$refs.allOrderRef.refreshTable(false)
}
})
......@@ -1741,6 +1741,15 @@ export default {
alink.download = '订单导入模板.xlsx'
alink.click()
alink.remove()
},
visibleImportDialog (val = false) {
if (this.$refs?.uploadInput) this.$refs.uploadInput.value = null
this.file = {
fileName: '',
fileType: ''
}
this.importVisible = val
}
}
}
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!