Merge branch 'fix/qiuxiang-douyin-settle-time-label'

This commit is contained in:
qiuxiang 2026-09-29 10:53:22 +08:00
commit 2ec60574ff
2 changed files with 6 additions and 2 deletions

View File

@ -17,7 +17,7 @@
<input v-else v-model.trim="filters.bill_item" placeholder="账单项目" />
</label>
<div class="tw-filter-field tw-date" :class="{ 'is-stable-date': usesStableDateControl }">
<span class="tw-filter-label">{{ isJdBillTab || billType === 'jd-wallet' ? '费用结算时间' : '发生时间' }}</span>
<span class="tw-filter-label">{{ dateFilterLabel }}</span>
<div class="tw-date-row">
<span class="tw-date-control has-picker" @click="usesStableDateControl && openDatePicker('startDate')">
<flat-picker ref="startDate" :value="filters.start" :config="startDateConfig" aria-label="开始日期" placeholder="开始日期" @on-change="(_, value) => changeDate('start', value)" />
@ -76,6 +76,8 @@ import 'flatpickr/dist/flatpickr.css';
const SORTABLE = ['occurred_at','income','expense','balance','record_code'];
// 京东账单与京喜账单共用同一份列定义与同一套交互,只在数据口径上拆分。
const JD_BILL_TABS = ['jd-transactions','jingxi'];
// 时间筛选标签与该页签的时间列名保持一致(其余页签沿用「发生时间」)。
const DATE_FILTER_LABELS = {'jd-transactions':'费用结算时间','jingxi':'费用结算时间','jd-wallet':'费用结算时间','douyin':'结算时间'};
const dateConfig = {dateFormat:'Y-m-d',locale:Mandarin,disableMobile:true,allowInput:false,onReady:(_,value,picker)=>picker.calendarContainer.classList.add('account-bill-calendar')};
const emptyFilters = billType => ({store_name:'',bill_item:'',start:'',end:'',keyword:'',keyword_match:billType==='douyin'?'exact-record':'contains'});
export default {
@ -85,6 +87,7 @@ export default {
isDouyin(){return this.billType==='douyin';},
// 费用结算时间标签、来源说明与收支净额统计口径按京东系列页签(京东账单/京喜账单)统一。
isJdBillTab(){return JD_BILL_TABS.indexOf(this.billType)!==-1;},
dateFilterLabel(){return DATE_FILTER_LABELS[this.billType]||'发生时间';},
// 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;},

View File

@ -45,7 +45,8 @@ class AccountBillsTableTest extends TestCase
$this->assertStringContainsString("const JD_BILL_TABS = ['jd-transactions','jingxi'];", $source);
$this->assertStringContainsString("isJdBillTab(){return JD_BILL_TABS.indexOf(this.billType)!==-1;}", $source);
$this->assertStringContainsString("{{ isJdBillTab || billType === 'jd-wallet' ? '费用结算时间' : '发生时间' }}", $source);
$this->assertStringContainsString("const DATE_FILTER_LABELS = {'jd-transactions':'费用结算时间','jingxi':'费用结算时间','jd-wallet':'费用结算时间','douyin':'结算时间'};", $source);
$this->assertStringContainsString('{{ dateFilterLabel }}', $source);
$this->assertStringContainsString('v-if="isJdBillTab && sync"', $source);
$this->assertStringContainsString("netLabel=JD_BILL_TABS.concat(['vipshop-jx']).indexOf(this.billType)!==-1", $source);
}