Bladeren bron

增加征集管理等...验收需求

shaogen1995 1 maand geleden
bovenliggende
commit
13cabad0bb
30 gewijzigde bestanden met toevoegingen van 2596 en 956 verwijderingen
  1. 2 1
      public/baseUrl.js
  2. 16 16
      src/components/LeftBar/index.tsx
  3. 33 11
      src/components/LookObjTable/LookModal.tsx
  4. 15 0
      src/components/LookObjTable/index.css
  5. 20 7
      src/components/LookObjTable/index.less
  6. 41 41
      src/components/LookObjTable/index.tsx
  7. 109 38
      src/components/ObjectAdd/index.tsx
  8. 140 123
      src/pages/Object/index.tsx
  9. 192 162
      src/pages/ObjectSon/Object1/AddObject1/index.tsx
  10. 78 85
      src/pages/ObjectSon/Object1/AuditObject1/index.tsx
  11. 144 0
      src/pages/ObjectSon/Object1/GoodsAll.tsx
  12. 10 7
      src/pages/ObjectSon/Object1/LookObject1/index.tsx
  13. 142 169
      src/pages/ObjectSon/Object3/AddObject3/index.tsx
  14. 86 0
      src/pages/ObjectSon/Object7/AddObject7/index.module.scss
  15. 320 0
      src/pages/ObjectSon/Object7/AddObject7/index.tsx
  16. 80 0
      src/pages/ObjectSon/Object7/AuditObject7/index.module.scss
  17. 155 0
      src/pages/ObjectSon/Object7/AuditObject7/index.tsx
  18. 55 0
      src/pages/ObjectSon/Object7/LookObject7/index.module.scss
  19. 123 0
      src/pages/ObjectSon/Object7/LookObject7/index.tsx
  20. 8 0
      src/pages/ObjectSon/Object7/data.ts
  21. 4 0
      src/pages/ObjectSon/Object7/index.module.scss
  22. 313 0
      src/pages/ObjectSon/Object7/index.tsx
  23. 215 216
      src/pages/SystemSon/System2/index.tsx
  24. 19 4
      src/store/action/object1.ts
  25. 135 0
      src/store/action/object7.ts
  26. 16 14
      src/store/reducer/index.ts
  27. 41 39
      src/store/reducer/login.ts
  28. 31 22
      src/store/reducer/object1.ts
  29. 52 0
      src/store/reducer/object7.ts
  30. 1 1
      src/utils/http.ts

+ 2 - 1
public/baseUrl.js

@@ -1 +1,2 @@
-const baseUrlHttp='https://lsbwg.4dage.com'
+const baseUrlHttp = 'https://lsbwg.4dage.com'
+// const baseUrlHttp = 'http://192.168.20.61:8038/api/'

+ 16 - 16
src/components/LeftBar/index.tsx

@@ -1,29 +1,29 @@
-import styles from "./index.module.scss";
-import classNames from "classnames";
-import history from "@/utils/history";
-import { useLocation } from "react-router-dom";
-import { useEffect, useState } from "react";
+import styles from './index.module.scss'
+import classNames from 'classnames'
+import history from '@/utils/history'
+import { useLocation } from 'react-router-dom'
+import { useEffect, useState } from 'react'
 export default function LeftBar({ data }: any) {
   const cutRouter = (path: string) => {
-    history.push(path);
-  };
-  const location = useLocation();
+    history.push(path)
+  }
+  const location = useLocation()
 
-  const [pathId, setPathId] = useState(1);
+  const [pathId, setPathId] = useState(1)
   useEffect(() => {
-    const arr = location.pathname.split("/");
-    let id = 1;
-    if (arr[2]) id = Number(arr[2]);
+    const arr = location.pathname.split('/')
+    let id = arr[1] === 'object' ? 7 : 1
+    if (arr[2]) id = Number(arr[2])
 
-    setPathId(id);
-  }, [location]);
+    setPathId(id)
+  }, [location])
   return (
     <div className={styles.LeftBar}>
       {data.length > 0
         ? data.map((v: any) => (
             <div
               onClick={() => cutRouter(v.path)}
-              className={classNames("leftRow", v.id === pathId ? "active" : "")}
+              className={classNames('leftRow', v.id === pathId ? 'active' : '')}
               key={v.id}
             >
               <div></div>
@@ -33,5 +33,5 @@ export default function LeftBar({ data }: any) {
           ))
         : null}
     </div>
-  );
+  )
 }

+ 33 - 11
src/components/LookObjTable/LookModal.tsx

@@ -1,6 +1,6 @@
 import React, { useCallback, useEffect, useMemo, useState } from 'react'
 import classNames from 'classnames'
-import { Button, Modal, Select, Table } from 'antd'
+import { Button, Cascader, Modal, Select, Table } from 'antd'
 import { useDispatch, useSelector } from 'react-redux'
 import { RootState } from '@/store'
 import ImageLazy from '../ImageLazy'
@@ -11,9 +11,10 @@ type Props = {
   show: boolean
   closeShow: any
   id: number
+  isZj?: boolean
 }
 
-function LookModal({ show, closeShow, id }: Props) {
+function LookModal({ show, closeShow, id, isZj }: Props) {
   const dispatch = useDispatch()
   // 根据id发送请求把数据存到仓库
 
@@ -95,6 +96,9 @@ function LookModal({ show, closeShow, id }: Props) {
     return tempArr
   }, [fileSelect])
 
+  // 从仓库中获取库房总信息
+  const storesAllList = useSelector((state: RootState) => state.stores1Store.infoList)
+
   return (
     <>
       <Modal
@@ -169,30 +173,30 @@ function LookModal({ show, closeShow, id }: Props) {
           <div className='row'>
             <div>
               <span>实际数量:</span>
-              <p>{info.pcs}</p>
+              <p>{info.pcs || '-'}</p>
             </div>
             <div>
               <span>文物级别:</span>
-              <p>{info.dictLevel}</p>
+              <p>{info.dictLevel || '-'}</p>
             </div>
           </div>
           <div className='rowFull'>
             <span>外形尺寸:</span>
-            <p dangerouslySetInnerHTML={{ __html: sizeRes }}></p>
+            <p dangerouslySetInnerHTML={{ __html: sizeRes || '-' }}></p>
           </div>
           <div className='rowFull'>
             <span>具体尺寸:</span>
-            <p>{info.sizeSpecific}</p>
+            <p>{info.sizeSpecific || '-'}</p>
           </div>
 
           <div className='row'>
             <div>
               <span>质量范围:</span>
-              <p>{info.dictQualityScope}</p>
+              <p>{info.dictQualityScope || '-'}</p>
             </div>
             <div>
               <span>具体质量:</span>
-              <p>{qualityRes}</p>
+              <p>{qualityRes || '-'}</p>
             </div>
           </div>
 
@@ -210,7 +214,7 @@ function LookModal({ show, closeShow, id }: Props) {
           <div className='row'>
             <div>
               <span>入藏时间范围:</span>
-              <p>{info.dictCheckInScope}</p>
+              <p>{info.dictCheckInScope || '-'}</p>
             </div>
             <div>
               <span>入藏年度:</span>
@@ -242,8 +246,26 @@ function LookModal({ show, closeShow, id }: Props) {
             <p>{info.remark ? info.remark : '-'}</p>
           </div>
           <div className='rowFull'>
-            <span>展示状态:</span>
-            <p>{info.display ? '是' : '否'}</p>
+            <span>{isZj ? '入库建议' : '展示状态'}:</span>
+
+            {isZj ? (
+              info.inSuggest ? (
+                <Cascader
+                  value={JSON.parse(info.inSuggest)}
+                  fieldNames={{
+                    label: 'name',
+                    value: 'id',
+                    children: 'children'
+                  }}
+                  onChange={e => {}}
+                  options={storesAllList}
+                />
+              ) : (
+                '-'
+              )
+            ) : (
+              <p>{info.display ? '是' : '否'}</p>
+            )}
           </div>
         </div>
 

+ 15 - 0
src/components/LookObjTable/index.css

@@ -59,6 +59,21 @@
 .lookObjTable .goodsInfo .rowFull p {
   width: calc(100% - 110px);
 }
+.lookObjTable .goodsInfo .rowFull .ant-cascader {
+  pointer-events: none !important;
+}
+.lookObjTable .goodsInfo .rowFull .ant-select-selector {
+  border: none !important;
+  pointer-events: none !important;
+  height: 22px !important;
+}
+.lookObjTable .goodsInfo .rowFull .ant-select-arrow {
+  display: none !important;
+}
+.lookObjTable .goodsInfo .rowFull .ant-select-selection-item {
+  height: 22px !important;
+  line-height: 22px !important;
+}
 .lookObjTable .goodsBtn {
   margin-top: 20px;
   text-align: center;

+ 20 - 7
src/components/LookObjTable/index.less

@@ -12,7 +12,7 @@
     display: flex;
     margin-bottom: 15px;
 
-    &>div {
+    & > div {
       cursor: pointer;
       width: 50%;
       height: 30px;
@@ -33,12 +33,11 @@
   }
 
   .goodsInfo {
-
     .row {
       display: flex;
       width: 100%;
 
-      &>div {
+      & > div {
         padding: 5px;
         width: 50%;
         display: flex;
@@ -56,7 +55,7 @@
         }
       }
     }
-    .rowFull{
+    .rowFull {
       display: flex;
       padding: 5px;
       border: 1px solid #ccc;
@@ -70,6 +69,22 @@
       p {
         width: calc(100% - 110px);
       }
+      // 下拉框控制
+      .ant-cascader {
+        pointer-events: none !important;
+      }
+      .ant-select-selector {
+        border: none !important;
+        pointer-events: none !important;
+        height: 22px !important;
+      }
+      .ant-select-arrow {
+        display: none !important;
+      }
+      .ant-select-selection-item {
+        height: 22px !important;
+        line-height: 22px !important;
+      }
     }
 
     // .rowThree {
@@ -90,7 +105,6 @@
     //     }
     //   }
     // }
-
   }
 
   .goodsBtn {
@@ -99,7 +113,6 @@
   }
 
   .goodsFile {
-
     .row {
       width: 100%;
       display: flex;
@@ -117,4 +130,4 @@
       }
     }
   }
-}
+}

+ 41 - 41
src/components/LookObjTable/index.tsx

@@ -1,95 +1,95 @@
-import { Button, Table } from "antd";
-import React, { useCallback, useMemo, useRef, useState } from "react";
-import ImageLazy from "../ImageLazy";
-import LookModal from "./LookModal";
+import { Button, Table } from 'antd'
+import React, { useCallback, useMemo, useRef, useState } from 'react'
+import ImageLazy from '../ImageLazy'
+import LookModal from './LookModal'
 
 type Props = {
-  data: any;
-  y: number;
-};
+  data: any
+  y: number
+  isZj?: boolean
+}
 
-function LookObjTable({ data, y }: Props) {
-  const lookIdRef = useRef(-1);
+function LookObjTable({ data, y, isZj }: Props) {
+  const lookIdRef = useRef(-1)
 
   // 点击表格里面的查看
   const lookGoods = useCallback((id: number) => {
-    lookIdRef.current = id;
-    setShow(true);
-  }, []);
+    lookIdRef.current = id
+    setShow(true)
+  }, [])
 
   // 外层表格格式
   const columns = useMemo(() => {
     const tempArr = [
       {
-        title: "缩略图",
-        render: (item: any) => (
-          <ImageLazy width={120} height={70} src={item.thumb} />
-        ),
+        title: '缩略图',
+        render: (item: any) => <ImageLazy width={120} height={70} src={item.thumb} />
       },
       {
-        title: "藏品编号名称",
-        dataIndex: "dictNum",
+        title: '藏品编号名称',
+        dataIndex: 'dictNum'
       },
       {
-        title: "藏品编号",
-        render: (item: any) => (item.num ? item.num : "-"),
+        title: '藏品编号',
+        render: (item: any) => (item.num ? item.num : '-')
       },
       {
-        title: "藏品名称",
-        dataIndex: "name",
+        title: '藏品名称',
+        dataIndex: 'name'
       },
       {
-        title: "类别",
-        dataIndex: "dictGoodType",
+        title: '类别',
+        dataIndex: 'dictGoodType'
       },
       {
-        title: "完残程度",
-        dataIndex: "complete",
+        title: '完残程度',
+        dataIndex: 'complete'
       },
       {
-        title: "年代",
-        dataIndex: "dictAge",
+        title: '年代',
+        dataIndex: 'dictAge'
       },
       {
-        title: "操作",
+        title: '操作',
         render: (item: any) => (
           <>
-            <Button type="text" danger onClick={() => lookGoods(item.id)}>
+            <Button type='text' danger onClick={() => lookGoods(item.id)}>
               查看
             </Button>
           </>
-        ),
-      },
-    ];
+        )
+      }
+    ]
 
-    return tempArr;
-  }, [lookGoods]);
+    return tempArr
+  }, [lookGoods])
 
   // 控制弹窗的显示隐藏
-  const [show, setShow] = useState(false);
+  const [show, setShow] = useState(false)
 
   return (
     <div>
       <Table
-        size="small"
+        size='small'
         scroll={{ y }}
         dataSource={data}
         columns={columns}
-        rowKey="id"
+        rowKey='id'
         pagination={false}
       />
       {/* 点击查看出来的对话框 */}
       {show ? (
         <LookModal
+          isZj={isZj}
           id={lookIdRef.current}
           show={show}
           closeShow={() => setShow(false)}
         />
       ) : null}
     </div>
-  );
+  )
 }
 
-const MemoLookObjTable = React.memo(LookObjTable);
+const MemoLookObjTable = React.memo(LookObjTable)
 
-export default MemoLookObjTable;
+export default MemoLookObjTable

+ 109 - 38
src/components/ObjectAdd/index.tsx

@@ -28,6 +28,7 @@ import {
 import { goodsChangeObj } from '@/utils/dataChange'
 import { editObj2GoodsAPI } from '@/store/action/object2'
 import { MessageFu } from '@/utils/message'
+import { delInfileAPI7, goodsSonAddAPIZJ } from '@/store/action/object7'
 const { Option } = Select
 
 type Props = {
@@ -36,9 +37,26 @@ type Props = {
   editId?: any
   dirCode: any
   upInfoAPIFu?: any
+  // 订单id
+  orderId?: number
+  isZJ?: boolean
+  // 从藏品登记里面选择征集的藏品,并且编辑
+  isZJbyDJ?: boolean
 }
 
-function ObjectAdd({ id, colsePage, editId, dirCode, upInfoAPIFu }: Props) {
+function ObjectAdd({
+  id,
+  colsePage,
+  editId,
+  dirCode,
+  upInfoAPIFu,
+  isZJ,
+  isZJbyDJ,
+  orderId
+}: Props) {
+  // 从仓库中获取库房总信息
+  const storesAllList = useSelector((state: RootState) => state.stores1Store.infoList)
+
   const dispatch = useDispatch()
 
   // 没有通过校验
@@ -87,7 +105,13 @@ function ObjectAdd({ id, colsePage, editId, dirCode, upInfoAPIFu }: Props) {
       registerId: dirCode,
       dictAge,
       dictTexture,
-      display: values.display
+      display: values.display,
+      inSuggest: values.inSuggest ? JSON.stringify(values.inSuggest) : ''
+    }
+
+    if (editId !== 'edit') {
+      obj.moduleId = orderId
+      obj.moduleType = isZJ ? 'ZJ' : 'DJ'
     }
 
     // -----------------藏品修改
@@ -146,6 +170,17 @@ function ObjectAdd({ id, colsePage, editId, dirCode, upInfoAPIFu }: Props) {
 
       console.log('旧数据', before)
       console.log('新数据', after)
+    } else if (isZJ) {
+      // ------------征集管理新增和编辑
+      await dispatch(goodsSonAddAPIZJ(obj, id, isZJbyDJ))
+
+      // 真正的删除
+      if (delFileList.current.length) {
+        await delInfileAPI7(delFileList.current.join(','))
+      }
+
+      //  关闭弹窗
+      colsePage()
     } else {
       // ------------藏品新增和编辑
       await dispatch(goodsSonAddAPI(obj, id))
@@ -203,7 +238,11 @@ function ObjectAdd({ id, colsePage, editId, dirCode, upInfoAPIFu }: Props) {
         size3: size[2],
         quality: quality[0],
         dictAge,
-        dictTexture
+        dictTexture,
+        inSuggest: data.inSuggest ? JSON.parse(data.inSuggest) : '',
+        dictQualityScope: data.dictQualityScope ? data.dictQualityScope : null,
+        repair: data.repair ? data.repair : null,
+        dictCheckInScope: options9[0].name ? options9[0].name : null
       })
       // 具体质量的单位
       setDanweiValue(quality[1])
@@ -223,7 +262,7 @@ function ObjectAdd({ id, colsePage, editId, dirCode, upInfoAPIFu }: Props) {
       // 修改附件仓库信息
       dispatch({ type: 'login/setFileData', payload: fileData })
     },
-    [dispatch]
+    [dispatch, options9]
   )
 
   // 进页面看看是编辑就 从仓库获取信息,新增就设置默认值
@@ -582,9 +621,11 @@ function ObjectAdd({ id, colsePage, editId, dirCode, upInfoAPIFu }: Props) {
             </div>
             {/* 实际数量----------文物级别 */}
             <div className='formRow'>
-              <div className='bs bs3'>*</div>
+              <div className={classNames(isZJ && !isZJbyDJ ? '' : 'bs bs3')}>
+                {isZJ && !isZJbyDJ ? '' : '*'}
+              </div>
               <Form.Item
-                rules={[{ required: true, message: '不能为空!' }]}
+                rules={[{ required: isZJ && !isZJbyDJ ? false : true, message: '不能为空!' }]}
                 label='实际数量'
                 name='pcs'
               >
@@ -592,6 +633,7 @@ function ObjectAdd({ id, colsePage, editId, dirCode, upInfoAPIFu }: Props) {
               </Form.Item>
               <Form.Item label='文物级别' name='dictLevel'>
                 <Select
+                  allowClear={isZJ && !isZJbyDJ ? true : false}
                   placeholder='请选择'
                   options={options5.map((v: any) => ({
                     label: v.name,
@@ -600,21 +642,26 @@ function ObjectAdd({ id, colsePage, editId, dirCode, upInfoAPIFu }: Props) {
                 />
               </Form.Item>
             </div>
+
             {/* 外形尺寸----------通长,宽,高 */}
             <div className='formRow formRowThree'>
               <Form.Item
-                rules={[{ required: true, message: '不能为空!' }]}
+                rules={[{ required: isZJ && !isZJbyDJ ? false : true, message: '不能为空!' }]}
                 label='外形尺寸'
                 name='size1'
               >
                 <InputNumber min={1} maxLength={8} placeholder='通长' addonAfter='cm' />
               </Form.Item>
-              <Form.Item rules={[{ required: true, message: '不能为空!' }]} label='' name='size2'>
+              <Form.Item
+                rules={[{ required: isZJ && !isZJbyDJ ? false : true, message: '不能为空!' }]}
+                label=''
+                name='size2'
+              >
                 <InputNumber min={1} maxLength={8} placeholder='通宽' addonAfter='cm' />
               </Form.Item>
               <Form.Item
                 className='formRowThreeRow'
-                rules={[{ required: true, message: '不能为空!' }]}
+                rules={[{ required: isZJ && !isZJbyDJ ? false : true, message: '不能为空!' }]}
                 label=''
                 name='size3'
               >
@@ -626,7 +673,7 @@ function ObjectAdd({ id, colsePage, editId, dirCode, upInfoAPIFu }: Props) {
               <Form.Item
                 label='具体尺寸'
                 name='sizeSpecific'
-                rules={[{ required: true, message: '不能为空!' }]}
+                rules={[{ required: isZJ && !isZJbyDJ ? false : true, message: '不能为空!' }]}
                 getValueFromEvent={e => e.target.value.replace(/\s+/g, '')}
               >
                 <Input maxLength={50} showCount placeholder='请输入' />
@@ -634,9 +681,12 @@ function ObjectAdd({ id, colsePage, editId, dirCode, upInfoAPIFu }: Props) {
             </div>
             {/* 质量范围----------具体质量 */}
             <div className='formRow'>
-              <div className='bs bs4'>*</div>
+              <div className={classNames(isZJ && !isZJbyDJ ? '' : 'bs bs4')}>
+                {isZJ && !isZJbyDJ ? '' : '*'}
+              </div>
               <Form.Item label='质量范围' name='dictQualityScope'>
                 <Select
+                  allowClear={isZJ && !isZJbyDJ ? true : false}
                   placeholder='请选择'
                   options={options6.map((v: any) => ({
                     label: v.name,
@@ -683,22 +733,26 @@ function ObjectAdd({ id, colsePage, editId, dirCode, upInfoAPIFu }: Props) {
                 />
               </Form.Item>
             </div>
+
             {/* 入藏时间范围----------入藏年度 */}
-            <div className='formRow'>
-              <div className='bs'>*</div>
-              <Form.Item label='入藏时间范围' name='dictCheckInScope'>
-                <Select
-                  placeholder='请选择'
-                  options={options9.map((v: any) => ({
-                    label: v.name,
-                    value: v.name
-                  }))}
-                />
-              </Form.Item>
-              <Form.Item label='入藏年度' name='checkInYear'>
-                <InputNumber min={1000} maxLength={4} placeholder='请输入数字' />
-              </Form.Item>
-            </div>
+            {isZJ && !isZJbyDJ ? null : (
+              <div className='formRow'>
+                <div className='bs'>*</div>
+                <Form.Item label='入藏时间范围' name='dictCheckInScope'>
+                  <Select
+                    placeholder='请选择'
+                    options={options9.map((v: any) => ({
+                      label: v.name,
+                      value: v.name
+                    }))}
+                  />
+                </Form.Item>
+                <Form.Item label='入藏年度' name='checkInYear'>
+                  <InputNumber min={1000} maxLength={4} placeholder='请输入数字' />
+                </Form.Item>
+              </div>
+            )}
+
             {/* 著者----------版本 */}
             <div className='formRow'>
               <Form.Item label='著者' name='author'>
@@ -728,18 +782,35 @@ function ObjectAdd({ id, colsePage, editId, dirCode, upInfoAPIFu }: Props) {
               </Form.Item>
             </div>
 
-            <div className='formRow formRowLast'>
-              <Form.Item
-                rules={[{ required: true, message: '不能为空!' }]}
-                label='展示状态'
-                name='display'
-              >
-                <Radio.Group>
-                  <Radio value={1}> 是 </Radio>
-                  <Radio value={0}> 否 </Radio>
-                </Radio.Group>
-              </Form.Item>
-            </div>
+            {isZJ && !isZJbyDJ ? (
+              <div className='formRow formRowLast'>
+                <Form.Item label='入库建议' name='inSuggest'>
+                  <Cascader
+                    allowClear={true}
+                    fieldNames={{
+                      label: 'name',
+                      value: 'id',
+                      children: 'children'
+                    }}
+                    options={storesAllList}
+                    placeholder='请选择'
+                  />
+                </Form.Item>
+              </div>
+            ) : (
+              <div className='formRow formRowLast'>
+                <Form.Item
+                  rules={[{ required: true, message: '不能为空!' }]}
+                  label='展示状态'
+                  name='display'
+                >
+                  <Radio.Group>
+                    <Radio value={1}> 是 </Radio>
+                    <Radio value={0}> 否 </Radio>
+                  </Radio.Group>
+                </Form.Item>
+              </div>
+            )}
           </div>
           {/* -----------------------附件信息 */}
           <div hidden={titSelect === 'tit1'}>

+ 140 - 123
src/pages/Object/index.tsx

@@ -1,221 +1,237 @@
-import styles from "./index.module.scss";
-import LeftBar from "@/components/LeftBar";
-import React, { useEffect, useMemo, useState } from "react";
-import SpinLoding from "@/components/SpinLoding";
-import { Route, Switch } from "react-router-dom";
-import AuthRoute from "@/components/AuthRoute";
-import NotFound from "@/components/NotFound";
-import history from "@/utils/history";
-import { useDispatch, useSelector } from "react-redux";
-import { RootState } from "@/store";
-import { getStores1ListAPI } from "@/store/action/stores1";
+import styles from './index.module.scss'
+import LeftBar from '@/components/LeftBar'
+import React, { useEffect, useMemo, useState } from 'react'
+import SpinLoding from '@/components/SpinLoding'
+import { Route, Switch } from 'react-router-dom'
+import AuthRoute from '@/components/AuthRoute'
+import NotFound from '@/components/NotFound'
+import history from '@/utils/history'
+import { useDispatch, useSelector } from 'react-redux'
+import { RootState } from '@/store'
+import { getStores1ListAPI } from '@/store/action/stores1'
 
-const LookObject1 = React.lazy(
-  () => import("../ObjectSon/Object1/LookObject1")
-);
-const LookObject2 = React.lazy(
-  () => import("../ObjectSon/Object2/LookObject2")
-);
-const LookObject3 = React.lazy(
-  () => import("../ObjectSon/Object3/LookObject3")
-);
+const LookObject1 = React.lazy(() => import('../ObjectSon/Object1/LookObject1'))
+const LookObject2 = React.lazy(() => import('../ObjectSon/Object2/LookObject2'))
+const LookObject3 = React.lazy(() => import('../ObjectSon/Object3/LookObject3'))
 
-const LookObject4 = React.lazy(
-  () => import("../ObjectSon/Object4/LookObject4")
-);
-const LookObject5 = React.lazy(
-  () => import("../ObjectSon/Object5/LookObject5")
-);
-const LookObject6 = React.lazy(
-  () => import("../ObjectSon/Object6/LookObject6")
-);
+const LookObject4 = React.lazy(() => import('../ObjectSon/Object4/LookObject4'))
+const LookObject5 = React.lazy(() => import('../ObjectSon/Object5/LookObject5'))
+const LookObject6 = React.lazy(() => import('../ObjectSon/Object6/LookObject6'))
+const LookObject7 = React.lazy(() => import('../ObjectSon/Object7/LookObject7'))
 
 export default function Object() {
-  const dispatch = useDispatch();
+  const dispatch = useDispatch()
   // 进入馆藏管理的时候调用仓库数据
   useEffect(() => {
-    dispatch(getStores1ListAPI());
-  }, [dispatch]);
+    dispatch(getStores1ListAPI())
+  }, [dispatch])
 
-  const powerInfo = useSelector(
-    (state: RootState) => state.loginStore.authPageArr
-  );
+  const powerInfo = useSelector((state: RootState) => state.loginStore.authPageArr)
 
   const dataTemp = useMemo(() => {
     return [
       {
+        id: 7,
+        name: '征集管理',
+        done: false,
+        Com: React.lazy(() => import('../ObjectSon/Object7')),
+        path: '/object'
+      },
+      {
         id: 1,
-        name: "藏品登记",
+        name: '藏品登记',
         done: false,
-        Com: React.lazy(() => import("../ObjectSon/Object1")),
-        path: "/object",
+        Com: React.lazy(() => import('../ObjectSon/Object1')),
+        path: '/object/1'
       },
       {
         id: 2,
         done: false,
-        name: "藏品总账",
-        Com: React.lazy(() => import("../ObjectSon/Object2")),
-        path: "/object/2",
+        name: '藏品总账',
+        Com: React.lazy(() => import('../ObjectSon/Object2')),
+        path: '/object/2'
       },
       {
         id: 3,
         done: false,
-        name: "入库管理",
-        Com: React.lazy(() => import("../ObjectSon/Object3")),
-        path: "/object/3",
+        name: '入库管理',
+        Com: React.lazy(() => import('../ObjectSon/Object3')),
+        path: '/object/3'
       },
       {
         id: 4,
         done: false,
-        name: "出库管理",
-        Com: React.lazy(() => import("../ObjectSon/Object4")),
-        path: "/object/4",
+        name: '出库管理',
+        Com: React.lazy(() => import('../ObjectSon/Object4')),
+        path: '/object/4'
       },
       {
         id: 5,
         done: false,
-        name: "藏品修改",
-        Com: React.lazy(() => import("../ObjectSon/Object5")),
-        path: "/object/5",
+        name: '藏品修改',
+        Com: React.lazy(() => import('../ObjectSon/Object5')),
+        path: '/object/5'
       },
       {
         id: 6,
         done: false,
-        name: "藏品注销",
-        Com: React.lazy(() => import("../ObjectSon/Object6")),
-        path: "/object/6",
-      },
-    ];
-  }, []);
+        name: '藏品注销',
+        Com: React.lazy(() => import('../ObjectSon/Object6')),
+        path: '/object/6'
+      }
+    ]
+  }, [])
 
   const dataInTemp = useMemo(() => {
     return [
       {
         id: 1001,
         done: false,
-        name: "藏品登记新增",
-        Com: React.lazy(() => import("../ObjectSon/Object1/AddObject1")),
-        path: "/object/1/add",
+        name: '藏品登记新增',
+        Com: React.lazy(() => import('../ObjectSon/Object1/AddObject1')),
+        path: '/object/1/add'
       },
       {
         id: 1002,
         done: false,
-        name: "藏品登记审核",
-        Com: React.lazy(() => import("../ObjectSon/Object1/AuditObject1")),
-        path: "/object/1/audit",
+        name: '藏品登记审核',
+        Com: React.lazy(() => import('../ObjectSon/Object1/AuditObject1')),
+        path: '/object/1/audit'
       },
       {
         id: 3001,
         done: false,
-        name: "入库管理新增",
-        Com: React.lazy(() => import("../ObjectSon/Object3/AddObject3")),
-        path: "/object/3/add",
+        name: '入库管理新增',
+        Com: React.lazy(() => import('../ObjectSon/Object3/AddObject3')),
+        path: '/object/3/add'
       },
       {
         id: 3002,
         done: false,
-        name: "入库管理审核",
-        Com: React.lazy(() => import("../ObjectSon/Object3/AuditObject3")),
-        path: "/object/3/audit",
+        name: '入库管理审核',
+        Com: React.lazy(() => import('../ObjectSon/Object3/AuditObject3')),
+        path: '/object/3/audit'
       },
       {
         id: 4001,
         done: false,
-        name: "出库管理新增",
-        Com: React.lazy(() => import("../ObjectSon/Object4/AddObject4")),
-        path: "/object/4/add",
+        name: '出库管理新增',
+        Com: React.lazy(() => import('../ObjectSon/Object4/AddObject4')),
+        path: '/object/4/add'
       },
       {
         id: 4002,
         done: false,
-        name: "出库管理审核",
-        Com: React.lazy(() => import("../ObjectSon/Object4/AuditObject4")),
-        path: "/object/4/audit",
+        name: '出库管理审核',
+        Com: React.lazy(() => import('../ObjectSon/Object4/AuditObject4')),
+        path: '/object/4/audit'
       },
       {
         id: 5001,
         done: false,
-        name: "出库管理审核",
-        Com: React.lazy(() => import("../ObjectSon/Object5/AuditObject5")),
-        path: "/object/5/audit",
+        name: '出库管理审核',
+        Com: React.lazy(() => import('../ObjectSon/Object5/AuditObject5')),
+        path: '/object/5/audit'
       },
       {
         id: 6001,
         done: false,
-        name: "藏品注销新增",
-        Com: React.lazy(() => import("../ObjectSon/Object6/AddObject6")),
-        path: "/object/6/add",
+        name: '藏品注销新增',
+        Com: React.lazy(() => import('../ObjectSon/Object6/AddObject6')),
+        path: '/object/6/add'
       },
       {
         id: 6002,
         done: false,
-        name: "藏品注销审核",
-        Com: React.lazy(() => import("../ObjectSon/Object6/AuditObject6")),
-        path: "/object/6/audit",
+        name: '藏品注销审核',
+        Com: React.lazy(() => import('../ObjectSon/Object6/AuditObject6')),
+        path: '/object/6/audit'
+      },
+      {
+        id: 9001,
+        done: false,
+        name: '征集管理新增',
+        Com: React.lazy(() => import('../ObjectSon/Object7/AddObject7')),
+        path: '/object/7/add'
       },
-    ];
-  }, []);
+      {
+        id: 9002,
+        done: false,
+        name: '征集管理审核',
+        Com: React.lazy(() => import('../ObjectSon/Object7/AuditObject7')),
+        path: '/object/7/audit'
+      }
+    ]
+  }, [])
 
-  const [data, setData] = useState(dataTemp);
-  const [dataIn, setDadaIn] = useState(dataInTemp);
+  const [data, setData] = useState(dataTemp)
+  const [dataIn, setDadaIn] = useState(dataInTemp)
 
   useEffect(() => {
     powerInfo.forEach((v: any) => {
       if (v.id === 100) {
-        dataTemp[0].done = true;
+        dataTemp[1].done = true
         v.children.forEach((v2: any) => {
-          if (v2.id === 102 && v2.authority) dataInTemp[0].done = true;
-          if (v2.id === 105 && v2.authority) dataInTemp[1].done = true;
-        });
+          if (v2.id === 102 && v2.authority) dataInTemp[0].done = true
+          if (v2.id === 105 && v2.authority) dataInTemp[1].done = true
+        })
       }
-      if (v.id === 200) dataTemp[1].done = true;
+      if (v.id === 200) dataTemp[2].done = true
       if (v.id === 300) {
-        dataTemp[2].done = true;
+        dataTemp[3].done = true
         v.children.forEach((v2: any) => {
-          if (v2.id === 302 && v2.authority) dataInTemp[2].done = true;
-          if (v2.id === 305 && v2.authority) dataInTemp[3].done = true;
-        });
+          if (v2.id === 302 && v2.authority) dataInTemp[2].done = true
+          if (v2.id === 305 && v2.authority) dataInTemp[3].done = true
+        })
       }
       if (v.id === 400) {
-        dataTemp[3].done = true;
+        dataTemp[4].done = true
         v.children.forEach((v2: any) => {
-          if (v2.id === 402 && v2.authority) dataInTemp[4].done = true;
-          if (v2.id === 405 && v2.authority) dataInTemp[5].done = true;
-        });
+          if (v2.id === 402 && v2.authority) dataInTemp[4].done = true
+          if (v2.id === 405 && v2.authority) dataInTemp[5].done = true
+        })
       }
       if (v.id === 500) {
         v.children.forEach((v2: any) => {
-          if (v2.id === 505 && v2.authority) dataInTemp[6].done = true;
-        });
-        dataTemp[4].done = true;
+          if (v2.id === 505 && v2.authority) dataInTemp[6].done = true
+        })
+        dataTemp[5].done = true
       }
       if (v.id === 600) {
-        dataTemp[5].done = true;
+        dataTemp[6].done = true
+        v.children.forEach((v2: any) => {
+          if (v2.id === 602 && v2.authority) dataInTemp[7].done = true
+          if (v2.id === 605 && v2.authority) dataInTemp[8].done = true
+        })
+      }
+
+      if (v.id === 900) {
+        dataTemp[0].done = true
         v.children.forEach((v2: any) => {
-          if (v2.id === 602 && v2.authority) dataInTemp[7].done = true;
-          if (v2.id === 605 && v2.authority) dataInTemp[8].done = true;
-        });
+          if (v2.id === 902 && v2.authority) dataInTemp[9].done = true
+          if (v2.id === 904 && v2.authority) dataInTemp[10].done = true
+        })
       }
-    });
-    setData(dataTemp.filter((v) => v.done));
-    setDadaIn(dataInTemp.filter((v) => v.done));
-  }, [dataInTemp, dataTemp, powerInfo]);
+    })
+    setData(dataTemp.filter(v => v.done))
+    setDadaIn(dataInTemp.filter(v => v.done))
+  }, [dataInTemp, dataTemp, powerInfo])
 
   useEffect(() => {
     // 没有藏品登记页面的权限 跳到有权限的页面
     if (data[0].id !== 1) {
       // 并且不是从藏品总账里面点击操作记录的查看进来
-      if (!window.location.href.includes("look")) history.replace(data[0].path);
+      if (!window.location.href.includes('look')) history.replace(data[0].path)
     }
-  }, [data]);
+  }, [data])
 
   return (
     <div className={styles.Object}>
-      <div className="leftBar">
+      <div className='leftBar'>
         <LeftBar data={data} />
       </div>
       {/* 三级路由页面 */}
-      <div className="rightMain">
+      <div className='rightMain'>
         <React.Suspense fallback={<SpinLoding />}>
           <Switch>
             {data.map((v: any, i: number) => (
@@ -228,22 +244,23 @@ export default function Object() {
               />
             ))}
             {/* 查看页面,无需权限 */}
-            <AuthRoute path="/object/1/look" component={LookObject1} />
-            <AuthRoute path="/object/2/look" component={LookObject2} />
-            <AuthRoute path="/object/3/look" component={LookObject3} />
-            <AuthRoute path="/object/4/look" component={LookObject4} />
-            <AuthRoute path="/object/5/look" component={LookObject5} />
-            <AuthRoute path="/object/6/look" component={LookObject6} />
+            <AuthRoute path='/object/1/look' component={LookObject1} />
+            <AuthRoute path='/object/2/look' component={LookObject2} />
+            <AuthRoute path='/object/3/look' component={LookObject3} />
+            <AuthRoute path='/object/4/look' component={LookObject4} />
+            <AuthRoute path='/object/5/look' component={LookObject5} />
+            <AuthRoute path='/object/6/look' component={LookObject6} />
+            <AuthRoute path='/object/7/look' component={LookObject7} />
 
             {/* 新增 */}
             {dataIn.map((v: any) => (
               <AuthRoute key={v.id} path={v.path} component={v.Com} />
             ))}
 
-            <Route path="*" component={NotFound} />
+            <Route path='*' component={NotFound} />
           </Switch>
         </React.Suspense>
       </div>
     </div>
-  );
+  )
 }

+ 192 - 162
src/pages/ObjectSon/Object1/AddObject1/index.tsx

