|
@@ -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>
|
|
|
 
|
|
|
- <Tag>
|
|
|
+ <Tag color={info.storageStatus === 2 ? "green" : ""}>
|
|
|
{Reflect.get(storageStatusTxtObj, info.storageStatus) || ""}
|
|
|
- <> I 待完善货架</>
|
|
|
</Tag>
|
|
|
+  
|
|
|
+ {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>
|
|
|
 
|
|
|
- {/* 只有已登记的时候才有操作按钮 */}
|
|
|
- {info.status === 2 && !isCance ? (
|
|
|
+ {/* 只有已登记的时候才有操作按钮 && 只有 未入库 已入库 才显示*/}
|
|
|
+ {info.status === 2 &&
|
|
|
+ !isCance &&
|
|
|
+ (info.storageStatus === 0 || info.storageStatus === 2) ? (
|
|
|
<>
|
|
|
<Popover placement="bottom" content={btnArr}>
|
|
|
<Button type="primary">
|