|
|
|
@ -0,0 +1,299 @@
|
|
|
|
|
<template>
|
|
|
|
|
<div class="moral-heart-activity-list-content-style">
|
|
|
|
|
<div v-if="pageType === 0">
|
|
|
|
|
<div class="search-and-add-style">
|
|
|
|
|
<div>
|
|
|
|
|
<span style="margin-right: 0.5rem">课程名称</span>
|
|
|
|
|
<a-input v-model="courseName"/>
|
|
|
|
|
<span style="margin:0 0.5rem">课程日期</span>
|
|
|
|
|
<a-date-picker :locale="locale"
|
|
|
|
|
v-model="courseDate"
|
|
|
|
|
:format="dateFormat"
|
|
|
|
|
@change="onChange"/>
|
|
|
|
|
<span style="margin:0 0.5rem">课程地点</span>
|
|
|
|
|
<a-input v-model="coursePlace"/>
|
|
|
|
|
<span style="margin:0 0.5rem">主讲人</span>
|
|
|
|
|
<a-input v-model="courseSpeaker"/>
|
|
|
|
|
<span style="margin:0 0.5rem">参加人员</span>
|
|
|
|
|
<a-input v-model="attendees"/>
|
|
|
|
|
<a-icon type="search" :style="{fontSize: '16px', color: '#31a8fa',marginLeft:'0.5rem'}" @click="search" />
|
|
|
|
|
</div>
|
|
|
|
|
<a-button type="primary" @click="toAdd" class="add-button-style">新增</a-button>
|
|
|
|
|
</div>
|
|
|
|
|
<a-table :columns="tableColumn" :data-source="dataList" :loading="loading" :pagination="false">
|
|
|
|
|
<span slot="action" slot-scope="text, record">
|
|
|
|
|
<a @click="toEdit(record)">编辑</a>
|
|
|
|
|
<a-divider type="vertical"/>
|
|
|
|
|
<a @click="toDelete(record)">删除</a>
|
|
|
|
|
</span>
|
|
|
|
|
</a-table>
|
|
|
|
|
<a-pagination v-if="totalPage > 1" v-model="pageNumber" :pageSize="pageSize" :total="totalNum"
|
|
|
|
|
@change="onPageChange"/>
|
|
|
|
|
</div>
|
|
|
|
|
<a-modal title="提示"
|
|
|
|
|
:visible="visible"
|
|
|
|
|
centered
|
|
|
|
|
cancelText="取消"
|
|
|
|
|
okText="确定"
|
|
|
|
|
@ok="handleOk"
|
|
|
|
|
@cancel="handleCancel">
|
|
|
|
|
是否确定删除此条信息?
|
|
|
|
|
</a-modal>
|
|
|
|
|
<template v-if="pageType === 1">
|
|
|
|
|
|
|
|
|
|
</template>
|
|
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
|
<script>
|
|
|
|
|
import InterConfig from '../interConfig';
|
|
|
|
|
import {Table, Button, Select, Modal, Divider, Cascader, Icon, Input,Pagination,DatePicker} from 'ant-design-vue';
|
|
|
|
|
import Upload from '../../../../../../components/common/uploader/Upload.vue';
|
|
|
|
|
import locale from 'ant-design-vue/es/date-picker/locale/zh_CN';
|
|
|
|
|
import moment from 'moment';
|
|
|
|
|
const tableColumn = [
|
|
|
|
|
{
|
|
|
|
|
dataIndex: 'index',
|
|
|
|
|
key: 'index',
|
|
|
|
|
title: '序号',
|
|
|
|
|
width: "80px",
|
|
|
|
|
align: "center"
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
dataIndex: 'course_name',
|
|
|
|
|
key: 'courseName',
|
|
|
|
|
title: '课程名称',
|
|
|
|
|
align: "center"
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
dataIndex: 'course_date',
|
|
|
|
|
key: 'courseDate',
|
|
|
|
|
title: '课程日期',
|
|
|
|
|
align: "center"
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
dataIndex: 'course_place',
|
|
|
|
|
key: 'coursePlace',
|
|
|
|
|
title: '课程地点',
|
|
|
|
|
align: "center",
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
dataIndex: 'course_speaker',
|
|
|
|
|
key: 'courseSpeaker',
|
|
|
|
|
title: '主讲人',
|
|
|
|
|
align: "center",
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
dataIndex: 'attendees',
|
|
|
|
|
key: 'attendees',
|
|
|
|
|
title: '参与人员',
|
|
|
|
|
align: "center",
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
title: '操作',
|
|
|
|
|
key: 'action',
|
|
|
|
|
align: "center",
|
|
|
|
|
scopedSlots: {customRender: 'action'},
|
|
|
|
|
}
|
|
|
|
|
]
|
|
|
|
|
export default{
|
|
|
|
|
props: ["menuId"],
|
|
|
|
|
data(){
|
|
|
|
|
return {
|
|
|
|
|
locale,
|
|
|
|
|
dateFormat: "YYYY-MM-DD",
|
|
|
|
|
pageType: 0,//0 列表页面 1 新增页面
|
|
|
|
|
courseName: "",//课程名称
|
|
|
|
|
tableColumn: tableColumn,
|
|
|
|
|
dataList: [],
|
|
|
|
|
loading: false,
|
|
|
|
|
activityId:"",//活动ID
|
|
|
|
|
clubId: "",
|
|
|
|
|
clubList:[],
|
|
|
|
|
activityName:"",
|
|
|
|
|
courseDate:"",//课程日期
|
|
|
|
|
coursePlace:"",//课程地点
|
|
|
|
|
courseSpeaker:"",//主讲人
|
|
|
|
|
attendees:"",//参与人员名单
|
|
|
|
|
visible: false,
|
|
|
|
|
pageNumber: 1,
|
|
|
|
|
pageSize: 3,
|
|
|
|
|
totalPage: 0,
|
|
|
|
|
totalNum: 0,
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
created(){
|
|
|
|
|
this.getClubList();
|
|
|
|
|
},
|
|
|
|
|
mounted(){
|
|
|
|
|
|
|
|
|
|
},
|
|
|
|
|
methods: {
|
|
|
|
|
getClubList:function(){
|
|
|
|
|
let param = {
|
|
|
|
|
bureau_id: this.BaseConfig.person_info_my.bureau_id,
|
|
|
|
|
club_name: "",
|
|
|
|
|
page_number: 1,
|
|
|
|
|
page_size: 1000000,
|
|
|
|
|
}
|
|
|
|
|
this.InterfaceConfig.callInterface([{
|
|
|
|
|
url: InterConfig.getClublist.url,
|
|
|
|
|
params: param,
|
|
|
|
|
method: InterConfig.getClublist.method,
|
|
|
|
|
isTestLogin: InterConfig.getClublist.isTestLogin,
|
|
|
|
|
}], (result) => {
|
|
|
|
|
let resData = result[0].data;
|
|
|
|
|
if (resData.code === 2000) {
|
|
|
|
|
let dataList = resData.data.list;
|
|
|
|
|
if(dataList && dataList.length > 0){
|
|
|
|
|
this.clubList = dataList;
|
|
|
|
|
this.clubId = dataList[0].club_id;
|
|
|
|
|
this.getClubActivityList();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
},
|
|
|
|
|
onChange(value, dateString) {
|
|
|
|
|
this.activityDate = dateString;
|
|
|
|
|
},
|
|
|
|
|
search:function () {
|
|
|
|
|
this.getClubActivityList();
|
|
|
|
|
},
|
|
|
|
|
clubChange:function(value){
|
|
|
|
|
this.clubId = value;
|
|
|
|
|
this.getClubActivityList();
|
|
|
|
|
},
|
|
|
|
|
getClubActivityList: function () {
|
|
|
|
|
let param = {
|
|
|
|
|
bureau_id: this.BaseConfig.person_info_my.bureau_id,
|
|
|
|
|
club_id: this.clubId,
|
|
|
|
|
activity_name:this.activityName,
|
|
|
|
|
activity_date:this.activityDate,
|
|
|
|
|
activity_place:this.activityPlace,
|
|
|
|
|
page_number: this.pageNumber,
|
|
|
|
|
page_size: this.pageSize,
|
|
|
|
|
}
|
|
|
|
|
this.InterfaceConfig.callInterface([{
|
|
|
|
|
url: InterConfig.getClubActivityList.url,
|
|
|
|
|
params: param,
|
|
|
|
|
method: InterConfig.getClubActivityList.method,
|
|
|
|
|
isTestLogin: InterConfig.getClubActivityList.isTestLogin,
|
|
|
|
|
}], (result) => {
|
|
|
|
|
let resData = result[0].data;
|
|
|
|
|
if (resData.code === 2000) {
|
|
|
|
|
let dataList = resData.data.list;
|
|
|
|
|
if (dataList && dataList.length > 0) {
|
|
|
|
|
for (let i = 0, len = dataList.length; i < len; i++) {
|
|
|
|
|
dataList[i]['index'] = i + 1;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
this.dataList = dataList;
|
|
|
|
|
this.totalNum = resData.data.total_row;
|
|
|
|
|
this.totalPage = resData.data.total_page;
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
},
|
|
|
|
|
onPageChange: function (page) {
|
|
|
|
|
this.pageNumber = page;
|
|
|
|
|
this.getClubActivityList();
|
|
|
|
|
},
|
|
|
|
|
toAdd: function () {
|
|
|
|
|
this.activityId = "";
|
|
|
|
|
this.pageType = 1;
|
|
|
|
|
},
|
|
|
|
|
toEdit: function (record) {
|
|
|
|
|
this.pageType = 1;
|
|
|
|
|
this.activityId = record.activity_id + "";
|
|
|
|
|
},
|
|
|
|
|
toDelete: function (record) {
|
|
|
|
|
this.activityId = record.activity_id + "";
|
|
|
|
|
this.visible = true;
|
|
|
|
|
},
|
|
|
|
|
cancel: function () {
|
|
|
|
|
this.pageType = 0;
|
|
|
|
|
this.getClubList();
|
|
|
|
|
},
|
|
|
|
|
//确定删除
|
|
|
|
|
handleOk: function () {
|
|
|
|
|
let param = {
|
|
|
|
|
activity_ids: this.activityId,
|
|
|
|
|
club_id:this.clubId,
|
|
|
|
|
bureau_id: this.BaseConfig.person_info_my.bureau_id,
|
|
|
|
|
}
|
|
|
|
|
this.InterfaceConfig.callInterface([{
|
|
|
|
|
url: InterConfig.deleteClubActivity.url,
|
|
|
|
|
params: param,
|
|
|
|
|
method: InterConfig.deleteClubActivity.method,
|
|
|
|
|
isTestLogin: InterConfig.deleteClubActivity.isTestLogin,
|
|
|
|
|
}], (result) => {
|
|
|
|
|
let resData = result[0].data;
|
|
|
|
|
if (resData.code === 2000) {
|
|
|
|
|
Modal.success({
|
|
|
|
|
title: "操作成功",
|
|
|
|
|
content: "",
|
|
|
|
|
centered: true
|
|
|
|
|
});
|
|
|
|
|
this.handleCancel();
|
|
|
|
|
this.getClubActivityList();
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
},
|
|
|
|
|
//取消
|
|
|
|
|
handleCancel: function () {
|
|
|
|
|
this.activityId = "";
|
|
|
|
|
this.visible = false;
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
components: {
|
|
|
|
|
ATable: Table,
|
|
|
|
|
AButton: Button,
|
|
|
|
|
AModal: Modal,
|
|
|
|
|
ADivider: Divider,
|
|
|
|
|
AIcon: Icon,
|
|
|
|
|
AInput: Input,
|
|
|
|
|
APagination:Pagination,
|
|
|
|
|
AInputSearch: Input.Search,
|
|
|
|
|
ASelect: Select,
|
|
|
|
|
ASelectOption: Select.Option,
|
|
|
|
|
Upload,
|
|
|
|
|
ActivityInfo,
|
|
|
|
|
ADatePicker:DatePicker
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
</script>
|
|
|
|
|
<style scoped lang="scss">
|
|
|
|
|
.moral-heart-activity-list-content-style {
|
|
|
|
|
width: 100%;
|
|
|
|
|
height: auto;
|
|
|
|
|
padding: 0.5rem;
|
|
|
|
|
.search-and-add-style {
|
|
|
|
|
width: 100%;
|
|
|
|
|
height: 3.5rem;
|
|
|
|
|
background-color: white;
|
|
|
|
|
margin-bottom: 0.5rem;
|
|
|
|
|
display: flex;
|
|
|
|
|
justify-content: space-between;
|
|
|
|
|
align-items: center;
|
|
|
|
|
padding: 0 0.5rem;
|
|
|
|
|
.ant-select {
|
|
|
|
|
width: 100px;
|
|
|
|
|
}
|
|
|
|
|
.ant-input {
|
|
|
|
|
width: 150px;
|
|
|
|
|
}
|
|
|
|
|
.add-button-style {
|
|
|
|
|
float: right;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
.ant-table-wrapper {
|
|
|
|
|
/deep/ .upload-container-style {
|
|
|
|
|
display: flex;
|
|
|
|
|
justify-content: center;
|
|
|
|
|
align-items: center;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
.ant-pagination {
|
|
|
|
|
margin-top: 0.5rem;
|
|
|
|
|
text-align: right;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
</style>
|