!380 修改:商业智能-排行榜,合同金额排行和回款金额排行时间条件和接口修改
Merge pull request !380 from 安浩浩/dev
This commit is contained in:
commit
d6438943b8
@ -14,7 +14,9 @@ export interface BiReceivablesRanKingRespVO {
|
|||||||
|
|
||||||
export interface BiRankReqVO {
|
export interface BiRankReqVO {
|
||||||
deptId: number
|
deptId: number
|
||||||
type: string
|
orderDate: Date[]
|
||||||
|
startTime: Date
|
||||||
|
endTime: Date
|
||||||
}
|
}
|
||||||
|
|
||||||
// 排行 API
|
// 排行 API
|
||||||
@ -22,14 +24,14 @@ export const RankingStatisticsApi = {
|
|||||||
// 获得合同排行榜
|
// 获得合同排行榜
|
||||||
contractAmountRanking: (params: any) => {
|
contractAmountRanking: (params: any) => {
|
||||||
return request.get({
|
return request.get({
|
||||||
url: '/bi/ranking/contract-ranking',
|
url: '/crm/bi-ranking/contract-ranking',
|
||||||
params
|
params
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
// 获得回款排行榜
|
// 获得回款排行榜
|
||||||
receivablesAmountRanking: (params: any) => {
|
receivablesAmountRanking: (params: any) => {
|
||||||
return request.get({
|
return request.get({
|
||||||
url: '/bi/ranking/receivables-ranking',
|
url: '/crm/bi-ranking/receivables-ranking',
|
||||||
params
|
params
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
@ -18,14 +18,21 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { RankingStatisticsApi, BiContractRanKingRespVO, BiRankReqVO } from '@/api/crm/bi/ranking'
|
import { RankingStatisticsApi, BiContractRanKingRespVO, BiRankReqVO } from '@/api/crm/bi/ranking'
|
||||||
import { EChartsOption } from 'echarts'
|
import { EChartsOption } from 'echarts'
|
||||||
|
import { beginOfDay, endOfDay, formatDate } from '@/utils/formatTime'
|
||||||
|
|
||||||
/** 合同金额排行 */
|
/** 合同金额排行 */
|
||||||
defineOptions({ name: 'RankingContractStatistics' })
|
defineOptions({ name: 'RankingContractStatistics' })
|
||||||
|
|
||||||
|
const params = reactive({
|
||||||
|
deptId: undefined,
|
||||||
|
startTime: undefined,
|
||||||
|
endTime: undefined
|
||||||
|
})
|
||||||
|
|
||||||
const trendLoading = ref(true) // 状态加载中
|
const trendLoading = ref(true) // 状态加载中
|
||||||
const loading = ref(false) // 列表的加载中
|
const loading = ref(false) // 列表的加载中
|
||||||
const list = ref<BiContractRanKingRespVO[]>([]) // 列表的数据
|
const list = ref<BiContractRanKingRespVO[]>([]) // 列表的数据
|
||||||
const params = defineProps<{ queryParams: BiRankReqVO }>() // 搜索参数
|
const queryParams = defineProps<{ queryParams: BiRankReqVO }>() // 搜索参数
|
||||||
|
|
||||||
/** 柱状图配置 横向 */
|
/** 柱状图配置 横向 */
|
||||||
const barChartOptions = reactive<EChartsOption>({
|
const barChartOptions = reactive<EChartsOption>({
|
||||||
@ -98,7 +105,10 @@ const barChartOptions = reactive<EChartsOption>({
|
|||||||
const getRankingContractStatistics = async () => {
|
const getRankingContractStatistics = async () => {
|
||||||
trendLoading.value = true
|
trendLoading.value = true
|
||||||
loading.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) => {
|
let source = rankingList.map((item: BiContractRanKingRespVO) => {
|
||||||
return {
|
return {
|
||||||
name: item.nickname,
|
name: item.nickname,
|
||||||
|
@ -16,16 +16,23 @@
|
|||||||
</el-card>
|
</el-card>
|
||||||
</template>
|
</template>
|
||||||
<script setup lang="ts">
|
<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 { EChartsOption } from 'echarts'
|
||||||
|
import { beginOfDay, endOfDay, formatDate } from '@/utils/formatTime'
|
||||||
|
|
||||||
/** 回款金额排行 */
|
/** 回款金额排行 */
|
||||||
defineOptions({ name: 'RankingReceivablesStatistics' })
|
defineOptions({ name: 'RankingReceivablesStatistics' })
|
||||||
|
|
||||||
|
const params = reactive({
|
||||||
|
deptId: undefined,
|
||||||
|
startTime: undefined,
|
||||||
|
endTime: undefined
|
||||||
|
})
|
||||||
|
|
||||||
const trendLoading = ref(true) // 状态加载中
|
const trendLoading = ref(true) // 状态加载中
|
||||||
const loading = ref(false) // 列表的加载中
|
const loading = ref(false) // 列表的加载中
|
||||||
const list = ref<BiReceivablesRanKingRespVO[]>([]) // 列表的数据
|
const list = ref<BiReceivablesRanKingRespVO[]>([]) // 列表的数据
|
||||||
const params = defineProps<{ queryParams: any }>() // 搜索参数
|
const queryParams = defineProps<{ queryParams: BiRankReqVO }>() // 搜索参数
|
||||||
|
|
||||||
/** 柱状图配置 横向 */
|
/** 柱状图配置 横向 */
|
||||||
const barChartOptions = reactive<EChartsOption>({
|
const barChartOptions = reactive<EChartsOption>({
|
||||||
@ -98,7 +105,10 @@ const barChartOptions = reactive<EChartsOption>({
|
|||||||
const getRankingReceivablesStatistics = async () => {
|
const getRankingReceivablesStatistics = async () => {
|
||||||
trendLoading.value = true
|
trendLoading.value = true
|
||||||
loading.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) => {
|
let source = rankingList.map((item: BiReceivablesRanKingRespVO) => {
|
||||||
return {
|
return {
|
||||||
name: item.nickname,
|
name: item.nickname,
|
||||||
|
@ -8,15 +8,17 @@
|
|||||||
:inline="true"
|
:inline="true"
|
||||||
label-width="68px"
|
label-width="68px"
|
||||||
>
|
>
|
||||||
<el-form-item label="类型" prop="type">
|
<el-form-item label="时间" prop="orderDate">
|
||||||
<el-select v-model="queryParams.type" placeholder="请选择类型" clearable class="!w-240px">
|
<el-date-picker
|
||||||
<el-option
|
v-model="queryParams.orderDate"
|
||||||
v-for="dict in getIntDictOptions(DICT_TYPE.BI_ANALYZE_TYPE)"
|
:shortcuts="defaultShortcuts"
|
||||||
:key="dict.value"
|
class="!w-240px"
|
||||||
:label="dict.label"
|
end-placeholder="结束日期"
|
||||||
:value="dict.value"
|
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-select>
|
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="归属部门" prop="deptId">
|
<el-form-item label="归属部门" prop="deptId">
|
||||||
<el-tree-select
|
<el-tree-select
|
||||||
@ -54,15 +56,23 @@
|
|||||||
import RankingContractStatistics from './components/RankingContractStatistics.vue'
|
import RankingContractStatistics from './components/RankingContractStatistics.vue'
|
||||||
import { defaultProps, handleTree } from '@/utils/tree'
|
import { defaultProps, handleTree } from '@/utils/tree'
|
||||||
import * as DeptApi from '@/api/system/dept'
|
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' })
|
defineOptions({ name: 'RankingStatistics' })
|
||||||
|
|
||||||
const queryParams = reactive({
|
const queryParams = reactive({
|
||||||
type: 9, // 将 type 的初始值设置为 9 本年
|
deptId: undefined,
|
||||||
deptId: null
|
//默认显示最近一周的数据
|
||||||
|
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 queryFormRef = ref() // 搜索的表单
|
||||||
const deptList = ref<Tree[]>([]) // 树形结构
|
const deptList = ref<Tree[]>([]) // 树形结构
|
||||||
const activeTab = ref('contractAmountRanking')
|
const activeTab = ref('contractAmountRanking')
|
||||||
|
Loading…
Reference in New Issue
Block a user