Commit 0f643150 authored by 张海景's avatar 张海景

update:报表改成模板,加上模板类型显示

parent 57275431
<template> <template>
<div class="app-container"> <div class="app-container">
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px"> <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
<el-form-item label="报表名称" prop="name"> <el-form-item label="模版名称" prop="name">
<el-input <el-input
v-model="queryParams.name" v-model="queryParams.name"
placeholder="请输入报表名称" placeholder="请输入模版名称"
clearable clearable
@keyup.enter.native="handleQuery" @keyup.enter.native="handleQuery"
/> />
...@@ -63,8 +63,15 @@ ...@@ -63,8 +63,15 @@
<el-table v-loading="loading" :data="listData" @selection-change="handleSelectionChange"> <el-table v-loading="loading" :data="listData" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" /> <el-table-column type="selection" width="55" align="center" />
<el-table-column label="报表名称" align="center" prop="name" /> <el-table-column label="模版名称" align="center" prop="name" />
<el-table-column label="模板类型" align="center" prop="reportType" /> <el-table-column label="模版类型" align="center" prop="reportType" >
<template slot-scope="scope">
<dict-tag
:options="dict.type.sys_report_type"
:value="scope.row.reportType"
/>
</template>
</el-table-column>
<el-table-column label="创建时间" align="center" prop="createTime" width="180"> <el-table-column label="创建时间" align="center" prop="createTime" width="180">
<template slot-scope="scope"> <template slot-scope="scope">
<span>{{ parseTime(scope.row.createTime, '{y}-{m}-{d}') }}</span> <span>{{ parseTime(scope.row.createTime, '{y}-{m}-{d}') }}</span>
...@@ -114,11 +121,11 @@ ...@@ -114,11 +121,11 @@
<!-- 添加或修改报表管理对话框 --> <!-- 添加或修改报表管理对话框 -->
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body> <el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="80px"> <el-form ref="form" :model="form" :rules="rules" label-width="80px">
<el-form-item label="报表名称" prop="name"> <el-form-item label="模版名称" prop="name">
<el-input v-model="form.name" placeholder="请输入报表名称" /> <el-input v-model="form.name" placeholder="请输入模版名称" />
</el-form-item> </el-form-item>
<el-form-item label="报表类型" prop="reportType"> <el-form-item label="模版类型" prop="reportType">
<el-select style="width:100%;" v-model="form.reportType" placeholder="请选择模类型"> <el-select style="width:100%;" v-model="form.reportType" placeholder="请选择模类型">
<el-option <el-option
v-for="dict in dict.type.sys_report_type" v-for="dict in dict.type.sys_report_type"
:key="dict.value" :key="dict.value"
...@@ -159,7 +166,7 @@ export default { ...@@ -159,7 +166,7 @@ export default {
showSearch: true, showSearch: true,
// 总条数 // 总条数
total: 0, total: 0,
// 报表管理表格数据 // 模版管理表格数据
listData: [], listData: [],
// 弹出层标题 // 弹出层标题
title: "", title: "",
...@@ -179,7 +186,7 @@ export default { ...@@ -179,7 +186,7 @@ export default {
// 表单校验 // 表单校验
rules: { rules: {
name: [ name: [
{ required: true, message: "报表名称不能为空", trigger: "blur" } { required: true, message: "模版名称不能为空", trigger: "blur" }
], ],
} }
}; };
...@@ -188,7 +195,7 @@ export default { ...@@ -188,7 +195,7 @@ export default {
this.getList(); this.getList();
}, },
methods: { methods: {
/** 查询报表管理列表 */ /** 查询模版管理列表 */
getList() { getList() {
this.loading = true; this.loading = true;
listReport({...this.queryParams, isPrintTemplate:1}).then(response => { listReport({...this.queryParams, isPrintTemplate:1}).then(response => {
...@@ -233,9 +240,9 @@ export default { ...@@ -233,9 +240,9 @@ export default {
handleAdd() { handleAdd() {
this.reset(); this.reset();
this.open = true; this.open = true;
this.title = "添加报表管理"; this.title = "添加模版管理";
}, },
/** 报表预览 */ /** 模版预览 */
handleDesigner(name) { handleDesigner(name) {
window.open(`${this.website.reportUrl}/designer?_u=mysql:`+name) window.open(`${this.website.reportUrl}/designer?_u=mysql:`+name)
}, },
...@@ -246,7 +253,7 @@ export default { ...@@ -246,7 +253,7 @@ export default {
getReport(id).then(response => { getReport(id).then(response => {
this.form = response.data; this.form = response.data;
this.open = true; this.open = true;
this.title = "修改报表管理"; this.title = "修改模版管理";
}); });
}, },
/** 提交按钮 */ /** 提交按钮 */
...@@ -272,7 +279,7 @@ export default { ...@@ -272,7 +279,7 @@ export default {
/** 删除按钮操作 */ /** 删除按钮操作 */
handleDelete(row) { handleDelete(row) {
const ids = row.id || this.ids; const ids = row.id || this.ids;
this.$modal.confirm('是否确认删除报表管理编号为"' + ids + '"的数据项?').then(function() { this.$modal.confirm('是否确认删除模版管理编号为"' + ids + '"的数据项?').then(function() {
return delReport(ids); return delReport(ids);
}).then(() => { }).then(() => {
this.getList(); this.getList();
...@@ -283,7 +290,7 @@ export default { ...@@ -283,7 +290,7 @@ export default {
handleExport() { handleExport() {
this.download('ureport/export', { this.download('ureport/export', {
...this.queryParams ...this.queryParams
}, `报表模块_${new Date().getTime()}.xlsx`) }, `模版模块_${new Date().getTime()}.xlsx`)
} }
} }
}; };
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment