1
This commit is contained in:
@@ -1,15 +1,33 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="app-container" v-loading="loading">
|
<div class="app-container" v-loading="loading">
|
||||||
<!-- 查询条件 -->
|
<!-- 查询条件(始终展示,避免找不到京粉账号筛选) -->
|
||||||
<el-card class="filter-card">
|
<el-card class="filter-card">
|
||||||
<el-form :model="queryParams" ref="queryForm" :inline="true" size="small" v-show="showSearch" label-width="88px">
|
<div slot="header" class="filter-card-header">
|
||||||
<el-form-item label="京粉账号" prop="unionId">
|
<span class="filter-card-title">筛选条件</span>
|
||||||
<el-select v-model="queryParams.unionId" placeholder="全部京东联盟账号" clearable filterable style="width: 220px">
|
<right-toolbar :search="false" @queryTable="getStatistics" />
|
||||||
|
</div>
|
||||||
|
<el-alert
|
||||||
|
v-if="adminUnionNotice"
|
||||||
|
:title="adminUnionNotice"
|
||||||
|
type="warning"
|
||||||
|
:closable="false"
|
||||||
|
show-icon
|
||||||
|
class="admin-alert"
|
||||||
|
/>
|
||||||
|
<el-form :model="queryParams" ref="queryForm" :inline="true" size="small" label-width="88px">
|
||||||
|
<el-form-item label="京粉账号" prop="unionId" class="union-form-item">
|
||||||
|
<el-select
|
||||||
|
v-model="queryParams.unionId"
|
||||||
|
placeholder="选择京粉 / 联盟账号(与「订单列表」页同一数据源)"
|
||||||
|
clearable
|
||||||
|
filterable
|
||||||
|
style="width: 280px"
|
||||||
|
>
|
||||||
<el-option
|
<el-option
|
||||||
v-for="admin in adminList"
|
v-for="admin in adminList"
|
||||||
:key="admin.value || admin.id"
|
:key="String(admin.value || admin.id)"
|
||||||
:label="admin.label || (admin.name + ' (' + admin.wxid + ')')"
|
:label="admin.label || (admin.name + ' (' + admin.wxid + ')')"
|
||||||
:value="admin.value || admin.id"
|
:value="admin.value != null ? admin.value : admin.id"
|
||||||
/>
|
/>
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
@@ -134,7 +152,9 @@ export default {
|
|||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
loading: false,
|
loading: false,
|
||||||
showSearch: true,
|
/** 京粉下拉的独立加载状态(避免 validCode 接口失败拖垮 admin 列表) */
|
||||||
|
_adminListLoaded: false,
|
||||||
|
_adminListError: false,
|
||||||
queryParams: {
|
queryParams: {
|
||||||
beginTime: null,
|
beginTime: null,
|
||||||
endTime: null,
|
endTime: null,
|
||||||
@@ -199,6 +219,16 @@ export default {
|
|||||||
hint: 'actualFee 汇总'
|
hint: 'actualFee 汇总'
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
},
|
||||||
|
/** 下拉无数据或加载失败时的说明(用户误以为「没有京粉筛选」) */
|
||||||
|
adminUnionNotice() {
|
||||||
|
if (this._adminListError) {
|
||||||
|
return '京粉账号列表接口异常,下拉暂无选项。请刷新或检查接口 /jarvis/superadmin/select/adminUnionId 与权限。'
|
||||||
|
}
|
||||||
|
if (this._adminListLoaded && (!this.adminList || this.adminList.length === 0)) {
|
||||||
|
return '未配置任何京粉账号选项:请先到「超级管理员」维护 unionId,或确认当前账号有拉取下拉数据的权限。'
|
||||||
|
}
|
||||||
|
return ''
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
@@ -216,21 +246,29 @@ export default {
|
|||||||
this._disposeCharts()
|
this._disposeCharts()
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
bootstrap() {
|
async bootstrap() {
|
||||||
Promise.all([
|
this._adminListError = false
|
||||||
getValidCodeSelectData().then(res => {
|
try {
|
||||||
this.validCodeOptions = res.data || []
|
const res = await getValidCodeSelectData()
|
||||||
}),
|
this.validCodeOptions = (res && res.data) ? res.data : []
|
||||||
getAdminSelectData().then(res => {
|
} catch (e) {
|
||||||
this.adminList = res.data || res || []
|
this.validCodeOptions = []
|
||||||
})
|
this.$message.error('订单状态下拉加载失败')
|
||||||
])
|
}
|
||||||
.catch(() => {
|
try {
|
||||||
this.$message.error('加载筛选项失败')
|
const res = await getAdminSelectData()
|
||||||
})
|
this.adminList = (res && (res.data || res.rows)) ? (res.data || res.rows) : (res || [])
|
||||||
.finally(() => {
|
if (!Array.isArray(this.adminList)) {
|
||||||
|
this.adminList = []
|
||||||
|
}
|
||||||
|
} catch (e) {
|
||||||
|
this._adminListError = true
|
||||||
|
this.adminList = []
|
||||||
|
this.$message.error('京粉账号下拉加载失败')
|
||||||
|
} finally {
|
||||||
|
this._adminListLoaded = true
|
||||||
|
}
|
||||||
this.getStatistics()
|
this.getStatistics()
|
||||||
})
|
|
||||||
},
|
},
|
||||||
_disposeCharts() {
|
_disposeCharts() {
|
||||||
if (this._statusChart) {
|
if (this._statusChart) {
|
||||||
@@ -248,6 +286,9 @@ export default {
|
|||||||
if (params.skuId === '' || params.skuId === undefined) {
|
if (params.skuId === '' || params.skuId === undefined) {
|
||||||
params.skuId = null
|
params.skuId = null
|
||||||
}
|
}
|
||||||
|
if (params.unionId === '' || params.unionId === undefined) {
|
||||||
|
params.unionId = null
|
||||||
|
}
|
||||||
getOrderStatistics(params)
|
getOrderStatistics(params)
|
||||||
.then(response => {
|
.then(response => {
|
||||||
this.statistics = Object.assign(
|
this.statistics = Object.assign(
|
||||||
@@ -406,6 +447,27 @@ export default {
|
|||||||
margin-bottom: 16px;
|
margin-bottom: 16px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.filter-card-header {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: space-between;
|
||||||
|
gap: 12px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.filter-card-title {
|
||||||
|
font-weight: 600;
|
||||||
|
font-size: 15px;
|
||||||
|
color: #303133;
|
||||||
|
}
|
||||||
|
|
||||||
|
.admin-alert {
|
||||||
|
margin-bottom: 12px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.union-form-item {
|
||||||
|
margin-bottom: 12px;
|
||||||
|
}
|
||||||
|
|
||||||
.summary-row {
|
.summary-row {
|
||||||
margin-bottom: 8px;
|
margin-bottom: 8px;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user