master
271556543@qq.com 3 years ago
parent 12a384ae1c
commit 7392ca79c0

@ -1,4 +1,5 @@
const mode = process.env.NODE_ENV; const mode = process.env.NODE_ENV;
//const mode = 'development';
let ROOTPATH = ''; //域名 let ROOTPATH = ''; //域名
switch (mode) { switch (mode) {
case 'development': case 'development':

@ -66,14 +66,15 @@
<view class="line"></view> <view class="line"></view>
<view class="content"> <view class="content">
<view class="content-item" v-for="(item,index) in skuList" :key='item.sku_id'> <view class="content-item" v-for="(item,index) in skuList" :key='item.info.id'>
<u-checkbox v-model="item.isSelect" shape="circle" :name="item.name"> <u-checkbox :disabled="detail.status === 2" v-model="item.isSelect" shape="circle"
{{item.name}} :name="item.form.name">
{{item.info.name}}
</u-checkbox> </u-checkbox>
<view class="input"> <view class="input">
<u-input v-model="item.time" :custom-style="inputStyle" placeholder="请输入" <u-input :disabled="detail.status === 2" v-model="item.form.time" :custom-style="inputStyle"
placeholder-style="color:#A7AFBC;" input-align="center" :clearable="false" type="number" :placeholder="'需 '+item.info.time_lenth" placeholder-style="color:#A7AFBC;"
height="40"> input-align="center" :clearable="false" type="number" height="40">
</u-input> </u-input>
<view>分钟</view> <view>分钟</view>
</view> </view>
@ -96,8 +97,7 @@
<view class="text1">签退</view> <view class="text1">签退</view>
<view class="text2">{{$u.timeFormat(time,'hh:MM:ss')}}</view> <view class="text2">{{$u.timeFormat(time,'hh:MM:ss')}}</view>
</view> </view>
<view class="btn" v-if="detail.status === 0 && !flag" <view class="btn" v-if="detail.status === 0 && !flag" @click="$u.throttle(refreshLoaction,1000)">
@click="$u.throttle(refreshLoaction,1000),flag = true">
<view class="text1">更新定位</view> <view class="text1">更新定位</view>
<view class="text2">{{$u.timeFormat(time,'hh:MM:ss')}}</view> <view class="text2">{{$u.timeFormat(time,'hh:MM:ss')}}</view>
</view> </view>
@ -153,13 +153,9 @@
upload_list: [], upload_list: [],
}, },
skuList: [], skuList: [],
// subForm: {
// id: '',
// sku_time_list: []
// },
detail: {}, detail: {},
time: new Date(), time: new Date(),
timer: null,
} }
}, },
methods: { methods: {
@ -176,11 +172,13 @@
this.detail = res this.detail = res
this.skuList = res.sku.map(item => { this.skuList = res.sku.map(item => {
return { return {
id: item.id, info: item.sku_info,
name: item.sku_info?.name,
isSelect: item.time ? true : false, isSelect: item.time ? true : false,
form: {
id: item.id,
time: item.time || '',
sku_id: item.sku_id, sku_id: item.sku_id,
time: item.time || '' }
} }
}) })
this.form.schedule_list_id = this.id this.form.schedule_list_id = this.id
@ -230,6 +228,7 @@
icon: 'none', icon: 'none',
title: '更新定位成功' title: '更新定位成功'
}) })
this.flag = true
}) })
}, },
@ -259,10 +258,8 @@
return Promise.all(promiseAll) return Promise.all(promiseAll)
} else { } else {
uni.showToast({
icon: 'none', return Promise.reject(res[0].errMsg)
title: '上传失败'
})
} }
}, },
@ -302,19 +299,28 @@
title: '操作失败,请重试' title: '操作失败,请重试'
}) })
}) })
}).catch(err => {
uni.showToast({
icon: 'none',
title: '图片上传失败'
})
}) })
}, },
// //
saveSku() { saveSku() {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
let list = this.skuList.filter(item => { let temp1 = this.skuList.filter(item => {
return item.isSelect return item.isSelect
}) })
let temp2 = temp1.map(item => {
return item.form
})
this.$u.api.nurseSave({ this.$u.api.nurseSave({
id: this.id, id: this.id,
sku_time_list: list sku_time_list: temp2
}).then(res => { }).then(res => {
resolve(res) resolve(res)
}).catch(err => { }).catch(err => {
@ -333,7 +339,7 @@
// //
let flag = false let flag = false
for (let i of this.skuList) { for (let i of this.skuList) {
if (i.isSelect && i.time) { if (i.isSelect && i.form.time) {
flag = true flag = true
} }
} }
@ -367,7 +373,7 @@
// //
let flag = false let flag = false
for (let i of this.skuList) { for (let i of this.skuList) {
if (i.isSelect && i.time) { if (i.isSelect && i.form.time) {
flag = true flag = true
} }
} }
@ -378,6 +384,23 @@
}) })
return return
} }
//
let flag2 = 0
let tempArr = []
for (let i of this.skuList) {
if (i.isSelect && (i.form.time >= i.info.time_lenth)) {
flag2++
} else {
tempArr.push(i.info.name)
}
}
if (flag2 < this.skuList.length) {
uni.showToast({
icon: 'none',
title: `${tempArr.toString()}服务时间未满`
})
return
}
this.saveSku().then(() => { this.saveSku().then(() => {
this.clock(3) this.clock(3)
@ -405,16 +428,21 @@
} }
}, },
onLoad(option) { onLoad(option) {
this.load()
this.getDeatil(option.id) this.getDeatil(option.id)
this.id = option.id this.id = option.id
this.getLoaction() },
onShow() {
setInterval(() => { this.timer = setInterval(() => {
this.time = new Date() this.time = new Date()
}, 1000) }, 1000)
},
onHide() {
clearInterval(this.timer)
},
mounted() {
this.load()
this.getLoaction()
} }
} }
</script> </script>
@ -687,4 +715,8 @@
margin: 46rpx auto; margin: 46rpx auto;
} }
::v-deep .u-checkbox__icon-wrap--disabled {
background: #1d5cba !important;
}
</style> </style>

