🍷 葡月ERP管理系统

{% if page == 'home' %}
{{ stats.total_sales }}
销售总额(元)
{{ stats.total_profit }}
销售利润(元)
{{ stats.total_orders }}
订单数量
{{ stats.total_quantity }}
销售箱数
{{ stats.total_customers }}
客户数
{{ stats.margin }}%
毛利率

🏆 销售排行 TOP5

{% for p in top_products %}{% endfor %}
商品销量利润
{{ p.name[:20] }}...{{ p.quantity }}箱¥{{ p.profit }}

👥 客户排行

{% for c in top_customers %}{% endfor %}
客户销量利润
{{ c.name[:15] }}{{ c.quantity }}箱¥{{ c.profit }}
{% if warnings %}

⚠️ 库存预警

{% for w in warnings %}{% endfor %}
商品当前库存安全库存状态
{{ w.name[:30] }}{{ w.quantity }}箱{{ w.min_stock }}箱库存不足
{% else %}

✅ 库存状态

所有商品库存充足

{% endif %} {% endif %} {% if page == 'purchase' %}

📥 采购订单

{% for p in purchase_orders %}{% endfor %}
订单号日期商品数量单价金额付款状态收货状态操作
#{{ p.id }}{{ p.date }}{{ p.product[:25] }}{{ p.quantity }}箱¥{{ p.unit_price }}¥{{ p.total_amount }}{{ p.payment_status }}{{ p.delivery_status }}{% if p.payment_status!='已付款' %}{% else %}{% endif %} {% if p.delivery_status!='已收货' %}{% else %}{% endif %}{% if p.payment_status=='未付款' and p.delivery_status=='未收货' %} {% endif %}

➕ 新建采购单

采购总计:商品项: 0 项  |  金额合计: ¥0
¥{{ purchase_stats.total }}
采购总金额
{{ purchase_stats.orders }}
采购订单数
{{ purchase_stats.quantity }}
采购箱数
{% endif %} {% if page == 'inventory' %}

📦 当前库存

{% for p in products %}{% endfor %}
商品名称规格库存(箱)库存(瓶)成本(瓶)库存总值安全库存
{{ p.name }}{{ p.spec }}{{ p.quantity }}{{ p.quantity * (6 if '6瓶' in p.spec else 4) }}¥{{ p.cost }}¥{{ p.quantity * p.cost * (6 if '6瓶' in p.spec else 4) }}{{ p.get('min_stock', 0) }}箱
📦 合计{{ total_quantity }}箱{{ total_bottles }}瓶¥{{ total_value }}
{% endif %} {% if page == 'products' %}
{{ product_stats.total_products }}
商品种类
{{ product_stats.total_quantity }}
总库存(箱)
{{ product_stats.total_bottles }}
总库存(瓶)
{{ product_stats.total_value }}
库存总值(元)
¥{{ "{:,.0f}".format(product_stats.total_sales|default(0)) }}
累计销售额
¥{{ "{:,.0f}".format(product_stats.total_profit|default(0)) }}
累计利润
{{ product_stats.low_stock_count }}
库存预警

🍷 商品库存明细

{% for p in products %}{% endfor %}
ID商品名称类型葡萄品种产地年份酒精度规格库存成本股东价状态操作
{{ p.id }}{{ p.name }}{{ p.wine_type|default('-') }}{{ p.grape_variety|default('-') }}{{ p.region|default('-') }}{{ p.vintage|default('-') }}{% if p.alcohol %}{{ p.alcohol }}%{% else %}-{% endif %}{{ p.spec }}{{ p.quantity }}箱¥{{ p.cost }}¥{{ p.shareholder_price|default(0) }}{% if p.low_stock %}库存不足{% else %}正常{% endif %}
{% endif %} {% if page == 'stock_check' %}

🔍 库存盘点

📋 盘点记录

{% if stock_check_records %}{% for r in stock_check_records %}{% endfor %}
序号时间商品原库存盘点后差异
#{{ r.id }}{{ r.date }}{{ r.product[:20] }}{{ r.old_quantity }}箱{{ r.new_quantity }}箱{{ r.diff }}箱
{% else %}

