Merge branch 'main' of http://114.55.169.15:3000/qiushanhe/ss-crm-manage-web into dev-cl
# Conflicts: # .env.base
This commit is contained in:
@@ -78,3 +78,7 @@
|
||||
left: 2px;
|
||||
}
|
||||
}
|
||||
|
||||
.el-table--default .cell {
|
||||
padding: 0 5px;
|
||||
}
|
||||
|
||||
@@ -9,6 +9,18 @@
|
||||
:label="col.label"
|
||||
:width="col.width"
|
||||
/>
|
||||
<el-table-column label="状态" key="status">
|
||||
<template #default="scope">
|
||||
<el-switch
|
||||
v-model="scope.row.status"
|
||||
:active-value="0"
|
||||
active-text="在职"
|
||||
inactive-text="离职"
|
||||
:inactive-value="1"
|
||||
disabled
|
||||
/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<Pagination
|
||||
v-model:limit="pageSize"
|
||||
|
||||
@@ -19,13 +19,19 @@
|
||||
:props="defaultProps"
|
||||
check-strictly
|
||||
clearable
|
||||
filterable
|
||||
node-key="sourceId"
|
||||
placeholder="请选择渠道"
|
||||
@change="sourceChange"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item v-if="appStore.getAppInfo?.instanceType == 1">
|
||||
<el-select v-model="searchForm.licenseType" placeholder="选择驾照类型" clearable>
|
||||
<el-select
|
||||
v-model="searchForm.licenseTypeList"
|
||||
placeholder="选择驾照类型"
|
||||
clearable
|
||||
multiple
|
||||
>
|
||||
<el-option
|
||||
v-for="item in props.licenseTypeOptions"
|
||||
:key="item.label"
|
||||
@@ -105,6 +111,7 @@ import * as reportApi from '@/api/home/reportSaler'
|
||||
import { getIntDictOptions } from '@/utils/dict'
|
||||
import { removeNullField } from '@/utils'
|
||||
import { useAppStore } from '@/store/modules/app'
|
||||
import { formatDate } from '@/utils/formatTime'
|
||||
|
||||
const appStore = useAppStore()
|
||||
|
||||
@@ -149,7 +156,9 @@ const showPane = ref(1)
|
||||
function handleReset() {
|
||||
searchForm.value = {
|
||||
nickname: undefined,
|
||||
consultTime: []
|
||||
consultTime: [`${year}-${month}-01`, formatDate(new Date())],
|
||||
licenseTypeList: [],
|
||||
sourceId: undefined
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -22,12 +22,18 @@
|
||||
:props="defaultProps"
|
||||
check-strictly
|
||||
clearable
|
||||
filterable
|
||||
node-key="sourceId"
|
||||
placeholder="请选择渠道"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item v-if="appStore.getAppInfo?.instanceType == 1">
|
||||
<el-select v-model="searchForm.licenseType" placeholder="选择驾照类型" clearable>
|
||||
<el-select
|
||||
v-model="searchForm.licenseTypeList"
|
||||
placeholder="选择驾照类型"
|
||||
clearable
|
||||
multiple
|
||||
>
|
||||
<el-option
|
||||
v-for="item in licenseTypeOptions"
|
||||
:key="item.label"
|
||||
@@ -43,8 +49,15 @@
|
||||
</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
|
||||
v-loading="loading"
|
||||
:data="tableList"
|
||||
border
|
||||
stripe
|
||||
show-summary
|
||||
:summary-method="getSummaries"
|
||||
>
|
||||
<el-table-column type="index" width="60" fixed="left" align="center" />
|
||||
<el-table-column prop="nickname" label="姓名" width="80" fixed="left">
|
||||
<template #default="{ row }">
|
||||
<el-button type="primary" style="padding: 0" text @click="handleDetail(row)">{{
|
||||
@@ -164,22 +177,61 @@ function handleReset() {
|
||||
const month = new Date().getMonth() + 1
|
||||
searchForm.value = {
|
||||
nickname: undefined,
|
||||
consultTime: [`${year}-${month}-01`, formatDate(new Date())]
|
||||
consultTime: [`${year}-${month}-01`, formatDate(new Date())],
|
||||
licenseTypeList: [],
|
||||
sourceId: undefined
|
||||
}
|
||||
}
|
||||
|
||||
const loading = ref(false)
|
||||
const tableList = ref([])
|
||||
const avgData = ref({})
|
||||
async function handleSearch() {
|
||||
loading.value = true
|
||||
try {
|
||||
const data = await reportApi.getList(removeNullField(searchForm.value))
|
||||
tableList.value = data
|
||||
tableList.value = data.personDataVOList
|
||||
avgData.value = data.averageDataVO
|
||||
} finally {
|
||||
loading.value = false
|
||||
}
|
||||
}
|
||||
|
||||
function getSummaries({ columns, data }) {
|
||||
const sums = []
|
||||
columns.forEach((column, index) => {
|
||||
if (index == 0) {
|
||||
sums[index] = '统计'
|
||||
return
|
||||
}
|
||||
|
||||
const doubleSumsColumns = [
|
||||
'newClueNumber',
|
||||
'signNumber',
|
||||
'clueCostTotal',
|
||||
'payPriceTotal',
|
||||
'profitTotal'
|
||||
]
|
||||
if (column.property in avgData.value) {
|
||||
sums[index] = `均值: ${avgData.value[column.property]}`
|
||||
} else if (doubleSumsColumns.includes(column.property)) {
|
||||
const values = data.map((item) => Number(item[column.property]))
|
||||
let sum = values.reduce((prev, curr) => prev + curr, 0)
|
||||
let avg = sum / values.length
|
||||
if (['newClueNumber', 'signNumber'].includes(column.property)) {
|
||||
avg = Math.floor(avg)
|
||||
} else {
|
||||
sum = sum.toFixed(2)
|
||||
avg = avg.toFixed(2)
|
||||
}
|
||||
sums[index] = h('div', {}, [h('div', {}, `合计:${sum}`), h('div', {}, `均值:${avg}`)])
|
||||
} else {
|
||||
sums[index] = ''
|
||||
}
|
||||
})
|
||||
return sums
|
||||
}
|
||||
|
||||
const SalerDetailDialog = ref()
|
||||
function handleDetail(info) {
|
||||
SalerDetailDialog.value.open(info, searchForm.value)
|
||||
|
||||
Reference in New Issue
Block a user