diff --git a/config/business_navigation.php b/config/business_navigation.php index 88ae629f..3e517fb9 100644 --- a/config/business_navigation.php +++ b/config/business_navigation.php @@ -554,6 +554,7 @@ $navigation = [ ['slug' => 'dewu', 'title' => '得物账户'], ['slug' => 'vipshop', 'title' => '唯品会MP账户'], ['slug' => 'vipshop-jx', 'title' => '唯品会JX账户'], + ['slug' => 'promotion-marketing', 'title' => '推广费(营销账户)'], ], ], [ diff --git a/modules/EcommerceFinance/Http/Controllers/AccountBills.php b/modules/EcommerceFinance/Http/Controllers/AccountBills.php index 1386aa87..795c1315 100644 --- a/modules/EcommerceFinance/Http/Controllers/AccountBills.php +++ b/modules/EcommerceFinance/Http/Controllers/AccountBills.php @@ -40,6 +40,10 @@ class AccountBills extends Controller $billType = $bill_type; + if ($billType === 'promotion-marketing') { + return $this->promotionMarketingIndex($request); + } + if (! AccountBillColumns::has($billType)) { abort(404, '未知的账户类型。'); } @@ -109,6 +113,78 @@ class AccountBills extends Controller return response()->json($this->withLedgerRemarks($data, $billType)); } + /** + * 推广费(营销账户)页签的固定响应结构。 + * + * 各平台取数口径尚未配置,先返回明确的空结果与店铺明细列定义;后续接入时 + * 只替换这里的数据来源,不改页签、卡片和弹窗契约。 + */ + private function promotionMarketingIndex(Request $request) + { + $page = max(1, (int) $request->get('page', 1)); + $limit = min(max((int) $request->get('limit', 10), 1), 100); + + return response()->json([ + 'data' => [], + 'total' => 0, + 'current_page' => $page, + 'last_page' => 1, + 'per_page' => $limit, + 'summary' => [ + 'income' => 0, + 'expense' => 0, + 'balance' => 0, + 'count' => 0, + ], + 'columns' => [ + 'title' => '推广费(营销账户)', + 'groups' => [], + 'columns' => self::promotionExpenseDetailColumns(), + ], + ]); + } + + /** + * 推广费(营销账户)的店铺明细。当前先提供统一空结果,待逐平台取数口径 + * 确定后由专用 Repository 填充;筛选参数与主账单页保持一致。 + */ + public function promotionExpenseDetails(Request $request, string $bill_type) + { + abort_unless($bill_type === 'promotion-marketing', 404); + $this->authorizeStoreReceivingBills(); + + $request->validate([ + 'store_name' => ['nullable', 'string', 'max:255'], + 'ledger_remark' => ['nullable', 'string', 'max:191'], + 'bill_item' => ['nullable', 'string', 'max:255'], + 'start' => ['nullable', 'date_format:Y-m-d'], + 'end' => ['nullable', 'date_format:Y-m-d', 'after_or_equal:start'], + 'keyword' => ['nullable', 'string', 'max:255'], + ]); + + return response()->json([ + 'data' => [], + 'total' => 0, + 'summary' => [ + 'expense' => 0, + 'count' => 0, + ], + 'columns' => self::promotionExpenseDetailColumns(), + 'message' => '推广费数据源尚未配置,接入后将按当前筛选显示店铺明细。', + ]); + } + + /** @return array */ + private static function promotionExpenseDetailColumns(): array + { + return [ + ['label' => '店铺名称', 'field' => 'store_name', 'kind' => 'text'], + ['label' => '交易时间', 'field' => 'occurred_at', 'kind' => 'date'], + ['label' => '备注', 'field' => 'notes', 'kind' => 'text'], + ['label' => '支出金额', 'field' => 'expense', 'kind' => 'money'], + ]; + } + public function export(Request $request, string $bill_type) { $this->authorizeStoreReceivingBills(); diff --git a/resources/assets/js/components/business/AccountBills.vue b/resources/assets/js/components/business/AccountBills.vue index 7307cba6..cbbef0b4 100644 --- a/resources/assets/js/components/business/AccountBills.vue +++ b/resources/assets/js/components/business/AccountBills.vue @@ -1,7 +1,80 @@