Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
B
bigwood
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
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
罗超
bigwood
Commits
22db63b2
Commit
22db63b2
authored
Feb 22, 2023
by
youjie
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
no message
parent
f6edb900
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
48 additions
and
10 deletions
+48
-10
addEditVehicle.vue
src/pages/vehicle/addEditVehicle.vue
+48
-10
No files found.
src/pages/vehicle/addEditVehicle.vue
View file @
22db63b2
...
...
@@ -13,7 +13,7 @@
</div>
<div>
<div
class=
"row items-center"
>
<q-input
type=
"number"
dense
standout
v-model=
"search.PeopleNum"
class=
""
:class=
"
{'col q-mr-md':$q.platform.is.desktop,'col-12 q-mt-sm':$q.platform.is.mobile}" :placeholder="$t('v102.vehicle.title6')" :rules="[ val => val
&&
val > 0 || ' ']" ref="guestPeopleNum"/>
<q-input
type=
"number"
dense
standout
v-model=
"search.PeopleNum"
class=
""
:class=
"
{'col q-mr-md':$q.platform.is.desktop,'col-12 q-mt-sm':$q.platform.is.mobile}" :placeholder="$t('v102.vehicle.title6')" :rules="[ val => val
&&
val > 0 || ' ']" ref="guestPeopleNum"
@update:model-value="checkPeopleNum"
/>
<q-field
:class=
"
{'q-py-md':$q.platform.is.desktop,'q-pt-sm':$q.platform.is.mobile}" standout :model-value="search.StartDate" class="col height text-dark cursor-pointer q-mr-md" ref="guestStartDate">
<template
v-slot:control
>
<div
class=
"self-center full-width no-outline"
tabindex=
"0"
>
...
...
@@ -208,6 +208,7 @@ export default defineComponent({
{
name
:
'TripInfo'
,
label
:
t
(
'v102.vehicle.tatle.th4'
),
field
:
(
row
:
any
)
=>
row
,
align
:
'left'
},
{
name
:
'operation'
,
label
:
t
(
'v102.vehicle.tatle.th5'
),
field
:
(
row
:
any
)
=>
row
,
align
:
'left'
}
]
as
any
[],
SeatNum
:
0
})
if
(
currentRouter
.
currentRoute
&&
currentRouter
.
currentRoute
.
value
.
params
.
Id
)
{
data
.
search
.
Id
=
currentRouter
.
currentRoute
.
value
.
params
.
Id
...
...
@@ -219,7 +220,9 @@ export default defineComponent({
methods
.
vehicleinit
()
methods
.
vehicleList
()
if
(
data
.
search
.
Id
&&
data
.
search
.
Id
>
0
)
{
methods
.
details
()
setTimeout
(()
=>
{
methods
.
details
()
},
100
)
}
let
userDetail
=
Store
.
state
.
user
.
userDetail
let
salesBaseInfo
=
Store
.
state
.
user
.
userDetail
.
salesBaseInfo
...
...
@@ -232,6 +235,24 @@ export default defineComponent({
data
.
search
.
details
.
splice
(
index
,
1
)
data
.
search
.
UseDayNum
=
data
.
search
.
details
.
length
},
// 获取车型座位数
getBusType
(){
if
(
data
.
vehicletop
&&
data
.
vehicletop
.
length
>
0
){
data
.
vehicletop
.
forEach
(
x
=>
{
if
(
x
.
Id
===
data
.
search
.
BusType
){
data
.
SeatNum
=
x
.
SeatNum
if
(
data
.
search
.
PeopleNum
>
x
.
SeatNum
){
data
.
search
.
PeopleNum
=
x
.
SeatNum
}
}
})
}
},
checkPeopleNum
(){
if
(
data
.
search
.
PeopleNum
>
data
.
SeatNum
){
data
.
search
.
PeopleNum
=
data
.
SeatNum
}
},
// 获取修改详情
details
()
{
HotelService
.
VehicleDetails
(
data
.
search
.
Id
)
...
...
@@ -253,6 +274,7 @@ export default defineComponent({
data
.
search
.
TeamName
=
r
.
data
.
data
.
TeamName
data
.
search
.
details
=
r
.
data
.
data
.
details
data
.
isCheck
=
true
methods
.
getBusType
()
}
else
{
message
.
errorMsg
(
r
.
data
.
message
)
}
...
...
@@ -262,8 +284,8 @@ export default defineComponent({
})
},
// 获取车型下拉
vehicleinit
()
{
HotelService
.
TypeVehicle
({})
async
vehicleinit
()
{
await
HotelService
.
TypeVehicle
({})
.
then
(
r
=>
{
if
(
r
.
data
.
resultCode
==
ApiResult
.
SUCCESS
)
{
data
.
vehicletop
=
r
.
data
.
data
...
...
@@ -343,7 +365,6 @@ export default defineComponent({
// 天数失去焦点时间
checkInteger
()
{
if
(
data
.
search
.
UseDayNum
<
data
.
search
.
details
.
length
){
console
.
log
(
data
.
search
.
details
.
length
-
data
.
search
.
UseDayNum
)
for
(
let
i
=
0
;
i
<
(
data
.
search
.
details
.
length
-
data
.
search
.
UseDayNum
);
i
++
){
data
.
search
.
details
.
splice
(
data
.
search
.
details
.
length
-
1
,
1
)
}
...
...
@@ -356,15 +377,32 @@ export default defineComponent({
timelist
=
methods
.
getDiffDate
(
data
.
search
.
StartDate
,
list
)
if
(
timelist
&&
timelist
.
length
>
0
)
{
timelist
.
forEach
((
item
:
any
,
i
:
any
)
=>
{
details2
.
push
(
{
let
dataObj
=
{
DayNum
:
i
+
1
,
UseDate
:
item
,
//日期
UseType
:
''
as
any
,
//用车类型(接口返下拉列表)
UseType
:
''
,
//用车类型(接口返下拉列表)
// UseTime: '',//接送机时间
TripInfo
:
""
,
//行程信息
})
TripInfo
:
''
,
//行程信息
}
details2
.
push
(
dataObj
)
if
(
data
.
search
.
details
&&
data
.
search
.
details
.
length
==
0
){
data
.
search
.
details
=
details2
}
else
{
let
UseDateArr
=
data
.
search
.
details
.
map
(
x
=>
{
return
x
.
UseDate
})
if
(
UseDateArr
.
indexOf
(
item
)
==-
1
){
data
.
search
.
details
.
push
(
dataObj
)
data
.
search
.
details
.
sort
((
a
,
b
)
=>
{
let
obj1
=
a
[
'UseDate'
]
let
obj2
=
b
[
'UseDate'
]
const
val1
=
Math
.
floor
(
new
Date
(
obj1
).
getTime
()
/
1000
)
const
val2
=
Math
.
floor
(
new
Date
(
obj2
).
getTime
()
/
1000
)
return
val1
-
val2
})
}
}
})
data
.
search
.
details
=
details2
}
}
}
...
...
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