quality.cy.ts 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  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: '8',
  15. supplierId: 'EC00276',
  16. supplierName: '西安特来电智能充电科技有限公司',
  17. orderId: null,
  18. orderNumber: null,
  19. materialName: '六角螺母\\\\M16;4;彩锌;粗;GB/T41-2000\\\\',
  20. materialId: null,
  21. measurementId: null,
  22. purchaseNum: '60',
  23. arrivalNum: '60',
  24. arrivalTime: '2023-04-12',
  25. type: '0',
  26. qualifiedNum: '60',
  27. disqualificationNum: '0',
  28. orderCode: '6202023040301356',
  29. companyNumber: '8400',
  30. compName: '青岛特来电智能充电设备有限公司',
  31. wbs: '2',
  32. orderType: null,
  33. sourceType: null,
  34. entryNumber: null,
  35. moveType: null,
  36. page: 0,
  37. limit: 0,
  38. startTime: null,
  39. endTime: null,
  40. warehousingNum: null,
  41. wllbCode: '3415100010390008',
  42. };
  43. describe('质检单列表', function () {
  44. beforeEach(function () {
  45. beforeSetup();
  46. intoMenu('入库管理', '质检单列表');
  47. });
  48. beforeEach(function () {
  49. intercept('/receiveGoods/getReceiveGoods', function ({search, reply}) {
  50. generateNetworkResult({search, reply, basicData, title: 'orderCode'});
  51. });
  52. successIntercept('/receiveGoods/delReceiveGoods');
  53. });
  54. it('table', function () {
  55. selectAllFilters('quality_filter', 6);
  56. validateTableList('receive_table');
  57. validateTableSearch(
  58. 'receive_table',
  59. [
  60. 'orderCode',
  61. 'materialId',
  62. 'materialName',
  63. 'wbs',
  64. {id: 'companyNumber', type: 'select', value: '8130'},
  65. {id: 'supplierId', type: 'select', value: 'EC92255'},
  66. ],
  67. {toolId: 'quality_filter', url: '/receiveGoods/getReceiveGoods'},
  68. );
  69. });
  70. it('operation', function () {
  71. const {validateAdd} = validatePut('quality_modal', 'receive_table', {
  72. label: '质检单',
  73. });
  74. validateAdd([
  75. 'poId',
  76. 'poNo',
  77. {id: 'materialId', type: 'keySelect'},
  78. {id: 'measUnitId', type: 'keySelect'},
  79. {id: 'purchaseCount', type: 'field', value: '10'},
  80. {id: 'curOkCount', type: 'field', value: '10'},
  81. {id: 'curNgCount', type: 'field', value: '10'},
  82. {id: 'receiveCount', type: 'field', value: '10'},
  83. {id: 'supplierNo', type: 'keySelect'},
  84. {id: 'companyNo', type: 'keySelect'},
  85. {id: 'poType', type: 'select'},
  86. 'entryNumber',
  87. 'WBS',
  88. ]);
  89. validateDelete('receive_table', '质检单', {eq: 0, title: 'page-1'});
  90. });
  91. });