Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
P
patzn-cloud-web-h5app-drs
Overview
Overview
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
zhuxiaomei
patzn-cloud-web-h5app-drs
Commits
1951fb86
Commit
1951fb86
authored
Oct 30, 2020
by
zhuxiaomei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
打卡
parent
51b9b2c8
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
55 additions
and
18 deletions
+55
-18
attendance_record.js
src/api/drs/attendance_record.js
+12
-0
index.js
src/api/index.js
+1
-0
plugins.js
src/lib/plugins.js
+21
-0
SamplingLocation.vue
src/page/sampling-task/SamplingLocation.vue
+21
-18
No files found.
src/api/drs/attendance_record.js
0 → 100644
View file @
1951fb86
/**
* 双随机抽样计划附件表相关
*/
import
http
from
'../../api/http'
export
default
{
page
:
data
=>
http
.
post
(
'/drs/v1/attendance_record/page'
,
data
).
then
(
res
=>
res
),
list
:
data
=>
http
.
post
(
'/drs/v1/attendance_record/list'
,
data
).
then
(
res
=>
res
),
add
:
data
=>
http
.
post
(
'/drs/v1/attendance_record/'
,
data
).
then
(
res
=>
res
),
edit
:
data
=>
http
.
put
(
'/drs/v1/attendance_record/'
+
data
.
id
,
data
.
obj
).
then
(
res
=>
res
),
deleteByIds
:
data
=>
http
.
delete
(
'/drs/v1/attendance_record/?ids='
+
data
.
id
).
then
(
res
=>
res
),
}
src/api/index.js
View file @
1951fb86
...
...
@@ -31,3 +31,4 @@ export {default as samplingPlace} from './drs/sampling-place'
export
{
default
as
samplingShelf
}
from
'./drs/sampling-shelf'
export
{
default
as
samplingSummary
}
from
'./drs/sampling-summary'
export
{
default
as
samplingPlanAttachment
}
from
'./drs/sampling-plan-attachment'
export
{
default
as
attendanceRecord
}
from
'./drs/attendance_record'
src/lib/plugins.js
View file @
1951fb86
...
...
@@ -38,6 +38,27 @@ export default {
}
/**
* 将经纬度转化为度分秒的格式
* ****/
Vue
.
prototype
.
$changeToDFM
=
function
(
du
,
type
)
{
let
duStr
=
du
.
toString
()
const
arr1
=
duStr
.
split
(
"."
);
const
d
=
arr1
[
0
];
let
tp
=
"0."
+
arr1
[
1
]
tp
=
String
(
tp
*
60
);
//这里进行了强制类型转换
const
arr2
=
tp
.
split
(
"."
);
const
f
=
arr2
[
0
];
tp
=
"0."
+
arr2
[
1
];
tp
=
tp
*
60
;
let
mStr
=
tp
.
toString
();
const
arr3
=
mStr
.
split
(
"."
)
const
subStr
=
arr3
[
1
].
substring
(
0
,
2
)
const
m
=
arr3
[
0
]
+
"."
+
subStr
;
const
dfm
=
d
+
"°"
+
f
+
"'"
+
m
+
"
\"
"
+
type
;
return
dfm
;
};
/**
* 全局的配置
* @type {{getLogin, logout, baseURL, setToken, setLogin, getToken, version}}
*/
...
...
src/page/sampling-task/SamplingLocation.vue
View file @
1951fb86
...
...
@@ -24,7 +24,7 @@
</van-list>
</van-pull-refresh>
<div
id=
'
container
'
v-show=
"false"
></div>
<div
id=
'
map
'
v-show=
"false"
></div>
</div>
<div
class=
"bottom-btn"
>
<van-button
type=
"info"
block
@
click=
"_add"
>
添加地点
</van-button>
...
...
@@ -38,8 +38,7 @@
<
script
>
import
BaiduMap
from
'../../lib/map'
import
{
samplingPlace
}
from
'../../api'
import
{
samplingPlace
,
attendanceRecord
}
from
'../../api'
import
SelectLocation
from
'./components/SelectLocation'
export
default
{
...
...
@@ -56,7 +55,9 @@
refreshing
:
false
,
//刷新中...
loading
:
false
,
//加载中...
finished
:
false
,
//没有更多数据
planId
:
this
.
$route
.
query
.
planId
planId
:
this
.
$route
.
query
.
planId
,
latitude
:
''
,
longitude
:
''
}
},
mounted
()
{
...
...
@@ -96,31 +97,33 @@
this
.
$refs
.
allLoc
.
_open
(
this
.
planId
)
})
},
//获取位置(web)
_getWebLoc
()
{
let
that
=
this
that
.
$nextTick
(()
=>
{
BaiduMap
.
init
().
then
(
BMap
=>
{
var
geolocation
=
new
BMap
.
Geolocation
()
geolocation
.
getCurrentPosition
(
function
(
r
)
{
console
.
log
(
r
)
// if (this.getStatus() == BMAP_STATUS_SUCCESS) {
// that.latitude = that.$changeToDFM(r.point.lat, 'N')
// that.longitude = that.$changeToDFM(r.point.lng, 'E')
// console.log(r)
// } else {
// alert('获取不到位置信息')
// }
if
(
this
.
getStatus
()
==
BMAP_STATUS_SUCCESS
)
{
that
.
latitude
=
that
.
$changeToDFM
(
r
.
point
.
lat
,
'N'
)
that
.
longitude
=
that
.
$changeToDFM
(
r
.
point
.
lng
,
'E'
)
that
.
_action
()
}
else
{
alert
(
'获取不到位置信息'
)
}
},
{
enableHighAccuracy
:
true
})
})
})
},
// 打卡
_action
()
{
// this.action = Global.baseURL + '/env/v1/point_attachment/upload/?planId=' + this.planId
// + '&point=' + encodeURIComponent(this.point) + '&pointCode=' + encodeURIComponent(this.pointCode)
// + '&testType=' + encodeURIComponent(this.testType) + '&longitude=' + encodeURIComponent(this.longitude)
// + '&latitude=' + encodeURIComponent(this.latitude);
_action
:
async
function
()
{
let
result
=
await
attendanceRecord
.
add
({
planId
:
this
.
planId
,
attendanceAddress
:
this
.
latitude
+
','
+
this
.
longitude
})
if
(
result
)
{
this
.
$toast
(
'打卡成功!'
)
this
.
_refresh
()
}
},
_goto
(
data
)
{
this
.
$router
.
push
({
path
:
'/sampling_task/goods_shelves'
,
query
:
{
placeId
:
data
.
id
}})
...
...
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