2024-10-29 16:58:44 +08:00
|
|
|
<template>
|
|
|
|
|
<ContentWrap>
|
|
|
|
|
<el-form :model="searchForm" label-width="0" inline>
|
|
|
|
|
<el-form-item>
|
|
|
|
|
<el-date-picker
|
2024-11-05 09:41:16 +08:00
|
|
|
v-model="searchForm.consultTime"
|
2024-10-29 16:58:44 +08:00
|
|
|
type="daterange"
|
|
|
|
|
format="YYYY-MM-DD"
|
|
|
|
|
value-format="YYYY-MM-DD"
|
|
|
|
|
start-placeholder="选择日期"
|
|
|
|
|
end-placeholder="选择日期"
|
2024-11-05 09:41:16 +08:00
|
|
|
:clearable="false"
|
2024-10-29 16:58:44 +08:00
|
|
|
/>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
<el-form-item>
|
|
|
|
|
<el-input v-model="searchForm.nickname" placeholder="销售姓名" clearable />
|
|
|
|
|
</el-form-item>
|
|
|
|
|
<el-form-item>
|
|
|
|
|
<el-tree-select
|
|
|
|
|
v-model="searchForm.sourceId"
|
|
|
|
|
:data="sourceOptions"
|
|
|
|
|
:props="defaultProps"
|
|
|
|
|
check-strictly
|
2024-11-05 09:41:16 +08:00
|
|
|
clearable
|
2024-10-29 16:58:44 +08:00
|
|
|
node-key="sourceId"
|
|
|
|
|
placeholder="请选择渠道"
|
|
|
|
|
/>
|
|
|
|
|
</el-form-item>
|
2024-11-07 10:42:43 +08:00
|
|
|
<el-form-item v-if="appStore.getAppInfo?.instanceType == 1">
|
2024-11-05 09:41:16 +08:00
|
|
|
<el-select v-model="searchForm.licenseType" placeholder="选择驾照类型" clearable>
|
2024-10-29 16:58:44 +08:00
|
|
|
<el-option
|
2024-11-05 09:41:16 +08:00
|
|
|
v-for="item in licenseTypeOptions"
|
|
|
|
|
:key="item.label"
|
2024-10-29 16:58:44 +08:00
|
|
|
:label="item.label"
|
2024-11-05 09:41:16 +08:00
|
|
|
:value="item.label"
|
2024-10-29 16:58:44 +08:00
|
|
|
/>
|
|
|
|
|
</el-select>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
|
|
|
|
|
<el-form-item>
|
|
|
|
|
<el-button @click="handleSearch">查询</el-button>
|
|
|
|
|
<el-button @click="handleReset">重置</el-button>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
</el-form>
|
|
|
|
|
|
|
|
|
|
<el-table v-loading="loading" :data="tableList" border stripe>
|
|
|
|
|
<el-table-column type="index" width="50" fixed="left" />
|
2024-10-30 16:49:18 +08:00
|
|
|
<el-table-column prop="nickname" label="姓名" width="80" fixed="left">
|
|
|
|
|
<template #default="{ row }">
|
2024-11-05 09:41:16 +08:00
|
|
|
<el-button type="primary" style="padding: 0" text @click="handleDetail(row)">{{
|
2024-10-30 16:49:18 +08:00
|
|
|
row.nickname
|
|
|
|
|
}}</el-button>
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
2024-11-05 09:41:16 +08:00
|
|
|
<el-table-column prop="newClueNumber" sortable min-width="100">
|
2024-10-29 16:58:44 +08:00
|
|
|
<template #header>
|
|
|
|
|
<Tooltip message="咨询日期在所选周期内的线索总数" />
|
|
|
|
|
<span>新线索数</span>
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
2024-11-05 09:41:16 +08:00
|
|
|
<el-table-column label="成交数" prop="signNumber" sortable min-width="100">
|
2024-10-29 16:58:44 +08:00
|
|
|
<template #header>
|
|
|
|
|
<Tooltip message="成交日期在所选周期内的成交数" />
|
|
|
|
|
<span>成交数</span>
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
2024-11-07 10:42:43 +08:00
|
|
|
<el-table-column
|
|
|
|
|
label="成交率"
|
|
|
|
|
prop="signRate"
|
|
|
|
|
sortable
|
|
|
|
|
min-width="100"
|
|
|
|
|
:formatter="(row) => row.signRate + '%'"
|
|
|
|
|
/>
|
2024-11-05 09:41:16 +08:00
|
|
|
<el-table-column label="跟进数/日" prop="dayFollowNumber" sortable min-width="100" />
|
|
|
|
|
<el-table-column label="成交数/日" prop="daySignNumber" sortable min-width="100" />
|
|
|
|
|
<el-table-column label="平均成交周期" prop="averageSignPeriod" sortable min-width="100">
|
2024-10-30 16:49:18 +08:00
|
|
|
<template #header>
|
|
|
|
|
<Tooltip message="平均每条成交的线索,从咨询开始到成交所需要的天数" />
|
|
|
|
|
<span>平均成交周期</span>
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
2024-11-05 09:41:16 +08:00
|
|
|
<el-table-column prop="grossProfitOfSingleSign" sortable min-width="100">
|
2024-10-29 16:58:44 +08:00
|
|
|
<template #header>
|
|
|
|
|
<Tooltip
|
|
|
|
|
message="平均每笔成交订单的公司利润【按照登记,不按审核到账】=总公司利润/总成交数"
|
|
|
|
|
/>
|
|
|
|
|
<span>毛利/单</span>
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
2024-11-05 09:41:16 +08:00
|
|
|
<el-table-column prop="payPriceOfSingleSign" sortable min-width="100">
|
2024-10-29 16:58:44 +08:00
|
|
|
<template #header>
|
|
|
|
|
<Tooltip
|
|
|
|
|
message="平均每笔成交订单的额外支出(返费等)【按照登记,不按审核到账】=总支出/总成交数"
|
|
|
|
|
/>
|
|
|
|
|
<span>支出/单</span>
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
2024-11-05 09:41:16 +08:00
|
|
|
<el-table-column prop="costOfSingleClue" sortable min-width="100">
|
2024-10-29 16:58:44 +08:00
|
|
|
<template #header>
|
|
|
|
|
<Tooltip message="平均每条线索的成本=总线索成本/新线索条数" />
|
|
|
|
|
<span>线索成本/条</span>
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
2024-11-05 09:41:16 +08:00
|
|
|
<el-table-column prop="netProfitOfSingleSign" sortable min-width="100">
|
2024-10-29 16:58:44 +08:00
|
|
|
<template #header>
|
|
|
|
|
<Tooltip message="=(总公司利润-总支出-总线索成本)/总成交数" />
|
|
|
|
|
<span>净利润/单</span>
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
2024-11-05 09:41:16 +08:00
|
|
|
<el-table-column label="总线索成本" prop="clueCostTotal" sortable min-width="100" />
|
|
|
|
|
<el-table-column label="总支出" prop="payPriceTotal" sortable min-width="100" />
|
|
|
|
|
<el-table-column label="总利润" prop="profitTotal" sortable min-width="100" />
|
|
|
|
|
<el-table-column prop="efficiency" sortable min-width="100">
|
2024-10-29 16:58:44 +08:00
|
|
|
<template #header>
|
2024-10-30 16:49:18 +08:00
|
|
|
<Tooltip message="=总利润/(总成本+总支出)" />
|
2024-10-29 16:58:44 +08:00
|
|
|
<span>能效</span>
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
2024-11-05 09:41:16 +08:00
|
|
|
<el-table-column label="撞单数" prop="repeatClueNum" sortable min-width="100" />
|
|
|
|
|
<el-table-column label="撞单成交数" prop="repeatClueSignNum" sortable min-width="100" />
|
2024-10-29 16:58:44 +08:00
|
|
|
</el-table>
|
2024-10-30 16:49:18 +08:00
|
|
|
|
2024-11-05 09:41:16 +08:00
|
|
|
<DialogSalerReportDetail
|
|
|
|
|
:licenseTypeOptions="licenseTypeOptions"
|
|
|
|
|
:source-options="sourceOptions"
|
|
|
|
|
ref="SalerDetailDialog"
|
|
|
|
|
/>
|
2024-10-29 16:58:44 +08:00
|
|
|
</ContentWrap>
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
<script setup name="SalesReport">
|
2024-10-30 16:49:18 +08:00
|
|
|
import DialogSalerReportDetail from './Comp/DialogSalerReportDetail.vue'
|
|
|
|
|
|
2024-11-05 09:41:16 +08:00
|
|
|
import * as reportApi from '@/api/home/reportSaler'
|
|
|
|
|
import { getSimpleSourceList as getResourceOptions } from '@/api/clue/source'
|
|
|
|
|
|
2024-10-29 16:58:44 +08:00
|
|
|
import { removeNullField } from '@/utils'
|
2024-11-05 09:41:16 +08:00
|
|
|
import { formatDate } from '@/utils/formatTime'
|
|
|
|
|
import { handleTree } from '@/utils/tree'
|
|
|
|
|
import { getIntDictOptions } from '@/utils/dict'
|
2024-11-07 10:42:43 +08:00
|
|
|
import { useAppStore } from '@/store/modules/app'
|
2024-10-29 16:58:44 +08:00
|
|
|
|
2024-11-07 10:42:43 +08:00
|
|
|
const appStore = useAppStore()
|
2024-10-29 16:58:44 +08:00
|
|
|
onMounted(() => {
|
2024-11-05 09:41:16 +08:00
|
|
|
getOptions()
|
2024-10-29 16:58:44 +08:00
|
|
|
handleReset()
|
|
|
|
|
handleSearch()
|
|
|
|
|
})
|
|
|
|
|
|
2024-10-30 16:49:18 +08:00
|
|
|
const defaultProps = {
|
|
|
|
|
children: 'children',
|
|
|
|
|
label: 'sourceName',
|
|
|
|
|
value: 'sourceId',
|
|
|
|
|
isLeaf: 'leaf'
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const sourceOptions = ref([])
|
2024-11-05 09:41:16 +08:00
|
|
|
const licenseTypeOptions = ref([])
|
2024-10-30 16:49:18 +08:00
|
|
|
|
2024-10-29 16:58:44 +08:00
|
|
|
const searchForm = ref({})
|
|
|
|
|
|
|
|
|
|
function handleReset() {
|
2024-11-05 09:41:16 +08:00
|
|
|
const year = new Date().getFullYear()
|
|
|
|
|
const month = new Date().getMonth() + 1
|
2024-10-29 16:58:44 +08:00
|
|
|
searchForm.value = {
|
|
|
|
|
nickname: undefined,
|
2024-11-05 09:41:16 +08:00
|
|
|
consultTime: [`${year}-${month}-01`, formatDate(new Date())]
|
2024-10-29 16:58:44 +08:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const loading = ref(false)
|
|
|
|
|
const tableList = ref([])
|
|
|
|
|
async function handleSearch() {
|
|
|
|
|
loading.value = true
|
|
|
|
|
try {
|
|
|
|
|
const data = await reportApi.getList(removeNullField(searchForm.value))
|
2024-11-05 09:41:16 +08:00
|
|
|
tableList.value = data
|
2024-10-29 16:58:44 +08:00
|
|
|
} finally {
|
|
|
|
|
loading.value = false
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2024-10-30 16:49:18 +08:00
|
|
|
const SalerDetailDialog = ref()
|
|
|
|
|
function handleDetail(info) {
|
|
|
|
|
SalerDetailDialog.value.open(info, searchForm.value)
|
|
|
|
|
}
|
|
|
|
|
|
2024-11-05 09:41:16 +08:00
|
|
|
function getOptions() {
|
|
|
|
|
getResourceOptions().then((data) => {
|
|
|
|
|
sourceOptions.value = handleTree(data, 'sourceId')
|
|
|
|
|
})
|
|
|
|
|
licenseTypeOptions.value = getIntDictOptions('license_type')
|
|
|
|
|
}
|
2024-10-29 16:58:44 +08:00
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
<style lang="scss" scoped></style>
|