增加配置报名处理方式
This commit is contained in:
@@ -32,3 +32,25 @@ export async function updateTopicEnrollStatus(id, status) {
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出订单
|
||||
* @param params 查询条件
|
||||
*/
|
||||
export async function exportTopicEnroll(params) {
|
||||
const res = await request.get('/sytopic/enroll/export', {
|
||||
params
|
||||
});
|
||||
if (res.data.code === 0) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
export async function pageSyTopicEnrollTopic() {
|
||||
const res = await request.get('/sytopic/enroll/topicList', {});
|
||||
if (res.data.code === 0) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
@@ -55,6 +55,16 @@
|
||||
/>
|
||||
<div class="ele-text-secondary">建议尺寸100X100</div>
|
||||
</el-form-item>
|
||||
<el-form-item
|
||||
label="线索处理:"
|
||||
v-show="form.organizationType == 1 ? true : false"
|
||||
>
|
||||
<el-select v-model="form.enrollDeal">
|
||||
<el-option value="0" label="不处理" />
|
||||
<el-option value="1" label="后台客服清洗" />
|
||||
<el-option value="2" label="派发理车宝" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col v-bind="styleResponsive ? { sm: 12 } : { span: 12 }">
|
||||
<el-form-item label="机构类型:" prop="organizationType">
|
||||
@@ -127,7 +137,8 @@
|
||||
sortNumber: null,
|
||||
comments: '',
|
||||
logo: [],
|
||||
city: []
|
||||
city: [],
|
||||
enrollDeal: 0
|
||||
};
|
||||
return {
|
||||
defaultForm,
|
||||
|
||||
@@ -2,19 +2,60 @@
|
||||
<div class="ele-body">
|
||||
<el-card shadow="never">
|
||||
<!-- 搜索表单 -->
|
||||
<!--
|
||||
<el-form label-width="77px" class="ele-form-search">
|
||||
<el-row :gutter="15">
|
||||
<el-col :md="6" :sm="12">
|
||||
<el-form-item label="专题标题:">
|
||||
<el-input
|
||||
placeholder="请输入专题标题"
|
||||
clearable
|
||||
v-model="where.title"
|
||||
<el-col v-bind="styleResponsive ? { lg: 4, md: 8 } : { span: 4 }">
|
||||
<el-form-item label="专题:">
|
||||
<ele-tree-select
|
||||
:data="topicLists"
|
||||
label-key="title"
|
||||
value-key="id"
|
||||
v-model="where.topicId"
|
||||
:clearable="true"
|
||||
placeholder="请选择"
|
||||
:disabled="false"
|
||||
:default-expand-all="false"
|
||||
:expand-on-click-node="false"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :md="6" :sm="12">
|
||||
<el-col v-bind="styleResponsive ? { lg: 5, md: 10 } : { span: 5 }">
|
||||
<el-form-item label="姓名:">
|
||||
<el-input
|
||||
placeholder="请输入姓名"
|
||||
clearable
|
||||
v-model="where.name"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col v-bind="styleResponsive ? { lg: 5, md: 10 } : { span: 5 }">
|
||||
<el-form-item label="手机号:">
|
||||
<el-input
|
||||
placeholder="请输入手机号"
|
||||
clearable
|
||||
v-model="where.mobile"
|
||||
type="number"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col v-bind="styleResponsive ? { lg: 5, md: 10 } : { span: 5 }">
|
||||
<el-form-item label="状态:">
|
||||
<el-select
|
||||
clearable
|
||||
v-model="where.status"
|
||||
placeholder="请选择"
|
||||
class="ele-fluid"
|
||||
>
|
||||
<el-option
|
||||
v-for="(item, key) in statusLists"
|
||||
:key="key"
|
||||
:value="key"
|
||||
:label="item"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col v-bind="styleResponsive ? { lg: 5, md: 10 } : { span: 5 }">
|
||||
<div class="ele-form-actions">
|
||||
<el-button
|
||||
type="primary"
|
||||
@@ -29,7 +70,6 @@
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
-->
|
||||
<!-- 数据表格 -->
|
||||
<ele-pro-table
|
||||
ref="table"
|
||||
@@ -39,7 +79,17 @@
|
||||
cache-key="syliveActivityTable"
|
||||
>
|
||||
<!-- 表头工具栏 -->
|
||||
<template v-slot:toolbar></template>
|
||||
<template v-slot:toolbar>
|
||||
<el-button
|
||||
size="small"
|
||||
type="primary"
|
||||
class="ele-btn-icon"
|
||||
icon="el-icon-download"
|
||||
@click="exportData"
|
||||
>
|
||||
导出
|
||||
</el-button>
|
||||
</template>
|
||||
<!-- 状态列 -->
|
||||
<template v-slot:status="{ row }">
|
||||
{{ statusLists[row.status] }}
|
||||
@@ -69,12 +119,14 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { removeTopic } from '@/api/sytopic/sytopic';
|
||||
import {
|
||||
pageSyTopicEnroll,
|
||||
pageSyTopicEnrollTypes
|
||||
pageSyTopicEnrollTypes,
|
||||
exportTopicEnroll,
|
||||
pageSyTopicEnrollTopic
|
||||
} from '@/api/sytopic/enroll';
|
||||
import EditStatus from '@/views/sytopic/enroll/components/edit-status.vue';
|
||||
import { utils, writeFile } from 'xlsx';
|
||||
|
||||
export default {
|
||||
name: 'syTopicEnroll',
|
||||
@@ -127,7 +179,7 @@
|
||||
showOverflowTooltip: true
|
||||
},
|
||||
{
|
||||
prop: 'status',
|
||||
prop: 'status_cn',
|
||||
label: '状态',
|
||||
align: 'center',
|
||||
resizable: false,
|
||||
@@ -149,12 +201,21 @@
|
||||
current: null,
|
||||
// 是否显示编辑弹窗
|
||||
showEdit: false,
|
||||
statusLists: []
|
||||
statusLists: [],
|
||||
title: '专题报名',
|
||||
topicLists: []
|
||||
};
|
||||
},
|
||||
created() {},
|
||||
computed: {
|
||||
// 是否开启响应式布局
|
||||
styleResponsive() {
|
||||
return this.$store.state.theme.styleResponsive;
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.topicListsQuery();
|
||||
},
|
||||
methods: {
|
||||
/* 查询机构 */
|
||||
statusQuery() {
|
||||
pageSyTopicEnrollTypes()
|
||||
.then((list) => {
|
||||
@@ -164,6 +225,20 @@
|
||||
this.$message.error(e.message);
|
||||
});
|
||||
},
|
||||
topicListsQuery() {
|
||||
pageSyTopicEnrollTopic()
|
||||
.then((list) => {
|
||||
console.log(list);
|
||||
this.topicLists = this.$util.toTreeData({
|
||||
data: list,
|
||||
idField: 'id',
|
||||
parentIdField: 'title'
|
||||
});
|
||||
})
|
||||
.catch((e) => {
|
||||
this.$message.error(e.message);
|
||||
});
|
||||
},
|
||||
/* 表格数据源 */
|
||||
datasource({ page, limit, where, order }) {
|
||||
if (page === 1) {
|
||||
@@ -175,44 +250,6 @@
|
||||
reload() {
|
||||
this.$refs.table.reload({ page: 1, where: this.where });
|
||||
},
|
||||
/* 删除 */
|
||||
remove(row) {
|
||||
const loading = this.$loading({ lock: true });
|
||||
removeTopic(row.id)
|
||||
.then((msg) => {
|
||||
loading.close();
|
||||
this.$message.success(msg);
|
||||
this.reload();
|
||||
})
|
||||
.catch((e) => {
|
||||
loading.close();
|
||||
this.$message.error(e.message);
|
||||
});
|
||||
},
|
||||
/* 批量删除 */
|
||||
removeBatch() {
|
||||
if (!this.selection.length) {
|
||||
this.$message.error('请至少选择一条数据');
|
||||
return;
|
||||
}
|
||||
this.$confirm('确定要删除选中的活动吗?', '提示', {
|
||||
type: 'warning'
|
||||
})
|
||||
.then(() => {
|
||||
const loading = this.$loading({ lock: true });
|
||||
removeTopic(this.selection.map((d) => d.id))
|
||||
.then((msg) => {
|
||||
loading.close();
|
||||
this.$message.success(msg);
|
||||
this.reload();
|
||||
})
|
||||
.catch((e) => {
|
||||
loading.close();
|
||||
this.$message.error(e.message);
|
||||
});
|
||||
})
|
||||
.catch(() => {});
|
||||
},
|
||||
showEditStatus(row) {
|
||||
this.showEdit = true;
|
||||
this.current = row;
|
||||
@@ -222,6 +259,37 @@
|
||||
/* 重置搜索 */
|
||||
reset() {
|
||||
this.where = {};
|
||||
},
|
||||
/* 导出数据 */
|
||||
exportData() {
|
||||
const loading = this.$loading({ lock: true });
|
||||
this.$refs.table.doRequest(({ where, order }) => {
|
||||
exportTopicEnroll({ ...where, ...order })
|
||||
.then((data) => {
|
||||
loading.close();
|
||||
const array = [data.columns];
|
||||
data.list.forEach((d) => {
|
||||
let arrayItem = [];
|
||||
for (let key in d) {
|
||||
arrayItem.push(d[key]);
|
||||
}
|
||||
array.push(arrayItem);
|
||||
});
|
||||
writeFile(
|
||||
{
|
||||
SheetNames: ['Sheet1'],
|
||||
Sheets: {
|
||||
Sheet1: utils.aoa_to_sheet(array)
|
||||
}
|
||||
},
|
||||
this.title + '.xlsx'
|
||||
);
|
||||
})
|
||||
.catch((e) => {
|
||||
loading.close();
|
||||
this.$message.error(e.message);
|
||||
});
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user