Commit 6fa72e1f authored by 李苏's avatar 李苏 💬

两区农电模块:901030500淮阴淮安模块:901030510

地图点击弹框再弹框demo
parent e5323a05
import request from 'common/src/utils/request'
/* query */
export function doQuery(query) {
return request({
url: 'hafms/yszhcxlog/query',
method: 'post',
data: query||{}
})
}
export function doDelete(query) {
return request({
url: '/hafms/yszhcxlog/delete',
method: 'post',
data: query||{}
})
}
export function doQueryDetail(query){
return request({
url:'hafms/yszhcxlog/queryDetail',
method: 'post',
data: query||{}
})
}
...@@ -227,8 +227,35 @@ export const powerRoutes=[ ...@@ -227,8 +227,35 @@ export const powerRoutes=[
}, },
name:'yshz', name:'yshz',
path:"yshz" path:"yshz"
},
{
component:'sbysjsp/lqnd/index',
hidden:false,
meta:{
"title": "两区农电",
"icon": "",
"noCache": false,
"link": null,
"mkid": 901030500,
},
name:'lqnd',
path:"lqnd"
},
{
component:'sbysjsp/hyha/index',
hidden:false,
meta:{
"title": "淮阴淮安",
"icon": "",
"noCache": false,
"link": null,
"mkid": 901030510,
},
name:'hyha',
path:"hyha"
} }
] ]
}, },
......
<template>
<DefaultDialog :appendToBody='false' :app='app'>
<div slot="form" style="display: flex;height: 50vh;">
<div class="full">
<EditTable @initTableTitle='initTableTitle' :allowEdit='false' :spanMethod='spanMethod' ref="editTable" :editTableData='newFormDetail'
:app='this'></EditTable>
</div>
</div>
<div slot="reFooter" class="refooter">
<span slot="footer" class="dialog-footer">
<el-button @click="app.showDialog=false">取 消</el-button>
<!-- <el-button type="primary" @click="save()">保 存</el-button> -->
</span>
</div>
</DefaultDialog>
</template>
<script>
import {
toFixed
} from 'common/src/utils/blur.js'
export default {
props: {
app: {
type: Object,
default: () => {
return {}
}
}
},
async mounted() {
},
computed: {
newFormDetail() {
/* 进行分类统计*/
let flArr = []
this.formDetail.forEach(item => {
flArr.push(item.bmjc)
})
/* 去重*/
flArr = [...new Set(flArr)]
/* 获取bmjc的所有值*/
/* 顺序构建数据组*/
/* 获取总金额*/
let jeobj = {}
let sxList = []
flArr.forEach(item => {
jeobj[item] = 0
/* 按顺序排列*/
this.formDetail.forEach(fitem => {
if (fitem.bmjc == item) {
jeobj[item] += Number(fitem.xqje || 0)
sxList.push(fitem)
}
})
})
/* 赋值总金额*/
sxList.forEach(item => {
item.lxzje = item.showname + "合计:" + jeobj[item.bmjc]
})
/* 构建redata*/
let redata = sxList.map(item => {
return item.bmjc
})
/* 重置spanArr*/
this.spanArr = []
let pos = 0
redata.reduce((old, cur, i) => {
// old 上一个元素 cur 当前元素 i 索引
if (i === 0) {
// 第一次判断先增加一个 1 占位 ,索引为0
this.spanArr.push(1)
pos = 0
} else {
if (cur === old) {
this.spanArr[pos] += 1
this.spanArr.push(0)
} else {
this.spanArr.push(1)
pos = i
}
}
return cur
}, {})
/* reduce开始控制row col*/
this.formDetail = sxList
return this.formDetail
}
},
data() {
/* 公司=》部门=》事项明细=》金额*/
return {
formDetail: [
],
spanArr: [],
baseUrl:'sbysjsp/yshz/edit',
editTableTitle: [
{
label: "部门",
prop: "bmjc",
fieldType: "ftString",
width: 150
},
{
label: "事项",
prop: "flname",
fieldType: "ftString",
width: 150
},
{
label: "预算数额",
prop: "xqje",
fieldType: "ftString",
width: 150,
type: 'inputNumber',
blur: toFixed(4),
},
{label: "调增金额", prop: "pje", fieldType: "money",width:200},
{label: "调减金额", prop: "mje", fieldType: "money",width:200},
{label: "调整后金额", prop: "tzhje", fieldType: "money"},
]
}
},
methods: {
initTableTitle(){
const list = this.$refs.editTable.tableTitle
const showList = [
'pje', 'mje', 'tzhje'
]
if(this.app.queryParams.xsystz=='Y'){
list.forEach(item => {
if (item && item.prop && showList.includes(item.prop)) {
item.show = true
}
})
}else{
list.forEach(item => {
if (item && item.prop && showList.includes(item.prop)) {
item.show = false
}
})
}
},
spanMethod({
row,
column,
rowIndex,
columnIndex
}) {
if (column.property == 'bmjc'||column.property == 'flname') {
const _row = this.spanArr[rowIndex]
const _col = _row > 0 ? 1 : 0
return {
rowspan: _row,
colspan: _col
}
}
/* */
}
}
}
</script>
<style scoped>
</style>
<template>
<DefaultDialog :appendToBody='false' :app='app'>
<div slot="form" class="min_full" style="display: flex;height: 80vh;">
<Detail ref="detail" :app='this' v-if="showDialog" />
<!-- <div class="search" v-condition>
<SearchButton :app='this'></SearchButton>
<el-row :gutter="20" class="search-row-1">
<el-col :span="5" class="search-col">
<div class="search-item">
<span class="search-span">开始日期:</span>
<el-date-picker :popper-append-to-body="false" value-format="timestamp" v-model='queryParams.start'></el-date-picker>
</div>
</el-col>
<el-col :span="5" class="search-col">
<div class="search-item">
<span class="search-span">截止日期:</span>
<el-date-picker :popper-append-to-body="false" value-format="timestamp" v-model='queryParams.end'></el-date-picker>
</div>
</el-col>
<el-col :span="5" class="search-col">
<div class="search-item">
<span class="search-span">预算任务:</span>
<RelSelect style="width: 100%;" src='hafms/ysfl/query' filterable clearable
:match="{value:'id',label:'name'}" v-model='queryParams.flid'></RelSelect>
</div>
</el-col>
<el-col :span="5" class="search-col">
<div class="search-item">
<span class="search-span">状态:</span>
<RelSelect style="width: 100%;" src='hafms/yssq/init/zt' filterable clearable
:match="{value:'id',label:'name'}" v-model='queryParams.zt'></RelSelect>
</div>
</el-col>
<el-col :span="4" class="search-col">
<el-checkbox @change="tzxx" true-label='Y' false-label='N' v-model="queryParams.xsystz">显示调整信息</el-checkbox>
</el-col>
</el-row>
<el-row :gutter="20" class="search-row-1">
<el-col :span="8" class="search-col">
<div class="search-item">
<span class="search-span">申请订单:</span>
<el-input v-model="queryParams.djid"></el-input>
</div>
</el-col>
<el-col :span="8" class="search-col">
<div class="search-item">
<span class="search-span">申请公司:</span>
<RelSelect collapse-tags multiple style="width: 100%;" src='hafms/common/sjbm/query' filterable clearable
:match="{value:'id',label:'bmmc'}" v-model='queryParams.sjbmids'></RelSelect>
</div>
</el-col>
<el-col :span="8" class="search-col">
<div class="search-item">
<span class="search-span">申请部门:</span>
<RelSelect linkage :linkParams="{sjbmids:queryParams.sjbmids}" :params="{
pids:queryParams.sjbmids.join()
}" collapse-tags multiple style="width: 100%;" src='hafms/common/bm/query' filterable clearable
:match="{value:'id',label:'bmmc'}" v-model='queryParams.chooseBmids'></RelSelect>
</div>
</el-col>
</el-row>
</div> -->
<!-- 按钮操作-->
<!-- 表格-->
<div class="tablePagers">
<!-- 多选数组转 -->
<TablePager fePage :operateButtons="false" @tpDbClick="tpDbClick" :multipleTrans="[
'sjbmids','chooseBmids'
]" @getData='getData' :ref="'TablePager'" :app='this' :query='query' @selectItem='selectItem' @getRow='getRow'>
</TablePager>
</div>
</div>
</DefaultDialog>
</template>
<script>
import Detail from './detail.vue'
import {
doQuery,
queryDetail
} from '@/api/sbysjsp/yshz.js';
import {
tableMixin_noapp
} from 'common'
import cycle from 'common/src/mixin/cycle.js'
export default {
mixins: [tableMixin_noapp, cycle],
props: {
app: {
type: Object,
default: ()=>{
return {}
}
}
},
mounted() {
this.$nextTick(()=>{
this.$refs['TablePager'].pageQuery()
})
},
components: {
Detail
},
data() {
return {
/*需要的额外参数 */
showDialog: false,
DialogName: '',
type: '',
DialogTitle: '',
/* 基础url*/
baseUrl: 'hafms/ystz',
/* 查询参数*/
queryParams: {
xsystz: 'Y',
start: new Date().getTime() - 1000 * 60 * 60 * 24 * 30,
end: new Date().getTime(),
flid: '',
zt: '',
djid: '',
sjbmids: [],
chooseBmids: []
},
/* 表格标题对应参数*/
tableTitle: [{
title: "年度",
field: "year",
fieldType: "ftString",
width: 150
},
{
title: "事项",
field: "flname",
fieldType: "ftString",
width: 200
},
{
title: "需求金额",
field: "xqje",
width: 200
},
{
title: "调增金额",
field: "pje",
width: 200
},
{
title: "调减金额",
field: "mje",
width: 200
},
{
title: "调整后金额",
field: "tzhje",
},
]
}
},
methods: {
tzxx(e) {
const list = this.$refs.TablePager.newGridList
const showList = [
'pje', 'mje', 'tzhje'
]
/* Y 显示 N隐藏*/
if (e == 'Y') {
list.forEach(item => {
if (item && item.prop && showList.includes(item.prop)) {
item.show = true
}
})
} else {
list.forEach(item => {
if (item && item.prop && showList.includes(item.prop)) {
item.show = false
}
})
}
this.$refs['TablePager'].pageQuery()
},
tpDbClick(row) {
queryDetail({
year: row.year,
flid: row.flid,
xsystz: this.queryParams.xsystz
}).then(res => {
if (res.success) {
const {
records
} = res.data
if (records.length > 0) {
this.DialogTitle = "查看详情"
this.DialogWidth = "70vw"
this.showDialog = true
this.$nextTick(() => {
this.$refs.detail.formDetail = records || []
})
} else {
this.$warning('暂无数据')
}
}
})
},
yssqsp() {
if (this.selectOne || this.clickOne) {
submit(this.singleItem).then(res => {
if (res.success) {
this.$success('操作成功');
this.$refs['TablePager'].pageQuery()
}
})
} else {
this.$warning('请选中一行操作');
}
},
/* 基础查询*/
query: doQuery,
queryDetail: queryDetail
},
}
</script>
<style scoped>
/deep/.el-dialog{
background: url(./static/bg.png);
background-size: 100% 100%;
opacity: 1;
}
/deep/.el-dialog__title{
color: #fff;
}
.search-span{
color: #fff!important;
}
.min_full{
border: 0px solid!important;
}
.search{
border: 0px solid!important;
}
/deep/.el-table th.el-table__cell {
background-color:rgba(0,0,0,.2)!important;
color: #25c2da!important;
font-size: 13px!important;
font-weight: 500!important;
}
/deep/.el-table tr {
background-color: rgba(0,0,0,.2)!important;
color: #25c2da!important;
font-size: 13px!important;
font-weight: 500!important;
}
/deep/.el-table{
background-color: rgba(0,0,0,.2)!important;
}
</style>
<template> <template>
<div id="szkb"> <div id="szkb">
<Dialog :app='dialog' v-if="dialog.showDialog" />
<!-- 弹框区域-->
<div class="title"> <div class="title">
大数据展示平台 大数据展示平台
</div> </div>
...@@ -149,6 +151,7 @@ ...@@ -149,6 +151,7 @@
<script> <script>
import vueSeamless from 'vue-seamless-scroll' import vueSeamless from 'vue-seamless-scroll'
import huaian from "common/src/assets/mapJson/huaian.json" import huaian from "common/src/assets/mapJson/huaian.json"
import Dialog from "./dialog.vue"
export default { export default {
computed: { computed: {
optionSingleHeight() { optionSingleHeight() {
...@@ -158,9 +161,11 @@ ...@@ -158,9 +161,11 @@
} }
}, },
components: { components: {
vueSeamless vueSeamless,
Dialog
}, },
mounted() { mounted() {
this.initHuanai()
this.$nextTick(() => { this.$nextTick(() => {
document.getElementById("szkb").addEventListener('dblclick', function(e) { document.getElementById("szkb").addEventListener('dblclick', function(e) {
fullScreen(document.getElementById("szkb")); fullScreen(document.getElementById("szkb"));
...@@ -168,7 +173,9 @@ ...@@ -168,7 +173,9 @@
/* 初始化地图*/ /* 初始化地图*/
this.szkbmapCharts = this.initSzkbmapCharts() this.szkbmapCharts = this.initSzkbmapCharts()
this.sdtCharts=this.initsdt() this.sdtCharts=this.initsdt()
this.szkbmapCharts.on("click", function(params) { this.szkbmapCharts.on("click", (params)=>{
this.dialog.DialogTitle=params.name
this.dialog.showDialog=true
console.log(`${params.name}`) console.log(`${params.name}`)
}); });
...@@ -176,6 +183,11 @@ ...@@ -176,6 +183,11 @@
}, },
data() { data() {
return { return {
dialog:{
showDialog:false,
DialogTitle:'测试',
DialogWidth:'80vw'
},
listData: [{ listData: [{
data: 112, data: 112,
title: '百度' title: '百度'
...@@ -224,6 +236,28 @@ ...@@ -224,6 +236,28 @@
} }
}, },
methods: { methods: {
/* 地图标记
淮安供电公司本部,金湖县供电公司,盱眙县供电公司,洪泽县供电公司,涟水县供电公司
*/
initHuanai(){
let huaian1=_.cloneDeep(huaian)
huaian1.features.forEach(item=>{
if(item.properties.name=='淮安区'){
item.properties.name='淮安供电公司本部'
}else if(item.properties.name=='金湖县'){
item.properties.name='金湖县供电公司'
}else if(item.properties.name=='盱眙县'){
item.properties.name='盱眙县供电公司'
}else if(item.properties.name=='洪泽县'){
item.properties.name='洪泽县供电公司'
}else if(item.properties.name=='涟水县'){
item.properties.name='涟水县供电公司'
}else{
item.properties.name=''
}
})
return huaian1
},
initsdt(){ initsdt(){
const charts = this.$echarts.init(this.$refs["sdt"]); const charts = this.$echarts.init(this.$refs["sdt"]);
const option = { const option = {
...@@ -359,7 +393,7 @@ ...@@ -359,7 +393,7 @@
}, },
formatter: function (params) { formatter: function (params) {
// 格式化提示浮窗内容 // 格式化提示浮窗内容
return params.name + ": " + (params.value||'未设置'); // return params.name + ": " + (params.value||'未设置');
}, },
showDelay: 100, showDelay: 100,
}, },
...@@ -419,7 +453,7 @@ ...@@ -419,7 +453,7 @@
}, },
}; };
// 地图注册,第一个参数的名字必须和option.geo.map一致 // 地图注册,第一个参数的名字必须和option.geo.map一致
this.$echarts.registerMap("huaian", huaian) this.$echarts.registerMap("huaian", this.initHuanai())
charts.setOption(option); charts.setOption(option);
return charts return charts
......
...@@ -210,7 +210,6 @@ border-radius: 18px; ...@@ -210,7 +210,6 @@ border-radius: 18px;
/*position: relative;*/ /*position: relative;*/
} }
.lbtit > :nth-child(even) { .lbtit > :nth-child(even) {
-webkit-box-shadow: #3486da 0px 0px 10px; -webkit-box-shadow: #3486da 0px 0px 10px;
-moz-box-shadow: #3486da 0px 0px 10px; -moz-box-shadow: #3486da 0px 0px 10px;
box-shadow: inset 0 0 30px #3486da; box-shadow: inset 0 0 30px #3486da;
......
<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:'B'
}" />
<!-- 导入-->
<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()
// this.$refs['TablePager'].pageQuery()
},
data() {
return {
activeName: '',
paneList: [],
baseUrl: 'hafms/yszhcxlog',
/* 查询参数*/
queryParams: {
lx: 'B',
},
/* 表格标题对应参数*/
tableTitle: [{
title: "预算科目",
field: "fyname",
fieldType: "ftString",
width: 160
},
{
title: "加载中",
fieldType: "ftString",
field: "title",
width: 160,
subtitle: [{
label: "年度预算目标值(万元)",
prop: "ndysmb",
fieldType: "ftString",
width: 230
},
{
prop: "phmb",
label: "平衡目标值(万元)",
width: "120"
},
{
prop: "ljfj",
label: "累计分解值(万元)",
width: "120"
},
{
prop: "fjl",
label: "分解率",
width: "120"
},
{
prop: "fsz",
label: "发生值(万元)",
width: "120"
},
{
prop: "wcl",
label: "完成率",
width: "120"
},
]
},
{
title: "加载中",
fieldType: "ftString",
field: "title",
width: 160,
subtitle: [{
label: "年度预算目标值(万元)",
prop: "ndysmb2",
fieldType: "ftString",
width: 230
},
{
prop: "phmb2",
label: "平衡目标值(万元)",
width: "120"
},
{
prop: "ljfj2",
label: "累计分解值(万元)",
width: "120"
},
{
prop: "fjl2",
label: "分解率",
width: "120"
},
{
prop: "fsz2",
label: "发生值(万元)",
width: "120"
},
{
prop: "wcl2",
label: "完成率",
width: "120"
},
]
},
]
}
},
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: 'B'
}).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'] = gs1
/* 替换数据*/
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>
<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:'A'
}" />
<!-- 导入-->
<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()
// this.$refs['TablePager'].pageQuery()
},
data() {
return {
activeName: '',
paneList: [],
baseUrl: 'hafms/yszhcxlog',
/* 查询参数*/
queryParams: {
lx: 'A',
},
/* 表格标题对应参数*/
tableTitle: [{
title: "预算科目",
field: "fyname",
fieldType: "ftString",
width: 160
},
{
title: "加载中",
fieldType: "ftString",
field: "title",
width: 160,
subtitle: [{
label: "年度预算目标值(万元)",
prop: "ndysmb",
fieldType: "ftString",
width: 230
},
{
prop: "phmb",
label: "平衡目标值(万元)",
width: "120"
},
{
prop: "ljfj",
label: "累计分解值(万元)",
width: "120"
},
{
prop: "fjl",
label: "分解率",
width: "120"
},
{
prop: "fsz",
label: "发生值(万元)",
width: "120"
},
{
prop: "wcl",
label: "完成率",
width: "120"
},
]
},
{
title: "加载中",
fieldType: "ftString",
field: "title",
width: 160,
subtitle: [{
label: "年度预算目标值(万元)",
prop: "ndysmb2",
fieldType: "ftString",
width: 230
},
{
prop: "phmb2",
label: "平衡目标值(万元)",
width: "120"
},
{
prop: "ljfj2",
label: "累计分解值(万元)",
width: "120"
},
{
prop: "fjl2",
label: "分解率",
width: "120"
},
{
prop: "fsz2",
label: "发生值(万元)",
width: "120"
},
{
prop: "wcl2",
label: "完成率",
width: "120"
},
]
},
]
}
},
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'] = gs1
/* 替换数据*/
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