|
|
@@ -0,0 +1,510 @@
|
|
|
+<template>
|
|
|
+ <div class="list-view">
|
|
|
+ <div class="filters-container">
|
|
|
+ <el-form :model="form" inline label-width="100px">
|
|
|
+ <el-row>
|
|
|
+ <el-col :span="8">
|
|
|
+ <el-form-item label="展演活动名称">
|
|
|
+ <el-select
|
|
|
+ v-model="performanceId"
|
|
|
+ clearable
|
|
|
+ filterable
|
|
|
+ placeholder="展演活动名称"
|
|
|
+ style="width: 100%"
|
|
|
+ >
|
|
|
+ <el-option
|
|
|
+ v-for="item in performances"
|
|
|
+ :key="item.value"
|
|
|
+ :label="item.label"
|
|
|
+ :value="item.value"
|
|
|
+ >
|
|
|
+ </el-option>
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="8">
|
|
|
+ <el-form-item label="考级机构名称">
|
|
|
+ <el-select
|
|
|
+ v-model="gradingOrganizationId"
|
|
|
+ clearable
|
|
|
+ filterable
|
|
|
+ placeholder="考级机构"
|
|
|
+ style="width: 100%"
|
|
|
+ >
|
|
|
+ <el-option
|
|
|
+ v-for="item in gradingOrganizationIdOptions"
|
|
|
+ :key="item.value"
|
|
|
+ :label="item.label"
|
|
|
+ :value="item.value"
|
|
|
+ >
|
|
|
+ </el-option>
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="8"
|
|
|
+ ><el-form-item label="考级点名称">
|
|
|
+ <el-input placeholder="考级点名称" v-model="search" clearable></el-input> </el-form-item
|
|
|
+ ></el-col>
|
|
|
+ </el-row>
|
|
|
+ <el-row>
|
|
|
+ <el-col :span="8">
|
|
|
+ <el-form-item label="参赛专业">
|
|
|
+ <el-cascader
|
|
|
+ ref="artCascader"
|
|
|
+ style="width: 100%"
|
|
|
+ v-model="specialtyId"
|
|
|
+ :props="optionProps"
|
|
|
+ :options="artTypes"
|
|
|
+ :show-all-levels="false"
|
|
|
+ placeholder="请选择专业"
|
|
|
+ clearable
|
|
|
+ >
|
|
|
+ </el-cascader>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="8"
|
|
|
+ ><el-form-item label="参赛组别">
|
|
|
+ <el-select v-model="competitionGroup" clearable filterable placeholder="参赛组别">
|
|
|
+ <el-option
|
|
|
+ v-for="item in competitionGroupOptions"
|
|
|
+ :key="item.value"
|
|
|
+ :label="item.label"
|
|
|
+ :value="item.value"
|
|
|
+ >
|
|
|
+ </el-option>
|
|
|
+ </el-select> </el-form-item
|
|
|
+ ></el-col>
|
|
|
+ <el-col :span="8"
|
|
|
+ ><el-form-item label="参赛级别" v-if="competitionGroup">
|
|
|
+ <el-select
|
|
|
+ v-model="levelSettingId"
|
|
|
+ clearable
|
|
|
+ filterable
|
|
|
+ placeholder="参赛级别"
|
|
|
+ style="width: 100%"
|
|
|
+ v-if="competitionGroup == 'SINGLE'"
|
|
|
+ >
|
|
|
+ <el-option
|
|
|
+ v-for="item in levelSingleOptions"
|
|
|
+ :key="item.value"
|
|
|
+ :label="item.label"
|
|
|
+ :value="item.value"
|
|
|
+ >
|
|
|
+ <span style="float: left">{{ item.label }}</span>
|
|
|
+ <span style="float: right; color: #8492a6; font-size: 13px">{{ item.desc }}</span>
|
|
|
+ </el-option>
|
|
|
+ </el-select>
|
|
|
+ <el-select
|
|
|
+ v-model="levelSettingId"
|
|
|
+ clearable
|
|
|
+ filterable
|
|
|
+ placeholder="请选择"
|
|
|
+ style="width: 100%"
|
|
|
+ v-else
|
|
|
+ >
|
|
|
+ <el-option
|
|
|
+ v-for="item in levelCollectiveOptions"
|
|
|
+ :key="item.value"
|
|
|
+ :label="item.label"
|
|
|
+ :value="item.value"
|
|
|
+ >
|
|
|
+ <span style="float: left">{{ item.label }}</span>
|
|
|
+ <span style="float: right; color: #8492a6; font-size: 13px">{{ item.desc }}</span>
|
|
|
+ </el-option>
|
|
|
+ </el-select>
|
|
|
+ </el-form-item></el-col
|
|
|
+ >
|
|
|
+ </el-row>
|
|
|
+ <el-form-item>
|
|
|
+ <el-button @click="getData" type="primary" icon="el-icon-search">搜索 </el-button>
|
|
|
+ <el-button @click="clearSearch" type="primary">清空 </el-button>
|
|
|
+ <!-- <el-button @click="addRow" type="primary" icon="el-icon-plus">添加 </el-button> -->
|
|
|
+ <el-button
|
|
|
+ @click="download"
|
|
|
+ type="primary"
|
|
|
+ icon="el-icon-download"
|
|
|
+ :loading="downloading"
|
|
|
+ :disabled="totalElements < 1"
|
|
|
+ >导出
|
|
|
+ </el-button>
|
|
|
+ </el-form-item>
|
|
|
+ </el-form>
|
|
|
+ </div>
|
|
|
+ <el-table
|
|
|
+ :data="tableData"
|
|
|
+ row-key="id"
|
|
|
+ ref="table"
|
|
|
+ header-row-class-name="table-header-row"
|
|
|
+ header-cell-class-name="table-header-cell"
|
|
|
+ row-class-name="table-row"
|
|
|
+ cell-class-name="table-cell"
|
|
|
+ :height="tableHeight"
|
|
|
+ >
|
|
|
+ <el-table-column v-if="multipleMode" align="center" type="selection" width="50"> </el-table-column>
|
|
|
+ <!-- <el-table-column prop="id" label="ID" width="100"> </el-table-column> -->
|
|
|
+ <el-table-column prop="name" label="节目名称"> </el-table-column>
|
|
|
+ <el-table-column prop="specialty" label="参赛专业"> </el-table-column>
|
|
|
+ <el-table-column
|
|
|
+ prop="competitionGroup"
|
|
|
+ label="参赛组别"
|
|
|
+ :formatter="competitionGroupFormatter"
|
|
|
+ min-width="70"
|
|
|
+ >
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column prop="level" label="参赛级别" min-width="70"> </el-table-column>
|
|
|
+ <el-table-column prop="durationOfWork" label="作品时长" min-width="70"> </el-table-column>
|
|
|
+ <el-table-column prop="quantity" label="参赛人数" min-width="70"> </el-table-column>
|
|
|
+ <el-table-column prop="contact" label="联系人" min-width="68"> </el-table-column>
|
|
|
+ <el-table-column prop="phone" label="联系电话" min-width="95"> </el-table-column>
|
|
|
+ <el-table-column prop="gradingOrganization" label="考级机构" show-overflow-tooltip min-width="160">
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column prop="organization" label="承办单位" min-width="160"> </el-table-column>
|
|
|
+ <el-table-column prop="examPoint" label="考级点"> </el-table-column>
|
|
|
+ <el-table-column label="操作" align="center" fixed="right" min-width="340">
|
|
|
+ <template slot-scope="{ row }">
|
|
|
+ <el-button @click="showRow(row)" size="mini" plain>查看</el-button>
|
|
|
+ <el-button type="success" @click="editRow(row)" size="mini" plain>编辑</el-button>
|
|
|
+ <el-button type="warning" size="mini" plain>浏览视频</el-button>
|
|
|
+ <el-button @click="showCode(row)" type="primary" size="mini" plain>查看二维码</el-button>
|
|
|
+ <!-- <el-button @click="deleteRow(row)" type="danger" size="mini" plain>删除</el-button> -->
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ </el-table>
|
|
|
+ <div class="pagination-wrapper">
|
|
|
+ <!-- <div class="multiple-mode-wrapper">
|
|
|
+ <el-button v-if="!multipleMode" @click="toggleMultipleMode(true)">批量编辑</el-button>
|
|
|
+ <el-button-group v-else>
|
|
|
+ <el-button @click="operation1">批量操作1</el-button>
|
|
|
+ <el-button @click="operation2">批量操作2</el-button>
|
|
|
+ <el-button @click="toggleMultipleMode(false)">取消</el-button>
|
|
|
+ </el-button-group>
|
|
|
+ </div> -->
|
|
|
+ <el-pagination
|
|
|
+ background
|
|
|
+ @size-change="onSizeChange"
|
|
|
+ @current-change="onCurrentChange"
|
|
|
+ :current-page="page"
|
|
|
+ :page-sizes="[10, 20, 30, 40, 50]"
|
|
|
+ :page-size="pageSize"
|
|
|
+ layout="total, sizes, prev, pager, next, jumper"
|
|
|
+ :total="totalElements"
|
|
|
+ >
|
|
|
+ </el-pagination>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <el-dialog title="二维码" :visible.sync="dialogCode" width="400px" center>
|
|
|
+ <div style="margin-left: 70px;">
|
|
|
+ <qrcode-vue :value="dialogUrl" :size="200" level="H" />
|
|
|
+ </div>
|
|
|
+ </el-dialog>
|
|
|
+ </div>
|
|
|
+</template>
|
|
|
+<script>
|
|
|
+import delChild from '@/mixins/delChild';
|
|
|
+import { mapState } from 'vuex';
|
|
|
+import pageableTable from '@/mixins/pageableTable';
|
|
|
+import QrcodeVue from 'qrcode.vue';
|
|
|
+
|
|
|
+export default {
|
|
|
+ name: 'ProgrammeOrgList',
|
|
|
+ mixins: [pageableTable, delChild],
|
|
|
+ data() {
|
|
|
+ return {
|
|
|
+ multipleMode: false,
|
|
|
+ search: '',
|
|
|
+ url: '/programme/backAll',
|
|
|
+ downloading: false,
|
|
|
+ competitionGroupOptions: [
|
|
|
+ { label: '个人', value: 'SINGLE' },
|
|
|
+ { label: '集体', value: 'COLLECTIVE' }
|
|
|
+ ],
|
|
|
+ form: {},
|
|
|
+ competitionGroup: '',
|
|
|
+ levelSingleOptions: [],
|
|
|
+ levelCollectiveOptions: [],
|
|
|
+ levelSettingId: '',
|
|
|
+ dialogUrl: '',
|
|
|
+ dialogCode: false,
|
|
|
+ gradingOrganizationIdOptions: [],
|
|
|
+ gradingOrganizationId: '',
|
|
|
+ performanceId: '',
|
|
|
+ performances: [],
|
|
|
+ artTypes: [],
|
|
|
+ optionProps: {
|
|
|
+ value: 'id',
|
|
|
+ label: 'name',
|
|
|
+ children: 'children',
|
|
|
+ multiple: false,
|
|
|
+ emitPath: false,
|
|
|
+ checkStrictly: true,
|
|
|
+ expandTrigger: 'hover'
|
|
|
+ },
|
|
|
+ specialtyId: ''
|
|
|
+ };
|
|
|
+ },
|
|
|
+ created() {
|
|
|
+ this.$http
|
|
|
+ .post('/setting/byFlag', { flag: 3 })
|
|
|
+ .then(res => {
|
|
|
+ if (res.length > 0) {
|
|
|
+ res.forEach(item => {
|
|
|
+ this.levelSingleOptions.push({
|
|
|
+ label: item.name,
|
|
|
+ value: item.id,
|
|
|
+ desc: item.code
|
|
|
+ });
|
|
|
+ });
|
|
|
+ }
|
|
|
+ })
|
|
|
+ .catch(e => {
|
|
|
+ console.log(e);
|
|
|
+ this.$message.error(e.error);
|
|
|
+ });
|
|
|
+ if (this.$route.query.pid) {
|
|
|
+ this.performanceId = Number(this.$route.query.pid);
|
|
|
+ }
|
|
|
+ this.$http
|
|
|
+ .post('/setting/byFlag', { flag: 4 })
|
|
|
+ .then(res => {
|
|
|
+ if (res.length > 0) {
|
|
|
+ res.forEach(item => {
|
|
|
+ this.levelCollectiveOptions.push({
|
|
|
+ label: item.name,
|
|
|
+ value: item.id,
|
|
|
+ desc: item.code
|
|
|
+ });
|
|
|
+ });
|
|
|
+ }
|
|
|
+ })
|
|
|
+ .catch(e => {
|
|
|
+ console.log(e);
|
|
|
+ this.$message.error(e.error);
|
|
|
+ });
|
|
|
+ this.$http
|
|
|
+ .post('/gradingOrganization/all', { size: 1000, query: { del: false } }, { body: 'json' })
|
|
|
+ .then(res => {
|
|
|
+ if (res.content.length > 0) {
|
|
|
+ res.content.forEach(item => {
|
|
|
+ this.gradingOrganizationIdOptions.push({
|
|
|
+ label: item.name,
|
|
|
+ value: item.id
|
|
|
+ });
|
|
|
+ });
|
|
|
+ }
|
|
|
+ })
|
|
|
+ .catch(e => {
|
|
|
+ console.log(e);
|
|
|
+ this.$message.error(e.error);
|
|
|
+ });
|
|
|
+ this.$http
|
|
|
+ .post('/performance/all', { size: 1000, query: { del: false } }, { body: 'json' })
|
|
|
+ .then(res => {
|
|
|
+ if (res.content.length > 0) {
|
|
|
+ res.content.forEach(item => {
|
|
|
+ this.performances.push({
|
|
|
+ label: item.name,
|
|
|
+ value: item.id
|
|
|
+ });
|
|
|
+ });
|
|
|
+ }
|
|
|
+ })
|
|
|
+ .catch(e => {
|
|
|
+ console.log(e);
|
|
|
+ this.$message.error(e.error);
|
|
|
+ });
|
|
|
+ this.$http
|
|
|
+ .post('/artType/allList')
|
|
|
+ .then(res => {
|
|
|
+ this.artTypes = this.delChild(res);
|
|
|
+ })
|
|
|
+ .catch(e => {
|
|
|
+ console.log(e);
|
|
|
+ });
|
|
|
+ },
|
|
|
+ components: {
|
|
|
+ QrcodeVue
|
|
|
+ },
|
|
|
+ computed: {
|
|
|
+ selection() {
|
|
|
+ return this.$refs.table.selection.map(i => i.id);
|
|
|
+ }
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ competitionGroupFormatter(row, column, cellValue, index) {
|
|
|
+ let selectedOption = this.competitionGroupOptions.find(i => i.value === cellValue);
|
|
|
+ if (selectedOption) {
|
|
|
+ return selectedOption.label;
|
|
|
+ }
|
|
|
+ return '';
|
|
|
+ },
|
|
|
+ beforeGetData() {
|
|
|
+ let data = {
|
|
|
+ sort: 'createdAt,desc',
|
|
|
+ query: {}
|
|
|
+ };
|
|
|
+ if (this.competitionGroup) {
|
|
|
+ data.query.competitionGroup = this.competitionGroup;
|
|
|
+ }
|
|
|
+ if (this.levelSettingId) {
|
|
|
+ data.query.levelSettingId = this.levelSettingId;
|
|
|
+ }
|
|
|
+ if (this.gradingOrganizationId) {
|
|
|
+ data.query.gradingOrganizationId = this.gradingOrganizationId;
|
|
|
+ }
|
|
|
+ if (this.performanceId) {
|
|
|
+ data.query.performanceId = this.performanceId;
|
|
|
+ }
|
|
|
+ if (this.specialtyId) {
|
|
|
+ data.query.code = this.getCode(this.specialtyId);
|
|
|
+ }
|
|
|
+ return data;
|
|
|
+ },
|
|
|
+ toggleMultipleMode(multipleMode) {
|
|
|
+ this.multipleMode = multipleMode;
|
|
|
+ if (!multipleMode) {
|
|
|
+ this.$refs.table.clearSelection();
|
|
|
+ }
|
|
|
+ },
|
|
|
+ addRow() {
|
|
|
+ this.$router.push({
|
|
|
+ path: '/programmeEdit',
|
|
|
+ query: {
|
|
|
+ ...this.$route.query
|
|
|
+ }
|
|
|
+ });
|
|
|
+ },
|
|
|
+ editRow(row) {
|
|
|
+ this.$router.push({
|
|
|
+ path: '/programmeEdit',
|
|
|
+ query: {
|
|
|
+ id: row.id
|
|
|
+ }
|
|
|
+ });
|
|
|
+ },
|
|
|
+ showRow(row) {
|
|
|
+ this.$router.push({
|
|
|
+ path: '/programmeShow',
|
|
|
+ query: {
|
|
|
+ id: row.id
|
|
|
+ }
|
|
|
+ });
|
|
|
+ },
|
|
|
+ download() {
|
|
|
+ this.downloading = true;
|
|
|
+
|
|
|
+ let data = {
|
|
|
+ sort: 'createdAt,desc',
|
|
|
+ query: {}
|
|
|
+ };
|
|
|
+ if (this.competitionGroup) {
|
|
|
+ data.query.competitionGroup = this.competitionGroup;
|
|
|
+ }
|
|
|
+ if (this.levelSettingId) {
|
|
|
+ data.query.levelSettingId = this.levelSettingId;
|
|
|
+ }
|
|
|
+ if (this.gradingOrganizationId) {
|
|
|
+ data.query.gradingOrganizationId = this.gradingOrganizationId;
|
|
|
+ }
|
|
|
+ if (this.organizationId) {
|
|
|
+ data.query.organizationId = this.organizationId;
|
|
|
+ }
|
|
|
+ if (this.specialtyId) {
|
|
|
+ data.query.code = this.getCode(this.specialtyId);
|
|
|
+ }
|
|
|
+
|
|
|
+ this.$axios
|
|
|
+ .get('/programme/excel', {
|
|
|
+ responseType: 'blob',
|
|
|
+ params: data
|
|
|
+ })
|
|
|
+ .then(res => {
|
|
|
+ console.log(res);
|
|
|
+ this.downloading = false;
|
|
|
+ const downloadUrl = window.URL.createObjectURL(new Blob([res.data]));
|
|
|
+ const link = document.createElement('a');
|
|
|
+ link.href = downloadUrl;
|
|
|
+ link.setAttribute('download', res.headers['content-disposition'].split('filename=')[1]);
|
|
|
+ document.body.appendChild(link);
|
|
|
+ link.click();
|
|
|
+ link.remove();
|
|
|
+ })
|
|
|
+ .catch(e => {
|
|
|
+ console.log(e);
|
|
|
+ this.downloading = false;
|
|
|
+ this.$message.error(e.error);
|
|
|
+ });
|
|
|
+ },
|
|
|
+ operation1() {
|
|
|
+ this.$notify({
|
|
|
+ title: '提示',
|
|
|
+ message: this.selection
|
|
|
+ });
|
|
|
+ },
|
|
|
+ operation2() {
|
|
|
+ this.$message('操作2');
|
|
|
+ },
|
|
|
+ deleteRow(row) {
|
|
|
+ this.$alert('删除将无法恢复,确认要删除么?', '警告', { type: 'error' })
|
|
|
+ .then(() => {
|
|
|
+ return this.$http.post(`/programme/del/${row.id}`);
|
|
|
+ })
|
|
|
+ .then(() => {
|
|
|
+ this.$message.success('删除成功');
|
|
|
+ this.getData();
|
|
|
+ })
|
|
|
+ .catch(e => {
|
|
|
+ if (e !== 'cancel') {
|
|
|
+ this.$message.error(e.error);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ },
|
|
|
+ showCode(row) {
|
|
|
+ this.dialogCode = true;
|
|
|
+ this.dialogUrl =
|
|
|
+ 'http://wljtest.izouma.com/h5/home?performanceId=' +
|
|
|
+ row.performanceId +
|
|
|
+ '&performanceApplyId=' +
|
|
|
+ row.id;
|
|
|
+ },
|
|
|
+ clearSearch() {
|
|
|
+ this.competitionGroup = '';
|
|
|
+ this.levelSettingId = '';
|
|
|
+ this.gradingOrganizationId = '';
|
|
|
+ this.organizationId = '';
|
|
|
+ this.specialtyId = '';
|
|
|
+ this.getData();
|
|
|
+ },
|
|
|
+ getCode(value) {
|
|
|
+ return this.forTree(this.artTypes, value).code;
|
|
|
+ },
|
|
|
+ forTree(list, value) {
|
|
|
+ var result = null;
|
|
|
+ if (!list) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ for (var i in list) {
|
|
|
+ if (result !== null) {
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ var item = list[i];
|
|
|
+ if (item.id == value) {
|
|
|
+ result = item;
|
|
|
+ break;
|
|
|
+ } else if (item.children && item.children.length > 0) {
|
|
|
+ result = this.forTree(item.children, value);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return result;
|
|
|
+ }
|
|
|
+ }
|
|
|
+};
|
|
|
+</script>
|
|
|
+<style lang="less" scoped>
|
|
|
+.right {
|
|
|
+ float: right;
|
|
|
+}
|
|
|
+/deep/.el-form-item--mini.el-form-item,
|
|
|
+.el-form-item--small.el-form-item {
|
|
|
+ margin-bottom: 10px;
|
|
|
+}
|
|
|
+</style>
|