shaogen1995 4 月之前
父节点
当前提交
63a9b7412a

+ 0 - 6
src/pages/B_enterTibet/B3_4page/B3add/data.ts

@@ -1,6 +0,0 @@
-export const B3aForm1 = [
-  { name: '业务名称', key: '' },
-  { name: '发起人', key: '' },
-  { name: '发起部门', key: '' },
-  { name: '业务单号', key: '' }
-]

+ 0 - 17
src/pages/B_enterTibet/B3_4page/B3add/index.module.scss

@@ -1,17 +0,0 @@
-.B3add {
-  background-color: #fff;
-  border-radius: 10px;
-  padding: 15px 24px 0px;
-  position: relative;
-
-  :global {
-    .B3aBtn {
-      position: absolute;
-      bottom: 20px;
-      left: 124px;
-      .ant-btn {
-        margin-right: 20px;
-      }
-    }
-  }
-}

+ 0 - 73
src/pages/B_enterTibet/B3_4page/B3add/index.tsx

@@ -1,73 +0,0 @@
-import React, { useCallback, useRef } from 'react'
-import styles from './index.module.scss'
-import { useParams } from 'react-router-dom'
-import { Button } from 'antd'
-import MyPopconfirm from '@/components/MyPopconfirm'
-import history from '@/utils/history'
-import { MessageFu } from '@/utils/message'
-import B3aTop from './B3aTop'
-
-export const B3TiaoObjUrl = {
-  1: '/entering',
-  2: '/enterTibet',
-  3: '/register',
-  4: '/delete'
-}
-
-export const B3TitObjKey = {
-  '1': '入馆',
-  '2': '入藏',
-  '3': '登记',
-  '4': '删除'
-}
-
-function B3add() {
-  const { key } = useParams<any>()
-
-  // 待完善,各种功能
-
-  // 点击下方按钮
-  const btnClickFu = useCallback(
-    (val: number) => {
-      // 从顶部组件中拿到数据
-      const resData = topRef.current?.resData()
-      console.log('从子组件获取数据', resData)
-
-      if (val === 2) {
-        // 存草稿 当前页保存 不跳转
-        MessageFu.success('草稿保存成功')
-      } else {
-        const url = Reflect.get(B3TiaoObjUrl, key)
-        history.push(`${url}_edit/${key}/${99}`)
-      }
-    },
-    [key]
-  )
-
-  // 点击按钮调用子组件的方法获取数据
-  const topRef = useRef<any>(null)
-
-  return (
-    <div className={styles.B3add}>
-      <div className='pageTitle'>藏品{Reflect.get(B3TitObjKey, key)}-新增</div>
-      <B3aTop info='xx' pageSta='新增' ref={topRef} />
-      {/* 底部按钮 */}
-      <div className='B3aBtn'>
-        <Button type='primary' onClick={() => btnClickFu(1)}>
-          添加藏品
-        </Button>
-        <Button type='primary' onClick={() => btnClickFu(1)}>
-          创建
-        </Button>
-        <Button type='primary' onClick={() => btnClickFu(2)}>
-          存草稿
-        </Button>
-        <MyPopconfirm txtK='取消' onConfirm={() => history.go(-1)} />
-      </div>
-    </div>
-  )
-}
-
-const MemoB3add = React.memo(B3add)
-
-export default MemoB3add

src/pages/B_enterTibet/B3_4page/B3add/B3aTop/index.module.scss → src/pages/B_enterTibet/B3_4page/B3edit/B3aTop/index.module.scss


src/pages/B_enterTibet/B3_4page/B3add/B3aTop/index.tsx → src/pages/B_enterTibet/B3_4page/B3edit/B3aTop/index.tsx


+ 0 - 9
src/pages/B_enterTibet/B3_4page/B3edit/audit.tsx

@@ -1,9 +0,0 @@
-import React from 'react'
-import B3editMain from './main'
-function audit() {
-  return <B3editMain pageSta='审批' />
-}
-
-const MemoBaudit = React.memo(audit)
-
-export default MemoBaudit

+ 20 - 0
src/pages/B_enterTibet/B3_4page/B3edit/data.ts

