Parcourir la source

commit 入库

xkwg il y a 4 ans
Parent
commit
7556c07eff

+ 26 - 0
public/proto/mtp.proto

@@ -1099,5 +1099,31 @@ message AuditERMCPAreaInOutStockApplyRsp {
      optional uint64 InOutApplyID = 4; // uint64 申请ID
 }
 
+// 机构出入库申请请求 0 29 137
+message ERMCPAreaInOutStockApplyReq {
+	optional MessageHead Header = 1; // MessageHead
+	optional uint64 UserID = 2; // uint64 机构ID
+	optional int32 InOutType = 3; // int32 出入库类型 - 1:采购入库 2:销售出库 3:生产入库 4:生产出库
+	optional uint64 WRStandardID = 4; // uint64 现货商品ID
+	optional uint64 SpotGoodsModelID = 5; // uint64 现货型号ID
+	optional uint64 SpotGoodsBrandID = 6; // uint64 现货品牌ID
+	optional uint64 DeliveryGoodsID = 7; // uint64 现货品种ID
+	optional uint64 SpotContractID = 8; // uint64 关联现货合同ID [1:采购入库 2:销售出库 ](1,2状态必填)
+	optional uint64 WarehouseInfo = 9; // uint64 现货仓库ID
+	optional double Qty = 10; // double 数量
+	optional int32 ApplySrc = 11; // int32 申请来源 - 1:管理端 2:终端
+	optional uint64 ApplyId = 12; // uint64 申请人
+	optional string ApplyRemark = 13; // string 申请备注
+}
+
+// 机构出入库申请响应 0 29 138
+message ERMCPAreaInOutStockApplyRsp {
+	optional MessageHead Header = 1; // MessageHead 消息头
+	optional int32 RetCode = 2; // int32 返回码
+	optional string RetDesc = 3; // string 描述信息
+	optional uint64 InOutApplyID = 4; // uint64 申请ID
+}
+
+
 
 

+ 4 - 0
src/services/funcode/index.ts

