From 57b51c35fe5be4c8201bb4fc5153c6b9d34dfd07 Mon Sep 17 00:00:00 2001 From: jiangwei Date: Fri, 10 Mar 2023 16:29:51 +0800 Subject: [PATCH] 配件计划池增加查看90天出库详情和客户订件详情功能 --- src/pages/pms/partPlan/PlanManage/subpages/Apply/index.tsx | 22 ++++++++-------------- src/pages/pms/partPlan/PlanPool/api.ts | 66 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++- src/pages/pms/partPlan/PlanPool/components/AreaTable.tsx | 7 +++---- src/pages/pms/partPlan/PlanPool/components/CustBuyModal.tsx | 55 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ src/pages/pms/partPlan/PlanPool/components/OutFlowModal.tsx | 47 +++++++++++++++++++++++++++++++++++++++++++++++ src/pages/pms/partPlan/PlanPool/components/PartTable.tsx | 6 +++--- src/pages/pms/partPlan/PlanPool/components/SeriesTable.tsx | 6 +++--- src/pages/pms/partPlan/PlanPool/components/StoragePartTable.tsx | 16 ++++++++-------- src/pages/pms/partPlan/PlanPool/components/StorageTable.tsx | 6 +++--- src/pages/pms/partPlan/PlanPool/index.tsx | 4 ++++ src/pages/pms/partPlan/PlanPool/useStore.ts | 12 +++++++++++- 11 files changed, 210 insertions(+), 37 deletions(-) create mode 100644 src/pages/pms/partPlan/PlanPool/components/CustBuyModal.tsx create mode 100644 src/pages/pms/partPlan/PlanPool/components/OutFlowModal.tsx 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="取消" + - + 取消 + + ]} + > + `${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={[ + + ]} + > + `${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, }; } -- libgit2 0.22.2