Commit c5bb2b8a authored by 武广's avatar 武广

Merge branch 'feature/goods-list' of git.quantgroup.cn:ui/merchant-manage-ui...

Merge branch 'feature/goods-list' of git.quantgroup.cn:ui/merchant-manage-ui into feature/20230327_public_takeaway
parents edbef29f 245c0292
...@@ -21,13 +21,14 @@ const GoodsGroup = options => { ...@@ -21,13 +21,14 @@ const GoodsGroup = options => {
const json = JSON.parse(user); const json = JSON.parse(user);
const res = await apiSupplierShopList(json.id); const res = await apiSupplierShopList(json.id);
if (res && res.data && res.data.length > 0) { if (res && res.data && res.data.length > 0) {
setShops( // setShops(
res.data.map(item => ({ // res.data.map(item => ({
label: item.name, // label: item.name,
value: +item.id, // value: +item.id,
})), // })),
); // );
options.changeShop(+res.data[0].id); // options.changeShop(+res.data[0].id);
options.changeShop(0);
} else { } else {
options.changeShop(0); options.changeShop(0);
} }
...@@ -111,6 +112,7 @@ const GoodsGroup = options => { ...@@ -111,6 +112,7 @@ const GoodsGroup = options => {
return ( return (
<div className={styles.groupBox}> <div className={styles.groupBox}>
{(shops && shops.length && ( {(shops && shops.length && (
<>
<div className={styles['groupBox-title']}> <div className={styles['groupBox-title']}>
<div className={styles['groupBox-title--name']}>所属门店</div> <div className={styles['groupBox-title--name']}>所属门店</div>
<Select <Select
...@@ -124,11 +126,11 @@ const GoodsGroup = options => { ...@@ -124,11 +126,11 @@ const GoodsGroup = options => {
options={shops} options={shops}
/> />
</div> </div>
)) ||
''}
<div className={styles['groupBox-title']}> <div className={styles['groupBox-title']}>
<div className={styles['groupBox-title--name']}>商品分组</div> <div className={styles['groupBox-title--name']}>商品分组</div>
<Button onClick={() => setGroupEdit(!groupEdit)}>{groupEdit ? '完成' : '编辑分组'}</Button> <Button onClick={() => setGroupEdit(!groupEdit)}>
{groupEdit ? '完成' : '编辑分组'}
</Button>
</div> </div>
<div className={styles['groupBox-body']}> <div className={styles['groupBox-body']}>
{groupEdit ? ( {groupEdit ? (
...@@ -167,6 +169,9 @@ const GoodsGroup = options => { ...@@ -167,6 +169,9 @@ const GoodsGroup = options => {
</div> </div>
)} )}
</div> </div>
</>
)) ||
''}
<GroupInfo <GroupInfo
isModalOpen={isModalOpen} isModalOpen={isModalOpen}
id={storageId} id={storageId}
......
...@@ -50,12 +50,7 @@ const GroupInfo = options => { ...@@ -50,12 +50,7 @@ const GroupInfo = options => {
} }
}, [options.id, options.isModalOpen]); }, [options.id, options.isModalOpen]);
const extra = ( const extra = <Alert message="选中后,顾客下单需至少选择1个“下单必选分组”" type="error" />;
<Alert
message="选中后,顾客下单需至少选择1个“下单必选分组”商品每店仅可设置1个必点分组"
type="error"
/>
);
return ( return (
<Modal <Modal
...@@ -63,6 +58,7 @@ const GroupInfo = options => { ...@@ -63,6 +58,7 @@ const GroupInfo = options => {
visible={options.isModalOpen} visible={options.isModalOpen}
destroyOnClose destroyOnClose
maskClosable={false} maskClosable={false}
width="600px"
onOk={handleConfirm} onOk={handleConfirm}
onCancel={handleCancel} onCancel={handleCancel}
> >
......
...@@ -177,6 +177,7 @@ const Takeaway = options => { ...@@ -177,6 +177,7 @@ const Takeaway = options => {
<div className={styles.takeawayBox}> <div className={styles.takeawayBox}>
<Spin spinning={loading}> <Spin spinning={loading}>
<GoodsGroup shopId={shopId} changeShop={setShopId} changeGroup={setGroupId} /> <GoodsGroup shopId={shopId} changeShop={setShopId} changeGroup={setGroupId} />
{(shopId && (
<ActionBar <ActionBar
selectedRowKeys={selectedRowKeys} selectedRowKeys={selectedRowKeys}
shopId={shopId} shopId={shopId}
...@@ -184,6 +185,8 @@ const Takeaway = options => { ...@@ -184,6 +185,8 @@ const Takeaway = options => {
openModal={openModal} openModal={openModal}
newGoods={onNew} newGoods={onNew}
/> />
)) ||
''}
<Table <Table
dataSource={tableData} dataSource={tableData}
bordered bordered
......
...@@ -307,6 +307,9 @@ class goodsManage extends Component { ...@@ -307,6 +307,9 @@ class goodsManage extends Component {
productType: e || 1, productType: e || 1,
}); });
this.categoryListByType(e); this.categoryListByType(e);
if (e !== 5) {
this.handleSearch(1);
}
}; };
getVirtualCategory = async () => { getVirtualCategory = async () => {
......
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