li.shaoyi 3 年之前
父节点
当前提交
795179a7f3
共有 36 个文件被更改,包括 828 次插入538 次删除
  1. 3 210
      src/business/account/index.ts
  2. 314 0
      src/business/bank/index.ts
  3. 12 5
      src/business/common/index.ts
  4. 3 3
      src/business/favorite/index.ts
  5. 10 17
      src/business/goods/index.ts
  6. 3 1
      src/business/sign/index.ts
  7. 2 2
      src/business/table/index.ts
  8. 6 6
      src/hooks/datatable/index.ts
  9. 3 1
      src/hooks/datatable/interface.ts
  10. 16 8
      src/mock/router.ts
  11. 2 2
      src/packages/pc/views/boot/index.vue
  12. 42 0
      src/packages/pc/views/mine/bank/components/cancel/index.vue
  13. 9 6
      src/packages/pc/views/mine/bank/components/deposit/index.vue
  14. 12 9
      src/packages/pc/views/mine/bank/components/withdraw/index.vue
  15. 6 1
      src/packages/pc/views/mine/bank/index.vue
  16. 6 6
      src/packages/pc/views/mine/profile/components/rescind/index.vue
  17. 3 3
      src/packages/pc/views/mine/profile/components/sign/index.vue
  18. 1 1
      src/packages/pc/views/mine/profile/index.vue
  19. 42 0
      src/packages/pc/views/order/main/components/details/index.vue
  20. 1 1
      src/services/api/bank/index.ts
  21. 8 4
      src/services/socket/trade/index.ts
  22. 37 34
      src/stores/modules/account.ts
  23. 19 14
      src/stores/modules/enum.ts
  24. 19 14
      src/stores/modules/errorInfo.ts
  25. 20 17
      src/stores/modules/favorite.ts
  26. 20 17
      src/stores/modules/futures.ts
  27. 37 33
      src/stores/modules/login.ts
  28. 53 49
      src/stores/modules/menu.ts
  29. 54 20
      src/stores/modules/performance.ts
  30. 22 14
      src/stores/modules/tableColumn.ts
  31. 20 17
      src/stores/modules/user.ts
  32. 4 0
      src/types/ermcp/bank.d.ts
  33. 1 0
      src/types/ermcp/favorite.d.ts
  34. 5 5
      src/types/proto/bank.d.ts
  35. 6 13
      src/utils/storage/index.ts
  36. 7 5
      src/utils/websocket/index.ts

+ 3 - 210
src/business/account/index.ts

@@ -1,16 +1,12 @@
 import { shallowRef, reactive } from 'vue'
-import { decryptAES } from '@/utils/websocket/crypto'
-import { useDataTable } from '@/hooks/datatable'
 import { useUserStore, useAccountStore, useLoginStore } from '@/stores'
 import { modifyPassword } from '@/services/api/account'
-import { queryCusBankSignBank, queryAccountInOutApply, t2bBankSign, t2bBankCancelSign, queryBankAccountSign, t2bBankDeposit, t2bBankWithdraw } from '@/services/api/bank'
-import { getTableColumns } from '../table'
-import { SignStatus } from '@/constants/bank'
+import { queryBankAccountSign } from '@/services/api/bank'
 import cryptojs from 'crypto-js'
 
 export function useAccount() {
     const { getUserDataInfo } = useUserStore()
-    const { currentAccountInfo } = useAccountStore()
+    const { accountInfo } = useAccountStore()
     const loginInfo = getUserDataInfo('loginAccount')
     const userInfo = getUserDataInfo('userInfo')
     const bankInfo = shallowRef<Ermcp.BankAccountSignRsp>()
@@ -38,7 +34,7 @@ export function useAccount() {
         loading,
         loginInfo,
         userInfo,
-        currentAccountInfo,
+        accountInfo,
         bankInfo,
         getBankAccountSign,
     }
@@ -82,207 +78,4 @@ export function usePassword(ModifyPwdType: 0 | 1 | 2) {
         formData,
         formSubmit
     }
-}
-
-// 银行签约相关
-export function useBank() {
-    const { getUserDataInfo } = useUserStore()
-    const { currentAccountId } = useAccountStore()
-    const userInfo = getUserDataInfo('userInfo')
-    const loading = shallowRef(false)
-    const custodianBanks = shallowRef<Ermcp.CusBankSignBankRsp[]>([]) // 托管银行列表
-    const selectedCustodianBank = shallowRef<Ermcp.CusBankSignBankRsp>() // 已选中的托管银行
-    const selectedDepositBank = shallowRef<Ermcp.BankInfoRsp>() // 已选中的开户银行
-
-    const extendInfo = {
-        sex: userInfo.sex,
-    }
-
-    const formData = reactive<Partial<Proto.t2bBankSignReq>>({
-        OperateType: 1, // 变更类型[1-增加; 2-修改; 4-绑卡;
-        IsForce: 0, // 是否强制[0-否; 1-是]强制
-        AgentCertType: 0, // 授权代理人证件类型
-        BankCardType: 0, // 银行卡类型
-        BankAccountType: 1, // 银行账户类型
-        AccountType: 1, // // 账户类型[1-对私; 2-对公]
-        extend_info: JSON.stringify(extendInfo), //  扩展信息(JSON串,参考配置要求进行填充)
-        AccountCode: currentAccountId.toString(), // 账户
-        AccountName: userInfo.customername, // 客户名称
-        BankAccountName: userInfo.customername,
-        ExtOperatorID: new Date().getTime(), // 外部操作流水号
-        CertType: userInfo.cardtypeid.toString(), // 证件类型
-        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: formData,
-            complete: () => {
-                loading.value = false
-            }
-        })
-    }
-
-    // 获取托管银行
-    queryCusBankSignBank({
-        success: (res) => {
-            custodianBanks.value = res.data
-        }
-    })
-
-    return {
-        loading,
-        custodianBanks,
-        selectedCustodianBank,
-        selectedDepositBank,
-        formData,
-        formSubmit,
-    }
-}
-
-/**
- * 账户出入金
- * @returns 
- */
-export function useAccountInOut() {
-    const { getUserId } = useLoginStore()
-    const { dataList, selectList, buttonList } = useDataTable<Ermcp.AccountOutInApplyRsp>()
-    const columns = shallowRef(getTableColumns('mine_capital'))
-    const loading = shallowRef(false)
-
-    selectList.value = [
-        {
-            key: 'applystatus',
-            label: '状态',
-            options: [
-                { label: '待审核', value: 1 },
-                { label: '待复审', value: 2 }
-            ],
-        },
-        {
-            key: 'userinfotype',
-            label: '申请类型',
-            options: [
-                { label: '入金', value: 1 },
-                { label: '出金', value: 2 }
-            ],
-        },
-    ]
-
-    const getAccountInOutApply = () => {
-        loading.value = true
-        return queryAccountInOutApply({
-            data: {
-                userid: getUserId()
-            },
-            success: (res) => {
-                dataList.value = res.data
-            },
-            complete: () => {
-                loading.value = false
-            }
-        })
-    }
-
-    return {
-        loading,
-        dataList,
-        selectList,
-        buttonList,
-        columns,
-        getAccountInOutApply,
-    }
-}
-
-// 入金
-export function useDeposit() {
-    const { getUserDataInfo } = useUserStore()
-    const { currentAccountInfo } = useAccountStore()
-    const userInfo = getUserDataInfo('userInfo')
-    const loading = shallowRef(false)
-
-    const formData = reactive<Partial<Proto.t2bBankDepositReq>>({
-        CusBankID: '', // 托管银行编号
-        AccountCode: '', // 资金账户
-        Currency: '', // 币种
-    })
-
-    const formSubmit = async () => {
-        loading.value = true
-        return new Promise<void>((resolve, reject) => {
-            queryBankAccountSign({
-                data: {
-                    userid: userInfo.userid
-                },
-                success: (res) => {
-                    const bankInfo = res.data[0]
-                    if (bankInfo?.signstatus === SignStatus.Signed) {
-                        ({
-                            cusbankid: formData.CusBankID,
-                            accountcode: formData.AccountCode,
-                            currency: formData.Currency,
-                            bankaccountname2: formData.BankAccoutName,
-                            bankaccountno2: formData.BankAccoutNum,
-                        } = bankInfo)
-
-                        t2bBankDeposit({
-                            data: {
-                                ...formData,
-                                ExtOperatorID: new Date().getTime()
-                            },
-                            success: () => {
-                                resolve()
-                            },
-                            fail: (err) => {
-                                reject(err)
-                            },
-                            complete: () => {
-                                loading.value = false
-                            }
-                        })
-                    } else {
-                        loading.value = false
-                        reject('请先签约银行!')
-                    }
-                },
-                fail: (err) => {
-                    loading.value = false
-                    reject(err)
-                }
-            })
-        })
-    }
-
-    return {
-        loading,
-        userInfo,
-        currentAccountInfo,
-        formData,
-        formSubmit,
-    }
-}
-
-// 出金
-export function useWithdraw() {
-    const loading = shallowRef(false)
-
-    return {
-        loading,
-    }
 }

