shaogen1995 3 months ago
parent
commit
268c8fdccd
1 changed files with 13 additions and 10 deletions
  1. 13 10
      src/pages/D_storeManage/D3staff/D3edit/index.tsx

+ 13 - 10
src/pages/D_storeManage/D3staff/D3edit/index.tsx

@@ -68,14 +68,17 @@ function C21edit() {
   }, [])
 
   // 获取详情
-  const getInfoFu = useCallback(async () => {
-    const res = await D3_APIgetInfo(id)
-    if (res.code === 0) {
-      const { memberIds, ...rest } = res.data
-      setTopInfo(rest)
-      setOversiderList(JSON.parse(memberIds || '') || [])
-    }
-  }, [id])
+  const getInfoFu = useCallback(
+    async (id2?: number) => {
+      const res = await D3_APIgetInfo(id2 || id)
+      if (res.code === 0) {
+        const { memberIds, ...rest } = res.data
+        setTopInfo(rest)
+        setOversiderList(JSON.parse(memberIds || '') || [])
+      }
+    },
+    [id]
+  )
 
   useEffect(() => {
     if (key === '1') creatFu()
@@ -156,7 +159,7 @@ function C21edit() {
           const res = await D3_APIsaveDraft(obj)
           if (res.code === 0) {
             MessageFu.success('草稿保存成功')
-            getInfoFu()
+            getInfoFu(topInfo.id)
           }
         } else {
           const res = val === '创建' ? await D3_APIsaveCreate(obj) : await D3_APIsaveApply(obj)
@@ -168,7 +171,7 @@ function C21edit() {
         }
       }
     },
-    [auditSta, checkDataFu, oversiderList, topInfo]
+    [auditSta, checkDataFu, getInfoFu, oversiderList, topInfo]
   )
 
   // 查看的按钮创建-提交-撤回