Commit 22f08e1f by zhangxw

修改

1 parent 8f64803d
......@@ -75,24 +75,11 @@ Page({
},
// t1时间段内可编辑上月绩效
isExpired(endDateStr) {
const { pageQuery } = this.data
const now = new Date()
const endDate = new Date(endDateStr)
if (now > endDate) {
return true
}
const currentYear = now.getFullYear()
const currentMonth = now.getMonth()
let lastYear, lastMonth;
if (currentMonth === 0) {
lastYear = currentYear - 1
lastMonth = 12
} else {
lastYear = currentYear
lastMonth = currentMonth
}
const lastMonthStr = `${lastYear}-${String(lastMonth).padStart(2, '0')}`
return pageQuery.queryMonth !== lastMonthStr
},
getCycleTime() {
......@@ -150,7 +137,7 @@ Page({
info: {
...data,
entryDate: data?.entryDate ? dayjs(data?.entryDate).format('YYYY-MM-DD') : '',
adoptType: data?.isAutoPerformance == 0 || !data?.isAutoPerformance ? 2 : data?.adoptType
adoptType: data?.isAutoPerformance == 0 || !data?.isAutoPerformance ? 2 : data?.adoptType,
},
autoInfo: {
levelCode: data?.autoGradeCode,
......@@ -301,6 +288,13 @@ Page({
this.setData({
'info.adoptType': value
})
if (value == 1) {
const computedValue = NP.round(NP.times(NP.times(info.afterAttendanceTotalBasicSalary, 0.3), info.autoRewardCoefficient), 2)
this.setData({
'info.performanceSalary': computedValue,
'info.basicSalary': NP.plus(computedValue, info.baseSalary)
})
}
},
// 提交
......
......@@ -166,6 +166,7 @@ Page({
this.getRule()
this.search()
this.getStatics()
this.isHistoryMonth()
})
}
this.closeMonthPicker()
......@@ -216,13 +217,9 @@ Page({
}
})
},
isExpired(endDateStr) {
const { monthPickerValue } = this.data
isHistoryMonth() {
const now = new Date()
const endDate = new Date(endDateStr)
if (now > endDate) {
return true
}
const { monthPickerValue } = this.data
const currentYear = now.getFullYear()
const currentMonth = now.getMonth()
let lastYear, lastMonth;
......@@ -234,8 +231,18 @@ Page({
lastMonth = currentMonth
}
const lastMonthStr = `${lastYear}-${String(lastMonth).padStart(2, '0')}`
this.setData({
isHistoryMonthFlag: dayjs(monthPickerValue).format('YYYY-MM') !== lastMonthStr
})
return dayjs(monthPickerValue).format('YYYY-MM') !== lastMonthStr
},
isExpired(endDateStr) {
const now = new Date()
const endDate = new Date(endDateStr)
if (now > endDate) {
return true
}
},
// 批量操作
handleBatch() {
let {monthPickerValue} = this.data
......@@ -245,7 +252,7 @@ Page({
let { code, data, message } = res
if (code == 0) {
const T1EndDate = data?.find(val => val.cycleCode == 'T1')?.endDate
if (this.isExpired(T1EndDate)) {
if (this.isExpired(T1EndDate) || this.isHistoryMonth()) {
return wx.showModal({
title: '提示',
content: '亲,记得在运营配置的T1日前来评绩效哦',
......
......@@ -108,7 +108,7 @@
</view>
<view class="btn-box flex">
<view bindtap="handleDetail" data-target="{{item}}" class="btn">查看</view>
<view bindtap="handleEdit" data-target="{{item}}" class="btn primary">编辑{{(2 - item.submitCount)}}/2</view>
<view bindtap="handleEdit" data-target="{{item}}" wx:if="{{!isHistoryMonthFlag}}" class="btn primary">编辑{{(2 - item.submitCount)}}/2</view>
</view>
</view>
</block>
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!