productReport.cy.ts 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137
  1. import {
  2. beforeSetup,
  3. generateNetworkResult,
  4. intercept,
  5. intoMenu,
  6. selectAllFilters,
  7. successIntercept,
  8. validateDelete,
  9. validateExport,
  10. validatePut,
  11. validateTableList,
  12. validateTableSearch,
  13. } from './utils';
  14. const basicData = {
  15. id: '26',
  16. noticeId: 'TGD01202303230001',
  17. noticeCode: 'TGD01202303230001',
  18. companyNumber: '8130',
  19. noticeTime: '2023-04-12',
  20. sourceType: 'G',
  21. moveType: '104',
  22. entryNumber: '1',
  23. productionCode: 'DD01',
  24. materialId: '00000000000000012034',
  25. wbs: '',
  26. measurementId: '00000000000000000001',
  27. num: '20',
  28. type: '0',
  29. warehousingNum: '0',
  30. page: 0,
  31. limit: 0,
  32. startTime: null,
  33. endTime: null,
  34. materialName: '酒精纸\\',
  35. companyName: '青岛特来电智能设备有限公司',
  36. wllbClass: null,
  37. materialCode: null,
  38. userId: null,
  39. askGoodsId: null,
  40. wllbCode: '2205010010020003',
  41. serial: null,
  42. producBatch: null,
  43. attribute: null,
  44. storageLocationCode: null,
  45. storageLocationName: null,
  46. storageCode: null,
  47. seq: null,
  48. userName: null,
  49. realName: null,
  50. scrq: null,
  51. uniqueCode: null,
  52. partType: null,
  53. supplierId: null,
  54. capacity: null,
  55. accountName: null,
  56. wmsItemId: null,
  57. wmsId: null,
  58. code: null,
  59. name: null,
  60. warehouseWhere: null,
  61. };
  62. describe('成品报工单管理', function() {
  63. beforeEach(function() {
  64. beforeSetup();
  65. intoMenu('入库管理', '产成品报工单');
  66. });
  67. beforeEach(function() {
  68. intercept('/warehousing/getNotice', function({search, reply}) {
  69. generateNetworkResult({
  70. search,
  71. reply,
  72. basicData,
  73. title: 'productionCode',
  74. skipCondition: name => name === 'partType',
  75. });
  76. });
  77. successIntercept([
  78. '/warehousing/addInventoryNotice',
  79. '/warehousing/delInventoryNotice',
  80. ]);
  81. });
  82. it('table', function() {
  83. selectAllFilters('product_report_filter', 10);
  84. validateTableList('product_report_table');
  85. validateTableSearch(
  86. 'product_report_table',
  87. [
  88. 'productionCode',
  89. 'noticeCode',
  90. 'materialName',
  91. 'wllbCode',
  92. {id: 'endTime', type: 'date'},
  93. 'entryNumber',
  94. {id: 'companyNumber', type: 'select', value: '8130'},
  95. 'moveType',
  96. 'sourceType',
  97. {id: 'type', type: 'select', value: '0'},
  98. ],
  99. {toolId: 'product_report_filter', url: '/warehousing/getNotice'},
  100. );
  101. });
  102. it('operation', function() {
  103. const {validateAdd} = validatePut(
  104. 'product_report_modal',
  105. 'product_report_table',
  106. {label: '报工单'},
  107. );
  108. validateAdd([
  109. 'stockInNoticeId',
  110. 'stockInNoticeNo',
  111. 'prodOrderNo',
  112. {id: 'materialId', type: 'keySelect'},
  113. 'notificationTypeName',
  114. 'notificationTypeNumber',
  115. {id: 'measUnitId', type: 'keySelect'},
  116. {id: 'orderCount', type: 'field', value: '10'},
  117. {id: 'companyNo', type: 'keySelect'},
  118. 'entryNumber',
  119. 'WBS',
  120. ]);
  121. validateDelete('product_report_table', '产成品报工单', {
  122. title: basicData.noticeCode,
  123. eq: 0,
  124. });
  125. validateExport('product_report_table');
  126. });
  127. });