第6项:统一业务控件、主题与移动布局,保留原生输入和焦点契约
This commit is contained in:
1 parent
ff8b05973a
commit
cb705d296e
74 files changed
+3548
-2442
No files matched your search
@@ -1,4 +1,5 @@
|
||||
import { useRef, useEffect, type ReactNode } from 'react';
|
||||
import type { ReactNode } from 'react';
|
||||
import { LedgerButton, LedgerDialog } from '../../components/BusinessControls';
|
||||
export function Dialog({
|
||||
id,
|
||||
label,
|
||||
@@ -12,16 +13,9 @@ export function Dialog({
|
||||
children: ReactNode;
|
||||
ownClose?: boolean;
|
||||
}) {
|
||||
const ref = useRef<HTMLDialogElement>(null);
|
||||
useEffect(() => {
|
||||
const node = ref.current!;
|
||||
node.showModal();
|
||||
return () => node.close();
|
||||
}, []);
|
||||
return (
|
||||
<dialog
|
||||
<LedgerDialog
|
||||
id={id}
|
||||
ref={ref}
|
||||
aria-label={label}
|
||||
onCancel={event => {
|
||||
event.preventDefault();
|
||||
@@ -29,11 +23,17 @@ export function Dialog({
|
||||
}}
|
||||
>
|
||||
{!ownClose && (
|
||||
<button type="button" className="dialog-close" data-action="close-dialog" aria-label={label} onClick={close}>
|
||||
<LedgerButton
|
||||
type="button"
|
||||
className="dialog-close"
|
||||
data-action="close-dialog"
|
||||
aria-label={label}
|
||||
onClick={close}
|
||||
>
|
||||
×
|
||||
</button>
|
||||
</LedgerButton>
|
||||
)}
|
||||
{children}
|
||||
</dialog>
|
||||
</LedgerDialog>
|
||||
);
|
||||
}
|
||||
@@ -17,12 +17,13 @@ type TextKey<T> = { [K in keyof T]-?: T[K] extends string ? K : never }[keyof T]
|
||||
|
||||
import { Fees, Model } from '../../shared';
|
||||
import { uuid } from '../CreateOrder/useOrderForm';
|
||||
import { LedgerButton, LedgerInput, LedgerSelect } from '../../components/BusinessControls';
|
||||
|
||||
export function Input({ label, name, value, type = 'text', hidden, help, onChange, ...props }: InputProps) {
|
||||
return (
|
||||
<label hidden={hidden}>
|
||||
{label}
|
||||
<input
|
||||
<LedgerInput
|
||||
{...props}
|
||||
name={name}
|
||||
type={type}
|
||||
@@ -38,7 +39,7 @@ export function Choice({ label, name, value, options, hidden, help, onChange, ..
|
||||
return (
|
||||
<label hidden={hidden}>
|
||||
{label}
|
||||
<select
|
||||
<LedgerSelect
|
||||
{...props}
|
||||
name={name}
|
||||
value={value ?? ''}
|
||||
@@ -53,7 +54,7 @@ export function Choice({ label, name, value, options, hidden, help, onChange, ..
|
||||
</option>
|
||||
);
|
||||
})}
|
||||
</select>
|
||||
</LedgerSelect>
|
||||
{help}
|
||||
</label>
|
||||
);
|
||||
@@ -111,7 +112,7 @@ export function EditLine({
|
||||
<div className="line-item" data-legacy={line.legacy}>
|
||||
<div className="panel-title">
|
||||
<h3>商品 {index + 1}</h3>
|
||||
<button
|
||||
<LedgerButton
|
||||
type="button"
|
||||
data-action="remove-line"
|
||||
onClick={() => {
|
||||
@@ -123,7 +124,7 @@ export function EditLine({
|
||||
}}
|
||||
>
|
||||
移除
|
||||
</button>
|
||||
</LedgerButton>
|
||||
</div>
|
||||
<div className="grid four">
|
||||
<Choice label="商品名称" {...prop('nameType')} options={[...Model.productNames, '其他']} />
|
||||
@@ -163,9 +164,13 @@ export function EditLine({
|
||||
<div className="sale-charges">
|
||||
<div className="panel-title">
|
||||
<strong>工费附加项目(选填)</strong>
|
||||
<button type="button" data-action="add-charge" onClick={() => update(f => Model.addCharge(f, index, uuid))}>
|
||||
<LedgerButton
|
||||
type="button"
|
||||
data-action="add-charge"
|
||||
onClick={() => update(f => Model.addCharge(f, index, uuid))}
|
||||
>
|
||||
+ 添加附加项目
|
||||
</button>
|
||||
</LedgerButton>
|
||||
</div>
|
||||
{line.charges.map((c, i) => (
|
||||
<div key={c.id} className="charge-row grid four">
|
||||
@@ -191,13 +196,16 @@ export function EditLine({
|
||||
value={c.amount}
|
||||
onChange={value => updateCharge(i, charge => Model.setChargeAmount(charge, value))}
|
||||
/>
|
||||
<button type="button" onClick={() => change(l => ({ ...l, charges: l.charges.filter((_, j) => j !== i) }))}>
|
||||
<LedgerButton
|
||||
type="button"
|
||||
onClick={() => change(l => ({ ...l, charges: l.charges.filter((_, j) => j !== i) }))}
|
||||
>
|
||||
移除项目
|
||||
</button>
|
||||
</LedgerButton>
|
||||
{c.costRemoved && (
|
||||
<button type="button" onClick={() => update(f => Model.restoreChargeCost(f, index, i))}>
|
||||
<LedgerButton type="button" onClick={() => update(f => Model.restoreChargeCost(f, index, i))}>
|
||||
恢复内部成本
|
||||
</button>
|
||||
</LedgerButton>
|
||||
)}
|
||||
</div>
|
||||
))}
|
||||
@@ -235,7 +243,7 @@ export function EditLine({
|
||||
<>
|
||||
<Choice label="货品成本付款人" {...prop('payer')} options={members(line.payer)} />
|
||||
<Input label="原单货品成本(旧版未分项)" {...prop('cost')} type="number" readOnly />
|
||||
<button
|
||||
<LedgerButton
|
||||
type="button"
|
||||
onClick={() =>
|
||||
change(l => {
|
||||
@@ -252,7 +260,7 @@ export function EditLine({
|
||||
}
|
||||
>
|
||||
拆分这行成本
|
||||
</button>
|
||||
</LedgerButton>
|
||||
</>
|
||||
) : (
|
||||
<div className="cost-fields grid">
|
||||
@@ -277,9 +285,9 @@ export function EditLine({
|
||||
hidden={!pooled}
|
||||
onChange={poolId => change(l => ({ ...l, pool: { ...l.pool!, poolId, defaultDate: false } }))}
|
||||
/>
|
||||
<button type="button" onClick={reloadPools}>
|
||||
<LedgerButton type="button" onClick={reloadPools}>
|
||||
刷新料价
|
||||
</button>
|
||||
</LedgerButton>
|
||||
{line.view.poolNote && <p>{line.view.poolNote}</p>}
|
||||
</div>
|
||||
)}
|
||||
@@ -352,7 +360,7 @@ export function EditLine({
|
||||
options={members(p!.laborPayer)}
|
||||
/>
|
||||
{laborFunding && (
|
||||
<input
|
||||
<LedgerInput
|
||||
type="hidden"
|
||||
className="cost-funding"
|
||||
data-component="labor"
|
||||
@@ -371,9 +379,9 @@ export function EditLine({
|
||||
) : (
|
||||
<>
|
||||
{(['accessories', 'other'] as const).map(key => (
|
||||
<input key={key} type="hidden" name={prefix + key} value={p![key]} />
|
||||
<LedgerInput key={key} type="hidden" name={prefix + key} value={p![key]} />
|
||||
))}
|
||||
<input type="hidden" name="payer" value={line.payer} />
|
||||
<LedgerInput type="hidden" name="payer" value={line.payer} />
|
||||
</>
|
||||
)}
|
||||
</div>
|
||||
@@ -393,9 +401,9 @@ export function EditFees({ store, state, update }: { store: FormStore; state: Le
|
||||
<section className="panel internal">
|
||||
<div className="panel-title">
|
||||
<h2>实际费用(内部)</h2>
|
||||
<button type="button" onClick={() => update(f => Model.addManualFee(f, state, uuid))}>
|
||||
<LedgerButton type="button" onClick={() => update(f => Model.addManualFee(f, state, uuid))}>
|
||||
+ 添加其他成本
|
||||
</button>
|
||||
</LedgerButton>
|
||||
</div>
|
||||
<Input
|
||||
label="新增费用默认支付日期"
|
||||
@@ -411,7 +419,7 @@ export function EditFees({ store, state, update }: { store: FormStore; state: Le
|
||||
{Model.presetCatalogView(form, state).map(item => (
|
||||
<Fragment key={item.kind}>
|
||||
<label className="check">
|
||||
<input
|
||||
<LedgerInput
|
||||
type="checkbox"
|
||||
name={'cost_' + item.kind}
|
||||
disabled={hasLinkedCost(item.kind)}
|
||||
@@ -490,12 +498,12 @@ export function EditFees({ store, state, update }: { store: FormStore; state: Le
|
||||
onChange={v => edit('date', v)}
|
||||
/>
|
||||
{!row.automatic && (
|
||||
<button type="button" onClick={() => update(f => Model.removeFeeRow(f, i))}>
|
||||
<LedgerButton type="button" onClick={() => update(f => Model.removeFeeRow(f, i))}>
|
||||
移除费用
|
||||
</button>
|
||||
</LedgerButton>
|
||||
)}
|
||||
{ref && (
|
||||
<input
|
||||
<LedgerInput
|
||||
type="hidden"
|
||||
className="cost-funding"
|
||||
data-component="fee"
|
||||
|
||||
@@ -6,6 +6,7 @@ import { orderViews } from './orderViews';
|
||||
import { Dialog } from './Dialog';
|
||||
import { useRead } from './orderReads';
|
||||
import type { IndependentRequest } from './orderData';
|
||||
import { LedgerButton } from '../../components/BusinessControls';
|
||||
|
||||
interface SaleProps {
|
||||
client: LedgerClient;
|
||||
@@ -241,23 +242,23 @@ export function IndependentAfterSale({
|
||||
}
|
||||
}
|
||||
const reread = (
|
||||
<button
|
||||
<LedgerButton
|
||||
type="button"
|
||||
disabled={client.busy}
|
||||
data-action={review ? 'after-sale-change-open' : 'after-sale-edit'}
|
||||
data-id={id}
|
||||
>
|
||||
{review ? '重新读取申请并复核' : '重新读取售后'}
|
||||
</button>
|
||||
</LedgerButton>
|
||||
);
|
||||
const feedback = error && (
|
||||
<div className="error" role="alert">
|
||||
{error}{' '}
|
||||
{id &&
|
||||
(client.pending() ? (
|
||||
<button type="button" data-action="retry" disabled={client.busy}>
|
||||
<LedgerButton type="button" data-action="retry" disabled={client.busy}>
|
||||
恢复原操作
|
||||
</button>
|
||||
</LedgerButton>
|
||||
) : (
|
||||
reread
|
||||
))}
|
||||
@@ -269,18 +270,18 @@ export function IndependentAfterSale({
|
||||
if (receipt || (path && (review ? !request : !detail))) {
|
||||
content = (
|
||||
<>
|
||||
<button
|
||||
<LedgerButton
|
||||
className="dialog-close"
|
||||
data-action={review ? 'after-sale-changes-close' : 'close-after-sale'}
|
||||
aria-label={review ? '关闭售后修改复核' : '关闭售后记录'}
|
||||
>
|
||||
×
|
||||
</button>
|
||||
</LedgerButton>
|
||||
<h2>{receipt || (review ? '售后修改复核' : '修改售后')}</h2>
|
||||
{read.error || error ? (
|
||||
<div className="error" role="alert">
|
||||
{read.error || error} {reread}
|
||||
{review && <button data-action="after-sale-changes-reload">返回申请列表</button>}
|
||||
{review && <LedgerButton data-action="after-sale-changes-reload">返回申请列表</LedgerButton>}
|
||||
</div>
|
||||
) : (
|
||||
<p role="status">{receipt ? '正在刷新…' : review ? '正在读取申请…' : '正在读取售后记录…'}</p>
|
||||
|
||||
@@ -36,6 +36,7 @@ type UpdateInput = (fields: Partial<EditInputs>) => void;
|
||||
import { Calc as LedgerCalc, Fees, Model, Values } from '../../shared';
|
||||
import { Button } from '../Settings/controls';
|
||||
import { Input, Choice } from './EditFields';
|
||||
import { LedgerButton, LedgerInput, LedgerTextArea } from '../../components/BusinessControls';
|
||||
const { yuan, grams, validateOrderIdentity } = Model;
|
||||
const feeCategories: Record<string, string> = {
|
||||
jd: 'shipping',
|
||||
@@ -440,7 +441,7 @@ function EditableFees({
|
||||
return (
|
||||
<div key={kind} className="order-cost-box">
|
||||
<label className="order-cost-option">
|
||||
<input
|
||||
<LedgerInput
|
||||
type="checkbox"
|
||||
name={'cost_' + kind}
|
||||
checked={checked}
|
||||
@@ -466,7 +467,7 @@ function EditableFees({
|
||||
{row.byQuantity && (
|
||||
<label className="order-cost-quantity">
|
||||
{configured ? '数量(个)' : '盒子数量(个)'}
|
||||
<input
|
||||
<LedgerInput
|
||||
type="number"
|
||||
name={'cost_' + kind + '_quantity'}
|
||||
min="1"
|
||||
@@ -548,7 +549,7 @@ function EditableFees({
|
||||
</Button>
|
||||
)}
|
||||
{!automatic && row.funding && (
|
||||
<input
|
||||
<LedgerInput
|
||||
type="hidden"
|
||||
className="cost-funding"
|
||||
data-component="fee"
|
||||
@@ -736,7 +737,7 @@ function LockLine({
|
||||
/>
|
||||
</div>
|
||||
<label className="check">
|
||||
<input
|
||||
<LedgerInput
|
||||
type="checkbox"
|
||||
name="lock_material_verified"
|
||||
checked={!!mat.verified}
|
||||
@@ -781,7 +782,7 @@ function LockLine({
|
||||
/>
|
||||
</div>
|
||||
<label className="check" hidden={pooledExtra}>
|
||||
<input
|
||||
<LedgerInput
|
||||
type="checkbox"
|
||||
name="lock_extra_verified"
|
||||
checked={!!extra.verified}
|
||||
@@ -1021,7 +1022,7 @@ export function LockOrderEditor({
|
||||
['returning', '老客户'],
|
||||
].map(([key, text]) => (
|
||||
<label key={key} title={key === 'new' ? '首次成交' : '再次成交'}>
|
||||
<input
|
||||
<LedgerInput
|
||||
type="radio"
|
||||
name="customer_type"
|
||||
value={key}
|
||||
@@ -1056,7 +1057,7 @@ export function LockOrderEditor({
|
||||
</p>
|
||||
<label>
|
||||
客户单备注
|
||||
<textarea
|
||||
<LedgerTextArea
|
||||
name="note"
|
||||
maxLength={240}
|
||||
rows={2}
|
||||
@@ -1066,7 +1067,7 @@ export function LockOrderEditor({
|
||||
</label>
|
||||
<label>
|
||||
内部备注(客户不可见)<span className="small muted">必填,至少3个字符(含#号),最多500字</span>
|
||||
<textarea
|
||||
<LedgerTextArea
|
||||
name="internal_note"
|
||||
ref={textarea}
|
||||
maxLength={500}
|
||||
@@ -1085,7 +1086,7 @@ export function LockOrderEditor({
|
||||
<div data-order-note-tags className="order-note-tag-options" aria-label="内部备注快捷标签">
|
||||
{filteredTags.length ? (
|
||||
filteredTags.map(tag => (
|
||||
<button
|
||||
<LedgerButton
|
||||
type="button"
|
||||
className="quiet"
|
||||
key={tag}
|
||||
@@ -1100,7 +1101,7 @@ export function LockOrderEditor({
|
||||
}}
|
||||
>
|
||||
{tag}
|
||||
</button>
|
||||
</LedgerButton>
|
||||
))
|
||||
) : (
|
||||
<span className="small muted">
|
||||
@@ -1160,7 +1161,7 @@ export function LockOrderEditor({
|
||||
</div>
|
||||
<label>
|
||||
修改原因
|
||||
<textarea
|
||||
<LedgerTextArea
|
||||
name="edit_reason"
|
||||
required
|
||||
maxLength={200}
|
||||
@@ -1171,7 +1172,7 @@ export function LockOrderEditor({
|
||||
/>
|
||||
</label>
|
||||
<label className="check">
|
||||
<input
|
||||
<LedgerInput
|
||||
type="checkbox"
|
||||
name="edit_verified"
|
||||
required
|
||||
@@ -1185,14 +1186,14 @@ export function LockOrderEditor({
|
||||
<Button action="cancel-order-edit" className="quiet" onClick={onCancel}>
|
||||
取消修改
|
||||
</Button>
|
||||
<button
|
||||
<LedgerButton
|
||||
className="primary"
|
||||
type="submit"
|
||||
data-order-edit-submit
|
||||
disabled={client.busy || !!client.pending() || entry.conflicted}
|
||||
>
|
||||
{approval ? '提交修改申请' : '保存修改'}
|
||||
</button>
|
||||
</LedgerButton>
|
||||
</div>
|
||||
<div id="order-error" aria-live="polite">
|
||||
{serverFeedback}
|
||||
|
||||
@@ -38,6 +38,7 @@ import { navigate } from '../../lib/router';
|
||||
import { orderViews } from './orderViews';
|
||||
import { Dialog } from './Dialog';
|
||||
import { queues, useRead } from './orderReads';
|
||||
import { LedgerButton } from '../../components/BusinessControls';
|
||||
|
||||
const stop = (e: SyntheticEvent) => {
|
||||
e.stopPropagation();
|
||||
@@ -59,19 +60,19 @@ function DetailNavigation({
|
||||
const i = ids.indexOf(id);
|
||||
return (
|
||||
<div className="order-detail-navigation-row" role="group" aria-label="切换订单">
|
||||
<button data-action="order-detail-prev" disabled={blocked || i <= 0} onClick={() => open(ids[i - 1])}>
|
||||
<LedgerButton data-action="order-detail-prev" disabled={blocked || i <= 0} onClick={() => open(ids[i - 1])}>
|
||||
← 上一条
|
||||
</button>
|
||||
</LedgerButton>
|
||||
<span aria-live="polite">
|
||||
{i + 1} / {ids.length}
|
||||
</span>
|
||||
<button
|
||||
<LedgerButton
|
||||
data-action="order-detail-next"
|
||||
disabled={blocked || i < 0 || i >= ids.length - 1}
|
||||
onClick={() => open(ids[i + 1])}
|
||||
>
|
||||
下一条 →
|
||||
</button>
|
||||
</LedgerButton>
|
||||
<small>按当前筛选后的销售订单顺序查看</small>
|
||||
</div>
|
||||
);
|
||||
@@ -526,12 +527,12 @@ export function OrderActionDialog({
|
||||
panel = (
|
||||
<>
|
||||
<fieldset disabled>{panel}</fieldset>
|
||||
<button type="button" onClick={refreshDetail}>
|
||||
<LedgerButton type="button" onClick={refreshDetail}>
|
||||
重新读取订单
|
||||
</button>
|
||||
<button type="button" onClick={clearForm} disabled={client.busy}>
|
||||
</LedgerButton>
|
||||
<LedgerButton type="button" onClick={clearForm} disabled={client.busy}>
|
||||
收起
|
||||
</button>
|
||||
</LedgerButton>
|
||||
</>
|
||||
);
|
||||
return (
|
||||
@@ -539,7 +540,7 @@ export function OrderActionDialog({
|
||||
<div id="order-content" onClick={onClick} onChange={onChange} onSubmit={submit}>
|
||||
{details.error ? (
|
||||
<p role="alert">
|
||||
{details.error} <button onClick={refreshDetail}>重新读取</button>
|
||||
{details.error} <LedgerButton onClick={refreshDetail}>重新读取</LedgerButton>
|
||||
</p>
|
||||
) : !order ? (
|
||||
'正在读取订单…'
|
||||
|
||||
@@ -20,6 +20,7 @@ import { useOrderForm } from '../CreateOrder/useOrderForm';
|
||||
import { EditLine, EditFees, Input, Choice } from './EditFields';
|
||||
import { isRecord, errorMessage, errorStatus } from './readOrder';
|
||||
import { useRead } from './orderReads';
|
||||
import { LedgerButton, LedgerDataTable, LedgerInput, LedgerTextArea } from '../../components/BusinessControls';
|
||||
|
||||
interface SavedEdit {
|
||||
id: string;
|
||||
@@ -160,25 +161,18 @@ function ConflictPanel({
|
||||
{order.date} · {order.customer || '未填客户称呼'} · 开单人 {order.salesperson} · {order.payment_account} ·
|
||||
成交 {Model.orderAmount(order.total, order.rounding_mode)}
|
||||
</p>
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
{['商品', '克重/数量', '成交金额', '货品成本'].map(label => (
|
||||
<th key={label}>{label}</th>
|
||||
))}
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{order.lines.map((line, i) => (
|
||||
<tr key={i}>
|
||||
<td>{line.name}</td>
|
||||
<td>{line.unit === 'g' ? Model.grams(line.quantity) + 'g' : line.quantity + '件'}</td>
|
||||
<td>¥{Model.yuan(line.sale)}</td>
|
||||
<td>{line.cost == null ? '待补' : '¥' + Model.yuan(line.cost)}</td>
|
||||
</tr>
|
||||
))}
|
||||
</tbody>
|
||||
</table>
|
||||
<LedgerDataTable
|
||||
columns={[{ title: '商品' }, { title: '克重/数量' }, { title: '成交金额' }, { title: '货品成本' }]}
|
||||
rows={order.lines.map((line, i) => ({
|
||||
key: i,
|
||||
cells: [
|
||||
line.name,
|
||||
line.unit === 'g' ? Model.grams(line.quantity) + 'g' : line.quantity + '件',
|
||||
<>¥{Model.yuan(line.sale)}</>,
|
||||
line.cost == null ? '待补' : '¥' + Model.yuan(line.cost),
|
||||
],
|
||||
}))}
|
||||
/>
|
||||
<p>
|
||||
实际费用 ¥{Model.yuan(order.directCost)};客户单备注:{order.note || '无'}
|
||||
</p>
|
||||
@@ -189,17 +183,17 @@ function ConflictPanel({
|
||||
)}
|
||||
<div className="actions">
|
||||
{order ? (
|
||||
<button disabled={disabled} data-action="keep-order-edit" onClick={() => read('keep')}>
|
||||
<LedgerButton disabled={disabled} data-action="keep-order-edit" onClick={() => read('keep')}>
|
||||
已核对,保留草稿继续修改
|
||||
</button>
|
||||
</LedgerButton>
|
||||
) : (
|
||||
<button disabled={disabled} data-action="reload-order-edit" onClick={() => read('review')}>
|
||||
<LedgerButton disabled={disabled} data-action="reload-order-edit" onClick={() => read('review')}>
|
||||
读取最新订单供核对
|
||||
</button>
|
||||
</LedgerButton>
|
||||
)}
|
||||
<button disabled={disabled} data-action="reset-order-edit" onClick={() => read('reset')}>
|
||||
<LedgerButton disabled={disabled} data-action="reset-order-edit" onClick={() => read('reset')}>
|
||||
改用当前订单内容
|
||||
</button>
|
||||
</LedgerButton>
|
||||
</div>
|
||||
</section>
|
||||
);
|
||||
@@ -356,8 +350,8 @@ export function OrderEditPage({ client, state, session, refreshState, registerLe
|
||||
<div className="business-pages">
|
||||
<h1>订单修改已保存</h1>
|
||||
<p>已更新原订单,原单号保留。</p>
|
||||
<button onClick={go}>查看修改后的订单</button>
|
||||
<button onClick={() => navigate('orders')}>重新读取订单</button>
|
||||
<LedgerButton onClick={go}>查看修改后的订单</LedgerButton>
|
||||
<LedgerButton onClick={() => navigate('orders')}>重新读取订单</LedgerButton>
|
||||
{error && <p role="alert">{error}</p>}
|
||||
</div>
|
||||
);
|
||||
@@ -366,24 +360,24 @@ export function OrderEditPage({ client, state, session, refreshState, registerLe
|
||||
<div className="business-pages">
|
||||
<h1>修改订单</h1>
|
||||
<p>{id ? error || '正在读取已记录的订单…' : '请选择要修改的订单。'}</p>
|
||||
<button disabled={reading} onClick={() => read()}>
|
||||
<LedgerButton disabled={reading} onClick={() => read()}>
|
||||
重新读取订单
|
||||
</button>
|
||||
<button onClick={() => navigate('orders')}>返回订单列表</button>
|
||||
</LedgerButton>
|
||||
<LedgerButton onClick={() => navigate('orders')}>返回订单列表</LedgerButton>
|
||||
</div>
|
||||
);
|
||||
const serverFeedback = error && (
|
||||
<div role="alert" className="error">
|
||||
{error}
|
||||
{entry.conflicted && !entry.latest && (
|
||||
<button
|
||||
<LedgerButton
|
||||
type="button"
|
||||
data-action="reload-order-edit"
|
||||
disabled={reading || client.busy || !!client.pending()}
|
||||
onClick={() => read('review')}
|
||||
>
|
||||
读取最新订单供核对
|
||||
</button>
|
||||
</LedgerButton>
|
||||
)}
|
||||
</div>
|
||||
);
|
||||
@@ -522,7 +516,7 @@ function EditForm({
|
||||
['returning', '老客户'],
|
||||
].map(([k, l]) => (
|
||||
<label key={k}>
|
||||
<input
|
||||
<LedgerInput
|
||||
type="radio"
|
||||
name="customer_type"
|
||||
value={k}
|
||||
@@ -547,7 +541,7 @@ function EditForm({
|
||||
<>
|
||||
<label>
|
||||
内部备注(客户不可见)<span className="small muted">必填,至少3个字符(含#号),最多500字</span>
|
||||
<textarea
|
||||
<LedgerTextArea
|
||||
name="internal_note"
|
||||
rows={3}
|
||||
required
|
||||
@@ -559,20 +553,20 @@ function EditForm({
|
||||
/>
|
||||
</label>
|
||||
{(Model.filterNoteTags(tags.value?.tags || [], form.internal_note) || []).map(tag => (
|
||||
<button
|
||||
<LedgerButton
|
||||
key={tag}
|
||||
type="button"
|
||||
onClick={() => set('internal_note')(Model.insertNoteTag(form.internal_note, tag))}
|
||||
>
|
||||
{tag}
|
||||
</button>
|
||||
</LedgerButton>
|
||||
))}
|
||||
</>
|
||||
);
|
||||
const note = (
|
||||
<label>
|
||||
客户单备注
|
||||
<textarea
|
||||
<LedgerTextArea
|
||||
name="note"
|
||||
maxLength={240}
|
||||
rows={finance ? 2 : 3}
|
||||
@@ -591,9 +585,9 @@ function EditForm({
|
||||
{entry.order.paper_number || entry.order.number} · {entry.order.date}
|
||||
</p>
|
||||
</div>
|
||||
<button type="button" onClick={go}>
|
||||
<LedgerButton type="button" onClick={go}>
|
||||
取消修改
|
||||
</button>
|
||||
</LedgerButton>
|
||||
</div>
|
||||
<div className="note" id="order-edit-save-intro">
|
||||
{(approval ? '店主复核同意后' : '保存后') +
|
||||
@@ -608,9 +602,9 @@ function EditForm({
|
||||
>
|
||||
{finance ? (
|
||||
<>
|
||||
<input type="hidden" name="rounding_mode" value={form.rounding_mode} />
|
||||
<input type="hidden" name="orderId" value={entry.id} />
|
||||
<input type="hidden" name="revision" value={entry.revision} />
|
||||
<LedgerInput type="hidden" name="rounding_mode" value={form.rounding_mode} />
|
||||
<LedgerInput type="hidden" name="orderId" value={entry.id} />
|
||||
<LedgerInput type="hidden" name="revision" value={entry.revision} />
|
||||
<section className="panel">
|
||||
<div className="panel-title">
|
||||
<h2>客户与单据</h2>
|
||||
@@ -665,9 +659,9 @@ function EditForm({
|
||||
{...{ index, line, state, ctx, form, update: change, reloadPools: loadPools, error: setError }}
|
||||
/>
|
||||
))}
|
||||
<button type="button" onClick={() => change(f => Model.addLine(f, ctx))}>
|
||||
<LedgerButton type="button" onClick={() => change(f => Model.addLine(f, ctx))}>
|
||||
+ 添加商品
|
||||
</button>
|
||||
</LedgerButton>
|
||||
{poolError && <p role="alert">{poolError}</p>}
|
||||
</section>
|
||||
<EditFees {...{ store, state, update: change }} />
|
||||
@@ -708,7 +702,7 @@ function EditForm({
|
||||
</p>
|
||||
<label>
|
||||
修改原因
|
||||
<textarea
|
||||
<LedgerTextArea
|
||||
name="edit_reason"
|
||||
required
|
||||
rows={2}
|
||||
@@ -719,7 +713,7 @@ function EditForm({
|
||||
/>
|
||||
</label>
|
||||
<label className="check">
|
||||
<input
|
||||
<LedgerInput
|
||||
type="checkbox"
|
||||
name="edit_verified"
|
||||
required
|
||||
@@ -731,12 +725,12 @@ function EditForm({
|
||||
: '已核实客户称呼、开单人及备注的本次更正。'}
|
||||
</label>
|
||||
<div className="form-actions">
|
||||
<button type="button" onClick={go}>
|
||||
<LedgerButton type="button" onClick={go}>
|
||||
取消修改
|
||||
</button>
|
||||
<button data-order-edit-submit disabled={blocked} className="primary" type="submit">
|
||||
</LedgerButton>
|
||||
<LedgerButton data-order-edit-submit disabled={blocked} className="primary" type="submit">
|
||||
{approval ? '提交修改申请' : '保存修改'}
|
||||
</button>
|
||||
</LedgerButton>
|
||||
</div>
|
||||
</section>
|
||||
<div id="order-error" aria-live="polite">
|
||||
|
||||
@@ -27,6 +27,7 @@ import { useCallback, useEffect, useState } from 'react';
|
||||
import { navigate, searchParam } from '../../lib/router';
|
||||
import { orderViews } from './orderViews';
|
||||
import { OrderActionDialog, IndependentAfterSale } from './OrderDialogs';
|
||||
import { LedgerButton, LedgerInput, LedgerSelect } from '../../components/BusinessControls';
|
||||
|
||||
function initialFilters(state: LedgerState): Filters {
|
||||
const defaults: Filters = { mode: 'today', date: '', from: '', to: '', q: '', status: '', member: '', pocket: '' };
|
||||
@@ -304,26 +305,26 @@ export function OrdersPage({ client, state, session, refreshState, saleListStatu
|
||||
</summary>
|
||||
<div className="order-review-options">
|
||||
{queues.map(([kind, , name, action, id], i) => (
|
||||
<button key={kind} type="button" id={id} data-action={action}>
|
||||
<LedgerButton key={kind} type="button" id={id} data-action={action}>
|
||||
{name}
|
||||
{kind === 'after-sale' ? (state.user.role === 'owner' ? '复核' : '申请') : ''}(
|
||||
{counts.value?.[i] ?? '…'})
|
||||
</button>
|
||||
</LedgerButton>
|
||||
))}
|
||||
</div>
|
||||
</details>
|
||||
<button type="button" data-action="new-after-sale">
|
||||
<LedgerButton type="button" data-action="new-after-sale">
|
||||
新增售后费用
|
||||
</button>
|
||||
<button type="button" data-action="refresh">
|
||||
</LedgerButton>
|
||||
<LedgerButton type="button" data-action="refresh">
|
||||
刷新
|
||||
</button>
|
||||
</LedgerButton>
|
||||
</div>
|
||||
</div>
|
||||
<div className="order-book-dates">
|
||||
<div className="order-period-buttons" role="group" aria-label="订单日期">
|
||||
{views.orderBookPeriodOptions.map(([value, name]) => (
|
||||
<button
|
||||
<LedgerButton
|
||||
type="button"
|
||||
key={value}
|
||||
data-action="order-period"
|
||||
@@ -331,12 +332,12 @@ export function OrdersPage({ client, state, session, refreshState, saleListStatu
|
||||
aria-pressed={value === filters.mode}
|
||||
>
|
||||
{name}
|
||||
</button>
|
||||
</LedgerButton>
|
||||
))}
|
||||
</div>
|
||||
<label id="order-single-date" hidden={filters.mode !== 'date'}>
|
||||
指定日期
|
||||
<input
|
||||
<LedgerInput
|
||||
type="date"
|
||||
id="order-date"
|
||||
value={filters.mode === 'date' ? filters.date : range?.date || state.today}
|
||||
@@ -350,7 +351,7 @@ export function OrdersPage({ client, state, session, refreshState, saleListStatu
|
||||
{(['from', 'to'] as const).map((key, i) => (
|
||||
<label key={key}>
|
||||
{i ? '结束' : '开始'}日期
|
||||
<input
|
||||
<LedgerInput
|
||||
type="date"
|
||||
id={'order-' + key}
|
||||
value={filters[key]}
|
||||
@@ -372,7 +373,7 @@ export function OrdersPage({ client, state, session, refreshState, saleListStatu
|
||||
</details>
|
||||
<section className="panel order-book-panel">
|
||||
<div className="filters order-book-filters">
|
||||
<input
|
||||
<LedgerInput
|
||||
id="order-search"
|
||||
aria-label="搜索订单(单号、客户、商品或克重)"
|
||||
value={filters.q}
|
||||
@@ -380,35 +381,35 @@ export function OrdersPage({ client, state, session, refreshState, saleListStatu
|
||||
maxLength={100}
|
||||
onChange={e => filter({ q: e.target.value })}
|
||||
/>
|
||||
<select
|
||||
<LedgerSelect
|
||||
id="order-filter"
|
||||
aria-label="筛选状态"
|
||||
value={filters.status}
|
||||
onChange={e => filter({ status: e.target.value })}
|
||||
>
|
||||
{options(views.orderBookStatusOptions)}
|
||||
</select>
|
||||
</LedgerSelect>
|
||||
<label>
|
||||
出货货盘
|
||||
<select
|
||||
<LedgerSelect
|
||||
id="order-pocket-filter"
|
||||
aria-label="出货货盘"
|
||||
value={filters.pocket}
|
||||
onChange={e => filter({ pocket: e.target.value })}
|
||||
>
|
||||
{options(views.orderBookPocketOptions())}
|
||||
</select>
|
||||
</LedgerSelect>
|
||||
</label>
|
||||
{state.user.role === 'owner' && memberOptions.length > 0 && (
|
||||
<label>
|
||||
订单归属
|
||||
<select
|
||||
<LedgerSelect
|
||||
id="order-member-filter"
|
||||
value={filters.member}
|
||||
onChange={e => filter({ member: e.target.value })}
|
||||
>
|
||||
{options([['', '全部成员'], ...memberOptions])}
|
||||
</select>
|
||||
</LedgerSelect>
|
||||
</label>
|
||||
)}
|
||||
<span id="order-book-count">{content?.count}</span>
|
||||
@@ -418,7 +419,7 @@ export function OrdersPage({ client, state, session, refreshState, saleListStatu
|
||||
<div id="order-list" aria-live="polite">
|
||||
{bookError ? (
|
||||
<p role="alert">
|
||||
{bookError} <button onClick={refresh}>重新读取</button>
|
||||
{bookError} <LedgerButton onClick={refresh}>重新读取</LedgerButton>
|
||||
</p>
|
||||
) : (
|
||||
(content?.list ?? '正在读取订单…')
|
||||
@@ -435,7 +436,7 @@ export function OrdersPage({ client, state, session, refreshState, saleListStatu
|
||||
<p className="small muted">{queueInfo[3]}</p>
|
||||
{list.error ? (
|
||||
<p>
|
||||
{list.error} <button onClick={refresh}>重新读取</button>
|
||||
{list.error} <LedgerButton onClick={refresh}>重新读取</LedgerButton>
|
||||
</p>
|
||||
) : (
|
||||
review || '正在读取…'
|
||||
|
||||
@@ -2,6 +2,7 @@ import { useState } from 'react';
|
||||
import { Calc as LedgerCalc } from '../../../shared';
|
||||
import type { OrderLine } from '../orderData';
|
||||
import type { SharedViews } from '../viewTypes';
|
||||
import { LedgerInput, LedgerSelect } from '../../../components/BusinessControls';
|
||||
type CostModeKey = 'material' | 'labor';
|
||||
type CostInputs = Record<string, string>;
|
||||
type LineProps = { line: OrderLine; index: number; members: SharedViews['teamMemberOptions']; fallback: string } & Pick<
|
||||
@@ -64,7 +65,7 @@ export function LegacyCostRow({ line, index, members, fallback, choice, opts, gr
|
||||
const amount = (key: string, title: string, value: string, gram = false) => (
|
||||
<label>
|
||||
{title}
|
||||
<input
|
||||
<LedgerInput
|
||||
type="number"
|
||||
name={prefix + key}
|
||||
min="0"
|
||||
@@ -116,7 +117,7 @@ export function LegacyCostRow({ line, index, members, fallback, choice, opts, gr
|
||||
<div className="grid purchase-cost-grid">
|
||||
<label>
|
||||
{material ? '进货料费方式' : '进货工费方式'}
|
||||
<select
|
||||
<LedgerSelect
|
||||
name={prefix + key + 'Mode'}
|
||||
value={modes[key]}
|
||||
onChange={event => updateMode(key, event.target.value, value)}
|
||||
@@ -125,11 +126,11 @@ export function LegacyCostRow({ line, index, members, fallback, choice, opts, gr
|
||||
{material ? '按克料价' : '克工费'}
|
||||
</option>
|
||||
<option value="total">{material ? '直接填总料费' : '总工费'}</option>
|
||||
</select>
|
||||
</LedgerSelect>
|
||||
</label>
|
||||
<label hidden={!gram}>
|
||||
{material ? '进货料价(元/克)' : '进货克工费(元/克)'}
|
||||
<input
|
||||
<LedgerInput
|
||||
type="number"
|
||||
name={prefix + key + 'Rate'}
|
||||
min="0"
|
||||
@@ -144,7 +145,7 @@ export function LegacyCostRow({ line, index, members, fallback, choice, opts, gr
|
||||
{amount(key, material ? '料费成本合计(元)' : '进货总工费(元)', value, gram)}
|
||||
<label className="purchase-payer">
|
||||
{material ? '料费付款人' : '进货工费付款人'}
|
||||
<select
|
||||
<LedgerSelect
|
||||
required
|
||||
name={prefix + key + 'Payer'}
|
||||
defaultValue={options.some(([id]) => id === payer) ? payer : ''}
|
||||
@@ -155,7 +156,7 @@ export function LegacyCostRow({ line, index, members, fallback, choice, opts, gr
|
||||
</option>
|
||||
)}
|
||||
{opts(options)}
|
||||
</select>
|
||||
</LedgerSelect>
|
||||
</label>
|
||||
</div>
|
||||
<p className="purchase-formula small muted" aria-live="polite">
|
||||
|
||||
@@ -10,6 +10,14 @@ import type {
|
||||
import type { OrderContext, SharedViews } from '../viewTypes';
|
||||
import { Children } from 'react';
|
||||
import { Calc as LedgerCalc, Values } from '../../../shared';
|
||||
import {
|
||||
LedgerButton,
|
||||
LedgerDataTable,
|
||||
LedgerInput,
|
||||
LedgerSelect,
|
||||
LedgerTable,
|
||||
LedgerTextArea,
|
||||
} from '../../../components/BusinessControls';
|
||||
function object(value: unknown): value is Record<string, unknown> {
|
||||
return value !== null && typeof value === 'object' && !Array.isArray(value);
|
||||
}
|
||||
@@ -84,11 +92,17 @@ export function afterSales(
|
||||
<h3>{kind === 'approve' ? '同意售后修改' : '驳回售后修改'}</h3>
|
||||
<label>
|
||||
{kind === 'approve' ? '复核备注(选填)' : '驳回意见'}
|
||||
<textarea disabled={ui.blocked} name="note" rows={2} maxLength={200} required={kind === 'reject'}></textarea>
|
||||
<LedgerTextArea
|
||||
disabled={ui.blocked}
|
||||
name="note"
|
||||
rows={2}
|
||||
maxLength={200}
|
||||
required={kind === 'reject'}
|
||||
></LedgerTextArea>
|
||||
</label>
|
||||
{kind === 'approve' ? (
|
||||
<label className="check">
|
||||
<input disabled={ui.blocked} type="checkbox" name="verified" required />
|
||||
<LedgerInput disabled={ui.blocked} type="checkbox" name="verified" required />
|
||||
已核对原值、申请值、日期、金额和付款人。
|
||||
</label>
|
||||
) : (
|
||||
@@ -96,9 +110,9 @@ export function afterSales(
|
||||
)}
|
||||
<div className="form-actions">
|
||||
{button('取消', 'after-sale-review-cancel', 'quiet', { disabled: ui.busy })}
|
||||
<button type="submit" disabled={ui.blocked} className={kind === 'approve' ? 'primary' : ''}>
|
||||
<LedgerButton type="submit" disabled={ui.blocked} className={kind === 'approve' ? 'primary' : ''}>
|
||||
{kind === 'approve' ? '确认同意修改' : '确认驳回申请'}
|
||||
</button>
|
||||
</LedgerButton>
|
||||
</div>
|
||||
</form>
|
||||
);
|
||||
@@ -107,9 +121,9 @@ export function afterSales(
|
||||
const canReview = state.user.role === 'owner' && request.status === 'pending';
|
||||
return (
|
||||
<>
|
||||
<button className="dialog-close" data-action="after-sale-changes-close" aria-label="关闭售后修改复核">
|
||||
<LedgerButton className="dialog-close" data-action="after-sale-changes-close" aria-label="关闭售后修改复核">
|
||||
×
|
||||
</button>
|
||||
</LedgerButton>
|
||||
<h2 id="after-sale-changes-title">售后修改{request.status === 'pending' ? '复核' : '记录'}</h2>
|
||||
<div className="actions">{button('返回申请列表', 'after-sale-changes-reload', 'quiet')}</div>
|
||||
<p>
|
||||
@@ -247,7 +261,7 @@ export function afterSales(
|
||||
};
|
||||
return (
|
||||
<div className="table-wrap after-sale-comparison">
|
||||
<table className="order-change-table" aria-label="售后修改原值与申请值对照">
|
||||
<LedgerTable className="order-change-table" aria-label="售后修改原值与申请值对照">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>核对项目</th>
|
||||
@@ -262,7 +276,7 @@ export function afterSales(
|
||||
{pair('金额', 'amount', value => '¥' + yuan(Number(value)))}
|
||||
{pair('谁支付', 'payer', teamMemberName)}
|
||||
</tbody>
|
||||
</table>
|
||||
</LedgerTable>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
@@ -288,9 +302,9 @@ export function afterSales(
|
||||
);
|
||||
return (
|
||||
<>
|
||||
<button className="dialog-close" data-action="close-after-sale" aria-label="关闭售后记录">
|
||||
<LedgerButton className="dialog-close" data-action="close-after-sale" aria-label="关闭售后记录">
|
||||
×
|
||||
</button>
|
||||
</LedgerButton>
|
||||
<h2 id="after-sale-title">修改售后</h2>
|
||||
{detail.permissions.canEdit ? (
|
||||
<form id="after-sale-edit-form" data-id={record.id} data-approval={String(ui.approval)}>
|
||||
@@ -321,7 +335,12 @@ export function afterSales(
|
||||
</div>
|
||||
<label>
|
||||
修改说明(选填)
|
||||
<textarea name="reason" rows={2} maxLength={200} placeholder="例如:售后金额或付款人录错。"></textarea>
|
||||
<LedgerTextArea
|
||||
name="reason"
|
||||
rows={2}
|
||||
maxLength={200}
|
||||
placeholder="例如:售后金额或付款人录错。"
|
||||
></LedgerTextArea>
|
||||
</label>
|
||||
</fieldset>
|
||||
<div id="after-sale-edit-error" aria-live="polite">
|
||||
@@ -331,9 +350,9 @@ export function afterSales(
|
||||
<span className="small muted">金额可填 0。归属沿用原记录。</span>
|
||||
<div className="actions">
|
||||
{button('取消', 'close-after-sale', 'quiet', { disabled: ui.busy })}
|
||||
<button type="submit" disabled={ui.blocked} className="primary">
|
||||
<LedgerButton type="submit" disabled={ui.blocked} className="primary">
|
||||
{ui.approval ? '提交修改申请' : '直接保存修改'}
|
||||
</button>
|
||||
</LedgerButton>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
@@ -364,17 +383,17 @@ export function afterSales(
|
||||
) : (
|
||||
<label>
|
||||
订单归属(经营款与业绩)
|
||||
<input defaultValue={teamMemberName(selected)} readOnly />
|
||||
<input type="hidden" name="member" defaultValue={selected} />
|
||||
<LedgerInput defaultValue={teamMemberName(selected)} readOnly />
|
||||
<LedgerInput type="hidden" name="member" defaultValue={selected} />
|
||||
</label>
|
||||
);
|
||||
}
|
||||
function newIndependentSale() {
|
||||
return (
|
||||
<>
|
||||
<button className="dialog-close" data-action="close-after-sale" aria-label="关闭新增售后">
|
||||
<LedgerButton className="dialog-close" data-action="close-after-sale" aria-label="关闭新增售后">
|
||||
×
|
||||
</button>
|
||||
</LedgerButton>
|
||||
<h2 id="after-sale-title">新增售后</h2>
|
||||
<p className="small muted">售后费用计入所选日期,并扣减当天利润。</p>
|
||||
<form id="after-sale-form">
|
||||
@@ -397,12 +416,12 @@ export function afterSales(
|
||||
{orderMemberField()}
|
||||
<label>
|
||||
谁支付
|
||||
<select name="payer" required defaultValue="">
|
||||
<LedgerSelect name="payer" required defaultValue="">
|
||||
<option value="" disabled>
|
||||
请选择
|
||||
</option>
|
||||
{opts(teamMemberOptions())}
|
||||
</select>
|
||||
</LedgerSelect>
|
||||
</label>
|
||||
</div>
|
||||
<div id="after-sale-error" aria-live="polite">
|
||||
@@ -412,9 +431,9 @@ export function afterSales(
|
||||
<span className="small muted">金额可填 0,请按实际支出填写。</span>
|
||||
<div className="actions">
|
||||
{button('取消', 'close-after-sale', 'quiet')}
|
||||
<button className="primary" type="submit">
|
||||
<LedgerButton className="primary" type="submit">
|
||||
保存售后
|
||||
</button>
|
||||
</LedgerButton>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
@@ -648,13 +667,13 @@ export function afterSales(
|
||||
})}
|
||||
<label>
|
||||
售后原因
|
||||
<textarea
|
||||
<LedgerTextArea
|
||||
name="reason"
|
||||
rows={2}
|
||||
maxLength={200}
|
||||
required
|
||||
placeholder="填写客户实际退货退款原因。"
|
||||
></textarea>
|
||||
></LedgerTextArea>
|
||||
</label>
|
||||
</div>
|
||||
<section className="order-after-sale-products">
|
||||
@@ -678,13 +697,13 @@ export function afterSales(
|
||||
</div>
|
||||
<label>
|
||||
扣留款原因
|
||||
<textarea
|
||||
<LedgerTextArea
|
||||
name="deduction_reason"
|
||||
required={ui.reasonRequired}
|
||||
rows={2}
|
||||
maxLength={200}
|
||||
placeholder="有扣留款时填写,如约定扣除不可退工费或实际损耗。"
|
||||
></textarea>
|
||||
></LedgerTextArea>
|
||||
</label>
|
||||
<p className="small muted">扣留款与支付渠道手续费分开核对。原单已经发生的支付手续费、邮费等成本继续保留。</p>
|
||||
</section>
|
||||
@@ -697,9 +716,14 @@ export function afterSales(
|
||||
<div id="order-after-sale-expenses">{ui.expenses}</div>
|
||||
</section>
|
||||
<div className="form-actions">
|
||||
<button type="button" className="primary" data-action="order-after-sale-preview" disabled={ui.previewLoading}>
|
||||
<LedgerButton
|
||||
type="button"
|
||||
className="primary"
|
||||
data-action="order-after-sale-preview"
|
||||
disabled={ui.previewLoading}
|
||||
>
|
||||
核对售后预览
|
||||
</button>
|
||||
</LedgerButton>
|
||||
<span className="small muted" id="order-after-sale-preview-status" aria-live="polite">
|
||||
{ui.previewStatus || '填好后先预览,核对回库、回料、退款和利润。'}
|
||||
</span>
|
||||
@@ -711,23 +735,23 @@ export function afterSales(
|
||||
})}
|
||||
</div>
|
||||
<label className="check">
|
||||
<input type="checkbox" name="verified" required disabled={!ui.preview} />
|
||||
<LedgerInput type="checkbox" name="verified" required disabled={!ui.preview} />
|
||||
已按实际退回商品、退款凭据和新增成本,核对以下预览。
|
||||
</label>
|
||||
<div id="order-after-sale-error" aria-live="polite">
|
||||
{ui.afterError && (
|
||||
<div className="error">
|
||||
{ui.afterError}{' '}
|
||||
<button type="button" data-action="reload-order-change">
|
||||
<LedgerButton type="button" data-action="reload-order-change">
|
||||
重新读取订单
|
||||
</button>
|
||||
</LedgerButton>
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
<div className="form-actions">
|
||||
<button type="submit" className="primary" data-order-after-sale-submit="" disabled={!ui.preview}>
|
||||
<LedgerButton type="submit" className="primary" data-order-after-sale-submit="" disabled={!ui.preview}>
|
||||
{orderAfterSaleApproval(ui.date) ? '提交售后申请' : '确认并保存售后'}
|
||||
</button>
|
||||
</LedgerButton>
|
||||
{button('收起', 'order-after-sale-close', 'quiet')}
|
||||
</div>
|
||||
</form>
|
||||
@@ -826,49 +850,43 @@ export function afterSales(
|
||||
</div>
|
||||
{rows.length ? (
|
||||
<div className="table-wrap">
|
||||
<table className="change-list-table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>售后记录</th>
|
||||
<th>修改后日期</th>
|
||||
<th>申请人</th>
|
||||
<th>申请时间</th>
|
||||
<th>状态</th>
|
||||
<th>操作</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{Children.toArray(
|
||||
rows.map(request => (
|
||||
<tr>
|
||||
<td>
|
||||
<strong>{request.before.customer}</strong>
|
||||
<div className="small muted">
|
||||
{request.before.date} · {request.before.project}
|
||||
</div>
|
||||
</td>
|
||||
<td>{request.after.date}</td>
|
||||
<td>{request.requesterName || '未提供'}</td>
|
||||
<td>{afterSaleTime(request.created)}</td>
|
||||
<td>
|
||||
{afterSaleStatus(request)}
|
||||
{request.stale ? <div className="small danger-text">原记录已有变动</div> : ''}
|
||||
</td>
|
||||
<td>
|
||||
{button(
|
||||
state.user.role === 'owner' && request.status === 'pending' ? '查看并复核' : '查看修改',
|
||||
'after-sale-change-open',
|
||||
'',
|
||||
{
|
||||
'data-id': request.id,
|
||||
},
|
||||
)}
|
||||
</td>
|
||||
</tr>
|
||||
)),
|
||||
)}
|
||||
</tbody>
|
||||
</table>
|
||||
<LedgerDataTable
|
||||
className="change-list-table"
|
||||
columns={[
|
||||
{ title: '售后记录' },
|
||||
{ title: '修改后日期' },
|
||||
{ title: '申请人' },
|
||||
{ title: '申请时间' },
|
||||
{ title: '状态' },
|
||||
{ title: '操作' },
|
||||
]}
|
||||
rows={rows.map((request, rowIndex) => ({
|
||||
key: rowIndex,
|
||||
cells: [
|
||||
<>
|
||||
<strong>{request.before.customer}</strong>
|
||||
<div className="small muted">
|
||||
{request.before.date} · {request.before.project}
|
||||
</div>
|
||||
</>,
|
||||
request.after.date,
|
||||
request.requesterName || '未提供',
|
||||
afterSaleTime(request.created),
|
||||
<>
|
||||
{afterSaleStatus(request)}
|
||||
{request.stale ? <div className="small danger-text">原记录已有变动</div> : ''}
|
||||
</>,
|
||||
button(
|
||||
state.user.role === 'owner' && request.status === 'pending' ? '查看并复核' : '查看修改',
|
||||
'after-sale-change-open',
|
||||
'',
|
||||
{
|
||||
'data-id': request.id,
|
||||
},
|
||||
),
|
||||
],
|
||||
}))}
|
||||
/>
|
||||
</div>
|
||||
) : (
|
||||
<p className="empty">没有符合状态的售后修改申请。</p>
|
||||
|
||||
@@ -13,6 +13,7 @@ interface ActionInput extends Record<string, unknown> {
|
||||
import type { OrderContext, SharedViews } from '../viewTypes';
|
||||
import { Children } from 'react';
|
||||
import { Cards as CreditCardFees, Calc as LedgerCalc } from '../../../shared';
|
||||
import { LedgerButton, LedgerInput, LedgerSelect, LedgerTextArea } from '../../../components/BusinessControls';
|
||||
export function orderActions(
|
||||
{ currentOrder, ui = {}, state }: OrderContext,
|
||||
{
|
||||
@@ -143,18 +144,18 @@ export function orderActions(
|
||||
) : (
|
||||
<label>
|
||||
<span id="order-action-reason-label">{approval ? '申请原因' : '登记原因'}</span>
|
||||
<textarea
|
||||
<LedgerTextArea
|
||||
name="change_reason"
|
||||
maxLength={200}
|
||||
rows={2}
|
||||
required
|
||||
placeholder="写清本次需要登记或更正的原因。"
|
||||
></textarea>
|
||||
></LedgerTextArea>
|
||||
</label>
|
||||
)}
|
||||
{['cost', 'expense'].includes(kind) ? (
|
||||
<label className="check">
|
||||
<input type="checkbox" name="verified" required />
|
||||
<LedgerInput type="checkbox" name="verified" required />
|
||||
已核实本次金额、实际付款人与凭据一致。
|
||||
</label>
|
||||
) : (
|
||||
@@ -217,7 +218,7 @@ export function orderActions(
|
||||
<div className="credit-card-fields">
|
||||
<label>
|
||||
手续费(元,自动)
|
||||
<input
|
||||
<LedgerInput
|
||||
type="number"
|
||||
min="0"
|
||||
step="0.01"
|
||||
@@ -229,9 +230,9 @@ export function orderActions(
|
||||
</label>
|
||||
<label>
|
||||
手续费付款人
|
||||
<select name="credit_card_fee_payer" defaultValue={payer} required={!!visible} disabled={!visible}>
|
||||
<LedgerSelect name="credit_card_fee_payer" defaultValue={payer} required={!!visible} disabled={!visible}>
|
||||
{opts(teamMemberOptions())}
|
||||
</select>
|
||||
</LedgerSelect>
|
||||
</label>
|
||||
</div>
|
||||
<p className="small muted" data-credit-card-formula="" aria-live="polite">
|
||||
@@ -284,7 +285,7 @@ export function orderActions(
|
||||
{choice('收款方式', 'payment_method', methods, identity?.channel || '微信')}
|
||||
<label>
|
||||
收款人
|
||||
<select
|
||||
<LedgerSelect
|
||||
name="payment_recipient"
|
||||
key={card ? 'card' : 'standard'}
|
||||
defaultValue={card ? '麦麦' : ui.recipient || prefix}
|
||||
@@ -293,7 +294,7 @@ export function orderActions(
|
||||
disabled={card}
|
||||
>
|
||||
{opts(recipients)}
|
||||
</select>
|
||||
</LedgerSelect>
|
||||
{creditCardAvailable() ? (
|
||||
<small className="small muted payment-account-note" hidden={!card}>
|
||||
信用卡统一由{teamMemberName('owner')}收款。
|
||||
@@ -346,7 +347,7 @@ export function orderActions(
|
||||
)}
|
||||
</div>
|
||||
<label className="check">
|
||||
<input type="checkbox" name="verified" required />
|
||||
<LedgerInput type="checkbox" name="verified" required />
|
||||
已核实实际支付,没有发生的费用已填0。
|
||||
</label>
|
||||
</>
|
||||
@@ -378,7 +379,7 @@ export function orderActions(
|
||||
placeholder: '交易凭据末几位或说明',
|
||||
})}
|
||||
<label className="check">
|
||||
<input type="checkbox" name="verified" required />
|
||||
<LedgerInput type="checkbox" name="verified" required />
|
||||
已在实际账户核实{action === 'receipt' ? '到账' : '退款成功'},不是仅收到客户截图。
|
||||
</label>
|
||||
</>
|
||||
@@ -445,7 +446,7 @@ export function orderActions(
|
||||
补齐这张旧单的销售记账:按填写金额记录实际费用、从原货盘扣减黄金并计入销售与利润。款项未收齐或成本金额有空白时,请先补齐。
|
||||
</p>
|
||||
<label className="check">
|
||||
<input type="checkbox" name="verified" required />
|
||||
<LedgerInput type="checkbox" name="verified" required />
|
||||
已核实全额收款、商品已交付,所填费用为实际已付金额,没有发生的已填0。
|
||||
</label>
|
||||
</>
|
||||
@@ -494,7 +495,7 @@ export function orderActions(
|
||||
本入口办理整单退货,原销售额与货品成本在退货日冲回。已花费的运费等仍保留。换货先退原单,再开新单;部分退货暂未开放。
|
||||
</div>
|
||||
<label className="check">
|
||||
<input type="checkbox" name="verified" required />
|
||||
<LedgerInput type="checkbox" name="verified" required />
|
||||
已核实本单全部商品退回,所选去向与实际一致。
|
||||
</label>
|
||||
</>
|
||||
@@ -539,7 +540,7 @@ export function orderActions(
|
||||
: `货款待结 ¥${yuan(o.costDue)};利润待结 ¥${yuan(o.profitDue)}(负数为${teamMemberName('owner')}需转回)。`}
|
||||
</p>
|
||||
<label className="check">
|
||||
<input type="checkbox" name="verified" required />
|
||||
<LedgerInput type="checkbox" name="verified" required />
|
||||
已核实各人实际转账,不是仅记录计划交款。
|
||||
</label>
|
||||
</>
|
||||
@@ -590,9 +591,9 @@ export function orderActions(
|
||||
{moneyField('更正后金额(元)', 'amount')}
|
||||
<label>
|
||||
更正后收退款账户(仅收退款)
|
||||
<select name="account" defaultValue="助理微信">
|
||||
<LedgerSelect name="account" defaultValue="助理微信">
|
||||
{opts(activePaymentAccounts())}
|
||||
</select>
|
||||
</LedgerSelect>
|
||||
<small className="small muted correction-card-note" hidden={!isCreditCardAccount(ui.values?.account)}>
|
||||
信用卡统一由{teamMemberName('owner')}收款。
|
||||
</small>
|
||||
@@ -622,7 +623,7 @@ export function orderActions(
|
||||
maxLength: 200,
|
||||
})}
|
||||
<label className="check">
|
||||
<input type="checkbox" name="verified" required />
|
||||
<LedgerInput type="checkbox" name="verified" required />
|
||||
已核实原凭据,这次是修正登记错误。
|
||||
</label>
|
||||
</>
|
||||
@@ -662,9 +663,9 @@ export function orderActions(
|
||||
<div className="error">
|
||||
{ui.actionError}
|
||||
{ui.retryKey && (
|
||||
<button type="submit" formNoValidate data-retry-key={ui.retryKey} disabled={!!ui.retryBusy}>
|
||||
<LedgerButton type="submit" formNoValidate data-retry-key={ui.retryKey} disabled={!!ui.retryBusy}>
|
||||
恢复原操作
|
||||
</button>
|
||||
</LedgerButton>
|
||||
)}
|
||||
{ui.stale && <> {button('重新读取订单后申请', 'reload-order-change')}</>}
|
||||
</div>
|
||||
@@ -675,7 +676,7 @@ export function orderActions(
|
||||
html
|
||||
)}
|
||||
<div className="form-actions">
|
||||
<button
|
||||
<LedgerButton
|
||||
className="primary"
|
||||
disabled={!!ui.stale || !!ui.actionBlocked}
|
||||
{...(changeForm
|
||||
@@ -685,7 +686,7 @@ export function orderActions(
|
||||
: {})}
|
||||
>
|
||||
{requiresApproval ? '提交变更申请' : changeForm ? '核实并保存' : '确认保存'}
|
||||
</button>
|
||||
</LedgerButton>
|
||||
{button('收起', 'hide-action', 'quiet')}
|
||||
</div>
|
||||
</form>
|
||||
|
||||
@@ -3,6 +3,7 @@ import type { BookData, BookRow, BookSummary, LockActivity, MoneyKey } from '../
|
||||
import type { OrderContext, SharedViews } from '../viewTypes';
|
||||
import { Children, Fragment } from 'react';
|
||||
import { Values } from '../../../shared';
|
||||
import { LedgerButton, LedgerDataTable, LedgerTable } from '../../../components/BusinessControls';
|
||||
export function orderBook(
|
||||
{ orderBookFilters, state }: OrderContext,
|
||||
{
|
||||
@@ -84,37 +85,34 @@ export function orderBook(
|
||||
<details>
|
||||
<summary>查看 {rows.length} 项收付记录</summary>
|
||||
<div className="table-wrap">
|
||||
<table className="lock-activity-table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>日期/锁价单</th>
|
||||
<th>项目/客户</th>
|
||||
<th>账户/付款人</th>
|
||||
<th className="number">金额</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{Children.toArray(
|
||||
rows.map(item => (
|
||||
<tr>
|
||||
<td>
|
||||
{item.date}
|
||||
<br />
|
||||
<button className="link-button" data-action="open-price-lock" data-id={item.price_lock_id}>
|
||||
{item.number || '锁价记录'}
|
||||
</button>
|
||||
</td>
|
||||
<td>
|
||||
{item.activityType} · {item.activityName}
|
||||
<div className="small muted">{item.customer}</div>
|
||||
</td>
|
||||
<td>{item.who}</td>
|
||||
<td className="number">{item.amount == null ? '待补齐' : '¥' + yuan(item.amount)}</td>
|
||||
</tr>
|
||||
)),
|
||||
)}
|
||||
</tbody>
|
||||
</table>
|
||||
<LedgerDataTable
|
||||
className="lock-activity-table"
|
||||
columns={[
|
||||
{ title: '日期/锁价单' },
|
||||
{ title: '项目/客户' },
|
||||
{ title: '账户/付款人' },
|
||||
{ title: '金额', headerClassName: 'number' },
|
||||
]}
|
||||
rows={rows.map((item, rowIndex) => ({
|
||||
key: rowIndex,
|
||||
cellClasses: [undefined, undefined, undefined, 'number'],
|
||||
cells: [
|
||||
<>
|
||||
{item.date}
|
||||
<br />
|
||||
<LedgerButton className="link-button" data-action="open-price-lock" data-id={item.price_lock_id}>
|
||||
{item.number || '锁价记录'}
|
||||
</LedgerButton>
|
||||
</>,
|
||||
<>
|
||||
{item.activityType} · {item.activityName}
|
||||
<div className="small muted">{item.customer}</div>
|
||||
</>,
|
||||
item.who,
|
||||
item.amount == null ? '待补齐' : '¥' + yuan(item.amount),
|
||||
],
|
||||
}))}
|
||||
/>
|
||||
</div>
|
||||
</details>
|
||||
</section>
|
||||
@@ -383,7 +381,7 @@ export function orderBook(
|
||||
function orderBookIdentity(row: BookRow, version: number | undefined = undefined) {
|
||||
if (row.kind === 'orderAfterSale')
|
||||
return (
|
||||
<button
|
||||
<LedgerButton
|
||||
className="link-button order-book-link order-book-customer-first"
|
||||
data-action="open-order"
|
||||
data-id={row.order_id || row.id}
|
||||
@@ -391,12 +389,12 @@ export function orderBook(
|
||||
<strong className="order-book-customer-name">{row.customer || '未填称呼'}</strong>
|
||||
<span className="order-book-secondary muted">订单售后 · {row.paper_number || row.number}</span>
|
||||
<span className="small muted">查看原单售后结果</span>
|
||||
</button>
|
||||
</LedgerButton>
|
||||
);
|
||||
if (row.kind === 'recovery')
|
||||
return (
|
||||
<>
|
||||
<button
|
||||
<LedgerButton
|
||||
className="link-button order-book-link order-book-customer-first"
|
||||
data-action="recovery-open"
|
||||
data-id={row.recovery_id || row.id}
|
||||
@@ -407,7 +405,7 @@ export function orderBook(
|
||||
</span>
|
||||
<span className="order-book-secondary muted">{row.number}</span>
|
||||
<span className="order-book-recovery-payment">回收付款 ¥{yuan(row.cashPayment)}</span>
|
||||
</button>
|
||||
</LedgerButton>
|
||||
{button('打印', 'recovery-print', 'quiet order-book-recovery-print', {
|
||||
'data-id': row.recovery_id || row.id,
|
||||
'aria-label': '打印 ' + (row.customer || '客户') + ' 的回收单',
|
||||
@@ -434,7 +432,7 @@ export function orderBook(
|
||||
</div>
|
||||
);
|
||||
return (
|
||||
<button
|
||||
<LedgerButton
|
||||
className="link-button order-book-link order-book-customer-first"
|
||||
data-action="open-order"
|
||||
data-id={row.id}
|
||||
@@ -442,7 +440,7 @@ export function orderBook(
|
||||
>
|
||||
{customer}
|
||||
<span className="order-book-secondary muted">{row.paper_number || row.number}</span>
|
||||
</button>
|
||||
</LedgerButton>
|
||||
);
|
||||
}
|
||||
if (row.kind === 'afterSale')
|
||||
@@ -454,7 +452,7 @@ export function orderBook(
|
||||
</div>
|
||||
);
|
||||
return (
|
||||
<button
|
||||
<LedgerButton
|
||||
className="link-button order-book-link"
|
||||
data-action="open-order"
|
||||
data-id={row.id}
|
||||
@@ -462,7 +460,7 @@ export function orderBook(
|
||||
>
|
||||
<strong>{row.paper_number || row.number}</strong>
|
||||
<span>{row.customer || '未填称呼'}</span>
|
||||
</button>
|
||||
</LedgerButton>
|
||||
);
|
||||
}
|
||||
const card = (title: string, value: ReactNode, hint: ReactNode = '', emphasis = false) => (
|
||||
@@ -659,7 +657,7 @@ export function orderBook(
|
||||
}
|
||||
const table = (
|
||||
<div className="table-wrap order-book-table-wrap">
|
||||
<table className="order-book-table" aria-label={range.name + '订单账本'}>
|
||||
<LedgerTable className="order-book-table" aria-label={range.name + '订单账本'}>
|
||||
<thead>
|
||||
<tr>
|
||||
<th className="order-index">序号</th>
|
||||
@@ -805,7 +803,7 @@ export function orderBook(
|
||||
<td></td>
|
||||
</tr>
|
||||
</tfoot>
|
||||
</table>
|
||||
</LedgerTable>
|
||||
</div>
|
||||
);
|
||||
return {
|
||||
|
||||
@@ -6,6 +6,7 @@ type CostRow = ReturnType<typeof import('../../../../../public/calculations.js')
|
||||
import type { OrderContext, SharedViews } from '../viewTypes';
|
||||
import { Children, Fragment } from 'react';
|
||||
import { Calc as LedgerCalc } from '../../../shared';
|
||||
import { LedgerDataTable, LedgerTable } from '../../../components/BusinessControls';
|
||||
export function orderDetail(
|
||||
{ currentOrder, state, detailForm, error, navigation }: OrderContext,
|
||||
{
|
||||
@@ -84,30 +85,19 @@ export function orderDetail(
|
||||
].sort((a, b) => a.date.localeCompare(b.date));
|
||||
return rows.length ? (
|
||||
<div className="table-wrap">
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>日期</th>
|
||||
<th>业务</th>
|
||||
<th>金额</th>
|
||||
<th>账户/经办人</th>
|
||||
<th>说明</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{Children.toArray(
|
||||
rows.map(r => (
|
||||
<tr>
|
||||
<td>{r.date}</td>
|
||||
<td>{r.type}</td>
|
||||
<td>¥{yuan(r.amount)}</td>
|
||||
<td>{r.who}</td>
|
||||
<td>{r.note}</td>
|
||||
</tr>
|
||||
)),
|
||||
)}
|
||||
</tbody>
|
||||
</table>
|
||||
<LedgerDataTable
|
||||
columns={[
|
||||
{ title: '日期' },
|
||||
{ title: '业务' },
|
||||
{ title: '金额' },
|
||||
{ title: '账户/经办人' },
|
||||
{ title: '说明' },
|
||||
]}
|
||||
rows={rows.map((r, rowIndex) => ({
|
||||
key: rowIndex,
|
||||
cells: [r.date, r.type, <>¥{yuan(r.amount)}</>, r.who, r.note],
|
||||
}))}
|
||||
/>
|
||||
</div>
|
||||
) : (
|
||||
<p className="muted">还没有收退款、费用或交款记录。</p>
|
||||
@@ -224,7 +214,7 @@ export function orderDetail(
|
||||
const names = Object.fromEntries(teamMemberKeys().map(member => [member, teamMemberName(member)]));
|
||||
return (
|
||||
<div className="table-wrap">
|
||||
<table className="detail-cost-table" aria-label={label}>
|
||||
<LedgerTable className="detail-cost-table" aria-label={label}>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>成本项目</th>
|
||||
@@ -284,7 +274,7 @@ export function orderDetail(
|
||||
}),
|
||||
)}
|
||||
</tbody>
|
||||
</table>
|
||||
</LedgerTable>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -1,6 +1,13 @@
|
||||
import type { CancellationRequest, OwnershipRequest, ChangeRequest, ReviewList, CancelSummary } from '../orderData';
|
||||
import type { OrderContext, SharedViews } from '../viewTypes';
|
||||
import { Children } from 'react';
|
||||
import {
|
||||
LedgerButton,
|
||||
LedgerDataTable,
|
||||
LedgerInput,
|
||||
LedgerSelect,
|
||||
LedgerTextArea,
|
||||
} from '../../../components/BusinessControls';
|
||||
export function orderReviews(
|
||||
{
|
||||
state,
|
||||
@@ -67,64 +74,58 @@ export function orderReviews(
|
||||
</div>
|
||||
{result.requests.length ? (
|
||||
<div className="table-wrap">
|
||||
<table className="cancellation-list-table" aria-label="全部日期的取消申请">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>原订单/日期</th>
|
||||
<th>经办/申请人及时间</th>
|
||||
<th>取消原因</th>
|
||||
<th>状态/处理记录</th>
|
||||
<th>查看</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{Children.toArray(
|
||||
result.requests.map(request => (
|
||||
<tr>
|
||||
<td>
|
||||
<strong>{request.order_number}</strong>
|
||||
<div className="small muted">{request.order_date}</div>
|
||||
<div className="small">原成交 ¥{yuan(request.summary.total)}</div>
|
||||
</td>
|
||||
<td>
|
||||
{request.direct === true ? '经办人:' : ''}
|
||||
{request.operator_name || request.requester_name}
|
||||
<div className="small muted">
|
||||
{orderCancellationTime(request.executedAt || request.created)}
|
||||
</div>
|
||||
</td>
|
||||
<td className="cancellation-reason">{request.reason}</td>
|
||||
<td>
|
||||
{orderCancellationRecordStatus(request)}
|
||||
{request.stale && request.status === 'pending' ? (
|
||||
<div className="small danger-text">原单已有变动,需驳回后重新申请</div>
|
||||
) : (
|
||||
''
|
||||
)}
|
||||
{request.note ? <div className="small cancellation-reason">{request.note}</div> : ''}
|
||||
{request.reviewer_name ? (
|
||||
<div className="small muted">
|
||||
{request.reviewer_name} · {orderCancellationTime(request.reviewed)}
|
||||
</div>
|
||||
) : (
|
||||
''
|
||||
)}
|
||||
</td>
|
||||
<td>
|
||||
{button(
|
||||
owner && request.status === 'pending' ? '查看并复核' : '查看订单',
|
||||
'open-cancellation-order',
|
||||
'',
|
||||
{
|
||||
'data-id': request.order_id,
|
||||
},
|
||||
)}
|
||||
</td>
|
||||
</tr>
|
||||
)),
|
||||
)}
|
||||
</tbody>
|
||||
</table>
|
||||
<LedgerDataTable
|
||||
className="cancellation-list-table"
|
||||
aria-label="全部日期的取消申请"
|
||||
columns={[
|
||||
{ title: '原订单/日期' },
|
||||
{ title: '经办/申请人及时间' },
|
||||
{ title: '取消原因' },
|
||||
{ title: '状态/处理记录' },
|
||||
{ title: '查看' },
|
||||
]}
|
||||
rows={result.requests.map((request, rowIndex) => ({
|
||||
key: rowIndex,
|
||||
cellClasses: [undefined, undefined, 'cancellation-reason', undefined, undefined],
|
||||
cells: [
|
||||
<>
|
||||
<strong>{request.order_number}</strong>
|
||||
<div className="small muted">{request.order_date}</div>
|
||||
<div className="small">原成交 ¥{yuan(request.summary.total)}</div>
|
||||
</>,
|
||||
<>
|
||||
{request.direct === true ? '经办人:' : ''}
|
||||
{request.operator_name || request.requester_name}
|
||||
<div className="small muted">{orderCancellationTime(request.executedAt || request.created)}</div>
|
||||
</>,
|
||||
request.reason,
|
||||
<>
|
||||
{orderCancellationRecordStatus(request)}
|
||||
{request.stale && request.status === 'pending' ? (
|
||||
<div className="small danger-text">原单已有变动,需驳回后重新申请</div>
|
||||
) : (
|
||||
''
|
||||
)}
|
||||
{request.note ? <div className="small cancellation-reason">{request.note}</div> : ''}
|
||||
{request.reviewer_name ? (
|
||||
<div className="small muted">
|
||||
{request.reviewer_name} · {orderCancellationTime(request.reviewed)}
|
||||
</div>
|
||||
) : (
|
||||
''
|
||||
)}
|
||||
</>,
|
||||
button(
|
||||
owner && request.status === 'pending' ? '查看并复核' : '查看订单',
|
||||
'open-cancellation-order',
|
||||
'',
|
||||
{
|
||||
'data-id': request.order_id,
|
||||
},
|
||||
),
|
||||
],
|
||||
}))}
|
||||
/>
|
||||
</div>
|
||||
) : (
|
||||
<p className="empty">全部日期均无此状态的取消申请。</p>
|
||||
@@ -158,65 +159,60 @@ export function orderReviews(
|
||||
</div>
|
||||
{result.requests.length ? (
|
||||
<div className="table-wrap">
|
||||
<table className="change-list-table" aria-label="全部日期的归属申请">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>订单/日期</th>
|
||||
<th>归属修改</th>
|
||||
<th>申请人/原因</th>
|
||||
<th>复核结果</th>
|
||||
<th>查看</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{Children.toArray(
|
||||
result.requests.map(request => (
|
||||
<tr>
|
||||
<td>
|
||||
<strong className="order-ownership-list-customer">
|
||||
{request.order_customer || '未填客户称呼'}
|
||||
</strong>
|
||||
<div className="small muted">
|
||||
{request.order_number} · {request.order_date}
|
||||
</div>
|
||||
</td>
|
||||
<td>{orderOwnershipPairHTML(request)}</td>
|
||||
<td>
|
||||
{request.requester_name}
|
||||
<div className="small muted">{orderOwnershipTime(request.created)}</div>
|
||||
<p className="change-reason">{request.reason}</p>
|
||||
</td>
|
||||
<td>
|
||||
{orderOwnershipStatus[request.status]}
|
||||
{request.stale && request.status === 'pending' ? (
|
||||
<div className="small danger-text">订单已有变动,需驳回后重申</div>
|
||||
) : (
|
||||
''
|
||||
)}
|
||||
{request.note ? <p className="small change-reason">{request.note}</p> : ''}
|
||||
{request.reviewer_name ? (
|
||||
<div className="small muted">
|
||||
{request.reviewer_name} · {orderOwnershipTime(request.reviewed)}
|
||||
</div>
|
||||
) : (
|
||||
''
|
||||
)}
|
||||
</td>
|
||||
<td>
|
||||
{button(
|
||||
owner && request.status === 'pending' ? '查看并复核' : '查看订单',
|
||||
'order-ownership-open-order',
|
||||
'',
|
||||
{
|
||||
'data-id': request.order_id,
|
||||
},
|
||||
)}
|
||||
</td>
|
||||
</tr>
|
||||
)),
|
||||
)}
|
||||
</tbody>
|
||||
</table>
|
||||
<LedgerDataTable
|
||||
className="change-list-table"
|
||||
aria-label="全部日期的归属申请"
|
||||
columns={[
|
||||
{ title: '订单/日期' },
|
||||
{ title: '归属修改' },
|
||||
{ title: '申请人/原因' },
|
||||
{ title: '复核结果' },
|
||||
{ title: '查看' },
|
||||
]}
|
||||
rows={result.requests.map((request, rowIndex) => ({
|
||||
key: rowIndex,
|
||||
cells: [
|
||||
<>
|
||||
<strong className="order-ownership-list-customer">
|
||||
{request.order_customer || '未填客户称呼'}
|
||||
</strong>
|
||||
<div className="small muted">
|
||||
{request.order_number} · {request.order_date}
|
||||
</div>
|
||||
</>,
|
||||
orderOwnershipPairHTML(request),
|
||||
<>
|
||||
{request.requester_name}
|
||||
<div className="small muted">{orderOwnershipTime(request.created)}</div>
|
||||
<p className="change-reason">{request.reason}</p>
|
||||
</>,
|
||||
<>
|
||||
{orderOwnershipStatus[request.status]}
|
||||
{request.stale && request.status === 'pending' ? (
|
||||
<div className="small danger-text">订单已有变动,需驳回后重申</div>
|
||||
) : (
|
||||
''
|
||||
)}
|
||||
{request.note ? <p className="small change-reason">{request.note}</p> : ''}
|
||||
{request.reviewer_name ? (
|
||||
<div className="small muted">
|
||||
{request.reviewer_name} · {orderOwnershipTime(request.reviewed)}
|
||||
</div>
|
||||
) : (
|
||||
''
|
||||
)}
|
||||
</>,
|
||||
button(
|
||||
owner && request.status === 'pending' ? '查看并复核' : '查看订单',
|
||||
'order-ownership-open-order',
|
||||
'',
|
||||
{
|
||||
'data-id': request.order_id,
|
||||
},
|
||||
),
|
||||
],
|
||||
}))}
|
||||
/>
|
||||
</div>
|
||||
) : (
|
||||
<p className="empty">全部日期均无此状态的归属申请。</p>
|
||||
@@ -250,69 +246,60 @@ export function orderReviews(
|
||||
</div>
|
||||
{result.requests.length ? (
|
||||
<div className="table-wrap">
|
||||
<table className="change-list-table" aria-label="全部日期的变更申请">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>原订单/日期</th>
|
||||
<th>申请人/申请时间</th>
|
||||
<th>动作/申请原因</th>
|
||||
<th>状态/复核意见</th>
|
||||
<th>查看</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{Children.toArray(
|
||||
result.requests.map(request => (
|
||||
<tr>
|
||||
<td>
|
||||
<strong>{request.order_number}</strong>
|
||||
<div className="small muted">{request.order_date}</div>
|
||||
<div className="small">
|
||||
原成交 {orderChangeMoney(request.summary.before.total)}
|
||||
<br />
|
||||
申请成交 {orderChangeMoney(request.summary.after.total)}
|
||||
</div>
|
||||
</td>
|
||||
<td>
|
||||
{request.requester_name}
|
||||
<div className="small muted">{orderChangeTime(request.created)}</div>
|
||||
</td>
|
||||
<td className="change-reason">
|
||||
<strong>{orderChangeActionLabel(request)}</strong>
|
||||
<br />
|
||||
{request.reason}
|
||||
</td>
|
||||
<td>
|
||||
{orderChangeStatus[request.status]}
|
||||
{request.stale && request.status === 'pending' ? (
|
||||
<div className="small danger-text">原单已有变动,需驳回后重新申请</div>
|
||||
) : (
|
||||
''
|
||||
)}
|
||||
{request.note ? <div className="small change-reason">{request.note}</div> : ''}
|
||||
{request.reviewer_name ? (
|
||||
<div className="small muted">
|
||||
{request.reviewer_name} · {orderChangeTime(request.reviewed)}
|
||||
</div>
|
||||
) : (
|
||||
''
|
||||
)}
|
||||
</td>
|
||||
<td>
|
||||
{button(
|
||||
owner && request.status === 'pending' ? '查看并复核' : '查看订单',
|
||||
'open-change-order',
|
||||
'',
|
||||
{
|
||||
'data-id': request.order_id,
|
||||
},
|
||||
)}
|
||||
</td>
|
||||
</tr>
|
||||
)),
|
||||
)}
|
||||
</tbody>
|
||||
</table>
|
||||
<LedgerDataTable
|
||||
className="change-list-table"
|
||||
aria-label="全部日期的变更申请"
|
||||
columns={[
|
||||
{ title: '原订单/日期' },
|
||||
{ title: '申请人/申请时间' },
|
||||
{ title: '动作/申请原因' },
|
||||
{ title: '状态/复核意见' },
|
||||
{ title: '查看' },
|
||||
]}
|
||||
rows={result.requests.map((request, rowIndex) => ({
|
||||
key: rowIndex,
|
||||
cellClasses: [undefined, undefined, 'change-reason', undefined, undefined],
|
||||
cells: [
|
||||
<>
|
||||
<strong>{request.order_number}</strong>
|
||||
<div className="small muted">{request.order_date}</div>
|
||||
<div className="small">
|
||||
原成交 {orderChangeMoney(request.summary.before.total)}
|
||||
<br />
|
||||
申请成交 {orderChangeMoney(request.summary.after.total)}
|
||||
</div>
|
||||
</>,
|
||||
<>
|
||||
{request.requester_name}
|
||||
<div className="small muted">{orderChangeTime(request.created)}</div>
|
||||
</>,
|
||||
<>
|
||||
<strong>{orderChangeActionLabel(request)}</strong>
|
||||
<br />
|
||||
{request.reason}
|
||||
</>,
|
||||
<>
|
||||
{orderChangeStatus[request.status]}
|
||||
{request.stale && request.status === 'pending' ? (
|
||||
<div className="small danger-text">原单已有变动,需驳回后重新申请</div>
|
||||
) : (
|
||||
''
|
||||
)}
|
||||
{request.note ? <div className="small change-reason">{request.note}</div> : ''}
|
||||
{request.reviewer_name ? (
|
||||
<div className="small muted">
|
||||
{request.reviewer_name} · {orderChangeTime(request.reviewed)}
|
||||
</div>
|
||||
) : (
|
||||
''
|
||||
)}
|
||||
</>,
|
||||
button(owner && request.status === 'pending' ? '查看并复核' : '查看订单', 'open-change-order', '', {
|
||||
'data-id': request.order_id,
|
||||
}),
|
||||
],
|
||||
}))}
|
||||
/>
|
||||
</div>
|
||||
) : (
|
||||
<p className="empty">全部日期均无此状态的变更申请。</p>
|
||||
@@ -330,7 +317,7 @@ export function orderReviews(
|
||||
'这笔历史记录未记录对数,当前对数按实际盘点基准保留。本次旧重量冲回不自动更改当前对数,如实物有变化请另做当天对数调整。'}
|
||||
</div>
|
||||
<label className="check">
|
||||
<input name="legacyCountVerified" type="checkbox" required />
|
||||
<LedgerInput name="legacyCountVerified" type="checkbox" required />
|
||||
已核对当前对数基准,理解本次更正对历史对数的处理
|
||||
</label>
|
||||
</>
|
||||
@@ -404,32 +391,25 @@ export function orderReviews(
|
||||
{summary.legacyCountNotice ? <p className="note">{summary.legacyCountNotice}</p> : ''}
|
||||
{summary.inventory.length ? (
|
||||
<div className="table-wrap">
|
||||
<table aria-label="取消后库存冲回摘要">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>原日期</th>
|
||||
<th>货盘</th>
|
||||
<th className="number">恢复/冲回克重</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{Children.toArray(
|
||||
summary.inventory.map(item => (
|
||||
<tr>
|
||||
<td>{item.date}</td>
|
||||
<td>{pocketLabel(item.pocket)}</td>
|
||||
<td className="number">
|
||||
{item.mg > 0 ? '+' : ''}
|
||||
{grams(item.mg)}g
|
||||
{inventoryCountHTML(item, {
|
||||
signed: true,
|
||||
})}
|
||||
</td>
|
||||
</tr>
|
||||
)),
|
||||
)}
|
||||
</tbody>
|
||||
</table>
|
||||
<LedgerDataTable
|
||||
aria-label="取消后库存冲回摘要"
|
||||
columns={[{ title: '原日期' }, { title: '货盘' }, { title: '恢复/冲回克重', headerClassName: 'number' }]}
|
||||
rows={summary.inventory.map((item, rowIndex) => ({
|
||||
key: rowIndex,
|
||||
cellClasses: [undefined, undefined, 'number'],
|
||||
cells: [
|
||||
item.date,
|
||||
pocketLabel(item.pocket),
|
||||
<>
|
||||
{item.mg > 0 ? '+' : ''}
|
||||
{grams(item.mg)}g
|
||||
{inventoryCountHTML(item, {
|
||||
signed: true,
|
||||
})}
|
||||
</>,
|
||||
],
|
||||
}))}
|
||||
/>
|
||||
</div>
|
||||
) : (
|
||||
<p className="small muted">本单没有需要冲回的库存出入。</p>
|
||||
@@ -471,20 +451,20 @@ export function orderReviews(
|
||||
这张订单是今天开的,核实后直接按录错作废,无需另行审批。业务日期:{data.directActionDate}
|
||||
。本入口不办理真实退货或退款。
|
||||
</div>
|
||||
<input type="hidden" name="date" defaultValue={data.directActionDate} />
|
||||
<LedgerInput type="hidden" name="date" defaultValue={data.directActionDate} />
|
||||
{orderCancellationSummaryDataHTML(data.summary)}
|
||||
<label>
|
||||
取消原因
|
||||
<textarea
|
||||
<LedgerTextArea
|
||||
name="reason"
|
||||
rows={3}
|
||||
required
|
||||
maxLength={200}
|
||||
placeholder="写清这张单录错的原因,例如:同一笔销售重复录入。"
|
||||
></textarea>
|
||||
></LedgerTextArea>
|
||||
</label>
|
||||
<label className="check">
|
||||
<input type="checkbox" name="verified" required />
|
||||
<LedgerInput type="checkbox" name="verified" required />
|
||||
已核实这是录错作废,并确认撤销上述记账和冲回库存;本次不登记真实退货退款。
|
||||
</label>
|
||||
</>
|
||||
@@ -500,13 +480,13 @@ export function orderReviews(
|
||||
<p className="small muted">真实退货请从“整单退货”办理;这里不会发起真实退款。</p>
|
||||
<label>
|
||||
取消原因
|
||||
<textarea
|
||||
<LedgerTextArea
|
||||
name="reason"
|
||||
rows={3}
|
||||
required
|
||||
maxLength={200}
|
||||
placeholder="写清这张单录错的原因,例如:同一笔销售重复录入。"
|
||||
></textarea>
|
||||
></LedgerTextArea>
|
||||
</label>
|
||||
</>
|
||||
);
|
||||
@@ -521,10 +501,10 @@ export function orderReviews(
|
||||
<p className="cancellation-reason">取消原因:{request.reason}</p>
|
||||
{orderCancellationSummaryHTML(request)}
|
||||
<label>
|
||||
复核备注(选填)<textarea name="note" maxLength={200} rows={2}></textarea>
|
||||
复核备注(选填)<LedgerTextArea name="note" maxLength={200} rows={2}></LedgerTextArea>
|
||||
</label>
|
||||
<label className="check">
|
||||
<input type="checkbox" name="verified" required />
|
||||
<LedgerInput type="checkbox" name="verified" required />
|
||||
已核实这是录错作废,并确认撤销上述记账和冲回库存;本次不登记真实退货退款。
|
||||
</label>
|
||||
</>
|
||||
@@ -538,13 +518,13 @@ export function orderReviews(
|
||||
<p className="small muted">驳回后原订单继续计账,申请人可核对后重新申请。</p>
|
||||
<label>
|
||||
驳回意见
|
||||
<textarea
|
||||
<LedgerTextArea
|
||||
name="note"
|
||||
rows={3}
|
||||
required
|
||||
maxLength={200}
|
||||
placeholder="写清需要补充或重新核对的地方。"
|
||||
></textarea>
|
||||
></LedgerTextArea>
|
||||
</label>
|
||||
</>
|
||||
);
|
||||
@@ -564,13 +544,13 @@ export function orderReviews(
|
||||
{html}
|
||||
<div id="order-cancellation-error" aria-live="polite"></div>
|
||||
<div className="form-actions">
|
||||
<button
|
||||
<LedgerButton
|
||||
type="submit"
|
||||
data-order-cancellation-submit=""
|
||||
className={['approve', 'direct'].includes(kind) ? 'danger' : 'primary'}
|
||||
>
|
||||
{submit}
|
||||
</button>
|
||||
</LedgerButton>
|
||||
{button('收起', 'close-order-cancellation-form', 'quiet')}
|
||||
</div>
|
||||
</form>
|
||||
@@ -608,16 +588,16 @@ export function orderReviews(
|
||||
<div className="grid two">
|
||||
<label>
|
||||
当前归属
|
||||
<input defaultValue={before.label} readOnly />
|
||||
<LedgerInput defaultValue={before.label} readOnly />
|
||||
</label>
|
||||
<label>
|
||||
修改为
|
||||
<select name="member" required defaultValue="">
|
||||
<LedgerSelect name="member" required defaultValue="">
|
||||
{opts([
|
||||
['', '请选择新归属'],
|
||||
...members.map((member): [string, string] => [member.member, member.label]),
|
||||
])}
|
||||
</select>
|
||||
</LedgerSelect>
|
||||
</label>
|
||||
</div>
|
||||
<p className="order-ownership-selection" id="order-ownership-selection" aria-live="polite">
|
||||
@@ -626,16 +606,16 @@ export function orderReviews(
|
||||
{orderOwnershipEffectHTML(data.member)}
|
||||
<label>
|
||||
修改原因
|
||||
<textarea
|
||||
<LedgerTextArea
|
||||
name="reason"
|
||||
required
|
||||
maxLength={200}
|
||||
rows={3}
|
||||
placeholder="写清原归属录错的原因及正确归属。"
|
||||
></textarea>
|
||||
></LedgerTextArea>
|
||||
</label>
|
||||
<label className="check">
|
||||
<input type="checkbox" name="verified" required />
|
||||
<LedgerInput type="checkbox" name="verified" required />
|
||||
已核对原归属、新归属和修改原因,确认本次归属{direct ? '更正' : '申请'}。
|
||||
</label>
|
||||
</>
|
||||
@@ -654,10 +634,10 @@ export function orderReviews(
|
||||
<>
|
||||
{orderOwnershipEffectHTML(request.before.member)}
|
||||
<label>
|
||||
复核备注(选填)<textarea name="note" maxLength={200} rows={2}></textarea>
|
||||
复核备注(选填)<LedgerTextArea name="note" maxLength={200} rows={2}></LedgerTextArea>
|
||||
</label>
|
||||
<label className="check">
|
||||
<input type="checkbox" name="verified" required />
|
||||
<LedgerInput type="checkbox" name="verified" required />
|
||||
已核对原归属、新归属和原因,同意后按新归属统计,并更新原助理的查看权限。
|
||||
</label>
|
||||
</>
|
||||
@@ -666,13 +646,13 @@ export function orderReviews(
|
||||
<p className="small muted">驳回后保留原归属,申请人可核对后重新申请。</p>
|
||||
<label>
|
||||
驳回意见
|
||||
<textarea
|
||||
<LedgerTextArea
|
||||
name="note"
|
||||
required
|
||||
maxLength={200}
|
||||
rows={3}
|
||||
placeholder="写清需要重新核对的地方。"
|
||||
></textarea>
|
||||
></LedgerTextArea>
|
||||
</label>
|
||||
</>
|
||||
)}
|
||||
@@ -685,9 +665,9 @@ export function orderReviews(
|
||||
{html}
|
||||
<div id="order-ownership-error" aria-live="polite"></div>
|
||||
<div className="form-actions">
|
||||
<button type="submit" className="primary">
|
||||
<LedgerButton type="submit" className="primary">
|
||||
{submit}
|
||||
</button>
|
||||
</LedgerButton>
|
||||
{button('收起', 'order-ownership-close-form', 'quiet')}
|
||||
</div>
|
||||
</form>
|
||||
@@ -723,10 +703,10 @@ export function orderReviews(
|
||||
{orderChangeActionSummaryHTML(request)}
|
||||
{orderChangeComparisonHTML(request)}
|
||||
<label>
|
||||
复核备注(选填)<textarea name="note" maxLength={200} rows={2}></textarea>
|
||||
复核备注(选填)<LedgerTextArea name="note" maxLength={200} rows={2}></LedgerTextArea>
|
||||
</label>
|
||||
<label className="check">
|
||||
<input type="checkbox" name="verified" required />
|
||||
<LedgerInput type="checkbox" name="verified" required />
|
||||
已核对本次申请动作、金额、日期、账户或付款人、退货去向及库存,确认原值与申请值,以及以上关联订单的本次修改。
|
||||
</label>
|
||||
</>
|
||||
@@ -736,13 +716,13 @@ export function orderReviews(
|
||||
<p>驳回后原单继续计账,申请人可按最新原单重新申请。</p>
|
||||
<label>
|
||||
驳回意见
|
||||
<textarea
|
||||
<LedgerTextArea
|
||||
name="note"
|
||||
required
|
||||
maxLength={200}
|
||||
rows={3}
|
||||
placeholder="写清需要重新核对或补充的地方。"
|
||||
></textarea>
|
||||
></LedgerTextArea>
|
||||
</label>
|
||||
</>
|
||||
);
|
||||
@@ -752,9 +732,9 @@ export function orderReviews(
|
||||
{html}
|
||||
<div id="order-change-error" aria-live="polite"></div>
|
||||
<div className="form-actions">
|
||||
<button type="submit" className="primary">
|
||||
<LedgerButton type="submit" className="primary">
|
||||
{kind === 'approve' ? '同意变更并更新原单' : '确认驳回'}
|
||||
</button>
|
||||
</LedgerButton>
|
||||
{button('收起', 'close-order-change-form', 'quiet')}
|
||||
</div>
|
||||
</form>
|
||||
|
||||
@@ -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 (
|
||||
|
||||
Reference in new issue
Block a user