Files
income_payments_client/src/views/projectManagement/InternationalSeminarGenerateCode.vue
T

160 lines
4.9 KiB
Vue

<!-- 国际研讨会 生成随机码页面-->
<template>
<div class="generate-code-container">
<page-header-title :is-level-one="false" :level-two-title="title"></page-header-title>
<a-card :bordered="false">
<!-- 查询区域 -->
<div class="table-page-search-wrapper">
<a-form layout="inline" @keyup.enter.native="searchQuery">
<a-row :gutter="24">
<a-col :xl="8" :lg="8" :md="10" :sm="24">
<a-form-item label="嘉宾类型">
<j-dict-select-tag placeholder="请选择嘉宾类型" dict-code="guest_type" v-model="queryParam.guestType"></j-dict-select-tag>
</a-form-item>
</a-col>
<a-col :xl="8" :lg="8" :md="10" :sm="24">
<span style="float: left;overflow: hidden;" class="table-page-search-submitButtons">
<a-button type="primary" @click="searchQuery" icon="search" v-has="'internationalSeminarGenerateCode:search'">查询</a-button>
<a-button @click="searchReset" icon="reload" class="reset-button" style="margin-left: 8px">重置</a-button>
</span>
</a-col>
</a-row>
</a-form>
</div>
<!-- 查询区域-END -->
<!-- 操作按钮区域 -->
<div class="table-operator">
<a-button @click="handleAdd" type="primary" icon="plus" v-has="'internationalSeminarGenerateCode:add'">新增</a-button>
<a-button type="primary" icon="download" @click="handleExportXls(meetingInfo.meetingName + '随机码')" v-has="'internationalSeminarGenerateCode:export'">导出</a-button>
</div>
<a-table
ref="table"
size="middle"
bordered
rowKey="randomCodeId"
:scroll="{x: 800}"
:columns="columns"
:dataSource="dataSource"
:pagination="false"
:loading="loading"
:rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}"
class="j-table-force-nowrap"
@change="handleTableChange">
<template slot="text" slot-scope="text">
<a-tooltip>
<template slot="title">{{ text }}</template>
<div class="table-text">{{ text }}</div>
</a-tooltip>
</template>
<span slot="action" slot-scope="text, record" class="action-span-cell">
<a @click="handleEdit(record)" v-has="'internationalSeminarGenerateCode:edit'">编辑</a>
</span>
</a-table>
</a-card>
<generate-code-modal ref="modalForm" :meeting-id="meetingInfo.id" @ok="modalFormOk"></generate-code-modal>
</div>
</template>
<script>
import {getMeetInfoById} from '../../api/incomeMeetingApi'
import {JeroListMixin} from '@/mixins/JeroListMixin'
import JDictSelectTag from '@comp/dict/JDictSelectTag'
import PageHeaderTitle from '@comp/layouts/PageHeaderTitle'
import GenerateCodeModal from './modules/InternationalSeminarGenerateCodeModal'
export default {
name: 'InternationalSeminarGenerateCode',
mixins: [JeroListMixin],
components: {
JDictSelectTag,
GenerateCodeModal,
PageHeaderTitle
},
data() {
return {
// 当前会议的相关信息
meetingInfo: {},
title: '随机码设置',
confirmLoading: false,
columns: [
{
title: '序号',
dataIndex: '',
key: 'rowIndex',
width: 60,
align: 'center',
customRender: function (t, r, index) {
return parseInt(index) + 1
}
},
{
title: '嘉宾类型',
align: 'center',
dataIndex: 'guestType_dictText',
scopedSlots: {customRender: 'text'},
},
{
title: '随机码个数',
align: 'center',
dataIndex: 'randomCodeCount',
width: 120,
scopedSlots: {customRender: 'text'}
},
{
title: '使用个数',
align: 'center',
dataIndex: 'useCount',
width: 120,
scopedSlots: {customRender: 'text'},
},
{
title: '操作',
align: 'center',
fixed: 'right',
width: 180,
scopedSlots: {customRender: 'action'}
},
],
url: {
list: '/meeting/randomCode/page',
exportXlsUrl: '/meeting/randomCode/exportXls'
},
disableMixinCreated: true
}
},
mounted() {
if(!this.$route.query.id) return
this.meetingInfo.id = this.$route.query.id
this.filters.meetingId = this.meetingInfo.id
this.getMeetingInfo()
// 加载数据
this.loadData()
},
methods: {
getMeetingInfo() {
getMeetInfoById({id: this.meetingInfo.id}).then(res => {
if (res.success) {
this.meetingInfo = res.result
this.title = this.meetingInfo.meetingName + '随机码设置'
}
})
}
}
}
</script>
<style scoped lang="less">
@import '~@assets/less/common.less';
/*表格滚动条*/
/deep/.ant-table-body {
overflow-x: auto!important;
}
</style>