productReport.cy.ts 3.0 KB

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