拆分详情增加

This commit is contained in:
caoyang
2022-03-30 15:57:45 +08:00
parent 33326162f9
commit d3696b6567
10 changed files with 485 additions and 175 deletions
@@ -11,48 +11,57 @@
>
<div class="split-table-content">
<div class="split-header">
<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>
<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">
<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>
<tableData
:flag="'header'"
:url="url"
:type="type"
:showAction="false"
: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">
<a-button class="split-btn split-chai" type="primary">{{$t('split')}}</a-button>
<a-button class="split-btn split-chai" type="primary" @click="submitSplit">{{$t('split')}}</a-button>
<a-button class="split-btn" type="primary" @click="cancelSplit">{{$t('cancel')}}</a-button>
</div>
</div>
@@ -61,21 +70,21 @@
</template>
<script>
import { getAction } from '../../../../api/manage'
import { getAction, postAction } from '../../../../api/manage'
import search from '@/components/search/index'
import TableData from '@/components/OcrTable/DocTable'
import eventBUs from '../../../../common/event'
export default {
name: 'split',
components:{
search,
TableData,
},
data(){
return{
visible:false,
tableSource:[
{
standNumber:'aaaa',
standName:'11111',
fileName:'234323',
fileType_dictText:'ewre',
}
], //列表数据
tableSource:[], //列表数据
selectedRowKeys:[],
queryParams:{
pageNo:1,
@@ -113,10 +122,21 @@
},
],
spinning:false, //loading标识
url:{
tableHeader: 'document/bussDocumentLibraryEO/getHeaderOrConditionForOcr', //表格头部字段
seachList: 'document/bussDocumentLibraryEO/getHeaderOrConditionForOcr', //搜索字段
tableList: 'document/bussDocumentLibraryEO/ocrPageInfo', //表格数据
},
type:'doc',
OperationList:[]
}
},
props:{
splitVisible:Boolean
splitVisible:{
type:Boolean,
default:false
},
},
mounted() {
this.visible=this.splitVisible
@@ -142,8 +162,14 @@
this.visible = false;
this.$emit('visible',false)
},
onSelectChange(keys){
onSelectChange(keys,rows){
this.selectedRowKeys=keys
if(keys.length>1){
this.$message.warning(this.$t('OnlyOneSelected'))
}else{
this.rowId=keys[0]
}
this.rows=[...rows]
},
//搜索
@@ -167,6 +193,54 @@
},
cancelSplit(){
this.$emit('visible',false)
},
//拆分
submitSplit(){
if(this.rows&&this.rows.length>1){
this.$message.warning(this.$t('OnlyOneSelected'))
}else if(this.rows==undefined||this.rows.length===0){
this.$message.warning(this.$t('selectLeastOne'))
}else if(this.rows&&this.rows.length==1) {
let file = this.rows[0]
if (file.file_name) {
let name = file.file_name.split('.')
let nameSuffix = name[name.length - 1]
if (nameSuffix.toLowerCase() === 'doc'||nameSuffix.toLowerCase() === 'docx') {
let params = {
attId: file.id,
standName: file.title,
standNumber: file.serial_number,
connectId: file.connect_id
}
if (file.text_info == '发布稿(必读)') {
params.fileType = '1'
} else if (file.text_info == '增补件(必读)') {
params.fileType = '2'
} else if (file.text_info == '报批稿') {
params.fileType = '3'
} else if (file.text_info == '征求意见稿') {
params.fileType = '4'
} else if (file.text_info == '测试程序') {
params.fileType = '5'
} else if (file.text_info == '相关资料') {
params.fileType = '6'
}
postAction(`split/sarFileSplitInfo/add`, params).then(res => {
if (res.success) {
this.$message.success(this.$t('OperationSuccessful'))
eventBUs.$emit('searchReset')
this.visible = false;
this.$emit('visible', false)
} else {
this.$message.warning(this.$t('operationFailed'))
}
})
// this.$emit('exportVisible',true)
} else {
this.$message.warning(this.$t('OnlyPDF'))
}
}
}
}
}
@@ -180,6 +254,7 @@
.split-item{
display: flex;
}
}
}
@@ -199,4 +274,13 @@
}
}
</style>
<style lang="less">
.split-table-content {
.split-header {
.ant-col-sm-24{
display: flex;
}
}
}
</style>