|
@@ -0,0 +1,589 @@
|
|
|
+<template>
|
|
|
+ <div class="layout_container">
|
|
|
+ <div class="layout_main layout_container layout-horizontal">
|
|
|
+ <aside style="width: 500px;">
|
|
|
+ <div class="layout_container">
|
|
|
+ <header>
|
|
|
+ <el-input v-model="queryParam.text" style="width: 369px;" placeholder="输入关键词搜索" @input="queryTargetDictConstantData"/>
|
|
|
+ </header>
|
|
|
+ <div class="layout_main layout_card">
|
|
|
+ <el-table :data="targetConstantData" stripe border highlight-current-row @row-click="targetConstantClick">
|
|
|
+ <el-table-column type="index" header-align="center" />
|
|
|
+ <el-table-column prop="reportName" label="指标名称" header-align="center" width="240"/>
|
|
|
+ <el-table-column prop="baseSql" label="指标值" header-align="center">
|
|
|
+ <template #default="scope">
|
|
|
+ {{ scope.row.baseSql.replaceAll('select', '').replaceAll('as sg', '').trim() }}
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ </el-table>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </aside>
|
|
|
+ <div class="layout_container layout_overflow_auto">
|
|
|
+ <header>
|
|
|
+ <el-button type="primary" icon="Plus" @click="addForm(ruleFormRef)"
|
|
|
+ style="margin-left: 10px">新增</el-button>
|
|
|
+ <el-button type="primary" icon="Edit" @click="editForm(ruleFormRef)"
|
|
|
+ style="margin-left: 10px">编辑</el-button>
|
|
|
+ <el-button type="primary" icon="Check" @click="submitForm(ruleFormRef)"
|
|
|
+ style="margin-left: 10px">保存</el-button>
|
|
|
+ <el-button type="primary" icon="Refresh" @click="resetForm(ruleFormRef)"
|
|
|
+ style="margin-left: 10px">重置</el-button>
|
|
|
+ </header>
|
|
|
+ <div class="layout_main layout_card">
|
|
|
+ <el-form ref="ruleFormRef" :model="reportForm" :rules="rules" label-width="120px"
|
|
|
+ class="demo-ruleForm" status-icon :disabled="isDisabledForm">
|
|
|
+ <el-row>
|
|
|
+ <el-col :span="12">
|
|
|
+ <el-form-item label="报表名称" prop="reportName">
|
|
|
+ <el-input v-model="reportForm.reportName" minlength="1" maxlength="256"
|
|
|
+ show-word-limit />
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="12">
|
|
|
+ <el-form-item label="报表编码" prop="reportId">
|
|
|
+ <el-input v-model="reportForm.reportId" minlength="1" maxlength="12"
|
|
|
+ show-word-limit />
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ <el-row>
|
|
|
+ <el-col :span="8">
|
|
|
+ <el-form-item label="报表类型" prop="reportType">
|
|
|
+ <el-select v-model="reportForm.reportType" placeholder="请选择报表类型">
|
|
|
+ <el-option v-for="item in reportTypeList" :key="item.reportType"
|
|
|
+ :label="item.reportLabel" :value="item.reportType">
|
|
|
+ <span style="float: left">{{ item.reportType }}</span>
|
|
|
+ <span style="float: right; color: var(--el-text-color-secondary); font-size: 13px; ">{{ item.reportLabel }}</span>
|
|
|
+ </el-option>
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="8">
|
|
|
+ <el-form-item label="单位" prop="unit">
|
|
|
+ <el-input v-model="reportForm.unit" minlength="0" maxlength="8" show-word-limit />
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="8">
|
|
|
+ <el-form-item label="报表分组类型" prop="level">
|
|
|
+ <el-select v-model="levelId" filterable :filter-method="levelFilterMethod"
|
|
|
+ value-key="id" placeholder="请选择报表分组类型">
|
|
|
+ <el-option v-for="item in levelList" :key="item.reportId"
|
|
|
+ :label="item.levelName" :value="item.levelId">
|
|
|
+ <span style="float: left">{{ item.levelId }}</span>
|
|
|
+ <span style="float: right; color: var(--el-text-color-secondary); font-size: 13px; ">{{ item.levelName }}</span>
|
|
|
+ </el-option>
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ <el-row>
|
|
|
+ <el-col :span="8">
|
|
|
+ <el-form-item label="报表值" prop="baseSql">
|
|
|
+ <el-input v-model="reportForm.baseSql"/>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="8">
|
|
|
+ <el-form-item label="指标排序" prop="reportSort">
|
|
|
+ <el-input v-model="reportForm.reportSort" minlength="0" maxlength="256"
|
|
|
+ show-word-limit />
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="8">
|
|
|
+ <el-form-item label="是否有效" prop="flag">
|
|
|
+ <el-switch v-model="reportForm.flag" active-value="Y" inactive-value="N"
|
|
|
+ active-color="#13ce66" inactive-color="#ff4949" />
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+<!-- <el-row>-->
|
|
|
+<!-- <el-col :span="8">-->
|
|
|
+<!-- <el-form-item label="报表文件" prop="fileArr">-->
|
|
|
+<!-- <el-upload-->
|
|
|
+<!-- ref="fileArr"-->
|
|
|
+<!-- class="upload-demo"-->
|
|
|
+<!-- action="https://run.mocky.io/v3/9d059bf9-4660-45f2-925d-ce80ad6c4d15"-->
|
|
|
+<!-- :auto-upload="false"-->
|
|
|
+<!-- >-->
|
|
|
+<!-- <template #trigger>-->
|
|
|
+<!-- <el-button type="primary">选择文件</el-button>-->
|
|
|
+<!-- </template>-->
|
|
|
+<!-- <el-button class="ml-3" style="margin-left: 5px" type="success" @click="submitUpload">-->
|
|
|
+<!-- 文件上传-->
|
|
|
+<!-- </el-button>-->
|
|
|
+<!-- </el-upload>-->
|
|
|
+<!-- </el-form-item>-->
|
|
|
+<!-- </el-col>-->
|
|
|
+<!-- </el-row>-->
|
|
|
+ </el-form>
|
|
|
+ <el-divider />
|
|
|
+ <el-form ref="ruleFormRef" label-width="120px" :model="sqlForm" class="demo-ruleForm">
|
|
|
+ <el-row>
|
|
|
+ <el-col :span="12">
|
|
|
+ <el-form-item label="计算结果测试" prop="childResult">
|
|
|
+ <el-input v-model="sqlForm.calcResult" type="textarea" />
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="12">
|
|
|
+ <el-form-item>
|
|
|
+ <el-button type="primary" @click="sqlExecute(ruleFormRef)"> 指标运行结果 </el-button>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ </el-form>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+</template>
|
|
|
+<script setup name="TargetDictConstant" lang="ts">
|
|
|
+import { ref, reactive, onMounted, nextTick } from 'vue'
|
|
|
+import { ElMessage } from 'element-plus'
|
|
|
+import { formatDate } from '@/utils/date'
|
|
|
+import type { FormInstance, FormRules, UploadInstance } from 'element-plus'
|
|
|
+import { selectTargetDictConstantData, selectReportDict, selectReportType, reportSqlExecute, selectReportLevel, saveReportBaseInfo, selectReportLevelDict } from '@/api/target-management/report-dict'
|
|
|
+import { selectReportInfoData } from '@/api/reports/high-report'
|
|
|
+import { queryDept } from '@/api/public-api'
|
|
|
+import { clone } from '@/utils/clone'
|
|
|
+import { useUserStore } from "@/pinia/user-store";
|
|
|
+
|
|
|
+const userInfo = useUserStore().userInfo
|
|
|
+const isAddSave = ref(true)
|
|
|
+// 是否开启Form表单编辑
|
|
|
+const isDisabledForm = ref(false)
|
|
|
+const deptWardList = ref([])
|
|
|
+const nowDay = new Date()
|
|
|
+const ds = formatDate(nowDay)
|
|
|
+const ruleFormRef = ref<FormInstance>()
|
|
|
+const levelId = ref('group_zb')
|
|
|
+const targetConstantData = ref([])
|
|
|
+const reportTypeList = ref([
|
|
|
+ {
|
|
|
+ reportType: '',
|
|
|
+ reportLabel: ''
|
|
|
+ }
|
|
|
+])
|
|
|
+const reportData = ref({
|
|
|
+ reportId: '', // 报表id
|
|
|
+ reportName: '', // 报表名称
|
|
|
+ reportType: '', // 报表类型
|
|
|
+ unit: '', // 单位
|
|
|
+ level: '', // 报表分组类型
|
|
|
+ gatherSql: '', // 聚合sql
|
|
|
+ baseSql: '', // 基础sql
|
|
|
+ displayType: '', // 展示类型
|
|
|
+ menuId: '', // 菜单id
|
|
|
+ sort: '', // 面板排序
|
|
|
+ reportSort: '', // 报表统计排序
|
|
|
+ file: '', // 报表证明文件
|
|
|
+ isCw: 'N', // 是否财务报表大屏显示指标(Y: 是)
|
|
|
+ isYj: 'N', // 是否医技报表大屏显示指标(Y: 是)
|
|
|
+ flag: 'Y', // 是否有效
|
|
|
+})
|
|
|
+
|
|
|
+const levelList = ref([
|
|
|
+ {
|
|
|
+ id: '',
|
|
|
+ levelId: '',
|
|
|
+ reportId: '',
|
|
|
+ levelName: '',
|
|
|
+ }
|
|
|
+])
|
|
|
+
|
|
|
+const deptMethod = (val: string) => {
|
|
|
+ queryDept(val).then((res: any) => {
|
|
|
+ deptWardList.value = res
|
|
|
+ })
|
|
|
+}
|
|
|
+
|
|
|
+const queryParam = reactive({
|
|
|
+ text: '', // 指标关键字
|
|
|
+ reportId: '', // 报表id
|
|
|
+ reportName: '', // 报表名称
|
|
|
+ reportType: 'sg', // 报表类型
|
|
|
+ startTime: '', // 开始时间
|
|
|
+ endTime: '', // 结束时间
|
|
|
+})
|
|
|
+
|
|
|
+const sqlForm = reactive({
|
|
|
+ gatherSql: '', // 聚合sql
|
|
|
+ baseSql: '', // 基础sql
|
|
|
+ startTime: ds, // 开始时间
|
|
|
+ endTime: ds, // 结束时间
|
|
|
+ calcResult: '', // 计算结果
|
|
|
+})
|
|
|
+
|
|
|
+let reportForm = ref({
|
|
|
+ reportId: '', // 报表id
|
|
|
+ reportName: '', // 报表名称
|
|
|
+ reportType: 'sg', // 报表类型
|
|
|
+ unit: '', // 单位
|
|
|
+ level: 'group_zb', // 报表分组类型
|
|
|
+ gatherSql: 't.*', // 聚合sql
|
|
|
+ baseSql: '', // 基础sql
|
|
|
+ displayType: '', // 展示类型
|
|
|
+ menuId: '', // 菜单id
|
|
|
+ sort: '', // 面板排序
|
|
|
+ reportSort: '', // 报表统计排序
|
|
|
+ file: '', // 报表证明文件
|
|
|
+ isCw: 'N', // 是否财务报表大屏显示指标(Y: 是)
|
|
|
+ isYj: 'N', // 是否医技报表大屏显示指标(Y: 是)
|
|
|
+ flag: 'Y', // 是否有效
|
|
|
+})
|
|
|
+
|
|
|
+onMounted(() => {
|
|
|
+ nextTick(() => {
|
|
|
+ queryTargetDictConstantData()
|
|
|
+ deptMethod('')
|
|
|
+ reportTypeQt()
|
|
|
+ levelTypeQt()
|
|
|
+ })
|
|
|
+})
|
|
|
+
|
|
|
+const rules = reactive<FormRules>({
|
|
|
+ reportId: [
|
|
|
+ { required: true, message: '请填写报表编码', trigger: 'blur' },
|
|
|
+ { min: 1, max: 12, message: '报表id长度范围1-12个字符', trigger: 'blur' },
|
|
|
+ ],
|
|
|
+ reportName: [
|
|
|
+ { required: true, message: '请填写报表名称', trigger: 'blur' },
|
|
|
+ { min: 1, max: 256, message: '报表名称长度范围1-256个字符', trigger: 'blur' },
|
|
|
+ ],
|
|
|
+ reportType: [
|
|
|
+ { required: true, message: '请填写报表类型', trigger: 'blur' },
|
|
|
+ ],
|
|
|
+ baseSql: [
|
|
|
+ { required: true, message: '请填写固定值', trigger: 'blur' },
|
|
|
+ ],
|
|
|
+ // fileArr: [
|
|
|
+ // { required: true, message: '请上传文件', trigger: 'blur' },
|
|
|
+ // ],
|
|
|
+})
|
|
|
+
|
|
|
+// 查询常数指标
|
|
|
+const queryTargetDictConstantData = () => {
|
|
|
+ selectTargetDictConstantData(queryParam)
|
|
|
+ .then((res: any) => {
|
|
|
+ targetConstantData.value = res
|
|
|
+ });
|
|
|
+}
|
|
|
+
|
|
|
+// 查询报表类型字典
|
|
|
+const reportTypeQt = () => {
|
|
|
+ selectReportType()
|
|
|
+ .then((res: any) => {
|
|
|
+ reportTypeList.value = res
|
|
|
+ });
|
|
|
+}
|
|
|
+
|
|
|
+// 查询指标分组类型字典
|
|
|
+const levelTypeQt = () => {
|
|
|
+ selectReportLevelDict()
|
|
|
+ .then((res: any) => {
|
|
|
+ levelList.value = res
|
|
|
+ });
|
|
|
+}
|
|
|
+
|
|
|
+// 指标分组类型字典内容检索
|
|
|
+const levelFilterMethod = (key: any) => {
|
|
|
+ //`这一步一定要加上,不然输入框会有问题`!!!!!
|
|
|
+ reportForm.value.level = key
|
|
|
+ if (key) {
|
|
|
+ levelList.value = levelList.value.filter((item: any) => {
|
|
|
+ let flag = true
|
|
|
+ if (item.levelName.indexOf(key) === -1 && item.reportId.indexOf(key.toLowerCase()) === -1) {
|
|
|
+ flag = false
|
|
|
+ }
|
|
|
+ return flag
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+ levelTypeQt()
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+// ------ 接收树页面传来的数据 -------
|
|
|
+const targetConstantClick = async (row: any, column: any, event: any) => {
|
|
|
+ if (row) {
|
|
|
+ if (!isDisabledForm.value) {
|
|
|
+ isDisabledForm.value = true
|
|
|
+ }
|
|
|
+ ruleFormRef.value?.resetFields()
|
|
|
+ sqlForm.calcResult = ''
|
|
|
+ row.baseSql = row.baseSql.replaceAll('select', '').replaceAll('as sg', '').trim()
|
|
|
+
|
|
|
+ reportForm.value = row
|
|
|
+ // 回显报表分组类型
|
|
|
+ levelId.value = reportForm.value.level
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+// ---------- 新增报表 ------------
|
|
|
+const addForm = (formEl: FormInstance | undefined) => {
|
|
|
+ if (!formEl) return
|
|
|
+
|
|
|
+ if (isDisabledForm.value) {
|
|
|
+ isDisabledForm.value = false
|
|
|
+ }
|
|
|
+
|
|
|
+ formEl.resetFields()
|
|
|
+ reportForm.value = {} as any
|
|
|
+ ruleFormRef.value?.resetFields()
|
|
|
+ sqlForm.calcResult = ''
|
|
|
+ reportForm.value.flag = 'Y'
|
|
|
+ isAddSave.value = true
|
|
|
+
|
|
|
+}
|
|
|
+
|
|
|
+// ---------- 编辑报表 ------------
|
|
|
+const editForm = (formEl: FormInstance | undefined) => {
|
|
|
+ if(reportForm.value.displayType !== userInfo.code){
|
|
|
+ ElMessage({
|
|
|
+ type: "info",
|
|
|
+ message: "不属于您创建的指标,无法修改!",
|
|
|
+ duration: 2500,
|
|
|
+ showClose: true,
|
|
|
+ });
|
|
|
+ return
|
|
|
+ }
|
|
|
+
|
|
|
+ if (!formEl) return
|
|
|
+
|
|
|
+ if (isDisabledForm.value) {
|
|
|
+ isDisabledForm.value = false
|
|
|
+ }
|
|
|
+
|
|
|
+ if (isAddSave.value) {
|
|
|
+ isAddSave.value = false
|
|
|
+ }
|
|
|
+
|
|
|
+}
|
|
|
+
|
|
|
+// ---------- 保存报表 ------------
|
|
|
+const submitForm = async (formEl: FormInstance | undefined) => {
|
|
|
+ if(reportForm.value.displayType !== userInfo.code){
|
|
|
+ ElMessage({
|
|
|
+ type: "info",
|
|
|
+ message: "不属于您创建的指标,无法保存!",
|
|
|
+ duration: 2500,
|
|
|
+ showClose: true,
|
|
|
+ });
|
|
|
+ return
|
|
|
+ }
|
|
|
+
|
|
|
+ if (!formEl) return
|
|
|
+
|
|
|
+ if (reportForm.value.reportId == '') {
|
|
|
+ ElMessage({
|
|
|
+ type: "info",
|
|
|
+ message: '指标报表信息不全,请确认!',
|
|
|
+ duration: 2500,
|
|
|
+ showClose: true,
|
|
|
+ });
|
|
|
+ return
|
|
|
+ }
|
|
|
+
|
|
|
+ // 新增指标验证指标id是否已存在
|
|
|
+ let badFlag = false
|
|
|
+ if (isAddSave.value) {
|
|
|
+ await selectReportInfoData(reportForm.value).then((res: any) => {
|
|
|
+ reportData.value = res
|
|
|
+ if (reportData.value) {
|
|
|
+ badFlag = true
|
|
|
+ ElMessage({
|
|
|
+ type: "info",
|
|
|
+ message: "已有指标报表: " + reportData.value.reportName + ",请确认!",
|
|
|
+ duration: 2500,
|
|
|
+ showClose: true,
|
|
|
+ });
|
|
|
+ return
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+
|
|
|
+ if (badFlag) {
|
|
|
+ return
|
|
|
+ }
|
|
|
+
|
|
|
+ await formEl.validate((valid, fields) => {
|
|
|
+ if (valid) {
|
|
|
+ if (reportForm.value.gatherSql == '' || reportForm.value.baseSql == '' || reportForm.value.reportName == '') {
|
|
|
+ ElMessage({
|
|
|
+ type: "info",
|
|
|
+ message: '指标报表信息不全,请确认!',
|
|
|
+ duration: 2500,
|
|
|
+ showClose: true,
|
|
|
+ });
|
|
|
+ return
|
|
|
+ }
|
|
|
+ // level需要指定
|
|
|
+ if (levelId.value) {
|
|
|
+ reportForm.value.level = levelId.value
|
|
|
+ } else {
|
|
|
+ if (reportForm.value.reportType === 'zb') {
|
|
|
+ reportForm.value.level = 'group_zb'
|
|
|
+ } else {
|
|
|
+ reportForm.value.level = 'group_ks'
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ saveReportBaseInfo(reportForm.value).then((res: any) => {
|
|
|
+ ElMessage({
|
|
|
+ type: "success",
|
|
|
+ message: res.cg,
|
|
|
+ duration: 2500,
|
|
|
+ showClose: true,
|
|
|
+ });
|
|
|
+ if (!isDisabledForm.value) {
|
|
|
+ isDisabledForm.value = true
|
|
|
+ }
|
|
|
+ queryTargetDictConstantData()
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ queryTargetDictConstantData()
|
|
|
+ return
|
|
|
+ }
|
|
|
+ })
|
|
|
+
|
|
|
+}
|
|
|
+
|
|
|
+// ---------- 重置报表 ------------
|
|
|
+const resetForm = (formEl: FormInstance | undefined) => {
|
|
|
+ if (!formEl) return
|
|
|
+
|
|
|
+ if (isDisabledForm.value) {
|
|
|
+ isDisabledForm.value = false
|
|
|
+ }
|
|
|
+
|
|
|
+ formEl.resetFields()
|
|
|
+ reportForm.value = {} as any
|
|
|
+ ruleFormRef.value?.resetFields()
|
|
|
+ reportForm.value.flag = 'Y'
|
|
|
+ reportForm.value.reportType = 'sg'
|
|
|
+ sqlForm.calcResult = ''
|
|
|
+}
|
|
|
+
|
|
|
+// --------------- sql运行 ----------------
|
|
|
+const sqlExecute = (formEl: FormInstance | undefined) => {
|
|
|
+ if (!formEl) return
|
|
|
+ // 验证是否填写完整
|
|
|
+ if (reportForm.value.reportId === '') {
|
|
|
+ ElMessage({
|
|
|
+ type: "info",
|
|
|
+ message: "报表信息不全,请确认!",
|
|
|
+ duration: 2500,
|
|
|
+ showClose: true,
|
|
|
+ });
|
|
|
+ return
|
|
|
+ }
|
|
|
+
|
|
|
+ if (reportForm.value.baseSql === '') {
|
|
|
+ ElMessage({
|
|
|
+ type: "info",
|
|
|
+ message: "未填写固定值,请检查!",
|
|
|
+ duration: 2500,
|
|
|
+ showClose: true,
|
|
|
+ });
|
|
|
+ return
|
|
|
+ }
|
|
|
+
|
|
|
+ if (sqlForm.startTime === '' || sqlForm.endTime === '') {
|
|
|
+ ElMessage({
|
|
|
+ type: "info",
|
|
|
+ message: "时间条件未选择,请确认!",
|
|
|
+ duration: 2500,
|
|
|
+ showClose: true,
|
|
|
+ });
|
|
|
+ return
|
|
|
+ }
|
|
|
+
|
|
|
+ if(isNaN(reportForm.value.baseSql)){
|
|
|
+ ElMessage({
|
|
|
+ type: "info",
|
|
|
+ message: "请输入有效的数字,请确认!",
|
|
|
+ duration: 2500,
|
|
|
+ showClose: true,
|
|
|
+ });
|
|
|
+ return
|
|
|
+ }
|
|
|
+
|
|
|
+ // sql测试
|
|
|
+ sqlForm.gatherSql = reportForm.value.gatherSql
|
|
|
+ sqlForm.baseSql = 'select ' + reportForm.value.baseSql + ' as sg'
|
|
|
+
|
|
|
+ let qData = clone(sqlForm)
|
|
|
+ qData.startTime = sqlForm.startTime + ' 00:00:00'
|
|
|
+ qData.endTime = sqlForm.endTime + ' 23:59:59'
|
|
|
+ reportSqlExecute(qData)
|
|
|
+ .then((res: any) => {
|
|
|
+ let r = JSON.parse(JSON.stringify(res))
|
|
|
+ sqlForm.calcResult = r.r1
|
|
|
+
|
|
|
+ });
|
|
|
+
|
|
|
+}
|
|
|
+
|
|
|
+// --------------- 报表分组类型配置 -------------------
|
|
|
+const showReportLevel = ref(false)
|
|
|
+const reportLevelTitle = ref('报表分组类型配置')
|
|
|
+const reportLevelDetail = ref({})
|
|
|
+const reportLevel = () => {
|
|
|
+ if (reportForm.value.reportId == '') {
|
|
|
+ ElMessage({
|
|
|
+ type: "info",
|
|
|
+ message: "指标报表信息不全,请确认!",
|
|
|
+ duration: 2500,
|
|
|
+ showClose: true,
|
|
|
+ });
|
|
|
+ return
|
|
|
+ }
|
|
|
+ if (!reportForm.value.level) {
|
|
|
+ if (reportForm.value.reportType === 'zb') {
|
|
|
+ reportForm.value.level = 'group_zb'
|
|
|
+ } else {
|
|
|
+ reportForm.value.level = 'group_ks'
|
|
|
+ }
|
|
|
+ }
|
|
|
+ const param = {
|
|
|
+ reportId: reportForm.value.reportId,
|
|
|
+ level: reportForm.value.level,
|
|
|
+ }
|
|
|
+ selectReportLevel(param).then((res: any) => {
|
|
|
+ if (res == null) {
|
|
|
+ ElMessage({
|
|
|
+ type: "info",
|
|
|
+ message: "查询指标报表信息不全,请确认!",
|
|
|
+ duration: 2500,
|
|
|
+ showClose: true,
|
|
|
+ });
|
|
|
+ return
|
|
|
+ }
|
|
|
+
|
|
|
+ showReportLevel.value = true
|
|
|
+ reportLevelDetail.value = res
|
|
|
+ })
|
|
|
+}
|
|
|
+
|
|
|
+// --------------- 报表页面详情配置 -------------------
|
|
|
+const showReportDetails = ref(false)
|
|
|
+const reportDetailsTitle = ref('报表页面详情配置')
|
|
|
+const reportDetailsData = ref({})
|
|
|
+const reportDetails = () => {
|
|
|
+ reportDetailsData.value = clone(reportForm.value)
|
|
|
+ showReportDetails.value = true
|
|
|
+}
|
|
|
+
|
|
|
+// ------------- 报表文件上传 -------------------
|
|
|
+const fileArr = ref<UploadInstance>()
|
|
|
+const submitUpload = () => {
|
|
|
+ fileArr.value!.submit()
|
|
|
+}
|
|
|
+</script>
|
|
|
+<style lang="scss" scoped >
|
|
|
+:deep(.hd-cl) {
|
|
|
+ margin-bottom: 1px !important;
|
|
|
+}
|
|
|
+
|
|
|
+:deep(.el-textarea.is-disabled .el-textarea__inner) {
|
|
|
+ color: #1146f3;
|
|
|
+}
|
|
|
+</style>
|