diff --git a/src/pages/pms/partPlan/PlanManage/subpages/Apply/index.tsx b/src/pages/pms/partPlan/PlanManage/subpages/Apply/index.tsx
index 96bc315..63b1b9a 100644
--- a/src/pages/pms/partPlan/PlanManage/subpages/Apply/index.tsx
+++ b/src/pages/pms/partPlan/PlanManage/subpages/Apply/index.tsx
@@ -171,7 +171,7 @@ export default function Index() {
}));
const type = isSave ? 1 : 2;
apiObj[type]({
- planId: planId?.planId,
+ planId: Number(planId?.planId),
...dfParams,
suppliers
// suppliers: suppliers.map(i => ({
@@ -333,20 +333,14 @@ export default function Index() {
/>
-
history.goBack()}
- okText="确定"
- cancelText="取消"
+
+ 取消
+
{
export function deleteApi(params: {poolId: number}) {
return request.post(`${PMS_HOST}/erp/plan/pool/delete/plan`, {...params});
}
+
export function editApi(params: { poolId?: number, partCnt?: number}) {
return request.post(`${PMS_HOST}/erp/plan/pool/update/plan`, {...params});
}
+
+export function outFlowApi(params: { poolIds?: any, planId?: number, current?: number, pageSize?:number}):http.PromisePageResp {
+ return request.get(`${PMS_HOST}/erp/storage/out/list`, {params});
+}
+
+export function custBuyApi(params: { planWaitListIds?: any}):http.PromiseResp {
+ return request.get(`${PMS_HOST}/erp/cus/buy/part/get/buy/part/list`, {params});
+}
diff --git a/src/pages/pms/partPlan/PlanPool/components/AreaTable.tsx b/src/pages/pms/partPlan/PlanPool/components/AreaTable.tsx
index 222f332..1554655 100644
--- a/src/pages/pms/partPlan/PlanPool/components/AreaTable.tsx
+++ b/src/pages/pms/partPlan/PlanPool/components/AreaTable.tsx
@@ -14,7 +14,7 @@ interface Props {
id?: number, // 上一个列表ID
}
export default function Index(props: Props = {}) {
- const { dfParams, key } = useStore();
+ const { dfParams, key, setItem, setOutVisible, setCustVisible } = useStore();
const {showAnalyse=true} = props;
const { data: parts, setParams, loading } = useInitial(getList, [], {...dfParams, ...props});
const [visible, setVisible] = useState(false);
@@ -23,7 +23,6 @@ export default function Index(props: Props = {}) {
const [id, setId] = useState();
useEffect(() => {
- console.log('dfParams11', dfParams, key, props);
if (key == props.type) {
setParams(dfParams, true);
}
@@ -37,13 +36,13 @@ export default function Index(props: Props = {}) {
(t || 0).toFixed(2)} />
(t || 0).toFixed(2)} />
-
+ { setCustVisible(true); setItem(r); }}>{r.buyCnt}} />
-
+ { setOutVisible(true); setItem(r); }}>{r.outStockCnt}} />
{showAnalyse && (
<>
{
+ if (custVisible && item?.planWaitListIds) {
+ setParams({ planWaitListIds: item.planWaitListIds }, true);
+ setDelay(false);
+ }
+ }, [custVisible]);
+
+ return (
+ setCustVisible(false)}
+ footer={[
+ setCustVisible(false)}>取消
+ ]}
+ >
+ `${v.waitListIds}`}
+ dataSource={data}
+ pagination={false}
+ loading={loading}
+ scroll={{x: 1400, y: 500}}
+ >
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ );
+}
\ No newline at end of file
diff --git a/src/pages/pms/partPlan/PlanPool/components/OutFlowModal.tsx b/src/pages/pms/partPlan/PlanPool/components/OutFlowModal.tsx
new file mode 100644
index 0000000..649cd21
--- /dev/null
+++ b/src/pages/pms/partPlan/PlanPool/components/OutFlowModal.tsx
@@ -0,0 +1,47 @@
+import React, { useEffect, useState } from 'react';
+import {Button, Modal, Table} from 'antd';
+import {useStore} from '../index';
+import { outFlowApi, OutItem } from '../api';
+import usePagination from '@/hooks/usePagination';
+
+const {Column} = Table;
+
+export default function Index() {
+ const {outVisible, setOutVisible, item} = useStore();
+ const [delay, setDelay]= useState(true);
+ const { list, setParams, loading, paginationConfig } = usePagination(outFlowApi, [], {delay});
+
+ useEffect(() => {
+ if (outVisible && item?.poolIds) {
+ setParams({poolIds: item.poolIds}, true);
+ setDelay(false);
+ }
+ }, [outVisible]);
+
+ return (
+ setOutVisible(false)}
+ footer={[
+ setOutVisible(false)}>取消
+ ]}
+ >
+ `${v.partId}`}
+ >
+
+
+
+
+
+
+
+
+ );
+}
\ No newline at end of file
diff --git a/src/pages/pms/partPlan/PlanPool/components/PartTable.tsx b/src/pages/pms/partPlan/PlanPool/components/PartTable.tsx
index 2df6c66..ebc7c82 100644
--- a/src/pages/pms/partPlan/PlanPool/components/PartTable.tsx
+++ b/src/pages/pms/partPlan/PlanPool/components/PartTable.tsx
@@ -16,7 +16,7 @@ interface Props {
id?: number, // 上一个列表ID
}
export default function Index(props: Props = {}) {
- const { dfParams, key } = useStore();
+ const { dfParams, key, setItem, setOutVisible, setCustVisible } = useStore();
const {showAnalyse=true} = props;
const { data: parts, setParams, loading } = useInitial(getList, [], {...dfParams, ...props});
const [visible, setVisible] = useState(false);
@@ -43,13 +43,13 @@ export default function Index(props: Props = {}) {
(t || 0).toFixed(2)} />
-
+ { setCustVisible(true); setItem(r); }}>{r.buyCnt}} />
-
+ { setOutVisible(true); setItem(r); }}>{r.outStockCnt}} />
{showAnalyse && (
<>
(t || 0).toFixed(2)} />
-
+ { setCustVisible(true); setItem(r); }}>{r.buyCnt}} />
-
+ { setOutVisible(true); setItem(r); }}>{r.outStockCnt}} />
{showAnalyse && (
<>
();
+ const [itemPrice, setItemPrice] = useState();
useEffect(() => {
if (key == props.type) {
@@ -25,8 +25,8 @@ export default function Index(props: Props = {}) {
}, [dfParams, key]);
useEffect(() => {
- if (visible && item?.poolId) {
- form.setFieldsValue({cnt: item.cnt});
+ if (visible && itemPrice?.poolId) {
+ form.setFieldsValue({ cnt: itemPrice.cnt});
} else {
form.resetFields;
}
@@ -43,7 +43,7 @@ export default function Index(props: Props = {}) {
fixed="left"
render={r => (
<>
- { setVisible(true); setItem(r); }}>编辑
+ { setVisible(true); setItemPrice(r); }}>编辑
(t || 0).toFixed(2)} />
-
+ { setCustVisible(true); setItem(r); }}>{r.buyCnt}} />
-
+ { setOutVisible(true); setItem(r); }}>{r.outStockCnt}} />
{
form.validateFields().then(fields => {
- editApi({poolId: item?.poolId, partCnt: fields.cnt}).then(res => {
+ editApi({ poolId: itemPrice?.poolId, partCnt: fields.cnt}).then(res => {
setVisible(false);
message.success("操作成功");
setParams({}, true);
diff --git a/src/pages/pms/partPlan/PlanPool/components/StorageTable.tsx b/src/pages/pms/partPlan/PlanPool/components/StorageTable.tsx
index 57acfba..c43dbe2 100644
--- a/src/pages/pms/partPlan/PlanPool/components/StorageTable.tsx
+++ b/src/pages/pms/partPlan/PlanPool/components/StorageTable.tsx
@@ -14,7 +14,7 @@ interface Props {
id?: number, // 上一个列表ID
}
export default function Index(props: Props = {}) {
- const { dfParams, key } = useStore();
+ const { dfParams, key, setItem, setOutVisible, setCustVisible } = useStore();
const {showAnalyse=true} = props;
const { data: parts, setParams, loading } = useInitial(getList, [], {...dfParams, ...props});
const [visible, setVisible] = useState(false);
@@ -37,12 +37,12 @@ export default function Index(props: Props = {}) {
(t || 0).toFixed(2)} />
-
+ { setCustVisible(true); setItem(r); }}>{r.buyCnt}} />
-
+ { setOutVisible(true); setItem(r); }}>{r.outStockCnt}} />
{showAnalyse && (
<>
+
+
diff --git a/src/pages/pms/partPlan/PlanPool/useStore.ts b/src/pages/pms/partPlan/PlanPool/useStore.ts
index cdce14f..3acfe99 100644
--- a/src/pages/pms/partPlan/PlanPool/useStore.ts
+++ b/src/pages/pms/partPlan/PlanPool/useStore.ts
@@ -1,17 +1,27 @@
import { useState } from 'react';
import useInitail from "@/hooks/useInitail";
import { getPartTypeApi } from '@/pages/pms/part/Repertory/api';
+import {ListVO} from './api';
export default function useStore() {
const [dfParams, setDfParams] = useState({});
const [key, setKey] = useState('1');
const { data: partTypeData } = useInitail(getPartTypeApi, [], {});
+ const [outVisible, setOutVisible] = useState(false);
+ const [custVisible, setCustVisible] = useState(false);
+ const [item, setItem] = useState();
return {
dfParams,
setDfParams,
key,
setKey,
- partTypeData
+ partTypeData,
+ outVisible,
+ setOutVisible,
+ item,
+ setItem,
+ custVisible,
+ setCustVisible,
};
}