huangbin vor 4 Jahren
Ursprung
Commit
62cc3e4017

+ 1 - 0
src/services/proto/spotcontract/index.ts

@@ -34,6 +34,7 @@ export const orderContract = (param: GldErmcpSpotContractOperateReq): Promise<an
         APP.sendTradingServer(package50, undefined, {
             onSuccess: (res) => {
                 const { isSuccess, result } = parseProtoRsp50(res, 'GldErmcpSpotContractOperateRsp');
+                debugger
                 if (isSuccess) {
                     resolve(result);
                 } else {

+ 9 - 7
src/services/socket/protobuf/buildReq.ts

@@ -1,13 +1,13 @@
+import APP from '@/services';
+import { getAccount_longType, getUserId } from '@/services/bus/account';
+import { getErrorInfoByCode } from '@/services/bus/error';
+import { funCode } from '@/services/funcode/index';
 import ProtobufCtr from '@/services/socket/protobuf/index';
 import { Package50 } from '@/utils/websocket/package';
-import { funCode } from '@/services/funcode/index';
 import { v4 as uuidv4 } from 'uuid';
-import { SoleSearchParam, CommonSearchParam, ParseRsp } from './interface';
 import * as type from './interface';
+import { CommonSearchParam, ParseRsp, SoleSearchParam } from './interface';
 import { IMessageHead } from './proto.d';
-import APP from '@/services';
-import { getAccount_longType, getUserId } from '@/services/bus/account';
-import { getErrorInfoByCode } from '@/services/bus/error';
 
 /**
  * 构建proto50 报文
@@ -179,11 +179,13 @@ function isErrer(rspPackage: any, funCodeName: string): void {
 function parseSoleProtoRsp(rspPackage: any, funCodeName: string): ParseRsp {
     isErrer(rspPackage, funCodeName);
     const reqPackage = ProtobufCtr.generateProtoContent(funCodeName, rspPackage.content);
-    const { RetCode, Status } = reqPackage;
+    const { RetCode, Status, RetDesc } = reqPackage;
     if (RetCode !== null) {
         if (RetCode === 0) {
             return { isSuccess: true, result: reqPackage };
-        } else {
+        } if (RetCode === -1) { // 管理端错误消息
+            return { isSuccess: false, result: RetDesc };
+        } else {    // 数据库获取的错误信息
             const errMsg = getErrorInfoByCode(String(RetCode));
             const result = errMsg ? errMsg : `未知错误:${RetCode}`;
             return { isSuccess: false, result };

+ 3 - 1
src/views/information/spot-contract/components/add/index.vue

@@ -401,7 +401,7 @@ import { defineComponent, ref, toRaw } from 'vue';
 import { closeModal } from '@/common/setup/modal/index';
 import { initData } from '@/common/methods';
 import { handleFromState, handleContract, handlevalidate, handleDeliveryGoods, handlePrice, handleDate, addContractReq } from './setup';
-import { getUserName } from '@/services/bus/user';
+import { getUserName, getUsrId } from '@/services/bus/user';
 import { getGoodsList } from '@/services/bus/goods';
 import { Goods } from '@/services/go/ermcp/goodsInfo/interface';
 import { ValidateErrorEntity } from 'ant-design-vue/lib/form/interface';
@@ -453,6 +453,8 @@ export default defineComponent({
                 .validate()
                 .then(() => {
                     const param = toRaw(formState);
+                    const id = getUsrId();
+                    isSell.value ? (param.SellUserID = id) : (param.BuyUserID = id);
 
                     // 交收期
                     const dDate = deliveryDate.value;

+ 1 - 1
src/views/information/spot-contract/components/setup.ts

@@ -38,7 +38,7 @@ export function changeOrderContract() {
                 return Promise.resolve(sign[0])
             })
             .catch(err => {
-                message.error(sign[1])
+                message.error(sign[1] + err)
                 return Promise.reject(sign[1] + err)
             }).finally(() => {
                 loading.value = false