Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
B
biz.qingxiao.com
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
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
wangxuelai
biz.qingxiao.com
Commits
5a8fb662
Commit
5a8fb662
authored
Jun 17, 2020
by
baixian
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ERP年龄计算优化
parent
c2b662e1
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
7 additions
and
7 deletions
+7
-7
index.html
index.html
+1
-1
index.js
src/pages/student/index.js
+1
-1
StudentEdit.js
src/pages/studentinfo/StudentEdit.js
+4
-4
index.js
src/pages/studentinfo/index.js
+1
-1
No files found.
index.html
View file @
5a8fb662
...
...
@@ -18,5 +18,5 @@
</head>
<body>
<div
id=
"root"
></div>
<script
type=
"text/javascript"
src=
"https://cdn.s.shangjiadao.cn/qingxiao/biz/dist/main.
d6563c
.js"
></script></body>
<script
type=
"text/javascript"
src=
"https://cdn.s.shangjiadao.cn/qingxiao/biz/dist/main.
4a8467
.js"
></script></body>
</html>
src/pages/student/index.js
View file @
5a8fb662
...
...
@@ -896,7 +896,7 @@ class StudentMgt extends React.Component {
return (
<div>
{/* { new Date(Date(record.birthday)).getFullYear()} */}
{record.birthday ? `
$
{(
new
Date
().
getFullYear
()
+
1
)
-
new
Date
(
record
.
birthday
).
getFullYear
(
)}
岁
` : ''}
{record.birthday ? `
$
{(
(
new
Date
().
getFullYear
())
-
new
Date
(
record
.
birthday
).
getFullYear
())
==
0
?
1
:
((
new
Date
().
getFullYear
())
-
new
Date
(
record
.
birthday
).
getFullYear
()
)}
岁
` : ''}
</div>
);
},
...
...
src/pages/studentinfo/StudentEdit.js
View file @
5a8fb662
...
...
@@ -96,15 +96,15 @@ class StudentAddForm extends React.Component {
const
{
getFieldDecorator
}
=
this
.
props
.
form
;
let
cAge
=
0
;
if
(
!
selectYear
==
''
)
{
const
toyear
=
new
Date
().
getFullYear
()
+
1
;
cAge
=
toyear
-
selectYear
;
const
toyear
=
new
Date
().
getFullYear
();
cAge
=
((
toyear
-
selectYear
)
==
0
)
?
1
:
toyear
-
selectYear
;
}
else
{
if
(
!
studentsdetail
.
birthday
)
{
cAge
=
0
;
}
else
{
const
year
=
new
Date
(
studentsdetail
.
birthday
.
replace
(
/-/g
,
'-'
)).
getFullYear
();
const
toyear
=
new
Date
().
getFullYear
()
+
1
;
cAge
=
toyear
-
year
;
const
toyear
=
new
Date
().
getFullYear
();
cAge
=
((
toyear
-
year
)
==
0
)
?
1
:
toyear
-
year
;
}
}
// const cage = toyear - Number(dateString ? dateString.format('YYYY') : 0);
...
...
src/pages/studentinfo/index.js
View file @
5a8fb662
...
...
@@ -775,7 +775,7 @@ class StudentMgt extends React.Component {
<
/Descriptions
>
<
Descriptions
>
<
Descriptions
.
Item
label
=
"状态"
>
{
studentsdetail
.
student_courses
&&
studentsdetail
.
student_courses
.
length
==
0
?
'未在读'
:
'在读'
}
<
/Descriptions.Item
>
<
Descriptions
.
Item
label
=
"年龄"
>
{(
new
Date
().
getFullYear
()
+
1
)
-
new
Date
(
studentsdetail
.
birthday
).
getFullYear
(
)}
<
/Descriptions.Item
>
<
Descriptions
.
Item
label
=
"年龄"
>
{(
(
new
Date
().
getFullYear
())
-
new
Date
(
studentsdetail
.
birthday
).
getFullYear
()
==
0
?
1
:
(
new
Date
().
getFullYear
())
-
new
Date
(
studentsdetail
.
birthday
).
getFullYear
()
)}
<
/Descriptions.Item
>
<
Descriptions
.
Item
label
=
"备注"
>
{
studentsdetail
.
remark
}
<
/Descriptions.Item
>
<
/Descriptions
>
<
/Col
>
...
...
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