Merge remote-tracking branch 'yudao/dev' into crm-msg
commit
e033793a94
@ -0,0 +1,25 @@
|
|||||||
|
import request from '@/config/axios'
|
||||||
|
|
||||||
|
export interface BiRankRespVO {
|
||||||
|
count: number
|
||||||
|
nickname: string
|
||||||
|
deptName: string
|
||||||
|
}
|
||||||
|
|
||||||
|
// 排行 API
|
||||||
|
export const RankApi = {
|
||||||
|
// 获得合同排行榜
|
||||||
|
getContractPriceRank: (params: any) => {
|
||||||
|
return request.get({
|
||||||
|
url: '/crm/bi-rank/get-contract-price-rank',
|
||||||
|
params
|
||||||
|
})
|
||||||
|
},
|
||||||
|
// 获得回款排行榜
|
||||||
|
getReceivablePriceRank: (params: any) => {
|
||||||
|
return request.get({
|
||||||
|
url: '/crm/bi-rank/get-receivable-price-rank',
|
||||||
|
params
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -1,34 +0,0 @@
|
|||||||
import request from '@/config/axios'
|
|
||||||
|
|
||||||
export interface BiContractRanKingRespVO {
|
|
||||||
price: number
|
|
||||||
nickname: string
|
|
||||||
deptName: string
|
|
||||||
}
|
|
||||||
export interface BiReceivablesRanKingRespVO {
|
|
||||||
price: number
|
|
||||||
nickname: string
|
|
||||||
deptName: string
|
|
||||||
}
|
|
||||||
export interface BiRankReqVO {
|
|
||||||
deptId: number
|
|
||||||
type: string
|
|
||||||
}
|
|
||||||
|
|
||||||
// 排行 API
|
|
||||||
export const RankingStatisticsApi = {
|
|
||||||
// 获得合同排行榜
|
|
||||||
contractAmountRanking: (params: any) => {
|
|
||||||
return request.get({
|
|
||||||
url: '/bi/ranking/contract-ranking',
|
|
||||||
params
|
|
||||||
})
|
|
||||||
},
|
|
||||||
// 获得回款排行榜
|
|
||||||
receivablesAmountRanking: (params: any) => {
|
|
||||||
return request.get({
|
|
||||||
url: '/bi/ranking/receivables-ranking',
|
|
||||||
params
|
|
||||||
})
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -0,0 +1,50 @@
|
|||||||
|
import request from '@/config/axios'
|
||||||
|
|
||||||
|
// ERP 商品分类 VO
|
||||||
|
export interface ProductCategoryVO {
|
||||||
|
// 分类编号
|
||||||
|
id: number
|
||||||
|
// 父分类编号
|
||||||
|
parentId: number
|
||||||
|
// 分类名称
|
||||||
|
name: string
|
||||||
|
// 分类编码
|
||||||
|
code: string
|
||||||
|
// 分类排序
|
||||||
|
sort: number
|
||||||
|
// 开启状态
|
||||||
|
status: number
|
||||||
|
}
|
||||||
|
|
||||||
|
// ERP 商品分类 API
|
||||||
|
export const ProductCategoryApi = {
|
||||||
|
// 查询ERP 商品分类列表
|
||||||
|
getProductCategoryList: async (params) => {
|
||||||
|
return await request.get({ url: `/erp/product-category/list`, params })
|
||||||
|
},
|
||||||
|
|
||||||
|
// 查询ERP 商品分类详情
|
||||||
|
getProductCategory: async (id: number) => {
|
||||||
|
return await request.get({ url: `/erp/product-category/get?id=` + id })
|
||||||
|
},
|
||||||
|
|
||||||
|
// 新增ERP 商品分类
|
||||||
|
createProductCategory: async (data: ProductCategoryVO) => {
|
||||||
|
return await request.post({ url: `/erp/product-category/create`, data })
|
||||||
|
},
|
||||||
|
|
||||||
|
// 修改ERP 商品分类
|
||||||
|
updateProductCategory: async (data: ProductCategoryVO) => {
|
||||||
|
return await request.put({ url: `/erp/product-category/update`, data })
|
||||||
|
},
|
||||||
|
|
||||||
|
// 删除ERP 商品分类
|
||||||
|
deleteProductCategory: async (id: number) => {
|
||||||
|
return await request.delete({ url: `/erp/product-category/delete?id=` + id })
|
||||||
|
},
|
||||||
|
|
||||||
|
// 导出ERP 商品分类 Excel
|
||||||
|
exportProductCategory: async (params) => {
|
||||||
|
return await request.download({ url: `/erp/product-category/export-excel`, params })
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,44 @@
|
|||||||
|
import request from '@/config/axios'
|
||||||
|
|
||||||
|
// ERP 产品单位 VO
|
||||||
|
export interface ProductUnitVO {
|
||||||
|
// 单位编号
|
||||||
|
id: number
|
||||||
|
// 单位名字
|
||||||
|
name: string
|
||||||
|
// 单位状态
|
||||||
|
status: number
|
||||||
|
}
|
||||||
|
|
||||||
|
// ERP 产品单位 API
|
||||||
|
export const ProductUnitApi = {
|
||||||
|
// 查询ERP 产品单位分页
|
||||||
|
getProductUnitPage: async (params: any) => {
|
||||||
|
return await request.get({ url: `/erp/product-unit/page`, params })
|
||||||
|
},
|
||||||
|
|
||||||
|
// 查询ERP 产品单位详情
|
||||||
|
getProductUnit: async (id: number) => {
|
||||||
|
return await request.get({ url: `/erp/product-unit/get?id=` + id })
|
||||||
|
},
|
||||||
|
|
||||||
|
// 新增ERP 产品单位
|
||||||
|
createProductUnit: async (data: ProductUnitVO) => {
|
||||||
|
return await request.post({ url: `/erp/product-unit/create`, data })
|
||||||
|
},
|
||||||
|
|
||||||
|
// 修改ERP 产品单位
|
||||||
|
updateProductUnit: async (data: ProductUnitVO) => {
|
||||||
|
return await request.put({ url: `/erp/product-unit/update`, data })
|
||||||
|
},
|
||||||
|
|
||||||
|
// 删除ERP 产品单位
|
||||||
|
deleteProductUnit: async (id: number) => {
|
||||||
|
return await request.delete({ url: `/erp/product-unit/delete?id=` + id })
|
||||||
|
},
|
||||||
|
|
||||||
|
// 导出ERP 产品单位 Excel
|
||||||
|
exportProductUnit: async (params) => {
|
||||||
|
return await request.download({ url: `/erp/product-unit/export-excel`, params })
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,100 @@
|
|||||||
|
<!-- BI 排行版 -->
|
||||||
|
<template>
|
||||||
|
<ContentWrap>
|
||||||
|
<!-- 搜索工作栏 -->
|
||||||
|
<el-form
|
||||||
|
class="-mb-15px"
|
||||||
|
:model="queryParams"
|
||||||
|
ref="queryFormRef"
|
||||||
|
:inline="true"
|
||||||
|
label-width="68px"
|
||||||
|
>
|
||||||
|
<el-form-item label="时间范围" prop="orderDate">
|
||||||
|
<el-date-picker
|
||||||
|
v-model="queryParams.times"
|
||||||
|
:shortcuts="defaultShortcuts"
|
||||||
|
class="!w-240px"
|
||||||
|
end-placeholder="结束日期"
|
||||||
|
start-placeholder="开始日期"
|
||||||
|
type="daterange"
|
||||||
|
value-format="YYYY-MM-DD HH:mm:ss"
|
||||||
|
:default-time="[new Date('1 00:00:00'), new Date('1 23:59:59')]"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="归属部门" prop="deptId">
|
||||||
|
<el-tree-select
|
||||||
|
v-model="queryParams.deptId"
|
||||||
|
:data="deptList"
|
||||||
|
:props="defaultProps"
|
||||||
|
check-strictly
|
||||||
|
node-key="id"
|
||||||
|
placeholder="请选择归属部门"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item>
|
||||||
|
<el-button @click="handleQuery"><Icon icon="ep:search" class="mr-5px" /> 搜索</el-button>
|
||||||
|
<el-button @click="resetQuery"><Icon icon="ep:refresh" class="mr-5px" /> 重置</el-button>
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
|
</ContentWrap>
|
||||||
|
|
||||||
|
<!-- 排行数据 -->
|
||||||
|
<el-col>
|
||||||
|
<el-tabs v-model="activeTab">
|
||||||
|
<!-- 合同金额排行 -->
|
||||||
|
<el-tab-pane label="合同金额排行" name="contractPriceRank" lazy>
|
||||||
|
<ContractPriceRank :query-params="queryParams" ref="contractPriceRankRef" />
|
||||||
|
</el-tab-pane>
|
||||||
|
<!-- 回款金额排行 -->
|
||||||
|
<el-tab-pane label="回款金额排行" name="receivablePriceRank" lazy>
|
||||||
|
<ReceivablePriceRank :query-params="queryParams" ref="receivablePriceRankRef" />
|
||||||
|
</el-tab-pane>
|
||||||
|
</el-tabs>
|
||||||
|
</el-col>
|
||||||
|
</template>
|
||||||
|
<script lang="ts" setup>
|
||||||
|
import ContractPriceRank from './ContractPriceRank.vue'
|
||||||
|
import ReceivablePriceRank from './ReceivablePriceRank.vue'
|
||||||
|
import { defaultProps, handleTree } from '@/utils/tree'
|
||||||
|
import * as DeptApi from '@/api/system/dept'
|
||||||
|
import { beginOfDay, defaultShortcuts, endOfDay, formatDate } from '@/utils/formatTime'
|
||||||
|
import { useUserStore } from '@/store/modules/user'
|
||||||
|
|
||||||
|
defineOptions({ name: 'CrmBiRank' })
|
||||||
|
|
||||||
|
const queryParams = reactive({
|
||||||
|
deptId: useUserStore().getUser.deptId,
|
||||||
|
times: [
|
||||||
|
// 默认显示最近一周的数据
|
||||||
|
formatDate(beginOfDay(new Date(new Date().getTime() - 3600 * 1000 * 24 * 7))),
|
||||||
|
formatDate(endOfDay(new Date(new Date().getTime() - 3600 * 1000 * 24)))
|
||||||
|
]
|
||||||
|
})
|
||||||
|
|
||||||
|
const queryFormRef = ref() // 搜索的表单
|
||||||
|
const deptList = ref<Tree[]>([]) // 树形结构
|
||||||
|
const activeTab = ref('contractPriceRank')
|
||||||
|
const contractPriceRankRef = ref() // ContractPriceRank 组件的引用
|
||||||
|
const receivablePriceRankRef = ref() // ReceivablePriceRank 组件的引用
|
||||||
|
|
||||||
|
/** 搜索按钮操作 */
|
||||||
|
const handleQuery = () => {
|
||||||
|
if (activeTab.value === 'contractPriceRank') {
|
||||||
|
contractPriceRankRef.value.loadData()
|
||||||
|
} else if (activeTab.value === 'receivablePriceRank') {
|
||||||
|
receivablePriceRankRef.value.loadData()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 重置按钮操作 */
|
||||||
|
const resetQuery = () => {
|
||||||
|
queryFormRef.value.resetFields()
|
||||||
|
handleQuery()
|
||||||
|
}
|
||||||
|
|
||||||
|
// 加载部门树
|
||||||
|
onMounted(async () => {
|
||||||
|
deptList.value = handleTree(await DeptApi.getSimpleDeptList())
|
||||||
|
})
|
||||||
|
</script>
|
||||||
|
<style lang="scss" scoped></style>
|
||||||
@ -1,133 +0,0 @@
|
|||||||
<template>
|
|
||||||
<el-card shadow="never">
|
|
||||||
<!-- 柱状图 -->
|
|
||||||
<el-skeleton :loading="trendLoading" animated>
|
|
||||||
<Echart :height="500" :options="barChartOptions" />
|
|
||||||
</el-skeleton>
|
|
||||||
</el-card>
|
|
||||||
<el-card shadow="never" class="mt-16px">
|
|
||||||
<!-- 排行列表 -->
|
|
||||||
<el-table v-loading="loading" :data="list">
|
|
||||||
<el-table-column label="公司排名" align="center" type="index" width="80" />
|
|
||||||
<el-table-column label="签订人" align="center" prop="nickname" min-width="200" />
|
|
||||||
<el-table-column label="部门" align="center" prop="deptName" min-width="200" />
|
|
||||||
<el-table-column label="合同金额(元)" align="center" prop="price" min-width="200" />
|
|
||||||
</el-table>
|
|
||||||
</el-card>
|
|
||||||
</template>
|
|
||||||
<script setup lang="ts">
|
|
||||||
import { RankingStatisticsApi, BiContractRanKingRespVO, BiRankReqVO } from '@/api/crm/bi/ranking'
|
|
||||||
import { EChartsOption } from 'echarts'
|
|
||||||
|
|
||||||
/** 合同金额排行 */
|
|
||||||
defineOptions({ name: 'RankingContractStatistics' })
|
|
||||||
|
|
||||||
const trendLoading = ref(true) // 状态加载中
|
|
||||||
const loading = ref(false) // 列表的加载中
|
|
||||||
const list = ref<BiContractRanKingRespVO[]>([]) // 列表的数据
|
|
||||||
const params = defineProps<{ queryParams: BiRankReqVO }>() // 搜索参数
|
|
||||||
|
|
||||||
/** 柱状图配置 横向 */
|
|
||||||
const barChartOptions = reactive<EChartsOption>({
|
|
||||||
dataset: {
|
|
||||||
dimensions: ['name', 'value'],
|
|
||||||
source: []
|
|
||||||
},
|
|
||||||
grid: {
|
|
||||||
left: 20,
|
|
||||||
right: 20,
|
|
||||||
bottom: 20,
|
|
||||||
top: 80,
|
|
||||||
containLabel: true
|
|
||||||
},
|
|
||||||
legend: {
|
|
||||||
top: 50
|
|
||||||
},
|
|
||||||
series: [
|
|
||||||
{
|
|
||||||
name: '合同金额排行',
|
|
||||||
type: 'bar',
|
|
||||||
smooth: true,
|
|
||||||
itemStyle: { color: '#B37FEB' }
|
|
||||||
}
|
|
||||||
],
|
|
||||||
toolbox: {
|
|
||||||
feature: {
|
|
||||||
// 数据区域缩放
|
|
||||||
dataZoom: {
|
|
||||||
yAxisIndex: false // Y轴不缩放
|
|
||||||
},
|
|
||||||
brush: {
|
|
||||||
type: ['lineX', 'clear'] // 区域缩放按钮、还原按钮
|
|
||||||
},
|
|
||||||
saveAsImage: { show: true, name: '合同金额排行' } // 保存为图片
|
|
||||||
}
|
|
||||||
},
|
|
||||||
tooltip: {
|
|
||||||
trigger: 'axis',
|
|
||||||
axisPointer: {
|
|
||||||
type: 'shadow'
|
|
||||||
}
|
|
||||||
},
|
|
||||||
xAxis: {
|
|
||||||
type: 'value',
|
|
||||||
name: '合同金额(元)',
|
|
||||||
nameGap: 30,
|
|
||||||
nameTextStyle: {
|
|
||||||
color: '#666',
|
|
||||||
fontSize: 14
|
|
||||||
}
|
|
||||||
},
|
|
||||||
yAxis: {
|
|
||||||
type: 'category',
|
|
||||||
name: '签订人',
|
|
||||||
nameGap: 30,
|
|
||||||
nameTextStyle: {
|
|
||||||
color: '#666',
|
|
||||||
fontSize: 14
|
|
||||||
},
|
|
||||||
axisLabel: {
|
|
||||||
formatter: (value: string) => {
|
|
||||||
return value
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}) as EChartsOption
|
|
||||||
|
|
||||||
/** 获取合同金额排行 */
|
|
||||||
const getRankingContractStatistics = async () => {
|
|
||||||
trendLoading.value = true
|
|
||||||
loading.value = true
|
|
||||||
const rankingList = await RankingStatisticsApi.contractAmountRanking(params.queryParams)
|
|
||||||
let source = rankingList.map((item: BiContractRanKingRespVO) => {
|
|
||||||
return {
|
|
||||||
name: item.nickname,
|
|
||||||
value: item.price
|
|
||||||
}
|
|
||||||
})
|
|
||||||
// 反转数据源
|
|
||||||
source = source.reverse()
|
|
||||||
// 更新 Echarts 数据
|
|
||||||
if (barChartOptions.dataset && barChartOptions.dataset['source']) {
|
|
||||||
barChartOptions.dataset['source'] = source
|
|
||||||
}
|
|
||||||
// 更新列表数据
|
|
||||||
list.value = rankingList
|
|
||||||
trendLoading.value = false
|
|
||||||
loading.value = false
|
|
||||||
}
|
|
||||||
|
|
||||||
/** 重新加载数据 */
|
|
||||||
const reloadData = async () => {
|
|
||||||
await getRankingContractStatistics()
|
|
||||||
}
|
|
||||||
// 暴露 reloadData 函数
|
|
||||||
defineExpose({
|
|
||||||
reloadData
|
|
||||||
})
|
|
||||||
|
|
||||||
onMounted(() => {
|
|
||||||
getRankingContractStatistics()
|
|
||||||
})
|
|
||||||
</script>
|
|
||||||
<style scoped lang="scss"></style>
|
|
||||||
@ -1,133 +0,0 @@
|
|||||||
<template>
|
|
||||||
<el-card shadow="never">
|
|
||||||
<!-- 柱状图 -->
|
|
||||||
<el-skeleton :loading="trendLoading" animated>
|
|
||||||
<Echart :height="500" :options="barChartOptions" />
|
|
||||||
</el-skeleton>
|
|
||||||
</el-card>
|
|
||||||
<el-card shadow="never" class="mt-16px">
|
|
||||||
<!-- 排行列表 -->
|
|
||||||
<el-table v-loading="loading" :data="list">
|
|
||||||
<el-table-column label="公司排名" align="center" type="index" width="80" />
|
|
||||||
<el-table-column label="签订人" align="center" prop="nickname" min-width="200" />
|
|
||||||
<el-table-column label="部门" align="center" prop="deptName" min-width="200" />
|
|
||||||
<el-table-column label="合同金额(元)" align="center" prop="price" min-width="200" />
|
|
||||||
</el-table>
|
|
||||||
</el-card>
|
|
||||||
</template>
|
|
||||||
<script setup lang="ts">
|
|
||||||
import { RankingStatisticsApi, BiReceivablesRanKingRespVO } from '@/api/crm/bi/ranking'
|
|
||||||
import { EChartsOption } from 'echarts'
|
|
||||||
|
|
||||||
/** 回款金额排行 */
|
|
||||||
defineOptions({ name: 'RankingReceivablesStatistics' })
|
|
||||||
|
|
||||||
const trendLoading = ref(true) // 状态加载中
|
|
||||||
const loading = ref(false) // 列表的加载中
|
|
||||||
const list = ref<BiReceivablesRanKingRespVO[]>([]) // 列表的数据
|
|
||||||
const params = defineProps<{ queryParams: any }>() // 搜索参数
|
|
||||||
|
|
||||||
/** 柱状图配置 横向 */
|
|
||||||
const barChartOptions = reactive<EChartsOption>({
|
|
||||||
dataset: {
|
|
||||||
dimensions: ['name', 'value'],
|
|
||||||
source: []
|
|
||||||
},
|
|
||||||
grid: {
|
|
||||||
left: 20,
|
|
||||||
right: 20,
|
|
||||||
bottom: 20,
|
|
||||||
top: 80,
|
|
||||||
containLabel: true
|
|
||||||
},
|
|
||||||
legend: {
|
|
||||||
top: 50
|
|
||||||
},
|
|
||||||
series: [
|
|
||||||
{
|
|
||||||
name: '回款金额排行',
|
|
||||||
type: 'bar',
|
|
||||||
smooth: true,
|
|
||||||
itemStyle: { color: '#B37FEB' }
|
|
||||||
}
|
|
||||||
],
|
|
||||||
toolbox: {
|
|
||||||
feature: {
|
|
||||||
// 数据区域缩放
|
|
||||||
dataZoom: {
|
|
||||||
yAxisIndex: false // Y轴不缩放
|
|
||||||
},
|
|
||||||
brush: {
|
|
||||||
type: ['lineX', 'clear'] // 区域缩放按钮、还原按钮
|
|
||||||
},
|
|
||||||
saveAsImage: { show: true, name: '回款金额排行' } // 保存为图片
|
|
||||||
}
|
|
||||||
},
|
|
||||||
tooltip: {
|
|
||||||
trigger: 'axis',
|
|
||||||
axisPointer: {
|
|
||||||
type: 'shadow'
|
|
||||||
}
|
|
||||||
},
|
|
||||||
xAxis: {
|
|
||||||
type: 'value',
|
|
||||||
name: '回款金额(元)',
|
|
||||||
nameGap: 30,
|
|
||||||
nameTextStyle: {
|
|
||||||
color: '#666',
|
|
||||||
fontSize: 14
|
|
||||||
}
|
|
||||||
},
|
|
||||||
yAxis: {
|
|
||||||
type: 'category',
|
|
||||||
name: '签订人',
|
|
||||||
nameGap: 30,
|
|
||||||
nameTextStyle: {
|
|
||||||
color: '#666',
|
|
||||||
fontSize: 14
|
|
||||||
},
|
|
||||||
axisLabel: {
|
|
||||||
formatter: (value: string) => {
|
|
||||||
return value
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}) as EChartsOption
|
|
||||||
|
|
||||||
/** 获取回款金额排行 */
|
|
||||||
const getRankingReceivablesStatistics = async () => {
|
|
||||||
trendLoading.value = true
|
|
||||||
loading.value = true
|
|
||||||
const rankingList = await RankingStatisticsApi.receivablesAmountRanking(params.queryParams)
|
|
||||||
let source = rankingList.map((item: BiReceivablesRanKingRespVO) => {
|
|
||||||
return {
|
|
||||||
name: item.nickname,
|
|
||||||
value: item.price
|
|
||||||
}
|
|
||||||
})
|
|
||||||
// 反转数据源
|
|
||||||
source = source.reverse()
|
|
||||||
// 更新 Echarts 数据
|
|
||||||
if (barChartOptions.dataset && barChartOptions.dataset['source']) {
|
|
||||||
barChartOptions.dataset['source'] = source
|
|
||||||
}
|
|
||||||
// 更新列表数据
|
|
||||||
list.value = rankingList
|
|
||||||
trendLoading.value = false
|
|
||||||
loading.value = false
|
|
||||||
}
|
|
||||||
|
|
||||||
/** 重新加载数据 */
|
|
||||||
const reloadData = async () => {
|
|
||||||
await getRankingReceivablesStatistics()
|
|
||||||
}
|
|
||||||
// 暴露 reloadData 函数
|
|
||||||
defineExpose({
|
|
||||||
reloadData
|
|
||||||
})
|
|
||||||
|
|
||||||
onMounted(() => {
|
|
||||||
getRankingReceivablesStatistics()
|
|
||||||
})
|
|
||||||
</script>
|
|
||||||
<style scoped lang="scss"></style>
|
|
||||||
@ -1,91 +0,0 @@
|
|||||||
<template>
|
|
||||||
<ContentWrap>
|
|
||||||
<!-- 搜索工作栏 -->
|
|
||||||
<el-form
|
|
||||||
class="-mb-15px"
|
|
||||||
:model="queryParams"
|
|
||||||
ref="queryFormRef"
|
|
||||||
:inline="true"
|
|
||||||
label-width="68px"
|
|
||||||
>
|
|
||||||
<el-form-item label="类型" prop="type">
|
|
||||||
<el-select v-model="queryParams.type" placeholder="请选择类型" clearable class="!w-240px">
|
|
||||||
<el-option
|
|
||||||
v-for="dict in getIntDictOptions(DICT_TYPE.BI_ANALYZE_TYPE)"
|
|
||||||
:key="dict.value"
|
|
||||||
:label="dict.label"
|
|
||||||
:value="dict.value"
|
|
||||||
/>
|
|
||||||
</el-select>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="归属部门" prop="deptId">
|
|
||||||
<el-tree-select
|
|
||||||
v-model="queryParams.deptId"
|
|
||||||
:data="deptList"
|
|
||||||
:props="defaultProps"
|
|
||||||
check-strictly
|
|
||||||
node-key="id"
|
|
||||||
placeholder="请选择归属部门"
|
|
||||||
/>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item>
|
|
||||||
<el-button @click="handleQuery"><Icon icon="ep:search" class="mr-5px" /> 搜索</el-button>
|
|
||||||
<el-button @click="resetQuery"><Icon icon="ep:refresh" class="mr-5px" /> 重置</el-button>
|
|
||||||
</el-form-item>
|
|
||||||
</el-form>
|
|
||||||
</ContentWrap>
|
|
||||||
<el-col>
|
|
||||||
<el-tabs v-model="activeTab">
|
|
||||||
<el-tab-pane label="合同金额排行" name="contractAmountRanking">
|
|
||||||
<!-- 合同金额排行 -->
|
|
||||||
<RankingContractStatistics :queryParams="queryParams" ref="rankingContractStatisticsRef" />
|
|
||||||
</el-tab-pane>
|
|
||||||
<el-tab-pane label="回款金额排行" name="receivablesRanKing" lazy>
|
|
||||||
<!-- 回款金额排行 -->
|
|
||||||
<RankingReceivablesStatistics
|
|
||||||
:queryParams="queryParams"
|
|
||||||
ref="rankingReceivablesStatisticsRef"
|
|
||||||
/>
|
|
||||||
</el-tab-pane>
|
|
||||||
</el-tabs>
|
|
||||||
</el-col>
|
|
||||||
</template>
|
|
||||||
<script lang="ts" setup>
|
|
||||||
import RankingContractStatistics from './components/RankingContractStatistics.vue'
|
|
||||||
import { defaultProps, handleTree } from '@/utils/tree'
|
|
||||||
import * as DeptApi from '@/api/system/dept'
|
|
||||||
import { DICT_TYPE, getIntDictOptions } from '@/utils/dict'
|
|
||||||
|
|
||||||
/** 排行榜 */
|
|
||||||
defineOptions({ name: 'RankingStatistics' })
|
|
||||||
|
|
||||||
const queryParams = reactive({
|
|
||||||
type: 9, // 将 type 的初始值设置为 9 本年
|
|
||||||
deptId: null
|
|
||||||
})
|
|
||||||
const queryFormRef = ref() // 搜索的表单
|
|
||||||
const deptList = ref<Tree[]>([]) // 树形结构
|
|
||||||
const activeTab = ref('contractAmountRanking')
|
|
||||||
const rankingContractStatisticsRef = ref() // RankingContractStatistics组件的引用
|
|
||||||
const rankingReceivablesStatisticsRef = ref() // RankingReceivablesStatistics组件的引用
|
|
||||||
|
|
||||||
/** 搜索按钮操作 */
|
|
||||||
const handleQuery = () => {
|
|
||||||
if (activeTab.value === 'contractAmountRanking') {
|
|
||||||
rankingContractStatisticsRef.value.reloadData()
|
|
||||||
} else if (activeTab.value === 'receivablesRanKing') {
|
|
||||||
rankingReceivablesStatisticsRef.value.reloadData()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/** 重置按钮操作 */
|
|
||||||
const resetQuery = () => {
|
|
||||||
queryFormRef.value.resetFields()
|
|
||||||
handleQuery()
|
|
||||||
}
|
|
||||||
// 加载部门树
|
|
||||||
onMounted(async () => {
|
|
||||||
deptList.value = handleTree(await DeptApi.getSimpleDeptList())
|
|
||||||
})
|
|
||||||
</script>
|
|
||||||
<style lang="scss" scoped></style>
|
|
||||||
Loading…
Reference in New Issue