暂无盘点记录

{% endif %}
{% endif %} {% if page in ['sales','analysis','product_analysis'] %}
销售订单销售分析商品分析
{% if page == 'sales' %}

📋 销售订单

{% for order in orders %}{% endfor %}
订单号日期客户商品数量金额收款状态发货状态操作
#{{ order.id }}{{ order.date }}{{ order.customer }}{{ order.product[:20] }}{{ order.quantity }}箱¥{{ order.total_amount }}{{ order.payment_status }}{{ order.delivery_status }}{% if order.payment_status!='已收款' %}{% else %}{% endif %} {% if order.delivery_status!='已发货' %}{% else %}{% endif %}{% if order.payment_status=='未收款' and order.delivery_status=='未发货' %} {% endif %}
{% endif %} {% if page == 'analysis' %}

📈 销售趋势分析

{% for d in trend_data %}{% endfor %}
时间订单数销量(箱)销售额利润环比
{{ d.period }}{{ d.orders }}{{ d.quantity }}¥{{ d.sales }}¥{{ d.profit }}{{ d.growth }}%

按客户

{% for c in customer_stats %}{% endfor %}
客户销量销售额利润
{{ c.name }}{{ c.quantity }}箱¥{{ c.sales }}¥{{ c.profit }}

按商品

{% for p in product_stats %}{% endfor %}
商品销量销售额利润
{{ p.name[:15] }}{{ p.quantity }}箱¥{{ p.sales }}¥{{ p.profit }}
{% endif %} {% if page == 'product_analysis' %}
{{ product_stats_summary.total_products }}
商品种类
{{ product_stats_summary.total_sales }}
销售总额
{{ product_stats_summary.total_profit }}
利润总额
{{ product_stats_summary.avg_order }}
平均客单价
{{ product_stats_summary.best_product }}
畅销商品
{{ product_stats_summary.best_sales }}
销售额

🏆 销售额Top5

{% for p in top_by_sales %}{% endfor %}
商品销量销售额利润占比
{{ p.name[:20] }}{{ p.quantity }}箱¥{{ p.sales }}¥{{ p.profit }}{{ p.percent }}%

💰 利润Top5

{% for p in top_by_profit %}{% endfor %}
商品销量销售额利润单位利润
{{ p.name[:20] }}{{ p.quantity }}箱¥{{ p.sales }}¥{{ p.profit }}¥{{ p.unit_profit }}

📊 商品销售占比

{% for p in product_stats %}
{{ p.name[:20] }}¥{{ p.sales }} ({{ p.percent }}%)
{% endfor %}

🍷 商品销售明细

{% for p in product_stats %}{% endfor %}
排名商品销量销售额利润单位利润占比
{{ loop.index }}{{ p.name[:20] }}{{ p.quantity }}箱¥{{ p.sales }}¥{{ p.profit }}¥{{ p.unit_profit }}{{ p.percent }}%
{% endif %} {% endif %} {% if page == 'add_sale' %}

➕ 录入销售订单

订单总计:商品项: 0 项  |  金额合计: ¥0
{% endif %} {% if page in ['customers','customer_analysis'] %}
{{ customer_stats.total }}
总客户数
{{ customer_stats.active }}
活跃客户
{{ customer_stats.inactive }}
沉默客户
{{ customer_stats.repeat_rate }}%
复购率
客户列表客户分析
{% if page == 'customers' %}

👥 客户列表

{% for c in customers %}{% endfor %}
ID名称类型等级联系方式操作
{{ c.id }}{{ c.name }}{{ c.type }}{{ c.level }}{{ c.contact or '-' }} / {{ c.phone or '-' }}
{% endif %} {% if page == 'customer_analysis' %}
{{ customer_stats.total }}
总客户数
{{ customer_stats.active }}
活跃客户
{{ customer_stats.inactive }}
沉默客户
{{ customer_stats.repeat_rate }}%
复购率
{{ customer_stats.avg_order }}
平均订单金额
{{ customer_stats.total_sales }}
客户累计销售额

