拆分结果保存
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) {
|
||||
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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(){
|
||||
|
||||
|
||||
@@ -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() {},
|
||||
});
|
||||
|
||||
@@ -12,26 +12,6 @@
|
||||
<div class="split-table-content">
|
||||
<div class="split-header">
|
||||
<search :url="url" :flag="'condition'"></search>
|
||||
<!-- <a-form layout="inline" @keyup.enter.native="searchQuery(queryParams)">-->
|
||||
<!-- <a-row :gutter="24">-->
|
||||
<!-- <a-col :md="6" :sm="8">-->
|
||||
<!-- <a-form-item :label="$t('standard')" class="split-item">-->
|
||||
<!-- <j-input :placeholder="$t('enterNumber')" v-model="queryParams.standNumber"></j-input>-->
|
||||
<!-- </a-form-item>-->
|
||||
<!-- </a-col>-->
|
||||
<!-- <a-col :md="6" :sm="8">-->
|
||||
<!-- <a-form-item :label="$t('title')" class="split-item">-->
|
||||
<!-- <j-input :placeholder="$t('enterTitle')" v-model="queryParams.standName"></j-input>-->
|
||||
<!-- </a-form-item>-->
|
||||
<!-- </a-col>-->
|
||||
<!-- <a-col :md="6" :sm="6">-->
|
||||
<!-- <span style="float: left;overflow: hidden;" class="table-page-search-submitButtons">-->
|
||||
<!-- <a-button type="primary" @click="searchQuery" icon="search">{{$t('query')}}</a-button>-->
|
||||
<!-- <a-button @click="searchReset" icon="reload" style="margin-left: 8px">{{$t('reset')}}</a-button>-->
|
||||
<!-- </span>-->
|
||||
<!-- </a-col>-->
|
||||
<!-- </a-row>-->
|
||||
<!-- </a-form>-->
|
||||
</div>
|
||||
</div>
|
||||
<div class="split-table-detail">
|
||||
@@ -43,21 +23,6 @@
|
||||
:OperationList="OperationList"
|
||||
@onSelectChange="onSelectChange"
|
||||
/>
|
||||
<!-- <a-spin :spinning="spinning">-->
|
||||
<!-- <a-table :data-source="tableSource" :columns="columns" :row-selection="{ selectedRowKeys: selectedRowKeys, onChange: onSelectChange }" class="tag-con-table" :pagination="false" >-->
|
||||
<!-- </a-table>-->
|
||||
<!-- </a-spin>-->
|
||||
<!-- <div class="page" v-if="tableSource.length > 0">-->
|
||||
<!-- <a-pagination-->
|
||||
<!-- :show-total="total => $t('total')+` ${total} `+ $t('strip')"-->
|
||||
<!-- show-quick-jumper-->
|
||||
<!-- show-size-changer-->
|
||||
<!-- :page-size.sync="queryParams.pageSize"-->
|
||||
<!-- :total="total"-->
|
||||
<!-- @change="onChangePage"-->
|
||||
<!-- @showSizeChange="SizeChange"-->
|
||||
<!-- />-->
|
||||
<!-- </div>-->
|
||||
</div>
|
||||
<div class="split-footer">
|
||||
<div class="split-footer-wrap">
|
||||
@@ -72,7 +37,7 @@
|
||||
<script>
|
||||
import { getAction, postAction } from '../../../../api/manage'
|
||||
import search from '@/components/search/index'
|
||||
import TableData from '@/components/OcrTable/DocTable'
|
||||
import TableData from '@/components/SplitTable/DocTable'
|
||||
import eventBUs from '../../../../common/event'
|
||||
|
||||
export default {
|
||||
@@ -123,7 +88,7 @@
|
||||
],
|
||||
spinning:false, //loading标识
|
||||
url:{
|
||||
tableHeader: 'document/bussDocumentLibraryEO/getHeaderOrConditionForOcr', //表格头部字段
|
||||
tableHeader: 'document/bussDocumentLibraryEO/getHeaderOrConditionForSplit', //表格头部字段
|
||||
seachList: 'document/bussDocumentLibraryEO/getHeaderOrConditionForOcr', //搜索字段
|
||||
tableList: 'document/bussDocumentLibraryEO/ocrPageInfo', //表格数据
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user