瀏覽代碼

fix: 整改单字段变更

lanjianrong 4 年之前
父節點
當前提交
7bd1324043
共有 3 個文件被更改,包括 23 次插入24 次删除
  1. 11 11
      src/pages/Quality/Content/Info/Detail/index.tsx
  2. 11 11
      src/pages/Safe/Content/Info/Detail/index.tsx
  3. 1 2
      src/types/auditDetail.d.ts

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

@@ -55,9 +55,8 @@ const Detail: React.FC<RouteComponentProps> = props => {
     checkOrder: {
       // 整改单
       name: '',
-      status: 0,
       opinion: '',
-      create_time: new Date().toDateString()
+      rectifiedTime: ''
     },
     auditHistory: [],
     rectifiedInfo: [],
@@ -175,9 +174,13 @@ const Detail: React.FC<RouteComponentProps> = props => {
         return message.error('现场检查情况或处理要求措施不能为空')
       }
     }
-    if (type === 'pass' && detail.latestAuditor.progress === '1' && !detail.checkOrder.opinion) {
-
-      return message.error('请填写整改单')
+    if (type === 'pass' && detail.latestAuditor.progress === '1' ) {
+      if (!detail.checkOrder.opinion) {
+        return message.error('请填写整改单')
+      }
+      if (!detail.checkOrder.rectifiedTime) {
+        return message.error('请选择整改完成日期')
+      }
     }
     setModalObj({ ...modalObj, auditType: type, auditModal: true })
   }
@@ -203,11 +206,8 @@ const Detail: React.FC<RouteComponentProps> = props => {
     if (modalObj.auditType === 'pass' || modalObj.auditType === 'back') {
       payload.id = detail.latestAuditor.id
       if (detail.latestAuditor.progress === '1') {
-        // if (!detail.checkOrder.opinion) {
-        //   return message.error('请填写整改单')
-        // } else {
-        // }
         payload.rectifiedInfo = detail.checkOrder.opinion
+        payload.rectifiedTime = detail.checkOrder.rectifiedTime
       }
     }
 
@@ -388,7 +388,7 @@ const Detail: React.FC<RouteComponentProps> = props => {
                       size="small"
                       allowClear={false}
                       disabledDate={disabledDate}
-                      onChange={value => setDetail({ ...detail, checkOrder: { ...detail.checkOrder, create_time: value?.format() } })} />
+                      onChange={value => setDetail({ ...detail, checkOrder: { ...detail.checkOrder, rectifiedTime: value?.format("YYYY-MM-DD HH:mm:ss") } })} />
                   </td>
                 </tr>
                 <tr>
@@ -413,7 +413,7 @@ const Detail: React.FC<RouteComponentProps> = props => {
                       <td>{item.opinion}</td>
                     </tr>
                     <tr>
-                      <th style={{ width: '150px' }}>整改日期</th>
+                      <th style={{ width: '150px' }}>整改完成日期</th>
                       <td>{dayjsFormat(item.create_time, 'YYYY-MM-DD')}</td>
                     </tr>
                     <tr>

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

@@ -56,9 +56,8 @@ const Detail: React.FC<RouteComponentProps> = props => {
     status: 0,
     checkOrder: { // 整改单
       name: '',
-      status: 0,
       opinion: '',
-      create_time: undefined
+      rectifiedTime: undefined
     },
     auditHistory: [],
     rectifiedInfo: [],
@@ -180,9 +179,13 @@ const Detail: React.FC<RouteComponentProps> = props => {
       }
     }
 
-    if (type === 'pass' && detail.latestAuditor.progress === '1' && !detail.checkOrder.opinion) {
-
-      return message.error('请填写整改单')
+    if (type === 'pass' && detail.latestAuditor.progress === '1' ) {
+      if (!detail.checkOrder.opinion) {
+        return message.error('请填写整改单')
+      }
+      if (!detail.checkOrder.rectifiedTime) {
+        return message.error('请选择整改完成日期')
+      }
     }
 
     setModalObj({ ...modalObj, auditType: type, auditModal: true })
@@ -209,11 +212,8 @@ const Detail: React.FC<RouteComponentProps> = props => {
     if (modalObj.auditType === 'pass' || modalObj.auditType === 'back') {
       payload.id = detail.latestAuditor.id
       if (detail.latestAuditor.progress === '1') {
-        // if (!detail.checkOrder.opinion) {
-        //   return message.error("请填写整改单")
-        // } else {
-        // }
         payload.rectifiedInfo = detail.checkOrder.opinion
+        payload.rectifiedTime = detail.checkOrder.rectifiedTime
       }
     }
 
@@ -356,13 +356,13 @@ const Detail: React.FC<RouteComponentProps> = props => {
                     </td>
                   </tr>
                   <tr>
-                    <th style={{ width: '150px' }}>整改日期</th>
+                    <th style={{ width: '150px' }}>整改完成日期</th>
                     <td>
                       <DatePicker
                         size="small"
                         allowClear={false}
                         disabledDate={disabledDate}
-                        onChange={value => setDetail({ ...detail, checkOrder: { ...detail.checkOrder, create_time: value?.format() } })} />
+                        onChange={value => setDetail({ ...detail, checkOrder: { ...detail.checkOrder, rectifiedTime: value?.format("YYYY-MM-DD HH:mm:ss") } })} />
                     </td>
                   </tr>
                   <tr>

+ 1 - 2
src/types/auditDetail.d.ts

@@ -23,9 +23,8 @@ export interface iDetailState {
 
 export interface iModifiedOrder {
   name: string
-  create_time: string | undefined
+  rectifiedTime: string | undefined
   opinion: string
-  status: number
 }
 export interface iFileState {
   fileList: any[]