🏆 销售额Top5

{% for c in top_customers %}{% endfor %}
客户销售额利润订单数
{{ c.name }}¥{{ c.sales }}¥{{ c.profit }}{{ c.orders }}

💰 利润Top5

{% for c in top_profit_customers %}{% endfor %}
客户销售额利润订单数
{{ c.name }}¥{{ c.sales }}¥{{ c.profit }}{{ c.orders }}

📊 客户等级分布

{% for k,v in level_distribution.items() %}
{{ k }}{{ v }}人
{% endfor %}

👤 客户价值排名

{% for c in customer_detail %}{% endfor %}
排名客户类型等级销量销售额利润订单数平均订单最后下单状态
{{ loop.index }}{{ c.name }}{{ c.type }}{{ c.level }}{{ c.quantity }}箱¥{{ c.sales }}¥{{ c.profit }}{{ c.order_count }}¥{{ c.avg_order }}{{ c.last_order }}{{ c.status }}
{% endif %} {% endif %} {% if page == 'customer_orders' %}
← 返回客户列表
{{ total_sales }}
累计消费
{{ total_quantity }}
累计箱数
{{ total_profit }}
累计利润

📋 {{ customer_name }} 的订单记录

{% for o in customer_orders %}{% endfor %}
订单号日期商品数量金额利润收款状态发货状态
#{{ o.id }}{{ o.date }}{{ o.product[:20] }}{{ o.quantity }}箱¥{{ o.total_amount }}¥{{ o.profit }}{{ o.payment_status }}{{ o.delivery_status }}
{% endif %} {% if page == 'analysis' %}

📈 销售趋势分析

{% for d in trend_data %}{% endfor %}
时间订单数销量(箱)销售额利润环比
{{ d.period }}{{ d.orders }}{{ d.quantity }}¥{{ d.sales }}¥{{ d.profit }}{{ d.growth }}%

按客户

{% for c in customer_stats %}{% endfor %}
客户销量销售额利润
{{ c.name }}{{ c.quantity }}箱¥{{ c.sales }}¥{{ c.profit }}

按商品

{% for p in product_stats %}{% endfor %}
商品销量销售额利润
{{ p.name[:15] }}{{ p.quantity }}箱¥{{ p.sales }}¥{{ p.profit }}
{% endif %} {% if page == 'financial' %}
¥{{ financial.sales }}
销售总额(已收款)
¥{{ financial.cost }}
销售成本
¥{{ financial.profit }}
毛利润
{{ financial.margin }}%
毛利率
¥{{ financial.purchase }}
采购支出(已付款)
¥{{ financial.stock_value }}
库存资产
¥{{ financial.corporate }}
对公账户余额
¥{{ financial.cash }}
现金账户余额
¥{{ financial.capital }}
注册资本
¥{{ financial.receivable }}
应收账款
¥{{ financial.payable }}
应付账款

📊 资产负债表

资产金额负债及权益金额付款状态收货状态操作
库存商品¥{{ financial.stock_value }}注册资本¥{{ financial.capital }}
应收账款¥{{ financial.receivable }}未分配利润¥{{ financial.retained }}
资产合计¥{{ financial.total_assets }}权益合计¥{{ financial.total_equity }}

💵 成本结构

{% for c in cost_structure %}{% endfor %}
商品单位成本销量总成本
{{ c.name[:20] }}¥{{ c.unit_cost }}{{ c.quantity }}箱¥{{ c.total_cost }}

💳 账户交易流水