@@ -88,6 +88,10 @@ export const funCode: Code = {
     ContractOperateApplyReq: 1179656, // 合同操作请求(1179656)
     ContractOperateApplyRsp: 1179657, // 合同操作响应(1179657)
 
+    // 机构出入库
+    ERMCPAreaInOutStockApplyReq: 1900681, /// 机构出入库申请请求(1966081)
+    ERMCPAreaInOutStockApplyRsp: 1900682,/// 机构出入库申请响应
+
     // 套保计划 -- 新增套保计划
     ErmcpHedgePlanReq: 1900708,  /// 套保计划操作请求(1179650)
     ErmcpHedgePlanRsp: 1900709,  /// 套保计划操作响应(1179651)

+ 1 - 1
src/services/proto/hedgeplan/interface.ts

@@ -1,6 +1,6 @@
 // 套保计划请求 0 29 164
 export interface ErmcpHedgePlanReq {
-    HedgePlanID: number // uint64 套保计划ID(601+Unix秒时间戳(10位)+xxxxxx)
+    HedgePlanID?: number // uint64 套保计划ID(601+Unix秒时间戳(10位)+xxxxxx)
     HedgePlanNo?: string // string 套保计划名称
     ContractType?: number // int32 计划类型-1:采购-1:销售
     AreaUserID?: number// uint64 机构ID

+ 37 - 1
src/services/proto/warehouse/index.ts

@@ -2,12 +2,13 @@ import APP from "@/services";
 import { Callback } from "@/utils/websocket";
 import { getSelectedAccountId, getUserId } from "@/services/bus/account";
 import {
-    AreaInOutApplyAuditPassReq, AuditERMCPAreaInOutStockApplyReq,
+    AreaInOutApplyAuditPassReq, AuditERMCPAreaInOutStockApplyReq, ERMCPAreaInOutStockApplyReq,
     WarehouseApplyReq,
     WarehouseStateChangeReq
 } from "@/services/proto/warehouse/interface";
 import {getUUID} from "@/utils/qt/common";
 import {buildProtoReq50, parseProtoRsp50} from "@/services/socket/protobuf/buildReq";
+import {getLongTypeLoginID} from "@/services/bus/login";
 
 /**
  * 新增 / 修改 仓库信息请求  修改需要传仓库id
@@ -144,3 +145,38 @@ export const refuseStockApplyReq = (param: AuditERMCPAreaInOutStockApplyReq): Pr
         } as Callback);
     });
 }
+
+/**
+ * 出入库申请
+ * @param param
+ */
+export const ermcpInOutStockApplyReq = (param: ERMCPAreaInOutStockApplyReq): Promise<any> => {
+    param.UserID = getUserId()
+    param.ApplySrc = 2
+    param.ApplyId = Number(getLongTypeLoginID())
+
+    return new Promise((resolve, reject) => {
+        const params = {
+            protobufName: 'ERMCPAreaInOutStockApplyReq',
+            funCodeName: 'ERMCPAreaInOutStockApplyReq',
+            reqParams: param,
+            msgHeadParams: {
+                AccountID: getSelectedAccountId(),
+                MarketID: 18,
+                GoodsID: 0,
+            }
+        };
+        const package50 = buildProtoReq50(params);
+        APP.sendTradingServer(package50, undefined, {
+            onSuccess: (res) => {
+                const { isSuccess, result } = parseProtoRsp50(res, 'ERMCPAreaInOutStockApplyRsp');
+                if (isSuccess) {
+                    resolve(result);
+                } else {
+                    reject(result);
+                }
+            },
+            onFail: (err) => reject(err.message),
+        } as Callback);
+    });
+}

+ 25 - 0
src/services/proto/warehouse/interface.ts

@@ -59,3 +59,28 @@ export interface  AuditERMCPAreaInOutStockApplyRsp {
     RetDesc: string; // string 描述信息
     InOutApplyID: number; // uint64 申请ID
 }
+
+// 机构出入库申请请求 0 29 137
+export interface ERMCPAreaInOutStockApplyReq {
+    UserID?: number; // uint64 机构ID
+    InOutType: number; // int32 出入库类型 - 1:采购入库 2:销售出库 3:生产入库 4:生产出库
+    WRStandardID: number; // uint64 现货商品ID
+    SpotGoodsModelID?: number; // uint64 现货型号ID
+    SpotGoodsBrandID: number; // uint64 现货品牌ID
+    DeliveryGoodsID: number; // uint64 现货品种ID
+    SpotContractID: number; // uint64 关联现货合同ID [1:采购入库 2:销售出库 ](1,2状态必填)
+    WarehouseInfo: number; // uint64 现货仓库ID
+    Qty: number; // double 数量
+    ApplySrc?: number; // int32 申请来源 - 1:管理端 2:终端
+    ApplyId?: number; // uint64 申请人
+    ApplyRemark?: string; // string 申请备注
+}
+
+// 机构出入库申请响应 0 29 138
+export interface ERMCPAreaInOutStockApplyRsp {
+    RetCode: number; // int32 返回码
+    RetDesc: string; // string 描述信息
+    InOutApplyID: number; // uint64 申请ID
+}
+
+

+ 32 - 6
src/views/business/plan/components/add/index.vue

@@ -143,14 +143,21 @@
 <script lang="ts">
 import { defineComponent, ref, toRaw } from 'vue';
 import { closeModal } from '@/common/setup/modal/index';
-import { initData } from '@/common/methods/index';
+import {formatTime, initData} from '@/common/methods/index';
 import { getPayCurrencyTypeEnumList, getSpotContractTypeEnumList } from '@/common/constants/enumsList';
 import { AllEnums } from '@/services/go/commonService/interface';
 import { getAllEnum } from '@/services/bus/allEnum';
-import { getMiddleGoodsD, handleForm, handleTrader } from '../setup';
+import {changeStatus, getMiddleGoodsD, handleForm, handleTrader} from '../setup';
 import { ValidateErrorEntity } from 'ant-design-vue/lib/form/interface';
 import { FormState } from '@/views/information/spot-contract/components/interface';
 import { context } from 'ant-design-vue/lib/vc-image/src/PreviewGroup';
+import {ErmcpHedgePlanReq} from "@/services/proto/hedgeplan/interface";
+import {hedgePlanReq} from "@/services/proto/hedgeplan";
+import {getLongTypeLoginID} from "@/services/bus/login";
+import {LongType} from "@/services/socket/login/interface";
+import moment from "moment";
+import APP from "@/services";
+import * as Long from "long";
 
 export default defineComponent({
     name: 'add-custom',
@@ -174,10 +181,29 @@ export default defineComponent({
                 .validate()
                 .then(() => {
                     const param = toRaw(formState);
-                    // addAction(param).then(() => {
-                    //     cancel();
-                    //     context.emit('refresh', true);
-                    // });
+                    const loginId = getLongTypeLoginID() as LongType;
+                    const userid = APP.get('userAccount').memberuserid;
+                    const reqParam: ErmcpHedgePlanReq = {
+                        HedgePlanNo: param.HedgePlanNo, // 计划类型
+                        ContractType: param.ContractType, // 计划类型
+                        DeliveryGoodsID: Number(param.DeliveryGoodsID),
+                        WRStandardID: Number(param.WRStandardID), // 现货品种
+                        PlanQty: Number(param.PlanQty),  // 计划数量
+                        OperateType: OperateType,
+                        Currencyid: param.Currencyid,
+                        ApplyId: Number(loginId),
+                        PlanTime: formatTime(moment(), "s"),
+                        ProductType: 1,
+                        Biztype: 1,
+                        AreaUserID: userid,
+                        Remark: param.Remark,
+                        Tradeuserid: param.Tradeuserid, // 交易用户id
+                    }
+                    changeStatus(reqParam, OperateType, loading)
+                    .then(() => {
+                        cancel();
+                        context.emit('refresh', true);
+                    });
                     console.log('param', param);
                 })
                 .catch((error: ValidateErrorEntity<FormState>) => {

+ 3 - 3
src/views/business/plan/setup.ts

@@ -8,10 +8,10 @@ export function getPlanContractType(contracttype: number): string{
     let result = "--";
     switch (contracttype) {
         case 1:
-            result = "套保采购计划";
+            result = "采购";
             break
-        case 2:
-            result = "套保销售计划";
+        case -1:
+            result = "销售";
             break
     }
     return result

+ 11 - 0
src/views/business/purchase/components/setup.ts

@@ -20,6 +20,8 @@ import {purchaseStateSign} from "@/views/business/purchase/setup";
 import {hedgePlanReq} from "@/services/proto/hedgeplan";
 import {Ref} from "vue";
 import {objectToUint8Array} from "@/utils/objHandle";
+import {ermcpInOutStockApplyReq} from "@/services/proto/warehouse";
+import {ERMCPAreaInOutStockApplyReq} from "@/services/proto/warehouse/interface";
 
 /**
  * 这里负责 点价登记, 交收登记, 款项登记, 发票登记, 入库登记
@@ -63,6 +65,15 @@ export function invoiceReq(spotcontractid: string, req: InvoiceReq, loading: Ref
         loading)
 }
 
+/**
+ * 入库登记
+ */
+export function storageReq(req: ERMCPAreaInOutStockApplyReq, loading: Ref<boolean>): Promise<string>{
+    const sign = getRequestResultInfo(purchaseStateSign, 5)  // 接口请求后的返回提示 这里统一进行管理
+    const result = ermcpInOutStockApplyReq(req)
+    return commonResultInfo(result, sign, loading)
+}
+
 
 /**
  * 请求报文组装

+ 34 - 3
src/views/business/purchase/components/storage/index.vue

@@ -16,17 +16,48 @@
 </template>
 
 <script lang="ts">
-import { defineComponent, ref } from 'vue';
+import {defineComponent, PropType, ref} from 'vue';
 import { closeModal } from '@/common/setup/modal/index';
+import {SomePriceReq} from "@/services/proto/contract/interface";
+import {somePriceReq, storageReq} from "@/views/business/purchase/components/setup";
+import {Ermcp3SellBuyContract} from "@/services/go/ermcp/purchase/interface";
+import {ERMCPAreaInOutStockApplyReq} from "@/services/proto/warehouse/interface";
+import * as Long from "long";
 
 export default defineComponent({
     name: 'purchase_pending_storage',
     components: {},
-    setup() {
+    props: {
+        selectedRow: {
+            type: Object as PropType<Ermcp3SellBuyContract>,
+            default: {},
+        },
+    },
+    setup(props, context) {
         const { visible, cancel } = closeModal('purchase_pending_storage');
         const loading = ref<boolean>(false);
         function submit() {
-            cancel();
+
+            const params : ERMCPAreaInOutStockApplyReq = {
+                InOutType: 1,  //  1:采购入库 2:销售出库 3:生产入库 4:生产出库
+                WRStandardID: props.selectedRow.wrstandardid,  //品类ID
+                SpotGoodsBrandID: props.selectedRow.spotgoodsbrandid,  //现货品牌ID(DGFactoryItem表的ID)
+                DeliveryGoodsID: props.selectedRow.deliverygoodsid,  //现货商品ID
+                SpotContractID: Long.fromString(props.selectedRow.spotcontractid),  //合同ID
+                WarehouseInfo: 8,   // uint64 现货仓库ID
+                Qty: 10,  // double 数量
+                ApplyRemark: "",  // string 申请备注
+            }
+            // 入库
+            storageReq(
+                params, loading)
+                .then(res => {
+                    cancel()
+                    context.emit('refresh')
+                })
+                .catch(err => {
+
+                })
         }
         return {
             visible,

+ 2 - 1
src/views/business/purchase/setup.ts

@@ -23,10 +23,11 @@ export function getPriceTypeName(pricetype: number): string {
 /************** 接口相关提示 **************** /
  *
  */
-// 登记操作 点价登记, 交收登记, 款项登记, 发票登记
+// 登记操作 点价登记, 交收登记, 款项登记, 发票登记 , 入库登记
 export const purchaseStateSign = new Map<number, ResultInfo>([
     [1, ['点价登记成功', '点价登记失败:']],
     [2, ['交收登记成功', '交收登记失败:']],
     [3, ['款项登记成功', '款项登记失败:']],
     [4, ['发票登记成功', '发票登记失败:']],
+    [5, ['入库登记成功', '入库登记失败:']],
 ])