|
@@ -290,18 +290,26 @@ export default {
|
|
|
return Array.isArray(data) ? data.reduce((acc, item) => ({ ...acc, [item.label]: item.name }), {}) : {}
|
|
return Array.isArray(data) ? data.reduce((acc, item) => ({ ...acc, [item.label]: item.name }), {}) : {}
|
|
|
},
|
|
},
|
|
|
handleImportTableActionEvent (file, options) {
|
|
handleImportTableActionEvent (file, options) {
|
|
|
|
|
+ let errmessage = ''
|
|
|
IbpsImport.xlsx(file, options).then(({ header, results }) => {
|
|
IbpsImport.xlsx(file, options).then(({ header, results }) => {
|
|
|
- const list = []
|
|
|
|
|
|
|
+ let list = []
|
|
|
const keys = this.getKeys(this.getColumns())
|
|
const keys = this.getKeys(this.getColumns())
|
|
|
- results.forEach(item => {
|
|
|
|
|
|
|
+ results.forEach((item, index) => {
|
|
|
const obj = {}
|
|
const obj = {}
|
|
|
Object.keys(item).forEach(key => {
|
|
Object.keys(item).forEach(key => {
|
|
|
if (keys[key]) {
|
|
if (keys[key]) {
|
|
|
- obj[keys[key]] = item[key].trim()
|
|
|
|
|
|
|
+ obj[keys[key]] = item[key]?.trim()
|
|
|
}
|
|
}
|
|
|
})
|
|
})
|
|
|
|
|
+ if (obj.sfxf !== '是' && obj.sfxf !== '否') {
|
|
|
|
|
+ errmessage = errmessage + ' ' + (index + 1)
|
|
|
|
|
+ }
|
|
|
list.push(obj)
|
|
list.push(obj)
|
|
|
})
|
|
})
|
|
|
|
|
+ if (errmessage) {
|
|
|
|
|
+ list = []
|
|
|
|
|
+ this.$message.warning(`请检查第${errmessage}行是否相符填写格式是否正确! `)
|
|
|
|
|
+ }
|
|
|
const filteredArray = list.map(item => {
|
|
const filteredArray = list.map(item => {
|
|
|
if (item.jyxm && item.fhl && item.jl) {
|
|
if (item.jyxm && item.fhl && item.jl) {
|
|
|
return item
|
|
return item
|