@@ -1,279 +1,301 @@
-import BreadTit from "@/components/BreadTit";
-import history, { urlParameter } from "@/utils/history";
-import { Input, Select, Table, Popconfirm, Button } from "antd";
-import TextArea from "antd/es/input/TextArea";
-import React, {
-  useCallback,
-  useEffect,
-  useMemo,
-  useRef,
-  useState,
-} from "react";
-import { useLocation } from "react-router-dom";
-import styles from "./index.module.scss";
-import ObjectAdd from "@/components/ObjectAdd";
-import ImageLazy from "@/components/ImageLazy/index";
-import { useDispatch, useSelector } from "react-redux";
-import { RootState } from "@/store";
+import BreadTit from '@/components/BreadTit'
+import history, { urlParameter } from '@/utils/history'
+import { Input, Select, Table, Popconfirm, Button } from 'antd'
+import TextArea from 'antd/es/input/TextArea'
+import React, { useCallback, useEffect, useMemo, useRef, useState } from 'react'
+import { useLocation } from 'react-router-dom'
+import styles from './index.module.scss'
+import ObjectAdd from '@/components/ObjectAdd'
+import ImageLazy from '@/components/ImageLazy/index'
+import { useDispatch, useSelector } from 'react-redux'
+import { RootState } from '@/store'
 import {
   delInTablesAPI,
   getObj1InfoTableAPI,
   object1AddAPI,
-  object1infoOutAPI,
-} from "@/store/action/object1";
-import _ from "lodash";
-import { MessageFu } from "@/utils/message";
+  object1infoOutAPI
+} from '@/store/action/object1'
+import _ from 'lodash'
+import { MessageFu } from '@/utils/message'
+import GoodsAll from '../GoodsAll'
 function AddObject1() {
-  const dispatch = useDispatch();
+  const dispatch = useDispatch()
 
   // 从仓库中获取藏品来源下拉数据
-  const options = useSelector(
-    (state: RootState) => state.loginStore.selectAll["文物来源"]
-  );
+  const options = useSelector((state: RootState) => state.loginStore.selectAll['文物来源'])
   // 顶部数据
-  const [addInfoTop, setAddInfoTop] = useState<any>({});
+  const [addInfoTop, setAddInfoTop] = useState<any>({})
 
   // 进入页面新增请求函数
   const object1AddAPIFu = useCallback(async () => {
-    const res = await object1AddAPI();
+    const res = await object1AddAPI()
     setAddInfoTop({
       ...res.data,
-      sourceName:null
+      sourceName: null
       // sourceName: options[0].name ? options[0].name : "",
-    });
-  }, []);
+    })
+
+    // 初始化表格数据
+    dispatch({
+      type: 'object1/getIsZJListAc',
+      payload: []
+    })
+  }, [dispatch])
 
   // 通过id获取详情函数
   const object1infoOutAPIFu = useCallback(
     async (id: number) => {
-      const res = await object1infoOutAPI(id);
-      setAddInfoTop(res.data);
-      // 获取表格详情信息
-      dispatch(getObj1InfoTableAPI(id));
+      const res: any = await object1infoOutAPI(id)
+
+      if (res.code === 0) {
+        setAddInfoTop(res.data)
+
+        // 设置表格信息
+        dispatch({
+          type: 'object1/getIsZJListAc',
+          payload: []
+        })
+
+        // 获取表格详情信息
+        dispatch(getObj1InfoTableAPI(res.data.goodIds))
+      }
     },
     [dispatch]
-  );
+  )
 
   // 获取地址栏参数
-  const location = useLocation();
-  const [urlParam, setUrlParam] = useState<any>({});
+  const location = useLocation()
+  const [urlParam, setUrlParam] = useState<any>({})
   useEffect(() => {
-    const obj = urlParameter(location.search);
-    setUrlParam(obj);
+    const obj = urlParameter(location.search)
+    setUrlParam(obj)
 
     if (obj.id) {
       // 如果是编辑
-      object1infoOutAPIFu(obj.id);
-    } else object1AddAPIFu();
-  }, [location, object1AddAPIFu, object1infoOutAPIFu]);
+      object1infoOutAPIFu(obj.id)
+    } else object1AddAPIFu()
+  }, [location, object1AddAPIFu, object1infoOutAPIFu])
 
   // 藏品来源下拉框
   const handleChange = (value: string) => {
-    setAddInfoTop({ ...addInfoTop, sourceName: value });
-  };
+    setAddInfoTop({ ...addInfoTop, sourceName: value })
+  }
 
   // 表格数据
 
   // 选中的表格数据
-  const [tableSelectList, setTableSelectList] = useState([]);
+  const [tableSelectList, setTableSelectList] = useState<any[]>([])
 
   // 从仓库拿表格信息
-  const results = useSelector(
-    (state: RootState) => state.loginStore.goodsTableList
-  );
+  const results = useSelector((state: RootState) => state.loginStore.goodsTableList)
+
+  const results2 = useSelector((state: RootState) => state.object1Store.isZJListAc)
 
   // 前端删除成功的id集合,用于点击存入草稿或者提交成功之后 传入后端删除
-  const delIds = useRef<any>([]);
+  const delIds = useRef<any>([])
 
   // 点击删除
   const delTableListFu = useCallback(() => {
-    console.log("多个删除", tableSelectList);
-    const data = _.differenceBy(results, tableSelectList, "id");
-    dispatch({ type: "login/setGoodsSonList", payload: data });
-    setTableSelectList(data);
+    console.log('多个删除', tableSelectList)
+
+    const arr1 = tableSelectList.filter(v => v.moduleType === 'DJ')
+    const arr2 = tableSelectList.filter(v => v.moduleType === 'ZJ')
 
+    // ---------原登记逻辑
+    const data = _.differenceBy(results, arr1, 'id')
+    dispatch({ type: 'login/setGoodsSonList', payload: data })
     // 删除的id存起来
-    tableSelectList.forEach((v: any) => {
-      delIds.current.push(v.id);
-    });
-  }, [dispatch, results, tableSelectList]);
+    arr1.forEach((v: any) => {
+      delIds.current.push(v.id)
+    })
+
+    // ----------藏品征集删除逻辑
+    const data2 = _.differenceBy(results2, arr2, 'id')
+    dispatch({ type: 'object1/getIsZJListAc', payload: data2 })
+
+    setTableSelectList([...data2, ...data])
+  }, [dispatch, results, results2, tableSelectList])
 
   const delOne = useCallback(
-    (id: number) => {
-      const data = results.filter((v: any) => v.id !== id);
-      dispatch({ type: "login/setGoodsSonList", payload: data });
-      console.log("单个删除", id);
-      // 删除的id存起来
-      delIds.current.push(id);
+    (item: any) => {
+      // ---------原登记逻辑
+      if (item.moduleType === 'DJ') {
+        const data = results.filter((v: any) => v.id !== item.id)
+        dispatch({ type: 'login/setGoodsSonList', payload: data })
+        console.log('单个删除', item.id)
+        // 删除的id存起来
+        delIds.current.push(item.id)
+      } else {
+        const data = results2.filter((v: any) => v.id !== item.id)
+        // -----------藏品征集逻辑
+        dispatch({ type: 'object1/getIsZJListAc', payload: data })
+      }
     },
 
-    [dispatch, results]
-  );
+    [dispatch, results, results2]
+  )
 
   const rowSelection = {
     onChange: (selectedRowKeys: any, selectedRows: any) => {
-      setTableSelectList(selectedRows);
-    },
-  };
+      setTableSelectList(selectedRows)
+    }
+  }
 
   // 点击添加或者编辑
 
-  const addId = useRef<any>(null);
+  const addId = useRef<any>(null)
 
-  const addPageFu = useCallback((id?: any) => {
-    addId.current = id;
-    setAddPage(true);
-  }, []);
+  const addPageFu = useCallback((type: string, id?: any) => {
+    addId.current = id
+    setAddPage(type)
+  }, [])
 
   const columns = useMemo(() => {
     return [
       {
-        title: "缩略图",
-        render: (item: any) => (
-          <ImageLazy width={120} height={70} src={item.thumb} />
-        ),
+        title: '缩略图',
+        render: (item: any) => <ImageLazy width={120} height={70} src={item.thumb} />
       },
 
       {
-        title: "藏品编号名称",
-        dataIndex: "dictNum",
+        title: '藏品编号名称',
+        dataIndex: 'dictNum'
       },
       {
-        title: "藏品编号",
-        render: (item: any) => (item.num ? item.num : "-"),
+        title: '藏品编号',
+        render: (item: any) => (item.num ? item.num : '-')
       },
       {
-        title: "藏品名称",
-        dataIndex: "name",
+        title: '藏品名称',
+        dataIndex: 'name'
       },
       {
-        title: "类别",
-        dataIndex: "dictGoodType",
+        title: '类别',
+        dataIndex: 'dictGoodType'
       },
       {
-        title: "完残程度",
-        dataIndex: "complete",
+        title: '完残程度',
+        dataIndex: 'complete'
       },
       {
-        title: "年代",
-        dataIndex: "dictAge",
+        title: '年代',
+        dataIndex: 'dictAge'
       },
       {
-        title: "操作",
+        title: '操作',
         render: (item: any) => (
           <>
-            <Button type="text" danger onClick={() => addPageFu(item.id)}>
+            <Button type='text' danger onClick={() => addPageFu(item.moduleType, item.id)}>
               编辑
             </Button>
             <Popconfirm
-              title="确定删除吗?"
-              okText="确定"
-              cancelText="取消"
-              onConfirm={() => delOne(item.id)}
+              title='确定删除吗?'
+              okText='确定'
+              cancelText='取消'
+              onConfirm={() => delOne(item)}
             >
-              <Button type="text" danger>
+              <Button type='text' danger>
                 删除
               </Button>
             </Popconfirm>
           </>
-        ),
-      },
-    ];
-  }, [addPageFu, delOne]);
+        )
+      }
+    ]
+  }, [addPageFu, delOne])
 
   // 点击返回
   const cancelFu = useCallback(() => {
     history.push({
-      pathname: `/object`,
-      state: { k: urlParam.k ? urlParam.k : "1", d: urlParam.d },
-    });
-  }, [urlParam.d, urlParam.k]);
+      pathname: `/object/1`,
+      state: { k: urlParam.k ? urlParam.k : '1', d: urlParam.d }
+    })
+  }, [urlParam.d, urlParam.k])
 
   // 点击提交
   const submitFu = useCallback(
     async (val: number) => {
-      if (!addInfoTop.sourceName) return MessageFu.warning("请选择藏品来源!");
+      if (!addInfoTop.sourceName) return MessageFu.warning('请选择藏品来源!')
+
+      if (results.length + results2.length === 0)
+        return MessageFu.warning('至少需要添加一条藏品信息!')
+
+      const goodIds = [...results, ...results2].map(v => v.id).join(',')
 
-      if (results.length === 0)
-        return MessageFu.warning("至少需要添加一条藏品信息!");
       const obj = {
         ...addInfoTop,
         status: val,
-      };
-      const res: any = await object1AddAPI(obj);
+        goodIds
+      }
+      const res: any = await object1AddAPI(obj)
       if (res.code === 0) {
         // 真正进行删除
         if (delIds.current.length) {
-          const res2: any = await delInTablesAPI(delIds.current.join(","));
+          const res2: any = await delInTablesAPI(delIds.current.join(','))
           if (res2.code === 0) {
-            MessageFu.success("操作成功!");
-            cancelFu();
+            MessageFu.success('操作成功!')
+            cancelFu()
           }
         } else {
-          MessageFu.success("操作成功!");
-          cancelFu();
+          MessageFu.success('操作成功!')
+          cancelFu()
         }
       }
     },
-    [addInfoTop, cancelFu, results.length]
-  );
+    [addInfoTop, cancelFu, results, results2]
+  )
 
   // 点击添加或者编辑出来页面
-  const [addPage, setAddPage] = useState(false);
+  const [addPage, setAddPage] = useState('')
+
+  // 从征集中添加
+  const [isZj, setIsZj] = useState(false)
 
   return (
     <div className={styles.AddObject1}>
-      <div className="breadTit">
+      <div className='breadTit'>
         <BreadTit>
-          <div className="breadTitRow">藏品登记</div>
-          <div className="splitStr">/</div>
-          <div className="breadTitRow active">
-            {urlParam.id ? "编辑" : "新增"}
-          </div>
+          <div className='breadTitRow'>藏品登记</div>
+          <div className='splitStr'>/</div>
+          <div className='breadTitRow active'>{urlParam.id ? '编辑' : '新增'}</div>
         </BreadTit>
       </div>
 
-      <div className="objectSonMain">
+      <div className='objectSonMain'>
         {/* 上面的信息展示 */}
-        <div className="addInfoTop">
-          <div className="row">
+        <div className='addInfoTop'>
+          <div className='row'>
             <div>
-              <span className="bs">登记编号:</span>
+              <span className='bs'>登记编号:</span>
               <Input style={{ width: 400 }} value={addInfoTop.num} disabled />
             </div>
             <div>
-              <span className="bs">登记人员:</span>
-              <Input
-                style={{ width: 400 }}
-                value={addInfoTop.creatorName}
-                disabled
-              />
+              <span className='bs'>登记人员:</span>
+              <Input style={{ width: 400 }} value={addInfoTop.creatorName} disabled />
             </div>
           </div>
-          <div className="row">
+          <div className='row'>
             <div>
-              <span className="bs">藏品来源:</span>
+              <span className='bs'>藏品来源:</span>
               <Select
-                placeholder="请选择"
+                placeholder='请选择'
                 style={{ width: 400 }}
                 value={addInfoTop.sourceName}
                 onChange={handleChange}
                 options={options.map((v: any) => ({
                   label: v.name,
-                  value: v.name,
+                  value: v.name
                 }))}
               />
             </div>
           </div>
-          <div className="rowAll">
+          <div className='rowAll'>
             <span>登记说明:</span>
             <TextArea
               value={addInfoTop.description}
-              onChange={(e) =>
-                setAddInfoTop({ ...addInfoTop, description: e.target.value })
-              }
+              onChange={e => setAddInfoTop({ ...addInfoTop, description: e.target.value })}
               rows={3}
-              placeholder="请输入"
+              placeholder='请输入'
               showCount
               maxLength={255}
             />
@@ -281,17 +303,19 @@ function AddObject1() {
         </div>
 
         {/* 下面的表格 */}
-        <div className="addTableBox">
-          <div className="addTableBox_Tit">
-            <div className="addTableBox_TitL">藏品信息</div>
-            <div className="addTableBox_TitR">
-              <Button onClick={() => addPageFu(null)}>添加</Button>
+        <div className='addTableBox'>
+          <div className='addTableBox_Tit'>
+            <div className='addTableBox_TitL'>藏品信息</div>
+            <div className='addTableBox_TitR'>
+              <Button onClick={() => setIsZj(true)}>从征集中添加</Button>
+              &emsp;
+              <Button onClick={() => addPageFu('DJ', null)}>添加</Button>
               &emsp;
               <Popconfirm
                 disabled={tableSelectList.length === 0}
-                title="确定删除吗?"
-                okText="确定"
-                cancelText="取消"
+                title='确定删除吗?'
+                okText='确定'
+                cancelText='取消'
                 onConfirm={delTableListFu}
               >
                 <Button disabled={tableSelectList.length === 0}>删除</Button>
@@ -299,24 +323,24 @@ function AddObject1() {
             </div>
           </div>
           {/* 表格主体 */}
-          <div className="addTableBox_table">
+          <div className='addTableBox_table'>
             <Table
-              size="small"
+              size='small'
               scroll={{ y: 300 }}
               rowSelection={{
-                type: "checkbox",
-                ...rowSelection,
+                type: 'checkbox',
+                ...rowSelection
               }}
-              dataSource={results}
+              dataSource={[...results2, ...results]}
               columns={columns}
-              rowKey="id"
+              rowKey='id'
               pagination={false}
             />
           </div>
-          <div className="addTableBox_btn">
+          <div className='addTableBox_btn'>
             <Button onClick={() => submitFu(0)}>存入草稿</Button>
             &emsp;
-            <Button type="primary" onClick={() => submitFu(1)}>
+            <Button type='primary' onClick={() => submitFu(1)}>
               提交
             </Button>
             &emsp;
@@ -328,14 +352,20 @@ function AddObject1() {
       {addPage ? (
         <ObjectAdd
           id={addId.current}
-          colsePage={() => setAddPage(false)}
+          colsePage={() => setAddPage('')}
           dirCode={addInfoTop.id}
+          orderId={addInfoTop.id}
+          isZJ={addPage === 'ZJ'}
+          isZJbyDJ={true}
         />
       ) : null}
+
+      {/* 从征集中添加 */}
+      {isZj ? <GoodsAll addPage={isZj} colsePage={() => setIsZj(false)} /> : null}
     </div>
-  );
+  )
 }
 
-const MemoAddObject1 = React.memo(AddObject1);
+const MemoAddObject1 = React.memo(AddObject1)
 
-export default MemoAddObject1;
+export default MemoAddObject1

+ 78 - 85
src/pages/ObjectSon/Object1/AuditObject1/index.tsx

@@ -1,145 +1,138 @@
-import BreadTit from "@/components/BreadTit";
-import LookObjTable from "@/components/LookObjTable";
-import { RootState } from "@/store";
-import {
-  auditObject1API,
-  getObj1InfoTableAPI2,
-  object1infoOutAPI,
-} from "@/store/action/object1";
-import { statusObj } from "@/utils/dataChange";
-import history, { urlParameter } from "@/utils/history";
-import { MessageFu } from "@/utils/message";
-import { Button, Select } from "antd";
-import TextArea from "antd/es/input/TextArea";
-import React, { useCallback, useEffect, useRef, useState } from "react";
-import { useDispatch, useSelector } from "react-redux";
-import { useLocation } from "react-router-dom";
-import styles from "./index.module.scss";
-const { Option } = Select;
+import BreadTit from '@/components/BreadTit'
+import LookObjTable from '@/components/LookObjTable'
+import { RootState } from '@/store'
+import { auditObject1API, getObj1InfoTableAPI2, object1infoOutAPI } from '@/store/action/object1'
+import { statusObj } from '@/utils/dataChange'
+import history, { urlParameter } from '@/utils/history'
+import { MessageFu } from '@/utils/message'
+import { Button, Select } from 'antd'
+import TextArea from 'antd/es/input/TextArea'
+import React, { useCallback, useEffect, useRef, useState } from 'react'
+import { useDispatch, useSelector } from 'react-redux'
+import { useLocation } from 'react-router-dom'
+import styles from './index.module.scss'
+const { Option } = Select
 
 function AuditObject1() {
-  const dispatch = useDispatch();
+  const dispatch = useDispatch()
   // 获取地址栏参数
-  const location = useLocation();
-  const urlParamRef = useRef<any>({});
+  const location = useLocation()
+  const urlParamRef = useRef<any>({})
   useEffect(() => {
-    urlParamRef.current = urlParameter(location.search);
+    urlParamRef.current = urlParameter(location.search)
     // console.log("地址栏参数", urlParamRef.current);
-  }, [location]);
+  }, [location])
 
   // 点击返回
   const cancelFu = () => {
     history.push({
-      pathname: `/object`,
+      pathname: `/object/1`,
       state: {
-        k: urlParamRef.current.k ? urlParamRef.current.k : "1",
-        d: urlParamRef.current.d,
-      },
-    });
-  };
+        k: urlParamRef.current.k ? urlParamRef.current.k : '1',
+        d: urlParamRef.current.d
+      }
+    })
+  }
 
   const getInfo = useCallback(async () => {
-    const id = urlParamRef.current.id;
-    const res1 = await object1infoOutAPI(id);
-    const res2 = await getObj1InfoTableAPI2(id);
-    const info = res1.data;
-    info.statusTxt = statusObj[info.status];
-    const list = res2.data;
-    dispatch({ type: "object1/getLookInfo", payload: { info, list } });
-  }, [dispatch]);
+    const id = urlParamRef.current.id
+    const res1: any = await object1infoOutAPI(id)
+
+    if (res1.code === 0) {
+      const res2 = await getObj1InfoTableAPI2(res1.data.goodIds)
+      const info = res1.data
+      info.statusTxt = statusObj[info.status]
+      const list = res2.data
+      dispatch({ type: 'object1/getLookInfo', payload: { info, list } })
+    }
+  }, [dispatch])
 
   useEffect(() => {
-    getInfo();
-  }, [getInfo]);
+    getInfo()
+  }, [getInfo])
 
-  const { info, list: tableList } = useSelector(
-    (state: RootState) => state.object1Store.lookInfo
-  );
+  const { info, list: tableList } = useSelector((state: RootState) => state.object1Store.lookInfo)
 
   // 审核结果筛选
-  const [value, setValue] = useState(3);
+  const [value, setValue] = useState(3)
   const valueChangeFu = (val: number) => {
-    setValue(val);
-  };
+    setValue(val)
+  }
   // 审核说明
-  const [value2, setValue2] = useState("");
+  const [value2, setValue2] = useState('')
 
   // 点击确定
   const btnOkFu = async () => {
-    const txt = value2.replaceAll(" ", "").replaceAll("\n", "");
-    if (txt === "") return MessageFu.warning("审核说明不能为空!");
+    const txt = value2.replaceAll(' ', '').replaceAll('\n', '')
+    if (txt === '') return MessageFu.warning('审核说明不能为空!')
     const res: any = await auditObject1API({
       id: Number(urlParamRef.current.id),
       reason: value2,
-      status: value,
-    });
+      status: value
+    })
     if (res.code === 0) {
-      MessageFu.success("操作成功!");
-      cancelFu();
+      MessageFu.success('操作成功!')
+      cancelFu()
     }
-  };
+  }
 
   return (
     <div className={styles.AuditObject1}>
-      <div className="breadTit">
+      <div className='breadTit'>
         <BreadTit>
-          <div className="breadTitRow">藏品登记</div>
-          <div className="splitStr">/</div>
-          <div className="breadTitRow active">审核</div>
+          <div className='breadTitRow'>藏品登记</div>
+          <div className='splitStr'>/</div>
+          <div className='breadTitRow active'>审核</div>
         </BreadTit>
       </div>
-      <div className="objectSonMain">
-        <div className="topTit">入库信息</div>
-        <div className="topInfo">
-          <div className="topInfoRow">
+      <div className='objectSonMain'>
+        <div className='topTit'>入库信息</div>
+        <div className='topInfo'>
+          <div className='topInfoRow'>
             <div>
-              <div className="one">登记编号:</div>
+              <div className='one'>登记编号:</div>
               <div>{info.num}</div>
             </div>
             <div>
-              <div className="one">登记人员:</div>
+              <div className='one'>登记人员:</div>
               <div>{info.creatorName}</div>
             </div>
             <div>
-              <div className="one">藏品来源:</div>
+              <div className='one'>藏品来源:</div>
               <div>{info.sourceName}</div>
             </div>
           </div>
-          <div className="topInfoTex" title={info.description}>
+          <div className='topInfoTex' title={info.description}>
             <span>登记说明:</span>
-            {info.description ? info.description : "-"}
+            {info.description ? info.description : '-'}
           </div>
         </div>
         <br />
-        <div className="topTit">藏品信息</div>
+        <div className='topTit'>藏品信息</div>
 
-        <div className="goodsInfo">
+        <div className='goodsInfo'>
           {/* 封装的表格信息 */}
           <LookObjTable data={tableList} y={245} />
           <br />
-          <div className="inputBox1">
-            <div className="inputBoxTit">
+          <div className='inputBox1'>
+            <div className='inputBoxTit'>
               <span>* </span>审核结果:
             </div>
-            <Select
-              style={{ width: 150 }}
-              value={value}
-              onChange={(val) => valueChangeFu(val)}
-            >
+            <Select style={{ width: 150 }} value={value} onChange={val => valueChangeFu(val)}>
               <Option value={3}>通过</Option>
               <Option value={2}>不通过</Option>
             </Select>
           </div>
-          <div className="inputBox1 inputBox2">
-            <div className="inputBoxTit">
+          <div className='inputBox1 inputBox2'>
+            <div className='inputBoxTit'>
               <span>* </span>审核说明:
             </div>
-            <div className="inputBoxText">
+            <div className='inputBoxText'>
               <TextArea
                 value={value2}
-                onChange={(e) => setValue2(e.target.value)}
+                onChange={e => setValue2(e.target.value)}
                 rows={3}
-                placeholder="请输入"
+                placeholder='请输入'
                 showCount
                 maxLength={255}
               />
@@ -147,8 +140,8 @@ function AuditObject1() {
           </div>
         </div>
 
-        <div className="backBtn">
-          <Button onClick={btnOkFu} type="primary">
+        <div className='backBtn'>
+          <Button onClick={btnOkFu} type='primary'>
             提交
           </Button>
           &emsp;
@@ -156,9 +149,9 @@ function AuditObject1() {
         </div>
       </div>
     </div>
-  );
+  )
 }
 
-const MemoAuditObject1 = React.memo(AuditObject1);
+const MemoAuditObject1 = React.memo(AuditObject1)
 
-export default MemoAuditObject1;
+export default MemoAuditObject1

+ 144 - 0
src/pages/ObjectSon/Object1/GoodsAll.tsx

@@ -0,0 +1,144 @@
+import { Button, Input, Modal, Table } from 'antd'
+import React, { useCallback, useEffect, useMemo, useRef, useState } from 'react'
+import styles from './index.module.scss'
+import { useDispatch, useSelector } from 'react-redux'
+import { RootState } from '@/store'
+import ImageLazy from '@/components/ImageLazy'
+import '../Object3/AddObject3/GoodsAll.css'
+import { MessageFu } from '@/utils/message'
+import { API_getGoodsListByZJ } from '@/store/action/object1'
+
+type Props = {
+  colsePage: any
+  addPage: boolean
+}
+function GoodsAll({ colsePage, addPage }: Props) {
+  const dispatch = useDispatch()
+
+  // 进页面获取列表
+  useEffect(() => {
+    dispatch(API_getGoodsListByZJ(''))
+  }, [dispatch])
+
+  // 藏品名称
+  const [name, setName] = useState('')
+  const nameTime = useRef(-1)
+  const nameChange = useCallback(
+    (e: React.ChangeEvent<HTMLInputElement>) => {
+      setName(e.target.value)
+      clearTimeout(nameTime.current)
+      nameTime.current = window.setTimeout(() => {
+        dispatch(API_getGoodsListByZJ(e.target.value))
+      }, 500)
+    },
+    [dispatch]
+  )
+
+  // 有关表格
+  const results = useSelector((state: RootState) => state.object1Store.isZJList)
+
+  // 已经选中的表格数据
+  const resultsAc = useSelector((state: RootState) => state.object1Store.isZJListAc)
+
+  const columns = useMemo(() => {
+    return [
+      {
+        title: '缩略图',
+        render: (item: any) => <ImageLazy width={120} height={70} src={item.thumb} />
+      },
+      {
+        title: '藏品编号名称',
+        dataIndex: 'dictNum'
+      },
+      {
+        title: '藏品编号',
+        render: (item: any) => (item.num ? item.num : '-')
+      },
+      {
+        title: '藏品名称',
+        dataIndex: 'name'
+      },
+      {
+        title: '类别',
+        dataIndex: 'dictGoodType'
+      }
+    ]
+  }, [])
+
+  // 选中的表格数据
+  const [tableSelectList, setTableSelectList] = useState([])
+  // 表格的多选
+
+  const rowSelection = useMemo(() => {
+    return {
+      onChange: (selectedRowKeys: any, selectedRows: any) => {
+        setTableSelectList(selectedRows)
+      },
+      // 默认选中
+      defaultSelectedRowKeys: resultsAc.map((v: any) => v.id)
+    }
+  }, [resultsAc])
+
+  // 点击确定
+  const btnOkFu = useCallback(() => {
+    dispatch({
+      type: 'object1/getIsZJListAc',
+      payload: tableSelectList
+    })
+    MessageFu.success('添加成功!')
+    colsePage()
+  }, [colsePage, dispatch, tableSelectList])
+
+  return (
+    <div className={styles.GoodsAll}>
+      <Modal
+        open={addPage}
+        destroyOnClose
+        wrapClassName='GoodsAllModel'
+        title='添加藏品'
+        onCancel={colsePage}
+        footer={
+          [] // 设置footer为空,去掉 取消 确定默认按钮
+        }
+      >
+        <div className='ObjectAddTit'>
+          <div className='topSearch'>
+            <span>藏品编号:</span>
+            <Input
+              value={name}
+              maxLength={10}
+              style={{ width: 300 }}
+              placeholder='请输入'
+              allowClear
+              onChange={e => nameChange(e)}
+            />
+          </div>
+        </div>
+        <div className='tableBox'>
+          <Table
+            size='small'
+            scroll={{ y: 500 }}
+            rowSelection={{
+              type: 'checkbox',
+              ...rowSelection
+            }}
+            dataSource={results}
+            columns={columns}
+            rowKey='id'
+            pagination={false}
+          />
+        </div>
+        <br />
+        <div className='moveBtn'>
+          <Button type='primary' onClick={btnOkFu} disabled={tableSelectList.length === 0}>
+            提交
+          </Button>
+        </div>
+      </Modal>
+    </div>
+  )
+}
+
+const MemoGoodsAll = React.memo(GoodsAll)
+
+export default MemoGoodsAll

+ 10 - 7
src/pages/ObjectSon/Object1/LookObject1/index.tsx

@@ -24,7 +24,7 @@ function LookObject1() {
   // 点击返回
   const cancelFu = () => {
     history.push({
-      pathname: `/object`,
+      pathname: `/object/1`,
       state: {
         k: urlParamRef.current.k ? urlParamRef.current.k : '1',
         d: urlParamRef.current.d
@@ -34,12 +34,15 @@ function LookObject1() {
 
   const getInfo = useCallback(async () => {
     const id = urlParamRef.current.id
-    const res1 = await object1infoOutAPI(id)
-    const res2 = await getObj1InfoTableAPI2(id)
-    const info = res1.data
-    info.statusTxt = statusObj[info.status]
-    const list = res2.data
-    dispatch({ type: 'object1/getLookInfo', payload: { info, list } })
+    const res1: any = await object1infoOutAPI(id)
+
+    if (res1.code === 0) {
+      const res2 = await getObj1InfoTableAPI2(res1.data.goodIds)
+      const info = res1.data
+      info.statusTxt = statusObj[info.status]
+      const list = res2.data
+      dispatch({ type: 'object1/getLookInfo', payload: { info, list } })
+    }
   }, [dispatch])
 
   useEffect(() => {

+ 142 - 169
src/pages/ObjectSon/Object3/AddObject3/index.tsx

@@ -1,304 +1,281 @@
-import BreadTit from "@/components/BreadTit";
-import { object3AddAPI, object3infoOutAPI } from "@/store/action/object3";
-import history, { urlParameter } from "@/utils/history";
-import { Button, Cascader, Input, Popconfirm, Table } from "antd";
-import TextArea from "antd/es/input/TextArea";
-import React, {
-  useCallback,
-  useEffect,
-  useMemo,
-  useRef,
-  useState,
-} from "react";
-import { useLocation } from "react-router-dom";
-import _ from "lodash";
-import styles from "./index.module.scss";
-import { useDispatch, useSelector } from "react-redux";
-import { RootState } from "@/store";
-import ImageLazy from "@/components/ImageLazy";
-import GoodsAll from "./GoodsAll";
-import LookModal from "@/components/LookObjTable/LookModal";
-import { getStores1ListAPI } from "@/store/action/stores1";
-import { obj3InStorage } from "@/utils/dataChange";
-import { MessageFu } from "@/utils/message";
+import BreadTit from '@/components/BreadTit'
+import { object3AddAPI, object3infoOutAPI } from '@/store/action/object3'
+import history, { urlParameter } from '@/utils/history'
+import { Button, Cascader, Input, Popconfirm, Table } from 'antd'
+import TextArea from 'antd/es/input/TextArea'
+import React, { useCallback, useEffect, useMemo, useRef, useState } from 'react'
+import { useLocation } from 'react-router-dom'
+import _ from 'lodash'
+import styles from './index.module.scss'
+import { useDispatch, useSelector } from 'react-redux'
+import { RootState } from '@/store'
+import ImageLazy from '@/components/ImageLazy'
+import GoodsAll from './GoodsAll'
+import LookModal from '@/components/LookObjTable/LookModal'
+import { getStores1ListAPI } from '@/store/action/stores1'
+import { obj3InStorage } from '@/utils/dataChange'
+import { MessageFu } from '@/utils/message'
 function AddObject3() {
-  const dispatch = useDispatch();
+  const dispatch = useDispatch()
 
   // 进页面获取所有的库房信息
   useEffect(() => {
-    dispatch(getStores1ListAPI());
-  }, [dispatch]);
+    dispatch(getStores1ListAPI())
+  }, [dispatch])
 
   // 从仓库中获取库房总信息
-  const storesAllList = useSelector(
-    (state: RootState) => state.stores1Store.infoList
-  );
+  const storesAllList = useSelector((state: RootState) => state.stores1Store.infoList)
 
   // 从仓库拿表格信息
-  const results = useSelector(
-    (state: RootState) => state.object3Store.goodsTableList
-  );
+  const results = useSelector((state: RootState) => state.object3Store.goodsTableList)
 
   // 针对表格信息扩展自己需要的 入库 级连 筛选信息
-  const storesLocArr = useRef<any>({});
+  const storesLocArr = useRef<any>({})
 
   // 级联筛选发生变化
   const onChangeStores = useCallback(
     (value: any, arr: any, id: number) => {
       storesLocArr.current[id] = {
-        ids: value.join(","),
-        names: arr.map((v: any) => v.name).join("/"),
-      };
+        ids: value.join(','),
+        names: arr.map((v: any) => v.name).join('/')
+      }
     },
     [storesLocArr]
-  );
+  )
 
   // 顶部数据
-  const [addInfoTop, setAddInfoTop] = useState<any>({});
+  const [addInfoTop, setAddInfoTop] = useState<any>({})
 
   // 进入页面新增请求函数
   const object3AddAPIFu = useCallback(async () => {
-    const res = await object3AddAPI();
-    setAddInfoTop(res.data);
+    const res = await object3AddAPI()
+    setAddInfoTop(res.data)
     // 初始化表格数据
     dispatch({
-      type: "object3/getGoodsTableList",
-      payload: [],
-    });
-  }, [dispatch]);
+      type: 'object3/getGoodsTableList',
+      payload: []
+    })
+  }, [dispatch])
 
   // 通过id获取详情函数
   const object3infoOutAPIFu = useCallback(
     async (id: number) => {
-      const res = await object3infoOutAPI(id);
-      setAddInfoTop(res.data.entity);
+      const res = await object3infoOutAPI(id)
+      setAddInfoTop(res.data.entity)
       // 设置表格信息
       dispatch({
-        type: "object3/getGoodsTableList",
-        payload: res.data.child,
-      });
+        type: 'object3/getGoodsTableList',
+        payload: res.data.child
+      })
       // 设置藏品位置ref
       if (res.data.child && res.data.child.length) {
         res.data.child.forEach((v: any) => {
           storesLocArr.current[v.id] = {
             ids: v.storageAncestor,
-            names: obj3InStorage(v.storageAncestor),
-          };
-        });
+            names: obj3InStorage(v.storageAncestor)
+          }
+        })
       }
     },
     [dispatch]
-  );
+  )
 
   // 获取地址栏参数
-  const location = useLocation();
-  const [urlParam, setUrlParam] = useState<any>({});
+  const location = useLocation()
+  const [urlParam, setUrlParam] = useState<any>({})
   useEffect(() => {
-    const obj = urlParameter(location.search);
-    setUrlParam(obj);
+    const obj = urlParameter(location.search)
+    setUrlParam(obj)
 
     if (obj.id) {
       // 如果是编辑
-      object3infoOutAPIFu(obj.id);
-    } else object3AddAPIFu();
-  }, [location, object3AddAPIFu, object3infoOutAPIFu]);
+      object3infoOutAPIFu(obj.id)
+    } else object3AddAPIFu()
+  }, [location, object3AddAPIFu, object3infoOutAPIFu])
   // 点击返回
   const cancelFu = useCallback(() => {
     history.push({
       pathname: `/object/3`,
-      state: { k: urlParam.k ? urlParam.k : "1", d: urlParam.d },
-    });
-  }, [urlParam.d, urlParam.k]);
+      state: { k: urlParam.k ? urlParam.k : '1', d: urlParam.d }
+    })
+  }, [urlParam.d, urlParam.k])
 
   // 点击提交
   const submitFu = useCallback(async () => {
-    if (results.length === 0)
-      return MessageFu.warning("至少需要添加一条藏品信息!");
+    if (results.length === 0) return MessageFu.warning('至少需要添加一条藏品信息!')
 
-    const objLength = Object.keys(storesLocArr.current).length;
-    if (objLength < results.length) return MessageFu.warning("请选择藏品位置!");
+    const objLength = Object.keys(storesLocArr.current).length
+    if (objLength < results.length) return MessageFu.warning('请选择藏品位置!')
 
     const obj = {
       description: addInfoTop.description,
       id: addInfoTop.id,
-      goodsIds: results.map((v: any) => v.id).join(","),
-      location: storesLocArr.current,
-    };
+      goodsIds: results.map((v: any) => v.id).join(','),
+      location: storesLocArr.current
+    }
 
-    const res: any = await object3AddAPI(obj);
+    const res: any = await object3AddAPI(obj)
     if (res.code === 0) {
-      MessageFu.success("操作成功!");
-      cancelFu();
+      MessageFu.success('操作成功!')
+      cancelFu()
     }
-  }, [addInfoTop.description, addInfoTop.id, cancelFu, results]);
+  }, [addInfoTop.description, addInfoTop.id, cancelFu, results])
 
   // 点击添加或者编辑出来页面
-  const [addPage, setAddPage] = useState(false);
+  const [addPage, setAddPage] = useState(false)
 
   // 选中的表格数据
-  const [tableSelectList, setTableSelectList] = useState([]);
+  const [tableSelectList, setTableSelectList] = useState([])
 
   // 表格的勾选状态
-  const [selectedRowKeys, setSelectedRowKeys] = useState<React.Key[]>([]);
+  const [selectedRowKeys, setSelectedRowKeys] = useState<React.Key[]>([])
 
   // 表格的多选
   const rowSelection = {
     selectedRowKeys,
     onChange: (selectedRowKeys: any, selectedRows: any) => {
-      setTableSelectList(selectedRows);
-      setSelectedRowKeys(selectedRowKeys);
-    },
-  };
+      setTableSelectList(selectedRows)
+      setSelectedRowKeys(selectedRowKeys)
+    }
+  }
 
   // 点击添加
   const addPageFu = useCallback((id?: any) => {
-    setAddPage(true);
-  }, []);
+    setAddPage(true)
+  }, [])
 
   // 点击删除
   const delTableListFu = useCallback(() => {
-    console.log("多个删除", tableSelectList);
-    const data = _.differenceBy(results, tableSelectList, "id");
-    dispatch({ type: "object3/getGoodsTableList", payload: data });
-    setTableSelectList(data);
+    console.log('多个删除', tableSelectList)
+    const data = _.differenceBy(results, tableSelectList, 'id')
+    dispatch({ type: 'object3/getGoodsTableList', payload: data })
+    setTableSelectList(data)
 
     // 清除表格的勾选状态
-    setSelectedRowKeys([]);
+    setSelectedRowKeys([])
 
     // 同时删除藏品位置信息
     tableSelectList.forEach((v: any) => {
-      delete storesLocArr.current[v.id];
-    });
-  }, [dispatch, results, tableSelectList]);
+      delete storesLocArr.current[v.id]
+    })
+  }, [dispatch, results, tableSelectList])
 
   // 控制弹窗的显示隐藏
