| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835 |
- <template>
- <div class="list-view">
- <div class="filters-container">
- <el-form :model="form" inline size="mini" 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.id"
- :label="item.name"
- :value="item.id"
- >
- </el-option>
- </el-select>
- </el-form-item>
- </el-col>
- <el-col :span="8">
- <el-form-item label="考级机构名称">
- <el-select
- v-model="form.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="form.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="form.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="form.competitionGroup">
- <el-select
- v-model="form.levelSettingId"
- clearable
- filterable
- placeholder="参赛级别"
- style="width: 100%"
- v-if="form.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="form.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-row>
- <el-col :span="8">
- <el-form-item label="节目名称">
- <el-input placeholder="节目名称" v-model="form.name" clearable></el-input>
- </el-form-item>
- </el-col>
- <el-col :span="8">
- <el-form-item label="指导老师">
- <el-input placeholder="指导老师" v-model="form.instructor" clearable></el-input>
- </el-form-item>
- </el-col>
- </el-row>
- <el-form-item>
- <el-button @click="canAdd" type="primary" icon="el-icon-search">查询 </el-button>
- <el-button @click="addRow" type="primary" icon="el-icon-plus" v-if="add">添加 </el-button>
- <!-- <el-button @click="addRow" type="primary" icon="el-icon-plus">添加 </el-button> -->
- <el-upload
- :action="uploadUrl"
- :before-upload="beforeUpload"
- :headers="headers"
- :show-file-list="false"
- ref="upload"
- :on-success="onSuccess"
- class="uploader"
- :on-error="onfail"
- :loading="loading"
- :disabled="loading"
- >
- <el-button
- slot="trigger"
- type="primary"
- icon="el-icon-upload2"
- v-if="add"
- :loading="loading"
- :disabled="loading"
- >批量上传</el-button
- >
- </el-upload>
- <!-- <el-upload
- :action="uploadUrl"
- :before-upload="beforeUpload"
- :headers="headers"
- :show-file-list="false"
- ref="upload"
- :on-success="onSuccess"
- class="uploader"
- :on-error="onfail"
- :loading="loading"
- :disabled="loading"
- >
- <el-button
- slot="trigger"
- type="primary"
- icon="el-icon-upload2"
- :loading="loading"
- :disabled="loading"
- >批量上传</el-button
- >
- </el-upload> -->
- <el-button
- @click="download"
- type="primary"
- icon="el-icon-download"
- :loading="downloading"
- :disabled="totalElements < 1"
- >导出
- </el-button>
- <el-button @click="downloadTemp" type="primary" icon="el-icon-tickets" :loading="downloading"
- >模版下载
- </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="编号" width="70" fixed="left"> </el-table-column>
- <el-table-column prop="name" label="节目名称" fixed="left" show-overflow-tooltip> </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="gradingOrganizationId" label="考级机构" show-overflow-tooltip min-width="160">
- <template slot="header" slot-scope="{ column }">
- <sortable-header :column="column" :current-sort="sort" @changeSort="changeSort"> </sortable-header>
- </template>
- <template slot-scope="{ row }">
- <span>{{ row.gradingOrganization }}</span>
- </template>
- </el-table-column>
- <el-table-column prop="organizationId" label="承办单位" min-width="180">
- <template slot="header" slot-scope="{ column }">
- <sortable-header :column="column" :current-sort="sort" @changeSort="changeSort"> </sortable-header>
- </template>
- <template slot-scope="{ row }">
- <span>{{ row.organization }}</span>
- </template>
- </el-table-column>
- <el-table-column prop="examPoint" label="考级点" min-width="160">
- <template slot="header" slot-scope="{ column }">
- <sortable-header :column="column" :current-sort="sort" @changeSort="changeSort"> </sortable-header>
- </template>
- </el-table-column>
- <el-table-column prop="programmeStatus" label="节目状态" min-width="100">
- <template slot="header" slot-scope="{ column }">
- <sortable-header :column="column" :current-sort="sort" @changeSort="changeSort"> </sortable-header>
- </template>
- <template slot-scope="{ row }">
- <span v-if="row.process == 0 && row.programmeStatus == 'SUBMIT'">初审中</span>
- <span v-if="row.process == 1 && row.programmeStatus == 'SUBMIT'">初审通过</span>
- <span v-if="row.process == 2 && row.programmeStatus == 'SUBMIT'">复审中</span>
- <span v-if="row.process == 3 && row.programmeStatus == 'SUBMIT'">复审通过</span>
- <span v-if="row.programmeStatus == 'INITIAL'">未提交</span>
- <span v-if="row.programmeStatus == 'AUDIT_FAILED'">初审未通过</span>
- <span v-if="row.programmeStatus == 'REVIEW_FAILED'">复审未通过</span>
- </template>
- </el-table-column>
- <el-table-column prop="award" label="奖项" min-width="80" v-if="showAward"> </el-table-column>
- <el-table-column label="操作" align="center" fixed="right" min-width="300">
- <template slot-scope="{ row, $index }">
- <el-button @click="showRow(row)" size="mini" plain>查看</el-button>
- <el-button
- type="success"
- @click="editRow(row)"
- size="mini"
- plain
- v-if="row.programmeStatus == 'INITIAL' && add"
- >编辑</el-button
- >
- <el-button type="warning" @click="playVideo(row, $index)" size="mini" plain>查看作品</el-button>
- <el-button
- @click="showCode(row)"
- type="primary"
- size="mini"
- plain
- v-if="row.programmeStatus != 'INITIAL'"
- >查看二维码</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>
- <el-dialog
- :title="programme.name"
- class="videoDialog"
- destroy-on-close
- center
- append-to-body
- :visible.sync="showViedo"
- width="auto"
- >
- <video
- :src="programme.video"
- controls
- style="max-height: 600px; max-width: 100%; margin: 0 auto"
- v-if="programme.video"
- >
- 您的浏览器不支持 video 标签。
- </video>
- <img
- style="max-height: 600px; max-width: 100%; display: block; margin: auto"
- :src="programme.annex"
- alt=""
- v-if="programme.annex"
- />
- <div style="display: block; margin: 10px">
- <el-button size="mini" @click="move(-1)" :disabled="index == 0">上一个</el-button>
- <el-button
- size="mini"
- @click="move(1)"
- :disabled="(page - 1) * pageSize + index == totalElements - 1 || index >= pageSize - 1"
- >下一个</el-button
- >
- <el-button @click="showViedo = false" size="mini">关闭</el-button>
- </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';
- import resolveUrl from 'resolve-url';
- import { format } from 'date-fns';
- 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: {},
- levelSingleOptions: [],
- levelCollectiveOptions: [],
- dialogUrl: '',
- dialogCode: false,
- gradingOrganizationIdOptions: [],
- performanceId: '',
- performances: [],
- artTypes: [],
- optionProps: {
- value: 'id',
- label: 'name',
- children: 'children',
- multiple: false,
- emitPath: false,
- checkStrictly: true,
- expandTrigger: 'hover'
- },
- showViedo: false,
- showImg: false,
- videoUrl: '',
- annex: '',
- uploadUrl: '',
- currentTime: '',
- add: false,
- programmeStatusOptions: [
- { label: '未提交', value: 'INITIAL' },
- { label: '已提交', value: 'SUBMIT' },
- { label: '初选未通过', value: 'AUDIT_FAILED' },
- { label: '审核未通过', value: 'REVIEW_FAILED' },
- { label: '已评奖', value: 'COMPLETE' }
- ],
- loading: false,
- programme: {},
- index: 0,
- showAward: false
- };
- },
- created() {
- this.uploadUrl = resolveUrl(this.$baseUrl, 'programme/upload');
- this.currentTime = format(new Date(), 'yyyy-MM-dd');
- 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,
- sort: 'year,desc',
- query: {
- publish: true
- }
- },
- { body: 'json' }
- )
- .then(res => {
- if (res.content.length > 0) {
- // res.content.forEach(item => {
- // this.performances.push({
- // label: item.name,
- // value: item.id
- // });
- // });
- this.performances = res.content;
- if (!this.$route.query.pid) {
- this.performanceId = res.content[0].id;
- }
- this.canAdd();
- }
- })
- .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);
- },
- ...mapState(['organization']),
- headers() {
- return {
- Authorization: 'Bearer ' + sessionStorage.getItem('token')
- };
- }
- },
- methods: {
- programmeStatusFormatter(row, column, cellValue, index) {
- let selectedOption = this.programmeStatusOptions.find(i => i.value === cellValue);
- if (selectedOption) {
- return selectedOption.label;
- }
- return '';
- },
- competitionGroupFormatter(row, column, cellValue, index) {
- let selectedOption = this.competitionGroupOptions.find(i => i.value === cellValue);
- if (selectedOption) {
- return selectedOption.label;
- }
- return '';
- },
- beforeGetData() {
- let data = {
- query: {
- organizationId: this.organization.id,
- performanceId: Number(this.$route.query.pid)
- }
- };
- if (this.form.competitionGroup) {
- data.query.competitionGroup = this.form.competitionGroup;
- }
- if (this.form.levelSettingId) {
- data.query.levelSettingId = this.form.levelSettingId;
- }
- if (this.form.gradingOrganizationId) {
- data.query.gradingOrganizationId = this.form.gradingOrganizationId;
- }
- if (this.performanceId) {
- data.query.performanceId = this.performanceId;
- }
- if (this.form.specialtyId) {
- data.query.code = this.getCode(this.form.specialtyId);
- }
- if (this.form.name) {
- data.query.name = this.form.name;
- }
- if (this.form.instructor) {
- data.query.instructor = this.form.instructor;
- }
- 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: 'programmeStatus,desc',
- size: 1000,
- query: {
- organizationId: this.organization.id
- }
- };
- if (this.form.competitionGroup) {
- data.query.competitionGroup = this.form.competitionGroup;
- }
- if (this.form.levelSettingId) {
- data.query.levelSettingId = this.form.levelSettingId;
- }
- if (this.form.gradingOrganizationId) {
- data.query.gradingOrganizationId = this.form.gradingOrganizationId;
- }
- if (this.form.specialtyId) {
- data.query.code = this.getCode(this.form.specialtyId);
- }
- if (this.form.name) {
- data.query.name = this.form.name;
- }
- if (this.form.instructor) {
- data.query.instructor = this.form.instructor;
- }
- if (this.performanceId) {
- data.query.performanceId = this.performanceId;
- }
- 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);
- });
- },
- downloadTemp() {
- this.downloading = true;
- this.$axios
- .get('/programme/excelTemp', {
- responseType: 'blob'
- })
- .then(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://yskj.njlyw.cn:8081/h5/home?performanceId=' + row.performanceId + '&programmeId=' + row.id;
- },
- clearSearch() {
- this.form = {};
- 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;
- },
- // closeEvent() {
- // document.exitPictureInPicture();
- // },
- // playVideo(row) {
- // console.log(row);
- // this.showViedo = true;
- // this.videoUrl = row.video;
- // },
- playImg(row) {
- console.log(row);
- this.showImg = true;
- this.annex = row.annex;
- },
- upload() {},
- onfail(e) {
- console.log(e);
- this.$message.error('失败:' + e);
- this.loading = false;
- this.getData();
- },
- onSuccess() {
- this.$message.success('上传成功');
- this.loading = false;
- this.getData();
- },
- beforeUpload() {
- return this.$confirm('确认要上传文件吗?', '提示', {
- confirmButtonText: '确定',
- cancelButtonText: '取消',
- type: 'warning'
- }).then(() => {
- this.loading = true;
- });
- },
- canAdd() {
- let data = this.performances.find(item => {
- return item.id == this.performanceId;
- });
- // if (data.endDate >= this.currentTime) {
- // this.add = true;
- // } else {
- // this.add = false;
- // }
- this.add = data.close;
- this.showAward = data.showAward;
- this.getData();
- },
- playVideo(row, index) {
- this.index = index;
- this.showViedo = true;
- this.programme = row;
- },
- move(direction) {
- const end = direction + this.index;
- this.programme = { ...this.tableData[end] };
- this.index = end;
- }
- }
- };
- </script>
- <style lang="less" scoped>
- .right {
- float: right;
- }
- /deep/ .el-form-item__label {
- font-weight: bold;
- }
- /deep/ .el-input__inner {
- border: 1px solid #00000069 !important;
- }
- /deep/.el-form-item--mini.el-form-item,
- .el-form-item--small.el-form-item {
- margin-bottom: 10px;
- }
- .videoDialog {
- display: flex;
- align-items: center;
- justify-content: center;
- .el-dialog {
- max-width: 900px;
- margin-top: 0px;
- .close {
- position: absolute;
- right: 0px;
- top: -42px;
- width: 71px;
- height: 32px;
- background: #00000015;
- font-size: 12px;
- color: #fdffff;
- line-height: 32px;
- text-align: center;
- cursor: pointer;
- &:hover {
- background: #00000055;
- }
- }
- }
- .el-dialog__header {
- display: none;
- }
- .el-dialog__body {
- padding: 0;
- video {
- display: block;
- height: auto;
- width: 100%;
- outline: none;
- }
- }
- }
- .uploader {
- display: inline-block;
- margin: 0 10px;
- }
- </style>
|