diff --git a/src/components/System/Ware/PositionDetail.jsx b/src/components/System/Ware/PositionDetail.jsx
index b1a4c8b7248ae4e3e313bd241dc9a93b5104f1e8..c2468671d55b720a04a195a6f3552218dbbb54b3 100644
--- a/src/components/System/Ware/PositionDetail.jsx
+++ b/src/components/System/Ware/PositionDetail.jsx
@@ -1,13 +1,14 @@
import React, { useState } from "react";
-import axios from "axios";
import { AiOutlineEdit } from "react-icons/ai";
import { BsFillTrashFill } from "react-icons/bs";
import { GrClose } from "react-icons/gr";
import { Modal, message } from "antd";
+import adminRequest from "../../../utils/adminRequest";
+
//仓位详情(下半部分右
const PositionDetail = ({ curPos, handleCloseDetail, update }) => {
- console.log(curPos);
+ // console.log(curPos);
const [status, setStatus] = useState(curPos.positionStatus);
@@ -23,7 +24,7 @@ const PositionDetail = ({ curPos, handleCloseDetail, update }) => {
};
const deleteHandleOk = () => {
- axios
+ adminRequest
.get("http://127.0.0.1:8088/admin/system/ware-manage/deletePosition", {
params: { id: curPos.positionId },
})
@@ -48,7 +49,7 @@ const PositionDetail = ({ curPos, handleCloseDetail, update }) => {
};
const handleSubmit = () => {
- axios
+ adminRequest
.post(
"http://127.0.0.1:8088/admin/system/ware-manage/updatePosition",
{},
@@ -85,12 +86,20 @@ const PositionDetail = ({ curPos, handleCloseDetail, update }) => {
仓位
{curPos.productVOList &&
- curPos.productVOList.map((item) => (
+ curPos.productVOList.map((item, index) => (
<>
-
货物编号:{item.productId}
-
货物名称:{item.productName}
-
货物类型:{item.productType}
-
货物数量:{item.productNum}
+
+ {`货物${index + 1}编号:`}
+ {item.productID}
+
+
+ {`货物${index + 1}名称:`}
+ {item.productName}
+
+
+ {`货物${index + 1}数量:`}
+ {item.amount}
+
>
))}
diff --git a/src/components/System/Ware/WareManage.jsx b/src/components/System/Ware/WareManage.jsx
index c65c36d1ec84c9c9b31bb23f42b46374db8d829c..9f6703b3ef52f31a58ef2176f96d3471e43424e2 100644
--- a/src/components/System/Ware/WareManage.jsx
+++ b/src/components/System/Ware/WareManage.jsx
@@ -1,10 +1,10 @@
import React, { useState, useEffect } from "react";
-import axios from "axios";
import { Table, Modal, Button, message } from "antd";
import Position from "./Position";
import AddRepo from "./AddRepo";
import EditRepo from "./EditRepo";
+import adminRequest from "../../../utils/adminRequest";
// 仓库管理
const WareManage = () => {
@@ -70,7 +70,7 @@ const WareManage = () => {
};
const deleteHandleOk = () => {
- axios
+ adminRequest
.get("http://127.0.0.1:8088/admin/system/ware-manage/deleteRepository", {
params: { id: curWare.repositoryId },
})
@@ -93,7 +93,7 @@ const WareManage = () => {
const handleAddSubmit = (e) => {
e.preventDefault();
const [name, position] = document.forms[0];
- axios
+ adminRequest
.post("http://127.0.0.1:8088/admin/system/ware-manage/addRepository", {
repositoryName: name.value,
repositoryPosition: position.value,
@@ -115,7 +115,7 @@ const WareManage = () => {
const handleEditSubmit = (e) => {
e.preventDefault();
const [name, position] = document.forms[0];
- axios
+ adminRequest
.post(
"http://127.0.0.1:8088/admin/system/ware-manage/updateRepository",
{},
@@ -142,10 +142,10 @@ const WareManage = () => {
};
useEffect(() => {
- axios
+ adminRequest
.get("http://127.0.0.1:8088/admin/system/ware-manage/queryAll")
.then((res) => {
- if (res.data.code === 10000) {
+ if (res.data.success) {
setWareData(res.data.data.repositoryList);
} else {
message.error(res.data.message);
@@ -155,7 +155,7 @@ const WareManage = () => {
}, [repoChange]);
useEffect(() => {
- axios
+ adminRequest
.get("http://127.0.0.1:8088/admin/system/ware-manage/queryAll")
.then((res) => {
if (res.data.code === 10000) {
diff --git a/src/components/WareClerk/GoodsIn.jsx b/src/components/WareClerk/GoodsIn.jsx
index 97bf89d6511323b0e5b417b825c9af93d63dfa22..e2c186872396cb835efbd4cf6eeaa33876151a8f 100644
--- a/src/components/WareClerk/GoodsIn.jsx
+++ b/src/components/WareClerk/GoodsIn.jsx
@@ -1,10 +1,10 @@
import React, { useState, useEffect } from "react";
import { useLocation, useNavigate } from "react-router-dom";
import { Table, Modal, Button, message } from "antd";
-import axios from "axios";
import InputArea from "../InputArea";
import Selector from "../Selector";
+import adminRequest from "../../utils/adminRequest";
const editCSS =
"pl-0 mt-1 w-20 rounded border-2 border-b-blue-200 outline-none focus:ring focus:ring-blue-300 focus:border-white duration-150 ease-in";
@@ -108,7 +108,7 @@ const GoodsIn = () => {
const rightHandleCancel = () => {};
const goodsInSubmit = () => {
- axios
+ adminRequest
.post(
"http://127.0.0.1:8088/admin/ware-clerk/tasks/goods-in/order",
inventoryList
@@ -195,7 +195,7 @@ const GoodsIn = () => {
//所有仓库
useEffect(() => {
- axios
+ adminRequest
.get("http://127.0.0.1:8088/admin/system/ware-manage/queryAll")
.then((res) => {
if (res.data.code === 10000) {
diff --git a/src/components/WareClerk/GoodsOut.jsx b/src/components/WareClerk/GoodsOut.jsx
index d012db7f8f3c54fc424fed575535ecd0f45250c2..9be9ea3ab7948d259c699f7a6c98eeba24e95985 100644
--- a/src/components/WareClerk/GoodsOut.jsx
+++ b/src/components/WareClerk/GoodsOut.jsx
@@ -1,28 +1,32 @@
-import React, { useState } from "react";
-import { useLocation } from "react-router-dom";
+import React, { useState, useEffect } from "react";
+import { useLocation,useNavigate } from "react-router-dom";
import { Table, message } from "antd";
-import axios from "axios";
+import adminRequest from "../../utils/adminRequest";
const GoodsOut = () => {
const location = useLocation();
- // console.log(location.state.record)
+ // console.log(location.state.record);
+ const navigate = useNavigate();
+
const orderId = location.state.record.orderId;
const [orderList, setOrderList] = useState(
- location.state.record.orderdetailsList
+ // location.state.record.orderdetailsList
+ []
);
const goodsOutSubmit = () => {
- axios
+ adminRequest
.post(
"http://127.0.0.1:8088/admin/ware-clerk/tasks/goods-out/order",
{},
- { params: orderId }
+ { params: { order_id: orderId } }
)
.then((res) => {
if (res.data.code === 10000) {
message.success(res.data.message);
//跳转
+ navigate(-1);
} else {
message.error(res.data.message);
}
@@ -33,14 +37,40 @@ const GoodsOut = () => {
});
};
+ useEffect(() => {
+ adminRequest
+ .post(
+ "http://127.0.0.1:8088/admin/ware-clerk/tasks/getposition",
+ {},
+ { params: { order_id: orderId } }
+ )
+ .then((res) => {
+ if (res.data.success) {
+ // console.log(
+ // res.data.data.items.filter(
+ // (item) => item.inventoryRepository !== null
+ // )
+ // );
+ setOrderList(
+ res.data.data.items.filter(
+ (item) => item.inventoryRepository !== null
+ )
+ );
+ } else {
+ message.error(res.data.message);
+ }
+ })
+ .catch((err) => console.log(err));
+ }, []);
+
const goodsColumns = [
{
title: "货品编号",
- dataIndex: "productId",
+ dataIndex: "inventoryProduct",
},
{
title: "货品名称",
- dataIndex: "productName",
+ dataIndex: "inventoryProductName",
},
// {
// title: "货品类型",
@@ -48,15 +78,15 @@ const GoodsOut = () => {
// },
{
title: "出库件数",
- dataIndex: "out",
+ dataIndex: "inventoryNum",
},
{
title: "仓库号",
- dataIndex: "in",
+ dataIndex: "inventoryRepository",
},
{
title: "仓位号",
- dataIndex: "in",
+ dataIndex: "inventoryPosition",
},
];
diff --git a/src/components/WareClerk/Tasks.jsx b/src/components/WareClerk/Tasks.jsx
index 283f65e58ba14a3bc571b2c79b41d8208ce89a32..afaf1948591f3a12ca4f12adf087bafc2a6a90cf 100644
--- a/src/components/WareClerk/Tasks.jsx
+++ b/src/components/WareClerk/Tasks.jsx
@@ -2,10 +2,10 @@ import React, { useState, useEffect } from "react";
import { Link } from "react-router-dom";
import { FiSearch } from "react-icons/fi";
import { Table, message } from "antd";
-import axios from "axios";
import Selector from "../Selector";
import { taskCategories } from "../../utils/data";
+import adminRequest from "../../utils/adminRequest";
const Tasks = () => {
const [cate, setCate] = useState(6);
@@ -24,7 +24,7 @@ const Tasks = () => {
};
useEffect(() => {
- axios
+ adminRequest
.get("http://127.0.0.1:8088/admin/ware-clerk/tasks/tasks")
.then((res) => {
if (res.data.code === 10000) {
diff --git a/src/components/WareClerk/WareChange.jsx b/src/components/WareClerk/WareChange.jsx
index 35f6fe88d7dd5b95052199b4ee14d18a690c982f..4b37bbd8892fa09faecb75a08dc47f76d6c32f34 100644
--- a/src/components/WareClerk/WareChange.jsx
+++ b/src/components/WareClerk/WareChange.jsx
@@ -1,10 +1,10 @@
import React, { useState, useEffect } from "react";
-import axios from "axios";
import { FiSearch } from "react-icons/fi";
import { Modal, Table, Button, message } from "antd";
import InputArea from "../InputArea";
import Selector from "../Selector";
+import adminRequest from "../../utils/adminRequest";
const WareChange = () => {
const [curData, setCurData] = useState(null);
@@ -35,7 +35,7 @@ const WareChange = () => {
const handleOk = () => {
// console.log(curData, repoSelected, posSelected);
setLoading(true);
- axios
+ adminRequest
.post("http://127.0.0.1:8088/ /admin/ware-clerk/ware-change/change", {
...curData,
inventoryRepositoryNew: repoSelected,
@@ -140,7 +140,7 @@ const WareChange = () => {
//所有库存
useEffect(() => {
- axios
+ adminRequest
.get("http://127.0.0.1:8088/admin/ware-manager/stock/findAll")
.then((res) => {
if (res.data.success) {
@@ -158,7 +158,7 @@ const WareChange = () => {
//所有仓库
useEffect(() => {
- axios
+ adminRequest
.get("http://127.0.0.1:8088/admin/system/ware-manage/queryAll")
.then((res) => {
if (res.data.code === 10000) {
diff --git a/src/components/WareManager/Analysis.jsx b/src/components/WareManager/Analysis.jsx
index df775d45e209c052935965f77cf5c20a703998c3..7c91d9156a4092d4bf43b1c7e778aef0a7d339df 100644
--- a/src/components/WareManager/Analysis.jsx
+++ b/src/components/WareManager/Analysis.jsx
@@ -1,15 +1,175 @@
-import React, { useEffect, useRef } from "react";
+import React, { useState, useEffect, useRef } from "react";
+import { Tabs, message } from "antd";
import * as echarts from "echarts";
+import Selector from "../Selector";
+import adminRequest from "../../utils/adminRequest";
+
+const { TabPane } = Tabs;
+
const Analysis = () => {
const inOutRef = useRef(null);
const inOutRefBar = useRef(null);
+ const monthProRef = useRef(null);
+ const weekProRef = useRef(null);
+
+ const [initial, setInitial] = useState(true);
+ const [inOutRate, setInOutRate] = useState(0);
+ const [repoList, setRepoList] = useState([]);
+ const [repoIdList, setRepoIdList] = useState([]);
+ const [repoPosNum, setRepoPosNum] = useState([]);
+ const [repoRateList, setRepoRateList] = useState([]);
+
+ const [monthProfit, setMonthProfit] = useState([]);
+ const [weekProfit, setWeekProfit] = useState([]);
+
+ const [selectedRepo, setSelectedRepo] = useState("");
+ const [curRepoList, setCurRepoList] = useState([]);
+ const [curRepoCategories, setCurRepoCategories] = useState([]);
+
+ const [rateFinished, setRateFinished] = useState(false);
+
+ var temp = [],
+ chartInstance,
+ chartInstanceBar,
+ chartMonth,
+ chartWeek;
+
+ //利用率、周月利润
+ const getRateList = async () => {
+ //算利用率
+ for (let j = 0, len = repoIdList.length; j < len; j++) {
+ let id = repoIdList[j];
+ await adminRequest
+ .get(
+ `http://127.0.0.1:8088/admin/ware-manager/analysis/storage/rate/repository/${id}`
+ )
+ .then((res) => {
+ if (res.status === 200) {
+ temp.push(((res.data / repoPosNum[j]) * 100).toFixed(2));
+ } else {
+ message.error(res.data.message);
+ }
+ })
+ .catch((err) => console.log(err));
+ }
+
+ //月利润
+ await adminRequest
+ .get("http://127.0.0.1:8088/admin/ware-manager/analysis/profit/month")
+ .then((res) => {
+ if (res.data.success) {
+ let tempArr = [];
+ tempArr = res.data.data["month profit"].map((item, index) => {
+ return ([index] = [item["对应月"], item["利润"]]);
+ });
+ setMonthProfit(tempArr);
+ } else {
+ message.error(res.data.message);
+ }
+ })
+ .catch((err) => console.log(err));
+
+ //周利润
+ await adminRequest
+ .get("http://127.0.0.1:8088/admin/ware-manager/analysis/profit/week")
+ .then((res) => {
+ if (res.data.success) {
+ // console.log(res.data.data["week profit"]);
+ let tempArr = [];
+ tempArr = res.data.data["week profit"].map((item, index) => {
+ return ([index] = [item["对应周"], item["利润"]]);
+ });
+ setWeekProfit(tempArr);
+ } else {
+ message.error(res.data.message);
+ }
+ })
+ .catch((err) => console.log(err));
+
+ if (temp !== []) {
+ setRepoRateList([...temp]);
+ setRateFinished((pre) => !pre);
+ }
+ };
useEffect(() => {
- let chartInstance = echarts.init(inOutRef.current);
+ //rate
+ adminRequest
+ .get("http://127.0.0.1:8088/admin/ware-manager/analysis/rate")
+ .then((res) => {
+ if (res.data.success) {
+ // console.log(res.data.data.rate);
+ //rate = 出库比入库
+ setInOutRate(res.data.data.rate);
+ } else {
+ message.error(res.data.message);
+ }
+ })
+ .catch((err) => console.log(err));
+
+ //仓库数据
+ adminRequest
+ .get("http://127.0.0.1:8088/admin/system/ware-manage/queryAll")
+ .then((res) => {
+ if (res.data.success) {
+ setRepoList(res.data.data.repositoryList);
+ setRepoIdList(
+ res.data.data.repositoryList.map((item) => item.repositoryId)
+ );
+ setRepoPosNum(
+ res.data.data.repositoryList.map(
+ (item) => item.positionVOList.length
+ )
+ );
+ } else {
+ message.error(res.data.message);
+ }
+ })
+ .catch((err) => console.log(err));
+
+ //仓库列表
+ adminRequest
+ .get("http://127.0.0.1:8088/admin/system/ware-manage/queryAll")
+ .then((res) => {
+ if (res.data.success) {
+ // console.log(res.data.data.repositoryList);
+ setCurRepoList(res.data.data.repositoryList);
+ setCurRepoCategories(
+ res.data.data.repositoryList.map((item) => ({
+ id: item.repositoryId,
+ name: item.repositoryId,
+ }))
+ );
+ } else {
+ message.error(res.data.message);
+ }
+ })
+ .catch((err) => console.log(err));
+ }, []);
+
+ useEffect(() => {
+ getRateList();
+ }, [repoIdList]);
+
+ //其他两个图表
+ useEffect(() => {
+ if (initial) {
+ setInitial(false);
+ return;
+ }
+ if (
+ chartInstance != null &&
+ chartInstance != "" &&
+ chartInstance != undefined
+ ) {
+ chartInstance.dispose(); //销毁
+ }
+ chartInstance = echarts.init(inOutRef.current);
const option = {
tooltip: {
trigger: "item",
+ formatter: "{c}%",
},
legend: {
top: "5%",
@@ -37,15 +197,23 @@ const Analysis = () => {
show: false,
},
data: [
- { value: 65, name: "入库" },
- { value: 35, name: "出库" },
+ { value: 100 - (inOutRate * 100).toFixed(2), name: "入库" },
+ { value: (inOutRate * 100).toFixed(2), name: "出库" },
],
},
],
};
chartInstance.setOption(option);
- let chartInstanceBar = echarts.init(inOutRefBar.current);
+ //仓库使用率
+ if (
+ chartInstanceBar != null &&
+ chartInstanceBar != "" &&
+ chartInstanceBar != undefined
+ ) {
+ chartInstanceBar.dispose(); //销毁
+ }
+ chartInstanceBar = echarts.init(inOutRefBar.current);
const optionBar = {
tooltip: {
trigger: "axis",
@@ -61,11 +229,8 @@ const Analysis = () => {
},
grid: {
top: "15%",
-
left: "15%",
-
right: "10%",
-
bottom: "10%",
},
xAxis: {
@@ -76,7 +241,7 @@ const Analysis = () => {
show: false, //不显示坐标轴线
},
type: "category",
- data: ["01", "02", "03", "04", "05", "06", "07", "08"],
+ data: repoIdList,
},
yAxis: {
type: "value",
@@ -91,40 +256,118 @@ const Analysis = () => {
color: ["#5459BC"],
series: [
{
- data: [26, 20, 16, 42, 90, 40, 65, 50],
+ //比例
+ data: repoRateList,
type: "bar",
barWidth: 20,
itemStyle: {
emphasis: {
- barBorderRadius: 6,
+ borderRadius: 6,
},
normal: {
- barBorderRadius: 6,
+ borderRadius: 6,
},
},
},
],
};
chartInstanceBar.setOption(optionBar);
- }, []);
+
+ //月利润
+ if (chartMonth != null && chartMonth != "" && chartMonth != undefined) {
+ chartMonth.dispose(); //销毁
+ }
+ chartMonth = echarts.init(monthProRef.current);
+ const optionMonth = {
+ xAxis: {
+ type: "category",
+ name: "月份",
+ },
+ yAxis: {
+ type: "value",
+ name: "利润(元)",
+ },
+ series: [
+ {
+ data: monthProfit,
+ type: "line",
+ encode: {
+ x: "月份",
+ y: "利润",
+ },
+ label: {
+ show: true,
+ position: "bottom",
+ },
+ },
+ ],
+ };
+ chartMonth.setOption(optionMonth);
+ }, [rateFinished]);
+
+ //周利润
+ const onChangeTab = (key) => {
+ if (key === "2") {
+ setTimeout(() => {
+ if (chartWeek != null && chartWeek != "" && chartWeek != undefined) {
+ chartWeek.dispose(); //销毁
+ }
+ chartWeek = echarts.init(weekProRef.current);
+ console.log(weekProfit);
+ const optionWeek = {
+ xAxis: {
+ type: "category",
+ name: "周数",
+ },
+ yAxis: {
+ type: "value",
+ name: "利润(元)",
+ },
+ series: [
+ {
+ data: weekProfit,
+ type: "line",
+ encode: {
+ x: "周数",
+ y: "利润",
+ },
+ label: {
+ show: true,
+ position: "bottom",
+ },
+ },
+ ],
+ };
+ chartWeek.setOption(optionWeek);
+ }, 20);
+ }
+ };
return (
-
-
盈利报表
-
-
13:00~14:00
- {/*
*/}
+
+ 盈利报表
+
+
@@ -139,8 +382,38 @@ const Analysis = () => {
仓位使用情况
-
13:00~14:00
- {/*
*/}
+
+ {
+ setSelectedRepo(+e.target.value);
+ }}
+ className={
+ "w-20 pt-1 outline-none border-gray-300 border-2 rounded-lg font-medium"
+ }
+ categories={curRepoCategories}
+ />
+ 选择仓库
+
+
+ {selectedRepo !== "" && (
+ <>
+ {curRepoList
+ .filter((item) => item.repositoryId === selectedRepo)[0]
+ .positionVOList.map((item) => (
+
+ {/* {item.positionNum} */}
+
+ ))}
+ >
+ )}
+
diff --git a/src/components/WareManager/Stock.jsx b/src/components/WareManager/Stock.jsx
index d22c7a97b92f067994255acf55a66e709eeaf7dd..46e92caefcace8d6786bfb54aa065da7ba16ae85 100644
--- a/src/components/WareManager/Stock.jsx
+++ b/src/components/WareManager/Stock.jsx
@@ -1,18 +1,13 @@
import React, { useState, useEffect } from "react";
-import axios from "axios";
import { FiSearch } from "react-icons/fi";
import { Table, DatePicker, Space, ConfigProvider, message } from "antd";
import locale from "antd/lib/locale/zh_CN";
import Selector from "../Selector";
import InputArea from "../InputArea";
+import adminRequest from "../../utils/adminRequest";
const Stock = () => {
-
- const onChange = (date, dateString) => {
- setTime(dateString);
- };
-
const [cate, setCate] = useState(-1); //-1是全部仓库
const [time, setTime] = useState(null);
const [info, setInfo] = useState(null);
@@ -20,8 +15,12 @@ const Stock = () => {
const [searchRes, setSearchRes] = useState([]);
const [dataSource, setDataSource] = useState([]);
+ const onChange = (date, dateString) => {
+ setTime(dateString);
+ };
+
useEffect(() => {
- axios
+ adminRequest
.get("http://127.0.0.1:8088/admin/ware-manager/stock/findAll")
.then((res) => {
if (res.data.success) {
diff --git a/src/components/WareManager/WareQuery.jsx b/src/components/WareManager/WareQuery.jsx
index 6487c06ea6f809caab24a64e8a1ad0357f0f6aa3..fff8bfffa1d7830386cfee921ab8a6def8f8371e 100644
--- a/src/components/WareManager/WareQuery.jsx
+++ b/src/components/WareManager/WareQuery.jsx
@@ -1,18 +1,18 @@
import React, { useState, useEffect } from "react";
-import { Tabs, Table, DatePicker, Space, ConfigProvider } from "antd";
+import { Tabs, Table, DatePicker, Space, ConfigProvider, message } from "antd";
import { FiSearch } from "react-icons/fi";
import locale from "antd/lib/locale/zh_CN";
-import axios from "axios";
import moment from "moment";
import Selector from "../Selector";
-import { taskCategories } from "../../utils/data";
+import { flowCategories } from "../../utils/data";
+import adminRequest from "../../utils/adminRequest";
const { TabPane } = Tabs;
// 流水查询
const WareQuery = () => {
- const [cate, setCate] = useState(6);
+ const [cate, setCate] = useState(3); //全部
const [inTime, setInTime] = useState(null);
const [outTime, setOutTime] = useState(null);
const [inTime2, setInTime2] = useState(null);
@@ -33,136 +33,196 @@ const WareQuery = () => {
if (+cate === 3) {
setInOutSearchRes(inOutWare);
} else {
- setInOutSearchRes(inOutWare.filter((item) => item.type == cate));
+ setInOutSearchRes(inOutWare.filter((item) => item.recordsType == cate));
}
} else {
if (+cate === 3) {
- if (!inTime) {
+ if (!inTime && outTime) {
setInOutSearchRes(
- inOutWare.filter((item) => item.out.split(" ")[0] == outTime)
+ inOutWare.filter((item) =>
+ item.outputTime
+ ? item.outputTime.split("T")[0]
+ : item.outputTime == outTime
+ )
);
- } else if (!outTime) {
+ } else if (!outTime && inTime) {
setInOutSearchRes(
- inOutWare.filter((item) => item.in.split(" ")[0] == inTime)
+ inOutWare.filter((item) =>
+ item.importTime
+ ? item.importTime.split("T")[0]
+ : item.importTime == inTime
+ )
);
} else {
setInOutSearchRes(
- inOutWare.filter(
- (item) =>
- item.in.split(" ")[0] == inTime &&
- item.out.split(" ")[0] == outTime
+ inOutWare.filter((item) =>
+ item.importTime.split("T")[0] == inTime && item.outputTime
+ ? item.outputTime.split("T")[0]
+ : item.outputTime == outTime
)
);
}
} else {
if (!inTime) {
setInOutSearchRes(
- inOutWare.filter(
- (item) => item.type == cate && item.out.split(" ")[0] == outTime
+ inOutWare.filter((item) =>
+ item.recordsType == cate && item.outputTime
+ ? item.outputTime.split("T")[0]
+ : item.outputTime == outTime
)
);
} else if (!outTime) {
setInOutSearchRes(
- inOutWare.filter(
- (item) => item.type == cate && item.in.split(" ")[0] == inTime
+ inOutWare.filter((item) =>
+ item.recordsType == cate && item.importTime
+ ? item.importTime.split("T")[0]
+ : item.importTime == inTime
)
);
} else {
setInOutSearchRes(
- inOutWare.filter(
- (item) =>
- item.type == cate &&
- item.in.split(" ")[0] == inTime &&
- item.out.split(" ")[0] == outTime
+ inOutWare.filter((item) =>
+ item.recordsType == cate && item.importTime
+ ? item.importTime.split("T")[0]
+ : item.importTime == inTime && item.outputTime
+ ? item.outputTime.split("T")[0]
+ : item.outputTime == outTime
)
);
}
}
}
- // console.log(cate, inTime, outTime);
};
const changeWareSubmitHandler = (e) => {
e.preventDefault();
if (!inTime2 && !outTime2) {
setChangeWareSearchRes(changeWare);
- } else if (!inTime2) {
- setChangeWareSearchRes(changeWare.filter((item) => item.out == outTime2));
+ } else if (!inTime2 && outTime2) {
+ setChangeWareSearchRes(
+ changeWare.filter((item) =>
+ item.outputTime
+ ? item.outputTime.split("T")[0]
+ : item.outputTime == outTime2
+ )
+ );
+ } else if (inTime2 && !outTime2) {
+ setChangeWareSearchRes(
+ changeWare.filter((item) =>
+ item.importTime
+ ? item.importTime.split("T")[0]
+ : item.importTime == inTime2
+ )
+ );
} else {
- setChangeWareSearchRes(changeWare.filter((item) => item.in == inTime2));
+ setChangeWareSearchRes(
+ changeWare.filter(
+ (item) =>
+ (item.importTime
+ ? item.importTime.split("T")[0]
+ : item.importTime == inTime2) &&
+ (item.outputTime
+ ? item.outputTime.split("T")[0]
+ : item.outputTime == outTime2)
+ )
+ );
}
- // console.log(inTime2, outTime2);
};
useEffect(() => {
- axios.get("/admin/ware-manager/query").then((res) => {
- setInOutWare(res.data.result.list);
- // setInOutWare(res.data.result.list.filter(item=>item.type===0||item.type===2))
- setInOutSearchRes(res.data.result.list);
- });
+ adminRequest
+ .get("http://127.0.0.1:8088/admin/manager/queryAll")
+ .then((res) => {
+ console.log(res);
+ if (res.data.success) {
+ // console.log(res.data.data.items);
+ setInOutWare(
+ res.data.data.items.filter((item) => item.recordsType !== null)
+ );
+ setInOutSearchRes(
+ res.data.data.items.filter((item) => item.recordsType !== null)
+ );
+ } else {
+ message.error(res.data.message);
+ }
+ })
+ .catch((err) => console.log(err));
+
+ adminRequest
+ .get("http://127.0.0.1:8088/admin/ware-manager/query/movement/repository")
+ .then((res) => {
+ if (res.data.success) {
+ // console.log(res.data.data.move);
+ setChangeWare(res.data.data.move);
+ setChangeWareSearchRes(res.data.data.move);
+ } else {
+ message.error(res.data.message);
+ }
+ })
+ .catch((err) => console.log(err));
}, []);
const columns = [
{
title: "类型",
- dataIndex: "type",
+ dataIndex: "recordsType",
render: (record) =>
record === 0 ?
,
},
{
title: "仓库号",
- dataIndex: "repository",
+ dataIndex: "latRepository",
},
{
title: "仓位号",
- dataIndex: "position",
+ dataIndex: "latPosition",
},
{
title: "货品名称",
- dataIndex: "name",
+ dataIndex: "productName",
},
{
title: "入库时间",
- dataIndex: "time",
- render: (record) => record.split(" ")[0],
+ dataIndex: "importTime",
+ render: (record) => (record ? record.split("T")[0] : record),
},
{
title: "出库时间",
- dataIndex: "time",
- render: (record) => record.split(" ")[0],
+ dataIndex: "outputTime",
+ render: (record) => (record ? record.split("T")[0] : record),
},
];
const column = [
{
title: "货品编号",
- dataIndex: "product",
+ dataIndex: "productId",
},
{
title: "原仓库号",
- dataIndex: "repository",
+ dataIndex: "preRepository",
},
{
title: "原仓位号",
- dataIndex: "position",
+ dataIndex: "prePosition",
},
{
- title: "仓库号",
- dataIndex: "repository",
+ title: "现仓库号",
+ dataIndex: "latRepository",
},
{
- title: "仓位号",
- dataIndex: "position",
+ title: "现仓位号",
+ dataIndex: "latPosition",
},
{
title: "入库时间",
- dataIndex: "time",
- render: (record) => record.split(" ")[0],
+ dataIndex: "importTime",
+ render: (record) => (record ? record.split("T")[0] : record),
},
{
title: "出库时间",
- dataIndex: "time",
- render: (record) => record.split(" ")[0],
+ dataIndex: "outputTime",
+ render: (record) => (record ? record.split("T")[0] : record),
},
];
@@ -179,7 +239,7 @@ const WareQuery = () => {