semiDraw.cy.ts 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161
  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: '56',
  18. askGoodsId: 'BCP001',
  19. entryNumber: '1',
  20. productionCode: 'DD01',
  21. storageLocationName: null,
  22. userName: null,
  23. realName: null,
  24. materialId: '00000000000000072550',
  25. wbs: '1',
  26. measurementId: null,
  27. num: '20',
  28. outNum: '3',
  29. askGoodsCode: 'CODE123',
  30. companyNumber: '8130',
  31. companyCode: null,
  32. sqrq: '2023-04-11',
  33. departmentId: null,
  34. departmentName: null,
  35. department: '柜体组装班组',
  36. departmentCode: null,
  37. name: null,
  38. code: null,
  39. sourceType: '8',
  40. moveType: '207',
  41. materialName: '瑞银;一体式电表;DJZ1226;600A',
  42. materialCode: '5TK540010437W87',
  43. uniqueCode: null,
  44. storageLocationCode: null,
  45. supplierId: null,
  46. serial: null,
  47. type: '0',
  48. userId: null,
  49. scrq: null,
  50. supplierName: null,
  51. producDate: null,
  52. wllbCode: null,
  53. page: 0,
  54. limit: 0,
  55. askGoodsType: null,
  56. startTime: null,
  57. endTime: null,
  58. process: null,
  59. askGoodsApplyType: null,
  60. partType: null,
  61. attribute: null,
  62. deliveryId: null,
  63. customerName: null,
  64. customerCode: null,
  65. warehouseWhere: null,
  66. companyName: '青岛特来电智能充电设备有限公司',
  67. storageCode: null,
  68. accountSleeve: null,
  69. inventoryId: null,
  70. storageLocationCodeRk: null,
  71. accountName: null,
  72. requestTypeNumber: null,
  73. requestTypeName: null,
  74. ifCommodity: null,
  75. amount: '0',
  76. };
  77. describe('半成品领料单管理', function () {
  78. beforeEach(function () {
  79. beforeSetup();
  80. intoMenu('出库管理', '半成品领料单管理');
  81. });
  82. beforeEach(function () {
  83. intercept('/askGoods/getGoodsHalf', function ({reply, search}) {
  84. generateNetworkResult({
  85. search,
  86. reply,
  87. basicData,
  88. title: 'askGoodsCode',
  89. skipCondition: name => name === 'partType',
  90. });
  91. });
  92. successIntercept([
  93. '/askGoods/delAskGoods',
  94. '/warehousing/updateInventoryNotice',
  95. ]);
  96. });
  97. it('table', function () {
  98. selectAllFilters('semi_draw_filter', 11);
  99. validateTableList('semi_draw_table');
  100. validateTableSearch(
  101. 'semi_draw_table',
  102. [
  103. 'askGoodsCode',
  104. 'productionCode',
  105. 'materialCode',
  106. 'materialName',
  107. {id: 'departmentCode', type: 'select', value: '00029999'},
  108. {id: 'companyCode', type: 'select', value: '8130'},
  109. 'entryNumber',
  110. 'sourceType',
  111. 'moveType',
  112. {id: 'startTime', type: 'date'},
  113. {id: 'type', type: 'select', value: '0'},
  114. ],
  115. {
  116. toolId: 'semi_draw_filter',
  117. url: '/askGoods/getGoodsHalf',
  118. },
  119. );
  120. });
  121. it('operation', function () {
  122. const {validateAdd} = validatePut('semi_draw_modal', 'semi_draw_table', {
  123. label: '领料单',
  124. });
  125. validateAdd([
  126. 'requestOrderId',
  127. 'requestOrderNo',
  128. 'prodOrderNo',
  129. {id: 'materialId', type: 'keySelect'},
  130. 'requestTypeName',
  131. 'requestTypeNumber',
  132. {id: 'ifCommodity', type: 'select'},
  133. {id: 'measUnitId', type: 'keySelect'},
  134. {id: 'orderCount', type: 'field', value: '10'},
  135. {id: 'companyNo', type: 'keySelect'},
  136. {id: 'useDepartment', type: 'keySelect'},
  137. 'entryNumber',
  138. 'WBS',
  139. ]);
  140. validateDelete('semi_draw_table', '半成品领料单', {title: 'page-1'});
  141. // 出库
  142. tableBtnClick('semi_draw_table', 0);
  143. cy.getTestId('semi_draw_modal')
  144. .find('h3')
  145. .should('have.text', '选择库位信息');
  146. cy.getTestId('field_outNum').clear().type('10');
  147. selectClick('field_warehouse');
  148. selectClick('field_location');
  149. validateModalOperation('semi_draw_modal', '出库完成');
  150. });
  151. });