relocation.cy.ts 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127
  1. import {
  2. beforeSetup,
  3. exportIntercept,
  4. generateNetworkResult,
  5. intercept,
  6. intoMenu,
  7. selectAllFilters,
  8. successIntercept,
  9. validateDelete,
  10. validateExport,
  11. validatePut,
  12. validateTableList,
  13. validateTableSearch,
  14. } from './utils';
  15. const basicData = {
  16. id: '65',
  17. warehouseTransferId: 'YK004',
  18. warehouseTransferCode: 'YK004',
  19. askGoodsWarehouseId: 'd7f30912-8d52-47e3-b',
  20. askGoodsWarehouseName: '充电设备事业部电气半成品库',
  21. documentTime: '2023-02-10',
  22. warehouseTransferType: '移库',
  23. entryNumber: '1',
  24. supplyWarehouseId: '6062e900-b3f0-4a5a-b',
  25. supplyWarehouseName: '充电设备事业部借件库',
  26. materialId: '00000000000000012034',
  27. materialName: '酒精纸\\',
  28. materialCode: '2205010010020003',
  29. companyName: '青岛特来电智能设备有限公司',
  30. companyCode: null,
  31. wbs: '1',
  32. measurementId: null,
  33. num: '100',
  34. outNum: '100',
  35. type: '0',
  36. warehouseWhere: null,
  37. startTime: null,
  38. endTime: null,
  39. page: 0,
  40. limit: 0,
  41. uniqueCode: null,
  42. accountSleeve: '8130',
  43. partType: null,
  44. askType: null,
  45. suppType: null,
  46. isRecommend: null,
  47. };
  48. describe('移库单明细', function () {
  49. beforeEach(function () {
  50. beforeSetup();
  51. intoMenu('库内管理', '移库单明细');
  52. });
  53. beforeEach(function () {
  54. intercept('/queryList/getWarehouseTransfer', function ({reply, search}) {
  55. generateNetworkResult({
  56. search,
  57. reply,
  58. basicData,
  59. title: 'warehouseTransferCode',
  60. });
  61. });
  62. exportIntercept('/queryList/getWarehouseTransferExcel');
  63. successIntercept('/warehouseTransfer/delWarehouseTransfer');
  64. });
  65. it('table', function () {
  66. selectAllFilters('relocation_filter', 10);
  67. validateTableList('relocation_table');
  68. validateTableSearch(
  69. 'relocation_table',
  70. [
  71. 'warehouseTransferCode',
  72. 'materialCode',
  73. 'materialName',
  74. {
  75. id: 'askGoodsWarehouseId',
  76. type: 'select',
  77. value: '2bdf33b8-4326-47e8-b',
  78. },
  79. {
  80. id: 'supplyWarehouseId',
  81. type: 'select',
  82. value: '2bdf33b8-4326-47e8-b',
  83. },
  84. {
  85. id: 'companyCode',
  86. type: 'select',
  87. value: '8130',
  88. },
  89. 'warehouseTransferType',
  90. 'wbs',
  91. 'entryNumber',
  92. {id: 'startTime', type: 'date'},
  93. ],
  94. {
  95. toolId: 'relocation_filter',
  96. url: '/queryList/getWarehouseTransfer',
  97. },
  98. );
  99. });
  100. it('operation', function () {
  101. const {validateAdd} = validatePut('relocation_modal', 'relocation_table', {
  102. label: '移库单',
  103. });
  104. validateAdd([
  105. 'transferNoticeOrderId',
  106. 'transferNoticeOrderNo',
  107. {type: 'keySelect', id: 'materialId'},
  108. {type: 'field', id: 'orderCount', value: '10'},
  109. {type: 'keySelect', id: 'measUnitId'},
  110. {type: 'keySelect', id: 'requestWarehouseId'},
  111. {type: 'keySelect', id: 'supplyWarehouseId'},
  112. {type: 'keySelect', id: 'accountSleeve'},
  113. 'entryNo',
  114. 'WBS',
  115. ]);
  116. validateExport('relocation_table');
  117. validateDelete('relocation_table', '移库单', {eq: 0, title: 'page-1'});
  118. });
  119. });