@ -46,7 +46,7 @@
<view class="line"></view> <view class="line"></view>
<view class="center"> <view class="center" @click="toDetail(item)">
<view class="avatar"> <view class="avatar">
<u-image :src="item.customer.sex === '男' ? vuex_male_img : vuex_female_img" height="104" <u-image :src="item.customer.sex === '男' ? vuex_male_img : vuex_female_img" height="104"
width="104" shape="circle"></u-image> width="104" shape="circle"></u-image>
@ -208,6 +208,14 @@
} }
}, },
//
toDetail(item) {
uni.$u.throttle(() => {
uni.navigateTo({
url: `/pages/detailNursing/detailNursing?id=${item.id}`
})
})
},
toThere(item) { toThere(item) {
this.$u.throttle(() => { this.$u.throttle(() => {
uni.openLocation({ uni.openLocation({

@ -124,15 +124,15 @@
joinCluster: true, joinCluster: true,
label: { // label: { //
content: markerIds.length + '人', content: markerIds.length + '人',
fontSize: 16, fontSize: 13,
color: '#36596A', color: '#36596A',
width: 50, width: 64,
height: 25, height: 25,
bgColor: '#FFFFFF', bgColor: '#FFFFFF',
borderRadius: 5, borderRadius: 5,
textAlign: 'center', textAlign: 'center',
anchorX: -10, anchorX: -32,
anchorY: 0, anchorY: 4,
} }
} }
clusterMarkers.push(clusterObj) clusterMarkers.push(clusterObj)
@ -163,15 +163,15 @@
joinCluster: true, joinCluster: true,
label: { label: {
content: item.customer.name, content: item.customer.name,
fontSize: 14, fontSize: 13,
color: '#36596A', color: '#36596A',
width: 54, width: 64,
height: 25, height: 25,
bgColor: '#FFFFFF', bgColor: '#FFFFFF',
borderRadius: 5, borderRadius: 5,
textAlign: 'center', textAlign: 'center',
anchorX: -7, anchorX: -32,
anchorY: 0, anchorY: 4,
}, },
info: item info: item
} }
@ -203,9 +203,10 @@
this.mapCtx.initMarkerCluster({ this.mapCtx.initMarkerCluster({
enableDefaultStyle: false, enableDefaultStyle: false,
zoomOnClick: true, zoomOnClick: true,
gridSize: 20 gridSize: 40
}) })
this.mapCtx.on("markerClusterCreate", e => { this.mapCtx.on("markerClusterCreate", e => {
console.log(e);
this.updateClusters(e.clusters) this.updateClusters(e.clusters)
}) })

@ -17,7 +17,7 @@
<view class="arrow" @click="monthMin"> <view class="arrow" @click="monthMin">
<u-icon name="arrow-left" size="20" color="#36596A"></u-icon> <u-icon name="arrow-left" size="20" color="#36596A"></u-icon>
</view> </view>
<view class="text"> <view class="text" @click="showPicker = true">
{{select.month}} {{select.month}}
</view> </view>
<view class="arrow" @click="monthPlus"> <view class="arrow" @click="monthPlus">
@ -88,7 +88,9 @@
<view class="center"> <view class="center">
<view class="top">{{item.customer.name}}</view> <view class="top">{{item.customer.name}}</view>
<view class="bottom"> <view class="bottom">
<view class="time">{{$u.timeFormat(new Date(item.start_time),'hh:MM')}}</view> <view class="time">
{{$u.timeFormat(new Date(item.start_time),'hh:MM')}}~{{$u.timeFormat(new Date(item.end_time),'hh:MM')}}
</view>
<view class="list-status-icon" <view class="list-status-icon"
:class="{icon1:item.status === 0,icon2:item.status === 2,icon3:item.status === 1}"> :class="{icon1:item.status === 0,icon2:item.status === 2,icon3:item.status === 1}">
</view> </view>
@ -106,6 +108,15 @@
</scroll-view> </scroll-view>
</view> </view>
</view> </view>
<u-picker mode="time" v-model="showPicker" :params="{
year: false,
month: true,
day: false,
hour: false,
minute: false,
second: false
}" :default-time="`${select.year}-${select.month}-${select.date}`" @confirm='monthPick'></u-picker>
</view> </view>
</template> </template>
@ -116,6 +127,7 @@
export default { export default {
data() { data() {
return { return {
showPicker: false,
statusDay: [{ statusDay: [{
date: 1, date: 1,
status: 2 status: 2
@ -136,7 +148,7 @@
], ],
opsionts: (() => { opsionts: (() => {
let res = [] let res = []
for (let i = 0; i < 20; i++) { for (let i = -1; i < 20; i++) {
res.push(new Date().getFullYear() - i) res.push(new Date().getFullYear() - i)
} }
return res return res
@ -176,6 +188,9 @@
} }
}, },
methods: { methods: {
monthPick(e) {
this.select.month = Number(e.month)
},
monthPlus() { monthPlus() {
this.$u.throttle(() => { this.$u.throttle(() => {
if (this.select.month < 12) { if (this.select.month < 12) {
@ -648,7 +663,6 @@
padding-top: 18rpx; padding-top: 18rpx;
.time { .time {
width: 100rpx;
background: #F9F9F9; background: #F9F9F9;
height: 40rpx; height: 40rpx;
font-size: 28rpx; font-size: 28rpx;
@ -658,6 +672,8 @@
line-height: 40rpx; line-height: 40rpx;
text-align: center; text-align: center;
border-radius: 10rpx; border-radius: 10rpx;
padding: 0 4rpx;
} }
.list-status-icon { .list-status-icon {

Loading…
Cancel
Save