+ 314 - 0
src/business/bank/index.ts

@@ -0,0 +1,314 @@
+import { shallowRef, reactive } from 'vue'
+import { decryptAES } from '@/utils/websocket/crypto'
+import { useDataTable } from '@/hooks/datatable'
+import { useUserStore, useAccountStore, useLoginStore } from '@/stores'
+import { queryCusBankSignBank, queryAccountInOutApply, t2bBankSign, t2bBankCancelSign, queryBankAccountSign, t2bBankDeposit, t2bBankWithdraw } from '@/services/api/bank'
+import { getTableColumns } from '../table'
+import { SignStatus } from '@/constants/bank'
+
+// 银行签约相关
+export function useBankSign() {
+    const { getUserDataInfo } = useUserStore()
+    const { accountId } = useAccountStore()
+    const userInfo = getUserDataInfo('userInfo')
+    const loading = shallowRef(false)
+    const custodianBanks = shallowRef<Ermcp.CusBankSignBankRsp[]>([]) // 托管银行列表
+    const selectedCustodianBank = shallowRef<Ermcp.CusBankSignBankRsp>() // 已选中的托管银行
+    const selectedDepositBank = shallowRef<Ermcp.BankInfoRsp>() // 已选中的开户银行
+
+    const extendInfo = {
+        sex: userInfo.sex,
+    }
+
+    const formData = reactive<Partial<Proto.t2bBankSignReq>>({
+        OperateType: 1, // 变更类型[1-增加; 2-修改; 4-绑卡;
+        IsForce: 0, // 是否强制[0-否; 1-是]强制
+        AgentCertType: 0, // 授权代理人证件类型
+        BankCardType: 0, // 银行卡类型
+        BankAccountType: 1, // 银行账户类型
+        AccountType: 1, // // 账户类型[1-对私; 2-对公]
+        extend_info: JSON.stringify(extendInfo), //  扩展信息(JSON串,参考配置要求进行填充)
+        AccountCode: accountId.value.toString(), // 账户
+        AccountName: userInfo.customername, // 客户名称
+        BankAccountName: userInfo.customername,
+        ExtOperatorID: 0, // 外部操作流水号
+        CertType: userInfo.cardtypeid.toString(), // 证件类型
+        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: {
+                ...formData,
+                ExtOperatorID: new Date().getTime(),
+            },
+            complete: () => {
+                loading.value = false
+            }
+        })
+    }
+
+    // 获取托管银行
+    queryCusBankSignBank({
+        success: (res) => {
+            custodianBanks.value = res.data
+        }
+    })
+
+    return {
+        loading,
+        custodianBanks,
+        selectedCustodianBank,
+        selectedDepositBank,
+        formData,
+        formSubmit,
+    }
+}
+
+// 银行解约相关
+export function useBankCancelSign(bankInfo: Ermcp.BankAccountSignRsp) {
+    const { getFirstAccountId } = useLoginStore()
+    const loading = shallowRef(false)
+
+    const formSubmit = () => {
+        loading.value = true
+        return t2bBankCancelSign({
+            data: {
+                ExtOperatorID: new Date().getTime(), // 外部操作流水号
+                AccountCode: getFirstAccountId().toString(), // 账户
+                CusBankID: bankInfo.cusbankid, // 托管银行编号
+                IsForce: 0, // 是否强制
+                Currency: bankInfo.currency, // 币种
+            },
+            complete: () => {
+                loading.value = false
+            }
+        })
+    }
+
+    return {
+        loading,
+        formSubmit,
+    }
+}
+
+/**
+ * 账户出入金
+ * @returns 
+ */
+export function useAccountInOut() {
+    const { getUserId } = useLoginStore()
+    const { dataList, selectList, buttonList, filterMethod, getQueryParam } = useDataTable<Ermcp.AccountOutInApplyRsp>()
+    const columns = shallowRef(getTableColumns('mine_capital'))
+    const loading = shallowRef(false)
+
+    selectList.value = [
+        {
+            key: 'applystatus',
+            label: '状态',
+            options: [
+                { label: '待审核', value: 1 },
+                { label: '待复审', value: 2 }
+            ],
+        },
+        {
+            key: 'executetype',
+            label: '申请类型',
+            options: [
+                { label: '出金', value: 1 },
+                { label: '入金', value: 2 }
+            ],
+        },
+    ]
+
+    filterMethod.onReset = () => {
+        getAccountInOutApply()
+    }
+
+    filterMethod.onSearch = () => {
+        getAccountInOutApply()
+    }
+
+    const getAccountInOutApply = () => {
+        const param = getQueryParam()
+        loading.value = true
+        return queryAccountInOutApply({
+            data: {
+                userid: getUserId(),
+                applystatus: param.applystatus,
+                querytype: param.executetype,
+            },
+            success: (res) => {
+                dataList.value = res.data
+            },
+            complete: () => {
+                loading.value = false
+            }
+        })
+    }
+
+    return {
+        loading,
+        dataList,
+        selectList,
+        buttonList,
+        columns,
+        getAccountInOutApply,
+    }
+}
+
+// 入金
+export function useDeposit() {
+    const { getUserDataInfo } = useUserStore()
+    const { accountInfo } = useAccountStore()
+    const userInfo = getUserDataInfo('userInfo')
+    const loading = shallowRef(false)
+
+    const formData = reactive<Partial<Proto.t2bBankDepositReq>>({
+        CusBankID: '', // 托管银行编号
+        AccountCode: '', // 资金账户
+        Currency: '', // 币种
+        BankAccoutName: '',
+        BankAccoutNum: '',
+    })
+
+    const formSubmit = async () => {
+        loading.value = true
+        return new Promise<void>((resolve, reject) => {
+            queryBankAccountSign({
+                data: {
+                    userid: userInfo.userid
+                },
+                success: (res) => {
+                    const bankInfo = res.data[0]
+                    if (bankInfo?.signstatus === SignStatus.Signed) {
+                        ({
+                            cusbankid: formData.CusBankID,
+                            accountcode: formData.AccountCode,
+                            currency: formData.Currency,
+                            bankaccountname2: formData.BankAccoutName,
+                            bankaccountno2: formData.BankAccoutNum,
+                        } = bankInfo)
+
+                        t2bBankDeposit({
+                            data: {
+                                ...formData,
+                                ExtOperatorID: new Date().getTime()
+                            },
+                            success: () => {
+                                resolve()
+                            },
+                            fail: (err) => {
+                                reject(err)
+                            },
+                            complete: () => {
+                                loading.value = false
+                            }
+                        })
+                    } else {
+                        loading.value = false
+                        reject('请先签约银行!')
+                    }
+                },
+                fail: (err) => {
+                    loading.value = false
+                    reject(err)
+                }
+            })
+        })
+    }
+
+    return {
+        loading,
+        userInfo,
+        accountInfo,
+        formData,
+        formSubmit,
+    }
+}
+
+// 出金
+export function useWithdraw() {
+    const { getUserDataInfo } = useUserStore()
+    const { accountInfo } = useAccountStore()
+    const userInfo = getUserDataInfo('userInfo')
+    const loading = shallowRef(false)
+
+    const formData = reactive<Partial<Proto.t2bBankDepositReq>>({
+        CusBankID: '', // 托管银行编号
+        AccountCode: '', // 资金账户
+        Currency: '', // 币种
+        BankAccoutName: '',
+        BankAccoutNum: '',
+    })
+
+    const formSubmit = async () => {
+        loading.value = true
+        return new Promise<void>((resolve, reject) => {
+            queryBankAccountSign({
+                data: {
+                    userid: userInfo.userid
+                },
+                success: (res) => {
+                    const bankInfo = res.data[0]
+                    if (bankInfo?.signstatus === SignStatus.Signed) {
+                        ({
+                            cusbankid: formData.CusBankID,
+                            accountcode: formData.AccountCode,
+                            currency: formData.Currency,
+                            bankaccountname2: formData.BankAccoutName,
+                            bankaccountno2: formData.BankAccoutNum,
+                        } = bankInfo)
+
+                        t2bBankWithdraw({
+                            data: {
+                                ...formData,
+                                ExtOperatorID: new Date().getTime()
+                            },
+                            success: () => {
+                                resolve()
+                            },
+                            fail: (err) => {
+                                reject(err)
+                            },
+                            complete: () => {
+                                loading.value = false
+                            }
+                        })
+                    } else {
+                        loading.value = false
+                        reject('请先签约银行!')
+                    }
+                },
+                fail: (err) => {
+                    loading.value = false
+                    reject(err)
+                }
+            })
+        })
+    }
+
+    return {
+        loading,
+        userInfo,
+        accountInfo,
+        formData,
+        formSubmit,
+    }
+}

