|
@@ -38,8 +38,8 @@
|
|
placeholder="选择执行时间">
|
|
placeholder="选择执行时间">
|
|
</el-date-picker>
|
|
</el-date-picker>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
- <!-- <el-form-item label="事件地点" prop="eventPlace">-->
|
|
|
|
- <!-- <el-select v-model="queryParams.eventPlace" placeholder="请选择事件地点" clearable size="small">-->
|
|
|
|
|
|
+ <!-- <el-form-item label="地点" prop="eventPlace">-->
|
|
|
|
+ <!-- <el-select v-model="queryParams.eventPlace" placeholder="请选择地点" clearable size="small">-->
|
|
<!-- <el-option label="请选择字典生成" value="" />-->
|
|
<!-- <el-option label="请选择字典生成" value="" />-->
|
|
<!-- </el-select>-->
|
|
<!-- </el-select>-->
|
|
<!-- </el-form-item>-->
|
|
<!-- </el-form-item>-->
|
|
@@ -115,6 +115,19 @@
|
|
<!-- <el-table-column label="主键" align="center" prop="id" />-->
|
|
<!-- <el-table-column label="主键" align="center" prop="id" />-->
|
|
<el-table-column label="事件编号" align="center" prop="eventNo"/>
|
|
<el-table-column label="事件编号" align="center" prop="eventNo"/>
|
|
<el-table-column label="事件名称" align="center" prop="eventName"/>
|
|
<el-table-column label="事件名称" align="center" prop="eventName"/>
|
|
|
|
+ <el-table-column label="禁止取消预约时限" align="center" prop="banCancelSubscribeTimeLimit"/>
|
|
|
|
+ <el-table-column label="活动开始前多久提示" align="center" prop="howLongRemind"/>
|
|
|
|
+ <el-table-column label="数量限制" align="center" prop="limitNum"/>
|
|
|
|
+ <el-table-column label="事件开始时间" align="center" prop="eventStartTime" width="180">
|
|
|
|
+ <template slot-scope="scope">
|
|
|
|
+ <span>{{ parseTime(scope.row.eventStartTime, '{y}-{m}-{d} {h}:{i}:{s}') }}</span>
|
|
|
|
+ </template>
|
|
|
|
+ </el-table-column>
|
|
|
|
+ <el-table-column label="事件结束时间" align="center" prop="eventEndTime" width="180">
|
|
|
|
+ <template slot-scope="scope">
|
|
|
|
+ <span>{{ parseTime(scope.row.eventEndTime, '{y}-{m}-{d} {h}:{i}:{s}') }}</span>
|
|
|
|
+ </template>
|
|
|
|
+ </el-table-column>
|
|
<el-table-column label="开始时间" align="center" prop="startTime" width="180">
|
|
<el-table-column label="开始时间" align="center" prop="startTime" width="180">
|
|
<template slot-scope="scope">
|
|
<template slot-scope="scope">
|
|
<span>{{ parseTime(scope.row.startTime, '{y}-{m}-{d} {h}:{i}:{s}') }}</span>
|
|
<span>{{ parseTime(scope.row.startTime, '{y}-{m}-{d} {h}:{i}:{s}') }}</span>
|
|
@@ -135,7 +148,12 @@
|
|
<dict-tag :options="dict.type.event_type" :value="scope.row.eventType"/>
|
|
<dict-tag :options="dict.type.event_type" :value="scope.row.eventType"/>
|
|
</template>
|
|
</template>
|
|
</el-table-column>
|
|
</el-table-column>
|
|
- <el-table-column label="事件地点" align="center" prop="eventPlace" v-if="queryParams.eventStatus !== '1'"/>
|
|
|
|
|
|
+ <el-table-column label="地点" align="center" prop="eventPlace" v-if="queryParams.eventStatus !== '1'">
|
|
|
|
+ <template slot-scope="scope">
|
|
|
|
+ <treeselect v-model="scope.row.eventPlace" :options="placeOptions" :normalizer="normalizer" placeholder="请选择地点"
|
|
|
|
+ disabled/>
|
|
|
|
+ </template>
|
|
|
|
+ </el-table-column>
|
|
<el-table-column label="事件描述" align="center" prop="eventDescribe" v-if="queryParams.eventStatus !== '1'"/>
|
|
<el-table-column label="事件描述" align="center" prop="eventDescribe" v-if="queryParams.eventStatus !== '1'"/>
|
|
<el-table-column label="事件状态" align="center" prop="eventStatus">
|
|
<el-table-column label="事件状态" align="center" prop="eventStatus">
|
|
<template slot-scope="scope">
|
|
<template slot-scope="scope">
|
|
@@ -189,25 +207,46 @@
|
|
<el-form-item label="事件名称" prop="eventName">
|
|
<el-form-item label="事件名称" prop="eventName">
|
|
<el-input v-model="form.eventName" placeholder="请输入事件名称"/>
|
|
<el-input v-model="form.eventName" placeholder="请输入事件名称"/>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
- <el-form-item label="开始时间" prop="startTime">
|
|
|
|
|
|
+ <el-form-item label="事件项目" prop="eventName">
|
|
|
|
+ <el-input v-model="form.activityTypeId" placeholder="请输入事件名称"/>
|
|
|
|
+ </el-form-item>
|
|
|
|
+ <el-form-item label="禁止取消预约时限" prop="banCancelSubscribeTimeLimit">
|
|
|
|
+ <el-input v-model="form.banCancelSubscribeTimeLimit" placeholder="请输入禁止取消预约时限"/>
|
|
|
|
+ </el-form-item>
|
|
|
|
+ <el-form-item label="数量限制" prop="limitNum">
|
|
|
|
+ <el-input v-model="form.limitNum" placeholder="请输入数量限制"/>
|
|
|
|
+ </el-form-item>
|
|
|
|
+ <el-form-item label="活动开始前多久提示" prop="howLongRemind">
|
|
|
|
+ <el-input v-model="form.howLongRemind" placeholder="请输入活动开始前多久提示"/>
|
|
|
|
+ </el-form-item>
|
|
|
|
+ <el-form-item label="活动开始时间" prop="startTime">
|
|
<el-date-picker
|
|
<el-date-picker
|
|
clearable size="small"
|
|
clearable size="small"
|
|
- v-model="form.startTime"
|
|
|
|
|
|
+ v-model="form.eventStartTime"
|
|
type="datetime"
|
|
type="datetime"
|
|
value-format="yyyy-MM-dd HH:mm:ss"
|
|
value-format="yyyy-MM-dd HH:mm:ss"
|
|
placeholder="选择开始时间">
|
|
placeholder="选择开始时间">
|
|
</el-date-picker>
|
|
</el-date-picker>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
- <el-form-item label="执行时间" prop="eventTime">
|
|
|
|
|
|
+ <el-form-item label="活动结束时间" prop="startTime">
|
|
<el-date-picker
|
|
<el-date-picker
|
|
clearable size="small"
|
|
clearable size="small"
|
|
- v-model="form.eventTime"
|
|
|
|
|
|
+ v-model="form.eventEndTime"
|
|
type="datetime"
|
|
type="datetime"
|
|
value-format="yyyy-MM-dd HH:mm:ss"
|
|
value-format="yyyy-MM-dd HH:mm:ss"
|
|
- placeholder="选择执行时间">
|
|
|
|
|
|
+ placeholder="选择开始时间">
|
|
</el-date-picker>
|
|
</el-date-picker>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
- <el-form-item label="结束时间" prop="endTime">
|
|
|
|
|
|
+ <el-form-item label="预约开始时间" prop="startTime">
|
|
|
|
+ <el-date-picker
|
|
|
|
+ clearable size="small"
|
|
|
|
+ v-model="form.startTime"
|
|
|
|
+ type="datetime"
|
|
|
|
+ value-format="yyyy-MM-dd HH:mm:ss"
|
|
|
|
+ placeholder="选择开始时间">
|
|
|
|
+ </el-date-picker>
|
|
|
|
+ </el-form-item>
|
|
|
|
+ <el-form-item label="预约结束时间" prop="endTime">
|
|
<el-date-picker
|
|
<el-date-picker
|
|
clearable size="small"
|
|
clearable size="small"
|
|
v-model="form.endTime"
|
|
v-model="form.endTime"
|
|
@@ -216,6 +255,15 @@
|
|
placeholder="选择结束时间">
|
|
placeholder="选择结束时间">
|
|
</el-date-picker>
|
|
</el-date-picker>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
|
|
+ <el-form-item label="执行时间" prop="eventTime">
|
|
|
|
+ <el-date-picker
|
|
|
|
+ clearable size="small"
|
|
|
|
+ v-model="form.eventTime"
|
|
|
|
+ type="datetime"
|
|
|
|
+ value-format="yyyy-MM-dd HH:mm:ss"
|
|
|
|
+ placeholder="选择执行时间">
|
|
|
|
+ </el-date-picker>
|
|
|
|
+ </el-form-item>
|
|
<el-form-item label="事件类型" prop="eventType">
|
|
<el-form-item label="事件类型" prop="eventType">
|
|
<el-select v-model="form.eventType" placeholder="请选择事件类型">
|
|
<el-select v-model="form.eventType" placeholder="请选择事件类型">
|
|
<el-option
|
|
<el-option
|
|
@@ -226,10 +274,9 @@
|
|
></el-option>
|
|
></el-option>
|
|
</el-select>
|
|
</el-select>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
- <el-form-item label="事件地点" prop="eventPlace" v-if="queryParams.eventStatus !== '1'">
|
|
|
|
- <el-select v-model="form.eventPlace" placeholder="请选择事件地点">
|
|
|
|
- <el-option label="请选择字典生成" value=""/>
|
|
|
|
- </el-select>
|
|
|
|
|
|
+ <el-form-item label="地点" prop="eventPlace" v-if="queryParams.eventStatus !== '1'">
|
|
|
|
+ <treeselect v-model="form.eventPlace" :options="placeOptions" :normalizer="normalizer"
|
|
|
|
+ placeholder="请选择地点"/>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
<el-form-item label="事件描述" v-if="queryParams.eventStatus !== '1'">
|
|
<el-form-item label="事件描述" v-if="queryParams.eventStatus !== '1'">
|
|
<editor v-model="form.eventDescribe" :min-height="192"/>
|
|
<editor v-model="form.eventDescribe" :min-height="192"/>
|
|
@@ -257,13 +304,23 @@
|
|
</template>
|
|
</template>
|
|
|
|
|
|
<script>
|
|
<script>
|
|
-import {listEvent, getEvent, delEvent, addEvent, updateEvent, exportEvent} from "@/api/eventConfig/event";
|
|
|
|
|
|
+import { listEvent, getEvent, delEvent, addEvent, updateEvent, exportEvent } from '@/api/eventConfig/event'
|
|
|
|
+import { listPlace } from '@/api/canteen/place'
|
|
|
|
+import user from '@/store/modules/user'
|
|
|
|
+import Treeselect from '@riophae/vue-treeselect'
|
|
|
|
+import '@riophae/vue-treeselect/dist/vue-treeselect.css'
|
|
|
|
|
|
export default {
|
|
export default {
|
|
- name: "Event",
|
|
|
|
|
|
+ name: 'Event',
|
|
|
|
+ components: {
|
|
|
|
+ Treeselect
|
|
|
|
+ },
|
|
dicts: ['event_type', 'event_status'],
|
|
dicts: ['event_type', 'event_status'],
|
|
data() {
|
|
data() {
|
|
return {
|
|
return {
|
|
|
|
+
|
|
|
|
+ // 地点树选项
|
|
|
|
+ placeOptions: [],
|
|
// 遮罩层
|
|
// 遮罩层
|
|
loading: true,
|
|
loading: true,
|
|
// 导出遮罩层
|
|
// 导出遮罩层
|
|
@@ -282,7 +339,7 @@ export default {
|
|
eventList: [],
|
|
eventList: [],
|
|
id: '',
|
|
id: '',
|
|
// 弹出层标题
|
|
// 弹出层标题
|
|
- title: "",
|
|
|
|
|
|
+ title: '',
|
|
// 是否显示弹出层
|
|
// 是否显示弹出层
|
|
open: false,
|
|
open: false,
|
|
// 查询参数
|
|
// 查询参数
|
|
@@ -298,13 +355,13 @@ export default {
|
|
eventPlace: null,
|
|
eventPlace: null,
|
|
eventDescribe: null,
|
|
eventDescribe: null,
|
|
eventStatus: null,
|
|
eventStatus: null,
|
|
- isDelete: null,
|
|
|
|
|
|
+ isDelete: null
|
|
},
|
|
},
|
|
// 表单参数
|
|
// 表单参数
|
|
form: {},
|
|
form: {},
|
|
// 表单校验
|
|
// 表单校验
|
|
rules: {}
|
|
rules: {}
|
|
- };
|
|
|
|
|
|
+ }
|
|
},
|
|
},
|
|
created() {
|
|
created() {
|
|
// this.getList();
|
|
// this.getList();
|
|
@@ -312,20 +369,41 @@ export default {
|
|
methods: {
|
|
methods: {
|
|
/** 查询活动配置列表 */
|
|
/** 查询活动配置列表 */
|
|
getList() {
|
|
getList() {
|
|
- this.loading = true;
|
|
|
|
|
|
+ this.loading = true
|
|
listEvent(this.queryParams).then(response => {
|
|
listEvent(this.queryParams).then(response => {
|
|
- this.eventList = response.rows;
|
|
|
|
- this.total = response.total;
|
|
|
|
- this.loading = false;
|
|
|
|
- });
|
|
|
|
|
|
+ this.eventList = response.rows
|
|
|
|
+ this.total = response.total
|
|
|
|
+ this.loading = false
|
|
|
|
+ })
|
|
},
|
|
},
|
|
getEventId() {
|
|
getEventId() {
|
|
- return this.id;
|
|
|
|
|
|
+ return this.id
|
|
|
|
+ },
|
|
|
|
+ /** 查询地点下拉树结构 */
|
|
|
|
+ getTreeselect() {
|
|
|
|
+ listPlace({ jgid: user.state.organ }).then(response => {
|
|
|
|
+ this.placeOptions = []
|
|
|
|
+ const data = { placeId: 0, placeName: '顶级节点', children: [] }
|
|
|
|
+ data.children = this.handleTree(response.data, 'placeId', 'parentId')
|
|
|
|
+ this.placeOptions.push(data)
|
|
|
|
+ })
|
|
|
|
+ },
|
|
|
|
+
|
|
|
|
+ /** 转换地点数据结构 */
|
|
|
|
+ normalizer(node) {
|
|
|
|
+ if (node.children && !node.children.length) {
|
|
|
|
+ delete node.children
|
|
|
|
+ }
|
|
|
|
+ return {
|
|
|
|
+ id: node.placeId,
|
|
|
|
+ label: node.placeName,
|
|
|
|
+ children: node.children
|
|
|
|
+ }
|
|
},
|
|
},
|
|
// 取消按钮
|
|
// 取消按钮
|
|
cancel() {
|
|
cancel() {
|
|
- this.open = false;
|
|
|
|
- this.reset();
|
|
|
|
|
|
+ this.open = false
|
|
|
|
+ this.reset()
|
|
},
|
|
},
|
|
// 表单重置
|
|
// 表单重置
|
|
reset() {
|
|
reset() {
|
|
@@ -344,22 +422,22 @@ export default {
|
|
updateBy: null,
|
|
updateBy: null,
|
|
updateTime: null,
|
|
updateTime: null,
|
|
remark: null
|
|
remark: null
|
|
- };
|
|
|
|
- this.resetForm("form");
|
|
|
|
|
|
+ }
|
|
|
|
+ this.resetForm('form')
|
|
},
|
|
},
|
|
bindingGiftChild(row) {
|
|
bindingGiftChild(row) {
|
|
- this.id = row.id;
|
|
|
|
- this.$parent.$parent.getBindingList();
|
|
|
|
|
|
+ this.id = row.id
|
|
|
|
+ this.$parent.$parent.getBindingList()
|
|
},
|
|
},
|
|
/** 搜索按钮操作 */
|
|
/** 搜索按钮操作 */
|
|
handleQuery() {
|
|
handleQuery() {
|
|
- this.queryParams.pageNum = 1;
|
|
|
|
- this.getList();
|
|
|
|
|
|
+ this.queryParams.pageNum = 1
|
|
|
|
+ this.getList()
|
|
},
|
|
},
|
|
/** 重置按钮操作 */
|
|
/** 重置按钮操作 */
|
|
resetQuery() {
|
|
resetQuery() {
|
|
- this.resetForm("queryForm");
|
|
|
|
- this.handleQuery();
|
|
|
|
|
|
+ this.resetForm('queryForm')
|
|
|
|
+ this.handleQuery()
|
|
},
|
|
},
|
|
// 多选框选中数据
|
|
// 多选框选中数据
|
|
handleSelectionChange(selection) {
|
|
handleSelectionChange(selection) {
|
|
@@ -369,63 +447,63 @@ export default {
|
|
},
|
|
},
|
|
/** 新增按钮操作 */
|
|
/** 新增按钮操作 */
|
|
handleAdd() {
|
|
handleAdd() {
|
|
- this.reset();
|
|
|
|
- this.open = true;
|
|
|
|
- this.title = "添加活动配置";
|
|
|
|
|
|
+ this.reset()
|
|
|
|
+ this.open = true
|
|
|
|
+ this.title = '添加活动配置'
|
|
},
|
|
},
|
|
/** 修改按钮操作 */
|
|
/** 修改按钮操作 */
|
|
handleUpdate(row) {
|
|
handleUpdate(row) {
|
|
- this.reset();
|
|
|
|
|
|
+ this.reset()
|
|
const id = row.id || this.ids
|
|
const id = row.id || this.ids
|
|
getEvent(id).then(response => {
|
|
getEvent(id).then(response => {
|
|
- this.form = response.data;
|
|
|
|
- this.open = true;
|
|
|
|
- this.title = "修改活动配置";
|
|
|
|
- });
|
|
|
|
|
|
+ this.form = response.data
|
|
|
|
+ this.open = true
|
|
|
|
+ this.title = '修改活动配置'
|
|
|
|
+ })
|
|
},
|
|
},
|
|
/** 提交按钮 */
|
|
/** 提交按钮 */
|
|
submitForm() {
|
|
submitForm() {
|
|
- this.$refs["form"].validate(valid => {
|
|
|
|
|
|
+ this.$refs['form'].validate(valid => {
|
|
if (valid) {
|
|
if (valid) {
|
|
if (this.form.id != null) {
|
|
if (this.form.id != null) {
|
|
updateEvent(this.form).then(() => {
|
|
updateEvent(this.form).then(() => {
|
|
- this.$modal.msgSuccess("修改成功");
|
|
|
|
- this.open = false;
|
|
|
|
- this.getList();
|
|
|
|
- });
|
|
|
|
|
|
+ this.$modal.msgSuccess('修改成功')
|
|
|
|
+ this.open = false
|
|
|
|
+ this.getList()
|
|
|
|
+ })
|
|
} else {
|
|
} else {
|
|
addEvent(this.form).then(() => {
|
|
addEvent(this.form).then(() => {
|
|
- this.$modal.msgSuccess("新增成功");
|
|
|
|
- this.open = false;
|
|
|
|
- this.getList();
|
|
|
|
- });
|
|
|
|
|
|
+ this.$modal.msgSuccess('新增成功')
|
|
|
|
+ this.open = false
|
|
|
|
+ this.getList()
|
|
|
|
+ })
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- });
|
|
|
|
|
|
+ })
|
|
},
|
|
},
|
|
/** 删除按钮操作 */
|
|
/** 删除按钮操作 */
|
|
handleDelete(row) {
|
|
handleDelete(row) {
|
|
- const ids = row.id || this.ids;
|
|
|
|
- this.$modal.confirm('是否确认删除活动配置编号为"' + ids + '"的数据项?').then(function () {
|
|
|
|
- return delEvent(ids);
|
|
|
|
|
|
+ const ids = row.id || this.ids
|
|
|
|
+ this.$modal.confirm('是否确认删除活动配置编号为"' + ids + '"的数据项?').then(function() {
|
|
|
|
+ return delEvent(ids)
|
|
}).then(() => {
|
|
}).then(() => {
|
|
- this.getList();
|
|
|
|
- this.$modal.msgSuccess("删除成功");
|
|
|
|
|
|
+ this.getList()
|
|
|
|
+ this.$modal.msgSuccess('删除成功')
|
|
}).catch(() => {
|
|
}).catch(() => {
|
|
- });
|
|
|
|
|
|
+ })
|
|
},
|
|
},
|
|
/** 导出按钮操作 */
|
|
/** 导出按钮操作 */
|
|
handleExport() {
|
|
handleExport() {
|
|
- const queryParams = this.queryParams;
|
|
|
|
|
|
+ const queryParams = this.queryParams
|
|
this.$modal.confirm('是否确认导出所有活动配置数据项?').then(() => {
|
|
this.$modal.confirm('是否确认导出所有活动配置数据项?').then(() => {
|
|
- this.exportLoading = true;
|
|
|
|
- return exportEvent(queryParams);
|
|
|
|
|
|
+ this.exportLoading = true
|
|
|
|
+ return exportEvent(queryParams)
|
|
}).then(response => {
|
|
}).then(response => {
|
|
- this.$download.name(response.msg);
|
|
|
|
- this.exportLoading = false;
|
|
|
|
|
|
+ this.$download.name(response.msg)
|
|
|
|
+ this.exportLoading = false
|
|
}).catch(() => {
|
|
}).catch(() => {
|
|
- });
|
|
|
|
|
|
+ })
|
|
}
|
|
}
|
|
}
|
|
}
|
|
-};
|
|
|
|
|
|
+}
|
|
</script>
|
|
</script>
|