Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
merchant-manage-ui
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
ui
merchant-manage-ui
Commits
02b9c78f
Commit
02b9c78f
authored
Apr 10, 2023
by
张子雨
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 门店业务回显问题
parent
c2dec122
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
27 additions
and
28 deletions
+27
-28
storeModal.jsx
src/pages/chainStoreManage/components/storeModal.jsx
+22
-22
index.jsx
src/pages/chainStoreManage/index.jsx
+5
-6
No files found.
src/pages/chainStoreManage/components/storeModal.jsx
View file @
02b9c78f
...
@@ -20,6 +20,7 @@ const StoreModal = props => {
...
@@ -20,6 +20,7 @@ const StoreModal = props => {
formInfo
,
formInfo
,
status
,
status
,
productBusiness
,
productBusiness
,
existTakewayShop
,
}
=
props
;
}
=
props
;
const
[
areaAddr
,
setAreaAddr
]
=
useState
([]);
const
[
areaAddr
,
setAreaAddr
]
=
useState
([]);
const
[
visibleMap
,
setVisibleMap
]
=
useState
(
false
);
const
[
visibleMap
,
setVisibleMap
]
=
useState
(
false
);
...
@@ -30,7 +31,7 @@ const StoreModal = props => {
...
@@ -30,7 +31,7 @@ const StoreModal = props => {
address
:
''
,
address
:
''
,
});
});
const
[
disabled
,
setDisabled
]
=
useState
(
false
);
const
[
disabled
,
setDisabled
]
=
useState
(
false
);
const
[
isDisabled
,
setIsDisabled
]
=
useState
(
tru
e
);
const
[
isDisabled
,
setIsDisabled
]
=
useState
(
fals
e
);
const
[
businessModel
,
setBusinessModel
]
=
useState
([
const
[
businessModel
,
setBusinessModel
]
=
useState
([
{
label
:
'
到家外卖业务(外卖配送业务)
'
,
value
:
1
},
{
label
:
'
到家外卖业务(外卖配送业务)
'
,
value
:
1
},
{
label
:
'
实物商品业务员
'
,
value
:
2
},
{
label
:
'
实物商品业务员
'
,
value
:
2
},
...
@@ -38,30 +39,11 @@ const StoreModal = props => {
...
@@ -38,30 +39,11 @@ const StoreModal = props => {
]);
]);
const
divDom
=
useRef
();
const
divDom
=
useRef
();
useEffect
(()
=>
{
setDisabled
(
props
.
status
);
},
[
props
.
status
]);
useEffect
(()
=>
{
if
(
props
.
productBusiness
.
length
)
{
businessModel
.
forEach
(
item
=>
{
if
(
!
props
.
productBusiness
.
includes
(
item
.
value
))
{
item
.
disabled
=
true
;
}
if
(
props
.
existTakewayShop
&&
item
.
value
===
1
)
{
item
.
disabled
=
true
;
}
});
const
val
=
props
.
productBusiness
.
includes
(
1
);
setIsDisabled
(
val
);
setBusinessModel
(
businessModel
);
}
},
[
props
.
productBusiness
]);
const
handleCancel
=
isSuccess
=>
{
const
handleCancel
=
isSuccess
=>
{
resetFields
();
resetFields
();
onCancel
(
isSuccess
);
onCancel
(
isSuccess
);
};
};
const
onSubmit
=
()
=>
{
const
onSubmit
=
()
=>
{
validateFields
(
async
(
error
,
fieldsValue
)
=>
{
validateFields
(
async
(
error
,
fieldsValue
)
=>
{
if
(
!
error
)
{
if
(
!
error
)
{
...
@@ -252,7 +234,24 @@ const StoreModal = props => {
...
@@ -252,7 +234,24 @@ const StoreModal = props => {
if
(
visible
)
{
if
(
visible
)
{
resetFields
();
resetFields
();
const
info
=
Object
.
assign
({},
formInfo
);
const
info
=
Object
.
assign
({},
formInfo
);
console
.
log
(
info
);
const
val
=
info
?.
productBusiness
?.
includes
(
1
);
setIsDisabled
(
val
);
if
(
status
===
'
look
'
)
{
setDisabled
(
true
);
}
else
{
setDisabled
(
false
);
}
const
data
=
[...
businessModel
];
data
.
forEach
(
item
=>
{
item
.
disabled
=
!
productBusiness
.
includes
(
item
.
value
);
if
(
existTakewayShop
&&
item
.
value
===
1
&&
!
val
)
{
item
.
disabled
=
true
;
}
else
{
item
.
disabled
=
false
;
}
});
setBusinessModel
(
data
);
if
(
info
&&
info
.
id
)
{
if
(
info
&&
info
.
id
)
{
info
.
week
=
info
.
businessHours
.
weeks
;
info
.
week
=
info
.
businessHours
.
weeks
;
const
hours
=
info
.
businessHours
.
hoursItems
;
const
hours
=
info
.
businessHours
.
hoursItems
;
...
@@ -265,6 +264,7 @@ const StoreModal = props => {
...
@@ -265,6 +264,7 @@ const StoreModal = props => {
});
});
});
});
}
}
info
.
lnglat
=
`
${
info
.
longitude
}
,
${
info
.
latitude
}
`
;
info
.
lnglat
=
`
${
info
.
longitude
}
,
${
info
.
latitude
}
`
;
info
.
addr
=
[
info
.
provinceId
,
info
.
cityId
,
info
.
countyId
];
info
.
addr
=
[
info
.
provinceId
,
info
.
cityId
,
info
.
countyId
];
info
.
shopHeadImage
=
(
info
.
shopHeadImage
&&
[
info
.
shopHeadImage
])
||
[];
info
.
shopHeadImage
=
(
info
.
shopHeadImage
&&
[
info
.
shopHeadImage
])
||
[];
...
...
src/pages/chainStoreManage/index.jsx
View file @
02b9c78f
...
@@ -25,7 +25,7 @@ export default () => {
...
@@ -25,7 +25,7 @@ export default () => {
const
[
visible
,
setVisible
]
=
useState
(
false
);
const
[
visible
,
setVisible
]
=
useState
(
false
);
const
[
storeInfo
,
setStoreInfo
]
=
useState
({});
const
[
storeInfo
,
setStoreInfo
]
=
useState
({});
const
[
areaAddr
,
setAreaAddr
]
=
useState
([]);
const
[
areaAddr
,
setAreaAddr
]
=
useState
([]);
const
[
status
,
setStatus
]
=
useState
();
const
[
status
,
setStatus
]
=
useState
(
false
);
const
[
dataList
,
setDataList
]
=
useState
([]);
const
[
dataList
,
setDataList
]
=
useState
([]);
const
[
pageNo
,
setPageNo
]
=
useState
(
1
);
const
[
pageNo
,
setPageNo
]
=
useState
(
1
);
const
[
totalNum
,
setTotalNum
]
=
useState
(
0
);
const
[
totalNum
,
setTotalNum
]
=
useState
(
0
);
...
@@ -41,18 +41,17 @@ export default () => {
...
@@ -41,18 +41,17 @@ export default () => {
setProductBusiness
(
res
.
productBusiness
||
[]);
setProductBusiness
(
res
.
productBusiness
||
[]);
setExistTakewayShop
(
res
.
existTakewayShop
);
setExistTakewayShop
(
res
.
existTakewayShop
);
}
}
setVisible
(
true
);
};
};
const
onCreate
=
()
=>
{
const
onCreate
=
()
=>
{
setStatus
(
'
add
'
);
setStoreInfo
({});
setStoreInfo
({});
setVisible
(
true
);
getBusiness
();
getBusiness
();
};
};
const
onShowInfo
=
(
info
,
val
)
=>
{
const
onShowInfo
=
(
info
,
val
)
=>
{
setStoreInfo
(
info
);
setStoreInfo
(
info
);
const
value
=
val
!==
'
edit
'
;
setStatus
(
val
);
setStatus
(
value
);
setVisible
(
true
);
getBusiness
();
getBusiness
();
};
};
...
@@ -272,7 +271,7 @@ export default () => {
...
@@ -272,7 +271,7 @@ export default () => {
fixed
:
'
right
'
,
fixed
:
'
right
'
,
render
:
(
val
,
r
)
=>
(
render
:
(
val
,
r
)
=>
(
<
div
className=
{
style
.
actionBtn
}
>
<
div
className=
{
style
.
actionBtn
}
>
<
Button
key=
"look"
onClick=
{
()
=>
onShowInfo
(
r
)
}
>
<
Button
key=
"look"
onClick=
{
()
=>
onShowInfo
(
r
,
'
look
'
)
}
>
查看
查看
</
Button
>
</
Button
>
<
Button
key=
"seek"
onClick=
{
()
=>
onShowInfo
(
r
,
'
edit
'
)
}
>
<
Button
key=
"seek"
onClick=
{
()
=>
onShowInfo
(
r
,
'
edit
'
)
}
>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment