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
dc9da6aa
Commit
dc9da6aa
authored
Jun 13, 2023
by
张子雨
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 接口联调
parent
fdb23155
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
84 additions
and
56 deletions
+84
-56
env.config.js
config/env.config.js
+1
-1
departmentModal.jsx
src/pages/EmployeeManagement/components/departmentModal.jsx
+1
-1
viewDepartmentModal.jsx
...ges/EmployeeManagement/components/viewDepartmentModal.jsx
+9
-11
data.js
src/pages/EmployeeManagement/data.js
+6
-0
index.jsx
src/pages/EmployeeManagement/index.jsx
+1
-2
index.jsx
src/pages/StoreManagement/addModal/index.jsx
+21
-18
data.js
src/pages/StoreManagement/data.js
+6
-5
index.jsx
src/pages/StoreManagement/index.jsx
+39
-18
No files found.
config/env.config.js
View file @
dc9da6aa
...
...
@@ -10,7 +10,7 @@ const getUrlParams = name => {
return
null
;
};
const
isPlatForm
=
+
getUrlParams
(
'
isMaster
'
)
===
1
;
const
apiPrefix
=
isPlatForm
?
'
/api/consoles
'
:
'
/api/
merchant
s
'
;
const
apiPrefix
=
isPlatForm
?
'
/api/consoles
'
:
'
/api/
enterprise
s
'
;
const
envAPi
=
{
api
:
`https://security-
${
environment
}
.liangkebang.net`
,
//'https://security-xyqb.liangkebang.net',
...
...
src/pages/EmployeeManagement/components/departmentModal.jsx
View file @
dc9da6aa
...
...
@@ -140,7 +140,7 @@ const DepartmentModal = ({ visible, onClose, enterpriseList }) => {
</
Dragger
>
</
Item
>
<
div
className=
{
styles
.
employees
}
>
<
a
href=
"https://kdspstatic.q-gp.com/%E6%96%B0%E5%A2%9E%E
5%91%98%E5%B7%A5
.xlsx"
>
<
a
href=
"https://kdspstatic.q-gp.com/%E6%96%B0%E5%A2%9E%E
9%83%A8%E9%97%A8
.xlsx"
>
部门导入模版.xlsx
</
a
>
</
div
>
...
...
src/pages/EmployeeManagement/components/viewDepartmentModal.jsx
View file @
dc9da6aa
...
...
@@ -27,6 +27,7 @@ const ViewDepartmentModal = ({ visible, onClose, enterpriseList }) => {
};
const
editName
=
row
=>
{
setName
(
row
.
name
);
refForm
.
setFieldsValue
({
name
:
row
.
name
});
setId
(
row
.
id
);
setNameVisible
(
true
);
};
...
...
@@ -54,7 +55,6 @@ const ViewDepartmentModal = ({ visible, onClose, enterpriseList }) => {
const
res
=
await
apiDepartmentUpdate
(
params
);
if
(
res
.
businessCode
===
'
0000
'
)
{
message
.
success
(
'
修改成功
'
);
refForm
.
resetFields
();
setNameVisible
(
false
);
getDepartmentList
({
data
:
{
enterpriseId
},
...
pageInfo
});
}
...
...
@@ -162,16 +162,14 @@ const ViewDepartmentModal = ({ visible, onClose, enterpriseList }) => {
onCancel=
{
onCancel
}
>
<
Form
form=
{
refForm
}
>
{
name
&&
(
<
Form
.
Item
label=
"部门名称"
name=
"name"
initialValue=
{
name
}
rules=
{
[{
required
:
true
,
message
:
'
请填写部门名称
'
}]
}
>
<
Input
/>
</
Form
.
Item
>
)
}
<
Form
.
Item
label=
"部门名称"
name=
"name"
initialValue=
{
name
}
rules=
{
[{
required
:
true
,
message
:
'
请填写部门名称
'
}]
}
>
<
Input
/>
</
Form
.
Item
>
</
Form
>
</
Modal
>
</
Modal
>
...
...
src/pages/EmployeeManagement/data.js
View file @
dc9da6aa
...
...
@@ -26,6 +26,12 @@ export const columns = props => [
dataIndex
:
'
staffName
'
,
align
:
'
center
'
,
},
{
title
:
'
员工ID
'
,
key
:
'
staffNo
'
,
dataIndex
:
'
staffNo
'
,
align
:
'
center
'
,
},
{
title
:
'
员工手机号
'
,
key
:
'
mobile
'
,
...
...
src/pages/EmployeeManagement/index.jsx
View file @
dc9da6aa
...
...
@@ -231,7 +231,6 @@ const StoreManagement = () => {
initialValue=
{
firstEnterprise
}
>
<
Select
allowClear
showSearch
filterOption=
{
(
input
,
option
)
=>
(
option
?.
label
??
''
).
toLowerCase
().
includes
(
input
.
toLowerCase
())
...
...
@@ -341,7 +340,7 @@ const StoreManagement = () => {
<
Table
columns=
{
columns
(
res
)
}
dataSource=
{
staffList
}
rowKey=
{
r
=>
r
.
id
}
rowKey=
{
r
=>
r
.
staffNo
}
bordered
rowSelection=
{
rowSelection
}
pagination=
{
pagination
}
...
...
src/pages/StoreManagement/addModal/index.jsx
View file @
dc9da6aa
...
...
@@ -4,11 +4,11 @@ import styles from '../index.less';
import
{
apiSelectedList
,
apiSelectList
,
apiShopAdd
}
from
'
../service.js
'
;
const
AddModal
=
props
=>
{
const
{
addVisible
,
enterpriseId
,
name
}
=
props
;
const
{
addVisible
,
enterpriseId
,
name
,
onCancel
}
=
props
;
const
[
selectList
,
setSelectList
]
=
useState
([]);
const
[
options
,
setOptions
]
=
useState
([]);
const
handleCancel
=
()
=>
{
props
.
onCancel
(
false
);
onCancel
(
false
);
};
const
handleChange
=
value
=>
{
setSelectList
(
value
);
...
...
@@ -34,44 +34,47 @@ const AddModal = props => {
const
{
data
}
=
res
;
const
list
=
[];
data
.
forEach
(
item
=>
{
list
.
push
(
item
.
i
d
);
list
.
push
(
item
.
shopI
d
);
});
setSelectList
(
list
);
}
};
const
getSelectList
=
async
()
=>
{
const
res
=
await
apiSelectList
({
id
:
enterpriseId
});
const
res
=
await
apiSelectList
({
enterpriseId
});
if
(
res
.
businessCode
===
'
0000
'
)
{
const
optionData
=
res
.
data
.
map
(
item
=>
({
value
:
item
.
i
d
,
label
:
item
.
n
ame
,
value
:
item
.
shopI
d
,
label
:
item
.
shopN
ame
,
}));
setOptions
(
optionData
);
getSelectedList
();
}
};
useEffect
(()
=>
{
if
(
addVisible
)
{
getSelect
ed
List
();
getSelectList
();
}
},
[
addVisible
]);
return
(
<>
<
Modal
title=
"添加企业店铺"
onOk=
{
onOk
}
visible=
{
addVisible
}
onCancel=
{
()
=>
handleCancel
}
>
<
Modal
title=
"添加企业店铺"
onOk=
{
onOk
}
visible=
{
addVisible
}
onCancel=
{
handleCancel
}
>
<
Form
>
<
Form
.
Item
label=
"企业名称"
>
<
span
>
{
name
}
</
span
>
</
Form
.
Item
>
<
Form
.
Item
label=
"添加微店"
name=
"shopIds"
initialValue=
{
selectList
}
>
<
Select
mode=
"multiple"
allowClear
style=
{
{
width
:
'
100%
'
}
}
placeholder=
"请选择微店"
onChange=
{
handleChange
}
options=
{
options
}
/>
</
Form
.
Item
>
{
selectList
&&
selectList
.
length
>
0
&&
(
<
Form
.
Item
label=
"添加微店"
name=
"shopIds"
initialValue=
{
selectList
}
>
<
Select
mode=
"multiple"
allowClear
style=
{
{
width
:
'
100%
'
}
}
placeholder=
"请选择微店"
onChange=
{
handleChange
}
options=
{
options
}
/>
</
Form
.
Item
>
)
}
<
Form
.
Item
label=
"餐饮类型"
>
<
span
>
到店
</
span
>
</
Form
.
Item
>
...
...
src/pages/StoreManagement/data.js
View file @
dc9da6aa
...
...
@@ -20,8 +20,8 @@ export const repastTypeList = [
export
const
columns
=
props
=>
[
{
title
:
'
微店ID
'
,
key
:
'
i
d
'
,
dataIndex
:
'
i
d
'
,
key
:
'
shopI
d
'
,
dataIndex
:
'
shopI
d
'
,
align
:
'
center
'
,
},
{
...
...
@@ -37,7 +37,8 @@ export const columns = props => [
align
:
'
center
'
,
render
:
(
_
,
row
)
=>
{
const
status
=
!
row
?.
pickselfName
;
if
(
row
?.
mealType
?.
length
)
{
const
isArray
=
Array
.
isArray
(
row
?.
mealType
);
if
(
isArray
)
{
return
(
<
Button
type
=
"
text
"
disabled
=
{
status
}
onClick
=
{()
=>
props
.
editRepastType
(
row
)}
>
{
row
.
mealType
?.
map
((
item
,
index
)
=>
(
...
...
@@ -75,8 +76,8 @@ export const columns = props => [
},
{
title
:
'
修改时间
'
,
key
:
'
amoun
t
'
,
dataIndex
:
'
amoun
t
'
,
key
:
'
createdA
t
'
,
dataIndex
:
'
createdA
t
'
,
align
:
'
center
'
,
},
{
...
...
src/pages/StoreManagement/index.jsx
View file @
dc9da6aa
import
React
,
{
useState
,
useRef
,
forwardRef
,
useEffect
}
from
'
react
'
;
import
{
PageHeaderWrapper
}
from
'
@ant-design/pro-layout
'
;
import
{
Modal
,
Form
,
Select
,
Table
,
Card
,
Row
,
Col
,
Input
,
Button
,
message
}
from
'
antd
'
;
import
{
set
}
from
'
lodash
'
;
import
{
columns
,
repastTypeList
}
from
'
./data
'
;
import
EditRepastModal
from
'
./editRepastModal
'
;
import
AddModal
from
'
./addModal
'
;
...
...
@@ -19,6 +20,7 @@ const StoreManagement = () => {
page
:
1
,
size
:
10
,
});
const
[
total
,
setTotal
]
=
useState
(
0
);
const
[
searchForm
,
setSearchForm
]
=
useState
({});
const
formRef
=
useRef
(
null
);
const
[
editVisible
,
setEditVisible
]
=
useState
(
false
);
...
...
@@ -31,14 +33,11 @@ const StoreManagement = () => {
const
[
dataList
,
setDataList
]
=
useState
([]);
const
[
name
,
setName
]
=
useState
(
''
);
const
shopList
=
async
()
=>
{
const
params
=
{
...
page
,
data
:
searchForm
,
};
const
shopList
=
async
params
=>
{
const
res
=
await
setShopList
(
params
);
if
(
res
.
businessCode
===
'
0000
'
)
{
setDataList
(
res
.
data
?.
records
);
setTotal
(
res
.
data
?.
total
);
}
};
...
...
@@ -52,23 +51,21 @@ const StoreManagement = () => {
value
:
item
.
id
,
label
:
item
.
name
,
}));
setEnterprise
({
value
:
list
[
0
].
id
,
label
:
list
[
0
].
name
});
setFirstEnterprise
(
firstOption
);
setEnterpriseList
(
optionData
);
setSearchForm
({
enterpriseId
:
firstOption
});
shopList
();
shopList
(
{
data
:
{
enterpriseId
:
firstOption
},
...
page
}
);
}
};
useEffect
(()
=>
{
getEnterpriseList
();
},
[]);
useEffect
(()
=>
{
shopList
();
},
[
searchForm
,
page
]);
// 关闭弹框
const
closeModal
=
value
=>
{
if
(
value
)
{
shopList
();
shopList
(
{
data
:
searchForm
,
...
page
}
);
}
setEditVisible
(
false
);
setAddVisible
(
false
);
...
...
@@ -91,7 +88,7 @@ const StoreManagement = () => {
const
res
=
await
setShopDelete
({
id
});
if
(
res
.
businessCode
===
'
0000
'
)
{
message
.
success
(
'
删除成功!
'
);
shopList
();
shopList
(
{
...
page
,
data
:
searchForm
}
);
}
};
// 删除
...
...
@@ -112,28 +109,46 @@ const StoreManagement = () => {
};
// 添加商户
const
addShop
=
async
()
=>
{
const
res
=
await
busineesTypeCheck
({
id
:
searchForm
.
i
d
});
const
res
=
await
busineesTypeCheck
({
enterpriseId
:
searchForm
.
enterpriseI
d
});
if
(
res
.
businessCode
===
'
0000
'
)
{
const
val
=
enterpriseList
.
find
(
item
=>
item
.
value
===
searchForm
.
enterpriseId
).
label
;
setName
(
val
);
setName
(
enterprise
.
label
);
setAddVisible
(
true
);
}
};
// 搜索
const
onFinish
=
async
values
=>
{
setSearchForm
(
values
);
setPage
({
current
:
1
,
pageSize
:
10
});
const
pageInfo
=
{
page
:
1
,
size
:
10
,
};
setPage
(
pageInfo
);
shopList
({
data
:
values
,
...
pageInfo
});
};
// 重置
const
onReset
=
()
=>
{
formRef
.
current
.
resetFields
();
const
pageInfo
=
{
page
:
1
,
size
:
10
,
};
setPage
(
pageInfo
);
setSearchForm
({
enterpriseId
:
firstEnterprise
});
shopList
({
data
:
{
enterpriseId
:
firstEnterprise
},
...
pageInfo
});
};
// 分页
const
handleTableChange
=
val
=>
{
setPage
(
val
);
};
const
pagination
=
{
...
page
,
total
,
showTotal
:
t
=>
`共
${
t
}
项数据`
,
handleTableChange
,
onShowSizeChange
:
handleTableChange
,
};
const
res
=
{
editRepastType
,
delShop
,
...
...
@@ -206,9 +221,10 @@ const StoreManagement = () => {
<
Table
columns=
{
columns
(
res
)
}
dataSource=
{
dataList
}
rowKey=
{
r
=>
r
.
appealNo
}
rowKey=
{
r
=>
r
.
id
}
bordered
onChange=
{
handleTableChange
}
// onChange={handleTableChange}
pagination=
{
pagination
}
/>
<
EditRepastModal
editVisible=
{
editVisible
}
...
...
@@ -216,7 +232,12 @@ const StoreManagement = () => {
id=
{
repastId
}
onCancel=
{
closeModal
}
/>
<
AddModal
addVisible=
{
addVisible
}
name=
{
name
}
onCancel=
{
closeModal
}
/>
<
AddModal
addVisible=
{
addVisible
}
enterpriseId=
{
searchForm
.
enterpriseId
}
name=
{
name
}
onCancel=
{
closeModal
}
/>
</
PageHeaderWrapper
>
);
};
...
...
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