|
|
@@ -262,11 +262,19 @@ class PunchClocks extends Component {
|
|
|
Taro.showToast({ title: '定位错误,请联系管理员', icon: 'none' })
|
|
|
return;
|
|
|
}
|
|
|
+
|
|
|
if ([5, 6].indexOf(dtails.type) === -1 && (dayjs().isBefore(dtails.releaseStarts) || dayjs().isAfter(dtails.releaseEnds))) {
|
|
|
Taro.hideLoading()
|
|
|
Taro.showToast({ title: '当前时间不在打卡时间范围内,无法打卡', icon: 'none' })
|
|
|
return;
|
|
|
+ } else if (dayjs().isAfter(dtails.releaseEnds)) {
|
|
|
+ Taro.hideLoading()
|
|
|
+ Taro.showToast({ title: '当前时间不在打卡时间范围内,无法打卡', icon: 'none' })
|
|
|
+ return;
|
|
|
}
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
// 非公出协单不受位置影响
|
|
|
if ([5, 6].indexOf(dtails.type) === -1 && !(this.state.distance <= this.wxConfig.clockInRange && this.state.distance >= 0)) {
|
|
|
Taro.hideLoading()
|
|
|
@@ -452,6 +460,30 @@ class PunchClocks extends Component {
|
|
|
});
|
|
|
}
|
|
|
|
|
|
+ getClockBgColor() {
|
|
|
+ const { dtails, distance, data } = this.state
|
|
|
+ const newClockIn = !!data.prdcList && data.prdcList.length > 0 ? data.prdcList[0] : {};
|
|
|
+ if ([5, 6].indexOf(dtails.type) > -1) {
|
|
|
+ if (!dayjs().isAfter(dtails.releaseEnds)) {
|
|
|
+ return [1, 2].includes(newClockIn.status) ? '#72cb78' : '#3f82e8'
|
|
|
+ } else {
|
|
|
+ return '#828e83'
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ return (!isNaN(parseInt(distance)))
|
|
|
+ && distance <= this.wxConfig.clockInRange
|
|
|
+ && distance >= 0
|
|
|
+ && !(dayjs().isBefore(dtails.releaseStarts) || dayjs().isAfter(dtails.releaseEnds))
|
|
|
+ && dtails.status === 2
|
|
|
+ ? dtails.type === 3
|
|
|
+ ? dtails.publicAssistAdvice > 0
|
|
|
+ ? ((newClockIn.status === 1 || newClockIn.status === 2) ? '#3f82e8' : '#72cb78')
|
|
|
+ : '#828e83'
|
|
|
+ : ((newClockIn.status === 1 || newClockIn.status === 2) ? '#3f82e8' : '#72cb78')
|
|
|
+ : '#828e83'
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
render() {
|
|
|
const { dtails, data } = this.state;
|
|
|
const newClockIn = !!data.prdcList && data.prdcList.length > 0 ? data.prdcList[0] : {};
|
|
|
@@ -633,35 +665,9 @@ class PunchClocks extends Component {
|
|
|
})
|
|
|
}}
|
|
|
style={{
|
|
|
- boxShadow:
|
|
|
- // (dtails.type == 1 && (dtails.techStartProcess == 1 || dtails.techStartProcess == 3))
|
|
|
- // ? '1px 1px 15px 1px #828e83'
|
|
|
- // : (dtails.type == 0 && (dtails.publicType == 1 || dtails.publicType == 3))
|
|
|
- // ? '1px 1px 15px 1px #828e83'
|
|
|
- // :
|
|
|
- (!isNaN(parseInt(this.state.distance)))
|
|
|
- && this.state.distance <= this.wxConfig.clockInRange
|
|
|
- && this.state.distance >= 0
|
|
|
- && !(dayjs().isBefore(this.state.dtails.releaseStarts) || dayjs().isAfter(this.state.dtails.releaseEnds))
|
|
|
- && dtails.status === 2
|
|
|
- ? dtails.type === 3
|
|
|
- ? dtails.publicAssistAdvice > 0
|
|
|
- ? ((newClockIn.status === 1 || newClockIn.status === 2) ? '1px 1px 15px 1px #3f82e8' : '1px 1px 15px 1px #72cb78')
|
|
|
- : '1px 1px 15px 1px #828e83'
|
|
|
- : ((newClockIn.status === 1 || newClockIn.status === 2) ? '1px 1px 15px 1px #3f82e8' : '1px 1px 15px 1px #72cb78')
|
|
|
- : '1px 1px 15px 1px #828e83',
|
|
|
- background:
|
|
|
- (!isNaN(parseInt(this.state.distance)))
|
|
|
- && this.state.distance <= this.wxConfig.clockInRange
|
|
|
- && this.state.distance >= 0
|
|
|
- && !(dayjs().isBefore(this.state.dtails.releaseStarts) || dayjs().isAfter(this.state.dtails.releaseEnds))
|
|
|
- && dtails.status === 2
|
|
|
- ? dtails.type === 3
|
|
|
- ? dtails.publicAssistAdvice > 0
|
|
|
- ? ((newClockIn.status === 1 || newClockIn.status === 2) ? '#3f82e8' : '#72cb78')
|
|
|
- : '#828e83'
|
|
|
- : ((newClockIn.status === 1 || newClockIn.status === 2) ? '#3f82e8' : '#72cb78')
|
|
|
- : '#828e83'
|
|
|
+ boxShadow: '1px 1px 15px 1px '+this.getClockBgColor(),
|
|
|
+ background: this.getClockBgColor()
|
|
|
+
|
|
|
}}>
|
|
|
<View className='punchClockTitle'>
|
|
|
{
|