Browse Source

update: 库位删除增加title

xyh 2 years ago
parent
commit
1109f2b373

+ 2 - 2
packages/app/src/pages/storage/table/hooks.tsx

@@ -87,7 +87,7 @@ export function useHandle(refetch: () => void) {
       key: 'id',
       width: DOUBLE_BTN_WIDTH,
       fixed: 'right',
-      render(_, {id}) {
+      render(_, {id, storageLocationName}) {
         return (
           <>
             <Button
@@ -102,7 +102,7 @@ export function useHandle(refetch: () => void) {
               type='text'
               danger
               loading={id === pendingId}
-              onClick={onDelete(id)}
+              onClick={onDelete(id, storageLocationName)}
             >
               删除
             </Button>

+ 3 - 2
packages/app/src/pages/storage/table/modal/hooks.ts

@@ -38,7 +38,7 @@ export function useFormState({
     defaultValues: {
       storageLocationCode: '',
       storageLocationName: '',
-      storageIsNotDisable: '0',
+      storageIsNotDisable: '',
       storageWarehouse: '',
       storageMaterialType: [],
       storageIsProduct: '',
@@ -104,7 +104,8 @@ export function useFormInfoValue(id: string) {
     function () {
       setValue('storageLocationCode', data?.storageLocationCode ?? '');
       setValue('storageLocationName', data?.storageLocationName ?? '');
-      setValue('storageIsNotDisable', data?.isNotDisable ?? '0');
+      setValue('storageIsNotDisable', data?.isNotDisable ?? '');
+      setValue('storageIsProduct', data?.isProduct ?? '');
       setValue('storageWarehouse', data?.warehouseWhere ?? '');
       setValue(
         'storageMaterialType',