修改机构查询接口, 调整表格宽度, 调整查询数据时机

This commit is contained in:
mengxiaolong
2021-01-22 13:30:29 +08:00
parent f3f2872406
commit 97c960251a
3 changed files with 31 additions and 14 deletions

View File

@@ -27,3 +27,12 @@ export function getComPerformance(data) {
data data
}) })
} }
// 个险业绩排行优化: 机构查询
export function getOrgList(data) {
return request({
url: getUrl('/data/performance/getBranchComList', 1),
method: 'post',
data
})
}

View File

@@ -6,7 +6,7 @@
<van-tab title="下辖营业区"></van-tab> <van-tab title="下辖营业区"></van-tab>
</van-tabs> </van-tabs>
<div class="table-wrapper"> <div class="table-wrapper">
<table class="myTable mb30" cellspacing="0" cellpadding="0"> <table class="myTable mb30" :style="widthObj" cellspacing="0" cellpadding="0">
<tr> <tr>
<th class="sticky th-rank">排名</th> <th class="sticky th-rank">排名</th>
<th v-for="(column, index) in columns" :key="index" :class="{ fixedWidth: index === 0, orgName: index === 0 }"> <th v-for="(column, index) in columns" :key="index" :class="{ fixedWidth: index === 0, orgName: index === 0 }">
@@ -54,18 +54,20 @@ export default {
computed: { computed: {
// 获取需要显示的列名称 // 获取需要显示的列名称
columns() { columns() {
this.widthObj.minWidth = '200vw'
if (this.dataType === 0) { if (this.dataType === 0) {
switch (this.timeType) { switch (this.timeType) {
case 0: case 0:
case 3: case 3:
return this.tableColumns[this.dataType][0] return this.tableColumns[0][0]
case 1: case 1:
return this.tableColumns[this.dataType][1] return this.tableColumns[0][1]
case 2: case 2:
if (this.active <= 1) { if (this.active <= 1) {
return this.tableColumns[this.dataType][2] return this.tableColumns[0][2]
} else { } else {
return this.tableColumns[this.dataType][3] this.widthObj.minWidth = '100%'
return this.tableColumns[0][3]
} }
default: default:
return [] return []
@@ -84,6 +86,9 @@ export default {
}, },
data() { data() {
return { return {
widthObj: {
minWidth: '200vw'
},
active: 0, active: 0,
tableColumns: [ tableColumns: [
[ [
@@ -250,7 +255,6 @@ $white: #fff;
.myTable { .myTable {
text-align: center; text-align: center;
min-width: 200vw;
} }
.myTable td, .myTable td,

View File

@@ -92,7 +92,7 @@ import { Popup, Tab, Tabs, DatetimePicker, Picker, Toast } from 'vant'
import Summarizing from './Summarizing.vue' import Summarizing from './Summarizing.vue'
import Organization from './Organization.vue' import Organization from './Organization.vue'
import dateUtil from '@/assets/js/utils/date-utils.js' import dateUtil from '@/assets/js/utils/date-utils.js'
import { getComPerformance, getComList } from '@/api/ebiz/branchOffice/branchOffice' import { getComPerformance, getOrgList } from '@/api/ebiz/branchOffice/branchOffice'
// 当前时间 // 当前时间
const currentDate = new Date() const currentDate = new Date()
@@ -152,7 +152,7 @@ export default {
OrgLv3Code: 0, OrgLv3Code: 0,
OrgLv3s: [], OrgLv3s: [],
areaCode: 0, areaCode: 0,
areaObjs: [], OrgLv4s: [],
years: [], years: [],
params: { params: {
// 86: 全国 // 86: 全国
@@ -199,7 +199,7 @@ export default {
}, },
area() { area() {
const area = ['全部'] const area = ['全部']
this.areaObjs.forEach(item => { this.OrgLv4s.forEach(item => {
if (item.upBranchCode === this.OrgLv3Code) { if (item.upBranchCode === this.OrgLv3Code) {
area.push(item.name) area.push(item.name)
} }
@@ -268,7 +268,8 @@ export default {
* 查询机构下拉列表 * 查询机构下拉列表
* manageCode, manageLv传空查全国所有二级机构 * manageCode, manageLv传空查全国所有二级机构
**/ **/
const res = await getComList({ console.log('getOrgList :>> ', getOrgList)
const res = await getOrgList({
bussinessType: 'normal', bussinessType: 'normal',
manageCode: '', manageCode: '',
manageLv: '' manageLv: ''
@@ -343,11 +344,12 @@ export default {
this.OrgLv4Name = '全部' this.OrgLv4Name = '全部'
this.OrgLv3Name = '全部' this.OrgLv3Name = '全部'
// 查询三级机构 // 查询三级机构
const res = await getComList({ const res = await getOrgList({
bussinessType: 'normal', bussinessType: 'normal',
manageCode: this.OrgLv2Code, manageCode: this.OrgLv2Code,
manageLv: '02' manageLv: '02'
}) })
this.OrgLv3s.splice(0)
this.OrgLv3s.push(...res.content) this.OrgLv3s.push(...res.content)
this.setRankData() this.setRankData()
}, },
@@ -367,19 +369,20 @@ export default {
} }
this.OrgLv3Name = '全部' this.OrgLv3Name = '全部'
// 查询四级机构 // 查询四级机构
const res = await getComList({ const res = await getOrgList({
bussinessType: 'normal', bussinessType: 'normal',
manageCode: this.OrgLv3Code, manageCode: this.OrgLv3Code,
manageLv: '03' manageLv: '03'
}) })
this.areaObjs.push(...res.content) this.OrgLv4s.splice(0)
this.OrgLv4s.push(...res.content)
this.setRankData() this.setRankData()
}, },
// 筛选四级机构 // 筛选四级机构
async onOrgLv4ConditionConfirm(data) { async onOrgLv4ConditionConfirm(data) {
this.isOrgLv4ConditionShow = false this.isOrgLv4ConditionShow = false
this.OrgLv3Name = data this.OrgLv3Name = data
let area = this.areaObjs.find(item => item.name === data) let area = this.OrgLv4s.find(item => item.name === data)
if (area) { if (area) {
this.areaCode = area.code this.areaCode = area.code
this.params.manageCode = this.areaCode this.params.manageCode = this.areaCode
@@ -470,6 +473,7 @@ export default {
// nv = 0 查询汇总 // nv = 0 查询汇总
if (nv === 0) { if (nv === 0) {
this.params.type = 'all' this.params.type = 'all'
this.setRankData()
} else { } else {
switch (this.typeIndex) { switch (this.typeIndex) {
case 0: case 0: