<template>
|
<div>
|
<div class="search-background">
|
<span class="search-group">
|
<span style="width: 160px">会议地点:</span>
|
<el-input v-model="searchForm.place" clearable size="small"></el-input>
|
<el-button size="medium" style="margin-left: 10px" @click="resetSearchForm">重 置</el-button>
|
<el-button size="medium" type="primary" @click="searchList">查 询</el-button>
|
</span>
|
<span class="search-group">
|
<el-button size="medium" type="primary" @click="openFormDia('add')">新 增</el-button>
|
</span>
|
</div>
|
<div class="table">
|
<limsTable :column="tableColumn" :height="'calc(100vh - 23em)'" :table-data="tableData"
|
:table-loading="tableLoading" style="padding: 0 10px;margin-bottom: 16px" :page="page" @pagination="pagination">
|
</limsTable>
|
</div>
|
<meeting-records-dia v-if="meetingRecordsDia" ref="meetingRecordsDia"
|
@closeYearDia="closeYearDia"></meeting-records-dia>
|
</div>
|
</template>
|
|
<script>
|
import limsTable from "@/components/Table/lims-table.vue";
|
import MeetingRecordsDia from './meetingRecordsDia.vue';
|
import ManagementFormDIa from './managementFormDIa.vue';
|
import {
|
getPageMeeting,
|
deleteMeeting,
|
exportMeeting,
|
} from '@/api/cnas/systemManagement/managementReview.js'
|
|
export default {
|
name: 'meetingRecords',
|
// import 引入的组件需要注入到对象中才能使用
|
components: { ManagementFormDIa, MeetingRecordsDia, limsTable },
|
data() {
|
// 这里存放数据
|
return {
|
searchForm: {
|
place: '',
|
},
|
tableColumn: [
|
{
|
label: '时间',
|
prop: 'meetingTime',
|
minWidth: '100'
|
},
|
{
|
label: '主持人',
|
prop: 'compere',
|
minWidth: '100'
|
},
|
{
|
label: '会议地点',
|
prop: 'place',
|
minWidth: '100'
|
},
|
{
|
label: '会议内容摘要',
|
prop: 'content',
|
minWidth: '100'
|
},
|
{
|
dataType: 'action',
|
minWidth: '120',
|
label: '操作',
|
operation: [
|
{
|
name: '编辑',
|
type: 'text',
|
clickFun: (row) => {
|
this.openFormDia('edit', row);
|
},
|
},
|
{
|
name: '删除',
|
type: 'text',
|
color: '#f56c6c',
|
clickFun: (row) => {
|
this.delPlan(row)
|
}
|
},
|
{
|
name: '下载',
|
type: 'text',
|
clickFun: (row) => {
|
this.handleDown(row)
|
}
|
},
|
]
|
}
|
],
|
tableData: [],
|
tableLoading: false,
|
page: {
|
size: 20,
|
current: 1,
|
total: 0,
|
},
|
meetingRecordsDia: false
|
};
|
},
|
mounted() {
|
this.searchList()
|
},
|
// 方法集合
|
methods: {
|
// 查询列表
|
searchList() {
|
this.tableLoading = true
|
getPageMeeting({ place: this.searchForm.place, pages: this.page.current, size: this.page.size }).then(res => {
|
this.tableLoading = false
|
if (res.code === 201) return
|
this.tableData = res.data.records
|
this.page.total = res.data.total
|
}).catch(err => {
|
console.log('err---', err);
|
this.tableLoading = false
|
})
|
},
|
// 新增,编辑弹框
|
openFormDia(type, row) {
|
this.meetingRecordsDia = true
|
this.$nextTick(() => {
|
this.$refs.meetingRecordsDia.openDia(type, row)
|
})
|
},
|
closeYearDia() {
|
this.meetingRecordsDia = false
|
this.searchList()
|
},
|
// 重置查询条件
|
resetSearchForm() {
|
this.searchForm.place = '';
|
this.searchList()
|
},
|
// 删除
|
delPlan(row) {
|
this.$confirm('此操作将永久删除该数据, 是否继续?', '提示', {
|
confirmButtonText: '确定',
|
cancelButtonText: '取消',
|
type: 'warning'
|
}).then(() => {
|
this.tableLoading = true
|
deleteMeeting({ id: row.id }).then(res => {
|
this.tableLoading = false
|
if (res.code === 201) return
|
this.$message.success('删除成功')
|
this.searchList()
|
}).catch(err => {
|
this.tableLoading = false
|
console.log('err---', err);
|
})
|
}).catch(() => {
|
this.$message({
|
type: 'info',
|
message: '已取消删除'
|
});
|
});
|
},
|
pagination({ page, limit }) {
|
this.page.current = page;
|
this.page.size = limit;
|
this.searchList();
|
},
|
handleDown(row) {
|
exportMeeting({ id: row.id }).then(res => {
|
if (res.code == 201) {
|
this.$message.error(res.message)
|
return
|
}
|
const blob = new Blob([res], { type: 'application/octet-stream' });
|
//将Blob 对象转换成字符串
|
let reader = new FileReader();
|
reader.readAsText(blob, 'utf-8');
|
reader.onload = () => {
|
try {
|
let result = JSON.parse(reader.result);
|
if (result.message) {
|
this.$message.error(result.message);
|
} else {
|
const url = URL.createObjectURL(blob);
|
const link = document.createElement('a');
|
link.href = url;
|
link.download = '会议记录.docx';
|
link.click();
|
this.$message.success('导出成功')
|
}
|
} catch (err) {
|
console.log(err);
|
const url = URL.createObjectURL(blob);
|
const link = document.createElement('a');
|
link.href = url;
|
link.download = '会议记录.docx';
|
link.click();
|
this.$message.success('导出成功')
|
}
|
}
|
})
|
},
|
}
|
};
|
</script>
|
|
<style scoped>
|
.search-background {
|
width: 100%;
|
height: 60px;
|
line-height: 60px;
|
display: flex;
|
justify-content: space-between;
|
}
|
|
.search-group {
|
display: flex;
|
align-items: center;
|
margin: 0 20px;
|
}
|
</style>
|