-  const [show, setShow] = useState(false);
+  const [show, setShow] = useState(false)
   // 点击表格里面的查看
-  const lookIdRef = useRef(-1);
+  const lookIdRef = useRef(-1)
   const lookGoods = useCallback((id: number) => {
-    lookIdRef.current = id;
-    setShow(true);
-  }, []);
+    lookIdRef.current = id
+    setShow(true)
+  }, [])
 
   // 表格数据
   const columns = useMemo(() => {
     return [
       {
-        title: "缩略图",
-        render: (item: any) => (
-          <ImageLazy width={120} height={70} src={item.thumb} />
-        ),
+        title: '缩略图',
+        render: (item: any) => <ImageLazy width={120} height={70} src={item.thumb} />
       },
 
       {
-        title: "藏品编号名称",
-        dataIndex: "dictNum",
+        title: '藏品编号名称',
+        dataIndex: 'dictNum'
       },
       {
-        title: "藏品编号",
-        render: (item: any) => (item.num ? item.num : "-"),
+        title: '藏品编号',
+        render: (item: any) => (item.num ? item.num : '-')
       },
       {
-        title: "藏品名称",
-        dataIndex: "name",
+        title: '藏品名称',
+        dataIndex: 'name'
       },
       {
-        title: "类别",
-        dataIndex: "dictGoodType",
+        title: '类别',
+        dataIndex: 'dictGoodType'
       },
       {
-        title: "完残程度",
-        dataIndex: "complete",
+        title: '完残程度',
+        dataIndex: 'complete'
       },
       {
-        title: "藏品位置",
+        title: '藏品位置',
         width: 200,
         render: (item: any) => (
           <>
             <Cascader
-              defaultValue={obj3InStorage(item.storageAncestor).split(",")}
+              defaultValue={obj3InStorage(item.storageAncestor).split(',')}
               allowClear={false}
               fieldNames={{
-                label: "name",
-                value: "id",
-                children: "children",
+                label: 'name',
+                value: 'id',
+                children: 'children'
               }}
-              onChange={(value, selectedOptions) =>
-                onChangeStores(value, selectedOptions, item.id)
-              }
+              onChange={(value, selectedOptions) => onChangeStores(value, selectedOptions, item.id)}
               options={storesAllList}
-              placeholder="请选择"
+              placeholder='请选择'
             />
           </>
-        ),
+        )
       },
       {
-        title: "操作",
+        title: '操作',
         render: (item: any) => (
           <>
-            <Button type="text" danger onClick={() => lookGoods(item.id)}>
+            <Button type='text' danger onClick={() => lookGoods(item.id)}>
               查看
             </Button>
           </>
-        ),
-      },
-    ];
-  }, [lookGoods, onChangeStores, storesAllList]);
+        )
+      }
+    ]
+  }, [lookGoods, onChangeStores, storesAllList])
 
   return (
     <div className={styles.AddObject3}>
-      <div className="breadTit">
+      <div className='breadTit'>
         <BreadTit>
-          <div className="breadTitRow">入库管理</div>
-          <div className="splitStr">/</div>
-          <div className="breadTitRow active">
-            {urlParam.id ? "编辑" : "新增"}
-          </div>
+          <div className='breadTitRow'>入库管理</div>
+          <div className='splitStr'>/</div>
+          <div className='breadTitRow active'>{urlParam.id ? '编辑' : '新增'}</div>
         </BreadTit>
       </div>
-      <div className="objectSonMain">
+      <div className='objectSonMain'>
         {/* 上面的信息展示 */}
-        <div className="addInfoTop">
-          <div className="row">
+        <div className='addInfoTop'>
+          <div className='row'>
             <div>
-              <span className="bs">入库编号:</span>
+              <span className='bs'>入库编号:</span>
               <Input style={{ width: 400 }} value={addInfoTop.num} disabled />
             </div>
             <div>
-              <span className="bs">登记人员:</span>
-              <Input
-                style={{ width: 400 }}
-                value={addInfoTop.creatorName}
-                disabled
-              />
+              <span className='bs'>登记人员:</span>
+              <Input style={{ width: 400 }} value={addInfoTop.creatorName} disabled />
             </div>
           </div>
-          <div className="rowAll">
+          <div className='rowAll'>
             <span>入库说明:</span>
             <TextArea
               value={addInfoTop.description}
-              onChange={(e) =>
-                setAddInfoTop({ ...addInfoTop, description: e.target.value })
-              }
+              onChange={e => setAddInfoTop({ ...addInfoTop, description: e.target.value })}
               rows={3}
-              placeholder="请输入"
+              placeholder='请输入'
               showCount
               maxLength={255}
             />
           </div>
         </div>
         {/* 下面的表格 */}
-        <div className="addTableBox">
-          <div className="addTableBox_Tit">
-            <div className="addTableBox_TitL">藏品信息</div>
-            <div className="addTableBox_TitR">
+        <div className='addTableBox'>
+          <div className='addTableBox_Tit'>
+            <div className='addTableBox_TitL'>藏品信息</div>
+            <div className='addTableBox_TitR'>
               <Button onClick={() => addPageFu(null)}>添加</Button>
               &emsp;
               <Popconfirm
                 disabled={tableSelectList.length === 0}
-                title="确定删除吗?"
-                okText="确定"
-                cancelText="取消"
+                title='确定删除吗?'
+                okText='确定'
+                cancelText='取消'
                 onConfirm={delTableListFu}
               >
                 <Button disabled={tableSelectList.length === 0}>删除</Button>
@@ -307,24 +284,24 @@ function AddObject3() {
           </div>
 
           {/* 表格主体 */}
-          <div className="addTableBox_table">
+          <div className='addTableBox_table'>
             <Table
-              size="small"
+              size='small'
               scroll={{ y: 355 }}
               rowSelection={{
-                type: "checkbox",
-                ...rowSelection,
+                type: 'checkbox',
+                ...rowSelection
               }}
               dataSource={results}
               columns={columns}
-              rowKey="id"
+              rowKey='id'
               pagination={false}
             />
           </div>
 
           {/* 返回按钮 */}
-          <div className="addTableBox_btn">
-            <Button type="primary" onClick={submitFu}>
+          <div className='addTableBox_btn'>
+            <Button type='primary' onClick={submitFu}>
               提交
             </Button>
             &emsp;
@@ -337,16 +314,12 @@ function AddObject3() {
 
       {/* 点击查看出来的对话框 */}
       {show ? (
-        <LookModal
-          id={lookIdRef.current}
-          show={show}
-          closeShow={() => setShow(false)}
-        />
+        <LookModal id={lookIdRef.current} show={show} closeShow={() => setShow(false)} />
       ) : null}
     </div>
-  );
+  )
 }
 
-const MemoAddObject3 = React.memo(AddObject3);
+const MemoAddObject3 = React.memo(AddObject3)
 
-export default MemoAddObject3;
+export default MemoAddObject3

+ 86 - 0
src/pages/ObjectSon/Object7/AddObject7/index.module.scss

@@ -0,0 +1,86 @@
+.AddObject7 {
+  :global {
+    .objectSonMain {
+      padding: 10px 30px;
+
+      .addInfoTop {
+        .row {
+          display: flex;
+          justify-content: space-between;
+          height: 50px;
+
+          & > div {
+            width: 45%;
+            height: 50px;
+            align-items: center;
+            display: flex;
+
+            & > span {
+              width: 80px;
+            }
+
+            .bs {
+              position: relative;
+
+              &::before {
+                content: '*';
+                position: absolute;
+                z-index: 10;
+                top: 2px;
+                left: -10px;
+                color: #ff4d4f;
+              }
+            }
+          }
+        }
+
+        .rowAll {
+          display: flex;
+          margin-top: 6px;
+
+          & > span {
+            width: 80px;
+          }
+
+          .ant-input-textarea {
+            width: calc(100% - 80px);
+          }
+        }
+      }
+
+      .addTableBox {
+        margin-top: 30px;
+        width: 100%;
+        height: 430px;
+
+        .addTableBox_Tit {
+          height: 40px;
+          display: flex;
+          align-items: center;
+          justify-content: space-between;
+
+          .addTableBox_TitL {
+            display: flex;
+            align-items: center;
+            color: var(--themeColor);
+            font-size: 20px;
+            font-weight: 700;
+          }
+        }
+
+        .addTableBox_table {
+          width: 100%;
+          height: calc(100% - 90px);
+        }
+
+        .addTableBox_btn {
+          width: 100%;
+          height: 40px;
+          display: flex;
+          justify-content: center;
+          margin-top: 10px;
+        }
+      }
+    }
+  }
+}

+ 320 - 0
src/pages/ObjectSon/Object7/AddObject7/index.tsx

@@ -0,0 +1,320 @@
+import React, { useCallback, useEffect, useMemo, useRef, useState } from 'react'
+import styles from './index.module.scss'
+import { useDispatch, useSelector } from 'react-redux'
+import {
+  delInTablesAPI7,
+  getObj7InfoTableAPI,
+  object7AddAPI,
+  object7infoOutAPI
+} from '@/store/action/object7'
+import { useLocation } from 'react-router-dom'
+import history, { urlParameter } from '@/utils/history'
+import { RootState } from '@/store'
+import _ from 'lodash'
+import ImageLazy from '@/components/ImageLazy'
+import { Button, Input, Popconfirm, Select, Table } from 'antd'
+import { MessageFu } from '@/utils/message'
+import BreadTit from '@/components/BreadTit'
+import { selectAdd1 } from '../data'
+import TextArea from 'antd/es/input/TextArea'
+import ObjectAdd from '@/components/ObjectAdd'
+
+function AddObject7() {
+  const dispatch = useDispatch()
+
+  // 顶部数据
+  const [addInfoTop, setAddInfoTop] = useState<any>({})
+
+  // 进入页面新增请求函数
+  const object7AddAPIFu = useCallback(async () => {
+    const res = await object7AddAPI()
+    setAddInfoTop({
+      ...res.data,
+      sourceName: null
+      // sourceName: options[0].name ? options[0].name : "",
+    })
+  }, [])
+
+  // 通过id获取详情函数
+  const object7infoOutAPIFu = useCallback(
+    async (id: number) => {
+      const res = await object7infoOutAPI(id)
+      setAddInfoTop(res.data)
+      // 获取表格详情信息
+      dispatch(getObj7InfoTableAPI(id))
+    },
+    [dispatch]
+  )
+
+  // 获取地址栏参数
+  const location = useLocation()
+  const [urlParam, setUrlParam] = useState<any>({})
+  useEffect(() => {
+    const obj = urlParameter(location.search)
+    setUrlParam(obj)
+
+    if (obj.id) {
+      // 如果是编辑
+      object7infoOutAPIFu(obj.id)
+    } else object7AddAPIFu()
+  }, [location, object7AddAPIFu, object7infoOutAPIFu])
+
+  // 征集方式下拉框-待完善
+  const handleChange = (value: string) => {
+    setAddInfoTop({ ...addInfoTop, sourceName: value })
+  }
+
+  // 表格数据
+
+  // 选中的表格数据
+  const [tableSelectList, setTableSelectList] = useState([])
+
+  // 从仓库拿表格信息
+  const results = useSelector((state: RootState) => state.loginStore.goodsTableListZJ)
+
+  // 前端删除成功的id集合,用于点击存入草稿或者提交成功之后 传入后端删除
+  const delIds = useRef<any>([])
+
+  // 点击删除
+  const delTableListFu = useCallback(() => {
+    console.log('多个删除', tableSelectList)
+    const data = _.differenceBy(results, tableSelectList, 'id')
+    dispatch({ type: 'login/setGoodsSonListZJ', payload: data })
+    setTableSelectList(data)
+
+    // 删除的id存起来
+    tableSelectList.forEach((v: any) => {
+      delIds.current.push(v.id)
+    })
+  }, [dispatch, results, tableSelectList])
+
+  const delOne = useCallback(
+    (id: number) => {
+      const data = results.filter((v: any) => v.id !== id)
+      dispatch({ type: 'login/setGoodsSonListZJ', payload: data })
+      console.log('单个删除', id)
+      // 删除的id存起来
+      delIds.current.push(id)
+    },
+
+    [dispatch, results]
+  )
+
+  const rowSelection = {
+    onChange: (selectedRowKeys: any, selectedRows: any) => {
+      setTableSelectList(selectedRows)
+    }
+  }
+
+  // 点击添加或者编辑
+
+  const addId = useRef<any>(null)
+
+  const addPageFu = useCallback((id?: any) => {
+    addId.current = id
+    setAddPage(true)
+  }, [])
+
+  const columns = useMemo(() => {
+    return [
+      {
+        title: '缩略图',
+        render: (item: any) => <ImageLazy width={120} height={70} src={item.thumb} />
+      },
+
+      {
+        title: '藏品编号名称',
+        dataIndex: 'dictNum'
+      },
+      {
+        title: '藏品编号',
+        render: (item: any) => (item.num ? item.num : '-')
+      },
+      {
+        title: '藏品名称',
+        dataIndex: 'name'
+      },
+      {
+        title: '类别',
+        dataIndex: 'dictGoodType'
+      },
+      {
+        title: '完残程度',
+        dataIndex: 'complete'
+      },
+      {
+        title: '年代',
+        dataIndex: 'dictAge'
+      },
+      {
+        title: '操作',
+        render: (item: any) => (
+          <>
+            <Button type='text' danger onClick={() => addPageFu(item.id)}>
+              编辑
+            </Button>
+            <Popconfirm
+              title='确定删除吗?'
+              okText='确定'
+              cancelText='取消'
+              onConfirm={() => delOne(item.id)}
+            >
+              <Button type='text' danger>
+                删除
+              </Button>
+            </Popconfirm>
+          </>
+        )
+      }
+    ]
+  }, [addPageFu, delOne])
+
+  // 点击返回
+  const cancelFu = useCallback(() => {
+    history.push({
+      pathname: `/object`,
+      state: { k: urlParam.k ? urlParam.k : '1', d: urlParam.d }
+    })
+  }, [urlParam.d, urlParam.k])
+
+  // 点击提交
+  const submitFu = useCallback(
+    async (val: number) => {
+      if (!addInfoTop.sourceName) return MessageFu.warning('请选择征集方式!')
+
+      if (results.length === 0) return MessageFu.warning('至少需要添加一条藏品信息!')
+      const obj = {
+        ...addInfoTop,
+        status: val
+      }
+      const res: any = await object7AddAPI(obj)
+      if (res.code === 0) {
+        // 真正进行删除
+        if (delIds.current.length) {
+          const res2: any = await delInTablesAPI7(delIds.current.join(','))
+          if (res2.code === 0) {
+            MessageFu.success('操作成功!')
+            cancelFu()
+          }
+        } else {
+          MessageFu.success('操作成功!')
+          cancelFu()
+        }
+      }
+    },
+    [addInfoTop, cancelFu, results.length]
+  )
+
+  // 点击添加或者编辑出来页面
+  const [addPage, setAddPage] = useState(false)
+
+  return (
+    <div className={styles.AddObject7}>
+      <div className='breadTit'>
+        <BreadTit>
+          <div className='breadTitRow'>征集管理</div>
+          <div className='splitStr'>/</div>
+          <div className='breadTitRow active'>{urlParam.id ? '编辑' : '新增'}</div>
+        </BreadTit>
+      </div>
+
+      <div className='objectSonMain'>
+        {/* 上面的信息展示 */}
+        <div className='addInfoTop'>
+          <div className='row'>
+            <div>
+              <span className='bs'>征集编号:</span>
+              <Input style={{ width: 400 }} value={addInfoTop.num} disabled />
+            </div>
+            <div>
+              <span className='bs'>征集人员:</span>
+              <Input style={{ width: 400 }} value={addInfoTop.creatorName} disabled />
+            </div>
+          </div>
+          <div className='row'>
+            <div>
+              <span className='bs'>征集方式:</span>
+              <Select
+                placeholder='请选择'
+                style={{ width: 400 }}
+                value={addInfoTop.sourceName}
+                onChange={handleChange}
+                options={selectAdd1}
+              />
+            </div>
+          </div>
+          <div className='rowAll'>
+            <span>征集说明:</span>
+            <TextArea
+              value={addInfoTop.description}
+              onChange={e => setAddInfoTop({ ...addInfoTop, description: e.target.value })}
+              rows={3}
+              placeholder='请输入'
+              showCount
+              maxLength={255}
+            />
+          </div>
+        </div>
+
+        {/* 下面的表格 */}
+        <div className='addTableBox'>
+          <div className='addTableBox_Tit'>
+            <div className='addTableBox_TitL'>藏品信息</div>
+            <div className='addTableBox_TitR'>
+              <Button onClick={() => addPageFu(null)}>添加</Button>
+              &emsp;
+              <Popconfirm
+                disabled={tableSelectList.length === 0}
+                title='确定删除吗?'
+                okText='确定'
+                cancelText='取消'
+                onConfirm={delTableListFu}
+              >
+                <Button disabled={tableSelectList.length === 0}>删除</Button>
+              </Popconfirm>
+            </div>
+          </div>
+          {/* 表格主体 */}
+          <div className='addTableBox_table'>
+            <Table
+              size='small'
+              scroll={{ y: 300 }}
+              rowSelection={{
+                type: 'checkbox',
+                ...rowSelection
+              }}
+              dataSource={results}
+              columns={columns}
+              rowKey='id'
+              pagination={false}
+            />
+          </div>
+          <div className='addTableBox_btn'>
+            <Button onClick={() => submitFu(0)}>存入草稿</Button>
+            &emsp;
+            <Button type='primary' onClick={() => submitFu(1)}>
+              提交
+            </Button>
+            &emsp;
+            <Button onClick={cancelFu}>返回</Button>
+          </div>
+        </div>
+      </div>
+
+      {/* 点击添加或者编辑出来的页面 */}
+      {addPage ? (
+        <ObjectAdd
+          orderId={addInfoTop.id}
+          isZJ={true}
+          id={addId.current}
+          colsePage={() => setAddPage(false)}
+          dirCode={addInfoTop.id}
+        />
+      ) : null}
+    </div>
+  )
+}
+
+const MemoAddObject7 = React.memo(AddObject7)
+
+export default MemoAddObject7

+ 80 - 0
src/pages/ObjectSon/Object7/AuditObject7/index.module.scss

@@ -0,0 +1,80 @@
+.AuditObject7 {
+  :global {
+    .objectSonMain {
+      padding: 10px 30px;
+
+      .topTit {
+        font-size: 16px;
+        font-weight: 700;
+        color: var(--themeColor);
+        margin-bottom: 12px;
+      }
+
+      .topInfo {
+        .topInfoRow {
+          display: flex;
+
+          & > div {
+            width: 33.33%;
+            border: 1px solid #ccc;
+            height: 34px;
+            line-height: 32px;
+            display: flex;
+
+            .one {
+              font-weight: 700;
+              width: 80px;
+              text-align: right;
+            }
+          }
+        }
+
+        .topInfoTex {
+          cursor: pointer;
+          border: 1px solid #ccc;
+          padding: 5px 10px 4px;
+          display: -webkit-box;
+          overflow: hidden;
+          white-space: normal !important;
+          text-overflow: ellipsis;
+          word-wrap: break-word;
+          -webkit-line-clamp: 2;
+          -webkit-box-orient: vertical;
+
+          & > span {
+            font-weight: 700;
+          }
+        }
+      }
+
+      .goodsInfo {
+        .inputBox1 {
+          margin-bottom: 10px;
+          display: flex;
+          align-items: center;
+          .inputBoxTit {
+            font-weight: 700;
+            width: 90px;
+            & > span {
+              position: relative;
+              top: 3px;
+              color: #ff4d4f;
+            }
+          }
+          .inputBoxText {
+            width: calc(100% - 90px);
+          }
+        }
+        .inputBox2 {
+          align-items: flex-start;
+        }
+      }
+
+      .backBtn {
+        margin-top: 12px;
+        display: flex;
+        justify-content: center;
+      }
+    }
+  }
+}

