Commit ec4b72d6 by 李伟康

```

feat(common): 新增检查今日是否在T1-T5之间的API方法

新增 checkTodayInT1T5 方法用于检查今天是否在T1-T5之间,
提供 dj.api.staff.miniprogram.salaryapply.daily.report.fill.check 接口支持

fix(Point): 调整组件样式并移除收入选项卡

将样式单位从rpx转换为toRpx函数以支持更好的适配,
同时移除了收入相关的选项卡功能
```
1 parent 9dbc508d
...@@ -602,4 +602,15 @@ module.exports = { ...@@ -602,4 +602,15 @@ module.exports = {
...data, ...data,
}) })
}, },
/**
* 检查今天是否在T1-T5之间
*/
checkTodayInT1T5(data={}) {
return http.post({
method: 'dj.api.staff.miniprogram.salaryapply.daily.report.fill.check',
projectName: 'staffMiniprogram',
...data,
})
},
} }
<!-- <!--
* @Author: 前端 qianduan01@didihu.com.cn * @Author: 前端 qianduan01@didihu.com.cn
* @Date: 2024-12-31 16:53:31 * @Date: 2024-12-31 16:53:31
* @LastEditors: 前端 qianduan01@didihu.com.cn * @LastEditors: 前端 qianduan01@didihu.com.cn
* @LastEditTime: 2025-01-17 21:26:09 * @LastEditTime: 2025-01-17 21:26:09
* @FilePath: \gl-tape\components\HomeFrame\components\Point.vue * @FilePath: \gl-tape\components\HomeFrame\components\Point.vue
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
--> -->
<template> <template>
<view class="point-container"> <view class="point-container">
<view class="tab-box"> <view class="tab-box">
<view @click="selectTab(index)" :class="{ 'tab-item': true, active: activeIndex == index }" v-for="(i, index) in tabList" :key="index">{{ i.name }}</view> <view @click="selectTab(index)" :class="{ 'tab-item': true, active: activeIndex == index }" v-for="(i, index) in tabList" :key="index">{{ i.name }}</view>
</view> </view>
<component :is="tabName" ref="centerRef" @selectTab="selectTab"></component> <component :is="tabName" ref="centerRef" @selectTab="selectTab"></component>
</view> </view>
</template> </template>
<script type="text/ecmascript-6"> <script type="text/ecmascript-6">
import Point from './Point/index.vue' import Point from './Point/index.vue'
import Income from './Income/index.vue' import Income from './Income/index.vue'
import Attendance from './Attendance/index.vue' import Attendance from './Attendance/index.vue'
import { mapState } from 'vuex' import { mapState } from 'vuex'
export default { export default {
name: '', name: '',
components: { components: {
Point, Point,
Income, Income,
Attendance Attendance
}, },
data () { data () {
return { return {
activeIndex: 0, activeIndex: 0,
componentList:['Attendance','Income'], componentList:['Attendance','Income'],
tabName: 'Attendance', tabName: 'Attendance',
tabList:[ tabList:[
// { {
// name:'我的积分', name:'我的考勤',
// }, },
{ ]
name:'我的考勤', }
}, },
{ computed: {
name:'我的收入', ...mapState(['point.tabIndex']),
} },
] watch: {
} '$store.state.point.tabIndex'(val) {
}, console.log(val)
computed: { this.activeIndex = val
...mapState(['point.tabIndex']), this.tabName = this.componentList[val]
}, }
watch: { },
'$store.state.point.tabIndex'(val) { mounted() {
console.log(val) this.$store.dispatch('setTab', 0)
this.activeIndex = val },
this.tabName = this.componentList[val] methods: {
} selectTab(index){
}, this.$store.dispatch('setTab', index)
mounted() { }
this.$store.dispatch('setTab', 0) },
}, }
methods: { </script>
selectTab(index){ <style scoped lang="scss">
this.$store.dispatch('setTab', index) .tab-box {
} margin-top: toRpx(68);
}, width: toRpx(290);
} height: toRpx(84);
</script> line-height: toRpx(74);
<style scoped lang="scss"> background: rgba(101, 171, 250, 0.12);
.tab-box { border-radius: toRpx(20);
margin-top: 68rpx; display: flex;
width: 550rpx; align-items: center;
height: 84rpx; justify-content: center;
line-height: 74rpx; .tab-item {
background: rgba(101, 171, 250, 0.12); font-size: toRpx(28);
border-radius: 20rpx; color: #1a1a1a;
display: flex; text-align: center;
align-items: center; width: 50%;
justify-content: center; &.active {
.tab-item { width: toRpx(260);
font-size: 28rpx; height: toRpx(72);
color: #1a1a1a; background: #ffffff;
text-align: center; border-radius: toRpx(16);
width: 50%; text-align: center;
&.active { font-weight: 600;
width: 260rpx; color: #4673ff;
height: 72rpx; }
background: #ffffff; }
border-radius: 16rpx; }
text-align: center; </style>
font-weight: 600;
color: #4673ff;
}
}
}
</style>
...@@ -229,7 +229,7 @@ ...@@ -229,7 +229,7 @@
src="../../../../assets/images/common/report-no-data.webp" src="../../../../assets/images/common/report-no-data.webp"
class="icon" class="icon"
/> />
已超过 7 个自然日,暂不支持补填操作 暂不支持补填操作
</view> </view>
</template> </template>
</template> </template>
...@@ -377,6 +377,7 @@ export default { ...@@ -377,6 +377,7 @@ export default {
]), ]),
weeklyList: [], weeklyList: [],
isEditReport: false, isEditReport: false,
editableDay: null
} }
}, },
computed: { computed: {
...@@ -503,8 +504,9 @@ export default { ...@@ -503,8 +504,9 @@ export default {
this.isEditReport = false this.isEditReport = false
}, },
methods: { methods: {
initData () { async initData () {
const { merchantId, merchantName, name, uuid, shopMerchantId, shopMerchantName } = this.userInfo let inT1T5 = await uni.$api.commonApi.checkTodayInT1T5(),
{ merchantId, merchantName, name, uuid, shopMerchantId, shopMerchantName } = this.userInfo
this.orderObj = { this.orderObj = {
yqMerchantId: merchantId, yqMerchantId: merchantId,
yqMerchantName: merchantName, yqMerchantName: merchantName,
...@@ -513,6 +515,7 @@ export default { ...@@ -513,6 +515,7 @@ export default {
merchantId: shopMerchantId, merchantId: shopMerchantId,
merchantName: shopMerchantName merchantName: shopMerchantName
} }
if (inT1T5) this.editableDay = dayjs().subtract(1, 'M').startOf('M')
this.getDailyReportCarBrand() this.getDailyReportCarBrand()
}, },
async getDailyReportCarBrand () { async getDailyReportCarBrand () {
...@@ -598,7 +601,9 @@ export default { ...@@ -598,7 +601,9 @@ export default {
carBandList, carBandList,
hwOhterObjArray, hwOhterObjArray,
orderObj, orderObj,
isHmStore } = this, isHmStore,
editableDay
} = this,
{ shopMerchantId, merchantId, uuid } = userInfo { shopMerchantId, merchantId, uuid } = userInfo
uni.showLoading({ uni.showLoading({
mask: true mask: true
...@@ -654,14 +659,15 @@ export default { ...@@ -654,14 +659,15 @@ export default {
return item return item
}) })
} }
let diffDay = dayjs().diff(dayjs(currentDate), 'day') let diffDay = dayjs().diff(dayjs(currentDate), 'day'),
disabledReport = false
if (editableDay && editableDay.diff(dayjs(currentDate), 'day') > 0) disabledReport = true
this.hwOhterObjArray = hwOhterObjArray this.hwOhterObjArray = hwOhterObjArray
this.carBandList = carBandList this.carBandList = carBandList
this.orderObj = { this.orderObj = {
...orderObj, ...orderObj,
reportDate: currentDate, reportDate: currentDate,
isDateWithin7Days: diffDay < 7, isDateWithin7Days:editableDay ? !disabledReport : diffDay < 7,
isDateWithin60Days: diffDay < 60,
remark, remark,
lastStaffName: data.lastStaffName, lastStaffName: data.lastStaffName,
lastStaffUuid: data.lastStaffUuid, lastStaffUuid: data.lastStaffUuid,
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!