Commit 1273f730 authored by 李苏's avatar 李苏 💬

综合查询

parent f73e0bf1
......@@ -269,6 +269,19 @@ export const powerRoutes = [{
name: 'hyha',
path: "hyha"
},
{
component: 'sbysjsp/zhcx/index',
hidden: false,
meta: {
"title": "综合查询",
"icon": "",
"noCache": false,
"link": null,
"mkid": '901030511',
},
name: 'zhcx',
path: "zhcx"
},
{
component: 'sbysjsp/yszxjd/index',
hidden: false,
......
......@@ -24,8 +24,6 @@
</div>
</div>
</div>
</div>
</template>
<script>
......@@ -45,7 +43,6 @@
async mounted() {
/* 查询数值*/
this.init()
// this.$refs['TablePager'].pageQuery()
},
data() {
return {
......
<template>
<div class=" flex">
<el-tabs @tab-click="handleClick" v-model="activeName" :tab-position="'left'">
<el-tab-pane style="font-size: 12px;" v-for="(item,index) in paneList" :key="item.id" :name="item.id"
:label="item.title"></el-tab-pane>
</el-tabs>
<div style="flex: 1;overflow: hidden;">
<div class="min_full" style="border-left: 0px;">
<!-- right-->
<el-row class="tool-bar">
<!-- <ToolButton :app='app'></ToolButton> -->
<ImportTempButton @success='success' url="hafms/yszhcxlog//excel/import" :params="{
lx:'C'
}" />
<!-- 导入-->
<el-button @click="del" size="mini" type="danger">删除当前报表</el-button>
</el-row>
<!-- 表格-->
<div class="tablePagers">
<TablePager :operateButtons='false' disableQuery @getData='getData' :ref="'TablePager'" :app='app'
:query='query' @selectItem='selectItem' @getRow='getRow'>
</TablePager>
</div>
</div>
</div>
</div>
</template>
<script>
import {
doQuery,
doDelete,
doQueryDetail
} from '@/api/sbysjsp/hyha.js';
import {
tableMixin
} from 'common'
export default {
mixins: [tableMixin],
/* 初始额外赋值*/
async mounted() {
/* 查询数值*/
this.init()
},
data() {
return {
activeName: '',
paneList: [],
baseUrl: 'hafms/yszhcxlog',
/* 查询参数*/
queryParams: {
lx: 'C',
},
/* 表格标题对应参数*/
tableTitle: [{
title: "项目名称",
field: "xmmc",
fieldType: "ftString",
width: 160
},
{
title: "国网项目编码",
field: "gwxmbm",
fieldType: "ftString",
width: 160
},
{
title: "项目类型",
field: "xmlx",
fieldType: "ftString",
width: 160
},
{
title: "项目包名称",
field: "xmbmc",
fieldType: "ftString",
width: 160
},
{
title: "一级单位",
field: "yjdw",
fieldType: "ftString",
width: 160
},
{
title: "二级单位",
field: "ejdw",
fieldType: "ftString",
width: 160
},
{
title: "归口部门",
field: "gkbm",
fieldType: "ftString",
width: 160
},
{
title: "实施部门",
field: "ssbm",
fieldType: "ftString",
width: 160
},
{
title: "当年预算(含税)(万元)",
field: "yshsje",
fieldType: "ftString",
width: 160
},
{
title: "当年预算(不含税)(万元)",
field: "yswsje",
fieldType: "ftString",
width: 160
},
{
title: "是否预安排项目",
field: "yapxm",
fieldType: "ftString",
width: 160
},
{
title: "是否安全生产",
field: "aqsc",
fieldType: "ftString",
width: 160
}
]
}
},
methods: {
del() {
if (this.paneList.length > 0 && this.activeName) {
this.$confirm('是否删除当前报表, 是否继续?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(res => {
doDelete({
id: this.activeName
}).then(e => {
if (e.success) {
this.$success('操作成功')
/* 初始化list*/
this.init()
}
})
})
} else {
this.$warning('当前无数据,请刷新或者导入后进行操作')
}
},
init() {
doQuery({
lx: 'A'
}).then(res => {
if (res.success) {
if (res.data && res.data.records && res.data.records.length != 0) {
this.paneList = res.data.records || []
if (this.paneList[0]) {
this.activeName = this.paneList[0].id
this.showTabData(this.paneList[0].id)
/* 查询第一个list*/
}
}
}
})
},
/* 导入成功回调*/
success() {
this.init()
},
/*数据处理*/
showTabData(id) {
/* 控制查询loading */
this.$refs.TablePager.loading = true
doQueryDetail({
mid: id
}).then(res => {
if (res.success) {
let records = res.data.records || []
/* 数据处理*/
let gs1 = ''
let gs2 = ''
let lxh1 = records.filter(item => {
if (item.lxh == '1') {
gs1 = item.gsname
return true
}
})
let lxh2 = records.filter(item => {
if (item.lxh == '2') {
gs2 = item.gsname
return true
}
})
/* 根据xh合并*/
let newList = lxh1.map(item1 => {
let newItem = {}
lxh2.forEach(item2 => {
if (item1.xh == item2.xh) {
Object.keys(item2).forEach(key => {
let keyName = key + '2'
newItem[keyName] = item2[key]
})
}
})
/* 最终合并*/
newItem = {
...newItem,
...item1
}
return newItem
})
/* 手动操作表格*/
/* 替换标题*/
// this.$refs.TablePager['newGridList'][1]['label'] = gs1
// this.$refs.TablePager['newGridList'][2]['label'] = gs2
/* 替换数据*/
this.$refs.TablePager['tableData'] = newList
}
}).finally(e => {
this.$refs.TablePager.loading = false
})
},
handleClick(item) {
this.showTabData(item.name)
},
/* 基础查询*/
query: doQuery,
apiDelete: doDelete,
queryDetail: doQueryDetail
},
components: {
}
}
</script>
<style scoped>
</style>
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