272 lines
8.9 KiB
Vue
272 lines
8.9 KiB
Vue
<template>
|
|
<a-drawer
|
|
:title="$t('docTool.split.splitText')"
|
|
placement="right"
|
|
:visible="visible"
|
|
@close="onClose"
|
|
width="1100"
|
|
class="custom-drawer-style">
|
|
<div class="custom-drawer-style-scroll">
|
|
<div class="table-page-search-wrapper">
|
|
<a-form layout="inline" @keyup.enter.native="searchQuery" :labelCol="labelCol" :wrapperCol="wrapperCol">
|
|
<a-row :gutter="24">
|
|
<!--来源-->
|
|
<a-col :md="8" :sm="12">
|
|
<a-form-item :label="$t('standardSelect.source')">
|
|
<j-dict-select-tag
|
|
class="box-input"
|
|
v-model="queryParam.origin"
|
|
:placeholder="$t('pleaseSelect') + $t('standardSelect.source')"
|
|
:type="'select'"
|
|
:triggerChange="false"
|
|
@change="sourceChange"
|
|
:dictCode="'split_standard_source'" />
|
|
</a-form-item>
|
|
</a-col>
|
|
<!--标准号-->
|
|
<a-col :md="8" :sm="12">
|
|
<a-form-item :label="$t('standardSelect.standardNumber')">
|
|
<a-input :placeholder="$t('pleaseEnter') + $t('standardSelect.standardNumber')"
|
|
v-model="queryParam.standardNumber"></a-input>
|
|
</a-form-item>
|
|
</a-col>
|
|
<!--标准名称-->
|
|
<a-col :md="8" :sm="12">
|
|
<a-form-item :label="$t('standardSelect.standardName')">
|
|
<a-input :placeholder="$t('pleaseEnter') + $t('standardSelect.standardName')"
|
|
v-model="queryParam.standardName"></a-input>
|
|
</a-form-item>
|
|
</a-col>
|
|
<!--文本状态-->
|
|
<a-col :md="8" :sm="12">
|
|
<a-form-item :label="$t('docTool.comparison.textStatus')">
|
|
<j-dict-select-tag
|
|
class="box-input"
|
|
v-model="queryParam.standardFileType"
|
|
:placeholder="$t('pleaseSelect') + $t('docTool.comparison.textStatus')"
|
|
:type="'select'"
|
|
:triggerChange="false"
|
|
:dictCode="'process_manuscript'" />
|
|
</a-form-item>
|
|
</a-col>
|
|
<!--标准拆分状态-->
|
|
<a-col :md="8" :sm="12">
|
|
<a-form-item :label="$t('docTool.comparison.standardSplitStatus')">
|
|
<j-dict-select-tag
|
|
class="box-input"
|
|
v-model="queryParam.standardSplitStatus"
|
|
:placeholder="$t('pleaseSelect') + $t('docTool.comparison.standardSplitStatus')"
|
|
:type="'select'"
|
|
:triggerChange="false"
|
|
:dictCode="'standard_split_status'" />
|
|
</a-form-item>
|
|
</a-col>
|
|
<!--主起草部门-->
|
|
<a-col v-if="queryParam.origin === SplitStandardSource.ENTERPRISE.value" :md="8" :sm="12">
|
|
<a-form-item :label="$t('docTool.comparison.chiefDraftingDepartment')">
|
|
<j-select-depart
|
|
class="box-input"
|
|
v-model="queryParam.esMainDraftUnit"
|
|
:placeholder="$t('pleaseSelect') + $t('docTool.comparison.chiefDraftingDepartment')"
|
|
:multi="true"
|
|
:backDepart="true"
|
|
:treeOpera="true" />
|
|
</a-form-item>
|
|
</a-col>
|
|
</a-row>
|
|
</a-form>
|
|
<div class="table-page-search-submitButtons">
|
|
<a-button type="primary" @click="searchQuery" icon="search">
|
|
{{ $t('query') }}
|
|
</a-button>
|
|
<a-button type="primary" @click="searchReset" icon="reload" ghost style="margin-left: 8px">{{ $t('reset') }}</a-button>
|
|
</div>
|
|
</div>
|
|
<j-table
|
|
:columns="columns"
|
|
:dataSource="dataSource"
|
|
:can-drag="true"
|
|
rowKey="id"
|
|
:loading="loading"
|
|
:scroll="{x: '100%'}"
|
|
:row-selection="{ selectedRowKeys: selectedRowKeys, onChange: onSelectChange, type: 'checkbox' }"
|
|
:pagination="ipagination"
|
|
@change="handleTableChange">
|
|
</j-table>
|
|
</div>
|
|
<div class="custom-drawer-style-bottom-btn">
|
|
<a-button @click="cancelSplit" style='margin-right: 15px'>{{ $t('cancel') }}</a-button>
|
|
<a-button type="primary" :loading="loading" @click="submitSplit">{{ $t('docTool.split.split') }}</a-button>
|
|
</div>
|
|
</a-drawer>
|
|
</template>
|
|
|
|
<script>
|
|
import JTable from '../../../../components/jero/JTable.vue'
|
|
import { JeroListMixin } from '../../../../mixins/JeroListMixin.js'
|
|
import { addDocSplit } from '../../../../api/documentToolApi.js'
|
|
import { SplitStandardSource } from '../../../../enums/commonEnums'
|
|
import JSelectDepart from '../../../../components/jerobiz/JSelectDepart'
|
|
import { postAction } from '../../../../api/manage'
|
|
|
|
export default {
|
|
name: 'SplitText',
|
|
components: { JTable, JSelectDepart },
|
|
mixins: [JeroListMixin],
|
|
data () {
|
|
return {
|
|
SplitStandardSource,
|
|
visible: false,
|
|
loading: false,
|
|
labelCol: {
|
|
span: 6
|
|
},
|
|
wrapperCol: {
|
|
span: 14
|
|
},
|
|
columns: [
|
|
// 资料类型
|
|
{
|
|
dataIndex: 'origin_dictText',
|
|
title: this.$t('docTool.split.dataType'),
|
|
width: 150
|
|
},
|
|
// 标准号
|
|
{
|
|
dataIndex: 'standardNumber',
|
|
title: this.$t('standardSelect.standardNumber'),
|
|
width: 150
|
|
},
|
|
// 标准名称
|
|
{
|
|
dataIndex: 'standardName',
|
|
title: this.$t('standardSelect.standardName'),
|
|
width: 150
|
|
},
|
|
// 文件状态
|
|
{
|
|
dataIndex: 'standardFileType_dictText',
|
|
title: this.$t('docTool.comparison.textStatus'),
|
|
width: 150
|
|
},
|
|
// 标准拆分状态
|
|
{
|
|
dataIndex: 'standardSplitStatus_dictText',
|
|
title: this.$t('docTool.comparison.standardSplitStatus'),
|
|
width: 150
|
|
},
|
|
// 附件
|
|
{
|
|
dataIndex: 'fileName',
|
|
title: this.$t('businessSupport.questionAnswer.attach'),
|
|
width: 150
|
|
}
|
|
],
|
|
url: {
|
|
list: '/laws/DocumentTool/documentSplit/querySplitFileInfoByPage' // 表格数据
|
|
},
|
|
type: 'pdfdoc',
|
|
operationList: [],
|
|
showAction: false,
|
|
flag: 'header',
|
|
disableMixinCreated: true
|
|
}
|
|
},
|
|
methods: {
|
|
open () {
|
|
this.visible = true
|
|
this.queryParam = {}
|
|
this.loadData(1)
|
|
},
|
|
// 来源改变,更改为国内的时候清空主起草单位
|
|
sourceChange (value) {
|
|
if (value === SplitStandardSource.DOMESTIC.value) {
|
|
this.queryParam.esMainDraftUnit = ''
|
|
}
|
|
},
|
|
// 查询改成post请求,否则主起草单位传太多有问题
|
|
loadData (arg) {
|
|
if (!this.url.list) {
|
|
this.$message.warning('请设置url.list属性!')
|
|
return
|
|
}
|
|
// 加载数据 若传入参数1则加载第一页的内容
|
|
if (arg === 1) {
|
|
this.ipagination.current = 1
|
|
}
|
|
const params = this.getQueryParams()// 查询条件
|
|
console.log(params)
|
|
this.loading = true
|
|
postAction(this.url.list, params).then((res) => {
|
|
if (res.success) {
|
|
// update-begin---author:zhangyafei Date:20201118 for:适配不分页的数据列表------------
|
|
this.dataSource = res.result.records || res.result
|
|
if (res.result.total) {
|
|
this.ipagination.total = res.result.total
|
|
} else {
|
|
this.ipagination.total = 0
|
|
}
|
|
// update-end---author:zhangyafei Date:20201118 for:适配不分页的数据列表------------
|
|
} else {
|
|
this.$message.warning(res.message)
|
|
}
|
|
}).finally(() => {
|
|
this.loading = false
|
|
})
|
|
},
|
|
// 抽屉关闭
|
|
onClose () {
|
|
this.visible = false
|
|
this.onClearSelected()
|
|
},
|
|
// 取消
|
|
cancelSplit () {
|
|
this.onClose()
|
|
},
|
|
// 拆分
|
|
submitSplit () {
|
|
if (this.loading) {
|
|
return
|
|
}
|
|
if (!this.selectedRowKeys || this.selectedRowKeys.length === 0) {
|
|
this.$message.warning(this.$t('selectOne'))
|
|
return
|
|
}
|
|
// 最多同时拆分十条
|
|
if (this.selectedRowKeys.length > 10) {
|
|
this.$message.warning(this.$t('docTool.split.maximumSelection') + '10' + this.$t('docTool.split.pieceOfData'))
|
|
return
|
|
}
|
|
this.loading = true
|
|
addDocSplit({ ids: this.selectedRowKeys.join(',') }).then(res => {
|
|
if (res.success) {
|
|
this.$message.success(this.$t('operationSuccessful'))
|
|
this.onClose()
|
|
} else {
|
|
this.messageLineFeedByBr(this.$t('operationFailed'), res.message)
|
|
}
|
|
this.$emit('ok')
|
|
}).finally(() => {
|
|
this.loading = false
|
|
})
|
|
}
|
|
}
|
|
}
|
|
</script>
|
|
|
|
<style scoped lang="less">
|
|
@import '~../../../../assets/less/common.less';
|
|
|
|
.table-page-search-wrapper {
|
|
display: flex;
|
|
|
|
.ant-form {
|
|
flex: 1;
|
|
}
|
|
}
|
|
|
|
.table-page-search-submitButtons {
|
|
margin-left: 10px;
|
|
}
|
|
</style>
|