Compare commits

2 Commits

Author SHA1 Message Date
wangzhuo
af25a14c17 fea: 打卡查看-支持出差打卡类型 2025-09-24 16:51:33 +08:00
wangzhuo
082d60e2da feat: 出差打卡-简化提示 2025-09-24 16:51:33 +08:00
3 changed files with 125 additions and 117 deletions

View File

@@ -10,25 +10,26 @@
<!-- 正文内容 --> <!-- 正文内容 -->
<view> <view>
<!-- 搜索 --> <!-- 搜索 -->
<!-- <view class="search">--> <!-- <view class="search">-->
<!-- <picker mode="date" :value="defaultDate" :start="startDate" :end="endDate" @change="bindDateChange"--> <!-- <picker mode="date" :value="defaultDate" :start="startDate" :end="endDate" @change="bindDateChange"-->
<!-- class="picker-bg">--> <!-- class="picker-bg">-->
<!-- <view class="picker">--> <!-- <view class="picker">-->
<!-- <uni-icons custom-prefix="iconfont" color="#ffffff" type="icon-phoneshizhong"--> <!-- <uni-icons custom-prefix="iconfont" color="#ffffff" type="icon-phoneshizhong"-->
<!-- size="18"></uni-icons>--> <!-- size="18"></uni-icons>-->
<!-- <view>{{ defaultDate }}</view>--> <!-- <view>{{ defaultDate }}</view>-->
<!-- <uni-icons type="down" size="18"></uni-icons>--> <!-- <uni-icons type="down" size="18"></uni-icons>-->
<!-- </view>--> <!-- </view>-->
<!-- </picker>--> <!-- </picker>-->
<!-- <button type="default" @click="handleSearch" size="mini" class="btn-search">查询</button>--> <!-- <button type="default" @click="handleSearch" size="mini" class="btn-search">查询</button>-->
<!-- </view>--> <!-- </view>-->
<!-- 分页部分 --> <!-- 分页部分 -->
<view class="white-bg margin-bottom20" v-for="(item, index) in list"> <view class="white-bg margin-bottom20" v-for="(item, index) in list">
<view class="report-list" > <view class="report-list">
<view class="title" <view class="title"
:style="{color: item.mapType == 1 ? '#F5813A' : '#1989FA'}" :style="{color: MapType[item.mapType].color}"
>类型{{ item.mapType == 1 ? '签到' : '打卡' }}</view> >类型{{ MapType[item.mapType].label }}
</view><!--item.mapType == 1 ? '#F5813A' : '#1989FA'}-->
<view class="r-list"> <view class="r-list">
<view class="r-left">开始签到时间</view> <view class="r-left">开始签到时间</view>
<view class="r-right">{{ item.goVisistStartTime }}</view> <view class="r-right">{{ item.goVisistStartTime }}</view>
@@ -61,11 +62,12 @@
<script setup> <script setup>
import customHeader from '@/components/customHeader.vue' import customHeader from '@/components/customHeader.vue'
import { getNavBarPaddingTop } from '@/utils/system.js' import {getNavBarPaddingTop} from '@/utils/system.js'
import { onMounted, ref } from 'vue'; import {onMounted, ref} from 'vue';
import { getDate } from '@/utils/datetime.js' import {getDate} from '@/utils/datetime.js'
import { CheckInInformationViewing } from '../../../../api/crm/activity/map'; import {CheckInInformationViewing} from '../../../../api/crm/activity/map';
import { onLoad } from '@dcloudio/uni-app'; import {onLoad} from '@dcloudio/uni-app';
import {MapType} from "./dataMap";
const navBarPaddingTop = ref(0); const navBarPaddingTop = ref(0);
onMounted(() => { onMounted(() => {
@@ -76,13 +78,14 @@ onMounted(() => {
let startDate = getDate('start'); let startDate = getDate('start');
// 结束时间间隔10年 // 结束时间间隔10年
let endDate = getDate('end'); let endDate = getDate('end');
let defaultDate = getDate({ format: true }) let defaultDate = getDate({format: true})
let bindDateChange = (e) => { let bindDateChange = (e) => {
defaultDate = e.detail.value defaultDate = e.detail.value
} }
//获取list集合信息 //获取list集合信息
let list = ref([]) let list = ref([])
function getList() { function getList() {
CheckInInformationViewing().then(res => { CheckInInformationViewing().then(res => {
list.value = res.rows list.value = res.rows
@@ -93,13 +96,17 @@ onLoad(() => {
getList() getList()
}) })
</script> </script>
<style scoped> <style scoped>
.r-left {
min-width: 6em;
}
.con-bg {
overflow-y: auto;
}
.search { .search {
display: flex; display: flex;
margin-bottom: 30rpx; margin-bottom: 30rpx;

View File

@@ -0,0 +1,9 @@
/**
* 签到/打卡/出差
* @type {{"1": {label: 签到, bgc: string}, "2": {label: 打卡, bgc: string}, "3": {label: 出差, bgc: string}}}
*/
export const MapType = {
'1': {label:'签到', color:'#F5813A'},
'2': {label:'打卡', color:'#1989FA'},
'3': {label:'出差', color:'#42b883'}
}

View File

@@ -131,10 +131,7 @@ const handleCancel = () => {
businessTripClockIn(form).then(res=>{ businessTripClockIn(form).then(res=>{
feedback(res,()=>console.log('出差打卡成功')); feedback(res,()=>console.log('出差打卡成功'));
}).catch(e=>{ }).catch(e=>{
uni.showToast({ console.log(e);
icon: 'none',
title: e
})
}) })
} }
// 打卡 // 打卡
@@ -142,13 +139,8 @@ let handleConfirm = () => {
addStartMapForClockIn(form).then(res=>{ addStartMapForClockIn(form).then(res=>{
feedback(res, ()=>console.log('打卡成功')); feedback(res, ()=>console.log('打卡成功'));
}).catch(e=>{ }).catch(e=>{
uni.showToast({ console.log(e)
icon: 'none',
title: e
}) })
})
} }
// 判定是否在范围内 // 判定是否在范围内