shaogen1995 2 rokov pred
rodič
commit
5bbc32c625

+ 86 - 11
src/components/ObjectAdd/index.tsx

@@ -31,6 +31,8 @@ import {
   goodsSonAddAPI,
   object1AddUpFileAPI,
 } from "@/store/action/object1";
+import { goodsChangeObj } from "@/utils/dataChange";
+import { editObj2GoodsAPI } from "@/store/action/object2";
 const { Option } = Select;
 
 type Props = {
@@ -38,9 +40,10 @@ type Props = {
   colsePage: any;
   editId?: any;
   dirCode: any;
+  upInfoAPIFu?: any;
 };
 
-function ObjectAdd({ id, colsePage, editId, dirCode }: Props) {
+function ObjectAdd({ id, colsePage, editId, dirCode, upInfoAPIFu }: Props) {
   const dispatch = useDispatch();
 
   // 没有通过校验
@@ -55,7 +58,6 @@ function ObjectAdd({ id, colsePage, editId, dirCode }: Props) {
     for (const k in values) {
       if (values[k]) oldObj[k] = values[k];
     }
-
     // 外形尺寸 3个 字段 变成一个组数
     const size = [values.size1, values.size2, values.size3];
     // 具体质量 + 单位
@@ -63,9 +65,14 @@ function ObjectAdd({ id, colsePage, editId, dirCode }: Props) {
     if (values.quality) quality = [values.quality, danweiValue];
     // 文件id
     const fileIds = [] as any;
+
+    // 新的完整附件数据
+    const newDataFile = [] as any;
+
     for (const k in results) {
       results[k].forEach((v: any) => {
         fileIds.push(v.id);
+        newDataFile.push(v);
       });
     }
     // 年代
@@ -85,18 +92,79 @@ function ObjectAdd({ id, colsePage, editId, dirCode }: Props) {
       dictAge,
       dictTexture,
     };
-    await dispatch(goodsSonAddAPI(obj, id));
 
-    // 真正的删除
-    if (delFileList.current.length) {
-      await delInfileAPI(delFileList.current.join(","));
-    }
-    //  关闭弹窗
-    colsePage();
+    // -----------------藏品修改
+    if (editId === "edit") {
+      // 表单信息对比
+      const oldData = oldDataRef.current.entity;
+
+      // 有变化的数据---更新前
+      const before = {} as any;
+      // 有变化的数据---更新后
+      const after = {} as any;
+
+      for (const k in obj) {
+        if (oldData[k] !== obj[k] && goodsChangeObj[k] && k !== "fileIds") {
+          before[k] = oldData[k];
+          after[k] = obj[k];
+        } else if (k === "fileIds") {
+          // 单独处理附件信息
+          before["fileIds"] = oldDataRef.current.file
+            .map((v: any) => v.id)
+            .join(",");
+          after["fileIds"] = newDataFile.map((v: any) => v.id).join(",");
+
+          before["fileIdsName"] = oldDataRef.current.file
+            .map((v: any) => v.name)
+            .join(",");
+          after["fileIdsName"] = newDataFile.map((v: any) => v.name).join(",");
+
+          if (
+            before["fileIds"] === after["fileIds"] ||
+            before["fileIdsName"] === after["fileIdsName"]
+          ) {
+            delete before["fileIds"];
+            delete after["fileIds"];
+            delete before["fileIdsName"];
+            delete after["fileIdsName"];
+          }
+        }
+      }
+      if (JSON.stringify(before) === "{}")
+        return message.warning("没有改变藏品的信息!");
 
-    // console.log('------封面信息',cover);
+      const editData = {
+        afterJson: after,
+        beforeJson: before,
+        goodsIds: Number(id),
+      };
 
-    // console.log('-------附件信息',results);
+      const res: any = await editObj2GoodsAPI(editData);
+      if (res.code === 0) {
+        message.success("编辑成功!");
+        // 通知父组件更新页面
+        upInfoAPIFu();
+        // 真正的删除
+        if (delFileList.current.length) {
+          await delInfileAPI(delFileList.current.join(","));
+        }
+        //  关闭弹窗
+        colsePage();
+      }
+
+      console.log("旧数据", before);
+      console.log("新数据", after);
+    } else {
+      // ------------藏品新增和编辑
+      await dispatch(goodsSonAddAPI(obj, id));
+
+      // 真正的删除
+      if (delFileList.current.length) {
+        await delInfileAPI(delFileList.current.join(","));
+      }
+      //  关闭弹窗
+      colsePage();
+    }
   };
 
   // 选择商品信息还是附近(默认商品信息)
@@ -135,11 +203,18 @@ function ObjectAdd({ id, colsePage, editId, dirCode }: Props) {
   // 单位选择
   const [danweiValue, setDanweiValue] = useState("kg");
 
+  // 把旧的数据保存起来--用于藏品修改的对比
+  const oldDataRef = useRef<any>({});
+
   // 设置表单初始数据(区分编辑和新增)
   const FormBoxRef = useRef<any>({});
   const getInfoInAPIFu = useCallback(
     async (id: number) => {
       const res = await getInfoInAPI(id);
+
+      // 把旧的数据存起来
+      oldDataRef.current = res.data;
+
       const data = res.data.entity;
       const size = data.size.split(",");
       const quality = data.quality.split(",");

+ 16 - 3
src/pages/Object/index.tsx

@@ -1,10 +1,11 @@
 import styles from "./index.module.scss";
 import LeftBar from "@/components/LeftBar";
-import React, { useMemo } from "react";
+import React, { useEffect, useMemo } 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";
 
 const LookObject1 = React.lazy(
   () => import("../ObjectSon/Object1/LookObject1")
@@ -69,9 +70,22 @@ export default function Object() {
         Com: React.lazy(() => import("../ObjectSon/Object1/AuditObject1")),
         path: "/object/1/audit",
       },
+      {
+        id: 3001,
+        name: "入库管理新增",
+        Com: React.lazy(() => import("../ObjectSon/Object3/AddObject3")),
+        path: "/object/3/add",
+      },
     ];
   }, []);
 
+  // 没有藏品登记页面的权限 跳到有权限的页面
+  useEffect(() => {
+    if (data[0].id !== 1) {
+      history.replace(data[0].path);
+    }
+  }, [data]);
+
   return (
     <div className={styles.Object}>
       <div className="leftBar">
@@ -83,14 +97,13 @@ export default function Object() {
           <Switch>
             {data.map((v, i) => (
               <AuthRoute
-              exact
+                exact
                 // exact={i === 0 ? true : false}
                 key={v.id}
                 path={v.path}
                 component={v.Com}
               />
             ))}
-
             {/* 查看页面,无需权限 */}
             <AuthRoute path="/object/1/look" component={LookObject1} />
             <AuthRoute path="/object/2/look" component={LookObject2} />

+ 2 - 0
src/pages/ObjectSon/Object1/AddObject1/index.tsx

@@ -88,6 +88,7 @@ function AddObject1() {
     console.log("多个删除", tableSelectList);
     const data = _.differenceBy(results, tableSelectList, "id");
     dispatch({ type: "login/setGoodsSonList", payload: data });
+    setTableSelectList(data)
 
     // 删除的id存起来
     tableSelectList.forEach((v: any) => {
@@ -283,6 +284,7 @@ function AddObject1() {
               <Button onClick={() => addPageFu(null)}>添加</Button>
               &emsp;
               <Popconfirm
+                disabled={tableSelectList.length === 0}
                 title="确定删除吗?"
                 okText="确定"
                 cancelText="取消"

+ 1 - 1
src/pages/ObjectSon/Object1/AuditObject1/index.tsx

@@ -5,8 +5,8 @@ import {
   auditObject1API,
   getObj1InfoTableAPI2,
   object1infoOutAPI,
-  statusObj,
 } from "@/store/action/object1";
+import { statusObj } from "@/utils/dataChange";
 import history, { urlParameter } from "@/utils/history";
 import { Button, message, Select } from "antd";
 import TextArea from "antd/es/input/TextArea";

+ 1 - 1
src/pages/ObjectSon/Object1/LookObject1/index.tsx

@@ -9,10 +9,10 @@ import styles from "./index.module.scss";
 import {
   getObj1InfoTableAPI2,
   object1infoOutAPI,
-  statusObj,
 } from "@/store/action/object1";
 import { useDispatch, useSelector } from "react-redux";
 import { RootState } from "@/store";
+import { statusObj } from "@/utils/dataChange";
 function LookObject1() {
   const dispatch = useDispatch();
 

+ 38 - 19
src/pages/ObjectSon/Object2/LookObject2/index.tsx

@@ -17,10 +17,10 @@ import { useLocation } from "react-router-dom";
 import styles from "./index.module.scss";
 import "./index.css";
 import LookObject2Log from "./table";
-import { storageStatusObj } from "@/store/action/object1";
 import { baseURL } from "@/utils/http";
 import classNames from "classnames";
 import { getObj2InfoInAPI } from "@/store/action/object2";
+import { storageStatusObj } from "@/utils/dataChange";
 function LookObject2() {
   const dispatch = useDispatch();
   // 获取地址栏参数
@@ -53,10 +53,31 @@ function LookObject2() {
     });
   }, [dispatch]);
 
-  useEffect(() => {
+  // 申请编辑和申请移库之后需要重新发送请求来更新按钮状态
+  const upInfoAPIFu = useCallback(() => {
     getObj2InfoInAPIFu();
   }, [getObj2InfoInAPIFu]);
 
+  useEffect(() => {
+    getObj2InfoInAPIFu();
+    return () => {
+      // 退出页面的时候初始化仓库数据
+      dispatch({
+        type: "object2/getOneGoodsInfo",
+        payload: {
+          info: {},
+          fileList: {
+            img: [],
+            video: [],
+            audio: [],
+            model: [],
+            doc: [],
+          },
+        },
+      });
+    };
+  }, [dispatch, getObj2InfoInAPIFu]);
+
   // 点击返回
   const cancelFu = () => {
     history.push({
@@ -222,22 +243,20 @@ function LookObject2() {
                 </div>
               </div>
               <div>
-                {info.tempEdit === 0 ? (
-                  <>
-                    <AuthButton
-                      size="small"
-                      type="primary"
-                      onClick={() => titCutFu("1")}
-                    >
-                      申请编辑
-                    </AuthButton>
-                    &emsp;
-                  </>
-                ) : null}
-                {/* {info.tempMove === 0 && info.storageStatus !== "0" ? ( */}
-                {info.tempMove === 0 ? (
+                <AuthButton
+                  disabled={info.tempEdit !== 0}
+                  size="small"
+                  type="primary"
+                  onClick={() => titCutFu("1")}
+                >
+                  申请编辑
+                </AuthButton>
+                &emsp;
+                {/* {info.storageStatus !== "0" ?  ( */}
+                {info.storageStatus === "0" ? (
                   <>
                     <AuthButton
+                      disabled={info.tempMove !== 0}
                       size="small"
                       type="primary"
                       onClick={() => titCutFu("2")}
@@ -247,7 +266,6 @@ function LookObject2() {
                     &emsp;
                   </>
                 ) : null}
-
                 <AuthButton size="small" onClick={() => titCutFu("3")}>
                   操作记录
                 </AuthButton>
@@ -261,7 +279,7 @@ function LookObject2() {
                 </div>
                 <div title={info.namePrimitive}>
                   <span>原名:</span>
-                  <p>{info.namePrimitive?info.namePrimitive:'-'}</p>
+                  <p>{info.namePrimitive ? info.namePrimitive : "-"}</p>
                 </div>
               </div>
               <div className="row">
@@ -430,7 +448,8 @@ function LookObject2() {
         {/*  申请编辑 */}
         {titCut === "1" ? (
           <ObjectAdd
-            dirCode={999999}
+            upInfoAPIFu={upInfoAPIFu}
+            dirCode={info.dirCode}
             id={urlParamRef.current.id}
             colsePage={() => setTitCut("")}
             editId="edit"

+ 7 - 4
src/pages/ObjectSon/Object2/index.module.scss

@@ -47,13 +47,13 @@
 
       .imgListRow {
         cursor: pointer;
-
-        width: 195px;
-        height: 230px;
+        transition: all .3s;
+        width: 238px;
+        height: 240px;
         border: 1px solid #ccc;
         margin: 0 20px 20px 0;
 
-        &:nth-of-type(6n) {
+        &:nth-of-type(5n) {
           margin: 0 0 20px 0;
         }
 
@@ -68,6 +68,9 @@
           text-overflow: ellipsis;
           white-space: nowrap;
         }
+        &:hover{
+          box-shadow: 1px 1px 5px 1px #ccc;
+        }
       }
     }
 

+ 2 - 2
src/pages/ObjectSon/Object2/index.tsx

@@ -367,8 +367,8 @@ export default function Object2() {
               >
                 <ImageLazy
                   noLook={true}
-                  width={193}
-                  height={190}
+                  width={236}
+                  height={200}
                   src={v.thumb}
                 />
                 <p>{v.name}</p>

+ 15 - 0
src/pages/ObjectSon/Object3/AddObject3/GoodsAll.css

@@ -0,0 +1,15 @@
+.GoodsAllModel .ant-modal {
+  width: 1000px !important;
+}
+.GoodsAllModel .ObjectAddTit {
+  border-top: 1px solid #999999;
+  padding-top: 15px;
+  margin-bottom: 15px;
+}
+.GoodsAllModel .ObjectAddTit .topSearch {
+  display: flex;
+  align-items: center;
+}
+.GoodsAllModel .moveBtn {
+  text-align: center;
+}

+ 18 - 0
src/pages/ObjectSon/Object3/AddObject3/GoodsAll.less

@@ -0,0 +1,18 @@
+.GoodsAllModel {
+  .ant-modal {
+    width: 1000px !important;
+  }
+
+  .ObjectAddTit {
+    border-top: 1px solid #999999;
+    padding-top: 15px;
+    margin-bottom: 15px;
+    .topSearch{
+      display: flex;
+      align-items: center;
+    }
+  }
+  .moveBtn{
+    text-align: center;
+  }
+}

+ 158 - 0
src/pages/ObjectSon/Object3/AddObject3/GoodsAll.tsx

@@ -0,0 +1,158 @@
+import { Button, Input, message, Modal, Table } from "antd";
+import React, {
+  useCallback,
+  useEffect,
+  useMemo,
+  useRef,
+  useState,
+} from "react";
+import styles from "./index.module.scss";
+import "./GoodsAll.css";
+import { getGoodsListAllAPI } from "@/store/action/object3";
+import { useDispatch, useSelector } from "react-redux";
+import { RootState } from "@/store";
+import ImageLazy from "@/components/ImageLazy";
+
+type Props = {
+  colsePage: any;
+};
+function GoodsAll({ colsePage }: Props) {
+  const dispatch = useDispatch();
+
+  // 进页面获取列表
+  useEffect(() => {
+    dispatch(getGoodsListAllAPI(""));
+  }, [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(getGoodsListAllAPI(e.target.value));
+      }, 500);
+    },
+    [dispatch]
+  );
+
+  // 有关表格
+  const results = useSelector(
+    (state: RootState) => state.object3Store.goodsAllList
+  );
+
+  // 已经选中的表格数据
+  const resultsAc = useSelector(
+    (state: RootState) => state.object3Store.goodsTableList
+  );
+
+  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: "object3/getGoodsTableList",
+      payload: tableSelectList,
+    });
+    message.success("添加成功!");
+    colsePage();
+  }, [colsePage, dispatch, tableSelectList]);
+
+  return (
+    <div className={styles.GoodsAll}>
+      <Modal
+        open={true}
+        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;

+ 87 - 0
src/pages/ObjectSon/Object3/AddObject3/index.module.scss

@@ -0,0 +1,87 @@
+.AddObject3 {
+  :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: 485px;
+
+        .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;
+        }
+      }
+    }
+  }
+}

+ 224 - 0
src/pages/ObjectSon/Object3/AddObject3/index.tsx

@@ -0,0 +1,224 @@
+import BreadTit from "@/components/BreadTit";
+import { object3AddAPI, object3infoOutAPI } from "@/store/action/object3";
+import history, { urlParameter } from "@/utils/history";
+import { Button, Input, Popconfirm, Table } from "antd";
+import TextArea from "antd/es/input/TextArea";
+import React, { useCallback, useEffect, useMemo, 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";
+function AddObject3() {
+  const dispatch = useDispatch();
+  // 顶部数据
+  const [addInfoTop, setAddInfoTop] = useState<any>({});
+
+  // 进入页面新增请求函数
+  const object3AddAPIFu = useCallback(async () => {
+    const res = await object3AddAPI();
+    setAddInfoTop(res.data);
+    // 初始化表格数据
+    dispatch({
+      type: "object3/getGoodsTableList",
+      payload: [],
+    });
+  }, [dispatch]);
+
+  // 通过id获取详情函数
+  const object3infoOutAPIFu = useCallback(async (id: number) => {
+    const res = await object3infoOutAPI(id);
+    // setAddInfoTop(res.data);
+    // // 获取表格详情信息
+    // dispatch(getObj1InfoTableAPI(id));
+  }, []);
+
+  // 获取地址栏参数
+  const location = useLocation();
+  const [urlParam, setUrlParam] = useState<any>({});
+  useEffect(() => {
+    const obj = urlParameter(location.search);
+    setUrlParam(obj);
+
+    if (obj.id) {
+      // 如果是编辑
+      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]);
+
+  // 点击提交
+  const submitFu = useCallback(() => {}, []);
+
+  // 点击添加或者编辑出来页面
+  const [addPage, setAddPage] = useState(false);
+
+  // 表格的多选
+  const rowSelection = {
+    onChange: (selectedRowKeys: any, selectedRows: any) => {
+      setTableSelectList(selectedRows);
+    },
+  };
+
+  // 点击添加
+  const addPageFu = useCallback((id?: any) => {
+    setAddPage(true);
+  }, []);
+
+  // 选中的表格数据
+  const [tableSelectList, setTableSelectList] = useState([]);
+
+  // 从仓库拿表格信息
+  const results = useSelector(
+    (state: RootState) => state.object3Store.goodsTableList
+  );
+
+  // 点击删除
+  const delTableListFu = useCallback(() => {
+    console.log("多个删除", tableSelectList);
+    const data = _.differenceBy(results, tableSelectList, "id");
+    dispatch({ type: "login/setGoodsSonList", payload: data });
+    setTableSelectList(data);
+  }, [dispatch, results, tableSelectList]);
+
+  // 表格数据
+  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: "藏品位置",
+        render: (item: any) => <>123</>,
+      },
+    ];
+  }, []);
+
+  return (
+    <div className={styles.AddObject3}>
+      <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="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: 355 }}
+              rowSelection={{
+                type: "checkbox",
+                ...rowSelection,
+              }}
+              dataSource={results}
+              columns={columns}
+              rowKey="id"
+              pagination={false}
+            />
+          </div>
+
+          {/* 返回按钮 */}
+          <div className="addTableBox_btn">
+            <Button type="primary" onClick={submitFu}>
+              提交
+            </Button>
+            &emsp;
+            <Button onClick={cancelFu}>返回</Button>
+          </div>
+        </div>
+      </div>
+      {/* 点击添加或者编辑出来的页面 */}
+      {addPage ? <GoodsAll colsePage={() => setAddPage(false)} /> : null}
+    </div>
+  );
+}
+
+const MemoAddObject3 = React.memo(AddObject3);
+
+export default MemoAddObject3;

+ 290 - 5
src/pages/ObjectSon/Object3/index.tsx

@@ -1,9 +1,294 @@
+import BreadTit from "@/components/BreadTit";
+import classNames from "classnames";
+import { useEffect, useMemo, useRef, useState } from "react";
 import styles from "./index.module.scss";
-export default function Object3() {
-  
+import { Input, DatePicker, Table, Button, Popconfirm, message } from "antd";
+import AuthButton from "@/components/AuthButton";
+import history from "@/utils/history";
+import { useLocation } from "react-router-dom";
+import { useDispatch, useSelector } from "react-redux";
+import { RootState } from "@/store";
+import {
+  getObject3List,
+  getObject3ListNum,
+  object3DelAPI,
+} from "@/store/action/object3";
+
+const { RangePicker } = DatePicker;
+
+export default function Object1() {
+  const dispatch = useDispatch();
+
+  // 获取顶部数量
+
+  useEffect(() => {
+    dispatch(getObject3ListNum());
+  }, [dispatch]);
+
+  // 顶部的状态改变了,统一管理,传到二级页码
+  const statusRef = useRef<null | number>(null);
+
+  const dataTit = useSelector(
+    (state: RootState) => state.object3Store.infoNum3
+  );
+
+  // 封装发送请求的函数
+  const getList = () => {
+    const data = { ...tableSelect, pageNum: pageNumRef.current };
+    dispatch(getObject3List(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,
+    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 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) => {
+    if (id)
+      history.push(
+        `/object/3/add?k=${pageNumRef.current}&d=${statusRef.current}&id=${id}`
+      );
+    else
+      history.push(
+        `/object/3/add?k=${pageNumRef.current}&d=${statusRef.current}`
+      );
+  };
+
+  // 点击删除按钮
+  const delOne = async (id: number) => {
+    const res: any = await object3DelAPI(id);
+    if (res.code === 0) {
+      message.success("删除成功!");
+      getList();
+      dispatch(getObject3ListNum());
+    }
+  };
+
+  // ---------关于表格
+
+  // 页码变化
+  const paginationChange = (pageNum: number, pageSize: number) => {
+    setTableSelect({ ...tableSelect, pageNum, pageSize });
+  };
+
+  const results = useSelector((state: RootState) => state.object3Store.info3);
+
+  const columns = useMemo(() => {
+    return [
+      {
+        title: "登记编号",
+        dataIndex: "num",
+      },
+      {
+        title: "藏品来源",
+        dataIndex: "sourceName",
+      },
+      {
+        title: "登记人员",
+        dataIndex: "creatorName",
+      },
+      {
+        title: "创建日期",
+        dataIndex: "createTime",
+      },
+      {
+        title: "完成日期",
+        render: (item: any) => (item.day ? item.day : "-"),
+      },
+      {
+        title: "状态",
+        dataIndex: "statusTxt",
+      },
+
+      {
+        title: "操作",
+        render: (item: any) => (
+          <>
+            <Button
+              type="text"
+              danger
+              onClick={() =>
+                history.push(
+                  `/object/1/look?k=${pageNumRef.current}&d=${statusRef.current}&id=${item.id}`
+                )
+              }
+            >
+              查看
+            </Button>
+
+            {item.status === 0 || item.status === 2 ? (
+              <AuthButton type="text" danger onClick={() => addObject(item.id)}>
+                编辑
+              </AuthButton>
+            ) : null}
+
+            {item.status === 1 ? (
+              <AuthButton
+                onClick={() =>
+                  history.push(
+                    `/object/1/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 type="text" danger>
+                  删除
+                </AuthButton>
+              </Popconfirm>
+            ) : null}
+          </>
+        ),
+      },
+    ];
+    // eslint-disable-next-line react-hooks/exhaustive-deps
+  }, []);
+
   return (
-    <div className={styles.Object3}>
-      <h1>Object3</h1>
+    <div className={styles.Object1}>
+      <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>
+              <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 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>
-  )
+  );
 }

+ 30 - 3
src/pages/Stores/index.tsx

@@ -1,9 +1,36 @@
+import LeftBar from "@/components/LeftBar";
+import React from "react";
+import { useMemo } from "react";
 import styles from "./index.module.scss";
 export default function Stores() {
-  
+  const data = useMemo(() => {
+    return [
+      {
+        id: 1,
+        name: "库房设置",
+        Com: React.lazy(() => import("../ObjectSon/Object1")),
+        path: "/stores",
+      },
+      {
+        id: 2,
+        name: "统计报表",
+        Com: React.lazy(() => import("../ObjectSon/Object2")),
+        path: "/stores/2",
+      },
+      {
+        id: 3,
+        name: "藏品移库",
+        Com: React.lazy(() => import("../ObjectSon/Object3")),
+        path: "/stores/3",
+      }
+    ];
+  }, []);
+
   return (
     <div className={styles.Stores}>
-      <h1>Stores</h1>
+      <div className="leftBar">
+        <LeftBar data={data} />
+      </div>
     </div>
-  )
+  );
 }

+ 5 - 0
src/pages/StoresSon/初始化组件 copy 2/index.module.scss

@@ -0,0 +1,5 @@
+.AAAAA{
+  :global{
+    
+  }
+}

+ 14 - 0
src/pages/StoresSon/初始化组件 copy 2/index.tsx

@@ -0,0 +1,14 @@
+import React from "react";
+import styles from "./index.module.scss";
+ function AAAAA() {
+  
+  return (
+    <div className={styles.AAAAA}>
+      <h1>AAAAA</h1>
+    </div>
+  )
+}
+
+const MemoAAAAA = React.memo(AAAAA);
+
+export default MemoAAAAA;

+ 5 - 0
src/pages/StoresSon/初始化组件 copy/index.module.scss

@@ -0,0 +1,5 @@
+.AAAAA{
+  :global{
+    
+  }
+}

+ 14 - 0
src/pages/StoresSon/初始化组件 copy/index.tsx

@@ -0,0 +1,14 @@
+import React from "react";
+import styles from "./index.module.scss";
+ function AAAAA() {
+  
+  return (
+    <div className={styles.AAAAA}>
+      <h1>AAAAA</h1>
+    </div>
+  )
+}
+
+const MemoAAAAA = React.memo(AAAAA);
+
+export default MemoAAAAA;

+ 5 - 0
src/pages/StoresSon/初始化组件/index.module.scss

@@ -0,0 +1,5 @@
+.AAAAA{
+  :global{
+    
+  }
+}

+ 14 - 0
src/pages/StoresSon/初始化组件/index.tsx

@@ -0,0 +1,14 @@
+import React from "react";
+import styles from "./index.module.scss";
+ function AAAAA() {
+  
+  return (
+    <div className={styles.AAAAA}>
+      <h1>AAAAA</h1>
+    </div>
+  )
+}
+
+const MemoAAAAA = React.memo(AAAAA);
+
+export default MemoAAAAA;

+ 1 - 14
src/store/action/object1.ts

@@ -1,3 +1,4 @@
+import { statusObj } from "@/utils/dataChange";
 import http from "@/utils/http";
 import { message } from "antd";
 import store, { AppDispatch } from "..";
@@ -39,20 +40,6 @@ export const goodsSonAddAPI = (data: any, id: any) => {
   };
 };
 
-// 状态的筛选
-export const statusObj = {
-  0: "待办理", //草稿中
-  1: "待审核", //待审核
-  2: "审核不通过", //审核不通过
-  3: "已完成", //审核通过
-} as any;
-
-// 入库出库的状态筛选
-export const storageStatusObj = {
-  "0": "未入库",
-  in: "已入库 ",
-  out: "已出库",
-} as any;
 
 /**
  * 获取藏品登记列表信息

+ 9 - 4
src/store/action/object2.ts

@@ -1,7 +1,6 @@
+import { storageStatusObj } from "@/utils/dataChange";
 import http from "@/utils/http";
-import { message } from "antd";
-import store, { AppDispatch } from "..";
-import { storageStatusObj } from "./object1";
+import { AppDispatch } from "..";
 
 /**
  * 获取藏品登记列表信息
@@ -22,10 +21,16 @@ export const getObject2List = (data: any) => {
   };
 };
 
-
 /**
  * 通过id获取藏品总账详情
  */
 export const getObj2InfoInAPI = (id: number) => {
   return http.get(`cms/ledger/detail/${id}`);
 };
+
+/**
+ * 藏品总账里面修改藏品
+ */
+export const editObj2GoodsAPI = (data: any) => {
+  return http.post("cms/edit/save", data);
+};

+ 73 - 0
src/store/action/object3.ts

@@ -0,0 +1,73 @@
+import { statusObj } from "@/utils/dataChange";
+import http from "@/utils/http";
+import { AppDispatch } from "..";
+
+/**
+ * 获取藏品登记列表信息
+ */
+export const getObject3List = (data: any) => {
+  return async (dispatch: AppDispatch) => {
+    // 获取列表数据
+    const res: any = await http.post("cms/in/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: "object3/getList", payload: obj });
+  };
+};
+
+/**
+ * 获取藏品登记列表顶部数字信息
+ */
+export const getObject3ListNum = () => {
+  return async (dispatch: AppDispatch) => {
+    // 获取统计数据
+    const res: any = await http.get("cms/in/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: "object3/getListNum", payload: data });
+  };
+};
+
+/**
+ * 删除外层表格数据
+ */
+export const object3DelAPI = (id: number) => {
+  return http.get(`cms/in/remove/${id}`);
+};
+
+/**
+ * 通过id获取信息
+ */
+export const object3infoOutAPI = (id: number) => {
+  return http.get(`cms/in/detail/${id}`);
+};
+
+/**
+ * 进新增页面发送请求
+ */
+export const object3AddAPI = (data?: any) => {
+  return http.post("cms/in/save", { ...data });
+};
+
+/**
+ * 点击新增或者编辑里面的添加按钮的所有藏品列表
+ */
+export const getGoodsListAllAPI = (val: any) => {
+  return async (dispatch: AppDispatch) => {
+    // 获取统计数据
+    const res: any = await http.get(`cms/in/goods/list?searchKey=${val}`);
+    dispatch({ type: "object3/setGoodsListAll", payload: res.data });
+  };
+};

+ 2 - 0
src/store/reducer/index.ts

@@ -2,12 +2,14 @@ import { combineReducers } from "redux";
 import loginReducer from "./login";
 import object1Reducer from "./object1";
 import object2Reducer from "./object2";
+import object3Reducer from "./object3";
 
 // 合并 reducer
 const rootReducer = combineReducers({
   loginStore: loginReducer,
   object1Store: object1Reducer,
   object2Store: object2Reducer,
+  object3Store: object3Reducer,
 });
 
 export default rootReducer;

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

@@ -0,0 +1,52 @@
+// 初始化状态应用注解
+const initState = {
+  // 表格数据
+  info3: {
+    list: [] as any,
+    total: 0,
+  },
+  // 表格顶部数字数据
+  infoNum3: [],
+  // 查看和审核的表格信息
+  lookInfo: {
+    info: {} as any,
+    list: [] as any,
+  },
+  // 新增或者编辑的藏品信息列表
+  goodsTableList: [] as any,
+  // 点击新增或者编辑里面的添加按钮的所有藏品列表
+  goodsAllList: [] as any,
+};
+
+type LoginActionType =
+  | { type: "object3/getList"; payload: any }
+  | { type: "object3/getListNum"; payload: any }
+  | { type: "object3/getLookInfo"; payload: any }
+  | { type: "object3/getGoodsTableList"; payload: any }
+  | { type: "object3/setGoodsListAll"; payload: any };
+// 频道 reducer
+export default function object3Reducer(
+  state = initState,
+  action: LoginActionType
+) {
+  switch (action.type) {
+    // 表格数据1
+    case "object3/getList":
+      return { ...state, info3: action.payload };
+    // 表格顶部数字数据1
+    case "object3/getListNum":
+      return { ...state, infoNum3: action.payload };
+    // 查看和审核的表格数据
+    case "object3/getLookInfo":
+      return { ...state, lookInfo: action.payload };
+    // 新增或者编辑的藏品信息列表
+    case "object3/getGoodsTableList":
+      return { ...state, goodsTableList: action.payload };
+    // 点击新增或者编辑里面的添加按钮的所有藏品列表
+    case "object3/setGoodsListAll":
+      return { ...state, goodsAllList: action.payload };
+
+    default:
+      return state;
+  }
+}

+ 41 - 0
src/utils/dataChange.ts

@@ -0,0 +1,41 @@
+// 藏品信息键值对的映射
+export const goodsChangeObj = {
+  name: "藏品名称",
+  namePrimitive: "原名",
+  dictNum: "藏品编号名称",
+  num: "藏品编号",
+  dictAge: "年代",
+  dictTexture: "文物质地",
+  ageSpecific: "具体年代",
+  dictGoodType: "文物类别",
+  pcs: "实际数量",
+  dictLevel: "文物级别",
+  size: "外形尺寸",
+  sizeSpecific: "具体尺寸",
+  dictQualityScope: "质量范围",
+  quality: "具体质量",
+  complete: "完残程度",
+  repair: "保存状态",
+  dictCheckInScope: "入藏时间范围",
+  checkInYear: "入藏年度",
+  author: "著者",
+  vision: "版本",
+  onFile: "存卷",
+  description: "来源说明",
+  thumb: "藏品图片",
+  fileIds: "附件信息",
+} as any;
+// 状态的筛选
+export const statusObj = {
+  0: "待办理", //草稿中
+  1: "待审核", //待审核
+  2: "审核不通过", //审核不通过
+  3: "已完成", //审核通过
+} as any;
+
+// 入库出库的状态筛选
+export const storageStatusObj = {
+  "0": "未入库",
+  in: "已入库 ",
+  out: "已出库",
+} as any;