Pārlūkot izejas kodu

app2.0:增加考勤打卡、考勤记录;

新疆影视学院高职
dyy pirms 3 gadiem
vecāks
revīzija
4830aecff7
8 mainītis faili ar 254 papildinājumiem un 24 dzēšanām
  1. Binārs
      Learun.Framework.Ultimate V7/LearunApp-2.2.0/common/images/2.png
  2. Binārs
      Learun.Framework.Ultimate V7/LearunApp-2.2.0/common/images/dk.png
  3. Binārs
      Learun.Framework.Ultimate V7/LearunApp-2.2.0/common/images/dkred.png
  4. Binārs
      Learun.Framework.Ultimate V7/LearunApp-2.2.0/common/images/dkyellow.png
  5. +5
    -4
      Learun.Framework.Ultimate V7/LearunApp-2.2.0/pages.json
  6. +58
    -20
      Learun.Framework.Ultimate V7/LearunApp-2.2.0/pages/ADRRecord/list.vue
  7. +0
    -0
      Learun.Framework.Ultimate V7/LearunApp-2.2.0/pages/ADRRecord/single.vue
  8. +191
    -0
      Learun.Framework.Ultimate V7/LearunApp-2.2.0/pages/AttendanceCard/list.vue

Binārs
Learun.Framework.Ultimate V7/LearunApp-2.2.0/common/images/2.png Parādīt failu

Pirms Pēc
Platums: 750  |  Augstums: 161  |  Izmērs: 13 KiB

Binārs
Learun.Framework.Ultimate V7/LearunApp-2.2.0/common/images/dk.png Parādīt failu

Pirms Pēc
Platums: 360  |  Augstums: 360  |  Izmērs: 17 KiB

Binārs
Learun.Framework.Ultimate V7/LearunApp-2.2.0/common/images/dkred.png Parādīt failu

Pirms Pēc
Platums: 360  |  Augstums: 360  |  Izmērs: 18 KiB

Binārs
Learun.Framework.Ultimate V7/LearunApp-2.2.0/common/images/dkyellow.png Parādīt failu

Pirms Pēc
Platums: 360  |  Augstums: 360  |  Izmērs: 19 KiB

+ 5
- 4
Learun.Framework.Ultimate V7/LearunApp-2.2.0/pages.json Parādīt failu

@@ -358,15 +358,16 @@
},
// 考勤记录
{
"path": "pages/LogisticsManagement/ADR_Record/list",
"path": "pages/ADRRecord/list",
"style": {
"navigationBarTitleText": "考勤里列表"
"navigationBarTitleText": "考勤记录"
}
},
// 考勤打卡
{
"path": "pages/LogisticsManagement/ADR_Record/single",
"path": "pages/AttendanceCard/list",
"style": {
"navigationBarTitleText": "考勤详情"
"navigationBarTitleText": "考勤打卡"
}
},
//班级自诊打卡


Learun.Framework.Ultimate V7/LearunApp-2.2.0/pages/LogisticsManagement/ADR_Record/list.vue → Learun.Framework.Ultimate V7/LearunApp-2.2.0/pages/ADRRecord/list.vue Parādīt failu