+ 12 - 5
src/business/common/index.ts

@@ -24,12 +24,19 @@ export async function initBaseData(callback?: () => void) {
     checkTokenLoop()
 
     const { userStore, futuresStore, menuStore, performanceStore, accountStore, favoriteStore } = useStore()
+    const task1 = userStore.getUserData()
+    const task2 = menuStore.getUserMenuList()
+    const task3 = futuresStore.getGoodsList()
+    const task4 = performanceStore.getPerformanceTemplateList()
+    const task5 = performanceStore.getPerformanceStepTypeList()
+    //const task6 = tableColumnStore.getTableColumnList()
+
     const asyncTask = [
-        userStore.getUserData(),
-        menuStore.getUserMenuList(),
-        futuresStore.getGoodsList(),
-        performanceStore.getPerformanceStepList(),
-        //useTableColumnStore.getTableColumnList(),
+        task1.result,
+        task2.result,
+        task3.result,
+        task4.result,
+        task5.result,
     ]
 
     await Promise.all(asyncTask).then(() => {

+ 3 - 3
src/business/favorite/index.ts

@@ -12,10 +12,10 @@ export function useFavorite() {
     selectList.value = [
         {
             label: '商品分类',
-            key: 'zscategorydisplay',
+            key: 'zscategory',
             options: [
-                { label: '单颗裸钻', value: Category.Diamond.toString() },
-                { label: '单颗彩钻', value: Category.Fancy.toString() }
+                { label: '单颗裸钻', value: Category.Diamond },
+                { label: '单颗彩钻', value: Category.Fancy }
             ],
         },
     ]

+ 10 - 17
src/business/goods/index.ts

@@ -32,7 +32,7 @@ import Long from 'long'
 // 钻石列表相关
 export function useDiamond() {
     const { getUserId } = useLoginStore()
-    const { dataList, total, pageIndex, pageSize, inputList, selectList, buttonList, getQueryParam } = useDataTable<Ermcp.MyWRPositionRsp>()
+    const { dataList, total, pageIndex, pageSize, inputList, selectList, buttonList, filterMethod, getQueryParam } = useDataTable<Ermcp.MyWRPositionRsp>()
     const loading = shallowRef(false)
     const columns = shallowRef(getTableColumns('warehousing_diamond'))
 
@@ -48,6 +48,7 @@ export function useDiamond() {
             key: 'zscategory',
             selectedValue: Category.Diamond,
             options: categoryList,
+            noClear: true,
         },
         {
             label: '仓库',
@@ -60,6 +61,14 @@ export function useDiamond() {
         { label: '商品', keys: ['goodsno'] },
     ]
 
+    filterMethod.onReset = () => {
+        getDiamondList()
+    }
+
+    filterMethod.onSearch = () => {
+        getDiamondList()
+    }
+
     const getDiamondList = () => {
         const param = getQueryParam()
         loading.value = true
@@ -82,22 +91,6 @@ export function useDiamond() {
         })
     }
 
-    const [reset, search] = buttonList.value
-    reset.onClick = () => {
-        pageIndex.value = 1
-        selectList.value.forEach((e, i) => {
-            if (i) {
-                e.selectedValue = undefined
-            }
-        })
-        inputList.value.forEach((e) => e.value = undefined)
-        getDiamondList()
-    }
-    search.onClick = () => {
-        pageIndex.value = 1
-        getDiamondList()
-    }
-
     // 获取仓库列表
     queryWarehouseInfo({
         data: {

+ 3 - 1
src/business/sign/index.ts

@@ -26,8 +26,10 @@ export function useSign() {
     // 用户登录
     const signIn = () => {
         loading.value = true
+        const { result } = userLogin(user)
+
         return new Promise((resolve, reject) => {
-            userLogin(user).then((res) => {
+            result.then((res) => {
                 initBaseData(() => {
                     resolve(res)
                 }).catch((err) => {

+ 2 - 2
src/business/table/index.ts

@@ -168,8 +168,8 @@ const pcTableColumnMap = new Map<TableColumnKey, Ermcp.TableColumn[]>([
     ]],
     // 会员中心-我的出入金
     ['mine_capital', [
-        { prop: 'logincode', label: '资金账户' },
-        { prop: 'branchbankname', label: '托管银行' },
+        { prop: 'accountcode', label: '资金账户' },
+        { prop: 'cusbankname', label: '托管银行' },
         { prop: 'executetype', label: '申请类型' },
         { prop: 'amount', label: '金额' },
         { prop: 'charge', label: '服务费' },

+ 6 - 6
src/hooks/datatable/index.ts

@@ -1,15 +1,15 @@
 import { reactive, ref, shallowRef, toRefs, computed, UnwrapRef } from 'vue'
 import { FilterValue, FilterOptions, DataTableOptions } from './interface'
 
-export function useDataTable<T>(options?: DataTableOptions) {
+export function useDataTable<T>(options: DataTableOptions = {}) {
     // 数据源
     const dataSource = ref<T[]>([])
-    // 总记录条数
+    // 总条数
     const total = shallowRef(0)
-    // 当前页码
-    const pageIndex = shallowRef(1)
     // 每页条数
-    const pageSize = shallowRef(20)
+    const pageSize = shallowRef(options.pageSize ?? 20)
+    // 当前页码
+    const pageIndex = shallowRef(options.pageIndex ?? 1)
     // 过滤筛选值
     const filters = shallowRef<FilterValue<T>[]>([])
     // 过滤选项
@@ -73,7 +73,7 @@ export function useDataTable<T>(options?: DataTableOptions) {
                 })
             })
             // 本地分页
-            if (options?.pagination) {
+            if (options.pagination) {
                 return result.slice((pageIndex.value - 1) * pageSize.value, pageIndex.value * pageSize.value)
             }
             return result

+ 3 - 1
src/hooks/datatable/interface.ts

@@ -56,5 +56,7 @@ export interface FilterButton {
  * 数据表配置项
  */
 export interface DataTableOptions {
-    pagination: boolean; // 是否进行本地分页
+    pagination?: boolean; // 是否进行本地分页
+    pageSize?: number; // 每页条数
+    pageIndex?: number; // 当前页码
 }

+ 16 - 8
src/mock/router.ts

@@ -623,6 +623,14 @@ const appmenu = {
                                 component: 'views/mine/bank/components/withdraw/index.vue',
                                 buttonName: 'withdraw',
                                 buttonType: 'primary',
+                            },
+                            {
+                                authType: 3,
+                                title: '撤销',
+                                code: 'bank_cancel',
+                                component: 'views/mine/bank/components/cancel/index.vue',
+                                buttonName: 'cancel',
+                                buttonType: 'primary',
                             }
                         ]
                     },
@@ -654,20 +662,20 @@ const appmenu = {
                             },
                             {
                                 authType: 3,
+                                title: '默认',
+                                code: 'mine_address_default',
+                                component: 'views/mine/address/components/default/index.vue',
+                                buttonName: 'default',
+                                buttonType: 'primary',
+                            },
+                            {
+                                authType: 3,
                                 title: '删除',
                                 code: 'mine_address_delete',
                                 component: 'views/mine/address/components/delete/index.vue',
                                 buttonName: 'delete',
                                 buttonType: 'danger',
                             },
-                            {
-                                authType: 3,
-                                title: '默认',
-                                code: 'mine_address_default',
-                                component: 'views/mine/address/components/default/index.vue',
-                                buttonName: 'default',
-                                buttonType: 'primary',
-                            }
                         ]
                     },
                     {

+ 2 - 2
src/packages/pc/views/boot/index.vue

@@ -30,8 +30,8 @@ const initService = async () => {
     loading.value = false
   })
 
-  await getAllEnumList()
-  await getErrorInfoList()
+  await getAllEnumList().result
+  await getErrorInfoList().result
 
   if (getToken()) {
     // 等待连接交易服务

+ 42 - 0
src/packages/pc/views/mine/bank/components/cancel/index.vue

@@ -0,0 +1,42 @@
+<!-- 会员中心-我的出入金-撤销 -->
+<template>
+    <app-drawer title="提示" v-model:show="show" :loading="loading" :refresh="refresh">
+        <div style="font-size:16px;text-align:center">是否撤销该申请?</div>
+        <template #footer>
+            <el-button @click="onCancel(false)" plain>取消</el-button>
+            <el-button type="primary" @click="onSubmit">确认</el-button>
+        </template>
+    </app-drawer>
+</template>
+
+<script lang="ts" setup>
+import { shallowRef, PropType } from 'vue'
+import { ElMessage } from 'element-plus'
+import { useInvoiceForm } from '@/business/user'
+import AppDrawer from '@pc/components/base/drawer/index.vue'
+
+const props = defineProps({
+    selectedRow: {
+        type: Object as PropType<Ermcp.WrUserReceiptInfoRsp>,
+        default: () => ({})
+    }
+})
+
+const { loading, deleteInvoice } = useInvoiceForm(props.selectedRow)
+const show = shallowRef(true)
+const refresh = shallowRef(false)
+
+const onCancel = (isRefresh = false) => {
+    show.value = false
+    refresh.value = isRefresh
+}
+
+const onSubmit = () => {
+    deleteInvoice().then(() => {
+        ElMessage.success('提交成功')
+        onCancel(true)
+    }).catch((err) => {
+        ElMessage.error('提交失败:' + err)
+    })
+}
+</script>

+ 9 - 6
src/packages/pc/views/mine/bank/components/deposit/index.vue

@@ -1,6 +1,6 @@
 <!-- 会员中心-我的出入金-入金申请 -->
 <template>
-    <app-drawer title="入金申请" :width="800" v-model:show="show" :loading="loading">
+    <app-drawer title="入金申请" :width="800" v-model:show="show" :loading="loading" :refresh="refresh">
         <el-form ref="formRef" class="el-form--horizontal" label-width="100px" :model="formData" :rules="formRules">
             <el-form-item label="资金账号">
                 <span>{{ accountInfo?.accountid }}</span>
@@ -19,7 +19,7 @@
             </el-form-item>
         </el-form>
         <template #footer>
-            <el-button @click="onCancel" plain>取消</el-button>
+            <el-button @click="onCancel(false)" plain>取消</el-button>
             <el-button type="primary" @click="onSubmit">提交</el-button>
         </template>
     </app-drawer>
@@ -29,19 +29,21 @@
 import { ref } from 'vue'
 import { ElMessage } from 'element-plus'
 import type { FormInstance, FormRules } from 'element-plus'
-import { useDeposit } from '@/business/account'
+import { useDeposit } from '@/business/bank'
 import AppDrawer from '@pc/components/base/drawer/index.vue'
 
 const { loading, accountInfo, formData, formSubmit } = useDeposit()
 const formRef = ref<FormInstance>()
 const show = ref(true)
+const refresh = ref(false)
 
 const formRules: FormRules = {
     Amount: [{ required: true, message: '请输入金额', trigger: 'blur' }],
 }
 
-const onCancel = () => {
+const onCancel = (isRefresh = false) => {
     show.value = false
+    refresh.value = isRefresh
 }
 
 const onSubmit = () => {
@@ -49,9 +51,10 @@ const onSubmit = () => {
         if (valid) {
             formSubmit().then(() => {
                 ElMessage.success('提交成功')
-                onCancel()
             }).catch((err) => {
-                ElMessage.error('提交失败:' + err)
+                ElMessage.warning(err)
+            }).finally(() => {
+                onCancel(true)
             })
         }
     })

+ 12 - 9
src/packages/pc/views/mine/bank/components/withdraw/index.vue

@@ -1,12 +1,12 @@
 <!-- 会员中心-我的出入金-出金申请 -->
 <template>
-    <app-drawer title="出金申请" :width="800" v-model:show="show" :loading="loading">
+    <app-drawer title="出金申请" :width="800" v-model:show="show" :loading="loading" :refresh="refresh">
         <el-form ref="formRef" class="el-form--horizontal" label-width="100px" :model="formData" :rules="formRules">
             <el-form-item label="资金账号">
-                <span>{{ accountInfo.accountid }}</span>
+                <span>{{ accountInfo?.accountid }}</span>
             </el-form-item>
             <el-form-item label="账户余额">
-                <span>{{ accountInfo.balance }}</span>
+                <span>{{ accountInfo?.balance }}</span>
             </el-form-item>
             <el-form-item label="入金金额" prop="Amount">
                 <el-input type="number" placeholder="请输入" v-model.number="formData.Amount" />
@@ -19,7 +19,7 @@
             </el-form-item>
         </el-form>
         <template #footer>
-            <el-button @click="onCancel" plain>取消</el-button>
+            <el-button @click="onCancel(false)" plain>取消</el-button>
             <el-button type="primary" @click="onSubmit">提交</el-button>
         </template>
     </app-drawer>
@@ -29,19 +29,21 @@
 import { ref } from 'vue'
 import { ElMessage } from 'element-plus'
 import type { FormInstance, FormRules } from 'element-plus'
-import { useDeposit } from '@/business/account'
+import { useWithdraw } from '@/business/bank'
 import AppDrawer from '@pc/components/base/drawer/index.vue'
 
-const { loading, accountInfo, formData, formSubmit } = useDeposit()
+const { loading, accountInfo, formData, formSubmit } = useWithdraw()
 const formRef = ref<FormInstance>()
 const show = ref(true)
+const refresh = ref(false)
 
 const formRules: FormRules = {
     Amount: [{ required: true, message: '请输入金额', trigger: 'blur' }],
 }
 
-const onCancel = () => {
+const onCancel = (isRefresh = false) => {
     show.value = false
+    refresh.value = isRefresh
 }
 
 const onSubmit = () => {
@@ -49,9 +51,10 @@ const onSubmit = () => {
         if (valid) {
             formSubmit().then(() => {
                 ElMessage.success('提交成功')
-                onCancel()
             }).catch((err) => {
-                ElMessage.error('提交失败:' + err)
+                ElMessage.warning(err)
+            }).finally(() => {
+                onCancel(true)
             })
         }
     })

+ 6 - 1
src/packages/pc/views/mine/bank/index.vue

@@ -7,13 +7,18 @@
             <template #header>
                 <app-auth-operation :menus="['deposit', 'withdraw']" @closed="getAccountInOutApply" />
             </template>
+            <!-- 操作 -->
+            <template #operate="{ row }">
+                <app-auth-operation :menus="['cancel']" :options="{ selectedRow: row }"
+                    @closed="getAccountInOutApply" />
+            </template>
         </app-table>
     </app-view>
 </template>
 
 <script lang="ts" setup>
 import { ElMessage } from 'element-plus'
-import { useAccountInOut } from '@/business/account'
+import { useAccountInOut } from '@/business/bank'
 import AppTable from '@pc/components/base/table/index.vue'
 import AppFilter from '@pc/components/base/table-filter/index.vue'
 import AppAuthOperation from '@pc/components/modules/auth-operation/index.vue'

+ 6 - 6
src/packages/pc/views/mine/profile/components/rescind/index.vue

@@ -12,17 +12,17 @@
 <script lang="ts" setup>
 import { shallowRef, PropType } from 'vue'
 import { ElMessage } from 'element-plus'
-import { useDiamondFavorite } from '@/business/goods'
+import { useBankCancelSign } from '@/business/bank'
 import AppDrawer from '@pc/components/base/drawer/index.vue'
 
 const props = defineProps({
-    selectedRow: {
-        type: Object as PropType<Ermcp.MyWRPositionRsp | Ermcp.SellOrderRsp>,
-        default: () => ({})
+    bankInfo: {
+        type: Object as PropType<Ermcp.BankAccountSignRsp>,
+        required: true
     },
 })
 
-const { loading, formSubmit } = useDiamondFavorite(props.selectedRow)
+const { loading, formSubmit } = useBankCancelSign(props.bankInfo)
 const show = shallowRef(true)
 const refresh = shallowRef(false)
 
@@ -32,7 +32,7 @@ const onCancel = (isRefresh = false) => {
 }
 
 const onSubmit = () => {
-    formSubmit(1).then(() => {
+    formSubmit().then(() => {
         ElMessage.success('提交成功')
         onCancel(true)
     }).catch((err) => {

+ 3 - 3
src/packages/pc/views/mine/profile/components/sign/index.vue

@@ -45,10 +45,10 @@ import { ref } from 'vue'
 import { ElMessage } from 'element-plus'
 import type { FormInstance, FormRules } from 'element-plus'
 import { getCertificateTypeName } from '@/constants/certificate'
-import { useBank } from '@/business/account'
+import { useBankSign } from '@/business/bank'
 import AppDrawer from '@pc/components/base/drawer/index.vue'
 
-const { loading, custodianBanks, selectedCustodianBank, selectedDepositBank, formData, formSubmit } = useBank()
+const { loading, custodianBanks, selectedCustodianBank, selectedDepositBank, formData, formSubmit } = useBankSign()
 const show = ref(true)
 const refresh = ref(false)
 const formRef = ref<FormInstance>()
@@ -90,7 +90,7 @@ const onSubmit = () => {
                 ElMessage.success('您的申请已提交,请稍后查询结果!')
                 onCancel(true)
             }).catch((err) => {
-                ElMessage.error('提交失败:' + err)
+                ElMessage.warning(err)
             })
         }
     })

+ 1 - 1
src/packages/pc/views/mine/profile/index.vue

@@ -33,7 +33,7 @@
                 <el-descriptions-item label="手机号">{{ handleNoneValue(bankInfo.mobilephone) }}</el-descriptions-item>
             </template>
         </el-descriptions>
-        <app-auth-operation :menus="handleTableButtons" @closed="getBankAccountSign" />
+        <app-auth-operation :menus="handleTableButtons" :options="{ bankInfo }" @closed="getBankAccountSign" />
     </app-view>
 </template>
 

+ 42 - 0
src/packages/pc/views/order/main/components/details/index.vue

@@ -0,0 +1,42 @@
+<!-- 订单管理-详情 -->
+<template>
+    <teleport to="#appMainTeleport">
+        <app-view class="app-details" v-bind="$attrs">
+            <template #header>
+                <div>
+                    <el-button @click="$emit('closed')">返回</el-button>
+                </div>
+            </template>
+            <el-descriptions title="基本信息" :column="2">
+                <el-descriptions-item label="关联单号">{{ selectedRow.relatedorderid }}</el-descriptions-item>
+                <el-descriptions-item label="履约商品">{{ selectedRow.goodsno }}</el-descriptions-item>
+                <el-descriptions-item label="履约金额">{{ selectedRow.amount }}</el-descriptions-item>
+                <el-descriptions-item label="付款方式">{{ selectedRow.paymenttype }}</el-descriptions-item>
+                <el-descriptions-item label="买方">{{ }}</el-descriptions-item>
+                <el-descriptions-item label="卖方">{{ }}</el-descriptions-item>
+                <el-descriptions-item label="买方冻结">{{ selectedRow.buyerfreezeamount }}</el-descriptions-item>
+                <el-descriptions-item label="卖方冻结">{{ selectedRow.sellerfreezeamount }}</el-descriptions-item>
+                <el-descriptions-item label="买方冻结剩余">{{ selectedRow.buyerfreezeamountremain }}</el-descriptions-item>
+                <el-descriptions-item label="卖方冻结剩余">{{ selectedRow.sellerfreezeamountremain }}</el-descriptions-item>
+                <el-descriptions-item label="买方今日付款">{{ }}</el-descriptions-item>
+                <el-descriptions-item label="卖方今日收款">{{ }}</el-descriptions-item>
+                <el-descriptions-item label="运费">{{ }}</el-descriptions-item>
+                <el-descriptions-item label="运费确认">{{ }}</el-descriptions-item>
+                <el-descriptions-item label="买方联络信息">{{ selectedRow.buyerinfo }}</el-descriptions-item>
+                <el-descriptions-item label="卖方联络信息">{{ selectedRow.sellerinfo }}</el-descriptions-item>
+            </el-descriptions>
+        </app-view>
+    </teleport>
+</template>
+
+<script lang="ts" setup>
+import { PropType } from 'vue'
+
+defineProps({
+    code: String,
+    selectedRow: {
+        type: Object as PropType<Ermcp.MyPerformancRsp>,
+        default: () => ({})
+    }
+})
+</script>

+ 1 - 1
src/services/api/bank/index.ts

@@ -20,7 +20,7 @@ export function t2bBankCancelSign(params: TradeRequest<Proto.t2bBankCancelSignRe
 /**
  * 出金申请
  */
-export function t2bBankWithdraw(params: TradeRequest<Proto.t2bBankWithdrawReq, Proto.t2bBankWithdrawRsp>) {
+export function t2bBankWithdraw(params: TradeRequest<Partial<Proto.t2bBankWithdrawReq>, Proto.t2bBankWithdrawRsp>) {
     return tradeServerRequest('t2bBankWithdrawReq', 't2bBankWithdrawRsp', params);
 }
 

+ 8 - 4
src/services/socket/trade/index.ts

@@ -78,8 +78,7 @@ export async function tradeServerRequest<Req, Rsp>(reqKey: keyof typeof FunCode,
     const { success, fail, complete } = params;
 
     await tradeServerMiddleware(reqKey, rspKey, params, marketId).then((res) => {
-        const { RetCode, RetDesc } = res;
-
+        const { RetCode, Status, RetDesc } = { ...res };
         switch (RetCode) {
             case 0: {
                 success && success(res);
@@ -97,8 +96,13 @@ export async function tradeServerRequest<Req, Rsp>(reqKey: keyof typeof FunCode,
                 return Promise.reject(res.RetDesc);
             }
             default: {
-                const msg = getErrorInfoByCode(RetCode)
-                const error = (RetDesc || RetCode).toString();
+                // 银行 业务 以 Status 作为判断依据
+                if (Status === 0) {
+                    success && success(res);
+                    return Promise.resolve();
+                }
+                const msg = getErrorInfoByCode(RetCode || Status);
+                const error = String(RetDesc || RetCode);
                 return Promise.reject(msg ?? error);
             }
         }

+ 37 - 34
src/stores/modules/account.ts

@@ -1,13 +1,12 @@
-import { computed, toRefs, shallowReadonly } from 'vue'
+import { computed, toRefs, shallowRef, shallowReadonly } from 'vue'
 import { queryTaAccounts } from '@/services/api/account'
 import { useLoginStore } from './login'
 import { VueStore } from '../base'
 import eventBus from '@/services/bus'
 
 interface StoreState {
-    loading: boolean;
     accountList: Ermcp.TaAccountsRsp[]; // 资金账户列表
-    currentAccountId: number; // 当前资金账户ID
+    accountId: number; // 当前资金账户ID
 }
 
 /**
@@ -16,9 +15,8 @@ interface StoreState {
 const store = new (class extends VueStore<StoreState> {
     constructor() {
         const state: StoreState = {
-            loading: false,
             accountList: [],
-            currentAccountId: 0,
+            accountId: 0,
         }
         super(state)
 
@@ -29,50 +27,55 @@ const store = new (class extends VueStore<StoreState> {
     }
 
     /** 当前资金账户信息 */
-    private currentAccountInfo = computed(() => {
-        return this.state.accountList.find((e) => e.accountid === this.state.currentAccountId)
+    private accountInfo = computed(() => {
+        return this.state.accountList.find((e) => e.accountid === this.state.accountId)
     })
 
     getters = {
-        currentAccountInfo: this.currentAccountInfo
+        accountInfo: this.accountInfo
     }
 
     actions = {
         /** 获取资金账户列表 */
         getAccountList: () => {
-            const { getLoginId } = useLoginStore()
-            this.state.loading = true
-
-            return queryTaAccounts({
-                data: {
-                    loginID: getLoginId()
-                },
-                success: (res) => {
-                    const dataList = res.data
-                    if (dataList.length) {
-                        this.state.accountList = dataList
-                        // 查找当前选中的资金账户
-                        const account = dataList.find((e) => e.accountid === this.state.currentAccountId)
-                        if (account) {
-                            this.state.loading = false
+            const loading = shallowRef(true)
+            const request = () => {
+                const { getLoginId } = useLoginStore()
+                return queryTaAccounts({
+                    data: {
+                        loginID: getLoginId()
+                    },
+                    success: (res) => {
+                        const dataList = res.data
+                        if (dataList.length) {
+                            this.state.accountList = dataList
+                            // 查找当前选中的资金账户
+                            const account = dataList.find((e) => e.accountid === this.state.accountId)
+                            if (account) {
+                                loading.value = false
+                            } else {
+                                // 如果不存在,默认选中第一个账户
+                                this.state.accountId = dataList[0].accountid
+                            }
                         } else {
-                            // 如果不存在,默认选中第一个账户
-                            this.state.currentAccountId = dataList[0].accountid
+                            loading.value = false
+                            this.actions.reset()
                         }
-                    } else {
-                        this.state.loading = false
-                        this.actions.reset()
+                    },
+                    fail: () => {
+                        loading.value = false
                     }
-                },
-                fail: () => {
-                    this.state.loading = false
-                }
-            })
+                })
+            }
+            return {
+                loading,
+                result: request()
+            }
         },
         /** 重置数据 */
         reset: () => {
             this.state.accountList = []
-            this.state.currentAccountId = 0
+            this.state.accountId = 0
         }
     }
 })

+ 19 - 14
src/stores/modules/enum.ts

@@ -1,4 +1,4 @@
-import { toRefs, shallowReadonly, ShallowRef } from 'vue'
+import { toRefs, shallowRef, shallowReadonly, ShallowRef } from 'vue'
 import { queryAllEnums } from '@/services/api/common'
 import { VueStore } from '../base'
 import WebStorage from '@/utils/storage/base'
@@ -13,7 +13,6 @@ export interface EnumType {
 }
 
 interface StoreState {
-    loading: boolean;
     allEnums: ShallowRef<Ermcp.EnumRsp[]>;
 }
 
@@ -24,7 +23,6 @@ const store = new (class extends VueStore<StoreState>{
     constructor() {
         const storage = new WebStorage<Ermcp.EnumRsp[]>(sessionStorage, 'allEnums', [])
         const state: StoreState = {
-            loading: false,
             allEnums: storage.getRef(),
         }
         super(state)
@@ -33,18 +31,25 @@ const store = new (class extends VueStore<StoreState>{
     actions = {
         /** 获取所有枚举列表 */
         getAllEnumList: () => {
-            if (this.state.allEnums.length) {
-                return Promise.resolve()
-            }
-            this.state.loading = true
-            return queryAllEnums({
-                success: (res) => {
-                    this.state.allEnums = res.data
-                },
-                complete: () => {
-                    this.state.loading = false
+            const loading = shallowRef(false)
+            const request = () => {
+                if (this.state.allEnums.length) {
+                    return Promise.resolve()
                 }
-            })
+                loading.value = true
+                return queryAllEnums({
+                    success: (res) => {
+                        this.state.allEnums = res.data
+                    },
+                    complete: () => {
+                        loading.value = false
+                    }
+                })
+            }
+            return {
+                loading,
+                result: request()
+            }
         },
         /** 获取枚举类型 */
         getEnumTypes: <T extends string[]>(...args: T) => {

+ 19 - 14
src/stores/modules/errorInfo.ts

@@ -1,10 +1,9 @@
-import { toRefs, shallowReadonly, ShallowRef } from 'vue'
+import { toRefs, shallowRef, shallowReadonly, ShallowRef } from 'vue'
 import { queryErrorInfos } from '@/services/api/common'
 import { VueStore } from '../base'
 import WebStorage from '@/utils/storage/base'
 
 interface StoreState {
-    loading: boolean;
     errorInfos: ShallowRef<Ermcp.ErrorInfosRsp[]>;
 }
 
@@ -15,7 +14,6 @@ const store = new (class extends VueStore<StoreState>{
     constructor() {
         const storage = new WebStorage<Ermcp.ErrorInfosRsp[]>(sessionStorage, 'errorInfos', [])
         const state: StoreState = {
-            loading: false,
             errorInfos: storage.getRef(),
         }
         super(state)
@@ -24,18 +22,25 @@ const store = new (class extends VueStore<StoreState>{
     actions = {
         /** 获取系统错误信息 */
         getErrorInfoList: () => {
-            if (this.state.errorInfos.length) {
-                return Promise.resolve()
-            }
-            this.state.loading = true
-            return queryErrorInfos({
-                success: (res) => {
-                    this.state.errorInfos = res.data
-                },
-                complete: () => {
-                    this.state.loading = false
+            const loading = shallowRef(false)
+            const request = () => {
+                if (this.state.errorInfos.length) {
+                    return Promise.resolve()
                 }
-            })
+                loading.value = true
+                return queryErrorInfos({
+                    success: (res) => {
+                        this.state.errorInfos = res.data
+                    },
+                    complete: () => {
+                        loading.value = false
+                    }
+                })
+            }
+            return {
+                loading,
+                result: request()
+            }
         },
         /** 根据 code 获取错误信息 */
         getErrorInfoByCode: (code: number) => {

+ 20 - 17
src/stores/modules/favorite.ts

@@ -1,10 +1,9 @@
-import { toRefs, shallowReadonly } from 'vue'
+import { toRefs, shallowRef, shallowReadonly } from 'vue'
 import { queryMyFavorite } from '@/services/api/favorite'
 import { useLoginStore } from './login'
 import { VueStore } from '../base'
 
 interface StoreState {
-    loading: boolean;
     favoriteList: Ermcp.MyFavoriteRsp[]; // 收藏列表
 }
 
@@ -14,7 +13,6 @@ interface StoreState {
 const store = new (class extends VueStore<StoreState>{
     constructor() {
         const state: StoreState = {
-            loading: false,
             favoriteList: [],
         }
         super(state)
@@ -23,20 +21,25 @@ const store = new (class extends VueStore<StoreState>{
     actions = {
         /** 获取收藏列表 */
         getFavoriteList: () => {
-            const { getUserId } = useLoginStore()
-            this.state.loading = true
-
-            return queryMyFavorite({
-                data: {
-                    userid: getUserId(),
-                },
-                success: (res) => {
-                    this.state.favoriteList = res.data
-                },
-                complete: () => {
-                    this.state.loading = false
-                }
-            })
+            const loading = shallowRef(true)
+            const request = () => {
+                const { getUserId } = useLoginStore()
+                return queryMyFavorite({
+                    data: {
+                        userid: getUserId(),
+                    },
+                    success: (res) => {
+                        this.state.favoriteList = res.data
+                    },
+                    complete: () => {
+                        loading.value = false
+                    }
+                })
+            }
+            return {
+                loading,
+                result: request()
+            }
         },
         /** 是否已收藏 */
         hasFavorite: (goodsno: string) => {

+ 20 - 17
src/stores/modules/futures.ts

@@ -1,4 +1,4 @@
-import { computed, toRefs, shallowReadonly } from 'vue'
+import { computed, shallowRef, toRefs, shallowReadonly } from 'vue'
 import { timerInterceptor } from '@/utils/timer'
 import { queryGoodsList } from '@/services/api/goods'
 import { useLoginStore } from './login'
@@ -7,7 +7,6 @@ import eventBus from '@/services/bus'
 import moment from 'moment'
 
 interface StoreState {
-    loading: boolean;
     goodsList: Ermcp.GoodsRsp[]; // 商品列表
     quoteDayList: Ermcp.QuoteDay[]; // 盘面列表
 }
@@ -18,7 +17,6 @@ interface StoreState {
 const store = new (class extends VueStore<StoreState> {
     constructor() {
         const state: StoreState = {
-            loading: false,
             goodsList: [],
             quoteDayList: [],
         }
@@ -204,20 +202,25 @@ const store = new (class extends VueStore<StoreState> {
     actions = {
         // 获取商品列表
         getGoodsList: () => {
-            const { getUserId } = useLoginStore()
-            this.state.loading = true
-
-            return queryGoodsList({
-                data: {
-                    userid: getUserId()
-                },
-                success: (res) => {
-                    this.state.goodsList = res.data
-                },
-                complete: () => {
-                    this.state.loading = false
-                }
-            })
+            const loading = shallowRef(true)
+            const request = () => {
+                const { getUserId } = useLoginStore()
+                return queryGoodsList({
+                    data: {
+                        userid: getUserId()
+                    },
+                    success: (res) => {
+                        this.state.goodsList = res.data
+                    },
+                    complete: () => {
+                        loading.value = false
+                    }
+                })
+            }
+            return {
+                loading,
+                result: request()
+            }
         },
         /** 通过 goodscode 获取盘面实时行情 */
         getQuoteDayInfoByCode: (goodscode: string) => {

+ 37 - 33
src/stores/modules/login.ts

@@ -1,11 +1,10 @@
-import { toRefs, shallowReadonly, ShallowRef } from 'vue'
+import { toRefs, shallowRef, shallowReadonly, ShallowRef } from 'vue'
 import { login, queryLoginId } from '@/services/api/account'
 import { VueStore } from '../base'
 import cryptojs from 'crypto-js'
 import WebStorage from '@/utils/storage/base'
 
 interface StoreState {
-    loading: boolean;
     loginInfo: ShallowRef<Proto.LoginRsp>;
 }
 
@@ -30,7 +29,6 @@ const store = new (class extends VueStore<StoreState> {
     constructor() {
         const storage = new WebStorage(sessionStorage, 'loginInfo', getInitData())
         const state: StoreState = {
-            loading: false,
             loginInfo: storage.getRef(),
         }
         super(state)
@@ -39,37 +37,43 @@ const store = new (class extends VueStore<StoreState> {
     actions = {
         /** 用户登录 */
         userLogin: (param: Proto.LoginReq) => {
-            this.state.loading = true
-            return new Promise<Proto.LoginRsp>((resolve, reject) => {
-                queryLoginId({
-                    data: {
-                        username: param.LoginID
-                    },
-                    success: (res) => {
-                        login({
-                            data: {
-                                ...param,
-                                LoginID: res.data,
-                                LoginPWD: cryptojs.SHA256(res.data + param.LoginPWD).toString(),
-                            },
-                            success: (res) => {
-                                this.state.loginInfo = res
-                                resolve(res)
-                            },
-                            fail: (err) => {
-                                reject(err)
-                            },
-                            complete: () => {
-                                this.state.loading = false
-                            }
-                        })
-                    },
-                    fail: (err) => {
-                        this.state.loading = false
-                        reject(err)
-                    }
+            const loading = shallowRef(true)
+            const request = () => {
+                return new Promise<Proto.LoginRsp>((resolve, reject) => {
+                    queryLoginId({
+                        data: {
+                            username: param.LoginID
+                        },
+                        success: (res) => {
+                            login({
+                                data: {
+                                    ...param,
+                                    LoginID: res.data,
+                                    LoginPWD: cryptojs.SHA256(res.data + param.LoginPWD).toString(),
+                                },
+                                success: (res) => {
+                                    this.state.loginInfo = res
+                                    resolve(res)
+                                },
+                                fail: (err) => {
+                                    reject(err)
+                                },
+                                complete: () => {
+                                    loading.value = false
+                                }
+                            })
+                        },
+                        fail: (err) => {
+                            loading.value = false
+                            reject(err)
+                        }
+                    })
                 })
-            })
+            }
+            return {
+                loading,
+                result: request()
+            }
         },
         /** 获取用户登录信息 */
         getLoginInfo: <K extends keyof Proto.LoginRsp>(key: K) => {

+ 53 - 49
src/stores/modules/menu.ts

@@ -1,11 +1,10 @@
-import { toRefs, shallowReadonly, ShallowRef } from 'vue'
+import { toRefs, shallowRef, shallowReadonly, ShallowRef } from 'vue'
 import { queryNewFuncmenu } from '@/services/api/common'
 import { queryAccountMenu } from '@/services/api/account'
 import { VueStore } from '../base'
 import WebStorage from '@/utils/storage/base'
 
 interface StoreState {
-    loading: boolean;
     userMenus: ShallowRef<Ermcp.UserMenu[]>;
 }
 
@@ -13,7 +12,6 @@ const store = new (class extends VueStore<StoreState>{
     constructor() {
         const storage = new WebStorage<Ermcp.UserMenu[]>(sessionStorage, 'userMenus', [])
         const state: StoreState = {
-            loading: false,
             userMenus: storage.getRef()
         }
         super(state)
@@ -22,55 +20,61 @@ const store = new (class extends VueStore<StoreState>{
     actions = {
         /** 获取用户菜单列表 */
         getUserMenuList: () => {
-            this.state.loading = true
-            return queryAccountMenu({
-                success: (res) => {
-                    this.state.userMenus = res.data
-                },
-                complete: () => {
-                    this.state.loading = false
-                }
-            })
-            return queryNewFuncmenu({
-                data: {
-                    menutype: '5',
-                },
-                success: (res) => {
-                    // 扁平列表树形化
-                    const arrayToTree = (list: Ermcp.NewFuncmenuRsp[], code: null | string = null) => {
-                        const getChildren = (parent: null | string) => {
-                            const result: Ermcp.UserMenu[] = []
-                            list.forEach((e) => {
-                                if (e.parentcode === parent) {
-                                    const item = {
-                                        id: 0,
-                                        authType: e.authtype,
-                                        title: e.resourcename,
-                                        code: e.resourcecode,
-                                        urlType: e.urltype,
-                                        url: e.url || '',
-                                        component: e.component,
-                                        icon: e.iconame,
-                                        buttonName: e.buttonname,
-                                        buttonType: e.buttontype,
-                                        sort: e.sort,
-                                        hidden: Boolean(e.hidden),
-                                        remark: e.remark,
-                                        children: getChildren(e.resourcecode),
+            const loading = shallowRef(true)
+            const request = () => {
+                return queryAccountMenu({
+                    success: (res) => {
+                        this.state.userMenus = res.data
+                    },
+                    complete: () => {
+                        loading.value = false
+                    }
+                })
+                return queryNewFuncmenu({
+                    data: {
+                        menutype: '5',
+                    },
+                    success: (res) => {
+                        // 扁平列表树形化
+                        const arrayToTree = (list: Ermcp.NewFuncmenuRsp[], code: null | string = null) => {
+                            const getChildren = (parent: null | string) => {
+                                const result: Ermcp.UserMenu[] = []
+                                list.forEach((e) => {
+                                    if (e.parentcode === parent) {
+                                        const item = {
+                                            id: 0,
+                                            authType: e.authtype,
+                                            title: e.resourcename,
+                                            code: e.resourcecode,
+                                            urlType: e.urltype,
+                                            url: e.url || '',
+                                            component: e.component,
+                                            icon: e.iconame,
+                                            buttonName: e.buttonname,
+                                            buttonType: e.buttontype,
+                                            sort: e.sort,
+                                            hidden: Boolean(e.hidden),
+                                            remark: e.remark,
+                                            children: getChildren(e.resourcecode),
+                                        }
+                                        result.push(item)
                                     }
-                                    result.push(item)
-                                }
-                            })
-                            return result
+                                })
+                                return result
+                            }
+                            return getChildren(code)
                         }
-                        return getChildren(code)
+                        this.state.userMenus = arrayToTree(res.data)
+                    },
+                    complete: () => {
+                        loading.value = false
                     }
-                    this.state.userMenus = arrayToTree(res.data)
-                },
-                complete: () => {
-                    this.state.loading = false
-                }
-            })
+                })
+            }
+            return {
+                loading,
+                result: request()
+            }
         },
         /** 重置数据 */
         reset: () => {

+ 54 - 20
src/stores/modules/performance.ts

@@ -1,38 +1,72 @@
-import { toRefs, shallowReadonly, ShallowRef } from 'vue'
-import { queryWrPerformanceStepType } from '@/services/api/performance'
+import { toRefs, shallowReadonly, ShallowRef, shallowRef } from 'vue'
+import { queryWrPerformanceStepType, queryPermancePlanTmp } from '@/services/api/performance'
 import { VueStore } from '../base'
-import WebStorage from '@/utils/storage/base'
+import WebStorage from '@/utils/storage'
 
 interface StoreState {
-    loading: boolean;
-    performanceStepTypes: ShallowRef<Ermcp.WrPerformanceStepTypeRsp[]>;
+    performanceStepTypes: ShallowRef<Ermcp.WrPerformanceStepTypeRsp[]>; // 履约步骤枚举
+    performanceTemplates: ShallowRef<Ermcp.PermancePlanTmpRsp[]>; // 履约模板
+}
+
+interface StorageData {
+    performanceStepTypes: Ermcp.WrPerformanceStepTypeRsp[];
+    performanceTemplates: Ermcp.PermancePlanTmpRsp[];
 }
 
 const store = new (class extends VueStore<StoreState>{
     constructor() {
-        const storage = new WebStorage<Ermcp.WrPerformanceStepTypeRsp[]>(sessionStorage, 'performanceStepTypes', [])
+        const storage = new WebStorage<StorageData>(sessionStorage, { performanceStepTypes: [], performanceTemplates: [] })
         const state: StoreState = {
-            loading: false,
-            performanceStepTypes: storage.getRef()
+            performanceStepTypes: storage.getRef('performanceStepTypes'),
+            performanceTemplates: storage.getRef('performanceTemplates'),
         }
         super(state)
     }
 
     actions = {
-        /** 获取履约步骤列表 */
-        getPerformanceStepList: () => {
-            if (this.state.performanceStepTypes.length) {
-                return Promise.resolve()
+        /** 获取履约模板列表 */
+        getPerformanceTemplateList: () => {
+            const loading = shallowRef(false)
+            const request = () => {
+                if (this.state.performanceTemplates.length) {
+                    return Promise.resolve()
+                }
+                loading.value = true
+                return queryPermancePlanTmp({
+                    success: (res) => {
+                        this.state.performanceTemplates = res.data
+                    },
+                    complete: () => {
+                        loading.value = false
+                    }
+                })
             }
-            this.state.loading = true
-            return queryWrPerformanceStepType({
-                success: (res) => {
-                    this.state.performanceStepTypes = res.data
-                },
-                complete: () => {
-                    this.state.loading = false
+            return {
+                loading,
+                result: request()
+            }
+        },
+        /** 获取履约步骤枚举列表 */
+        getPerformanceStepTypeList: () => {
+            const loading = shallowRef(false)
+            const request = () => {
+                if (this.state.performanceStepTypes.length) {
+                    return Promise.resolve()
                 }
-            })
+                loading.value = true
+                return queryWrPerformanceStepType({
+                    success: (res) => {
+                        this.state.performanceStepTypes = res.data
+                    },
+                    complete: () => {
+                        loading.value = true
+                    }
+                })
+            }
+            return {
+                loading,
+                result: request()
+            }
         }
     }
 })

+ 22 - 14
src/stores/modules/tableColumn.ts

@@ -1,10 +1,9 @@
-import { toRefs, shallowReadonly, ShallowRef } from 'vue'
+import { toRefs, shallowReadonly, ShallowRef, shallowRef } from 'vue'
 import { queryTableDefine } from '@/services/api/common'
 import { VueStore } from '../base'
 import WebStorage from '@/utils/storage/base'
 
 interface StoreState {
-    loading: boolean;
     tableColumns: ShallowRef<Ermcp.TableDefineRsp[]>;
 }
 
@@ -12,7 +11,6 @@ const store = new (class extends VueStore<StoreState>{
     constructor() {
         const storage = new WebStorage<Ermcp.TableDefineRsp[]>(sessionStorage, 'tableColumns', [])
         const state: StoreState = {
-            loading: false,
             tableColumns: storage.getRef()
         }
         super(state)
@@ -21,18 +19,28 @@ const store = new (class extends VueStore<StoreState>{
     actions = {
         /** 获取表格列列表 */
         getTableColumnList: () => {
-            this.state.loading = true
-            return queryTableDefine({
-                data: {
-                    tableType: 2
-                },
-                success: (res) => {
-                    this.state.tableColumns = res.data
-                },
-                complete: () => {
-                    this.state.loading = false
+            const loading = shallowRef(false)
+            const request = () => {
+                if (this.state.tableColumns.length) {
+                    return Promise.resolve()
                 }
-            })
+                loading.value = true
+                return queryTableDefine({
+                    data: {
+                        tableType: 2
+                    },
+                    success: (res) => {
+                        this.state.tableColumns = res.data
+                    },
+                    complete: () => {
+                        loading.value = false
+                    }
+                })
+            }
+            return {
+                loading,
+                result: request()
+            }
         }
     }
 })

+ 20 - 17
src/stores/modules/user.ts

@@ -1,10 +1,9 @@
-import { toRefs, shallowReadonly } from 'vue'
+import { toRefs, shallowRef, shallowReadonly } from 'vue'
 import { queryLoginData } from '@/services/api/account'
 import { useLoginStore } from './login'
 import { VueStore } from '../base'
 
 interface StoreState {
-    loading: boolean;
     userData: Ermcp.LoginQueryRsp;
 }
 
@@ -14,7 +13,6 @@ interface StoreState {
 const store = new (class extends VueStore<StoreState>{
     constructor() {
         const state: StoreState = {
-            loading: false,
             userData: {
                 arearole: [],
                 externalExchanges: [],
@@ -29,20 +27,25 @@ const store = new (class extends VueStore<StoreState>{
     actions = {
         /** 获取用户数据 */
         getUserData: () => {
-            const { getLoginId } = useLoginStore()
-            this.state.loading = true
-
-            return queryLoginData({
-                data: {
-                    loginID: getLoginId()
-                },
-                success: (res) => {
-                    this.state.userData = res.data
-                },
-                complete: () => {
-                    this.state.loading = false
-                }
-            })
+            const loading = shallowRef(true)
+            const request = () => {
+                const { getLoginId } = useLoginStore()
+                return queryLoginData({
+                    data: {
+                        loginID: getLoginId()
+                    },
+                    success: (res) => {
+                        this.state.userData = res.data
+                    },
+                    complete: () => {
+                        loading.value = false
+                    }
+                })
+            }
+            return {
+                loading,
+                result: request()
+            }
         },
         /** 获取用户数据 */
         getUserDataInfo: <K extends keyof Ermcp.LoginQueryRsp>(key: K) => {

+ 4 - 0
src/types/ermcp/bank.d.ts

@@ -101,6 +101,8 @@ declare global {
             begindate?: string;  //   申请起始日期(格式yyyymmdd)
             enddate?: string;    //   申请截止日期(格式yyyymmdd)
             likename?: string;   //   模糊搜索名称
+            applystatus?: number; // 状态 1-待审核 2-审核通过 3-审核拒绝
+            querytype?: number; // 查询类型 1-提现(出金) 2-充值(入金)
         }
 
         /** 查询充值提现 响应 */
@@ -130,6 +132,8 @@ declare global {
             checkerrorflag: number;//对账差错标志 - 1:为单边账;其它为正常出入金
             currency: string;//币种
             cusbankid: string;//托管银行编号
+            cusbankname: string; // 托管银行名称
+            cusbankshortname: string; // 托管银行简称
             exchticket: string;//银行服务流水号
             executetype: number;//申请类型 - 1:出金 2:入金 3: 单边账调整:入金; 4:单边账调整:出金 5:外部母账户调整:入金 6:外部母账户调整:出金 7:外部子账户:入金 8:外部子账户:出金
             extendinfo: string;//扩展信息

+ 1 - 0
src/types/ermcp/favorite.d.ts

@@ -22,6 +22,7 @@ declare namespace Ermcp {
         wrfactortypeid: string; // 仓单要素类型ID/商品ID(77)
         wrstandardid: number; // 现货商品ID(自增 SEQ_GOODS 确保不重复)
         wrtradeorderid: string; // 仓单贸易委托单ID(320+Unix秒时间戳(10位)+xxxxxx)
+        zscategory: number; // 钻石分类 - 枚举”ZSCategory“
         zscategorydisplay: string;
         zscerttypedisplay: string;
         zsclaritytype1display: string;

+ 5 - 5
src/types/proto/bank.d.ts

@@ -67,15 +67,15 @@ declare global {
         interface t2bBankCancelSignReq {
             Header?: IMessageHead;
             ExtOperatorID: number; // 外部操作流水号
-            ExchId: string; // 交易所编号
+            ExchId?: string; // 交易所编号
             AccountCode: string; // 账户
             CusBankID: string; // 托管银行编号
             IsForce: number; // 是否强制
             Currency: string; // 币种
-            TradeDate: string; // 交易所业务日期
-            ExchTicket: string; // 交易所流水号
-            BankChildAcc: string; // 银行子账号
-            BankChildAccName: string; // 银行子账号名
+            TradeDate?: string; // 交易所业务日期
+            ExchTicket?: string; // 交易所流水号
+            BankChildAcc?: string; // 银行子账号
+            BankChildAccName?: string; // 银行子账号名
         }
 
         /** 解约应答 */

+ 6 - 13
src/utils/storage/index.ts

@@ -11,21 +11,14 @@ export default class <T extends object> {
         // 读取本地数据
         for (const key in source) {
             const storageValue = this.getValue(key)
-            const state = this.stateMap.get(key)
-
-            if (state) {
-                state.value = storageValue
-            } else {
-                this.stateMap.set(key, shallowRef(storageValue))
-            }
-
+            this.state[key] = shallowRef(storageValue)
             this.observe(key)
         }
     }
 
     private readonly storage: Storage
     private readonly source // 初始数据
-    private stateMap = new Map<keyof T, ShallowRef<T[keyof T]>>()
+    private state = {} as { [K in keyof T]: ShallowRef<T[K]> }
 
     /**
      * 监听数据变化
@@ -71,7 +64,7 @@ export default class <T extends object> {
      * @returns 
      */
     getRefs() {
-        return [...this.stateMap.entries()].reduce((obj, [key, value]) => (obj[key] = value, obj), {} as { [key in keyof T]: ShallowRef<T[key]> })
+        return this.state
     }
 
     /**
@@ -80,7 +73,7 @@ export default class <T extends object> {
      * @returns 
      */
     getRef<K extends keyof T>(key: K) {
-        return this.stateMap.get(key)!
+        return this.state[key]
     }
 
     /**
@@ -94,8 +87,8 @@ export default class <T extends object> {
                 state.value = this.source[key]
             })
         } else {
-            for (const [key, state] of this.stateMap) {
-                state.value = this.source[key]
+            for (const key in this.state) {
+                this.state[key].value = this.source[key]
             }
         }
     }

+ 7 - 5
src/utils/websocket/index.ts

@@ -361,12 +361,14 @@ export class MTP2WebSocket<T extends Package40 | Package50>{
             } else if (sendMessage) {
                 // 非推送类报文
                 const { data, success } = sendMessage;
-                // 判断是否正确的回复功能吗
-                if (data.rspCode !== p.funCode) {
-                    //console.log('无效的rspCode', p.funCode)
-                    return
-                } else {
+
+                // 可能会收到多个流水号相同的数据包,需判断是否正确的回复码
+                if (data.rspCode === p.funCode) {
                     success && success(p);
+                } else {
+                    // 跳过当前收到的数据包,继续等待直到asyncTask超时
+                    //console.log('无效的回复码', p.funCode)
+                    return
                 }
             }
         }