semiReport.cy.ts 3.3 KB

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