chenlei 4 дней назад
Родитель
Сommit
e7bb6974a1

+ 19 - 5
src/pages/Fstorehouse/F4check/F4edit/index.tsx

@@ -10,7 +10,11 @@ import { F1_APIgetStorageList, F1API_obj } from '@/store/action/Fstorehouse/F1in
 import { Button, Dropdown, MenuProps, Select } from 'antd'
 import { selectObj } from '@/utils/dataChange'
 import FileArchive from '@/pages/Zother/FileArchive'
-import { F4_APIgetClueList, F4API_obj } from '@/store/action/Fstorehouse/F4check'
+import {
+  F4_APIgetClueList,
+  F4_APIgetRelatedOrderList,
+  F4API_obj
+} from '@/store/action/Fstorehouse/F4check'
 import { NewPcsCell, PdRemarkCell, PdRemarkModal } from './components'
 import MyTable from '@/components/MyTable'
 import { GoodsType } from '@/pages/Zother/SonGoodsList/data'
@@ -54,6 +58,7 @@ function F1editContent() {
     value: string
     onChange: (v: string) => void
   } | null>(null)
+  const [relatedOrderList, setRelatedOrderList] = useState<any[]>([])
 
   const handleStorageChange = useCallback(
     async (value: string, option: any) => {
@@ -123,7 +128,7 @@ function F1editContent() {
           items: registerMenu,
           style: { width: 100 },
           onClick: ({ key }) => {
-            history.push(`/${key}_edit/1/null?pId=${info.id}`)
+            history.push(`/${key}_edit/1/null?pNum=${info.num}`)
           }
         }}
         placement='bottom'
@@ -133,7 +138,16 @@ function F1editContent() {
         </Button>
       </Dropdown>
     ) : null
-  }, [history, info.id, isLook])
+  }, [history, info.num, isLook])
+
+  useEffect(() => {
+    if (!isLook || !info.num) return
+    F4_APIgetRelatedOrderList(info.num).then((res: any) => {
+      if (res.code === 0) {
+        setRelatedOrderList(res.data.records)
+      }
+    })
+  }, [info.num, isLook])
 
   return (
     <div className={styles.F4edit} id='editBox'>
@@ -232,9 +246,9 @@ function F1editContent() {
           <p className='F4editStorageTitle'>盘点登记</p>
           <MyTable
             classKey='SonGoodsList'
-            list={[]}
+            list={relatedOrderList}
             columnsTemp={[
-              ['txt', '业务类型', 'num'],
+              ['select', '业务类型', 'type', selectObj['维护类型']],
               ['txt', '申请编号', 'num'],
               ['txt', '发起部门', 'deptName'],
               ['txt', '发起人', 'creatorName'],

+ 2 - 2
src/store/action/Fstorehouse/F4check.ts

@@ -41,6 +41,6 @@ export const F4_APIgetClueList = (data: any) => {
  * 盘点登记-列表
  * type: SG-事故登记 XZ-现状登记 XF-修复登记
  */
-export const F4_APIgetRelatedOrderList = (num: string, type: 'SG' | 'XZ' | 'XF') => {
-  return http.get(`cms/orderSite/check/relatedOrderByNum/${num}/${type}`)
+export const F4_APIgetRelatedOrderList = (num: string, type?: 'SG' | 'XZ' | 'XF') => {
+  return http.get(`cms/orderSite/check/relatedOrderByNum/${num}`, { params: { type } })
 }

+ 5 - 0
src/utils/dataChange.tsx

@@ -151,6 +151,11 @@ export const selectObj = {
     { value: 'video', label: '视频' },
     { value: 'doc', label: '文档' },
     { value: 'other', label: '其他' }
+  ],
+  维护类型: [
+    { value: 'SG', label: '事故登记' },
+    { value: 'XZ', label: '现状登记' },
+    { value: 'XF', label: '修复登记' }
   ]
 }