【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.

341 lines
7.6 KiB

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