Przeglądaj źródła

完善查看按钮逻辑

shaogen1995 3 miesięcy temu
rodzic
commit
608bbdeae6

+ 4 - 1
src/pages/B_enterTibet/B1collect/B1edit/index.tsx

@@ -167,7 +167,10 @@ function B1edit() {
   const lookBtnFu = useCallback(
     async (val: '创建' | '提交' | '撤回') => {
       if (val !== '撤回') {
-        if (clueArr.length === 0) return MessageFu.warning('请添加藏品')
+        if (clueArr.length === 0) {
+          if (val === '创建') history.push(`/collect_edit/2/${id}`)
+          return MessageFu.warning('请添加藏品')
+        }
       }
 
       const obj = {

+ 4 - 1
src/pages/B_enterTibet/B2identify/B2edit/index.tsx

@@ -210,7 +210,10 @@ function B2edit() {
   const lookBtnFu = useCallback(
     async (val: '创建' | '提交' | '撤回') => {
       if (val !== '撤回') {
-        if (snaps.length === 0) return MessageFu.warning('请添加藏品')
+        if (snaps.length === 0) {
+          if (val === '创建') history.push(`/identify_edit/2/${id}`)
+          return MessageFu.warning('请添加藏品')
+        }
       }
 
       const obj = {

+ 5 - 1
src/pages/B_enterTibet/B34typeIn/B34edit/index.tsx

@@ -251,7 +251,11 @@ function B34edit({ type }: Props) {
       if (!topInfo.num) return MessageFu.warning('请输入入馆凭证号')
 
       if (val !== '撤回') {
-        if (snaps.length === 0) return MessageFu.warning('请添加藏品')
+        if (snaps.length === 0) {
+          if (val === '创建')
+            history.push(`/${type === '入馆' ? 'entering' : 'enterTibet'}_edit/2/${id}`)
+          return MessageFu.warning('请添加藏品')
+        }
       }
 
       const obj = {

+ 4 - 1
src/pages/D_storeManage/D4impStor/D4edit/index.tsx

@@ -350,7 +350,10 @@ function D4edit() {
   const lookBtnFu = useCallback(
     async (val: '创建' | '提交' | '撤回') => {
       if (val !== '撤回') {
-        if (snaps.length === 0) return MessageFu.warning('请添加藏品')
+        if (snaps.length === 0) {
+          if (val === '创建') history.push(`/impStor_edit/2/${id}`)
+          return MessageFu.warning('请添加藏品')
+        }
         if (snaps.some(v => !v.siteNum)) return MessageFu.warning('请输入藏品分库号')
         // 分库号输入重复校验
         const siteNumArr = snaps.map(v => v.siteNum!)

+ 4 - 1
src/pages/D_storeManage/D5moveStor/D5edit/index.tsx

@@ -361,7 +361,10 @@ function D5edit() {
   const lookBtnFu = useCallback(
     async (val: '创建' | '提交' | '撤回') => {
       if (val !== '撤回') {
-        if (snaps.length === 0) return MessageFu.warning('请添加藏品')
+        if (snaps.length === 0) {
+          if (val === '创建') history.push(`/moveStor_edit/2/${id}`)
+          return MessageFu.warning('请添加藏品')
+        }
         if (snaps.some(v => !v.siteNumNew)) return MessageFu.warning('请输入入库分库号')
         // 分库号输入重复校验
         const siteNumArr = snaps.map(v => v.siteNumNew!)

+ 4 - 1
src/pages/D_storeManage/D6putsStor/D6edit/index.tsx

@@ -416,7 +416,10 @@ function D6edit() {
   const lookBtnFu = useCallback(
     async (val: '创建' | '提交' | '撤回') => {
       if (val !== '撤回') {
-        if (snaps.length === 0) return MessageFu.warning('请添加藏品')
+        if (snaps.length === 0) {
+          if (val === '创建') history.push(`/putsStor_edit/2/${id}`)
+          return MessageFu.warning('请添加藏品')
+        }
       }
       const obj = {
         ...topInfo,

+ 4 - 1
src/pages/D_storeManage/D8cancel/D8edit/index.tsx

@@ -276,7 +276,10 @@ function D8edit() {
   const lookBtnFu = useCallback(
     async (val: '创建' | '提交' | '撤回') => {
       if (val !== '撤回') {
-        if (snaps.length === 0) return MessageFu.warning('请添加藏品')
+        if (snaps.length === 0) {
+          if (val === '创建') history.push(`/cancel_edit/2/${id}`)
+          return MessageFu.warning('请添加藏品')
+        }
       }
 
       // 富文本

+ 4 - 1
src/pages/E_goodsStorage/E4repair/E4edit/index.tsx

@@ -308,7 +308,10 @@ function E4edit() {
   const lookBtnFu = useCallback(
     async (val: '创建' | '提交' | '撤回') => {
       if (val !== '撤回') {
-        if (snaps.length === 0) return MessageFu.warning('请添加藏品')
+        if (snaps.length === 0) {
+          if (val === '创建') history.push(`/repair_edit/2/${id}`)
+          return MessageFu.warning('请添加藏品')
+        }
       }
 
       // 富文本