@@ -0,0 +1,20 @@
+export const B3aForm1 = [
+  { name: '业务名称', key: '' },
+  { name: '发起人', key: '' },
+  { name: '发起部门', key: '' },
+  { name: '业务单号', key: '' }
+]
+
+export const B3TiaoObjUrl = {
+  1: '/entering',
+  2: '/enterTibet',
+  3: '/register',
+  4: '/delete'
+}
+
+export const B3TitObjKey = {
+  '1': '入馆',
+  '2': '入藏',
+  '3': '登记',
+  '4': '删除'
+}

+ 8 - 1
src/pages/B_enterTibet/B3_4page/B3edit/index.tsx

@@ -1,7 +1,14 @@
 import React from 'react'
 import B3editMain from './main'
+import { useParams } from 'react-router-dom'
 function B3edit() {
-  return <B3editMain pageSta='编辑' />
+  const { key } = useParams<any>()
+
+  return (
+    <B3editMain
+      pageSta={key === '1' ? '新增' : key === '2' ? '编辑' : key === '3' ? '审批' : '查看'}
+    />
+  )
 }
 
 const MemoB3edit = React.memo(B3edit)

+ 0 - 9
src/pages/B_enterTibet/B3_4page/B3edit/look.tsx

@@ -1,9 +0,0 @@
-import React from 'react'
-import B3editMain from './main'
-function look() {
-  return <B3editMain pageSta='查看' />
-}
-
-const MemoBlook = React.memo(look)
-
-export default MemoBlook

+ 54 - 9
src/pages/B_enterTibet/B3_4page/B3edit/main.tsx

@@ -1,21 +1,34 @@
-import React, { useCallback, useMemo, useRef } from 'react'
+import React, { useCallback, useEffect, useMemo, useRef } from 'react'
 import styles from './index.module.scss'
 import { useParams } from 'react-router-dom'
-import B3aTop from '../B3add/B3aTop'
 import { TypeB3PageSta } from '../type'
 import { Button } from 'antd'
 import MyPopconfirm from '@/components/MyPopconfirm'
 import history from '@/utils/history'
-import { B3TiaoObjUrl, B3TitObjKey } from '../B3add'
 import B3goodsTable from '../../B3goodsTable'
 import B3flowTable from '../../B3flowTable'
