|
|
|
|
@ -50,7 +50,7 @@
|
|
|
|
|
<view>{{detail.customer.phone}}</view>
|
|
|
|
|
</view>
|
|
|
|
|
</view>
|
|
|
|
|
<view class="re-location">
|
|
|
|
|
<view class="re-location" @click="$u.throttle(refreshLoaction,1000)">
|
|
|
|
|
<view class="text">更新定位</view>
|
|
|
|
|
<u-image src="/static/detail/distance.png" height="34" width="34"></u-image>
|
|
|
|
|
</view>
|
|
|
|
|
@ -66,10 +66,9 @@
|
|
|
|
|
|
|
|
|
|
<view class="content">
|
|
|
|
|
<view class="content-item" v-for="(item,index) in detail.sku" :key='item.id'>
|
|
|
|
|
<view class="checkbox">
|
|
|
|
|
<u-checkbox v-model="form[index].isSelect" shape="circle"></u-checkbox>
|
|
|
|
|
<view>{{item.sku_info.name}}</view>
|
|
|
|
|
</view>
|
|
|
|
|
<u-checkbox v-model="form[index].isSelect" shape="circle" :name="item.sku_info.name">
|
|
|
|
|
{{item.sku_info.name}}
|
|
|
|
|
</u-checkbox>
|
|
|
|
|
<view class="input">
|
|
|
|
|
<u-input v-model="form[index].time" :custom-style="inputStyle" placeholder="请输入"
|
|
|
|
|
placeholder-style="color:#A7AFBC;" input-align="center" :clearable="false" type="number"
|
|
|
|
|
@ -83,11 +82,19 @@
|
|
|
|
|
|
|
|
|
|
<!-- 打卡 -->
|
|
|
|
|
<view class="clock">
|
|
|
|
|
<view class="btn" :class="{'btn-active':isClick && type === 1}" @click="punch">
|
|
|
|
|
<view class="btn">
|
|
|
|
|
<view class="text1">过程打卡</view>
|
|
|
|
|
<view class="text2">(1)</view>
|
|
|
|
|
<view class="text2">(3)</view>
|
|
|
|
|
</view>
|
|
|
|
|
<view class="btn" @click="$u.throttle(sign)">
|
|
|
|
|
<view class="text1">签到</view>
|
|
|
|
|
<view class="text2">{{$u.timeFormat(time,'hh:MM:ss')}}</view>
|
|
|
|
|
</view>
|
|
|
|
|
<view class="btn">
|
|
|
|
|
<view class="text1">签退</view>
|
|
|
|
|
<view class="text2">{{$u.timeFormat(time,'hh:MM:ss')}}</view>
|
|
|
|
|
</view>
|
|
|
|
|
<view class="btn" :class="{'btn-active':isClick && type === 2}" @click="locate">
|
|
|
|
|
<view class="btn">
|
|
|
|
|
<view class="text1">更新定位</view>
|
|
|
|
|
<view class="text2">{{$u.timeFormat(time,'hh:MM:ss')}}</view>
|
|
|
|
|
</view>
|
|
|
|
|
@ -102,12 +109,14 @@
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
<script>
|
|
|
|
|
import {
|
|
|
|
|
ROOTPATH
|
|
|
|
|
} from '@/common/config.js'
|
|
|
|
|
import QQMapWX from '@/libs/qqmap-wx-jssdk.js'
|
|
|
|
|
|
|
|
|
|
export default {
|
|
|
|
|
data() {
|
|
|
|
|
return {
|
|
|
|
|
isClick: false,
|
|
|
|
|
type: '',
|
|
|
|
|
qqmapsdk: null,
|
|
|
|
|
inputStyle: {
|
|
|
|
|
@ -122,15 +131,27 @@
|
|
|
|
|
borderRadius: '100%',
|
|
|
|
|
background: 'blue'
|
|
|
|
|
},
|
|
|
|
|
form: [],
|
|
|
|
|
detail: {},
|
|
|
|
|
time: new Date(),
|
|
|
|
|
location: {
|
|
|
|
|
lng: '',
|
|
|
|
|
lat: '',
|
|
|
|
|
time: '',
|
|
|
|
|
address: ''
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
form: {
|
|
|
|
|
schedule_list_id: '',
|
|
|
|
|
lat: '',
|
|
|
|
|
lng: '',
|
|
|
|
|
address: '',
|
|
|
|
|
type: '',
|
|
|
|
|
upload_list: [],
|
|
|
|
|
},
|
|
|
|
|
subForm: {
|
|
|
|
|
id: '',
|
|
|
|
|
sku_time_list: []
|
|
|
|
|
},
|
|
|
|
|
detail: {},
|
|
|
|
|
time: new Date(),
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
methods: {
|
|
|
|
|
@ -145,7 +166,7 @@
|
|
|
|
|
id
|
|
|
|
|
})
|
|
|
|
|
this.detail = res
|
|
|
|
|
this.form = res.sku.map(item => {
|
|
|
|
|
this.subForm.schedule_list_id = res.sku.map(item => {
|
|
|
|
|
return {
|
|
|
|
|
isSelect: false,
|
|
|
|
|
sku_id: item.id,
|
|
|
|
|
@ -154,75 +175,165 @@
|
|
|
|
|
})
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
save(type) {
|
|
|
|
|
this.$u.api.nurseSave({
|
|
|
|
|
id: this.detail.id,
|
|
|
|
|
sku_time_list: this.form.filter(item => {
|
|
|
|
|
return item.isSelect
|
|
|
|
|
}),
|
|
|
|
|
logs: [{
|
|
|
|
|
lat: this.location.lat,
|
|
|
|
|
lng: this.location.lng,
|
|
|
|
|
address: this.location.address,
|
|
|
|
|
type
|
|
|
|
|
}]
|
|
|
|
|
}).then(res => {
|
|
|
|
|
if (type === 1) {
|
|
|
|
|
uni.showToast({
|
|
|
|
|
icon: 'success',
|
|
|
|
|
title: '打卡成功'
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
if (type === 2) {
|
|
|
|
|
uni.showToast({
|
|
|
|
|
icon: 'success',
|
|
|
|
|
title: '更新定位成功'
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
},
|
|
|
|
|
punch() {
|
|
|
|
|
this.$u.throttle(() => {
|
|
|
|
|
this.type = 1
|
|
|
|
|
this.isClick = true
|
|
|
|
|
this.save(1)
|
|
|
|
|
setTimeout(() => {
|
|
|
|
|
this.isClick = false
|
|
|
|
|
}, 10000)
|
|
|
|
|
}, 10000)
|
|
|
|
|
|
|
|
|
|
},
|
|
|
|
|
//更新定位
|
|
|
|
|
locate() {
|
|
|
|
|
this.$u.throttle(() => {
|
|
|
|
|
this.type = 2
|
|
|
|
|
this.isClick = true
|
|
|
|
|
setTimeout(() => {
|
|
|
|
|
this.isClick = false
|
|
|
|
|
}, 10000)
|
|
|
|
|
//获取当前定位信息
|
|
|
|
|
getLoaction() {
|
|
|
|
|
return new Promise((resolve, reject) => {
|
|
|
|
|
uni.getLocation().then(res => {
|
|
|
|
|
this.location.lat = res[1]?.latitude
|
|
|
|
|
this.location.lng = res[1]?.longitude
|
|
|
|
|
this.location.time = this.time
|
|
|
|
|
if (res[1]) {
|
|
|
|
|
this.location.lat = res[1]?.latitude
|
|
|
|
|
this.location.lng = res[1]?.longitude
|
|
|
|
|
this.location.time = this.time
|
|
|
|
|
|
|
|
|
|
new Promise((reject, resolve) => {
|
|
|
|
|
this.qqmapsdk.reverseGeocoder({
|
|
|
|
|
location: {
|
|
|
|
|
latitude: this.location.lat,
|
|
|
|
|
longitude: this.location.lng
|
|
|
|
|
},
|
|
|
|
|
success: (r) => {
|
|
|
|
|
reject(r)
|
|
|
|
|
success: (res) => {
|
|
|
|
|
this.location.address = res.result.address
|
|
|
|
|
resolve(res)
|
|
|
|
|
},
|
|
|
|
|
fail: (err) => {
|
|
|
|
|
reject(err)
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
}).then(res => {
|
|
|
|
|
this.location.address = res.result.address
|
|
|
|
|
} else {
|
|
|
|
|
uni.showToast({
|
|
|
|
|
icon: 'none',
|
|
|
|
|
title: '操作频繁,请稍后再试'
|
|
|
|
|
})
|
|
|
|
|
reject(res)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
this.save(2)
|
|
|
|
|
})
|
|
|
|
|
})
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
//更新地址
|
|
|
|
|
refreshLoaction() {
|
|
|
|
|
this.getLoaction().then(res => {
|
|
|
|
|
uni.showToast({
|
|
|
|
|
icon: 'none',
|
|
|
|
|
title: '更新定位成功'
|
|
|
|
|
})
|
|
|
|
|
})
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
//图片批量上传
|
|
|
|
|
async uploadImgs() {
|
|
|
|
|
let res = await uni.chooseImage()
|
|
|
|
|
if (res[1]) {
|
|
|
|
|
let promiseAll = res[1].tempFilePaths.map(item => {
|
|
|
|
|
console.log(`${ROOTPATH}/api/nurse/upload-file`);
|
|
|
|
|
return new Promise((resolve, reject) => {
|
|
|
|
|
uni.uploadFile({
|
|
|
|
|
url: `${ROOTPATH}/api/nurse/upload-file`,
|
|
|
|
|
header: {
|
|
|
|
|
Authorization: `Bearer ${this.vuex_token}`
|
|
|
|
|
},
|
|
|
|
|
filePath: item,
|
|
|
|
|
name: 'file',
|
|
|
|
|
success: (res1) => {
|
|
|
|
|
resolve(res1)
|
|
|
|
|
},
|
|
|
|
|
fail: (err) => {
|
|
|
|
|
reject(err)
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
})
|
|
|
|
|
})
|
|
|
|
|
}, 10000)
|
|
|
|
|
|
|
|
|
|
return Promise.all(promiseAll)
|
|
|
|
|
} else {
|
|
|
|
|
uni.showToast({
|
|
|
|
|
icon: 'none',
|
|
|
|
|
title: '上传失败'
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
//签到
|
|
|
|
|
sign() {
|
|
|
|
|
this.uploadImgs().then(res => {
|
|
|
|
|
this.form.upload_list = res.map(item => {
|
|
|
|
|
return {
|
|
|
|
|
upload_id: JSON.parse(item.data).id
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
console.log(this.form);
|
|
|
|
|
})
|
|
|
|
|
},
|
|
|
|
|
// save(type) {
|
|
|
|
|
// this.$u.api.nurseSave({
|
|
|
|
|
// id: this.detail.id,
|
|
|
|
|
// sku_time_list: this.form.filter(item => {
|
|
|
|
|
// return item.isSelect
|
|
|
|
|
// }),
|
|
|
|
|
// logs: [{
|
|
|
|
|
// lat: this.location.lat,
|
|
|
|
|
// lng: this.location.lng,
|
|
|
|
|
// address: this.location.address,
|
|
|
|
|
// type
|
|
|
|
|
// }]
|
|
|
|
|
// }).then(res => {
|
|
|
|
|
// if (type === 1) {
|
|
|
|
|
// uni.showToast({
|
|
|
|
|
// icon: 'success',
|
|
|
|
|
// title: '打卡成功'
|
|
|
|
|
// })
|
|
|
|
|
// }
|
|
|
|
|
// if (type === 2) {
|
|
|
|
|
// uni.showToast({
|
|
|
|
|
// icon: 'success',
|
|
|
|
|
// title: '更新定位成功'
|
|
|
|
|
// })
|
|
|
|
|
// }
|
|
|
|
|
// })
|
|
|
|
|
// },
|
|
|
|
|
// punch() {
|
|
|
|
|
// this.$u.throttle(() => {
|
|
|
|
|
// this.type = 1
|
|
|
|
|
// this.isClick = true
|
|
|
|
|
// this.save(1)
|
|
|
|
|
// setTimeout(() => {
|
|
|
|
|
// this.isClick = false
|
|
|
|
|
// }, 10000)
|
|
|
|
|
// }, 10000)
|
|
|
|
|
|
|
|
|
|
// },
|
|
|
|
|
//更新定位
|
|
|
|
|
// locate() {
|
|
|
|
|
// this.$u.throttle(() => {
|
|
|
|
|
// this.type = 2
|
|
|
|
|
// this.isClick = true
|
|
|
|
|
// setTimeout(() => {
|
|
|
|
|
// this.isClick = false
|
|
|
|
|
// }, 10000)
|
|
|
|
|
// uni.getLocation().then(res => {
|
|
|
|
|
// this.location.lat = res[1]?.latitude
|
|
|
|
|
// this.location.lng = res[1]?.longitude
|
|
|
|
|
// this.location.time = this.time
|
|
|
|
|
|
|
|
|
|
// new Promise((reject, resolve) => {
|
|
|
|
|
// this.qqmapsdk.reverseGeocoder({
|
|
|
|
|
// location: {
|
|
|
|
|
// latitude: this.location.lat,
|
|
|
|
|
// longitude: this.location.lng
|
|
|
|
|
// },
|
|
|
|
|
// success: (r) => {
|
|
|
|
|
// reject(r)
|
|
|
|
|
// }
|
|
|
|
|
// })
|
|
|
|
|
// }).then(res => {
|
|
|
|
|
// this.location.address = res.result.address
|
|
|
|
|
|
|
|
|
|
// this.save(2)
|
|
|
|
|
// })
|
|
|
|
|
// })
|
|
|
|
|
// }, 10000)
|
|
|
|
|
// },
|
|
|
|
|
},
|
|
|
|
|
computed: {
|
|
|
|
|
ageComputed() {
|
|
|
|
|
@ -243,6 +354,8 @@
|
|
|
|
|
|
|
|
|
|
this.getDeatil(option.id)
|
|
|
|
|
|
|
|
|
|
this.getLoaction()
|
|
|
|
|
|
|
|
|
|
setInterval(() => {
|
|
|
|
|
this.time = new Date()
|
|
|
|
|
}, 1000)
|
|
|
|
|
@ -251,10 +364,6 @@
|
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
<style scoped lang="scss">
|
|
|
|
|
/deep/.u-checkbox {
|
|
|
|
|
display: inline !important;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.user-info {
|
|
|
|
|
width: 710rpx;
|
|
|
|
|
background: #FFFFFF;
|
|
|
|
|
@ -442,21 +551,7 @@
|
|
|
|
|
justify-content: space-between;
|
|
|
|
|
align-items: center;
|
|
|
|
|
|
|
|
|
|
.checkbox {
|
|
|
|
|
display: flex;
|
|
|
|
|
align-items: center;
|
|
|
|
|
|
|
|
|
|
&>view {
|
|
|
|
|
height: 40rpx;
|
|
|
|
|
font-size: 28rpx;
|
|
|
|
|
font-family: PingFang-SC-Medium, PingFang-SC;
|
|
|
|
|
font-weight: 500;
|
|
|
|
|
color: #36596A;
|
|
|
|
|
line-height: 40rpx;
|
|
|
|
|
|
|
|
|
|
padding-left: 16rpx;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
.checkbox {}
|
|
|
|
|
|
|
|
|
|
.input {
|
|
|
|
|
display: flex;
|
|
|
|
|
@ -523,33 +618,6 @@
|
|
|
|
|
.text2 {
|
|
|
|
|
@extend .text-class;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
&-active {
|
|
|
|
|
|
|
|
|
|
&::after {
|
|
|
|
|
content: '';
|
|
|
|
|
width: 80rpx;
|
|
|
|
|
height: 80rpx;
|
|
|
|
|
background: rgba(180, 180, 180, 0.5);
|
|
|
|
|
border-radius: 100%;
|
|
|
|
|
animation: ripper 270ms linear forwards;
|
|
|
|
|
|
|
|
|
|
position: absolute;
|
|
|
|
|
top: calc(50% - 40rpx);
|
|
|
|
|
left: calc(50% - 40rpx);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@keyframes ripper {
|
|
|
|
|
from {
|
|
|
|
|
opacity: 0.8;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
to {
|
|
|
|
|
opacity: 0.1;
|
|
|
|
|
transform: scale(2.6, 2.6);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|