feat(consignment): 寄卖规格与价格动态配置重构
This commit is contained in:
File diff suppressed because it is too large
Load Diff
@@ -14,6 +14,7 @@ import {
|
||||
Card,
|
||||
Col,
|
||||
Descriptions,
|
||||
Divider,
|
||||
Form,
|
||||
Input,
|
||||
InputNumber,
|
||||
@@ -270,6 +271,10 @@ export default function ConsignmentInventoryPanel() {
|
||||
values.salePrice !== undefined
|
||||
? Math.max(0, Math.round(Number(values.salePrice) * 100))
|
||||
: undefined,
|
||||
specValues:
|
||||
values.specValues && Object.keys(values.specValues).length
|
||||
? values.specValues
|
||||
: undefined,
|
||||
buyerName: values.buyerName,
|
||||
shopName: values.shopName,
|
||||
inboundBatch: values.inboundBatch,
|
||||
@@ -349,6 +354,11 @@ export default function ConsignmentInventoryPanel() {
|
||||
render: (_, record) => (
|
||||
<div>
|
||||
<div style={{ fontWeight: 600, fontSize: 14 }}>{record.itemName}</div>
|
||||
{record.specText ? (
|
||||
<Text type="secondary" style={{ fontSize: 12 }}>
|
||||
{record.specText}
|
||||
</Text>
|
||||
) : null}
|
||||
<Space size={4} align="center">
|
||||
<Text type="secondary" style={{ fontSize: 12 }}>
|
||||
寄卖单号
|
||||
@@ -666,6 +676,10 @@ export default function ConsignmentInventoryPanel() {
|
||||
setEditingItem(record)
|
||||
editForm.setFieldsValue({
|
||||
...record,
|
||||
specValues:
|
||||
record.specValues && Object.keys(record.specValues).length
|
||||
? record.specValues
|
||||
: undefined,
|
||||
costPrice: record.costPriceFen / 100,
|
||||
salePrice: (record.salePriceFen ?? record.costPriceFen) / 100,
|
||||
workerId: record.workerId || undefined,
|
||||
@@ -961,6 +975,46 @@ export default function ConsignmentInventoryPanel() {
|
||||
</Col>
|
||||
</Row>
|
||||
|
||||
{editingItem?.specs?.length ? (
|
||||
<>
|
||||
<Divider plain>动态规格</Divider>
|
||||
<Row gutter={16}>
|
||||
{editingItem.specs.map((field) => (
|
||||
<Col span={8} key={field.key}>
|
||||
<Form.Item name={['specValues', field.key]} label={field.label}>
|
||||
{field.type === 'select' || field.type === 'radio' ? (
|
||||
field.type === 'radio' ? (
|
||||
<Radio.Group
|
||||
options={field.options
|
||||
.filter((option) => option.enabled !== false)
|
||||
.map((option) => ({ label: option.label, value: option.value }))}
|
||||
/>
|
||||
) : (
|
||||
<Select
|
||||
options={field.options
|
||||
.filter((option) => option.enabled !== false)
|
||||
.map((option) => ({ label: option.label, value: option.value }))}
|
||||
/>
|
||||
)
|
||||
) : field.type === 'number' ? (
|
||||
<InputNumber style={{ width: '100%' }} />
|
||||
) : field.type === 'date' ? (
|
||||
<Input type="date" />
|
||||
) : field.type === 'textarea' ? (
|
||||
<Input.TextArea
|
||||
placeholder={field.placeholder || undefined}
|
||||
autoSize={{ minRows: 2, maxRows: 4 }}
|
||||
/>
|
||||
) : (
|
||||
<Input placeholder={field.placeholder || undefined} />
|
||||
)}
|
||||
</Form.Item>
|
||||
</Col>
|
||||
))}
|
||||
</Row>
|
||||
</>
|
||||
) : null}
|
||||
|
||||
<Row gutter={16}>
|
||||
<Col span={8}>
|
||||
<Form.Item name="buyerName" label="收购人">
|
||||
|
||||
@@ -166,6 +166,10 @@ export default function ConsignmentSubmissionsPanel() {
|
||||
series: values.series,
|
||||
diamondLevel: Number(values.diamondLevel || 1),
|
||||
brillianceCount: Number(values.brillianceCount || 0),
|
||||
specValues:
|
||||
values.specValues && Object.keys(values.specValues).length
|
||||
? values.specValues
|
||||
: undefined,
|
||||
sellerContact: values.sellerContact,
|
||||
sellerGameId: values.sellerGameId,
|
||||
sellerPaymentInfo: values.sellerPaymentInfo,
|
||||
@@ -375,6 +379,10 @@ export default function ConsignmentSubmissionsPanel() {
|
||||
setApproveModalItem(record)
|
||||
approveForm.setFieldsValue({
|
||||
...record,
|
||||
specValues:
|
||||
record.specValues && Object.keys(record.specValues).length
|
||||
? record.specValues
|
||||
: undefined,
|
||||
costPrice: record.askingPriceFen / 100,
|
||||
sellerContact: record.contactInfo,
|
||||
buyerName: '客服',
|
||||
@@ -667,6 +675,47 @@ export default function ConsignmentSubmissionsPanel() {
|
||||
</Col>
|
||||
</Row>
|
||||
|
||||
{approveModalItem?.specs?.length ? (
|
||||
<Row gutter={12}>
|
||||
{approveModalItem.specs.map((field) => (
|
||||
<Col span={8} key={field.key}>
|
||||
<Form.Item
|
||||
name={['specValues', field.key]}
|
||||
label={field.label}
|
||||
style={{ marginBottom: 16 }}
|
||||
>
|
||||
{field.type === 'select' || field.type === 'radio' ? (
|
||||
field.type === 'radio' ? (
|
||||
<Radio.Group
|
||||
options={field.options
|
||||
.filter((option) => option.enabled !== false)
|
||||
.map((option) => ({ label: option.label, value: option.value }))}
|
||||
/>
|
||||
) : (
|
||||
<Select
|
||||
options={field.options
|
||||
.filter((option) => option.enabled !== false)
|
||||
.map((option) => ({ label: option.label, value: option.value }))}
|
||||
/>
|
||||
)
|
||||
) : field.type === 'number' ? (
|
||||
<InputNumber style={{ width: '100%' }} />
|
||||
) : field.type === 'date' ? (
|
||||
<Input type="date" />
|
||||
) : field.type === 'textarea' ? (
|
||||
<Input.TextArea
|
||||
placeholder={field.placeholder || undefined}
|
||||
autoSize={{ minRows: 2, maxRows: 4 }}
|
||||
/>
|
||||
) : (
|
||||
<Input placeholder={field.placeholder || undefined} />
|
||||
)}
|
||||
</Form.Item>
|
||||
</Col>
|
||||
))}
|
||||
</Row>
|
||||
) : null}
|
||||
|
||||
{/* 分组二:履约与打手 */}
|
||||
<div
|
||||
style={{
|
||||
|
||||
Reference in New Issue
Block a user