Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
S
SuperMan
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
1
Issues
1
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
罗超
SuperMan
Commits
34bc5d0a
Commit
34bc5d0a
authored
Mar 20, 2019
by
zhengke
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
扩展时间格式方法
parent
458b43fe
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
49 additions
and
95 deletions
+49
-95
TicketManager.vue
src/components/Ticketing/TicketManager.vue
+4
-4
flightManagement.vue
src/components/Ticketing/flightManagement.vue
+2
-91
index.js
src/plug/index.js
+43
-0
No files found.
src/components/Ticketing/TicketManager.vue
View file @
34bc5d0a
...
...
@@ -1731,9 +1731,9 @@
</p>
</el-tooltip>
<div
style=
"margin:10px 0 0 12px;"
>
<el-input
type=
"text"
class=
"w80"
v-model=
"item.TicketDepartureTime"
maxlength=
"5"
<el-input
type=
"text"
class=
"w80"
v-model=
"item.TicketDepartureTime"
@
keyup
.
native=
"checkTime(item,'TicketDepartureTime')"
maxlength=
"5"
:placeholder=
"$t('system.ph_time')"
></el-input>
-
<el-input
type=
"text"
class=
"w80"
v-model=
"item.TicketArrivalTime"
maxlength=
"5"
<el-input
type=
"text"
class=
"w80"
v-model=
"item.TicketArrivalTime"
@
keyup
.
native=
"checkTime(item,'TicketArrivalTime')"
maxlength=
"5"
:placeholder=
"$t('system.ph_time')"
></el-input>
</div>
</div>
...
...
@@ -1799,9 +1799,9 @@
</p>
</el-tooltip>
<div
style=
"margin:10px 0 0 12px;"
>
<el-input
type=
"text"
class=
"w80"
v-model=
"item.TicketDepartureTime"
maxlength=
"5"
<el-input
type=
"text"
class=
"w80"
v-model=
"item.TicketDepartureTime"
@
keyup
.
native=
"checkTime(item,'TicketDepartureTime')"
maxlength=
"5"
:placeholder=
"$t('system.ph_time')"
></el-input>
-
<el-input
type=
"text"
class=
"w80"
v-model=
"item.TicketArrivalTime"
maxlength=
"5"
<el-input
type=
"text"
class=
"w80"
v-model=
"item.TicketArrivalTime"
@
keyup
.
native=
"checkTime(item,'TicketArrivalTime')"
maxlength=
"5"
:placeholder=
"$t('system.ph_time')"
></el-input>
</div>
</div>
...
...
src/components/Ticketing/flightManagement.vue
View file @
34bc5d0a
...
...
@@ -279,7 +279,7 @@
</el-select>
</el-form-item>
<el-form-item
:label=
"$t('system.ph_flightTime')"
prop=
"Departure_time"
class=
'flightMg_delete_icon time'
>
<el-input
type=
"text"
v-model=
"addMsg.Departure_time"
@
keyup
.
native=
"ch
angeV(addMsg
)"
maxlength=
"5"
<el-input
type=
"text"
v-model=
"addMsg.Departure_time"
@
keyup
.
native=
"ch
eckTime(addMsg,'Departure_time'
)"
maxlength=
"5"
:placeholder=
"$t('system.ph_time')"
></el-input>
</el-form-item>
<div
v-if=
'addMsg.Type=="2"'
>
...
...
@@ -315,7 +315,7 @@
</el-select>
</el-form-item>
<el-form-item
:label=
"$t('system.query_arrivalTime')"
prop=
"Arrival_time"
class=
'flightMg_delete_icon time'
>
<el-input
type=
"text"
v-model=
"addMsg.Arrival_time"
@
keyup
.
native=
"ch
angeV2(addMsg
)"
maxlength=
"5"
<el-input
type=
"text"
v-model=
"addMsg.Arrival_time"
@
keyup
.
native=
"ch
eckTime(addMsg,'Arrival_time'
)"
maxlength=
"5"
:placeholder=
"$t('system.ph_time')"
></el-input>
</el-form-item>
<el-form-item
class=
"flightMg_info"
>
...
...
@@ -735,95 +735,6 @@
//弹出框取消 初始化谈框内表单
this
.
$refs
[
formName
].
clearValidate
();
},
//验证时间格式
changeV
(
addMsg
)
{
var
date
=
addMsg
.
Departure_time
;
if
(
date
.
length
==
1
)
{
var
v1
=
date
.
substring
(
0
,
1
);
addMsg
.
Departure_time
=
v1
.
replace
(
/
[^
0-2
]{1}
/g
,
''
);
}
if
(
date
.
length
==
2
)
{
var
v1
=
date
.
substring
(
0
,
1
);
if
(
v1
==
2
)
{
var
reg
=
/
[^
0-3
]{1}
/g
;
}
else
{
var
reg
=
/
[^
0-9
]{1}
/g
;
}
var
v2
=
date
.
substring
(
1
,
2
);
if
(
!
reg
.
test
(
v2
))
{
addMsg
.
Departure_time
=
date
+
":"
}
else
{
addMsg
.
Departure_time
=
date
.
substring
(
0
,
1
);
}
}
if
(
date
.
length
==
4
)
{
reg
=
/
[^
0-5
]{1}
/g
;
var
v3
=
date
.
substring
(
3
,
4
);
if
(
!
reg
.
test
(
v3
))
{
addMsg
.
Departure_time
=
date
;
}
else
{
addMsg
.
Departure_time
=
date
.
substring
(
0
,
3
);
}
}
if
(
date
.
length
==
5
)
{
var
reg
=
/
[^
0-9
]{1}
/g
;
var
v4
=
date
.
substring
(
4
,
5
);
if
(
!
reg
.
test
(
v4
))
{
addMsg
.
Departure_time
=
date
}
else
{
addMsg
.
Departure_time
=
date
.
substring
(
0
,
4
);
}
}
if
(
date
.
length
>
5
)
{
addMsg
.
Departure_time
=
date
.
substring
(
0
,
5
);
}
this
.
$forceUpdate
();
},
//验证时间格式
changeV2
(
addMsg
)
{
var
date
=
addMsg
.
Arrival_time
;
if
(
date
.
length
==
1
)
{
var
v1
=
date
.
substring
(
0
,
1
);
addMsg
.
Arrival_time
=
v1
.
replace
(
/
[^
0-2
]{1}
/g
,
''
);
}
if
(
date
.
length
==
2
)
{
var
v1
=
date
.
substring
(
0
,
1
);
if
(
v1
==
2
)
{
var
reg
=
/
[^
0-3
]{1}
/g
;
}
else
{
var
reg
=
/
[^
0-9
]{1}
/g
;
}
var
v2
=
date
.
substring
(
1
,
2
);
if
(
!
reg
.
test
(
v2
))
{
addMsg
.
Arrival_time
=
date
+
":"
}
else
{
addMsg
.
Arrival_time
=
date
.
substring
(
0
,
1
);
}
}
if
(
date
.
length
==
4
)
{
reg
=
/
[^
0-5
]{1}
/g
;
var
v3
=
date
.
substring
(
3
,
4
);
if
(
!
reg
.
test
(
v3
))
{
addMsg
.
Arrival_time
=
date
;
}
else
{
addMsg
.
Arrival_time
=
date
.
substring
(
0
,
3
);
}
}
if
(
date
.
length
==
5
)
{
var
reg
=
/
[^
0-9
]{1}
/g
;
var
v4
=
date
.
substring
(
4
,
5
);
if
(
!
reg
.
test
(
v4
))
{
addMsg
.
Arrival_time
=
date
}
else
{
addMsg
.
Arrival_time
=
date
.
substring
(
0
,
4
);
}
}
if
(
date
.
length
>
5
)
{
addMsg
.
Arrival_time
=
date
.
substring
(
0
,
5
);
}
this
.
$forceUpdate
();
},
//获取季节类型枚举列表
getSeasonTypeList
()
{
this
.
apipost
(
...
...
src/plug/index.js
View file @
34bc5d0a
...
...
@@ -677,6 +677,49 @@ export default {
}
item
[
filed
]
=
value
;
}
Vue
.
prototype
.
checkTime
=
function
(
item
,
filed
){
var
date
=
item
[
filed
];
if
(
date
.
length
==
1
)
{
var
v1
=
date
.
substring
(
0
,
1
);
item
[
filed
]
=
v1
.
replace
(
/
[^
0-2
]{1}
/g
,
''
);
}
if
(
date
.
length
==
2
)
{
var
v1
=
date
.
substring
(
0
,
1
);
if
(
v1
==
2
)
{
var
reg
=
/
[^
0-3
]{1}
/g
;
}
else
{
var
reg
=
/
[^
0-9
]{1}
/g
;
}
var
v2
=
date
.
substring
(
1
,
2
);
if
(
!
reg
.
test
(
v2
))
{
item
[
filed
]
=
date
+
":"
}
else
{
item
[
filed
]
=
date
.
substring
(
0
,
1
);
}
}
if
(
date
.
length
==
4
)
{
reg
=
/
[^
0-5
]{1}
/g
;
var
v3
=
date
.
substring
(
3
,
4
);
if
(
!
reg
.
test
(
v3
))
{
item
[
filed
]
=
date
;
}
else
{
item
[
filed
]
=
date
.
substring
(
0
,
3
);
}
}
if
(
date
.
length
==
5
)
{
var
reg
=
/
[^
0-9
]{1}
/g
;
var
v4
=
date
.
substring
(
4
,
5
);
if
(
!
reg
.
test
(
v4
))
{
item
[
filed
]
=
date
}
else
{
item
[
filed
]
=
date
.
substring
(
0
,
4
);
}
}
if
(
date
.
length
>
5
)
{
item
[
filed
]
=
date
.
substring
(
0
,
5
);
}
this
.
$forceUpdate
();
}
//价钱格式化,三位数逗号分隔,保留两位小数 duanjun
Vue
.
prototype
.
moneyFormat
=
function
(
value
)
{
...
...
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