Bläddra i källkod

feat: 整改单限制日期逻辑判断改成一天开始

lanjianrong 4 år sedan
förälder
incheckning
567e4d47b9

+ 1 - 0
src/pages/Contract/Content/Income/components/TableContent/index.tsx

@@ -240,6 +240,7 @@ const GCsheet: React.FC<iTableContentPorps> = ({ changeModalType, row, setRow, h
     }
   }
   const handleRowClass = (record: any) => {
+
     return record.id === row.id ? 'ant-table-row-selected editable-row' : ''
   }
   const tabOnClick = (key: string) => {

+ 1 - 1
src/pages/Quality/Content/Info/Detail/index.tsx

@@ -281,7 +281,7 @@ const Detail: React.FC<RouteComponentProps> = props => {
   }
 
   const disabledDate = (current: dayjs.Dayjs) => {
-    return current.add(1, 'day') < dayjs(detail.createTime)
+    return current.startOf('day') < dayjs(detail.createTime).startOf('day')
   }
 
   return (

+ 13 - 4
src/pages/Quality/Content/List/index.tsx

@@ -51,6 +51,7 @@ const QualityList: React.FC<{}> = () => {
     {
       title: '序号',
       align: 'center',
+      width: '5%',
       // eslint-disable-next-line react/display-name
       render: (_: string, record: any, i: number) => {
         return <span>{i + 1}</span>
@@ -59,6 +60,7 @@ const QualityList: React.FC<{}> = () => {
     {
       title: '编号',
       dataIndex: 'code',
+      width: '10%',
       // eslint-disable-next-line react/display-name
       render: (text: string, record) => {
         return <Link to={{ pathname: '/console/quality/content/detail/info', state: { id: record.id } }}>{text}</Link>
@@ -66,19 +68,23 @@ const QualityList: React.FC<{}> = () => {
     },
     {
       title: '检查项目',
-      dataIndex: 'inspection'
+      dataIndex: 'inspection',
+      width: '10%'
     },
     {
       title: '现场检查情况',
-      dataIndex: 'inspection_detail'
+      dataIndex: 'inspection_detail',
+      width: '15%'
     },
     {
       title: '处理要求及措施',
-      dataIndex: 'demand'
+      dataIndex: 'demand',
+      width: '15%'
     },
     {
       title: '检查日期',
       dataIndex: 'createTime',
+      width: '10%',
       // eslint-disable-next-line react/display-name
       render: (text: string) => {
         return <span>{dayjsFormat(text, 'YYYY-MM-DD')}</span>
@@ -86,11 +92,13 @@ const QualityList: React.FC<{}> = () => {
     },
     {
       title: '检查人',
-      dataIndex: 'auditName'
+      dataIndex: 'auditName',
+      width: '15%'
     },
     {
       title: '附件',
       dataIndex: 'fileCounts',
+      width: '5%',
       // eslint-disable-next-line react/display-name
       render: (text: string, record) => {
         return (
@@ -103,6 +111,7 @@ const QualityList: React.FC<{}> = () => {
     {
       title: '状态',
       dataIndex: 'status',
+      width: '10%',
       // eslint-disable-next-line react/display-name
       render: (statu: number) => {
         return <span className={safeStatus[statu].className}>{safeStatus[statu].text}</span>

+ 2 - 2
src/pages/Safe/Content/Info/Detail/index.tsx

@@ -57,7 +57,7 @@ const Detail: React.FC<RouteComponentProps> = props => {
     checkOrder: { // 整改单
       name: '',
       opinion: '',
-      rectifiedTime: undefined
+      rectifiedTime: ''
     },
     auditHistory: [],
     rectifiedInfo: [],
@@ -273,7 +273,7 @@ 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 current.startOf('day') < dayjs(detail.createTime).startOf('day')
   }
   return (
     <div className="wrap-contaniner">

+ 14 - 4
src/pages/Safe/Content/List/index.tsx

@@ -20,6 +20,7 @@ import AddModel from './modal'
 
 const SafeList: React.FC<{}> = () => {
   const [ state, setState ] = useListModal(consts.DATA_TYPE.SAFE)
+
   useEffect(() => {
     initData()
   }, [])
@@ -27,6 +28,7 @@ const SafeList: React.FC<{}> = () => {
     {
       title: '序号',
       align: 'center',
+      width: '5%',
       // eslint-disable-next-line react/display-name
       render: (_: string, record: any, i: number) => {
         return <span>{i + 1}</span>
@@ -35,6 +37,7 @@ const SafeList: React.FC<{}> = () => {
     {
       title: '编号',
       dataIndex: 'code',
+      width: '10%',
       // eslint-disable-next-line react/display-name
       render: (text: string, record) => {
         return <Link to={{ pathname: '/console/safe/content/detail/info', state: { id: record.id } }}>{text}</Link>
@@ -42,19 +45,23 @@ const SafeList: React.FC<{}> = () => {
     },
     {
       title: '检查项目',
-      dataIndex: 'inspection'
+      dataIndex: 'inspection',
+      width: '10%'
     },
     {
       title: '现场检查情况',
-      dataIndex: 'inspection_detail'
+      dataIndex: 'inspection_detail',
+      width: '15%'
     },
     {
       title: '处理要求及措施',
-      dataIndex: 'demand'
+      dataIndex: 'demand',
+      width: '15%'
     },
     {
       title: '检查日期',
       dataIndex: 'createTime',
+      width: '10%',
       // eslint-disable-next-line react/display-name
       render: (text: string) => {
         return <span>{dayjsFormat(text, 'YYYY-MM-DD')}</span>
@@ -62,11 +69,13 @@ const SafeList: React.FC<{}> = () => {
     },
     {
       title: '检查人',
-      dataIndex: 'auditName'
+      dataIndex: 'auditName',
+      width: '15%'
     },
     {
       title: '附件',
       dataIndex: 'fileCounts',
+      width: '5%',
       // eslint-disable-next-line react/display-name
       render: (text: string, record) => {
         return (
@@ -79,6 +88,7 @@ const SafeList: React.FC<{}> = () => {
     {
       title: '状态',
       dataIndex: 'status',
+      width: '10%',
       // eslint-disable-next-line react/display-name
       render: (statu: number) => {
         return <span className={safeStatus[statu].className}>{safeStatus[statu].text}</span>