Commit d03fee46 by 胡悦

修改我的考勤和我的收入

1 parent 26e63ce0

2.43 MB | W: | H:

2.43 MB | W: | H:

assets/images/sprite.png
assets/images/sprite.png
assets/images/sprite.png
assets/images/sprite.png
  • 2-up
  • Swipe
  • Onion skin
...@@ -3,6 +3,7 @@ ...@@ -3,6 +3,7 @@
<view class="calendar-box"> <view class="calendar-box">
<view class="calendar-years"> <view class="calendar-years">
<view class="calendar-year">{{ currentInfo.year }}年{{ currentInfo.month }}月</view> <view class="calendar-year">{{ currentInfo.year }}年{{ currentInfo.month }}月</view>
<view class="appeal-record" @click="switchMonth"><view class="sprite-icon icon-calendar"></view>{{ currentInfo.month == defaultMonth ? '上个月' : '当前月'}}</view>
<!-- <view class="appeal-record" @click="viewAppeal"> <!-- <view class="appeal-record" @click="viewAppeal">
<view class="sprite-icon icon-appeal-record"></view>考勤申诉记录 <view class="sprite-icon icon-appeal-record"></view>考勤申诉记录
</view> --> </view> -->
...@@ -19,8 +20,8 @@ ...@@ -19,8 +20,8 @@
<view @click="openDetail(date)"> <view @click="openDetail(date)">
<view v-if="date.dayState != 1" :class="getTagClass(date)"> <view v-if="date.dayState != 1" :class="getTagClass(date)">
{{ DAY_STATE[date.dayState] }}</view> {{ DAY_STATE[date.dayState] }}</view>
<view class="date-num" v-if="date.day != currentInfo.day">{{ date.day || '' }}</view> <view class="current-date" v-if="currentInfo.month == defaultMonth && date.day == currentInfo.day">今</view>
<view class="current-date" v-else>今</view> <view class="date-num" v-else>{{ date.day || '' }}</view>
<template v-if="!date.isDefault"> <template v-if="!date.isDefault">
<view <view
:class="['date-desc first-child', date.clockInState != 0 || date.clockInAbnormalAttire ? 'date-red' : '']"> :class="['date-desc first-child', date.clockInState != 0 || date.clockInAbnormalAttire ? 'date-red' : '']">
...@@ -78,6 +79,7 @@ export default { ...@@ -78,6 +79,7 @@ export default {
month: new Date().getMonth() + 1, month: new Date().getMonth() + 1,
day: new Date().getDate() day: new Date().getDate()
}, },
defaultMonth: new Date().getMonth() + 1,
selectInfo: { selectInfo: {
year: new Date().getFullYear(), year: new Date().getFullYear(),
month: new Date().getMonth() + 1, month: new Date().getMonth() + 1,
...@@ -92,7 +94,9 @@ export default { ...@@ -92,7 +94,9 @@ export default {
// 获取当前日期 // 获取当前日期
const now = new Date(); const now = new Date();
const year = now.getFullYear(); const year = now.getFullYear();
const month = now.getMonth(); // const month = now.getMonth();
// 需求添加切换月份,月份从currentInfo中获取
const month = this.currentInfo.month - 1
// 获取当月第一天是星期几,注意 getDay() 返回值 0 代表周日,1 - 6 代表周一到周六 // 获取当月第一天是星期几,注意 getDay() 返回值 0 代表周日,1 - 6 代表周一到周六
const firstDayOfMonth = new Date(year, month, 1); const firstDayOfMonth = new Date(year, month, 1);
const firstDayWeekday = firstDayOfMonth.getDay(); const firstDayWeekday = firstDayOfMonth.getDay();
...@@ -166,9 +170,9 @@ export default { ...@@ -166,9 +170,9 @@ export default {
// 获取当前日期对象 // 获取当前日期对象
const now = new Date(); const now = new Date();
// 当月第一天 // 当月第一天
const firstDay = dayjs(new Date(now.getFullYear(), now.getMonth(), 1)).format('YYYY-MM-DD'); const firstDay = dayjs(new Date(this.currentInfo.year, this.currentInfo.month - 1, 1)).format('YYYY-MM-DD');
// 当月最后一天 // 当月最后一天
const lastDay = dayjs(new Date(now.getFullYear(), now.getMonth() + 1, 0)).format('YYYY-MM-DD'); const lastDay = dayjs(new Date(this.currentInfo.year, this.currentInfo.month, 0)).format('YYYY-MM-DD');
return { return {
startTime: firstDay + ' 00:00:00', startTime: firstDay + ' 00:00:00',
endTime: lastDay + ' 23:59:59', endTime: lastDay + ' 23:59:59',
...@@ -183,7 +187,7 @@ export default { ...@@ -183,7 +187,7 @@ export default {
console.log(this.dates, 'dates') console.log(this.dates, 'dates')
this.dates.forEach(item => { this.dates.forEach(item => {
const clockData = res.clockInDateList.find(i => i.day == item) const clockData = res.clockInDateList.find(i => i.day == item)
if (clockData && clockData.day < this.currentInfo.day) { if (clockData && (this.currentInfo.month < this.defaultMonth || clockData.day < this.currentInfo.day)) {
if (clockData.dayState == 4) clockData.isDefault = true if (clockData.dayState == 4) clockData.isDefault = true
clockData.clockInTime1 = clockData.clockInTime ? dayjs(new Date(clockData.clockInTime)).format('HH:mm') : null clockData.clockInTime1 = clockData.clockInTime ? dayjs(new Date(clockData.clockInTime)).format('HH:mm') : null
clockData.clockOutTime1 = clockData.clockOutTime ? dayjs(new Date(clockData.clockOutTime)).format('HH:mm') : null clockData.clockOutTime1 = clockData.clockOutTime ? dayjs(new Date(clockData.clockOutTime)).format('HH:mm') : null
...@@ -208,7 +212,18 @@ export default { ...@@ -208,7 +212,18 @@ export default {
console.log(res) console.log(res)
this.recordList = res.list this.recordList = res.list
}, },
// 切换月份
switchMonth() {
if (this.currentInfo.month == this.defaultMonth) {
// 切换上个月
this.currentInfo.month = new Date().getMonth()
this.init()
} else {
// 切换当前月
this.currentInfo.month = new Date().getMonth() + 1
this.init()
}
}
} }
} }
</script> </script>
...@@ -221,7 +236,7 @@ export default { ...@@ -221,7 +236,7 @@ export default {
height: calc(100vh - #{toRpx(276)}); height: calc(100vh - #{toRpx(276)});
border: toRpx(4) solid #fff; border: toRpx(4) solid #fff;
background: #f2f7ff; background: #f2f7ff;
box-shadow: inset 0 4px 8px 0 #ffffff80; box-shadow: inset 0 toRpx(4) toRpx(8) 0 #ffffff80;
border-radius: toRpx(48); border-radius: toRpx(48);
margin-top: toRpx(38); margin-top: toRpx(38);
...@@ -244,7 +259,8 @@ export default { ...@@ -244,7 +259,8 @@ export default {
border-radius: toRpx(16); border-radius: toRpx(16);
line-height: toRpx(64); line-height: toRpx(64);
.icon-appeal-record { .icon-appeal-record,
.icon-calendar {
margin-right: toRpx(8); margin-right: toRpx(8);
} }
} }
......
...@@ -33,14 +33,14 @@ ...@@ -33,14 +33,14 @@
<view class="empty-text">暂无记录</view> <view class="empty-text">暂无记录</view>
</view> </view>
</view> </view>
<view class="tips-footer"> <!-- <view class="tips-footer">
<view class="tips-btn" @click="IncomeCal"> <view class="tips-btn" @click="IncomeCal">
<text>收入测算</text> <text>收入测算</text>
<view class="tip-img"> <view class="tip-img">
<view class="sprite-icon icon-btn-tips"></view> <view class="sprite-icon icon-btn-tips"></view>
</view> </view>
</view> </view>
</view> </view> -->
<Dailog @close="closeCalDaliog" v-if="calDaliog" width="1600rpx" title="职级晋升、渗透率提升后收入测算"> <Dailog @close="closeCalDaliog" v-if="calDaliog" width="1600rpx" title="职级晋升、渗透率提升后收入测算">
<view class="dailog-body" slot="content"> <view class="dailog-body" slot="content">
<view :class="{ 'input-box select-container': true, row_2: form.sceneType === '0' }"> <view :class="{ 'input-box select-container': true, row_2: form.sceneType === '0' }">
...@@ -519,7 +519,7 @@ export default { ...@@ -519,7 +519,7 @@ export default {
} }
.tips-body { .tips-body {
height: calc(100vh - 540rpx); height: calc(100vh - 420rpx);
overflow-y: auto; overflow-y: auto;
overflow-x: hidden; overflow-x: hidden;
.empty-box { .empty-box {
......
...@@ -115,6 +115,7 @@ ...@@ -115,6 +115,7 @@
</template> </template>
<script> <script>
import dayjs from 'dayjs'
import Detail from './Detail' import Detail from './Detail'
import point from '@/mixin/point' import point from '@/mixin/point'
import Dailog from './Dailog.vue' import Dailog from './Dailog.vue'
...@@ -168,7 +169,8 @@ export default { ...@@ -168,7 +169,8 @@ export default {
monthStr: '', monthStr: '',
canPersent: [], //百分比数组 canPersent: [], //百分比数组
listIndex: 0 listIndex: 0,
basicSalary: {}
} }
}, },
mounted() { mounted() {
...@@ -183,6 +185,56 @@ export default { ...@@ -183,6 +185,56 @@ export default {
// this.showChart() // this.showChart()
}) })
.exec() .exec()
setTimeout(() => {
const _basicSalary = {
confirmSalary: true,
basicSalary: 3000,
performanceSalary: 1000,
actualBasicSalary: 3500,
shouldWorkDay: 26,
actualWorkDay: 10,
actualPerformanceSalary: 1500,
performanceSalaryConfigItemList: [
{
assessmentType: 1,
minAssessmentValue: 0,
maxAssessmentValue: 20,
performanceSalarDeductionRatio: 10
},
{
assessmentType: 1,
minAssessmentValue: 24,
maxAssessmentValue: 26,
performanceSalarDeductionRatio: 50
},
{
assessmentType: 1,
minAssessmentValue: 23,
maxAssessmentValue: 26,
performanceSalarDeductionRatio: 60
},
{
assessmentType: 1,
minAssessmentValue: 22,
maxAssessmentValue: 26,
performanceSalarDeductionRatio: 60
},
{
assessmentType: 1,
minAssessmentValue: 21,
maxAssessmentValue: 26,
performanceSalarDeductionRatio: 100
},
{
assessmentType: 2,
minAssessmentValue: 0,
maxAssessmentValue: 20,
performanceSalarDeductionRatio: 100
}
]
}
this.basicSalary = _basicSalary
}, 100)
}, },
methods: { methods: {
isShow(key) { isShow(key) {
...@@ -282,7 +334,18 @@ export default { ...@@ -282,7 +334,18 @@ export default {
* @param {Object} item - 点击的tips对象 * @param {Object} item - 点击的tips对象
*/ */
clickTips(item) { clickTips(item) {
console.log(this.basicSalary, 'basicSalary=======')
if (item.label == '基本工资') {
this.tipsDetail = Object.assign(item, this.basicSalary)
console.log(dayjs(new Date()).daysInMonth())
// 应出勤天数tips
const month = dayjs(new Date()).daysInMonth()
this.tipsDetail.basicList[1].tips = `(本月${month} - ${month-this.basicSalary.shouldWorkDay})`
// 实际出勤天数tips
this.tipsDetail.basicList[2].tips = `(截至${dayjs().subtract(1, 'day').format('YYYY-MM-DD')})`
} else {
this.tipsDetail = item this.tipsDetail = item
}
this.tipsShow = true this.tipsShow = true
}, },
showBaseDetail(item) { showBaseDetail(item) {
......
...@@ -116,6 +116,7 @@ ...@@ -116,6 +116,7 @@
</template> </template>
<script> <script>
import dayjs from 'dayjs'
import Detail from './Detail' import Detail from './Detail'
import baseDialog from './baseDialog' import baseDialog from './baseDialog'
import baseDetail from './baseDetail' import baseDetail from './baseDetail'
...@@ -214,11 +215,62 @@ export default { ...@@ -214,11 +215,62 @@ export default {
list: [], list: [],
show: false, show: false,
calDaliog: false, calDaliog: false,
caseList: [] caseList: [],
basicSalary: {}
} }
}, },
mounted() { mounted() {
this.outputList = this.outputList.filter(i => i.value == 0) this.outputList = this.outputList.filter(i => i.value == 0)
setTimeout(() => {
const _basicSalary = {
confirmSalary: false,
basicSalary: 3000,
performanceSalary: 1000,
actualBasicSalary: 3500,
shouldWorkDay: 26,
actualWorkDay: 10,
actualPerformanceSalary: 1500,
performanceSalaryConfigItemList: [
{
assessmentType: 1,
minAssessmentValue: 0,
maxAssessmentValue: 20,
performanceSalarDeductionRatio: 10
},
{
assessmentType: 1,
minAssessmentValue: 24,
maxAssessmentValue: 26,
performanceSalarDeductionRatio: 50
},
{
assessmentType: 1,
minAssessmentValue: 23,
maxAssessmentValue: 26,
performanceSalarDeductionRatio: 60
},
{
assessmentType: 1,
minAssessmentValue: 22,
maxAssessmentValue: 26,
performanceSalarDeductionRatio: 60
},
{
assessmentType: 1,
minAssessmentValue: 21,
maxAssessmentValue: 26,
performanceSalarDeductionRatio: 100
},
{
assessmentType: 2,
minAssessmentValue: 0,
maxAssessmentValue: 20,
performanceSalarDeductionRatio: 100
}
]
}
this.basicSalary = _basicSalary
}, 100)
}, },
watch: { watch: {
'form.merchantId'(val) { 'form.merchantId'(val) {
...@@ -319,7 +371,18 @@ export default { ...@@ -319,7 +371,18 @@ export default {
console.log(this.commissionsInfo, 'this.commissionsInfoQG', this.commissionsInfoQG) console.log(this.commissionsInfo, 'this.commissionsInfoQG', this.commissionsInfoQG)
}, },
clickTips(item) { clickTips(item) {
console.log(this.basicSalary, 'basicSalary=======')
if (item.label == '基本工资') {
this.tipsDetail = Object.assign(item, this.basicSalary)
console.log(dayjs(new Date()).daysInMonth())
// 应出勤天数tips
const month = dayjs(new Date()).daysInMonth()
this.tipsDetail.basicList[1].tips = `(本月${month} - ${month-this.basicSalary.shouldWorkDay})`
// 实际出勤天数tips
this.tipsDetail.basicList[2].tips = `(截至${dayjs().subtract(1, 'day').format('YYYY-MM-DD')})`
} else {
this.tipsDetail = item this.tipsDetail = item
}
this.tipsShow = true this.tipsShow = true
}, },
showTips() { showTips() {
......
...@@ -8,6 +8,47 @@ ...@@ -8,6 +8,47 @@
--> -->
<template> <template>
<Tips @close="close" v-if="show" width="1288rpx" :title="detail.label"> <Tips @close="close" v-if="show" width="1288rpx" :title="detail.label">
<template v-if="detail.customize">
<template v-if="detail.label == '基本工资'">
<view class="basic-body" slot="content">
<view class="basic-content">
<view class="basic-item">{{ detail.content }}</view>
<view class="basic-item" v-for="(item, index) in detail.basicList" :key="index">
<view>{{ item.label }}</view>
<view class="basic-right">
<view class="tips">{{ item.tips }}</view>
<view class="value">
<template v-if="!detail.confirmSalary">
{{ detail[item.prop] }}{{ item.unit }}
</template>
<template v-else>
{{ item.actualProp ? detail[item.actualProp] : detail[item.prop] }}{{ item.unit }}
</template>
</view>
</view>
</view>
</view>
<view class="basic-item performance">
<view>{{ detail.performance.label }}</view>
<view class="basic-right">
<view class="tips">{{ detail.confirmSalary ? '' : '未核算' }}</view>
<view class="value">{{ detail.confirmSalary ? detail.actualPerformanceSalary : detail.performanceSalary }}</view>
</view>
</view>
<ul class="basic-ul">
<li v-for="(i, ind) in detail.performanceSalaryConfigItemList" :key="ind">
<template v-if="i.assessmentType == 1">
月产值=0,且考勤 {{ i.minAssessmentValue ? i.minAssessmentValue : '' }} ≦ {{ i.maxAssessmentValue ? i.maxAssessmentValue : '' }} 绩效工资{{ i.performanceSalarDeductionRatio < 100 ? `扣减${i.performanceSalarDeductionRatio}%` : '不扣减' }}
</template>
<template v-if="i.assessmentType == 2">
月产值≠0,月度触客总数(含售前+售后触客){{ i.minAssessmentValue ? i.minAssessmentValue : '' }} ≦ {{ i.maxAssessmentValue ? i.maxAssessmentValue : '' }} 台,则绩效工资{{ i.performanceSalarDeductionRatio < 100 ? `扣减${i.performanceSalarDeductionRatio}%` : '不扣减' }}
</template>
</li>
</ul>
</view>
</template>
</template>
<template v-else>
<view class="dailog-body" slot="content"> <view class="dailog-body" slot="content">
<view class="dailog-content">{{ detail.content }}</view> <view class="dailog-content">{{ detail.content }}</view>
<view class="dailog-content" v-if="detail.subContent">{{ detail.subContent }}</view> <view class="dailog-content" v-if="detail.subContent">{{ detail.subContent }}</view>
...@@ -19,6 +60,7 @@ ...@@ -19,6 +60,7 @@
</view> </view>
<view class="dailog-desc" v-if="detail.desc">{{ detail.desc }}</view> <view class="dailog-desc" v-if="detail.desc">{{ detail.desc }}</view>
</view> </view>
</template>
</Tips> </Tips>
</template> </template>
...@@ -83,4 +125,51 @@ export default { ...@@ -83,4 +125,51 @@ export default {
margin-top: 32rpx; margin-top: 32rpx;
} }
} }
.basic-body {
padding: 0 toRpx(180);
.basic-content {
border-radius: toRpx(24);
background: #fafafa;
padding: toRpx(20) toRpx(36);
font-size: toRpx(26);
}
.basic-item {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: toRpx(18);
&.performance {
padding: toRpx(20) toRpx(36);
margin-bottom: 0;
}
&:last-child {
margin-bottom: 0;
}
.basic-right {
display: flex;
align-items: center;
.tips {
color: #808291;
margin-right: toRpx(20);
}
.value {
color: #1A1A1A;
}
}
}
.basic-ul {
color: #ADB0B8;
font-size: toRpx(24);
padding-right: toRpx(36);
padding-left: toRpx(64);
max-height: toRpx(224);
overflow-y: auto;
li {
margin-bottom: toRpx(12);
&:last-child {
margin-bottom: 0;
}
}
}
}
</style> </style>
...@@ -30,15 +30,19 @@ export default { ...@@ -30,15 +30,19 @@ export default {
data () { data () {
return { return {
activeIndex: 0, activeIndex: 0,
componentList:['Point','Income', 'Attendance'], componentList:['Attendance','Income'],
tabName: 'Point', tabName: 'Attendance',
tabList:[{ tabList:[
name:'我的积分', // {
},{ // name:'我的积分',
name:'我的收入', // },
},{ {
name:'我的考勤', name:'我的考勤',
}] },
{
name:'我的收入',
}
]
} }
}, },
computed: { computed: {
......
...@@ -6,12 +6,39 @@ export default { ...@@ -6,12 +6,39 @@ export default {
{ {
label: '基本工资', label: '基本工资',
icon: 'jbgz-icon', icon: 'jbgz-icon',
content: '基本工资 = 职级工资÷应出勤天数×实际出勤天数', content: '实发底薪=应发底薪÷应出勤天数x实际出勤天数',
value: 'actualBasicSalary', value: 'actualBasicSalary',
recordKey: 'refundOffsetRecords', recordKey: 'refundOffsetRecords',
showNext: true, showNext: true,
sort: 1, sort: 1,
base: true base: true,
customize: true,
basicList: [
{
label: '应发底薪',
tips: '',
prop: 'basicSalary',
actualProp: 'actualBasicSalary',
value: 3000
},
{
label: '应出勤天数',
value: 27,
prop: 'shouldWorkDay',
unit: '天'
},
{
label: '实际出勤天数',
value: 22,
prop: 'actualWorkDay',
unit: '天'
}
],
performance: {
label: '绩效工资',
prop: 'performanceSalary',
actualProp: 'actualPerformanceSalary',
},
}, },
{ {
label: '退单冲减', label: '退单冲减',
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!