feat: 优化OA流程筛选与口径展示 #791
@ -30,7 +30,7 @@ class ProcessDetails extends Controller
|
||||
return $this->refreshStatus((string) $request->query('refresh_status'));
|
||||
}
|
||||
|
||||
$filters = $this->filters($request);
|
||||
$filters = ProcessDetailsPageData::normalizeFilters($request);
|
||||
$page = max((int) $request->query('page', 1), 1);
|
||||
$perPage = ProcessDetailsPageData::normalizePerPage($request->query('per_page'));
|
||||
$paginationQuery = array_filter(
|
||||
@ -110,7 +110,7 @@ class ProcessDetails extends Controller
|
||||
->withErrors(['export' => 'OA流程镜像尚未完成导入,暂时不能导出。']);
|
||||
}
|
||||
|
||||
$filters = $this->filters($request);
|
||||
$filters = ProcessDetailsPageData::normalizeFilters($request);
|
||||
|
||||
return response()->streamDownload(function () use ($filters): void {
|
||||
$stream = fopen('php://output', 'wb');
|
||||
@ -192,30 +192,4 @@ class ProcessDetails extends Controller
|
||||
->header('Cache-Control', 'no-store');
|
||||
}
|
||||
|
||||
/** @return array<string,string> */
|
||||
private function filters(Request $request): array
|
||||
{
|
||||
$status = DingProcessDetailMirrorRepository::normalizeStatusFilter(
|
||||
$request->query('status', ''),
|
||||
);
|
||||
[$paidStart, $paidEnd] = ProcessDetailsPageData::normalizePaidDateRange(
|
||||
$request->query('paid_start'),
|
||||
$request->query('paid_end'),
|
||||
$request->query('paid_date'),
|
||||
);
|
||||
$paymentState = DingProcessDetailMirrorRepository::normalizePaymentStateFilter(
|
||||
$request->query('payment_state'),
|
||||
);
|
||||
|
||||
return [
|
||||
'paid_start' => $paidStart,
|
||||
'paid_end' => $paidEnd,
|
||||
'document_type' => mb_substr(trim((string) $request->query('document_type', '')), 0, 100),
|
||||
'status' => mb_substr($status, 0, 20),
|
||||
'payment_state' => $paymentState,
|
||||
'business_id' => mb_substr(trim((string) $request->query('business_id', '')), 0, 32),
|
||||
'originator_name' => mb_substr(trim((string) $request->query('originator_name', '')), 0, 100),
|
||||
'keyword' => mb_substr(trim((string) $request->query('keyword', '')), 0, 100),
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
@ -336,6 +336,28 @@ class DingProcessDetailMirrorRepository
|
||||
);
|
||||
}
|
||||
|
||||
$entryStart = $this->filterDate($filters['entry_start'] ?? '');
|
||||
$entryEnd = $this->filterDate($filters['entry_end'] ?? '');
|
||||
if ($entryStart !== '' && $entryEnd !== '' && $entryStart > $entryEnd) {
|
||||
[$entryStart, $entryEnd] = [$entryEnd, $entryStart];
|
||||
}
|
||||
if ($entryStart !== '') {
|
||||
$query->where(
|
||||
'ding_process_detail_mirror.current_task_started_at',
|
||||
'>=',
|
||||
$entryStart . ' 00:00:00',
|
||||
);
|
||||
}
|
||||
if ($entryEnd !== '') {
|
||||
$query->where(
|
||||
'ding_process_detail_mirror.current_task_started_at',
|
||||
'<',
|
||||
Carbon::createFromFormat('Y-m-d', $entryEnd)
|
||||
->addDay()
|
||||
->format('Y-m-d 00:00:00'),
|
||||
);
|
||||
}
|
||||
|
||||
foreach ([
|
||||
'document_type' => 'document_type',
|
||||
'status' => 'status',
|
||||
@ -352,6 +374,7 @@ class DingProcessDetailMirrorRepository
|
||||
foreach ([
|
||||
'business_id' => 'business_id',
|
||||
'originator_name' => 'originator_name',
|
||||
'current_approver_name' => 'current_approver_name',
|
||||
'keyword' => 'purpose',
|
||||
] as $filter => $column) {
|
||||
$value = mb_substr(trim((string) ($filters[$filter] ?? '')), 0, 100);
|
||||
|
||||
@ -27,7 +27,7 @@ class ProcessDetailsPageData
|
||||
}
|
||||
|
||||
/** @return array{0:string,1:string} */
|
||||
public static function normalizePaidDateRange(
|
||||
public static function normalizeDateRange(
|
||||
mixed $start,
|
||||
mixed $end,
|
||||
mixed $legacyDate = '',
|
||||
@ -46,10 +46,19 @@ class ProcessDetailsPageData
|
||||
return [$start, $end];
|
||||
}
|
||||
|
||||
/** @return array{0:string,1:string} */
|
||||
public static function normalizePaidDateRange(
|
||||
mixed $start,
|
||||
mixed $end,
|
||||
mixed $legacyDate = '',
|
||||
): array {
|
||||
return self::normalizeDateRange($start, $end, $legacyDate);
|
||||
}
|
||||
|
||||
/** @return array<string,mixed> */
|
||||
public function page(Request $request): array
|
||||
{
|
||||
$filters = $this->filters($request);
|
||||
$filters = self::normalizeFilters($request);
|
||||
$page = max((int) $request->query('page', 1), 1);
|
||||
$perPage = self::normalizePerPage($request->query('per_page'));
|
||||
$paginationQuery = array_filter(
|
||||
@ -115,7 +124,7 @@ class ProcessDetailsPageData
|
||||
}
|
||||
|
||||
/** @return array<string,string> */
|
||||
private function filters(Request $request): array
|
||||
public static function normalizeFilters(Request $request): array
|
||||
{
|
||||
$status = DingProcessDetailMirrorRepository::normalizeStatusFilter(
|
||||
$request->query('status', ''),
|
||||
@ -125,6 +134,10 @@ class ProcessDetailsPageData
|
||||
$request->query('paid_end'),
|
||||
$request->query('paid_date'),
|
||||
);
|
||||
[$entryStart, $entryEnd] = self::normalizeDateRange(
|
||||
$request->query('entry_start'),
|
||||
$request->query('entry_end'),
|
||||
);
|
||||
$paymentState = DingProcessDetailMirrorRepository::normalizePaymentStateFilter(
|
||||
$request->query('payment_state'),
|
||||
);
|
||||
@ -137,6 +150,9 @@ class ProcessDetailsPageData
|
||||
'payment_state' => $paymentState,
|
||||
'business_id' => mb_substr(trim((string) $request->query('business_id', '')), 0, 32),
|
||||
'originator_name' => mb_substr(trim((string) $request->query('originator_name', '')), 0, 100),
|
||||
'current_approver_name' => mb_substr(trim((string) $request->query('current_approver_name', '')), 0, 100),
|
||||
'entry_start' => $entryStart,
|
||||
'entry_end' => $entryEnd,
|
||||
'keyword' => mb_substr(trim((string) $request->query('keyword', '')), 0, 100),
|
||||
];
|
||||
}
|
||||
|
||||
@ -70,6 +70,7 @@
|
||||
$filters,
|
||||
static fn (mixed $value): bool => $value !== '' && $value !== null,
|
||||
);
|
||||
$activeFilterCount = count($exportFilters);
|
||||
$exportUrl ??= url('/' . company_id() . '/workspace/process-data/oa-process/export')
|
||||
. ($exportFilters === [] ? '' : '?' . http_build_query($exportFilters));
|
||||
@endphp
|
||||
@ -124,16 +125,67 @@
|
||||
}
|
||||
|
||||
.process-details-toolbar {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(12, minmax(0, 1fr));
|
||||
align-items: flex-end;
|
||||
gap: .8rem 1rem;
|
||||
padding: 1rem;
|
||||
overflow: visible;
|
||||
border: 1px solid var(--vip-border, #D8D2C7);
|
||||
border-radius: .75rem;
|
||||
background: var(--vip-surface, #fff);
|
||||
}
|
||||
|
||||
.process-details-filter-heading {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
gap: .75rem 1rem;
|
||||
min-height: 2.75rem;
|
||||
padding: .65rem 1rem;
|
||||
border-bottom: 1px solid var(--vip-border, #D8D2C7);
|
||||
background: #fffdf8;
|
||||
}
|
||||
|
||||
.process-details-filter-heading__title {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
gap: .4rem;
|
||||
color: var(--vip-content-ink, #171717);
|
||||
font-size: .8125rem;
|
||||
font-weight: 700;
|
||||
}
|
||||
|
||||
.process-details-filter-heading__title .material-icons-outlined {
|
||||
color: var(--vip-content-accent-dark, #856632);
|
||||
font-size: 1.05rem;
|
||||
}
|
||||
|
||||
.process-details-filter-heading__summary {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
gap: .35rem;
|
||||
color: var(--vip-content-muted, #595959);
|
||||
font-size: .72rem;
|
||||
}
|
||||
|
||||
.process-details-filter-count {
|
||||
display: inline-flex;
|
||||
min-width: 1.35rem;
|
||||
height: 1.35rem;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
padding: 0 .35rem;
|
||||
border-radius: 999px;
|
||||
background: var(--vip-content-accent-soft, #F7F0DE);
|
||||
color: var(--vip-content-accent-dark, #856632);
|
||||
font-variant-numeric: tabular-nums;
|
||||
font-weight: 700;
|
||||
}
|
||||
|
||||
.process-details-filter-grid {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(12, minmax(0, 1fr));
|
||||
align-items: end;
|
||||
gap: .8rem 1rem;
|
||||
padding: 1rem;
|
||||
}
|
||||
|
||||
.process-details-field {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
@ -143,19 +195,23 @@
|
||||
}
|
||||
|
||||
.process-details-field.is-wide {
|
||||
grid-column: span 3;
|
||||
}
|
||||
|
||||
.process-details-field.is-date-range {
|
||||
grid-column: span 4;
|
||||
}
|
||||
|
||||
.process-details-field.is-business {
|
||||
grid-column: span 2;
|
||||
}
|
||||
|
||||
.process-details-field.is-date-range {
|
||||
grid-column: span 5;
|
||||
}
|
||||
|
||||
.process-details-field.is-business {
|
||||
grid-column: span 3;
|
||||
}
|
||||
|
||||
.process-details-field.is-approver {
|
||||
grid-column: span 3;
|
||||
}
|
||||
|
||||
.process-details-field.is-keyword {
|
||||
grid-column: span 6;
|
||||
grid-column: span 8;
|
||||
}
|
||||
|
||||
.process-details-field label {
|
||||
@ -287,11 +343,61 @@
|
||||
font-variant-numeric: tabular-nums;
|
||||
}
|
||||
|
||||
.process-details-note {
|
||||
margin: -.2rem .25rem 0;
|
||||
.process-details-note-disclosure {
|
||||
margin: -.35rem 0 0;
|
||||
border: 1px solid rgba(185, 149, 79, .34);
|
||||
border-radius: .5rem;
|
||||
background: rgba(255, 253, 248, .82);
|
||||
}
|
||||
|
||||
.process-details-note-disclosure summary {
|
||||
display: flex;
|
||||
min-height: 2.4rem;
|
||||
align-items: center;
|
||||
gap: .4rem;
|
||||
padding: .5rem .75rem;
|
||||
color: var(--vip-content-muted, #595959);
|
||||
font-size: .75rem;
|
||||
line-height: 1.6;
|
||||
font-weight: 600;
|
||||
list-style: none;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.process-details-note-disclosure summary::-webkit-details-marker {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.process-details-note-disclosure summary .material-icons-outlined {
|
||||
color: var(--vip-content-accent-dark, #856632);
|
||||
font-size: 1rem;
|
||||
}
|
||||
|
||||
.process-details-note-disclosure summary::after {
|
||||
content: '展开';
|
||||
margin-left: auto;
|
||||
color: var(--vip-content-accent-dark, #856632);
|
||||
font-size: .7rem;
|
||||
font-weight: 500;
|
||||
}
|
||||
|
||||
.process-details-note-disclosure[open] summary {
|
||||
border-bottom: 1px solid rgba(185, 149, 79, .24);
|
||||
color: var(--vip-content-ink, #171717);
|
||||
}
|
||||
|
||||
.process-details-note-disclosure[open] summary::after {
|
||||
content: '收起';
|
||||
}
|
||||
|
||||
.process-details-note-content {
|
||||
padding: .7rem .8rem .8rem;
|
||||
color: var(--vip-content-muted, #595959);
|
||||
font-size: .74rem;
|
||||
line-height: 1.7;
|
||||
}
|
||||
|
||||
.process-details-note-content p {
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.process-details-table-card {
|
||||
@ -560,7 +666,7 @@
|
||||
}
|
||||
|
||||
@media (max-width: 900px) {
|
||||
.process-details-toolbar {
|
||||
.process-details-filter-grid {
|
||||
grid-template-columns: repeat(6, minmax(0, 1fr));
|
||||
}
|
||||
|
||||
@ -569,7 +675,7 @@
|
||||
}
|
||||
|
||||
.process-details-field.is-wide {
|
||||
grid-column: span 3;
|
||||
grid-column: span 2;
|
||||
}
|
||||
|
||||
.process-details-field.is-date-range,
|
||||
@ -579,7 +685,11 @@
|
||||
}
|
||||
|
||||
.process-details-field.is-business {
|
||||
grid-column: span 2;
|
||||
grid-column: span 3;
|
||||
}
|
||||
|
||||
.process-details-field.is-approver {
|
||||
grid-column: span 3;
|
||||
}
|
||||
|
||||
.process-details-actions {
|
||||
@ -604,13 +714,19 @@
|
||||
}
|
||||
|
||||
@media (max-width: 640px) {
|
||||
.process-details-toolbar {
|
||||
.process-details-filter-heading {
|
||||
align-items: flex-start;
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
.process-details-filter-grid {
|
||||
grid-template-columns: 1fr;
|
||||
}
|
||||
|
||||
.process-details-field,
|
||||
.process-details-field.is-wide,
|
||||
.process-details-field.is-business,
|
||||
.process-details-field.is-approver,
|
||||
.process-details-field.is-date-range,
|
||||
.process-details-field.is-keyword,
|
||||
.process-details-actions {
|
||||
@ -686,101 +802,166 @@
|
||||
|
||||
<form id="process-details-filter-form" method="GET" action="{{ $pageUrl }}" class="process-details-toolbar" aria-label="OA流程筛选">
|
||||
<input type="hidden" name="per_page" value="{{ $processRows->perPage() }}">
|
||||
<div class="process-details-field is-date-range">
|
||||
<label for="process-details-paid-start">打款时间</label>
|
||||
<div class="upstream-data-date-range" role="group" aria-label="打款开始至结算时间">
|
||||
<span class="upstream-data-date" data-date-picker>
|
||||
<input
|
||||
id="process-details-paid-start"
|
||||
type="text"
|
||||
name="paid_start"
|
||||
value="{{ $filters['paid_start'] ?? '' }}"
|
||||
readonly
|
||||
autocomplete="off"
|
||||
placeholder="开始日期"
|
||||
aria-label="打款开始日期"
|
||||
data-date-input
|
||||
>
|
||||
<button type="button" class="upstream-data-date__clear" data-date-clear hidden aria-label="清除打款开始日期">
|
||||
<span class="material-icons-outlined" aria-hidden="true">close</span>
|
||||
</button>
|
||||
<button type="button" class="upstream-data-date__pick" data-date-toggle aria-label="选择打款开始日期">
|
||||
<span class="material-icons-outlined" aria-hidden="true">calendar_today</span>
|
||||
</button>
|
||||
<div class="upstream-data-calendar" role="dialog" aria-label="打款开始日期日历" data-date-calendar hidden></div>
|
||||
</span>
|
||||
<b class="upstream-data-date-range__sep">至</b>
|
||||
<span class="upstream-data-date" data-date-picker>
|
||||
<input
|
||||
id="process-details-paid-end"
|
||||
type="text"
|
||||
name="paid_end"
|
||||
value="{{ $filters['paid_end'] ?? '' }}"
|
||||
readonly
|
||||
autocomplete="off"
|
||||
placeholder="结算日期"
|
||||
aria-label="打款结算日期"
|
||||
data-date-input
|
||||
>
|
||||
<button type="button" class="upstream-data-date__clear" data-date-clear hidden aria-label="清除打款结算日期">
|
||||
<span class="material-icons-outlined" aria-hidden="true">close</span>
|
||||
</button>
|
||||
<button type="button" class="upstream-data-date__pick" data-date-toggle aria-label="选择打款结算日期">
|
||||
<span class="material-icons-outlined" aria-hidden="true">calendar_today</span>
|
||||
</button>
|
||||
<div class="upstream-data-calendar" role="dialog" aria-label="打款结算日期日历" data-date-calendar hidden></div>
|
||||
</span>
|
||||
<div class="process-details-filter-heading">
|
||||
<span class="process-details-filter-heading__title">
|
||||
<span class="material-icons-outlined" aria-hidden="true">filter_alt</span>
|
||||
筛选条件
|
||||
</span>
|
||||
<span class="process-details-filter-heading__summary">
|
||||
@if ($activeFilterCount > 0)
|
||||
已启用 <b class="process-details-filter-count">{{ $activeFilterCount }}</b> 项条件
|
||||
@else
|
||||
可按审批人、状态和进入时间组合筛选
|
||||
@endif
|
||||
</span>
|
||||
</div>
|
||||
<div class="process-details-filter-grid">
|
||||
<div class="process-details-field is-business">
|
||||
<label for="process-details-business-id">审批编号</label>
|
||||
<input id="process-details-business-id" type="search" name="business_id" value="{{ $filters['business_id'] ?? '' }}" placeholder="支持包含查询">
|
||||
</div>
|
||||
<div class="process-details-field">
|
||||
<label for="process-details-type">单据类型</label>
|
||||
<select id="process-details-type" name="document_type">
|
||||
<option value="">全部类型</option>
|
||||
@foreach ($documentTypes as $option)
|
||||
<option value="{{ $option }}" @selected(($filters['document_type'] ?? '') === $option)>{{ $option }}</option>
|
||||
@endforeach
|
||||
</select>
|
||||
</div>
|
||||
<div class="process-details-field">
|
||||
<label for="process-details-status">审批状态</label>
|
||||
<select id="process-details-status" name="status">
|
||||
<option value="">全部状态</option>
|
||||
@foreach ($statuses as $option)
|
||||
<option value="{{ $option }}" @selected(($filters['status'] ?? '') === $option)>{{ $option }}</option>
|
||||
@endforeach
|
||||
</select>
|
||||
</div>
|
||||
<div class="process-details-field">
|
||||
<label for="process-details-payment-state">付款状态</label>
|
||||
<select id="process-details-payment-state" name="payment_state">
|
||||
<option value="">全部状态</option>
|
||||
@foreach ($paymentStates as $option)
|
||||
<option value="{{ $option }}" @selected(($filters['payment_state'] ?? '') === $option)>{{ $option }}</option>
|
||||
@endforeach
|
||||
</select>
|
||||
</div>
|
||||
<div class="process-details-field is-approver">
|
||||
<label for="process-details-current-approver">当前审批人</label>
|
||||
<input id="process-details-current-approver" type="search" name="current_approver_name" value="{{ $filters['current_approver_name'] ?? '' }}" placeholder="支持包含查询">
|
||||
</div>
|
||||
<div class="process-details-field is-date-range">
|
||||
<label for="process-details-paid-start">打款时间</label>
|
||||
<div class="upstream-data-date-range" role="group" aria-label="打款开始至结算时间">
|
||||
<span class="upstream-data-date" data-date-picker>
|
||||
<input
|
||||
id="process-details-paid-start"
|
||||
type="text"
|
||||
name="paid_start"
|
||||
value="{{ $filters['paid_start'] ?? '' }}"
|
||||
readonly
|
||||
autocomplete="off"
|
||||
placeholder="开始日期"
|
||||
aria-label="打款开始日期"
|
||||
data-date-input
|
||||
>
|
||||
<button type="button" class="upstream-data-date__clear" data-date-clear hidden aria-label="清除打款开始日期">
|
||||
<span class="material-icons-outlined" aria-hidden="true">close</span>
|
||||
</button>
|
||||
<button type="button" class="upstream-data-date__pick" data-date-toggle aria-label="选择打款开始日期">
|
||||
<span class="material-icons-outlined" aria-hidden="true">calendar_today</span>
|
||||
</button>
|
||||
<div class="upstream-data-calendar" role="dialog" aria-label="打款开始日期日历" data-date-calendar hidden></div>
|
||||
</span>
|
||||
<b class="upstream-data-date-range__sep">至</b>
|
||||
<span class="upstream-data-date" data-date-picker>
|
||||
<input
|
||||
id="process-details-paid-end"
|
||||
type="text"
|
||||
name="paid_end"
|
||||
value="{{ $filters['paid_end'] ?? '' }}"
|
||||
readonly
|
||||
autocomplete="off"
|
||||
placeholder="结算日期"
|
||||
aria-label="打款结算日期"
|
||||
data-date-input
|
||||
>
|
||||
<button type="button" class="upstream-data-date__clear" data-date-clear hidden aria-label="清除打款结算日期">
|
||||
<span class="material-icons-outlined" aria-hidden="true">close</span>
|
||||
</button>
|
||||
<button type="button" class="upstream-data-date__pick" data-date-toggle aria-label="选择打款结算日期">
|
||||
<span class="material-icons-outlined" aria-hidden="true">calendar_today</span>
|
||||
</button>
|
||||
<div class="upstream-data-calendar" role="dialog" aria-label="打款结算日期日历" data-date-calendar hidden></div>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="process-details-field is-date-range">
|
||||
<label for="process-details-entry-start">进入时间</label>
|
||||
<div class="upstream-data-date-range" role="group" aria-label="审批进入开始至结束时间">
|
||||
<span class="upstream-data-date" data-date-picker>
|
||||
<input
|
||||
id="process-details-entry-start"
|
||||
type="text"
|
||||
name="entry_start"
|
||||
value="{{ $filters['entry_start'] ?? '' }}"
|
||||
readonly
|
||||
autocomplete="off"
|
||||
placeholder="开始日期"
|
||||
aria-label="审批进入开始日期"
|
||||
data-date-input
|
||||
>
|
||||
<button type="button" class="upstream-data-date__clear" data-date-clear hidden aria-label="清除审批进入开始日期">
|
||||
<span class="material-icons-outlined" aria-hidden="true">close</span>
|
||||
</button>
|
||||
<button type="button" class="upstream-data-date__pick" data-date-toggle aria-label="选择审批进入开始日期">
|
||||
<span class="material-icons-outlined" aria-hidden="true">calendar_today</span>
|
||||
</button>
|
||||
<div class="upstream-data-calendar" role="dialog" aria-label="审批进入开始日期日历" data-date-calendar hidden></div>
|
||||
</span>
|
||||
<b class="upstream-data-date-range__sep">至</b>
|
||||
<span class="upstream-data-date" data-date-picker>
|
||||
<input
|
||||
id="process-details-entry-end"
|
||||
type="text"
|
||||
name="entry_end"
|
||||
value="{{ $filters['entry_end'] ?? '' }}"
|
||||
readonly
|
||||
autocomplete="off"
|
||||
placeholder="结束日期"
|
||||
aria-label="审批进入结束日期"
|
||||
data-date-input
|
||||
>
|
||||
<button type="button" class="upstream-data-date__clear" data-date-clear hidden aria-label="清除审批进入结束日期">
|
||||
<span class="material-icons-outlined" aria-hidden="true">close</span>
|
||||
</button>
|
||||
<button type="button" class="upstream-data-date__pick" data-date-toggle aria-label="选择审批进入结束日期">
|
||||
<span class="material-icons-outlined" aria-hidden="true">calendar_today</span>
|
||||
</button>
|
||||
<div class="upstream-data-calendar" role="dialog" aria-label="审批进入结束日期日历" data-date-calendar hidden></div>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="process-details-field">
|
||||
<label for="process-details-originator">发起人</label>
|
||||
<input id="process-details-originator" type="search" name="originator_name" value="{{ $filters['originator_name'] ?? '' }}" placeholder="支持包含查询">
|
||||
</div>
|
||||
<div class="process-details-field is-keyword">
|
||||
<label for="process-details-keyword">用途/摘要</label>
|
||||
<input id="process-details-keyword" type="search" name="keyword" value="{{ $filters['keyword'] ?? '' }}" placeholder="支持包含查询">
|
||||
</div>
|
||||
<div class="process-details-actions">
|
||||
<button class="process-details-button is-primary" type="submit">
|
||||
<span class="material-icons-outlined" aria-hidden="true">search</span>查询
|
||||
</button>
|
||||
<a class="process-details-button" href="{{ $pageUrl }}">
|
||||
<span class="material-icons-outlined" aria-hidden="true">refresh</span>重置
|
||||
</a>
|
||||
<a class="process-details-button" href="{{ $exportUrl }}" title="导出当前筛选结果(CSV,包含全部匹配行)">
|
||||
<span class="material-icons-outlined" aria-hidden="true">download</span>导出
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="process-details-field">
|
||||
<label for="process-details-type">单据类型</label>
|
||||
<select id="process-details-type" name="document_type">
|
||||
<option value="">全部类型</option>
|
||||
@foreach ($documentTypes as $option)
|
||||
<option value="{{ $option }}" @selected(($filters['document_type'] ?? '') === $option)>{{ $option }}</option>
|
||||
@endforeach
|
||||
</select>
|
||||
</div>
|
||||
<div class="process-details-field">
|
||||
<label for="process-details-status">审批状态</label>
|
||||
<select id="process-details-status" name="status">
|
||||
<option value="">全部状态</option>
|
||||
@foreach ($statuses as $option)
|
||||
<option value="{{ $option }}" @selected(($filters['status'] ?? '') === $option)>{{ $option }}</option>
|
||||
@endforeach
|
||||
</select>
|
||||
</div>
|
||||
<div class="process-details-field">
|
||||
<label for="process-details-payment-state">付款状态</label>
|
||||
<select id="process-details-payment-state" name="payment_state">
|
||||
<option value="">全部状态</option>
|
||||
@foreach ($paymentStates as $option)
|
||||
<option value="{{ $option }}" @selected(($filters['payment_state'] ?? '') === $option)>{{ $option }}</option>
|
||||
@endforeach
|
||||
</select>
|
||||
</div>
|
||||
<div class="process-details-field is-business">
|
||||
<label for="process-details-business-id">审批编号</label>
|
||||
<input id="process-details-business-id" type="search" name="business_id" value="{{ $filters['business_id'] ?? '' }}" placeholder="支持包含查询">
|
||||
</div>
|
||||
<div class="process-details-field">
|
||||
<label for="process-details-originator">发起人</label>
|
||||
<input id="process-details-originator" type="search" name="originator_name" value="{{ $filters['originator_name'] ?? '' }}" placeholder="支持包含查询">
|
||||
</div>
|
||||
<div class="process-details-field is-keyword">
|
||||
<label for="process-details-keyword">用途/摘要</label>
|
||||
<input id="process-details-keyword" type="search" name="keyword" value="{{ $filters['keyword'] ?? '' }}" placeholder="支持包含查询">
|
||||
</div>
|
||||
<div class="process-details-actions">
|
||||
<button class="process-details-button is-primary" type="submit">
|
||||
<span class="material-icons-outlined" aria-hidden="true">search</span>查询
|
||||
</button>
|
||||
<a class="process-details-button" href="{{ $pageUrl }}">
|
||||
<span class="material-icons-outlined" aria-hidden="true">refresh</span>重置
|
||||
</a>
|
||||
<a class="process-details-button" href="{{ $exportUrl }}" title="导出当前筛选结果(CSV,包含全部匹配行)">
|
||||
<span class="material-icons-outlined" aria-hidden="true">download</span>导出
|
||||
</a>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
@ -791,15 +972,23 @@
|
||||
<div class="item"><span>{{ $paymentSummaryLabel }}</span><b>{{ $money($summary['bank_amount_total'] ?? null) }}</b></div>
|
||||
</div>
|
||||
|
||||
<p class="process-details-note">
|
||||
金额合计按审批费用明细汇总,付款明细合计按审批表单中的结构化付款明细汇总,不等同于出纳已确认付款;
|
||||
同一笔付款不会因关联多条费用而重复计算。
|
||||
付款状态按审批状态和已抓取的结构化付款事实判断;付款差额按“费用合计 − 付款明细合计”单独计算,不参与付款状态判断。
|
||||
审批中的流程在出现结构化付款事实前显示“待付款”,已有付款事实时显示“已付款”。
|
||||
当前审批人、进入时间和已等待时长来自钉钉在途任务同步;打开页面时会定向刷新当前页审批中的流程,已完成流程不重复回查,已等待按实际小时显示。
|
||||
当前展示的是当前账号权限范围内可读取的钉钉OA审批流程;审批中的金额和行项目仍可能随流程变化。
|
||||
企业级全量数据待领导开通 OA 权限后切换。
|
||||
</p>
|
||||
<details class="process-details-note-disclosure">
|
||||
<summary>
|
||||
<span class="material-icons-outlined" aria-hidden="true">info</span>
|
||||
统计与口径说明
|
||||
</summary>
|
||||
<div class="process-details-note-content">
|
||||
<p>
|
||||
金额合计按审批费用明细汇总,付款明细合计按审批表单中的结构化付款明细汇总,不等同于出纳已确认付款;
|
||||
同一笔付款不会因关联多条费用而重复计算。付款状态按审批状态和已抓取的结构化付款事实判断;
|
||||
付款差额按“费用合计 − 付款明细合计”单独计算,不参与付款状态判断。
|
||||
审批中的流程在出现结构化付款事实前显示“待付款”,已有付款事实时显示“已付款”。
|
||||
当前审批人、进入时间和已等待时长来自钉钉在途任务同步;打开页面时会定向刷新当前页审批中的流程,
|
||||
已完成流程不重复回查,已等待按实际小时显示。当前展示的是当前账号权限范围内可读取的钉钉OA审批流程;
|
||||
审批中的金额和行项目仍可能随流程变化。企业级全量数据待领导开通 OA 权限后切换。
|
||||
</p>
|
||||
</div>
|
||||
</details>
|
||||
|
||||
<div class="process-details-table-card">
|
||||
<div class="process-details-table-wrap">
|
||||
|
||||
@ -87,6 +87,9 @@ class ProcessDetailsPageTest extends FeatureTestCase
|
||||
'page' => 'oa-process',
|
||||
'per_page' => 100,
|
||||
'payment_state' => '待付款',
|
||||
'current_approver_name' => '王五',
|
||||
'entry_start' => '2026-10-20',
|
||||
'entry_end' => '2026-10-30',
|
||||
]))->assertOk()
|
||||
->assertSee('流程数据')
|
||||
->assertSee('OA流程')
|
||||
@ -96,11 +99,19 @@ class ProcessDetailsPageTest extends FeatureTestCase
|
||||
->assertSee('打款时间')
|
||||
->assertSee('name="paid_start"', false)
|
||||
->assertSee('name="paid_end"', false)
|
||||
->assertSee('name="current_approver_name"', false)
|
||||
->assertSee('name="entry_start"', false)
|
||||
->assertSee('name="entry_end"', false)
|
||||
->assertSee('placeholder="开始日期"', false)
|
||||
->assertSee('placeholder="结算日期"', false)
|
||||
->assertSee('placeholder="结束日期"', false)
|
||||
->assertSee('aria-label="选择打款开始日期"', false)
|
||||
->assertSee('aria-label="选择打款结算日期"', false)
|
||||
->assertSee('aria-label="选择审批进入开始日期"', false)
|
||||
->assertSee('aria-label="选择审批进入结束日期"', false)
|
||||
->assertSee('CaiWuDatePicker.setup', false)
|
||||
->assertSee('class="process-details-filter-grid"', false)
|
||||
->assertSee('class="process-details-note-disclosure"', false)
|
||||
->assertSee('name="payment_state"', false)
|
||||
->assertSee('审批状态')
|
||||
->assertSee('付款状态')
|
||||
|
||||
@ -189,6 +189,24 @@ class DingProcessDetailMirrorRepositoryTest extends TestCase
|
||||
2,
|
||||
$this->repository->paginate(['payment_state' => '待付款'], 1, 50)['total'],
|
||||
);
|
||||
$this->assertSame(
|
||||
2,
|
||||
$this->repository->paginate(['current_approver_name' => '王五'], 1, 50)['total'],
|
||||
);
|
||||
$this->assertSame(
|
||||
2,
|
||||
$this->repository->paginate([
|
||||
'entry_start' => '2026-02-01',
|
||||
'entry_end' => '2026-02-28',
|
||||
], 1, 50)['total'],
|
||||
);
|
||||
$this->assertSame(
|
||||
2,
|
||||
$this->repository->paginate([
|
||||
'entry_start' => '2026-02-28',
|
||||
'entry_end' => '2026-02-01',
|
||||
], 1, 50)['total'],
|
||||
);
|
||||
}
|
||||
|
||||
public function test_pending_cashier_status_without_payment_facts_is_waiting_for_payment(): void
|
||||
@ -433,6 +451,10 @@ class DingProcessDetailMirrorRepositoryTest extends TestCase
|
||||
'payment_source_state' => 'present',
|
||||
'cashier_status' => $status === '已完成' ? 'completed' : 'pending',
|
||||
'cashier_checked_at' => $now,
|
||||
'current_approver_name' => $businessId === '202601011200000000001' ? '王五' : '赵六',
|
||||
'current_task_started_at' => $businessId === '202601011200000000001'
|
||||
? '2026-01-02 09:00:00'
|
||||
: '2026-02-03 09:00:00',
|
||||
'document_type' => $documentType,
|
||||
'purpose' => $purpose,
|
||||
'account_code' => '5602.04',
|
||||
@ -489,6 +511,7 @@ class DingProcessDetailMirrorRepositoryTest extends TestCase
|
||||
$table->string('payment_source_state', 24)->nullable();
|
||||
$table->string('cashier_status', 32)->nullable();
|
||||
$table->dateTime('cashier_checked_at')->nullable();
|
||||
$table->string('current_approver_name', 255)->nullable();
|
||||
$table->string('current_task_name', 255)->nullable();
|
||||
$table->dateTime('current_task_started_at')->nullable();
|
||||
$table->string('cashier_task_name', 100)->nullable();
|
||||
|
||||
@ -52,6 +52,9 @@ class ProcessDetailsPageDataTest extends TestCase
|
||||
$filters['paid_start'] === '2026-10-20'
|
||||
&& $filters['paid_end'] === '2026-10-24'
|
||||
&& $filters['payment_state'] === '已付款'
|
||||
&& $filters['current_approver_name'] === '王五'
|
||||
&& $filters['entry_start'] === '2026-10-21'
|
||||
&& $filters['entry_end'] === '2026-10-25'
|
||||
), 2, 50)
|
||||
->willReturn([
|
||||
'data' => [$row],
|
||||
@ -87,6 +90,9 @@ class ProcessDetailsPageDataTest extends TestCase
|
||||
'paid_start' => '2026-10-20',
|
||||
'paid_end' => '2026-10-24',
|
||||
'payment_state' => '出纳已打款',
|
||||
'current_approver_name' => '王五',
|
||||
'entry_start' => '2026-10-21',
|
||||
'entry_end' => '2026-10-25',
|
||||
'page' => 2,
|
||||
],
|
||||
));
|
||||
@ -101,6 +107,9 @@ class ProcessDetailsPageDataTest extends TestCase
|
||||
$this->assertSame('2026-10-20', $data['filters']['paid_start']);
|
||||
$this->assertSame('2026-10-24', $data['filters']['paid_end']);
|
||||
$this->assertSame('已付款', $data['filters']['payment_state']);
|
||||
$this->assertSame('王五', $data['filters']['current_approver_name']);
|
||||
$this->assertSame('2026-10-21', $data['filters']['entry_start']);
|
||||
$this->assertSame('2026-10-25', $data['filters']['entry_end']);
|
||||
$this->assertSame(
|
||||
[
|
||||
'待付款',
|
||||
@ -129,6 +138,14 @@ class ProcessDetailsPageDataTest extends TestCase
|
||||
['', ''],
|
||||
ProcessDetailsPageData::normalizePaidDateRange('2026-02-30', 'invalid'),
|
||||
);
|
||||
$this->assertSame(
|
||||
['2026-10-21', '2026-10-25'],
|
||||
ProcessDetailsPageData::normalizeDateRange('2026-10-25', '2026-10-21'),
|
||||
);
|
||||
$this->assertSame(
|
||||
['', ''],
|
||||
ProcessDetailsPageData::normalizeDateRange('invalid', '2026-02-30'),
|
||||
);
|
||||
}
|
||||
|
||||
public function test_unavailable_payment_state_filter_is_cleared_before_querying(): void
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user