Prechádzať zdrojové kódy

fix: 半成品入库接口调整

xyh 2 rokov pred
rodič
commit
4a4f68031c

+ 10 - 10
packages/app/src/apis/semiManufactures.ts

@@ -63,16 +63,16 @@ export async function semiManufacturesAdd(
 
   // 成功后触发成功回传
   // 触发向gs回调接口
-  if (result.msg === '200' && ENABLED_GS) {
-    const {realName} = userStore.getState();
-
-    request({
-      method: 'GET',
-      url: '/gsPlugOut/CreateGRReqInStock',
-      data: {removalCode: result.data, realName: realName ?? '李兆峰'},
-      skipError: true,
-    });
-  }
+  // if (result.msg === '200' && ENABLED_GS) {
+  //   const {realName} = userStore.getState();
+
+  //   request({
+  //     method: 'GET',
+  //     url: '/gsPlugOut/CreateGRReqInStock',
+  //     data: {removalCode: result.data, realName: realName ?? '李兆峰'},
+  //     skipError: true,
+  //   });
+  // }
 
   return result;
 }

+ 6 - 0
packages/app/src/models/request/semiManufactures.ts

@@ -69,6 +69,12 @@ export type SemiManufacturesAddParams = {
   wllbCode: string;
   /** 所属库位id */
   storageLocationCode: string;
+  /** 日期 */
+  producBatch: string;
+  /** 分录号 */
+  entryNumber: string;
+  /** 用户名称 */
+  userName: string;
 };
 
 /** 半成品出库 */

+ 15 - 1
packages/app/src/pages/semi-report/table/put-in-modal/hooks.ts

@@ -4,6 +4,7 @@ import {NoticeListData} from '@models';
 import {userStore} from '@stores';
 import {useMutation, useQueryClient} from '@tanstack/react-query';
 import {message} from 'antd';
+import dayjs from 'dayjs';
 import {useEffect, useMemo} from 'react';
 import {useForm} from 'react-hook-form';
 import {object, string} from 'yup';
@@ -79,12 +80,22 @@ export function useFormState({
   });
 
   const userId = useStore(userStore, state => String(state.id));
+  const userName = useStore(userStore, state => state.realName);
 
   const onSubmit = handleSubmit(function({location}) {
     if (!data)
       return message.error('未获取到报工单信息');
 
-    const {companyNumber, materialId, noticeId, wbs, wllbClass, wllbCode, num}
+    const {
+      companyNumber,
+      materialId,
+      noticeId,
+      wbs,
+      wllbClass,
+      wllbCode,
+      num,
+      entryNumber,
+    }
       = data;
 
     mutate({
@@ -97,6 +108,9 @@ export function useFormState({
       userId,
       warehousingNum: num,
       storageLocationCode: location,
+      entryNumber,
+      userName,
+      producBatch: dayjs().format('YYYYMMDD'),
     });
   });