semiReport.cy.ts 3.4 KB

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