<?php
$moduleName     = $this->currentRoute()->getModule();
$controllerName = $this->currentRoute()->getController();
$actionName     = $this->currentRoute()->getAction();

$menuArray = [
    'Admin' => [
        'name'  => $this->translate('系统'),
        'url'   => $this->url('admin'),

        'AdminController' => [
            'name'  => $this->translate('管理员'),
            'url'   => $this->url('admin'),

            'index'   => [
                'name'  => $this->translate('管理员列表'),
            ],
            'add'   => [
                'name'  => $this->translate('添加管理员'),
            ],
            'edit'  => [
                'name'  => $this->translate('编辑管理员'),
            ],
            'delete'    => [
                'name'  => $this->translate('删除管理员'),
            ],
            'changePassword'    => [
                'name'  => $this->translate('修改密码'),
            ]
        ],

        'AdminGroupController' => [
            'name'  => $this->translate('管理员组'),
            'url'   => $this->url('admin'),

            'adminGroupList'   => [
                'name'  => $this->translate('管理员组列表'),
            ],
            'addAdminGroup'   => [
                'name'  => $this->translate('添加管理员组'),
            ],
            'editAdminGroup'  => [
                'name'  => $this->translate('编辑管理员组'),
            ],
            'deleteAdminGroup'    => [
                'name'  => $this->translate('删除管理员组'),
            ]
        ],

        'RegionController' => [
            'name'  => $this->translate('地区管理'),
            'url'   => $this->url('brand'),

            'index' => [
                'name'  => $this->translate('地区列表')
            ],
            'add'   => [
                'name'  => $this->translate('添加地区')
            ],
            'edit'  => [
                'name'  => $this->translate('编辑地区')
            ],
            'delete'=> [
                'name'  => $this->translate('删除地区')
            ]
        ],

        'AppController' => [
            'name'  => $this->translate('商城绑定'),
            'url'   => $this->url('app'),

            'index' => [
                'name'  => $this->translate('商城列表')
            ],
            'add'   => [
                'name'  => $this->translate('添加商城')
            ],
            'edit'  => [
                'name'  => $this->translate('编辑应用')
            ],
            'delete'=> [
                'name'  => $this->translate('删除商城')
            ]
        ],

        'OperLogController' => [
            'name'  => $this->translate('操作日志'),
            'url'   => $this->url('oper-log'),

            'index' => [
                'name'  => $this->translate('日志列表')
            ]
        ],

        'SystemController' => [
            'name'  => $this->translate('系统设置'),
            'url'   => $this->url('admin-system')
        ]

    ],

    'Store' => [
        'name'  => $this->translate('基础数据'),
        'url'   => '',

        'GoodsController' => [
            'name'  => $this->translate('商品'),
            'url'   => $this->url('goods'),

            'index' => [
                'name'  => $this->translate('商品列表')
            ],
            'add'   => [
                'name'  => $this->translate('添加商品')
            ],
            'edit'  => [
                'name'  => $this->translate('编辑商品')
            ],
            'delete'=> [
                'name'  => $this->translate('删除商品')
            ],
            'priceTrend'=> [
                'name'  => $this->translate('采购价格趋势')
            ],
            'goodsWarehouse'=> [
                'name'  => $this->translate('商品分布')
            ]
        ],

        'GoodsCategoryController' => [
            'name'  => $this->translate('商品分类'),
            'url'   => $this->url('brand'),

            'index' => [
                'name'  => $this->translate('商品分类列表')
            ],
            'add'   => [
                'name'  => $this->translate('添加商品分类')
            ],
            'edit'  => [
                'name'  => $this->translate('编辑商品分类')
            ],
            'delete'=> [
                'name'  => $this->translate('删除商品分类')
            ]
        ],

        'BrandController' => [
            'name'  => $this->translate('商品品牌'),
            'url'   => $this->url('brand'),

            'index' => [
                'name'  => $this->translate('品牌列表')
            ],
            'add'   => [
                'name'  => $this->translate('添加品牌')
            ],
            'edit'  => [
                'name'  => $this->translate('编辑品牌')
            ],
            'delete'=> [
                'name'  => $this->translate('删除品牌')
            ]
        ],

        'PositionController' => [
            'name'  => $this->translate('仓位'),
            'url'   => $this->url('position'),

            'index' => [
                'name'  => $this->translate('仓位列表')
            ],
            'add'   => [
                'name'  => $this->translate('添加仓位')
            ],
            'edit'  => [
                'name'  => $this->translate('编辑仓位')
            ],
            'delete'=> [
                'name'  => $this->translate('删除仓位')
            ]
        ],

        'UnitController' => [
            'name'  => $this->translate('计量单位'),
            'url'   => $this->url('unit'),

            'index' => [
                'name'  => $this->translate('单位列表')
            ],
            'add'   => [
                'name'  => $this->translate('添加单位')
            ],
            'edit'  => [
                'name'  => $this->translate('编辑单位')
            ],
            'delete'=> [
                'name'  => $this->translate('删除单位')
            ]
        ],

        'WarehouseController' => [
            'name'  => $this->translate('仓库'),
            'url'   => $this->url('warehouse'),

            'index' => [
                'name'  => $this->translate('仓库列表')
            ],
            'add'   => [
                'name'  => $this->translate('添加仓库')
            ],
            'edit'  => [
                'name'  => $this->translate('编辑仓库')
            ],
            'delete'=> [
                'name'  => $this->translate('删除仓库')
            ]
        ]
    ],

    'Purchase' => [
        'name' => $this->translate('采购'),
        'url'  => '',

        'OrderController' => [
            'name' => $this->translate('采购订单'),
            'url'  => $this->url('p-order'),

            'index' => [
                'name'  => $this->translate('采购订单列表')
            ],
            'add'   => [
                'name'  => $this->translate('添加采购订单')
            ],
            'edit'  => [
                'name'  => $this->translate('编辑采购订单')
            ],
            'view'  => [
                'name'  => $this->translate('查看采购订单')
            ],
            'delete'=> [
                'name'  => $this->translate('删除采购订单')
            ]
        ],

        'OrderReturnController' => [
            'name'  => $this->translate('采购退货单'),
            'url'   => $this->url('order-return'),

            'index' => [
                'name' => $this->translate('采购退货单列表')
            ],
            'view'  => [
                'name' => $this->translate('采购退货详情')
            ],
            'returnOrder' => [
                'name' => $this->translate('采购退货')
            ]

        ],
        'WarehouseOrderController' => [
            'name'  => $this->translate('采购入库订单'),
            'url'   => $this->url('warehouse-order'),

            'index' => [
                'name'  => $this->translate('采购入库单列表')
            ],
            'add'   => [
                'name'  => $this->translate('添加采购入库单')
            ],
            'edit'  => [
                'name'  => $this->translate('编辑采购入库单')
            ],
            'view'  => [
                'name'  => $this->translate('订单详情')
            ],
            'delete'=> [
                'name'  => $this->translate('删除采购入库单')
            ]
        ]
    ],

    'Customer' => [
        'name'  => $this->translate('客户'),
        'url'   => '',

        'CustomerController' => [
            'name'  => $this->translate('客户'),
            'url'   => $this->url('customer'),

            'index' => [
                'name'  => $this->translate('客户列表')
            ],
            'add'   => [
                'name'  => $this->translate('添加客户')
            ],
            'edit'  => [
                'name'  => $this->translate('编辑客户')
            ],
            'delete'=> [
                'name'  => $this->translate('删除客户')
            ]
        ],

        'CustomerCategoryController' => [
            'name'  => $this->translate('客户分类'),
            'url'   => $this->url('customer-category'),

            'index' => [
                'name'  => $this->translate('客户分类列表')
            ],
            'add'   => [
                'name'  => $this->translate('添加客户分类')
            ],
            'edit'  => [
                'name'  => $this->translate('编辑客户分类')
            ],
            'delete'=> [
                'name'  => $this->translate('删除客户分类')
            ]
        ],

        'SupplierController' => [
            'name'  => $this->translate('供应商'),
            'url'   => $this->url('supplier'),

            'index' => [
                'name'  => $this->translate('供应商列表')
            ],
            'add'   => [
                'name'  => $this->translate('添加供应商')
            ],
            'edit'  => [
                'name'  => $this->translate('编辑供应商')
            ],
            'delete'=> [
                'name'  => $this->translate('删除供应商')
            ]
        ],

        'SupplierCategoryController' => [
            'name'  => $this->translate('供应商分类'),
            'url'   => $this->url('supplier-category'),

            'index' => [
                'name'  => $this->translate('供应商分类列表')
            ],
            'add'   => [
                'name'  => $this->translate('添加供应商分类')
            ],
            'edit'  => [
                'name'  => $this->translate('编辑供应商分类')
            ],
            'delete'=> [
                'name'  => $this->translate('删除供应商分类')
            ]
        ],

    ],

    'Finance' => [
        'name'  => $this->translate('资金'),
        'url'   => '',

        'PayableController' => [
            'name' => $this->translate('应付账款'),
            'url'  => $this->url('finance-payable'),

            'index' => [
                'name' => $this->translate('应付账款列表')
            ],
            'show'  => [
                'name' => $this->translate('应付账款详情')
            ],
            'addPayable' => [
                'name' => $this->translate('付款操作')
            ],
            'payableLog' => [
                'name' => $this->translate('付款记录')
            ]
        ],
        'ReceivablesController' => [
            'name' => $this->translate('应收账款'),
            'url'  => $this->url('accounts-receivable'),

            'index' => [
                'name' => $this->translate('应收账款列表')
            ],
            'show'  => [
                'name' => $this->translate('应收账款详情')
            ],
            'addReceivable' => [
                'name' => $this->translate('收款操作')
            ],
            'receivableLog' => [
                'name' => $this->translate('收款记录')
            ]
        ]
    ],

    'Sales' => [
        'name'  => $this->translate('销售'),
        'url'   => '',

        'SalesOrderController' => [
            'name'  => $this->translate('销售订单'),
            'url'   => $this->url('sales-order'),

            'index' => [
                'name' => $this->translate('销售订单列表')
            ],
            'view'  => [
                'name' => $this->translate('销售订单详情')
            ],
            'add'   => [
                'name' => $this->translate('添加销售订单')
            ],
            'edit'  => [
                'name' => $this->translate('编辑销售订单')
            ],
            'sendOrder'  => [
                'name' => $this->translate('订单发货出库')
            ]
        ],

        'SalesSendOrderController' => [
            'name'  => $this->translate('销售发货单'),
            'url'   => $this->url('sales-send-order'),

            'index' => [
                'name' => $this->translate('销售发货单列表')
            ],
            'view'  => [
                'name' => $this->translate('发货订单详情')
            ]
        ],

        'SalesOrderReturnController' => [
            'name'  => $this->translate('销售退货单'),
            'url'   => $this->url('sales-order-return'),

            'index' => [
                'name' => $this->translate('销售退货单列表')
            ],
            'add'  => [
                'name' => $this->translate('销售退货')
            ],
            'view'  => [
                'name' => $this->translate('销售退货单详情')
            ]
        ]
    ],

    'Shop' => [
        'name'  => $this->translate('商城'),
        'url'   => '',

        'IndexController' => [
            'name'  => $this->translate('商城订单'),
            'url'   => $this->url('app-shop'),

            'index' => [
                'name' => $this->translate('订单列表')
            ],
            'view'  => [
                'name' => $this->translate('商城订单详情')
            ]
        ],

        'OrderGoodsController' => [
            'name'  => $this->translate('商城订单'),
            'url'   => $this->url('app-shop-order-goods'),

            'index' => [
                'name' => $this->translate('订单商品列表')
            ]
        ],
    ],

    'Stock' => [
        'name'  => $this->translate('库存'),
        'url'   => '',

        'IndexController' => [
            'name'  => $this->translate('其他入库'),
            'url'   => $this->url('erp-stock'),

            'index' => [
                'name' => $this->translate('入库列表')
            ],
            'add' => [
                'name' => $this->translate('添加入库')
            ],
            'view' => [
                'name' => $this->translate('查看详情')
            ]
        ],
        'StockCheckController' => [
            'name'  => $this->translate('库存盘点'),
            'url'   => $this->url('erp-stock'),

            'index' => [
                'name' => $this->translate('盘点列表')
            ],
            'add' => [
                'name' => $this->translate('添加盘点')
            ],
            'edit' => [
                'name' => $this->translate('编辑盘点')
            ],
            'del' => [
                'name' => $this->translate('删除盘点')
            ],
            'view' => [
                'name' => $this->translate('盘点详情')
            ]
        ]
    ],

    'Report' => [
        'name'  => $this->translate('报表'),
        'url'   => '',

        'IndexController' => [
            'name'  => $this->translate('销售'),
            'url'   => $this->url('report'),
        ],
        'ReportStockController' => [
            'name'  => $this->translate('库存'),
            'url'   => $this->url('report-stock'),
        ],
        'ReportPurchaseController' => [
            'name'  => $this->translate('采购'),
            'url'   => $this->url('report-purchase'),
        ],
        'ReportFinanceController' => [
            'name'  => $this->translate('采购'),
            'url'   => $this->url('report-finance'),
        ]
    ]

];

?>
<ol class="breadcrumb">
    <a href="<?=$this->url('home');?>"><i class="fa fa-dashboard"></i></a>
    <?php if(isset($menuArray[$moduleName])) { ?>
        <li><a href="<?=$menuArray[$moduleName]['url']?>"><?=$menuArray[$moduleName]['name']?></a></li>

        <?php if(isset($menuArray[$moduleName][$controllerName])) { ?>
            <li><a href="<?=$menuArray[$moduleName][$controllerName]['url']?>"><?=$menuArray[$moduleName][$controllerName]['name']?></a></li>

            <?php if(isset($menuArray[$moduleName][$controllerName][$actionName])) { ?>
                <li class="active"><?=$menuArray[$moduleName][$controllerName][$actionName]['name']?></li>
            <?php } ?>

        <?php } ?>

    <?php } ?>
</ol>
