Commit b9c8c879 by 米嘉伟

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

parent 7374a216
...@@ -612,7 +612,7 @@ export default { ...@@ -612,7 +612,7 @@ export default {
// }, 200) // }, 200)
重复文件过滤 // 重复文件过滤
let existFile = fileList.slice(0, fileList.length - 1).find(f => f.name === file.name) let existFile = fileList.slice(0, fileList.length - 1).find(f => f.name === file.name)
if (existFile) { if (existFile) {
this.$message.error('当前文件已经存在!'); this.$message.error('当前文件已经存在!');
...@@ -636,6 +636,11 @@ export default { ...@@ -636,6 +636,11 @@ export default {
reader.onload = function () { reader.onload = function () {
const reg = /\<ysxt_asjxgrybh\>(.*?)\<\/ysxt_asjxgrybh\>/g const reg = /\<ysxt_asjxgrybh\>(.*?)\<\/ysxt_asjxgrybh\>/g
let barcode = this.result.match(reg) let barcode = this.result.match(reg)
if (barcode == null) {
newlist = []
fileList.pop()
that.$message.error('请检查所选类型和文件类型是否一致')
} else {
console.log(barcode, '多人文件') console.log(barcode, '多人文件')
let sonBarcode = []; let sonBarcode = [];
for (let i = 0; i < barcode.length; i++) { for (let i = 0; i < barcode.length; i++) {
...@@ -658,11 +663,17 @@ export default { ...@@ -658,11 +663,17 @@ export default {
that.$set(newlist[i], 'sonBarcode', sonBarcode) that.$set(newlist[i], 'sonBarcode', sonBarcode)
console.log(newlist[i], 'ajdhsajgguifhh 内序') console.log(newlist[i], 'ajdhsajgguifhh 内序')
} }
}
} else if (this.drlx == 6) { // 案件 } else if (this.drlx == 6) { // 案件
that.action = '/api/upload/case' that.action = '/api/upload/case'
reader.onload = function () { reader.onload = function () {
const reg = /\<ysxt_asjbh\>(.*?)\<\/ysxt_asjbh\>/g const reg = /\<ysxt_asjbh\>(.*?)\<\/ysxt_asjbh\>/g
let barcode = this.result.match(reg) let barcode = this.result.match(reg)
if (barcode == null) {
newlist = []
fileList.pop()
that.$message.error('请检查所选类型和文件类型是否一致')
} else {
let sonBarcode = [] let sonBarcode = []
for (let i = 0; i < barcode.length; i++) { for (let i = 0; i < barcode.length; i++) {
let newBarcode = null let newBarcode = null
...@@ -676,9 +687,9 @@ export default { ...@@ -676,9 +687,9 @@ export default {
sonBarcodeOlny.barcode = newBarcode[1] sonBarcodeOlny.barcode = newBarcode[1]
sonBarcode.push(sonBarcodeOlny) sonBarcode.push(sonBarcodeOlny)
} }
that.$set(newlist[i], 'wjxh', i + 1) that.$set(newlist[i], 'wjxh', i + 1)
that.$set(newlist[i], 'sonBarcode', sonBarcode) that.$set(newlist[i], 'sonBarcode', sonBarcode)
}
// that.$set(newlist[i], 'barcode', barcode[1]) // that.$set(newlist[i], 'barcode', barcode[1])
} }
} else if (this.drlx == 9) { // 比中关系 } else if (this.drlx == 9) { // 比中关系
...@@ -772,9 +783,11 @@ export default { ...@@ -772,9 +783,11 @@ export default {
} }
} }
} }
console.log('newlist', newlist) setTimeout(() => {
this.datas = newlist; this.datas = newlist;
console.log('newlist', newlist)
console.log('datas', this.datas) console.log('datas', this.datas)
}, 100)
}, },
// 提交前钩子函数 // 提交前钩子函数
beforeUpload () { 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