第6项:统一业务控件、主题与移动布局,保留原生输入和焦点契约

This commit is contained in:
黄健铭 committed 2026-12-05 08:15:19 -08:00
1 parent ff8b05973a
commit cb705d296e
74 files changed
+3548 -2442

No files matched your search

@@ -18,6 +18,13 @@ import type {
} from '../orderData';
import { Children, Fragment } from 'react';
import { Calc as LedgerCalc, Cards as CreditCardFees, Values } from '../../../shared';
import {
LedgerButton,
LedgerDataTable,
LedgerInput,
LedgerSelect,
LedgerTable,
} from '../../../components/BusinessControls';
export function sharedViews({
state,
session,
@@ -80,7 +87,7 @@ export function sharedViews({
return (
<label className="stock-count-field" data-stock-count-field="" hidden={!visible}>
{title}
<input
<LedgerInput
name={name}
readOnly={readOnly}
defaultValue={value ?? ''}
@@ -136,9 +143,9 @@ export function sharedViews({
return (
<label>
{title}
<select name={name} defaultValue={selected}>
<LedgerSelect name={name} defaultValue={selected}>
{opts(values)}
</select>
</LedgerSelect>
</label>
);
};
@@ -157,7 +164,7 @@ export function sharedViews({
) => (
<label>
{title}
<input type={type} name={name} defaultValue={value} {...props} />
<LedgerInput type={type} name={name} defaultValue={value} {...props} />
</label>
);
const opts = (values: Options) =>
@@ -280,7 +287,10 @@ export function sharedViews({
{lock.customer ? ' · ' + lock.customer : ''}
</h3>
<div className="table-wrap">
<table className="material-detail-table material-change-comparison" aria-label="关联锁价单成本影响">
<LedgerTable
className="material-detail-table material-change-comparison"
aria-label="关联锁价单成本影响"
>
<thead>
<tr>
<th>核对项目</th>
@@ -310,7 +320,7 @@ export function sharedViews({
: ''}
{pair('自动付款归属', sources(lock.before), sources(lock.after))}
</tbody>
</table>
</LedgerTable>
</div>
</>
)),
@@ -338,7 +348,7 @@ export function sharedViews({
<h3>{title}</h3>
{rows.length ? (
<div className="table-wrap">
<table className="order-change-inventory">
<LedgerTable className="order-change-inventory">
<thead>
<tr>
<th>日期</th>
@@ -365,7 +375,7 @@ export function sharedViews({
)),
)}
</tbody>
</table>
</LedgerTable>
</div>
) : (
<p className="small muted">{changes ? '本次没有黄金货盘净变动。' : '没有本单库存流水。'}</p>
@@ -745,7 +755,7 @@ export function sharedViews({
原值为申请时快照,申请值由服务器按本次变更试算。批准前请核对客户实付、商品、成本、费用及付款人。
</p>
<div className="table-wrap">
<table className="order-change-table" aria-label="变更申请原值与申请值对照">
<LedgerTable className="order-change-table" aria-label="变更申请原值与申请值对照">
<thead>
<tr>
<th>核对项目</th>
@@ -777,7 +787,7 @@ export function sharedViews({
orderChangeExpensesValue(after),
)}
</tbody>
</table>
</LedgerTable>
</div>
{orderChangeInventoryHTML(request.summary.inventory)}
{related}
@@ -888,42 +898,38 @@ export function sharedViews({
)}
</dl>
<div className="table-wrap">
<table aria-label="逐件售后回库与成本">
<thead>
<tr>
<th>商品与实际去向</th>
<th>实际退回</th>
<th>回料成本</th>
<th>保留工费</th>
<th>成本损失</th>
</tr>
</thead>
<tbody>
{Children.toArray(
record.lines.map(line => (
<tr>
<td>
{line.name || '商品 ' + (line.lineIndex + 1)}
<div className="small muted">
{pocketLabel(line.pocket)} · {line.disposition === 'stock' ? '完好现货' : '旧料/损坏'}
</div>
</td>
<td>
{grams(line.quantity)}g
{line.disposition === 'stock' && pocketCountsEnabled(line.pocket) ? (
<div className="small">{stockCountText(line.stockCount)}</div>
) : (
''
)}
</td>
<td>{money(line.materialReturnedCost)}</td>
<td>{money(line.laborRestockedCost)}</td>
<td>{money(line.costLoss)}</td>
</tr>
)),
)}
</tbody>
</table>
<LedgerDataTable
aria-label="逐件售后回库与成本"
columns={[
{ title: '商品与实际去向' },
{ title: '实际退回' },
{ title: '回料成本' },
{ title: '保留工费' },
{ title: '成本损失' },
]}
rows={record.lines.map((line, rowIndex) => ({
key: rowIndex,
cells: [
<>
{line.name || '商品 ' + (line.lineIndex + 1)}
<div className="small muted">
{pocketLabel(line.pocket)} · {line.disposition === 'stock' ? '完好现货' : '旧料/损坏'}
</div>
</>,
<>
{grams(line.quantity)}g
{line.disposition === 'stock' && pocketCountsEnabled(line.pocket) ? (
<div className="small">{stockCountText(line.stockCount)}</div>
) : (
''
)}
</>,
money(line.materialReturnedCost),
money(line.laborRestockedCost),
money(line.costLoss),
],
}))}
/>
</div>
<p className="small muted">
实退材料按原成本回售后日料池,不新增采购付款。完好现货工费留在退回现货批次;旧料工费与未退回材料成本计损失。原单实际费用继续保留。
@@ -1209,9 +1215,9 @@ export function sharedViews({
[key: `data-${string}`]: string | number | boolean | undefined;
} = {},
) => (
<button type="button" data-action={action} className={cls} {...props}>
<LedgerButton type="button" data-action={action} className={cls} {...props}>
{text}
</button>
</LedgerButton>
);
function teamMemberName(member: string | undefined) {
return (