purchase.cy.ts 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. import {
  2. beforeSetup,
  3. generateNetworkResult,
  4. intercept,
  5. intoMenu,
  6. validateTableList,
  7. validateTableSearch,
  8. } from './utils';
  9. const basicData = {
  10. id: '7',
  11. supplierId: 'PER00556',
  12. supplierName: '赵东林',
  13. orderId: null,
  14. orderNumber: null,
  15. materialName: '清洁纸;酒精擦纸,含酒精纯度≥99.5%,300x300mm',
  16. materialId: '00000000000000012033',
  17. measurementId: null,
  18. purchaseNum: '15',
  19. arrivalNum: '1',
  20. arrivalTime: '2023-04-10',
  21. type: '0',
  22. qualifiedNum: null,
  23. disqualificationNum: null,
  24. orderCode: 'CG62058902',
  25. companyNumber: null,
  26. compName: null,
  27. wbs: null,
  28. orderType: null,
  29. sourceType: null,
  30. entryNumber: null,
  31. moveType: null,
  32. page: 0,
  33. limit: 0,
  34. startTime: null,
  35. endTime: null,
  36. warehousingNum: null,
  37. wllbCode: '2205010010020004',
  38. };
  39. describe('采购单列表', function () {
  40. beforeEach(function () {
  41. beforeSetup();
  42. intoMenu('入库管理', '采购单列表');
  43. });
  44. beforeEach(function () {
  45. intercept('/receiveGoods/getPurchase', function ({search, reply}) {
  46. generateNetworkResult({
  47. search,
  48. reply,
  49. basicData,
  50. title: 'orderCode',
  51. skipCondition: name => name === 'type',
  52. });
  53. });
  54. intercept('/receiveGoods/timeoutPurchase', function ({search, reply}) {
  55. generateNetworkResult({
  56. search,
  57. reply,
  58. basicData,
  59. title: 'orderCode',
  60. skipCondition: name => name === 'type',
  61. replaceValue: 'timeout',
  62. });
  63. });
  64. });
  65. it('table', function () {
  66. validateTableList('purchase_order_table');
  67. validateTableSearch(
  68. 'purchase_order_table',
  69. [
  70. 'orderCode',
  71. {
  72. id: 'type',
  73. type: 'select',
  74. value: 'timeout',
  75. eq: 1,
  76. defaultValue: '全部',
  77. },
  78. ],
  79. {
  80. toolId: 'purchase_filter',
  81. url: '/receiveGoods/getPurchase',
  82. },
  83. );
  84. });
  85. });