stock.cy.ts 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. import {
  2. beforeSetup,
  3. exportIntercept,
  4. generateNetworkResult,
  5. intercept,
  6. intoMenu,
  7. selectAllFilters,
  8. validateExport,
  9. validateTableList,
  10. validateTableSearch,
  11. } from './utils';
  12. const basicData = {
  13. unitOfMeasurement: null,
  14. wllbClass: '金属紧固件',
  15. companyCode: '8400',
  16. supplierName: '西安特来电智能充电科技有限公司',
  17. code: '3415100010390008',
  18. supplierId: 'EC00276',
  19. year: 2023,
  20. storageLocationCode: 'B3-10-4',
  21. companyName: '青岛特来电智能充电设备有限公司',
  22. wbs: '2',
  23. sum: 3,
  24. maxNum: null,
  25. warehouseName: '充电设备事业部原材料库',
  26. warehouseCode: '2000',
  27. month: 4,
  28. accountSleeve: '8400',
  29. name: '六角螺母\\\\M16;4;彩锌;粗;GB/T41-2000\\\\',
  30. id: 8221,
  31. storageLocationName: 'B3-10-4',
  32. day: 365,
  33. partType: '原材料',
  34. };
  35. describe('库存明细', function() {
  36. beforeEach(function() {
  37. beforeSetup();
  38. intoMenu('库内管理', '库存明细');
  39. });
  40. beforeEach(function() {
  41. intercept('/queryList/storageLocation', function({search, reply}) {
  42. generateNetworkResult({
  43. search,
  44. reply,
  45. basicData,
  46. title: 'code',
  47. skipCondition: name => name === 'groupBy',
  48. });
  49. });
  50. exportIntercept('/queryList/exportStorageLocation');
  51. });
  52. it('库存明细', function() {
  53. selectAllFilters('stock_filter', 11);
  54. validateTableList('stock_table');
  55. validateTableSearch(
  56. 'stock_table',
  57. [
  58. 'wllbCode',
  59. 'materialName',
  60. 'storageLocationName',
  61. {id: 'companyCode', type: 'select', value: '8130'},
  62. {id: 'warehouseId', type: 'select', value: '2bdf33b8-4326-47e8-b'},
  63. {id: 'supplierId', type: 'select', value: 'EC92255'},
  64. 'wbs',
  65. 'partType',
  66. {id: 'wllbClass', type: 'select', value: '危化品'},
  67. {
  68. id: 'unitOfMeasurement',
  69. type: 'select',
  70. value: '00000000000000000001',
  71. },
  72. ],
  73. {
  74. toolId: 'stock_filter',
  75. url: '/queryList/storageLocation',
  76. },
  77. );
  78. validateExport('stock_table');
  79. });
  80. });