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,6 +636,11 @@ export default {
reader.onload = function () {
const reg = /\<ysxt_asjxgrybh\>(.*?)\<\/ysxt_asjxgrybh\>/g
let barcode = this.result.match(reg)
if (barcode == null) {
newlist = []
fileList.pop()
that.$message.error('请检查所选类型和文件类型是否一致')
} else {
console.log(barcode, '多人文件')
let sonBarcode = [];
for (let i = 0; i < barcode.length; i++) {
......@@ -658,11 +663,17 @@ export default {
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)
if (barcode == null) {
newlist = []
fileList.pop()
that.$message.error('请检查所选类型和文件类型是否一致')
} else {
let sonBarcode = []
for (let i = 0; i < barcode.length; i++) {
let newBarcode = null
......@@ -676,9 +687,9 @@ export default {
sonBarcodeOlny.barcode = newBarcode[1]
sonBarcode.push(sonBarcodeOlny)
}
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)
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