Commit 5637c169 by 张立顺

fix 需求评审功能修改

1 parent 799a320b
......@@ -513,5 +513,18 @@ module.exports = {
'dj.api.smartcarlife.goodsOrder.abnormalOrder.lock.select',
{}
)
},
// http://localhost:8081/rop-dj-riskmanage/router//dj.api.staff.miniprogram.salaryapply.daily.report.fill.check/1.0.0
// 检查今天是否在T1-T5之间
salaryapplyFillCheck(data) {
return api.post(
'dj.api.staff.miniprogram.salaryapply.daily.report.fill.check',
data,
[],
'/rop-dj-staff-miniprogram/router'
)
// return api.post(
// 'dj.api.staff.miniprogram.salaryapply.daily.report.fill.check'
// )
}
}
......@@ -61,13 +61,16 @@ var filterTemplateList = function (arr, value) {
}
}
var filterDisabled = function (role, weeklyList, date, disabledStatus) {
var filterDisabled = function (role, weeklyList, date, disabledStatus, isDynamicDateWithinRange) {
// console.log(role, weeklyList)
if (role == 'staff') {
// 员工七天内可操作
var isWithin =
isDynamicDateWithinRange !== undefined
? isDynamicDateWithinRange
: isDateWithin7Days(date)
return (
(weeklyList.indexOf(date) > -1 && !disabledStatus) ||
!isDateWithin7Days(date)
(weeklyList.indexOf(date) > -1 && !disabledStatus) || !isWithin
)
} else if (role == 'super') {
// 超管60天内可操作
......
......@@ -229,13 +229,19 @@ function getWeeksDiff(startDate, endDate) {
return weeksDiff
}
function isDateWithin7Days(date) {
console.log(date, 'isDateWithin7Daysdate')
// console.log(date, 'date');
function isDateWithin7Days(date, limitDate) {
// console.log(date, 'isDateWithin7Daysdate')
const oneDay = 24 * 60 * 60 * 1000 // 一天的毫秒数
const currentDate = new Date() // 当前日期
const targetDate = new Date(date) // 给定的日期
// 如果传了限制时间,则使用限制时间判断
if (limitDate) {
const limit = new Date(limitDate)
// 比较时间戳
return targetDate.getTime() >= limit.getTime()
}
// 计算给定日期与当前日期的时间差(以毫秒为单位)
const diffMilliseconds = targetDate - currentDate
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!