Commit 1aa01599 authored by 靳野's avatar 靳野

Merge branch 'feature-sku-2' into feature-tm

parents 516e3d64 b5a470fd
...@@ -16,5 +16,6 @@ module.exports = { ...@@ -16,5 +16,6 @@ module.exports = {
'import/extensions': 0, 'import/extensions': 0,
'no-unused-expressions': ['off'], 'no-unused-expressions': ['off'],
'template-curly-spacing': 'off', 'template-curly-spacing': 'off',
'no-shadow': 'off',
}, },
}; };
...@@ -19,7 +19,7 @@ const INIT_QUERY_PARAMS = { ...@@ -19,7 +19,7 @@ const INIT_QUERY_PARAMS = {
const MessageItem = props => { const MessageItem = props => {
const { item, onMark, viewDetail } = props; const { item, onMark, viewDetail } = props;
/** /**
* type: 0订单消息,1售后消息 * type: 0订单消息,1售后消息,7提示补货,8竞价成功
* readStatus: 0未读,1已读 * readStatus: 0未读,1已读
*/ */
const { readStatus, type } = item; const { readStatus, type } = item;
...@@ -30,17 +30,43 @@ const MessageItem = props => { ...@@ -30,17 +30,43 @@ const MessageItem = props => {
console.error('消息数据格式错误'); console.error('消息数据格式错误');
} }
const goodList = message.items.map((good, index) => ( const goodList = message.items?.map((good, index) => (
<div className={styles.good} key={String(index)}> <div className={styles.good} key={String(index)}>
<span className={styles.good__name}>{good.skuName}</span> <span className={styles.good__name}>{good.skuName}</span>
<span className={styles.good__count}>x{good.quantity}</span> <span className={styles.good__count}>x{good.quantity}</span>
</div> </div>
)); ));
const renderMessageHeader = message => {
switch (message.type) {
case 7:
return (
<>
<span className={styles['order-number']}>库存预警</span>
<span className={styles.time}>{message.time}</span>
</>
);
case 8:
return (
<>
<span className={styles['order-number']}>竞价成功</span>
<span className={styles.time}>{message.time}</span>
</>
);
default:
return (
<>
<span className={styles['order-number']}>订单编号:{message.orderNo}</span>
<span className={styles.time}>订单时间:{message.time}</span>
</>
);
}
};
return ( return (
<div className={styles['complex-list__item']}> <div className={styles['complex-list__item']}>
<div className={styles['complex-list__item--header']}> <div className={styles['complex-list__item--header']}>
<span className={styles['order-number']}> 订单编号:{message.orderNo}</span> {renderMessageHeader(message)}
<span className={styles.time}>订单时间:{message.time}</span>
<span className={styles['read-status']}> <span className={styles['read-status']}>
{readStatus === 0 ? ( {readStatus === 0 ? (
<a className={styles['read-status--un-read']} onClick={() => onMark([item.id])}> <a className={styles['read-status--un-read']} onClick={() => onMark([item.id])}>
...@@ -189,6 +215,12 @@ const Complex = props => { ...@@ -189,6 +215,12 @@ const Complex = props => {
query: { orderNo }, query: { orderNo },
}); });
} }
if ([7, 8].includes(type)) {
history.push({
pathname: '/goodsManage',
query: { orderNo },
});
}
close(); close();
}; };
......
...@@ -50,10 +50,25 @@ const Message = props => { ...@@ -50,10 +50,25 @@ const Message = props => {
console.error('消息数据格式错误'); console.error('消息数据格式错误');
} }
const renderMessageHeader = message => {
switch (message.type) {
case 7:
return <span className={styles['order-number']}>库存预警</span>;
case 8:
return <span className={styles['order-number']}>竞价成功</span>;
default:
return (
<>
<span className={styles['order-number']}>{message.orderNo}</span>
</>
);
}
};
return ( return (
<div className={styles.item}> <div className={styles.item}>
<div className={styles.info}> <div className={styles.info}>
<span className={styles['order-number']}>{message.orderNo}</span> {renderMessageHeader(message)}
<span className={styles['mark-read']} onClick={() => onMark([item.id])}> <span className={styles['mark-read']} onClick={() => onMark([item.id])}>
标记为已读 标记为已读
</span> </span>
...@@ -182,6 +197,13 @@ const Simple = props => { ...@@ -182,6 +197,13 @@ const Simple = props => {
query: { orderNo }, query: { orderNo },
}); });
} }
if ([7, 8].includes(type)) {
history.push({
pathname: '/goodsManage',
query: { orderNo },
});
}
toggle(); toggle();
}; };
......
...@@ -144,7 +144,7 @@ class goodsManage extends Component { ...@@ -144,7 +144,7 @@ class goodsManage extends Component {
className={styles.searchForm} className={styles.searchForm}
> >
<FormItem label="SKU编码" name="skuId"> <FormItem label="SKU编码" name="skuId">
<InputNumber placeholder="请输入SKU编码" max={99999999999999999} style={selectW} /> <Input maxLength={18} showCount placeholder="请输入SKU编码" style={selectW} />
</FormItem> </FormItem>
<FormItem label="商品名称" name="skuName"> <FormItem label="商品名称" name="skuName">
<Input placeholder="请输入商品名称" allowClear style={selectW} /> <Input placeholder="请输入商品名称" allowClear style={selectW} />
......
...@@ -145,6 +145,7 @@ export function column() { ...@@ -145,6 +145,7 @@ export function column() {
dataIndex: 'stock', dataIndex: 'stock',
align: 'center', align: 'center',
sorter: (a, b) => a.stock - b.stock, sorter: (a, b) => a.stock - b.stock,
defaultSortOrder: 'ascend',
render: (_, row) => { render: (_, row) => {
// const stockView = row.productStock; // const stockView = row.productStock;
const stockView = ( const stockView = (
...@@ -155,7 +156,9 @@ export function column() { ...@@ -155,7 +156,9 @@ export function column() {
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