li.shaoyi 2 سال پیش
والد
کامیت
e6ba420d49
47فایلهای تغییر یافته به همراه1065 افزوده شده و 890 حذف شده
  1. 9 10
      src/business/account/index.ts
  2. 52 63
      src/business/bank/index.ts
  3. 27 29
      src/business/bargain/index.ts
  4. 26 29
      src/business/bonded/index.ts
  5. 8 7
      src/business/common/index.ts
  6. 8 9
      src/business/customs/bonded.ts
  7. 16 18
      src/business/customs/exit.ts
  8. 30 33
      src/business/goods/index.ts
  9. 8 11
      src/business/login/index.ts
  10. 78 82
      src/business/order/index.ts
  11. 24 27
      src/business/trade/desting.ts
  12. 35 37
      src/business/trade/listing.ts
  13. 38 43
      src/business/user/index.ts
  14. 7 8
      src/business/warehouse/index.ts
  15. 0 1
      src/packages/mobile/main.ts
  16. 2 2
      src/packages/mobile/views/home/components/market/index.vue
  17. 1 0
      src/packages/pc/components/base/table-details/index.vue
  18. 0 1
      src/packages/pc/main.ts
  19. 9 14
      src/packages/pc/views/centralize/mine/components/add/index.vue
  20. 10 14
      src/packages/pc/views/presale/list/components/buy/index.vue
  21. 61 10
      src/packages/pc/views/presale/list/components/details/index.vue
  22. 9 14
      src/packages/pc/views/presale/mine/components/add/index.vue
  23. 3 1
      src/packages/pc/views/presale/mine/components/apply/details.vue
  24. 59 7
      src/packages/pc/views/presale/mine/components/details/index.vue
  25. 30 8
      src/services/api/account/index.ts
  26. 25 10
      src/services/api/bank/index.ts
  27. 22 8
      src/services/api/bonded/index.ts
  28. 29 10
      src/services/api/customs/index.ts
  29. 8 5
      src/services/api/favorite/index.ts
  30. 15 7
      src/services/api/goods/index.ts
  31. 25 10
      src/services/api/performance/index.ts
  32. 59 44
      src/services/api/presale/index.ts
  33. 57 19
      src/services/api/trade/index.ts
  34. 31 12
      src/services/api/user/index.ts
  35. 7 4
      src/services/api/warehouse/index.ts
  36. 134 48
      src/services/socket/quote/index.ts
  37. 0 9
      src/services/socket/quote/interface.ts
  38. 66 92
      src/services/socket/trade/index.ts
  39. 7 6
      src/services/socket/trade/interface.ts
  40. 0 109
      src/services/subscribe/index.ts
  41. 1 1
      src/stores/modules/performance.ts
  42. 2 0
      src/stores/storage.ts
  43. 2 2
      src/types/ermcp/presale.d.ts
  44. 18 9
      src/types/proto/account.d.ts
  45. 2 2
      src/types/proto/goods.d.ts
  46. 1 1
      src/types/proto/presale.d.ts
  47. 4 4
      src/types/proto/trade.d.ts

+ 9 - 10
src/business/account/index.ts

@@ -47,21 +47,20 @@ export function usePassword(ModifyPwdType: 0 | 1 | 2) {
         NewPwd: '' // 新资金密码
     })
 
