shaogen1995 2 rokov pred
rodič
commit
1a8d7cb942

+ 2 - 2
src/pages/A2Goods/A2Register/A2SelectModal/index.tsx

@@ -38,9 +38,9 @@ function A2SelectModal({ oldList, upTableFu, closeFu, myType }: Props) {
   }, [listAll, txtRes]);
 
   const getListAllFu = useCallback(async () => {
-    const res = await A2_APIresList({ searchKey: "", type: "ZX" });
+    const res = await A2_APIresList({ searchKey: "", type: myType });
     if (res.code === 0) setListAll(res.data);
-  }, []);
+  }, [myType]);
 
   useEffect(() => {
     getListAllFu();

+ 6 - 2
src/pages/A2Goods/A2Register/index.tsx

@@ -178,7 +178,11 @@ function A2Register({ closeFu, outInfo, myType, isLookItem }: Props) {
           <div>藏品清单:</div>
           <Button
             type="primary"
-            onClick={() => setAddInfo({ id: -1, txt: "新增" })}
+            onClick={() => {
+              if (tableList.length >= 50)
+                return MessageFu.warning("最多支持50条藏品!");
+              setAddInfo({ id: -1, txt: "新增" });
+            }}
           >
             新增
           </Button>
@@ -225,7 +229,7 @@ function A2Register({ closeFu, outInfo, myType, isLookItem }: Props) {
               oldList={tableList}
               closeFu={() => setAddInfo({ id: 0, txt: "" })}
               upTableFu={(itemArr) => setTableList(itemArr)}
-              myType='ZX'
+              myType="ZX"
             />
           )}
         </>

+ 85 - 0
src/pages/A3Stock/A3RoomStatu/index.module.scss

@@ -0,0 +1,85 @@
+.A3RoomStatu {
+  position: absolute;
+  top: 0;
+  left: 0;
+  width: 100%;
+  height: calc(100% + 2px);
+  z-index: 10;
+  background-color: #ecedf1;
+
+  :global {
+    .A3Rtop {
+      margin-bottom: 15px;
+      background-color: #fff;
+      border-radius: 10px;
+      padding: 20px 24px 20px 60px;
+      position: relative;
+
+      .A3RTitle {
+        position: absolute;
+        top: 14px;
+        left: 20px;
+        width: 30px;
+        font-weight: 700;
+        font-size: 22px;
+        color: var(--themeColor);
+      }
+
+      .A3RtopRow {
+        display: flex;
+
+        .A3Rtopll {
+          text-align: right;
+          width: 84px;
+          margin-right: 6px;
+
+          &>span {
+            color: #ff4d4f;
+          }
+        }
+
+        .A3Rtoprr {
+          width: calc(100% - 90px);
+
+          textarea {
+            min-height: 80px !important;
+          }
+        }
+      }
+
+      .A3RtopRow1 {
+        margin-bottom: 10px;
+        align-items: center;
+      }
+    }
+
+    .A3Rtable {
+      height: calc(100% - 180px);
+      background-color: #fff;
+      border-radius: 10px;
+      padding: 18px 24px 24px;
+
+      .A3Rtable1 {
+        display: flex;
+        justify-content: space-between;
+        margin-bottom: 10px;
+      }
+
+      .A3Rtable2 {
+        height: calc(100% - 80px);
+
+        .ant-table-body {
+          .ant-table-cell {
+            padding: 4px 6px !important;
+          }
+        }
+
+      }
+
+      .A3Rtable3 {
+        margin-top: 10px;
+        text-align: center;
+      }
+    }
+  }
+}

+ 254 - 0
src/pages/A3Stock/A3RoomStatu/index.tsx

@@ -0,0 +1,254 @@
+import React, {
+  useCallback,
+  useEffect,
+  useMemo,
+  useRef,
+  useState,
+} from "react";
+import styles from "./index.module.scss";
+import TextArea from "antd/es/input/TextArea";
+import { A2GoodObjTxt, A2addInfoType } from "@/pages/A2Goods/data";
+import { A2tableType } from "@/types";
+import { A3roomStatuType } from "../data";
+import { B1TieleObj } from "@/pages/B1Submit/data";
+import { API_roomTree } from "@/store/action/A4Roomset";
+import { useDispatch, useSelector } from "react-redux";
+import { RootState } from "@/store";
+import { Button, Cascader, Popconfirm } from "antd";
+import {
+  A2_APIaddWaiRoom,
+  A2_APIgetInfoWai,
+  A2_APIinDels,
+} from "@/store/action/A2Goods";
+import { MessageFu } from "@/utils/message";
+import history from "@/utils/history";
+import B1Look from "@/pages/B1Submit/B1Look";
+import A2SelectModal from "@/pages/A2Goods/A2Register/A2SelectModal";
+import ZlistTable from "@/components/ZlistTable";
+
+type Props = {
+  closeFu: () => void;
+  outInfo: A2addInfoType;
+  myType: A3roomStatuType;
+  // 从藏品查看页面点击注销进来
+  isLookItem?: A2tableType;
+};
+
+function A3RoomStatu({ closeFu, outInfo, myType, isLookItem }: Props) {
+  const dispatch = useDispatch();
+
+  // 获取下拉框树结构
+  useEffect(() => {
+    dispatch(API_roomTree());
+  }, [dispatch]);
+
+  const roomTree = useSelector((state: RootState) => state.A4Roomset.roomTree);
+
+  // 从 藏品查看也进来,直接把这条藏品信息添加到表格
+  useEffect(() => {
+    if (isLookItem && isLookItem.id) setTableList([isLookItem]);
+  }, [isLookItem]);
+
+  // 记录删除了的所有id集合
+  const delIdArr = useRef<number[]>([]);
+
+  // 当前审批的状态
+  const statusRef = useRef(0);
+
+  // 获取详情
+  const getInfoFu = useCallback(async (id: number) => {
+    const res = await A2_APIgetInfoWai(id);
+    if (res.code === 0) {
+      setTopValue(res.data.entity.description);
+      statusRef.current = res.data.entity.status;
+      setTableList(res.data.child);
+      const loc = res.data.entity.storageIds;
+      setRoomId(loc ? loc.split(",").map((v: any) => Number(v)) : undefined);
+    }
+  }, []);
+
+  useEffect(() => {
+    if (outInfo.txt !== "新增") getInfoFu(outInfo.id);
+  }, [getInfoFu, outInfo.id, outInfo.txt]);
+
+  // 表格信息
+  const [tableList, setTableList] = useState<A2tableType[]>([]);
+
+  // 申请说明字段
+  const [topValue, setTopValue] = useState("");
+
+  // 库房的选择
+  const [roomId, setRoomId] = useState<undefined | number[]>(undefined);
+
+  // 点击提交或者存草稿
+  const btnOkFu = useCallback(
+    async (status: 0 | 1) => {
+      if (!roomId) return MessageFu.warning("请选择库房!");
+
+      const obj = {
+        id:
+          outInfo.txt === "新增" || statusRef.current === 2 ? null : outInfo.id,
+        description: topValue,
+        goodsIds: tableList.map((v) => v.id).join(","),
+        status,
+        type: myType,
+        storageIds: roomId ? roomId.join(",") : null,
+      };
+
+      const res1 = await A2_APIaddWaiRoom(obj);
+
+      // 删除id集合
+      if (delIdArr.current.length > 0) {
+        await A2_APIinDels(delIdArr.current.join(","));
+      }
+
+      if (res1.code === 0) {
+        MessageFu.success(`操作成功!`);
+        if (window.location.hash.includes("/submit")) {
+          history.replace("/404");
+          window.setTimeout(() => {
+            history.push("/submit");
+          }, 200);
+        } else history.push("/submit");
+      }
+    },
+    [myType, outInfo.id, outInfo.txt, roomId, tableList, topValue]
+  );
+
+  // 点击表格的查看
+  const [lookId, setLookId] = useState(0);
+
+  // 表格的操作模块的列
+  const listTableBtn = useMemo(() => {
+    return {
+      title: "操作",
+      render: (item: A2tableType) => (
+        <>
+          <Button size="small" type="text" onClick={() => setLookId(item.id)}>
+            查看
+          </Button>
+
+          <Popconfirm
+            title="删除后无法恢复,是否删除?"
+            okText="删除"
+            cancelText="取消"
+            onConfirm={() => {
+              delIdArr.current.push(item.id);
+              setTableList(tableList.filter((v) => v.id !== item.id));
+              MessageFu.success("删除成功!");
+            }}
+            okButtonProps={{ loading: false }}
+          >
+            <Button size="small" type="text" danger>
+              删除
+            </Button>
+          </Popconfirm>
+        </>
+      ),
+    };
+  }, [tableList]);
+
+  // 新增和编辑
+  const [addInfo, setAddInfo] = useState<A2addInfoType>({ id: 0, txt: "" });
+
+  return (
+    <div className={styles.A3RoomStatu}>
+      <div className="A3Rtop">
+        <div className="A3RTitle">{Reflect.get(B1TieleObj, myType)}</div>
+        <div className="A3RtopRow A3RtopRow1">
+          <div className="A3Rtopll">
+            <span>*</span> {Reflect.get(A2GoodObjTxt, myType)}库房:
+          </div>
+          <div className="A3Rtoprr">
+            <Cascader
+              // 自定义字段
+              fieldNames={{
+                label: "name",
+                value: "id",
+                children: "children",
+              }}
+              style={{ width: 160 }}
+              options={roomTree}
+              placeholder="全部"
+              value={roomId}
+              onChange={(e) => setRoomId(e as number[])}
+            />
+          </div>
+        </div>
+        <div className="A3RtopRow">
+          <div className="A3Rtopll">申请说明:</div>
+          <div className="A3Rtoprr">
+            <TextArea
+              value={topValue}
+              onChange={(e) => setTopValue(e.target.value)}
+              placeholder="请输入内容"
+              showCount
+              maxLength={200}
+            />
+          </div>
+        </div>
+      </div>
+
+      <div className="A3Rtable">
+        <div className="A3Rtable1">
+          <div>藏品清单:</div>
+          <Button
+            type="primary"
+            onClick={() => {
+              if (tableList.length >= 50)
+                return MessageFu.warning("最多支持50条藏品!");
+              setAddInfo({ id: -1, txt: "新增" });
+            }}
+          >
+            新增
+          </Button>
+        </div>
+        <div className="A3Rtable2">
+          <ZlistTable list={tableList} btnDom={listTableBtn} y={478} />
+        </div>
+        <div className="A3Rtable3">
+          <Button
+            disabled={!tableList.length}
+            type="primary"
+            onClick={() => btnOkFu(1)}
+          >
+            提交
+          </Button>
+          &emsp;
+          <Button disabled={!tableList.length} onClick={() => btnOkFu(0)}>
+            存草稿
+          </Button>
+          &emsp;
+          <Popconfirm
+            title="放弃编辑后,信息将不会保存!"
+            okText="放弃"
+            cancelText="取消"
+            onConfirm={closeFu}
+            okButtonProps={{ loading: false }}
+          >
+            <Button>取消</Button>
+          </Popconfirm>
+        </div>
+      </div>
+
+      {/* 新增和编辑弹窗 */}
+      {addInfo.id ? (
+        <A2SelectModal
+          oldList={tableList}
+          closeFu={() => setAddInfo({ id: 0, txt: "" })}
+          upTableFu={(itemArr) => setTableList(itemArr)}
+          myType={myType as "RK" | "CK" | "YK"}
+        />
+      ) : null}
+
+      {/* 点击表格的查看 */}
+      {lookId ? (
+        <B1Look goodsId={lookId} closeFu={() => setLookId(0)} isCance={true} />
+      ) : null}
+    </div>
+  );
+}
+
+const MemoA3RoomStatu = React.memo(A3RoomStatu);
+
+export default MemoA3RoomStatu;

+ 9 - 0
src/pages/A3Stock/data.ts

@@ -0,0 +1,9 @@
+export type A3selectType = {
+  searchKey: string;
+  aaaa:string
+  storageStatus: "" | 0 | 1 | 2 | 3 | 4;
+  pageSize: number;
+  pageNum: number;
+};
+
+export type A3roomStatuType =''|'RK'|'CK'|'YK'

+ 39 - 3
src/pages/A3Stock/index.module.scss

@@ -1,5 +1,41 @@
-.A3Stock{
-  :global{
-    
+.A3Stock {
+  position: relative;
+
+  :global {
+    .A3top {
+      display: flex;
+      justify-content: space-between;
+      border-radius: 10px;
+      background-color: #fff;
+      padding: 15px 24px;
+
+      &>div {
+        display: flex;
+
+        .A3topRow {
+          margin-right: 20px;
+
+          // 级联选择器的 placeholder
+          .ant-select-selection-placeholder {
+            color: black;
+          }
+        }
+      }
+    }
+
+    .tableMain {
+      border-radius: 10px;
+      margin-top: 15px;
+      height: calc(100% - 75px);
+      background-color: #fff;
+
+      .ant-table-body {
+        height: 625px;
+
+        .ant-table-cell {
+          padding: 8px;
+        }
+      }
+    }
   }
 }

+ 145 - 5
src/pages/A3Stock/index.tsx

@@ -1,12 +1,152 @@
-import React from "react";
+import React, { useCallback, useEffect, useRef, useState } from "react";
 import styles from "./index.module.scss";
- function A3Stock() {
-  
+import { Button, Cascader, Input, Select, Table } from "antd";
+import { useDispatch, useSelector } from "react-redux";
+import { A3roomStatuType, A3selectType } from "./data";
+import { options3 } from "../A2Goods/data";
+import { API_roomTree } from "@/store/action/A4Roomset";
+import { RootState } from "@/store";
+import A3RoomStatu from "./A3RoomStatu";
+function A3Stock() {
+  const dispatch = useDispatch();
+
+  // 获取下拉框树结构
+  useEffect(() => {
+    dispatch(API_roomTree());
+  }, [dispatch]);
+
+  const roomTree = useSelector((state: RootState) => state.A4Roomset.roomTree);
+
+  // 筛选和分页
+  const [tableSelect, setTableSelect] = useState<A3selectType>({
+    searchKey: "",
+    aaaa: "",
+    storageStatus: "",
+    pageSize: 10,
+    pageNum: 1,
+  });
+
+  // 输入框的改变
+  const txtTimeRef = useRef(-1);
+  const txtChangeFu = useCallback(
+    (txt: string, key: "searchKey") => {
+      clearTimeout(txtTimeRef.current);
+      txtTimeRef.current = window.setTimeout(() => {
+        setTableSelect({ ...tableSelect, [key]: txt, pageNum: 1 });
+      }, 500);
+    },
+    [tableSelect]
+  );
+
+  // 点击重置
+  const [inputKey, setInputKey] = useState(1);
+  const resetSelectFu = useCallback(() => {
+    // 把2个输入框和时间选择器清空
+    setInputKey(Date.now());
+    setTableSelect({
+      searchKey: "",
+      aaaa: "",
+      storageStatus: "",
+      pageSize: 10,
+      pageNum: 1,
+    });
+  }, []);
+
+  // 入库 出库 移库
+  const [roomStatu, setRoomStatu] = useState<A3roomStatuType>("");
+
   return (
     <div className={styles.A3Stock}>
-     <div className="pageTitle">库存清单</div>
+      <div className="pageTitle">库存清单</div>
+      {/* 顶部筛选 */}
+      <div className="A3top">
+        {/* 左侧输入框 */}
+        <div className="A3top1">
+          <div className="A3topRow">
+            <span>搜索项:</span>
+            <Input
+              key={inputKey}
+              maxLength={10}
+              style={{ width: 248 }}
+              placeholder="请输入藏品编号/名称,最多10字"
+              allowClear
+              onChange={(e) => txtChangeFu(e.target.value, "searchKey")}
+            />
+          </div>
+
+          <div className="A3topRow">
+            <span>库房:</span>
+            <Cascader
+              // 自定义字段
+              fieldNames={{
+                label: "name",
+                value: "id",
+                children: "children",
+              }}
+              style={{ width: 160 }}
+              options={roomTree}
+              placeholder="全部"
+              onChange={(e) => console.log(123, e)}
+            />
+          </div>
+
+          <div className="A3topRow">
+            <span>库存状态:</span>
+            <Select
+              style={{ width: 160 }}
+              value={tableSelect.storageStatus}
+              onChange={(e) =>
+                setTableSelect({ ...tableSelect, storageStatus: e, pageNum: 1 })
+              }
+              options={options3.filter((v) => v.label !== "未入库")}
+            />
+          </div>
+        </div>
+        {/* 右侧按钮 */}
+        <div className="A3top2">
+          <Button onClick={resetSelectFu}>重置</Button>&emsp;
+          <Button onClick={() => setRoomStatu("CK")} type="primary">
+            出库
+          </Button>
+          &emsp;
+          <Button onClick={() => setRoomStatu("RK")} type="primary">
+            入库
+          </Button>
+          &emsp;
+          <Button onClick={() => setRoomStatu("YK")} type="primary">
+            移库
+          </Button>
+        </div>
+      </div>
+      {/* 表格主体 */}
+      <div className="tableMain">
+        {/* <Table
+          scroll={{ y: 625 }}
+          dataSource={A2TableList.list}
+          columns={columns}
+          rowKey="id"
+          pagination={{
+            showQuickJumper: true,
+            position: ["bottomCenter"],
+            showSizeChanger: true,
+            current: tableSelect.pageNum,
+            pageSize: tableSelect.pageSize,
+            total: A2TableList.total,
+            onChange: paginationChange(),
+          }}
+        /> */}
+      </div>
+
+      {/* 点击入库 出库 移库 */}
+      {roomStatu ? (
+        <A3RoomStatu
+          closeFu={() => setRoomStatu("")}
+          outInfo={{ id: -1, txt: "新增" }}
+          myType={roomStatu}
+        />
+      ) : null}
     </div>
-  )
+  );
 }
 
 const MemoA3Stock = React.memo(A3Stock);

+ 15 - 0
src/pages/B1Submit/B1Info/index.module.scss

@@ -103,7 +103,22 @@
       height: calc(100% - 277px);
       background-color: #fff;
       border-radius: 10px;
+    }
+
+    // 入库 出库 移库 信息
+    .B1IRK {
       display: flex;
+      padding: 10px;
+      align-items: center;
+      .ant-cascader{
+        pointer-events: none;
+        .ant-select-selector{
+          border: none;
+        }
+        .ant-select-arrow{
+          opacity: 0;
+        }
+      }
     }
 
     .B1ItableNoEdit {

+ 49 - 3
src/pages/B1Submit/B1Info/index.tsx

@@ -8,7 +8,7 @@ import React, {
 import styles from "./index.module.scss";
 import { A2tableType, B1tableType } from "@/types";
 import { B1StatusObj, B1TieleObj, antdTagColorFObj } from "../data";
-import { Button, Popconfirm, Radio, Table, Tag } from "antd";
+import { Button, Cascader, Popconfirm, Radio, Table, Tag } from "antd";
 import { A2addInfoType } from "@/pages/A2Goods/data";
 import ImageLazy from "@/components/ImageLazy";
 import { A2_APIdelOrder, A2_APIgetInfo } from "@/store/action/B1Submit";
@@ -21,6 +21,10 @@ import { B1EditKeyObj, B1EditTable } from "./data";
 import classNames from "classnames";
 import A2AddModal from "@/pages/A2Goods/A2Register/A2AddModal";
 import ZlistTable from "@/components/ZlistTable";
+import A3RoomStatu from "@/pages/A3Stock/A3RoomStatu";
+import { API_roomTree } from "@/store/action/A4Roomset";
+import { useDispatch, useSelector } from "react-redux";
+import { RootState } from "@/store";
 
 type Props = {
   closeFu: () => void;
@@ -30,6 +34,14 @@ type Props = {
 };
 
 function B1Info({ closeFu, lookId, pageKey, upTableFu }: Props) {
+  const dispatch = useDispatch();
+  // 获取下拉框树结构
+  useEffect(() => {
+    dispatch(API_roomTree());
+  }, [dispatch]);
+
+  const roomTree = useSelector((state: RootState) => state.A4Roomset.roomTree);
+
   const [info, setInfo] = useState({} as B1tableType);
 
   // 藏品编辑的id存储
@@ -350,6 +362,31 @@ function B1Info({ closeFu, lookId, pageKey, upTableFu }: Props) {
           info.type !== "BJ" ? "B1ItableNoEdit" : ""
         )}
       >
+        {/* 待完善 */}
+        {/* 入库信息 */}
+        {info.type === "RK" ? (
+          <div className="B1IRK">
+            <div>入库库房:</div>
+            <Cascader
+              // 自定义字段
+              fieldNames={{
+                label: "name",
+                value: "id",
+                children: "children",
+              }}
+              style={{ width: 160 }}
+              options={roomTree}
+              placeholder="全部"
+              value={
+                info.storageIds
+                  ? info.storageIds.split(",").map((v) => Number(v))
+                  : undefined
+              }
+              onChange={(e) => console.log(e)}
+            />
+          </div>
+        ) : null}
+
         {/* 藏品编辑表格 */}
         {info.type === "BJ" ? (
           <Table
@@ -360,10 +397,10 @@ function B1Info({ closeFu, lookId, pageKey, upTableFu }: Props) {
             rowKey="id"
             pagination={false}
           />
-        ) : info.type === "DJ" || info.type === "ZX" ? (
+        ) : (
           // 登记和注销表格
           <ZlistTable list={tableList} btnDom={listTableBtn} y={438} />
-        ) : null}
+        )}
       </div>
       {/* 点击表格里面的查看出来的页面 */}
       {goodsId ? (
@@ -373,6 +410,7 @@ function B1Info({ closeFu, lookId, pageKey, upTableFu }: Props) {
       {/* 点击编辑按钮出来的页面 */}
       {outInfo.id ? (
         info.type === "BJ" ? (
+          // 藏品修改
           <A2AddModal
             addInfo={{ id: outInfo.id, txt: "编辑" }}
             upTableFu={() => {}}
@@ -380,11 +418,19 @@ function B1Info({ closeFu, lookId, pageKey, upTableFu }: Props) {
             idOldToNew={true}
           />
         ) : info.type === "DJ" || info.type === "ZX" ? (
+          // 登记/注销
           <A2Register
             closeFu={() => setOutInfo({ id: 0, txt: "" })}
             outInfo={outInfo}
             myType={info.type}
           />
+        ) : ["RK", "YK", "CK"].includes(info.type) ? (
+          // 入库 移库 出库
+          <A3RoomStatu
+            closeFu={() => setOutInfo({ id: 0, txt: "" })}
+            outInfo={outInfo}
+            myType={info.type as "RK" | "YK" | "CK"}
+          />
         ) : null
       ) : null}
     </div>

+ 20 - 9
src/pages/B1Submit/B1Look/index.tsx

@@ -19,6 +19,7 @@ import A2AddModal from "@/pages/A2Goods/A2Register/A2AddModal";
 import B1Log from "./B1Log";
 import { A2tableType } from "@/types";
 import A2Register from "@/pages/A2Goods/A2Register";
+import A3RoomStatu from "@/pages/A3Stock/A3RoomStatu";
 
 type Props = {
   goodsId: number;
@@ -103,37 +104,37 @@ function B1Look({ closeFu, goodsId, isCance }: Props) {
   // 操作的按钮
   const [btnKey, setBtnKey] = useState<B1LbtnKey>({ id: 0, txt: "" });
   const btnClickFu = useCallback(
-    (key: "编辑" | "入库" | "移库" | "出库" | "注销") => {
+    (key: "BJ" | "RK" | "YK" | "CK" | "ZX") => {
       setBtnKey({ id: goodsId, txt: key });
     },
     [goodsId]
   );
 
-  // 操作按钮出现的逻辑(待完善)
+  // 操作按钮出现的逻辑
   const btnArr = useMemo(() => {
     const btn1 = (
       <div>
-        <Button onClick={() => btnClickFu("编辑")}>编辑</Button>
+        <Button onClick={() => btnClickFu("BJ")}>编辑</Button>
       </div>
     );
     const btn2 = (
       <div>
-        <Button onClick={() => btnClickFu("入库")}>入库</Button>
+        <Button onClick={() => btnClickFu("RK")}>入库</Button>
       </div>
     );
     const btn3 = (
       <div>
-        <Button onClick={() => btnClickFu("移库")}>移库</Button>
+        <Button onClick={() => btnClickFu("YK")}>移库</Button>
       </div>
     );
     const btn4 = (
       <div>
-        <Button onClick={() => btnClickFu("出库")}>出库</Button>
+        <Button onClick={() => btnClickFu("CK")}>出库</Button>
       </div>
     );
     const btn5 = (
       <div>
-        <Button onClick={() => btnClickFu("注销")}>注销</Button>
+        <Button onClick={() => btnClickFu("ZX")}>注销</Button>
       </div>
     );
     let res: React.ReactNode = "";
@@ -289,7 +290,7 @@ function B1Look({ closeFu, goodsId, isCance }: Props) {
       {logId ? <B1Log logId={logId} closeFu={() => setLogId(0)} /> : null}
 
       {/* 点击编辑出现的弹窗 */}
-      {btnKey.txt === "编辑" ? (
+      {btnKey.txt === "BJ" ? (
         <A2AddModal
           addInfo={{ id: btnKey.id, txt: "编辑" }}
           upTableFu={() => {}}
@@ -299,7 +300,7 @@ function B1Look({ closeFu, goodsId, isCance }: Props) {
       ) : null}
 
       {/* 点击注销出现的弹窗 */}
-      {btnKey.txt === "注销" ? (
+      {btnKey.txt === "ZX" ? (
         <A2Register
           outInfo={{ id: btnKey.id, txt: "新增" }}
           closeFu={() => setBtnKey({ id: 0, txt: "" })}
@@ -308,6 +309,16 @@ function B1Look({ closeFu, goodsId, isCance }: Props) {
           isLookItem={info}
         />
       ) : null}
+
+      {/* 入库 移库 出库 */}
+      {["RK", "YK", "CK"].includes(btnKey.txt) ? (
+        <A3RoomStatu
+          closeFu={() => setBtnKey({ id: 0, txt: "" })}
+          outInfo={{ id: btnKey.id, txt: "新增" }}
+          myType={btnKey.txt as "RK" | "YK" | "CK"}
+          isLookItem={info}
+        />
+      ) : null}
     </div>
   );
 }

+ 1 - 1
src/pages/B1Submit/data.ts

@@ -96,6 +96,6 @@ export const antdTagColorFObj={
 
 export type B1LbtnKey={
   id:number
-  txt:'编辑'|'入库'|'移库'|'出库'|'注销'|''
+  txt:'BJ'|'RK'|'YK'|'CK'|'ZX'|''
 }
 

+ 8 - 1
src/store/action/A2Goods.ts

@@ -39,13 +39,20 @@ export const A2_APIinDels = (ids: string) => {
 };
 
 /**
- * 登记藏品(外)
+ * 登记藏品(外)----登记 注销
  */
 export const A2_APIaddWai = (data: any) => {
   return http.post("cms/order/save/registerOrCancel", data);
 };
 
 /**
+ *  订单-入库/出库/移库申请-编辑|新增
+ */
+export const A2_APIaddWaiRoom = (data: any) => {
+  return http.post("cms/order/save/storage", data);
+};
+
+/**
  * 通过id获取详情(外 1对多)
  */
 export const A2_APIgetInfoWai = (orderId: number) => {

+ 12 - 0
src/store/action/A4Roomset.ts

@@ -40,3 +40,15 @@ export const A4_APIgetInfo = (id: number) => {
 export const A4_APIadd = (data: any) => {
   return http.post("cms/storage/save", data);
 };
+
+/**
+ * 获取列表 树结构 用于下拉框
+ */
+export const API_roomTree = () => {
+  return async (dispatch: AppDispatch) => {
+    const res = await http.get("cms/storage/getTree");
+    if (res.code === 0) {
+      dispatch({ type: "A4/getTree", payload: res.data });
+    }
+  };
+};

+ 0 - 13
src/store/action/B2Audit.ts

@@ -17,16 +17,3 @@ export const B2_APIgetList = (data: any) => {
   };
 };
 
-// /**
-//  * 获取详情
-//  */
-// export const A2_APIgetInfo = (id: number) => {
-//   return http.get(`cms/my/order/detail/${id}`);
-// };
-
-// /**
-//  * 删除订单
-//  */
-// export const A2_APIdelOrder = (id: number) => {
-//   return http.get(`cms/order/removes/${id}`);
-// };

+ 10 - 5
src/store/reducer/A4Roomset.ts

@@ -1,22 +1,27 @@
-import { A4tableType } from "@/types";
+import { A4tableType, TreeType } from "@/types";
 
 // 初始化状态
 const initState = {
   // 列表数据
   tableInfo: [] as A4tableType[],
+
+  // 树结构,用于下拉框
+  roomTree: [] as TreeType[],
 };
 
 // 定义 action 类型
-type Props = {
-  type: "A4/getList";
-  payload: A4tableType[];
-};
+type Props =
+  | { type: "A4/getList"; payload: A4tableType[] }
+  | { type: "A4/getTree"; payload: TreeType[] };
 
 export default function Reducer(state = initState, action: Props) {
   switch (action.type) {
     // 获取列表数据
     case "A4/getList":
       return { ...state, tableInfo: action.payload };
+    // 树结构,用于下拉框
+    case "A4/getTree":
+      return { ...state, roomTree: action.payload };
     default:
       return state;
   }

+ 17 - 8
src/types/api/A4Roomset.d.ts

@@ -1,8 +1,17 @@
-export type A4tableType= {
-	description: string;
-	id: number;
-	name: string;
-	num: string;
-  level:1|2
-	pcs:number
-}
+export type A4tableType = {
+  description: string;
+  id: number;
+  name: string;
+  num: string;
+  level: 1 | 2;
+  pcs: number;
+};
+
+export type TreeType = {
+  id: number;
+  name: string;
+  children: {
+    id: number;
+    name: string;
+  }[];
+};