diff --git a/src/pages/pms/partPlan/CustBuyPlan/subpages/First/components/PartModal.tsx b/src/pages/pms/partPlan/CustBuyPlan/subpages/First/components/PartModal.tsx index 83c132a..fccaa62 100644 --- a/src/pages/pms/partPlan/CustBuyPlan/subpages/First/components/PartModal.tsx +++ b/src/pages/pms/partPlan/CustBuyPlan/subpages/First/components/PartModal.tsx @@ -73,7 +73,7 @@ export default function DetailModal() { align="center" render={r => ( <> - deletePart(r)} okText="确定" @@ -81,7 +81,7 @@ export default function DetailModal() { > 删除 - + */} onFinish(r)}>完成 )} diff --git a/src/pages/pms/partPlan/PlanManage/subpages/Apply/index.tsx b/src/pages/pms/partPlan/PlanManage/subpages/Apply/index.tsx index 63b1b9a..b9c7dc8 100644 --- a/src/pages/pms/partPlan/PlanManage/subpages/Apply/index.tsx +++ b/src/pages/pms/partPlan/PlanManage/subpages/Apply/index.tsx @@ -1,4 +1,4 @@ -import {Card, ConfigProvider, Select, Button, message, Popconfirm} from 'antd'; +import {Card, ConfigProvider, Select, Button, message, Popconfirm, Input} from 'antd'; import { PageHeaderWrapper } from '@ant-design/pro-layout'; import React, {useEffect, useState} from "react"; import DealerModal from './components/DealerModal'; @@ -15,7 +15,8 @@ import PartModal from "@/pages/pms/partPlan/PlanManage/subpages/Apply/components import {groupBys, flattenDeep} from '@/pages/pms/entity'; import {PartDetail} from '../../api'; import { history } from 'umi'; -import { getDetail, DetailVO, Params as detailParams } from '../Detail/api'; +import { getDetail, Params as detailParams, Item } from '../Detail/api'; +import ImageUpload from '@/pages/decoration/deco/DeoGoodsManagement/components/ImageUpload'; const { Option } = Select; const apiObj: { [key: number]: any } = { @@ -25,7 +26,7 @@ const apiObj: { [key: number]: any } = { export default function Index() { const planId = history.location.query; const [detaildelay, setDetaildelay] = useState(true); - const { data, setParams: detailsetParams } = useInitial(getDetail, [], { ...planId }, detaildelay); + const { data, setParams: detailsetParams } = useInitial(getDetail, {}, { ...planId }, detaildelay); const [delay, setDelay] = useState(true); const [loading, setLoading] = useState(false); const { data: brands } = useInitial(API.getBrandFilterApi, [], {}); @@ -39,6 +40,8 @@ export default function Index() { const [visiblePartDetail, setVisiblePartDetail] = useState(false); const partList = flattenDeep(dealerList.map(it => (it.suppliers || []).map((su: any) => (su.storages || []).map((st: any) => (st.parts || []))))); const poolIds = partList.map((it: any) => it.poolId); + const [imageVisible, setImageVisible] = useState(true); + const [info, setInfo] = useState<{ remark?: string, fids?: any }>(); useEffect(() => { if (planId?.planId) { @@ -48,14 +51,16 @@ export default function Index() { }, []); useEffect(() => { - if (data.length) { - setDfParams({brandId: data[0].brandId}); + if (data.list?.length) { + setImageVisible(false); + setDfParams({brandId: data.list[0].brandId}); setParams({}, true); setDelay(false); - setDealerList(data); + setDealerList(data.list); + setInfo({ remark: data.remark, fids: data.fids?.split(',').map(i => `/api/file/show?fid=${i}`) }); } - }, [data.length]); - + }, [data.list?.length]); + console.log(info, 'info'); function onOk(parts: ListVO[] = []) { setDealerList(dealerList.map(it => { if (it.settleDealerId == dealer.settleDealerId) { @@ -173,7 +178,15 @@ export default function Index() { apiObj[type]({ planId: Number(planId?.planId), ...dfParams, - suppliers + suppliers, + remark: info?.remark, + fids: info?.fids.map((i: any) => { + if (typeof i == 'object') { + return i.url.split('=')[1]; + } else { + return i; + } + }).join() // suppliers: suppliers.map(i => ({ // settleDealerId: i.settleDealerId, // settleDealerName: i.settleDealerName, @@ -332,12 +345,29 @@ export default function Index() { deletePart={deletePart} /> +
+ 备注: + setInfo({...info, remark: e.target.value})} /> +
+
+ 附件: + { + const ids = v.fileList.map(it => it?.response?.data || it); + setInfo({ ...info, fids: ids }); + console.log(ids); + }} + /> +
diff --git a/src/pages/pms/partPlan/PlanManage/subpages/Detail/api.ts b/src/pages/pms/partPlan/PlanManage/subpages/Detail/api.ts index 9326739..d200ce5 100644 --- a/src/pages/pms/partPlan/PlanManage/subpages/Detail/api.ts +++ b/src/pages/pms/partPlan/PlanManage/subpages/Detail/api.ts @@ -48,9 +48,55 @@ export interface Params { planNo?: string; no?: string; } +export interface Item { + /** + * 计划单号 + */ + planNo?: string; + /** + * 品牌ID + */ + brandId?: number; + /** + * 计划日期 + */ + planDate?: string; + /** + * 审核单号 + */ + approvalOrderNo?: string; + /** + * 计划人员 + */ + userName?: string; + /** + * 库销比 + */ + ratio?: number; + /** + * 计划库销比 + */ + planRatio?: number; + /** + * 计划状态 1:待审核2:已通过9:已拒绝 + */ + status?: string; + /** + * 备注 + */ + remark?: string; + /** + * 附件 + */ + fids?: string; + /** + * 计划列表 + */ + list?: DetailVO[]; +} /** * 查询明细 */ -export function getDetail(params?: Params): http.PromiseResp { +export function getDetail(params?: Params): http.PromiseResp { return request.get(`${PMS_HOST}/erp/part/plan/get/plan/group/detail`, { params }); } diff --git a/src/pages/pms/partPlan/PlanManage/subpages/Detail/index.tsx b/src/pages/pms/partPlan/PlanManage/subpages/Detail/index.tsx index 9ee1395..9aafa6d 100644 --- a/src/pages/pms/partPlan/PlanManage/subpages/Detail/index.tsx +++ b/src/pages/pms/partPlan/PlanManage/subpages/Detail/index.tsx @@ -1,8 +1,8 @@ -import {Card, ConfigProvider, Spin} from 'antd'; +import { Card, ConfigProvider, Spin, Upload } from 'antd'; import { PageHeaderWrapper } from '@ant-design/pro-layout'; import React, {useState} from "react"; import useInitial from "@/hooks/useInitail"; -import {getDetail, DetailVO, Params, SupplierVO, StorageVO, PartVO} from "./api"; +import { getDetail, Item, Params, SupplierVO, StorageVO, PartVO, DetailVO } from "./api"; import zhCN from "antd/lib/locale-provider/zh_CN"; import st from "@/pages/pms/partPlan/PlanManage/style.less"; import StepBnt from "@/pages/pms/comonents/StepBnt"; @@ -14,7 +14,7 @@ import PartDetailModal from './components/PartDetailModal'; export default function Index({ match }: common.ConnectProps) { const { planId } = match.params; - const { data, loading } = useInitial(getDetail, [], {planId}); + const { data, loading } = useInitial(getDetail, {}, {planId}); const [visiblePart, setVisiblePart] = useState(false); const [parts, setParts] = useState([]); @@ -23,7 +23,7 @@ export default function Index({ match }: common.ConnectProps) { - {data.map((dealer: DetailVO = {}) => ( + {data.list?.map((dealer: DetailVO = {}) => (
{`商家: ${dealer.settleDealerName || ''}`}
{(dealer.suppliers || []).map((supplier: SupplierVO = {}) => { @@ -57,6 +57,26 @@ export default function Index({ match }: common.ConnectProps) { })}
))} +
+ 备注:{data.remark} +
+
+ 附件: +
+ {data.fids?.split(',').map(i => ( + + ))} +
+
setVisiblePart(false)} parts={parts} /> { +export function outFlowApi(params: { poolIds?: any, planId?: number}):http.PromiseResp { return request.get(`${PMS_HOST}/erp/storage/out/list`, {params}); } +export function outFlowDetailApi(params:any):http.PromiseResp { + return request.get(`${PMS_HOST}/erp/storage/out/detail`, {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 b209a83..a0d3f71 100644 --- a/src/pages/pms/partPlan/PlanPool/components/AreaTable.tsx +++ b/src/pages/pms/partPlan/PlanPool/components/AreaTable.tsx @@ -4,6 +4,7 @@ import useInitial from "@/hooks/useInitail"; import {getList, ListVO} from "@/pages/pms/partPlan/PlanPool/api"; import DetailModal from './DetailModal'; import {useStore} from "@/pages/pms/partPlan/PlanPool"; +import _ from 'lodash'; const { Column } = Table; interface Props { @@ -33,8 +34,8 @@ export default function Index(props: Props = {}) { `${v.id}`} scroll={{y: 500, x: 2500}} dataSource={parts || []} pagination={false} loading={loading}> - (t || 0).toFixed(2)} /> - (t || 0).toFixed(2)} /> + (t ? t.toFixed(2) : "--")} /> + (t ? t.toFixed(2) : "--")} /> (r.buyCnt ? { setCustVisible(true); setItem(r); }}>{r.buyCnt} : r.buyCnt)} /> @@ -42,7 +43,7 @@ export default function Index(props: Props = {}) { - (r.outStockCnt ? { setOutVisible(true); setItem(r); }}>{r.outStockCnt} : r.outStockCnt)} /> + (r.outStockCnt ? { setOutVisible(true); setItem(r); }}>{_.floor(r.outStockCnt/3)} : r.outStockCnt)} /> {showAnalyse && ( <> { + if (visible && item?.poolIds) { + setParams({ min: undefined, max: undefined, date: undefined, outCnt: undefined, ...item }, true); + setDelay(false); + } else { + setVisible(); + } + }, [visible]); + + return ( + setVisible()} + footer={[ + + ]} + > +
`${v.partId}`} + pagination={false} + scroll={{ y: 400 }} + > + + + + + + moment(r.outTime).format('YYYY-MM-DD HH:mm:ss')} /> +
+ + ); +} \ 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 index 649cd21..71cb42d 100644 --- a/src/pages/pms/partPlan/PlanPool/components/OutFlowModal.tsx +++ b/src/pages/pms/partPlan/PlanPool/components/OutFlowModal.tsx @@ -1,15 +1,17 @@ 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'; +import { outFlowApi, outListVO } from '../api'; +import useInitial from '@/hooks/useInitail'; +import OutFlowDetailModal from './OutFlowDetailModal'; 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}); + const { data, setParams, loading } = useInitial(outFlowApi, [], {}, delay); + const [current, setCurrent] = useState<{visible?: boolean, itemData?: any}>(); useEffect(() => { if (outVisible && item?.poolIds) { @@ -17,6 +19,11 @@ export default function Index() { setDelay(false); } }, [outVisible]); + const total = data + .map(i => i.outCnt) + .reduce((prev, cur) => { + return (prev || 0) + (cur || 0); + }, 0); return ( setOutVisible(false)}>取消 ]} > +
+ 滚动90天出库数: + setCurrent({ visible: true, itemData: { poolIds: item?.poolIds } })} + > + {total} + +
`${v.partId}`} + rowKey={(v: outListVO) => `${v.date}`} + pagination={false} + scroll={{y: 400}} > - - - - - - + + setCurrent({ visible: true, itemData: { ...r, poolIds: item?.poolIds }})}>{r.outCnt}} />
+ setCurrent({visible: false, itemData: undefined})} item={current?.itemData} />
); } \ 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 45e1f58..fb10c31 100644 --- a/src/pages/pms/partPlan/PlanPool/components/PartTable.tsx +++ b/src/pages/pms/partPlan/PlanPool/components/PartTable.tsx @@ -4,6 +4,7 @@ import useInitial from "@/hooks/useInitail"; import {getList, ListVO} from "@/pages/pms/partPlan/PlanPool/api"; import DetailModal from './DetailModal'; import {useStore} from "@/pages/pms/partPlan/PlanPool"; +import _ from 'lodash'; const { Column } = Table; interface Props { @@ -39,8 +40,8 @@ export default function Index(props: Props = {}) { - (t || 0).toFixed(2)} /> - (t || 0).toFixed(2)} /> + (t ? t.toFixed(2) : "--")} /> + (t ? t.toFixed(2) : "--")} /> (r.buyCnt ? { setCustVisible(true); setItem(r); }}>{r.buyCnt} : r.buyCnt)} /> @@ -49,7 +50,7 @@ export default function Index(props: Props = {}) { - (r.outStockCnt ? { setOutVisible(true); setItem(r); }}>{r.outStockCnt} : r.outStockCnt)} /> + (r.outStockCnt ? { setOutVisible(true); setItem(r); }}>{_.floor(r.outStockCnt/3)} : r.outStockCnt)} /> {showAnalyse && ( <> `${v.id}`} scroll={{y: 500, x: 2500}} dataSource={parts || []} pagination={false} loading={loading}> - (t || 0).toFixed(2)} /> - (t || 0).toFixed(2)} /> + (t ? t.toFixed(2) : "--")} /> + (t ? t.toFixed(2) : "--")} /> (r.buyCnt ? { setCustVisible(true); setItem(r); }}>{r.buyCnt} : r.buyCnt)} /> @@ -44,7 +45,7 @@ export default function Index(props: Props = {}) { - (r.outStockCnt ? { setOutVisible(true); setItem(r); }}>{r.outStockCnt} : r.outStockCnt)} /> + (r.outStockCnt ? { setOutVisible(true); setItem(r); }}>{_.floor(r.outStockCnt/3)} : r.outStockCnt)} /> {showAnalyse && ( <> - (t || 0).toFixed(2)} /> - (t || 0).toFixed(2)} /> + (t ? t.toFixed(2) : "--")} /> + (t ? t.toFixed(2) : "--")} /> (r.buyCnt ? { setCustVisible(true); setItem(r); }}>{r.buyCnt} : r.buyCnt)} /> @@ -73,7 +74,7 @@ export default function Index(props: Props = {}) { - (r.outStockCnt ? { setOutVisible(true); setItem(r); }}>{r.outStockCnt} : r.outStockCnt)} /> + (r.outStockCnt ? { setOutVisible(true); setItem(r); }}>{_.floor(r.outStockCnt/3)} : r.outStockCnt)} /> `${v.id}`} scroll={{y: 500, x: 2500}} dataSource={parts || []} pagination={false} loading={loading}> - (t || 0).toFixed(2)} /> - (t || 0).toFixed(2)} /> + (t ? t.toFixed(2) : "--")} /> + (t ? t.toFixed(2) : "--")} /> (r.buyCnt ? { setCustVisible(true); setItem(r); }}>{r.buyCnt} : r.buyCnt)} /> @@ -42,7 +43,7 @@ export default function Index(props: Props = {}) { - (r.outStockCnt ? { setOutVisible(true); setItem(r); }}>{r.outStockCnt} : r.outStockCnt)} /> + (r.outStockCnt ? { setOutVisible(true); setItem(r); }}>{floor(r.outStockCnt/3)} : r.outStockCnt)} /> {showAnalyse && ( <>