Ver Fonte

入库登记

huangbin há 4 anos atrás
pai
commit
d90d3813fe

+ 8 - 20
src/views/business/purchase/components/setup.ts

@@ -6,6 +6,8 @@
  *
  */
 
+import { commonResultInfo, getRequestResultInfo } from "@/common/methods/request";
+import { operationContractReq } from "@/services/proto/contract";
 import {
     ErmcpContractOperateApplyReq,
     FundsReq,
@@ -13,15 +15,10 @@ import {
     SettlementReq,
     SomePriceReq
 } from "@/services/proto/contract/interface";
-import {operationContractReq} from "@/services/proto/contract";
+import { objectToUint8Array } from "@/utils/objHandle";
+import { purchaseStateSign } from "@/views/business/purchase/setup";
 import Long from "long";
-import {commonResultInfo, getRequestResultInfo} from "@/common/methods/request";
-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";
+import { Ref } from "vue";
 
 /**
  * 这里负责 点价登记, 交收登记, 款项登记, 发票登记, 入库登记
@@ -50,7 +47,7 @@ export function settlementReq(spotcontractid: string, req: SettlementReq, loadin
 /**
  * 款项登记
  */
-export function fundsReq(spotcontractid: string, req: FundsReq, loading: Ref<boolean>,Remark:String): Promise<string> {
+export function fundsReq(spotcontractid: string, req: FundsReq, loading: Ref<boolean>, Remark: String): Promise<string> {
     return operationContractRsp(3,
         operationContractReqBuilder(req, spotcontractid, 3),
         loading)
@@ -65,15 +62,6 @@ 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)
-}
-
 
 /**
  * 请求报文组装
@@ -81,10 +69,10 @@ export function storageReq(req: ERMCPAreaInOutStockApplyReq, loading: Ref<boolea
  * @param id 操作的合同id
  * @param type 操作类型
  */
-export function operationContractReqBuilder(req: Object, id: string, type: number,Remark?:String): ErmcpContractOperateApplyReq {
+export function operationContractReqBuilder(req: Object, id: string, type: number, Remark?: String): ErmcpContractOperateApplyReq {
     return {
         OperateType: 1, // uint32 操作类型-1:登记2:确认3:拒绝4:撤销
-        Remark:'',
+        Remark: '',
         Info: {
             OperateApplyType: type, // uint32 操作申请类型-1:点价2:结算3:款项4:发票
             RelatedID: Long.fromString(id), // uint64 现货合同ID(602+Unix秒时间戳(10位)+xxxxxx)

+ 8 - 13
src/views/business/purchase/components/storage/index.vue

@@ -131,12 +131,10 @@
 </template>
 
 <script lang="ts">
-import { defineComponent, PropType, ref, unref, reactive, watchEffect } from 'vue';
+import { defineComponent, PropType, ref, unref, watchEffect } 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 { Ermcp3AreaStockApply, ERMCPAreaInOutStockApplyReq } from '@/services/proto/warehouse/interface';
+import { ERMCPAreaInOutStockApplyReq } from '@/services/proto/warehouse/interface';
 import { QueryAreaStockApply, QueryWareHouse } from '@/services/go/ermcp/warehouse-info/index';
 import * as Long from 'long';
 import { formatValue } from '@/common/methods';
@@ -144,10 +142,10 @@ import { handleForm } from './setup';
 import APP from '@/services';
 import { initData } from '@/common/methods';
 import { ErmcpWareHouseInfo } from '@/views/information/warehouse-info/list';
-import { QueryMiddleGoodsChange } from '@/services/go/ermcp/goodsInfo';
-import { ErmcpMiddleGoodsChangeLog } from '@/services/go/ermcp/goodsInfo/interface';
+import { requestResultLoadingAndInfo } from '@/common/methods/request/resultInfo';
 import { message } from 'ant-design-vue';
 import { Ermcp3AreaStockApplySum } from '@/services/go/ermcp/warehouse-info/interface';
+import { ermcpInOutStockApplyReq } from '@/services/proto/warehouse';
 
 export default defineComponent({
     name: 'purchase_pending_storage',
@@ -201,13 +199,10 @@ export default defineComponent({
                     Qty: formState.Qty || 0, // double 数量t
                     ApplyRemark: '', // string 申请备注
                 };
-                // 入库
-                storageReq(params, loading)
-                    .then((res) => {
-                        cancel();
-                        context.emit('refresh');
-                    })
-                    .catch((err) => {});
+                requestResultLoadingAndInfo(ermcpInOutStockApplyReq, params, loading, ['入库登记成功', '入库登记失败:']).then(() => {
+                    context.emit('refresh');
+                    cancel();
+                });
             });
         }
         return {