Compare commits
39 Commits
dev-report
...
16cb210988
| Author | SHA1 | Date | |
|---|---|---|---|
| 16cb210988 | |||
|
|
0ef7703f7d | ||
| bc3c4f2ebc | |||
|
|
fa39fd8492 | ||
|
|
b8bc124162 | ||
|
|
e1036fd2c3 | ||
|
|
014bb14170 | ||
| 6ba54c8bcd | |||
|
|
eaaceb9595 | ||
| acccadd43a | |||
|
|
1ab365efae | ||
| 0f04d7e80c | |||
| 02af7babc4 | |||
| 505139cfe2 | |||
| 6246d46d53 | |||
| 98a5d374a4 | |||
| dd049320f6 | |||
| 696e96a0c0 | |||
| ee770b9e60 | |||
| 6908183a36 | |||
| af9bcb7024 | |||
| 5c6c3df4d0 | |||
| acdcc670de | |||
| 9472c5ea56 | |||
| 4f150b0912 | |||
| f76d6dce66 | |||
| dd4bdb0786 | |||
| 477a279867 | |||
| c87637cc78 | |||
| a544840679 | |||
| 247c6ed4a0 | |||
| 769c901954 | |||
| 18bfc7d353 | |||
| fb6b341242 | |||
| fea69da8ed | |||
| 125f6f28ad | |||
| 39cddaa8e0 | |||
| ffd15e2433 | |||
| 2bebd0480e |
@@ -4,7 +4,7 @@ VITE_NODE_ENV=development
|
||||
VITE_DEV=true
|
||||
|
||||
# 请求路径
|
||||
VITE_BASE_URL='http://118.31.23.45:48080'
|
||||
VITE_BASE_URL='http://localhost:48080'
|
||||
# VITE_BASE_URL='http://114.55.169.15:48080'
|
||||
|
||||
# 上传路径
|
||||
|
||||
@@ -61,14 +61,15 @@
|
||||
</el-table>
|
||||
</div>
|
||||
</el-tab-pane>
|
||||
<el-tab-pane
|
||||
label="回款记录"
|
||||
name="returnRecord"
|
||||
v-if="checkPermi(['clue:order:return-list'])"
|
||||
>
|
||||
<el-tab-pane label="回款记录" name="returnRecord">
|
||||
<el-table :data="returnRecordList" border stripe>
|
||||
<el-table-column type="index" width="50" />
|
||||
<el-table-column prop="money" label="回款金额" />
|
||||
<el-table-column
|
||||
v-if="checkPermi(['clue:order:return-list'])"
|
||||
prop="money"
|
||||
label="回款金额"
|
||||
/>
|
||||
<el-table-column prop="personProfit" label="员工利润" />
|
||||
<el-table-column prop="applyTime" label="申请日期" />
|
||||
<el-table-column prop="isPayoff" label="是否结清" />
|
||||
<el-table-column prop="stateName" label="审核状态" />
|
||||
|
||||
@@ -74,8 +74,8 @@
|
||||
@get-checked-columns="getCheckedColumns"
|
||||
@selection-change="handleSelectionChange"
|
||||
>
|
||||
<el-table-column type="selection" width="60" />
|
||||
<el-table-column type="expand">
|
||||
<el-table-column type="selection" width="60" fixed="left" />
|
||||
<el-table-column type="expand" fixed="left">
|
||||
<template #default="{ row }">
|
||||
<div class="p-10px flex justify-center">
|
||||
<VueDraggable
|
||||
@@ -91,8 +91,8 @@
|
||||
stripe
|
||||
style="width: 80%; margin: 0 auto"
|
||||
>
|
||||
<el-table-column prop="productName" label="成交产品" />
|
||||
<el-table-column prop="specsName" label="产品规格" />
|
||||
<el-table-column prop="productName" label="成交产品" width="120px" />
|
||||
<el-table-column prop="specsName" label="产品规格" width="120px" />
|
||||
<el-table-column prop="signNum" label="成交数量" width="90px" />
|
||||
<el-table-column prop="remark" label="成交备注" width="100px" />
|
||||
<el-table-column label="生产状态" width="160px">
|
||||
|
||||
@@ -248,6 +248,16 @@
|
||||
<el-form-item label="结算金额">
|
||||
{{ settleAmount }}
|
||||
</el-form-item>
|
||||
<el-form-item label="结算日期">
|
||||
<el-date-picker
|
||||
v-model="form.settlementDate"
|
||||
type="date"
|
||||
placeholder="选择日期时间"
|
||||
format="YYYY-MM-DD"
|
||||
value-format="YYYY-MM-DD"
|
||||
:clearable="false"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="结算备注" prop="remark">
|
||||
<Editor v-model:modelValue="form.remark" />
|
||||
</el-form-item>
|
||||
@@ -270,7 +280,7 @@ import { getPlaceList } from '@/api/school/place'
|
||||
import { getClassTypeList } from '@/api/school/class'
|
||||
import * as SettleApi from '@/api/clue/settle'
|
||||
|
||||
import { dateFormatter } from '@/utils/formatTime'
|
||||
import { dateFormatter, formatDate } from '@/utils/formatTime'
|
||||
import { removeNullField } from '@/utils/index'
|
||||
|
||||
const message = useMessage() // 消息弹窗
|
||||
@@ -395,6 +405,7 @@ function batchSettle() {
|
||||
showDailog.value = true
|
||||
form.value = {
|
||||
settlementIds: selectList.value.map((it) => it.settlementId),
|
||||
settlementDate: formatDate(new Date()),
|
||||
reamrk: undefined
|
||||
}
|
||||
settleAmount.value = selectList.value.reduce((pre, cur) => pre + cur.settlementMoney, 0)
|
||||
|
||||
@@ -7,21 +7,40 @@
|
||||
:rules="formRules"
|
||||
label-width="80px"
|
||||
>
|
||||
<el-form-item v-if="formData.parentSource" label="上级来源">
|
||||
<el-row :gutter="20">
|
||||
<el-col v-if="formData.parentSource" :span="12" :offset="0">
|
||||
<el-form-item label="上级来源">
|
||||
<el-input v-model="formData.parentSource" disabled />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12" :offset="0">
|
||||
<el-form-item label="来源名称" prop="sourceName">
|
||||
<el-input v-model="formData.sourceName" placeholder="请输入来源名称" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12" :offset="0">
|
||||
<el-form-item label="排序" prop="sort">
|
||||
<el-input v-model="formData.sort" placeholder="请输入排序" type="number" :min="0" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12" :offset="0">
|
||||
<el-form-item label="成本模式" prop="mode">
|
||||
<el-radio-group v-model="formData.mode">
|
||||
<el-radio :label="0"> 总价 </el-radio>
|
||||
<el-radio :label="1"> 单价 </el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="12" :offset="0">
|
||||
<el-form-item label="状态" prop="status">
|
||||
<el-radio-group v-model="formData.status">
|
||||
<el-radio :label="0"> 启用 </el-radio>
|
||||
<el-radio :label="1"> 禁用 </el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24" :offset="0">
|
||||
<el-form-item label="备注" prop="remark">
|
||||
<el-input
|
||||
type="textarea"
|
||||
@@ -30,7 +49,39 @@
|
||||
:autosize="{ minRows: 4, maxRows: 8 }"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
|
||||
<el-divider direction="horizontal" content-position="left">线索成本</el-divider>
|
||||
|
||||
<el-button class="mb-10px" type="primary" @click="handleAddPrice"> 添加年份 </el-button>
|
||||
<el-table :data="formData.priceVOList" border>
|
||||
<el-table-column label="年份" width="120">
|
||||
<template #default="{ row }">
|
||||
<el-date-picker
|
||||
v-model="row.year"
|
||||
type="year"
|
||||
placeholder="选择年份"
|
||||
size="small"
|
||||
format="YYYY"
|
||||
value-format="YYYY"
|
||||
style="width: 100%"
|
||||
/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column v-for="col in 12" :key="col" :label="`${col}月`" width="100px">
|
||||
<template #default="{ row }">
|
||||
<el-input-number
|
||||
v-model="row.monthTargetVOList[col - 1].targetPrice"
|
||||
size="small"
|
||||
:controls="false"
|
||||
style="width: 100%"
|
||||
/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<template #footer>
|
||||
<el-button :disabled="formLoading" type="primary" @click="submitForm">确 定</el-button>
|
||||
<el-button @click="dialogVisible = false">取 消</el-button>
|
||||
@@ -111,8 +162,27 @@ const resetForm = () => {
|
||||
sourceName: '',
|
||||
status: 0,
|
||||
sort: 1,
|
||||
remark: ''
|
||||
remark: '',
|
||||
mode: 0,
|
||||
priceVOList: []
|
||||
}
|
||||
formRef.value?.resetFields()
|
||||
}
|
||||
|
||||
function handleAddPrice() {
|
||||
const obj = {
|
||||
year: undefined,
|
||||
monthTargetVOList: []
|
||||
}
|
||||
for (let i = 1; i <= 12; i++) {
|
||||
obj.monthTargetVOList.push({
|
||||
month: i,
|
||||
targetPrice: undefined
|
||||
})
|
||||
}
|
||||
if (!formData.value.priceVOList) {
|
||||
formData.value.priceVOList = []
|
||||
}
|
||||
formData.value.priceVOList.push(obj)
|
||||
}
|
||||
</script>
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
|
||||
<el-table v-loading="loading" :data="tableList" border stripe>
|
||||
<el-table-column type="index" width="50" fixed="left" />
|
||||
<el-table-column prop="nickname" label="姓名" width="80" />
|
||||
<el-table-column prop="nickname" label="姓名" width="80" fixed="left" />
|
||||
<el-table-column
|
||||
v-for="(item, index) in new Date().getMonth() + 1"
|
||||
:key="index"
|
||||
@@ -102,8 +102,6 @@ function totalSort(pre, cur) {
|
||||
}
|
||||
|
||||
function monthSort(pre, cur, idx) {
|
||||
console.log(idx)
|
||||
|
||||
return (
|
||||
Number(pre.monthClueSignRateReportList[idx].rate) -
|
||||
Number(cur.monthClueSignRateReportList[idx].rate)
|
||||
|
||||
62
src/views/Home/Comp/BarSalerClueReport.vue
Normal file
62
src/views/Home/Comp/BarSalerClueReport.vue
Normal file
@@ -0,0 +1,62 @@
|
||||
<template>
|
||||
<Echart :options="optionsData" :width="400" :height="200" />
|
||||
</template>
|
||||
|
||||
<script setup name="BarSalerClueReport">
|
||||
import { set } from 'lodash-es'
|
||||
|
||||
onMounted(() => {
|
||||
nextTick(() => {
|
||||
getReportData()
|
||||
})
|
||||
})
|
||||
|
||||
const optionsData = ref({})
|
||||
|
||||
const getReportData = async () => {
|
||||
// const data = await HomeApi.getClueSignSignRate()
|
||||
set(optionsData, 'radiusAxis', {
|
||||
type: 'category',
|
||||
data: ['宝典', '一点通', '抖音', '小红书'],
|
||||
z: 10
|
||||
})
|
||||
set(optionsData, 'series', [
|
||||
{
|
||||
type: 'bar',
|
||||
data: [1, 2, 3, 4],
|
||||
coordinateSystem: 'polar',
|
||||
name: '高意向A',
|
||||
stack: 'a',
|
||||
emphasis: {
|
||||
focus: 'series'
|
||||
}
|
||||
},
|
||||
{
|
||||
type: 'bar',
|
||||
data: [2, 4, 6, 8],
|
||||
coordinateSystem: 'polar',
|
||||
name: '中意向B',
|
||||
stack: 'a',
|
||||
emphasis: {
|
||||
focus: 'series'
|
||||
}
|
||||
},
|
||||
{
|
||||
type: 'bar',
|
||||
data: [1, 2, 3, 4],
|
||||
coordinateSystem: 'polar',
|
||||
name: '低意向C',
|
||||
stack: 'a',
|
||||
emphasis: {
|
||||
focus: 'series'
|
||||
}
|
||||
}
|
||||
])
|
||||
}
|
||||
|
||||
defineExpose({
|
||||
getReportData
|
||||
})
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped></style>
|
||||
353
src/views/Home/Comp/DialogSalerReportDetail.vue
Normal file
353
src/views/Home/Comp/DialogSalerReportDetail.vue
Normal file
@@ -0,0 +1,353 @@
|
||||
<template>
|
||||
<Dialog title="详情" v-model="dialogVisible" width="1000px">
|
||||
<el-form :model="searchForm" label-width="0" inline>
|
||||
<el-form-item>
|
||||
<el-date-picker
|
||||
v-model="searchForm.period"
|
||||
type="daterange"
|
||||
format="YYYY-MM-DD"
|
||||
value-format="YYYY-MM-DD"
|
||||
start-placeholder="选择日期"
|
||||
end-placeholder="选择日期"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-tree-select
|
||||
v-model="searchForm.sourceId"
|
||||
:data="props.sourceOptions"
|
||||
:props="defaultProps"
|
||||
check-strictly
|
||||
node-key="sourceId"
|
||||
placeholder="请选择渠道"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-select v-model="searchForm.cartype" placeholder="选择驾照类型" clearable>
|
||||
<el-option
|
||||
v-for="item in props.cartypeOptions"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
</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-tabs v-model="showPane" class="pb-10px">
|
||||
<el-tab-pane label="详细数据" :name="1">
|
||||
<el-table v-loading="loading" :data="tableList" border stripe>
|
||||
<el-table-column prop="sourceName" label="渠道名称" width="100" fixed="left" />
|
||||
<el-table-column prop="" label="新线索数" sortable />
|
||||
<el-table-column prop="" label="成交数" sortable />
|
||||
<el-table-column prop="" label="成交率" sortable />
|
||||
<el-table-column prop="" label="成交周期" sortable />
|
||||
<el-table-column prop="" label="毛利/单" sortable />
|
||||
<el-table-column prop="" label="支出/单" sortable />
|
||||
<el-table-column prop="" label="线索成本/条" sortable />
|
||||
<el-table-column prop="" label="净利润/单" sortable />
|
||||
<el-table-column label="总线索成本" prop="" sortable min-width="100" />
|
||||
<el-table-column label="总支出" prop="" sortable min-width="100" />
|
||||
<el-table-column label="总利润" prop="" sortable min-width="100" />
|
||||
</el-table>
|
||||
</el-tab-pane>
|
||||
<el-tab-pane label="图表展示" :name="2" lazy>
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="24" :offset="0">
|
||||
<el-checkbox-group v-model="showChannel" @change="setReportData">
|
||||
<el-checkbox v-for="(item, index) in channelArr" :key="index" :label="item" />
|
||||
</el-checkbox-group>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="12" :offset="0">
|
||||
<el-skeleton :loading="loading" animated>
|
||||
<Echart :options="echart1Option" width="100%" :height="400" />
|
||||
</el-skeleton>
|
||||
</el-col>
|
||||
<el-col :span="12" :offset="0">
|
||||
<Echart :options="echart2Option" width="100%" :height="400" />
|
||||
</el-col>
|
||||
<el-col :span="24" :offset="0">
|
||||
<Echart :options="echart3Option" width="100%" :height="400" />
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-tab-pane>
|
||||
</el-tabs>
|
||||
</Dialog>
|
||||
</template>
|
||||
|
||||
<script setup name="DialogSalerReportDetail">
|
||||
import { set } from 'lodash-es'
|
||||
import * as reportApi from '@/api/home/reportSignRate'
|
||||
import { removeNullField } from '@/utils'
|
||||
|
||||
const props = defineProps({
|
||||
cartypeOptions: {
|
||||
type: Array,
|
||||
default: () => []
|
||||
},
|
||||
sourceOptions: {
|
||||
type: Array,
|
||||
default: () => []
|
||||
}
|
||||
})
|
||||
|
||||
const defaultProps = {
|
||||
children: 'children',
|
||||
label: 'sourceName',
|
||||
value: 'sourceId',
|
||||
isLeaf: 'leaf'
|
||||
}
|
||||
|
||||
const dialogVisible = ref(false) // 弹窗的是否展示
|
||||
const dialogTitle = ref('') // 弹窗的标题
|
||||
const loading = ref(false)
|
||||
const searchForm = ref({})
|
||||
|
||||
const showPane = ref(1)
|
||||
const showChannel = ref([])
|
||||
|
||||
function handleReset() {
|
||||
searchForm.value = {
|
||||
nickname: undefined,
|
||||
period: []
|
||||
}
|
||||
}
|
||||
|
||||
/** 打开弹窗 */
|
||||
const open = async (info, queryInfo) => {
|
||||
showPane.value = 1
|
||||
dialogVisible.value = true
|
||||
dialogTitle.value = `销售详情-【${info.nickname}】`
|
||||
searchForm.value.period = queryInfo.period
|
||||
searchForm.value.cartype = queryInfo.cartype
|
||||
showChannel.value = [...channelArr]
|
||||
|
||||
handleSearch()
|
||||
}
|
||||
defineExpose({ open }) // 提供 open 方法,用于打开弹窗
|
||||
|
||||
const tableList = ref([])
|
||||
|
||||
async function handleSearch() {
|
||||
loading.value = true
|
||||
try {
|
||||
setReportData()
|
||||
const data = await reportApi.getList(removeNullField(searchForm.value))
|
||||
tableList.value = data.map((item) => {
|
||||
const count = item.monthClueSignRateReportList.reduce(
|
||||
(pre, cur) => {
|
||||
return {
|
||||
signCount: pre.signCount + cur.clueSignNum,
|
||||
clueCount: pre.clueCount + cur.followClueNum
|
||||
}
|
||||
},
|
||||
{ signCount: 0, clueCount: 0 }
|
||||
)
|
||||
const rate = count.clueCount > 0 ? ((count.signCount * 100) / count.clueCount).toFixed(2) : 0
|
||||
return {
|
||||
...item,
|
||||
totalRate: `${rate}%(${count.signCount}/${count.clueCount})`,
|
||||
totalRateNum: rate
|
||||
}
|
||||
})
|
||||
} finally {
|
||||
loading.value = false
|
||||
}
|
||||
}
|
||||
|
||||
const channelArr = ['美团', '高德', '线下渠道', '其他', '一点通', '抖音', '小红书', '宝典']
|
||||
|
||||
const echart1Option = ref({
|
||||
title: {
|
||||
text: '线索分布图'
|
||||
},
|
||||
radiusAxis: {},
|
||||
angleAxis: {},
|
||||
tooltip: {
|
||||
show: true,
|
||||
formatter: '{b0}-{a}: {c}'
|
||||
},
|
||||
polar: {},
|
||||
legend: {
|
||||
show: true
|
||||
}
|
||||
})
|
||||
|
||||
const echart2Option = ref({
|
||||
title: {
|
||||
text: '成交分布图'
|
||||
},
|
||||
radiusAxis: {},
|
||||
angleAxis: {},
|
||||
tooltip: {
|
||||
show: true,
|
||||
formatter: '{b0}-{a}: {c}'
|
||||
},
|
||||
polar: {},
|
||||
legend: {
|
||||
show: true
|
||||
}
|
||||
})
|
||||
|
||||
const echart3Option = ref({
|
||||
title: {
|
||||
text: '销售雷达图'
|
||||
},
|
||||
radar: {
|
||||
indicator: [
|
||||
{ name: '成交周期' },
|
||||
{ name: '毛利/单' },
|
||||
{ name: '支出/单' },
|
||||
{ name: '线索成本/条' },
|
||||
{ name: '净利润/单' },
|
||||
{ name: '线索总成本' },
|
||||
{ name: '总支出' },
|
||||
{ name: '总利润' }
|
||||
]
|
||||
},
|
||||
legend: {
|
||||
show: true
|
||||
}
|
||||
})
|
||||
|
||||
const setReportData = async () => {
|
||||
// const data = await HomeApi.getClueSignSignRate()
|
||||
|
||||
set(echart1Option.value, 'radiusAxis', {
|
||||
type: 'category',
|
||||
data: showChannel.value,
|
||||
axisLabel: {
|
||||
margin: 5,
|
||||
fontSize: 10,
|
||||
interval: 0
|
||||
}
|
||||
})
|
||||
|
||||
set(echart1Option.value, 'series', [
|
||||
{
|
||||
type: 'bar',
|
||||
data: [2, 2, 3, 4, 10, 22, 43, 141],
|
||||
coordinateSystem: 'polar',
|
||||
name: '高意向A',
|
||||
stack: 'a',
|
||||
emphasis: {
|
||||
focus: 'series'
|
||||
},
|
||||
label: {
|
||||
show: true,
|
||||
position: 'middle'
|
||||
}
|
||||
},
|
||||
{
|
||||
type: 'bar',
|
||||
data: [6, 6, 7, 8, 22, 14, 36, 128],
|
||||
coordinateSystem: 'polar',
|
||||
name: '中意向B',
|
||||
stack: 'a',
|
||||
emphasis: {
|
||||
focus: 'series'
|
||||
},
|
||||
label: {
|
||||
show: true,
|
||||
position: 'middle'
|
||||
}
|
||||
},
|
||||
{
|
||||
type: 'bar',
|
||||
data: [1, 4, 7, 11, 16, 42, 13, 42],
|
||||
coordinateSystem: 'polar',
|
||||
name: '低意向C',
|
||||
stack: 'a',
|
||||
emphasis: {
|
||||
focus: 'series'
|
||||
},
|
||||
label: {
|
||||
show: true,
|
||||
position: 'middle'
|
||||
}
|
||||
}
|
||||
])
|
||||
|
||||
set(echart2Option.value, 'radiusAxis', {
|
||||
type: 'category',
|
||||
data: showChannel.value,
|
||||
axisLabel: {
|
||||
margin: 5,
|
||||
fontSize: 10,
|
||||
interval: 0
|
||||
}
|
||||
})
|
||||
set(echart2Option.value, 'series', [
|
||||
{
|
||||
type: 'bar',
|
||||
data: [2, 2, 3, 4, 1, 11, 23, 41],
|
||||
coordinateSystem: 'polar',
|
||||
name: 'C1',
|
||||
stack: 'a',
|
||||
emphasis: {
|
||||
focus: 'series'
|
||||
},
|
||||
label: {
|
||||
show: true,
|
||||
position: 'middle'
|
||||
}
|
||||
},
|
||||
{
|
||||
type: 'bar',
|
||||
data: [6, 6, 7, 8, 12, 14, 6, 28],
|
||||
coordinateSystem: 'polar',
|
||||
name: 'C2',
|
||||
stack: 'a',
|
||||
emphasis: {
|
||||
focus: 'series'
|
||||
},
|
||||
label: {
|
||||
show: true,
|
||||
position: 'middle'
|
||||
}
|
||||
},
|
||||
{
|
||||
type: 'bar',
|
||||
data: [1, 4, 7, 1, 6, 2, 23, 14],
|
||||
coordinateSystem: 'polar',
|
||||
name: 'D/E/F',
|
||||
stack: 'a',
|
||||
emphasis: {
|
||||
focus: 'series'
|
||||
},
|
||||
label: {
|
||||
show: true,
|
||||
position: 'middle'
|
||||
}
|
||||
}
|
||||
])
|
||||
set(echart3Option.value, 'series', [
|
||||
{
|
||||
type: 'radar',
|
||||
data: [
|
||||
{
|
||||
value: [5.5, 1000, 200, 51, 666, 12345, 1245, 65478],
|
||||
name: '平均',
|
||||
label: {
|
||||
show: true
|
||||
}
|
||||
},
|
||||
{
|
||||
value: [15, 800, 300, 66, 551, 23456, 2123, 25698],
|
||||
name: '当前',
|
||||
label: {
|
||||
show: true
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
])
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped></style>
|
||||
@@ -38,31 +38,42 @@
|
||||
</el-form>
|
||||
<el-table :data="tableList" border stripe show-summary :summary-method="getSummaries">
|
||||
<el-table-column label="周期" prop="period" width="110px" />
|
||||
<el-table-column label="成交" align="center">
|
||||
<el-table-column prop="signNumber" label="成交数" />
|
||||
<el-table-column prop="signPrice" label="成交额" />
|
||||
<el-table-column
|
||||
prop="signPriceSequentialGrowth"
|
||||
label="成交额环比增长"
|
||||
:formatter="parseRate"
|
||||
/>
|
||||
<el-table-column prop="signPriceSequentialGrowth" label="环比" :formatter="parseRate" />
|
||||
<el-table-column
|
||||
prop="signPriceSamePeriodCompareGrowth"
|
||||
label="成交额同比增长"
|
||||
label="同比"
|
||||
:formatter="parseRate"
|
||||
/>
|
||||
<el-table-column prop="profit" label="利润" />
|
||||
<el-table-column prop="profitSequentialGrowth" label="利润环比增长" :formatter="parseRate" />
|
||||
<el-table-column
|
||||
prop="profitSamePeriodCompareGrowth"
|
||||
label="利润同比增长"
|
||||
:formatter="parseRate"
|
||||
/>
|
||||
<el-table-column prop="notReceivedMoney" label="未到账金额" />
|
||||
<el-table-column prop="receivedMoney" label="已到账金额" />
|
||||
</el-table-column>
|
||||
<el-table-column label="利润" align="center">
|
||||
<el-table-column prop="profit">
|
||||
<template #header> <Tooltip message="公司利润" /> <span>利润</span> </template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="profitSequentialGrowth" label="环比" :formatter="parseRate" />
|
||||
<el-table-column prop="profitSamePeriodCompareGrowth" label="同比" :formatter="parseRate" />
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column prop="notReceivedMoney">
|
||||
<template #header>
|
||||
<Tooltip message="回款列表中未审核的公司利润" /> <span>未到账</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="receivedMoney">
|
||||
<template #header>
|
||||
<Tooltip message="回款列表中已审核的公司利润" /> <span>已到账</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="waitSettleMoney" label="待结算金额" />
|
||||
<el-table-column prop="settledMoney" label="已结算金额" />
|
||||
<el-table-column prop="refundAmount" label="已退款金额" />
|
||||
<el-table-column prop="remainMoney" label="结余" />
|
||||
<el-table-column prop="remainMoney">
|
||||
<template #header>
|
||||
<Tooltip message="已到账金额-已结算金额-已退款金额" /> <span>结余</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</ContentWrap>
|
||||
</template>
|
||||
@@ -129,7 +140,8 @@ function getSummaries({ columns, data }) {
|
||||
if (column.property.includes('Growth')) {
|
||||
sums[index] = ''
|
||||
} else {
|
||||
sums[index] = values.reduce((prev, curr) => {
|
||||
sums[index] = values
|
||||
.reduce((prev, curr) => {
|
||||
const value = Number(curr)
|
||||
if (!Number.isNaN(value)) {
|
||||
return prev + curr
|
||||
@@ -137,6 +149,7 @@ function getSummaries({ columns, data }) {
|
||||
return prev
|
||||
}
|
||||
}, 0)
|
||||
.toFixed(2)
|
||||
}
|
||||
} else {
|
||||
sums[index] = ''
|
||||
|
||||
191
src/views/Home/SalesReport.vue
Normal file
191
src/views/Home/SalesReport.vue
Normal file
@@ -0,0 +1,191 @@
|
||||
<template>
|
||||
<ContentWrap>
|
||||
<el-form :model="searchForm" label-width="0" inline>
|
||||
<el-form-item>
|
||||
<el-date-picker
|
||||
v-model="searchForm.period"
|
||||
type="daterange"
|
||||
format="YYYY-MM-DD"
|
||||
value-format="YYYY-MM-DD"
|
||||
start-placeholder="选择日期"
|
||||
end-placeholder="选择日期"
|
||||
/>
|
||||
</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
|
||||
node-key="sourceId"
|
||||
placeholder="请选择渠道"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-select v-model="searchForm.cartype" placeholder="选择驾照类型" clearable>
|
||||
<el-option
|
||||
v-for="item in cartypeOptions"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
</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" />
|
||||
<el-table-column prop="nickname" label="姓名" width="80" fixed="left">
|
||||
<template #default="{ row }">
|
||||
<el-button type="primary" style="padding: 0" text @click="handleDetail">{{
|
||||
row.nickname
|
||||
}}</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="" sortable min-width="100">
|
||||
<template #header>
|
||||
<Tooltip message="咨询日期在所选周期内的线索总数" />
|
||||
<span>新线索数</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="成交数" prop="" sortable min-width="100">
|
||||
<template #header>
|
||||
<Tooltip message="成交日期在所选周期内的成交数" />
|
||||
<span>成交数</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="成交率" prop="" sortable min-width="100" />
|
||||
<el-table-column label="跟进数/日" prop="" sortable min-width="100" />
|
||||
<el-table-column label="成交数/日" prop="" sortable min-width="100" />
|
||||
<el-table-column label="平均成交周期" prop="" sortable min-width="100">
|
||||
<template #header>
|
||||
<Tooltip message="平均每条成交的线索,从咨询开始到成交所需要的天数" />
|
||||
<span>平均成交周期</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="" sortable min-width="100">
|
||||
<template #header>
|
||||
<Tooltip
|
||||
message="平均每笔成交订单的公司利润【按照登记,不按审核到账】=总公司利润/总成交数"
|
||||
/>
|
||||
<span>毛利/单</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="" sortable min-width="100">
|
||||
<template #header>
|
||||
<Tooltip
|
||||
message="平均每笔成交订单的额外支出(返费等)【按照登记,不按审核到账】=总支出/总成交数"
|
||||
/>
|
||||
<span>支出/单</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="" sortable min-width="100">
|
||||
<template #header>
|
||||
<Tooltip message="平均每条线索的成本=总线索成本/新线索条数" />
|
||||
<span>线索成本/条</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="" sortable min-width="100">
|
||||
<template #header>
|
||||
<Tooltip message="=(总公司利润-总支出-总线索成本)/总成交数" />
|
||||
<span>净利润/单</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="总线索成本" prop="" sortable min-width="100" />
|
||||
<el-table-column label="总支出" prop="" sortable min-width="100" />
|
||||
<el-table-column label="总利润" prop="" sortable min-width="100" />
|
||||
<el-table-column prop="" sortable min-width="100">
|
||||
<template #header>
|
||||
<Tooltip message="=总利润/(总成本+总支出)" />
|
||||
<span>能效</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="撞单数" prop="" sortable min-width="100" />
|
||||
<el-table-column label="撞单成交数" prop="" sortable min-width="100" />
|
||||
</el-table>
|
||||
|
||||
<DialogSalerReportDetail ref="SalerDetailDialog" />
|
||||
</ContentWrap>
|
||||
</template>
|
||||
|
||||
<script setup name="SalesReport">
|
||||
import DialogSalerReportDetail from './Comp/DialogSalerReportDetail.vue'
|
||||
|
||||
import * as reportApi from '@/api/home/reportSignRate'
|
||||
import { removeNullField } from '@/utils'
|
||||
|
||||
onMounted(() => {
|
||||
handleReset()
|
||||
handleSearch()
|
||||
})
|
||||
|
||||
const defaultProps = {
|
||||
children: 'children',
|
||||
label: 'sourceName',
|
||||
value: 'sourceId',
|
||||
isLeaf: 'leaf'
|
||||
}
|
||||
|
||||
const sourceOptions = ref([])
|
||||
const cartypeOptions = ref([])
|
||||
|
||||
const searchForm = ref({})
|
||||
|
||||
function handleReset() {
|
||||
searchForm.value = {
|
||||
nickname: undefined,
|
||||
period: []
|
||||
}
|
||||
}
|
||||
|
||||
const loading = ref(false)
|
||||
const tableList = ref([])
|
||||
async function handleSearch() {
|
||||
loading.value = true
|
||||
try {
|
||||
const data = await reportApi.getList(removeNullField(searchForm.value))
|
||||
tableList.value = data.map((item) => {
|
||||
const count = item.monthClueSignRateReportList.reduce(
|
||||
(pre, cur) => {
|
||||
return {
|
||||
signCount: pre.signCount + cur.clueSignNum,
|
||||
clueCount: pre.clueCount + cur.followClueNum
|
||||
}
|
||||
},
|
||||
{ signCount: 0, clueCount: 0 }
|
||||
)
|
||||
const rate = count.clueCount > 0 ? ((count.signCount * 100) / count.clueCount).toFixed(2) : 0
|
||||
return {
|
||||
...item,
|
||||
totalRate: `${rate}%(${count.signCount}/${count.clueCount})`,
|
||||
totalRateNum: rate
|
||||
}
|
||||
})
|
||||
} finally {
|
||||
loading.value = false
|
||||
}
|
||||
}
|
||||
|
||||
const SalerDetailDialog = ref()
|
||||
function handleDetail(info) {
|
||||
SalerDetailDialog.value.open(info, searchForm.value)
|
||||
}
|
||||
|
||||
// function monthSort(pre, cur, idx) {
|
||||
|
||||
// return (
|
||||
// Number(pre.monthClueSignRateReportList[idx].rate) -
|
||||
// Number(cur.monthClueSignRateReportList[idx].rate)
|
||||
// )
|
||||
// }
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped></style>
|
||||
@@ -17,6 +17,7 @@
|
||||
</el-form>
|
||||
<el-table v-loading="loading" :data="tableList">
|
||||
<el-table-column prop="label" label="供应商名称" />
|
||||
<!-- <el-table-column prop="" label="微信群名称" /> -->
|
||||
<el-table-column prop="sort" label="排序" width="100px" />
|
||||
<el-table-column prop="remark" label="备注" />
|
||||
<el-table-column
|
||||
|
||||
@@ -49,7 +49,7 @@
|
||||
|
||||
<!-- 列表 -->
|
||||
<el-table v-loading="loading" class="mt-20px" :data="tableList" border>
|
||||
<el-table-column type="expand" width="30">
|
||||
<el-table-column type="expand" width="30" fixed="left">
|
||||
<template #default="{ row }">
|
||||
<div class="pl-100px pr-100px">
|
||||
<el-table :data="row.productSpecList">
|
||||
@@ -71,16 +71,16 @@
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column key="productId" label="产品编码" prop="productId" />
|
||||
<el-table-column show-overflow-tooltip label="产品名称" min-width="200" prop="productName" />
|
||||
<el-table-column label="分类" min-width="90" prop="productCategoryName" />
|
||||
<el-table-column label="品牌" min-width="90" prop="productBrandName" />
|
||||
<el-table-column show-overflow-tooltip label="产品名称" min-width="100" prop="productName" />
|
||||
<el-table-column label="分类" width="90" prop="productCategoryName" />
|
||||
<el-table-column label="品牌" width="90" prop="productBrandName" />
|
||||
<el-table-column label="商品图" min-width="80">
|
||||
<template #default="{ row }">
|
||||
<el-image :src="row.mainImage" @click="imagePreview(row.mainImage)" class="w-30px h-30px" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="简介" min-width="70" prop="productIntro" />
|
||||
<el-table-column :formatter="dateFormatter" label="创建时间" prop="createTime" width="180" />
|
||||
<el-table-column label="简介" min-width="200" prop="productIntro" />
|
||||
<el-table-column :formatter="dateFormatter" label="创建时间" prop="createTime" width="120" />
|
||||
<el-table-column v-for="item in diyFieldList" :key="item.clueParamId" :label="item.label">
|
||||
<template #default="{ row }">
|
||||
<div v-if="item.component == 'DatePicker'">
|
||||
|
||||
Reference in New Issue
Block a user