Commit 052c8f9fad39691ca57131da4b63f33c0514978e

Authored by jiangwei
1 parent 88663303

服务站配件锁库流水和释放流水查看

src/pages/pms/storage/partShop/api.ts
... ... @@ -42,6 +42,12 @@ export function getLockDetail(params?: PmsStoragePartShop.LockParams): http.Prom
42 42 export function getFlowDetail(params?: PmsStoragePartShop.FlowParams): http.PromisePageResp<PmsStoragePartShop.FlowVO> {
43 43 return request.get(`${PMS_HOST}/erp/part/shop/get/record`, { params });
44 44 }
  45 +/**
  46 + * 查询门店备件锁库流水明细列表
  47 + */
  48 +export function getLockFlowDetail(params?: PmsStoragePartShop.FlowParams): http.PromisePageResp<PmsStoragePartShop.FlowVO> {
  49 + return request.get(`${PMS_HOST}/erp/part/shop/get/lock/record`, { params });
  50 +}
45 51 // 释放库存
46 52 export function unLock(params: PmsStoragePartShop.unLock): http.PromiseResp<string> {
47 53 return request.post(`${PMS_HOST}/erp/part/shop/cancel/lock`, { ...params }, { contentType: "form-urlencoded" });
... ...
src/pages/pms/storage/partShop/components/List.tsx
... ... @@ -4,6 +4,7 @@ import { useStore } from &#39;../index&#39;;
4 4 import LockDetailModal from './LockDetailModal';
5 5 import FlowDetailModal from './FlowDetailModal';
6 6 import PartShopModal from './PartShopModal';
  7 +import LockFlowModal from './LockFlowModal';
7 8  
8 9 const { Column } = Table;
9 10  
... ... @@ -11,6 +12,7 @@ export default function Filter() {
11 12 const { setParams, loading, paginationConfig, list, setVisible, setItem, item, fw, setIsprice} = useStore();
12 13 const [visibleLockDetail, setVisibleLockDetail] = useState(false);
13 14 const [visibleFlowDetail, setVisibleFlowDetail] = useState(false);
  15 + const [visibleLockFlow, setVisibleLockFlow] = useState(false);
14 16  
15 17 return (
16 18 <div>
... ... @@ -43,6 +45,14 @@ export default function Filter() {
43 45 title="入库流水"
44 46 render={(t, it: PartRepertorySpace.Item) => <a onClick={() => { setVisibleFlowDetail(true); setItem({...it, isOut: false}); }}>查看</a>}
45 47 />
  48 + <Column
  49 + title="锁库流水"
  50 + render={(t, it: PartRepertorySpace.Item) => <a onClick={() => { setVisibleLockFlow(true); setItem({...it, isLock: true}); }}>查看</a>}
  51 + />
  52 + <Column
  53 + title="释放流水"
  54 + render={(t, it: PartRepertorySpace.Item) => <a onClick={() => { setVisibleLockFlow(true); setItem({...it, isLock: false}); }}>查看</a>}
  55 + />
46 56 {fw ? (
47 57 <Column
48 58 title="操作"
... ... @@ -65,6 +75,7 @@ export default function Filter() {
65 75 </Table>
66 76 <LockDetailModal item={item} visible={visibleLockDetail} onCancel={() => setVisibleLockDetail(false)} />
67 77 <FlowDetailModal item={item} visible={visibleFlowDetail} onCancel={() => setVisibleFlowDetail(false)} />
  78 + <LockFlowModal item={item} visible={visibleLockFlow} onCancel={() => setVisibleLockFlow(false)} />
68 79 <PartShopModal />
69 80 </div>
70 81 );
... ...
src/pages/pms/storage/partShop/components/LockFlowModal.tsx 0 → 100644
  1 +import React, {useEffect, useState} from 'react';
  2 +import {Modal, Table, Button} from 'antd';
  3 +import { getLockFlowDetail } from '@/pages/pms/storage/partShop/api';
  4 +import usePagination from '@/hooks/usePagination';
  5 +
  6 +interface Props {
  7 + item?: any
  8 + visible: boolean
  9 + onCancel: () => any
  10 +}
  11 +const {Column} = Table;
  12 +export default function Index(props: Props) {
  13 + const {item, visible, onCancel} = props;
  14 + const [delay, setDelay] = useState(true);
  15 + const { list, loading, setParams, paginationConfig, setList } = usePagination<PmsStoragePartShop.FlowVO>(getLockFlowDetail, {}, { delay });
  16 +
  17 + useEffect(() => {
  18 + if (item.shopId && item.partId && visible) {
  19 + setParams({ partId: item.partId, shopId: item.shopId, isLock: item.isLock }, true);
  20 + setDelay(false);
  21 + } else {
  22 + setList([]);
  23 + }
  24 + }, [visible, item.partId]);
  25 +
  26 + return (
  27 + <Modal
  28 + title={`${item.isLock ? '锁定库存' : '释放库存'}流水`}
  29 + width={1000}
  30 + visible={visible}
  31 + maskClosable={false}
  32 + onCancel={onCancel}
  33 + footer={[
  34 + <Button key="1" onClick={onCancel}>取消</Button>,
  35 + ]}
  36 + >
  37 + <Table
  38 + loading={loading}
  39 + dataSource={list}
  40 + rowKey={(v: PmsStoragePartShop.FlowVO) => `${v.type}_${v.typeId}`}
  41 + pagination={paginationConfig}
  42 + >
  43 + <Column title="配件数量" dataIndex="partCnt" />
  44 + <Column title="单号" dataIndex="remark" render={t => t || "--"} />
  45 + <Column
  46 + title="详情"
  47 + dataIndex="text"
  48 + width={350}
  49 + render={(t: string, it: PmsStoragePartShop.FlowVO) => {
  50 + const obj = JSON.parse(t || '{}');
  51 + return (
  52 + <div>
  53 + {!!obj.type && <div>{`类型: ${obj.type}`}</div>}
  54 + {!!obj.serviceCatName && <div>{`进站类型: ${obj.serviceCatName}`}</div>}
  55 + {!!obj.exclusiveAdviser && <div>{`专属顾问: ${obj.exclusiveAdviser}`}</div>}
  56 + {!!obj.shopLinkmanName && <div>{`服务顾问: ${obj.shopLinkmanName}`}</div>}
  57 + {!!obj.receiverName && <div>{`服务顾问: ${obj.receiverName}`}</div>}
  58 + {!!obj.plateNo && <div>{`车牌号: ${obj.plateNo}`}</div>}
  59 + {!!obj.ownerName && <div>{`车主: ${obj.ownerName}`}</div>}
  60 + {!!obj.vin && <div>{`VIN: ${obj.vin}`}</div>}
  61 + {!!obj.userName && <div>{`操作账号: ${obj.userName}`}</div>}
  62 + {!!obj.fixRemark && <div>{`备注: ${obj.fixRemark}`}</div>}
  63 + </div>
  64 + );
  65 + }}
  66 + />
  67 + <Column title={`${item.isLock ? '锁库' : '释放'}时间`} dataIndex="recordTime" />
  68 + </Table>
  69 + </Modal>
  70 + );
  71 +}
0 72 \ No newline at end of file
... ...
src/pages/pms/storage/partShop/interface.d.ts
... ... @@ -21,7 +21,8 @@ declare namespace PmsStoragePartShop {
21 21 actualStock?: number,
22 22 shopId?: number, // 服务站ID
23 23 shopName?: string // 服务站名称
24   - isOut?: boolean
  24 + isOut?: boolean,
  25 + isLock?:boolean
25 26 }
26 27  
27 28 interface Params {
... ... @@ -77,6 +78,7 @@ declare namespace PmsStoragePartShop {
77 78 isOut?: boolean, // 出入库
78 79 current?: number
79 80 pageSize?:number
  81 + isLock?:boolean // 锁库 ?释放
80 82 }
81 83  
82 84 /**
... ...