소스 검색

chore: 移除废弃的页面

xyh 2 년 전
부모
커밋
616b56405e

+ 1 - 1
packages/app/src/components/filter-field/Tool.tsx

@@ -49,7 +49,7 @@ type Props<S extends Record<string, string | string[]>> = {
   onFilter?: () => void;
   onChange?: (key: any) => (value: string | number) => void;
   onDatesChange?: (dates: RangeValue<Dayjs>) => void;
-  testId?: string;
+  testId: string;
 };
 
 function FilterTool<S extends Record<string, string | string[]>>({

+ 1 - 1
packages/app/src/components/filter-field/Wrapper.tsx

@@ -5,7 +5,7 @@ import {FormEvent} from 'react';
 
 type Props = {
   onSearch: () => void;
-  testId?: string;
+  testId: string;
 };
 
 const FilterFieldWrapper: ChildrenFC<Props> = function ({

+ 1 - 1
packages/app/src/hooks/use-table-event/index.ts

@@ -54,7 +54,7 @@ export function useTableDeleteEvent<P>(
 
   const findPendintId = useLatest(findId);
   const onDelte = useCallback(
-    function (params: P, title?: string) {
+    function (params: P, title: string) {
       return function () {
         deleteConfirm(
           label,

+ 0 - 26
packages/app/src/pages/product-draw/context.ts

@@ -1,26 +0,0 @@
-import {
-  createPageContext,
-  createSearchContext,
-  createTableSearchContext,
-} from '@hooks';
-import {GetSemiManufacturesDrawList, OriginalListParams} from '@models';
-
-export const pageContext = createPageContext();
-export const searchContext = createSearchContext();
-
-export const contextState: OriginalListParams<GetSemiManufacturesDrawList> = {
-  partType: '产成品',
-  productionCode: '',
-  type: '',
-  askGoodsCode: '',
-  materialCode: '',
-  materialName: '',
-  departmentCode: '',
-  companyCode: '',
-  entryNumber: '',
-  moveType: '',
-  sourceType: '',
-  startTime: '',
-  endTime: '',
-};
-export const context = createTableSearchContext(contextState);

+ 0 - 72
packages/app/src/pages/product-draw/filter/index.tsx

@@ -1,72 +0,0 @@
-import {FC} from 'react';
-import {
-  useContextSection,
-  useFilterDB,
-  useFilterField,
-  useRangeDate,
-  useTableSearchToolEvents,
-} from '@hooks';
-import {context, searchContext} from '../context';
-import {FilterSelectorModal, FilterTool} from '@components';
-import {fixedMap, sourceMap} from './state';
-
-const Filter: FC = function () {
-  const [fields, {onChange, resetState}] = useFilterField(
-    {
-      partType: '产成品' as const,
-      productionCode: '',
-      type: '',
-      askGoodsCode: '',
-      materialCode: '',
-      materialName: '',
-      departmentCode: '',
-      companyCode: '',
-      entryNumber: '',
-      moveType: '',
-      sourceType: '',
-    },
-    true,
-  );
-  const [{dates, start, end}, onDatesChange] = useRangeDate();
-  const {isSearching} = useContextSection(searchContext, state => state[0]);
-  const [visible, {onSearch, onReset, onShowModal, onCloseModal}] =
-    useTableSearchToolEvents(
-      context,
-      {...fields, startTime: start, endTime: end},
-      {
-        resetCallback() {
-          resetState();
-          onDatesChange([null, null]);
-        },
-      },
-    );
-  const [filterList, {set}] = useFilterDB();
-
-  return (
-    <>
-      <FilterTool
-        onSearch={onSearch}
-        onChange={onChange}
-        onReset={onReset}
-        onDatesChange={onDatesChange}
-        filterData={filterList}
-        fields={fields}
-        dates={dates}
-        sourceMap={sourceMap}
-        fixedMap={fixedMap}
-        isSearching={isSearching}
-        onFilter={onShowModal}
-      />
-
-      <FilterSelectorModal
-        visible={visible}
-        onClose={onCloseModal}
-        source={filterList}
-        filtermap={sourceMap}
-        onConfirm={set}
-      />
-    </>
-  );
-};
-
-export default Filter;

+ 0 - 46
packages/app/src/pages/product-draw/filter/state.ts

@@ -1,46 +0,0 @@
-import {FilterGroupMap, MapValue} from '@components';
-import {contextState} from '../context';
-
-export const sourceMap: FilterGroupMap<typeof contextState> = new Map([
-  [
-    '1',
-    {
-      label: '要料部门',
-      type: 'keySelect',
-      selectKey: '部门字典',
-      value: 'departmentCode',
-    },
-  ],
-  [
-    '2',
-    {
-      label: '所属公司',
-      type: 'keySelect',
-      selectKey: '公司',
-      value: 'companyCode',
-    },
-  ],
-  ['3', {label: '分录号', type: 'field', value: 'entryNumber'}],
-  ['4', {label: '移动类型', type: 'field', value: 'moveType'}],
-  ['5', {label: '来源类型', type: 'field', value: 'sourceType'}],
-  [
-    '6',
-    {
-      label: '状态',
-      type: 'select',
-      value: 'type',
-      options: [
-        {label: '未出库', value: '0'},
-        {label: '已出库', value: '1'},
-      ],
-    },
-  ],
-  ['7', {label: '申请日期', type: 'date', value: 'startTime'}],
-]);
-
-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'},
-];

+ 0 - 22
packages/app/src/pages/product-draw/index.tsx

@@ -1,22 +0,0 @@
-import {PageProvider, SearchProvider, TableSearchProvider} from '@components';
-import {FC} from 'react';
-import {context, contextState, pageContext, searchContext} from './context';
-import Filter from './filter';
-import TableList from './table';
-
-const SemiDraw: FC = function () {
-  return (
-    <TableSearchProvider context={context} state={contextState}>
-      <PageProvider context={pageContext}>
-        <SearchProvider context={searchContext}>
-          <section className='content-main'>
-            <Filter />
-            <TableList />
-          </section>
-        </SearchProvider>
-      </PageProvider>
-    </TableSearchProvider>
-  );
-};
-
-export default SemiDraw;

+ 0 - 86
packages/app/src/pages/product-draw/table/index.tsx

@@ -1,86 +0,0 @@
-import {FC} from 'react';
-import {Card} from 'antd';
-import {Table, TableTools} from '@components';
-import {context, pageContext, searchContext} from '../context';
-import {SemiDrawListData} from '@models';
-import {
-  NORMAL_TABLE_WIDTH,
-  MIDDLE_TABLE_WIDTH,
-  SMALL_TABLE_WIDTH,
-} from '@utils';
-import {ColumnsType} from 'antd/es/table';
-import {getSemiManufacturesDrawList} from '@apis';
-import {useContextSection, useQueryTableList} from '@hooks';
-
-const columns: ColumnsType<SemiDrawListData> = [
-  {
-    title: '要货单编号',
-    dataIndex: 'askGoodsId',
-    key: 'askGoodsId',
-    width: NORMAL_TABLE_WIDTH,
-  },
-  {
-    title: '物料编号',
-    dataIndex: 'materialCode',
-    key: 'materialCode',
-    width: NORMAL_TABLE_WIDTH,
-  },
-  {
-    title: '物料名称',
-    dataIndex: 'materialName',
-    key: 'materialName',
-    width: MIDDLE_TABLE_WIDTH,
-  },
-  {title: '数量', dataIndex: 'num', key: 'num', width: SMALL_TABLE_WIDTH},
-  {
-    title: '生产订单号',
-    dataIndex: 'productionCode',
-    key: 'productionCode',
-    width: NORMAL_TABLE_WIDTH,
-  },
-  {
-    title: '要料部门',
-    dataIndex: 'department',
-    key: 'department',
-    width: NORMAL_TABLE_WIDTH,
-  },
-  {
-    title: '状态',
-    dataIndex: 'type',
-    key: 'type',
-    render(_, {type}) {
-      return type === '0' ? '未出库' : '已出库';
-    },
-    width: SMALL_TABLE_WIDTH,
-  },
-];
-
-const TableList: FC = function () {
-  const params = useContextSection(context, state => state[0]);
-
-  const [{data, count, isFetching}, {refetch}] = useQueryTableList({
-    queryFn: getSemiManufacturesDrawList,
-    params,
-    pageContext,
-    searchContext,
-  });
-
-  return (
-    <>
-      <Card className='table-wrapper'>
-        <TableTools onRefresh={refetch} isRefreshing={isFetching} />
-
-        <Table
-          data-testid='product_draw_table'
-          data={data}
-          columns={columns}
-          count={count}
-          pageContext={pageContext}
-          searchContext={searchContext}
-        />
-      </Card>
-    </>
-  );
-};
-
-export default TableList;

+ 0 - 3
packages/app/src/routes/index.tsx

@@ -31,7 +31,6 @@ import {
   GS_INTERFACE_LOG_PATH,
   PRODUCTION_REQUISITION_PATH,
   SELL_ORDER_PATH,
-  PRODUCT_DRAW_PATH,
   RELOCAT_ORDER_PATH,
   PRODUCT_REPORT_PATH,
   ORDER_LOG_PATH,
@@ -66,7 +65,6 @@ import {
   GSInterfaceLog,
   ProductionRequisitionOrder,
   RelcationOrder,
-  ProductDraw,
   ProductReport,
   DeadProduct,
   PurchaseOrder,
@@ -119,7 +117,6 @@ export const routes: RouteObject[] = [
       },
       {path: SELL_ORDER_PATH, element: <SellOrder />},
       {path: RELOCAT_ORDER_PATH, element: <RelcationOrder />},
-      {path: PRODUCT_DRAW_PATH, element: <ProductDraw />},
       {path: PRODUCT_REPORT_PATH, element: <ProductReport />},
       {path: ORDER_LOG_PATH, element: <OrderDeleteLog />},
       {path: INVENTORY_PATH, element: <Inventory />},

+ 0 - 2
packages/app/src/routes/name.ts

@@ -87,8 +87,6 @@ export const PRODUCTION_REQUISITION_PATH = '/production/requisition';
 export const SELL_ORDER_PATH = '/sellorder';
 /** 移库单 */
 export const RELOCAT_ORDER_PATH = '/relocation';
-/** 产成品领料单 */
-export const PRODUCT_DRAW_PATH = '/product/draw';
 /** 产成品报工单 */
 export const PRODUCT_REPORT_PATH = '/product/report';
 /** 单据删除日志 */

+ 0 - 3
packages/app/src/routes/routes.tsx

@@ -188,9 +188,6 @@ export const RelcationOrder = lazy(
 export const ProductReport = lazy(
   () => import(/* webpackChunkName: "productReport" */ '@pages/product-report'),
 );
-export const ProductDraw = lazy(
-  () => import(/* webpackChunkName: "productDraw" */ '@pages/product-draw'),
-);
 export const OrderDeleteLog = lazy(
   () => import(/* webpackChunkName: "orderLog" */ '@pages/order-log'),
 );