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
2d3a0026
Commit
2d3a0026
authored
Jun 14, 2023
by
张子雨
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 代码优化
parent
ede5c396
Changes
9
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
84 additions
and
43 deletions
+84
-43
RechargeDetailsModal.jsx
...es/EmployeeManagement/components/RechargeDetailsModal.jsx
+14
-4
blacklistModal.jsx
src/pages/EmployeeManagement/components/blacklistModal.jsx
+7
-2
departmentModal.jsx
src/pages/EmployeeManagement/components/departmentModal.jsx
+3
-3
newEmployeeModal.jsx
src/pages/EmployeeManagement/components/newEmployeeModal.jsx
+9
-4
viewDepartmentModal.jsx
...ges/EmployeeManagement/components/viewDepartmentModal.jsx
+2
-2
data.js
src/pages/EmployeeManagement/data.js
+2
-2
index.jsx
src/pages/EmployeeManagement/index.jsx
+33
-17
data.js
src/pages/StoreManagement/data.js
+5
-2
index.jsx
src/pages/StoreManagement/index.jsx
+9
-7
No files found.
src/pages/EmployeeManagement/components/RechargeDetailsModal.jsx
View file @
2d3a0026
...
@@ -5,29 +5,39 @@ const RechargeDetailsModal = ({ visible, onClose, list }) => {
...
@@ -5,29 +5,39 @@ const RechargeDetailsModal = ({ visible, onClose, list }) => {
const
columns
=
[
const
columns
=
[
{
{
title
:
'
员工ID
'
,
title
:
'
员工ID
'
,
dataIndex
:
'
id
'
,
dataIndex
:
'
staffNo
'
,
key
:
'
id
'
,
key
:
'
staffNo
'
,
align
:
'
center
'
,
},
},
{
{
title
:
'
员工姓名
'
,
title
:
'
员工姓名
'
,
dataIndex
:
'
staffName
'
,
dataIndex
:
'
staffName
'
,
key
:
'
staffName
'
,
key
:
'
staffName
'
,
align
:
'
center
'
,
},
},
{
{
title
:
'
充值余额
'
,
title
:
'
充值余额
'
,
dataIndex
:
'
rechargeAmount
'
,
dataIndex
:
'
rechargeAmount
'
,
key
:
'
rechargeAmount
'
,
key
:
'
rechargeAmount
'
,
align
:
'
center
'
,
},
},
{
{
title
:
'
充值时间
'
,
title
:
'
充值时间
'
,
dataIndex
:
'
generateDate
'
,
dataIndex
:
'
generateDate
'
,
key
:
'
generateDate
'
,
key
:
'
generateDate
'
,
align
:
'
center
'
,
},
},
];
];
return
(
return
(
<
Modal
visible=
{
visible
}
title=
"充值明细"
onCancel=
{
onClose
}
footer=
{
null
}
>
<
Modal
<
Table
dataSource=
{
list
}
columns=
{
columns
}
pagination=
{
false
}
border
/>
width=
"800px"
visible=
{
visible
}
title=
"充值明细"
onCancel=
{
()
=>
onClose
(
false
,
'
rechargeDetails
'
)
}
footer=
{
null
}
>
<
Table
dataSource=
{
list
}
columns=
{
columns
}
pagination=
{
false
}
bordered
/>
</
Modal
>
</
Modal
>
);
);
};
};
...
...
src/pages/EmployeeManagement/components/blacklistModal.jsx
View file @
2d3a0026
...
@@ -19,14 +19,19 @@ const BlacklistModal = ({ visible, onClose, list, enterpriseId }) => {
...
@@ -19,14 +19,19 @@ const BlacklistModal = ({ visible, onClose, list, enterpriseId }) => {
apiStaffBlack
(
params
).
then
(
res
=>
{
apiStaffBlack
(
params
).
then
(
res
=>
{
if
(
res
.
businessCode
===
'
0000
'
)
{
if
(
res
.
businessCode
===
'
0000
'
)
{
message
.
success
(
'
设置成功
'
);
message
.
success
(
'
设置成功
'
);
onClose
(
true
);
onClose
(
true
,
'
blacklist
'
);
}
}
});
});
});
});
};
};
return
(
return
(
<
Modal
visible=
{
visible
}
title=
"设置员工黑名单"
onCancel=
{
onClose
}
onOk=
{
handleSave
}
>
<
Modal
visible=
{
visible
}
title=
"设置员工黑名单"
onCancel=
{
()
=>
onClose
(
false
,
'
blacklist
'
)
}
onOk=
{
handleSave
}
>
<
Form
form=
{
form
}
layout=
"vertical"
>
<
Form
form=
{
form
}
layout=
"vertical"
>
<
Item
name=
"ids"
label=
"您确定要把员工ID:"
>
<
Item
name=
"ids"
label=
"您确定要把员工ID:"
>
{
list
.
length
&&
list
.
map
(
item
=>
<
span
>
{
item
}
,
</
span
>)
}
{
list
.
length
&&
list
.
map
(
item
=>
<
span
>
{
item
}
,
</
span
>)
}
...
...
src/pages/EmployeeManagement/components/departmentModal.jsx
View file @
2d3a0026
...
@@ -17,7 +17,7 @@ const DepartmentModal = ({ visible, onClose, enterpriseList }) => {
...
@@ -17,7 +17,7 @@ const DepartmentModal = ({ visible, onClose, enterpriseList }) => {
const
handleCancel
=
val
=>
{
const
handleCancel
=
val
=>
{
form
.
resetFields
();
form
.
resetFields
();
setImportMode
(
false
);
setImportMode
(
false
);
onClose
(
val
);
onClose
(
val
,
'
department
'
);
};
};
const
handleImportChange
=
info
=>
{
const
handleImportChange
=
info
=>
{
...
@@ -68,7 +68,7 @@ const DepartmentModal = ({ visible, onClose, enterpriseList }) => {
...
@@ -68,7 +68,7 @@ const DepartmentModal = ({ visible, onClose, enterpriseList }) => {
visible=
{
visible
}
visible=
{
visible
}
onCancel=
{
()
=>
handleCancel
(
false
)
}
onCancel=
{
()
=>
handleCancel
(
false
)
}
footer=
{
[
footer=
{
[
<
Button
key=
"cancel"
onClick=
{
onClose
}
>
<
Button
key=
"cancel"
onClick=
{
()
=>
handleCancel
(
false
)
}
>
取消
取消
</
Button
>,
</
Button
>,
<
Button
key=
"save"
type=
"primary"
onClick=
{
()
=>
handleSave
()
}
>
<
Button
key=
"save"
type=
"primary"
onClick=
{
()
=>
handleSave
()
}
>
...
@@ -151,7 +151,7 @@ const DepartmentModal = ({ visible, onClose, enterpriseList }) => {
...
@@ -151,7 +151,7 @@ const DepartmentModal = ({ visible, onClose, enterpriseList }) => {
name=
"name"
name=
"name"
rules=
{
[{
required
:
true
,
message
:
'
请输入部门名称
'
}]
}
rules=
{
[{
required
:
true
,
message
:
'
请输入部门名称
'
}]
}
>
>
<
Input
/>
<
Input
maxLength=
{
20
}
/>
</
Item
>
</
Item
>
)
}
)
}
</
Form
>
</
Form
>
...
...
src/pages/EmployeeManagement/components/newEmployeeModal.jsx
View file @
2d3a0026
...
@@ -19,7 +19,7 @@ const NewEmployeeModal = props => {
...
@@ -19,7 +19,7 @@ const NewEmployeeModal = props => {
const
handleCancel
=
val
=>
{
const
handleCancel
=
val
=>
{
form
.
resetFields
();
form
.
resetFields
();
setImportMode
(
false
);
setImportMode
(
false
);
onClose
(
val
);
onClose
(
val
,
'
newEmployee
'
);
};
};
const
handleSave
=
()
=>
{
const
handleSave
=
()
=>
{
form
.
validateFields
().
then
(
async
values
=>
{
form
.
validateFields
().
then
(
async
values
=>
{
...
@@ -64,15 +64,16 @@ const NewEmployeeModal = props => {
...
@@ -64,15 +64,16 @@ const NewEmployeeModal = props => {
setDepartmentList
([]);
setDepartmentList
([]);
};
};
const
onChange
=
value
=>
{
const
onChange
=
value
=>
{
form
.
setFieldsValue
({
departmentId
:
undefined
});
getDepartmentList
(
value
);
getDepartmentList
(
value
);
};
};
return
(
return
(
<
Modal
<
Modal
visible=
{
visible
}
visible=
{
visible
}
title=
"添加新员工"
title=
"添加新员工"
onCancel=
{
onClose
}
onCancel=
{
handleCancel
}
footer=
{
[
footer=
{
[
<
Button
key=
"cancel"
onClick=
{
onClose
}
>
<
Button
key=
"cancel"
onClick=
{
handleCancel
}
>
取消
取消
</
Button
>,
</
Button
>,
<
Button
key=
"save"
type=
"primary"
onClick=
{
handleSave
}
>
<
Button
key=
"save"
type=
"primary"
onClick=
{
handleSave
}
>
...
@@ -177,9 +178,13 @@ const NewEmployeeModal = props => {
...
@@ -177,9 +178,13 @@ const NewEmployeeModal = props => {
required
:
true
,
required
:
true
,
message
:
'
请输入员工ID
'
,
message
:
'
请输入员工ID
'
,
},
},
{
pattern
:
/^
[
a-zA-Z0-9
]
+$/
,
message
:
'
员工ID由数字与英文大小写字母组成
'
,
},
]
}
]
}
>
>
<
Input
/>
<
Input
maxLength=
{
15
}
/>
</
Form
.
Item
>
</
Form
.
Item
>
<
Form
.
Item
<
Form
.
Item
name=
"staffName"
name=
"staffName"
...
...
src/pages/EmployeeManagement/components/viewDepartmentModal.jsx
View file @
2d3a0026
...
@@ -23,7 +23,7 @@ const ViewDepartmentModal = ({ visible, onClose, enterpriseList }) => {
...
@@ -23,7 +23,7 @@ const ViewDepartmentModal = ({ visible, onClose, enterpriseList }) => {
setDataSource
([]);
setDataSource
([]);
setPageInfo
({
page
:
1
,
size
:
10
});
setPageInfo
({
page
:
1
,
size
:
10
});
setTotal
(
0
);
setTotal
(
0
);
onClose
();
onClose
(
false
,
'
viewDepartment
'
);
};
};
const
editName
=
row
=>
{
const
editName
=
row
=>
{
setName
(
row
.
name
);
setName
(
row
.
name
);
...
@@ -168,7 +168,7 @@ const ViewDepartmentModal = ({ visible, onClose, enterpriseList }) => {
...
@@ -168,7 +168,7 @@ const ViewDepartmentModal = ({ visible, onClose, enterpriseList }) => {
initialValue=
{
name
}
initialValue=
{
name
}
rules=
{
[{
required
:
true
,
message
:
'
请填写部门名称
'
}]
}
rules=
{
[{
required
:
true
,
message
:
'
请填写部门名称
'
}]
}
>
>
<
Input
/>
<
Input
maxLength=
{
20
}
/>
</
Form
.
Item
>
</
Form
.
Item
>
</
Form
>
</
Form
>
</
Modal
>
</
Modal
>
...
...
src/pages/EmployeeManagement/data.js
View file @
2d3a0026
...
@@ -67,8 +67,8 @@ export const columns = props => [
...
@@ -67,8 +67,8 @@ export const columns = props => [
},
},
{
{
title
:
'
员工企业余额
'
,
title
:
'
员工企业余额
'
,
key
:
'
balance
BackFlag
'
,
key
:
'
balance
'
,
dataIndex
:
'
balance
BackFlag
'
,
dataIndex
:
'
balance
'
,
align
:
'
center
'
,
align
:
'
center
'
,
},
},
{
{
...
...
src/pages/EmployeeManagement/index.jsx
View file @
2d3a0026
...
@@ -90,16 +90,30 @@ const StoreManagement = () => {
...
@@ -90,16 +90,30 @@ const StoreManagement = () => {
setDepartmentList
([]);
setDepartmentList
([]);
};
};
// 关闭弹框
// 关闭弹框
const
handleCloseModal
=
val
=>
{
const
handleCloseModal
=
(
status
,
val
)
=>
{
setModalVisible
(
false
);
switch
(
val
)
{
setDepartmentVisible
(
false
);
case
'
newEmployee
'
:
setViewDepartmentVisible
(
false
);
setModalVisible
(
false
);
setBlacklistVisible
(
false
);
break
;
setRechargeDetailsVisible
(
false
);
case
'
viewDepartment
'
:
if
(
val
)
{
setViewDepartmentVisible
(
false
);
getDepartmentList
(
searchForm
.
enterpriseId
);
getDepartmentList
(
searchForm
.
enterpriseId
);
break
;
case
'
department
'
:
setDepartmentVisible
(
false
);
break
;
case
'
blacklist
'
:
setBlacklistVisible
(
false
);
setSelectedRowKeys
([]);
break
;
case
'
rechargeDetails
'
:
setRechargeDetailsVisible
(
false
);
break
;
default
:
break
;
}
if
(
status
)
{
shopList
({
...
page
,
data
:
searchForm
});
shopList
({
...
page
,
data
:
searchForm
});
setSelectedRowKeys
([]);
}
}
};
};
...
@@ -337,14 +351,16 @@ const StoreManagement = () => {
...
@@ -337,14 +351,16 @@ const StoreManagement = () => {
</
Button
>
</
Button
>
</
div
>
</
div
>
</
Card
>
</
Card
>
<
Table
<
Card
>
columns=
{
columns
(
res
)
}
<
Table
dataSource=
{
staffList
}
columns=
{
columns
(
res
)
}
rowKey=
{
r
=>
r
.
staffNo
}
dataSource=
{
staffList
}
bordered
rowKey=
{
r
=>
r
.
id
}
rowSelection=
{
rowSelection
}
bordered
pagination=
{
pagination
}
rowSelection=
{
rowSelection
}
/>
pagination=
{
pagination
}
/>
</
Card
>
<
NewEmployeeModal
<
NewEmployeeModal
visible=
{
modalVisible
}
visible=
{
modalVisible
}
enterpriseList=
{
enterpriseList
}
enterpriseList=
{
enterpriseList
}
...
...
src/pages/StoreManagement/data.js
View file @
2d3a0026
...
@@ -23,10 +23,13 @@ const repastType = list => {
...
@@ -23,10 +23,13 @@ const repastType = list => {
.
filter
(
item
=>
item
!==
4
)
.
filter
(
item
=>
item
!==
4
)
.
map
(
item
=>
{
.
map
(
item
=>
{
const
name
=
repastTypeList
.
find
(
i
=>
i
.
value
===
item
)?.
label
;
const
name
=
repastTypeList
.
find
(
i
=>
i
.
value
===
item
)?.
label
;
return
name
?
`
${
name
}
/到店`
:
null
;
return
name
?
`
${
name
}
/到店
`
:
null
;
});
});
}
}
return
'
到店
'
;
return
list
.
map
(
item
=>
{
const
name
=
repastTypeList
.
find
(
i
=>
i
.
value
===
item
)?.
label
;
return
name
?
`
${
name
}
`
:
null
;
});
};
};
export
const
columns
=
props
=>
[
export
const
columns
=
props
=>
[
{
{
...
...
src/pages/StoreManagement/index.jsx
View file @
2d3a0026
...
@@ -242,13 +242,15 @@ const StoreManagement = () => {
...
@@ -242,13 +242,15 @@ const StoreManagement = () => {
</
Form
>
</
Form
>
)
}
)
}
</
Card
>
</
Card
>
<
Table
<
Card
>
columns=
{
columns
(
res
)
}
<
Table
dataSource=
{
dataList
}
columns=
{
columns
(
res
)
}
rowKey=
{
r
=>
r
.
id
}
dataSource=
{
dataList
}
bordered
rowKey=
{
r
=>
r
.
id
}
pagination=
{
pagination
}
bordered
/>
pagination=
{
pagination
}
/>
</
Card
>
<
EditRepastModal
<
EditRepastModal
editVisible=
{
editVisible
}
editVisible=
{
editVisible
}
repastType=
{
repastType
}
repastType=
{
repastType
}
...
...
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