stock.cy.ts 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  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({search, reply, basicData, title: 'code'});
  43. });
  44. exportIntercept('queryList/exportStorageLocation');
  45. });
  46. it('库存明细', function () {
  47. selectAllFilters('stock_filter', 10);
  48. validateTableList('stock_table');
  49. validateTableSearch(
  50. 'stock_table',
  51. [
  52. 'wllbCode',
  53. 'materialName',
  54. 'storageLocationName',
  55. {id: 'companyCode', type: 'select', value: '8130'},
  56. {id: 'warehouseId', type: 'select', value: '2bdf33b8-4326-47e8-b'},
  57. {id: 'supplierId', type: 'select', value: 'EC92255'},
  58. 'wbs',
  59. 'partType',
  60. {id: 'wllbClass', type: 'select', value: '危化品'},
  61. {
  62. id: 'unitOfMeasurement',
  63. type: 'select',
  64. value: '00000000000000000001',
  65. },
  66. ],
  67. {
  68. toolId: 'stock_filter',
  69. url: '/queryList/storageLocation',
  70. },
  71. );
  72. validateExport('stock_table');
  73. });
  74. });