123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179 |
- import {
- beforeSetup,
- exportIntercept,
- generateNetworkResult,
- intercept,
- intoMenu,
- selectAllFilters,
- selectClick,
- successIntercept,
- validateDelete,
- validateExport,
- validatePut,
- validateTableList,
- validateTableSearch,
- } from './utils';
- const basicData = {
- id: '57',
- askGoodsId: 'LLDID123',
- entryNumber: '1234',
- productionCode: 'LLDCODE123',
- storageLocationName: null,
- userName: null,
- realName: null,
- materialId: '00000000000000012522',
- wbs: '111',
- measurementId: null,
- num: '2',
- outNum: '0',
- askGoodsCode: 'LLDCODE123',
- companyNumber: '8130',
- companyCode: null,
- sqrq: '2023-04-13',
- departmentId: null,
- departmentName: '采购中心(公共) ',
- department: null,
- departmentCode: null,
- name: null,
- code: null,
- sourceType: '8',
- moveType: '207',
- materialName: '加强筋;8T.K42.600.0210',
- materialCode: '8TK426000210',
- uniqueCode: null,
- storageLocationCode: null,
- supplierId: null,
- serial: null,
- type: null,
- userId: null,
- scrq: null,
- supplierName: null,
- producDate: null,
- wllbCode: null,
- page: 0,
- limit: 0,
- askGoodsType: null,
- startTime: null,
- endTime: null,
- process: null,
- askGoodsApplyType: null,
- partType: null,
- attribute: null,
- deliveryId: null,
- customerName: null,
- customerCode: null,
- warehouseWhere: null,
- companyName: '青岛特来电智能设备有限公司',
- storageCode: null,
- accountSleeve: null,
- inventoryId: null,
- storageLocationCodeRk: null,
- accountName: null,
- requestTypeNumber: null,
- requestTypeName: null,
- ifCommodity: null,
- amount: '0',
- };
- describe('生产领料明细', function() {
- beforeEach(function() {
- beforeSetup();
- intoMenu('出库管理', '生产领料明细');
- });
- beforeEach(function() {
- intercept('/queryList/getAskGoods', function({reply, search}) {
- generateNetworkResult({
- search,
- reply,
- basicData,
- title: 'askGoodsId',
- skipCondition: name => name === 'type',
- });
- });
- intercept('/queryList/getInvite', function({reply, search}) {
- generateNetworkResult({
- search,
- reply,
- basicData,
- title: 'askGoodsId',
- skipCondition: name => name === 'type',
- });
- });
- successIntercept(['/askGoods/delAskGoods', '/invite/delAskGoods']);
- exportIntercept([
- '/queryList/getAskGoodsExcel',
- '/queryList/getInviteExcel',
- ]);
- });
- function validateTable(label?: string, callback?: () => void) {
- selectAllFilters('production_requisition_filter', 11);
- validateTableList('production_requisition_table');
- validateTableSearch(
- 'production_requisition_table',
- [
- 'askGoodsCode',
- 'productionCode',
- 'materialCode',
- 'materialName',
- {id: 'companyCode', type: 'select', value: '8130'},
- {id: 'departmentCode', type: 'select', value: '00029999'},
- 'moveType',
- 'sourceType',
- 'entryNumber',
- 'wbs',
- ],
- {
- toolId: 'production_requisition_filter',
- url: '/queryList/getAskGoods',
- },
- );
- // eslint-disable-next-line callback-return
- callback?.();
- validateExport('production_requisition_table');
- const {validateAdd} = validatePut(
- 'production_requisition_modal',
- 'production_requisition_table',
- {label: label ?? '生产领料单'},
- );
- validateAdd([
- 'requestOrderId',
- 'requestOrderNo',
- 'prodOrderNo',
- 'requestTypeName',
- 'requestTypeNumber',
- {id: 'materialId', type: 'keySelect'},
- {id: 'measUnitId', type: 'keySelect'},
- {id: 'orderCount', type: 'field', value: '10'},
- {id: 'companyNo', type: 'keySelect'},
- {id: 'ifCommodity', type: 'select'},
- {id: 'useDepartment', type: 'select'},
- 'entryNumber',
- 'WBS',
- ]);
- validateDelete('production_requisition_table', label ?? '生产领料单', {
- eq: 0,
- title: basicData.askGoodsCode,
- });
- }
- it('table', () => validateTable());
- it('non-standard table', function() {
- selectClick('filter_type', 1);
- cy.getTestId('search_btn').click();
- validateTable('非生产领料单', function() {
- selectClick('filter_type', 1);
- cy.getTestId('search_btn').click();
- });
- });
- });
|