From 052c8f9fad39691ca57131da4b63f33c0514978e Mon Sep 17 00:00:00 2001 From: jiangwei Date: Thu, 9 Mar 2023 15:21:25 +0800 Subject: [PATCH] 服务站配件锁库流水和释放流水查看 --- src/pages/pms/storage/partShop/api.ts | 6 ++++++ src/pages/pms/storage/partShop/components/List.tsx | 11 +++++++++++ src/pages/pms/storage/partShop/components/LockFlowModal.tsx | 71 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ src/pages/pms/storage/partShop/interface.d.ts | 4 +++- 4 files changed, 91 insertions(+), 1 deletion(-) create mode 100644 src/pages/pms/storage/partShop/components/LockFlowModal.tsx diff --git a/src/pages/pms/storage/partShop/api.ts b/src/pages/pms/storage/partShop/api.ts index 39d666a..215ca83 100644 --- a/src/pages/pms/storage/partShop/api.ts +++ b/src/pages/pms/storage/partShop/api.ts @@ -42,6 +42,12 @@ export function getLockDetail(params?: PmsStoragePartShop.LockParams): http.Prom export function getFlowDetail(params?: PmsStoragePartShop.FlowParams): http.PromisePageResp { return request.get(`${PMS_HOST}/erp/part/shop/get/record`, { params }); } +/** + * 查询门店备件锁库流水明细列表 + */ +export function getLockFlowDetail(params?: PmsStoragePartShop.FlowParams): http.PromisePageResp { + return request.get(`${PMS_HOST}/erp/part/shop/get/lock/record`, { params }); +} // 释放库存 export function unLock(params: PmsStoragePartShop.unLock): http.PromiseResp { return request.post(`${PMS_HOST}/erp/part/shop/cancel/lock`, { ...params }, { contentType: "form-urlencoded" }); diff --git a/src/pages/pms/storage/partShop/components/List.tsx b/src/pages/pms/storage/partShop/components/List.tsx index e05f2f1..bdbb818 100644 --- a/src/pages/pms/storage/partShop/components/List.tsx +++ b/src/pages/pms/storage/partShop/components/List.tsx @@ -4,6 +4,7 @@ import { useStore } from '../index'; import LockDetailModal from './LockDetailModal'; import FlowDetailModal from './FlowDetailModal'; import PartShopModal from './PartShopModal'; +import LockFlowModal from './LockFlowModal'; const { Column } = Table; @@ -11,6 +12,7 @@ export default function Filter() { const { setParams, loading, paginationConfig, list, setVisible, setItem, item, fw, setIsprice} = useStore(); const [visibleLockDetail, setVisibleLockDetail] = useState(false); const [visibleFlowDetail, setVisibleFlowDetail] = useState(false); + const [visibleLockFlow, setVisibleLockFlow] = useState(false); return (
@@ -43,6 +45,14 @@ export default function Filter() { title="入库流水" render={(t, it: PartRepertorySpace.Item) => { setVisibleFlowDetail(true); setItem({...it, isOut: false}); }}>查看} /> + { setVisibleLockFlow(true); setItem({...it, isLock: true}); }}>查看} + /> + { setVisibleLockFlow(true); setItem({...it, isLock: false}); }}>查看} + /> {fw ? ( setVisibleLockDetail(false)} /> setVisibleFlowDetail(false)} /> + setVisibleLockFlow(false)} />
); diff --git a/src/pages/pms/storage/partShop/components/LockFlowModal.tsx b/src/pages/pms/storage/partShop/components/LockFlowModal.tsx new file mode 100644 index 0000000..75ba50a --- /dev/null +++ b/src/pages/pms/storage/partShop/components/LockFlowModal.tsx @@ -0,0 +1,71 @@ +import React, {useEffect, useState} from 'react'; +import {Modal, Table, Button} from 'antd'; +import { getLockFlowDetail } from '@/pages/pms/storage/partShop/api'; +import usePagination from '@/hooks/usePagination'; + +interface Props { + item?: any + visible: boolean + onCancel: () => any +} +const {Column} = Table; +export default function Index(props: Props) { + const {item, visible, onCancel} = props; + const [delay, setDelay] = useState(true); + const { list, loading, setParams, paginationConfig, setList } = usePagination(getLockFlowDetail, {}, { delay }); + + useEffect(() => { + if (item.shopId && item.partId && visible) { + setParams({ partId: item.partId, shopId: item.shopId, isLock: item.isLock }, true); + setDelay(false); + } else { + setList([]); + } + }, [visible, item.partId]); + + return ( + 取消, + ]} + > + `${v.type}_${v.typeId}`} + pagination={paginationConfig} + > + + t || "--"} /> + { + const obj = JSON.parse(t || '{}'); + return ( +
+ {!!obj.type &&
{`类型: ${obj.type}`}
} + {!!obj.serviceCatName &&
{`进站类型: ${obj.serviceCatName}`}
} + {!!obj.exclusiveAdviser &&
{`专属顾问: ${obj.exclusiveAdviser}`}
} + {!!obj.shopLinkmanName &&
{`服务顾问: ${obj.shopLinkmanName}`}
} + {!!obj.receiverName &&
{`服务顾问: ${obj.receiverName}`}
} + {!!obj.plateNo &&
{`车牌号: ${obj.plateNo}`}
} + {!!obj.ownerName &&
{`车主: ${obj.ownerName}`}
} + {!!obj.vin &&
{`VIN: ${obj.vin}`}
} + {!!obj.userName &&
{`操作账号: ${obj.userName}`}
} + {!!obj.fixRemark &&
{`备注: ${obj.fixRemark}`}
} +
+ ); + }} + /> + +
+
+ ); +} \ No newline at end of file diff --git a/src/pages/pms/storage/partShop/interface.d.ts b/src/pages/pms/storage/partShop/interface.d.ts index 7df1697..c1aaa14 100644 --- a/src/pages/pms/storage/partShop/interface.d.ts +++ b/src/pages/pms/storage/partShop/interface.d.ts @@ -21,7 +21,8 @@ declare namespace PmsStoragePartShop { actualStock?: number, shopId?: number, // 服务站ID shopName?: string // 服务站名称 - isOut?: boolean + isOut?: boolean, + isLock?:boolean } interface Params { @@ -77,6 +78,7 @@ declare namespace PmsStoragePartShop { isOut?: boolean, // 出入库 current?: number pageSize?:number + isLock?:boolean // 锁库 ?释放 } /** -- libgit2 0.22.2