shaogen1995 1 год назад
Родитель
Сommit
9b0c9fbc7e

+ 17 - 1
src/pages/A3Stock/A3RoomStatu/index.module.scss

@@ -14,6 +14,7 @@
       border-radius: 10px;
       padding: 20px 24px 20px 60px;
       position: relative;
+      min-height: 140px;
 
       .A3RTitle {
         position: absolute;
@@ -49,7 +50,22 @@
 
       .A3RtopRow1 {
         margin-bottom: 10px;
-        align-items: center;
+        &>div{
+          display: flex;
+          align-items: center;
+          margin-right: 20px;
+        }
+        .A3RtopRowSonYK{
+          .ant-cascader{
+            pointer-events: none;
+            .ant-select-selector{
+              border: none;
+            }
+            .ant-select-arrow{
+              opacity: 0;
+            }
+          }
+        }
       }
     }
 

+ 27 - 19
src/pages/A3Stock/A3RoomStatu/index.tsx

@@ -32,6 +32,7 @@ type Props = {
   myType: A3roomStatuType;
   // 从藏品查看页面点击注销进来
   isLookItem?: A2tableType;
+  pageFlag?: boolean; //从 库存清单页面进来的时候 格式会有不同
 };
 
 function A3RoomStatu({ closeFu, outInfo, myType, isLookItem }: Props) {
@@ -83,7 +84,7 @@ function A3RoomStatu({ closeFu, outInfo, myType, isLookItem }: Props) {
   // 点击提交或者存草稿
   const btnOkFu = useCallback(
     async (status: 0 | 1) => {
-      if (!roomId) return MessageFu.warning("请选择库房!");
+      if (!roomId && myType !== "CK") return MessageFu.warning("请选择库房!");
 
       const obj = {
         id:
@@ -155,25 +156,32 @@ function A3RoomStatu({ closeFu, outInfo, myType, isLookItem }: Props) {
     <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>
+          {/* 出库的时候不用选择库房 */}
+          {myType === "CK" ? null : (
+            <div>
+              <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>
         <div className="A3RtopRow">
           <div className="A3Rtopll">申请说明:</div>

+ 2 - 1
src/pages/A3Stock/index.tsx

@@ -81,7 +81,7 @@ function A3Stock() {
               fieldNames={{
                 label: "name",
                 value: "id",
-                children: "children",
+                children: "children2",
               }}
               style={{ width: 160 }}
               options={roomTree}
@@ -143,6 +143,7 @@ function A3Stock() {
           closeFu={() => setRoomStatu("")}
           outInfo={{ id: -1, txt: "新增" }}
           myType={roomStatu}
+          pageFlag={true}
         />
       ) : null}
     </div>

+ 10 - 4
src/pages/B1Submit/B1Info/index.module.scss

@@ -97,7 +97,6 @@
     }
 
     // 表格
-
     .B1Itable {
       margin-top: 15px;
       height: calc(100% - 277px);
@@ -110,12 +109,19 @@
       display: flex;
       padding: 10px;
       align-items: center;
-      .ant-cascader{
+
+      .RKtxt {
+        margin-right: 40px;
+      }
+
+      .ant-cascader {
         pointer-events: none;
-        .ant-select-selector{
+
+        .ant-select-selector {
           border: none;
         }
-        .ant-select-arrow{
+
+        .ant-select-arrow {
           opacity: 0;
         }
       }

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

@@ -362,11 +362,10 @@ function B1Info({ closeFu, lookId, pageKey, upTableFu }: Props) {
           info.type !== "BJ" ? "B1ItableNoEdit" : ""
         )}
       >
-        {/* 待完善 */}
         {/* 入库信息 */}
-        {info.type === "RK" ? (
+        {["RK", "YK"].includes(info.type) ? (
           <div className="B1IRK">
-            <div>入库库房:</div>
+            <div>{info.type === "RK" ? "入库" : "移库"}库房:</div>
             <Cascader
               // 自定义字段
               fieldNames={{
@@ -376,7 +375,7 @@ function B1Info({ closeFu, lookId, pageKey, upTableFu }: Props) {
               }}
               style={{ width: 160 }}
               options={roomTree}
-              placeholder="全部"
+              placeholder=""
               value={
                 info.storageIds
                   ? info.storageIds.split(",").map((v) => Number(v))

+ 15 - 1
src/pages/B1Submit/B1Look/index.module.scss

@@ -41,6 +41,20 @@
               font-weight: 700;
               font-size: 20px;
             }
+
+            .B1LtopTxt {
+              .ant-cascader {
+                pointer-events: none;
+
+                .ant-select-selector {
+                  border: none;
+                }
+
+                .ant-select-arrow {
+                  opacity: 0;
+                }
+              }
+            }
           }
         }
 
@@ -164,7 +178,7 @@
       .ant-table-cell {
         text-align: center !important;
       }
-      
+
 
       .B1Lbtn {
         margin-top: 20px;

+ 35 - 6
src/pages/B1Submit/B1Look/index.tsx

@@ -5,12 +5,12 @@ import {
   statusTxtObj,
   storageStatusTxtObj,
 } from "@/pages/A2Goods/data";
-import { Button, Popover, Table, Tag } from "antd";
+import { Button, Cascader, Popover, Table, Tag } from "antd";
 import ImageLazy from "@/components/ImageLazy";
 import { CaretDownOutlined } from "@ant-design/icons";
 import { A2_APIgetInfoSon } from "@/store/action/A2Goods";
 import { FileListType } from "@/components/Z_upFileOtherList";
-import { useSelector } from "react-redux";
+import { useDispatch, useSelector } from "react-redux";
 import { RootState } from "@/store";
 import filesLookFu from "@/utils/filesLook";
 import { baseURL } from "@/utils/http";
@@ -20,6 +20,7 @@ import B1Log from "./B1Log";
 import { A2tableType } from "@/types";
 import A2Register from "@/pages/A2Goods/A2Register";
 import A3RoomStatu from "@/pages/A3Stock/A3RoomStatu";
+import { API_roomTree } from "@/store/action/A4Roomset";
 
 type Props = {
   goodsId: number;
@@ -28,6 +29,14 @@ type Props = {
 };
 
 function B1Look({ closeFu, goodsId, isCance }: Props) {
+  const dispatch = useDispatch();
+  // 获取下拉框树结构
+  useEffect(() => {
+    dispatch(API_roomTree());
+  }, [dispatch]);
+
+  const roomTree = useSelector((state: RootState) => state.A4Roomset.roomTree);
+
   // isFileDonw 全局的是否允许下载
   const isFileDonw = useSelector(
     (state: RootState) => state.A0Layout.isFileDonw
@@ -184,18 +193,38 @@ function B1Look({ closeFu, goodsId, isCance }: Props) {
                 {Reflect.get(statusTxtObj, info.status)}
               </Tag>
               &emsp;
-              <Tag>
+              <Tag color={info.storageStatus === 2 ? "green" : ""}>
                 {Reflect.get(storageStatusTxtObj, info.storageStatus) || ""}
-                <> I 待完善货架</>
               </Tag>
+              &emsp;
+              {info.storageIds && info.storageStatus !== 0 ? (
+                <div className="B1LtopTxt">
+                  位置:
+                  <Cascader
+                    // 自定义字段
+                    fieldNames={{
+                      label: "name",
+                      value: "id",
+                      children: "children",
+                    }}
+                    style={{ width: "auto" }}
+                    options={roomTree}
+                    placeholder=""
+                    value={info.storageIds.split(",").map((v) => Number(v))}
+                    onChange={(e) => console.log(e)}
+                  />
+                </div>
+              ) : null}
             </div>
             <div>
               <Button type="primary" onClick={() => setLogId(goodsId)}>
                 藏品日志
               </Button>
               &emsp;
-              {/* 只有已登记的时候才有操作按钮 */}
-              {info.status === 2 && !isCance ? (
+              {/* 只有已登记的时候才有操作按钮  && 只有 未入库 已入库 才显示*/}
+              {info.status === 2 &&
+              !isCance &&
+              (info.storageStatus === 0 || info.storageStatus === 2) ? (
                 <>
                   <Popover placement="bottom" content={btnArr}>
                     <Button type="primary">

+ 16 - 0
src/store/action/A3Stock.ts

@@ -0,0 +1,16 @@
+import http from "@/utils/http";
+import { AppDispatch } from "..";
+
+/**
+ * 获取库房设置外层列表
+ */
+export const A3_APIgetList = (data: any) => {
+  return async (dispatch: AppDispatch) => {
+    const res = await http.post("cms/storage/goodsList", data);
+    if (res.code === 0) {
+      // dispatch({ type: "A4/getList", payload: res.data });
+      console.log(123,res);
+      
+    }
+  };
+};

+ 1 - 0
src/types/api/B1Submit.d.ts

@@ -12,6 +12,7 @@ export type B1tableType ={
 	num: string;
 	status: number;
 	storageIds: string;
+	beforeStorageIds:string
 	type: string;
 	updateTime: string;
 }