Browse Source

refactor(my_attendance): 优化考勤列表展示逻辑

-整合左侧和右侧内容,提高信息密度
- 优化时间显示逻辑,区分考勤和请假情况
- 添加签退按钮,便于快速操作
- 修复部分字段空值显示问题
master
liutong 10 months ago
parent
commit
39558b2d97
  1. 68
      pages/common/my_attendance.vue

68
pages/common/my_attendance.vue

@ -73,39 +73,33 @@
v-for="(v,k) in tableList" v-for="(v,k) in tableList"
:key="k" :key="k"
> >
<view class="left"> <view class="left" @click="openInfo(v)">
<view class="content">普通考勤</view> <view class="content">普通考勤</view>
<view class="content"> <view class="content">
{{v.status_name}} {{v.status_name}}
</view> </view>
<view class="content"> <view class="content">
校区{{v.campus_id_name}} 校区{{v.campus_id_name || ''}}
</view> </view>
<view class="content"> <view class="content">
备注{{v.remarks || ''}} 备注{{v.remarks || ''}}
</view> </view>
<view class="content"> <view class="content">
<text>{{v.attendance_date}} {{v.check_in_time}}</text> <view class="item" v-if="v.status != 'leave'">
<text v-if="v.check_out_time" style="padding: 0 20rpx">-</text> <!--考勤-->
<text v-if="v.check_out_time">{{v.attendance_date}} {{v.check_out_time}}</text> <text>开始时间{{ v.attendance_date }} {{ v.check_in_time || '' }}</text>
<text v-if="v.check_out_time">结束时间{{ v.attendance_date }} {{ v.check_out_time || '' }}</text>
</view>
<!--请假-->
<view class="item" v-else>
<text>开始时间{{ v.attendance_date }} {{v.leave_start_time || ''}}</text>
<text>结束时间{{ v.attendance_date }} {{v.leave_end_time || ''}}</text>
</view>
</view> </view>
</view> </view>
<view class="right"> <view class="right">
<view class="content">普通考勤</view> <view v-if="v.status == 'present' && !v.check_out_time" class="btn" style="background-color: #00b0f0;" @click="openSignInShow('sign_out',v)">签退</view>
<view class="content">
{{v.status_name}}
</view>
<view class="content">
校区{{v.campus_id_name}}
</view>
<view class="content">
备注{{v.remarks || ''}}
</view>
<view class="content">
<text>{{v.attendance_date}} {{v.check_in_time}}</text>
<text v-if="v.check_out_time" style="padding: 0 20rpx">-</text>
<text v-if="v.check_out_time">{{v.attendance_date}} {{v.check_out_time}}</text>
</view>
</view> </view>
</view> </view>
</view> </view>
@ -125,39 +119,33 @@
v-for="(v,k) in tableList" v-for="(v,k) in tableList"
:key="k" :key="k"
> >
<view class="left"> <view class="left" @click="openInfo(v)">
<view class="content">普通考勤</view> <view class="content">普通考勤</view>
<view class="content"> <view class="content">
{{v.status_name}} {{v.status_name}}
</view> </view>
<view class="content"> <view class="content">
校区{{v.campus_id_name}} 校区{{v.campus_id_name || ''}}
</view> </view>
<view class="content"> <view class="content">
备注{{v.remarks || ''}} 备注{{v.remarks || ''}}
</view> </view>
<view class="content"> <view class="content">
<text>{{v.attendance_date}} {{v.check_in_time}}</text> <view class="item" v-if="v.status != 'leave'">
<text v-if="v.check_out_time" style="padding: 0 20rpx">-</text> <!--考勤-->
<text v-if="v.check_out_time">{{v.attendance_date}} {{v.check_out_time}}</text> <text>开始时间{{ v.attendance_date }} {{ v.check_in_time || '' }}</text>
<text v-if="v.check_out_time">结束时间{{ v.attendance_date }} {{ v.check_out_time || '' }}</text>
</view>
<!--请假-->
<view class="item" v-else>
<text>开始时间{{ v.attendance_date }} {{v.leave_start_time || ''}}</text>
<text>结束时间{{ v.attendance_date }} {{v.leave_end_time || ''}}</text>
</view>
</view> </view>
</view> </view>
<view class="right"> <view class="right">
<view class="content">普通考勤</view> <view v-if="v.status == 'present' && !v.check_out_time" class="btn" style="background-color: #00b0f0;" @click="openSignInShow('sign_out',v)">签退</view>
<view class="content">
{{v.status_name}}
</view>
<view class="content">
校区{{v.campus_id_name}}
</view>
<view class="content">
备注{{v.remarks || ''}}
</view>
<view class="content">
<text>{{v.attendance_date}} {{v.check_in_time}}</text>
<text v-if="v.check_out_time" style="padding: 0 20rpx">-</text>
<text v-if="v.check_out_time">{{v.attendance_date}} {{v.check_out_time}}</text>
</view>
</view> </view>
</view> </view>
</view> </view>

Loading…
Cancel
Save