Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
N
NewTruckTerminalSyetem
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
SQL_Mou
NewTruckTerminalSyetem
Commits
b99fd2d9
Commit
b99fd2d9
authored
Aug 31, 2022
by
xxx
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1
parent
9df807eb
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
58 additions
and
33 deletions
+58
-33
index.vue
...ews/MLargeScreen/components/startOrderReceiving/index.vue
+57
-1
index.vue
src/views/MLargeScreen/index.vue
+1
-32
No files found.
src/views/MLargeScreen/components/startOrderReceiving/index.vue
View file @
b99fd2d9
...
...
@@ -42,6 +42,11 @@ export default {
dingDanId
:
''
,
equipmentName
:
''
,
//车载设备编号
xiecheBtnAble
:
false
,
//卸车按钮是否能用
//暂存的经纬度
oldxy
:{
lat
:
0
,
//纬度
lng
:
0
,
//经度
},
}
},
mounted
(){
...
...
@@ -97,6 +102,22 @@ export default {
});
}
}
//获取车辆坐标计算距离并返回给后台
httpGet
(
carRealTimeLocationQuery2
,{
name
:
resSon1
.
data
.
content
[
0
].
equipmentName
}).
then
((
res2
)
=>
{
if
(
res2
.
data
){
if
(
this
.
oldxy
.
lat
==
0
||
this
.
oldxy
.
lng
==
0
){
this
.
oldxy
.
lat
=
res2
.
data
.
location
.
y
;
this
.
oldxy
.
lng
=
res2
.
data
.
location
.
x
;
}
else
{
let
distance1
=
this
.
getDistance
(
this
.
oldxy
.
lat
,
this
.
oldxy
.
lng
,
res2
.
data
.
location
.
y
,
res2
.
data
.
location
.
x
)
+
parseFloat
(
res
.
data
.
content
[
0
].
mil
);
putForJson
(
dingDanBiaoCaoZuo
,{
id
:
res
.
data
.
content
[
0
].
id
,
mil
:
distance1
}).
then
((
res
)
=>
{});
this
.
$nextTick
(()
=>
{
this
.
oldxy
.
lat
=
res2
.
data
.
location
.
y
;
this
.
oldxy
.
lng
=
res2
.
data
.
location
.
x
;
})
}
}
});
}
});
}
...
...
@@ -131,6 +152,22 @@ export default {
this
.
dingDanId
=
res
.
data
.
content
[
0
].
id
;
}
}
//获取车辆坐标计算距离并返回给后台
httpGet
(
carRealTimeLocationQuery2
,{
name
:
resSon1
.
data
.
content
[
0
].
equipmentName
}).
then
((
res2
)
=>
{
if
(
res2
.
data
){
if
(
this
.
oldxy
.
lat
==
0
||
this
.
oldxy
.
lng
==
0
){
this
.
oldxy
.
lat
=
res2
.
data
.
location
.
y
;
this
.
oldxy
.
lng
=
res2
.
data
.
location
.
x
;
}
else
{
let
distance1
=
this
.
getDistance
(
this
.
oldxy
.
lat
,
this
.
oldxy
.
lng
,
res2
.
data
.
location
.
y
,
res2
.
data
.
location
.
x
)
+
parseFloat
(
res
.
data
.
content
[
0
].
mil
);
putForJson
(
dingDanBiaoCaoZuo
,{
id
:
res
.
data
.
content
[
0
].
id
,
mil
:
distance1
}).
then
((
res
)
=>
{});
this
.
$nextTick
(()
=>
{
this
.
oldxy
.
lat
=
res2
.
data
.
location
.
y
;
this
.
oldxy
.
lng
=
res2
.
data
.
location
.
x
;
})
}
}
});
}
});
}
...
...
@@ -192,6 +229,7 @@ export default {
refusePaidanFn
(){
this
.
btnShow1
=
false
;
this
.
showDe
=
false
;
this
.
$notify
({
title
:
'
已拒绝派单!
'
,
type
:
'
success
'
,
...
...
@@ -212,6 +250,10 @@ export default {
}
});
httpDelForJson
(
dingDanBiaoCaoZuo
,[
this
.
dingDanId
]).
then
((
res
)
=>
{});
this
.
$nextTick
(()
=>
{
this
.
oldxy
.
lat
=
0
;
this
.
oldxy
.
lng
=
0
;
})
},
//卸车
finishPaidanFn
(){
...
...
@@ -241,7 +283,10 @@ export default {
httpDelForJson
(
dingDanBiaoCaoZuo
,[
this
.
dingDanId
]).
then
((
res
)
=>
{
//this.$parent.zhixinglujing2(false);
});
this
.
$nextTick
(()
=>
{
this
.
oldxy
.
lat
=
0
;
this
.
oldxy
.
lng
=
0
;
})
}
},
//获取当前时间
...
...
@@ -336,6 +381,17 @@ export default {
return
true
;
}
},
//根据两个经纬度计算距离
getDistance
(
lat1
,
lng1
,
lat2
,
lng2
)
{
var
radLat1
=
lat1
*
Math
.
PI
/
180.0
;
var
radLat2
=
lat2
*
Math
.
PI
/
180.0
;
var
a
=
radLat1
-
radLat2
;
var
b
=
lng1
*
Math
.
PI
/
180.0
-
lng2
*
Math
.
PI
/
180.0
;
var
s
=
2
*
Math
.
asin
(
Math
.
sqrt
(
Math
.
pow
(
Math
.
sin
(
a
/
2
),
2
)
+
Math
.
cos
(
radLat1
)
*
Math
.
cos
(
radLat2
)
*
Math
.
pow
(
Math
.
sin
(
b
/
2
),
2
)));
s
=
s
*
6378.137
// EARTH_RADIUS;
s
=
Math
.
round
(
s
*
10000
)
/
10000
;
return
s
},
},
beforeDestroy
()
{
...
...
src/views/MLargeScreen/index.vue
View file @
b99fd2d9
...
...
@@ -134,11 +134,6 @@ export default {
batteryEnegy
:
0
,
//判断卸车1
boo1
:
false
,
//暂存的经纬度
oldxy
:{
lat
:
0
,
//纬度
lng
:
0
,
//经度
},
}
},
mounted
(){
...
...
@@ -179,22 +174,7 @@ export default {
});
}
});
//获取车辆坐标计算距离并返回给后台
httpGet
(
carRealTimeLocationQuery2
,{
name
:
res
.
data
.
content
[
0
].
equipmentName
}).
then
((
res2
)
=>
{
if
(
res2
.
data
){
if
(
this
.
oldxy
.
lat
==
0
||
this
.
oldxy
.
lng
==
0
){
this
.
oldxy
.
lat
=
res2
.
data
.
location
.
y
;
this
.
oldxy
.
lng
=
res2
.
data
.
location
.
x
;
}
else
{
let
distance1
=
this
.
getDistance
(
this
.
oldxy
.
lat
,
this
.
oldxy
.
lng
,
res2
.
data
.
location
.
y
,
res2
.
data
.
location
.
x
)
+
parseFloat
(
res
.
data
.
content
[
0
].
odo
);
putForJson
(
vehicleInformationUpdate
,{
id
:
res
.
data
.
content
[
0
].
id
,
odo
:
distance1
}).
then
((
res
)
=>
{});
this
.
$nextTick
(()
=>
{
this
.
oldxy
.
lat
=
res2
.
data
.
location
.
y
;
this
.
oldxy
.
lng
=
res2
.
data
.
location
.
x
;
})
}
}
});
}
}
});
...
...
@@ -528,17 +508,6 @@ export default {
}
});
},
//根据两个经纬度计算距离
getDistance
(
lat1
,
lng1
,
lat2
,
lng2
)
{
var
radLat1
=
lat1
*
Math
.
PI
/
180.0
;
var
radLat2
=
lat2
*
Math
.
PI
/
180.0
;
var
a
=
radLat1
-
radLat2
;
var
b
=
lng1
*
Math
.
PI
/
180.0
-
lng2
*
Math
.
PI
/
180.0
;
var
s
=
2
*
Math
.
asin
(
Math
.
sqrt
(
Math
.
pow
(
Math
.
sin
(
a
/
2
),
2
)
+
Math
.
cos
(
radLat1
)
*
Math
.
cos
(
radLat2
)
*
Math
.
pow
(
Math
.
sin
(
b
/
2
),
2
)));
s
=
s
*
6378.137
// EARTH_RADIUS;
s
=
Math
.
round
(
s
*
10000
)
/
10000
;
return
s
},
//执行路径
zhixinglujing
(
boo
){
//this.$refs.mars3dViewerMapMethod.addArrowGraphic3(boo);
...
...
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