【PT.SCC实名制管理系统】24.10.01 -30天,考勤打卡小程序
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

334 lines
7.4 KiB

6 months ago
5 months ago
6 months ago
5 months ago
6 months ago
5 months ago
6 months ago
5 months ago
6 months ago
5 months ago
6 months ago
5 months ago
6 months ago
5 months ago
6 months ago
5 months ago
5 months ago
6 months ago
5 months ago
5 months ago
6 months ago
5 months ago
6 months ago
5 months ago
5 months ago
5 months ago
6 months ago
5 months ago
5 months ago
6 months ago
5 months ago
6 months ago
5 months ago
6 months ago
5 months ago
6 months ago
5 months ago
6 months ago
5 months ago
6 months ago
5 months ago
6 months ago
5 months ago
6 months ago
5 months ago
6 months ago
5 months ago
6 months ago
6 months ago
  1. <!-- 签到记录 -->
  2. <template>
  3. <view class="record">
  4. <!-- 自定义导航栏 -->
  5. <uni-nav-bar dark :fixed="true" shadow background-color="var(--main-color)" status-bar left-icon="left"
  6. title="签到记录" @clickLeft="$utils.navigateBack" />
  7. <!-- 签到日历 -->
  8. <view class="sign-calendar main">
  9. <view class="sign-user-info">
  10. <image class="user-img" :src="userInfo.headImage" mode="widthFix"></image>
  11. <view class="base">
  12. <view class="name"
  13. v-if="userInfo.auth">{{ userInfo.auth.name }}</view>
  14. <view class="project"
  15. v-if="userInfo.team">{{ userInfo.team.name }}</view>
  16. </view>
  17. </view>
  18. <view>
  19. <view class="calendar-top">
  20. <view class="current-time">
  21. <view class="year">{{ selectDate.format('YYYY') }}</view>
  22. <view class="time">{{ selectDate.format('MM') }}</view>
  23. </view>
  24. <view class="calendar-desc">
  25. <view class="calendar-desc-item">正常</view>
  26. <view class="calendar-desc-item">缺卡</view>
  27. <view class="calendar-desc-item">未打卡</view>
  28. </view>
  29. </view>
  30. <uni-calendar class="uni-calendar--hook"
  31. @monthSwitch="monthSwitch"
  32. @change="changeDate"
  33. :selected="clockTotal.date" showMonth />
  34. <view class="desc">
  35. <view style="width: 100%;justify-content: flex-start;margin-top: 30rpx;" class="calendar-desc">
  36. <view style="margin: 0rpx 45rpx;" class="calendar-desc-item">正常<text>{{ clockTotal.normal }}</text></view>
  37. <view style="margin: 0rpx 45rpx;" class="calendar-desc-item">缺卡<text>{{ clockTotal.noCard }}</text></view>
  38. <view style="margin: 0rpx 45rpx;" class="calendar-desc-item">未打卡<text>{{ clockTotal.abnormal }}</text></view>
  39. </view>
  40. </view>
  41. </view>
  42. </view>
  43. <!-- 今日打卡详情 -->
  44. <view class="today-detail main">
  45. <view class="today-detail-title">今日打卡详情</view>
  46. <uv-steps current="8" direction="column" dot>
  47. <uv-steps-item v-for="item in list"
  48. :key="item.id">
  49. <template #title>
  50. <view class="today-detail-main">
  51. <image :src="item.pic"
  52. @click="previewImage([item.pic])"
  53. mode="aspectFill"></image>
  54. <view class="sign-detail">
  55. <view class="time" v-if="item.clockInTime">{{ item.clockInTime }}</view>
  56. <view class="time" v-else>
  57. {{ selectDate.format('YYYY-MM-DD ') + item.clockStartTime }}
  58. <view class="tag">
  59. 缺卡
  60. </view>
  61. </view>
  62. <view class="address">{{ item.address }}</view>
  63. </view>
  64. </view>
  65. </template>
  66. </uv-steps-item>
  67. </uv-steps>
  68. </view>
  69. </view>
  70. </template>
  71. <script>
  72. import { mapState } from 'vuex'
  73. import mixinList from '@/mixins/list.js'
  74. export default {
  75. mixins : [mixinList],
  76. name: "Record",
  77. data() {
  78. return {//this.$dayjs().format('YYYY-MM-DD')
  79. // year: this.$dayjs().format('YYYY'), //年
  80. // monthDay: this.$dayjs().format('MM'), //月日
  81. selectDate : this.$dayjs(),
  82. selected: [ //info为1:正常 2:缺卡 3:未打卡
  83. // {
  84. // date: getDate(new Date(), -3).fullDate,
  85. // info: 3
  86. // },
  87. // {
  88. // date: getDate(new Date(), -2).fullDate,
  89. // info: 2
  90. // },
  91. // {
  92. // date: getDate(new Date(), -1).fullDate,
  93. // info: 1
  94. // }
  95. ],
  96. mixinsListApi : 'clockList',
  97. clockTotal : {
  98. date : [],
  99. }
  100. }
  101. },
  102. onLoad() {
  103. this.queryParams.date = this.selectDate.format('YYYY-MM-DD HH:mm:ss')
  104. },
  105. computed : {
  106. ...mapState(['teamList', 'userInfo']),
  107. },
  108. onShow() {
  109. this.getClockTotal()
  110. },
  111. methods: {
  112. getClockTotal(){
  113. this.$api('clockTotal', {
  114. date : this.selectDate.format('YYYY-MM-DD HH:mm:ss')
  115. }, res => {
  116. if(res.code == 200){
  117. res.result.date.forEach(n => {
  118. n.info = n.type + 1
  119. })
  120. this.clockTotal = res.result
  121. }
  122. })
  123. },
  124. //切换月份
  125. monthSwitch(e){
  126. this.selectDate = this.$dayjs(`${e.year}-${e.month}-01 01:00:10`)
  127. this.getClockTotal()
  128. },
  129. // 切换日期
  130. changeDate(e){
  131. this.selectDate = this.$dayjs(`${e.fulldate} 01:00:10`)
  132. this.queryParams.date = this.selectDate.format('YYYY-MM-DD HH:mm:ss')
  133. this.getData()
  134. },
  135. }
  136. }
  137. </script>
  138. <style lang="scss" scoped>
  139. .record {
  140. min-height: 100vh;
  141. background: #E4E4E4;
  142. padding-bottom: 100rpx;
  143. .main {
  144. width: 95%;
  145. margin: 0rpx auto;
  146. }
  147. // 签到日历
  148. .sign-calendar {
  149. background: white;
  150. border-radius: 30rpx;
  151. overflow: hidden;
  152. margin-top: 30rpx;
  153. box-sizing: border-box;
  154. padding: 25rpx 15rpx;
  155. .sign-user-info {
  156. display: flex;
  157. flex-wrap: wrap;
  158. border-bottom: 2rpx solid #ccc;
  159. padding: 15rpx 0rpx;
  160. .user-img {
  161. width: 150rpx;
  162. height: 150rpx;
  163. border-radius: 20rpx;
  164. }
  165. .base {
  166. display: flex;
  167. flex-direction: column;
  168. justify-content: space-between;
  169. box-sizing: border-box;
  170. padding: 25rpx 0rpx 25rpx 15rpx;
  171. width: calc(100% - 150rpx);
  172. .name {
  173. font-size: 36rpx;
  174. }
  175. .project {
  176. font-size: 30rpx;
  177. color: #959595;
  178. }
  179. }
  180. }
  181. .calendar-top,
  182. .desc {
  183. display: flex;
  184. align-items: center;
  185. justify-content: space-between;
  186. padding: 15rpx 0rpx 20rpx 0rpx;
  187. .current-time {
  188. display: flex;
  189. font-size: 32rpx;
  190. font-weight: bold;
  191. width: 35%;
  192. .year {
  193. margin-right: 15rpx;
  194. }
  195. .time {}
  196. }
  197. .calendar-desc {
  198. display: flex;
  199. justify-content: flex-end;
  200. width: 65%;
  201. color: #707070;
  202. .calendar-desc-item {
  203. position: relative;
  204. margin: 0rpx 35rpx;
  205. &::before {
  206. position: absolute;
  207. top: 10rpx;
  208. left: -25rpx;
  209. display: block;
  210. content: "";
  211. width: 20rpx;
  212. height: 20rpx;
  213. border-radius: 50%;
  214. background: #11FF00;
  215. }
  216. &:nth-child(1) {
  217. &::before {
  218. background: #11FF00;
  219. }
  220. }
  221. &:nth-child(2) {
  222. &::before {
  223. background: #F97D00;
  224. }
  225. }
  226. &:nth-child(3) {
  227. &::before {
  228. background: #FF0000;
  229. }
  230. }
  231. }
  232. }
  233. }
  234. // 修改日历样式
  235. &::v-deep .uni-calendar__header {
  236. // display: none !important;
  237. }
  238. &::v-deep .uni-calendar__header-text{
  239. display: none !important;
  240. }
  241. &::v-deep .uni-calendar-item__weeks-box {
  242. border-radius: 50% !important;
  243. }
  244. &::v-deep .uni-calendar-item--isDay {
  245. background-color: $main-color !important;
  246. }
  247. &::v-deep .uni-calendar-item--checked {
  248. background-color: $main-color !important;
  249. }
  250. }
  251. // 今日打卡详情
  252. .today-detail {
  253. border-radius: 30rpx;
  254. background: white;
  255. margin-top: 35rpx;
  256. box-sizing: border-box;
  257. padding: 25rpx 15rpx;
  258. overflow: hidden;
  259. .today-detail-title {
  260. font-size: 32rpx;
  261. font-weight: bold;
  262. }
  263. .today-detail-main {
  264. display: flex;
  265. box-shadow: 0rpx 0rpx 10rpx rgba(0, 0, 0, .1);
  266. margin: 15rpx 0rpx;
  267. box-sizing: border-box;
  268. padding: 20rpx 15rpx;
  269. font-size: 26rpx;
  270. image {
  271. width: 220rpx;
  272. border-radius: 10rpx;
  273. flex-shrink: 0;
  274. height: 150rpx;
  275. }
  276. .time{
  277. display: flex;
  278. align-items: center;
  279. .tag{
  280. border: 1px solid #F97D00;
  281. color: #F97D00;
  282. padding: 2rpx 6rpx;
  283. border-radius: 10rpx;
  284. font-size: 22rpx;
  285. margin-left: 20rpx;
  286. }
  287. }
  288. .sign-detail {
  289. display: flex;
  290. flex-direction: column;
  291. justify-content: space-around;
  292. padding-left: 15rpx;
  293. box-sizing: border-box;
  294. }
  295. }
  296. }
  297. }
  298. </style>