+ 155 - 0
src/pages/ObjectSon/Object7/AuditObject7/index.tsx

@@ -0,0 +1,155 @@
+import React, { useCallback, useEffect, useRef, useState } from 'react'
+import styles from './index.module.scss'
+import { useDispatch, useSelector } from 'react-redux'
+import { useLocation } from 'react-router-dom'
+import history, { urlParameter } from '@/utils/history'
+import { auditObject7API, getObj7InfoTableAPI2, object7infoOutAPI } from '@/store/action/object7'
+import { statusObj } from '@/utils/dataChange'
+import { RootState } from '@/store'
+import { MessageFu } from '@/utils/message'
+import BreadTit from '@/components/BreadTit'
+import LookObjTable from '@/components/LookObjTable'
+import { Button, Select } from 'antd'
+import TextArea from 'antd/es/input/TextArea'
+const { Option } = Select
+
+function AuditObject7() {
+  const dispatch = useDispatch()
+  // 获取地址栏参数
+  const location = useLocation()
+  const urlParamRef = useRef<any>({})
+  useEffect(() => {
+    urlParamRef.current = urlParameter(location.search)
+    // console.log("地址栏参数", urlParamRef.current);
+  }, [location])
+
+  // 点击返回
+  const cancelFu = () => {
+    history.push({
+      pathname: `/object`,
+      state: {
+        k: urlParamRef.current.k ? urlParamRef.current.k : '1',
+        d: urlParamRef.current.d
+      }
+    })
+  }
+
+  const getInfo = useCallback(async () => {
+    const id = urlParamRef.current.id
+    const res1 = await object7infoOutAPI(id)
+    const res2 = await getObj7InfoTableAPI2(id)
+    const info = res1.data
+    info.statusTxt = statusObj[info.status]
+    const list = res2.data
+    dispatch({ type: 'object7/getLookInfo', payload: { info, list } })
+  }, [dispatch])
+
+  useEffect(() => {
+    getInfo()
+  }, [getInfo])
+
+  const { info, list: tableList } = useSelector((state: RootState) => state.object7Store.lookInfo)
+
+  // 审核结果筛选
+  const [value, setValue] = useState(3)
+  const valueChangeFu = (val: number) => {
+    setValue(val)
+  }
+
+  // 审核说明
+  const [value2, setValue2] = useState('')
+
+  // 点击确定
+  const btnOkFu = async () => {
+    const txt = value2.replaceAll(' ', '').replaceAll('\n', '')
+    if (txt === '') return MessageFu.warning('审核说明不能为空!')
+    const res: any = await auditObject7API({
+      id: Number(urlParamRef.current.id),
+      reason: value2,
+      status: value
+    })
+    if (res.code === 0) {
+      MessageFu.success('操作成功!')
+      cancelFu()
+    }
+  }
+
+  return (
+    <div className={styles.AuditObject7}>
+      <div className='breadTit'>
+        <BreadTit>
+          <div className='breadTitRow'>征集管理</div>
+          <div className='splitStr'>/</div>
+          <div className='breadTitRow active'>审核</div>
+        </BreadTit>
+      </div>
+      <div className='objectSonMain'>
+        <div className='topTit'>征集信息</div>
+        <div className='topInfo'>
+          <div className='topInfoRow'>
+            <div>
+              <div className='one'>征集编号:</div>
+              <div>{info.num}</div>
+            </div>
+            <div>
+              <div className='one'>征集人员:</div>
+              <div>{info.creatorName}</div>
+            </div>
+            <div>
+              <div className='one'>征集方式:</div>
+              <div>{info.sourceName}</div>
+            </div>
+          </div>
+          <div className='topInfoTex' title={info.description}>
+            <span>征集说明:</span>
+            {info.description ? info.description : '-'}
+          </div>
+        </div>
+        <br />
+        <div className='topTit'>藏品信息</div>
+
+        <div className='goodsInfo'>
+          {/* 封装的表格信息 */}
+          <LookObjTable isZj={true} data={tableList} y={245} />
+          <br />
+          <div className='inputBox1'>
+            <div className='inputBoxTit'>
+              <span>* </span>审核结果:
+            </div>
+            <Select style={{ width: 150 }} value={value} onChange={val => valueChangeFu(val)}>
+              <Option value={3}>通过</Option>
+              <Option value={2}>不通过</Option>
+            </Select>
+          </div>
+          <div className='inputBox1 inputBox2'>
+            <div className='inputBoxTit'>
+              <span>* </span>审核说明:
+            </div>
+            <div className='inputBoxText'>
+              <TextArea
+                value={value2}
+                onChange={e => setValue2(e.target.value)}
+                rows={3}
+                placeholder='请输入'
+                showCount
+                maxLength={255}
+              />
+            </div>
+          </div>
+        </div>
+
+        <div className='backBtn'>
+          <Button onClick={btnOkFu} type='primary'>
+            提交
+          </Button>
+          &emsp;
+          <Button onClick={cancelFu}>返回</Button>
+        </div>
+      </div>
+    </div>
+  )
+}
+
+const MemoAuditObject7 = React.memo(AuditObject7)
+
+export default MemoAuditObject7

+ 55 - 0
src/pages/ObjectSon/Object7/LookObject7/index.module.scss

@@ -0,0 +1,55 @@
+.LookObject7 {
+  :global {
+    .objectSonMain {
+      padding: 10px 30px;
+
+      .topTit {
+        font-size: 16px;
+        font-weight: 700;
+        color: var(--themeColor);
+        margin-bottom: 12px;
+      }
+
+      .topInfo {
+        .topInfoRow {
+          display: flex;
+          & > div {
+            width: 50%;
+            border: 1px solid #ccc;
+            height: 34px;
+            line-height: 32px;
+            display: flex;
+
+            .one {
+              font-weight: 700;
+              width: 80px;
+              text-align: right;
+            }
+          }
+        }
+
+        .topInfoTex {
+          cursor: pointer;
+          border: 1px solid #ccc;
+          padding: 5px 10px 4px;
+          display: -webkit-box;
+          overflow: hidden;
+          white-space: normal !important;
+          text-overflow: ellipsis;
+          word-wrap: break-word;
+          -webkit-line-clamp: 2;
+          -webkit-box-orient: vertical;
+
+          & > span {
+            font-weight: 700;
+          }
+        }
+      }
+      .backBtn {
+        margin-top: 12px;
+        display: flex;
+        justify-content: center;
+      }
+    }
+  }
+}

+ 123 - 0
src/pages/ObjectSon/Object7/LookObject7/index.tsx

@@ -0,0 +1,123 @@
+import React, { useCallback, useEffect, useRef } from 'react'
+import styles from './index.module.scss'
+import { useDispatch, useSelector } from 'react-redux'
+import { useLocation } from 'react-router-dom'
+import history, { urlParameter } from '@/utils/history'
+import { getObj7InfoTableAPI2, object7infoOutAPI } from '@/store/action/object7'
+import { statusObj } from '@/utils/dataChange'
+import { RootState } from '@/store'
+import BreadTit from '@/components/BreadTit'
+import LookObjTable from '@/components/LookObjTable'
+import AuthButton from '@/components/AuthButton'
+import { Button } from 'antd'
+function LookObject7() {
+  const dispatch = useDispatch()
+
+  // 获取地址栏参数
+  const location = useLocation()
+  const urlParamRef = useRef<any>({})
+  useEffect(() => {
+    urlParamRef.current = urlParameter(location.search)
+    // console.log("地址栏参数", urlParamRef.current);
+  }, [location])
+
+  // 点击返回
+  const cancelFu = () => {
+    history.push({
+      pathname: `/object`,
+      state: {
+        k: urlParamRef.current.k ? urlParamRef.current.k : '1',
+        d: urlParamRef.current.d
+      }
+    })
+  }
+
+  const getInfo = useCallback(async () => {
+    const id = urlParamRef.current.id
+    const res1 = await object7infoOutAPI(id)
+    const res2 = await getObj7InfoTableAPI2(id)
+    const info = res1.data
+    info.statusTxt = statusObj[info.status]
+    const list = res2.data
+    dispatch({ type: 'object7/getLookInfo', payload: { info, list } })
+  }, [dispatch])
+
+  useEffect(() => {
+    getInfo()
+  }, [getInfo])
+
+  const { info, list: tableList } = useSelector((state: RootState) => state.object7Store.lookInfo)
+
+  return (
+    <div className={styles.LookObject7}>
+      <div className='breadTit'>
+        <BreadTit>
+          <div className='breadTitRow'>征集管理</div>
+          <div className='splitStr'>/</div>
+          <div className='breadTitRow active'>查看</div>
+        </BreadTit>
+      </div>
+
+      <div className='objectSonMain'>
+        <div className='topTit'>征集信息</div>
+        <div className='topInfo'>
+          <div className='topInfoRow'>
+            <div>
+              <div className='one'>征集编号:</div>
+              <div>{info.num}</div>
+            </div>
+            <div>
+              <div className='one'>征集人员:</div>
+              <div>{info.creatorName}</div>
+            </div>
+          </div>
+          <div className='topInfoRow'>
+            <div>
+              <div className='one'>征集方式:</div>
+              <div>{info.sourceName}</div>
+            </div>
+            <div>
+              <div className='one'>审核结果:</div>
+              <div>{info.statusTxt}</div>
+            </div>
+          </div>
+          <div className='topInfoTex' title={info.description}>
+            <span>征集说明:</span>
+            {info.description ? info.description : '-'}
+          </div>
+          <div className='topInfoTex' title={info.reason}>
+            <span>审核说明:</span>
+            {info.reason ? info.reason : '-'}
+          </div>
+        </div>
+        <br />
+        <div className='topTit'>藏品信息</div>
+        <div className='goodsInfo'>
+          {/* 封装的表格信息 */}
+          <LookObjTable data={tableList} y={340} isZj={true} />
+        </div>
+        <div className='backBtn'>
+          {info.status === 2 ? (
+            <AuthButton
+              id={902}
+              type='primary'
+              onClick={() =>
+                history.push(
+                  `/object/7/add?k=${urlParamRef.current.k}&d=${urlParamRef.current.d}&id=${urlParamRef.current.id}`
+                )
+              }
+            >
+              编辑
+            </AuthButton>
+          ) : null}
+          &emsp;
+          <Button onClick={cancelFu}>返回</Button>
+        </div>
+      </div>
+    </div>
+  )
+}
+
+const MemoLookObject7 = React.memo(LookObject7)
+
+export default MemoLookObject7

+ 8 - 0
src/pages/ObjectSon/Object7/data.ts

@@ -0,0 +1,8 @@
+export const selectAdd1 = [
+  { value: '征购', lable: '征购' },
+  { value: '捐赠', lable: '捐赠' },
+  { value: '移交', lable: '移交' },
+  { value: '上交', lable: '上交' },
+  { value: '调拨', lable: '调拨' },
+  { value: '其他', lable: '其他' }
+]

+ 4 - 0
src/pages/ObjectSon/Object7/index.module.scss

@@ -0,0 +1,4 @@
+.Object7 {
+  :global {
+  }
+}

+ 313 - 0
src/pages/ObjectSon/Object7/index.tsx

@@ -0,0 +1,313 @@
+import React, { useEffect, useMemo, useRef, useState } from 'react'
+import styles from './index.module.scss'
+import BreadTit from '@/components/BreadTit'
+import { useDispatch, useSelector } from 'react-redux'
+import { getObject7List, getObject7ListNum, object7DelAPI } from '@/store/action/object7'
+import { RootState } from '@/store'
+import { useLocation } from 'react-router-dom'
+import history from '@/utils/history'
+import { MessageFu } from '@/utils/message'
+import { Button, DatePicker, Input, Popconfirm, Select, Table } from 'antd'
+import AuthButton from '@/components/AuthButton'
+import classNames from 'classnames'
+const { RangePicker } = DatePicker
+
+function Object7() {
+  const dispatch = useDispatch()
+
+  // 获取顶部数量
+
+  useEffect(() => {
+    dispatch(getObject7ListNum())
+  }, [dispatch])
+
+  // 顶部的状态改变了,统一管理,传到二级页码
+  const statusRef = useRef<null | number>(null)
+
+  const dataTit = useSelector((state: RootState) => state.object7Store.infoNum1)
+
+  // 封装发送请求的函数
+  const getList = () => {
+    const data = {
+      ...tableSelect,
+      pageNum: pageNumRef.current,
+      status: statusRef.current
+    }
+    dispatch(getObject7List(data))
+  }
+
+  // 获取地址栏参数
+  const location = useLocation()
+
+  const pageNumRef = useRef(1)
+
+  // 如果有参数 根据参数页码在次发送请求
+  useEffect(() => {
+    const urlParam = location.state || {}
+    setTableSelect({
+      ...tableSelect,
+      pageNum: Number(urlParam.k) ? Number(urlParam.k) : 1,
+      // eslint-disable-next-line eqeqeq
+      status: urlParam.d && urlParam.d != 'null' ? Number(urlParam.d) : null
+    })
+    // eslint-disable-next-line react-hooks/exhaustive-deps
+  }, [location])
+
+  // 顶部筛选
+  const [tableSelect, setTableSelect] = useState({
+    status: null as null | number,
+    sourceName: null,
+    searchKey: '',
+    startTime: '',
+    endTime: '',
+    pageSize: 10,
+    pageNum: 1
+  })
+
+  // 当前页码统一
+  useEffect(() => {
+    pageNumRef.current = tableSelect.pageNum
+  }, [tableSelect.pageNum])
+
+  // 顶部状态统一
+  useEffect(() => {
+    statusRef.current = tableSelect.status
+  }, [tableSelect.status])
+
+  // 防止返回的时候发送了2次请求来对应页码
+
+  const getListRef = useRef(-1)
+
+  useEffect(() => {
+    clearTimeout(getListRef.current)
+    getListRef.current = window.setTimeout(() => {
+      getList()
+    }, 100)
+
+    // eslint-disable-next-line react-hooks/exhaustive-deps
+  }, [tableSelect])
+
+  // 藏品来源下拉框筛选
+  const handleChange = (value: any) => {
+    setTableSelect({ ...tableSelect, sourceName: value, pageNum: 1 })
+  }
+
+  // 登记人员输入
+  const nameTime = useRef(-1)
+  const nameChange = (e: React.ChangeEvent<HTMLInputElement>) => {
+    clearTimeout(nameTime.current)
+    nameTime.current = window.setTimeout(() => {
+      setTableSelect({ ...tableSelect, searchKey: e.target.value, pageNum: 1 })
+    }, 500)
+  }
+
+  // 时间选择器改变
+  const timeChange = (date: any, dateString: any) => {
+    let startTime = ''
+    let endTime = ''
+    if (dateString[0] && dateString[1]) {
+      startTime = dateString[0] + ' 00:00:00'
+      endTime = dateString[1] + ' 23:59:59'
+    }
+    setTableSelect({ ...tableSelect, startTime, endTime, pageNum: 1 })
+  }
+
+  // 点击新增或者编辑按钮
+  const addObject = (id?: any) => {
+    // 清空详情页面里面的附件表格信息
+    dispatch({ type: 'login/setGoodsSonListZJ', payload: [] })
+
+    if (id) history.push(`/object/7/add?k=${pageNumRef.current}&d=${statusRef.current}&id=${id}`)
+    else history.push(`/object/7/add?k=${pageNumRef.current}&d=${statusRef.current}`)
+  }
+
+  // 点击删除按钮
+  const delOne = async (id: number) => {
+    const res: any = await object7DelAPI(id)
+    if (res.code === 0) {
+      MessageFu.success('删除成功!')
+      getList()
+      dispatch(getObject7ListNum())
+    }
+  }
+
+  // ---------关于表格
+
+  // 页码变化
+  const paginationChange = (pageNum: number, pageSize: number) => {
+    setTableSelect({ ...tableSelect, pageNum, pageSize })
+  }
+
+  const results = useSelector((state: RootState) => state.object7Store.info1)
+
+  const columns = useMemo(() => {
+    return [
+      {
+        title: '登记编号',
+        dataIndex: 'num'
+      },
+      {
+        title: '藏品来源',
+        dataIndex: 'sourceName'
+      },
+      {
+        title: '登记人员',
+        dataIndex: 'creatorName'
+      },
+      {
+        title: '创建日期',
+        dataIndex: 'createTime'
+      },
+      {
+        title: '完成日期',
+        render: (item: any) => (item.day && item.status === 3 ? item.day : '-')
+      },
+      {
+        title: '状态',
+        dataIndex: 'statusTxt'
+      },
+
+      {
+        title: '操作',
+        render: (item: any) => (
+          <>
+            <Button
+              type='text'
+              danger
+              onClick={() =>
+                history.push(
+                  `/object/7/look?k=${pageNumRef.current}&d=${statusRef.current}&id=${item.id}`
+                )
+              }
+            >
+              查看
+            </Button>
+            {item.status === 0 || item.status === 2 ? (
+              <AuthButton id={902} type='text' danger onClick={() => addObject(item.id)}>
+                编辑
+              </AuthButton>
+            ) : null}
+
+            {item.status === 1 ? (
+              <AuthButton
+                id={904}
+                onClick={() =>
+                  history.push(
+                    `/object/7/audit?k=${pageNumRef.current}&d=${statusRef.current}&id=${item.id}`
+                  )
+                }
+                type='text'
+                danger
+              >
+                审核
+              </AuthButton>
+            ) : null}
+
+            {item.status === 0 || item.status === 2 ? (
+              <Popconfirm
+                title='确定删除吗?'
+                okText='确定'
+                cancelText='取消'
+                onConfirm={() => delOne(item.id)}
+              >
+                <AuthButton id={903} type='text' danger>
+                  删除
+                </AuthButton>
+              </Popconfirm>
+            ) : null}
+          </>
+        )
+      }
+    ]
+    // eslint-disable-next-line react-hooks/exhaustive-deps
+  }, [])
+
+  // 从仓库中获取藏品来源下拉数据
+  const options = useSelector((state: RootState) => state.loginStore.selectAll['文物来源'])
+
+  return (
+    <div className={styles.Object7}>
+      <div className='breadTit'>
+        <BreadTit>
+          <div className='breadTitRow active'>征集管理</div>
+        </BreadTit>
+      </div>
+
+      <div className='objectSonMain'>
+        {/* 顶部筛选 */}
+        <div className='objectSonMainTit'>
+          {dataTit.map((v: any) => (
+            <div
+              key={v.id}
+              onClick={() => setTableSelect({ ...tableSelect, status: v.id, pageNum: 1 })}
+              className={classNames(v.id === tableSelect.status ? 'active' : '')}
+            >
+              {v.name}({v.num})
+            </div>
+          ))}
+        </div>
+        <div className='objectSonMainTable'>
+          {/* 表格数据筛选 */}
+          <div className='tableSelectBox'>
+            <div className='row'>
+              <span>藏品来源:</span>
+              <Select
+                placeholder='请选择'
+                allowClear
+                style={{ width: 150 }}
+                value={tableSelect.sourceName}
+                onChange={handleChange}
+                options={options.map((v: any) => ({
+                  label: v.name,
+                  value: v.name
+                }))}
+              />
+            </div>
+            <div className='row'>
+              <span>登记人员:</span>
+              <Input
+                maxLength={10}
+                style={{ width: 150 }}
+                placeholder='请输入'
+                allowClear
+                onChange={e => nameChange(e)}
+              />
+            </div>
+            <div className='row'>
+              <span>创建日期:</span>
+              <RangePicker onChange={timeChange} />
+            </div>
+            <div className='row'>
+              <AuthButton id={102} type='primary' onClick={() => addObject()}>
+                新增
+              </AuthButton>
+            </div>
+          </div>
+
+          {/* 表格主体 */}
+          <div className='tableMain'>
+            <Table
+              scroll={{ y: 428 }}
+              dataSource={results.list}
+              columns={columns}
+              rowKey='id'
+              pagination={{
+                showQuickJumper: true,
+                position: ['bottomCenter'],
+                showSizeChanger: true,
+                current: tableSelect.pageNum,
+                pageSize: tableSelect.pageSize,
+                total: results.total,
+                onChange: paginationChange
+              }}
+            />
+          </div>
+        </div>
+      </div>
+    </div>
+  )
+}
+
+const MemoObject7 = React.memo(Object7)
+
+export default MemoObject7

+ 215 - 216
src/pages/SystemSon/System2/index.tsx

@@ -1,264 +1,267 @@
-import BreadTit from "@/components/BreadTit";
-import { RootState } from "@/store";
+import BreadTit from '@/components/BreadTit'
+import { RootState } from '@/store'
 import {
   addRoleAPI,
   delRoleAPI,
   getRoleInfoAPI,
   getRoleListAPI,
-  roleEditStatusAPI,
-} from "@/store/action/system";
-import {
-  Button,
-  Checkbox,
-  Input,
-  Modal,
-  Popconfirm,
-  Switch,
-  Table,
-} from "antd";
-import TextArea from "antd/es/input/TextArea";
-import React, {
-  useCallback,
-  useEffect,
-  useMemo,
-  useRef,
-  useState,
-} from "react";
-import { useDispatch, useSelector } from "react-redux";
-import styles from "./index.module.scss";
-import classNames from "classnames";
-import "../System1/index.css";
-import { MessageFu } from "@/utils/message";
+  roleEditStatusAPI
+} from '@/store/action/system'
+import { Button, Checkbox, Input, Modal, Popconfirm, Switch, Table } from 'antd'
+import TextArea from 'antd/es/input/TextArea'
+import React, { useCallback, useEffect, useMemo, useRef, useState } from 'react'
+import { useDispatch, useSelector } from 'react-redux'
+import styles from './index.module.scss'
+import classNames from 'classnames'
+import '../System1/index.css'
+import { MessageFu } from '@/utils/message'
 
 function System2() {
-  const dispatch = useDispatch();
+  const dispatch = useDispatch()
 
   // 从仓库中获取权限数据
-  const roleInfo = useSelector(
-    (state: RootState) => state.systemStore.roleInfo
-  );
-  const roleArr = useSelector((state: RootState) => state.systemStore.roleArr);
+  const roleInfo = useSelector((state: RootState) => state.systemStore.roleInfo)
+  const roleArr = useSelector((state: RootState) => state.systemStore.roleArr)
+
+  const roleArrRes = useMemo(() => {
+    const arr: any[] = [...roleArr]
+
+    if (arr[0].id !== 900) {
+      arr.unshift(arr[arr.length - 1])
+      arr.length = arr.length - 1
+    }
+
+    return arr
+  }, [roleArr])
 
   // 筛选和分页
   const [tableSelect, setTableSelect] = useState({
-    searchKey: "",
+    searchKey: '',
     pageSize: 10,
-    pageNum: 1,
-  });
+    pageNum: 1
+  })
 
   // 账号的输入
-  const nameTime = useRef(-1);
+  const nameTime = useRef(-1)
   const nameChange = (e: React.ChangeEvent<HTMLInputElement>) => {
-    clearTimeout(nameTime.current);
+    clearTimeout(nameTime.current)
     nameTime.current = window.setTimeout(() => {
-      setTableSelect({ ...tableSelect, searchKey: e.target.value, pageNum: 1 });
-    }, 500);
-  };
+      setTableSelect({ ...tableSelect, searchKey: e.target.value, pageNum: 1 })
+    }, 500)
+  }
   useEffect(() => {
-    dispatch(getRoleListAPI(tableSelect));
-  }, [dispatch, tableSelect]);
+    dispatch(getRoleListAPI(tableSelect))
+  }, [dispatch, tableSelect])
 
   // 点击新增或者编辑按钮
   const addRole = useCallback(
     async (id?: any) => {
       if (id) {
-        const res: any = await getRoleInfoAPI(id);
-        const roleInfo = res.data.role;
-        const roleArr = res.data.permission;
-        dispatch({ type: "system/getRoleInfo", payload: roleInfo });
-        dispatch({ type: "system/getRoleArr", payload: roleArr });
-        setRoleDesc(roleInfo.roleDesc);
-        setRoleName(roleInfo.roleName);
-        editRef.current = "edit";
+        const res: any = await getRoleInfoAPI(id)
+        const roleInfo = res.data.role
+        const roleArr = res.data.permission
+        dispatch({ type: 'system/getRoleInfo', payload: roleInfo })
+        dispatch({ type: 'system/getRoleArr', payload: roleArr })
+        setRoleDesc(roleInfo.roleDesc)
+        setRoleName(roleInfo.roleName)
+        editRef.current = 'edit'
       } else {
         // 清空仓库角色信息
-        dispatch({ type: "system/getRoleInfo", payload: {} });
-        setRoleDesc("");
-        setRoleName("");
+        dispatch({ type: 'system/getRoleInfo', payload: {} })
+        setRoleDesc('')
+        setRoleName('')
         // 初始化权限信息
         dispatch({
-          type: "system/getRoleArr",
+          type: 'system/getRoleArr',
           payload: [
             {
+              id: 900,
+              name: '征集管理',
+              authority: false,
+              children: [
+                { name: '编辑', authority: false, id: 902 },
+                { name: '删除', authority: false, id: 903 },
+                { name: '审核', authority: false, id: 904 }
+              ]
+            },
+            {
               id: 100,
-              name: "藏品登记",
+              name: '藏品登记',
               authority: false,
               children: [
-                { name: "编辑", authority: false, id: 102 },
-                { name: "删除", authority: false, id: 103 },
-                { name: "审核", authority: false, id: 105 },
-              ],
+                { name: '编辑', authority: false, id: 102 },
+                { name: '删除', authority: false, id: 103 },
+                { name: '审核', authority: false, id: 105 }
+              ]
             },
             {
               id: 200,
-              name: "臧品总账",
+              name: '臧品总账',
               authority: false,
               children: [
-                { name: "编辑", authority: false, id: 202 },
-                { name: "移库", authority: false, id: 205 },
-              ],
+                { name: '编辑', authority: false, id: 202 },
+                { name: '移库', authority: false, id: 205 }
+              ]
             },
             {
               id: 300,
-              name: "入库管理",
+              name: '入库管理',
               authority: false,
               children: [
-                { name: "编辑", authority: false, id: 302 },
-                { name: "删除", authority: false, id: 303 },
-                { name: "审核", authority: false, id: 305 },
-              ],
+                { name: '编辑', authority: false, id: 302 },
+                { name: '删除', authority: false, id: 303 },
+                { name: '审核', authority: false, id: 305 }
+              ]
             },
             {
               id: 400,
-              name: "出库管理",
+              name: '出库管理',
               authority: false,
               children: [
-                { name: "编辑", authority: false, id: 402 },
-                { name: "删除", authority: false, id: 403 },
-                { name: "审核", authority: false, id: 405 },
-                { name: "归还", authority: false, id: 406 },
-              ],
+                { name: '编辑', authority: false, id: 402 },
+                { name: '删除', authority: false, id: 403 },
+                { name: '审核', authority: false, id: 405 },
+                { name: '归还', authority: false, id: 406 }
+              ]
             },
             {
               id: 500,
-              name: "臧品修改",
+              name: '臧品修改',
               authority: false,
               children: [
-                { name: "删除", authority: false, id: 503 },
-                { name: "审核", authority: false, id: 505 },
-              ],
+                { name: '删除', authority: false, id: 503 },
+                { name: '审核', authority: false, id: 505 }
+              ]
             },
             {
               id: 600,
-              name: "臧品注销",
+              name: '臧品注销',
               authority: false,
               children: [
-                { name: "编辑", authority: false, id: 602 },
-                { name: "删除", authority: false, id: 603 },
-                { name: "审核", authority: false, id: 605 },
-              ],
+                { name: '编辑', authority: false, id: 602 },
+                { name: '删除', authority: false, id: 603 },
+                { name: '审核', authority: false, id: 605 }
+              ]
             },
             {
               id: 700,
-              name: "库房设置",
+              name: '库房设置',
               authority: false,
               children: [
-                { name: "编辑", authority: false, id: 702 },
-                { name: "删除", authority: false, id: 703 },
-              ],
+                { name: '编辑', authority: false, id: 702 },
+                { name: '删除', authority: false, id: 703 }
+              ]
             },
             {
               id: 800,
-              name: "臧品移库",
+              name: '臧品移库',
               authority: false,
               children: [
-                { name: "删除", authority: false, id: 803 },
-                { name: "审核", authority: false, id: 805 },
-              ],
-            },
-          ],
-        });
-        editRef.current = "add";
+                { name: '删除', authority: false, id: 803 },
+                { name: '审核', authority: false, id: 805 }
+              ]
+            }
+          ]
+        })
+        editRef.current = 'add'
       }
-      setOpen(true);
+      setOpen(true)
     },
     [dispatch]
-  );
+  )
   // 点击删除
   const delOne = useCallback(
     async (id: number) => {
-      const res: any = await delRoleAPI(id);
+      const res: any = await delRoleAPI(id)
       if (res.code === 0) {
-        MessageFu.success("删除成功!");
+        MessageFu.success('删除成功!')
         // 重新发请求更新页面
-        dispatch(getRoleListAPI(tableSelect));
+        dispatch(getRoleListAPI(tableSelect))
       }
     },
     [dispatch, tableSelect]
-  );
+  )
 
   // ---------关于表格
 
   // 切换表格中的启用停用状态
   const isEnabledClickFu = useCallback(
     async (val: boolean, id: number) => {
-      const isDisable = val ? 1 : 0;
-      const res: any = await roleEditStatusAPI(id, isDisable);
-      if (res.code === 0) dispatch(getRoleListAPI(tableSelect));
+      const isDisable = val ? 1 : 0
+      const res: any = await roleEditStatusAPI(id, isDisable)
+      if (res.code === 0) dispatch(getRoleListAPI(tableSelect))
     },
     [dispatch, tableSelect]
-  );
+  )
 
   // 页码变化
   const paginationChange = (pageNum: number, pageSize: number) => {
-    setTableSelect({ ...tableSelect, pageNum, pageSize });
-  };
-  const results = useSelector(
-    (state: RootState) => state.systemStore.tableList
-  );
+    setTableSelect({ ...tableSelect, pageNum, pageSize })
+  }
+  const results = useSelector((state: RootState) => state.systemStore.tableList)
   const columns = useMemo(() => {
     return [
       {
-        title: "角色名称",
-        dataIndex: "roleName",
+        title: '角色名称',
+        dataIndex: 'roleName'
       },
       {
-        title: "描述",
-        dataIndex: "roleDesc",
+        title: '描述',
+        dataIndex: 'roleDesc'
       },
       {
-        title: "成员数量",
-        dataIndex: "count",
+        title: '成员数量',
+        dataIndex: 'count'
       },
 
       {
-        title: "状态",
+        title: '状态',
         render: (item: any) => (
           <Switch
-            checkedChildren="启用"
-            unCheckedChildren="停用"
+            checkedChildren='启用'
+            unCheckedChildren='停用'
             checked={item.isEnabled === 1}
-            onChange={(val) => isEnabledClickFu(val, item.id)}
-            disabled={item.roleKey && item.roleKey.includes("sys_")}
+            onChange={val => isEnabledClickFu(val, item.id)}
+            disabled={item.roleKey && item.roleKey.includes('sys_')}
           />
-        ),
+        )
       },
 
       {
-        title: "操作",
+        title: '操作',
         render: (item: any) => (
           <>
-            <Button type="text" danger onClick={() => addRole(item.id)}>
-              {item.roleKey && item.roleKey.includes("sys_") ? "查看" : "编辑"}
+            <Button type='text' danger onClick={() => addRole(item.id)}>
+              {item.roleKey && item.roleKey.includes('sys_') ? '查看' : '编辑'}
             </Button>
-            {item.roleKey && item.roleKey.includes("sys_") ? null : (
+            {item.roleKey && item.roleKey.includes('sys_') ? null : (
               <>
                 <Popconfirm
-                  title="确定删除吗?"
-                  okText="确定"
-                  cancelText="取消"
+                  title='确定删除吗?'
+                  okText='确定'
+                  cancelText='取消'
                   onConfirm={() => delOne(item.id)}
                 >
-                  <Button type="text" danger>
+                  <Button type='text' danger>
                     删除
                   </Button>
                 </Popconfirm>
               </>
             )}
           </>
-        ),
-      },
-    ];
-  }, [addRole, delOne, isEnabledClickFu]);
+        )
+      }
+    ]
+  }, [addRole, delOne, isEnabledClickFu])
 
   // --------关于弹窗
-  const [open, setOpen] = useState(false);
-  const editRef = useRef("add");
+  const [open, setOpen] = useState(false)
+  const editRef = useRef('add')
 
   // 角色名称
-  const [roleName, setRoleName] = useState("");
+  const [roleName, setRoleName] = useState('')
   // 描述
-  const [roleDesc, setRoleDesc] = useState("");
+  const [roleDesc, setRoleDesc] = useState('')
 
   // 权限第一级的改变
   const checkOneFu = useCallback(
@@ -266,111 +269,111 @@ function System2() {
       const data = roleArr.map((v: any) => {
         return {
           ...v,
-          authority: v.id === id ? val : v.authority,
-        };
-      });
-      dispatch({ type: "system/getRoleArr", payload: data });
+          authority: v.id === id ? val : v.authority
+        }
+      })
+      dispatch({ type: 'system/getRoleArr', payload: data })
     },
     [dispatch, roleArr]
-  );
+  )
   // 权限的第二级改变
   const checkTowFu = useCallback(
     (val: boolean, id1: number, id2: number) => {
-      const data = [...roleArr];
-      data.forEach((v) => {
+      const data = [...roleArr]
+      data.forEach(v => {
         if (v.id === id1) {
           v.children.forEach((v2: any) => {
-            if (v2.id === id2) v2.authority = val;
-          });
+            if (v2.id === id2) v2.authority = val
+          })
         }
-      });
-      dispatch({ type: "system/getRoleArr", payload: data });
+      })
+      dispatch({ type: 'system/getRoleArr', payload: data })
     },
     [dispatch, roleArr]
-  );
+  )
 
   // 点击提交
   const btnOkFu = useCallback(async () => {
-    if (roleName === "") return MessageFu.warning("角色名称不能为空!");
-    const txt = roleDesc.replaceAll(" ", "").replaceAll("\n", "");
-    if (txt === "") return MessageFu.warning("描述不能为空!");
-    const resources = [] as any;
+    if (roleName === '') return MessageFu.warning('角色名称不能为空!')
+    const txt = roleDesc.replaceAll(' ', '').replaceAll('\n', '')
+    if (txt === '') return MessageFu.warning('描述不能为空!')
+    const resources = [] as any
     roleArr.forEach((v: any) => {
-      if (v.authority) resources.push(v.id);
+      if (v.authority) resources.push(v.id)
       v.children.forEach((v2: any) => {
-        if (v2.authority) resources.push(v2.id);
-      });
-    });
+        if (v2.authority) resources.push(v2.id)
+      })
+    })
     const obj = {
       ...roleInfo,
       roleName,
       roleDesc,
-      resources,
-    };
-    const res: any = await addRoleAPI(obj);
+      resources
+    }
+    const res: any = await addRoleAPI(obj)
     if (res.code === 0) {
-      MessageFu.success("操作成功!");
-      setOpen(false);
+      MessageFu.success('操作成功!')
+      setOpen(false)
       // 重新发请求更新页面
-      dispatch(getRoleListAPI(tableSelect));
+      dispatch(getRoleListAPI(tableSelect))
     }
-  }, [dispatch, roleArr, roleDesc, roleInfo, roleName, tableSelect]);
+  }, [dispatch, roleArr, roleDesc, roleInfo, roleName, tableSelect])
 
   return (
     <div className={styles.System2}>
-      <div className="breadTit">
+      <div className='breadTit'>
         <BreadTit>
-          <div className="breadTitRow active">角色管理</div>
+          <div className='breadTitRow active'>角色管理</div>
         </BreadTit>
       </div>
-      <div className="objectSonMain">
-        <div className="tableSelectBox">
-          <div className="row">
+      <div className='objectSonMain'>
+        <div className='tableSelectBox'>
+          <div className='row'>
             <span>角色名:</span>
             <Input
               maxLength={10}
               style={{ width: 150 }}
-              placeholder="请输入"
+              placeholder='请输入'
               allowClear
-              onChange={(e) => nameChange(e)}
+              onChange={e => nameChange(e)}
             />
           </div>
-          <div className="row">
-            <Button type="primary" onClick={() => addRole()}>
+          <div className='row'>
+            <Button type='primary' onClick={() => addRole()}>
               新增角色
             </Button>
           </div>
         </div>
         {/* 表格主体 */}
-        <div className="tableMain">
+        <div className='tableMain'>
           <Table
             scroll={{ y: 480 }}
             dataSource={results.list}
             columns={columns}
-            rowKey="id"
+            rowKey='id'
             pagination={{
               showQuickJumper: true,
-              position: ["bottomCenter"],
+              position: ['bottomCenter'],
               showSizeChanger: true,
               current: tableSelect.pageNum,
               pageSize: tableSelect.pageSize,
               total: results.total,
-              onChange: paginationChange,
+              onChange: paginationChange
             }}
           />
         </div>
       </div>
       {/* 点击新增或者编辑出来的弹窗 */}
       <Modal
-        wrapClassName="systemUser systemRole"
+        wrapClassName='systemUser systemRole'
         destroyOnClose
         open={open}
         title={
-          editRef.current === "add"
-            ? "新增角色"
-            : roleInfo.roleKey && roleInfo.roleKey.includes("sys_")
-            ? "查看角色"
-            : "编辑角色"
+          editRef.current === 'add'
+            ? '新增角色'
+            : roleInfo.roleKey && roleInfo.roleKey.includes('sys_')
+            ? '查看角色'
+            : '编辑角色'
         }
         onCancel={() => setOpen(false)}
         footer={
@@ -379,56 +382,52 @@ function System2() {
       >
         <div
           className={classNames(
-            "systemTit",
-            roleInfo.roleKey && roleInfo.roleKey.includes("sys_")
-              ? "looksystem"
-              : ""
+            'systemTit',
+            roleInfo.roleKey && roleInfo.roleKey.includes('sys_') ? 'looksystem' : ''
           )}
         >
-          <div className="systemTitRow">
-            <div className="bs">*</div>
-            <div className="lable">角色名称:</div>
+          <div className='systemTitRow'>
+            <div className='bs'>*</div>
+            <div className='lable'>角色名称:</div>
             <Input
               maxLength={15}
               showCount
               style={{ width: 600 }}
-              placeholder="请输入"
+              placeholder='请输入'
               value={roleName}
-              onChange={(e) => setRoleName(e.target.value.trim())}
+              onChange={e => setRoleName(e.target.value.trim())}
             />
           </div>
-          <div className="systemTitRow">
-            <div className="bs bs2">*</div>
-            <div className="lable">描述:</div>
+          <div className='systemTitRow'>
+            <div className='bs bs2'>*</div>
+            <div className='lable'>描述:</div>
             <TextArea
               style={{ width: 600 }}
               value={roleDesc}
-              onChange={(e) => setRoleDesc(e.target.value)}
+              onChange={e => setRoleDesc(e.target.value)}
               rows={3}
-              placeholder="请输入"
+              placeholder='请输入'
               showCount
               maxLength={255}
             />
           </div>
-          <div className="systemTitRow systemTitRow2">
-            <div className="lable">权限设置:</div>
-            <div className="powerBox">
-              {roleArr.map((v: any) => (
-                <div className="powerBoxRow" key={v.id}>
-                  <span className="label">{v.name}:</span>
+          <div className='systemTitRow systemTitRow2'>
+            <div className='lable'>权限设置:</div>
+            <div className='powerBox'>
+              {roleArrRes.map((v: any) => (
+                <div className='powerBoxRow' key={v.id}>
+                  <span className='label'>{v.name}:</span>
                   <Checkbox
-                    className="oneCheck"
+                    className='oneCheck'
                     checked={v.authority}
-                    onChange={(e) => checkOneFu(e.target.checked, v.id)}
+                    onChange={e => checkOneFu(e.target.checked, v.id)}
                   >
                     启用
                   </Checkbox>
                   {v.children.map((v2: any) => (
                     <Checkbox
                       checked={v2.authority}
-                      onChange={(e) =>
-                        checkTowFu(e.target.checked, v.id, v2.id)
-                      }
+                      onChange={e => checkTowFu(e.target.checked, v.id, v2.id)}
                       disabled={!v.authority}
                       key={v2.id}
                     >
@@ -438,9 +437,9 @@ function System2() {
                 </div>
               ))}
               {roleInfo.id === 1 ? (
-                <div className="powerBoxRow">
-                  <span className="label">系统管理:</span>
-                  <Checkbox className="oneCheck" defaultChecked={true}>
+                <div className='powerBoxRow'>
+                  <span className='label'>系统管理:</span>
+                  <Checkbox className='oneCheck' defaultChecked={true}>
                     启用
                   </Checkbox>
                 </div>
@@ -449,8 +448,8 @@ function System2() {
           </div>
 
           <br />
-          <div className="systemTitBtn">
-            <Button type="primary" onClick={btnOkFu}>
+          <div className='systemTitBtn'>
+            <Button type='primary' onClick={btnOkFu}>
               提交
             </Button>
             &emsp;
@@ -459,9 +458,9 @@ function System2() {
         </div>
       </Modal>
     </div>
-  );
+  )
 }
 
-const MemoSystem2 = React.memo(System2);
+const MemoSystem2 = React.memo(System2)
 
-export default MemoSystem2;
+export default MemoSystem2

+ 19 - 4
src/store/action/object1.ts

@@ -108,16 +108,16 @@ export const object1infoOutAPI = (id: number) => {
 /**
  * 通过id获取表格信息
  */
-export const getObj1InfoTableAPI2 = (id: number) => {
-  return http.get(`cms/register/goods/list/${id}`)
+export const getObj1InfoTableAPI2 = (ids: string) => {
+  return http.get(`cms/register/goods/getList/${ids}`)
 }
 /**
  * 通过id获取表格信息
  */
-export const getObj1InfoTableAPI = (id: number): any => {
+export const getObj1InfoTableAPI = (ids: string): any => {
   return async (dispatch: AppDispatch) => {
     // 获取统计数据
-    const res: any = await http.get(`cms/register/goods/list/${id}`)
+    const res: any = await http.get(`cms/register/goods/getList/${ids}`)
     dispatch({ type: 'login/setGoodsSonList', payload: res.data })
   }
 }
@@ -149,3 +149,18 @@ export const getInfoInAPI = (id: number) => {
 export const auditObject1API = (data: any) => {
   return http.post('cms/register/audit', data)
 }
+
+/**
+ * 获取征集列表信息
+ */
+export const API_getGoodsListByZJ = (val: any): any => {
+  return async (dispatch: AppDispatch) => {
+    // 获取统计数据
+
+    let url = 'cms/register/goods/zjList'
+    if (val) url += `?num=${val}`
+
+    const res: any = await http.get(url)
+    dispatch({ type: 'object1/getZJlist', payload: res.data })
+  }
+}

+ 135 - 0
src/store/action/object7.ts

@@ -0,0 +1,135 @@
+import { statusObj } from '@/utils/dataChange'
+import http from '@/utils/http'
+import { MessageFu } from '@/utils/message'
+import store, { AppDispatch } from '..'
+
+/**
+ * 征集管理页面点击新增
+ */
+export const object7AddAPI = (data?: any) => {
+  return http.post('cms/collect/save', { ...data })
+}
+
+/**
+ * 里面的一条藏品添加
+ */
+export const goodsSonAddAPIZJ = (data: any, id: any, isZJbyDJ?: boolean): any => {
+  return async (dispatch: AppDispatch) => {
+    const res: any = await http.post('cms/collect/goods/save', data)
+
+    if (res.code === 0) {
+      const oldData = isZJbyDJ
+        ? store.getState().object1Store.isZJListAc
+        : store.getState().loginStore.goodsTableListZJ
+      MessageFu.success('操作成功!')
+      let newData
+      if (id) {
+        // 是编辑 覆盖之前的数据
+        newData = oldData.map((v: any) => {
+          if (v.id === id) return res.data
+          else return v
+        })
+      } else newData = [res.data, ...oldData] // 是新增,在前面添加一条数据
+      dispatch({
+        type: isZJbyDJ ? 'object1/getIsZJListAc' : 'login/setGoodsSonListZJ',
+        payload: newData
+      })
+    }
+  }
+}
+
+/**
+ * 获取征集管理列表信息
+ */
+export const getObject7List = (data: any): any => {
+  return async (dispatch: AppDispatch) => {
+    // 获取列表数据
+    const res: any = await http.post('cms/collect/pageList', data)
+    const list = res.data.records
+    list.forEach((v: any) => {
+      v.statusTxt = statusObj[v.status]
+    })
+    const obj = {
+      list,
+      total: res.data.total
+    }
+    dispatch({ type: 'object7/getList', payload: obj })
+  }
+}
+
+/**
+ * 获取征集管理列表顶部数字信息
+ */
+export const getObject7ListNum = (): any => {
+  return async (dispatch: AppDispatch) => {
+    // 获取统计数据
+    const res: any = await http.get('cms/collect/countByStatus')
+
+    const data = [
+      { id: null, name: '全部', num: res.data.all ? res.data.all : 0 },
+      { id: 0, name: '待办理', num: res.data[0] ? res.data[0] : 0 },
+      { id: 1, name: '待审核', num: res.data[1] ? res.data[1] : 0 },
+      { id: 2, name: '审核不通过', num: res.data[2] ? res.data[2] : 0 },
+      { id: 3, name: '已完成', num: res.data[3] ? res.data[3] : 0 }
+    ]
+    dispatch({ type: 'object7/getListNum', payload: data })
+  }
+}
+
+/**
+ * 删除外层表格数据
+ */
+export const object7DelAPI = (id: number) => {
+  return http.get(`cms/collect/remove/${id}`)
+}
+
+/**
+ * 通过id获取信息
+ */
+export const object7infoOutAPI = (id: number) => {
+  return http.get(`cms/collect/detail/${id}`)
+}
+/**
+ * 通过id获取表格信息
+ */
+export const getObj7InfoTableAPI2 = (id: number) => {
+  return http.get(`cms/collect/goods/list/${id}`)
+}
+/**
+ * 通过id获取表格信息
+ */
+export const getObj7InfoTableAPI = (id: number): any => {
+  return async (dispatch: AppDispatch) => {
+    // 获取统计数据
+    const res: any = await http.get(`cms/collect/goods/list/${id}`)
+    dispatch({ type: 'login/setGoodsSonListZJ', payload: res.data })
+  }
+}
+
+/**
+ * 删除里面的表格藏品 s
+ */
+export const delInTablesAPI7 = (ids: string) => {
+  return http.get(`cms/collect/goods/removes/${ids}`)
+}
+
+/**
+ * 删除最里面的附件或者封面图 s
+ */
+export const delInfileAPI7 = (ids: string) => {
+  return http.get(`cms/collect/goods/file/dels/${ids}`)
+}
+
+/**
+ * 通过id获取里面的藏品详情
+ */
+export const getInfoInAPI7 = (id: number) => {
+  return http.get(`cms/collect/goods/detail/${id}`)
+}
+
+/**
+ * 审核藏品信息
+ */
+export const auditObject7API = (data: any) => {
+  return http.post('cms/collect/audit', data)
+}

+ 16 - 14
src/store/reducer/index.ts

@@ -1,14 +1,15 @@
-import { combineReducers } from "redux";
-import loginReducer from "./login";
-import object1Reducer from "./object1";
-import object2Reducer from "./object2";
-import object3Reducer from "./object3";
-import object4Reducer from "./object4";
-import object5Reducer from "./object5";
-import object6Reducer from "./object6";
-import stores1Reducer from "./stores1";
-import stores3Reducer from "./stores3";
-import systemReducer from "./system";
+import { combineReducers } from 'redux'
+import loginReducer from './login'
+import object1Reducer from './object1'
+import object2Reducer from './object2'
+import object3Reducer from './object3'
+import object4Reducer from './object4'
+import object5Reducer from './object5'
+import object6Reducer from './object6'
+import object7Reducer from './object7'
+import stores1Reducer from './stores1'
+import stores3Reducer from './stores3'
+import systemReducer from './system'
 
 // 合并 reducer
 const rootReducer = combineReducers({
@@ -19,9 +20,10 @@ const rootReducer = combineReducers({
   object4Store: object4Reducer,
   object5Store: object5Reducer,
   object6Store: object6Reducer,
+  object7Store: object7Reducer,
   stores1Store: stores1Reducer,
   stores3Store: stores3Reducer,
-  systemStore: systemReducer,
-});
+  systemStore: systemReducer
+})
 
-export default rootReducer;
+export default rootReducer

+ 41 - 39
src/store/reducer/login.ts

@@ -1,4 +1,4 @@
-import { MessageType } from "@/utils/message";
+import { MessageType } from '@/utils/message'
 
 // 初始化状态应用注解
 const initState = {
@@ -13,7 +13,7 @@ const initState = {
     质量范围: [],
     文物类别: [],
     质地: [],
-    年代: [],
+    年代: []
   } as any,
   // 单个里面的藏品的附件信息
   fileData: {
@@ -21,69 +21,71 @@ const initState = {
     video: [],
     audio: [],
     model: [],
-    doc: [],
+    doc: []
   } as any,
   // 藏品的表格信息
   goodsTableList: [] as any,
+  // 征集管理-藏品的表格信息
+  goodsTableListZJ: [] as any,
   // 关于按钮的权限信息
   authButtonArr: [],
   // 外层页面的权限信息
   authPageArr: [],
   // 所有图片点击预览查看大图
   lookBigImg: {
-    url: "",
-    show: false,
+    url: '',
+    show: false
   },
   // 加载请求的loding
   asyncLoding: false,
   // antd轻提示(兼容360浏览器)
   message: {
-    txt: "",
-    type: "info",
-    duration: 3,
-  } as MessageType,
-};
+    txt: '',
+    type: 'info',
+    duration: 3
+  } as MessageType
+}
 
 type LoginActionType =
-  | { type: "login/getSelectAll"; payload: any }
-  | { type: "login/setFileData"; payload: any }
-  | { type: "login/setGoodsSonList"; payload: any }
-  | { type: "login/setAuthButtonArr"; payload: any }
-  | { type: "login/setAuthPageArr"; payload: any }
-  | { type: "login/lookBigImg"; payload: any }
-  | { type: "login/asyncLoding"; payload: any }
-  | { type: "login/message"; payload: MessageType };
+  | { type: 'login/getSelectAll'; payload: any }
+  | { type: 'login/setFileData'; payload: any }
+  | { type: 'login/setGoodsSonList'; payload: any }
+  | { type: 'login/setGoodsSonListZJ'; payload: any }
+  | { type: 'login/setAuthButtonArr'; payload: any }
+  | { type: 'login/setAuthPageArr'; payload: any }
+  | { type: 'login/lookBigImg'; payload: any }
+  | { type: 'login/asyncLoding'; payload: any }
+  | { type: 'login/message'; payload: MessageType }
 // 频道 reducer
-export default function loginReducer(
-  state = initState,
-  action: LoginActionType
-) {
+export default function loginReducer(state = initState, action: LoginActionType) {
   switch (action.type) {
     // 所有的下拉列表数据
-    case "login/getSelectAll":
-      return { ...state, selectAll: action.payload };
+    case 'login/getSelectAll':
+      return { ...state, selectAll: action.payload }
     // 新增编辑藏品的附件数据(弹窗里面的附件)
-    case "login/setFileData":
-      return { ...state, fileData: action.payload };
+    case 'login/setFileData':
+      return { ...state, fileData: action.payload }
     // 新增编辑藏品 的外层 表格信息(新增编辑页面下面的表格)
-    case "login/setGoodsSonList":
-      return { ...state, goodsTableList: action.payload };
+    case 'login/setGoodsSonList':
+      return { ...state, goodsTableList: action.payload }
+    case 'login/setGoodsSonListZJ':
+      return { ...state, goodsTableListZJ: action.payload }
     // 关于按钮的权限信息
-    case "login/setAuthButtonArr":
-      return { ...state, authButtonArr: action.payload };
+    case 'login/setAuthButtonArr':
+      return { ...state, authButtonArr: action.payload }
     // 关于外层页面的权限信息
-    case "login/setAuthPageArr":
-      return { ...state, authPageArr: action.payload };
+    case 'login/setAuthPageArr':
+      return { ...state, authPageArr: action.payload }
     // 所有图片点击预览查看大图
-    case "login/lookBigImg":
-      return { ...state, lookBigImg: action.payload };
+    case 'login/lookBigImg':
+      return { ...state, lookBigImg: action.payload }
     // 加载请求的loding
-    case "login/asyncLoding":
-      return { ...state, asyncLoding: action.payload };
+    case 'login/asyncLoding':
+      return { ...state, asyncLoding: action.payload }
     // antd轻提示(兼容360浏览器)
-    case "login/message":
-      return { ...state, message: action.payload };
+    case 'login/message':
+      return { ...state, message: action.payload }
     default:
-      return state;
+      return state
   }
 }

+ 31 - 22
src/store/reducer/object1.ts

@@ -3,14 +3,14 @@ const initState = {
   // 表格数据
   info1: {
     list: [] as any,
-    total: 0,
+    total: 0
   },
   // 表格顶部数字数据
   infoNum1: [],
   // 查看和审核的表格信息
   lookInfo: {
     info: {} as any,
-    list: [] as any,
+    list: [] as any
   },
   // 点击里面的表格的查看的单个藏品信息
   oneGoodsInfo: {
@@ -20,36 +20,45 @@ const initState = {
       video: [],
       audio: [],
       model: [],
-      doc: [],
-    },
+      doc: []
+    }
   } as any,
-};
+
+  // 征集列表-所有
+  isZJList: [] as any[],
+  // 征集列表-选中
+  isZJListAc: [] as any[]
+}
 
 type LoginActionType =
-  | { type: "object1/getList"; payload: any }
-  | { type: "object1/getListNum"; payload: any }
-  | { type: "object1/getLookInfo"; payload: any }
-  | { type: "object1/getOneGoodsInfo"; payload: any };
+  | { type: 'object1/getList'; payload: any }
+  | { type: 'object1/getListNum'; payload: any }
+  | { type: 'object1/getLookInfo'; payload: any }
+  | { type: 'object1/getOneGoodsInfo'; payload: any }
+  | { type: 'object1/getZJlist'; payload: any }
+  | { type: 'object1/getIsZJListAc'; payload: any }
 // 频道 reducer
-export default function object1Reducer(
-  state = initState,
-  action: LoginActionType
-) {
+export default function object1Reducer(state = initState, action: LoginActionType) {
   switch (action.type) {
     // 表格数据1
-    case "object1/getList":
-      return { ...state, info1: action.payload };
+    case 'object1/getList':
+      return { ...state, info1: action.payload }
     // 表格顶部数字数据1
-    case "object1/getListNum":
-      return { ...state, infoNum1: action.payload };
+    case 'object1/getListNum':
+      return { ...state, infoNum1: action.payload }
     // 查看和审核的表格数据
-    case "object1/getLookInfo":
-      return { ...state, lookInfo: action.payload };
+    case 'object1/getLookInfo':
+      return { ...state, lookInfo: action.payload }
     // 点击里面的表格的查看的单个藏品信息
-    case "object1/getOneGoodsInfo":
-      return { ...state, oneGoodsInfo: action.payload };
+    case 'object1/getOneGoodsInfo':
+      return { ...state, oneGoodsInfo: action.payload }
+    // 获取征集列表
+    case 'object1/getZJlist':
+      return { ...state, isZJList: action.payload }
+    case 'object1/getIsZJListAc':
+      return { ...state, isZJListAc: action.payload }
 
     default:
-      return state;
+      return state
   }
 }

+ 52 - 0
src/store/reducer/object7.ts

@@ -0,0 +1,52 @@
+// 初始化状态应用注解
+const initState = {
+  // 表格数据
+  info1: {
+    list: [] as any,
+    total: 0
+  },
+  // 表格顶部数字数据
+  infoNum1: [],
+  // 查看和审核的表格信息
+  lookInfo: {
+    info: {} as any,
+    list: [] as any
+  },
+  // 点击里面的表格的查看的单个藏品信息
+  oneGoodsInfo: {
+    info: {},
+    fileList: {
+      img: [],
+      video: [],
+      audio: [],
+      model: [],
+      doc: []
+    }
+  } as any
+}
+
+type LoginActionType =
+  | { type: 'object7/getList'; payload: any }
+  | { type: 'object7/getListNum'; payload: any }
+  | { type: 'object7/getLookInfo'; payload: any }
+  | { type: 'object7/getOneGoodsInfo'; payload: any }
+// 频道 reducer
+export default function object7Reducer(state = initState, action: LoginActionType) {
+  switch (action.type) {
+    // 表格数据1
+    case 'object7/getList':
+      return { ...state, info1: action.payload }
+    // 表格顶部数字数据1
+    case 'object7/getListNum':
+      return { ...state, infoNum1: action.payload }
+    // 查看和审核的表格数据
+    case 'object7/getLookInfo':
+      return { ...state, lookInfo: action.payload }
+    // 点击里面的表格的查看的单个藏品信息
+    case 'object7/getOneGoodsInfo':
+      return { ...state, oneGoodsInfo: action.payload }
+
+    default:
+      return state
+  }
+}

+ 1 - 1
src/utils/http.ts

@@ -20,7 +20,7 @@ const http = axios.create({
 
   // --------打包或线上环境接口需要加上api/
   baseURL: baseURL + '/api/',
-  timeout: 5000
+  timeout: 20000
 })
 
 let axajInd = 0