fix: 修复OA流程通用路由内容解析
This commit is contained in:
parent
12f9ee5c76
commit
1083d9485c
@ -4693,6 +4693,7 @@ class Pages extends Controller
|
||||
'online-daifa-price' => $this->contentForOnlineDaifaPrice(),
|
||||
'product-costs' => $this->contentForProductCosts(),
|
||||
'financial-analysis' => $this->contentForFinancialAnalysis(),
|
||||
'oa-process' => $this->contentForProcessDetails(),
|
||||
'labor-expenses' => $this->contentForLaborExpenses(),
|
||||
'courier-surcharge' => $this->contentForCourierSurcharge($tab),
|
||||
'courier-surcharge-settlement' => $this->contentForCourierSurchargeSettlementPage(),
|
||||
@ -4722,6 +4723,17 @@ class Pages extends Controller
|
||||
};
|
||||
}
|
||||
|
||||
protected function contentForProcessDetails(): array
|
||||
{
|
||||
$data = app(\Modules\EcommerceFinance\View\ProcessDetailsPageData::class)->page(request());
|
||||
$data['view'] = 'business.pages.financial-operations.process-details-content';
|
||||
$data['scopeLabel'] = ($data['scope'] ?? null) === 'personal_permission'
|
||||
? '当前账号权限范围'
|
||||
: ($data['scope'] ?? '');
|
||||
|
||||
return $data;
|
||||
}
|
||||
|
||||
protected function contentForLaborExpenses(): array
|
||||
{
|
||||
return [
|
||||
|
||||
@ -1,7 +1,27 @@
|
||||
@php
|
||||
$filters ??= [];
|
||||
$summary ??= [];
|
||||
$documentTypes ??= [];
|
||||
$statuses ??= [];
|
||||
$error ??= null;
|
||||
$paymentStates = $paymentStates ?? ($pageData['paymentStates'] ?? []);
|
||||
$mirrorStale = $mirrorStale ?? ($pageData['mirrorStale'] ?? false);
|
||||
$mirrorStaleAfterMinutes = $mirrorStaleAfterMinutes ?? ($pageData['mirrorStaleAfterMinutes'] ?? 15);
|
||||
$scopeLabel ??= (($scope ?? null) === 'personal_permission'
|
||||
? '当前账号权限范围'
|
||||
: ($scope ?? ''));
|
||||
$money ??= static fn (mixed $value): string => $value === null || $value === ''
|
||||
? '-'
|
||||
: number_format((float) $value, 2);
|
||||
$text ??= static fn (mixed $value): string => $value === null || trim((string) $value) === ''
|
||||
? '-'
|
||||
: (string) $value;
|
||||
$statusClass ??= static fn (string $status): string => match ($status) {
|
||||
'已完成' => 'is-success',
|
||||
'审批中' => 'is-warning',
|
||||
'已终止', '已撤销' => 'is-danger',
|
||||
default => 'is-neutral',
|
||||
};
|
||||
$paymentStateClass = static fn (string $state): string => match ($state) {
|
||||
'出纳已打款' => 'is-success',
|
||||
'出纳待打款', '出纳退回' => 'is-warning',
|
||||
@ -9,6 +29,16 @@
|
||||
'出纳未开始', '流程终止', '不涉及付款' => 'is-neutral',
|
||||
default => 'is-neutral',
|
||||
};
|
||||
$pageUrl ??= route('business.pages.show', [
|
||||
'section' => 'process-data',
|
||||
'page' => 'oa-process',
|
||||
]);
|
||||
$exportFilters = array_filter(
|
||||
$filters,
|
||||
static fn (mixed $value): bool => $value !== '' && $value !== null,
|
||||
);
|
||||
$exportUrl ??= url('/' . company_id() . '/workspace/process-data/oa-process/export')
|
||||
. ($exportFilters === [] ? '' : '?' . http_build_query($exportFilters));
|
||||
@endphp
|
||||
|
||||
<style>
|
||||
|
||||
@ -30,6 +30,9 @@ class ProcessDetailsPageDataTest extends TestCase
|
||||
$this->assertStringContainsString('class="process-details-table-card"', $content);
|
||||
$this->assertStringContainsString('class="process-details-pagination"', $content);
|
||||
$this->assertStringContainsString('class="process-details-page-jump"', $content);
|
||||
$this->assertStringContainsString('$pageUrl ??=', $content);
|
||||
$this->assertStringContainsString('$exportUrl ??=', $content);
|
||||
$this->assertStringContainsString('$statusClass ??=', $content);
|
||||
$this->assertStringNotContainsString('$processRows->links()', $content);
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user