From 3c0375d675136df3225fe19329920f8ff675ed29 Mon Sep 17 00:00:00 2001 From: mayf <m13160102112@163.com> Date: 星期六, 12 十月 2024 13:59:50 +0800 Subject: [PATCH] 花农报表 --- assets/statistic/index.scss | 27 +++++ pages/report/supplier.vue | 164 ++++++++++++++++++++++++++++++++ pages/bill/_type/index.vue | 18 --- pages/report/finance/index.vue | 13 -- utils/form-item-config.js | 29 +++++ 5 files changed, 222 insertions(+), 29 deletions(-) diff --git a/assets/statistic/index.scss b/assets/statistic/index.scss new file mode 100644 index 0000000..d8fb17f --- /dev/null +++ b/assets/statistic/index.scss @@ -0,0 +1,27 @@ +.statistic-title { + text-align: center; + font-size: 20px; + color: $main-title-color; + font-weight: bold; + margin-bottom: 6px; +} +.statistic-num { + text-align: center; + font-size: 16px; + color: $primary-color; +} +::v-deep { + .el-card { + &.is-total { + height: 100%; + } + &__body { + padding: 10px; + height: 100%; + display: flex; + flex-direction: column; + align-items: center; + justify-content: center; + } + } +} diff --git a/pages/bill/_type/index.vue b/pages/bill/_type/index.vue index 898d62d..c852983 100644 --- a/pages/bill/_type/index.vue +++ b/pages/bill/_type/index.vue @@ -170,21 +170,5 @@ </script> <style lang="scss" scoped> -.statistic-title { - text-align: center; - font-size: 20px; - color: $main-title-color; - font-weight: bold; - margin-bottom: 6px; -} -.statistic-num { - text-align: center; - font-size: 16px; - color: $primary-color; -} -::v-deep { - .el-card__body { - padding: 10px; - } -} +@import '@/assets/statistic/index.scss'; </style> diff --git a/pages/report/finance/index.vue b/pages/report/finance/index.vue index e04b403..a490242 100644 --- a/pages/report/finance/index.vue +++ b/pages/report/finance/index.vue @@ -244,16 +244,5 @@ </script> <style lang="scss" scoped> -.statistic-title { - text-align: center; - font-size: 20px; - color: $main-title-color; - font-weight: bold; - margin-bottom: 6px; -} -.statistic-num { - text-align: center; - font-size: 16px; - color: $primary-color; -} +@import '@/assets/statistic/index.scss'; </style> diff --git a/pages/report/supplier.vue b/pages/report/supplier.vue new file mode 100644 index 0000000..aad9201 --- /dev/null +++ b/pages/report/supplier.vue @@ -0,0 +1,164 @@ +<template> + <div> + <div v-loading="statisticLoading"> + <el-row :gutter="20" type="flex" justify="center"> + <el-col :span="6" class="mb-10"> + <el-card class="is-total"> + <div class="statistic-title">底价合计</div> + <div class="statistic-num"> + {{ statistic.orderSupplierPriceAmount || 0 }} + </div> + </el-card> + </el-col> + <el-col :span="12" class="mb-10"> + <el-row :gutter="20"> + <el-col :span="12" class="mb-10"> + <el-card> + <div class="statistic-title">降级扣款</div> + <div class="statistic-num"> + {{ statistic.orderCheckFee || 0 }} + </div> + </el-card> + </el-col> + <el-col :span="12" class="mb-10"> + <el-card> + <div class="statistic-title">缺货扣款</div> + <div class="statistic-num"> + {{ statistic.orderLackFeeSupplier || 0 }} + </div> + </el-card> + </el-col> + <el-col :span="12"> + <el-card> + <div class="statistic-title">售后扣款</div> + <div class="statistic-num"> + {{ statistic.salesFeeSupplier || 0 }} + </div> + </el-card> + </el-col> + <el-col :span="12"> + <el-card> + <div class="statistic-title">实际销售扎数</div> + <div class="statistic-num"> + {{ statistic.realSaleNum || 0 }} + </div> + </el-card> + </el-col> + </el-row> + </el-col> + <el-col :span="6" class="mb-10"> + <el-card class="is-total"> + <div class="statistic-title">结算合计</div> + <div class="statistic-num"> + {{ statistic.profitFeeAmount || 0 }} + </div> + </el-card> + </el-col> + </el-row> + </div> + <el-bus-crud v-bind="tableConfig"></el-bus-crud> + </div> +</template> + +<script> +import { getSupplierListConfig } from '@/utils/form-item-config' +export default { + data() { + const currentDate = this.$elBusUtil.toDate(new Date()) + return { + statisticLoading: false, + statistic: {}, + tableConfig: { + url: 'flower/v2/report/order/supplier/page', + hasNew: false, + hasOperation: false, + hasExport: true, + exportUrl: 'flower/v2/report/order/supplier/export', + exportText: '导出', + beforeRequest: async (params) => { + this.statisticLoading = true + // eslint-disable-next-line + let { code, data } = await this.$elBusHttp.request( + `flower/v2/report/order/supplier/count`, + { params } + ) + if (code === 0) { + this.statistic = data || {} + } + this.statisticLoading = false + }, + columns: [ + { label: '日期', prop: 'dateinfo', fixed: 'left', minWidth: 120 }, + { + label: '供应商ID', + prop: 'supplierId', + fixed: 'left', + minWidth: 80, + }, + { + label: '供应商', + prop: 'supplierName', + fixed: 'left', + minWidth: 120, + }, + { + label: '花农底价', + prop: 'orderSupplierPriceAmount', + minWidth: 120, + }, + { label: '降级扣款', prop: 'orderCheckFee', minWidth: 120 }, + { + label: '缺货扣款(缺货+补货)', + prop: 'orderLackFeeSupplier', + minWidth: 150, + }, + { label: '售后扣花农款', prop: 'salesFeeSupplier', minWidth: 120 }, + { label: '实际销售扎数', prop: 'realSaleNum', minWidth: 120 }, + { + label: '结算费用', + prop: 'profitFeeAmount', + fixed: 'right', + minWidth: 120, + }, + { + label: '订单状态', + prop: 'settleStatus', + fixed: 'right', + minWidth: 120, + }, + ], + searchForm: [ + { + type: 'row', + items: [ + { + label: '下单日期', + id: 'startDate', + component: 'el-bus-date-range', + el: { + clearable: false, + }, + commonFormat: true, + commonFormatProps: ['startDate', 'endDate'], + customClass: 'in-bus-form', + commonRules: true, + default: [currentDate, currentDate], + }, + { ...getSupplierListConfig(), label: '供应商' }, + ], + }, + ], + }, + } + }, + head() { + return { + title: '花农结算报表', + } + }, +} +</script> + +<style lang="scss" scoped> +@import '@/assets/statistic/index.scss'; +</style> diff --git a/utils/form-item-config.js b/utils/form-item-config.js index aca653c..c557ea8 100644 --- a/utils/form-item-config.js +++ b/utils/form-item-config.js @@ -177,3 +177,32 @@ }, } } + +export const getSupplierListConfig = () => { + return { + label: '供应商:', + id: 'supplierId', + type: 'bus-select', + el: { + interfaceUri: 'flower/api/supplier/page', + extraQuery: { + current: 1, + size: 2000, + status: 'P', + isEnabled: 1, + }, + props: { + label: 'name', + value: 'id', + dataPath: 'records', + }, + filterable: true, + clearable: true, + style: 'width:100%', + // 列表返回的是id是int但是存的是string情况 + filterOptions: (list) => { + return list.map((item) => ({ ...item, id: item.id + '' })) + }, + }, + } +} -- Gitblit v1.9.3