import { beforeSetup, generateNetworkResult, intercept, intoMenu, selectAllFilters, successIntercept, validateDelete, validatePut, validateTableList, validateTableSearch, } from './utils'; const basicData = { id: '26', noticeId: 'TGD01202303230001', noticeCode: 'TGD01202303230001', companyNumber: '8130', noticeTime: '2023-04-12', sourceType: 'G', moveType: '104', entryNumber: '1', productionCode: 'DD01', materialId: '00000000000000012034', wbs: '', measurementId: '00000000000000000001', num: '20', type: '0', warehousingNum: '0', page: 0, limit: 0, startTime: null, endTime: null, materialName: '酒精纸\\', companyName: '青岛特来电智能设备有限公司', wllbClass: null, materialCode: null, userId: null, askGoodsId: null, wllbCode: '2205010010020003', serial: null, producBatch: null, attribute: null, storageLocationCode: null, storageLocationName: null, storageCode: null, seq: null, userName: null, realName: null, scrq: null, uniqueCode: null, partType: null, supplierId: null, capacity: null, accountName: null, wmsItemId: null, wmsId: null, code: null, name: null, warehouseWhere: null, }; describe('成品报工单管理', function () { beforeEach(function () { beforeSetup(); intoMenu('入库管理', '产成品报工单'); }); beforeEach(function () { intercept('/warehousing/getNotice', function ({search, reply}) { generateNetworkResult({ search, reply, basicData, title: 'productionCode', skipCondition: name => name === 'partType', }); }); successIntercept([ '/warehousing/addInventoryNotice', '/warehousing/delInventoryNotice', ]); }); it('table', function () { selectAllFilters('product_report_filter', 10); validateTableList('product_report_table'); validateTableSearch( 'product_report_table', [ 'productionCode', 'noticeCode', 'materialName', 'wllbCode', {id: 'endTime', type: 'date'}, 'entryNumber', {id: 'companyNumber', type: 'select', value: '8130'}, 'moveType', 'sourceType', {id: 'type', type: 'select', value: '0'}, ], {toolId: 'product_report_filter', url: '/warehousing/getNotice'}, ); }); it('operation', function () { const {validateAdd} = validatePut( 'product_report_modal', 'product_report_table', {label: '报工单'}, ); validateAdd([ 'stockInNoticeId', 'stockInNoticeNo', 'prodOrderNo', {id: 'materialId', type: 'keySelect'}, 'notificationTypeName', 'notificationTypeNumber', {id: 'measUnitId', type: 'keySelect'}, {id: 'orderCount', type: 'field', value: '10'}, {id: 'companyNo', type: 'keySelect'}, 'entryNumber', 'WBS', ]); validateDelete('product_report_table', '产成品报工单', { title: basicData.noticeCode, eq: 0, }); }); });