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) => { export const getList = async (data) => {
return await request.post({ url: '/admin-api/crm/sch-clue/clueQuality/report', 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) { success(content: string) {
ElMessage.success(content) // ElMessage.success(content)
ElMessage({
message: content,
duration: 1500,
type: 'success'
})
}, },
// 警告消息 // 警告消息
warning(content: string) { warning(content: string) {

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

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

@ -36,15 +36,27 @@
<el-button @click="handleReset">重置</el-button> <el-button @click="handleReset">重置</el-button>
</el-form-item> </el-form-item>
</el-form> </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 label="周期" prop="period" width="110px" />
<el-table-column prop="signNumber" label="成交数" /> <el-table-column prop="signNumber" label="成交数" />
<el-table-column prop="signPrice" label="成交额" /> <el-table-column prop="signPrice" label="成交额" />
<el-table-column prop="signPriceSequentialGrowth" label="成交额环比增长" /> <el-table-column
<el-table-column prop="signPriceSamePeriodCompareGrowth" label="成交额同比增长" /> prop="signPriceSequentialGrowth"
label="成交额环比增长"
:formatter="parseRate"
/>
<el-table-column
prop="signPriceSamePeriodCompareGrowth"
label="成交额同比增长"
:formatter="parseRate"
/>
<el-table-column prop="profit" label="利润" /> <el-table-column prop="profit" label="利润" />
<el-table-column prop="profitSequentialGrowth" label="利润环比增长" /> <el-table-column prop="profitSequentialGrowth" label="利润环比增长" :formatter="parseRate" />
<el-table-column prop="profitSamePeriodCompareGrowth" label="利润同比增长" /> <el-table-column
prop="profitSamePeriodCompareGrowth"
label="利润同比增长"
:formatter="parseRate"
/>
<el-table-column prop="notReceivedMoney" label="未到账金额" /> <el-table-column prop="notReceivedMoney" label="未到账金额" />
<el-table-column prop="receivedMoney" label="已到账金额" /> <el-table-column prop="receivedMoney" label="已到账金额" />
<el-table-column prop="waitSettleMoney" label="待结算金额" /> <el-table-column prop="waitSettleMoney" label="待结算金额" />
@ -100,6 +112,38 @@ async function handleSearch() {
loading.value = false 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> </script>
<style lang="scss" scoped></style> <style lang="scss" scoped></style>

Loading…
Cancel
Save