li.shaoyi 3 年之前
父節點
當前提交
43f21a23c8
共有 51 個文件被更改,包括 1256 次插入403 次删除
  1. 2 2
      src/business/bargain/index.ts
  2. 6 12
      src/business/common/index.ts
  3. 2 1
      src/business/favorite/index.ts
  4. 71 0
      src/business/home/index.ts
  5. 30 1
      src/business/order/index.ts
  6. 1 1
      src/business/search/index.ts
  7. 1 3
      src/business/sign/index.ts
  8. 18 3
      src/business/table/index.ts
  9. 2 2
      src/business/trade/list.ts
  10. 38 0
      src/constants/bank.ts
  11. 19 3
      src/constants/order.ts
  12. 17 4
      src/filters/index.ts
  13. 9 0
      src/packages/pc/views/bargain/buy/index.vue
  14. 5 0
      src/packages/pc/views/bargain/sell/index.vue
  15. 11 2
      src/packages/pc/views/favorite/main/index.vue
  16. 102 10
      src/packages/pc/views/home/main/index.vue
  17. 1 1
      src/packages/pc/views/mine/address/index.vue
  18. 10 0
      src/packages/pc/views/mine/bank/index.vue
  19. 1 1
      src/packages/pc/views/mine/invoice/index.vue
  20. 1 0
      src/packages/pc/views/mine/profile/index.vue
  21. 43 8
      src/packages/pc/views/order/main/components/details/index.vue
  22. 10 0
      src/packages/pc/views/search/diamond/index.vue
  23. 10 0
      src/packages/pc/views/search/fancy/index.vue
  24. 19 0
      src/packages/pc/views/search/jewelry/components/compare/index.less
  25. 154 0
      src/packages/pc/views/search/jewelry/components/compare/index.vue
  26. 21 9
      src/packages/pc/views/search/jewelry/index.vue
  27. 9 0
      src/packages/pc/views/trade/bargain/index.vue
  28. 18 1
      src/packages/pc/views/trade/delisting/index.vue
  29. 9 0
      src/packages/pc/views/trade/sale/index.vue
  30. 9 0
      src/packages/pc/views/trade/sell/index.vue
  31. 9 0
      src/packages/pc/views/warehousing/goods/index.vue
  32. 7 0
      src/services/api/common/index.ts
  33. 0 39
      src/services/api/order/index.ts
  34. 44 0
      src/services/api/performance/index.ts
  35. 1 1
      src/services/api/trade/index.ts
  36. 4 4
      src/services/http/index.ts
  37. 147 0
      src/stores/@next.ts
  38. 27 31
      src/stores/modules/account.ts
  39. 19 30
      src/stores/modules/enum.ts
  40. 14 19
      src/stores/modules/errorInfo.ts
  41. 16 20
      src/stores/modules/favorite.ts
  42. 16 20
      src/stores/modules/futures.ts
  43. 33 37
      src/stores/modules/login.ts
  44. 49 53
      src/stores/modules/menu.ts
  45. 26 43
      src/stores/modules/performance.ts
  46. 17 22
      src/stores/modules/tableColumn.ts
  47. 16 20
      src/stores/modules/user.ts
  48. 14 0
      src/types/ermcp/common.d.ts
  49. 1 0
      src/types/ermcp/favorite.d.ts
  50. 47 0
      src/types/ermcp/performance.d.ts
  51. 100 0
      src/types/ermcp/trade.d.ts

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

