fix 79311
This commit is contained in:
@@ -129,10 +129,10 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<!-- 计划稽查日期: 到期前一周标红 -->
|
<!-- 计划稽查日期: 到期前一周标红 -->
|
||||||
<template slot="scheduledCheckDate" slot-scope="{text}">
|
<template slot="scheduledCheckDate" slot-scope="{text, record}">
|
||||||
<a-tooltip overlay-class-name="tooltip-style">
|
<a-tooltip overlay-class-name="tooltip-style">
|
||||||
<template slot="title">{{ text || text === 0 ? text : global.emptyLine }}</template>
|
<template slot="title">{{ text || text === 0 ? text : global.emptyLine }}</template>
|
||||||
<div class="table-text" :class="{'table-red-text': text && new Date(Date.parse(text)) > sevenDaysAgo}">{{ text || text === 0 ? text : global.emptyLine }}</div>
|
<div class="table-text" :class="{'table-red-text': isMarkRed(record)}">{{ text || text === 0 ? text : global.emptyLine }}</div>
|
||||||
</a-tooltip>
|
</a-tooltip>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@@ -185,6 +185,8 @@ import DeferredCheckModal from './modules/DeferredCheckModal'
|
|||||||
// 稽查报告弹框
|
// 稽查报告弹框
|
||||||
import CheckReportModal from './modules/CheckReportModal'
|
import CheckReportModal from './modules/CheckReportModal'
|
||||||
import RectificationPlanModal from './modules/RectificationPlanModal'
|
import RectificationPlanModal from './modules/RectificationPlanModal'
|
||||||
|
import { InspectStatus } from '@/enums/commonEnums'
|
||||||
|
import moment from 'moment'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'CheckList',
|
name: 'CheckList',
|
||||||
@@ -335,6 +337,19 @@ export default {
|
|||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
isHasPermission,
|
isHasPermission,
|
||||||
|
/**
|
||||||
|
* 是否标红
|
||||||
|
* @description fix:79388((进行中 || 稽查中) && 到期前一周) || 拖期
|
||||||
|
* @param record
|
||||||
|
* @return {boolean}
|
||||||
|
*/
|
||||||
|
isMarkRed (record) {
|
||||||
|
// 是否进行中或稽查中
|
||||||
|
const state = [InspectStatus.inProgress.value, InspectStatus.underInspection.value].includes(record.inspectStatus + '')
|
||||||
|
// 是否到期前一周(比较当前天和每条数据的计划稽查日期小于7天)
|
||||||
|
const isExpireOneWeek = moment().diff(moment(record.planInspectDate), 'days') < 7
|
||||||
|
return (state && isExpireOneWeek) || record.inspectStatus === InspectStatus.delay.value
|
||||||
|
},
|
||||||
// 获取七天前日期
|
// 获取七天前日期
|
||||||
getSevenDaysAgo () {
|
getSevenDaysAgo () {
|
||||||
const dateStr = new Date().getFullYear() + '-' + (new Date().getMonth() + 1) + '-' + (new Date().getDate() - 7)
|
const dateStr = new Date().getFullYear() + '-' + (new Date().getMonth() + 1) + '-' + (new Date().getDate() - 7)
|
||||||
|
|||||||
Reference in New Issue
Block a user