<template>
|
<a-card :bordered='false'>
|
<!-- 查询区域 -->
|
<div class='table-page-search-wrapper'>
|
<a-form layout='inline' @keyup.enter.native='searchQuery'>
|
<a-row :gutter='24'>
|
<a-col :md='6' :sm='12'>
|
<a-form-item label='专利(软著)名称'>
|
<j-input
|
placeholder='请输入专利(软著)名称模糊查询'
|
v-model='queryParam.mc'
|
>
|
</j-input>
|
</a-form-item>
|
</a-col>
|
<a-col :md='6' :sm='12'>
|
<a-form-item label='专利(软著)编号'>
|
<j-input
|
placeholder='请输入专利(软著)编号模糊查询'
|
v-model='queryParam.bh'
|
>
|
</j-input>
|
</a-form-item>
|
</a-col>
|
|
|
<template v-if='toggleSearchStatus'>
|
|
</template>
|
|
<a-col :md='6' :sm='8'>
|
<span style='float: left;overflow: hidden;' class='table-page-search-submitButtons'>
|
<a-button type='primary' @click='searchQuery' icon='search'>查询</a-button>
|
<a-button type='primary' @click='searchReset' icon='reload' style='margin-left: 8px'>重置</a-button>
|
<a @click='handleToggleSearch' style='margin-left: 8px'>
|
{{ toggleSearchStatus ? '收起' : '展开' }}
|
<a-icon :type="toggleSearchStatus ? 'up' : 'down'" />
|
</a>
|
</span>
|
</a-col>
|
|
</a-row>
|
</a-form>
|
</div>
|
|
<!-- 操作按钮区域 -->
|
<div class='table-operator' style='border-top: 5px'>
|
<a-button @click='handleAdd' type='primary' icon='plus'>新增</a-button>
|
<a-button type='primary' icon='download' @click="handleExportXls('专利软著')">导出</a-button>
|
<a-upload name='file' :showUploadList='false' :multiple='false' :headers='tokenHeader' :action='importExcelUrl'
|
@change='handleImportExcel'>
|
<a-button type='primary' icon='import'>导入</a-button>
|
</a-upload>
|
<a-dropdown v-if='selectedRowKeys.length > 0'>
|
<a-menu slot='overlay' @click='handleMenuClick'>
|
<a-menu-item key='1'>
|
<a-icon type='delete' @click='batchDel' />
|
删除
|
</a-menu-item>
|
</a-menu>
|
<a-button style='margin-left: 8px'>
|
批量操作
|
<a-icon type='down' />
|
</a-button>
|
</a-dropdown>
|
|
</div>
|
|
<!-- table区域-begin -->
|
<div>
|
<div class='ant-alert ant-alert-info' style='margin-bottom: 16px;'>
|
<i class='anticon anticon-info-circle ant-alert-icon'></i>已选择 <a
|
style='font-weight: 600'>{{ selectedRowKeys.length }}</a>项
|
<a style='margin-left: 24px' @click='onClearSelected'>清空</a>
|
</div>
|
|
<a-table
|
style='height: 500px'
|
:scroll='{ x: 1200 }'
|
ref='table'
|
bordered
|
size='middle'
|
rowKey='id'
|
:columns='columns'
|
:dataSource='dataSource'
|
:pagination='ipagination'
|
:loading='loading'
|
:expandedRowKeys="expandedRowKeys"
|
:rowSelection='{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}'
|
@change='handleTableChange'
|
@expand='handleExpand'
|
|
>
|
|
<!-- 字符串超长截取省略号显示-->
|
<span slot='esContent10' slot-scope='text'>
|
<j-ellipsis :value='text' :length='10' />
|
</span>
|
<span slot='esContent4' slot-scope='text'>
|
<j-ellipsis :value='text' :length='4' />
|
</span>
|
<span slot='esContent8' slot-scope='text'>
|
<j-ellipsis :value='text' :length='8' />
|
</span>
|
<span slot='esContent15' slot-scope='text'>
|
<j-ellipsis :value='text' :length='15' />
|
</span>
|
<span slot='esContent20' slot-scope='text'>
|
<j-ellipsis :value='text' :length='20' />
|
</span>
|
|
<span slot='action' slot-scope='text, record'>
|
<a @click='openUpload(record)'>上传</a>
|
<a-divider type='vertical' />
|
<a @click='handleEdit(record)'>编辑</a>
|
<a-divider type='vertical' />
|
<a-dropdown>
|
<a class='ant-dropdown-link'>
|
更多 <a-icon type='down' />
|
</a>
|
<a-menu slot='overlay'>
|
<a-menu-item>
|
<a href='javascript:;' @click='handleDetail(record)'>详情</a>
|
</a-menu-item>
|
|
<a-menu-item>
|
<a-popconfirm title='确定删除吗?' @confirm='() => handleDelete(record.id)'>
|
<a>删除</a>
|
</a-popconfirm>
|
</a-menu-item>
|
|
</a-menu>
|
</a-dropdown>
|
</span>
|
|
|
<!-- 内部子table-->
|
<a-table
|
slot='expandedRowRender'
|
slot-scope='text'
|
:columns='innerColumns'
|
:dataSource='innerDataSource'
|
size='middle'
|
bordered
|
rowKey='id'
|
:pagination='false'
|
:rowSelection='{selectedRowKeys: selectedRowKeys2, onChange: onSelectChange2}'
|
:customRow='clickThenCheck2'>
|
<span slot='esContent' slot-scope='text'>
|
<j-ellipsis :value='text' :length='32' />
|
</span>
|
<span slot='action2' slot-scope='text, record'>
|
<a @click.stop='download(record)'>下载</a>
|
<a-divider type='vertical' />
|
<a-dropdown>
|
<a class='ant-dropdown-link'>
|
更多 <a-icon type='down' />
|
</a>
|
<a-menu slot='overlay'>
|
|
<a-menu-item>
|
<a-popconfirm title='确定删除吗?' @confirm='() => handleDeleteItem(record.id)'>
|
<a>删除</a>
|
</a-popconfirm>
|
</a-menu-item>
|
|
</a-menu>
|
</a-dropdown>
|
</span>
|
</a-table>
|
|
</a-table>
|
</div>
|
<!-- table区域-end -->
|
|
<!-- 新增专利(软著) -->
|
<pa-softbook-modal ref='modalForm' @ok='modalFormOk'></pa-softbook-modal>
|
|
<pa-upload-file-modal ref='uploadFile' @ok='uploadFileOk'></pa-upload-file-modal>
|
|
|
</a-card>
|
</template>
|
|
<script>
|
import { JeecgListMixin } from '@/mixins/JeecgListMixin'
|
|
import { deleteAction, getAction } from '@api/manage'
|
import PaSoftbookModal from '@views/patent/modules/PaSoftbookModal'
|
import PaUploadFileModal from '@views/patent/modules/PaUploadFileModal'
|
|
|
export default {
|
name: 'PaSoftBookList',
|
mixins: [JeecgListMixin],
|
components: {
|
PaUploadFileModal,
|
PaSoftbookModal
|
|
},
|
data() {
|
return {
|
description: '这是用户管理页面',
|
disableMixinCreated: false,
|
innerDataSource: [],
|
selectedRowKeys2: [],
|
selectionRows2: [],
|
columns: [
|
{
|
title: '序号',
|
dataIndex: '',
|
key: 'rowIndex',
|
width: 60,
|
align: 'center',
|
customRender: function(t, r, index) {
|
return parseInt(index) + 1
|
}
|
},
|
{
|
title: '名称',
|
align: 'center',
|
dataIndex: 'mc',
|
width: 120,
|
sorter: true,
|
scopedSlots: { customRender: 'esContent10' }
|
},
|
{
|
title: '编号',
|
align: 'center',
|
dataIndex: 'bh',
|
width: 120,
|
sorter: true,
|
scopedSlots: { customRender: 'esContent10' }
|
},
|
{
|
title: '负责人',
|
align: 'center',
|
dataIndex: 'fzr_dictText',
|
scopedSlots: { customRender: 'esContent4' },
|
width: 80
|
},
|
{
|
title: '相关成员',
|
align: 'center',
|
dataIndex: 'xgcy_dictText',
|
scopedSlots: { customRender: 'esContent8' },
|
width: 120
|
},
|
|
{
|
title: '类型',
|
align: 'center',
|
dataIndex: 'type_dictText',
|
width: 60
|
},
|
{
|
title: '描述',
|
align: 'center',
|
dataIndex: 'ms',
|
width: 150
|
},
|
{
|
title: '申请日期',
|
align: 'center',
|
dataIndex: 'sqrq',
|
width: 100
|
|
},
|
|
{
|
title: '操作',
|
dataIndex: 'action',
|
scopedSlots: { customRender: 'action' },
|
align: 'center',
|
width: 170
|
}
|
|
],
|
// 子表表头
|
innerColumns: [
|
{
|
title: '文件名',
|
align: 'center',
|
width: 200,
|
dataIndex: 'wjmc',
|
},
|
{
|
title: '文件描述',
|
align: 'center',
|
width: 200,
|
dataIndex: 'wjms',
|
scopedSlots: { customRender: 'esContent' }
|
},
|
|
|
|
{
|
title: '创建人',
|
width: 100,
|
dataIndex: 'createBy',
|
align: 'center'
|
},
|
|
{
|
title: '创建时间',
|
width: 160,
|
dataIndex: 'createTime',
|
align: 'center'
|
},
|
{
|
title: '操作',
|
dataIndex: 'action',
|
scopedSlots: { customRender: 'action2' },
|
align: 'center',
|
fixed: 'right',
|
width: 170
|
}
|
|
],
|
|
url: {
|
list: '/pa/soft/list',
|
innerList: '/pa/file/list',
|
delete: '/pa/soft/delete',
|
deleteItem: '/pa/file/delete',
|
deleteBatch: '/pa/soft/deleteBatch',
|
exportXlsUrl: '/pa/soft/exportXls',
|
importExcelUrl: 'pa/soft/importExcel'
|
}
|
}
|
},
|
methods: {
|
handleMenuClick(e) {
|
if (e.key == 1) {
|
this.batchDel()
|
}
|
},
|
onSyncFinally({ isToLocal }) {
|
// 同步到本地时刷新下数据
|
if (isToLocal) {
|
this.loadData()
|
}
|
},
|
clickThenCheck2(record) {
|
return {
|
on: {
|
click: () => {
|
this.onSelectChange2(record.id.split(','), [record])
|
}
|
}
|
}
|
},
|
onSelectChange2(selectedRowKeys, selectionRows) {
|
this.selectedRowKeys2 = selectedRowKeys
|
this.selectionRows2 = selectionRows
|
},
|
|
handleDeleteItem: function(id) {
|
if (!this.url.deleteItem) {
|
this.$message.error('请设置url.delete属性!')
|
return
|
}
|
var that = this
|
deleteAction(that.url.deleteItem, {
|
id: id
|
}).then((res) => {
|
if (res.success) {
|
//重新计算分页问题
|
that.$message.success(res.message)
|
that.loadData()
|
that.queryInnerData(this.expandedRowKeys[0])
|
} else {
|
that.$message.warning(res.message)
|
}
|
})
|
},
|
|
//新增发放记录
|
handleAdd: function(record) {
|
this.$refs.modalForm.edit(record)
|
this.$refs.modalForm.title = '新增'
|
this.$refs.modalForm.disableSubmit = false
|
},
|
//外table展开关闭
|
handleExpand(expanded, record) {
|
console.info("567890987656789098765456789")
|
this.expandedRowKeys = []
|
this.innerDataSource = []
|
if (expanded === true) {
|
if (!record.id) return false
|
this.expandedRowKeys.push(record.id)
|
//查询内table数据
|
this.queryInnerData(record.id)
|
}
|
},
|
|
queryInnerData(paymentId) {
|
|
getAction(this.url.innerList, { pid: paymentId }).then((res) => {
|
if (res.success) {
|
// this.loading = false
|
this.innerDataSource = res.result.records
|
}
|
}).finally(() => {
|
// this.loading = false
|
})
|
},
|
openUpload(record){
|
this.$refs.uploadFile.add(record);
|
},
|
download(record) {
|
this.downloadFile(record.wjlj)
|
},
|
uploadFileOk(){
|
this.queryInnerData(this.expandedRowKeys[0])
|
}
|
},
|
created() {
|
|
},
|
computed: {
|
importExcelUrl: function() {
|
return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`
|
}
|
}
|
}
|
</script>
|
|
<style scoped>
|
@import '~@assets/less/common.less';
|
</style>
|