Commit 245c0292 authored by 武广's avatar 武广

fix: 修改缺少门店问题

parent 89627e63
......@@ -21,13 +21,14 @@ const GoodsGroup = options => {
const json = JSON.parse(user);
const res = await apiSupplierShopList(json.id);
if (res && res.data && res.data.length > 0) {
setShops(
res.data.map(item => ({
label: item.name,
value: +item.id,
})),
);
options.changeShop(+res.data[0].id);
// setShops(
// res.data.map(item => ({
// label: item.name,
// value: +item.id,
// })),
// );
// options.changeShop(+res.data[0].id);
options.changeShop(0);
} else {
options.changeShop(0);
}
......@@ -111,6 +112,7 @@ const GoodsGroup = options => {
return (
<div className={styles.groupBox}>
{(shops && shops.length && (
<>
<div className={styles['groupBox-title']}>
<div className={styles['groupBox-title--name']}>所属门店</div>
<Select
......@@ -124,11 +126,11 @@ const GoodsGroup = options => {
options={shops}
/>
</div>
)) ||
''}
<div className={styles['groupBox-title']}>
<div className={styles['groupBox-title--name']}>商品分组</div>
<Button onClick={() => setGroupEdit(!groupEdit)}>{groupEdit ? '完成' : '编辑分组'}</Button>
<Button onClick={() => setGroupEdit(!groupEdit)}>
{groupEdit ? '完成' : '编辑分组'}
</Button>
</div>
<div className={styles['groupBox-body']}>
{groupEdit ? (
......@@ -167,6 +169,9 @@ const GoodsGroup = options => {
</div>
)}
</div>
</>
)) ||
''}
<GroupInfo
isModalOpen={isModalOpen}
id={storageId}
......
......@@ -177,6 +177,7 @@ const Takeaway = options => {
<div className={styles.takeawayBox}>
<Spin spinning={loading}>
<GoodsGroup shopId={shopId} changeShop={setShopId} changeGroup={setGroupId} />
{(shopId && (
<ActionBar
selectedRowKeys={selectedRowKeys}
shopId={shopId}
......@@ -184,6 +185,8 @@ const Takeaway = options => {
openModal={openModal}
newGoods={onNew}
/>
)) ||
''}
<Table
dataSource={tableData}
bordered
......
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