mayf
2024-10-12 3c0375d675136df3225fe19329920f8ff675ed29
花农报表
已修改3个文件
已添加2个文件
251 ■■■■ 文件已修改
assets/statistic/index.scss 27 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/bill/_type/index.vue 18 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/report/finance/index.vue 13 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/report/supplier.vue 164 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
utils/form-item-config.js 29 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
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;
    }
  }
}
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>
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>
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>
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 + '' }))
      },
    },
  }
}