matter.cy.ts 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107
  1. import {
  2. beforeSetup,
  3. exportIntercept,
  4. generateNetworkResult,
  5. intercept,
  6. intoMenu,
  7. successIntercept,
  8. validateDelete,
  9. validateExport,
  10. validatePut,
  11. validateTableList,
  12. validateTableSearch,
  13. } from './utils';
  14. const basicData = {
  15. id: '5010',
  16. storageLocationCode: 'D6-3-51',
  17. wllbCode: '3599020010010141',
  18. wllbClass: null,
  19. wllbName: '科密EP-9000 一二维码有线USB扫描枪;科密EP-9000 收银农资',
  20. storageLocationName: 'D6-3-51',
  21. size: null,
  22. tldId: null,
  23. materialType: null,
  24. isNotDisable: null,
  25. isRecommend: null,
  26. partType: null,
  27. warehouseWhere: 'e7f6bff1-e6ab-49e7-9',
  28. minNum: null,
  29. maxNum: null,
  30. page: 0,
  31. limit: 0,
  32. modifyUser: 'admin',
  33. modifyTime: '2023-03-30 09:27:44',
  34. code: null,
  35. };
  36. const TABLE_NAME = 'matter_table';
  37. describe('库位绑定管理', function () {
  38. beforeEach(function () {
  39. beforeSetup();
  40. intoMenu('基础资料', '库位绑定管理');
  41. });
  42. beforeEach(function () {
  43. intercept('/materialClass/getMaterialClass', function ({reply, search}) {
  44. generateNetworkResult({search, reply, basicData, title: 'wllbCode'});
  45. });
  46. exportIntercept('/materialClass/Export');
  47. successIntercept([
  48. '/materialClass/addMaterialClass',
  49. '/materialClass/updateMaterialClass',
  50. '/materialClass/delMaterialClass',
  51. ]);
  52. });
  53. it('table', function () {
  54. validateTableList(TABLE_NAME);
  55. validateTableSearch(
  56. TABLE_NAME,
  57. [
  58. 'wllbCode',
  59. 'wllbName',
  60. 'storageLocationCode',
  61. 'storageLocationName',
  62. 'modifyUser',
  63. ],
  64. {
  65. toolId: 'matter_filter',
  66. url: '/materialClass/getMaterialClass',
  67. },
  68. );
  69. validateExport(TABLE_NAME);
  70. });
  71. it('operation', function () {
  72. const {validateAdd, validateEdit} = validatePut(
  73. 'matter_modal',
  74. TABLE_NAME,
  75. {
  76. label: '库位绑定',
  77. },
  78. );
  79. validateAdd([
  80. {id: 'wllbCode', type: 'keySelect'},
  81. {id: 'warehouseId', type: 'select'},
  82. {id: 'storageLocationCode', type: 'select'},
  83. ]);
  84. validateEdit([
  85. {id: 'wllbCode', type: 'select', value: basicData.wllbName},
  86. {id: 'warehouseId', type: 'select', value: '充电设备事业部原材料库'},
  87. {
  88. id: 'storageLocationCode',
  89. type: 'select',
  90. value: basicData.storageLocationName,
  91. },
  92. ]);
  93. validateDelete(TABLE_NAME, '库位绑定', {title: 'page-1'});
  94. });
  95. });