-    const formSubmit = () => {
-        const { ModifyPwdType, ModifyPwdID, OldPwd, NewPwd } = formData
-        loading.value = true
+    const formSubmit = async () => {
+        try {
+            loading.value = true
+            const { ModifyPwdType, ModifyPwdID, OldPwd, NewPwd } = formData
 
-        return modifyPassword({
-            data: {
+            return await modifyPassword({
                 ModifyPwdType,
                 ModifyPwdID,
                 OldPwd: cryptojs.SHA256(ModifyPwdID + OldPwd).toString(),
                 NewPwd: cryptojs.SHA256(ModifyPwdID + NewPwd).toString(),
-            },
-            complete: () => {
-                loading.value = false
-            }
-        })
+            })
+        } finally {
+            loading.value = false
+        }
     }
 
     return {

+ 52 - 63
src/business/bank/index.ts

@@ -35,32 +35,32 @@ export function useBankSign() {
         CertID: decryptAES(userInfo.cardnum)!, // 证件号码
     })
 
-    const formSubmit = () => {
-        loading.value = true
-        // 已选的托管银行
-        if (selectedCustodianBank.value) {
-            ({
-                cusbankid: formData.CusBankID,
-                currency: formData.Currency,
-                tradedate: formData.TradeDate,
-            } = selectedCustodianBank.value)
-        }
-        // 已选中的开户银行
-        if (selectedDepositBank.value) {
-            ({
-                bankid: formData.OpenBankAccId,
-                bankname: formData.ExBankName,
-            } = selectedDepositBank.value)
-        }
-        return t2bBankSign({
-            data: {
+    const formSubmit = async () => {
+        try {
+            loading.value = true
+            // 已选的托管银行
+            if (selectedCustodianBank.value) {
+                ({
+                    cusbankid: formData.CusBankID,
+                    currency: formData.Currency,
+                    tradedate: formData.TradeDate,
+                } = selectedCustodianBank.value)
+            }
+            // 已选中的开户银行
+            if (selectedDepositBank.value) {
+                ({
+                    bankid: formData.OpenBankAccId,
+                    bankname: formData.ExBankName,
+                } = selectedDepositBank.value)
+            }
+
+            return await t2bBankSign({
                 ...formData,
                 ExtOperatorID: new Date().getTime(),
-            },
-            complete: () => {
-                loading.value = false
-            }
-        })
+            })
+        } finally {
+            loading.value = false
+        }
     }
 
     // 获取托管银行
@@ -82,20 +82,19 @@ export function useBankSign() {
 export function useBankCancelSign(bankInfo: Ermcp.BankAccountSignRsp) {
     const loading = shallowRef(false)
 
-    const formSubmit = () => {
-        loading.value = true
-        return t2bBankCancelSign({
-            data: {
-                ExtOperatorID: new Date().getTime(), // 外部操作流水号
-                AccountCode: firstAccountId.value.toString(), // 账户
-                CusBankID: bankInfo.cusbankid, // 托管银行编号
-                IsForce: 0, // 是否强制
+    const formSubmit = async () => {
+        try {
+            loading.value = true
+            return await t2bBankCancelSign({
+                ExtOperatorID: new Date().getTime(),
+                AccountCode: firstAccountId.value.toString(),
+                CusBankID: bankInfo.cusbankid,
+                IsForce: 0,
                 Currency: bankInfo.currency, // 币种
-            },
-            complete: () => {
-                loading.value = false
-            }
-        })
+            })
+        } finally {
+            loading.value = false
+        }
     }
 
     return {
@@ -164,19 +163,14 @@ export function useDeposit() {
                     } = bankInfo)
 
                     t2bBankDeposit({
-                        data: {
-                            ...formData,
-                            ExtOperatorID: new Date().getTime()
-                        },
-                        success: () => {
-                            resolve()
-                        },
-                        fail: (err) => {
-                            reject(err)
-                        },
-                        complete: () => {
-                            loading.value = false
-                        }
+                        ...formData,
+                        ExtOperatorID: new Date().getTime()
+                    }).then(() => {
+                        resolve()
+                    }).catch((err) => {
+                        reject(err)
+                    }).finally(() => {
+                        loading.value = false
                     })
                 } else {
                     loading.value = false
@@ -229,19 +223,14 @@ export function useWithdraw() {
                     } = bankInfo)
 
                     t2bBankWithdraw({
-                        data: {
-                            ...formData,
-                            ExtOperatorID: new Date().getTime()
-                        },
-                        success: () => {
-                            resolve()
-                        },
-                        fail: (err) => {
-                            reject(err)
-                        },
-                        complete: () => {
-                            loading.value = false
-                        }
+                        ...formData,
+                        ExtOperatorID: new Date().getTime()
+                    }).then(() => {
+                        resolve()
+                    }).catch((err) => {
+                        reject(err)
+                    }).finally(() => {
+                        loading.value = false
                     })
                 } else {
                     loading.value = false

+ 27 - 29
src/business/bargain/index.ts

@@ -147,47 +147,45 @@ export function useBargainOperate(selectedRow: Ermcp.MyBargainApplyRsp | Ermcp.M
         AuditRemark: ''
     })
 
-    const formSubmit = (OperateType: 0 | 1 | 2 | 3) => {
+    const formSubmit = async (OperateType: 0 | 1 | 2 | 3) => {
         loading.value = true
 
         // 买询价操作
         if ('wrbargainid' in selectedRow) {
-            return zsBuyOrderDestingNegPriceOperate({
-                data: {
-                    UserID: userId.value, // 用户ID,必填
-                    AccountID: firstAccountId.value, // 资金账号,必填
-                    WRBargainID: Long.fromString(selectedRow.wrbargainid), // 议价申请单ID,必填
-                    OperateType, // 操作类型,1:撤销2:拒绝3:同意
+            try {
+                return await zsBuyOrderDestingNegPriceOperate({
+                    UserID: userId.value,
+                    AccountID: firstAccountId.value,
+                    WRBargainID: Long.fromString(selectedRow.wrbargainid),
+                    OperateType,
                     AuditRemark: formData.AuditRemark,
-                    MarketID: Market.GZ, // 市场ID,必填
-                    ClientType: ClientType.Web, // 终端类型
-                    OrderSrc: 1, // 委托来源
+                    MarketID: Market.GZ,
+                    ClientType: ClientType.Web,
+                    OrderSrc: 1,
                     ClientSerialNo: v4() // 客户端流水号
-                },
-                complete: () => {
-                    loading.value = false
-                }
-            })
+                })
+            } finally {
+                loading.value = false
+            }
         }
 
         // 卖询价操作
         if ('selldelistingapplyid' in selectedRow) {
-            return zsSellOrderDestingApplyOperate({
-                data: {
-                    UserID: userId.value, // 用户ID,必填
-                    AccountID: firstAccountId.value, // 资金账号,必填
-                    SellDelistingApplyID: Long.fromString(selectedRow.selldelistingapplyid), // 卖摘牌申请ID,必填
-                    OperateType, // 操作类型,1:撤销2:拒绝3:同意
+            try {
+                return await zsSellOrderDestingApplyOperate({
+                    UserID: userId.value,
+                    AccountID: firstAccountId.value,
+                    SellDelistingApplyID: Long.fromString(selectedRow.selldelistingapplyid),
+                    OperateType,
                     AuditRemark: formData.AuditRemark,
-                    MarketID: Market.GZ, // 市场ID,必填
-                    ClientType: ClientType.Web, // 终端类型
-                    OrderSrc: 1, // 委托来源
+                    MarketID: Market.GZ,
+                    ClientType: ClientType.Web,
+                    OrderSrc: 1,
                     ClientSerialNo: v4(), // 客户端流水号
-                },
-                complete: () => {
-                    loading.value = false
-                }
-            })
+                })
+            } finally {
+                loading.value = false
+            }
         }
 
         loading.value = false

+ 26 - 29
src/business/bonded/index.ts

@@ -92,17 +92,16 @@ export function useBscInAndOutWareHouseApply(OrderType: number) {
         ClientSerialNo: '', // 客户端流水号
     })
 
-    const formSubmit = () => {
-        loading.value = true
-        return bscInAndOutWareHouseApply({
-            data: {
+    const formSubmit = async () => {
+        try {
+            loading.value = true
+            return await bscInAndOutWareHouseApply({
                 ...formData,
                 ClientSerialNo: v4(),
-            },
-            complete: () => {
-                loading.value = false
-            }
-        })
+            })
+        } finally {
+            loading.value = false
+        }
     }
 
     return {
@@ -126,17 +125,16 @@ export function useBscUploadFile(orderId: string) {
         OperateAccount: LoginCode, // 操作人账户,必填
     })
 
-    const formSubmit = () => {
-        loading.value = true
-        return bscUploadFile({
-            data: {
+    const formSubmit = async () => {
+        try {
+            loading.value = true
+            return await bscUploadFile({
                 ...formData,
                 ClientSerialNo: v4(),
-            },
-            complete: () => {
-                loading.value = false
-            }
-        })
+            })
+        } finally {
+            loading.value = false
+        }
     }
 
     return {
@@ -215,18 +213,17 @@ export function useGzbscusermonthpayDetails(trademonth: string) {
 export function useBscConfirmPay(TradeMonth: string) {
     const loading = shallowRef(false)
 
-    const formSubmit = () => {
-        loading.value = true
-        return bscConfirmPay({
-            data: {
-                UserID: userId.value, // 用户ID,必填
-                TradeMonth, // 月份(yyyMM),必填
+    const formSubmit = async () => {
+        try {
+            loading.value = true
+            return await bscConfirmPay({
+                UserID: userId.value,
+                TradeMonth,
                 ClientSerialNo: v4() // 客户端流水号
-            },
-            complete: () => {
-                loading.value = false
-            }
-        })
+            })
+        } finally {
+            loading.value = false
+        }
     }
 
     return {

+ 8 - 7
src/business/common/index.ts

@@ -6,15 +6,16 @@ import eventBus from '@/services/bus'
 /**
  * 令牌校验
  */
-export function checkToken() {
-    const { loginId, token } = loginStore.$mapGetters()
-    return tokenCheck({
-        data: {
+export async function checkToken() {
+    try {
+        const { loginId, token } = loginStore.$mapGetters()
+        return await tokenCheck({
             LoginID: loginId.value,
             Token: token.value,
-        },
-        fail: () => eventBus.$emit('LogoutNotify')
-    })
+        })
+    } catch {
+        eventBus.$emit('LogoutNotify')
+    }
 }
 
 /**

+ 8 - 9
src/business/customs/bonded.ts

@@ -148,17 +148,16 @@ export function useBSFWMemberOperate(orderId: string) {
         ClientSerialNo: '', // 客户端流水号
     })
 
-    const formSubmit = () => {
-        loading.value = true
-        return bsfwMemberOperate({
-            data: {
+    const formSubmit = async () => {
+        try {
+            loading.value = true
+            return await bsfwMemberOperate({
                 ...formData,
                 ClientSerialNo: v4(),
-            },
-            complete: () => {
-                loading.value = false
-            }
-        })
+            })
+        } finally {
+            loading.value = false
+        }
     }
 
     return {

+ 16 - 18
src/business/customs/exit.ts

@@ -174,17 +174,16 @@ export function useCJJCOrderApply(selectedRow?: Ermcp.GZCJJCOrderRsp) {
         })
     }
 
-    const formSubmit = () => {
-        loading.value = true
-        return cjjcApply({
-            data: {
+    const formSubmit = async () => {
+        try {
+            loading.value = true
+            return await cjjcApply({
                 ...formData,
                 ClientSerialNo: v4(),
-            },
-            complete: () => {
-                loading.value = false
-            }
-        })
+            })
+        } finally {
+            loading.value = false
+        }
     }
 
     return {
@@ -232,17 +231,16 @@ export function useCJJCMemberOperate(orderId: string) {
         ClientSerialNo: '', // 客户端流水号
     })
 
-    const formSubmit = () => {
-        loading.value = true
-        return cjjcMemberOperate({
-            data: {
+    const formSubmit = async () => {
+        try {
+            loading.value = true
+            return await cjjcMemberOperate({
                 ...formData,
                 ClientSerialNo: v4(),
-            },
-            complete: () => {
-                loading.value = false
-            }
-        })
+            })
+        } finally {
+            loading.value = false
+        }
     }
 
     return {

+ 30 - 33
src/business/goods/index.ts

@@ -201,10 +201,10 @@ export function useDiamondForm(category: Category) {
     // 货币信息
     const currencyInfo = computed(() => getCurrencyTypeInfo(formData.ZSCurrencyType ?? 0))
 
-    const addOrUpdate = () => {
-        loading.value = true
-        return addDiamond({
-            data: {
+    const addOrUpdate = async () => {
+        try {
+            loading.value = true
+            return await addDiamond({
                 UserID: userId.value,
                 AccountID: firstAccountId.value,
                 AddType: performanceId.value ? 2 : 1,
@@ -214,11 +214,10 @@ export function useDiamondForm(category: Category) {
                 ClientSerialNo: v4(),
                 GZ_WRStandardExInfo: formData,
                 PerformanceTemplateID: performanceId.value,
-            },
-            complete: () => {
-                loading.value = false
-            }
-        })
+            })
+        } finally {
+            loading.value = false
+        }
     }
 
     // 获取仓库列表
@@ -249,21 +248,20 @@ export function useDiamondFavorite(selectedRow: Ermcp.MyWRPositionRsp | Ermcp.Se
     const loading = shallowRef(false)
 
     // 钻石收藏操作
-    const formSubmit = (operateType: number) => {
-        loading.value = true
-        return goodsFavoriteOperate({
-            data: {
-                UserID: userId.value, // 用户ID,必填
-                WRTradeOrderID: Long.fromString(selectedRow.wrtradeorderid), // 委托单ID,必填
-                OperateType: operateType, // 操作类型,1:添加2:删除,必填
-                ClientType: ClientType.Web, // 终端类型
-                MarketID: Market.GZ, // 市场ID,必填
+    const formSubmit = async (operateType: number) => {
+        try {
+            loading.value = true
+            return await goodsFavoriteOperate({
+                UserID: userId.value,
+                WRTradeOrderID: Long.fromString(selectedRow.wrtradeorderid),
+                OperateType: operateType,
+                ClientType: ClientType.Web,
+                MarketID: Market.GZ,
                 ClientSerialNo: v4() // 客户端流水号
-            },
-            complete: () => {
-                loading.value = false
-            }
-        })
+            })
+        } finally {
+            loading.value = false
+        }
     }
 
     return {
@@ -276,10 +274,10 @@ export function useDiamondFavorite(selectedRow: Ermcp.MyWRPositionRsp | Ermcp.Se
 export function useDiamondDelete(selectedRow: Ermcp.MyWRPositionRsp) {
     const loading = shallowRef(false)
 
-    const formSubmit = () => {
-        loading.value = true
-        return receiptZSOutApply({
-            data: {
+    const formSubmit = async () => {
+        try {
+            loading.value = true
+            return await receiptZSOutApply({
                 Common: {
                     UserID: userId.value,
                     AccountID: firstAccountId.value,
@@ -292,13 +290,12 @@ export function useDiamondDelete(selectedRow: Ermcp.MyWRPositionRsp) {
                 SubNum: selectedRow.subnum,
                 Qty: selectedRow.weight,
                 ApplyType: 1,
-                ClientType: ClientType.Web, // 终端类型
+                ClientType: ClientType.Web,
                 ClientTicket: v4() // 客户端流水号
-            },
-            complete: () => {
-                loading.value = false
-            }
-        })
+            })
+        } finally {
+            loading.value = false
+        }
     }
 
     return {

+ 8 - 11
src/business/login/index.ts

@@ -4,7 +4,7 @@ import { encryptAES, decryptAES } from '@/utils/crypto'
 import { timerTask } from '@/utils/timer'
 import { queryLoginId, login } from '@/services/api/account'
 import { sessionData, localData } from '@/stores/storage'
-import { loginStore, enumStore, errorInfoStore, futuresStore, favoriteStore, accountStore, performanceStore } from '@/stores'
+import { loginStore, enumStore, errorInfoStore, favoriteStore, accountStore, performanceStore } from '@/stores'
 import { checkToken, checkTokenLoop } from '@/business/common'
 import service from '@/services'
 import socket from '@/services/socket'
@@ -45,16 +45,13 @@ export function useLogin() {
 
     const loginAction = async (params: Proto.LoginReq) => {
         params.GUID = v4()
-        await login({
-            data: params,
-            success: async (res) => {
-                const encryptedData = encryptAES(JSON.stringify(params)) // 数据加密
-                localData.setValue('autoLoginEncryptedData', encryptedData)
-                loginStore.$setState((state) => {
-                    state.loginInfo = res
-                })
-                localStorage.setItem('gz_loginId', formData.LoginID) // 记住登录ID
-            }
+        await login(params).then((res) => {
+            const encryptedData = encryptAES(JSON.stringify(params)) // 数据加密
+            localData.setValue('autoLoginEncryptedData', encryptedData)
+            loginStore.$setState((state) => {
+                state.loginInfo = res
+            })
+            localStorage.setItem('gz_loginId', formData.LoginID) // 记住登录ID
         })
         await loadUserData()
         eventBus.$emit('LoginNotify') // 登录成功通知

+ 78 - 82
src/business/order/index.ts

@@ -64,14 +64,13 @@ export function usePerformanceManual(selectedRow: Ermcp.MyPerformancRsp) {
         StepRemark: '',
     })
 
-    const formSubmit = () => {
-        loading.value = true
-        return performanceManualConfirm({
-            data: formData,
-            complete: () => {
-                loading.value = false
-            }
-        })
+    const formSubmit = async () => {
+        try {
+            loading.value = true
+            return await performanceManualConfirm(formData)
+        } finally {
+            loading.value = false
+        }
     }
 
     return {
@@ -90,14 +89,13 @@ export function usePerformanceDelay(selectedRow: Ermcp.MyPerformancRsp) {
         applicant: userId.value, // uint64 申请人
     })
 
-    const formSubmit = () => {
-        loading.value = true
-        return performanceDelayApply({
-            data: formData,
-            complete: () => {
-                loading.value = false
-            }
-        })
+    const formSubmit = async () => {
+        try {
+            loading.value = true
+            return await performanceDelayApply(formData)
+        } finally {
+            loading.value = false
+        }
     }
 
     return {
@@ -117,14 +115,13 @@ export function usePerformanceContracted(selectedRow: Ermcp.MyPerformancRsp) {
         Applicant: userId.value, // uint64 违约申请人
     })
 
-    const formSubmit = () => {
-        loading.value = true
-        return performanceContractedApply({
-            data: formData,
-            complete: () => {
-                loading.value = false
-            }
-        })
+    const formSubmit = async () => {
+        try {
+            loading.value = true
+            return await performanceContractedApply(formData)
+        } finally {
+            loading.value = false
+        }
     }
 
     return {
@@ -139,71 +136,70 @@ export function usePerformanceModify(selectedRow: Ermcp.MyPerformancRsp) {
     const loading = shallowRef(false)
     const formData = reactive<{ address?: Ermcp.UserReceiveInfoRsp, invoice?: Ermcp.WrUserReceiptInfoRsp, contactInfo?: string }>({})
 
-    const formSubmit = () => {
-        loading.value = true
+    const formSubmit = async () => {
+        try {
+            loading.value = true
 
-        const jsonParam = {
-            ContactInfo: formData.contactInfo,
-            ReceiveInfo: '',
-            ReceiptInfo: ''
-        }
+            const jsonParam = {
+                ContactInfo: formData.contactInfo,
+                ReceiveInfo: '',
+                ReceiptInfo: ''
+            }
 
-        if (formData.address) {
-            const { provincename, cityname, districtname, address } = formData.address
-            jsonParam.ReceiveInfo = [provincename, cityname, districtname, address].join(' ')
-        }
+            if (formData.address) {
+                const { provincename, cityname, districtname, address } = formData.address
+                jsonParam.ReceiveInfo = [provincename, cityname, districtname, address].join(' ')
+            }
 
-        if (formData.invoice) {
-            Object.entries(formData.invoice).forEach(([key, value]) => {
-                if (value !== '') {
-                    switch (key) {
-                        case 'receipttype': {
-                            jsonParam.ReceiptInfo += '发票类型:' + getReceiptTypeName(Number(value)) + '\n'
-                            break
-                        }
-                        case 'username': {
-                            jsonParam.ReceiptInfo += '户名:' + value + '\n'
-                            break
-                        }
-                        case 'address': {
-                            jsonParam.ReceiptInfo += '地址:' + value + '\n'
-                            break
-                        }
-                        case 'contactinfo': {
-                            jsonParam.ReceiptInfo += '联系方式:' + value + '\n'
-                            break
-                        }
-                        case 'idnum': {
-                            jsonParam.ReceiptInfo += '身份证号码:' + value + '\n'
-                            break
-                        }
-                        case 'receiptaccount': {
-                            jsonParam.ReceiptInfo += '发票帐号:' + value + '\n'
-                            break
-                        }
-                        case 'receiptbank': {
-                            jsonParam.ReceiptInfo += '发票开户行:' + value + '\n'
-                            break
-                        }
-                        case 'taxpayerid': {
-                            jsonParam.ReceiptInfo += '纳税人识别号:' + value + '\n'
-                            break
+            if (formData.invoice) {
+                Object.entries(formData.invoice).forEach(([key, value]) => {
+                    if (value !== '') {
+                        switch (key) {
+                            case 'receipttype': {
+                                jsonParam.ReceiptInfo += '发票类型:' + getReceiptTypeName(Number(value)) + '\n'
+                                break
+                            }
+                            case 'username': {
+                                jsonParam.ReceiptInfo += '户名:' + value + '\n'
+                                break
+                            }
+                            case 'address': {
+                                jsonParam.ReceiptInfo += '地址:' + value + '\n'
+                                break
+                            }
+                            case 'contactinfo': {
+                                jsonParam.ReceiptInfo += '联系方式:' + value + '\n'
+                                break
+                            }
+                            case 'idnum': {
+                                jsonParam.ReceiptInfo += '身份证号码:' + value + '\n'
+                                break
+                            }
+                            case 'receiptaccount': {
+                                jsonParam.ReceiptInfo += '发票帐号:' + value + '\n'
+                                break
+                            }
+                            case 'receiptbank': {
+                                jsonParam.ReceiptInfo += '发票开户行:' + value + '\n'
+                                break
+                            }
+                            case 'taxpayerid': {
+                                jsonParam.ReceiptInfo += '纳税人识别号:' + value + '\n'
+                                break
+                            }
                         }
                     }
-                }
-            })
-        }
+                })
+            }
 
-        return performanceModifyContact({
-            data: {
-                PerformancePlanID: Long.fromString(selectedRow.performanceplanid), // uint64 履约计划ID
-                AccountID: firstAccountId.value, // uint64 账号
+            return await performanceModifyContact({
+                PerformancePlanID: Long.fromString(selectedRow.performanceplanid),
+                AccountID: firstAccountId.value,
                 ContactInfo: JSON.stringify(jsonParam), // string 联络信息
-            },
-            complete: () => {
-                loading.value = false
-            }
-        })
+            })
+        } finally {
+            loading.value = false
+        }
     }
 
     return {

+ 24 - 27
src/business/trade/desting.ts

@@ -18,10 +18,10 @@ const { userId, firstAccountId } = loginStore.$mapGetters()
 export function useBuyOrderDesting(selectedRow: Ermcp.DiamondDetailsRsp) {
     const loading = shallowRef(false)
 
-    const formSubmit = () => {
-        loading.value = true
-        return zsBuyOrderDesting({
-            data: {
+    const formSubmit = async () => {
+        try {
+            loading.value = true
+            return await zsBuyOrderDesting({
                 UserID: userId.value,
                 AccountID: firstAccountId.value,
                 RelatedWRTradeOrderID: Long.fromString(selectedRow.wrtradeorderid),
@@ -32,11 +32,10 @@ export function useBuyOrderDesting(selectedRow: Ermcp.DiamondDetailsRsp) {
                 ClientType: ClientType.Web,
                 OperatorID: userId.value,
                 MarketID: Market.GZ
-            },
-            complete: () => {
-                loading.value = false
-            }
-        })
+            })
+        } finally {
+            loading.value = false
+        }
     }
 
     return {
@@ -64,18 +63,17 @@ export function useBuyOrderBargain(selectedRow: Ermcp.DiamondDetailsRsp) {
         ApplyRemark: '' // 申请备注
     })
 
-    const formSubmit = () => {
-        loading.value = true
-        return zsBuyOrderDestingNegPrice({
-            data: {
+    const formSubmit = async () => {
+        try {
+            loading.value = true
+            return await zsBuyOrderDestingNegPrice({
                 ...formData,
                 ClientSerialNo: v4(),
                 ClientOrderTime: moment().format('YYYY-MM-DD HH:mm:ss')
-            },
-            complete: () => {
-                loading.value = false
-            }
-        })
+            })
+        } finally {
+            loading.value = false
+        }
     }
 
     return {
@@ -122,17 +120,16 @@ export function useSellOrderBargain(selectedRow: Ermcp.BuyOrderRsp) {
         { prop: 'priceper', label: '克拉单价' },
     ])
 
-    const formSubmit = () => {
-        loading.value = true
-        return zsSellOrderDestingApply({
-            data: {
+    const formSubmit = async () => {
+        try {
+            loading.value = true
+            return await zsSellOrderDestingApply({
                 ...formData,
                 ClientSerialNo: v4()
-            },
-            complete: () => {
-                loading.value = false
-            }
-        })
+            })
+        } finally {
+            loading.value = false
+        }
     }
 
     // 获取商品列表

+ 35 - 37
src/business/trade/listing.ts

@@ -70,13 +70,14 @@ export function useBuyOrderListing() {
         styleTypeList: getStyleTypeList(),
     }
 
-    const formSubmit = () => {
-        loading.value = true
-        if (formData.Size.some((val) => !val)) {
-            formData.Size = []
-        }
-        return zsBuyOrderListing({
-            data: {
+    const formSubmit = async () => {
+        try {
+            loading.value = true
+            if (formData.Size.some((val) => !val)) {
+                formData.Size = []
+            }
+
+            return await zsBuyOrderListing({
                 UserID: userId.value,
                 AccountID: firstAccountId.value,
                 MarketID: Market.GZ,
@@ -85,11 +86,10 @@ export function useBuyOrderListing() {
                 ClientSerialNo: v4(),
                 PerformanceTemplateID: performanceId.value,
                 GZ_BuyOrderDetailExInfo: formData
-            },
-            complete: () => {
-                loading.value = false
-            }
-        })
+            })
+        } finally {
+            loading.value = false
+        }
     }
 
     return {
@@ -162,18 +162,17 @@ export function useSellOrderListing(selectedRow?: Ermcp.MyWRPositionRsp) {
         })
     }
 
-    const formSubmit = () => {
-        submitLoading.value = true
-        return zsSellOrderListing({
-            data: {
+    const formSubmit = async () => {
+        try {
+            submitLoading.value = true
+            return await zsSellOrderListing({
                 ...formData,
                 ClientSerialNo: v4(),
                 ClientOrderTime: moment().format('YYYY-MM-DD HH:mm:ss')
-            },
-            complete: () => {
-                submitLoading.value = false
-            }
-        })
+            })
+        } finally {
+            submitLoading.value = false
+        }
     }
 
     return {
@@ -195,24 +194,23 @@ export function useSellOrderListing(selectedRow?: Ermcp.MyWRPositionRsp) {
 export function useListingCancel(wrtradeorderid: string, buyorsell: number) {
     const loading = shallowRef(false)
 
-    const formSubmit = () => {
-        loading.value = true
-        return wrListingCancelOrder({
-            data: {
-                UserID: userId.value, // 用户ID
-                AccountID: firstAccountId.value, // 资金账号
-                OldWRTradeOrderID: Long.fromString(wrtradeorderid || '0'), // 目标仓单贸易委托单ID
-                OrderSrc: 1, // 委托来源
-                ClientType: ClientType.Web, // 终端类型
-                OperatorID: userId.value, // 操作员账号ID
-                BuyOrSell: buyorsell, // 买卖方向
+    const formSubmit = async () => {
+        try {
+            loading.value = true
+            return await wrListingCancelOrder({
+                UserID: userId.value,
+                AccountID: firstAccountId.value,
+                OldWRTradeOrderID: Long.fromString(wrtradeorderid || '0'),
+                OrderSrc: 1,
+                ClientType: ClientType.Web,
+                OperatorID: userId.value,
+                BuyOrSell: buyorsell,
                 ClientSerialNo: v4(),
                 ClientOrderTime: moment().format('YYYY-MM-DD HH:mm:ss')
-            },
-            complete: () => {
-                loading.value = false
-            }
-        })
+            })
+        } finally {
+            loading.value = false
+        }
     }
 
     return {

+ 38 - 43
src/business/user/index.ts

@@ -65,39 +65,36 @@ export function useAddressForm(selectedRow?: Ermcp.UserReceiveInfoRsp) {
         } = selectedRow)
     }
 
-    const addOrUpdate = () => {
-        loading.value = true
-        return userReceiveInfo({
-            data: formData,
-            complete: () => {
-                loading.value = false
-            }
-        })
+    const addOrUpdate = async () => {
+        try {
+            loading.value = true
+            return await userReceiveInfo(formData)
+        } finally {
+            loading.value = false
+        }
     }
 
-    const deleteAddress = () => {
-        loading.value = true
-        return delUserReceiveInfo({
-            data: {
+    const deleteAddress = async () => {
+        try {
+            loading.value = true
+            return await delUserReceiveInfo({
                 ReceiveInfoId: formData.ReceiveInfoId
-            },
-            complete: () => {
-                loading.value = false
-            }
-        })
+            })
+        } finally {
+            loading.value = false
+        }
     }
 
-    const updateAddressIsDefault = () => {
-        loading.value = true
-        return userReceiveIsDefault({
-            data: {
+    const updateAddressIsDefault = async () => {
+        try {
+            loading.value = true
+            return await userReceiveIsDefault({
                 UserId: userId.value,
                 AutoId: formData.ReceiveInfoId
-            },
-            complete: () => {
-                loading.value = false
-            }
-        })
+            })
+        } finally {
+            loading.value = false
+        }
     }
 
     return {
@@ -168,26 +165,24 @@ export function useInvoiceForm(selectedRow?: Ermcp.WrUserReceiptInfoRsp) {
         } = selectedRow)
     }
 
-    const addOrUpdate = () => {
-        loading.value = true
-        return userReceiptInfo({
-            data: formData,
-            complete: () => {
-                loading.value = false
-            }
-        })
+    const addOrUpdate = async () => {
+        try {
+            loading.value = true
+            return await userReceiptInfo(formData)
+        } finally {
+            loading.value = false
+        }
     }
 
-    const deleteInvoice = () => {
-        loading.value = true
-        return delUserReceiptInfo({
-            data: {
+    const deleteInvoice = async () => {
+        try {
+            loading.value = true
+            return await delUserReceiptInfo({
                 ReceiptInfoId: formData.ReceiptInfoId
-            },
-            complete: () => {
-                loading.value = false
-            }
-        })
+            })
+        } finally {
+            loading.value = false
+        }
     }
 
     return {

+ 7 - 8
src/business/warehouse/index.ts

@@ -60,14 +60,13 @@ export function useWarehouseForm(selectedRow?: Ermcp.WarehouseInfoRsp) {
         } = selectedRow)
     }
 
-    const addOrUpdate = () => {
-        loading.value = true
-        return warehouseApply({
-            data: formData,
-            complete: () => {
-                loading.value = false
-            }
-        })
+    const addOrUpdate = async () => {
+        try {
+            loading.value = true
+            return await warehouseApply(formData)
+        } finally {
+            loading.value = false
+        }
     }
 
     return {

+ 0 - 1
src/packages/mobile/main.ts

@@ -3,7 +3,6 @@ import App from './App.vue'
 import router from './router'
 import directives from '@/directives' // 自定义指令集
 //import 'default-passive-events'
-import '@/services/subscribe' // 全局订阅通知
 import '@/mock' // 模拟数据
 import '@/utils/h5plus' // 加载html5+
 import layouts from './components/layouts' // 全局布局组件

+ 2 - 2
src/packages/mobile/views/home/components/market/index.vue

@@ -40,11 +40,11 @@ import { futuresStore, globalStore } from '@/stores'
 import { handlePriceColor, handleNoneValue } from '@/filters'
 import AppTable from '@mobile/components/base/table/index.vue'
 import { TableColumn } from '@mobile/components/base/table/interface'
-import subscribe from '@/services/subscribe'
+import quote from '@/services/socket/quote'
 
 const { setTheme } = globalStore.actions;
 const { quoteDayList } = futuresStore.$mapState();
-const quoteSubscribe = subscribe.addQuoteSubscribe(['cu2206', 'cu2207', 'cu2208', 'cu2209', 'cu2301', 'cu2303', 'cu2304']);
+const quoteSubscribe = quote.addSubscribe(['cu2206', 'cu2207', 'cu2208', 'cu2209', 'cu2301', 'cu2303', 'cu2304']);
 const showAction = ref(false);
 
 const columns = reactive<TableColumn[]>([

+ 1 - 0
src/packages/pc/components/base/table-details/index.vue

@@ -35,6 +35,7 @@ interface cellProp {
     label: string;
     decimal?: number; // 保留小数点位数
     entireRow?: boolean; // 是否整行显示
+    hideEmpty?: boolean; // 是否隐藏空值
 }
 
 const props = defineProps({

+ 0 - 1
src/packages/pc/main.ts

@@ -2,7 +2,6 @@ import { createApp } from 'vue'
 import App from './App.vue'
 import router from './router'
 import directives from '@/directives' // 自定义指令集
-import '@/services/subscribe' // 全局订阅通知
 import '@/mock' // 模拟数据
 import { i18n } from '@/stores' // 国际化语言
 import layouts from "./components/layouts" // 布局组件

+ 9 - 14
src/packages/pc/views/centralize/mine/components/add/index.vue

@@ -243,20 +243,15 @@ const onSubmit = () => {
 
             loading.value = true
             gzCenterPurchaseApply({
-                data: {
-                    ...formData,
-                    BuyMarginValue: (formData.BuyMarginValue ?? 0) / 100
-                },
-                success: () => {
-                    ElMessage.success('提交成功')
-                    onCancel(true)
-                },
-                fail: (err) => {
-                    ElMessage.error('提交失败:' + err)
-                },
-                complete: () => {
-                    loading.value = false
-                }
+                ...formData,
+                BuyMarginValue: (formData.BuyMarginValue ?? 0) / 100
+            }).then(() => {
+                ElMessage.success('提交成功')
+                onCancel(true)
+            }).catch((err) => {
+                ElMessage.error('提交失败:' + err)
+            }).finally(() => {
+                loading.value = false
             })
         }
     })

+ 10 - 14
src/packages/pc/views/presale/list/components/buy/index.vue

@@ -1,7 +1,7 @@
 <!-- 预售大厅-预售大厅-认购 -->
 <template>
     <app-drawer title="认购" v-model:show="show" :loading="loading" :refresh="refresh">
-        <el-form ref="formRef" label-width="140px" :model="formData" :rules="formRules">
+        <el-form ref="formRef" label-width="100px" :model="formData" :rules="formRules">
             <el-form-item label="商品名称">
                 {{ selectedRow.wrstandardname }}
             </el-form-item>
@@ -32,6 +32,7 @@ import { shallowRef, reactive, PropType } from 'vue'
 import { ElMessage, FormInstance, FormRules } from 'element-plus'
 import { gzPresaleOrder } from '@/services/api/presale'
 import AppDrawer from '@pc/components/base/drawer/index.vue'
+import Long from 'long'
 
 const props = defineProps({
     selectedRow: {
@@ -46,7 +47,7 @@ const refresh = shallowRef(false)
 const loading = shallowRef(false)
 
 const formData = reactive<Partial<Proto.GZPresaleOrderReq>>({
-    WRTradeOrderID: props.selectedRow.sellwrtradeorderid, // 仓单贸易委托单ID,必填
+    WRTradeOrderID:Long.fromString(props.selectedRow.sellwrtradeorderid), // 仓单贸易委托单ID,必填
 })
 
 const formRules: FormRules = {
@@ -65,18 +66,13 @@ const onSubmit = () => {
     formRef.value?.validate((valid) => {
         if (valid) {
             loading.value = true
-            gzPresaleOrder({
-                data: formData,
-                success: () => {
-                    ElMessage.success('提交成功')
-                    onCancel(true)
-                },
-                fail: (err) => {
-                    ElMessage.error('提交失败:' + err)
-                },
-                complete: () => {
-                    loading.value = false
-                }
+            gzPresaleOrder(formData).then(() => {
+                ElMessage.success('提交成功')
+                onCancel(true)
+            }).catch((err) => {
+                ElMessage.error('提交失败:' + err)
+            }).finally(() => {
+                loading.value = false
             })
         }
     })

+ 61 - 10
src/packages/pc/views/presale/list/components/details/index.vue

@@ -1,9 +1,33 @@
 <!-- 预售大厅-预售大厅-详情 -->
 <template>
-    <app-drawer title="详情" :width="960" v-model:show="show" :loading="loading" :refresh="refresh">
-        <app-table-details title="预售信息" :label-width="100" :data="selectedRow" :cell-props="details1" :column="2" />
-        <app-table-details title="钻石参考信息" :label-width="100" :data="selectedRow" :cell-props="details2" :column="2" />
-        <template #footer>
+    <app-drawer title="详情" :width="800" v-model:show="show" :loading="loading" :refresh="refresh">
+        <app-table-details title="预售信息" :label-width="140" :data="selectedRow" :cell-props="details1" :column="2">
+            <!-- 采购保证金比例 -->
+            <template #buymarginvalue="{ value }">
+                {{ parsePercent(value) }}
+            </template>
+            <!-- 状态 -->
+            <template #presalestatus="{ value }">
+                {{ getWRPresaleStatusName(value) }}
+            </template>
+            <!-- 履约方式 -->
+            <template #performancetemplateid="{ value }">
+                <app-performance-rule :item="getPerformanceTemplateById(value)" />
+            </template>
+        </app-table-details>
+        <app-table-details title="钻石参考信息" :label-width="140" :data="selectedRow" :cell-props="details2" :column="2">
+            <!-- 生产方式 -->
+            <template #ysproductionmode="{ value }">
+                {{ getYSProductionModeName(value) }}
+            </template>
+            <!-- 图片 -->
+            <template #pictureurls>
+                <template v-for="(url, index) in imageUrl" :key="index">
+                    <el-image :src="url" :preview-src-list="imageUrl" fit="cover" />
+                </template>
+            </template>
+        </app-table-details>
+        <template #footer v-if="selectedRow.presalestatus !== 1">
             <el-button @click="onCancel(false)" plain>取消</el-button>
             <el-button type="primary" @click="showBuy = true">认购</el-button>
         </template>
@@ -12,11 +36,15 @@
 </template>
 
 <script lang="ts" setup>
-import { shallowRef, PropType, defineAsyncComponent } from 'vue'
+import { shallowRef, reactive, PropType, onMounted, defineAsyncComponent } from 'vue'
+import { getFileUrl, parsePercent } from '@/filters'
+import { getWRPresaleStatusName, getYSProductionModeName } from '@/constants/presale'
+import { performanceStore } from '@/stores'
 import AppDrawer from '@pc/components/base/drawer/index.vue'
 import AppTableDetails from '@pc/components/base/table-details/index.vue'
+import AppPerformanceRule from '@pc/components/modules/performance-rule/index.vue'
 
-defineProps({
+const props = defineProps({
     selectedRow: {
         type: Object as PropType<Ermcp.GZPreSellRsp>,
         required: true
@@ -26,10 +54,12 @@ defineProps({
 // 认购
 const Buy = defineAsyncComponent(() => import('../buy/index.vue'))
 
+const { getPerformanceTemplateById } = performanceStore.actions
 const show = shallowRef(true)
 const showBuy = shallowRef(false)
 const refresh = shallowRef(false)
 const loading = shallowRef(false)
+const imageUrl = reactive<string[]>([])
 
 const details1 = [
     { prop: 'wrstandardname', label: '商品名称:' },
@@ -44,7 +74,7 @@ const details1 = [
     { prop: 'enddate', label: '结束日期:' },
     { prop: 'presalestatus', label: '状态:' },
     { prop: 'tradeqty', label: '已认购数量:' },
-    { prop: 'performancetemplateid', label: '履约方式:' },
+    { prop: 'performancetemplateid', label: '履约方式:', entireRow: true },
 ]
 
 const details2 = [
@@ -55,8 +85,8 @@ const details2 = [
     { prop: 'qtydesc', label: '数量描述:' },
     { prop: 'weightdesc', label: '重量描述:' },
     { prop: 'ysproductionmode', label: '生产方式:' },
-    { prop: 'pictureurls', label: '图片:' },
-    { prop: 'remark', label: '备注:' },
+    { prop: 'pictureurls', label: '图片:', entireRow: true },
+    { prop: 'remark', label: '备注:', entireRow: true },
 ]
 
 const onBuyClosed = () => {
@@ -67,4 +97,25 @@ const onCancel = (isRefresh = false) => {
     show.value = false
     refresh.value = isRefresh
 }
-</script>
+
+onMounted(() => {
+    const images = props.selectedRow.pictureurls.split(',')
+    images.forEach((url) => {
+        if (url) {
+            imageUrl.push(getFileUrl(url))
+        }
+    })
+})
+</script>
+
+<style lang="less" scoped>
+.el-image {
+    width: 64px;
+    height: 64px;
+    border: 1px solid #ccc;
+
+    +.el-image {
+        margin-left: 10px;
+    }
+}
+</style>

+ 9 - 14
src/packages/pc/views/presale/mine/components/add/index.vue

@@ -175,20 +175,15 @@ const onSubmit = () => {
 
             loading.value = true
             gzPresaleApply({
-                data: {
-                    ...formData,
-                    BuyMarginValue: (formData.BuyMarginValue ?? 0) / 100
-                },
-                success: () => {
-                    ElMessage.success('提交成功')
-                    onCancel(true)
-                },
-                fail: (err) => {
-                    ElMessage.error('提交失败:' + err)
-                },
-                complete: () => {
-                    loading.value = false
-                }
+                ...formData,
+                BuyMarginValue: (formData.BuyMarginValue ?? 0) / 100
+            }).then(() => {
+                ElMessage.success('提交成功')
+                onCancel(true)
+            }).catch((err) => {
+                ElMessage.error('提交失败:' + err)
+            }).finally(() => {
+                loading.value = false
             })
         }
     })

+ 3 - 1
src/packages/pc/views/presale/mine/components/apply/details.vue

@@ -81,7 +81,9 @@ const details2 = [
 onMounted(() => {
     const images = props.selectedRow.pictureurls.split(',')
     images.forEach((url) => {
-        imageUrl.push(getFileUrl(url))
+        if (url) {
+            imageUrl.push(getFileUrl(url))
+        }
     })
 })
 </script>

+ 59 - 7
src/packages/pc/views/presale/mine/components/details/index.vue

@@ -1,8 +1,32 @@
 <!-- 预售大厅-我的预售-详情 -->
 <template>
     <app-drawer class="g-details" title="详情" :width="960" v-model:show="show">
-        <app-table-details title="预售信息" :label-width="100" :data="selectedRow" :cell-props="details1" :column="2" />
-        <app-table-details title="钻石参考信息" :label-width="100" :data="selectedRow" :cell-props="details2" :column="2" />
+        <app-table-details title="预售信息" :label-width="140" :data="selectedRow" :cell-props="details1" :column="2">
+            <!-- 采购保证金比例 -->
+            <template #buymarginvalue="{ value }">
+                {{ parsePercent(value) }}
+            </template>
+            <!-- 状态 -->
+            <template #presalestatus="{ value }">
+                {{ getWRPresaleStatusName(value) }}
+            </template>
+            <!-- 履约方式 -->
+            <template #performancetemplateid="{ value }">
+                <app-performance-rule :item="getPerformanceTemplateById(value)" />
+            </template>
+        </app-table-details>
+        <app-table-details title="钻石参考信息" :label-width="140" :data="selectedRow" :cell-props="details2" :column="2">
+            <!-- 生产方式 -->
+            <template #ysproductionmode="{ value }">
+                {{ getYSProductionModeName(value) }}
+            </template>
+            <!-- 图片 -->
+            <template #pictureurls>
+                <template v-for="(url, index) in imageUrl" :key="index">
+                    <el-image :src="url" :preview-src-list="imageUrl" fit="cover" />
+                </template>
+            </template>
+        </app-table-details>
         <app-table :data="dataList" :columns="columns" :show-toolbar="false" :loading="loading" border>
             <template #header>
                 <h3 class="g-details__title">认购信息</h3>
@@ -15,14 +39,18 @@
 </template>
 
 <script lang="ts" setup>
-import { shallowRef, PropType } from 'vue'
+import { shallowRef, reactive, PropType, onMounted } from 'vue'
 import { ElMessage } from 'element-plus'
+import { getFileUrl, parsePercent } from '@/filters'
+import { getWRPresaleStatusName, getYSProductionModeName } from '@/constants/presale'
 import { useRequest } from '@/hooks/request'
+import { performanceStore } from '@/stores'
 import { queryGZMyPresell } from '@/services/api/presale'
 import AppDrawer from '@pc/components/base/drawer/index.vue'
 import AppTable from '@pc/components/base/table/index.vue'
 import AppPagination from '@pc/components/base/pagination/index.vue'
 import AppTableDetails from '@pc/components/base/table-details/index.vue'
+import AppPerformanceRule from '@pc/components/modules/performance-rule/index.vue'
 
 const props = defineProps({
     selectedRow: {
@@ -31,7 +59,10 @@ const props = defineProps({
     },
 })
 
+const { getPerformanceTemplateById } = performanceStore.actions
 const show = shallowRef(true)
+const imageUrl = reactive<string[]>([])
+
 const { loading, dataList, total, pageIndex, pageSize, run } = useRequest(queryGZMyPresell, {
     params: {
         pagesize: 10,
@@ -55,7 +86,7 @@ const details1 = [
     { prop: 'enddate', label: '结束日期:' },
     { prop: 'presalestatus', label: '状态:' },
     { prop: 'tradeqty', label: '已认购数量:' },
-    { prop: 'performancetemplateid', label: '履约方式:' },
+    { prop: 'performancetemplateid', label: '履约方式:', entireRow: true },
 ]
 
 const details2 = [
@@ -66,8 +97,8 @@ const details2 = [
     { prop: 'qtydesc', label: '数量描述:' },
     { prop: 'weightdesc', label: '重量描述:' },
     { prop: 'ysproductionmode', label: '生产方式:' },
-    { prop: 'pictureurls', label: '图片:' },
-    { prop: 'remark', label: '备注:' },
+    { prop: 'pictureurls', label: '图片:', entireRow: true },
+    { prop: 'remark', label: '备注:', entireRow: true },
 ]
 
 const columns: Ermcp.TableColumn[] = [
@@ -75,4 +106,25 @@ const columns: Ermcp.TableColumn[] = [
     { prop: 'orderqty', label: '认购数量(ct)' },
     { prop: 'ordertime', label: '认购时间' },
 ]
-</script>
+
+onMounted(() => {
+    const images = props.selectedRow.pictureurls.split(',')
+    images.forEach((url) => {
+        if (url) {
+            imageUrl.push(getFileUrl(url))
+        }
+    })
+})
+</script>
+
+<style lang="less" scoped>
+.el-image {
+    width: 64px;
+    height: 64px;
+    border: 1px solid #ccc;
+
+    +.el-image {
+        margin-left: 10px;
+    }
+}
+</style>

+ 30 - 8
src/services/api/account/index.ts

@@ -1,26 +1,48 @@
 import http from '@/services/http'
-import { tradeServerRequest } from '@/services/socket/trade'
-import { TradeParams } from '@/services/socket/trade/interface'
+import tradeServer from '@/services/socket/trade'
 
 /**
  * 用户登录
  */
-export function login(params: TradeParams<Proto.LoginReq, Proto.LoginRsp>) {
-    return tradeServerRequest('LoginReq', 'LoginRsp', params);
+export function login(params: Proto.LoginReq) {
+    return tradeServer.sendMessage<Proto.LoginRsp>({
+        params,
+        reqName: 'LoginReq',
+        rspName: 'LoginRsp'
+    })
+}
+
+/**
+ * 用户登出
+ */
+export function logout(params: Proto.LogoutReq) {
+    return tradeServer.sendMessage<Proto.LogoutRsp>({
+        params,
+        reqName: 'LogoutReq',
+        rspName: 'LogoutRsp'
+    })
 }
 
 /**
  * 用户令牌校验
  */
-export function tokenCheck(params: TradeParams<Proto.TokenCheckReq, Proto.TokenCheckRsp>) {
-    return tradeServerRequest('TokenCheckReq', 'TokenCheckRsp', params);
+export function tokenCheck(params: Proto.TokenCheckReq) {
+    return tradeServer.sendMessage<Proto.TokenCheckRsp>({
+        params,
+        reqName: 'TokenCheckReq',
+        rspName: 'TokenCheckRsp'
+    })
 }
 
 /**
  * 修改密码
  */
-export function modifyPassword(params: TradeParams<Proto.ModifyPwdReq, Proto.ModifyPwdRsp>) {
-    return tradeServerRequest('ModifyPwdReq', 'ModifyPwdRsp', params);
+export function modifyPassword(params: Proto.ModifyPwdReq) {
+    return tradeServer.sendMessage<Proto.ModifyPwdRsp>({
+        params,
+        reqName: 'ModifyPwdReq',
+        rspName: 'ModifyPwdRsp'
+    })
 }
 
 /**

+ 25 - 10
src/services/api/bank/index.ts

@@ -1,33 +1,48 @@
 import http from '@/services/http'
-import { tradeServerRequest } from '@/services/socket/trade'
-import { TradeParams } from '@/services/socket/trade/interface'
+import tradeServer from '@/services/socket/trade'
 
 /**
  * 银行签约
  */
-export function t2bBankSign(params: TradeParams<Partial<Proto.t2bBankSignReq>, Proto.t2bBankSignRsp>) {
-    return tradeServerRequest('t2bBankSignReq', 't2bBankSignRsp', params);
+export function t2bBankSign(params: Partial<Proto.t2bBankSignReq>) {
+    return tradeServer.sendMessage<Proto.t2bBankSignRsp>({
+        params,
+        reqName: 't2bBankSignReq',
+        rspName: 't2bBankSignRsp'
+    })
 }
 
 /**
  * 银行解约
  */
-export function t2bBankCancelSign(params: TradeParams<Proto.t2bBankCancelSignReq, Proto.t2bBankCancelSignRsp>) {
-    return tradeServerRequest('t2bBankCancelSignReq', 't2bBankCancelSignRsp', params);
+export function t2bBankCancelSign(params: Proto.t2bBankCancelSignReq) {
+    return tradeServer.sendMessage<Proto.t2bBankCancelSignRsp>({
+        params,
+        reqName: 't2bBankCancelSignReq',
+        rspName: 't2bBankCancelSignRsp'
+    })
 }
 
 /**
  * 出金申请
  */
-export function t2bBankWithdraw(params: TradeParams<Partial<Proto.t2bBankWithdrawReq>, Proto.t2bBankWithdrawRsp>) {
-    return tradeServerRequest('t2bBankWithdrawReq', 't2bBankWithdrawRsp', params);
+export function t2bBankWithdraw(params: Partial<Proto.t2bBankWithdrawReq>) {
+    return tradeServer.sendMessage<Proto.t2bBankWithdrawRsp>({
+        params,
+        reqName: 't2bBankWithdrawReq',
+        rspName: 't2bBankWithdrawRsp'
+    })
 }
 
 /**
  * 入金申请
  */
-export function t2bBankDeposit(params: TradeParams<Partial<Proto.t2bBankDepositReq>, Proto.t2bBankDepositRsp>) {
-    return tradeServerRequest('t2bBankDepositReq', 't2bBankDepositRsp', params);
+export function t2bBankDeposit(params: Partial<Proto.t2bBankDepositReq>) {
+    return tradeServer.sendMessage<Proto.t2bBankDepositRsp>({
+        params,
+        reqName: 't2bBankDepositReq',
+        rspName: 't2bBankDepositRsp'
+    })
 }
 
 /**

+ 22 - 8
src/services/api/bonded/index.ts

@@ -1,6 +1,5 @@
 import http from '@/services/http'
-import { tradeServerRequest } from '@/services/socket/trade'
-import { TradeParams } from '@/services/socket/trade/interface'
+import tradeServer from '@/services/socket/trade'
 
 /**
  * 获取保税商品表
@@ -84,20 +83,35 @@ export function queryBscinoutorder(params: Ermcp.BscinoutorderReq) {
 /**
  * 保税仓进出仓申请
  */
-export function bscInAndOutWareHouseApply(params: TradeParams<Proto.BSCInAndOutWareHouseApplyReq, Proto.BSCInAndOutWareHouseApplyRsp>) {
-    return tradeServerRequest('BSCInAndOutWareHouseApplyReq', 'BSCInAndOutWareHouseApplyRsp', params, 66201);
+export function bscInAndOutWareHouseApply(params: Proto.BSCInAndOutWareHouseApplyReq) {
+    return tradeServer.sendMessage<Proto.BSCInAndOutWareHouseApplyRsp>({
+        params,
+        reqName: 'BSCInAndOutWareHouseApplyReq',
+        rspName: 'BSCInAndOutWareHouseApplyRsp',
+        marketId: 66201
+    })
 }
 
 /**
  * 保税仓上传文件
  */
-export function bscUploadFile(params: TradeParams<Proto.BSCUploadFileReq, Proto.BSCUploadFileRsp>) {
-    return tradeServerRequest('BSCUploadFileReq', 'BSCUploadFileRsp', params, 66201);
+export function bscUploadFile(params: Proto.BSCUploadFileReq) {
+    return tradeServer.sendMessage<Proto.BSCUploadFileRsp>({
+        params,
+        reqName: 'BSCUploadFileReq',
+        rspName: 'BSCUploadFileRsp',
+        marketId: 66201
+    })
 }
 
 /**
  * 保税仓确认支付
  */
-export function bscConfirmPay(params: TradeParams<Proto.BSCConfirmPayReq, Proto.BSCConfirmPayRsp>) {
-    return tradeServerRequest('BSCConfirmPayReq', 'BSCConfirmPayRsp', params, 66201);
+export function bscConfirmPay(params: Proto.BSCConfirmPayReq) {
+    return tradeServer.sendMessage<Proto.BSCConfirmPayRsp>({
+        params,
+        reqName: 'BSCConfirmPayReq',
+        rspName: 'BSCConfirmPayRsp',
+        marketId: 66201
+    })
 }

+ 29 - 10
src/services/api/customs/index.ts

@@ -1,6 +1,5 @@
 import http from '@/services/http'
-import { tradeServerRequest } from '@/services/socket/trade'
-import { TradeParams } from '@/services/socket/trade/interface'
+import tradeServer from '@/services/socket/trade'
 
 /**
  * 查询出境检测单据
@@ -85,27 +84,47 @@ export function queryFworderoperate(params: Ermcp.FworderoperateReq) {
 /**
  * 出境检测申请
  */
-export function cjjcApply(params: TradeParams<Partial<Proto.CJJCApplyReq>, Proto.CJJCApplyRsp>) {
-    return tradeServerRequest('CJJCApplyReq', 'CJJCApplyRsp', params, 66201);
+export function cjjcApply(params: Partial<Proto.CJJCApplyReq>) {
+    return tradeServer.sendMessage<Proto.CJJCApplyRsp>({
+        params,
+        reqName: 'CJJCApplyReq',
+        rspName: 'CJJCApplyRsp',
+        marketId: 66201
+    })
 }
 
 /**
  * 出境检测会员操作
  */
-export function cjjcMemberOperate(params: TradeParams<Proto.CJJCMemberOperateReq, Proto.CJJCMemberOperateRsp>) {
-    return tradeServerRequest('CJJCMemberOperateReq', 'CJJCMemberOperateRsp', params, 66201);
+export function cjjcMemberOperate(params: Proto.CJJCMemberOperateReq) {
+    return tradeServer.sendMessage<Proto.CJJCMemberOperateRsp>({
+        params,
+        reqName: 'CJJCMemberOperateReq',
+        rspName: 'CJJCMemberOperateRsp',
+        marketId: 66201
+    })
 }
 
 /**
  * 出境检测确认预付款生成文件
  */
-export function cjjcConfirmMarginBuildFileReq(params: TradeParams<Proto.CJJCConfirmMarginBuildFileReq, Proto.CJJCConfirmMarginBuildFileRsp>) {
-    return tradeServerRequest('CJJCConfirmMarginBuildFileReq', 'BSFWMemberOperateRsp', params, 66201);
+export function cjjcConfirmMarginBuildFileReq(params: Proto.CJJCConfirmMarginBuildFileReq) {
+    return tradeServer.sendMessage<Proto.CJJCConfirmMarginBuildFileRsp>({
+        params,
+        reqName: 'CJJCConfirmMarginBuildFileReq',
+        rspName: 'CJJCConfirmMarginBuildFileRsp',
+        marketId: 66201
+    })
 }
 
 /**
  * 保税服务会员操作
  */
-export function bsfwMemberOperate(params: TradeParams<Proto.BSFWMemberOperateReq, Proto.BSFWMemberOperateRsp>) {
-    return tradeServerRequest('BSFWMemberOperateReq', 'BSFWMemberOperateRsp', params, 66201);
+export function bsfwMemberOperate(params: Proto.BSFWMemberOperateReq) {
+    return tradeServer.sendMessage<Proto.BSFWMemberOperateRsp>({
+        params,
+        reqName: 'BSFWMemberOperateReq',
+        rspName: 'BSFWMemberOperateRsp',
+        marketId: 66201
+    })
 }

+ 8 - 5
src/services/api/favorite/index.ts

@@ -1,7 +1,5 @@
 import http from '@/services/http'
-import { tradeServerRequest } from '@/services/socket/trade'
-import { TradeParams } from '@/services/socket/trade/interface'
-import { Market } from '@/constants/market'
+import tradeServer from '@/services/socket/trade'
 
 /**
  * 查询我的收藏
@@ -16,6 +14,11 @@ export function queryMyFavorite(params: Ermcp.MyFavoriteReq) {
 /**
  * 商品收藏操作
  */
-export function goodsFavoriteOperate(params: TradeParams<Proto.GoodsFavoriteOperateReq, Proto.GoodsFavoriteOperateRsp>) {
-    return tradeServerRequest('GoodsFavoriteOperateReq', 'GoodsFavoriteOperateRsp', params, Market.GZ);
+export function goodsFavoriteOperate(params: Proto.GoodsFavoriteOperateReq) {
+    return tradeServer.sendMessage<Proto.GoodsFavoriteOperateRsp>({
+        params,
+        reqName: 'GoodsFavoriteOperateReq',
+        rspName: 'GoodsFavoriteOperateRsp',
+        marketId: 67201
+    })
 }

+ 15 - 7
src/services/api/goods/index.ts

@@ -1,7 +1,5 @@
 import http from '@/services/http'
-import { tradeServerRequest } from '@/services/socket/trade'
-import { TradeParams } from '@/services/socket/trade/interface'
-import { Market } from '@/constants/market'
+import tradeServer from '@/services/socket/trade'
 
 /**
  * 查询商品列表
@@ -35,13 +33,23 @@ export function queryDiamondDetails(params: Ermcp.DiamondDetailsReq) {
 /**
  * 新增钻石商品
  */
-export function addDiamond(params: TradeParams<Proto.AddZSGoodsReq, Proto.AddZSGoodsRsp>) {
-    return tradeServerRequest('AddZSGoodsReq', 'AddZSGoodsRsp', params, Market.GZ);
+export function addDiamond(params: Proto.AddZSGoodsReq) {
+    return tradeServer.sendMessage<Proto.AddZSGoodsRsp>({
+        params,
+        reqName: 'AddZSGoodsReq',
+        rspName: 'AddZSGoodsRsp',
+        marketId: 67201
+    })
 }
 
 /**
  * 钻石出库申请
  */
-export function receiptZSOutApply(params: TradeParams<Proto.ReceiptZSOutApplyReq, Proto.ReceiptZSOutApplyRsp>) {
-    return tradeServerRequest('ReceiptZSOutApplyReq', 'ReceiptZSOutApplyRsp', params, 4);
+export function receiptZSOutApply(params: Proto.ReceiptZSOutApplyReq) {
+    return tradeServer.sendMessage<Proto.ReceiptZSOutApplyRsp>({
+        params,
+        reqName: 'ReceiptZSOutApplyReq',
+        rspName: 'ReceiptZSOutApplyRsp',
+        marketId: 4
+    })
 }

+ 25 - 10
src/services/api/performance/index.ts

@@ -1,33 +1,48 @@
 import http from '@/services/http'
-import { tradeServerRequest } from '@/services/socket/trade'
-import { TradeParams } from '@/services/socket/trade/interface'
+import tradeServer from '@/services/socket/trade'
 
 /**
  * 履约违约申请
  */
-export function performanceContractedApply(params: TradeParams<Proto.PerformanceContractedApplyReq, Proto.PerformanceContractedApplyRsp>) {
-    return tradeServerRequest('PerformanceContractedApplyReq', 'PerformanceContractedApplyRsp', params);
+export function performanceContractedApply(params: Proto.PerformanceContractedApplyReq) {
+    return tradeServer.sendMessage<Proto.PerformanceContractedApplyRsp>({
+        params,
+        reqName: 'PerformanceContractedApplyReq',
+        rspName: 'PerformanceContractedApplyRsp'
+    })
 }
 
 /**
  * 履约延期申请
  */
-export function performanceDelayApply(params: TradeParams<Proto.PerformanceDelayApplyReq, Proto.PerformanceDelayApplyRsp>) {
-    return tradeServerRequest('PerformanceDelayApplyReq', 'PerformanceDelayApplyRsp', params);
+export function performanceDelayApply(params: Proto.PerformanceDelayApplyReq) {
+    return tradeServer.sendMessage<Proto.PerformanceDelayApplyRsp>({
+        params,
+        reqName: 'PerformanceDelayApplyReq',
+        rspName: 'PerformanceDelayApplyRsp'
+    })
 }
 
 /**
  * 履约手动申请
  */
-export function performanceManualConfirm(params: TradeParams<Proto.PerformanceManualConfirmReq, Proto.PerformanceManualConfirmRsp>) {
-    return tradeServerRequest('PerformanceManualConfirmReq', 'PerformanceManualConfirmRsp', params);
+export function performanceManualConfirm(params: Proto.PerformanceManualConfirmReq) {
+    return tradeServer.sendMessage<Proto.PerformanceManualConfirmRsp>({
+        params,
+        reqName: 'PerformanceManualConfirmReq',
+        rspName: 'PerformanceManualConfirmRsp'
+    })
 }
 
 /**
  * 履约修改联络信息
  */
-export function performanceModifyContact(params: TradeParams<Proto.PerformanceModifyContactReq, Proto.PerformanceModifyContactRsp>) {
-    return tradeServerRequest('PerformanceModifyContactReq', 'PerformanceModifyContactRsp', params);
+export function performanceModifyContact(params: Proto.PerformanceModifyContactReq) {
+    return tradeServer.sendMessage<Proto.PerformanceModifyContactRsp>({
+        params,
+        reqName: 'PerformanceModifyContactReq',
+        rspName: 'PerformanceModifyContactRsp'
+    })
 }
 
 /**

+ 59 - 44
src/services/api/presale/index.ts

@@ -1,9 +1,8 @@
 import { v4 } from 'uuid'
 import { loginStore } from '@/stores'
 import { ClientType } from '@/constants/client'
-import { tradeServerRequest } from '@/services/socket/trade'
-import { TradeParams } from '@/services/socket/trade/interface'
 import http from '@/services/http'
+import tradeServer from '@/services/socket/trade'
 import moment from 'moment'
 
 const { userId, firstAccountId } = loginStore.$mapGetters()
@@ -53,61 +52,77 @@ export function queryGZMyTradingPreSell(params: Ermcp.GZMyTradingPreSellReq) {
 /**
  * 广钻预售申请
  */
-export function gzPresaleApply(params: TradeParams<Partial<Proto.GZPresaleApplyReq>, Proto.GZPresaleApplyRsp>) {
-    params.data = {
-        SellUserID: userId.value,
-        SellAccountID: firstAccountId.value,
-        MarketID: 63201,
-        ClientType: ClientType.Web,
-        ClientSerialNo: v4(),
-        ...params.data
-    }
-    return tradeServerRequest('GZPresaleApplyReq', 'GZPresaleApplyRsp', params, 63201);
+export function gzPresaleApply(params: Partial<Proto.GZPresaleApplyReq>) {
+    return tradeServer.sendMessage<Proto.GZPresaleApplyRsp>({
+        params: {
+            SellUserID: userId.value,
+            SellAccountID: firstAccountId.value,
+            MarketID: 63201,
+            ClientType: ClientType.Web,
+            ClientSerialNo: v4(),
+            ...params
+        },
+        reqName: 'GZPresaleApplyReq',
+        rspName: 'GZPresaleApplyRsp',
+        marketId: 63201
+    })
 }
 
 /**
  * 广钻预售认购下单
  */
-export function gzPresaleOrder(params: TradeParams<Partial<Proto.GZPresaleOrderReq>, Proto.GZPresaleOrderRsp>) {
-    params.data = {
-        UserID: userId.value,
-        AccountID: firstAccountId.value,
-        MarketID: 63201,
-        ClientOrderTime: moment().format('YYYY-MM-DD HH:mm:ss'),
-        ClientType: ClientType.Web,
-        ClientSerialNo: v4(),
-        ...params.data
-    }
-    return tradeServerRequest('GZPresaleOrderReq', 'GZPresaleOrderRsp', params, 63201);
+export function gzPresaleOrder(params: Partial<Proto.GZPresaleOrderReq>) {
+    return tradeServer.sendMessage<Proto.GZPresaleOrderRsp>({
+        params: {
+            UserID: userId.value,
+            AccountID: firstAccountId.value,
+            MarketID: 63201,
+            ClientOrderTime: moment().format('YYYY-MM-DD HH:mm:ss'),
+            ClientType: ClientType.Web,
+            ClientSerialNo: v4(),
+            ...params
+        },
+        reqName: 'GZPresaleOrderReq',
+        rspName: 'GZPresaleOrderRsp',
+        marketId: 63201
+    })
 }
 
 /**
  * 广钻集采申请
  */
-export function gzCenterPurchaseApply(params: TradeParams<Partial<Proto.GZCenterPurchaseApplyReq>, Proto.GZCenterPurchaseApplyRsp>) {
-    params.data = {
-        SellUserID: userId.value,
-        SellAccountID: firstAccountId.value,
-        MarketID: 62201,
-        ClientType: ClientType.Web,
-        ClientSerialNo: v4(),
-        ...params.data
-    }
-    return tradeServerRequest('GZCenterPurchaseApplyReq', 'GZCenterPurchaseApplyRsp', params, 62201);
+export function gzCenterPurchaseApply(params: Partial<Proto.GZCenterPurchaseApplyReq>) {
+    return tradeServer.sendMessage<Proto.GZCenterPurchaseApplyRsp>({
+        params: {
+            SellUserID: userId.value,
+            SellAccountID: firstAccountId.value,
+            MarketID: 62201,
+            ClientType: ClientType.Web,
+            ClientSerialNo: v4(),
+            ...params
+        },
+        reqName: 'GZCenterPurchaseApplyReq',
+        rspName: 'GZCenterPurchaseApplyRsp',
+        marketId: 62201
+    })
 }
 
 /**
  * 广钻集采认购下单
  */
-export function gzCenterPurchaseOrder(params: TradeParams<Partial<Proto.GZCenterPurchaseOrderReq>, Proto.GZCenterPurchaseOrderRsp>) {
-    params.data = {
-        UserID: userId.value,
-        AccountID: firstAccountId.value,
-        MarketID: 62201,
-        ClientOrderTime: moment().format('YYYY-MM-DD HH:mm:ss'),
-        ClientType: ClientType.Web,
-        ClientSerialNo: v4(),
-        ...params.data
-    }
-    return tradeServerRequest('GZCenterPurchaseOrderReq', 'GZCenterPurchaseOrderRsp', params, 62201);
+export function gzCenterPurchaseOrder(params: Partial<Proto.GZCenterPurchaseOrderReq>) {
+    return tradeServer.sendMessage<Proto.GZCenterPurchaseOrderRsp>({
+        params: {
+            UserID: userId.value,
+            AccountID: firstAccountId.value,
+            MarketID: 62201,
+            ClientOrderTime: moment().format('YYYY-MM-DD HH:mm:ss'),
+            ClientType: ClientType.Web,
+            ClientSerialNo: v4(),
+            ...params
+        },
+        reqName: 'GZCenterPurchaseOrderReq',
+        rspName: 'GZCenterPurchaseOrderRsp',
+        marketId: 62201
+    })
 }

+ 57 - 19
src/services/api/trade/index.ts

@@ -1,62 +1,100 @@
 import http from '@/services/http'
-import { tradeServerRequest } from '@/services/socket/trade'
-import { TradeParams } from '@/services/socket/trade/interface'
-import { Market } from '@/constants/market'
+import tradeServer from '@/services/socket/trade'
 
 /**
  * 钻石买挂牌
  */
-export function zsBuyOrderListing(params: TradeParams<Proto.ZSBuyOrderListingReq, Proto.ZSBuyOrderListingRsp>) {
-    return tradeServerRequest('ZSBuyOrderListingReq', 'ZSBuyOrderListingRsp', params, Market.GZ);
+export function zsBuyOrderListing(params: Proto.ZSBuyOrderListingReq) {
+    return tradeServer.sendMessage<Proto.ZSBuyOrderListingRsp>({
+        params,
+        reqName: 'ZSBuyOrderListingReq',
+        rspName: 'ZSBuyOrderListingRsp',
+        marketId: 67201
+    })
 }
 
 /**
  * 钻石卖挂牌
  */
-export function zsSellOrderListing(params: TradeParams<Proto.ZSSellOrderListingReq, Proto.ZSSellOrderListingRsp>) {
-    return tradeServerRequest('ZSSellOrderListingReq', 'ZSSellOrderListingRsp', params, Market.GZ);
+export function zsSellOrderListing(params: Proto.ZSSellOrderListingReq) {
+    return tradeServer.sendMessage<Proto.ZSSellOrderListingRsp>({
+        params,
+        reqName: 'ZSSellOrderListingReq',
+        rspName: 'ZSSellOrderListingRsp',
+        marketId: 67201
+    })
 }
 
 /**
  * 钻石买摘牌
  */
-export function zsBuyOrderDesting(params: TradeParams<Proto.ZSBuyOrderDestingReq, Proto.ZSBuyOrderDestingRsp>) {
-    return tradeServerRequest('ZSBuyOrderDestingReq', 'ZSBuyOrderDestingRsp', params, Market.GZ);
+export function zsBuyOrderDesting(params: Proto.ZSBuyOrderDestingReq) {
+    return tradeServer.sendMessage<Proto.ZSBuyOrderDestingRsp>({
+        params,
+        reqName: 'ZSBuyOrderDestingReq',
+        rspName: 'ZSBuyOrderDestingRsp',
+        marketId: 67201
+    })
 }
 
 /**
  * 钻石买摘牌询价
  */
-export function zsBuyOrderDestingNegPrice(params: TradeParams<Proto.ZSBuyOrderDestingNegPriceReq, Proto.ZSBuyOrderDestingNegPriceRsp>) {
-    return tradeServerRequest('ZSBuyOrderDestingNegPriceReq', 'ZSBuyOrderDestingNegPriceRsp', params, Market.GZ);
+export function zsBuyOrderDestingNegPrice(params: Proto.ZSBuyOrderDestingNegPriceReq) {
+    return tradeServer.sendMessage<Proto.ZSBuyOrderDestingNegPriceRsp>({
+        params,
+        reqName: 'ZSBuyOrderDestingNegPriceReq',
+        rspName: 'ZSBuyOrderDestingNegPriceRsp',
+        marketId: 67201
+    })
 }
 
 /**
  * 钻石卖摘牌申请
  */
-export function zsSellOrderDestingApply(params: TradeParams<Proto.ZSSellOrderDestingApplyReq, Proto.ZSSellOrderDestingApplyRsp>) {
-    return tradeServerRequest('ZSSellOrderDestingApplyReq', 'ZSSellOrderDestingApplyRsp', params, Market.GZ);
+export function zsSellOrderDestingApply(params: Proto.ZSSellOrderDestingApplyReq) {
+    return tradeServer.sendMessage<Proto.ZSSellOrderDestingApplyRsp>({
+        params,
+        reqName: 'ZSSellOrderDestingApplyReq',
+        rspName: 'ZSSellOrderDestingApplyRsp',
+        marketId: 67201
+    })
 }
 
 /**
  * 钻石买询价操作
  */
-export function zsBuyOrderDestingNegPriceOperate(params: TradeParams<Proto.ZSBuyOrderDestingNegPriceOperateReq, Proto.ZSBuyOrderDestingNegPriceOperateRsp>) {
-    return tradeServerRequest('ZSBuyOrderDestingNegPriceOperateReq', 'ZSBuyOrderDestingNegPriceOperateRsp', params, Market.GZ);
+export function zsBuyOrderDestingNegPriceOperate(params: Proto.ZSBuyOrderDestingNegPriceOperateReq) {
+    return tradeServer.sendMessage<Proto.ZSBuyOrderDestingNegPriceOperateRsp>({
+        params,
+        reqName: 'ZSBuyOrderDestingNegPriceOperateReq',
+        rspName: 'ZSBuyOrderDestingNegPriceOperateRsp',
+        marketId: 67201
+    })
 }
 
 /**
  * 钻石卖询价操作
  */
-export function zsSellOrderDestingApplyOperate(params: TradeParams<Proto.ZSSellOrderDestingApplyOperateReq, Proto.ZSSellOrderDestingApplyOperateRsp>) {
-    return tradeServerRequest('ZSSellOrderDestingApplyOperateReq', 'ZSSellOrderDestingApplyOperateRsp', params, Market.GZ);
+export function zsSellOrderDestingApplyOperate(params: Proto.ZSSellOrderDestingApplyOperateReq) {
+    return tradeServer.sendMessage<Proto.ZSSellOrderDestingApplyOperateRsp>({
+        params,
+        reqName: 'ZSSellOrderDestingApplyOperateReq',
+        rspName: 'ZSSellOrderDestingApplyOperateRsp',
+        marketId: 67201
+    })
 }
 
 /**
  * 钻石挂牌撤单
  */
-export function wrListingCancelOrder(params: TradeParams<Proto.WRListingCancelOrderReq, Proto.WRListingCancelOrderRsp>) {
-    return tradeServerRequest('WRListingCancelOrderReq', 'WRListingCancelOrderRsp', params, Market.GZ);
+export function wrListingCancelOrder(params: Proto.WRListingCancelOrderReq) {
+    return tradeServer.sendMessage<Proto.WRListingCancelOrderRsp>({
+        params,
+        reqName: 'WRListingCancelOrderReq',
+        rspName: 'WRListingCancelOrderRsp',
+        marketId: 67201
+    })
 }
 
 /**

+ 31 - 12
src/services/api/user/index.ts

@@ -1,7 +1,6 @@
-import { tradeServerRequest } from '@/services/socket/trade'
-import { TradeParams } from '@/services/socket/trade/interface'
 import { loginStore } from '@/stores'
 import http from '@/services/http'
+import tradeServer from '@/services/socket/trade'
 
 const { userId } = loginStore.$mapGetters()
 
@@ -34,34 +33,54 @@ export function queryWrUserReceiptInfo(params?: Ermcp.WrUserReceiptInfoReq) {
 /**
  * 新增修改收货地址
  */
-export function userReceiveInfo(params: TradeParams<Proto.UserReceiveInfoReq, Proto.UserReceiveInfoRsp>) {
-    return tradeServerRequest('UserReceiveInfoReq', 'UserReceiveInfoRsp', params);
+export function userReceiveInfo(params: Proto.UserReceiveInfoReq) {
+    return tradeServer.sendMessage<Proto.UserReceiveInfoRsp>({
+        params,
+        reqName: 'UserReceiveInfoReq',
+        rspName: 'UserReceiveInfoRsp'
+    })
 }
 
 /**
  * 删除收货地址
  */
-export function delUserReceiveInfo(params: TradeParams<Proto.DelUserReceiveInfoReq, Proto.DelUserReceiveInfoRsp>) {
-    return tradeServerRequest('DelUserReceiveInfoReq', 'DelUserReceiveInfoRsp', params);
+export function delUserReceiveInfo(params: Proto.DelUserReceiveInfoReq) {
+    return tradeServer.sendMessage<Proto.DelUserReceiveInfoRsp>({
+        params,
+        reqName: 'DelUserReceiveInfoReq',
+        rspName: 'DelUserReceiveInfoRsp'
+    })
 }
 
 /**
  * 设置默认收货地址
  */
-export function userReceiveIsDefault(params: TradeParams<Proto.UserReceiveIsDefaultReq, Proto.UserReceiveIsDefaultRsp>) {
-    return tradeServerRequest('UserReceiveIsDefaultReq', 'UserReceiveIsDefaultRsp', params);
+export function userReceiveIsDefault(params: Proto.UserReceiveIsDefaultReq) {
+    return tradeServer.sendMessage<Proto.UserReceiveIsDefaultRsp>({
+        params,
+        reqName: 'UserReceiveIsDefaultReq',
+        rspName: 'UserReceiveIsDefaultRsp'
+    })
 }
 
 /**
  * 新增修改用户发票信息
  */
-export function userReceiptInfo(params: TradeParams<Proto.UserReceiptInfoReq, Proto.UserReceiptInfoRsp>) {
-    return tradeServerRequest('UserReceiptInfoReq', 'UserReceiptInfoRsp', params);
+export function userReceiptInfo(params: Proto.UserReceiptInfoReq) {
+    return tradeServer.sendMessage<Proto.UserReceiptInfoRsp>({
+        params,
+        reqName: 'UserReceiptInfoReq',
+        rspName: 'UserReceiptInfoRsp'
+    })
 }
 
 /**
  * 删除用户发票信息
  */
-export function delUserReceiptInfo(params: TradeParams<Proto.DelUserReceiptInfoReq, Proto.DelUserReceiptInfoRsp>) {
-    return tradeServerRequest('DelUserReceiptInfoReq', 'DelUserReceiptInfoRsp', params);
+export function delUserReceiptInfo(params: Proto.DelUserReceiptInfoReq) {
+    return tradeServer.sendMessage<Proto.DelUserReceiptInfoRsp>({
+        params,
+        reqName: 'DelUserReceiptInfoReq',
+        rspName: 'DelUserReceiptInfoRsp'
+    })
 }

+ 7 - 4
src/services/api/warehouse/index.ts

@@ -1,6 +1,5 @@
 import http from '@/services/http'
-import { tradeServerRequest } from '@/services/socket/trade'
-import { TradeParams } from '@/services/socket/trade/interface'
+import tradeServer from '@/services/socket/trade'
 
 /**
  * 查询仓库信息
@@ -15,6 +14,10 @@ export function queryWarehouseInfo(params: Ermcp.WarehouseInfoReq) {
 /**
  * 仓库新增修改
  */
-export function warehouseApply(params: TradeParams<Proto.WarehouseApplyReq, Proto.WarehouseApplyRsp>) {
-    return tradeServerRequest('WarehouseApplyReq', 'WarehouseApplyRsp', params);
+export function warehouseApply(params: Proto.WarehouseApplyReq) {
+    return tradeServer.sendMessage<Proto.WarehouseApplyRsp>({
+        params,
+        reqName: 'WarehouseApplyReq',
+        rspName: 'WarehouseApplyRsp'
+    })
 }

+ 134 - 48
src/services/socket/quote/index.ts

@@ -1,58 +1,144 @@
-import Long from 'long'
+import { v4 } from 'uuid'
 import { Package40 } from '@/utils/websocket/package'
 import { FunCode } from '@/constants/funcode'
-import { QuoteRequest } from './interface'
+import { loginStore } from '@/stores'
 import { subscribeListToByteArrary } from './build/encode'
 import { parseSubscribeRsp } from './build/decode'
-import { loginStore } from '@/stores'
+import Long from 'long'
+import eventBus from '@/services/bus'
 import socket from '../index'
 
-/**
- * 向行情服务器发送请求
- * @param params 
- */
-function quoteServerMiddleware(params: QuoteRequest): Promise<Proto.QuoteRsp[]> {
-    const { loginId, token } = loginStore.$mapGetters();
-    const content = subscribeListToByteArrary(params.data, token.value, Long.fromNumber(loginId.value));
-
-    return new Promise((resolve, reject) => {
-        socket.sendQuoteServer({
-            data: {
-                rspCode: FunCode.QuoteSubscribeRsp,
-                payload: new Package40(FunCode.QuoteSubscribeReq, content)
-            },
-            success: (raw) => {
-                if (raw.content) {
-                    parseSubscribeRsp(raw.content).then((res) => {
-                        resolve(res);
-                    }).catch(() => {
-                        console.warn('报文解析失败', raw);
-                        reject('报文解析失败')
+export default new (class {
+    /** 行情订阅列表 */
+    private quoteSubscribeMap = new Map<string, string[]>()
+
+    constructor() {
+        // 接收行情服务断线重连成功通知
+        eventBus.$on('QuoteServerReconnectNotify', () => {
+            this.quoteSubscribe();
+        })
+    }
+
+    /**
+     * 向行情服务器发送请求
+     * @param params 
+     * @returns 
+     */
+    private send(params: Proto.QuoteReq[]) {
+        const { loginId, token } = loginStore.$mapGetters()
+        const content = subscribeListToByteArrary(params, token.value, Long.fromNumber(loginId.value));
+
+        return new Promise<Proto.QuoteRsp[]>((resolve, reject) => {
+            socket.sendQuoteServer({
+                data: {
+                    rspCode: FunCode.QuoteSubscribeRsp,
+                    payload: new Package40(FunCode.QuoteSubscribeReq, content)
+                },
+                success: (raw) => {
+                    if (raw.content) {
+                        parseSubscribeRsp(raw.content).then((res) => {
+                            resolve(res);
+                        }).catch(() => {
+                            console.warn('报文解析失败', raw)
+                            reject('报文解析失败')
+                        })
+                    } else {
+                        reject('数据异常')
+                    }
+                },
+                fail: (err) => {
+                    console.error('服务器请求失败', err)
+                    reject(err)
+                }
+            })
+        })
+    }
+
+    /**
+     * 开始行情订阅
+     */
+    private quoteSubscribe = () => {
+        const subscribeData: Proto.QuoteReq[] = []
+
+        this.quoteSubscribeMap.forEach((values) => {
+            values.forEach((code) => {
+                if (!subscribeData.some((e) => e.goodsCode === code)) {
+                    subscribeData.push({
+                        goodsCode: code,
+                        exchangeCode: 250,
+                        subState: 0
                     })
+                }
+            })
+        })
+
+        if (subscribeData.length) {
+            console.log('开始行情订阅', subscribeData)
+            this.send(subscribeData).then((res) => {
+                if (res.length) {
+                    console.log('行情订阅成功', res)
                 } else {
-                    reject('数据异常');
+                    console.error('行情订阅失败')
                 }
-            },
-            fail: (err) => {
-                console.error('服务器请求失败', err);
-                reject(err);
+            }).catch((err) => {
+                console.error('行情订阅失败', err)
+            })
+        } else {
+            // 没有订阅商品的时候,断开连接
+            socket.closeQuoteServer()
+        }
+    }
+
+    /**
+     * 添加行情订阅
+     * @param goodsCodes 
+     * @param key 
+     * @returns 
+     */
+    addSubscribe = (goodsCodes: string[], key?: string) => {
+        const { token } = loginStore.$mapGetters()
+        const uuid = key ?? v4()
+        const value = this.quoteSubscribeMap.get(uuid) ?? []
+
+        const start = () => {
+            if (token.value) {
+                // 对相同 key 订阅的商品进行合并处理
+                this.quoteSubscribeMap.set(uuid, [...value, ...goodsCodes])
+                this.quoteSubscribe()
             }
-        })
-    })
-}
-
-/**
- * 向行情服务器发送请求
- * @param params 
- */
-export function quoteServerRequest(params: QuoteRequest) {
-    const { success, fail, complete } = params;
-
-    quoteServerMiddleware(params).then((res) => {
-        success && success(res);
-    }).catch((msg) => {
-        fail && fail({ msg });
-    }).finally(() => {
-        complete && complete();
-    })
-}
+        }
+
+        return {
+            uuid,
+            start,
+            stop: () => {
+                const flag = this.quoteSubscribeMap.delete(uuid)
+                if (flag) {
+                    console.log('删除订阅', uuid)
+                }
+                if (token.value) {
+                    this.quoteSubscribe()
+                }
+                return flag
+            },
+        }
+    }
+
+    /**
+     * 删除行情订阅
+     * @param keys 
+     */
+    removeSubscribe = (...keys: string[]) => {
+        if (keys.length) {
+            keys.forEach((key) => {
+                if (this.quoteSubscribeMap.delete(key)) {
+                    console.log('删除订阅', key)
+                }
+            })
+        } else {
+            console.log('取消订阅')
+            this.quoteSubscribeMap.clear()
+        }
+        this.quoteSubscribe()
+    }
+})

+ 0 - 9
src/services/socket/quote/interface.ts

@@ -1,9 +0,0 @@
-/**
- * 行情服务请求参数
- */
-export interface QuoteRequest {
-    data: Proto.QuoteReq[];
-    success?: (res: Proto.QuoteRsp[]) => void;
-    fail?: (err: { msg: string }) => void;
-    complete?: () => void;
-}

+ 66 - 92
src/services/socket/trade/index.ts

@@ -2,116 +2,90 @@ import { v4 } from 'uuid'
 import { Package50 } from '@/utils/websocket/package'
 import { FunCode } from '@/constants/funcode'
 import { loginStore, errorInfoStore } from '@/stores'
-import { IMessageHead } from './protobuf/proto'
-import { TradeParams, TradeResponse } from './interface'
+import { TradeResponse, TradeRequestConfig } from './interface'
 import cryptojs from 'crypto-js'
 import Protobuf from './protobuf'
 import socket from '../index'
 
-/**
- * 构建消息头部
- */
-function getProtoHeader(funCode: keyof typeof FunCode, header?: IMessageHead, marketId?: number) {
-    const { userId, firstAccountId } = loginStore.$mapGetters();
-    // 组合请求头
-    const protoHeader: IMessageHead = {
-        FunCode: FunCode[funCode],
-        UUID: v4(),
-        UserID: userId.value,
-        AccountID: firstAccountId.value,
-        ...(header ?? {})
-    }
-    if (marketId) {
-        protoHeader.MarketID = marketId;
-    }
-    return protoHeader;
-}
+export default new (class {
+    /**
+     * 向交易服务器发送请求
+     * @param config 
+     * @returns 
+     */
+    private send<T>({ params, reqName, rspName, marketId = 0 }: TradeRequestConfig) {
+        const { userId } = loginStore.$mapGetters()
+        const reqCode = FunCode[reqName]
+        const rspCode = FunCode[rspName]
 
-/**
- * 向交易服务器发送请求
- * @param params 请求参数
- * @param reqKey 请求代码
- * @param rspKey 回调代码
- * @param marketId 市场ID
- */
-function tradeServerMiddleware<Req, Rsp>(reqKey: keyof typeof FunCode, rspKey: keyof typeof FunCode, params: TradeParams<Req, Rsp>, marketId?: number): Promise<Rsp> {
-    params.data.Header = getProtoHeader(reqKey, params.data.Header, marketId);
-    console.log(reqKey, FunCode[reqKey], params.data);
+        // 默认请求头
+        params.Header = {
+            MarketID: marketId,
+            FunCode: reqCode,
+            UUID: v4(),
+            UserID: userId.value,
+            ...params.Header
+        }
 
-    return new Promise((resolve, reject) => {
-        Protobuf.requestEncode(reqKey, params.data).then((res) => {
-            // 发送消息
-            socket.sendTradeServer({
-                data: {
-                    rspCode: FunCode[rspKey],
-                    payload: new Package50(FunCode[reqKey], res)
-                },
-                success: (raw) => {
-                    Protobuf.responseDecode<Rsp>(rspKey, raw.content).then((res) => {
-                        console.log(rspKey, FunCode[rspKey], res);
-                        resolve(res);
-                    }).catch(() => {
-                        console.error(rspKey, raw);
-                        reject('报文解析失败');
-                    })
-                },
-                fail: (err) => {
-                    console.error(reqKey, err);
-                    reject(err);
-                }
+        console.log(reqName, reqCode, params)
+
+        return new Promise<T>((resolve, reject) => {
+            Protobuf.requestEncode(reqName, params).then((res) => {
+                // 发送消息
+                socket.sendTradeServer({
+                    data: {
+                        rspCode: rspCode,
+                        payload: new Package50(reqCode, res)
+                    },
+                    success: (raw) => {
+                        Protobuf.responseDecode<T>(rspName, raw.content).then((res) => {
+                            console.log(rspName, rspCode, res)
+                            resolve(res)
+                        }).catch(() => {
+                            console.error(rspName, raw)
+                            reject('报文解析失败')
+                        })
+                    },
+                    fail: (err) => {
+                        console.error(reqName, err)
+                        reject(err)
+                    }
+                })
+            }).catch((msg) => {
+                console.error(reqName, msg)
+                reject('报文构建失败')
             })
-        }).catch((msg) => {
-            console.error(reqKey, msg);
-            reject('报文构建失败');
         })
-    })
-}
-
-/**
- * 向交易服务器发送请求
- * @param reqKey 
- * @param rspKey 
- * @param params 
- * @param marketId 
- */
-export async function tradeServerRequest<Req, Rsp>(reqKey: keyof typeof FunCode, rspKey: keyof typeof FunCode, params: TradeParams<Req, Rsp & TradeResponse>, marketId?: number) {
-    const { success, fail, complete } = params;
+    }
 
-    return await tradeServerMiddleware(reqKey, rspKey, params, marketId).then((res) => {
-        const { RetCode, Status, RetDesc } = { ...res };
-        switch (RetCode) {
+    /**
+     * 向交易服务器发送请求
+     * @param config 
+     * @returns 
+     */
+    async sendMessage<T extends TradeResponse>(config: TradeRequestConfig) {
+        const res = await this.send<T>(config)
+        switch (res.RetCode) {
             case 0: {
-                success && success(res);
-                return Promise.resolve(res);
-            }
-            case -1: {
-                // 管理端错误消息
-                return Promise.reject(RetDesc);
+                return Promise.resolve(res)
             }
             case 12018: {
-                if (RetDesc) {
+                if (res.RetDesc) {
                     const { Utf8, Base64 } = cryptojs.enc
-                    const word = Base64.parse(RetDesc)
-                    // 解析base64
+                    const word = Base64.parse(res.RetDesc) // 解析base64
                     res.RetDesc = Utf8.stringify(word)
                 }
-                return Promise.reject(res.RetDesc);
+                return Promise.reject(res.RetDesc)
             }
             default: {
                 // 银行 业务 以 Status 作为判断依据
-                if (Status === 0) {
-                    success && success(res);
-                    return Promise.resolve(res);
+                if (res.Status === 0 || res.Status == 6007) {
+                    return Promise.resolve(res)
                 }
-                const msg = errorInfoStore.actions.getErrorInfoByCode(RetCode || Status);
-                const error = String(RetDesc || RetCode);
-                return Promise.reject(msg ?? error);
+                const msg = errorInfoStore.actions.getErrorInfoByCode(res.RetCode)
+                const error = String(res.RetDesc || res.RetCode)
+                return Promise.reject(msg ?? error)
             }
         }
-    }).catch((err) => {
-        fail && fail(err);
-        return Promise.reject(err);
-    }).finally(() => {
-        complete && complete();
-    })
-}
+    }
+})

+ 7 - 6
src/services/socket/trade/interface.ts

@@ -1,13 +1,14 @@
+import { FunCode } from '@/constants/funcode'
 import { IMessageHead } from './protobuf/proto'
 
 /**
  * 交易服务请求参数
  */
-export interface TradeParams<Req, Rsp> {
-    data: { Header?: IMessageHead } & Req;
-    success?: (res: Rsp) => void;
-    fail?: (err: string) => void;
-    complete?: () => void;
+export interface TradeRequestConfig<T extends object = { Header?: IMessageHead }> {
+    params: T;
+    reqName: keyof typeof FunCode;
+    rspName: keyof typeof FunCode;
+    marketId?: number;
 }
 
 /**
@@ -16,5 +17,5 @@ export interface TradeParams<Req, Rsp> {
 export interface TradeResponse {
     RetCode: number;
     RetDesc: string;
-    Status: number;
+    Status?: number;
 }

+ 0 - 109
src/services/subscribe/index.ts

@@ -1,109 +0,0 @@
-import { v4 } from 'uuid'
-import { quoteServerRequest } from '@/services/socket/quote'
-import { loginStore } from '@/stores'
-import eventBus from '@/services/bus'
-import socket from '@/services/socket'
-
-/**
- * 订阅行情
- */
-export default new (class {
-    /** 行情订阅列表 */
-    private quoteSubscribeMap = new Map<string, string[]>()
-
-    constructor() {
-        // 接收行情服务断线重连成功通知
-        eventBus.$on('QuoteServerReconnectNotify', () => {
-            this.quoteSubscribe();
-        })
-    }
-
-    /**
-     * 开始行情订阅
-     */
-    private quoteSubscribe = () => {
-        const subscribeData: Proto.QuoteReq[] = []
-
-        this.quoteSubscribeMap.forEach((value) => {
-            const item = value.map((code) => ({
-                goodsCode: code,
-                exchangeCode: 250,
-                subState: 0
-            }))
-            subscribeData.push(...item)
-        })
-
-        if (subscribeData.length) {
-            console.log('开始行情订阅', subscribeData)
-            quoteServerRequest({
-                data: subscribeData,
-                success: (res) => {
-                    if (res.length) {
-                        console.log('行情订阅成功', res)
-                    } else {
-                        console.error('行情订阅失败')
-                    }
-                },
-                fail: (err) => {
-                    console.error('行情订阅失败', err)
-                }
-            })
-        } else {
-            // 没有订阅商品的时候,断开连接
-            socket.closeQuoteServer()
-        }
-    }
-
-    /**
-     * 添加行情订阅
-     * @param goodsCodes 
-     * @param key 
-     * @returns 
-     */
-    addQuoteSubscribe = (goodsCodes: string[], key?: string) => {
-        const { token } = loginStore.$mapGetters()
-        const uuid = key ?? v4()
-        const value = this.quoteSubscribeMap.get(uuid) ?? []
-
-        const start = () => {
-            if (token.value) {
-                // 对相同 key 订阅的商品进行合并处理
-                this.quoteSubscribeMap.set(uuid, [...value, ...goodsCodes])
-                this.quoteSubscribe()
-            }
-        }
-
-        return {
-            uuid,
-            start,
-            stop: () => {
-                const flag = this.quoteSubscribeMap.delete(uuid)
-                if (flag) {
-                    console.log('删除订阅', uuid)
-                }
-                if (token.value) {
-                    this.quoteSubscribe()
-                }
-                return flag
-            },
-        }
-    }
-
-    /**
-     * 删除行情订阅
-     * @param keys 
-     */
-    removeQuoteSubscribe = (...keys: string[]) => {
-        if (keys.length) {
-            keys.forEach((key) => {
-                if (this.quoteSubscribeMap.delete(key)) {
-                    console.log('删除订阅', key)
-                }
-            })
-        } else {
-            console.log('取消订阅')
-            this.quoteSubscribeMap.clear()
-        }
-        this.quoteSubscribe()
-    }
-})

+ 1 - 1
src/stores/modules/performance.ts

@@ -26,7 +26,7 @@ export const performanceStore = createStore({
         },
         // 根据 id 查找对应的履约模板
         getPerformanceTemplateById(id: number) {
-            return this.state.performanceTemplates.find((e) => e.autoid === id)
+            return this.state.performanceTemplates.find((e) => e.autoid.toString() === id.toString())
         },
         // 获取履约步骤枚举列表
         async getPerformanceStepTypeList() {

+ 2 - 0
src/stores/storage.ts

@@ -13,6 +13,8 @@ function createLocalData() {
 function createSessionData() {
     return {
         loginInfo: <Proto.LoginRsp>{
+            RetCode: 0,
+            RetDesc: '',
             AccountIDs: [],
             LoginCode: '',
             LoginID: 0,

+ 2 - 2
src/types/ermcp/presale.d.ts

@@ -43,7 +43,7 @@ declare namespace Ermcp {
         sellmarginalgorithm: number; // 卖方保证金方式
         sellmarginvalue: number; // 卖方保证金值
         selluserid: number; // 发行方用户ID
-        sellwrtradeorderid: number; // 发行方卖委托单ID
+        sellwrtradeorderid: string; // 发行方卖委托单ID
         sizestr: string; // 尺寸 [1:成品裸钻 \ 2:毛坯钻石]
         startdate: string; // 预售开始日期
         takestartdate: string; // 提货开始日期
@@ -53,7 +53,7 @@ declare namespace Ermcp {
         unitprice: number; // 商品单价
         warehouseid: number; // 仓库ID
         weightdesc: string; // 重量描述 [2:毛坯钻石]
-        wrfactortypeid: number; // 仓单要素类型ID - 根据现货商品\仓库生成
+        wrfactortypeid: string; // 仓单要素类型ID - 根据现货商品\仓库生成
         wrstandardid: number; // 现货商品ID
         wrstandardname: string; // 现货商品名称
         yieldrate: string; // 成品率[2:毛坯钻石]

+ 18 - 9
src/types/proto/account.d.ts

@@ -24,8 +24,8 @@ declare global {
         /** 用户登录应答 */
         interface LoginRsp {
             Header?: IMessageHead; // 消息头
-            RetCode?: number; // 返回码
-            RetDesc?: string; // 描述信息
+            RetCode: number; // 返回码
+            RetDesc: string; // 描述信息
             LoginID: number; // 登录ID
             LoginUserType: number; // 登陆用户类型
             AccountStatus: number; // 用户状态
@@ -43,6 +43,22 @@ declare global {
             ClientID: number; // 终端ID(登陆服务分配,用于通道交易关联链路)
         }
 
+        /** 用户登出请求 */
+        interface LogoutReq {
+            Header?: IMessageHead; // 消息头
+            LoginID: number; // 登录ID
+            Token: string; // 登录时返回的用户令牌
+            LoginIp: string; // 登出IP地址
+            LoginPort: number; // 登出通信端口
+        }
+
+        /** 用户登出应答 */
+        interface LogoutRsp {
+            Header?: IMessageHead; // 消息头
+            RetCode: number; // 返回码
+            RetDesc: string; // 描述信息
+        }
+
         /** 用户令牌校验请求 */
         interface TokenCheckReq {
             Header?: IMessageHead; // 消息头
@@ -66,13 +82,6 @@ declare global {
             SystemTime: number; // 返回服务器最新时间
         }
 
-        /** 用户登出应答 */
-        interface LogoutRsp {
-            Header?: IMessageHead; // 消息头
-            RetCode: number; // 返回码
-            RetDesc?: string; // 描述信息
-        }
-
         // 修改账户密码请求
         interface ModifyPwdReq {
             Header?: IMessageHead; // 消息头

+ 2 - 2
src/types/proto/goods.d.ts

@@ -20,8 +20,8 @@ declare global {
         /** 新增钻石商品接口响应 */
         interface AddZSGoodsRsp {
             Header?: IMessageHead; // 消息头
-            RetCode?: number; // 返回码
-            RetDesc?: string; // 描述信息
+            RetCode: number; // 返回码
+            RetDesc: string; // 描述信息
             UserID: number; // 用户ID
             AccountID: number; // 资金账户ID
             WRStandardID: number; // 现货商品ID

+ 1 - 1
src/types/proto/presale.d.ts

@@ -49,7 +49,7 @@ declare global {
             Header?: IMessageHead;
             UserID: number; // 用户ID,必填
             AccountID: number; // 资金账户ID,必填
-            WRTradeOrderID: number; // 仓单贸易委托单ID,必填
+            WRTradeOrderID: Long; // 仓单贸易委托单ID,必填
             OrderQty: number; // 认购数量,必填
             MarketID: number; // 市场ID,必填
             ClientOrderTime: string; // 委托时间,必填

+ 4 - 4
src/types/proto/trade.d.ts

@@ -20,8 +20,8 @@ declare global {
         /** 钻石买挂牌接口应答 */
         interface ZSBuyOrderListingRsp {
             Header?: IMessageHead; // 消息头
-            RetCode?: number; // 返回码
-            RetDesc?: string; // 描述信息
+            RetCode: number; // 返回码
+            RetDesc: string; // 描述信息
             UserID: number; // 用户ID
             AccountID: number; // 资金账户ID
             WRTradeOrderID: number; // 仓单贸易委托单ID
@@ -76,8 +76,8 @@ declare global {
         /** 钻石卖挂牌接口响应 */
         interface ZSSellOrderListingRsp {
             Header?: IMessageHead; // 消息头
-            RetCode?: number; // 返回码
-            RetDesc?: string; // 描述信息
+            RetCode: number; // 返回码
+            RetDesc: string; // 描述信息
             UserID: number; // 用户ID
             AccountID: number; // 资金账户ID
             WRTradeOrderID: number; // 仓单贸易委托单ID