@@ -3,7 +3,7 @@
<!-- 主列表页 -->
<view :class="sideOpen ? 'show' : ''" class="mainpage" style="padding-top: 80rpx;">
<!-- 顶部条目/分页信息栏 -->
<l-customlist-banner @buttonClick="sideOpen = true">{{ tips }}</l-customlist-banner>
<l-customlist-banner >{{ tips }}</l-customlist-banner>
<!-- 滚动列表,跨端支持上拉/下拉 -->
<l-scroll-list v-if="ready" @pullDown="pullDown" @toBottom="fetchList()" ref="list">
@@ -12,22 +12,22 @@
<view class="customlist-item" v-for="item of list" :key="item.ID">
<view class="customlist-item-field">
<text class="customlist-item-field-title">文本框:</text>
{{ displayListItem(item, 'ADDate') }}
<text class="customlist-item-field-title">打卡时间:</text>
{{ displayListItem(item, 'ClockTime') }}
</view>
<view class="customlist-item-field">
<text class="customlist-item-field-title">下拉框:</text>
{{ displayListItem(item, 'ClockStatus') }}
<text class="customlist-item-field-title">考勤类型:</text>
{{ showADTypeFormat(item, 'ADType') }}
</view>
<view class="customlist-item-field">
<text class="customlist-item-field-title">日期框:</text>
{{ displayListItem(item, 'ADTime') }}
<text class="customlist-item-field-title">打卡结果:</text>
{{ displayListItem(item, 'ClockStatus') }}
</view>
<l-customlist-action showEdit @edit="action('edit', item.ID)" showDelete @delete="action('delete', item.ID)" @view="action('view', item.ID)" />
<!-- <l-customlist-action showEdit @edit="action('edit', item.ID)" showDelete @delete="action('delete', item.ID)" @view="action('view', item.ID)" /> -->
</view>
</l-customlist>
</l-scroll-list>
@@ -71,7 +71,7 @@
</view>
</scroll-view>
<l-customlist-add v-if="!sideOpen" @click="action('add')" />
<!-- <l-customlist-add v-if="!sideOpen" @click="action('add')" /> -->
</view>
</template>
@@ -105,22 +105,22 @@ export default {
return {
// 数据项的数据类型、结构
scheme: {
ADDate: { type: 'text' },
ClockStatus: { type: 'select', itemCode: 'DbFieldType', dataSource: '0' },
ADTime: { type: 'datetime', dateformat: '0' },
ClockTime: { type: 'datetime' },
ADType: { type: 'text' },
ClockStatus: { type: 'select', itemCode: 'ADStatus', dataSource: '0' },
},
// 查询条件
searchData: {},
defaultQueryData: {},
queryData: {
ADDate: '',
ClockTime: '',
ClockStatus: '',
},
// 数据源
dataSource: {
ClockStatus: Object.values(this.GET_GLOBAL('dataDictionary').DbFieldType).map(t => ({ value: t.value, text: t.text })),
ClockStatus: Object.values(this.GET_GLOBAL('dataDictionary').ADStatus).map(t => ({ value: t.value, text: t.text })),
},
// 时间查询参数
@@ -143,13 +143,13 @@ export default {
await this.init()
},
onUnload() {
this.OFF('LogisticsManagementADR_Record-list-change')
this.OFF('ADRRecord-list-change')
},
methods: {
// 页面初始化
async init() {
this.ON('LogisticsManagementADR_Record-list-change', this.refreshList)
this.ON('ADRRecord-list-change', this.refreshList)
// 拉取加载列表和数据源
await Promise.all([
@@ -166,13 +166,16 @@ export default {
// 拉取列表
async fetchList() {
if (this.page > this.total) { return }
let userInfo = this.GET_GLOBAL('loginUser');
this.searchData.UserNo=userInfo.account;
const result = await this.HTTP_GET(
'learun/adms/LogisticsManagement/ADR_Record/pagelist',
'learun/adms/attendance/getrecordpagelist',
{
// 这里 sidx 表示排序字段,sord 表示排序方式(DESC=降序,ASC=升序)
// 代码生成器生成时默认按照主键排序,您可以修改成按创建时间的字段降序
pagination: { rows: 10, page: this.page, sidx: 'ID', sord: 'DESC' },
pagination: { rows: 10, page: this.page, sidx: 'ClockTime', sord: 'DESC' },
queryJson: JSON.stringify(this.searchData)
},
'加载数据时出错'
@@ -283,11 +286,46 @@ export default {
case 'datetime':
if (!value) { return '' }
return moment(value).format(Number(fieldItem.dateformat) === 0 ? 'YYYY年 M月 D日' : 'YYYY-MM-DD HH:mm')
return moment(value).format(Number(fieldItem.dateformat) === 0 ? 'YYYY年 M月 D日' : 'YYYY-MM-DD HH:mm:ss')
default: return value === null || value === undefined ? '' : value
}
}
},
//显示考勤类型格式化
showADTypeFormat(item,field){
const ADType = item[field]
var type = '';
if(ADType=='0'){
type='未定义';
}else if(ADType=='1')
{
type='上班';
}else if(ADType=='2')
{
type='下班';
}else if(ADType=='3')
{
type='开始休息';
}else if(ADType=='4')
{
type='结束休息';
}else if(ADType=='5')
{
type='开始加班';
}else if(ADType=='6')
{
type='结束加班';
}else if(ADType=='7')
{
type='中午上班';
}else if(ADType=='8')
{
type='中午下班';
}
return type;
}
}
}

Learun.Framework.Ultimate V7/LearunApp-2.2.0/pages/LogisticsManagement/ADR_Record/single.vue → Learun.Framework.Ultimate V7/LearunApp-2.2.0/pages/ADRRecord/single.vue Parādīt failu


+ 191
- 0
Learun.Framework.Ultimate V7/LearunApp-2.2.0/pages/AttendanceCard/list.vue Parādīt failu

@@ -0,0 +1,191 @@
<template>
<view v-if="ready" class="contentBox">
<view class="content" id="attendContent">
<view id="show">{{now}}</view>
<div class="pen" @click="action('dk')">
<img id="attimg" :src="imgsrc" alt="" width="100%">
</div>
</view>
<view class="footer">
<img src="../../common/images/2.png" alt="" width="100%">
</view>
</view>
</template>
<script>
/*
* 版 本 Learun-ADMS V7.0.3 力软敏捷开发框架(http://www.learun.cn)
* Copyright (c) 2013-2020 上海力软信息技术有限公司
* 创建人:超级管理员
* 日 期:2022-03-10 15:30
* 描 述:考勤打卡
*/
/**
* 本段代码由移动端代码生成器输出,移动端须 2.2.0 版本及以上可以使用
* 请在移动端 /pages.json 中的 pages 字段中添加一条记录:
* { "path": "pages/AttendanceCard/list", "style": { "navigationBarTitleText": "考勤打卡" } }
*
* (navigationBarTitleText 字段为本页面的标题文本,可以修改)
* (必须自行操作该步骤,力软代码生成器不会自动帮您修改 /pages.json 文件)
*/
import get from 'lodash/get'
import set from 'lodash/set'
import moment from 'moment'
import customPageMixins from '@/common/custompage.js'
//导入图片
import dk from '../../common/images/dk.png'
import dkred from '../../common/images/dkred.png'
import dkyellow from '../../common/images/dkyellow.png'
export default {
mixins: [customPageMixins],
data() {
return {
// 页面相关参数
now: null,
imgsrc:dk,
ready: false,
}
},
async onLoad() {
await this.init()
},
methods: {
// 页面初始化
async init() {
this.LOADING('加载数据中...')
this.now = this.getCurrentTime()
setInterval(this.getCurrentTime,1000)
await this.judgeIsDK()
this.ready = true
this.HIDE_LOADING()
},
// 点击 「打卡」按钮
async action(type) {
switch (type) {
case 'dk':
if(this.imgsrc == "dkred"){
return
}
this.HTTP_POST('learun/adms/attendance/clockin', {}, '打卡失败').then(success => {
if(!success) {
this.TOAST('打卡失败')
return
}
this.TOAST('打卡成功','success')
setTimeout(this.back,1000)
})
return
default: break
}
},
//判断当前时间是否可以打卡
async judgeIsDK(){
this.HTTP_GET('learun/adms/attendance/IsAttendance',{},'判断当前时间是否可以打卡失败').then(success=>{
if(!success){return}
if (success.data == "red") {
this.imgsrc=dkred;
} else if (success.data == "yellow") {
this.imgsrc=dkyellow;
}else {
this.imgsrc=dk;
}
})
},
//返回
back(){
this.NAV_BACK()
},
//获取当前时间
getCurrentTime() {
let nowDate = new Date();
  let hh = nowDate.getHours();
  let mf = nowDate.getMinutes()<10 ? '0'+nowDate.getMinutes() : nowDate.getMinutes();
  let ss = nowDate.getSeconds()<10 ? '0'+nowDate.getSeconds() : nowDate.getSeconds();
  this.now = hh+':'+mf+':'+ss;
}
}
}
</script>

<style lang="less">
uni-page-body{
height: 100%;
width: 100%;
background-color: #fff;
}
.content {
width: 48%;
height: 50%;
position: absolute;
top: 15%;
left: 50%;
transform: translate(-50%, 10%);
}

#show {
text-align: center;
height: 200rpx;
font-size: 56rpx;
}

.pen {
height: 48%;
border-radius: 50%;
background-color: #e7f5ff;
display: flex;
align-items: center;
justify-content: center;
}

.pen2 {
width: 91%;
height: 91%;
border-radius: 50%;
background-color: #bde4ff;
display: flex;
align-items: center;
justify-content: center;
}

.pen3 {
width: 84%;
height: 84%;
border-radius: 50%;
background-color: #0c86d8;
text-align: center;
font-size: 68rpx;
display: flex;
align-items: center;
justify-content: center;
color: #ffff;
}

.footer {
width: 100%;
position: fixed;
left: 0;
bottom: 0;
overflow: hidden;
}
</style>

Notiek ielāde…
Atcelt
Saglabāt