Commit b9c8c879 by 米嘉伟

人员,案件导入文件类型校验

parent 7374a216
......@@ -612,7 +612,7 @@ export default {
// }, 200)
重复文件过滤
// 重复文件过滤
let existFile = fileList.slice(0, fileList.length - 1).find(f => f.name === file.name)
if (existFile) {
this.$message.error('当前文件已经存在!');
......@@ -636,49 +636,60 @@ export default {
reader.onload = function () {
const reg = /\<ysxt_asjxgrybh\>(.*?)\<\/ysxt_asjxgrybh\>/g
let barcode = this.result.match(reg)
console.log(barcode, '多人文件')
let sonBarcode = [];
for (let i = 0; i < barcode.length; i++) {
let newBarcode = null
let sonBarcodeOlny = {
nx: '', // 内序
barcode: '', // 条码号
if (barcode == null) {
newlist = []
fileList.pop()
that.$message.error('请检查所选类型和文件类型是否一致')
} else {
console.log(barcode, '多人文件')
let sonBarcode = [];
for (let i = 0; i < barcode.length; i++) {
let newBarcode = null
let sonBarcodeOlny = {
nx: '', // 内序
barcode: '', // 条码号
}
const reg1 = /\<ysxt_asjxgrybh\>(.*?)\<\/ysxt_asjxgrybh\>/
newBarcode = barcode[i].match(reg1)
console.log(newBarcode, '单条')
sonBarcodeOlny.nx = (i + 1)
sonBarcodeOlny.barcode = newBarcode[1]
sonBarcode.push(sonBarcodeOlny)
// that.$set(newlist[i], 'nx', i + 1)
// that.$set(newlist[i], 'barcode', newBarcode[1])
}
const reg1 = /\<ysxt_asjxgrybh\>(.*?)\<\/ysxt_asjxgrybh\>/
newBarcode = barcode[i].match(reg1)
console.log(newBarcode, '单条')
sonBarcodeOlny.nx = (i + 1)
sonBarcodeOlny.barcode = newBarcode[1]
sonBarcode.push(sonBarcodeOlny)
// that.$set(newlist[i], 'nx', i + 1)
// that.$set(newlist[i], 'barcode', newBarcode[1])
// that.$set(newlist[i], 'barcode', barcode[1])
that.$set(newlist[i], 'wjxh', i + 1)
that.$set(newlist[i], 'sonBarcode', sonBarcode)
console.log(newlist[i], 'ajdhsajgguifhh 内序')
}
// that.$set(newlist[i], 'barcode', barcode[1])
that.$set(newlist[i], 'wjxh', i + 1)
that.$set(newlist[i], 'sonBarcode', sonBarcode)
console.log(newlist[i], 'ajdhsajgguifhh 内序')
}
} else if (this.drlx == 6) { // 案件
that.action = '/api/upload/case'
reader.onload = function () {
const reg = /\<ysxt_asjbh\>(.*?)\<\/ysxt_asjbh\>/g
let barcode = this.result.match(reg)
let sonBarcode = []
for (let i = 0; i < barcode.length; i++) {
let newBarcode = null
let sonBarcodeOlny = {
nx: '',//内序
barcode: '',// 条码号
if (barcode == null) {
newlist = []
fileList.pop()
that.$message.error('请检查所选类型和文件类型是否一致')
} else {
let sonBarcode = []
for (let i = 0; i < barcode.length; i++) {
let newBarcode = null
let sonBarcodeOlny = {
nx: '',//内序
barcode: '',// 条码号
}
const reg1 = /\<ysxt_asjbh\>(.*?)\<\/ysxt_asjbh\>/
newBarcode = barcode[i].match(reg1)
sonBarcodeOlny.nx = (i + 1)
sonBarcodeOlny.barcode = newBarcode[1]
sonBarcode.push(sonBarcodeOlny)
}
const reg1 = /\<ysxt_asjbh\>(.*?)\<\/ysxt_asjbh\>/
newBarcode = barcode[i].match(reg1)
sonBarcodeOlny.nx = (i + 1)
sonBarcodeOlny.barcode = newBarcode[1]
sonBarcode.push(sonBarcodeOlny)
that.$set(newlist[i], 'wjxh', i + 1)
that.$set(newlist[i], 'sonBarcode', sonBarcode)
}
that.$set(newlist[i], 'wjxh', i + 1)
that.$set(newlist[i], 'sonBarcode', sonBarcode)
// that.$set(newlist[i], 'barcode', barcode[1])
}
} else if (this.drlx == 9) { // 比中关系
......@@ -772,9 +783,11 @@ export default {
}
}
}
console.log('newlist', newlist)
this.datas = newlist;
console.log('datas', this.datas)
setTimeout(() => {
this.datas = newlist;
console.log('newlist', newlist)
console.log('datas', this.datas)
}, 100)
},
// 提交前钩子函数
beforeUpload () {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment