shaogen1995 2 anni fa
parent
commit
f5981cf801

+ 1 - 0
src/components/AsyncSpinLoding/index.module.scss

@@ -9,6 +9,7 @@
   width: 100%;
   width: 100%;
   height: 100%;
   height: 100%;
   background-color: rgba(0, 0, 0, .6);
   background-color: rgba(0, 0, 0, .6);
+  // background-color: transparent;
   :global{
   :global{
     .ant-spin-spinning{
     .ant-spin-spinning{
       position: absolute;
       position: absolute;

+ 1 - 0
src/components/LookObjTable/LookModal.tsx

@@ -5,6 +5,7 @@ import { useDispatch, useSelector } from "react-redux";
 import { RootState } from "@/store";
 import { RootState } from "@/store";
 import ImageLazy from "../ImageLazy";
 import ImageLazy from "../ImageLazy";
 import { getInfoInAPI } from "@/store/action/object1";
 import { getInfoInAPI } from "@/store/action/object1";
+import './index.css'
 
 
 type Props = {
 type Props = {
   show: boolean;
   show: boolean;

+ 0 - 1
src/components/LookObjTable/index.tsx

@@ -1,7 +1,6 @@
 import { Button, Table } from "antd";
 import { Button, Table } from "antd";
 import React, { useCallback, useMemo, useRef, useState } from "react";
 import React, { useCallback, useMemo, useRef, useState } from "react";
 import ImageLazy from "../ImageLazy";
 import ImageLazy from "../ImageLazy";
-import "./index.css";
 import LookModal from "./LookModal";
 import LookModal from "./LookModal";
 
 
 type Props = {
 type Props = {

+ 10 - 0
src/pages/Object/index.tsx

@@ -13,6 +13,9 @@ const LookObject1 = React.lazy(
 const LookObject2 = React.lazy(
 const LookObject2 = React.lazy(
   () => import("../ObjectSon/Object2/LookObject2")
   () => import("../ObjectSon/Object2/LookObject2")
 );
 );
+const LookObject3 = React.lazy(
+  () => import("../ObjectSon/Object3/LookObject3")
+);
 
 
 export default function Object() {
 export default function Object() {
   const data = useMemo(() => {
   const data = useMemo(() => {
@@ -76,6 +79,12 @@ export default function Object() {
         Com: React.lazy(() => import("../ObjectSon/Object3/AddObject3")),
         Com: React.lazy(() => import("../ObjectSon/Object3/AddObject3")),
         path: "/object/3/add",
         path: "/object/3/add",
       },
       },
+      {
+        id: 3002,
+        name: "入库管理审核",
+        Com: React.lazy(() => import("../ObjectSon/Object3/AuditObject3")),
+        path: "/object/3/audit",
+      },
     ];
     ];
   }, []);
   }, []);
 
 
@@ -107,6 +116,7 @@ export default function Object() {
             {/* 查看页面,无需权限 */}
             {/* 查看页面,无需权限 */}
             <AuthRoute path="/object/1/look" component={LookObject1} />
             <AuthRoute path="/object/1/look" component={LookObject1} />
             <AuthRoute path="/object/2/look" component={LookObject2} />
             <AuthRoute path="/object/2/look" component={LookObject2} />
+            <AuthRoute path="/object/3/look" component={LookObject3} />
 
 
             {/* 新增 */}
             {/* 新增 */}
             {dataIn.map((v) => (
             {dataIn.map((v) => (

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

@@ -88,7 +88,7 @@ function AuditObject1() {
         </BreadTit>
         </BreadTit>
       </div>
       </div>
       <div className="objectSonMain">
       <div className="objectSonMain">
-        <div className="topTit">登记信息</div>
+        <div className="topTit">入库信息</div>
         <div className="topInfo">
         <div className="topInfo">
           <div className="topInfoRow">
           <div className="topInfoRow">
             <div>
             <div>
@@ -104,7 +104,7 @@ function AuditObject1() {
               <div>{info.sourceName}</div>
               <div>{info.sourceName}</div>
             </div>
             </div>
           </div>
           </div>
-          <div className="topInfoTex" title="87979">
+          <div className="topInfoTex" title={info.description}>
             <span>登记说明:</span>
             <span>登记说明:</span>
             {info.description ? info.description : "-"}
             {info.description ? info.description : "-"}
           </div>
           </div>

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

@@ -86,11 +86,11 @@ function LookObject1() {
               <div>{info.statusTxt}</div>
               <div>{info.statusTxt}</div>
             </div>
             </div>
           </div>
           </div>
-          <div className="topInfoTex" title="666">
+          <div className="topInfoTex" title={info.description}>
             <span>登记说明:</span>
             <span>登记说明:</span>
             {info.description ? info.description : "-"}
             {info.description ? info.description : "-"}
           </div>
           </div>
-          <div className="topInfoTex" title="666">
+          <div className="topInfoTex" title={info.reason}>
             <span>审核说明:</span>
             <span>审核说明:</span>
             {info.reason ? info.reason : "-"}
             {info.reason ? info.reason : "-"}
           </div>
           </div>

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

@@ -174,7 +174,7 @@ export default function Object1() {
       },
       },
       {
       {
         title: "完成日期",
         title: "完成日期",
-        render: (item: any) => (item.day ? item.day : "-"),
+        render: (item: any) => (item.day&&item.status===3 ? item.day : "-"),
       },
       },
       {
       {
         title: "状态",
         title: "状态",

+ 25 - 11
src/pages/ObjectSon/Object2/LookObject2/index.module.scss

@@ -20,20 +20,23 @@
           padding-top: 10px;
           padding-top: 10px;
           width: calc(100% - 320px);
           width: calc(100% - 320px);
 
 
-          .topInfoBoxRTit{
+          .topInfoBoxRTit {
             margin-bottom: 10px;
             margin-bottom: 10px;
             display: flex;
             display: flex;
             justify-content: space-between;
             justify-content: space-between;
             align-items: center;
             align-items: center;
             padding: 0 10px 8px;
             padding: 0 10px 8px;
             border-bottom: 1px solid #ccc;
             border-bottom: 1px solid #ccc;
-            &>div{
+
+            &>div {
               display: flex;
               display: flex;
               align-items: center;
               align-items: center;
-              &>h1{
+
+              &>h1 {
                 font-size: 20px;
                 font-size: 20px;
               }
               }
-              .bs{
+
+              .bs {
                 margin-left: 10px;
                 margin-left: 10px;
                 color: #fff;
                 color: #fff;
                 height: 20px;
                 height: 20px;
@@ -43,17 +46,24 @@
                 border-radius: 3px;
                 border-radius: 3px;
                 font-size: 12px;
                 font-size: 12px;
               }
               }
-              .bs1{
+
+              .bs1 {
                 border: 1px solid #ccc;
                 border: 1px solid #ccc;
                 color: black;
                 color: black;
                 // background-color: var(--themeColor);
                 // background-color: var(--themeColor);
               }
               }
-              .bs2{
+
+              .bs2 {
                 background-color: var(--themeColor);
                 background-color: var(--themeColor);
               }
               }
-              .bs3{
+
+              .bs3 {
                 background-color: green;
                 background-color: green;
               }
               }
+
+              .bs4 {
+                background-color: #999;
+              }
             }
             }
           }
           }
 
 
@@ -90,19 +100,23 @@
 
 
         }
         }
       }
       }
-      .tableInfoBox{
+
+      .tableInfoBox {
         width: 100%;
         width: 100%;
         height: 265px;
         height: 265px;
-        .tableInfoBoxTit{
+
+        .tableInfoBoxTit {
           margin-bottom: 5px;
           margin-bottom: 5px;
           display: flex;
           display: flex;
           align-items: center;
           align-items: center;
-          .rowTit{
+
+          .rowTit {
             font-weight: 700;
             font-weight: 700;
           }
           }
         }
         }
       }
       }
-      .backBtn{
+
+      .backBtn {
         height: 40px;
         height: 40px;
         display: flex;
         display: flex;
         justify-content: center;
         justify-content: center;

+ 59 - 47
src/pages/ObjectSon/Object2/LookObject2/index.tsx

@@ -4,7 +4,7 @@ import ImageLazy from "@/components/ImageLazy";
 import ObjectAdd from "@/components/ObjectAdd";
 import ObjectAdd from "@/components/ObjectAdd";
 import { RootState } from "@/store";
 import { RootState } from "@/store";
 import history, { urlParameter } from "@/utils/history";
 import history, { urlParameter } from "@/utils/history";
-import { Button, Cascader, Modal, Select, Table } from "antd";
+import { Button, Cascader, message, Modal, Select, Table } from "antd";
 import React, {
 import React, {
   useCallback,
   useCallback,
   useEffect,
   useEffect,
@@ -19,8 +19,9 @@ import "./index.css";
 import LookObject2Log from "./table";
 import LookObject2Log from "./table";
 import { baseURL } from "@/utils/http";
 import { baseURL } from "@/utils/http";
 import classNames from "classnames";
 import classNames from "classnames";
-import { getObj2InfoInAPI } from "@/store/action/object2";
+import { editObj2StoresAPI, getObj2InfoInAPI } from "@/store/action/object2";
 import { storageStatusObj } from "@/utils/dataChange";
 import { storageStatusObj } from "@/utils/dataChange";
+import { getStores1ListAPI } from "@/store/action/stores1";
 function LookObject2() {
 function LookObject2() {
   const dispatch = useDispatch();
   const dispatch = useDispatch();
   // 获取地址栏参数
   // 获取地址栏参数
@@ -167,48 +168,46 @@ function LookObject2() {
   // 关于  申请编辑  申请移库  操作记录
   // 关于  申请编辑  申请移库  操作记录
   const [titCut, setTitCut] = useState("");
   const [titCut, setTitCut] = useState("");
 
 
-  const titCutFu = useCallback((val: string) => {
-    setTitCut(val);
-  }, []);
-
-  // 移库
-  const moveOptions = [
-    {
-      name: "库房1",
-      label: "库房1",
-      children: [
-        {
-          name: "房子1",
-          label: "房子1",
-          children: [{ name: "格子1", label: "格子1" }],
-        },
-        {
-          name: "房子0",
-          label: "房子0",
-          children: [{ name: "格子0", label: "格子0" }],
-        },
-      ],
+  const titCutFu = useCallback(
+    (val: string) => {
+      if (val === "2") {
+        dispatch(getStores1ListAPI());
+      }
+      setTitCut(val);
     },
     },
-    {
-      name: "库房2",
-      label: "库房2",
-      children: [
-        {
-          name: "房子2",
-          label: "房子2",
-          children: [{ name: "格子2", label: "格子2" }],
-        },
-      ],
-    },
-  ];
-  const [moveLoc, setMoveLoc] = useState(["库房1", "格子1", "房子1"]);
+    [dispatch]
+  );
+
+  // 从仓库中获取库房总信息
+  const moveOptions = useSelector(
+    (state: RootState) => state.stores1Store.infoList
+  );
+
+  const [moveLoc, setMoveLoc] = useState<any>([]);
   const moveLocChangeFu = (val: any) => {
   const moveLocChangeFu = (val: any) => {
     setMoveLoc(val);
     setMoveLoc(val);
   };
   };
 
 
-  const moveBtnOk = () => {
-    console.log("移库点击提交", moveLoc);
-  };
+  const moveBtnOk = useCallback(async () => {
+    const oldLoc = info.storageAncestor;
+    const newLoc = moveLoc.join(",");
+    if (!newLoc) return message.warning("请选择移库位置!");
+    if (oldLoc === newLoc) return message.warning("位置不能相同!");
+    const obj = {
+      after: oldLoc,
+      before: newLoc,
+      goodsIds: info.id,
+    };
+    const res: any = await editObj2StoresAPI(obj);
+    if (res.code === 0) {
+      message.success("申请移库成功!");
+      // 更新页面
+      getObj2InfoInAPIFu();
+      setTitCut("");
+    }
+
+    console.log("移库点击提交", oldLoc, newLoc);
+  }, [getObj2InfoInAPIFu, info.id, info.storageAncestor, moveLoc]);
 
 
   return (
   return (
     <div className={styles.LookObject2}>
     <div className={styles.LookObject2}>
@@ -236,7 +235,9 @@ function LookObject2() {
                       ? "bs1"
                       ? "bs1"
                       : info.storageStatus === "in"
                       : info.storageStatus === "in"
                       ? "bs2"
                       ? "bs2"
-                      : "bs3"
+                      : info.storageStatus === "otu"
+                      ? "bs3"
+                      : "bs4"
                   )}
                   )}
                 >
                 >
                   {storageStatusObj[info.storageStatus]}
                   {storageStatusObj[info.storageStatus]}
@@ -252,8 +253,7 @@ function LookObject2() {
                   申请编辑
                   申请编辑
                 </AuthButton>
                 </AuthButton>
                 &emsp;
                 &emsp;
-                {/* {info.storageStatus !== "0" ?  ( */}
-                {info.storageStatus === "0" ? (
+                {info.storageStatus !== "0" && info.storageStatus !== "temp" ? (
                   <>
                   <>
                     <AuthButton
                     <AuthButton
                       disabled={info.tempMove !== 0}
                       disabled={info.tempMove !== 0}
@@ -389,10 +389,22 @@ function LookObject2() {
               </div>
               </div>
 
 
               <div className="row">
               <div className="row">
-                <div title={info.storageAncestorName}>
+                <div
+                  title={
+                    info.storageStatus !== "0" &&
+                    info.storageStatus !== "temp" &&
+                    info.storageAncestorName
+                      ? info.storageAncestorName
+                      : ""
+                  }
+                >
                   <span>入库位置:</span>
                   <span>入库位置:</span>
                   <p>
                   <p>
-                    {info.storageAncestorName ? info.storageAncestorName : "-"}
+                    {info.storageStatus !== "0" &&
+                    info.storageStatus !== "temp" &&
+                    info.storageAncestorName
+                      ? info.storageAncestorName
+                      : "-"}
                   </p>
                   </p>
                 </div>
                 </div>
                 <div title={info.outLocation}>
                 <div title={info.outLocation}>
@@ -461,7 +473,7 @@ function LookObject2() {
           <div className="moveLocBox">
           <div className="moveLocBox">
             <div>
             <div>
               <span>当前位置:</span>
               <span>当前位置:</span>
-              <p>库房1/房子1/格子1</p>
+              <p>{info.storageAncestorName}</p>
             </div>
             </div>
             <div>
             <div>
               <span>移库位置:</span>
               <span>移库位置:</span>
@@ -472,7 +484,7 @@ function LookObject2() {
                 onChange={moveLocChangeFu}
                 onChange={moveLocChangeFu}
                 fieldNames={{
                 fieldNames={{
                   label: "name",
                   label: "name",
-                  value: "name",
+                  value: "id",
                   children: "children",
                   children: "children",
                 }}
                 }}
                 options={moveOptions}
                 options={moveOptions}
@@ -493,7 +505,7 @@ function LookObject2() {
         {titCut === "3" ? (
         {titCut === "3" ? (
           <div className="logBox">
           <div className="logBox">
             {/* 表格 */}
             {/* 表格 */}
-            <LookObject2Log />
+            <LookObject2Log id={info.id}/>
           </div>
           </div>
         ) : null}
         ) : null}
       </Modal>
       </Modal>

+ 55 - 30
src/pages/ObjectSon/Object2/LookObject2/table.tsx

@@ -1,36 +1,53 @@
-import { Button, Table } from "antd";
-import React, { useMemo, useRef, useState } from "react";
-function LookObject2Log() {
+import AuthButton from "@/components/AuthButton";
+import { RootState } from "@/store";
+import { getObj2LogListAPI } from "@/store/action/object2";
+import { logTypeObj, logTypeOpenObj } from "@/utils/dataChange";
+import { Table } from "antd";
+import React, {
+  useCallback,
+  useEffect,
+  useMemo,
+  useRef,
+  useState,
+} from "react";
+import { useDispatch, useSelector } from "react-redux";
+
+type Props = {
+  id: number;
+};
+function LookObject2Log({ id }: Props) {
+  const dispatch = useDispatch();
+
   const pageNumRef = useRef(1);
   const pageNumRef = useRef(1);
   const pagePageRef = useRef(10);
   const pagePageRef = useRef(10);
   const [tableSelect, setTableSelect] = useState({
   const [tableSelect, setTableSelect] = useState({
     pageNum: 1,
     pageNum: 1,
     pageSize: 10,
     pageSize: 10,
+    goodsId: id,
   });
   });
+
+  useEffect(() => {
+    dispatch(getObj2LogListAPI(tableSelect));
+  }, [dispatch, tableSelect]);
+
   const paginationChange = (pageNum: number, pageSize: number) => {
   const paginationChange = (pageNum: number, pageSize: number) => {
     pageNumRef.current = pageNum;
     pageNumRef.current = pageNum;
     pagePageRef.current = pageSize;
     pagePageRef.current = pageSize;
-    setTableSelect({ pageNum, pageSize });
-  };
-  const logResults = {
-    list: [
-      { id: 1, name: "123" },
-      { id: 2, name: "123" },
-      { id: 3, name: "123" },
-      { id: 4, name: "123" },
-      { id: 5, name: "123" },
-      { id: 6, name: "123" },
-      { id: 7, name: "123" },
-      { id: 8, name: "123" },
-      { id: 9, name: "123" },
-      { id: 10, name: "123" },
-      { id: 11, name: "123" },
-    ],
-    total: 11,
+    setTableSelect({ ...tableSelect, pageNum, pageSize });
   };
   };
 
 
+  // 从仓库中获取列表信息
+  const logResults = useSelector(
+    (state: RootState) => state.object2Store.logList
+  );
+
+  // 点击操作记录里面的查看,打开新的页面
+  const openURL = useCallback((url: string) => {
+    window.open(url);
+  }, []);
+
   const columns = useMemo(() => {
   const columns = useMemo(() => {
-    return [
+    const tempArr = [
       {
       {
         title: "序号",
         title: "序号",
         render: (text: any, record: any, index: any) =>
         render: (text: any, record: any, index: any) =>
@@ -38,27 +55,35 @@ function LookObject2Log() {
       },
       },
       {
       {
         title: "业务单号",
         title: "业务单号",
-        dataIndex: "name",
+        dataIndex: "num",
       },
       },
       {
       {
         title: "业务类型",
         title: "业务类型",
-        dataIndex: "name",
+        render: (item: any) => logTypeObj[item.type],
       },
       },
 
 
       {
       {
         title: "完成时间",
         title: "完成时间",
-        dataIndex: "name",
+        dataIndex: "day",
       },
       },
       {
       {
         title: "操作",
         title: "操作",
-        render: (item: any) => (
-          <Button type="text" danger>
-            查看
-          </Button>
-        ),
+        render: (item: any) => {
+          // 暂时不处理权限问题,后面在完善
+          return (
+            <AuthButton
+              type="text"
+              danger
+              onClick={() => openURL(logTypeOpenObj[item.type] + item.id)}
+            >
+              查看
+            </AuthButton>
+          );
+        },
       },
       },
     ];
     ];
-  }, []);
+    return tempArr;
+  }, [openURL]);
 
 
   return (
   return (
     <Table
     <Table

+ 7 - 1
src/pages/ObjectSon/Object3/AddObject3/GoodsAll.tsx

@@ -93,7 +93,13 @@ function GoodsAll({ colsePage }: Props) {
   const btnOkFu = useCallback(() => {
   const btnOkFu = useCallback(() => {
     dispatch({
     dispatch({
       type: "object3/getGoodsTableList",
       type: "object3/getGoodsTableList",
-      payload: tableSelectList,
+      payload: tableSelectList.map((v:any)=>{
+        return {
+          ...v,
+          storageAncestor:'',
+          storageAncestorName:''
+        }
+      }),
     });
     });
     message.success("添加成功!");
     message.success("添加成功!");
     colsePage();
     colsePage();

+ 99 - 16
src/pages/ObjectSon/Object3/AddObject3/index.tsx

@@ -1,7 +1,7 @@
 import BreadTit from "@/components/BreadTit";
 import BreadTit from "@/components/BreadTit";
 import { object3AddAPI, object3infoOutAPI } from "@/store/action/object3";
 import { object3AddAPI, object3infoOutAPI } from "@/store/action/object3";
 import history, { urlParameter } from "@/utils/history";
 import history, { urlParameter } from "@/utils/history";
-import { Button, Input, Popconfirm, Table } from "antd";
+import { Button, Cascader, Input, message, Popconfirm, Table } from "antd";
 import TextArea from "antd/es/input/TextArea";
 import TextArea from "antd/es/input/TextArea";
 import React, {
 import React, {
   useCallback,
   useCallback,
@@ -18,8 +18,39 @@ import { RootState } from "@/store";
 import ImageLazy from "@/components/ImageLazy";
 import ImageLazy from "@/components/ImageLazy";
 import GoodsAll from "./GoodsAll";
 import GoodsAll from "./GoodsAll";
 import LookModal from "@/components/LookObjTable/LookModal";
 import LookModal from "@/components/LookObjTable/LookModal";
+import { getStores1ListAPI } from "@/store/action/stores1";
 function AddObject3() {
 function AddObject3() {
   const dispatch = useDispatch();
   const dispatch = useDispatch();
+
+  // 进页面获取所有的库房信息
+  useEffect(() => {
+    dispatch(getStores1ListAPI());
+  }, [dispatch]);
+
+  // 从仓库中获取库房总信息
+  const storesAllList = useSelector(
+    (state: RootState) => state.stores1Store.infoList
+  );
+
+  // 从仓库拿表格信息
+  const results = useSelector(
+    (state: RootState) => state.object3Store.goodsTableList
+  );
+
+  // 针对表格信息扩展自己需要的 入库 级连 筛选信息
+  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("/"),
+      };
+    },
+    [storesLocArr]
+  );
+
   // 顶部数据
   // 顶部数据
   const [addInfoTop, setAddInfoTop] = useState<any>({});
   const [addInfoTop, setAddInfoTop] = useState<any>({});
 
 
@@ -35,12 +66,27 @@ function AddObject3() {
   }, [dispatch]);
   }, [dispatch]);
 
 
   // 通过id获取详情函数
   // 通过id获取详情函数
-  const object3infoOutAPIFu = useCallback(async (id: number) => {
-    const res = await object3infoOutAPI(id);
-    // setAddInfoTop(res.data);
-    // // 获取表格详情信息
-    // dispatch(getObj1InfoTableAPI(id));
-  }, []);
+  const object3infoOutAPIFu = useCallback(
+    async (id: number) => {
+      const res = await object3infoOutAPI(id);
+      setAddInfoTop(res.data.entity);
+      // 设置表格信息
+      dispatch({
+        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: v.storageAncestorName,
+          };
+        });
+      }
+    },
+    [dispatch]
+  );
 
 
   // 获取地址栏参数
   // 获取地址栏参数
   const location = useLocation();
   const location = useLocation();
@@ -63,7 +109,26 @@ function AddObject3() {
   }, [urlParam.d, urlParam.k]);
   }, [urlParam.d, urlParam.k]);
 
 
   // 点击提交
   // 点击提交
-  const submitFu = useCallback(() => {}, []);
+  const submitFu = useCallback(async () => {
+    if (results.length === 0)
+      return message.warning("至少需要添加一条藏品信息!");
+
+    const objLength = Object.keys(storesLocArr.current).length;
+    if (objLength < results.length) return message.warning("请选择藏品位置!");
+
+    const obj = {
+      description: addInfoTop.description,
+      id: addInfoTop.id,
+      goodsIds: results.map((v: any) => v.id).join(","),
+      location: storesLocArr.current,
+    };
+
+    const res: any = await object3AddAPI(obj);
+    if (res.code === 0) {
+      message.success("操作成功!");
+      cancelFu();
+    }
+  }, [addInfoTop.description, addInfoTop.id, cancelFu, results]);
 
 
   // 点击添加或者编辑出来页面
   // 点击添加或者编辑出来页面
   const [addPage, setAddPage] = useState(false);
   const [addPage, setAddPage] = useState(false);
@@ -83,17 +148,17 @@ function AddObject3() {
   // 选中的表格数据
   // 选中的表格数据
   const [tableSelectList, setTableSelectList] = useState([]);
   const [tableSelectList, setTableSelectList] = useState([]);
 
 
-  // 从仓库拿表格信息
-  const results = useSelector(
-    (state: RootState) => state.object3Store.goodsTableList
-  );
-
   // 点击删除
   // 点击删除
   const delTableListFu = useCallback(() => {
   const delTableListFu = useCallback(() => {
     console.log("多个删除", tableSelectList);
     console.log("多个删除", tableSelectList);
     const data = _.differenceBy(results, tableSelectList, "id");
     const data = _.differenceBy(results, tableSelectList, "id");
-    dispatch({ type: "login/setGoodsSonList", payload: data });
+    dispatch({ type: "object3/getGoodsTableList", payload: data });
     setTableSelectList(data);
     setTableSelectList(data);
+
+    // 同时删除藏品位置信息
+    tableSelectList.forEach((v: any) => {
+      delete storesLocArr.current[v.id];
+    });
   }, [dispatch, results, tableSelectList]);
   }, [dispatch, results, tableSelectList]);
 
 
   // 控制弹窗的显示隐藏
   // 控制弹窗的显示隐藏
@@ -137,7 +202,25 @@ function AddObject3() {
       },
       },
       {
       {
         title: "藏品位置",
         title: "藏品位置",
-        render: (item: any) => <>123</>,
+        width: 200,
+        render: (item: any) => (
+          <>
+            <Cascader
+              defaultValue={item.storageAncestorName.split(",")}
+              allowClear={false}
+              fieldNames={{
+                label: "name",
+                value: "id",
+                children: "children",
+              }}
+              onChange={(value, selectedOptions) =>
+                onChangeStores(value, selectedOptions, item.id)
+              }
+              options={storesAllList}
+              placeholder="请选择"
+            />
+          </>
+        ),
       },
       },
       {
       {
         title: "操作",
         title: "操作",
@@ -150,7 +233,7 @@ function AddObject3() {
         ),
         ),
       },
       },
     ];
     ];
-  }, [lookGoods]);
+  }, [lookGoods, onChangeStores, storesAllList]);
 
 
   return (
   return (
     <div className={styles.AddObject3}>
     <div className={styles.AddObject3}>

+ 86 - 0
src/pages/ObjectSon/Object3/AuditObject3/index.module.scss

@@ -0,0 +1,86 @@
+.AuditObject3 {
+  :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;
+          }
+        }
+
+      }
+
+      .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;
+      }
+
+    }
+  }
+}

+ 233 - 0
src/pages/ObjectSon/Object3/AuditObject3/index.tsx

@@ -0,0 +1,233 @@
+import BreadTit from "@/components/BreadTit";
+import ImageLazy from "@/components/ImageLazy";
+import LookModal from "@/components/LookObjTable/LookModal";
+import { RootState } from "@/store";
+import { auditObject3API, object3infoOutAPI } from "@/store/action/object3";
+import { statusObj } from "@/utils/dataChange";
+import history, { urlParameter } from "@/utils/history";
+import { Button, message, Select, 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 { useLocation } from "react-router-dom";
+import styles from "./index.module.scss";
+const { Option } = Select;
+
+function AuditObject3() {
+  const dispatch = useDispatch();
+
+  // 获取地址栏参数
+  const location = useLocation();
+  const urlParamRef = useRef<any>({});
+  useEffect(() => {
+    urlParamRef.current = urlParameter(location.search);
+    // console.log("地址栏参数", urlParamRef.current);
+  }, [location]);
+
+  const { info, list: tableList } = useSelector(
+    (state: RootState) => state.object3Store.lookInfo
+  );
+
+  // 审核结果筛选
+  const [value, setValue] = useState(3);
+  const valueChangeFu = (val: number) => {
+    setValue(val);
+  };
+  // 审核说明
+  const [value2, setValue2] = useState("");
+
+  const getInfo = useCallback(async () => {
+    const id = urlParamRef.current.id;
+    const res1 = await object3infoOutAPI(id);
+    const info = res1.data.entity;
+    const list = res1.data.child;
+    info.statusTxt = statusObj[info.status];
+    dispatch({ type: "object3/getLookInfo", payload: { info, list } });
+  }, [dispatch]);
+
+  useEffect(() => {
+    getInfo();
+  }, [getInfo]);
+
+  // 控制弹窗的显示隐藏
+  const [show, setShow] = useState(false);
+  // 点击表格里面的查看
+  const lookIdRef = useRef(-1);
+
+  const lookGoods = useCallback((id: number) => {
+    lookIdRef.current = id;
+    setShow(true);
+  }, []);
+
+  // 点击返回
+  const cancelFu = useCallback(() => {
+    history.push({
+      pathname: `/object/3`,
+      state: {
+        k: urlParamRef.current.k ? urlParamRef.current.k : "1",
+        d: urlParamRef.current.d,
+      },
+    });
+  }, []);
+
+  // 点击确定
+  const btnOkFu = useCallback(async () => {
+    const txt = value2.replaceAll(" ", "").replaceAll("\n", "");
+    if (txt === "") return message.warning("审核说明不能为空!");
+    const res: any = await auditObject3API({
+      id: Number(urlParamRef.current.id),
+      reason: value2,
+      status: value,
+    });
+    if (res.code === 0) {
+      message.success("操作成功!");
+      cancelFu();
+    }
+  }, [cancelFu, value, value2]);
+
+  // 表格格式
+  const columns = useMemo(() => {
+    const tempArr = [
+      {
+        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: "storageAncestorName",
+      },
+      {
+        title: "操作",
+        render: (item: any) => (
+          <>
+            <Button type="text" danger onClick={() => lookGoods(item.id)}>
+              查看
+            </Button>
+          </>
+        ),
+      },
+    ];
+
+    return tempArr;
+  }, [lookGoods]);
+
+  return (
+    <div className={styles.AuditObject3}>
+      <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="topInfoTex" title={info.description}>
+            <span>入库说明:</span>
+            {info.description ? info.description : "-"}
+          </div>
+        </div>
+        <br />
+        <div className="topTit">藏品信息</div>
+        <div className="goodsInfo">
+          {/* 表格信息 */}
+          <Table
+            size="small"
+            scroll={{ y: 245 }}
+            dataSource={tableList}
+            columns={columns}
+            rowKey="id"
+            pagination={false}
+          />
+          <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>
+      {/* 点击查看出来的对话框 */}
+      {show ? (
+        <LookModal
+          id={lookIdRef.current}
+          show={show}
+          closeShow={() => setShow(false)}
+        />
+      ) : null}
+    </div>
+  );
+}
+
+const MemoAuditObject3 = React.memo(AuditObject3);
+
+export default MemoAuditObject3;

+ 56 - 0
src/pages/ObjectSon/Object3/LookObject3/index.module.scss

@@ -0,0 +1,56 @@
+.LookObject3 {
+  :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;
+          }
+        }
+
+      }
+      .backBtn{
+        margin-top: 12px;
+        display: flex;
+        justify-content: center;
+      }
+    }
+  }
+}

+ 200 - 0
src/pages/ObjectSon/Object3/LookObject3/index.tsx

@@ -0,0 +1,200 @@
+import AuthButton from "@/components/AuthButton";
+import BreadTit from "@/components/BreadTit";
+import ImageLazy from "@/components/ImageLazy";
+import LookModal from "@/components/LookObjTable/LookModal";
+import { RootState } from "@/store";
+import { object3infoOutAPI } from "@/store/action/object3";
+import { statusObj, storageStatusObj } from "@/utils/dataChange";
+import history, { urlParameter } from "@/utils/history";
+import { Button, Table } from "antd";
+import React, {
+  useCallback,
+  useEffect,
+  useMemo,
+  useRef,
+  useState,
+} from "react";
+import { useDispatch, useSelector } from "react-redux";
+import { useLocation } from "react-router-dom";
+import styles from "./index.module.scss";
+function LookObject3() {
+  const dispatch = useDispatch();
+
+  // 获取地址栏参数
+  const location = useLocation();
+  const urlParamRef = useRef<any>({});
+  useEffect(() => {
+    urlParamRef.current = urlParameter(location.search);
+    // console.log("地址栏参数", urlParamRef.current);
+  }, [location]);
+
+  const getInfo = useCallback(async () => {
+    const id = urlParamRef.current.id;
+    const res1 = await object3infoOutAPI(id);
+    const info = res1.data.entity;
+    const list = res1.data.child;
+    info.statusTxt = statusObj[info.status];
+    dispatch({ type: "object3/getLookInfo", payload: { info, list } });
+  }, [dispatch]);
+
+  useEffect(() => {
+    getInfo();
+  }, [getInfo]);
+
+  const { info, list: tableList } = useSelector(
+    (state: RootState) => state.object3Store.lookInfo
+  );
+
+  // 点击返回
+  const cancelFu = () => {
+    history.push({
+      pathname: `/object/3`,
+      state: {
+        k: urlParamRef.current.k ? urlParamRef.current.k : "1",
+        d: urlParamRef.current.d,
+      },
+    });
+  };
+
+  // 控制弹窗的显示隐藏
+  const [show, setShow] = useState(false);
+  // 点击表格里面的查看
+  const lookIdRef = useRef(-1);
+
+  const lookGoods = useCallback((id: number) => {
+    lookIdRef.current = id;
+    setShow(true);
+  }, []);
+
+  // 表格格式
+  const columns = useMemo(() => {
+    const tempArr = [
+      {
+        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: "storageAncestorName",
+      },
+      {
+        title: "入库状态",
+        render: (item: any) => storageStatusObj[item.storageStatus],
+      },
+      {
+        title: "操作",
+        render: (item: any) => (
+          <>
+            <Button type="text" danger onClick={() => lookGoods(item.id)}>
+              查看
+            </Button>
+          </>
+        ),
+      },
+    ];
+
+    return tempArr;
+  }, [lookGoods]);
+
+  return (
+    <div className={styles.LookObject3}>
+      <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.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">
+          {/* 表格信息 */}
+          <Table
+            size="small"
+            scroll={{ y: 360 }}
+            dataSource={tableList}
+            columns={columns}
+            rowKey="id"
+            pagination={false}
+          />
+        </div>
+        <div className="backBtn">
+          {info.status === 2 ? (
+            <AuthButton
+              type="primary"
+              onClick={() =>
+                history.push(
+                  `/object/1/add?k=${urlParamRef.current.k}&d=${urlParamRef.current.d}&id=${urlParamRef.current.id}`
+                )
+              }
+            >
+              编辑
+            </AuthButton>
+          ) : null}
+          &emsp;
+          <Button onClick={cancelFu}>返回</Button>
+        </div>
+      </div>
+      {/* 点击查看出来的对话框 */}
+      {show ? (
+        <LookModal
+          id={lookIdRef.current}
+          show={show}
+          closeShow={() => setShow(false)}
+        />
+      ) : null}
+    </div>
+  );
+}
+
+const MemoLookObject3 = React.memo(LookObject3);
+
+export default MemoLookObject3;

+ 8 - 8
src/pages/ObjectSon/Object3/index.tsx

@@ -142,24 +142,24 @@ export default function Object1() {
   const columns = useMemo(() => {
   const columns = useMemo(() => {
     return [
     return [
       {
       {
-        title: "登记编号",
+        title: "入库编号",
         dataIndex: "num",
         dataIndex: "num",
       },
       },
       {
       {
-        title: "藏品来源",
-        dataIndex: "sourceName",
-      },
-      {
         title: "登记人员",
         title: "登记人员",
         dataIndex: "creatorName",
         dataIndex: "creatorName",
       },
       },
       {
       {
+        title: "入库说明",
+        render: (item: any) => (item.description ? item.description : "-"),
+      },
+      {
         title: "创建日期",
         title: "创建日期",
         dataIndex: "createTime",
         dataIndex: "createTime",
       },
       },
       {
       {
         title: "完成日期",
         title: "完成日期",
-        render: (item: any) => (item.day ? item.day : "-"),
+        render: (item: any) => (item.day&&item.status===3 ? item.day : "-"),
       },
       },
       {
       {
         title: "状态",
         title: "状态",
@@ -175,7 +175,7 @@ export default function Object1() {
               danger
               danger
               onClick={() =>
               onClick={() =>
                 history.push(
                 history.push(
-                  `/object/1/look?k=${pageNumRef.current}&d=${statusRef.current}&id=${item.id}`
+                  `/object/3/look?k=${pageNumRef.current}&d=${statusRef.current}&id=${item.id}`
                 )
                 )
               }
               }
             >
             >
@@ -192,7 +192,7 @@ export default function Object1() {
               <AuthButton
               <AuthButton
                 onClick={() =>
                 onClick={() =>
                   history.push(
                   history.push(
-                    `/object/1/audit?k=${pageNumRef.current}&d=${statusRef.current}&id=${item.id}`
+                    `/object/3/audit?k=${pageNumRef.current}&d=${statusRef.current}&id=${item.id}`
                   )
                   )
                 }
                 }
                 type="text"
                 type="text"

+ 22 - 0
src/store/action/object2.ts

@@ -34,3 +34,25 @@ export const getObj2InfoInAPI = (id: number) => {
 export const editObj2GoodsAPI = (data: any) => {
 export const editObj2GoodsAPI = (data: any) => {
   return http.post("cms/edit/save", data);
   return http.post("cms/edit/save", data);
 };
 };
+
+/**
+ * 藏品总账里面的申请移库
+ */
+export const editObj2StoresAPI = (data: any) => {
+  return http.post("cms/move/save", data);
+};
+
+/**
+ * 藏品总账里面的操作记录
+ */
+export const getObj2LogListAPI = (data: any) => {
+  return async (dispatch: AppDispatch) => {
+    // 获取列表数据
+    const res: any = await http.post("cms/ledger/order/pageList", data);
+    const obj = {
+      list: res.data.records,
+      total: res.data.total,
+    };
+    dispatch({ type: "object2/getLogList", payload: obj });
+  };
+};

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

@@ -71,3 +71,11 @@ export const getGoodsListAllAPI = (val: any) => {
     dispatch({ type: "object3/setGoodsListAll", payload: res.data });
     dispatch({ type: "object3/setGoodsListAll", payload: res.data });
   };
   };
 };
 };
+
+/**
+ * 审核入库信息
+ */
+export const auditObject3API = (data: any) => {
+  return http.post("cms/in/audit", data);
+};
+

+ 11 - 2
src/store/reducer/object2.ts

@@ -6,7 +6,7 @@ const initState = {
     total: 0,
     total: 0,
   },
   },
 
 
-  // // 点击查看的单个藏品信息
+  // 点击查看的单个藏品信息
   oneGoodsInfo: {
   oneGoodsInfo: {
     info: {},
     info: {},
     fileList: {
     fileList: {
@@ -17,11 +17,17 @@ const initState = {
       doc: [],
       doc: [],
     },
     },
   } as any,
   } as any,
+  // 操作记录列表
+  logList: {
+    list: [] as any,
+    total: 0,
+  },
 };
 };
 
 
 type LoginActionType =
 type LoginActionType =
   | { type: "object2/getList"; payload: any }
   | { type: "object2/getList"; payload: any }
-  | { type: "object2/getOneGoodsInfo"; payload: any };
+  | { type: "object2/getOneGoodsInfo"; payload: any }
+  | { type: "object2/getLogList"; payload: any };
 // 频道 reducer
 // 频道 reducer
 export default function object2Reducer(
 export default function object2Reducer(
   state = initState,
   state = initState,
@@ -34,6 +40,9 @@ export default function object2Reducer(
     // 查看页面的数据
     // 查看页面的数据
     case "object2/getOneGoodsInfo":
     case "object2/getOneGoodsInfo":
       return { ...state, oneGoodsInfo: action.payload };
       return { ...state, oneGoodsInfo: action.payload };
+    // 操作记录列表
+    case "object2/getLogList":
+      return { ...state, logList: action.payload };
 
 
     default:
     default:
       return state;
       return state;

+ 16 - 0
src/utils/dataChange.ts

@@ -36,6 +36,22 @@ export const statusObj = {
 // 入库出库的状态筛选
 // 入库出库的状态筛选
 export const storageStatusObj = {
 export const storageStatusObj = {
   "0": "未入库",
   "0": "未入库",
+  temp: "待审核通过",
   in: "已入库 ",
   in: "已入库 ",
   out: "已出库",
   out: "已出库",
 } as any;
 } as any;
+
+// 藏品总账,操作记录
+export const logTypeObj = {
+  in: "入库管理",
+  out: "出库管理",
+  move: "藏品移库",
+  edit: "藏品修改",
+} as any;
+// 藏品总账,操作记录跳转
+export const logTypeOpenObj = {
+  in: "#/object/3/look?k=1&d=null&id=",
+  out: "出库管理",
+  move: "藏品移库",
+  edit: "藏品修改",
+} as any;

+ 3 - 3
src/utils/http.ts

@@ -44,10 +44,10 @@ http.interceptors.response.use(
     // 请求回来的关闭加载提示
     // 请求回来的关闭加载提示
     axajInd--;
     axajInd--;
     if (axajInd === 0) {
     if (axajInd === 0) {
-      setTimeout(() => {
+      // setTimeout(() => {
         lodingDom.style.opacity = 0;
         lodingDom.style.opacity = 0;
         lodingDom.style.pointerEvents = "none";
         lodingDom.style.pointerEvents = "none";
-      }, 200);
+      // }, 100);
     }
     }
 
 
     if (response.data.code === 5001 || response.data.code === 5002) {
     if (response.data.code === 5001 || response.data.code === 5002) {
@@ -64,7 +64,7 @@ http.interceptors.response.use(
     setTimeout(() => {
     setTimeout(() => {
       lodingDom.style.opacity = 0;
       lodingDom.style.opacity = 0;
       lodingDom.style.pointerEvents = "none";
       lodingDom.style.pointerEvents = "none";
-    }, 100);
+    }, 300);
     // 如果因为网络原因,response没有,给提示消息
     // 如果因为网络原因,response没有,给提示消息
     if (!err.response) {
     if (!err.response) {
       message.warning("网络繁忙,请稍后重试!");
       message.warning("网络繁忙,请稍后重试!");