Commit 8dbf9940 authored by 靳野's avatar 靳野

feat:库存排序字段调整stock

parent dc359ebb
...@@ -144,24 +144,21 @@ export function column() { ...@@ -144,24 +144,21 @@ export function column() {
width: 120, width: 120,
dataIndex: 'stock', dataIndex: 'stock',
align: 'center', align: 'center',
sorter: (a, b) => a.productStock - b.productStock, sorter: (a, b) => a.stock - b.stock,
defaultSortOrder: 'ascend', defaultSortOrder: 'ascend',
render: (_, row) => { render: (_, row) => {
// const stockView = row.productStock; // const stockView = row.productStock;
const stockView = ( const stockView = (
<Button <Button type="link" onClick={() => this.onShowStockModal(row)} style={{ padding: 0 }}>
type="link"
danger={row.productStock <= 10}
onClick={() => this.onShowStockModal(row)}
style={{ padding: 0 }}
>
{row.productStock} {row.productStock}
</Button> </Button>
); );
return ( return (
<> <>
<p>当前库存:{stockView}</p> <p>当前库存:{stockView}</p>
<p>可售库存:{_}</p> <p>
可售库存:<span style={{ color: row.stock <= 10 ? 'red' : '' }}>{_}</span>
</p>
{row.type === 1 && row.productStockWarning > 0 && ( {row.type === 1 && row.productStockWarning > 0 && (
<p>预警值:{row.productStockWarning}</p> <p>预警值:{row.productStockWarning}</p>
)} )}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment