Ver código fonte

chore: 添加绑定库位测试

xyh 2 anos atrás
pai
commit
2805303ecd

+ 1 - 1
cypress/e2e/container.cy.ts

@@ -27,7 +27,7 @@ describe('容器管理', function() {
     loginSetup();
     optionsIntercept();
     dictionaryIntercept();
-    menuTrigger(2, 2);
+    menuTrigger(2, 3);
   });
 
   beforeEach(function() {

+ 66 - 0
cypress/e2e/goods.cy.ts

@@ -0,0 +1,66 @@
+import {
+  loginIntercept,
+  menuIntercept,
+  loginSetup,
+  optionsIntercept,
+  dictionaryIntercept,
+  menuTrigger,
+  intercept,
+  successIntercept,
+  selectClick,
+  validateTableList,
+  validateTableSearch,
+  validatePut,
+  validateSelect,
+} from './utils';
+
+describe('物料管理', function() {
+  beforeEach(function() {
+    loginIntercept();
+    menuIntercept();
+    loginSetup();
+    optionsIntercept();
+    dictionaryIntercept();
+    menuTrigger(2, 2);
+  });
+
+  beforeEach(function() {
+    intercept('/dictionary/getDictionaryPage', function({search, reply}) {
+      if (search.has('name') && search.get('name').length)
+        return reply({fixture: 'dictonary/search1'});
+      if (search.has('code') && search.get('code').length)
+        return reply({fixture: 'dictonary/search2'});
+
+      const page = search.get('page');
+      reply({fixture: `dictonary/list${page}`});
+    });
+
+    successIntercept('/materialClass/updateMaterial');
+  });
+
+  const TABLE_NAME = 'goods_table',
+        MODAL_NAME = 'goods_modal';
+
+  it('表单', function() {
+    validateTableList(TABLE_NAME);
+
+    const validate = validateTableSearch(TABLE_NAME);
+
+    cy.get('#filter_goodsName').type('name');
+    validate('search1');
+
+    cy.get('#filter_goodsName').clear();
+    cy.get('#filter_goodsCode').type('code');
+    validate('search2');
+  });
+
+  it.only('修改操作', function() {
+    const {validateEdit} = validatePut(MODAL_NAME, '物料');
+
+    validateEdit(TABLE_NAME, function() {
+      validateSelect('select_goodsType', '546');
+      cy.getTestId('field_goodsSize').should('have.value', '1');
+      validateSelect('select_goodsMixin', '是');
+    });
+  });
+});

+ 78 - 0
cypress/e2e/matter.cy.ts

@@ -0,0 +1,78 @@
+import {
+  loginIntercept,
+  menuIntercept,
+  loginSetup,
+  optionsIntercept,
+  dictionaryIntercept,
+  menuTrigger,
+  intercept,
+  selectClick,
+  validateTableList,
+  validateTableSearch,
+  successIntercept,
+  validatePut,
+  validateSelect,
+  validateDelete,
+} from './utils';
+
+describe('库位绑定管理', function() {
+  beforeEach(function() {
+    loginIntercept();
+    menuIntercept();
+    loginSetup();
+    optionsIntercept();
+    dictionaryIntercept();
+    menuTrigger(2, 1);
+  });
+
+  beforeEach(function() {
+    intercept(
+      '/materialClass/getMaterialClass',
+      function({search, reply}) {
+        if (search.has('storageLocationCode') && search.get('storageLocationCode').length)
+          return reply({fixture: 'matter/search1'});
+        if (search.has('wllbCode') && search.get('wllbCode').length)
+          return reply({fixture: 'matter/search2'});
+
+        const page = search.get('page');
+        reply({fixture: `matter/list${page}`});
+      },
+    );
+
+    successIntercept('/materialClass/addMaterialClass');
+    successIntercept('/materialClass/updateMaterialClass');
+    successIntercept('/materialClass/delMaterialClass');
+  });
+
+  const TABLE_NAME = 'matter_table',
+        MODAL_NAME = 'matter_modal';
+
+  it('列表', function() {
+    validateTableList(TABLE_NAME, 2, 1);
+
+    const validate = validateTableSearch(TABLE_NAME);
+
+    selectClick('filter_matterCode', 1);
+    validate('search2');
+
+    selectClick('filter_matterCode', 0);
+    selectClick('filter_StorageCode', 1);
+    validate('search1');
+  });
+
+  it('列表操作', function() {
+    const {validateAdd, validateEdit} = validatePut(MODAL_NAME, '库位绑定');
+
+    validateAdd(function() {
+      selectClick('select_wllbCode', 0);
+      selectClick('select_storageLocationCode', 0);
+    });
+
+    validateEdit(TABLE_NAME, function() {
+      validateSelect('select_wllbCode', '材料1');
+      validateSelect('select_storageLocationCode', '1号库位');
+    });
+
+    validateDelete(TABLE_NAME, '库位绑定');
+  });
+});

+ 15 - 4
cypress/e2e/utils/setup.ts

@@ -19,10 +19,6 @@ export function normalIntercept(
   );
 }
 
-export function dictionaryIntercept() {
-  normalIntercept('/dictionary/getDictionary', 'dictonary/department');
-}
-
 export function successIntercept(url: string) {
   return normalIntercept(
     url,
@@ -53,6 +49,21 @@ export function intercept(
   );
 }
 
+export function dictionaryIntercept() {
+  intercept('/dictionary/getDictionary', function({search, reply}) {
+    const type = search.get('type');
+
+    switch (type) {
+      case '物料字典':
+        return reply({fixture: 'dictonary/goods'});
+      case '部门字典':
+        return reply({fixture: 'dictonary/department'});
+      case '物料类型':
+        return reply({fixture: 'dictonary/goodsType'});
+    }
+  });
+}
+
 export function loginSetup() {
   cy.visit('/');
 

+ 23 - 0
cypress/fixtures/dictonary/goods.json

@@ -0,0 +1,23 @@
+{
+  "msg": "200",
+  "data": [
+    {
+      "id": "1",
+      "code": "123",
+      "name": "材料1",
+      "tldId": "123",
+      "specificationAndModel": "123",
+      "unitOfMeasurement": "123",
+      "materialId": null,
+      "num": null,
+      "type": null,
+      "tableName": null,
+      "size": "1",
+      "materialType": null,
+      "wllbClass": "456546",
+      "isNotDisable": "1",
+      "page": 0,
+      "limit": 0
+    }
+  ]
+}

+ 41 - 0
cypress/fixtures/dictonary/goodsType.json

@@ -0,0 +1,41 @@
+{
+  "msg": "200",
+  "data": [
+    {
+      "id": "1",
+      "code": "123",
+      "name": "123",
+      "tldId": "123",
+      "specificationAndModel": null,
+      "unitOfMeasurement": null,
+      "materialId": null,
+      "num": null,
+      "type": null,
+      "tableName": null,
+      "size": null,
+      "materialType": null,
+      "wllbClass": null,
+      "isNotDisable": null,
+      "page": 0,
+      "limit": 0
+    },
+    {
+      "id": "2",
+      "code": "456",
+      "name": "546",
+      "tldId": "456546",
+      "specificationAndModel": null,
+      "unitOfMeasurement": null,
+      "materialId": null,
+      "num": null,
+      "type": null,
+      "tableName": null,
+      "size": null,
+      "materialType": null,
+      "wllbClass": null,
+      "isNotDisable": null,
+      "page": 0,
+      "limit": 0
+    }
+  ]
+}

+ 80 - 0
cypress/fixtures/dictonary/list1.json

@@ -0,0 +1,80 @@
+{
+  "msg": "200",
+  "data": {
+    "total": 11,
+    "list": [
+      {
+        "id": "1",
+        "code": "123",
+        "name": "材料1",
+        "tldId": "123",
+        "specificationAndModel": "123",
+        "unitOfMeasurement": "123",
+        "materialId": null,
+        "num": null,
+        "type": null,
+        "tableName": null,
+        "size": "1",
+        "materialType": "546",
+        "wllbClass": "456546",
+        "isNotDisable": "1",
+        "page": 0,
+        "limit": 0
+      },
+      {
+        "id": "3",
+        "code": "123",
+        "name": "材料1",
+        "tldId": "123",
+        "specificationAndModel": "123",
+        "unitOfMeasurement": "123",
+        "materialId": null,
+        "num": null,
+        "type": null,
+        "tableName": null,
+        "size": "1",
+        "materialType": "546",
+        "wllbClass": "456546",
+        "isNotDisable": "1",
+        "page": 0,
+        "limit": 0
+      },
+      {
+        "id": "2",
+        "code": "123",
+        "name": "材料1",
+        "tldId": "123",
+        "specificationAndModel": "123",
+        "unitOfMeasurement": "123",
+        "materialId": null,
+        "num": null,
+        "type": null,
+        "tableName": null,
+        "size": "1",
+        "materialType": "546",
+        "wllbClass": "456546",
+        "isNotDisable": "1",
+        "page": 0,
+        "limit": 0
+      }
+    ],
+    "pageNum": 1,
+    "pageSize": 10,
+    "size": 1,
+    "startRow": 1,
+    "endRow": 1,
+    "pages": 1,
+    "prePage": 0,
+    "nextPage": 0,
+    "isFirstPage": true,
+    "isLastPage": true,
+    "hasPreviousPage": false,
+    "hasNextPage": false,
+    "navigatePages": 8,
+    "navigatepageNums": [
+      1
+    ],
+    "navigateFirstPage": 1,
+    "navigateLastPage": 1
+  }
+}

+ 62 - 0
cypress/fixtures/dictonary/list2.json

@@ -0,0 +1,62 @@
+{
+  "msg": "200",
+  "data": {
+    "total": 12,
+    "list": [
+      {
+        "id": "1",
+        "code": "123",
+        "name": "材料1",
+        "tldId": "123",
+        "specificationAndModel": "123",
+        "unitOfMeasurement": "123",
+        "materialId": null,
+        "num": null,
+        "type": null,
+        "tableName": null,
+        "size": "1",
+        "materialType": "546",
+        "wllbClass": "456546",
+        "isNotDisable": "1",
+        "page": 0,
+        "limit": 0
+      },
+      {
+        "id": "2",
+        "code": "123",
+        "name": "材料1",
+        "tldId": "123",
+        "specificationAndModel": "123",
+        "unitOfMeasurement": "123",
+        "materialId": null,
+        "num": null,
+        "type": null,
+        "tableName": null,
+        "size": "1",
+        "materialType": "546",
+        "wllbClass": "456546",
+        "isNotDisable": "1",
+        "page": 0,
+        "limit": 0
+      }
+    ],
+    "pageNum": 1,
+    "pageSize": 10,
+    "size": 1,
+    "startRow": 1,
+    "endRow": 1,
+    "pages": 1,
+    "prePage": 0,
+    "nextPage": 0,
+    "isFirstPage": true,
+    "isLastPage": true,
+    "hasPreviousPage": false,
+    "hasNextPage": false,
+    "navigatePages": 8,
+    "navigatepageNums": [
+      1
+    ],
+    "navigateFirstPage": 1,
+    "navigateLastPage": 1
+  }
+}

+ 80 - 0
cypress/fixtures/dictonary/search1.json

@@ -0,0 +1,80 @@
+{
+  "msg": "200",
+  "data": {
+    "total": 1,
+    "list": [
+      {
+        "id": "1",
+        "code": "123",
+        "name": "search1",
+        "tldId": "123",
+        "specificationAndModel": "123",
+        "unitOfMeasurement": "123",
+        "materialId": null,
+        "num": null,
+        "type": null,
+        "tableName": null,
+        "size": "1",
+        "materialType": "546",
+        "wllbClass": "456546",
+        "isNotDisable": "1",
+        "page": 0,
+        "limit": 0
+      },
+      {
+        "id": "3",
+        "code": "123",
+        "name": "材料1",
+        "tldId": "123",
+        "specificationAndModel": "123",
+        "unitOfMeasurement": "123",
+        "materialId": null,
+        "num": null,
+        "type": null,
+        "tableName": null,
+        "size": "1",
+        "materialType": "546",
+        "wllbClass": "456546",
+        "isNotDisable": "1",
+        "page": 0,
+        "limit": 0
+      },
+      {
+        "id": "2",
+        "code": "123",
+        "name": "材料1",
+        "tldId": "123",
+        "specificationAndModel": "123",
+        "unitOfMeasurement": "123",
+        "materialId": null,
+        "num": null,
+        "type": null,
+        "tableName": null,
+        "size": "1",
+        "materialType": "546",
+        "wllbClass": "456546",
+        "isNotDisable": "1",
+        "page": 0,
+        "limit": 0
+      }
+    ],
+    "pageNum": 1,
+    "pageSize": 10,
+    "size": 1,
+    "startRow": 1,
+    "endRow": 1,
+    "pages": 1,
+    "prePage": 0,
+    "nextPage": 0,
+    "isFirstPage": true,
+    "isLastPage": true,
+    "hasPreviousPage": false,
+    "hasNextPage": false,
+    "navigatePages": 8,
+    "navigatepageNums": [
+      1
+    ],
+    "navigateFirstPage": 1,
+    "navigateLastPage": 1
+  }
+}

+ 80 - 0
cypress/fixtures/dictonary/search2.json

@@ -0,0 +1,80 @@
+{
+  "msg": "200",
+  "data": {
+    "total": 1,
+    "list": [
+      {
+        "id": "1",
+        "code": "123",
+        "name": "search2",
+        "tldId": "123",
+        "specificationAndModel": "123",
+        "unitOfMeasurement": "123",
+        "materialId": null,
+        "num": null,
+        "type": null,
+        "tableName": null,
+        "size": "1",
+        "materialType": "546",
+        "wllbClass": "456546",
+        "isNotDisable": "1",
+        "page": 0,
+        "limit": 0
+      },
+      {
+        "id": "3",
+        "code": "123",
+        "name": "材料1",
+        "tldId": "123",
+        "specificationAndModel": "123",
+        "unitOfMeasurement": "123",
+        "materialId": null,
+        "num": null,
+        "type": null,
+        "tableName": null,
+        "size": "1",
+        "materialType": "546",
+        "wllbClass": "456546",
+        "isNotDisable": "1",
+        "page": 0,
+        "limit": 0
+      },
+      {
+        "id": "2",
+        "code": "123",
+        "name": "材料1",
+        "tldId": "123",
+        "specificationAndModel": "123",
+        "unitOfMeasurement": "123",
+        "materialId": null,
+        "num": null,
+        "type": null,
+        "tableName": null,
+        "size": "1",
+        "materialType": "546",
+        "wllbClass": "456546",
+        "isNotDisable": "1",
+        "page": 0,
+        "limit": 0
+      }
+    ],
+    "pageNum": 1,
+    "pageSize": 10,
+    "size": 1,
+    "startRow": 1,
+    "endRow": 1,
+    "pages": 1,
+    "prePage": 0,
+    "nextPage": 0,
+    "isFirstPage": true,
+    "isLastPage": true,
+    "hasPreviousPage": false,
+    "hasNextPage": false,
+    "navigatePages": 8,
+    "navigatepageNums": [
+      1
+    ],
+    "navigateFirstPage": 1,
+    "navigateLastPage": 1
+  }
+}

+ 52 - 0
cypress/fixtures/matter/list1.json

@@ -0,0 +1,52 @@
+{
+  "msg": "200",
+  "data": {
+    "total": 12,
+    "list": [
+      {
+        "id": "2",
+        "storageLocationCode": "4",
+        "wllbCode": "123",
+        "wllbName": "材料1",
+        "storageLocationName": "2号库位",
+        "size": null,
+        "tldId": null,
+        "materialType": null,
+        "isNotDisable": null,
+        "page": 0,
+        "limit": 0
+      },
+      {
+        "id": "4",
+        "storageLocationCode": "4",
+        "wllbCode": "123",
+        "wllbName": "材料1",
+        "storageLocationName": "1号库位",
+        "size": null,
+        "tldId": null,
+        "materialType": null,
+        "isNotDisable": null,
+        "page": 0,
+        "limit": 0
+      }
+    ],
+    "pageNum": 1,
+    "pageSize": 10,
+    "size": 2,
+    "startRow": 1,
+    "endRow": 2,
+    "pages": 1,
+    "prePage": 0,
+    "nextPage": 0,
+    "isFirstPage": true,
+    "isLastPage": true,
+    "hasPreviousPage": false,
+    "hasNextPage": false,
+    "navigatePages": 8,
+    "navigatepageNums": [
+      1
+    ],
+    "navigateFirstPage": 1,
+    "navigateLastPage": 1
+  }
+}

+ 39 - 0
cypress/fixtures/matter/list2.json

@@ -0,0 +1,39 @@
+{
+  "msg": "200",
+  "data": {
+    "total": 12,
+    "list": [
+      {
+        "id": "2",
+        "storageLocationCode": "6",
+        "wllbCode": "123",
+        "wllbName": "材料1",
+        "storageLocationName": "2号库位",
+        "size": null,
+        "tldId": null,
+        "materialType": null,
+        "isNotDisable": null,
+        "page": 0,
+        "limit": 0
+      }
+    ],
+    "pageNum": 1,
+    "pageSize": 10,
+    "size": 2,
+    "startRow": 1,
+    "endRow": 2,
+    "pages": 1,
+    "prePage": 0,
+    "nextPage": 0,
+    "isFirstPage": true,
+    "isLastPage": true,
+    "hasPreviousPage": false,
+    "hasNextPage": false,
+    "navigatePages": 8,
+    "navigatepageNums": [
+      1
+    ],
+    "navigateFirstPage": 1,
+    "navigateLastPage": 1
+  }
+}

+ 52 - 0
cypress/fixtures/matter/search1.json

@@ -0,0 +1,52 @@
+{
+  "msg": "200",
+  "data": {
+    "total": 2,
+    "list": [
+      {
+        "id": "2",
+        "storageLocationCode": "6",
+        "wllbCode": "123",
+        "wllbName": "search1",
+        "storageLocationName": "2号库位",
+        "size": null,
+        "tldId": null,
+        "materialType": null,
+        "isNotDisable": null,
+        "page": 0,
+        "limit": 0
+      },
+      {
+        "id": "4",
+        "storageLocationCode": "4",
+        "wllbCode": "123",
+        "wllbName": "材料1",
+        "storageLocationName": "1号库位",
+        "size": null,
+        "tldId": null,
+        "materialType": null,
+        "isNotDisable": null,
+        "page": 0,
+        "limit": 0
+      }
+    ],
+    "pageNum": 1,
+    "pageSize": 10,
+    "size": 2,
+    "startRow": 1,
+    "endRow": 2,
+    "pages": 1,
+    "prePage": 0,
+    "nextPage": 0,
+    "isFirstPage": true,
+    "isLastPage": true,
+    "hasPreviousPage": false,
+    "hasNextPage": false,
+    "navigatePages": 8,
+    "navigatepageNums": [
+      1
+    ],
+    "navigateFirstPage": 1,
+    "navigateLastPage": 1
+  }
+}

+ 52 - 0
cypress/fixtures/matter/search2.json

@@ -0,0 +1,52 @@
+{
+  "msg": "200",
+  "data": {
+    "total": 2,
+    "list": [
+      {
+        "id": "2",
+        "storageLocationCode": "6",
+        "wllbCode": "123",
+        "wllbName": "search2",
+        "storageLocationName": "2号库位",
+        "size": null,
+        "tldId": null,
+        "materialType": null,
+        "isNotDisable": null,
+        "page": 0,
+        "limit": 0
+      },
+      {
+        "id": "4",
+        "storageLocationCode": "4",
+        "wllbCode": "123",
+        "wllbName": "材料1",
+        "storageLocationName": "1号库位",
+        "size": null,
+        "tldId": null,
+        "materialType": null,
+        "isNotDisable": null,
+        "page": 0,
+        "limit": 0
+      }
+    ],
+    "pageNum": 1,
+    "pageSize": 10,
+    "size": 2,
+    "startRow": 1,
+    "endRow": 2,
+    "pages": 1,
+    "prePage": 0,
+    "nextPage": 0,
+    "isFirstPage": true,
+    "isLastPage": true,
+    "hasPreviousPage": false,
+    "hasNextPage": false,
+    "navigatePages": 8,
+    "navigatepageNums": [
+      1
+    ],
+    "navigateFirstPage": 1,
+    "navigateLastPage": 1
+  }
+}

+ 20 - 20
cypress/fixtures/menu/basic.json

@@ -11,7 +11,7 @@
       "page": 0,
       "limit": 0,
       "orderBy": null,
-      "menu": "23,15,16,27,25,14,13,29,24,26,47,",
+      "menu": "23,15,16,14,13,29,26,25,47,48,49,",
       "pid": "13"
     },
     {
@@ -24,7 +24,7 @@
       "page": 0,
       "limit": 0,
       "orderBy": null,
-      "menu": "23,15,16,27,25,14,13,29,24,26,47,",
+      "menu": "23,15,16,14,13,29,26,25,47,48,49,",
       "pid": "0"
     },
     {
@@ -37,7 +37,7 @@
       "page": 0,
       "limit": 0,
       "orderBy": null,
-      "menu": "23,15,16,27,25,14,13,29,24,26,47,",
+      "menu": "23,15,16,14,13,29,26,25,47,48,49,",
       "pid": "15"
     },
     {
@@ -50,7 +50,7 @@
       "page": 0,
       "limit": 0,
       "orderBy": null,
-      "menu": "23,15,16,27,25,14,13,29,24,26,47,",
+      "menu": "23,15,16,14,13,29,26,25,47,48,49,",
       "pid": "25"
     },
     {
@@ -63,7 +63,7 @@
       "page": 0,
       "limit": 0,
       "orderBy": null,
-      "menu": "23,15,16,27,25,14,13,29,24,26,47,",
+      "menu": "23,15,16,14,13,29,26,25,47,48,49,",
       "pid": "13"
     },
     {
@@ -76,7 +76,7 @@
       "page": 0,
       "limit": 0,
       "orderBy": null,
-      "menu": "23,15,16,27,25,14,13,29,24,26,47,",
+      "menu": "23,15,16,14,13,29,26,25,47,48,49,",
       "pid": "15"
     },
     {
@@ -89,38 +89,38 @@
       "page": 0,
       "limit": 0,
       "orderBy": null,
-      "menu": "23,15,16,27,25,14,13,29,24,26,47,",
+      "menu": "23,15,16,14,13,29,26,25,47,48,49,",
       "pid": "0"
     },
     {
-      "id": "27",
-      "name": "货品管理",
-      "url": "/goods",
+      "id": "48",
+      "name": "库位绑定管理",
+      "url": "/matter",
       "pId": "25",
       "idCode": null,
       "type": null,
       "page": 0,
       "limit": 0,
       "orderBy": null,
-      "menu": "23,15,16,27,25,14,13,29,24,26,47,",
+      "menu": "23,15,16,14,13,29,26,25,47,48,49,",
       "pid": "25"
     },
     {
-      "id": "24",
-      "name": "部门管理",
-      "url": "/department",
-      "pId": "15",
+      "id": "49",
+      "name": "物料管理",
+      "url": "/goods",
+      "pId": "25",
       "idCode": null,
       "type": null,
       "page": 0,
       "limit": 0,
       "orderBy": null,
-      "menu": "23,15,16,27,25,14,13,29,24,26,47,",
-      "pid": "15"
+      "menu": "23,15,16,14,13,29,26,25,47,48,49,",
+      "pid": "25"
     },
     {
       "id": "47",
-      "name": "托盘管理",
+      "name": "容器管理",
       "url": "/container",
       "pId": "25",
       "idCode": null,
@@ -128,7 +128,7 @@
       "page": 0,
       "limit": 0,
       "orderBy": null,
-      "menu": "23,15,16,27,25,14,13,29,24,26,47,",
+      "menu": "23,15,16,14,13,29,26,25,47,48,49,",
       "pid": "25"
     },
     {
@@ -141,7 +141,7 @@
       "page": 0,
       "limit": 0,
       "orderBy": null,
-      "menu": "23,15,16,27,25,14,13,29,24,26,47,",
+      "menu": "23,15,16,14,13,29,26,25,47,48,49,",
       "pid": "0"
     }
   ]

+ 2 - 1
packages/app/.browserslistrc

@@ -5,4 +5,5 @@ not ie <= 11
 
 
 [development]
-last 1 chrome version
+>= 0.5%
+not dead

+ 3 - 11
packages/app/src/hooks/useOptions/index.ts

@@ -1,4 +1,4 @@
-import {getAllDepartment, getAllRoleList, getAllStorage, getDictionaryOptions} from '@apis';
+import {getAllRoleList, getAllStorage, getDictionaryOptions} from '@apis';
 import {BaseResult, DictionaryParamsType} from '@models';
 import {useQuery} from '@tanstack/react-query';
 
@@ -8,7 +8,7 @@ function useQueryOptions<T extends {id: number | string}>(
   addAll: boolean,
 ) {
   const {data} = useQuery(
-    [fn.name],
+    [fn.name, addAll],
     async function() {
       const data = await fn();
 
@@ -31,14 +31,6 @@ function useQueryOptions<T extends {id: number | string}>(
   return data;
 }
 
-export function useDepartmentOptions(addAll = false) {
-  return useQueryOptions(
-    getAllDepartment,
-    state => state.name,
-    addAll,
-  );
-}
-
 export function useStorageOptions(addAll = false) {
   return useQueryOptions(
     getAllStorage,
@@ -57,7 +49,7 @@ export function useRoleOptions(addAll = false) {
 
 export function useDictionaryOptions(type: DictionaryParamsType, addAll = false) {
   const {data} = useQuery(
-    [getDictionaryOptions.name, type],
+    [getDictionaryOptions.name, type, addAll],
     async function() {
       const data = await getDictionaryOptions(type);
 

+ 15 - 0
packages/app/src/index.tsx

@@ -1,6 +1,7 @@
 import '@styles/index.css';
 
 import {RootRoutes} from '@routes';
+import {render} from 'react-dom';
 import {createRoot} from 'react-dom/client';
 import {BrowserRouter} from 'react-router-dom';
 import {QueryClient, QueryClientProvider} from '@tanstack/react-query';
@@ -47,3 +48,17 @@ root.render(
     </QueryClientProvider>
   </StrictMode>,
 );
+
+// render(
+//   <StrictMode>
+//     <QueryClientProvider client={queryClient}>
+//       <ConfigProvider theme={themeConfig} locale={zhCN}>
+//         <BrowserRouter>
+//           <RootRoutes />
+//         </BrowserRouter>
+//       </ConfigProvider>
+//       <ReactQueryDevtools initialIsOpen={false} position='bottom-right' />
+//     </QueryClientProvider>
+//   </StrictMode>,
+//   document.querySelector('#root'),
+// );

+ 1 - 1
packages/app/src/pages/goods/table/modal/hooks.ts

@@ -74,7 +74,7 @@ export function useWatchId(id: string) {
 
   useEffect(function() {
     setValue('goodsType', data?.wllbClass ?? '');
-    setValue('goodsSize', Number(data?.num ?? '1'));
+    setValue('goodsSize', Number(data?.size ?? '1'));
     setValue('goodsMixin', data?.isNotDisable ?? '');
   }, [data, setValue]);
 }

+ 1 - 0
packages/app/src/pages/goods/table/modal/index.tsx

@@ -26,6 +26,7 @@ const EditModal: FC<Props> = function({id, visible, onClose, onFetch}) {
       onClose={onClose}
       style={style}
       hideBtnGroup
+      testId='goods_modal'
     >
       <FormProvider {...formInstance}>
         <ErrorBoundary>

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

@@ -58,7 +58,7 @@ export function useDelete(refetch: () => void) {
   function onDelete(id: string) {
     return function() {
       deleteConfirm(
-        '物料类型',
+        '库位绑定',
         function() {
           setPendingId(id);
           mutate(id);
@@ -95,6 +95,7 @@ export function useHandle(refetch: () => void) {
             <Button
               type='text'
               danger
+              loading={id === pendingId}
               onClick={onDelete(id)}
             >
               删除

+ 1 - 1
packages/app/src/pages/matter/table/modal/index.tsx

@@ -28,7 +28,7 @@ const PutModal: FC<Props> = function({visible, onClose, id, onFetch}) {
       style={styles}
       visible={visible}
       onClose={onClose}
-      title={`${id ? '修改' : '新增'}物料类型`}
+      title={`${id ? '修改' : '新增'}库位绑定`}
       hideBtnGroup
       testId='matter_modal'
       onSubmit={onSubmit}