添加市场

This commit is contained in:
liu
2026-08-20 15:39:39 +08:00
parent cd7007bc49
commit 22237a47e7
20 changed files with 134 additions and 239 deletions
+19 -15
View File
@@ -157,6 +157,7 @@ const PurchaseOrderPage: React.FC = () => {
product_name: row.product_name,
product_spec: row.product_spec,
unit: row.unit,
market: row.market,
cost_price: String(row.cost_price),
quantity: row.quantity,
weight: String(row.weight),
@@ -474,6 +475,7 @@ const PurchaseOrderPage: React.FC = () => {
align: 'center',
render: (_, row) => row.supplier?.name ?? '-',
},
{ title: '市场', dataIndex: 'market', width: 90, align: 'center', render: (v) => v || '-' },
{
title: '参考零售价',
key: 'retail_price',
@@ -558,27 +560,28 @@ const PurchaseOrderPage: React.FC = () => {
return (
<Table.Summary.Row>
<Table.Summary.Cell index={0} colSpan={6} align="center">
<Table.Summary.Cell index={0} colSpan={7} align="center">
<Text strong></Text>
</Table.Summary.Cell>
{storeTotals.map((amount, index) => (
<Table.Summary.Cell key={stores[index].id} index={6 + index} align="center">
<Table.Summary.Cell key={stores[index].id} index={7 + index} align="center">
<Text strong>¥{amount.toFixed(2)}</Text>
</Table.Summary.Cell>
))}
<Table.Summary.Cell index={6 + stores.length} align="center">
<Table.Summary.Cell index={7 + stores.length} align="center">
<Text strong>{totalQuantity}</Text>
</Table.Summary.Cell>
<Table.Summary.Cell index={7 + stores.length} align="center">
<Table.Summary.Cell index={8 + stores.length} align="center">
<Text strong>¥{totalAmount.toFixed(2)}</Text>
</Table.Summary.Cell>
</Table.Summary.Row>
);
};
/** 门店购买详情列:商品/购买参考零售价(单价÷包规)/包规/单位/单价/数量/预计金额 + 操作 */
/** 门店购买详情列:商品/市场/购买参考零售价(单价÷包规)/包规/单位/单价/数量/预计金额 + 操作 */
const storeColumns: TableProps<IPurchaseStoreItem>['columns'] = [
{ title: '商品', dataIndex: 'product_name', width: 160, align: 'center' },
{ title: '市场', dataIndex: 'market', width: 90, align: 'center', render: (v) => v || '-' },
{
title: '参考零售价',
key: 'retail_price',
@@ -654,28 +657,29 @@ const PurchaseOrderPage: React.FC = () => {
const totalWeight = items.reduce((sum, row) => sum + Number(row.weight), 0);
return (
<Table.Summary.Row>
<Table.Summary.Cell index={0} colSpan={5} align="center">
<Table.Summary.Cell index={0} colSpan={6} align="center">
<Text strong></Text>
</Table.Summary.Cell>
<Table.Summary.Cell index={5} align="center">
<Table.Summary.Cell index={6} align="center">
<Text strong>{totalQuantity}</Text>
</Table.Summary.Cell>
<Table.Summary.Cell index={6} align="center">
<Table.Summary.Cell index={7} align="center">
<Text strong>{totalWeight.toFixed(3)}</Text>
</Table.Summary.Cell>
<Table.Summary.Cell index={7} align="center">
<Table.Summary.Cell index={8} align="center">
<Text strong type="danger">¥{totalAmount.toFixed(2)}</Text>
</Table.Summary.Cell>
<Table.Summary.Cell index={8} align="center">
<Table.Summary.Cell index={9} align="center">
<Text strong>-</Text>
</Table.Summary.Cell>
</Table.Summary.Row>
);
};
/** 供应商采购明细列:品名/包规/单位/成本价/数量/重量/金额(成本口径) */
/** 供应商采购明细列:品名/市场/包规/单位/成本价/数量/重量/金额(成本口径) */
const supplierColumns: TableProps<IPurchaseSupplierItem>['columns'] = [
{ title: '品名', dataIndex: 'product_name', width: 180, align: 'center' },
{ title: '市场', dataIndex: 'market', width: 100, align: 'center', render: (v) => v || '-' },
{ title: '包规', dataIndex: 'product_spec', width: 110, align: 'center', render: (v) => v || '-' },
{ title: '单位', dataIndex: 'unit', width: 90, align: 'center', render: (v) => v || '-' },
{
@@ -709,16 +713,16 @@ const PurchaseOrderPage: React.FC = () => {
const totalAmount = supplierItems.reduce((sum, row) => sum + Number(row.amount), 0);
return (
<Table.Summary.Row>
<Table.Summary.Cell index={0} colSpan={4} align="center">
<Table.Summary.Cell index={0} colSpan={5} align="center">
<Text strong></Text>
</Table.Summary.Cell>
<Table.Summary.Cell index={4} align="center">
<Table.Summary.Cell index={5} align="center">
<Text strong>{totalQuantity}</Text>
</Table.Summary.Cell>
<Table.Summary.Cell index={5} align="center">
<Table.Summary.Cell index={6} align="center">
<Text strong>{totalWeight.toFixed(3)}</Text>
</Table.Summary.Cell>
<Table.Summary.Cell index={6} align="center">
<Table.Summary.Cell index={7} align="center">
<Text strong type="danger">¥{totalAmount.toFixed(2)}</Text>
</Table.Summary.Cell>
</Table.Summary.Row>