diff --git a/jero-web/src/common/lang/en-us.js b/jero-web/src/common/lang/en-us.js index 042cdb86d..d3afd036e 100644 --- a/jero-web/src/common/lang/en-us.js +++ b/jero-web/src/common/lang/en-us.js @@ -568,4 +568,6 @@ module.exports = { searchInResults:'Search in results', searchContent:'Search content', viewFile:'view file', + fileFormatIncorrect:'the file format is incorrect', + } \ No newline at end of file diff --git a/jero-web/src/common/lang/zh-cn.js b/jero-web/src/common/lang/zh-cn.js index dd222bdc5..bae2b8d6a 100644 --- a/jero-web/src/common/lang/zh-cn.js +++ b/jero-web/src/common/lang/zh-cn.js @@ -568,9 +568,11 @@ module.exports = { selectDirectoryTerms:'请选择添加条款的目录位置', OnlyWord:'只能导入word文件', labelAreaDeleted:'若进行删除,则该展示区域下标签项都将被删除', - StandardBreakdown:'标准分解单', searchInResults:'结果中检索', searchContent:'搜索内容', viewFile:'查看文件', + fileFormatIncorrect:'文件格式不正确', + + } \ No newline at end of file diff --git a/jero-web/src/components/SplitImport/index.vue b/jero-web/src/components/SplitImport/index.vue index c5ee46392..242e257b8 100644 --- a/jero-web/src/components/SplitImport/index.vue +++ b/jero-web/src/components/SplitImport/index.vue @@ -101,7 +101,7 @@ const status = info.file.status; info.fileList.forEach((val,index)=>{ if(val.response && !val.response.result){ - this.$message.error(val.response.message); + this.$message.success(val.response.message); info.fileList.splice(index,1) } }) diff --git a/jero-web/src/components/SplitTable/DocTable.vue b/jero-web/src/components/SplitTable/DocTable.vue new file mode 100644 index 000000000..51462cae6 --- /dev/null +++ b/jero-web/src/components/SplitTable/DocTable.vue @@ -0,0 +1,252 @@ + + + + + diff --git a/jero-web/src/components/SplitUpload/index.vue b/jero-web/src/components/SplitUpload/index.vue index a820c4528..a10aa88ad 100644 --- a/jero-web/src/components/SplitUpload/index.vue +++ b/jero-web/src/components/SplitUpload/index.vue @@ -53,6 +53,7 @@ }, mounted() { this.visible=this.splitVisible + console.log('accept11111',this.accept) // console.log(this.thisFileType,this.thisFileSize,this.thisFileUploadUrl); }, methods: { @@ -68,16 +69,24 @@ } }, beforeUpload(file) { - let fileTypes=this.accept.split(',') let fileFlag=false - fileTypes.forEach(item=>{ - if(item==file.type){ - fileFlag=true - } - }) - console.log('filetype',fileFlag) - if(!fileFlag){ - this.$message.warning('文件格式不正确') + console.log('accept',this.accept,file) + // if(this.accept.indexOf(',')!=-1){ + // let fileTypes=this.accept.split(',') + // fileTypes.forEach(item=>{ + // if(item==file.type){ + // fileFlag=true + // } + // }) + // }else{ + // let fileTypes=this.accept.split('/') + // let fileNowTypes=file.type.split('/') + // fileFlag=fileTypes[0]==fileTypes[0]?true:false + // } + + // console.log('filetype',fileFlag) + if(fileFlag){ + this.$message.warning(this.$t('fileFormatIncorrect')) this.fileTypeSatus = false }else{ // let thisFileType = this.thisFileType.replace(/\s+/g, ""); @@ -96,7 +105,7 @@ window.open(url, '_blank') }, handleChange(info) { - // console.log('file',info) + let { file,fileList } = info const status = info.file.status info.fileList.forEach((val, index) => { @@ -154,6 +163,7 @@ this.fileList.push(res) } }) + // console.log('file111111',this.fileList,fileList) this.$emit('uploadSuccess', this.fileList,fileList) // console.log('uplossss',this.fileList,fileList) if (this.myfileList.length > 0) { diff --git a/jero-web/src/views/documentManage/splitting/modules/ImportResult.vue b/jero-web/src/views/documentManage/splitting/modules/ImportResult.vue index d8d35ba54..0bbea9361 100644 --- a/jero-web/src/views/documentManage/splitting/modules/ImportResult.vue +++ b/jero-web/src/views/documentManage/splitting/modules/ImportResult.vue @@ -34,8 +34,10 @@ :wrapper-col="wrapperCol" > + {{form.file}} + {{ (form.file === 'null' || form.file === '' || form.file == null) ? $t('upload1') : $t('viewUploadedFiles') }} @@ -46,7 +48,8 @@ @@ -59,8 +62,11 @@ import { getAction, postAction, deleteAction, downloadFile } from '@/api/manage' import SplitUpload from '@/components/SplitUpload/index' import search from '@/components/search/index' - import TableData from '@/components/OcrTable/DocTable' + import TableData from '@/components/SplitTable/DocTable' + import axios from 'axios' + import { ACCESS_TOKEN } from '@/store/mutation-types' import eventBUs from '../../../../common/event' + import Vue from 'vue' export default { name: 'import', components:{ @@ -123,13 +129,16 @@ spinning:false, //loading标识 type:'', url:{ - tableHeader: 'document/bussDocumentLibraryEO/getHeaderOrConditionForOcr', //表格头部字段 + tableHeader: 'document/bussDocumentLibraryEO/getHeaderOrConditionForSplit', //表格头部字段 seachList: 'document/bussDocumentLibraryEO/getHeaderOrConditionForOcr', //搜索字段 tableList: 'document/bussDocumentLibraryEO/ocrPageInfo', //表格数据 }, OperationList:[], upload1:this.$t('upload1'), - accept:'application/vnd.openxmlformats-officedocument.wordprocessingml.document,application/msword' + // accept:'application/vnd.openxmlformats-officedocument.wordprocessingml.document,application/msword', + accept:'application/zip', + rows:[], + token:Vue.ls.get(ACCESS_TOKEN), } }, props:{ @@ -137,8 +146,8 @@ }, watch:{ 'form.file'(val){ - console.log(val) - } + console.log('val111',val) + }, }, mounted() { @@ -168,6 +177,7 @@ onSelectChange(keys,rows){ console.log('keys',keys,rows) this.selectedRowKeys=keys + this.rows=rows }, //搜索 @@ -202,7 +212,6 @@ data.map(item => { attIdList.push(item.id || data.name) }) - console.log('file',attIdList) // /** 赋值给当前对应的表单文件 */ this.form.file = attIdList.join(',') // console.log('this.form.file',this.form.file) @@ -211,6 +220,53 @@ downLoad(){ let name = this.$t('documentSplitTemplate')+'.xls' downloadFile('split/sarFileSplitItems/exportTemplate',name, {}) + }, + //保存 + handleSubmit(){ + console.log('seleced',this.selectedRowKeys,this.rows) + if(!this.rows){ + this.$message.warning(this.$t('PleaseSelectData')) + }else if(this.rows&&this.rows.length>1){ + this.$message.warning(this.$t('OnlyOneSelected')) + }else if(this.rows&&this.rows.length===1){ + let params={ + connectId:this.rows[0].connect_id, + fileId:this.form.file, + fileName:this.rows[0].file_name, + fileType:this.rows[0].text_info, + serialNumber:this.rows[0].serial_number, + title:this.rows[0].title + } + let formData = new FormData() + Object.keys(params).forEach((key) => { + console.log('key',key,params[key]) + formData.append(key, params[key]); + }); + console.log('formData',params,formData.getAll) + axios({ + url: '/jero-boot/split/sarFileSplitItems/importSplitResult', + method: 'post', + data:formData, + // data: params, + // transformRequest: [function (data) { + // // Do whatever you want to transform the data + // let ret = '' + // for (let it in data) { + // ret += encodeURIComponent(it) + '=' + encodeURIComponent(data[it]) + '&' + // } + // return ret + // }], + headers: { + 'Content-Type': 'multipart/form-data', + // 'Content-Type': 'application/x-www-form-urlencoded', + 'X-Access-Token':this.token + } + }).then(res => { + if (res.data.success) { + + } + }) + } } } } diff --git a/jero-web/src/views/documentManage/splitting/modules/SplitAddForm.vue b/jero-web/src/views/documentManage/splitting/modules/SplitAddForm.vue index 049ee320a..403985d0b 100644 --- a/jero-web/src/views/documentManage/splitting/modules/SplitAddForm.vue +++ b/jero-web/src/views/documentManage/splitting/modules/SplitAddForm.vue @@ -569,9 +569,10 @@ }, mounted() { this.visible=this.addVisible - this.formInline=this.item + // this.formInline=this.item // console.log('form',this.formInline,this.item) this.loadData() + this.loadFormInfo() }, methods:{ loadData(){ @@ -584,6 +585,16 @@ }).finally(()=>{ this.loading=false }) + + }, + //获取表单信息 + loadFormInfo(){ + getAction(`split/sarFileSplitItems/getSplitItemsById`,{id:this.itemId}).then(res=>{ + if(res.success){ + this.formInline=[...res.result] + + } + }) }, afterVisibleChange(){ diff --git a/jero-web/src/views/documentManage/splitting/modules/SplitDetail.vue b/jero-web/src/views/documentManage/splitting/modules/SplitDetail.vue index 1d6ae077d..3cdf74268 100644 --- a/jero-web/src/views/documentManage/splitting/modules/SplitDetail.vue +++ b/jero-web/src/views/documentManage/splitting/modules/SplitDetail.vue @@ -612,6 +612,8 @@ attIdList.push(item.id || data.name) }) this.attId = attIdList.join(',') + this.loadMenuData() + eventBUs.$emit('searchReset') } }, //导出 @@ -664,17 +666,6 @@ }) - - // getAction(`split/sarFileSplitItems/batchMergeItems`, { ids: ids }).then(res => { - // if (res.success) { - // this.$message.success(this.$t('OperationSuccessful')) - // - // } else { - // this.$message.warning(this.$t('operationFailed')) - // } - // }).finally(()=>{ - // this.selectedRowKeys=[] - // }) } }) } @@ -744,19 +735,6 @@ }); - // postAction(`split/sarFileSplitItems/batchDeleteItems`,params).then(res=> { - // if(res.success){ - // this.$message.success(this.$t('OperationSuccessful')) - // // if(this.selecIds.length==this.tableData.length&&this.queryParams.pageNo!=1){ - // // this.queryParams.pageNo=this.queryParams.pageNo-1 - // // } - // // this.loadData() - // this.loadMenuData() - // eventBUs.$emit('searchReset') - // }else{ - // this.$message.warning(this.$t('operationFailed')) - // } - // }) }, onCancel() {}, }); diff --git a/jero-web/src/views/documentManage/splitting/modules/SplitText.vue b/jero-web/src/views/documentManage/splitting/modules/SplitText.vue index f3aa27621..03ce5bf67 100644 --- a/jero-web/src/views/documentManage/splitting/modules/SplitText.vue +++ b/jero-web/src/views/documentManage/splitting/modules/SplitText.vue @@ -12,26 +12,6 @@
- - - - - - - - - - - - - - - - - - - -
@@ -43,21 +23,6 @@ :OperationList="OperationList" @onSelectChange="onSelectChange" /> - - - - - - - - - - - - - - -