Ver código fonte

commit 提交代码

yu jie 4 anos atrás
pai
commit
42c3a831ef

+ 0 - 1
src/services/proto/contract/interface.ts

@@ -33,7 +33,6 @@ export interface ContractOperateApplyReq {
     OperateType: number; // uint32 操作类型-1:登记2:确认3:拒绝4:撤销
     Remark?: string; // string 备注
     Info?: ContractOperateApplyInfo; // ContractOperateApplyInfo 合同操作信息
-
     OperateSrc?: number
     OperatorID?: number
     ClientTicket?: string

+ 1 - 1
src/views/business/purchase/components/invoice/index.vue

@@ -163,7 +163,7 @@ export default defineComponent({
                     InvoiceAmount: formState.InvoiceAmount!,
                 };
                 // 发出发票登记
-                invoiceReq(props.selectedRow.spotcontractid, params, loading)
+                invoiceReq(props.selectedRow.spotcontractid, params, loading, getFirstImg())
                     .then(() => {
                         cancel(true);
                     })

+ 15 - 3
src/views/business/purchase/components/setup.ts

@@ -19,6 +19,12 @@ import { objectToUint8Array } from "@/utils/objHandle";
 import { purchaseStateSign } from "@/views/business/purchase/setup";
 import Long from "long";
 import { Ref } from "vue";
+import {getUserId} from "@/services/bus/account";
+import {getLongTypeLoginID} from "@/services/bus/login";
+import * as long from "long";
+import {LongType} from "@/services/socket/login/interface";
+import {getTimeValue} from "@/utils/time";
+import {v4 as uuidv4} from "uuid";
 
 /**
  * 这里负责 点价登记, 交收登记, 款项登记, 发票登记, 入库登记
@@ -56,9 +62,9 @@ export function fundsReq(spotcontractid: string, req: FundsReq, loading: Ref<boo
 /**
  * 发票登记
  */
-export function invoiceReq(spotcontractid: string, req: InvoiceReq, loading: Ref<boolean>): Promise<string> {
+export function invoiceReq(spotcontractid: string, req: InvoiceReq, loading: Ref<boolean>, attachUrl?: String): Promise<string> {
     return operationContractRsp(4,
-        operationContractReqBuilder(req, spotcontractid, 4),
+        operationContractReqBuilder(req, spotcontractid, 4, "" ,attachUrl),
         loading)
 }
 
@@ -69,15 +75,20 @@ export function invoiceReq(spotcontractid: string, req: InvoiceReq, loading: Ref
  * @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, attachUrl?: String): ErmcpContractOperateApplyReq {
     return {
         OperateType: 1, // uint32 操作类型-1:登记2:确认3:拒绝4:撤销
         Remark: '',
+        OperateSrc: 2,
+        ClientTicket: uuidv4(),
+        OperateApplyID: getTimeValue(),
         Info: {
             OperateApplyType: type, // uint32 操作申请类型-1:点价2:结算3:款项4:发票
             RelatedID: Long.fromString(id), // uint64 现货合同ID(602+Unix秒时间戳(10位)+xxxxxx)
             DetailJson: objectToUint8Array(req), // bytes 明细JSON {}
+            AttachUrl: attachUrl === undefined ? "" : objectToUint8Array(attachUrl as string) // bytes 附件
         },
+        UserID: getLongTypeLoginID()?.toNumber()
     } as ErmcpContractOperateApplyReq
 }
 
@@ -90,6 +101,7 @@ export function operationContractReqBuilder(req: Object, id: string, type: numbe
  */
 export function operationContractRsp(type: number, req: ErmcpContractOperateApplyReq, loading: Ref<boolean>): Promise<string> {
     const sign = getRequestResultInfo(purchaseStateSign, type)  // 接口请求后的返回提示 这里统一进行管理
+    debugger
     const result = operationContractReq(req)
     return commonResultInfo(result, sign, loading)
 }