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