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

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

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

@ -46,7 +46,7 @@
<view class="line"></view>
<view class="center">
<view class="center" @click="toDetail(item)">
<view class="avatar">
<u-image :src="item.customer.sex === '男' ? vuex_male_img : vuex_female_img" height="104"
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) {
this.$u.throttle(() => {
uni.openLocation({

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

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

Loading…
Cancel
Save