拆分结果保存
This commit is contained in:
@@ -34,8 +34,10 @@
|
||||
:wrapper-col="wrapperCol"
|
||||
>
|
||||
<a-form-model-item ref="file" :label="$t('splitFile')" prop="file">
|
||||
{{form.file}}
|
||||
<a-button type="primary" class="button-text"
|
||||
@click="fileUpload()">
|
||||
|
||||
{{ (form.file === 'null' || form.file === '' ||
|
||||
form.file == null) ? $t('upload1') : $t('viewUploadedFiles')
|
||||
}}
|
||||
@@ -46,7 +48,8 @@
|
||||
</div>
|
||||
<div class="imports-footer">
|
||||
<div class="imports-footer-wrap">
|
||||
<a-button class="imports-btn imports-chai" type="primary">{{$t('preservation')}}</a-button>
|
||||
<!-- <uploadFile ref="uploadFile" :accept="accept" :disabled="disabled" @uploadSuccess="uploadSuccess"></uploadFile>-->
|
||||
<a-button class="imports-btn imports-chai" type="primary" @click="handleSubmit">{{$t('preservation')}}</a-button>
|
||||
<a-button class="imports-btn" type="primary" @click="cancleImports">{{$t('cancel')}}</a-button>
|
||||
</div>
|
||||
</div>
|
||||
@@ -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) {
|
||||
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user