200 lines
7.9 KiB
Plaintext
200 lines
7.9 KiB
Plaintext
<scroll-view
|
|
class="page safe-bottom"
|
|
scroll-y
|
|
type="list"
|
|
refresher-enabled
|
|
refresher-triggered="{{refreshing}}"
|
|
bindrefresherrefresh="onPullDownRefresh"
|
|
>
|
|
<view class="header">
|
|
<text class="title">考勤设置</text>
|
|
<text class="subtitle">按考勤点维护作息时间、就餐时间和扫码考勤范围</text>
|
|
</view>
|
|
|
|
<view class="card auto-submit-card">
|
|
<view class="form-item">
|
|
<text class="label">系统自动提交时长(小时)</text>
|
|
<input
|
|
class="input"
|
|
type="digit"
|
|
value="{{form.autoSubmitHours}}"
|
|
placeholder="默认15小时"
|
|
bindinput="onAutoSubmitHoursInput"
|
|
/>
|
|
<text class="subtitle">超过该时长未下班报工,系统将自动提交待审核报工。</text>
|
|
</view>
|
|
</view>
|
|
|
|
<view class="section-title section-title-action">
|
|
<text>考勤范围</text>
|
|
<button class="btn mini primary add-point-btn" bindtap="addAttendancePoint">+</button>
|
|
</view>
|
|
<view
|
|
wx:for="{{form.attendancePoints}}"
|
|
wx:key="localKey"
|
|
wx:for-index="pointIndex"
|
|
wx:for-item="point"
|
|
class="card location-card {{expandedPointKey === point.localKey ? 'expanded' : 'collapsed'}}"
|
|
>
|
|
<view class="location-head" data-key="{{point.localKey}}" bindtap="toggleAttendancePoint">
|
|
<view class="location-text">
|
|
<text class="schedule-name">{{point.name || '新考勤点'}}</text>
|
|
<block wx:if="{{expandedPointKey === point.localKey}}">
|
|
<text class="subtitle">一个考勤点对应一个分公司,可独立配置作息和扫码范围</text>
|
|
<text wx:if="{{locationAccuracyText}}" class="location-accuracy">{{locationAccuracyText}}</text>
|
|
</block>
|
|
</view>
|
|
<button
|
|
wx:if="{{expandedPointKey === point.localKey}}"
|
|
class="btn primary locate-btn"
|
|
loading="{{locating}}"
|
|
data-index="{{pointIndex}}"
|
|
catchtap="useCurrentLocation"
|
|
>使用当前位置</button>
|
|
</view>
|
|
|
|
<block wx:if="{{expandedPointKey === point.localKey}}">
|
|
<view class="form-item">
|
|
<text class="label">考勤点名称</text>
|
|
<input
|
|
class="input"
|
|
value="{{point.name}}"
|
|
placeholder="请输入考勤点名称"
|
|
data-index="{{pointIndex}}"
|
|
data-field="name"
|
|
bindinput="onPointInput"
|
|
/>
|
|
</view>
|
|
|
|
<view class="point-section-title">作息时间</view>
|
|
<view class="schedule-panel">
|
|
<view class="schedule-row">
|
|
<text class="schedule-name">白班时间段</text>
|
|
<view class="time-range">
|
|
<picker mode="time" value="{{point.dayStart}}" data-index="{{pointIndex}}" data-field="dayStart" bindchange="onTimeChange">
|
|
<view class="picker time-picker">{{point.dayStart}}</view>
|
|
</picker>
|
|
<text class="range-sep">至</text>
|
|
<picker mode="time" value="{{point.dayEnd}}" data-index="{{pointIndex}}" data-field="dayEnd" bindchange="onTimeChange">
|
|
<view class="picker time-picker">{{point.dayEnd}}</view>
|
|
</picker>
|
|
</view>
|
|
</view>
|
|
|
|
<view class="schedule-row">
|
|
<text class="schedule-name">夜班时间段</text>
|
|
<view class="time-range">
|
|
<picker mode="time" value="{{point.nightStart}}" data-index="{{pointIndex}}" data-field="nightStart" bindchange="onTimeChange">
|
|
<view class="picker time-picker">{{point.nightStart}}</view>
|
|
</picker>
|
|
<text class="range-sep">至</text>
|
|
<picker mode="time" value="{{point.nightEnd}}" data-index="{{pointIndex}}" data-field="nightEnd" bindchange="onTimeChange">
|
|
<view class="picker time-picker">{{point.nightEnd}}</view>
|
|
</picker>
|
|
</view>
|
|
</view>
|
|
|
|
<view class="schedule-row">
|
|
<text class="schedule-name">中饭就餐</text>
|
|
<view class="time-range">
|
|
<picker mode="time" value="{{point.lunchStart}}" data-index="{{pointIndex}}" data-field="lunchStart" bindchange="onTimeChange">
|
|
<view class="picker time-picker">{{point.lunchStart}}</view>
|
|
</picker>
|
|
<text class="range-sep">至</text>
|
|
<picker mode="time" value="{{point.lunchEnd}}" data-index="{{pointIndex}}" data-field="lunchEnd" bindchange="onTimeChange">
|
|
<view class="picker time-picker">{{point.lunchEnd}}</view>
|
|
</picker>
|
|
</view>
|
|
</view>
|
|
|
|
<view class="schedule-row">
|
|
<text class="schedule-name">晚饭就餐</text>
|
|
<view class="time-range">
|
|
<picker mode="time" value="{{point.dinnerStart}}" data-index="{{pointIndex}}" data-field="dinnerStart" bindchange="onTimeChange">
|
|
<view class="picker time-picker">{{point.dinnerStart}}</view>
|
|
</picker>
|
|
<text class="range-sep">至</text>
|
|
<picker mode="time" value="{{point.dinnerEnd}}" data-index="{{pointIndex}}" data-field="dinnerEnd" bindchange="onTimeChange">
|
|
<view class="picker time-picker">{{point.dinnerEnd}}</view>
|
|
</picker>
|
|
</view>
|
|
</view>
|
|
|
|
<view class="schedule-row last">
|
|
<text class="schedule-name">加班时间段</text>
|
|
<view class="time-range">
|
|
<picker mode="time" value="{{point.overtimeStart}}" data-index="{{pointIndex}}" data-field="overtimeStart" bindchange="onTimeChange">
|
|
<view class="picker time-picker">{{point.overtimeStart}}</view>
|
|
</picker>
|
|
<text class="range-sep">至</text>
|
|
<picker mode="time" value="{{point.overtimeEnd}}" data-index="{{pointIndex}}" data-field="overtimeEnd" bindchange="onTimeChange">
|
|
<view class="picker time-picker">{{point.overtimeEnd}}</view>
|
|
</picker>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
|
|
<view class="point-section-title">考勤范围</view>
|
|
<view class="location-grid">
|
|
<view class="location-cell">
|
|
<text class="label">纬度</text>
|
|
<input
|
|
class="input coordinate-input mono"
|
|
type="digit"
|
|
value="{{point.latitude}}"
|
|
placeholder="请输入纬度"
|
|
data-index="{{pointIndex}}"
|
|
data-field="latitude"
|
|
bindinput="onPointInput"
|
|
/>
|
|
</view>
|
|
<view class="location-cell">
|
|
<text class="label">经度</text>
|
|
<input
|
|
class="input coordinate-input mono"
|
|
type="digit"
|
|
value="{{point.longitude}}"
|
|
placeholder="请输入经度"
|
|
data-index="{{pointIndex}}"
|
|
data-field="longitude"
|
|
bindinput="onPointInput"
|
|
/>
|
|
</view>
|
|
</view>
|
|
|
|
<view class="form-item radius-item">
|
|
<text class="label">考勤范围半径(米)</text>
|
|
<input
|
|
class="input"
|
|
type="number"
|
|
value="{{point.radiusMeters}}"
|
|
placeholder="请输入米数"
|
|
data-index="{{pointIndex}}"
|
|
data-field="radiusMeters"
|
|
bindinput="onPointInput"
|
|
/>
|
|
</view>
|
|
<view class="form-item">
|
|
<text class="label">备注</text>
|
|
<textarea
|
|
class="textarea"
|
|
value="{{point.remark}}"
|
|
placeholder="可填写分公司或厂区说明"
|
|
data-index="{{pointIndex}}"
|
|
data-field="remark"
|
|
bindinput="onPointInput"
|
|
></textarea>
|
|
</view>
|
|
<button class="btn danger full" data-index="{{pointIndex}}" catchtap="removePoint">停用/移除考勤点</button>
|
|
</block>
|
|
</view>
|
|
|
|
<view class="card save-card">
|
|
<text wx:if="{{updatedAtText}}" class="subtitle">最近更新 {{updatedAtText}}</text>
|
|
<view class="button-row">
|
|
<button class="btn secondary full" bindtap="resetDefault">恢复默认</button>
|
|
<button class="btn primary full" loading="{{saving}}" bindtap="save">保存设置</button>
|
|
</view>
|
|
</view>
|
|
</scroll-view>
|