|
@@ -15,9 +15,8 @@ import { auditProgress } from '@/utils/common/constStatus'
|
|
|
import consts from '@/utils/consts'
|
|
|
import { dayjsFormat } from '@/utils/util'
|
|
|
import { Button, Input, message, Pagination, Tooltip } from 'antd'
|
|
|
-import locale from 'antd/es/date-picker/locale/zh_CN'
|
|
|
import dayjs from 'dayjs'
|
|
|
-import React, { useEffect, useState, useMemo } from 'react'
|
|
|
+import React, { useEffect, useState } from 'react'
|
|
|
import { RouteComponentProps } from 'react-router'
|
|
|
import { apiGetSafeDetail, apiResfulSafeAudit } from './api'
|
|
|
import AuditModal from '@/pages/Quality/Content/Info/Detail/components/Modal'
|
|
@@ -59,7 +58,7 @@ const Detail: React.FC<RouteComponentProps> = props => {
|
|
|
name: '',
|
|
|
status: 0,
|
|
|
opinion: '',
|
|
|
- create_time: new Date().toDateString()
|
|
|
+ create_time: undefined
|
|
|
},
|
|
|
auditHistory: [],
|
|
|
rectifiedInfo: [],
|
|
@@ -273,6 +272,9 @@ const Detail: React.FC<RouteComponentProps> = props => {
|
|
|
|
|
|
const auditData = { auditors: detail.auditors, auditHistory: detail.auditHistory, status: detail.status, uName: detail.auditName, uid: detail.uid }
|
|
|
|
|
|
+ const disabledDate = (current: dayjs.Dayjs) => {
|
|
|
+ return current.add(1, 'day') < dayjs(detail.createTime)
|
|
|
+ }
|
|
|
return (
|
|
|
<div className="wrap-contaniner">
|
|
|
<Header title="安全巡检">
|
|
@@ -323,7 +325,6 @@ const Detail: React.FC<RouteComponentProps> = props => {
|
|
|
isEdited ? <span>{detail.createTime && dayjsFormat(detail.createTime, 'YYYY-MM-DD')}</span> :
|
|
|
<DatePicker
|
|
|
size="small"
|
|
|
- locale={locale}
|
|
|
allowClear={false}
|
|
|
value={dayjs(detail.createTime)}
|
|
|
onChange={value => setDetail({ ...detail, createTime: value?.format() })} />
|
|
@@ -359,9 +360,8 @@ const Detail: React.FC<RouteComponentProps> = props => {
|
|
|
<td>
|
|
|
<DatePicker
|
|
|
size="small"
|
|
|
- locale={locale}
|
|
|
allowClear={false}
|
|
|
- value={dayjs(detail.checkOrder.create_time)}
|
|
|
+ disabledDate={disabledDate}
|
|
|
onChange={value => setDetail({ ...detail, checkOrder: { ...detail.checkOrder, create_time: value?.format() } })} />
|
|
|
</td>
|
|
|
</tr>
|