diff --git a/modules/EcommerceFinance/Http/Controllers/AlipayBills.php b/modules/EcommerceFinance/Http/Controllers/AlipayBills.php index ab0e08c1..9e091acc 100644 --- a/modules/EcommerceFinance/Http/Controllers/AlipayBills.php +++ b/modules/EcommerceFinance/Http/Controllers/AlipayBills.php @@ -85,6 +85,27 @@ class AlipayBills extends Controller } } + public function filterOptions(StoreReceivingAlipayBillMirrorRepository $repository) + { + $this->authorizeStoreReceivingBills(); + + try { + return response()->json($repository->filterOptionsForChannel( + 'alipayCSV', StoreReceivingAlipayBillMirrorRepository::DATASET, true + )); + } catch (RuntimeException $exception) { + if ($exception->getMessage() !== 'store_receiving_alipay_bill_mirror_not_ready') { + throw $exception; + } + + return response()->json([ + 'message' => '淘系支付宝账单共享业务镜像正在首次同步,筛选选项稍后可用。', + 'shops' => [], + 'bill_items' => [], + ], 503); + } + } + public function export(Request $request, StoreReceivingAlipayBillMirrorRepository $repository) { $this->authorizeStoreReceivingBills(); diff --git a/modules/EcommerceFinance/Repositories/StoreReceivingAlipayBillMirrorRepository.php b/modules/EcommerceFinance/Repositories/StoreReceivingAlipayBillMirrorRepository.php index 843b31e7..1d433ca9 100644 --- a/modules/EcommerceFinance/Repositories/StoreReceivingAlipayBillMirrorRepository.php +++ b/modules/EcommerceFinance/Repositories/StoreReceivingAlipayBillMirrorRepository.php @@ -182,7 +182,7 @@ class StoreReceivingAlipayBillMirrorRepository } /** @return array{shops:array,bill_items:array} */ - public function filterOptionsForChannel(string|array $channel, string $datasetKey = self::DATASET): array + public function filterOptionsForChannel(string|array $channel, string $datasetKey = self::DATASET, bool $excludeNonTaobaoPlatforms = false): array { $dataset = $this->datasets->get($datasetKey); if (! $this->mirror->ready($dataset) @@ -192,6 +192,9 @@ class StoreReceivingAlipayBillMirrorRepository $channelQuery = $this->billQuery($dataset->targetTable()); $this->applyChannel($channelQuery, $channel, $dataset->fixedFilters()); + if ($excludeNonTaobaoPlatforms) { + $this->applyTaobaoPlatformScope($channelQuery); + } $shopIds = (clone $channelQuery) ->whereNotNull('b.shop_id') diff --git a/resources/assets/js/components/business/AccountBills.vue b/resources/assets/js/components/business/AccountBills.vue index ae2479a1..e2c23da4 100644 --- a/resources/assets/js/components/business/AccountBills.vue +++ b/resources/assets/js/components/business/AccountBills.vue @@ -84,7 +84,7 @@ export default { // Every account-bill tab uses the same explicit picker path. Keeping one // control avoids browser-native date inputs appearing on older tabs. usesStableDateControl(){return true;}, - usesMirrorOptions(){return ['douyin','pinduoduo','dewu','jd-transactions','jd-wallet','vipshop'].indexOf(this.billType)!==-1;}, + usesMirrorOptions(){return ['douyin','pinduoduo','dewu','taobao-wechat','jd-transactions','jd-wallet','vipshop'].indexOf(this.billType)!==-1;}, invalidDateRange(){return Boolean(this.filters.start&&this.filters.end&&this.filters.start>this.filters.end);}, startDateConfig(){return {...dateConfig,maxDate:this.filters.end||null};}, endDateConfig(){return {...dateConfig,minDate:this.filters.start||null};}, diff --git a/resources/assets/js/components/business/TaobaoAlipayBills.vue b/resources/assets/js/components/business/TaobaoAlipayBills.vue index 98afe930..e6c3c55f 100644 --- a/resources/assets/js/components/business/TaobaoAlipayBills.vue +++ b/resources/assets/js/components/business/TaobaoAlipayBills.vue @@ -9,13 +9,40 @@
- + - + - +
+ 发生时间 +
+ + + + + + 至 + + + + + +
+
-
+
+ +
@@ -68,6 +95,12 @@