|
@@ -17,7 +17,7 @@ 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, useCallback } from 'react'
|
|
|
+import React, { useEffect, useState, useMemo } from 'react'
|
|
|
import { RouteComponentProps } from 'react-router'
|
|
|
import { apiGetSafeDetail, apiResfulSafeAudit } from './api'
|
|
|
import AuditModal from '@/pages/Quality/Content/Info/Detail/components/Modal'
|
|
@@ -230,7 +230,7 @@ const Detail: React.FC<RouteComponentProps> = props => {
|
|
|
<ZhSubmitButton size="small" className="pi-mg-left-5" onClick={() => btnClick('start')}>提交审批</ZhSubmitButton>
|
|
|
</div>
|
|
|
)
|
|
|
- } else if(status === auditProgress.checking || status === auditProgress.checkNo) {
|
|
|
+ } else if (status === auditProgress.checking || status === auditProgress.checkNo) {
|
|
|
return (
|
|
|
<div className="pi-flex-row pi-align-center">
|
|
|
<Button type="primary" danger size="small" onClick={() => btnClick('close')}>关闭</Button>
|
|
@@ -275,7 +275,7 @@ const Detail: React.FC<RouteComponentProps> = props => {
|
|
|
<th style={{ width: '150px' }}>检查项目</th>
|
|
|
<td>
|
|
|
{
|
|
|
- isEdited ? <span>{detail.inspection}</span> : <TextArea value={detail.inspection} onChange={(e) => {setDetail({ ...detail, inspection: e.currentTarget.value })}}></TextArea>
|
|
|
+ isEdited ? <span>{detail.inspection}</span> : <TextArea value={detail.inspection} onChange={(e) => { setDetail({ ...detail, inspection: e.currentTarget.value }) }}></TextArea>
|
|
|
}
|
|
|
</td>
|
|
|
</tr>
|
|
@@ -283,7 +283,7 @@ const Detail: React.FC<RouteComponentProps> = props => {
|
|
|
<th style={{ width: '150px' }}>现场检查情况</th>
|
|
|
<td>
|
|
|
{
|
|
|
- isEdited ? <span>{detail.inspectionDetail}</span> : <TextArea value={detail.inspectionDetail} onChange={(e) => {setDetail({ ...detail, inspectionDetail: e.currentTarget.value })}}></TextArea>
|
|
|
+ isEdited ? <span>{detail.inspectionDetail}</span> : <TextArea value={detail.inspectionDetail} onChange={(e) => { setDetail({ ...detail, inspectionDetail: e.currentTarget.value }) }}></TextArea>
|
|
|
}
|
|
|
</td>
|
|
|
</tr>
|
|
@@ -291,7 +291,7 @@ const Detail: React.FC<RouteComponentProps> = props => {
|
|
|
<th style={{ width: '150px' }}>处理要求及措施</th>
|
|
|
<td>
|
|
|
{
|
|
|
- isEdited ? <span>{detail.demand}</span> : <TextArea value={detail.demand} onChange={(e) => {setDetail({ ...detail, demand: e.currentTarget.value })}}></TextArea>
|
|
|
+ isEdited ? <span>{detail.demand}</span> : <TextArea value={detail.demand} onChange={(e) => { setDetail({ ...detail, demand: e.currentTarget.value }) }}></TextArea>
|
|
|
}
|
|
|
</td>
|
|
|
</tr>
|
|
@@ -300,12 +300,12 @@ const Detail: React.FC<RouteComponentProps> = props => {
|
|
|
<td>
|
|
|
{
|
|
|
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() })}></DatePicker>
|
|
|
+ <DatePicker
|
|
|
+ size="small"
|
|
|
+ locale={locale}
|
|
|
+ allowClear={false}
|
|
|
+ value={dayjs(detail.createTime)}
|
|
|
+ onChange={value => setDetail({ ...detail, createTime: value?.format() })}></DatePicker>
|
|
|
}
|
|
|
|
|
|
</td>
|
|
@@ -317,64 +317,64 @@ const Detail: React.FC<RouteComponentProps> = props => {
|
|
|
</tbody>
|
|
|
</table>
|
|
|
{
|
|
|
- detail.status === auditProgress.checked && detail.latestAuditor.audit_id === userStore.userInfo.id?
|
|
|
- <table className="pi-table pi-bordered">
|
|
|
- <thead>
|
|
|
- <tr>
|
|
|
- <th colSpan={2} className="pi-text-center">
|
|
|
- 整改单
|
|
|
+ detail.status === auditProgress.checked && detail.latestAuditor.audit_id === userStore.userInfo.id ?
|
|
|
+ <table className="pi-table pi-bordered">
|
|
|
+ <thead>
|
|
|
+ <tr>
|
|
|
+ <th colSpan={2} className="pi-text-center">
|
|
|
+ 整改单
|
|
|
</th>
|
|
|
- </tr>
|
|
|
- </thead>
|
|
|
- <tbody>
|
|
|
- <tr>
|
|
|
- <th style={{ width: '150px' }}>整改情况</th>
|
|
|
- <td>
|
|
|
- <TextArea value={detail.checkOrder.opinion} onChange={(e) => setDetail({ ...detail, checkOrder: { ...detail.checkOrder, opinion: e.currentTarget.value } })}></TextArea>
|
|
|
- </td>
|
|
|
- </tr>
|
|
|
- <tr>
|
|
|
- <th style={{ width: '150px' }}>整改日期</th>
|
|
|
- <td>
|
|
|
- <DatePicker
|
|
|
- size="small"
|
|
|
- locale={locale}
|
|
|
- allowClear={false}
|
|
|
- value={dayjs(detail.checkOrder.create_time)}
|
|
|
- onChange={value => setDetail({ ...detail, checkOrder: { ...detail.checkOrder, create_time: value?.format() } })}></DatePicker>
|
|
|
- </td>
|
|
|
- </tr>
|
|
|
- <tr>
|
|
|
- <th style={{ width: '150px' }}>整改人</th>
|
|
|
- <td>{detail.auditors.find(item => item.progress === '1')?.name}</td>
|
|
|
- </tr>
|
|
|
- </tbody>
|
|
|
- </table>
|
|
|
- : detail.rectifiedInfo.map(item => (
|
|
|
- <table className="pi-table pi-bordered" key={item.create_time}>
|
|
|
- <thead>
|
|
|
- <tr>
|
|
|
- <th colSpan={2} className="pi-text-center">
|
|
|
- 整改单
|
|
|
+ </tr>
|
|
|
+ </thead>
|
|
|
+ <tbody>
|
|
|
+ <tr>
|
|
|
+ <th style={{ width: '150px' }}>整改情况</th>
|
|
|
+ <td>
|
|
|
+ <TextArea value={detail.checkOrder.opinion} onChange={(e) => setDetail({ ...detail, checkOrder: { ...detail.checkOrder, opinion: e.currentTarget.value } })}></TextArea>
|
|
|
+ </td>
|
|
|
+ </tr>
|
|
|
+ <tr>
|
|
|
+ <th style={{ width: '150px' }}>整改日期</th>
|
|
|
+ <td>
|
|
|
+ <DatePicker
|
|
|
+ size="small"
|
|
|
+ locale={locale}
|
|
|
+ allowClear={false}
|
|
|
+ value={dayjs(detail.checkOrder.create_time)}
|
|
|
+ onChange={value => setDetail({ ...detail, checkOrder: { ...detail.checkOrder, create_time: value?.format() } })}></DatePicker>
|
|
|
+ </td>
|
|
|
+ </tr>
|
|
|
+ <tr>
|
|
|
+ <th style={{ width: '150px' }}>整改人</th>
|
|
|
+ <td>{detail.auditors.find(item => item.progress === '1')?.name}</td>
|
|
|
+ </tr>
|
|
|
+ </tbody>
|
|
|
+ </table>
|
|
|
+ : detail.rectifiedInfo.map(item => (
|
|
|
+ <table className="pi-table pi-bordered" key={item.create_time}>
|
|
|
+ <thead>
|
|
|
+ <tr>
|
|
|
+ <th colSpan={2} className="pi-text-center">
|
|
|
+ 整改单
|
|
|
</th>
|
|
|
- </tr>
|
|
|
- </thead>
|
|
|
- <tbody>
|
|
|
- <tr>
|
|
|
- <th style={{ width: '150px' }}>整改情况</th>
|
|
|
- <td>{item.opinion}</td>
|
|
|
- </tr>
|
|
|
- <tr>
|
|
|
- <th style={{ width: '150px' }}>整改日期</th>
|
|
|
- <td>{dayjsFormat(item.create_time, 'YYYY-MM-DD')}</td>
|
|
|
- </tr>
|
|
|
- <tr>
|
|
|
- <th style={{ width: '150px' }}>整改人</th>
|
|
|
- <td>{item.name}</td>
|
|
|
- </tr>
|
|
|
- </tbody>
|
|
|
- </table>
|
|
|
- ))
|
|
|
+ </tr>
|
|
|
+ </thead>
|
|
|
+ <tbody>
|
|
|
+ <tr>
|
|
|
+ <th style={{ width: '150px' }}>整改情况</th>
|
|
|
+ <td>{item.opinion}</td>
|
|
|
+ </tr>
|
|
|
+ <tr>
|
|
|
+ <th style={{ width: '150px' }}>整改日期</th>
|
|
|
+ <td>{dayjsFormat(item.create_time, 'YYYY-MM-DD')}</td>
|
|
|
+ </tr>
|
|
|
+ <tr>
|
|
|
+ <th style={{ width: '150px' }}>整改人</th>
|
|
|
+ <td>{item.name}</td>
|
|
|
+ </tr>
|
|
|
+ </tbody>
|
|
|
+ </table>
|
|
|
+ ))
|
|
|
|
|
|
}
|
|
|
<table className="pi-table pi-bordered mt-3">
|
|
@@ -400,20 +400,20 @@ const Detail: React.FC<RouteComponentProps> = props => {
|
|
|
|
|
|
{detail.file.fileList?.map((file, idx) => (
|
|
|
<tr key={idx}>
|
|
|
- <td className="pi-width-70">{idx + 1}</td>
|
|
|
- <td style={{ width: 383, maxWidth: 383, overflow: 'hidden', whiteSpace: 'nowrap', textOverflow: 'ellipsis' }}>
|
|
|
- <a href={consts.OSS_PATH.REVIEW + file.filepath} target="_blank" rel="noopener noreferrer">
|
|
|
- {file.filename}
|
|
|
- </a>
|
|
|
- </td>
|
|
|
- <td className="pi-text-center pi-width-100">{file.accountName}</td>
|
|
|
- <td className="pi-text-center">{dayjsFormat(file.createTime)}</td>
|
|
|
- <td className="pi-text-center pi-width-90">
|
|
|
- <Tooltip title="移除">
|
|
|
- <Button size="small" type="text" icon={<SvgIcon type="xxh-times-circle1" />} style={{ color: '#df3f45' }} onClick={() => delFile(file.id, !idx)}></Button>
|
|
|
- </Tooltip>
|
|
|
- </td>
|
|
|
- </tr>
|
|
|
+ <td className="pi-width-70">{idx + 1}</td>
|
|
|
+ <td style={{ width: 383, maxWidth: 383, overflow: 'hidden', whiteSpace: 'nowrap', textOverflow: 'ellipsis' }}>
|
|
|
+ <a href={consts.OSS_PATH.REVIEW + file.filepath} target="_blank" rel="noopener noreferrer">
|
|
|
+ {file.filename}
|
|
|
+ </a>
|
|
|
+ </td>
|
|
|
+ <td className="pi-text-center pi-width-100">{file.accountName}</td>
|
|
|
+ <td className="pi-text-center">{dayjsFormat(file.createTime)}</td>
|
|
|
+ <td className="pi-text-center pi-width-90">
|
|
|
+ <Tooltip title="移除">
|
|
|
+ <Button size="small" type="text" icon={<SvgIcon type="xxh-times-circle1" />} style={{ color: '#df3f45' }} onClick={() => delFile(file.id, !idx)}></Button>
|
|
|
+ </Tooltip>
|
|
|
+ </td>
|
|
|
+ </tr>
|
|
|
))}
|
|
|
{detail.file.total > consts.PAGE_SIZE ? (
|
|
|
<tr>
|
|
@@ -440,6 +440,7 @@ const Detail: React.FC<RouteComponentProps> = props => {
|
|
|
onShow={onOssModalShow}>
|
|
|
</OssUploadModal>
|
|
|
<AuditModal
|
|
|
+ type="safe"
|
|
|
modalObj={modalProps}
|
|
|
onCancel={() => setModalObj({ ...modalObj, auditModal: false })}
|
|
|
onCreate={onModalConfirm}
|