|
|
|
|
@ -7,7 +7,8 @@
|
|
|
|
|
<view class="user-info" v-if="detail.customer">
|
|
|
|
|
<view class="top">
|
|
|
|
|
<view class="left">
|
|
|
|
|
<u-image src="/static/logo.png" width="104" height="104" shape="circle"></u-image>
|
|
|
|
|
<u-image :src="detail.customer.sex === '男' ? vuex_male_img : vuex_female_img" width="104"
|
|
|
|
|
height="104" shape="circle"></u-image>
|
|
|
|
|
</view>
|
|
|
|
|
<view class="center">
|
|
|
|
|
<view class="name">{{detail.customer.name}}</view>
|
|
|
|
|
@ -57,7 +58,7 @@
|
|
|
|
|
</view>
|
|
|
|
|
|
|
|
|
|
<!-- 今日护理 -->
|
|
|
|
|
<view class="today-nursing">
|
|
|
|
|
<view class="today-nursing" v-show="detail.status !== 0">
|
|
|
|
|
<view class="title">
|
|
|
|
|
今日护理
|
|
|
|
|
</view>
|
|
|
|
|
@ -65,12 +66,12 @@
|
|
|
|
|
<view class="line"></view>
|
|
|
|
|
|
|
|
|
|
<view class="content">
|
|
|
|
|
<view class="content-item" v-for="(item,index) in detail.sku" :key='item.id'>
|
|
|
|
|
<u-checkbox v-model="form[index].isSelect" shape="circle" :name="item.sku_info.name">
|
|
|
|
|
{{item.sku_info.name}}
|
|
|
|
|
<view class="content-item" v-for="(item,index) in skuList" :key='item.sku_id'>
|
|
|
|
|
<u-checkbox v-model="item.isSelect" shape="circle" :name="item.name">
|
|
|
|
|
{{item.name}}
|
|
|
|
|
</u-checkbox>
|
|
|
|
|
<view class="input">
|
|
|
|
|
<u-input v-model="form[index].time" :custom-style="inputStyle" placeholder="请输入"
|
|
|
|
|
<u-input v-model="item.time" :custom-style="inputStyle" placeholder="请输入"
|
|
|
|
|
placeholder-style="color:#A7AFBC;" input-align="center" :clearable="false" type="number"
|
|
|
|
|
height="40">
|
|
|
|
|
</u-input>
|
|
|
|
|
@ -82,22 +83,27 @@
|
|
|
|
|
|
|
|
|
|
<!-- 打卡 -->
|
|
|
|
|
<view class="clock">
|
|
|
|
|
<view class="btn">
|
|
|
|
|
<view class="btn" v-if="detail.status === 1 && detail.logs_count < 3"
|
|
|
|
|
@click="$u.throttle(clockIn,1000)">
|
|
|
|
|
<view class="text1">过程打卡</view>
|
|
|
|
|
<view class="text2">(3)</view>
|
|
|
|
|
<view class="text2">({{detail.logs_count + 1}})</view>
|
|
|
|
|
</view>
|
|
|
|
|
<view class="btn" @click="$u.throttle(sign)">
|
|
|
|
|
<view class="btn" v-if="detail.status === 0 && flag" @click="$u.throttle(sign,1000)">
|
|
|
|
|
<view class="text1">签到</view>
|
|
|
|
|
<view class="text2">{{$u.timeFormat(time,'hh:MM:ss')}}</view>
|
|
|
|
|
</view>
|
|
|
|
|
<view class="btn">
|
|
|
|
|
<view class="btn" v-if="detail.status === 1" @click="$u.throttle(signOut,1000)">
|
|
|
|
|
<view class="text1">签退</view>
|
|
|
|
|
<view class="text2">{{$u.timeFormat(time,'hh:MM:ss')}}</view>
|
|
|
|
|
</view>
|
|
|
|
|
<view class="btn">
|
|
|
|
|
<view class="btn" v-if="detail.status === 0 && !flag"
|
|
|
|
|
@click="$u.throttle(refreshLoaction,1000),flag = true">
|
|
|
|
|
<view class="text1">更新定位</view>
|
|
|
|
|
<view class="text2">{{$u.timeFormat(time,'hh:MM:ss')}}</view>
|
|
|
|
|
</view>
|
|
|
|
|
<view class="btn" v-if="detail.status === 2">
|
|
|
|
|
<view class="text1">护理已完成</view>
|
|
|
|
|
</view>
|
|
|
|
|
</view>
|
|
|
|
|
|
|
|
|
|
<!-- 打卡信息 -->
|
|
|
|
|
@ -117,7 +123,8 @@
|
|
|
|
|
export default {
|
|
|
|
|
data() {
|
|
|
|
|
return {
|
|
|
|
|
type: '',
|
|
|
|
|
id: '',
|
|
|
|
|
flag: false, //未开始护理时,是否更新过定位(真为更新过定位)
|
|
|
|
|
qqmapsdk: null,
|
|
|
|
|
inputStyle: {
|
|
|
|
|
fontSize: "24rpx",
|
|
|
|
|
@ -145,10 +152,11 @@
|
|
|
|
|
type: '',
|
|
|
|
|
upload_list: [],
|
|
|
|
|
},
|
|
|
|
|
subForm: {
|
|
|
|
|
id: '',
|
|
|
|
|
sku_time_list: []
|
|
|
|
|
},
|
|
|
|
|
skuList: [],
|
|
|
|
|
// subForm: {
|
|
|
|
|
// id: '',
|
|
|
|
|
// sku_time_list: []
|
|
|
|
|
// },
|
|
|
|
|
detail: {},
|
|
|
|
|
time: new Date(),
|
|
|
|
|
|
|
|
|
|
@ -166,13 +174,16 @@
|
|
|
|
|
id
|
|
|
|
|
})
|
|
|
|
|
this.detail = res
|
|
|
|
|
this.subForm.schedule_list_id = res.sku.map(item => {
|
|
|
|
|
this.skuList = res.sku.map(item => {
|
|
|
|
|
return {
|
|
|
|
|
isSelect: false,
|
|
|
|
|
sku_id: item.id,
|
|
|
|
|
time: ''
|
|
|
|
|
id: item.id,
|
|
|
|
|
name: item.sku_info?.name,
|
|
|
|
|
isSelect: item.time ? true : false,
|
|
|
|
|
sku_id: item.sku_id,
|
|
|
|
|
time: item.time || ''
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
this.form.schedule_list_id = this.id
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
//获取当前定位信息
|
|
|
|
|
@ -183,6 +194,8 @@
|
|
|
|
|
this.location.lat = res[1]?.latitude
|
|
|
|
|
this.location.lng = res[1]?.longitude
|
|
|
|
|
this.location.time = this.time
|
|
|
|
|
this.form.lat = this.location.lat
|
|
|
|
|
this.form.lng = this.location.lng
|
|
|
|
|
|
|
|
|
|
this.qqmapsdk.reverseGeocoder({
|
|
|
|
|
location: {
|
|
|
|
|
@ -191,6 +204,7 @@
|
|
|
|
|
},
|
|
|
|
|
success: (res) => {
|
|
|
|
|
this.location.address = res.result.address
|
|
|
|
|
this.form.address = this.location.address
|
|
|
|
|
resolve(res)
|
|
|
|
|
},
|
|
|
|
|
fail: (err) => {
|
|
|
|
|
@ -253,87 +267,128 @@
|
|
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
//签到
|
|
|
|
|
sign() {
|
|
|
|
|
//打卡
|
|
|
|
|
clock(type) {
|
|
|
|
|
let title;
|
|
|
|
|
switch (type) {
|
|
|
|
|
case 1:
|
|
|
|
|
title = '签到成功'
|
|
|
|
|
break;
|
|
|
|
|
case 2:
|
|
|
|
|
title = `第${this.detail.logs_count+1}次打卡成功`
|
|
|
|
|
break;
|
|
|
|
|
case 3:
|
|
|
|
|
title = '签退成功'
|
|
|
|
|
break;
|
|
|
|
|
default:
|
|
|
|
|
title = '操作成功'
|
|
|
|
|
}
|
|
|
|
|
this.uploadImgs().then(res => {
|
|
|
|
|
this.form.upload_list = res.map(item => {
|
|
|
|
|
return {
|
|
|
|
|
upload_id: JSON.parse(item.data).id
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
this.form.type = type
|
|
|
|
|
console.log(this.form);
|
|
|
|
|
this.$u.api.processSave(this.form).then(res => {
|
|
|
|
|
uni.showToast({
|
|
|
|
|
icon: 'success',
|
|
|
|
|
title
|
|
|
|
|
})
|
|
|
|
|
this.getDeatil(this.id)
|
|
|
|
|
}).catch(err => {
|
|
|
|
|
uni.showToast({
|
|
|
|
|
title: '操作失败,请重试'
|
|
|
|
|
})
|
|
|
|
|
})
|
|
|
|
|
})
|
|
|
|
|
},
|
|
|
|
|
// 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)
|
|
|
|
|
// },
|
|
|
|
|
|
|
|
|
|
//保存服务项目
|
|
|
|
|
saveSku() {
|
|
|
|
|
return new Promise((resolve, reject) => {
|
|
|
|
|
let list = this.skuList.filter(item => {
|
|
|
|
|
return item.isSelect
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
this.$u.api.nurseSave({
|
|
|
|
|
id: this.id,
|
|
|
|
|
sku_time_list: list
|
|
|
|
|
}).then(res => {
|
|
|
|
|
resolve(res)
|
|
|
|
|
}).catch(err => {
|
|
|
|
|
reject(err)
|
|
|
|
|
})
|
|
|
|
|
})
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
//签到
|
|
|
|
|
sign() {
|
|
|
|
|
this.clock(1)
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
//过程打卡
|
|
|
|
|
clockIn() {
|
|
|
|
|
//验证是否有选择服务项目并填写
|
|
|
|
|
let flag = false
|
|
|
|
|
for (let i of this.skuList) {
|
|
|
|
|
if (i.isSelect && i.time) {
|
|
|
|
|
flag = true
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if (!flag) {
|
|
|
|
|
uni.showToast({
|
|
|
|
|
icon: 'none',
|
|
|
|
|
title: `请选择并填写服务项目与时间`
|
|
|
|
|
})
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
this.saveSku().then(res => {
|
|
|
|
|
this.clock(2)
|
|
|
|
|
}).catch(err => {
|
|
|
|
|
console.log(err);
|
|
|
|
|
uni.showToast({
|
|
|
|
|
icon: 'none',
|
|
|
|
|
title: '请重试'
|
|
|
|
|
})
|
|
|
|
|
})
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
//签退
|
|
|
|
|
signOut() {
|
|
|
|
|
if (this.detail.logs_count < 3) {
|
|
|
|
|
uni.showToast({
|
|
|
|
|
icon: 'none',
|
|
|
|
|
title: `请先完成3次打卡,再签退。当前完成打卡次数${this.detail.logs_count}`
|
|
|
|
|
})
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
//验证是否有选择服务项目并填写
|
|
|
|
|
let flag = false
|
|
|
|
|
for (let i of this.skuList) {
|
|
|
|
|
if (i.isSelect && i.time) {
|
|
|
|
|
flag = true
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if (!flag) {
|
|
|
|
|
uni.showToast({
|
|
|
|
|
icon: 'none',
|
|
|
|
|
title: `请选择并填写服务项目与时间`
|
|
|
|
|
})
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
this.saveSku().then(() => {
|
|
|
|
|
this.clock(3)
|
|
|
|
|
}).catch(err => {
|
|
|
|
|
console.log(err);
|
|
|
|
|
uni.showToast({
|
|
|
|
|
icon: 'none',
|
|
|
|
|
title: '请重试'
|
|
|
|
|
})
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
computed: {
|
|
|
|
|
ageComputed() {
|
|
|
|
|
@ -353,6 +408,7 @@
|
|
|
|
|
this.load()
|
|
|
|
|
|
|
|
|
|
this.getDeatil(option.id)
|
|
|
|
|
this.id = option.id
|
|
|
|
|
|
|
|
|
|
this.getLoaction()
|
|
|
|
|
|
|
|
|
|
|