{% for t in transactions %}{% endfor %}
日期类型账户金额关联单号备注
{{ t.date }}{{ t.type }}{{ t.account }}{{ '+' if t.amount > 0 else '' }}¥{{ t.amount|int }}{{ t.ref }}{{ t.customer[:15] }}
{% endif %} {% if page == 'expenses' %} {# 预算监控 #} {% if budget_info.budget > 0 %}

📊 {{ budget_info.month }} 预算监控

预算: ¥{{ "{:,.0f}".format(budget_info.budget) }} | 实际: ¥{{ "{:,.0f}".format(budget_info.actual) }} | 剩余: ¥{{ "{:,.0f}".format(budget_info.remaining) }}

{{ "%.1f"|format(budget_info.percent) }}% 已使用

{% endif %}
¥{{ "{:,.0f}".format(expense_stats.total) }}
费用总额
¥{{ "{:,.0f}".format(expense_stats.pending) }}
待报销
¥{{ "{:,.0f}".format(expense_stats.approved) }}
已报销
¥{{ "{:,.0f}".format(expense_stats.rejected) }}
已拒绝
{{ expense_stats.count }}
费用笔数
{{ expense_stats.status_counts.pending }}
待处理
{{ expense_stats.status_counts.approved }}
已通过

📊 费用类型分布

{% if top_expense_types %} {% for t in top_expense_types %}{% endfor %}
类型金额
{{ t.type }}¥{{ "{:,.0f}".format(t.amount) }}
{% else %}

暂无数据

{% endif %}

📈 月度趋势

{% if monthly_trend %} {% for m in monthly_trend %}{% endfor %}
月份金额笔数
{{ m.month }}¥{{ "{:,.0f}".format(m.total) }}{{ m.count }}
{% else %}

暂无数据

{% endif %}

📝 新增费用

💰 设置预算

🔄 周期性费用

{% if recurring_expenses %}

已设置周期费用:

{% for r in recurring_expenses %}{% endfor %}
类型金额频率下次操作
{{ r.type }}¥{{ "{:,.0f}".format(r.amount) }}{{ r.frequency }}{{ r.next_date }}
{% endif %}

📋 费用明细

{% for e in expenses %}{% endfor %}
ID日期类型金额说明支付账户状态操作
#{{ e.id }}{{ e.date }}{{ e.type }}¥{{ "{:,.0f}".format(e.amount) }}{{ e.description[:20] if e.description else '' }}{% if e.pay_account %}{{ e.pay_account }}{% else %}-{% endif %}{% if e.status == '待报销' %}{{ e.status }}{% elif e.status == '已报销' %}{{ e.status }}{% else %}{{ e.status }}{% endif %}{% if e.status == '待报销' %} {% endif %}
{% endif %} {% if page == 'inventory_warning' %} {% if warnings %}{% for w in warnings %}
{{ w.name[:30] }} 库存不足!当前: {{ w.quantity }}箱,安全: {{ w.min_stock }}箱,建议补货: {{ w.suggest }}箱
{% endfor %}{% else %}

✅ 所有商品库存充足

{% endif %}

📊 库存周转分析

{% for t in turnover %}{% endfor %}
商品当前库存日均销量可销售天数状态
{{ t.name[:20] }}{{ t.quantity }}箱{{ t.daily_sales }}箱{{ t.days }}天{{ t.status }}
{% endif %} {% if page == 'receive_payment' %}

💰 销售收款

订单 #{{ order.id }} - {{ order.customer }}

商品: {{ order.product[:30] }} | 数量: {{ order.quantity }}箱

应收金额: ¥{{ order.total_amount }}

{% endif %} {% if page == 'pay_purchase' %}

💸 采购付款

采购单 #{{ order.id }}

商品: {{ order.product[:30] }} | 数量: {{ order.quantity }}箱

应付金额: ¥{{ order.total_amount }}

{% endif %} {% if page == 'pay_expense' %}

💳 费用支付

费用单 #{{ expense.id }}

类型: {{ expense.type }} | 日期: {{ expense.date }}

说明: {{ expense.description }}

应付金额: ¥{{ "{:,.0f}".format(expense.amount) }}

{% endif %} {% if page == 'backup' %}

💾 数据备份

点击下方按钮可备份所有数据(库存、销售、采购、客户等)

备份系统文件(不含数据):

📂 备份历史

{% if backups %} {% for b in backups %}{% endfor %}
文件名大小创建时间操作
{{ b.name }}{{ b.size }}{{ b.time }}
{% else %}

暂无备份记录

{% endif %}
{% endif %}