dev-report
qsh 1 month ago
parent 2406bcb8e4
commit 9c7ba2fb87
  1. 4
      src/api/home/reportChannel.js
  2. 7
      src/hooks/web/useMessage.ts
  3. 1
      src/router/modules/remaining.ts
  4. 19
      src/views/Home/Comp/ChannelPeriod.vue
  5. 54
      src/views/Home/Comp/SignListCard.vue

@ -2,3 +2,7 @@ import request from '@/config/axios'
export const getList = async (data) => {
return await request.post({ url: '/admin-api/crm/sch-clue/clueQuality/report', data })
}
export const getPeriodList = async (data) => {
return await request.post({ url: '/admin-api/crm/sch-clue/clueQuality/period/report', data })
}

@ -13,7 +13,12 @@ export const useMessage = () => {
},
// 成功消息
success(content: string) {
ElMessage.success(content)
// ElMessage.success(content)
ElMessage({
message: content,
duration: 1500,
type: 'success'
})
},
// 警告消息
warning(content: string) {

@ -106,7 +106,6 @@ const remainingRouter: AppRouteRecordRaw[] = [
}
]
},
// {
// path: '/dict',
// component: Layout,

@ -11,9 +11,9 @@
end-placeholder="选择日期"
/>
</el-form-item>
<el-form-item label="成交周期" prop="period">
<el-form-item label="成交周期" prop="periodNumber">
<el-input-number
v-model="searchForm.period"
v-model="searchForm.periodNumber"
:min="1"
:controls="false"
style="width: 100%"
@ -62,7 +62,7 @@
</template>
<script setup name="ChannelPeriod">
import * as reportApi from '@/api/home/reportChannel'
import { getPeriodList } from '@/api/home/reportChannel'
import { removeNullField } from '@/utils'
const props = defineProps({
@ -82,8 +82,8 @@ const defaultProps = {
const searchRef = ref()
const searchRules = {
consultDate: { required: true, type: 'array', message: '请选择咨询日期', trigger: 'change,blur' },
period: { required: true, message: '请输入成交周期', trigger: 'blur' }
// consultDate: { required: true, type: 'array', message: '', trigger: 'change,blur' },
periodNumber: { required: true, message: '请输入成交周期', trigger: 'blur' }
}
onMounted(() => {
@ -96,7 +96,7 @@ const searchForm = ref({})
function handleReset() {
searchForm.value = {
sourceId: undefined,
period: 30,
periodNumber: 30,
consultDate: []
}
}
@ -110,7 +110,12 @@ async function handleSearch() {
const valid = await searchRef.value.validate()
if (!valid) return
loading.value = true
const data = await reportApi.getList(removeNullField(searchForm.value))
const params = { ...searchForm.value }
if (params.consultDate && params.consultDate.length) {
params.startDateTime = params.consultDate[0]
params.endDateTime = params.consultDate[1]
}
const data = await getPeriodList(removeNullField(params))
tableList.value = data
} finally {
loading.value = false

@ -36,15 +36,27 @@
<el-button @click="handleReset">重置</el-button>
</el-form-item>
</el-form>
<el-table :data="tableList" border stripe>
<el-table :data="tableList" border stripe show-summary :summary-method="getSummaries">
<el-table-column label="周期" prop="period" width="110px" />
<el-table-column prop="signNumber" label="成交数" />
<el-table-column prop="signPrice" label="成交额" />
<el-table-column prop="signPriceSequentialGrowth" label="成交额环比增长" />
<el-table-column prop="signPriceSamePeriodCompareGrowth" label="成交额同比增长" />
<el-table-column
prop="signPriceSequentialGrowth"
label="成交额环比增长"
:formatter="parseRate"
/>
<el-table-column
prop="signPriceSamePeriodCompareGrowth"
label="成交额同比增长"
:formatter="parseRate"
/>
<el-table-column prop="profit" label="利润" />
<el-table-column prop="profitSequentialGrowth" label="利润环比增长" />
<el-table-column prop="profitSamePeriodCompareGrowth" 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 prop="waitSettleMoney" label="待结算金额" />
@ -100,6 +112,38 @@ async function handleSearch() {
loading.value = false
}
}
function parseRate(row, column) {
return Number(row[column.property] * 100).toFixed(2) + '%'
}
function getSummaries({ columns, data }) {
let sums = []
columns.forEach((column, index) => {
if (index == 0) {
sums[index] = '合计'
return
}
const values = data.map((item) => Number(item[column.property]))
if (!values.every((value) => Number.isNaN(value))) {
if (column.property.includes('Growth')) {
sums[index] = ''
} else {
sums[index] = values.reduce((prev, curr) => {
const value = Number(curr)
if (!Number.isNaN(value)) {
return prev + curr
} else {
return prev
}
}, 0)
}
} else {
sums[index] = ''
}
})
return sums
}
</script>
<style lang="scss" scoped></style>

Loading…
Cancel
Save