Commit 5637c169 by 张立顺

fix 需求评审功能修改

1 parent 799a320b
...@@ -513,5 +513,18 @@ module.exports = { ...@@ -513,5 +513,18 @@ module.exports = {
'dj.api.smartcarlife.goodsOrder.abnormalOrder.lock.select', '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) { ...@@ -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) // console.log(role, weeklyList)
if (role == 'staff') { if (role == 'staff') {
// 员工七天内可操作 // 员工七天内可操作
var isWithin =
isDynamicDateWithinRange !== undefined
? isDynamicDateWithinRange
: isDateWithin7Days(date)
return ( return (
(weeklyList.indexOf(date) > -1 && !disabledStatus) || (weeklyList.indexOf(date) > -1 && !disabledStatus) || !isWithin
!isDateWithin7Days(date)
) )
} else if (role == 'super') { } else if (role == 'super') {
// 超管60天内可操作 // 超管60天内可操作
......
...@@ -229,13 +229,19 @@ function getWeeksDiff(startDate, endDate) { ...@@ -229,13 +229,19 @@ function getWeeksDiff(startDate, endDate) {
return weeksDiff return weeksDiff
} }
function isDateWithin7Days(date) { function isDateWithin7Days(date, limitDate) {
console.log(date, 'isDateWithin7Daysdate') // console.log(date, 'isDateWithin7Daysdate')
// console.log(date, 'date');
const oneDay = 24 * 60 * 60 * 1000 // 一天的毫秒数 const oneDay = 24 * 60 * 60 * 1000 // 一天的毫秒数
const currentDate = new Date() // 当前日期 const currentDate = new Date() // 当前日期
const targetDate = new Date(date) // 给定的日期 const targetDate = new Date(date) // 给定的日期
// 如果传了限制时间,则使用限制时间判断
if (limitDate) {
const limit = new Date(limitDate)
// 比较时间戳
return targetDate.getTime() >= limit.getTime()
}
// 计算给定日期与当前日期的时间差(以毫秒为单位) // 计算给定日期与当前日期的时间差(以毫秒为单位)
const diffMilliseconds = targetDate - currentDate 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!