|
@@ -6,18 +6,16 @@
|
|
|
<el-col :span="16">
|
|
|
<PageLayer>
|
|
|
<template #header class="hd-cl">
|
|
|
- <el-date-picker v-model="queryParam.startTime" type="year" label="选择开始年份" placeholder="选择年份"
|
|
|
- format="YYYY" value-format="YYYY" />
|
|
|
- <el-date-picker v-model="queryParam.endTime" type="year" label="选择结束年份" placeholder="选择年份" format="YYYY"
|
|
|
- value-format="YYYY" />
|
|
|
+ <el-date-picker v-model="dateRange" type="daterange" range-separator="至" start-placeholder="开始日期"
|
|
|
+ end-placeholder="结束日期" :shortcuts="shortcuts"> </el-date-picker>
|
|
|
<el-select-v2 ref="deptInfoRef" v-model="queryParam.deptId" clearable remote filterable
|
|
|
:remote-method="deptMethod" :options="deptWardList" />
|
|
|
<el-input v-model="queryParam.calcChild" v-if="isShowSql"></el-input>
|
|
|
<el-input v-model="queryParam.calcMom" v-if="isShowSql"></el-input>
|
|
|
<el-button icon="Search" type="primary" @click="selectTargetDictInfo"
|
|
|
style="margin-left: 10px">查询</el-button>
|
|
|
- <el-button icon="Download" type="primary">导出分子</el-button>
|
|
|
- <el-button icon="Download" type="primary">导出分母</el-button>
|
|
|
+ <el-button icon="Download" type="primary" @click="exportChildData">导出分子</el-button>
|
|
|
+ <el-button icon="Download" type="primary" @click="exportMomData">导出分母</el-button>
|
|
|
</template>
|
|
|
<template #main>
|
|
|
<el-form ref="ruleFormRef" label-width="120px" :model="targetForm" class="demo-ruleForm"
|
|
@@ -31,9 +29,12 @@
|
|
|
<el-form-item label="计分细则" prop="scoreRule">
|
|
|
<el-input v-model="targetForm.scoreRule" type="textarea" />
|
|
|
</el-form-item>
|
|
|
- <el-row>
|
|
|
+ </el-form>
|
|
|
+ <el-divider />
|
|
|
+ <el-tabs type="border-card" v-model="queryParam.tabFlag" @tab-click="handleClick">
|
|
|
+ <el-tab-pane label="所有结果汇总" name="total">
|
|
|
<el-table :data="QtResultData" stripe border highlight-current-row row-key="childKey"
|
|
|
- height="200" style="width: 100%">
|
|
|
+ style="width: 100%">
|
|
|
<el-table-column prop="year" label="年份" header-align="center" />
|
|
|
<el-table-column prop="dataType" label="数据方式" header-align="center">
|
|
|
<template #default="scope">
|
|
@@ -46,15 +47,44 @@
|
|
|
<el-table-column prop="op" label="统计人员" header-align="center" />
|
|
|
<el-table-column prop="opTime" label="统计时间" header-align="center" width="200" />
|
|
|
</el-table>
|
|
|
- </el-row>
|
|
|
- </el-form>
|
|
|
- <el-divider />
|
|
|
- <el-tabs type="border-card" v-model="queryParam.tabFlag" @tab-click="handleClick">
|
|
|
- <el-tab-pane label="分子" name="child">
|
|
|
-
|
|
|
</el-tab-pane>
|
|
|
- <el-tab-pane label="分母" name="mom">
|
|
|
-
|
|
|
+ <el-tab-pane label="分子结果详情" name="child">
|
|
|
+ <xc-table :data="returnData" localPaging :openPaging="true" :height="heightData">
|
|
|
+ <el-table-column type="index" label="序号" align="center"></el-table-column>
|
|
|
+ <template v-for="col in returnData.tableDisplays">
|
|
|
+ <el-table-column v-if="col.prop.endsWith('-t')" :prop="col.prop" :label="col.label"
|
|
|
+ :width="col.width" :align="col.align" show-overflow-tooltip>
|
|
|
+ <template v-for="cell in returnData.chirdData">
|
|
|
+ <el-table-column v-if="cell.pid === col.id" :prop="cell.prop"
|
|
|
+ :label="cell.label" :width="cell.width" :align="cell.align"
|
|
|
+ show-overflow-tooltip>
|
|
|
+ </el-table-column>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column v-else :prop="col.prop" :label="col.label" :width="col.width"
|
|
|
+ :align="col.align" show-overflow-tooltip>
|
|
|
+ </el-table-column>
|
|
|
+ </template>
|
|
|
+ </xc-table>
|
|
|
+ </el-tab-pane>
|
|
|
+ <el-tab-pane label="分母结果详情" name="mom">
|
|
|
+ <xc-table :data="returnData" localPaging :openPaging="true" :height="heightData">
|
|
|
+ <el-table-column type="index" label="序号" align="center"></el-table-column>
|
|
|
+ <template v-for="col in returnData.tableDisplays">
|
|
|
+ <el-table-column v-if="col.prop.endsWith('-t')" :prop="col.prop" :label="col.label"
|
|
|
+ :width="col.width" :align="col.align" show-overflow-tooltip>
|
|
|
+ <template v-for="cell in returnData.chirdData">
|
|
|
+ <el-table-column v-if="cell.pid === col.id" :prop="cell.prop"
|
|
|
+ :label="cell.label" :width="cell.width" :align="cell.align"
|
|
|
+ show-overflow-tooltip>
|
|
|
+ </el-table-column>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column v-else :prop="col.prop" :label="col.label" :width="col.width"
|
|
|
+ :align="col.align" show-overflow-tooltip>
|
|
|
+ </el-table-column>
|
|
|
+ </template>
|
|
|
+ </xc-table>
|
|
|
</el-tab-pane>
|
|
|
</el-tabs>
|
|
|
</template>
|
|
@@ -70,19 +100,29 @@ import { ElMessage } from 'element-plus'
|
|
|
import type { FormInstance } from 'element-plus'
|
|
|
import { selectTargetDict, selectTargetDictTree } from '../../../api/target-management/target-dict'
|
|
|
import { selectTargetReportResult, selectTargetSql } from '../../../api/target-management/target-sql'
|
|
|
+import { selectReportPortalMenu, exportReportPortalData } from '../../../api/reports/high-report'
|
|
|
import { queryDept } from '../../../api/public-api'
|
|
|
+import XcTable from '../../../components/xiao-chan/xc-table/XcTable.vue'
|
|
|
+import { formatDate, getDateRangeFormatDate } from '../../../utils/date'
|
|
|
+import { shortcuts, clockinShortcuts } from '../../../data/shortcuts'
|
|
|
|
|
|
const targetTreeData = ref({
|
|
|
data: [{}],
|
|
|
height: 900,
|
|
|
})
|
|
|
|
|
|
+const start: any = formatDate(clockinShortcuts[1].value[0])
|
|
|
+const end: any = formatDate(clockinShortcuts[1].value[1])
|
|
|
+
|
|
|
const isShowTree = ref(false)
|
|
|
const isShowForm = ref(true)
|
|
|
const isShowSql = ref(false)
|
|
|
const deptWardList = ref([])
|
|
|
const formSize = ref('default')
|
|
|
const ruleFormRef = ref<FormInstance>()
|
|
|
+const dateRange: any = ref([]);
|
|
|
+
|
|
|
+const heightData = ref(450)
|
|
|
|
|
|
const deptMethod = (val: string) => {
|
|
|
queryDept(val).then((res: any) => {
|
|
@@ -105,7 +145,8 @@ const queryParam = reactive({
|
|
|
childId: '', // 分子报表id
|
|
|
momId: '', // 分母报表id
|
|
|
isLeaf: '', //是否叶子节点(0:否, 1:是)
|
|
|
- tabFlag: 'child', //分子分母(child:分子 默认, mom:分母)
|
|
|
+ tabFlag: 'total', //结果,分子,分母(total:结果 默认,child:分子, mom:分母),
|
|
|
+ exportName: ''
|
|
|
})
|
|
|
|
|
|
const targetForm = ref({
|
|
@@ -133,7 +174,17 @@ const targetForm = ref({
|
|
|
momId: '', // 分母报表id
|
|
|
})
|
|
|
|
|
|
+let returnData = $ref({
|
|
|
+ currentPage: 1,
|
|
|
+ pageSize: 30,
|
|
|
+ total: 0,
|
|
|
+ data: []
|
|
|
+});
|
|
|
+
|
|
|
onMounted(() => {
|
|
|
+ queryParam.startTime = start + '00:00:00';
|
|
|
+ queryParam.endTime = end + " 23:59:59";
|
|
|
+ dateRange.value = [start, end];
|
|
|
nextTick(() => {
|
|
|
qeryTargetDictTree()
|
|
|
deptMethod('')
|
|
@@ -180,22 +231,33 @@ const treeNodeClick = async (data: any, node: any, obj: any) => {
|
|
|
}
|
|
|
|
|
|
let QtResultData = ref([])
|
|
|
-const selectTargetDictInfo = async () => {
|
|
|
+const selectTargetDictInfo = () => {
|
|
|
+ if (!queryParam.id) {
|
|
|
+ ElMessage({
|
|
|
+ message: '请选择一个指标!',
|
|
|
+ type: 'warning',
|
|
|
+ duration: 2500,
|
|
|
+ showClose: true,
|
|
|
+ })
|
|
|
+ return
|
|
|
+ }
|
|
|
// 查询指标结果
|
|
|
- selectTargetReportResult(queryParam)
|
|
|
- .then((res: any) => {
|
|
|
- QtResultData.value = res
|
|
|
- });
|
|
|
-
|
|
|
- // 查询指标分子,分母明细结果(默认查询分子)
|
|
|
- // let selectTargetSqlDetialRes = await selectTargetSqlDetail(queryParam)
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
+ calcTargetDictInfo(queryParam)
|
|
|
}
|
|
|
|
|
|
// 查询分子,分母数据
|
|
|
-const handleClick = (tab, event) => {
|
|
|
+const handleClick = (tab: any, event: any) => {
|
|
|
+ returnData.data = []
|
|
|
+ if (!queryParam.id) {
|
|
|
+ ElMessage({
|
|
|
+ message: '请选择一个指标!',
|
|
|
+ type: 'warning',
|
|
|
+ duration: 2500,
|
|
|
+ showClose: true,
|
|
|
+ })
|
|
|
+ return
|
|
|
+ }
|
|
|
+
|
|
|
if (!queryParam.startTime) {
|
|
|
ElMessage({
|
|
|
message: '请选择时间!',
|
|
@@ -209,9 +271,178 @@ const handleClick = (tab, event) => {
|
|
|
// 查询哪个tab页面
|
|
|
queryParam.tabFlag = tab.props.name
|
|
|
|
|
|
- if (queryParam.tabFlag === 'first') {
|
|
|
+ calcTargetDictInfo(queryParam)
|
|
|
+}
|
|
|
+
|
|
|
+const calcTargetDictInfo = (queryParam: any) => {
|
|
|
+ if (queryParam.tabFlag === 'total') {
|
|
|
+ let dataParam = {
|
|
|
+ id: queryParam.id,
|
|
|
+ pid: queryParam.pid,
|
|
|
+ }
|
|
|
+ selectTargetReportResult(dataParam)
|
|
|
+ .then((res: any) => {
|
|
|
+ QtResultData.value = res
|
|
|
+ });
|
|
|
+ } else if (queryParam.tabFlag === 'child') {
|
|
|
+ if (dateRange.value) {
|
|
|
+ let dateS = getDateRangeFormatDate(dateRange.value);
|
|
|
+ queryParam.startTime = dateS.startTime;
|
|
|
+ queryParam.endTime = dateS.endTime;
|
|
|
+ } else {
|
|
|
+ queryParam.startTime = start;
|
|
|
+ queryParam.endTime = end;
|
|
|
+ }
|
|
|
+ if (queryParam.childId) {
|
|
|
+ let data = {
|
|
|
+ reportId: queryParam.childId,
|
|
|
+ reportType: 'zb',
|
|
|
+ startTime: queryParam.startTime,
|
|
|
+ endTime: queryParam.endTime,
|
|
|
+ type: '2',
|
|
|
+ }
|
|
|
+ selectReportPortalMenu(data)
|
|
|
+ .then((res: any) => {
|
|
|
+ let id: any
|
|
|
+ returnData.tableDisplays = []
|
|
|
+ returnData.chirdData = []
|
|
|
+ res.tableDisplays.forEach((item: any) => {
|
|
|
+ if (item.prop.endsWith('-t')) {
|
|
|
+ id = item.id
|
|
|
+ returnData.tableDisplays.push(item)
|
|
|
+ } else {
|
|
|
+ if (item.pid === id) {
|
|
|
+ returnData.chirdData.push(item)
|
|
|
+ } else {
|
|
|
+ returnData.tableDisplays.push(item)
|
|
|
+ }
|
|
|
+ }
|
|
|
+ })
|
|
|
+ returnData.data = res.dataList
|
|
|
+ returnData.total = res.dataList.length
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ ElMessage({
|
|
|
+ message: '没有分子的指标!',
|
|
|
+ type: 'warning',
|
|
|
+ duration: 2500,
|
|
|
+ showClose: true,
|
|
|
+ })
|
|
|
+ }
|
|
|
+
|
|
|
+ } else if (queryParam.tabFlag === 'mom') {
|
|
|
+ if (dateRange.value) {
|
|
|
+ let dateS = getDateRangeFormatDate(dateRange.value);
|
|
|
+ queryParam.startTime = dateS.startTime;
|
|
|
+ queryParam.endTime = dateS.endTime;
|
|
|
+ } else {
|
|
|
+ queryParam.startTime = start;
|
|
|
+ queryParam.endTime = end;
|
|
|
+ }
|
|
|
+ if (queryParam.momId) {
|
|
|
+ let data = {
|
|
|
+ reportId: queryParam.momId,
|
|
|
+ reportType: 'zb',
|
|
|
+ startTime: queryParam.startTime,
|
|
|
+ endTime: queryParam.endTime,
|
|
|
+ type: '2',
|
|
|
+ }
|
|
|
+ selectReportPortalMenu(data)
|
|
|
+ .then((res: any) => {
|
|
|
+ let id: any
|
|
|
+ returnData.tableDisplays = []
|
|
|
+ returnData.chirdData = []
|
|
|
+ res.tableDisplays.forEach((item: any) => {
|
|
|
+ if (item.prop.endsWith('-t')) {
|
|
|
+ id = item.id
|
|
|
+ returnData.tableDisplays.push(item)
|
|
|
+ } else {
|
|
|
+ if (item.pid === id) {
|
|
|
+ returnData.chirdData.push(item)
|
|
|
+ } else {
|
|
|
+ returnData.tableDisplays.push(item)
|
|
|
+ }
|
|
|
+ }
|
|
|
+ })
|
|
|
+ returnData.data = res.dataList
|
|
|
+ returnData.total = res.dataList.length
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ ElMessage({
|
|
|
+ message: '没有分母的指标!',
|
|
|
+ type: 'warning',
|
|
|
+ duration: 2500,
|
|
|
+ showClose: true,
|
|
|
+ })
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|
|
|
|
|
|
+const exportChildData = () => {
|
|
|
+ if (queryParam.tabFlag != 'child') {
|
|
|
+ ElMessage({
|
|
|
+ message: '请查询出分子结果详情,再导出!',
|
|
|
+ type: 'warning',
|
|
|
+ duration: 2500,
|
|
|
+ showClose: true,
|
|
|
+ })
|
|
|
+ return
|
|
|
}
|
|
|
+ if (returnData.data.length <= 0) {
|
|
|
+ ElMessage({
|
|
|
+ message: '没有可以导出的数据!',
|
|
|
+ type: 'warning',
|
|
|
+ duration: 2500,
|
|
|
+ showClose: true,
|
|
|
+ })
|
|
|
+ return
|
|
|
+ }
|
|
|
+ exportData(queryParam.childId, '分子结果详情导出')
|
|
|
+}
|
|
|
+
|
|
|
+const exportMomData = () => {
|
|
|
+ if (queryParam.tabFlag != 'mom') {
|
|
|
+ ElMessage({
|
|
|
+ message: '请查询出分母结果详情,再导出!',
|
|
|
+ type: 'warning',
|
|
|
+ duration: 2500,
|
|
|
+ showClose: true,
|
|
|
+ })
|
|
|
+ return
|
|
|
+ }
|
|
|
+ if (returnData.data.length <= 0) {
|
|
|
+ ElMessage({
|
|
|
+ message: '没有可以导出的数据!',
|
|
|
+ type: 'warning',
|
|
|
+ duration: 2500,
|
|
|
+ showClose: true,
|
|
|
+ })
|
|
|
+ return
|
|
|
+ }
|
|
|
+ exportData(queryParam.momId, '分母结果详情导出')
|
|
|
+}
|
|
|
+
|
|
|
+const exportData = (id: string, name: string) => {
|
|
|
+ if (dateRange.value) {
|
|
|
+ let dateS = getDateRangeFormatDate(dateRange.value);
|
|
|
+ queryParam.startTime = dateS.startTime;
|
|
|
+ queryParam.endTime = dateS.endTime;
|
|
|
+ } else {
|
|
|
+ queryParam.startTime = start;
|
|
|
+ queryParam.endTime = end;
|
|
|
+ }
|
|
|
+ // 导出excel表格标题等
|
|
|
+ let dataF = {
|
|
|
+ reportId: id,
|
|
|
+ reportType: 'zb',
|
|
|
+ startTime: queryParam.startTime,
|
|
|
+ endTime: queryParam.endTime,
|
|
|
+ dept: queryParam.deptId,
|
|
|
+ exportName: name
|
|
|
+ }
|
|
|
+
|
|
|
+ exportReportPortalData(dataF)
|
|
|
+
|
|
|
}
|
|
|
|
|
|
</script>
|