!380 修改:商业智能-排行榜,合同金额排行和回款金额排行时间条件和接口修改
Merge pull request !380 from 安浩浩/dev
This commit is contained in:
commit
d6438943b8
@ -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
|
||||
})
|
||||
}
|
||||
|
@ -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,
|
||||
|
@ -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,
|
||||
|
@ -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')
|
||||
|
Loading…
Reference in New Issue
Block a user