Browse Source

update: 移除出入库删除接口

xyh 2 years ago
parent
commit
4c9574e2a2

+ 16 - 17
packages/app/src/apis/dictionary.ts

@@ -3,7 +3,6 @@ import {
   AllMaterialListData,
   BaseListResult,
   BaseResult,
-  DelStreamParams,
   DictionaryData,
   DictionaryParamsType,
   EditDictionaryListParams,
@@ -147,20 +146,20 @@ export function syncDepartment(): BaseResult {
   });
 }
 
-/** 删除入库流水 */
-export function delInStream(data: DelStreamParams): BaseResult {
-  return request({
-    url: `${BASE_URL}/delRunningWaterR`,
-    data,
-    method: 'DELETE',
-  });
-}
+// /** 删除入库流水 */
+// export function delInStream(data: DelStreamParams): BaseResult {
+//   return request({
+//     url: `${BASE_URL}/delRunningWaterR`,
+//     data,
+//     method: 'DELETE',
+//   });
+// }
 
-/** 删除出库流水 */
-export function delOutStream(data: DelStreamParams): BaseResult {
-  return request({
-    url: `${BASE_URL}/delRunningWaterC`,
-    data,
-    method: 'DELETE',
-  });
-}
+// /** 删除出库流水 */
+// export function delOutStream(data: DelStreamParams): BaseResult {
+//   return request({
+//     url: `${BASE_URL}/delRunningWaterC`,
+//     data,
+//     method: 'DELETE',
+//   });
+// }

+ 32 - 32
packages/app/src/pages/product-in-stream/table/hooks.tsx

@@ -13,9 +13,9 @@ import {
 } from '@utils';
 import {ColumnsType} from 'antd/es/table';
 import {FinishProductListStreamInListData} from '@models';
-import {useTableDeleteEvent} from '@hooks';
-import {delInStream} from '@apis';
-import {Button} from 'antd';
+// import {useTableDeleteEvent} from '@hooks';
+// import {delInStream} from '@apis';
+// import {Button} from 'antd';
 
 export const tableColumns: ColumnsType<FinishProductListStreamInListData> = [
   {
@@ -114,38 +114,38 @@ export const tableColumns: ColumnsType<FinishProductListStreamInListData> = [
   },
 ];
 
-export function useColumns(refetch: () => void) {
-  const [deleteingId, onDelete] = useTableDeleteEvent(
-    delInStream,
-    refetch,
-    {
-      label: '入库水流',
-      findId(state) {
-        return state.id;
-      },
-    },
-  );
+export function useColumns() {
+  // const [deleteingId, onDelete] = useTableDeleteEvent(
+  //   delInStream,
+  //   refetch,
+  //   {
+  //     label: '入库水流',
+  //     findId(state) {
+  //       return state.id;
+  //     },
+  //   },
+  // );
 
   const columns: ColumnsType<FinishProductListStreamInListData> = [
     ...tableColumns,
-    {
-      title: '操作',
-      fixed: true,
-      dataIndex: 'id',
-      width: MIDDLE_TABLE_WIDTH,
-      render(_, {id, storageCode}) {
-        return (
-          <Button
-            type="text"
-            danger
-            loading={deleteingId === id}
-            onClick={onDelete({type: '2', id}, storageCode)}
-          >
-            删除
-          </Button>
-        );
-      },
-    },
+    // {
+    //   title: '操作',
+    //   fixed: true,
+    //   dataIndex: 'id',
+    //   width: MIDDLE_TABLE_WIDTH,
+    //   render(_, {id, storageCode}) {
+    //     return (
+    //       <Button
+    //         type="text"
+    //         danger
+    //         loading={deleteingId === id}
+    //         onClick={onDelete({type: '2', id}, storageCode)}
+    //       >
+    //         删除
+    //       </Button>
+    //     );
+    //   },
+    // },
   ];
 
   return columns;

+ 30 - 30
packages/app/src/pages/raw-in-stream/table/hooks.tsx

@@ -13,9 +13,9 @@ import {
 } from '@utils';
 import {WarehousingListData} from '@models';
 import {ColumnsType} from 'antd/es/table';
-import {useTableDeleteEvent} from '@hooks';
-import {delInStream} from '@apis';
-import {Button} from 'antd';
+// import {useTableDeleteEvent} from '@hooks';
+// import {delInStream} from '@apis';
+// import {Button} from 'antd';
 
 export const columns: ColumnsType<WarehousingListData> = [
   {
@@ -112,35 +112,35 @@ export const columns: ColumnsType<WarehousingListData> = [
   },
 ];
 
-export function useColumns(refetch: () => void) {
-  const [deleteingId, onDelete] = useTableDeleteEvent(
-    delInStream,
-    refetch,
-    {
-      label: '入库流水',
-      findId: state => state.id,
-    },
-  );
+export function useColumns() {
+  // const [deleteingId, onDelete] = useTableDeleteEvent(
+  //   delInStream,
+  //   refetch,
+  //   {
+  //     label: '入库流水',
+  //     findId: state => state.id,
+  //   },
+  // );
 
   return [
     ...columns,
-    {
-      title: '操作',
-      fixed: true,
-      dataIndex: 'id',
-      width: MIDDLE_TABLE_WIDTH,
-      render(_, {id, storageCode}) {
-        return (
-          <Button
-            type="text"
-            danger
-            loading={deleteingId === id}
-            onClick={onDelete({type: '0', id}, storageCode)}
-          >
-            删除
-          </Button>
-        );
-      },
-    },
+    // {
+    //   title: '操作',
+    //   fixed: true,
+    //   dataIndex: 'id',
+    //   width: MIDDLE_TABLE_WIDTH,
+    //   render(_, {id, storageCode}) {
+    //     return (
+    //       <Button
+    //         type="text"
+    //         danger
+    //         loading={deleteingId === id}
+    //         onClick={onDelete({type: '0', id}, storageCode)}
+    //       >
+    //         删除
+    //       </Button>
+    //     );
+    //   },
+    // },
   ] as ColumnsType<WarehousingListData>;
 }

+ 27 - 27
packages/app/src/pages/raw-out-stream/table/hooks.tsx

@@ -13,9 +13,9 @@ import {
 } from '@utils';
 import {RawMaterialOutStreamListData} from '@models';
 import {ColumnsType} from 'antd/es/table';
-import {useTableDeleteEvent} from '@hooks';
-import {delOutStream} from '@apis';
-import {Button} from 'antd';
+// import {useTableDeleteEvent} from '@hooks';
+// import {delOutStream} from '@apis';
+// import {Button} from 'antd';
 
 export const columns: ColumnsType<RawMaterialOutStreamListData> = [
   {
@@ -112,32 +112,32 @@ export const columns: ColumnsType<RawMaterialOutStreamListData> = [
   },
 ];
 
-export function useColumns(refetch: () => void) {
-  const [deleteingId, onDelete] = useTableDeleteEvent(
-    delOutStream,
-    refetch,
-    {label: '出库流水', findId: state => state.id},
-  );
+export function useColumns() {
+  // const [deleteingId, onDelete] = useTableDeleteEvent(
+  //   delOutStream,
+  //   refetch,
+  //   {label: '出库流水', findId: state => state.id},
+  // );
 
   return [
     ...columns,
-    {
-      title: '操作',
-      fixed: true,
-      dataIndex: 'id',
-      width: MIDDLE_TABLE_WIDTH,
-      render(_, {id, storageCode}) {
-        return (
-          <Button
-            type="text"
-            danger
-            loading={deleteingId === id}
-            onClick={onDelete({type: '0', id}, storageCode)}
-          >
-            删除
-          </Button>
-        );
-      },
-    },
+    // {
+    //   title: '操作',
+    //   fixed: true,
+    //   dataIndex: 'id',
+    //   width: MIDDLE_TABLE_WIDTH,
+    //   render(_, {id, storageCode}) {
+    //     return (
+    //       <Button
+    //         type="text"
+    //         danger
+    //         loading={deleteingId === id}
+    //         onClick={onDelete({type: '0', id}, storageCode)}
+    //       >
+    //         删除
+    //       </Button>
+    //     );
+    //   },
+    // },
   ] as ColumnsType<RawMaterialOutStreamListData>;
 }

+ 27 - 27
packages/app/src/pages/semi-in-stream/table/hooks.tsx

@@ -11,9 +11,9 @@ import {
 } from '@utils';
 import {ColumnsType} from 'antd/es/table';
 import {SemiInStreamListData} from '@models';
-import {useTableDeleteEvent} from '@hooks';
-import {delInStream} from '@apis';
-import {Button} from 'antd';
+// import {useTableDeleteEvent} from '@hooks';
+// import {delInStream} from '@apis';
+// import {Button} from 'antd';
 
 export const columns: ColumnsType<SemiInStreamListData> = [
   {
@@ -94,32 +94,32 @@ export const columns: ColumnsType<SemiInStreamListData> = [
   },
 ];
 
-export function useColumns(refetch: () => void) {
-  const [deleteId, onDelete] = useTableDeleteEvent(
-    delInStream,
-    refetch,
-    {label: '入库流水', findId: state => state.id},
-  );
+export function useColumns() {
+  // const [deleteId, onDelete] = useTableDeleteEvent(
+  //   delInStream,
+  //   refetch,
+  //   {label: '入库流水', findId: state => state.id},
+  // );
 
   return [
     ...columns,
-    {
-      title: '操作',
-      fixed: true,
-      width: MIDDLE_TABLE_WIDTH,
-      dataIndex: 'id',
-      render(_, {id, storageCode}) {
-        return (
-          <Button
-            type="text"
-            danger
-            loading={deleteId === id}
-            onClick={onDelete({type: '1', id}, storageCode)}
-          >
-            删除
-          </Button>
-        );
-      },
-    },
+    // {
+    //   title: '操作',
+    //   fixed: true,
+    //   width: MIDDLE_TABLE_WIDTH,
+    //   dataIndex: 'id',
+    //   render(_, {id, storageCode}) {
+    //     return (
+    //       <Button
+    //         type="text"
+    //         danger
+    //         loading={deleteId === id}
+    //         onClick={onDelete({type: '1', id}, storageCode)}
+    //       >
+    //         删除
+    //       </Button>
+    //     );
+    //   },
+    // },
   ] as ColumnsType<SemiInStreamListData>;
 }

+ 26 - 26
packages/app/src/pages/semi-out-stream/table/hooks.tsx

@@ -11,9 +11,9 @@ import {
 } from '@utils';
 import {ColumnsType} from 'antd/es/table';
 import {SemiOutStreamListData} from '@models';
-import {useTableDeleteEvent} from '@hooks';
-import {delOutStream} from '@apis';
-import {Button} from 'antd';
+// import {useTableDeleteEvent} from '@hooks';
+// import {delOutStream} from '@apis';
+// import {Button} from 'antd';
 
 export const columns: ColumnsType<SemiOutStreamListData> = [
   {
@@ -85,17 +85,17 @@ export const columns: ColumnsType<SemiOutStreamListData> = [
   },
 ];
 
-export function useColumns(refetch: () => void) {
-  const [deleteId, onDelete] = useTableDeleteEvent(
-    delOutStream,
-    refetch,
-    {
-      label: '出库流水',
-      findId(state) {
-        return state.id;
-      },
-    },
-  );
+export function useColumns() {
+  // const [deleteId, onDelete] = useTableDeleteEvent(
+  //   delOutStream,
+  //   refetch,
+  //   {
+  //     label: '出库流水',
+  //     findId(state) {
+  //       return state.id;
+  //     },
+  //   },
+  // );
 
   return [
     ...columns,
@@ -104,18 +104,18 @@ export function useColumns(refetch: () => void) {
       fixed: true,
       width: MIDDLE_TABLE_WIDTH,
       dataIndex: 'id',
-      render(_, {id, storageCode}) {
-        return (
-          <Button
-            type="text"
-            danger
-            loading={deleteId === id}
-            onClick={onDelete({type: '1', id}, storageCode)}
-          >
-            删除
-          </Button>
-        );
-      },
+      // render(_, {id, storageCode}) {
+      //   return (
+      //   //   <Button
+      //   //     type="text"
+      //   //     danger
+      //   //     loading={deleteId === id}
+      //   //     onClick={onDelete({type: '1', id}, storageCode)}
+      //   //   >
+      //   //     删除
+      //   //   </Button>
+      //   );
+      // },
     },
   ] as ColumnsType<SemiOutStreamListData>;
 }