+import { B3TiaoObjUrl, B3TitObjKey } from './data'
+import B3aTop from './B3aTop'
+import { MessageFu } from '@/utils/message'
 
 type Props = {
   pageSta: TypeB3PageSta
 }
 
 function B3editMain({ pageSta }: Props) {
-  const { key, id } = useParams<any>()
+  const { key, id, pageKey } = useParams<any>()
+
+  useEffect(() => {
+    // key 1 2 3 4 新增 编辑 审批 查看
+    // pageKey 1 2 3 4 入馆 入藏 登记 删除
+    console.log('待完善', key, id)
+  }, [id, key])
+
+  useEffect(() => {
+    // key改变的时候,滚动到顶部  并且更新数据
+    const dom = document.querySelector('#B3aTop') as HTMLDivElement
+    if (dom) dom.scrollTop = 0
+  }, [key])
 
   // 点击按钮调用子组件的方法获取数据
   const topRef = useRef<any>(null)
@@ -23,6 +36,24 @@ function B3editMain({ pageSta }: Props) {
   // 藏品清单子组件
   const goodsTableRef = useRef<any>(null)
 
+  // 新增的按钮点击
+  const btnClickFu = useCallback(
+    (val: number) => {
+      // 从顶部组件中拿到数据
+      const resData = topRef.current?.resData()
+      console.log('从子组件获取数据', resData)
+
+      if (val === 2) {
+        // 存草稿 当前页保存 不跳转
+        MessageFu.success('草稿保存成功')
+      } else {
+        const url = Reflect.get(B3TiaoObjUrl, pageKey)
+        history.push(`${url}_edit/2/${99}/${pageKey}`)
+      }
+    },
+    [pageKey]
+  )
+
   // 点击保存
   const btnOk = useCallback(async () => {
     console.log(pageSta, '编辑、审批逻辑判断')
@@ -37,9 +68,9 @@ function B3editMain({ pageSta }: Props) {
 
   // 点击取消
   const btnX = useCallback(() => {
-    let url = Reflect.get(B3TiaoObjUrl, key)
+    let url = Reflect.get(B3TiaoObjUrl, pageKey)
     history.push(url)
-  }, [key])
+  }, [pageKey])
 
   // const lookBtnFu = useCallback((val: string) => {
   //   const obj = {
@@ -90,8 +121,7 @@ function B3editMain({ pageSta }: Props) {
     <div className={styles.B3editMain}>
       <div className='pageTitle'>
         {/* 待完善id */}
-        藏品{Reflect.get(B3TitObjKey, key)}-{pageSta}
-        {id}
+        藏品{Reflect.get(B3TitObjKey, pageKey)}-{pageSta}
       </div>
 
       <B3aTop
@@ -101,7 +131,7 @@ function B3editMain({ pageSta }: Props) {
         Dom={
           <>
             {/* 藏品清单 */}
-            <B3goodsTable ref={goodsTableRef} pageSta={pageSta} />
+            {pageSta === '新增' ? null : <B3goodsTable ref={goodsTableRef} pageSta={pageSta} />}
 
             {/* 申请流程 */}
             {['查看', '审批'].includes(pageSta) ? <B3flowTable /> : null}
@@ -118,6 +148,21 @@ function B3editMain({ pageSta }: Props) {
           </Button>
         ) : null}
 
+        {pageSta === '新增' ? (
+          <>
+            {' '}
+            <Button type='primary' onClick={() => btnClickFu(1)}>
+              添加藏品
+            </Button>
+            <Button type='primary' onClick={() => btnClickFu(1)}>
+              创建
+            </Button>
+            <Button type='primary' onClick={() => btnClickFu(2)}>
+              存草稿
+            </Button>
+          </>
+        ) : null}
+
         {pageSta === '查看' ? lookBtn : <MyPopconfirm txtK='取消' onConfirm={() => btnX()} />}
       </div>
     </div>

+ 8 - 16
src/pages/B_enterTibet/B3_4page/index.tsx

@@ -1,7 +1,7 @@
 import React, { useCallback, useEffect, useMemo, useRef, useState } from 'react'
 import styles from './index.module.scss'
 import { Button, DatePicker, Input, Select } from 'antd'
-import { TypeB3Form, TypeB3PageSta } from './type'
+import { TypeB3Form } from './type'
 import dayjs from 'dayjs'
 import MyTable from '@/components/MyTable'
 import MyPopconfirm from '@/components/MyPopconfirm'
@@ -138,20 +138,12 @@ function B34page({ pageSta }: Props) {
 
   // 点击各种操作按钮
   const btnFu = useCallback(
-    (val: TypeB3PageSta, id: number | string) => {
+    (id: number | string, key: string) => {
       const url = Reflect.get(objUrl, pageSta)
 
-      const key = Reflect.get(objKey, pageSta)
+      const pagekey = Reflect.get(objKey, pageSta)
 
-      if (val === '新增') {
-        history.push(`${url}_add/${key}/null`)
-      } else if (val === '编辑') {
-        history.push(`${url}_edit/${key}/${id}`)
-      } else if (val === '审批') {
-        history.push(`${url}_audit/${key}/${id}`)
-      } else {
-        history.push(`${url}_look/${key}/${id}`)
-      }
+      history.push(`${url}_edit/${key}/${id}/${pagekey}`)
     },
     [pageSta]
   )
@@ -164,13 +156,13 @@ function B34page({ pageSta }: Props) {
         render: (item: any) => {
           return (
             <>
-              <Button size='small' type='text' onClick={() => btnFu('编辑', item.id)}>
+              <Button size='small' type='text' onClick={() => btnFu(item.id, '2')}>
                 编辑
               </Button>
-              <Button size='small' type='text' onClick={() => btnFu('审批', item.id)}>
+              <Button size='small' type='text' onClick={() => btnFu(item.id, '3')}>
                 审批
               </Button>
-              <Button size='small' type='text' onClick={() => btnFu('查看', item.id)}>
+              <Button size='small' type='text' onClick={() => btnFu(item.id, '4')}>
                 查看
               </Button>
               <MyPopconfirm txtK='删除' onConfirm={() => delTableFu(item.id)} />
@@ -201,7 +193,7 @@ function B34page({ pageSta }: Props) {
         </div>
         <div className='B3toprr'>
           <Button type='primary'>批量导出</Button>&emsp;
-          <Button type='primary' onClick={() => btnFu('新增', 'null')}>
+          <Button type='primary' onClick={() => btnFu('null', '1')}>
             新增
           </Button>
         </div>

+ 2 - 2
src/pages/D_storeManage/D4impStor/D4edit/index.tsx

@@ -2,7 +2,7 @@ import React, { useCallback, useEffect, useMemo, useRef, useState } from 'react'
 import styles from './index.module.scss'
 import { useParams } from 'react-router-dom'
 import { Button, Cascader, DatePicker, Input, Select } from 'antd'
-import { B3aForm1 } from '@/pages/B_enterTibet/B3_4page/B3add/data'
+import { B3aForm1 } from '@/pages/B_enterTibet/B3_4page/B3edit/data'
 import dayjs from 'dayjs'
 import Z3upFiles from '@/components/Z3upFiles'
 import ZRichTexts from '@/components/ZRichTexts'
@@ -67,7 +67,7 @@ function D4edit() {
     const rtf2 = ZAuditRef.current?.resData()
     console.log('审批信息富文本', rtf2)
 
-    if (1 + 1 === 2) return
+    // if (1 + 1 === 2) return
 
     if (val === 2) {
       // 存草稿 当前页保存 不跳转

+ 15 - 94
src/pages/Layout/data.ts

@@ -271,122 +271,43 @@ export const routerSon: RouterTypeRow = [
     path: '/storSet_site/:id',
     Com: React.lazy(() => import('../D_storeManage/D2storSet/D2site'))
   },
-  // {
-  //   id: 3,
-  //   name: '库房管理-查看藏品详情',
-  //   path: '/storage_look/:id',
-  //   Com: React.lazy(() => import('../Y_goodsDetails/Y2look'))
-  // },
 
+  // -------------入馆 - 入藏 - 登记 -删除-------------------
   {
-    id: 4,
-    name: '藏品入馆-新增',
-    path: '/entering_add/:key',
-    Com: React.lazy(() => import('../B_enterTibet/B3_4page/B3add'))
-  },
-  {
-    id: 5,
-    name: '藏品入藏-新增',
-    path: '/enterTibet_add/:key',
-    Com: React.lazy(() => import('../B_enterTibet/B3_4page/B3add'))
-  },
-  {
-    id: 6,
-    name: '藏品登记-新增',
-    path: '/register_add/:key',
-    Com: React.lazy(() => import('../B_enterTibet/B3_4page/B3add'))
-  },
-  {
-    id: 7,
-    name: '藏品删除-新增',
-    path: '/delete_add/:key',
-    Com: React.lazy(() => import('../B_enterTibet/B3_4page/B3add'))
-  },
-  {
-    id: 8,
-    name: '藏品入馆-新增/编辑/审批/查看',
-    path: '/entering_edit/:key/:id',
+    id: 3,
+    name: '藏品 入馆 新增/编辑/审批/查看',
+    path: '/entering_edit/:key/:id/:pageKey',
     Com: React.lazy(() => import('../B_enterTibet/B3_4page/B3edit'))
   },
   {
-    id: 9,
-    name: '藏品入藏-编辑',
-    path: '/enterTibet_edit/:key/:id',
+    id: 4,
+    name: '藏品 入藏 新增-编辑/审批/查看',
+    path: '/enterTibet_edit/:key/:id/:pageKey',
     Com: React.lazy(() => import('../B_enterTibet/B3_4page/B3edit'))
   },
   {
-    id: 10,
-    name: '藏品登记-编辑',
-    path: '/register_edit/:key/:id',
+    id: 5,
+    name: '藏品 登记 新增-编辑/审批/查看',
+    path: '/register_edit/:key/:id/:pageKey',
     Com: React.lazy(() => import('../B_enterTibet/B3_4page/B3edit'))
   },
   {
-    id: 11,
-    name: '藏品删除-编辑',
-    path: '/delete_edit/:key/:id',
+    id: 6,
+    name: '藏品 删除 新增-编辑/审批/查看',
+    path: '/delete_edit/:key/:id/:pageKey',
     Com: React.lazy(() => import('../B_enterTibet/B3_4page/B3edit'))
   },
 
-  {
-    id: 12,
-    name: '藏品入馆-审批',
-    path: '/entering_audit/:key/:id',
-    Com: React.lazy(() => import('../B_enterTibet/B3_4page/B3edit/audit'))
-  },
-  {
-    id: 13,
-    name: '藏品入藏-审批',
-    path: '/enterTibet_audit/:key/:id',
-    Com: React.lazy(() => import('../B_enterTibet/B3_4page/B3edit/audit'))
-  },
-  {
-    id: 14,
-    name: '藏品登记-审批',
-    path: '/register_audit/:key/:id',
-    Com: React.lazy(() => import('../B_enterTibet/B3_4page/B3edit/audit'))
-  },
-
-  {
-    id: 15,
-    name: '藏品删除-审批',
-    path: '/delete_audit/:key/:id',
-    Com: React.lazy(() => import('../B_enterTibet/B3_4page/B3edit/audit'))
-  },
-
-  {
-    id: 16,
-    name: '藏品入馆-查看',
-    path: '/entering_look/:key/:id',
-    Com: React.lazy(() => import('../B_enterTibet/B3_4page/B3edit/look'))
-  },
-  {
-    id: 17,
-    name: '藏品入藏-查看',
-    path: '/enterTibet_look/:key/:id',
-    Com: React.lazy(() => import('../B_enterTibet/B3_4page/B3edit/look'))
-  },
-  {
-    id: 18,
-    name: '藏品登记-查看',
-    path: '/register_look/:key/:id',
-    Com: React.lazy(() => import('../B_enterTibet/B3_4page/B3edit/look'))
-  },
-  {
-    id: 19,
-    name: '藏品删除-查看',
-    path: '/delete_look/:key/:id',
-    Com: React.lazy(() => import('../B_enterTibet/B3_4page/B3edit/look'))
-  },
   // -------------入库-----------------
   {
-    id: 20,
+    id: 7,
     name: '入库-新增/编辑/审批/查看',
     path: '/impStor_edit/:key/:id',
     Com: React.lazy(() => import('../D_storeManage/D4impStor/D4edit'))
   },
   // -------------出库-----------------
   {
-    id: 21,
+    id: 8,
     name: '出库-新增/编辑/审批/查看',
     path: '/putsStor_edit/:key/:id',
     Com: React.lazy(() => import('../D_storeManage/D6putsStor/D6edit'))

+ 11 - 21
src/pages/X_stock/X2lookText/index.tsx

@@ -18,27 +18,17 @@ function X2lookText({ closeFu }: Props) {
       }
     >
       <div className='YtMain'>
-        <h1>asdasd</h1>
-        <h1>asdasd</h1>
-        <h1>asdasd</h1>
-        <h1>asdasd</h1>
-        <h1>asdasd</h1>
-        <h1>asdasd</h1>
-        <h1>asdasd</h1>
-        <h1>asdasd</h1>
-        <h1>asdasd</h1>
-        <h1>asdasd</h1>
-        <h1>asdasd</h1>
-        <h1>asdasd</h1>
-        <h1>asdasd</h1>
-        <h1>asdasd</h1>
-        <h1>asdasd</h1>
-        <h1>asdasd</h1>
-        <h1>asdasd</h1>
-        <h1>asdasd</h1>
-        <h1>asdasd</h1>
-        <h1>asdasd</h1>
-        <h1>asdasd</h1>
+        <h1>不同意</h1>
+        <h1>xxxxxx</h1>
+        <h1>xxxxxx</h1>
+        <h1>xxxxxx</h1>
+        <h1>xxxxxx</h1>
+        <h1>xxxxxx</h1>
+        <h1>xxxxxx</h1>
+        <h1>xxxxxx</h1>
+        <h1>xxxxxx</h1>
+        <h1>xxxxxx</h1>
+        <h1>xxxxxx</h1>
       </div>
 
       <div className='YtBtn'>

+ 1 - 1
src/utils/http.ts

@@ -8,7 +8,7 @@ import { domShowFu } from './domShow'
 const envFlag = process.env.NODE_ENV === 'development'
 
 // 待完善
-// const baseUrlTemp = 'https://sit-liushaoqibwg.4dage.com' // 测试环境
+// const baseUrlTemp = 'https://sit-yiwubwg.4dage.com' // 测试环境
 const baseUrlTemp = 'http://192.168.20.61:8096' // 线下环境
 
 const baseFlag = baseUrlTemp.includes('https://')