@@ -25,8 +25,8 @@ export function useBargain(type: 0 | 1) {
             key: 'buyorsell',
             selectedValue: BuyOrSell.Buy,
             options: [
-                { label: '我的求购', value: BuyOrSell.Buy },
-                { label: '我的出售', value: BuyOrSell.Sell }
+                { label: '求购申请', value: BuyOrSell.Buy },
+                { label: '出售申请', value: BuyOrSell.Sell }
             ],
         },
         {

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

@@ -24,19 +24,13 @@ 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 = [
-        task1.result,
-        task2.result,
-        task3.result,
-        task4.result,
-        task5.result,
+        userStore.getUserData(),
+        menuStore.getUserMenuList(),
+        futuresStore.getGoodsList(),
+        performanceStore.getPerformanceTemplateList(),
+        performanceStore.getPerformanceStepTypeList(),
+        //tableColumnStore.getTableColumnList(),
     ]
 
     await Promise.all(asyncTask).then(() => {

+ 2 - 1
src/business/favorite/index.ts

@@ -5,7 +5,7 @@ import { Category } from '@/constants/diamond'
 import { useFavoriteStore } from '@/stores'
 
 export function useFavorite() {
-    const { favoriteList, getFavoriteList } = useFavoriteStore()
+    const { loading, favoriteList, getFavoriteList } = useFavoriteStore()
     const { dataList, total, pageIndex, pageSize, selectList, buttonList } = useDataTable<Ermcp.MyFavoriteRsp>({ pagination: true })
     const columns = shallowRef(getTableColumns('favorite'))
 
@@ -28,6 +28,7 @@ export function useFavorite() {
     })
 
     return {
+        loading,
         dataList,
         columns,
         total,

+ 71 - 0
src/business/home/index.ts

@@ -0,0 +1,71 @@
+import { shallowRef, computed } from 'vue'
+import { homeData, queryNotice } from '@/services/api/common'
+import { queryMyDeListing } from '@/services/api/trade'
+import { BuyOrSell } from '@/constants/order'
+import { useLoginStore, useFavoriteStore } from '@/stores'
+
+export function useHomeData() {
+    const { getUserId, getLoginId } = useLoginStore()
+    const favoriteStore = useFavoriteStore()
+    const deListingList = shallowRef<Ermcp.MyDeListingRsp[]>([])
+    const noticeList = shallowRef<Ermcp.NoticeRsp[]>([])
+
+    const favoriteList = computed(() => {
+        return favoriteStore.favoriteList.value.slice(0, 5)
+    })
+
+    const countData = shallowRef<Ermcp.HomeDataRsp>({
+        purchasedtransactions: 0, // 已购买的交易
+        transactioninpurchase: 0, // 求购中的交易
+        transactionsonsale: 0, // 出售中的交易
+        transactionssold: 0, // 已卖出的交易
+        unhandledmessage: 0, // 未处理消息
+    })
+
+    const getCountData = () => {
+        return homeData({
+            data: {
+                userid: getUserId()
+            },
+            success: (res) => {
+                countData.value = res.data
+            }
+        })
+    }
+
+    const getDeListingList = (buyorsell: BuyOrSell) => {
+        deListingList.value = []
+        return queryMyDeListing({
+            data: {
+                page: 1,
+                pagesize: 5,
+                buyorsell,
+                userid: getUserId(),
+            },
+            success: (res) => {
+                deListingList.value = res.data
+            }
+        })
+    }
+
+    const getNoticeList = () => {
+        return queryNotice({
+            data: {
+                loginID: getLoginId()
+            },
+            success: (res) => {
+                noticeList.value = res.data.splice(0, 5)
+            },
+        })
+    }
+
+    return {
+        countData,
+        deListingList,
+        favoriteList,
+        noticeList,
+        getCountData,
+        getDeListingList,
+        getNoticeList,
+    }
+}

+ 30 - 1
src/business/order/index.ts

@@ -2,7 +2,7 @@ import { shallowRef, ref, reactive } from 'vue'
 import { useDataTable } from '@/hooks/datatable'
 import { getTableColumns } from '@/business/table'
 import { getReceiptTypeName } from '@/constants/receipt'
-import { queryMyPerformance, performanceManualConfirm, performanceDelayApply, performanceContractedApply, performanceModifyContact } from '@/services/api/order'
+import { queryMyPerformance, performanceManualConfirm, performanceDelayApply, performanceContractedApply, performanceModifyContact, queryWrPerformancePlanStep } from '@/services/api/performance'
 import { useLoginStore } from '@/stores'
 import { BuyOrSell } from '@/constants/order'
 import Long from 'long'
@@ -236,4 +236,33 @@ export function usePerformanceModify(selectedRow: Ermcp.MyPerformancRsp) {
         formData,
         formSubmit
     }
+}
+
+// 履约计划步骤
+export function usePerformancePlanStep(planid: string) {
+    const { dataList } = useDataTable<Ermcp.WrPerformancePlanStepRsp>()
+    const loading = shallowRef(false)
+    const columns = shallowRef(getTableColumns('order_step'))
+
+    const getPlanStepList = () => {
+        loading.value = true
+        return queryWrPerformancePlanStep({
+            data: {
+                planid,
+            },
+            success: (res) => {
+                dataList.value = res.data
+            },
+            complete: () => {
+                loading.value = false
+            }
+        })
+    }
+
+    return {
+        loading,
+        dataList,
+        columns,
+        getPlanStepList,
+    }
 }

+ 1 - 1
src/business/search/index.ts

@@ -17,7 +17,7 @@ import {
 } from '@/constants/diamond'
 
 export function useSearch(category: Category) {
-    const { dataList, total, pageIndex, pageSize } = useDataTable<Ermcp.SellOrderRsp & { checked: boolean }>()
+    const { dataList, total, pageIndex, pageSize } = useDataTable<Ermcp.SellOrderSearchRsp & { checked: boolean }>()
     const loading = shallowRef(false)
     const columns = shallowRef(getTableColumns('listing_sellorder'))
     const warehouseList = shallowRef<Ermcp.WarehouseInfoRsp[]>([]) // 仓库列表

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

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

+ 18 - 3
src/business/table/index.ts

@@ -2,7 +2,7 @@ import { shallowRef } from 'vue'
 import { useTableColumnStore } from '@/stores'
 
 type TableColumnKey = typeof tableColumnKeys[number]
-const tableColumnKeys = ['system_menu', 'system_role', 'warehousing_diamond', 'warehousing_warehouse', 'mine_capital', 'listing_sellorder', 'listing_buyorder', 'listing_saleorder', 'listing_purchaseorder', 'listing_delisting', 'listing_bargain_buy', 'listing_bargain_sell', 'mine_address', 'mine_invoice', 'favorite', 'order', 'bargain_buy', 'bargain_sell'] as const
+const tableColumnKeys = ['system_menu', 'system_role', 'warehousing_diamond', 'warehousing_warehouse', 'mine_capital', 'listing_sellorder', 'listing_buyorder', 'listing_saleorder', 'listing_purchaseorder', 'listing_delisting', 'listing_bargain_buy', 'listing_bargain_sell', 'mine_address', 'mine_invoice', 'favorite', 'order', 'order_step', 'bargain_buy', 'bargain_sell'] as const
 
 /**
  * PC端表格列
@@ -93,8 +93,8 @@ const pcTableColumnMap = new Map<TableColumnKey, Ermcp.TableColumn[]>([
         { prop: 'zsfluorescencetype1display', label: '荧光' },
         { prop: 'size1', label: '尺寸' },
         { prop: 'price', label: '价格' },
-        { prop: 'fixedprice', label: '克拉重量' },
-        { prop: 'totalqty', label: '克拉单价' },
+        { prop: 'totalqty', label: '克拉重量' },
+        { prop: 'fixedprice', label: '克拉单价' },
         { prop: 'operate', label: '操作', width: 180 }
     ]],
     // 挂牌大厅-我的求购
@@ -229,6 +229,21 @@ const pcTableColumnMap = new Map<TableColumnKey, Ermcp.TableColumn[]>([
         { prop: 'remaindays', label: '剩余天数' },
         { prop: 'operate', label: '操作', width: 380 }
     ]],
+    // 订单履约步骤
+    ['order_step', [
+        { prop: 'steptypename', label: '名称' },
+        { prop: 'stepdays', label: '天数' },
+        { prop: 'remaindays', label: '剩余天数' },
+        { prop: 'stepvalue', label: '步骤值(%)' },
+        { prop: 'stepamount', label: '金额' },
+        { prop: 'realamount', label: '完成金额' },
+        { prop: 'isauto', label: '是否自动' },
+        { prop: 'steplanchtype', label: '启动类型' },
+        { prop: 'starttime', label: '开始日期' },
+        { prop: 'endtime', label: '结束日期' },
+        { prop: 'stepstatus', label: '步骤状态' },
+        { prop: 'remark', label: '步骤备注' },
+    ]],
     // 询价消息-求购
     ['bargain_buy', [
         { prop: 'warehousenamedisplay', label: '仓库' },

+ 2 - 2
src/business/trade/list.ts

@@ -316,13 +316,13 @@ export function usePurchaseOrder() {
 /**
  * 我的摘牌
  */
-export function useDelistingOrder() {
+export function useDelistingOrder(buyorsell = BuyOrSell.Buy) {
     const { getUserId } = useLoginStore()
     const { dataList, total, pageIndex, pageSize, inputList, selectList, buttonList, filterMethod, getQueryParam } = useDataTable<Ermcp.MyDeListingRsp>()
     const loading = shallowRef(false)
     const columns = shallowRef(getTableColumns('listing_delisting'))
     const filterDate = shallowRef<string[]>([])
-    const buyOrSell = shallowRef(BuyOrSell.Buy) // 根据查询的方向固定显示
+    const buyOrSell = shallowRef(buyorsell) // 根据查询的方向固定显示
 
     selectList.value = [
         {

+ 38 - 0
src/constants/bank.ts

@@ -1,3 +1,9 @@
+import { useEnumStore } from '@/stores'
+
+const { getEnumTypes, getEnumTypeList, getEnumTypeName } = useEnumStore()
+const enumKeys = ['applystatus', 'executetype'] as const
+const enumMap = getEnumTypes(...enumKeys)
+
 /**
  * 签约状态
  */
@@ -8,4 +14,36 @@ export enum SignStatus {
     Signed = 4,  // 已签约
     Rescinded = 7,  // 已解约
     Refuse = 10, // 审核拒绝
+}
+
+/**
+ * 获取出入金申请状态列表
+ * @returns 
+ */
+export function getApplyStatusList() {
+    return getEnumTypeList(enumMap.get('applystatus'))
+}
+
+/**
+ * 获取出入金申请状态名称
+ * @returns 
+ */
+export function getApplyStatusName(value: number) {
+    return getEnumTypeName(getApplyStatusList(), value)
+}
+
+/**
+ * 获取出入金申请类型列表
+ * @returns 
+ */
+export function getExecuteTypeList() {
+    return getEnumTypeList(enumMap.get('executetype'))
+}
+
+/**
+ * 获取出入金申请类型名称
+ * @returns 
+ */
+export function getExecuteTypeName(value: number) {
+    return getEnumTypeName(getExecuteTypeList(), value)
 }

+ 19 - 3
src/constants/order.ts

@@ -2,7 +2,7 @@ import { useEnumStore } from '@/stores'
 import { usePerformanceStore } from '@/stores'
 
 const { getEnumTypes, getEnumTypeList, getEnumTypeName } = useEnumStore()
-const enumKeys = ['wrApplyStatus', 'performanceStatus'] as const
+const enumKeys = ['wrApplyStatus', 'performanceStatus', 'stepStatus'] as const
 const enumMap = getEnumTypes(...enumKeys)
 
 /**
@@ -86,7 +86,7 @@ export enum StepType {
 }
 
 /**
- * 获取履约步骤列表
+ * 获取履约步骤类型列表
  * @returns 
  */
 export function getStepTypeList() {
@@ -98,9 +98,25 @@ export function getStepTypeList() {
 }
 
 /**
- * 获取履约步骤名称
+ * 获取履约步骤类型名称
  * @returns 
  */
 export function getStepTypeName(value: number) {
     return getEnumTypeName(getStepTypeList(), value)
+}
+
+/**
+ * 获取履约步骤状态列表
+ * @returns 
+ */
+export function getStepStatusList() {
+    return getEnumTypeList(enumMap.get('stepStatus'))
+}
+
+/**
+ * 获取履约步骤状态名称
+ * @returns 
+ */
+export function getStepStatusName(value: number) {
+    return getEnumTypeName(getStepStatusList(), value)
 }

+ 17 - 4
src/filters/index.ts

@@ -1,3 +1,5 @@
+import moment from 'moment'
+
 /**
  * 处理价格颜色的显示
  */
@@ -45,16 +47,17 @@ export function handleNumberValue(value: number, suffix = '') {
  * @returns 
  */
 export function formatDecimal(value: number, decimal = 2, round = true) {
+    const val = Number(value)
     if (decimal <= 0) {
         if (round) {
-            return Math.round(value).toString()
+            return Math.round(val).toString()
         }
-        return Math.trunc(value).toString()
+        return Math.trunc(val).toString()
     } else {
         if (round) {
-            return value.toFixed(decimal)
+            return val.toFixed(decimal)
         }
-        let num = value.toString()
+        let num = val.toString()
         const index = num.indexOf('.')
         if (index < 0) {
             // 小数位自动补零
@@ -80,4 +83,14 @@ export function formatAmount(value: number, decimal = 2) {
     const result = value.toFixed(decimal).toString().split('.')
     result[0] = result[0].replace(reg, '$1,')
     return result.join('.')
+}
+
+/**
+ * 日期格式化
+ * @param date 
+ * @param format 
+ * @returns 
+ */
+export function formatDate(date: string, format = 'YYYY-MM-DD HH:mm:ss') {
+    return moment(date).format(format)
 }

+ 9 - 0
src/packages/pc/views/bargain/buy/index.vue

@@ -6,6 +6,14 @@
         </template>
         <!-- 表格数据 -->
         <app-table :data="dataList" v-model:columns="columns" :loading="loading">
+            <!-- 克拉单价 -->
+            <template #priceper="{ row }">
+                {{ row.zscurrencytypedisplayunit + formatDecimal(row.priceper) }}
+            </template>
+            <!-- 我的出价 -->
+            <template #applyprice="{ row }">
+                {{ row.zscurrencytypedisplayunit + formatDecimal(row.applyprice) }}
+            </template>
             <!-- 申请状态 -->
             <template #applystatus="{ value }">
                 {{ getApplyStatusName(value) }}
@@ -25,6 +33,7 @@
 
 <script lang="ts" setup>
 import { ElMessage } from 'element-plus'
+import { formatDecimal } from '@/filters'
 import { useBuyBargain } from '@/business/bargain'
 import { getApplyStatusName, ApplyStatus } from '@/constants/order'
 import AppTable from '@pc/components/base/table/index.vue'

+ 5 - 0
src/packages/pc/views/bargain/sell/index.vue

@@ -6,6 +6,10 @@
         </template>
         <!-- 表格数据 -->
         <app-table :data="dataList" v-model:columns="columns" :loading="loading">
+            <!-- 卖方出价 -->
+            <template #applyprice="{ row }">
+                {{ row.zscurrencytypedisplayunit + formatDecimal(row.applyprice) }}
+            </template>
             <!-- 申请状态 -->
             <template #applystatus="{ value }">
                 {{ getApplyStatusName(value) }}
@@ -25,6 +29,7 @@
 
 <script lang="ts" setup>
 import { ElMessage } from 'element-plus'
+import { formatDecimal } from '@/filters'
 import { useSellBargain } from '@/business/bargain'
 import { getApplyStatusName, ApplyStatus } from '@/constants/order'
 import AppTable from '@pc/components/base/table/index.vue'

+ 11 - 2
src/packages/pc/views/favorite/main/index.vue

@@ -4,7 +4,15 @@
         <template #header>
             <app-filter v-bind="{ selectList,  buttonList }" />
         </template>
-        <app-table :data="dataList" v-model:columns="columns">
+        <app-table :data="dataList" v-model:columns="columns" :loading="loading">
+            <!-- 我的出价 -->
+            <template #price="{ row }">
+                {{ row.zscurrencytypedisplayunit + formatDecimal(row.price) }}
+            </template>
+            <!-- 克拉单价 -->
+            <template #priceper="{ row }">
+                {{ row.zscurrencytypedisplayunit + formatDecimal(row.priceper) }}
+            </template>
             <!-- 操作 -->
             <template #operate="{ row }">
                 <app-auth-operation :options="{ selectedRow: row }" @closed="getFavoriteList" />
@@ -17,11 +25,12 @@
 </template>
 
 <script lang="ts" setup>
+import { formatDecimal } from '@/filters'
 import { useFavorite } from '@/business/favorite'
 import AppAuthOperation from '@pc/components/modules/auth-operation/index.vue'
 import AppTable from '@pc/components/base/table/index.vue'
 import AppPagination from '@pc/components/base/pagination/index.vue'
 import AppFilter from '@pc/components/base/table-filter/index.vue'
 
-const { dataList, columns, total, pageIndex, pageSize, selectList, buttonList, getFavoriteList } = useFavorite()
+const { loading, dataList, columns, total, pageIndex, pageSize, selectList, buttonList, getFavoriteList } = useFavorite()
 </script>

+ 102 - 10
src/packages/pc/views/home/main/index.vue

@@ -1,31 +1,123 @@
 <template>
     <app-view class="home-main">
         <div class="home-main__card">
-            <el-card>
-                <h2>1</h2>
+            <el-card @click="routerTo('trade_sell')">
+                <h2>{{ countData.transactionsonsale }}</h2>
                 <p>出售中的交易</p>
             </el-card>
-            <el-card>
-                <h2>2</h2>
+            <el-card @click="routerTo('trade_buy')">
+                <h2>{{ countData.transactioninpurchase }}</h2>
                 <p>求购中的交易</p>
             </el-card>
-            <el-card>
-                <h2>3</h2>
+            <el-card @click="routerTo('trade_delisting', { buyorsell: BuyOrSell.Buy })">
+                <h2>{{ countData.purchasedtransactions }}</h2>
                 <p>已购买的交易</p>
             </el-card>
-            <el-card>
-                <h2>4</h2>
+            <el-card @click="routerTo('trade_delisting', { buyorsell: BuyOrSell.Sell })">
+                <h2>{{ countData.transactionssold }}</h2>
                 <p>已卖出的交易</p>
             </el-card>
-            <el-card>
-                <h2>5</h2>
+            <el-card @click="routerTo('trade_bargain')">
+                <h2>{{ countData.unhandledmessage }}</h2>
                 <p>未处理消息</p>
             </el-card>
         </div>
+        <div class="home-main__card" style="margin-top:20px">
+            <el-card shadow="never">
+                <template #header>
+                    <span>最近成交</span>
+                </template>
+                <el-tabs v-model="orderTab" @tab-change="orderTabChange">
+                    <el-tab-pane label="购买" name="buy" />
+                    <el-tab-pane label="销售" name="sell" />
+                </el-tabs>
+                <ul>
+                    <li v-for="(item,index) in deListingList" :key="index">
+                        <span>{{ item.zscategorydisplay }}</span>
+                        <span>{{ item.goodsno }}</span>
+                        <span>{{ item.matchusername }}</span>
+                        <span>{{ item.tradetime}}</span>
+                    </li>
+                </ul>
+            </el-card>
+            <el-card shadow="never">
+                <template #header>
+                    <span>我的收藏</span>
+                </template>
+                <ul>
+                    <li v-for="(item,index) in favoriteList" :key="index">
+                        <span>{{ item.zscategorydisplay }}</span>
+                        <span>{{ item.goodsno }}</span>
+                        <span>{{ item.accountname }}</span>
+                    </li>
+                </ul>
+            </el-card>
+            <el-card shadow="never">
+                <template #header>
+                    <span>系统公告</span>
+                </template>
+                <el-tabs v-model="noticeTab">
+                    <el-tab-pane label="公告" name="notice" />
+                    <el-tab-pane label="消息" name="message" />
+                </el-tabs>
+                <ul>
+                    <li v-for="(item,index) in notices" :key="index">
+                        <span>{{ formatDate(item.createtime) }}</span>
+                        <span>{{ item.title }}</span>
+                    </li>
+                </ul>
+            </el-card>
+        </div>
     </app-view>
 </template>
 
 <script lang="ts" setup>
+import { shallowRef, computed } from 'vue'
+import { useRouter, RouteParamsRaw } from 'vue-router'
+import { useHomeData } from '@/business/home'
+import { BuyOrSell } from '@/constants/order'
+import { formatDate } from '@/filters'
+
+const { countData, deListingList, favoriteList, noticeList, getCountData, getDeListingList, getNoticeList, } = useHomeData()
+const router = useRouter()
+const orderTab = shallowRef('buy')
+const noticeTab = shallowRef('notice')
+
+const notices = computed(() => {
+    switch (noticeTab.value) {
+        case 'notice': {
+            return noticeList.value.filter((e) => e.msgtype === 1).slice(0, 5)
+        }
+        case 'message': {
+            return noticeList.value.filter((e) => e.msgtype === 2).slice(0, 5)
+        }
+        default: {
+            return []
+        }
+    }
+})
+
+const orderTabChange = (tab: string) => {
+    switch (tab) {
+        case 'buy': {
+            getDeListingList(BuyOrSell.Buy)
+            break;
+        }
+        case 'sell': {
+            getDeListingList(BuyOrSell.Sell)
+            break;
+        }
+    }
+}
+
+// 路由跳转
+const routerTo = (name: string, params?: RouteParamsRaw) => {
+    router.push({ name, params })
+}
+
+getCountData()
+getNoticeList()
+orderTabChange(orderTab.value)
 </script>
 
 <style lang="less" scoped>

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

@@ -1,4 +1,4 @@
-<!-- 我的仓储-我的地址 -->
+<!-- 会员中心-我的地址 -->
 <template>
     <app-view>
         <app-table :data="dataList" v-model:columns="columns" :loading="loading">

+ 10 - 0
src/packages/pc/views/mine/bank/index.vue

@@ -1,3 +1,4 @@
+<!-- 会员中心-我的出入金 -->
 <template>
     <app-view>
         <template #header>
@@ -7,6 +8,14 @@
             <template #header>
                 <app-auth-operation :menus="['deposit', 'withdraw']" @closed="getAccountInOutApply" />
             </template>
+            <!-- 申请状态 -->
+            <template #applystatus="{ value }">
+                {{ getApplyStatusName(value) }}
+            </template>
+            <!-- 申请类型 -->
+            <template #executetype="{ value }">
+                {{ getExecuteTypeName(value) }}
+            </template>
             <!-- 操作 -->
             <template #operate="{ row }">
                 <app-auth-operation :menus="['cancel']" :options="{ selectedRow: row }"
@@ -19,6 +28,7 @@
 <script lang="ts" setup>
 import { ElMessage } from 'element-plus'
 import { useAccountInOut } from '@/business/bank'
+import { getApplyStatusName, getExecuteTypeName } from '@/constants/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'

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

@@ -1,4 +1,4 @@
-<!-- 我的仓储-我的发票 -->
+<!-- 会员中心-我的发票 -->
 <template>
     <app-view>
         <app-table :data="dataList" v-model:columns="columns" :loading="loading">

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

@@ -1,3 +1,4 @@
+<!-- 会员中心-会员信息 -->
 <template>
     <app-view>
         <el-descriptions title="会员信息" :column="2" style="padding:20px">

+ 43 - 8
src/packages/pc/views/order/main/components/details/index.vue

@@ -12,31 +12,66 @@
                 <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.accountname }}</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.buytodayamount }}</el-descriptions-item>
+                <el-descriptions-item label="卖方今日收款">{{ selectedRow.selltodayamount }}</el-descriptions-item>
                 <el-descriptions-item label="买方联络信息">{{ selectedRow.buyerinfo }}</el-descriptions-item>
                 <el-descriptions-item label="卖方联络信息">{{ selectedRow.sellerinfo }}</el-descriptions-item>
             </el-descriptions>
+            <app-table :data="dataList" :columns="columns" :show-header="false" :row-style="rowStyle">
+                <!-- 步骤值 -->
+                <template #stepvalue="{ value }">
+                    {{ (value * 100).toFixed(1) }}
+                </template>
+                <template #isauto="{ value }">
+                    {{ value ? '是' : '否'}}
+                </template>
+                <!-- 启动类型 -->
+                <template #steplanchtype="{ value }">
+                    {{ value === 1 ? '系统自动' : '手动' }}
+                </template>
+                <!-- 步骤状态 -->
+                <template #stepstatus="{ value }">
+                    {{ getStepStatusName(value) }}
+                </template>
+            </app-table>
         </app-view>
     </teleport>
 </template>
 
 <script lang="ts" setup>
-import { PropType } from 'vue'
+import { PropType, computed } from 'vue'
+import { getStepStatusName } from '@/constants/order'
+import { usePerformancePlanStep } from '@/business/order'
+import AppTable from '@pc/components/base/table/index.vue'
 
-defineProps({
+const props = defineProps({
     code: String,
     selectedRow: {
         type: Object as PropType<Ermcp.MyPerformancRsp>,
         default: () => ({})
     }
 })
+
+const { dataList, columns, getPlanStepList } = usePerformancePlanStep(props.selectedRow.performanceplanid)
+const currentStepIndex = computed(() => dataList.value.findIndex((e) => e.performancestepid === props.selectedRow.curstepid)) // 当前步骤索引位置
+
+const rowStyle = ({ row, rowIndex }: { row: Ermcp.WrPerformancePlanStepRsp, rowIndex: number }) => {
+    if (currentStepIndex.value > rowIndex) {
+        return {
+            color: 'green'
+        }
+    }
+    if (currentStepIndex.value === rowIndex) {
+        return {
+            color: 'red'
+        }
+    }
+}
+
+getPlanStepList()
 </script>

+ 10 - 0
src/packages/pc/views/search/diamond/index.vue

@@ -51,6 +51,15 @@
             </el-form>
         </template>
         <app-table :data="dataList" v-model:columns="columns" :show-header="false" :loading="loading">
+            <!-- 价格 -->
+            <template #price="{ row }">
+                {{ row.zscurrencytypedisplayunit + formatDecimal(row.price) }}
+            </template>
+            <!-- 克拉单价 -->
+            <template #fixedprice="{ row }">
+                {{ row.zscurrencytypedisplayunit + formatDecimal(row.fixedprice) }}
+            </template>
+            <!-- 操作 -->
             <template #operate="{ row }">
                 <app-auth-operation :menus="handleTableButtons(row)" :options="{ selectedRow: row }"
                     @closed="getSellOrderList" />
@@ -67,6 +76,7 @@
 import { ref } from 'vue'
 import { ElMessage } from 'element-plus'
 import type { FormInstance, FormRules } from 'element-plus'
+import { formatDecimal } from '@/filters'
 import { useLoginStore, useFavoriteStore } from '@/stores'
 import { useSearch } from '@/business/search'
 import { Category } from '@/constants/diamond'

+ 10 - 0
src/packages/pc/views/search/fancy/index.vue

@@ -48,6 +48,15 @@
             </el-form>
         </template>
         <app-table :data="dataList" v-model:columns="columns" :show-header="false" :loading="loading">
+            <!-- 价格 -->
+            <template #price="{ row }">
+                {{ row.zscurrencytypedisplayunit + formatDecimal(row.price) }}
+            </template>
+            <!-- 克拉单价 -->
+            <template #fixedprice="{ row }">
+                {{ row.zscurrencytypedisplayunit + formatDecimal(row.fixedprice) }}
+            </template>
+            <!-- 操作 -->
             <template #operate="{ row }">
                 <app-auth-operation :menus="handleTableButtons(row)" :options="{ selectedRow: row }"
                     @closed="getSellOrderList" />
@@ -63,6 +72,7 @@
 <script lang="ts" setup>
 import { ref } from 'vue'
 import type { FormInstance, FormRules } from 'element-plus'
+import { formatDecimal } from '@/filters'
 import { useLoginStore, useFavoriteStore } from '@/stores'
 import { useSearch } from '@/business/search'
 import { Category } from '@/constants/diamond'

+ 19 - 0
src/packages/pc/views/search/jewelry/components/compare/index.less

@@ -0,0 +1,19 @@
+.search-compare {
+    border      : solid #ccc;
+    border-width: 0 0 1px 1px;
+
+    th,
+    td {
+        border      : solid #ccc;
+        border-width: 1px 1px 0 0;
+        padding     : 5px 15px;
+    }
+
+    th {
+        text-align: left;
+    }
+
+    td {
+        text-align: center;
+    }
+}

+ 154 - 0
src/packages/pc/views/search/jewelry/components/compare/index.vue

@@ -0,0 +1,154 @@
+<!-- 钻石首饰-对比 -->
+<template>
+    <app-drawer title="对比" v-model:show="show">
+        <table class="search-compare" cellspacing="0" cellpadding="0">
+            <tbody>
+                <tr>
+                    <td></td>
+                    <td v-for="(item,index) in checkedItems" :key="index">
+                        {{ item.goodsno }}
+                    </td>
+                </tr>
+                <tr>
+                    <th colspan="5">基本信息</th>
+                </tr>
+                <tr>
+                    <td>重量</td>
+                    <td v-for="(item,index) in checkedItems" :key="index">
+                        {{ item.remainqty }}
+                    </td>
+                </tr>
+                <tr>
+                    <td>价格</td>
+                    <td v-for="(item,index) in checkedItems" :key="index">
+                        {{ item.zscurrencytypedisplayunit + item.price }}
+                    </td>
+                </tr>
+                <tr>
+                    <td>克拉单价</td>
+                    <td v-for="(item,index) in checkedItems" :key="index">
+                        {{ item.zscurrencytypedisplayunit + item.fixedprice }}
+                    </td>
+                </tr>
+                <tr>
+                    <td>市场价</td>
+                    <td v-for="(item,index) in checkedItems" :key="index">
+                        {{ item.zscurrencytypedisplayunit + item.marketprice }}
+                    </td>
+                </tr>
+                <tr>
+                    <td>仓库</td>
+                    <td v-for="(item,index) in checkedItems" :key="index">
+                        {{ item.warehousenamedisplay }}
+                    </td>
+                </tr>
+                <tr>
+                    <td>卖家</td>
+                    <td v-for="(item,index) in checkedItems" :key="index">
+                        {{ item.sellusername }}
+                    </td>
+                </tr>
+                <tr>
+                    <td>款式</td>
+                    <td v-for="(item,index) in checkedItems" :key="index">
+                        {{ item.zsstyletypedisplay }}
+                    </td>
+                </tr>
+                <tr>
+                    <th colspan="5">钻石属性</th>
+                </tr>
+                <tr>
+                    <td>形状</td>
+                    <td v-for="(item,index) in checkedItems" :key="index">
+                        {{ item.zsshapetypedisplay }}
+                    </td>
+                </tr>
+                <tr>
+                    <td>颜色</td>
+                    <td v-for="(item,index) in checkedItems" :key="index">
+                        {{ item.zscolortype1display }}
+                    </td>
+                </tr>
+                <tr>
+                    <td>净度</td>
+                    <td v-for="(item,index) in checkedItems" :key="index">
+                        {{ item.zsclaritytype1display }}
+                    </td>
+                </tr>
+                <tr>
+                    <td>切工</td>
+                    <td v-for="(item,index) in checkedItems" :key="index">
+                        {{ item.zscuttype1display }}
+                    </td>
+                </tr>
+                <tr>
+                    <td>对称度</td>
+                    <td v-for="(item,index) in checkedItems" :key="index">
+                        {{ item.zssymmetrytype1display }}
+                    </td>
+                </tr>
+                <tr>
+                    <td>抛光度</td>
+                    <td v-for="(item,index) in checkedItems" :key="index">
+                        {{ item.zspolishtype1display }}
+                    </td>
+                </tr>
+                <tr>
+                    <td>荧光</td>
+                    <td v-for="(item,index) in checkedItems" :key="index">
+                        {{ item.zsfluorescencetype1display }}
+                    </td>
+                </tr>
+                <tr>
+                    <td>尺寸</td>
+                    <td v-for="(item,index) in checkedItems" :key="index">
+                        {{ item.sizedisplay }}
+                    </td>
+                </tr>
+                <tr>
+                    <td>证书类型</td>
+                    <td v-for="(item,index) in checkedItems" :key="index">
+                        {{ item.zscerttypedisplay }}
+                    </td>
+                </tr>
+                <tr>
+                    <td>配石描述</td>
+                    <td v-for="(item,index) in checkedItems" :key="index">
+                        {{ item.stonedesc }}
+                    </td>
+                </tr>
+                <tr>
+                    <td>镶嵌材料</td>
+                    <td v-for="(item,index) in checkedItems" :key="index">
+                        {{ item.settingmaterial }}
+                    </td>
+                </tr>
+            </tbody>
+        </table>
+        <template #footer>
+            <el-button @click="onCancel" plain>关闭</el-button>
+        </template>
+    </app-drawer>
+</template>
+
+<script lang="ts" setup>
+import { shallowRef, PropType } from 'vue'
+import AppDrawer from '@pc/components/base/drawer/index.vue'
+
+defineProps({
+    checkedItems: {
+        type: Object as PropType<Ermcp.SellOrderSearchRsp[]>,
+        required: true
+    }
+})
+
+const show = shallowRef(true)
+
+const onCancel = () => {
+    show.value = false
+}
+</script>
+
+<style lang="less" scoped>
+@import './index.less';
+</style>

+ 21 - 9
src/packages/pc/views/search/jewelry/index.vue

@@ -37,13 +37,15 @@
         <div class="search-jewelry__list" v-if="dataList.length">
             <template v-for="(item,index) in dataList" :key="index">
                 <el-card shadow="hover">
-                    <h4 @click="openComponent('details')">{{item.goodsno}}</h4>
-                    <p>{{item.zsstyletypedisplay}}</p>
+                    <div @click="openDetails(item)">
+                        <h4>{{item.goodsno}}</h4>
+                        <p>{{item.zsstyletypedisplay}}</p>
+                    </div>
                     <el-checkbox v-model="item.checked" label="对比" @change="selectItem(index)" />
                 </el-card>
             </template>
         </div>
-        <div class="search-jewelry__comparebar" v-if="checkedItems.length">
+        <div class="search-jewelry__comparebar" v-if="checkedItems.length > 1">
             <div>对比栏</div>
             <ul>
                 <li v-for="(item,index) in checkedItems" :key="index">
@@ -52,29 +54,39 @@
                     <span>{{item.zsstyletypedisplay}}</span>
                 </li>
                 <li>
-                    <el-button>对比</el-button>
+                    <el-button @click="openComponent('compare')">对比</el-button>
                 </li>
             </ul>
         </div>
+        <component :is="componentMap.get(componentId)" v-bind="{ selectedRow, checkedItems }" @closed="closeComponent"
+            v-if="componentId" />
     </app-view>
 </template>
 
 <script lang="ts" setup>
-import { ref } from 'vue'
+import { ref, defineAsyncComponent } from 'vue'
 import { ElMessage } from 'element-plus'
 import type { FormInstance, FormRules } from 'element-plus'
 import { useSearch } from '@/business/search'
 import { Category } from '@/constants/diamond'
+import { useComponent } from '@/hooks/component'
 import AppMultiple from '@pc/components/base/multiple/index.vue'
 
+const componentMap = new Map<string, unknown>([
+    ['details', defineAsyncComponent(() => import('@pc/views/warehousing/goods/components/details/index.vue'))], // 详情
+    ['compare', defineAsyncComponent(() => import('./components/compare/index.vue'))], // 对比
+])
+
+const { componentId, openComponent, closeComponent } = useComponent()
 const { loading, dataList, checkedItems, formData, enums, selectItem, getSellOrderList, onSearch, onReset } = useSearch(Category.Jewelry)
+const selectedRow = ref<Ermcp.SellOrderSearchRsp>() // 当前选中的数据项
 const formRef = ref<FormInstance>()
 const formRules: FormRules = {}
-const componentId = ref<string>()
 
-const openComponent = (code: string) => {
-    componentId.value = code
-    console.log('打开详情')
+// 打开详情
+const openDetails = (item: Ermcp.SellOrderSearchRsp) => {
+    selectedRow.value = item
+    openComponent('details')
 }
 
 getSellOrderList().catch((err) => ElMessage.error(err))

+ 9 - 0
src/packages/pc/views/trade/bargain/index.vue

@@ -10,6 +10,14 @@
             <template #applystatus="{ value }">
                 {{ getApplyStatusName(value) }}
             </template>
+            <!-- 克拉单价 -->
+            <template #priceper="{ row }">
+                {{ row.zscurrencytypedisplayunit + formatDecimal(row.priceper) }}
+            </template>
+            <!-- 我的出价 -->
+            <template #applyprice="{ row }">
+                {{ row.zscurrencytypedisplayunit + formatDecimal(row.applyprice) }}
+            </template>
             <!-- 操作 -->
             <template #operate="{ row }">
                 <app-auth-operation :menus="handleTableButtons(row)" :options="{ selectedRow: row }"
@@ -25,6 +33,7 @@
 
 <script lang="ts" setup>
 import { ElMessage } from 'element-plus'
+import { formatDecimal } from '@/filters'
 import { useBargain } from '@/business/bargain'
 import { getApplyStatusName, ApplyStatus } from '@/constants/order'
 import AppTable from '@pc/components/base/table/index.vue'

+ 18 - 1
src/packages/pc/views/trade/delisting/index.vue

@@ -15,6 +15,14 @@
             <template #buyorsell>
                 {{ getBuyOrSellName(buyOrSell) }}
             </template>
+            <!-- 价格 -->
+            <template #price="{ row }">
+                {{ row.zscurrencytypedisplayunit + formatDecimal(row.price) }}
+            </template>
+            <!-- 成交价格 -->
+            <template #tradeprice="{ row }">
+                {{ row.zscurrencytypedisplayunit + formatDecimal(row.tradeprice) }}
+            </template>
             <!-- 操作 -->
             <template #operate="{ row }">
                 <app-auth-operation :menus="['details']" :options="{ selectedRow: row, buyorsell: buyOrSell }"
@@ -29,7 +37,9 @@
 </template>
 
 <script lang="ts" setup>
+import { useRoute } from 'vue-router'
 import { ElMessage } from 'element-plus'
+import { formatDecimal } from '@/filters'
 import { getBuyOrSellName } from '@/constants/order'
 import { useDelistingOrder } from '@/business/trade/list'
 import AppTable from '@pc/components/base/table/index.vue'
@@ -37,7 +47,14 @@ import AppPagination from '@pc/components/base/pagination/index.vue'
 import AppAuthOperation from '@pc/components/modules/auth-operation/index.vue'
 import AppFilter from '@pc/components/base/table-filter/index.vue'
 
-const { loading, dataList, total, pageIndex, pageSize, buyOrSell, columns, filterDate, selectList, inputList, buttonList, getDelistingOrderList } = useDelistingOrder()
+const { params } = useRoute()
+
+const buyorsell = (() => {
+    const result = Number(params.buyorsell)
+    return isNaN(result) ? undefined : result
+})()
+
+const { loading, dataList, total, pageIndex, pageSize, buyOrSell, columns, filterDate, selectList, inputList, buttonList, getDelistingOrderList } = useDelistingOrder(buyorsell)
 
 getDelistingOrderList().catch((err) => ElMessage.error(err))
 </script>

+ 9 - 0
src/packages/pc/views/trade/sale/index.vue

@@ -16,6 +16,14 @@
             <template #header>
                 <app-auth-operation :menus="['add']" @closed="getSaleOrderList" />
             </template>
+            <!-- 价格 -->
+            <template #price="{ row }">
+                {{ row.zscurrencytypedisplayunit + formatDecimal(row.price) }}
+            </template>
+            <!-- 克拉单价 -->
+            <template #fixedprice="{ row }">
+                {{ row.zscurrencytypedisplayunit + formatDecimal(row.fixedprice) }}
+            </template>
             <!-- 操作 -->
             <template #operate="{ row }">
                 <app-auth-operation :menus="handleTableButtons(row)" :options="{ selectedRow: row }"
@@ -31,6 +39,7 @@
 
 <script lang="ts" setup>
 import { ElMessage } from 'element-plus'
+import { formatDecimal } from '@/filters'
 import { useSaleOrder } from '@/business/trade/list'
 import AppTable from '@pc/components/base/table/index.vue'
 import AppPagination from '@pc/components/base/pagination/index.vue'

+ 9 - 0
src/packages/pc/views/trade/sell/index.vue

@@ -6,6 +6,14 @@
         </template>
         <!-- 表格数据 -->
         <app-table :data="dataList" v-model:columns="columns" :loading="loading">
+            <!-- 价格 -->
+            <template #price="{ row }">
+                {{ row.zscurrencytypedisplayunit + formatDecimal(row.price) }}
+            </template>
+            <!-- 克拉单价 -->
+            <template #fixedprice="{ row }">
+                {{ row.zscurrencytypedisplayunit + formatDecimal(row.fixedprice) }}
+            </template>
             <!-- 操作 -->
             <template #operate="{ row }">
                 <app-auth-operation :menus="handleTableButtons(row)" :options="{ selectedRow: row }"
@@ -21,6 +29,7 @@
 
 <script lang="ts" setup>
 import { ElMessage } from 'element-plus'
+import { formatDecimal } from '@/filters'
 import { useLoginStore, useFavoriteStore } from '@/stores'
 import { useSellOrder } from '@/business/trade/list'
 import AppAuthOperation from '@pc/components/modules/auth-operation/index.vue'

+ 9 - 0
src/packages/pc/views/warehousing/goods/index.vue

@@ -9,6 +9,14 @@
             <template #header>
                 <app-auth-operation :menus="headerButtons" @closed="getDiamondList" />
             </template>
+            <!-- 价格 -->
+            <template #price="{ row }">
+                {{ row.zscurrencytypedisplayunit + formatDecimal(row.price) }}
+            </template>
+            <!-- 克拉单价 -->
+            <template #priceper="{ row }">
+                {{ row.zscurrencytypedisplayunit + formatDecimal(row.priceper) }}
+            </template>
             <!-- 颜色 -->
             <template #zscolortype="{ row }">
                 {{ [row.zscolortype1display, row.zscolortype2display].join('-') }}
@@ -36,6 +44,7 @@
 
 <script lang="ts" setup>
 import { ElMessage } from 'element-plus'
+import { formatDecimal } from '@/filters'
 import { useDiamond } from '@/business/goods'
 import AppTable from '@pc/components/base/table/index.vue'
 import AppPagination from '@pc/components/base/pagination/index.vue'

+ 7 - 0
src/services/api/common/index.ts

@@ -2,6 +2,13 @@ import { httpRequest } from '@/services/http'
 import { HttpRequest } from '@/services/http/interface'
 
 /**
+ * 首页统计数据
+ */
+export function homeData(params: HttpRequest<{ req: Ermcp.HomeDataReq, rsp: Ermcp.HomeDataRsp }>) {
+    return httpRequest('/Guangzuan/HomeData', 'get', params);
+}
+
+/**
  * 获取服务器时间
  */
 export function getServerTime(params: HttpRequest<{ rsp: string }>) {

+ 0 - 39
src/services/api/order/index.ts

@@ -1,39 +0,0 @@
-import { httpRequest } from '@/services/http'
-import { HttpRequest } from '@/services/http/interface'
-import { tradeServerRequest } from '@/services/socket/trade'
-import { TradeRequest } from '@/services/socket/trade/interface'
-
-/**
- * 履约违约申请
- */
-export function performanceContractedApply(params: TradeRequest<Proto.PerformanceContractedApplyReq, Proto.PerformanceContractedApplyRsp>) {
-    return tradeServerRequest('PerformanceContractedApplyReq', 'PerformanceContractedApplyRsp', params);
-}
-
-/**
- * 履约延期申请
- */
-export function performanceDelayApply(params: TradeRequest<Proto.PerformanceDelayApplyReq, Proto.PerformanceDelayApplyRsp>) {
-    return tradeServerRequest('PerformanceDelayApplyReq', 'PerformanceDelayApplyRsp', params);
-}
-
-/**
- * 履约手动申请
- */
-export function performanceManualConfirm(params: TradeRequest<Proto.PerformanceManualConfirmReq, Proto.PerformanceManualConfirmRsp>) {
-    return tradeServerRequest('PerformanceManualConfirmReq', 'PerformanceManualConfirmRsp', params);
-}
-
-/**
- * 履约修改联络信息
- */
-export function performanceModifyContact(params: TradeRequest<Proto.PerformanceModifyContactReq, Proto.PerformanceModifyContactRsp>) {
-    return tradeServerRequest('PerformanceModifyContactReq', 'PerformanceModifyContactRsp', params);
-}
-
-/**
- * 查询我的履约
- */
-export function queryMyPerformance(params: HttpRequest<{ req: Ermcp.MyPerformancReq, rsp: Ermcp.MyPerformancRsp[] }>) {
-    return httpRequest('/Guangzuan/QueryMyPerformanc', 'get', params);
-}

+ 44 - 0
src/services/api/performance/index.ts

@@ -1,5 +1,42 @@
 import { httpRequest } from '@/services/http'
 import { HttpRequest } from '@/services/http/interface'
+import { tradeServerRequest } from '@/services/socket/trade'
+import { TradeRequest } from '@/services/socket/trade/interface'
+
+/**
+ * 履约违约申请
+ */
+export function performanceContractedApply(params: TradeRequest<Proto.PerformanceContractedApplyReq, Proto.PerformanceContractedApplyRsp>) {
+    return tradeServerRequest('PerformanceContractedApplyReq', 'PerformanceContractedApplyRsp', params);
+}
+
+/**
+ * 履约延期申请
+ */
+export function performanceDelayApply(params: TradeRequest<Proto.PerformanceDelayApplyReq, Proto.PerformanceDelayApplyRsp>) {
+    return tradeServerRequest('PerformanceDelayApplyReq', 'PerformanceDelayApplyRsp', params);
+}
+
+/**
+ * 履约手动申请
+ */
+export function performanceManualConfirm(params: TradeRequest<Proto.PerformanceManualConfirmReq, Proto.PerformanceManualConfirmRsp>) {
+    return tradeServerRequest('PerformanceManualConfirmReq', 'PerformanceManualConfirmRsp', params);
+}
+
+/**
+ * 履约修改联络信息
+ */
+export function performanceModifyContact(params: TradeRequest<Proto.PerformanceModifyContactReq, Proto.PerformanceModifyContactRsp>) {
+    return tradeServerRequest('PerformanceModifyContactReq', 'PerformanceModifyContactRsp', params);
+}
+
+/**
+ * 查询我的履约
+ */
+export function queryMyPerformance(params: HttpRequest<{ req: Ermcp.MyPerformancReq, rsp: Ermcp.MyPerformancRsp[] }>) {
+    return httpRequest('/Guangzuan/QueryMyPerformanc', 'get', params);
+}
 
 /**
  * 查询履约模板
@@ -13,4 +50,11 @@ export function queryPermancePlanTmp(params: HttpRequest<{ req: Ermcp.PermancePl
  */
 export function queryWrPerformanceStepType(params: HttpRequest<{ rsp: Ermcp.WrPerformanceStepTypeRsp[] }>) {
     return httpRequest('/WrTrade2/QueryWrPerformanceStepType', 'get', params);
+}
+
+/**
+ * 查询履约信息详情
+ */
+export function queryWrPerformancePlanStep(params: HttpRequest<{ req: Ermcp.WrPerformancePlanStepReq, rsp: Ermcp.WrPerformancePlanStepRsp[] }>) {
+    return httpRequest('/WrTrade2/QueryWrPerformancePlanStep', 'get', params);
 }

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

@@ -77,7 +77,7 @@ export function queryMyBuyOrder(params: HttpRequest<{ req: Ermcp.MyBuyOrderReq,
 /**
  * 搜索出售大厅委托单
  */
-export function searchSellOrder(params: HttpRequest<{ req: Ermcp.SellOrderSearchReq, rsp: Ermcp.SellOrderRsp[] }>) {
+export function searchSellOrder(params: HttpRequest<{ req: Ermcp.SellOrderSearchReq, rsp: Ermcp.SellOrderSearchRsp[] }>) {
     return httpRequest('/Guangzuan/QueryDiamond', 'post', params);
 }
 

+ 4 - 4
src/services/http/index.ts

@@ -1,7 +1,7 @@
 import axios, { AxiosRequestConfig, Method } from 'axios'
 //import qs from 'qs'
 //import cryptojs from 'crypto-js'
-import { addPending, removePending } from './pending'
+//import { addPending, removePending } from './pending'
 import { useLoginStore } from '@/stores'
 import { HttpRequest, HttpResponse, ResultCode } from './interface'
 import service from '@/services'
@@ -16,8 +16,8 @@ const http = axios.create({
 http.interceptors.request.use(
     (config) => {
         const { getToken } = useLoginStore();
-        removePending(config); //在请求开始前,对之前的请求做检查取消操作
-        addPending(config); //将当前请求添加到列表中
+        //removePending(config); //在请求开始前,对之前的请求做检查取消操作
+        //addPending(config); //将当前请求添加到列表中
 
         //请求头签名
         const sign = {
@@ -47,7 +47,7 @@ http.interceptors.request.use(
  */
 http.interceptors.response.use(
     (res) => {
-        removePending(res); //在请求结束后,移除本次请求
+        //removePending(res); //在请求结束后,移除本次请求
         return res;
     },
     (err) => {

+ 147 - 0
src/stores/@next.ts

@@ -0,0 +1,147 @@
+import { reactive, toRefs, UnwrapNestedRefs } from 'vue'
+
+type Getters<T> = {
+    [key in keyof T]: () => unknown
+}
+
+interface Store<S extends object, G extends Getters<G>, A extends object, M extends object> {
+    state: UnwrapNestedRefs<S>;
+    getters: G;
+    actions: A;
+    methods: M;
+}
+
+/**
+ * 存储配置项
+ */
+interface StoreOptions<S extends object, G extends Getters<G>, A extends object, M extends object> {
+    state: () => S;
+    created?: (context: Store<S, G, A, M>) => void;
+    getters?: G & ThisType<Store<S, G, A, M>>;
+    actions?: A & ThisType<Store<S, G, A, M>>;
+    methods?: M & ThisType<Store<S, G, A, M>>;
+}
+
+/**
+ * 实例化存储对象
+ * @param options 
+ * @returns 
+ */
+export function createStore<S extends object, G extends Getters<G>, A extends object, M extends object>(options: StoreOptions<S, G, A, M>) {
+    const state = reactive(options.state())
+    const getters = options.getters
+    const actions = options.actions
+
+    const methods = {
+        $setData: (callback: (state: UnwrapNestedRefs<S>) => void) => {
+            callback(state)
+        },
+        $storeToRefs: () => {
+            return toRefs(state)
+        },
+        ...options.methods,
+    }
+
+    const store = {
+        state,
+        getters,
+        actions,
+        methods,
+    }
+
+    for (const p in actions) {
+        const fn = actions[p]
+        if (fn instanceof Function) {
+            actions[p] = fn.bind(store)
+        }
+    }
+
+    //options.created && options.created(store)
+
+    return {
+        state,
+        getters,
+        actions,
+        methods,
+    }
+}
+
+const store = createStore({
+    state() {
+        return {
+            id: 0,
+            userName: '李兔饼'
+        }
+    },
+    getters: {
+        getUserid() {
+            return 10086
+        }
+    },
+    actions: {
+        getAllEnumList(userid: number) {
+            this.state.id = userid
+            this.actions.hello()
+        },
+        hello() {
+            console.log('hello world')
+        }
+    },
+})
+
+store.actions?.getAllEnumList(10086)
+
+setTimeout(() => {
+    console.log(store.state)
+}, 2000);
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+interface DefineStoreOptions<S extends object, A extends object> {
+    state: () => S;
+    actions: {
+        [key in keyof A]: (context: S, ...args: never) => unknown
+    }
+}
+
+function defineStore<S extends object, A extends object>(options: DefineStoreOptions<S, A>) {
+    const actions = {} as { [key in keyof A]: <T extends unknown[]>(...args: T) => unknown }
+
+    for (const p in options.actions) {
+        actions[p] = (...args) => {
+            return options.actions[p](options.state(), args as never)
+        }
+    }
+
+    return {
+        actions
+    }
+}
+
+const dStore = defineStore({
+    state() {
+        return {
+            id: 0,
+            userName: '李兔饼'
+        }
+    },
+    actions: {
+        getAllEnumList(context, userid: number) {
+            //context.id = userid
+            return context
+        },
+    }
+})
+
+dStore.actions.getAllEnumList(10086)

+ 27 - 31
src/stores/modules/account.ts

@@ -1,10 +1,11 @@
-import { computed, toRefs, shallowRef, shallowReadonly } from 'vue'
+import { computed, toRefs, 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[]; // 资金账户列表
     accountId: number; // 当前资金账户ID
 }
@@ -15,6 +16,7 @@ interface StoreState {
 const store = new (class extends VueStore<StoreState> {
     constructor() {
         const state: StoreState = {
+            loading: false,
             accountList: [],
             accountId: 0,
         }
@@ -38,39 +40,33 @@ const store = new (class extends VueStore<StoreState> {
     actions = {
         /** 获取资金账户列表 */
         getAccountList: () => {
-            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
-                            }
+            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.accountId)
+                        if (account) {
+                            this.state.loading = false
                         } else {
-                            loading.value = false
-                            this.actions.reset()
+                            // 如果不存在,默认选中第一个账户
+                            this.state.accountId = dataList[0].accountid
                         }
-                    },
-                    fail: () => {
-                        loading.value = false
+                    } else {
+                        this.state.loading = false
+                        this.actions.reset()
                     }
-                })
-            }
-            return {
-                loading,
-                result: request()
-            }
+                },
+                fail: () => {
+                    this.state.loading = false
+                }
+            })
         },
         /** 重置数据 */
         reset: () => {

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

@@ -1,4 +1,4 @@
-import { toRefs, shallowRef, shallowReadonly, ShallowRef } from 'vue'
+import { toRefs, shallowReadonly, ShallowRef } from 'vue'
 import { queryAllEnums } from '@/services/api/common'
 import { VueStore } from '../base'
 import WebStorage from '@/utils/storage/base'
@@ -13,6 +13,7 @@ export interface EnumType {
 }
 
 interface StoreState {
+    loading: boolean;
     allEnums: ShallowRef<Ermcp.EnumRsp[]>;
 }
 
@@ -23,6 +24,7 @@ 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)
@@ -31,25 +33,18 @@ const store = new (class extends VueStore<StoreState>{
     actions = {
         /** 获取所有枚举列表 */
         getAllEnumList: () => {
-            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()
+            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
+                }
+            })
         },
         /** 获取枚举类型 */
         getEnumTypes: <T extends string[]>(...args: T) => {
@@ -72,21 +67,15 @@ const store = new (class extends VueStore<StoreState>{
         },
         /** 获取枚举列表 */
         getEnumTypeList: (enums?: Ermcp.EnumRsp[]) => {
-            if (enums) {
-                return enums.map((e) => ({
-                    label: e.enumdicname,
-                    value: e.enumitemname,
-                }))
-            }
-            return []
+            return enums?.map((e) => ({
+                label: e.enumdicname,
+                value: e.enumitemname,
+            })) ?? []
         },
         /** 根据枚举值获取枚举名称 */
         getEnumTypeName: (enums: EnumType[], value?: number) => {
             const item = enums.find((e) => e.value === value)
-            if (item) {
-                return item.label
-            }
-            return '--'
+            return item?.label ?? value
         }
     }
 })

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

@@ -1,9 +1,10 @@
-import { toRefs, shallowRef, shallowReadonly, ShallowRef } from 'vue'
+import { toRefs, 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[]>;
 }
 
@@ -14,6 +15,7 @@ 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)
@@ -22,25 +24,18 @@ const store = new (class extends VueStore<StoreState>{
     actions = {
         /** 获取系统错误信息 */
         getErrorInfoList: () => {
-            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()
+            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
+                }
+            })
         },
         /** 根据 code 获取错误信息 */
         getErrorInfoByCode: (code: number) => {

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

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

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

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

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

@@ -1,10 +1,11 @@
-import { toRefs, shallowRef, shallowReadonly, ShallowRef } from 'vue'
+import { toRefs, 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>;
 }
 
@@ -29,6 +30,7 @@ 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)
@@ -37,43 +39,37 @@ const store = new (class extends VueStore<StoreState> {
     actions = {
         /** 用户登录 */
         userLogin: (param: Proto.LoginReq) => {
-            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)
-                        }
-                    })
+            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)
+                    }
                 })
-            }
-            return {
-                loading,
-                result: request()
-            }
+            })
         },
         /** 获取用户登录信息 */
         getLoginInfo: <K extends keyof Proto.LoginRsp>(key: K) => {

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

@@ -1,10 +1,11 @@
-import { toRefs, shallowRef, shallowReadonly, ShallowRef } from 'vue'
+import { toRefs, 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[]>;
 }
 
@@ -12,6 +13,7 @@ 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)
@@ -20,61 +22,55 @@ const store = new (class extends VueStore<StoreState>{
     actions = {
         /** 获取用户菜单列表 */
         getUserMenuList: () => {
-            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)
+            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),
                                     }
-                                })
-                                return result
-                            }
-                            return getChildren(code)
+                                    result.push(item)
+                                }
+                            })
+                            return result
                         }
-                        this.state.userMenus = arrayToTree(res.data)
-                    },
-                    complete: () => {
-                        loading.value = false
+                        return getChildren(code)
                     }
-                })
-            }
-            return {
-                loading,
-                result: request()
-            }
+                    this.state.userMenus = arrayToTree(res.data)
+                },
+                complete: () => {
+                    this.state.loading = false
+                }
+            })
         },
         /** 重置数据 */
         reset: () => {

+ 26 - 43
src/stores/modules/performance.ts

@@ -1,22 +1,19 @@
-import { toRefs, shallowReadonly, ShallowRef, shallowRef } from 'vue'
+import { toRefs, shallowReadonly, ShallowRef } from 'vue'
 import { queryWrPerformanceStepType, queryPermancePlanTmp } from '@/services/api/performance'
 import { VueStore } from '../base'
 import WebStorage from '@/utils/storage'
 
 interface StoreState {
+    loading: boolean;
     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<StorageData>(sessionStorage, { performanceStepTypes: [], performanceTemplates: [] })
+        const storage = new WebStorage(sessionStorage, { performanceStepTypes: [], performanceTemplates: [] })
         const state: StoreState = {
+            loading: false,
             performanceStepTypes: storage.getRef('performanceStepTypes'),
             performanceTemplates: storage.getRef('performanceTemplates'),
         }
@@ -26,47 +23,33 @@ const store = new (class extends VueStore<StoreState>{
     actions = {
         /** 获取履约模板列表 */
         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
-                    }
-                })
-            }
-            return {
-                loading,
-                result: request()
+            if (this.state.performanceTemplates.length) {
+                return Promise.resolve()
             }
+            this.state.loading = true
+            return queryPermancePlanTmp({
+                success: (res) => {
+                    this.state.performanceTemplates = res.data
+                },
+                complete: () => {
+                    this.state.loading = false
+                }
+            })
         },
         /** 获取履约步骤枚举列表 */
         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()
+            if (this.state.performanceStepTypes.length) {
+                return Promise.resolve()
             }
+            this.state.loading = true
+            return queryWrPerformanceStepType({
+                success: (res) => {
+                    this.state.performanceStepTypes = res.data
+                },
+                complete: () => {
+                    this.state.loading = true
+                }
+            })
         }
     }
 })

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

