!380 修改:商业智能-排行榜,合同金额排行和回款金额排行时间条件和接口修改

Merge pull request !380 from 安浩浩/dev
pull/381/MERGE
芋道源码 2024-02-02 15:49:13 +00:00 committed by Gitee
commit d6438943b8
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
4 changed files with 52 additions and 20 deletions

View File

@ -14,7 +14,9 @@ export interface BiReceivablesRanKingRespVO {
export interface BiRankReqVO {
deptId: number
type: string
orderDate: Date[]
startTime: Date
endTime: Date
}
// 排行 API
@ -22,14 +24,14 @@ export const RankingStatisticsApi = {
// 获得合同排行榜
contractAmountRanking: (params: any) => {
return request.get({
url: '/bi/ranking/contract-ranking',
url: '/crm/bi-ranking/contract-ranking',
params
})
},
// 获得回款排行榜
receivablesAmountRanking: (params: any) => {
return request.get({
url: '/bi/ranking/receivables-ranking',
url: '/crm/bi-ranking/receivables-ranking',
params
})
}

View File

@ -18,14 +18,21 @@
<script setup lang="ts">
import { RankingStatisticsApi, BiContractRanKingRespVO, BiRankReqVO } from '@/api/crm/bi/ranking'
import { EChartsOption } from 'echarts'
import { beginOfDay, endOfDay, formatDate } from '@/utils/formatTime'
/** 合同金额排行 */
defineOptions({ name: 'RankingContractStatistics' })
const params = reactive({
deptId: undefined,
startTime: undefined,
endTime: undefined
})
const trendLoading = ref(true) //
const loading = ref(false) //
const list = ref<BiContractRanKingRespVO[]>([]) //
const params = defineProps<{ queryParams: BiRankReqVO }>() //
const queryParams = defineProps<{ queryParams: BiRankReqVO }>() //
/** 柱状图配置 横向 */
const barChartOptions = reactive<EChartsOption>({
@ -98,7 +105,10 @@ const barChartOptions = reactive<EChartsOption>({
const getRankingContractStatistics = async () => {
trendLoading.value = true
loading.value = true
const rankingList = await RankingStatisticsApi.contractAmountRanking(params.queryParams)
params.deptId = queryParams.queryParams.deptId
params.startTime = formatDate(beginOfDay(new Date(queryParams.queryParams.orderDate[0])))
params.endTime = formatDate(endOfDay(new Date(queryParams.queryParams.orderDate[1])))
const rankingList = await RankingStatisticsApi.contractAmountRanking(params)
let source = rankingList.map((item: BiContractRanKingRespVO) => {
return {
name: item.nickname,

View File

@ -16,16 +16,23 @@
</el-card>
</template>
<script setup lang="ts">
import { RankingStatisticsApi, BiReceivablesRanKingRespVO } from '@/api/crm/bi/ranking'
import { RankingStatisticsApi, BiReceivablesRanKingRespVO, BiRankReqVO } from '@/api/crm/bi/ranking'
import { EChartsOption } from 'echarts'
import { beginOfDay, endOfDay, formatDate } from '@/utils/formatTime'
/** 回款金额排行 */
defineOptions({ name: 'RankingReceivablesStatistics' })
const params = reactive({
deptId: undefined,
startTime: undefined,
endTime: undefined
})
const trendLoading = ref(true) //
const loading = ref(false) //
const list = ref<BiReceivablesRanKingRespVO[]>([]) //
const params = defineProps<{ queryParams: any }>() //
const queryParams = defineProps<{ queryParams: BiRankReqVO }>() //
/** 柱状图配置 横向 */
const barChartOptions = reactive<EChartsOption>({
@ -98,7 +105,10 @@ const barChartOptions = reactive<EChartsOption>({
const getRankingReceivablesStatistics = async () => {
trendLoading.value = true
loading.value = true
const rankingList = await RankingStatisticsApi.receivablesAmountRanking(params.queryParams)
params.deptId = queryParams.queryParams.deptId
params.startTime = formatDate(beginOfDay(new Date(queryParams.queryParams.orderDate[0])))
params.endTime = formatDate(endOfDay(new Date(queryParams.queryParams.orderDate[1])))
const rankingList = await RankingStatisticsApi.receivablesAmountRanking(params)
let source = rankingList.map((item: BiReceivablesRanKingRespVO) => {
return {
name: item.nickname,

View File

@ -8,15 +8,17 @@
: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 label="时间" prop="orderDate">
<el-date-picker
v-model="queryParams.orderDate"
: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
@ -54,15 +56,23 @@
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'
import { beginOfDay, defaultShortcuts, endOfDay, formatDate } from '@/utils/formatTime'
import RankingReceivablesStatistics from '@/views/crm/bi/ranking/components/RankingReceivablesStatistics.vue'
/** 排行榜 */
defineOptions({ name: 'RankingStatistics' })
const queryParams = reactive({
type: 9, // type 9
deptId: null
deptId: undefined,
//
orderDate: [
formatDate(beginOfDay(new Date(new Date().getTime() - 3600 * 1000 * 24 * 7))),
formatDate(endOfDay(new Date(new Date().getTime() - 3600 * 1000 * 24)))
],
startTime: undefined,
endTime: undefined
})
const queryFormRef = ref() //
const deptList = ref<Tree[]>([]) //
const activeTab = ref('contractAmountRanking')