Procházet zdrojové kódy

test: 增加半成品出库明细

xyh před 2 roky
rodič
revize
0afc0e1d81

+ 114 - 0
cypress/e2e/semiOutStream.cy.ts

@@ -0,0 +1,114 @@
+import {
+  beforeSetup,
+  exportIntercept,
+  generateNetworkResult,
+  intercept,
+  intoMenu,
+  selectAllFilters,
+  validateExport,
+  validateTableList,
+  validateTableSearch,
+} from './utils';
+
+const basicData = {
+  id: '16',
+  askGoodsId: 'BCP001',
+  entryNumber: null,
+  productionCode: null,
+  storageLocationName: null,
+  userName: 'PDA',
+  realName: 'PDA测试',
+  materialId: null,
+  wbs: '1',
+  measurementId: null,
+  num: '1',
+  outNum: null,
+  askGoodsCode: 'BCP001',
+  companyNumber: null,
+  companyCode: null,
+  sqrq: null,
+  departmentId: null,
+  departmentName: null,
+  department: '柜体组装班组',
+  departmentCode: null,
+  name: null,
+  code: null,
+  sourceType: null,
+  moveType: null,
+  materialName: '瑞银;一体式电表;DJZ1226;600A',
+  materialCode: '5TK540010437W87',
+  uniqueCode: null,
+  storageLocationCode: null,
+  supplierId: null,
+  serial: null,
+  type: null,
+  userId: '36',
+  scrq: '2023-04-11 11:11:42',
+  supplierName: null,
+  producDate: null,
+  wllbCode: '5TK540010437W87',
+  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: null,
+  storageCode: 'CK2304110001',
+  accountSleeve: '8130',
+  inventoryId: null,
+  storageLocationCodeRk: null,
+  accountName: '青岛特来电智能设备有限公司',
+  requestTypeNumber: null,
+  requestTypeName: null,
+  ifCommodity: null,
+  amount: null,
+};
+
+describe('半成品出库明细', function () {
+  beforeEach(function () {
+    beforeSetup();
+    intoMenu('出库管理', '半成品出库明细');
+  });
+
+  beforeEach(function () {
+    intercept('/askGoods/getRemovalHalfProduct', function ({reply, search}) {
+      generateNetworkResult({search, reply, basicData, title: 'askGoodsCode'});
+    });
+
+    exportIntercept('/askGoods/getRemovalHalfProductExcel');
+  });
+
+  it('table', function () {
+    selectAllFilters('semi_out_stream_filter', 10);
+    validateTableList('semi_out_stream_table');
+    validateTableSearch(
+      'semi_out_stream_table',
+      [
+        'askGoodsCode',
+        'storageCode',
+        'wllbCode',
+        'materialName',
+        'userName',
+        'realName',
+        {id: 'departmentCode', type: 'select', value: '00029999'},
+        'wbs',
+        {id: 'startTime', type: 'date'},
+        {id: 'accountSleeve', type: 'select', value: '8130'},
+      ],
+      {
+        toolId: 'semi_out_stream_filter',
+        url: '/askGoods/getRemovalHalfProduct',
+      },
+    );
+
+    validateExport('semi_out_stream_table');
+  });
+});

+ 1 - 1
packages/app/src/models/request/rawMaterial.ts

@@ -47,7 +47,7 @@ export type GetSemiOutStreamListParams = {
   /** 领用部门 */
   departmentCode: string;
   /** 要货单 */
-  askGoodsId: string;
+  askGoodsCode: string;
   /** 真实姓名 */
   realName: string;
   /** 所属公司 */

+ 1 - 1
packages/app/src/pages/semi-out-stream/context.ts

@@ -17,7 +17,7 @@ export const contextState: OriginalListParams<GetSemiOutStreamListParams> = {
   storageCode: '',
   departmentCode: '',
   wbs: '',
-  askGoodsId: '',
+  askGoodsCode: '',
   realName: '',
   accountSleeve: '',
 };

+ 2 - 1
packages/app/src/pages/semi-out-stream/filter/index.tsx

@@ -22,7 +22,7 @@ const Filter: FC = function () {
       storageCode: '',
       departmentCode: '',
       wbs: '',
-      askGoodsId: '',
+      askGoodsCode: '',
       realName: '',
       accountSleeve: '',
     },
@@ -56,6 +56,7 @@ const Filter: FC = function () {
         isSearching={isSearching}
         sourceMap={sourceMap}
         fixedMap={fixedMap}
+        testId='semi_out_stream_filter'
       />
 
       <FilterSelectorModal

+ 1 - 1
packages/app/src/pages/semi-out-stream/filter/state.ts

@@ -27,7 +27,7 @@ export const sourceMap: FilterGroupMap<typeof contextState> = new Map([
 ]);
 
 export const fixedMap: MapValue<typeof contextState>[] = [
-  {label: '要货单', type: 'field', value: 'askGoodsId'},
+  {label: '领料单编号', type: 'field', value: 'askGoodsCode'},
   {label: '出库编号', type: 'field', value: 'storageCode'},
   {label: '物料编号', type: 'field', value: 'wllbCode'},
   {label: '物料名称', type: 'field', value: 'materialName'},

+ 3 - 3
packages/app/src/pages/semi-out-stream/table/index.tsx

@@ -23,9 +23,9 @@ import {
 
 const columns: ColumnsType<SemiOutStreamListData> = [
   {
-    title: '要货单',
-    dataIndex: 'askGoodsId',
-    key: 'askGoodsId',
+    title: '领料单编号',
+    dataIndex: 'askGoodsCode',
+    key: 'askGoodsCode',
     width: MIDDLE_TABLE_WIDTH,
   },
   {