Browse Source

chore: 领用单查询

xyh 2 years ago
parent
commit
7dfa2c667b

+ 5 - 2
packages/app/src/apis/finishProduct.ts

@@ -3,6 +3,7 @@ import {
   FinishProductListStreamInListData,
   FinishProductListStreamOutListData,
   GetFinishProductListStreamParams,
+  GetFinishProductOutListStreamParams,
   OtherGoodsOutParams,
 } from '@models';
 import {request} from './request';
@@ -12,17 +13,19 @@ const BASE_URL = '/askGoods',
 
 /** 获取产成品出库流水 */
 export function getFinishProductOutStreamList(
-  data: GetFinishProductListStreamParams,
+  data: GetFinishProductOutListStreamParams,
+  signal?: AbortSignal,
 ): BaseListResult<FinishProductListStreamOutListData> {
   return request({
     method: 'GET',
     data,
     url: `${BASE_URL}/getRemovalHalf`,
+    signal,
   });
 }
 
 /** 导出产成品出库流水  */
-export function getFinishProductOutStreamExport(data: GetFinishProductListStreamParams): any {
+export function getFinishProductOutStreamExport(data: GetFinishProductOutListStreamParams): any {
   return request({
     method: 'GET',
     data,

+ 4 - 0
packages/app/src/apis/queryList.ts

@@ -75,11 +75,13 @@ export function getGSInterfaceList(
 /** 生产领用查询 */
 export function getProductionRequisitionList(
   data: GetProductionRequisitionListParams,
+  signal?: AbortSignal,
 ): BaseListResult<ProductionRequisitionListData> {
   return request({
     method: 'GET',
     url: `${BASE_URL}/getAskGoods`,
     data,
+    signal,
   });
 }
 
@@ -105,11 +107,13 @@ export function delProductionRequisition(id: string): BaseResult {
 /** 非生产领用查询 */
 export function getUnproductionRequisitionList(
   data: GetProductionRequisitionListParams,
+  signal?: AbortSignal,
 ): BaseListResult<ProductionRequisitionListData> {
   return request({
     method: 'GET',
     url: `${BASE_URL}/getInvite`,
     data,
+    signal,
   });
 }
 

+ 27 - 4
packages/app/src/models/request/finishProduct.ts

@@ -1,10 +1,7 @@
 import {ListParams} from '.';
 
-/** 获取产成品库流水列表 */
+/** 获取产成品库流水列表 */
 export type GetFinishProductListStreamParams = {
-  /** 物料名称
-   *
-   */
   /** 物料编号 */
   wllbCode: string;
   /** 开始时间 */
@@ -33,6 +30,32 @@ export type GetFinishProductListStreamParams = {
   storageCode: string;
 } & ListParams;
 
+/** 产成品出库流水 */
+export type GetFinishProductOutListStreamParams = {
+  /** 物料编号 */
+  wllbCode: string;
+  /** 开始时间 */
+  startTime: string;
+  /** 结束时间 */
+  endTime: string;
+  /**
+   * 物料名称
+   */
+  materialName: string;
+  /** 出库单ID */
+  deliveryId: string;
+  /** 出库编号 */
+  storageCode: string;
+  /** 出库人 */
+  userName: string;
+  /** 所属公司 */
+  companyCode: string;
+  /** 客户名称 */
+  customerCode: string;
+  /** wbs */
+  wbs: string;
+} & ListParams;
+
 /** 其他出库 */
 export type OtherGoodsOutParams = {
   /** 物料code */

+ 23 - 3
packages/app/src/models/request/queryList.ts

@@ -63,9 +63,29 @@ export type GetGSInterfaceListParams = {
 /** 查询生产领用的 */
 export type GetProductionRequisitionListParams = {
   /** 生产领用单 */
-  askGoodsId: string;
-} & BaseOrderListParams &
-  ListParams;
+  askGoodsCode: string;
+  /** 物料名称 */
+  materialName: string;
+  /** 开始时间 */
+  startTime: string;
+  /** 结束时间 */
+  endTime: string;
+  /** 物料编号 */
+  materialCode: string;
+  /**  所属公司 */
+  companyCode: string;
+  /** 所属部门 */
+  departmentCode: string;
+  /** 移动类型 */
+  moveType: string;
+  /** 来源类型 */
+  sourceType: string;
+  /** 分录号 */
+  entryNumber: string;
+  /** 生产订单号 */
+  productionCode: string;
+  wbs: string;
+} & ListParams;
 
 /** 查询销售单 */
 export type GetSellOrderListParams = {

+ 12 - 0
packages/app/src/models/response/queryList.ts

@@ -134,6 +134,18 @@ export type ProductionRequisitionListData = {
   outNum: string;
   /** 申请日期 */
   srqr: string;
+  /** 所属公司 */
+  companyName: string;
+  /** 领用部门 */
+  departmentName: string;
+  /** 移动类型 */
+  moveType: string;
+  /** 来源类型 */
+  sourceType: string;
+  /** 分录号 */
+  entryNumber: string;
+  /** 生产订单号 */
+  productionCode: string;
 };
 
 /** 销售单 */

+ 9 - 2
packages/app/src/pages/product-out-stream/context.ts

@@ -1,11 +1,18 @@
 import {createPageContext, createSearchContext, createTableSearchContext} from '@hooks';
-import {GetFinishProductListStreamParams, OriginalListParams} from '@models';
+import {GetFinishProductOutListStreamParams, OriginalListParams} from '@models';
 
 export const pageContext = createPageContext();
 export const searchContext = createSearchContext();
-export const contextState = {
+export const contextState: OriginalListParams<GetFinishProductOutListStreamParams> = {
   wllbCode: '',
   startTime: '',
   endTime: '',
+  storageCode: '',
+  companyCode: '',
+  customerCode: '',
+  userName: '',
+  wbs: '',
+  deliveryId: '',
+  materialName: '',
 };
 export const context = createTableSearchContext(contextState);

+ 59 - 33
packages/app/src/pages/product-out-stream/filter/index.tsx

@@ -1,46 +1,72 @@
-import {FilterButtonGroup, FilterDatePicker, FilterField, FilterFieldWrapper} from '@components';
-import {useContextSection, useRangeDate, useTableExportEvent, useTableSearchEvent} from '@hooks';
+import {FilterSelectorModal, FilterTool} from '@components';
+import {
+  useContextSection,
+  useFilterDB,
+  useFilterField,
+  useRangeDate,
+  useTableSearchToolEvents,
+} from '@hooks';
 import {Card} from 'antd';
-import {FC, useState} from 'react';
-import {context, pageContext, searchContext} from '../context';
-import {getFinishProductOutStreamExport} from '@apis';
+import {FC} from 'react';
+import {context, searchContext} from '../context';
+import {fixedMap, sourceMap} from './state';
 
 const Filter: FC = function () {
+  const [fields, {onChange, resetState}] = useFilterField(
+    {
+      wllbCode: '',
+      startTime: '',
+      endTime: '',
+      storageCode: '',
+      companyCode: '',
+      customerCode: '',
+      userName: '',
+      wbs: '',
+      deliveryId: '',
+      materialName: '',
+    },
+    true,
+  );
   const [{dates, start, end}, onDatesChange] = useRangeDate();
-  const [code, onCodeChange] = useState('');
-  const {isSearching, refetch} = useContextSection(searchContext, state => state[0]);
-  const onSearch = useTableSearchEvent(context, {wllbCode: code, startTime: start, endTime: end});
-  const [isExporting, onExport] = useTableExportEvent({
-    pageContext,
+  const {isSearching} = useContextSection(searchContext, state => state[0]);
+  const [filterList, {set}] = useFilterDB();
+  const [visible, {onSearch, onShowModal, onCloseModal, onReset}] = useTableSearchToolEvents(
     context,
-    fn: getFinishProductOutStreamExport,
-  });
+    {...fields, startTime: start, endTime: end},
+    {
+      resetCallback() {
+        resetState();
+        onDatesChange([null, null]);
+      },
+    },
+  );
 
   return (
-    <Card>
-      <FilterFieldWrapper onSearch={onSearch}>
-        <FilterField
-          name='finishProductOutCode'
-          label='物料编号'
-          value={code}
-          onChange={onCodeChange}
-        />
-        <FilterDatePicker
-          name='finishProductOutDates'
-          label='出库时间'
-          value={dates}
-          onChange={onDatesChange}
-        />
-        <FilterButtonGroup
-          offset={6}
+    <>
+      <Card>
+        <FilterTool
           onSearch={onSearch}
-          onRefresh={refetch}
+          onFilter={onShowModal}
+          onReset={onReset}
+          onChange={onChange}
+          onDatesChange={onDatesChange}
+          fields={fields}
+          dates={dates}
           isSearching={isSearching}
-          onExport={onExport}
-          isExporting={isExporting}
+          filterData={filterList}
+          sourceMap={sourceMap}
+          fixedMap={fixedMap}
         />
-      </FilterFieldWrapper>
-    </Card>
+      </Card>
+
+      <FilterSelectorModal
+        onClose={onCloseModal}
+        filtermap={sourceMap}
+        onConfirm={set}
+        source={filterList}
+        visible={visible}
+      />
+    </>
   );
 };
 

+ 17 - 0
packages/app/src/pages/product-out-stream/filter/state.ts

@@ -0,0 +1,17 @@
+import {FilterGroupMap, MapValue} from '@components';
+import {contextState} from '../context';
+
+export const fixedMap: MapValue<typeof contextState>[] = [
+  {label: '出库单ID', type: 'field', value: 'deliveryId'},
+  {label: '出库编号', type: 'field', value: 'storageCode'},
+  {label: '物料编号', type: 'field', value: 'wllbCode'},
+  {label: '物料名称', type: 'field', value: 'materialName'},
+];
+
+export const sourceMap: FilterGroupMap<typeof contextState> = new Map([
+  ['1', {label: '出库人', type: 'field', value: 'userName'}],
+  ['2', {label: '所属公司', type: 'keySelect', selectKey: '公司', value: 'companyCode'}],
+  ['3', {label: '客户名称', type: 'keySelect', selectKey: '供应商/客户', value: 'customerCode'}],
+  ['4', {label: '出库时间', type: 'date', value: 'startTime'}],
+  ['5', {label: 'WBS编号', type: 'field', value: 'wbs'}],
+]);

+ 33 - 14
packages/app/src/pages/product-out-stream/table/index.tsx

@@ -2,46 +2,65 @@ import {FC} from 'react';
 import {ColumnsType} from 'antd/es/table';
 import {FinishProductListStreamOutListData} from '@models';
 import {Card} from 'antd';
-import {Table} from '@components';
+import {Table, TableTools} from '@components';
 import {context, pageContext, searchContext} from '../context';
 import {HUGE_TABLE_WIDTH, MIDDLE_TABLE_WIDTH, NORMAL_TABLE_WIDTH, SMALL_TABLE_WIDTH} from '@utils';
-import {getFinishProductOutStreamList} from '@apis';
-import {useContextSection, useQueryTableList} from '@hooks';
+import {getFinishProductOutStreamExport, getFinishProductOutStreamList} from '@apis';
+import {useContextSection, useQueryTableList, useTableExportEvent} from '@hooks';
 
 const columns: ColumnsType<FinishProductListStreamOutListData> = [
   {
-    title: '利道编号',
+    title: '出库单ID',
+    dataIndex: 'deliveryId',
+    key: 'deliveryId',
+    width: NORMAL_TABLE_WIDTH,
+  },
+  {
+    title: '出库编号',
     dataIndex: 'storageCode',
     key: 'storageCode',
     width: NORMAL_TABLE_WIDTH,
   },
+  {title: '物料编号', dataIndex: 'wllbCode', key: 'wllbCode', width: MIDDLE_TABLE_WIDTH},
+  {title: '物料名称', dataIndex: 'materialName', key: 'materialName', width: HUGE_TABLE_WIDTH},
+  {title: '出库数量', dataIndex: 'num', key: 'num', width: SMALL_TABLE_WIDTH, align: 'right'},
+  {title: '出库人', dataIndex: 'userName', key: 'userName', width: NORMAL_TABLE_WIDTH},
+  {title: '所属公司', dataIndex: 'companyName', key: 'companyName', width: HUGE_TABLE_WIDTH},
+  {title: '客户名称', dataIndex: 'customerName', key: 'customerName', width: HUGE_TABLE_WIDTH},
+  {title: '出库时间', dataIndex: 'scrq', key: 'scrq', width: MIDDLE_TABLE_WIDTH},
   {
-    title: 'wbs编号',
+    title: 'WBS编号',
     dataIndex: 'wbs',
     key: 'wbs',
     width: NORMAL_TABLE_WIDTH,
   },
-  {title: '物料名称', dataIndex: 'materialName', key: 'materialName', width: HUGE_TABLE_WIDTH},
-  {title: '物料编号', dataIndex: 'wllbCode', key: 'wllbCode', width: MIDDLE_TABLE_WIDTH},
-  {title: '出库数量', dataIndex: 'num', key: 'num', width: SMALL_TABLE_WIDTH},
-  {title: '用户名称', dataIndex: 'userName', key: 'userName', width: NORMAL_TABLE_WIDTH},
-  {title: '出库时间', dataIndex: 'scrq', key: 'scrq', width: MIDDLE_TABLE_WIDTH},
-  {title: '公司名称', dataIndex: 'companyName', key: 'companyName', width: NORMAL_TABLE_WIDTH},
-  {title: '客户名称', dataIndex: 'customerName', key: 'customerName', width: NORMAL_TABLE_WIDTH},
 ];
 
 const TableList: FC = function () {
   const params = useContextSection(context, state => state[0]);
 
-  const [{data, count}] = useQueryTableList({
+  const [{data, count, isFetching}, {refetch}] = useQueryTableList({
     queryFn: getFinishProductOutStreamList,
-    params: params as any,
+    params,
     pageContext,
     searchContext,
   });
 
+  const [isExporting, onExport] = useTableExportEvent({
+    pageContext,
+    context,
+    fn: getFinishProductOutStreamExport,
+  });
+
   return (
     <Card className='table-wrapper'>
+      <TableTools
+        isExporting={isExporting}
+        onExport={onExport}
+        isRefreshing={isFetching}
+        onRefresh={refetch}
+      />
+
       <Table
         columns={columns}
         data={data}

+ 9 - 11
packages/app/src/pages/production-requisition/context.ts

@@ -6,20 +6,18 @@ export const searchContext = createSearchContext();
 export const contextState: OriginalListParams<GetProductionRequisitionListParams> & {
   type: '1' | '2';
 } = {
-  askGoodsId: '',
-  materialCode: '',
+  askGoodsCode: '',
   materialName: '',
   startTime: '',
   endTime: '',
+  materialCode: '',
+  companyCode: '',
+  departmentCode: '',
+  moveType: '',
+  sourceType: '',
+  entryNumber: '',
+  productionCode: '',
   type: '1',
+  wbs: '',
 };
 export const context = createTableSearchContext(contextState);
-export function contextStateSelector({
-  askGoodsId,
-  materialCode,
-  materialName,
-  startTime,
-  endTime,
-}: typeof contextState): OriginalListParams<GetProductionRequisitionListParams> {
-  return {askGoodsId, materialCode, materialName, startTime, endTime};
-}

+ 57 - 74
packages/app/src/pages/production-requisition/filter/index.tsx

@@ -1,92 +1,75 @@
-import {
-  FilterButtonGroup,
-  FilterDatePicker,
-  FilterField,
-  FilterFieldWrapper,
-  FilterSelect,
-} from '@components';
 import {
   useContextSection,
+  useFilterDB,
   useFilterField,
-  useTableExportEvent,
-  useTableSearchEvent,
   useRangeDate,
+  useTableSearchToolEvents,
 } from '@hooks';
 import {Card} from 'antd';
 import {FC} from 'react';
-import {searchContext, context, pageContext} from '../context';
-import {exportProductionRequisitionList, exportUnproductionRequisitionList} from '@apis';
-
-const options = [
-  {label: '生产领用单', value: '1'},
-  {label: '非生产领用单', value: '2'},
-];
+import {searchContext, context} from '../context';
+import {FilterSelectorModal, FilterTool} from '@components';
+import {fixedMap, sourceMap} from './state';
 
 const Filter: FC = function () {
-  const [fields, onChange] = useFilterField({
-    askGoodsId: '',
-    materialCode: '',
-    materialName: '',
-    type: '1' as '1' | '2',
-  });
-  const {askGoodsId, materialCode, materialName, type} = fields;
+  const [fields, {onChange, resetState}] = useFilterField(
+    {
+      askGoodsCode: '',
+      materialName: '',
+      startTime: '',
+      endTime: '',
+      materialCode: '',
+      companyCode: '',
+      departmentCode: '',
+      moveType: '',
+      sourceType: '',
+      entryNumber: '',
+      productionCode: '',
+      type: '1' as '1' | '2',
+      wbs: '',
+    },
+    true,
+  );
   const [{dates, start, end}, onDatesChange] = useRangeDate();
-  const {isSearching, refetch} = useContextSection(searchContext, state => state[0]);
-  const onSearch = useTableSearchEvent(context, {...fields, startTime: start, endTime: end});
-  const searchContextType = useContextSection(context, state => state[0].type);
-  const [isExporting, onExport] = useTableExportEvent({
-    fn:
-      searchContextType === '1'
-        ? exportProductionRequisitionList
-        : exportUnproductionRequisitionList,
-    context: context as any,
-    pageContext,
-  });
+  const {isSearching} = useContextSection(searchContext, state => state[0]);
+  const [visible, {onCloseModal, onSearch, onShowModal, onReset}] = useTableSearchToolEvents(
+    context,
+    {...fields, startTime: start, endTime: end},
+    {
+      resetCallback() {
+        resetState();
+        onDatesChange([null, null]);
+      },
+    },
+  );
+  const [filterList, {set}] = useFilterDB();
 
   return (
-    <Card>
-      <FilterFieldWrapper onSearch={onSearch}>
-        <FilterField
-          name='productionOrder'
-          label='订单编号'
-          value={askGoodsId}
-          onChange={onChange('askGoodsId')}
-        />
-        <FilterField
-          name='materialName'
-          label='物料名称'
-          value={materialName}
-          onChange={onChange('materialName')}
-        />
-        <FilterField
-          name='materialCode'
-          label='物料编号'
-          value={materialCode}
-          onChange={onChange('materialCode')}
-        />
-
-        <FilterDatePicker
-          name='askGoodsDates'
-          label='申请日期'
-          value={dates}
-          onChange={onDatesChange}
-        />
-        <FilterSelect
-          onChange={onChange('type')}
-          value={type}
-          label='订单类型'
-          options={options}
-          name='productionType'
-        />
-        <FilterButtonGroup
+    <>
+      <Card>
+        <FilterTool
+          onReset={onReset}
+          onFilter={onShowModal}
           onSearch={onSearch}
-          onRefresh={refetch}
+          dates={dates}
+          fields={fields}
           isSearching={isSearching}
-          onExport={onExport}
-          isExporting={isExporting}
+          onChange={onChange}
+          onDatesChange={onDatesChange}
+          filterData={filterList}
+          fixedMap={fixedMap}
+          sourceMap={sourceMap}
         />
-      </FilterFieldWrapper>
-    </Card>
+      </Card>
+
+      <FilterSelectorModal
+        visible={visible}
+        onClose={onCloseModal}
+        onConfirm={set}
+        filtermap={sourceMap}
+        source={filterList}
+      />
+    </>
   );
 };
 

+ 28 - 0
packages/app/src/pages/production-requisition/filter/state.ts

@@ -0,0 +1,28 @@
+import {FilterGroupMap, MapValue} from '@components';
+import {contextState} from '../context';
+
+export const sourceMap: FilterGroupMap<typeof contextState> = new Map([
+  ['1', {label: '所属公司', type: 'keySelect', selectKey: '公司', value: 'companyCode'}],
+  ['2', {label: '领用部门', type: 'keySelect', selectKey: '部门字典', value: 'departmentCode'}],
+  ['3', {label: '移动类型', type: 'field', value: 'moveType'}],
+  ['4', {label: '来源类型', type: 'field', value: 'sourceType'}],
+  ['5', {label: '分录号', type: 'field', value: 'entryNumber'}],
+  ['6', {label: 'WBS编号', type: 'field', value: 'wbs'}],
+]);
+
+export const fixedMap: MapValue<typeof contextState>[] = [
+  {label: '领用编号', type: 'field', value: 'askGoodsCode'},
+  {label: '生产订单', type: 'field', value: 'productionCode'},
+  {label: '物料编号', type: 'field', value: 'materialCode'},
+  {label: '物料名称', type: 'field', value: 'materialName'},
+  {
+    label: '明细类型',
+    type: 'select',
+    value: 'type',
+    options: [
+      {label: '生产领用单', value: '1'},
+      {label: '非生产领用单', value: '2'},
+    ],
+    excludeAll: true,
+  },
+];

+ 48 - 15
packages/app/src/pages/production-requisition/table/hooks.tsx

@@ -1,18 +1,18 @@
 import {ColumnsType} from 'antd/es/table';
 import {ProductionRequisitionListData} from '@models';
-import {HUGE_TABLE_WIDTH, MIDDLE_TABLE_WIDTH, NORMAL_TABLE_WIDTH, SMALL_TABLE_WIDTH} from '@utils';
+import {
+  HUGE_TABLE_WIDTH,
+  LARGE_TABLE_WIDTH,
+  MIDDLE_TABLE_WIDTH,
+  NORMAL_TABLE_WIDTH,
+  SMALL_TABLE_WIDTH,
+} from '@utils';
 import {useContextSection, useSupertube, useTableDeleteEvent} from '@hooks';
 import {Button} from 'antd';
 import {delProductionRequisition, delUnProductionRequisition} from '@apis';
 import {context} from '../context';
 
 const columns: ColumnsType<ProductionRequisitionListData> = [
-  {
-    title: '领用单号',
-    dataIndex: 'askGoodsId',
-    key: 'askGoodsId',
-    width: MIDDLE_TABLE_WIDTH,
-  },
   {
     title: '领用编号',
     dataIndex: 'askGoodsCode',
@@ -20,10 +20,9 @@ const columns: ColumnsType<ProductionRequisitionListData> = [
     width: MIDDLE_TABLE_WIDTH,
   },
   {
-    title: '物料名称',
-    dataIndex: 'materialName',
-    key: 'materialName',
-    width: HUGE_TABLE_WIDTH,
+    title: '生产订单编号',
+    dataIndex: 'productionCode',
+    width: MIDDLE_TABLE_WIDTH,
   },
   {
     title: '物料编号',
@@ -31,23 +30,57 @@ const columns: ColumnsType<ProductionRequisitionListData> = [
     key: 'materialCode',
     width: MIDDLE_TABLE_WIDTH,
   },
+  {
+    title: '物料名称',
+    dataIndex: 'materialName',
+    key: 'materialName',
+    width: HUGE_TABLE_WIDTH,
+  },
   {
     title: '要料数量',
     dataIndex: 'num',
     key: 'num',
     width: SMALL_TABLE_WIDTH,
+    align: 'right',
   },
   {
     title: '出库数量',
     dataIndex: 'outNum',
     key: 'outNum',
     width: SMALL_TABLE_WIDTH,
+    align: 'right',
   },
   {
-    title: '公司编号',
-    dataIndex: 'companyNumber',
-    key: 'companyNumber',
-    width: SMALL_TABLE_WIDTH,
+    title: '所属公司',
+    dataIndex: 'companyName',
+    key: 'companyName',
+    width: LARGE_TABLE_WIDTH,
+  },
+  {
+    title: '领用部门',
+    dataIndex: 'departmentName',
+    key: 'departmentName',
+    width: NORMAL_TABLE_WIDTH,
+  },
+  {
+    title: '移动类型',
+    dataIndex: 'moveType',
+    width: NORMAL_TABLE_WIDTH,
+  },
+  {
+    title: '来源类型',
+    dataIndex: 'sourceType',
+    width: NORMAL_TABLE_WIDTH,
+  },
+  {
+    title: '分录号',
+    dataIndex: 'entryNumber',
+    width: NORMAL_TABLE_WIDTH,
+  },
+  {
+    title: 'WBS编号',
+    dataIndex: 'wbs',
+    width: NORMAL_TABLE_WIDTH,
   },
   {
     title: '申请日期',

+ 22 - 7
packages/app/src/pages/production-requisition/table/index.tsx

@@ -1,8 +1,13 @@
-import {useContextSection, useQueryTableList, useSupertube} from '@hooks';
+import {useContextSection, useQueryTableList, useSupertube, useTableExportEvent} from '@hooks';
 import {Card} from 'antd';
 import {FC} from 'react';
-import {context, contextStateSelector, pageContext, searchContext} from '../context';
-import {getProductionRequisitionList, getUnproductionRequisitionList} from '@apis';
+import {context, pageContext, searchContext} from '../context';
+import {
+  exportProductionRequisitionList,
+  exportUnproductionRequisitionList,
+  getProductionRequisitionList,
+  getUnproductionRequisitionList,
+} from '@apis';
 
 import {Table, TableTools} from '@components';
 import {useColumns} from './hooks';
@@ -11,20 +16,30 @@ import AddModal from './modal';
 
 const TableList: FC = function () {
   const params = useContextSection(context, state => state[0]);
-  const [{data, count}, {refetch}] = useQueryTableList({
+  const [{data, count, isFetching}, {refetch}] = useQueryTableList({
     queryFn: params.type === '1' ? getProductionRequisitionList : getUnproductionRequisitionList,
-    params: contextStateSelector(params),
+    params,
     pageContext,
     searchContext,
   });
   const columns = useColumns(refetch);
   const [visible, {setTrue, setFalse}] = useBoolean();
   const isSuper = useSupertube();
-
+  const [isExporting, onExport] = useTableExportEvent({
+    fn: params.type === '1' ? exportProductionRequisitionList : exportUnproductionRequisitionList,
+    context: context as any,
+    pageContext,
+  });
   return (
     <>
       <Card className='table-wrapper'>
-        {isSuper && <TableTools onClick={setTrue} />}
+        <TableTools
+          onAdd={isSuper ? setTrue : void 0}
+          onRefresh={refetch}
+          isRefreshing={isFetching}
+          isExporting={isExporting}
+          onExport={onExport}
+        />
 
         <Table
           columns={columns}

+ 1 - 1
packages/webpack/config/paths.js

@@ -7,7 +7,7 @@ function resolvePath(url) {
   return resolve(appDirection, url);
 }
 module.exports = {
-  outputPath: resolvePath('../../build'),
+  outputPath: resolvePath('../../lidao-wms'),
   srcPath: resolvePath('src'),
   nodeModulesPath: resolvePath('node_modules'),
   publicPath: resolvePath('public'),