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
fdb23155
Commit
fdb23155
authored
Jun 13, 2023
by
张子雨
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 修改传参
parent
6cc6cdaf
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
53 additions
and
28 deletions
+53
-28
viewDepartmentModal.jsx
...ges/EmployeeManagement/components/viewDepartmentModal.jsx
+14
-10
index.jsx
src/pages/EmployeeManagement/index.jsx
+39
-18
No files found.
src/pages/EmployeeManagement/components/viewDepartmentModal.jsx
View file @
fdb23155
...
@@ -54,8 +54,9 @@ const ViewDepartmentModal = ({ visible, onClose, enterpriseList }) => {
...
@@ -54,8 +54,9 @@ const ViewDepartmentModal = ({ visible, onClose, enterpriseList }) => {
const
res
=
await
apiDepartmentUpdate
(
params
);
const
res
=
await
apiDepartmentUpdate
(
params
);
if
(
res
.
businessCode
===
'
0000
'
)
{
if
(
res
.
businessCode
===
'
0000
'
)
{
message
.
success
(
'
修改成功
'
);
message
.
success
(
'
修改成功
'
);
refForm
.
resetFields
();
setNameVisible
(
false
);
setNameVisible
(
false
);
getDepartmentList
({
data
:
{
enterpriseId
:
values
.
enterpriseId
},
...
pageInfo
});
getDepartmentList
({
data
:
{
enterpriseId
},
...
pageInfo
});
}
}
});
});
};
};
...
@@ -94,8 +95,9 @@ const ViewDepartmentModal = ({ visible, onClose, enterpriseList }) => {
...
@@ -94,8 +95,9 @@ const ViewDepartmentModal = ({ visible, onClose, enterpriseList }) => {
},
},
];
];
const
onCancel
=
()
=>
{
const
onCancel
=
()
=>
{
setNameVisible
(
false
);
refForm
.
resetFields
(
);
setName
(
''
);
setName
(
''
);
setNameVisible
(
false
);
};
};
const
onChange
=
(
page
,
size
)
=>
{
const
onChange
=
(
page
,
size
)
=>
{
...
@@ -160,14 +162,16 @@ const ViewDepartmentModal = ({ visible, onClose, enterpriseList }) => {
...
@@ -160,14 +162,16 @@ const ViewDepartmentModal = ({ visible, onClose, enterpriseList }) => {
onCancel=
{
onCancel
}
onCancel=
{
onCancel
}
>
>
<
Form
form=
{
refForm
}
>
<
Form
form=
{
refForm
}
>
<
Form
.
Item
{
name
&&
(
label=
"部门名称"
<
Form
.
Item
name=
"name"
label=
"部门名称"
initialValue=
{
name
}
name=
"name"
rules=
{
[{
required
:
true
,
message
:
'
请填写部门名称
'
}]
}
initialValue=
{
name
}
>
rules=
{
[{
required
:
true
,
message
:
'
请填写部门名称
'
}]
}
<
Input
/>
>
</
Form
.
Item
>
<
Input
/>
</
Form
.
Item
>
)
}
</
Form
>
</
Form
>
</
Modal
>
</
Modal
>
</
Modal
>
</
Modal
>
...
...
src/pages/EmployeeManagement/index.jsx
View file @
fdb23155
...
@@ -27,10 +27,14 @@ import {
...
@@ -27,10 +27,14 @@ import {
}
from
'
./service.js
'
;
}
from
'
./service.js
'
;
import
NewEmployeeModal
from
'
./components/newEmployeeModal
'
;
import
NewEmployeeModal
from
'
./components/newEmployeeModal
'
;
import
DepartmentModal
from
'
./components/departmentModal
'
;
import
DepartmentModal
from
'
./components/departmentModal
'
;
import
ViewDepartmentModal
from
'
./components/
V
iewDepartmentModal
'
;
import
ViewDepartmentModal
from
'
./components/
v
iewDepartmentModal
'
;
import
BlacklistModal
from
'
./components/
B
lacklistModal
'
;
import
BlacklistModal
from
'
./components/
b
lacklistModal
'
;
import
RechargeDetailsModal
from
'
./components/RechargeDetailsModal
'
;
import
RechargeDetailsModal
from
'
./components/RechargeDetailsModal
'
;
const
layout
=
{
labelCol
:
{
span
:
6
},
wrapperCol
:
{
span
:
8
},
};
const
{
confirm
}
=
Modal
;
const
{
confirm
}
=
Modal
;
const
StoreManagement
=
()
=>
{
const
StoreManagement
=
()
=>
{
const
[
modalVisible
,
setModalVisible
]
=
useState
(
false
);
const
[
modalVisible
,
setModalVisible
]
=
useState
(
false
);
...
@@ -48,6 +52,7 @@ const StoreManagement = () => {
...
@@ -48,6 +52,7 @@ const StoreManagement = () => {
page
:
1
,
page
:
1
,
size
:
10
,
size
:
10
,
});
});
const
[
total
,
setTotal
]
=
useState
(
0
);
const
[
searchForm
,
setSearchForm
]
=
useState
({});
const
[
searchForm
,
setSearchForm
]
=
useState
({});
const
formRef
=
useRef
(
null
);
const
formRef
=
useRef
(
null
);
const
[
editVisible
,
setEditVisible
]
=
useState
(
false
);
const
[
editVisible
,
setEditVisible
]
=
useState
(
false
);
...
@@ -55,10 +60,11 @@ const StoreManagement = () => {
...
@@ -55,10 +60,11 @@ const StoreManagement = () => {
const
[
repastType
,
setRepastType
]
=
useState
([]);
const
[
repastType
,
setRepastType
]
=
useState
([]);
const
[
repastId
,
setRepastId
]
=
useState
(
null
);
const
[
repastId
,
setRepastId
]
=
useState
(
null
);
const
shopList
=
async
()
=>
{
const
shopList
=
async
params
=>
{
const
res
=
await
apiStaffList
(
{
...
page
,
data
:
searchForm
}
);
const
res
=
await
apiStaffList
(
params
);
if
(
res
.
businessCode
===
'
0000
'
&&
res
.
data
?.
records
)
{
if
(
res
.
businessCode
===
'
0000
'
&&
res
.
data
?.
records
)
{
const
list
=
res
.
data
.
records
;
const
list
=
res
.
data
.
records
;
setTotal
(
res
.
data
.
total
);
setStaffList
(
list
);
setStaffList
(
list
);
}
}
};
};
...
@@ -92,7 +98,7 @@ const StoreManagement = () => {
...
@@ -92,7 +98,7 @@ const StoreManagement = () => {
setRechargeDetailsVisible
(
false
);
setRechargeDetailsVisible
(
false
);
if
(
val
)
{
if
(
val
)
{
getDepartmentList
(
searchForm
.
enterpriseId
);
getDepartmentList
(
searchForm
.
enterpriseId
);
shopList
();
shopList
(
{
...
page
,
data
:
searchForm
}
);
setSelectedRowKeys
([]);
setSelectedRowKeys
([]);
}
}
};
};
...
@@ -111,8 +117,10 @@ const StoreManagement = () => {
...
@@ -111,8 +117,10 @@ const StoreManagement = () => {
setFirstEnterprise
(
firstOption
);
setFirstEnterprise
(
firstOption
);
getDepartmentList
(
firstOption
);
getDepartmentList
(
firstOption
);
setSearchForm
({
enterpriseId
:
firstOption
});
setSearchForm
({
enterpriseId
:
firstOption
});
shopList
({
...
page
,
data
:
{
enterpriseId
:
firstOption
}
});
}
}
};
};
// 设置黑名单
// 设置黑名单
const
getBlacklist
=
()
=>
{
const
getBlacklist
=
()
=>
{
if
(
!
selectedRowKeys
.
length
)
{
if
(
!
selectedRowKeys
.
length
)
{
...
@@ -124,17 +132,12 @@ const StoreManagement = () => {
...
@@ -124,17 +132,12 @@ const StoreManagement = () => {
useEffect
(()
=>
{
useEffect
(()
=>
{
getEnterpriseList
();
getEnterpriseList
();
},
[]);
},
[]);
useEffect
(()
=>
{
if
(
searchForm
.
enterpriseId
)
{
shopList
();
}
},
[
searchForm
,
page
]);
// 删除
// 删除
const
deleteEmployee
=
async
id
=>
{
const
deleteEmployee
=
async
id
=>
{
const
res
=
await
apiStaffDelete
({
id
,
enterpriseId
:
searchForm
.
enterpriseId
,
state
:
0
});
const
res
=
await
apiStaffDelete
({
id
,
enterpriseId
:
searchForm
.
enterpriseId
,
state
:
0
});
if
(
res
.
businessCode
===
'
0000
'
)
{
if
(
res
.
businessCode
===
'
0000
'
)
{
message
.
success
(
'
删除成功!
'
);
message
.
success
(
'
删除成功!
'
);
shopList
();
shopList
(
{
...
page
,
data
:
searchForm
}
);
}
}
};
};
// 删除
// 删除
...
@@ -157,16 +160,27 @@ const StoreManagement = () => {
...
@@ -157,16 +160,27 @@ const StoreManagement = () => {
// 搜索
// 搜索
const
onFinish
=
values
=>
{
const
onFinish
=
values
=>
{
setSearchForm
(
values
);
setSearchForm
(
values
);
setPage
({
current
:
1
,
pageSize
:
10
});
const
pageInfo
=
{
page
:
1
,
size
:
10
,
};
setPage
(
pageInfo
);
shopList
({
...
pageInfo
,
data
:
values
});
};
};
// 重置
// 重置
const
onReset
=
()
=>
{
const
onReset
=
()
=>
{
formRef
.
current
.
resetFields
();
formRef
.
current
.
resetFields
();
setSearchForm
({
enterpriseId
:
firstEnterprise
});
setSearchForm
({
enterpriseId
:
firstEnterprise
});
shopList
({
...
page
,
data
:
{
enterpriseId
:
firstEnterprise
}
});
};
};
// 分页
// 分页
const
handleTableChange
=
val
=>
{
const
onChange
=
(
pageNo
,
size
)
=>
{
setPage
(
val
);
const
pageInfo
=
{
page
:
pageNo
,
size
,
};
setPage
(
pageInfo
);
shopList
({
data
:
searchForm
,
...
pageInfo
});
};
};
const
goDetails
=
async
({
staffNo
})
=>
{
const
goDetails
=
async
({
staffNo
})
=>
{
setRechargeDetailsVisible
(
true
);
setRechargeDetailsVisible
(
true
);
...
@@ -184,7 +198,7 @@ const StoreManagement = () => {
...
@@ -184,7 +198,7 @@ const StoreManagement = () => {
});
});
if
(
res
.
businessCode
===
'
0000
'
)
{
if
(
res
.
businessCode
===
'
0000
'
)
{
message
.
success
(
'
设置成功
'
);
message
.
success
(
'
设置成功
'
);
shopList
();
shopList
(
{
...
page
,
data
:
searchForm
}
);
}
}
};
};
const
enterpriseOnChange
=
val
=>
{
const
enterpriseOnChange
=
val
=>
{
...
@@ -195,11 +209,18 @@ const StoreManagement = () => {
...
@@ -195,11 +209,18 @@ const StoreManagement = () => {
goDetails
,
goDetails
,
handleLimitChange
,
handleLimitChange
,
};
};
const
pagination
=
{
...
page
,
total
,
showTotal
:
t
=>
`共
${
t
}
项数据`
,
onChange
,
onShowSizeChange
:
onChange
,
};
return
(
return
(
<
PageHeaderWrapper
>
<
PageHeaderWrapper
>
<
Card
className=
{
styles
.
card
}
>
<
Card
className=
{
styles
.
card
}
>
{
firstEnterprise
&&
(
{
firstEnterprise
&&
(
<
Form
ref=
{
formRef
}
onFinish=
{
onFinish
}
>
<
Form
ref=
{
formRef
}
onFinish=
{
onFinish
}
{
...
layout
}
>
<
Row
gutter=
{
24
}
>
<
Row
gutter=
{
24
}
>
<
Col
span=
{
8
}
>
<
Col
span=
{
8
}
>
<
Form
.
Item
<
Form
.
Item
...
@@ -270,7 +291,7 @@ const StoreManagement = () => {
...
@@ -270,7 +291,7 @@ const StoreManagement = () => {
<
Input
maxLength=
"8"
allowClear
/>
<
Input
maxLength=
"8"
allowClear
/>
</
Form
.
Item
>
</
Form
.
Item
>
</
Col
>
</
Col
>
<
Col
>
<
Col
span=
{
24
}
>
<
Form
.
Item
>
<
Form
.
Item
>
<
Button
type=
"primary"
htmlType=
"submit"
>
<
Button
type=
"primary"
htmlType=
"submit"
>
搜索
搜索
...
@@ -322,8 +343,8 @@ const StoreManagement = () => {
...
@@ -322,8 +343,8 @@ const StoreManagement = () => {
dataSource=
{
staffList
}
dataSource=
{
staffList
}
rowKey=
{
r
=>
r
.
id
}
rowKey=
{
r
=>
r
.
id
}
bordered
bordered
onChange=
{
handleTableChange
}
rowSelection=
{
rowSelection
}
rowSelection=
{
rowSelection
}
pagination=
{
pagination
}
/>
/>
<
NewEmployeeModal
<
NewEmployeeModal
visible=
{
modalVisible
}
visible=
{
modalVisible
}
...
...
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