@@ -1,9 +1,10 @@
-import { toRefs, shallowReadonly, ShallowRef, shallowRef } from 'vue'
+import { toRefs, shallowReadonly, 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[]>;
 }
 
@@ -11,6 +12,7 @@ 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)
@@ -19,28 +21,21 @@ const store = new (class extends VueStore<StoreState>{
     actions = {
         /** 获取表格列列表 */
         getTableColumnList: () => {
-            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()
+            if (this.state.tableColumns.length) {
+                return Promise.resolve()
             }
+            this.state.loading = true
+            return queryTableDefine({
+                data: {
+                    tableType: 2
+                },
+                success: (res) => {
+                    this.state.tableColumns = res.data
+                },
+                complete: () => {
+                    this.state.loading = false
+                }
+            })
         }
     }
 })

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

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

+ 14 - 0
src/types/ermcp/common.d.ts

@@ -1,5 +1,19 @@
 /** 企业风管 */
 declare namespace Ermcp {
+    /** 首页统计数据 请求 */
+    interface HomeDataReq {
+        userid: number; // 用户ID
+    }
+
+    /** 首页统计数据 响应 */
+    interface HomeDataRsp {
+        purchasedtransactions: number; // 已购买的交易
+        transactioninpurchase: number; // 求购中的交易
+        transactionsonsale: number; // 出售中的交易
+        transactionssold: number; // 已卖出的交易
+        unhandledmessage: number; // 未处理消息
+    }
+
     /** 查询汇率信息 请求 */
     interface RatesReq {
         page?: number; // 页码

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

@@ -10,6 +10,7 @@ declare namespace Ermcp {
 
     /** 查询我的收藏 响应 */
     interface MyFavoriteRsp {
+        accountname: string; // 账户名称(机构名称)
         buyorsell: number; // 买卖 - 0:买 1:卖
         favoritestatus: number; // 收藏状态 - 1:正常 2:失效
         goodsno: string; // 商品编号

+ 47 - 0
src/types/ermcp/performance.d.ts

@@ -46,4 +46,51 @@ declare namespace Ermcp {
         steptypeid: number; // 步骤类型ID - 1:买方支付 2:卖方收款 3:买方自提 4:卖方发货 5:买方确认货 6:卖方发票 7:买方确认票 8:仓单转移
         steptypename: string; // 步骤类型名称
     }
+
+    /** 查询履约信息详情 请求 */
+    interface WrPerformancePlanStepReq {
+        planid: string; // 履约计划id(performanceplanid)
+        curstepid?: string; // 当前步骤id
+    }
+
+    /** 查询履约信息详情 响应 */
+    interface WrPerformancePlanStepRsp {
+        delaydays: number; // 延期申请天数
+        deliverygoodscode: string; // 品种代码
+        deliverygoodsid: number; // 品种ID
+        deliverygoodsname: string; // 品种名称
+        endtime: string; // 结束日期
+        enumdicname: string; // 单位名称
+        executeside: number; // 步骤执行方 - 1:买方 2:卖方
+        handlestatus: number; // 处理状态 - 1:开始 2:结束 3:冻结请求 4:冻结返回成功 5:冻结返回失败 6:扣款请求 7:扣款返回成功 8:扣款返回失败 9:仓单转移请求 10:仓单转移返回成功 11:仓单转移返回失败 12:加钱请求 13:加钱返回成功 14:加钱返回失败 15:解冻仓单头寸请求 16:解冻仓单头寸返回成功 17:解冻仓单头寸返回失败 18:解冻库位请求 19:解冻库位返回成功 20:解冻库位返回失败
+        isauto: number; // 是否自动 - 0:不自动 1:自动
+        islastreceivestep: number; // 是否最后收款步骤 - 0:不是 1:是 (暂时不用,由服务自己判断是否为最后一步付款或收款)
+        minivalue: number; // 现货商品最小变动值
+        optioncompare: string; // 选择项比较串【{选择项ID}+{冒号}+选择项值 } ,逗号分隔,头尾加逗号】-- 所有选择项拼接,用于比较
+        overdays: number; // 超期天数 = 当前时间(数据库时间) - 结束日期
+        performancestepid: string; // 履约步骤ID(131+Unix秒时间戳(10位)+xxxxxx)
+        planid: string; // 所属履约计划ID
+        realamount: number; // 实际完成金额
+        relatedorderid: string; // 关联单号
+        remaindays: number; // 剩余天数
+        remark: string; // 错误备注
+        starttime: string; // 开始日期
+        stepamount: number; // 步骤金额
+        stepdays: number; // 距离上一步天数(分钟)
+        stepindex: number; // 步骤序号
+        steplanchtype: number; // 步骤启动类型 - 1:系统自动 2:手动
+        stepremark: string; // 步骤备注
+        stepstatus: number; // 步骤状态 - 1:待开始 2:进行中 3:已完成 4:延期(进行中) 5:失败 6:自动完成 7:超时关闭
+        steptypeid: number; // 履约步骤类型ID - 1:买方支付 2:卖方收款 3:买方自提 4:卖方发货 5:买方确认货 6:卖方发票 7:买方确认票 8:仓单转移 9:释放卖方冻结 10:货款溢短 11:生成合同[中江] 12:运费 90:确认支付 91. 确认放行 92买方支付(直接扣款) 用于-1模板“
+        steptypename: string; // 步骤名称
+        stepvalue: number; // 步骤值
+        warehouseid: number; // 仓库ID
+        warehousename: string; // 仓库名称
+        wrfactortypeid: string; // 仓单要素类型ID(212+Unix秒时间戳(10位)+xxxxxx)
+        wrfactortypename: string; // 仓单要素类型名称(选择项要素的名称合并显示,逗号分隔)
+        wrstandardcode: string; // 现货商品代码
+        wrstandardid: number; // 现货商品ID
+        wrstandardname: string; // 商品名称
+        wrtypename: string; // 商品
+    }
 }

+ 100 - 0
src/types/ermcp/trade.d.ts

@@ -25,6 +25,103 @@ declare namespace Ermcp {
         zssymmetrytype?: number[]; // [对称度integer]
     }
 
+    /** 钻石搜索响应 */
+    interface SellOrderSearchRsp {
+        accountid: number; // 资金账号
+        applyid: number; // 申请单ID
+        attachment1: string; // 附件1
+        attachment2: string; // 附件2
+        buyorsell: number; // 买卖 - 0:买 1:卖
+        canbargain: number; // 是否可议价 - 0:不可 1:可
+        cancelqty: number; // 撤销数量
+        canceltime: string; // 撤销时间
+        cerno: string;
+        chargealgorithm: number; // 手续费收取方式 1:比率 2:固定
+        chargealgorithmvalue: number; // 手续费设置值(交易所部分)
+        chargealgorithmvalue2: number; // 手续费设置值(会员部分)
+        clientordertime: string; // 客户端委托时间
+        cpcertno: string;
+        exchangerate: number; // 汇率[67]
+        firstratio: number; // 首付比率 - [挂牌时指定,摘牌时使用]
+        fixedprice: number; // [克拉单价]固定价格 - [挂牌]
+        freezecharge: number; // 冻结手续费
+        freezefirstamount: number; // 冻结首付金额 - [摘牌]
+        freezemargin: number; // 冻结保证金
+        goodsno: string; // 商品编号
+        imagepath: string;
+        isQueryDiamond: boolean; // 是否钻石查询
+        isspecified: number; // 是否指定对手 - 0:不指定 1:指定好友(贸易圈) 2:指定对手 - [挂牌]
+        kppath: string;
+        kpweight: string;
+        marginalgorithm: number; // 保证金方式 - 1:比率 2:固定
+        marginvalue: number; // 保证金设置值
+        marketid: number; // 市场ID
+        marketprice: string;
+        orderamount: number; // 挂牌金额[账户] [67]= OrderQty * FixedPrice * ExchangeRate /100
+        ordertime: string; // 委托时间
+        performancetemplateid: number; // 履约计划模板ID
+        price: number; // 价格
+        pricefactor: number; // 价格系数(浮动价时填写) - [挂牌]
+        pricemove: number; // 升贴水(浮动价时填写) - [挂牌]
+        priceper: string;
+        relatedwrtradeorderid: number; // 关联委托单号(摘牌委托关联挂牌委托单ID)
+        remainqty: number; // 剩余重量
+        remark: string;
+        retcode: number; // 错误代码
+        sellusername: string; // 卖方(查询字段-模糊查询)
+        settingmaterial: string;
+        size1: string;
+        size2: string;
+        size3: string;
+        sizedisplay: string; // 尺寸
+        stonedesc: string;
+        totalqty: number; // 总重量
+        tradedate: string; // 交易日(yyyyMMdd)
+        tradeprice: number; // 成交价格 - [摘牌] (浮动价 ((商品1价格商品1价格系数+升贴水) 商品1重量系数 + 商品2价格商品2价格系数+商品2升贴水) 商品2重量系数 …)* 委托单价格系数 + 委托单升贴水)
+        unfreezecharge: number; // 解冻手续费
+        unfreezefirstamount: number; // 解冻首付金额 - [摘牌]
+        unfreezemargin: number; // 解冻保证金
+        userid: number; // 用户ID
+        uuid: string; // 发起端唯一id
+        validtime: string; // 有效期限
+        validtype: number; // 有效类型 - 1当日有效 2本周有效 3指定日期有效 4一直有效
+        warehousenamedisplay: string;
+        wrbargainid: number; // 议价申请单ID
+        wrfactortypeid: number; // 仓单要素类型ID/商品ID(77)
+        wrpath: string;
+        wrpricetype: number; // 价格方式 - 1:固定价 2-浮动价 - [挂牌]
+        wrstandardid: number; // 现货商品ID
+        wrtradeorderid: string; // 仓单贸易委托单ID(320+Unix秒时间戳(10位)+xxxxxx)
+        wrtradeorderstatus: number; // 委托状态 - 参考枚举’WRTradeOrderStatus’ - 1:委托请求 2:待冻结 3:委托成功 4:委托失败 5:配对成功 6:已撤 7:部成 8:已成 9:部成部撤 10:成交失败 11:委托拒绝 12:经过摘牌(先摘后挂专用) 13:冻结成功(通道交易专用) 14:通道已撤 15:通道部成部撤 16:成交失败违约(荷兰式竞拍专用) 17:冻结PD成功 18:冻结PD失败 19:冻结能量成功 20:冻结能量失败 21:预约已报价 22:过期未付 23:优惠券处理中 24:仓单生成失败 25:首付扣款失败 26:履约失败 27:撤单解冻贷款失败
+        wrtradetype: number; // 仓单贸易类型 - 1:挂牌 2:摘牌 3:提货卖(文化中国) 4:提货买(文化中国)
+        wrtransferuserid: number; // 仓单受让用户 - [摘牌]
+        zscategory: number; // 钻石分类 - 枚举”ZSCategory“
+        zscategorydisplay: string; // 钻石分类 - 描述
+        zscerttypedisplay: string;
+        zsclaritytype1display: string;
+        zsclaritytype2display: string;
+        zscolortype1display: string;
+        zscolortype2display: string;
+        zscrystaltype: string;
+        zscrystaltypedisplay: string;
+        zscurrencytype: number; // 货币类型 - 枚举“ZSCurrencyType”
+        zscurrencytypedisplay: string;
+        zscurrencytypedisplayunit: string;
+        zscuttype1display: string;
+        zscuttype2display: string;
+        zsczcolor1typedisplay: string;
+        zsczcolor2typedisplay: string;
+        zsczcolor3typedisplay: string;
+        zsfluorescencetype1display: string;
+        zsfluorescencetype2display: string;
+        zspolishtype1display: string;
+        zspolishtype2display: string;
+        zsshapetypedisplay: string;
+        zsstyletypedisplay: string;
+        zssymmetrytype1display: string;
+        zssymmetrytype2display: string;
+    }
+
     /** 查询出售大厅委托单请求 */
     interface SellOrderReq {
         page?: number; // 页码
@@ -526,6 +623,7 @@ declare namespace Ermcp {
         zscolortypedisplay: string;
         zscrystaltypedisplay: string;
         zscurrencytypedisplay: string;
+        zscurrencytypedisplayunit: string; // 价格单位
         zscuttypedisplay: string;
         zsczcolor1typedisplay: string;
         zsczcolor2typedisplay: string;
@@ -561,6 +659,7 @@ declare namespace Ermcp {
         buyerinfo: string; // 买方联系信息 - 存JSON字符串, 根据枚举‘BuyerContactInfo’,显示\隐藏字段,若数据不为JSON,则直接显示{ "ContactInfo": "xxxxxxxx", "ReceiveInfo": "xxxxxxxxx", "ReceiptInfo": "xxxxxxxxxxxx"}
         buyorsell: number; // 方向 - 0:买 1:卖
         buypaidamount: number; // 买方已冻/已扣金额
+        buytodayamount: number; // 买方今日扣/冻金额 (待开市时清零)
         curstepid: string; // 当前步骤ID
         goodsno: string; // 商品编号
         overshortamount: number; // 溢短金额
@@ -575,6 +674,7 @@ declare namespace Ermcp {
         sellerfreezeamountremain: number; // 卖方履约前冻结资金剩余
         sellerinfo: string; // 卖方联系信息 - 存JSON字符串, 根据枚举‘SellerContactInfo’,显示\隐藏字段,若数据不为JSON,则直接显示{ "ContactInfo": "xxxxxxxx"}
         sellreceivedamount: number; // 卖方已收金额
+        selltodayamount: number; // 卖方今日收取金额(待开市时清零)
         sizedisplay: string; // 尺寸
         steptypeid: number; // PerformanceStep
         warehousenamedisplay: string;