li.shaoyi 3 anos atrás
pai
commit
09580ec5d7
35 arquivos alterados com 1772 adições e 610 exclusões
  1. 91 0
      public/proto/gz.proto
  2. 1 1
      src/business/common/index.ts
  3. 21 1
      src/business/goods/index.ts
  4. 46 0
      src/business/order/desting.ts
  5. 891 0
      src/business/order/list.ts
  6. 5 479
      src/business/order/listing.ts
  7. 15 5
      src/constants/enum/funcode.ts
  8. 35 19
      src/mock/router.ts
  9. 4 8
      src/packages/pc/components/base/table-filter/index.less
  10. 11 5
      src/packages/pc/components/layouts/view/index.less
  11. 3 1
      src/packages/pc/components/layouts/view/index.vue
  12. 3 2
      src/packages/pc/components/modules/auth-operation/index.vue
  13. 38 0
      src/packages/pc/components/modules/goods-details/index.vue
  14. 2 2
      src/packages/pc/views/listing/buy/components/add/index.vue
  15. 15 4
      src/packages/pc/views/listing/buy/index.vue
  16. 25 1
      src/packages/pc/views/listing/delisting/index.vue
  17. 31 1
      src/packages/pc/views/listing/inquire/index.vue
  18. 2 2
      src/packages/pc/views/listing/purchase/index.vue
  19. 2 2
      src/packages/pc/views/listing/sale/index.vue
  20. 3 3
      src/packages/pc/views/listing/sell/components/add/index.vue
  21. 44 0
      src/packages/pc/views/listing/sell/components/delisting/index.vue
  22. 16 4
      src/packages/pc/views/listing/sell/index.vue
  23. 1 3
      src/packages/pc/views/mine/account/index.vue
  24. 2 4
      src/packages/pc/views/system/menu/index.vue
  25. 1 1
      src/packages/pc/views/warehousing/stock/index.vue
  26. 1 1
      src/packages/pc/views/warehousing/warehouse/index.vue
  27. 7 0
      src/services/api/goods/index.ts
  28. 56 0
      src/services/api/order/index.ts
  29. 18 17
      src/services/socket/trade/index.ts
  30. 1 1
      src/types/ermcp/account.d.ts
  31. 78 0
      src/types/ermcp/goods.d.ts
  32. 141 8
      src/types/ermcp/order.d.ts
  33. 140 0
      src/types/proto/order.d.ts
  34. 21 34
      src/utils/websocket/index.ts
  35. 1 1
      src/utils/websocket/interface.ts

+ 91 - 0
public/proto/gz.proto

@@ -342,6 +342,7 @@ message ZSSellOrderListingReq {
 		optional uint32 ClientType = 15; // 终端类型
 		optional uint64 MarketID = 16; // 市场ID,必填
 }
+
 // 钻石卖挂牌接口响应
 message ZSSellOrderListingRsp {
 	optional MessageHead Header = 1; // 消息头
@@ -353,4 +354,94 @@ message ZSSellOrderListingRsp {
 		optional uint64 FreezeQty = 7; // 冻结数量
 		optional string OrderTime = 8; // 接收委托交易的时间
 		optional string ClientSerialNo = 9; // 客户端流水号
+}
+
+
+// 钻石买摘牌接口请求
+message ZSBuyOrderDestingReq {
+	optional MessageHead Header = 1;
+	optional uint32 UserID = 2; // 用户ID,必填
+	optional uint64 AccountID = 3; // 资金账号,必填
+	optional uint64 RelatedWRTradeOrderID = 4; // 卖委托单号,必填
+	optional double OrderQty = 5; // 委托数量,必填2位小数,为WeigthAvg的整数倍
+	optional uint32 OrderSrc = 6; // 委托来源
+	optional string ClientSerialNo = 7; // 客户端流水号
+	optional string ClientOrderTime = 8; // 客户端委托时间
+	optional uint32 ClientType = 9; // 终端类型
+	optional uint64 OperatorID = 10; // 操作员账号ID
+	optional uint64 MarketID = 11; // 市场ID,必填
+}
+
+// 钻石买摘牌接口响应
+message ZSBuyOrderDestingRsp {
+	optional MessageHead Header = 1; // 消息头
+	optional int32 RetCode = 2; // 返回码
+	optional string RetDesc = 3; // 描述信息
+		optional uint32 UserID = 4; // 用户ID
+		optional uint64 AccountID = 5; // 资金账号
+		optional uint64 WRTradeOrderID = 6; // 仓单贸易委托单ID
+		optional uint64 RelatedWRTradeOrderID = 7; // 关联委托单号(摘牌委托关联挂牌委托单ID)
+		optional double FreezeAmount = 8; // 冻结货款
+		optional string OrderTime = 9; // 接收委托交易的时间
+		optional string ClientSerialNo = 10; // 客户端流水号
+}
+
+// 钻石卖摘牌申请接口请求
+message ZSSellOrderDestingApplyReq {
+	optional MessageHead Header = 1;
+		optional uint64 UserID = 2; // 用户ID,必填
+		optional uint64 AccountID = 3; // 资金账户ID,必填
+		optional uint64 BuyWRTradeOrderID = 4; // 买挂牌委托单ID,必填
+		optional uint64 WRStandardID = 5; // 现货商品ID,必填
+		optional uint64 WRFactorTypeID = 6; // 仓单要素类型ID,必填
+		optional double ApplyQty = 7; // 申请数量,必填,2位小数
+		optional double ApplyPrice = 8; // 申请价格,必填,2位小数
+		optional uint64 LadingBillID = 9; // 提单ID,必填
+		optional uint32 SubNum = 10; // 提单子单号,必填
+		optional string ApplyRemark = 11; // 备注
+		optional uint32 ClientType = 12; // 终端类型
+		optional string ClientSerialNo = 13; // 客户端流水号
+		optional uint64 MarketID = 14; // 市场ID,必填
+}
+
+
+// 钻石卖摘牌申请接口响应
+message ZSSellOrderDestingApplyRsp {
+	optional MessageHead Header = 1; // 消息头
+	optional int32 RetCode = 2; // 返回码
+	optional string RetDesc = 3; // 描述信息
+		optional uint32 UserID = 4; // 用户ID
+		optional uint64 AccountID = 5; // 资金账号
+		optional uint64 ApplyID = 6; // 仓单贸易委托单ID
+		optional string ClientSerialNo = 7; // 客户端流水号
+}
+
+
+// 钻石卖摘牌申请操作接口请求
+message ZSSellOrderDestingApplyOperateReq {
+	optional MessageHead Header = 1;
+		optional uint32 UserID = 2; // 用户ID,必填
+		optional uint64 AccountID = 3; // 资金账号
+		optional uint64 SellDelistingApplyID = 4; // 卖摘牌申请ID,必填
+		optional string AuditRemark = 5; // 备注
+		optional uint32 OperateType = 6; // 操作类型,1:撤销2:拒绝
+		optional uint32 MarketID = 7; // 市场ID,必填
+		optional uint32 ClientType = 8; // 终端类型
+		optional uint32 OrderSrc = 9; // 委托来源
+		optional string ClientSerialNo = 10; // 客户端流水号
+}
+
+
+// 钻石卖摘牌申请操作接口应答
+message ZSSellOrderDestingApplyOperateRsp {
+	optional MessageHead Header = 1; // 消息头
+	optional int32 RetCode = 2; // 返回码
+	optional string RetDesc = 3; // 描述信息
+		optional uint32 UserID = 4; // 用户ID
+		optional uint64 AccountID = 5; // 资金账号
+		optional uint64 SellDelistingApplyID = 6; // 卖摘牌申请ID
+		optional uint64 WRTradeOrderID = 7; // 仓单贸易委托单ID
+		optional double FreezeAmount = 8; // 冻结货款
+		optional string OrderTime = 9; // 接收委托交易的时间
+		optional string ClientSerialNo = 10; // 客户端流水号
 }

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

@@ -28,7 +28,7 @@ export async function initBaseData(callback?: () => void) {
             futuresStore.getGoodsList(),
             sessionData.getUserMenuList(),
             sessionData.getAllEnumList(),
-            sessionData.getTableColumnList(),
+            //sessionData.getTableColumnList(),
         ]
 
         await Promise.all(asyncTask).then(() => {

+ 21 - 1
src/business/goods/index.ts

@@ -5,7 +5,7 @@ import { formatDecimal } from '@/filters'
 import { ClientType } from '@/constants/enum/client'
 import { Market } from '@/constants/enum/market'
 import { queryWarehouseInfo } from '@/services/api/warehouse'
-import { addZSGoods, queryDiamondList } from '@/services/api/goods'
+import { addZSGoods, queryDiamondList, queryDiamondDetails } from '@/services/api/goods'
 import { sessionData } from '@/stores'
 import {
     Category,
@@ -27,6 +27,7 @@ import {
     getFancyColorType3List,
 } from '@/constants/enum/diamond'
 
+// 钻石列表相关
 export function useDiamond() {
     const { UserID } = sessionData.getValue('loginInfo')
     const { dataList, total, pageIndex, pageSize, inputList, selectList, buttonList, getQueryParam } = useDataTable<Ermcp.MyWRPositionRsp>()
@@ -185,6 +186,25 @@ export function useDiamond() {
     }
 }
 
+// 钻石详情相关
+export function useDiamondDetails(goodsno: string) {
+    const getDiamondDetails = () => {
+        return queryDiamondDetails({
+            data: {
+                goodsno,
+            },
+            success: (res) => {
+                console.log(res.data)
+            }
+        })
+    }
+
+    return {
+        getDiamondDetails
+    }
+}
+
+// 钻石表单操作相关
 export function useDiamondForm(category: Category) {
     const { UserID, AccountIDs } = sessionData.getValue('loginInfo')
     const loading = shallowRef(false)

+ 46 - 0
src/business/order/desting.ts

@@ -0,0 +1,46 @@
+import { shallowRef } from 'vue'
+import { v4 } from 'uuid'
+import { ClientType } from '@/constants/enum/client'
+import { Market } from '@/constants/enum/market'
+import { zsBuyOrderDesting } from '@/services/api/order'
+import { sessionData } from '@/stores'
+import moment from 'moment'
+import Long from 'long'
+
+/**
+ * 钻石买摘牌
+ * @returns 
+ */
+export function useBuyOrderDesting(selectedRow: Ermcp.SellOrderRsp) {
+    const { UserID, AccountIDs } = sessionData.getValue('loginInfo')
+    const loading = shallowRef(false)
+
+    const formSubmit = () => {
+        loading.value = true
+        return zsBuyOrderDesting({
+            data: {
+                Header: {
+                    AccountID: AccountIDs[0],
+                },
+                UserID,
+                AccountID: AccountIDs[0],
+                RelatedWRTradeOrderID: Long.fromString(selectedRow.wrtradeorderid),
+                OrderQty: selectedRow.remainqty,
+                OrderSrc: 2,
+                ClientSerialNo: v4(),
+                ClientOrderTime: moment().format('YYYY-MM-DD HH:mm:ss'),
+                ClientType: ClientType.Web,
+                OperatorID: UserID,
+                MarketID: Market.GZ
+            },
+            complete: () => {
+                loading.value = false
+            }
+        })
+    }
+
+    return {
+        loading,
+        formSubmit
+    }
+}

+ 891 - 0
src/business/order/list.ts

@@ -0,0 +1,891 @@
+import { shallowRef } from 'vue'
+import { useDataTable } from '@/hooks/datatable'
+import { queryBuyOrder, querySellOrder, queryMyBuyOrder, queryMySellOrder, queryMyDeListing, queryMyBargainApply, queryMyDelistingApply } from '@/services/api/order'
+import { sessionData } from '@/stores'
+import { Category, getCategoryList } from '@/constants/enum/diamond'
+
+/**
+ * 求购大厅
+ * @returns 
+ */
+export function useBuyOrder() {
+    const { dataList, total, pageIndex, pageSize, inputList, selectList, buttonList, getQueryParam, resetFilter } = useDataTable<Ermcp.BuyOrderRsp>()
+    const loading = shallowRef(false)
+
+    const columns = shallowRef<Ermcp.TableColumn[]>([
+        {
+            prop: 'wrtradeorderid',
+            label: '委托单号',
+            width: 200,
+            show: true,
+        },
+        {
+            prop: 'buyusername',
+            label: '买方',
+            show: true,
+        },
+        {
+            prop: 'zscategorydisplay',
+            label: '商品分类',
+            show: true,
+        },
+        {
+            prop: 'zstabledisplay',
+            label: '求购信息',
+            show: true,
+        },
+        {
+            prop: 'wrtradeorderstatus',
+            label: '状态',
+            show: true,
+        },
+        {
+            prop: 'validtime',
+            label: '有效日期',
+            width: 180,
+            show: true,
+        },
+        {
+            prop: 'ordertime',
+            label: '委托时间',
+            width: 180,
+            show: true,
+        },
+        {
+            prop: 'operate',
+            label: '操作',
+            show: true,
+            fixed: 'right',
+            width: 180,
+        }
+    ])
+
+    // 获取求购大厅委托单
+    const getBuyOrderList = () => {
+        const param = getQueryParam()
+        loading.value = true
+        return queryBuyOrder({
+            data: {
+                page: pageIndex.value,
+                pagesize: pageSize.value,
+                zscategory: param.zscategory,
+                wrtradeorderid: param.wrtradeorderid,
+                zsallproperties: param.zstabledisplay,
+                buyusername: param.buyusername,
+            },
+            success: (res) => {
+                total.value = res.total
+                dataList.value = res.data
+            },
+            fail: () => {
+                dataList.value = []
+            },
+            complete: () => {
+                loading.value = false
+            }
+        })
+    }
+
+    selectList.value = [
+        {
+            label: '商品分类',
+            key: 'zscategory',
+            options: getCategoryList(),
+        },
+    ]
+
+    inputList.value = [
+        { label: '单号', keys: ['wrtradeorderid'], type: 'number' },
+        { label: '买方', keys: ['buyusername'] },
+        { label: '商品', keys: ['zstabledisplay'] },
+    ]
+
+    const [reset, search] = buttonList.value
+    reset.onClick = () => {
+        resetFilter()
+        getBuyOrderList()
+    }
+    search.onClick = getBuyOrderList
+
+    return {
+        loading,
+        dataList,
+        total,
+        pageIndex,
+        pageSize,
+        columns,
+        inputList,
+        selectList,
+        buttonList,
+        getBuyOrderList,
+    }
+}
+
+/**
+ * 出售大厅
+ * @returns 
+ */
+export function useSellOrder() {
+    const { dataList, total, pageIndex, pageSize, inputList, selectList, buttonList, getQueryParam, resetFilter } = useDataTable<Ermcp.SellOrderRsp>()
+    const loading = shallowRef(false)
+
+    const columns = shallowRef<Ermcp.TableColumn[]>([
+        {
+            prop: 'wrtradeorderid',
+            label: '委托单号',
+            width: 200,
+            show: true,
+        },
+        {
+            prop: 'sellusername',
+            label: '卖方',
+            show: true,
+        },
+        {
+            prop: 'zscategorydisplay',
+            label: '商品分类',
+            show: true,
+        },
+        {
+            prop: 'goodsno',
+            label: '商品编号',
+            show: true,
+        },
+        {
+            prop: 'totalqty',
+            label: '总重量',
+            show: true,
+        },
+        {
+            prop: 'fixedprice',
+            label: '克拉单价',
+            show: true,
+        },
+        {
+            prop: 'remainqty',
+            label: '剩余重量',
+            show: true,
+        },
+        {
+            prop: 'wrtradeorderstatus',
+            label: '委托状态',
+            show: true,
+        },
+        {
+            prop: 'ordertime',
+            label: '委托时间',
+            width: 180,
+            show: true,
+        },
+        {
+            prop: 'tradedate',
+            label: '交易日',
+            show: true,
+        },
+        {
+            prop: 'operate',
+            label: '操作',
+            show: true,
+            fixed: 'right',
+            width: 180
+        }
+    ])
+
+    // 获取出售大厅委托单
+    const getSellOrderList = () => {
+        const param = getQueryParam()
+        loading.value = true
+        return querySellOrder({
+            data: {
+                page: pageIndex.value,
+                pagesize: pageSize.value,
+                zscategory: param.zscategory,
+                wrtradeorderid: param.wrtradeorderid,
+                zsallproperties: param.goodsno,
+                buyusername: param.sellusername,
+            },
+            success: (res) => {
+                total.value = res.total
+                dataList.value = res.data
+            },
+            fail: () => {
+                dataList.value = []
+            },
+            complete: () => {
+                loading.value = false
+            }
+        })
+    }
+
+    selectList.value = [
+        {
+            label: '商品分类',
+            key: 'zscategory',
+            options: getCategoryList(),
+        },
+    ]
+
+    inputList.value = [
+        { label: '单号', keys: ['wrtradeorderid'], type: 'number' },
+        { label: '卖方', keys: ['sellusername'] },
+        { label: '商品', keys: ['goodsno'] },
+    ]
+
+    const [reset, search] = buttonList.value
+    reset.onClick = () => {
+        resetFilter()
+        getSellOrderList()
+    }
+    search.onClick = getSellOrderList
+
+    return {
+        loading,
+        dataList,
+        total,
+        pageIndex,
+        pageSize,
+        columns,
+        inputList,
+        selectList,
+        buttonList,
+        getSellOrderList,
+    }
+}
+
+/**
+ * 我的出售
+ */
+export function useSaleOrder() {
+    const { dataList, total, pageIndex, pageSize, inputList, selectList, buttonList, getQueryParam, resetFilter } = useDataTable<Ermcp.MySellOrderRsp>()
+    const loading = shallowRef(false)
+
+    const columns = shallowRef<Ermcp.TableColumn[]>([
+        {
+            prop: 'wrtradeorderid',
+            label: '委托单号',
+            width: 200,
+            show: true,
+        },
+        {
+            prop: 'zscategorydisplay',
+            label: '商品分类',
+            show: true,
+        },
+        {
+            prop: 'goodsno',
+            label: '商品编号',
+            show: true,
+        },
+        {
+            prop: 'totalqty',
+            label: '委托重量',
+            show: true,
+        },
+        {
+            prop: 'fixedprice',
+            label: '克拉单价',
+            show: true,
+        },
+        {
+            prop: 'selledqty',
+            label: '成交重量',
+            show: true,
+        },
+        {
+            prop: 'wrtradeorderstatus',
+            label: '委托状态',
+            show: true,
+        },
+        {
+            prop: 'ordertime',
+            label: '委托时间',
+            width: 180,
+            show: true,
+        },
+        {
+            prop: 'operate',
+            label: '操作',
+            show: true,
+            fixed: 'right',
+        }
+    ])
+
+    // 获取我的出售列表
+    const getSaleOrderList = () => {
+        const param = getQueryParam()
+        loading.value = true
+        return queryMySellOrder({
+            data: {
+                page: pageIndex.value,
+                pagesize: pageSize.value,
+                userid: sessionData.getLoginInfo('UserID'),
+                zscategory: param.zscategory,
+                wrtradeorderid: param.wrtradeorderid,
+                zsallproperties: param.goodsno,
+            },
+            success: (res) => {
+                total.value = res.total
+                dataList.value = res.data
+            },
+            fail: () => {
+                dataList.value = []
+            },
+            complete: () => {
+                loading.value = false
+            }
+        })
+    }
+
+    selectList.value = [
+        {
+            label: '商品分类',
+            key: 'zscategory',
+            options: getCategoryList(),
+        },
+    ]
+
+    inputList.value = [
+        { label: '单号', keys: ['wrtradeorderid'], type: 'number' },
+        { label: '商品', keys: ['goodsno'] },
+    ]
+
+    const [reset, search] = buttonList.value
+    reset.onClick = () => {
+        resetFilter()
+        getSaleOrderList()
+    }
+    search.onClick = getSaleOrderList
+
+    return {
+        loading,
+        dataList,
+        total,
+        pageIndex,
+        pageSize,
+        columns,
+        inputList,
+        selectList,
+        buttonList,
+        getSaleOrderList,
+    }
+}
+
+/**
+ * 我的求购
+ */
+export function usePurchaseOrder() {
+    const { dataList, total, pageIndex, pageSize, inputList, selectList, buttonList, getQueryParam, resetFilter } = useDataTable<Ermcp.MyBuyOrderRsp>()
+    const loading = shallowRef(false)
+
+    const columns = shallowRef<Ermcp.TableColumn[]>([
+        {
+            prop: 'wrtradeorderid',
+            label: '委托单号',
+            width: 200,
+            show: true,
+        },
+        {
+            prop: 'zscategorydisplay',
+            label: '商品分类',
+            show: true,
+        },
+        {
+            prop: 'zstabledisplay',
+            label: '求购信息',
+            show: true,
+        },
+        {
+            prop: 'wrtradeorderstatus',
+            label: '状态',
+            show: true,
+        },
+        {
+            prop: 'validtime',
+            label: '有效日期',
+            width: 180,
+            show: true,
+        },
+        {
+            prop: 'ordertime',
+            label: '委托时间',
+            width: 180,
+            show: true,
+        },
+        {
+            prop: 'operate',
+            label: '操作',
+            show: true,
+            fixed: 'right',
+        }
+    ])
+
+    // 获取我的求购列表
+    const getPurchaseOrderList = () => {
+        const param = getQueryParam()
+        loading.value = true
+        return queryMyBuyOrder({
+            data: {
+                page: pageIndex.value,
+                pagesize: pageSize.value,
+                userid: sessionData.getLoginInfo('UserID'),
+                zscategory: param.zscategory,
+                wrtradeorderid: param.wrtradeorderid,
+                zsallproperties: param.zstabledisplay,
+            },
+            success: (res) => {
+                total.value = res.total
+                dataList.value = res.data
+            },
+            fail: () => {
+                dataList.value = []
+            },
+            complete: () => {
+                loading.value = false
+            }
+        })
+    }
+
+    selectList.value = [
+        {
+            label: '商品分类',
+            key: 'zscategory',
+            options: getCategoryList(),
+        },
+    ]
+
+    inputList.value = [
+        { label: '单号', keys: ['wrtradeorderid'], type: 'number' },
+        { label: '商品', keys: ['zstabledisplay'] },
+    ]
+
+    const [reset, search] = buttonList.value
+    reset.onClick = () => {
+        resetFilter()
+        getPurchaseOrderList()
+    }
+    search.onClick = getPurchaseOrderList
+
+    return {
+        loading,
+        dataList,
+        total,
+        pageIndex,
+        pageSize,
+        columns,
+        inputList,
+        selectList,
+        buttonList,
+        getPurchaseOrderList,
+    }
+}
+
+/**
+ * 我的摘牌
+ */
+export function useDelistingOrder() {
+    const { dataList, total, pageIndex, pageSize, inputList, selectList, buttonList, getQueryParam, resetFilter } = useDataTable<Ermcp.MyDeListingRsp>()
+    const loading = shallowRef(false)
+
+    const columns = shallowRef<Ermcp.TableColumn[]>([
+        {
+            prop: 'buyorsell',
+            label: '类型',
+            show: true,
+        },
+        {
+            prop: 'matchusername',
+            label: '对手方',
+            show: true,
+        },
+        {
+            prop: 'zsshapetypedisplay',
+            label: '形状',
+            show: true,
+        },
+        {
+            prop: 'zscolortype1display',
+            label: '颜色',
+            show: true,
+        },
+        {
+            prop: 'zsclaritytype1display',
+            label: '净度',
+            show: true,
+        },
+        {
+            prop: 'zscuttype1display',
+            label: '切工',
+            show: true,
+        },
+        {
+            prop: 'zspolishtype1display',
+            label: '抛光',
+            show: true,
+        },
+        {
+            prop: 'zssymmetrytype1display',
+            label: '对称',
+            show: true,
+        },
+        {
+            prop: 'zsfluorescencetype1display',
+            label: '荧光',
+            show: true,
+        },
+        {
+            prop: 'ordertime',
+            label: '尺寸',
+            show: true,
+        },
+        {
+            prop: 'qty',
+            label: '重量',
+            show: true,
+        },
+        {
+            prop: 'ordertime',
+            label: '价格',
+            show: true,
+        },
+        {
+            prop: 'exchangerate',
+            label: '汇率',
+            show: true,
+        },
+        {
+            prop: 'tradeprice',
+            label: '成交价格',
+            show: true,
+        },
+        {
+            prop: 'tradetime',
+            label: '成交时间',
+            width: 200,
+            show: true,
+        },
+        {
+            prop: 'operate',
+            label: '操作',
+            show: true,
+            fixed: 'right',
+        }
+    ])
+
+    const categoryList = [
+        { label: '单颗裸钻', value: Category.Diamond },
+        { label: '单颗彩钻', value: Category.Fancy }
+    ]
+
+    selectList.value = [
+        {
+            label: '商品分类',
+            key: 'zscategory',
+            options: categoryList,
+        },
+        {
+            label: '方向',
+            key: 'buyorsell',
+            options: [],
+        },
+    ]
+
+    inputList.value = [
+        { label: '对手方', keys: ['matchusername'] },
+        { label: '商品', keys: ['zscategorydisplay'] },
+    ]
+
+    // 获取我的摘牌列表
+    const getDelistingOrderList = () => {
+        const param = getQueryParam()
+        loading.value = true
+        return queryMyDeListing({
+            data: {
+                page: pageIndex.value,
+                pagesize: pageSize.value,
+                userid: sessionData.getLoginInfo('UserID'),
+                zscategorys: param.zscategory ? param.zscategory.toString() : categoryList.map((e) => e.value).join(','),
+            },
+            success: (res) => {
+                total.value = res.total
+                dataList.value = res.data
+            },
+            fail: () => {
+                dataList.value = []
+            },
+            complete: () => {
+                loading.value = false
+            }
+        })
+    }
+
+    const [reset, search] = buttonList.value
+    reset.onClick = () => {
+        resetFilter()
+        getDelistingOrderList()
+    }
+    search.onClick = getDelistingOrderList
+
+    return {
+        loading,
+        dataList,
+        total,
+        pageIndex,
+        pageSize,
+        columns,
+        inputList,
+        selectList,
+        buttonList,
+        getDelistingOrderList,
+    }
+}
+
+/**
+ * 我的询价
+ */
+export function useInquireOrder() {
+    const { dataList, total, pageIndex, pageSize } = useDataTable<Ermcp.MyBargainApplyRsp | Ermcp.MyDelistingApplyRsp>()
+    const loading = shallowRef(false)
+    const columns = shallowRef<Ermcp.TableColumn[]>([])
+    const selectedBuyOrSell = shallowRef(0)
+    const selectedStatus = shallowRef(1)
+
+    // 询价方向
+    const buyOrSell = [
+        { label: '求购', value: 0 },
+        { label: '出售', value: 1 }
+    ]
+
+    // 询价状态
+    const status = [
+        { label: '全部', value: 0 },
+        { label: '待确认', value: 1 }
+    ]
+
+    // 获取我的询价列表
+    const getInquireOrderList = () => {
+        loading.value = true
+        dataList.value = []
+
+        const param: Ermcp.MyBargainApplyReq | Ermcp.MyDelistingApplyReq = {
+            page: pageIndex.value,
+            pagesize: pageSize.value,
+            userid: sessionData.getLoginInfo('UserID'),
+        }
+
+        if (selectedStatus.value) {
+            param.applystatus = selectedStatus.value
+        }
+
+        if (selectedBuyOrSell.value) {
+            columns.value = [
+                {
+                    prop: 'buyorsell',
+                    label: '类型',
+                    show: true,
+                },
+                {
+                    prop: 'matchusername',
+                    label: '对手方',
+                    show: true,
+                },
+                {
+                    prop: 'zstabledisplay',
+                    label: '形状',
+                    show: true,
+                },
+                {
+                    prop: 'wrtradeorderstatus',
+                    label: '颜色',
+                    show: true,
+                },
+                {
+                    prop: 'validtime',
+                    label: '净度',
+                    show: true,
+                },
+                {
+                    prop: 'ordertime',
+                    label: '切工',
+                    show: true,
+                },
+                {
+                    prop: 'ordertime',
+                    label: '抛光',
+                    show: true,
+                },
+                {
+                    prop: 'ordertime',
+                    label: '对称',
+                    show: true,
+                },
+                {
+                    prop: 'ordertime',
+                    label: '荧光',
+                    show: true,
+                },
+                {
+                    prop: 'ordertime',
+                    label: '尺寸',
+                    show: true,
+                },
+                {
+                    prop: 'qty',
+                    label: '重量',
+                    show: true,
+                },
+                {
+                    prop: 'ordertime',
+                    label: '价格',
+                    show: true,
+                },
+                {
+                    prop: 'exchangerate',
+                    label: '汇率',
+                    show: true,
+                },
+                {
+                    prop: 'tradeprice',
+                    label: '成交价格',
+                    show: true,
+                },
+                {
+                    prop: 'tradetime',
+                    label: '成交时间',
+                    width: 200,
+                    show: true,
+                },
+                {
+                    prop: 'operate',
+                    label: '操作',
+                    show: true,
+                    fixed: 'right',
+                }
+            ]
+            return queryMyDelistingApply({
+                data: param,
+                success: (res) => {
+                    total.value = res.total
+                    dataList.value = res.data
+                },
+                fail: () => {
+                    dataList.value = []
+                },
+                complete: () => {
+                    loading.value = false
+                }
+            })
+        } else {
+            columns.value = [
+                {
+                    prop: 'buyorsell',
+                    label: '类型',
+                    show: true,
+                },
+                {
+                    prop: 'matchusername',
+                    label: '对手方',
+                    show: true,
+                },
+                {
+                    prop: 'zstabledisplay',
+                    label: '形状',
+                    show: true,
+                },
+                {
+                    prop: 'wrtradeorderstatus',
+                    label: '颜色',
+                    show: true,
+                },
+                {
+                    prop: 'validtime',
+                    label: '净度',
+                    show: true,
+                },
+                {
+                    prop: 'ordertime',
+                    label: '切工',
+                    show: true,
+                },
+                {
+                    prop: 'ordertime',
+                    label: '抛光',
+                    show: true,
+                },
+                {
+                    prop: 'ordertime',
+                    label: '对称',
+                    show: true,
+                },
+                {
+                    prop: 'ordertime',
+                    label: '荧光',
+                    show: true,
+                },
+                {
+                    prop: 'ordertime',
+                    label: '尺寸',
+                    show: true,
+                },
+                {
+                    prop: 'qty',
+                    label: '重量',
+                    show: true,
+                },
+                {
+                    prop: 'ordertime',
+                    label: '价格',
+                    show: true,
+                },
+                {
+                    prop: 'exchangerate',
+                    label: '汇率',
+                    show: true,
+                },
+                {
+                    prop: 'tradeprice',
+                    label: '成交价格',
+                    show: true,
+                },
+                {
+                    prop: 'tradetime',
+                    label: '成交时间',
+                    width: 200,
+                    show: true,
+                },
+                {
+                    prop: 'operate',
+                    label: '操作',
+                    show: true,
+                    fixed: 'right',
+                }
+            ]
+            return queryMyBargainApply({
+                data: param,
+                success: (res) => {
+                    total.value = res.total
+                    dataList.value = res.data
+                },
+                fail: () => {
+                    dataList.value = []
+                },
+                complete: () => {
+                    loading.value = false
+                }
+            })
+        }
+    }
+
+    return {
+        loading,
+        dataList,
+        total,
+        pageIndex,
+        pageSize,
+        columns,
+        buyOrSell,
+        status,
+        selectedBuyOrSell,
+        selectedStatus,
+        getInquireOrderList,
+    }
+}

+ 5 - 479
src/business/order/index.ts → src/business/order/listing.ts

@@ -4,7 +4,7 @@ import { ClientType } from '@/constants/enum/client'
 import { useDataTable } from '@/hooks/datatable'
 import { Market } from '@/constants/enum/market'
 import { queryDiamondList } from '@/services/api/goods'
-import { zsBuyOrderListing, zsSellOrderListing, queryBuyOrder, querySellOrder, queryMyBuyOrder, queryMySellOrder } from '@/services/api/order'
+import { zsBuyOrderListing, zsSellOrderListing } from '@/services/api/order'
 import { sessionData } from '@/stores'
 import {
     Category,
@@ -25,127 +25,10 @@ import moment from 'moment'
 import Long from 'long'
 
 /**
- * 求购大厅
+ * 求购大厅挂牌
  * @returns 
  */
-export function useBuyOrder() {
-    const { dataList, total, pageIndex, pageSize, inputList, selectList, buttonList, getQueryParam, resetFilter } = useDataTable<Ermcp.BuyOrderRsp>()
-    const loading = shallowRef(false)
-
-    const columns = shallowRef<Ermcp.TableColumn[]>([
-        {
-            prop: 'wrtradeorderid',
-            label: '委托单号',
-            width: 200,
-            show: true,
-        },
-        {
-            prop: 'buyusername',
-            label: '买方',
-            show: true,
-        },
-        {
-            prop: 'zscategorydisplay',
-            label: '商品分类',
-            show: true,
-        },
-        {
-            prop: 'zstabledisplay',
-            label: '求购信息',
-            show: true,
-        },
-        {
-            prop: 'wrtradeorderstatus',
-            label: '状态',
-            show: true,
-        },
-        {
-            prop: 'validtime',
-            label: '有效日期',
-            width: 180,
-            show: true,
-        },
-        {
-            prop: 'ordertime',
-            label: '委托时间',
-            width: 180,
-            show: true,
-        },
-        {
-            prop: 'operate',
-            label: '操作',
-            show: true,
-            fixed: 'right',
-            width: 180,
-        }
-    ])
-
-    // 获取求购大厅委托单
-    const getBuyOrderList = () => {
-        const param = getQueryParam()
-        loading.value = true
-        return queryBuyOrder({
-            data: {
-                page: pageIndex.value,
-                pagesize: pageSize.value,
-                zscategory: param.zscategory,
-                wrtradeorderid: param.wrtradeorderid,
-                zsallproperties: param.zstabledisplay,
-                buyusername: param.buyusername,
-            },
-            success: (res) => {
-                total.value = res.total
-                dataList.value = res.data
-            },
-            fail: () => {
-                dataList.value = []
-            },
-            complete: () => {
-                loading.value = false
-            }
-        })
-    }
-
-    selectList.value = [
-        {
-            label: '商品分类',
-            key: 'zscategory',
-            options: getCategoryList(),
-        },
-    ]
-
-    inputList.value = [
-        { label: '单号', keys: ['wrtradeorderid'], type: 'number' },
-        { label: '买方', keys: ['buyusername'] },
-        { label: '商品', keys: ['zstabledisplay'] },
-    ]
-
-    const [reset, search] = buttonList.value
-    reset.onClick = () => {
-        resetFilter()
-        getBuyOrderList()
-    }
-    search.onClick = getBuyOrderList
-
-    return {
-        loading,
-        dataList,
-        total,
-        pageIndex,
-        pageSize,
-        columns,
-        inputList,
-        selectList,
-        buttonList,
-        getBuyOrderList,
-    }
-}
-
-/**
- * 求购大厅表单
- * @returns 
- */
-export function useBuyOrderForm() {
+export function useBuyOrderListing() {
     const { UserID, AccountIDs } = sessionData.getValue('loginInfo')
     const loading = shallowRef(false)
     const performanceId = shallowRef<number>() // 选中的履约模板ID
@@ -220,140 +103,10 @@ export function useBuyOrderForm() {
 }
 
 /**
- * 出售大厅
+ * 出售大厅挂牌
  * @returns 
  */
-export function useSellOrder() {
-    const { dataList, total, pageIndex, pageSize, inputList, selectList, buttonList, getQueryParam, resetFilter } = useDataTable<Ermcp.SellOrderRsp>()
-    const loading = shallowRef(false)
-
-    const columns = shallowRef<Ermcp.TableColumn[]>([
-        {
-            prop: 'wrtradeorderid',
-            label: '委托单号',
-            width: 200,
-            show: true,
-        },
-        {
-            prop: 'sellusername',
-            label: '卖方',
-            show: true,
-        },
-        {
-            prop: 'zscategorydisplay',
-            label: '商品分类',
-            show: true,
-        },
-        {
-            prop: 'goodsno',
-            label: '商品编号',
-            show: true,
-        },
-        {
-            prop: 'totalqty',
-            label: '总重量',
-            show: true,
-        },
-        {
-            prop: 'fixedprice',
-            label: '克拉单价',
-            show: true,
-        },
-        {
-            prop: 'remainqty',
-            label: '剩余重量',
-            show: true,
-        },
-        {
-            prop: 'wrtradeorderstatus',
-            label: '委托状态',
-            show: true,
-        },
-        {
-            prop: 'ordertime',
-            label: '委托时间',
-            width: 180,
-            show: true,
-        },
-        {
-            prop: 'tradedate',
-            label: '交易日',
-            show: true,
-        },
-        {
-            prop: 'operate',
-            label: '操作',
-            show: true,
-            fixed: 'right',
-        }
-    ])
-
-    // 获取出售大厅委托单
-    const getSellOrderList = () => {
-        const param = getQueryParam()
-        loading.value = true
-        return querySellOrder({
-            data: {
-                page: pageIndex.value,
-                pagesize: pageSize.value,
-                zscategory: param.zscategory,
-                wrtradeorderid: param.wrtradeorderid,
-                zsallproperties: param.goodsno,
-                buyusername: param.sellusername,
-            },
-            success: (res) => {
-                total.value = res.total
-                dataList.value = res.data
-            },
-            fail: () => {
-                dataList.value = []
-            },
-            complete: () => {
-                loading.value = false
-            }
-        })
-    }
-
-    selectList.value = [
-        {
-            label: '商品分类',
-            key: 'zscategory',
-            options: getCategoryList(),
-        },
-    ]
-
-    inputList.value = [
-        { label: '单号', keys: ['wrtradeorderid'], type: 'number' },
-        { label: '卖方', keys: ['sellusername'] },
-        { label: '商品', keys: ['goodsno'] },
-    ]
-
-    const [reset, search] = buttonList.value
-    reset.onClick = () => {
-        resetFilter()
-        getSellOrderList()
-    }
-    search.onClick = getSellOrderList
-
-    return {
-        loading,
-        dataList,
-        total,
-        pageIndex,
-        pageSize,
-        columns,
-        inputList,
-        selectList,
-        buttonList,
-        getSellOrderList,
-    }
-}
-
-/**
- * 出售大厅表单
- * @returns 
- */
-export function useSellOrderForm() {
+export function useSellOrderListing() {
     const { dataList } = useDataTable<Ermcp.MyWRPositionRsp>()
     const { UserID, AccountIDs } = sessionData.getValue('loginInfo')
     const submitLoading = shallowRef(false)
@@ -681,231 +434,4 @@ export function useSellOrderForm() {
         categoryChange,
         formSubmit,
     }
-}
-
-/**
- * 我的出售
- */
-export function useSaleOrder() {
-    const { dataList, total, pageIndex, pageSize, inputList, selectList, buttonList, getQueryParam, resetFilter } = useDataTable<Ermcp.MySellOrderRsp>()
-    const loading = shallowRef(false)
-
-    const columns = shallowRef<Ermcp.TableColumn[]>([
-        {
-            prop: 'wrtradeorderid',
-            label: '委托单号',
-            width: 200,
-            show: true,
-        },
-        {
-            prop: 'zscategorydisplay',
-            label: '商品分类',
-            show: true,
-        },
-        {
-            prop: 'goodsno',
-            label: '商品编号',
-            show: true,
-        },
-        {
-            prop: 'totalqty',
-            label: '委托重量',
-            show: true,
-        },
-        {
-            prop: 'fixedprice',
-            label: '克拉单价',
-            show: true,
-        },
-        {
-            prop: 'selledqty',
-            label: '成交重量',
-            show: true,
-        },
-        {
-            prop: 'wrtradeorderstatus',
-            label: '委托状态',
-            show: true,
-        },
-        {
-            prop: 'ordertime',
-            label: '委托时间',
-            width: 180,
-            show: true,
-        },
-        {
-            prop: 'operate',
-            label: '操作',
-            show: true,
-            fixed: 'right',
-        }
-    ])
-
-    // 获取我的出售列表
-    const getSaleOrderList = () => {
-        const param = getQueryParam()
-        loading.value = true
-        return queryMySellOrder({
-            data: {
-                page: pageIndex.value,
-                pagesize: pageSize.value,
-                userid: sessionData.getLoginInfo('UserID'),
-                zscategory: param.zscategory,
-                wrtradeorderid: param.wrtradeorderid,
-                zsallproperties: param.goodsno,
-            },
-            success: (res) => {
-                total.value = res.total
-                dataList.value = res.data
-            },
-            fail: () => {
-                dataList.value = []
-            },
-            complete: () => {
-                loading.value = false
-            }
-        })
-    }
-
-    selectList.value = [
-        {
-            label: '商品分类',
-            key: 'zscategory',
-            options: getCategoryList(),
-        },
-    ]
-
-    inputList.value = [
-        { label: '单号', keys: ['wrtradeorderid'], type: 'number' },
-        { label: '商品', keys: ['goodsno'] },
-    ]
-
-    const [reset, search] = buttonList.value
-    reset.onClick = () => {
-        resetFilter()
-        getSaleOrderList()
-    }
-    search.onClick = getSaleOrderList
-
-    return {
-        loading,
-        dataList,
-        total,
-        pageIndex,
-        pageSize,
-        columns,
-        inputList,
-        selectList,
-        buttonList,
-        getSaleOrderList,
-    }
-}
-
-/**
- * 我的求购
- */
-export function usePurchaseOrder() {
-    const { dataList, total, pageIndex, pageSize, inputList, selectList, buttonList, getQueryParam, resetFilter } = useDataTable<Ermcp.MyBuyOrderRsp>()
-    const loading = shallowRef(false)
-
-    const columns = shallowRef<Ermcp.TableColumn[]>([
-        {
-            prop: 'wrtradeorderid',
-            label: '委托单号',
-            width: 200,
-            show: true,
-        },
-        {
-            prop: 'zscategorydisplay',
-            label: '商品分类',
-            show: true,
-        },
-        {
-            prop: 'zstabledisplay',
-            label: '求购信息',
-            show: true,
-        },
-        {
-            prop: 'wrtradeorderstatus',
-            label: '状态',
-            show: true,
-        },
-        {
-            prop: 'validtime',
-            label: '有效日期',
-            width: 180,
-            show: true,
-        },
-        {
-            prop: 'ordertime',
-            label: '委托时间',
-            width: 180,
-            show: true,
-        },
-        {
-            prop: 'operate',
-            label: '操作',
-            show: true,
-            fixed: 'right',
-        }
-    ])
-
-    // 获取我的求购列表
-    const getPurchaseOrderList = () => {
-        const param = getQueryParam()
-        loading.value = true
-        return queryMyBuyOrder({
-            data: {
-                page: pageIndex.value,
-                pagesize: pageSize.value,
-                userid: sessionData.getLoginInfo('UserID'),
-                zscategory: param.zscategory,
-                wrtradeorderid: param.wrtradeorderid,
-                zsallproperties: param.zstabledisplay,
-            },
-            success: (res) => {
-                total.value = res.total
-                dataList.value = res.data
-            },
-            fail: () => {
-                dataList.value = []
-            },
-            complete: () => {
-                loading.value = false
-            }
-        })
-    }
-
-    selectList.value = [
-        {
-            label: '商品分类',
-            key: 'zscategory',
-            options: getCategoryList(),
-        },
-    ]
-
-    inputList.value = [
-        { label: '单号', keys: ['wrtradeorderid'], type: 'number' },
-        { label: '商品', keys: ['zstabledisplay'] },
-    ]
-
-    const [reset, search] = buttonList.value
-    reset.onClick = () => {
-        resetFilter()
-        getPurchaseOrderList()
-    }
-    search.onClick = getPurchaseOrderList
-
-    return {
-        loading,
-        dataList,
-        total,
-        pageIndex,
-        pageSize,
-        columns,
-        inputList,
-        selectList,
-        buttonList,
-        getPurchaseOrderList,
-    }
 }

+ 15 - 5
src/constants/enum/funcode.ts

@@ -6,11 +6,11 @@ export enum FunCode {
     MoneyChangedNotify = 131076, // 资金变化通知
 
     // 行情内容
-    QuoteBeat = 0x12, // 心跳
-    QuoteSubscribeReq = 0x20, // 实时行情订阅请求
-    QuoteSubscribeRsp = 0x21, // 实时行情订阅响应
-    QueryQuoteReq = 0x22, // 盘面查询请求
-    QueryQuoteRsp = 0x23, // 盘面查询应答
+    QuoteBeat = 18, // 心跳
+    QuoteSubscribeReq = 32, // 实时行情订阅请求
+    QuoteSubscribeRsp = 33, // 实时行情订阅响应
+    QueryQuoteReq = 34, // 盘面查询请求
+    QueryQuoteRsp = 35, // 盘面查询应答
 
     // --------  账户操作相关接口 -----------
     LoginReq = 65537, // 用户登录请求
@@ -31,4 +31,14 @@ export enum FunCode {
     ZSBuyOrderListingRsp = 1441838, //钻石买挂牌接口应答
     ZSSellOrderListingReq = 1441829, // 钻石卖挂牌接口请求
     ZSSellOrderListingRsp = 1441830, // 钻石卖挂牌接口响应
+    ZSBuyOrderDestingReq = 1441831, // 钻石买摘牌接口请求
+    ZSBuyOrderDestingRsp = 1441832, // 钻石买摘牌接口响应
+    ZSSellOrderDestingApplyReq = 1441839, // 钻石卖摘牌申请接口请求
+    ZSSellOrderDestingApplyRsp = 1441840, // 钻石卖摘牌申请接口响应
+    ZSSellOrderDestingApplyOperateReq = 1441841, // 钻石卖摘牌申请操作接口请求
+    ZSSellOrderDestingApplyOperateRsp = 1441842, // 钻石卖摘牌申请操作接口应答
+    ZSBuyOrderDestingNegPriceReq = 1441833, // 买摘牌询价接口请求
+    ZSBuyOrderDestingNegPriceRsp = 1441834, // 买摘牌询价接口应答
+    ZSBuyOrderDestingNegPriceOperateReq = 1441835, // 买摘牌询价操作接口请求
+    ZSBuyOrderDestingNegPriceOperateRsp = 1441836, // 买摘牌询价操作接口应答
 }

+ 35 - 19
src/mock/router.ts

@@ -59,6 +59,41 @@ const appmenu = {
                     {
                         authType: 1,
                         sort: 1,
+                        title: '出售大厅',
+                        code: 'listing_sell',
+                        url: 'sell',
+                        urlType: 1,
+                        component: 'views/listing/sell/index.vue',
+                        children: [
+                            {
+                                authType: 3,
+                                title: '我要出售',
+                                code: 'listing_sell_add',
+                                component: 'views/listing/sell/components/add/index.vue',
+                                buttonName: 'add',
+                                buttonType: 'primary',
+                            },
+                            {
+                                authType: 3,
+                                title: '摘牌',
+                                code: 'listing_sell_delisting',
+                                component: 'views/listing/sell/components/delisting/index.vue',
+                                buttonName: 'delisting',
+                                buttonType: 'primary',
+                            },
+                            {
+                                authType: 3,
+                                title: '询价',
+                                code: 'listing_sell_inquire',
+                                component: 'views/listing/sell/components/inquire/index.vue',
+                                buttonName: 'inquire',
+                                buttonType: 'primary',
+                            },
+                        ]
+                    },
+                    {
+                        authType: 1,
+                        sort: 1,
                         title: '求购大厅',
                         code: 'listing_buy',
                         url: '',
@@ -94,25 +129,6 @@ const appmenu = {
                     {
                         authType: 1,
                         sort: 1,
-                        title: '出售大厅',
-                        code: 'listing_sell',
-                        url: 'sell',
-                        urlType: 1,
-                        component: 'views/listing/sell/index.vue',
-                        children: [
-                            {
-                                authType: 3,
-                                title: '我要出售',
-                                code: 'listing_sell_add',
-                                component: 'views/listing/sell/components/add/index.vue',
-                                buttonName: 'add',
-                                buttonType: 'primary',
-                            },
-                        ]
-                    },
-                    {
-                        authType: 1,
-                        sort: 1,
                         title: '我的出售',
                         code: 'listing_sale',
                         url: 'sale',

+ 4 - 8
src/packages/pc/components/base/table-filter/index.less

@@ -1,14 +1,10 @@
 .app-table-filter {
-    display         : flex;
-    flex-wrap       : wrap;
-    background-color: #fff;
-    border-radius   : 4px;
-    padding         : 20px;
-    padding-bottom  : 10px;
+    display  : flex;
+    flex-wrap: wrap;
+    gap      : 12px;
 
     .el-form-item {
-        margin-right : 10px;
-        margin-bottom: 10px;
+        margin: 0;
     }
 
     .el-select {

+ 11 - 5
src/packages/pc/components/layouts/view/index.less

@@ -15,20 +15,26 @@
     &__main {
         padding   : 0 20px;
         margin-top: 15px;
-
-        &:empty {
-            display: none;
-        }
     }
 
     &__header {
         margin-top: 20px;
     }
 
-    &__main &__container {
+    &__header &__container {
+        display  : flex;
+        flex-wrap: wrap;
+        gap      : 12px;
+    }
+
+    &__container {
         border-radius   : 4px;
         background-color: #fff;
         padding         : 20px;
+
+        &:empty {
+            display: none;
+        }
     }
 
     &--flex {

+ 3 - 1
src/packages/pc/components/layouts/view/index.vue

@@ -1,7 +1,9 @@
 <template>
   <div ref="scrollElement" :class="['app-view', flex && 'app-view--flex']">
     <div class="app-view__header">
-      <slot name="header"></slot>
+      <div class="app-view__container">
+        <slot name="header"></slot>
+      </div>
     </div>
     <div class="app-view__main">
       <div class="app-view__container">

+ 3 - 2
src/packages/pc/components/modules/auth-operation/index.vue

@@ -29,8 +29,9 @@
             </el-dropdown>
             <ul v-else>
                 <li v-for="(item, index) in dataList" :key="index">
-                    <el-button :class="item.code" :type="item.buttonType" :disabled="item.code === componentId"
-                        @click="openComponent(item.code)" :link="linkButton">
+                    <el-button :class="item.code" :type="item.buttonType"
+                        :disabled="item.disabled || item.code === componentId" @click="openComponent(item.code)"
+                        :link="linkButton">
                         <el-icon v-if="item.icon">
                             <component :is="item.icon" />
                         </el-icon>

+ 38 - 0
src/packages/pc/components/modules/goods-details/index.vue

@@ -0,0 +1,38 @@
+<template>
+    <teleport :to="teleport">
+        <app-view class="app-details" v-loading="loading" v-bind="$attrs">
+            <slot></slot>
+            <el-button @click="onClick">返回</el-button>
+        </app-view>
+    </teleport>
+</template>
+
+<script lang="ts" setup>
+import { PropType } from 'vue'
+import { useDiamondDetails } from '@/business/goods'
+
+const props = defineProps({
+    teleport: {
+        type: String as PropType<'#appPageTeleport' | '#appMainTeleport'>,
+        default: '#appMainTeleport'
+    },
+    loading: {
+        type: Boolean,
+        default: false,
+    },
+    goodsno: {
+        type: String,
+        required: true
+    },
+})
+
+const emit = defineEmits(['closed'])
+
+const { getDiamondDetails } = useDiamondDetails(props.goodsno)
+
+const onClick = () => {
+    emit('closed')
+}
+
+getDiamondDetails()
+</script>

+ 2 - 2
src/packages/pc/views/listing/buy/components/add/index.vue

@@ -84,7 +84,7 @@
 import { ref, defineAsyncComponent } from 'vue'
 import { ElMessage } from 'element-plus'
 import type { FormInstance, FormRules } from 'element-plus'
-import { useBuyOrderForm } from '@/business/order'
+import { useBuyOrderListing } from '@/business/order/listing'
 import { Category } from '@/constants/enum/diamond'
 import AppDrawer from '@pc/components/base/drawer/index.vue'
 import AppMultiple from '@pc/components/base/multiple/index.vue'
@@ -93,7 +93,7 @@ const components = {
     performance: defineAsyncComponent(() => import('@pc/components/modules/performance/index.vue')),
 }
 
-const { loading, performanceId, currencyId, formData, enums, formSubmit } = useBuyOrderForm()
+const { loading, performanceId, currencyId, formData, enums, formSubmit } = useBuyOrderListing()
 const show = ref(true)
 const refresh = ref(false)
 const formRef = ref<FormInstance>()

+ 15 - 4
src/packages/pc/views/listing/buy/index.vue

@@ -7,14 +7,14 @@
         <!-- 表格数据 -->
         <app-table :data="dataList" v-model:columns="columns" :loading="loading">
             <template #header>
-                <app-auth-operation :menus="['add']" @closed="getBuyOrderList" />
+                <app-auth-operation :menus="headerButtons" @closed="getBuyOrderList" />
             </template>
             <!-- 操作 -->
             <template #operate="{ row }">
-                <app-auth-operation :menus="['details', 'delisting']" :options="{ selectedRow: row }"
+                <app-auth-operation :menus="handleOperateButtons(row)" :options="{ selectedRow: row }"
                     @closed="getBuyOrderList" />
             </template>
-            <template #footer v-if="total > pageSize">
+            <template #footer>
                 <app-pagination :total="total" v-model:page-size="pageSize" v-model:page-index="pageIndex"
                     @change="getBuyOrderList" />
             </template>
@@ -24,13 +24,24 @@
 
 <script lang="ts" setup>
 import { ElMessage } from 'element-plus'
-import { useBuyOrder } from '@/business/order'
+import { useBuyOrder } from '@/business/order/list'
+import { sessionData } from '@/stores'
 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 { loading, dataList, columns, total, pageIndex, pageSize, selectList, inputList, buttonList, getBuyOrderList } = useBuyOrder()
+const headerButtons = ['add']
+const operateButtons = ['details', 'delisting']
+
+const handleOperateButtons = (row: Ermcp.SellOrderRsp) => {
+    if (row.userid === sessionData.getLoginInfo('UserID')) {
+        // 自己上架的商品不能摘牌
+        return operateButtons.filter((code) => !['delisting'].includes(code))
+    }
+    return operateButtons
+}
 
 getBuyOrderList().catch((err) => ElMessage.error(err))
 </script>

+ 25 - 1
src/packages/pc/views/listing/delisting/index.vue

@@ -1,9 +1,33 @@
 <!-- 挂牌大厅-我的摘牌 -->
 <template>
     <app-view>
-        我的摘牌
+        <template #header>
+            <app-filter v-bind="{ selectList, inputList, buttonList }" :loading="loading" />
+        </template>
+        <!-- 表格数据 -->
+        <app-table :data="dataList" v-model:columns="columns" :loading="loading">
+            <!-- 操作 -->
+            <template #operate="{ row }">
+                <app-auth-operation :menus="['details']" :options="{ selectedRow: row }"
+                    @closed="getDelistingOrderList" />
+            </template>
+            <template #footer>
+                <app-pagination :total="total" v-model:page-size="pageSize" v-model:page-index="pageIndex"
+                    @change="getDelistingOrderList" />
+            </template>
+        </app-table>
     </app-view>
 </template>
 
 <script lang="ts" setup>
+import { ElMessage } from 'element-plus'
+import { useDelistingOrder } from '@/business/order/list'
+import AppTable from '@pc/components/base/table/index.vue'
+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, columns, selectList, inputList, buttonList, getDelistingOrderList } = useDelistingOrder()
+
+getDelistingOrderList().catch((err) => ElMessage.error(err))
 </script>

+ 31 - 1
src/packages/pc/views/listing/inquire/index.vue

@@ -1,9 +1,39 @@
 <!-- 挂牌大厅-我的询价 -->
 <template>
     <app-view>
-        我的询价
+        <template #header>
+            <el-radio-group v-model="selectedBuyOrSell" :disabled="loading" @change="getInquireOrderList">
+                <el-radio-button :label="item.value" v-for="(item, index) in buyOrSell" :key="index">
+                    {{ item.label }}
+                </el-radio-button>
+            </el-radio-group>
+            <el-select v-model="selectedStatus" :disabled="loading" @change="getInquireOrderList" style="width:160px">
+                <el-option v-for="option in status" :key="option.value" :value="option.value" :label="option.label" />
+            </el-select>
+        </template>
+        <!-- 表格数据 -->
+        <app-table :data="dataList" v-model:columns="columns" :loading="loading">
+            <!-- 操作 -->
+            <template #operate="{ row }">
+                <app-auth-operation :menus="['details']" :options="{ selectedRow: row }"
+                    @closed="getInquireOrderList" />
+            </template>
+            <template #footer>
+                <app-pagination :total="total" v-model:page-size="pageSize" v-model:page-index="pageIndex"
+                    @change="getInquireOrderList" />
+            </template>
+        </app-table>
     </app-view>
 </template>
 
 <script lang="ts" setup>
+import { ElMessage } from 'element-plus'
+import { useInquireOrder } from '@/business/order/list'
+import AppTable from '@pc/components/base/table/index.vue'
+import AppPagination from '@pc/components/base/pagination/index.vue'
+import AppAuthOperation from '@pc/components/modules/auth-operation/index.vue'
+
+const { loading, dataList, total, pageIndex, pageSize, columns, buyOrSell, status, selectedBuyOrSell, selectedStatus, getInquireOrderList } = useInquireOrder()
+
+getInquireOrderList().catch((err) => ElMessage.error(err))
 </script>

+ 2 - 2
src/packages/pc/views/listing/purchase/index.vue

@@ -11,7 +11,7 @@
                 <app-auth-operation :menus="['details']" :options="{ selectedRow: row }"
                     @closed="getPurchaseOrderList" />
             </template>
-            <template #footer v-if="total > pageSize">
+            <template #footer>
                 <app-pagination :total="total" v-model:page-size="pageSize" v-model:page-index="pageIndex"
                     @change="getPurchaseOrderList" />
             </template>
@@ -21,7 +21,7 @@
 
 <script lang="ts" setup>
 import { ElMessage } from 'element-plus'
-import { usePurchaseOrder } from '@/business/order'
+import { usePurchaseOrder } from '@/business/order/list'
 import AppTable from '@pc/components/base/table/index.vue'
 import AppPagination from '@pc/components/base/pagination/index.vue'
 import AppAuthOperation from '@pc/components/modules/auth-operation/index.vue'

+ 2 - 2
src/packages/pc/views/listing/sale/index.vue

@@ -10,7 +10,7 @@
             <template #operate="{ row }">
                 <app-auth-operation :menus="['details']" :options="{ selectedRow: row }" @closed="getSaleOrderList" />
             </template>
-            <template #footer v-if="total > pageSize">
+            <template #footer>
                 <app-pagination :total="total" v-model:page-size="pageSize" v-model:page-index="pageIndex"
                     @change="getSaleOrderList" />
             </template>
@@ -20,7 +20,7 @@
 
 <script lang="ts" setup>
 import { ElMessage } from 'element-plus'
-import { useSaleOrder } from '@/business/order'
+import { useSaleOrder } from '@/business/order/list'
 import AppTable from '@pc/components/base/table/index.vue'
 import AppPagination from '@pc/components/base/pagination/index.vue'
 import AppAuthOperation from '@pc/components/modules/auth-operation/index.vue'

+ 3 - 3
src/packages/pc/views/listing/sell/components/add/index.vue

@@ -1,4 +1,4 @@
-<!-- 求购大厅-我要出售 -->
+<!-- 出售大厅-我要出售 -->
 <template>
     <app-drawer title="我要出售" :width="960" v-model:show="show" :loading="submitLoading" :refresh="refresh">
         <el-form ref="formRef" class="el-form--horizontal" label-width="100px" :model="formData" :rules="formRules">
@@ -43,7 +43,7 @@ import { ref, defineAsyncComponent } from 'vue'
 import Long from 'long'
 import { ElMessage } from 'element-plus'
 import type { FormInstance, FormRules } from 'element-plus'
-import { useSellOrderForm } from '@/business/order'
+import { useSellOrderListing } from '@/business/order/listing'
 import AppDrawer from '@pc/components/base/drawer/index.vue'
 import AppTable from '@pc/components/base/table/index.vue'
 
@@ -51,7 +51,7 @@ const components = {
     performance: defineAsyncComponent(() => import('@pc/components/modules/performance/index.vue')),
 }
 
-const { tableLoading, submitLoading, formData, dataList, columns, selectedCategoryId, categoryList, categoryChange, formSubmit } = useSellOrderForm()
+const { tableLoading, submitLoading, formData, dataList, columns, selectedCategoryId, categoryList, categoryChange, formSubmit } = useSellOrderListing()
 const show = ref(true)
 const refresh = ref(false)
 const formRef = ref<FormInstance>()

+ 44 - 0
src/packages/pc/views/listing/sell/components/delisting/index.vue

@@ -0,0 +1,44 @@
+<!-- 出售大厅-我要出售-摘牌 -->
+<template>
+    <app-details :goodsno="selectedRow.goodsno" :loading="loading">
+        <el-descriptions title="基本信息【单颗裸钻】" :column="2">
+            <el-descriptions-item label="商品编号">DKLZ00000001</el-descriptions-item>
+            <el-descriptions-item label="价格">¥10023.23</el-descriptions-item>
+            <el-descriptions-item label="克拉重量">223.23 克拉</el-descriptions-item>
+            <el-descriptions-item label="克拉单价">¥100.92</el-descriptions-item>
+        </el-descriptions>
+        <el-divider />
+        <el-descriptions title="钻石属性" :column="2">
+            <el-descriptions-item label="形状">圆明亮形(Round)</el-descriptions-item>
+            <el-descriptions-item label="尺寸">1.21 * 1.33 * 1.34</el-descriptions-item>
+            <el-descriptions-item label="颜色">E</el-descriptions-item>
+            <el-descriptions-item label="净度">FL</el-descriptions-item>
+        </el-descriptions>
+        <el-divider />
+        <el-button type="primary" @click="onSubmit">摘牌</el-button>
+    </app-details>
+</template>
+
+<script lang="ts" setup>
+import { PropType } from 'vue'
+import { ElMessage } from 'element-plus'
+import { useBuyOrderDesting } from '@/business/order/desting'
+import AppDetails from '@pc/components/modules/goods-details/index.vue'
+
+const props = defineProps({
+    selectedRow: {
+        type: Object as PropType<Ermcp.SellOrderRsp>,
+        default: () => ({})
+    }
+})
+
+const { loading, formSubmit } = useBuyOrderDesting(props.selectedRow)
+
+const onSubmit = () => {
+    formSubmit().then(() => {
+        ElMessage.success('提交成功')
+    }).catch((err) => {
+        ElMessage.error('提交失败:' + err)
+    })
+}
+</script>

+ 16 - 4
src/packages/pc/views/listing/sell/index.vue

@@ -7,13 +7,14 @@
         <!-- 表格数据 -->
         <app-table :data="dataList" v-model:columns="columns" :loading="loading">
             <template #header>
-                <app-auth-operation :menus="['add']" @closed="getSellOrderList" />
+                <app-auth-operation :menus="headerButtons" @closed="getSellOrderList" />
             </template>
             <!-- 操作 -->
             <template #operate="{ row }">
-                <app-auth-operation :menus="['details']" :options="{ selectedRow: row }" @closed="getSellOrderList" />
+                <app-auth-operation :menus="handleOperateButtons(row)" :options="{ selectedRow: row }"
+                    @closed="getSellOrderList" />
             </template>
-            <template #footer v-if="total > pageSize">
+            <template #footer>
                 <app-pagination :total="total" v-model:page-size="pageSize" v-model:page-index="pageIndex"
                     @change="getSellOrderList" />
             </template>
@@ -23,13 +24,24 @@
 
 <script lang="ts" setup>
 import { ElMessage } from 'element-plus'
-import { useSellOrder } from '@/business/order'
+import { useSellOrder } from '@/business/order/list'
+import { sessionData } from '@/stores'
 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 { loading, dataList, columns, total, pageIndex, pageSize, selectList, inputList, buttonList, getSellOrderList } = useSellOrder()
+const headerButtons = ['add']
+const operateButtons = ['details', 'delisting', 'inquire', 'favorite']
+
+const handleOperateButtons = (row: Ermcp.SellOrderRsp) => {
+    if (row.userid === sessionData.getLoginInfo('UserID')) {
+        // 自己上架的商品不能摘牌和询价
+        return operateButtons.filter((code) => !['delisting', 'inquire'].includes(code))
+    }
+    return operateButtons
+}
 
 getSellOrderList().catch((err) => ElMessage.error(err))
 </script>

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

@@ -20,7 +20,5 @@ import AppFilter from '@pc/components/base/table-filter/index.vue'
 
 const { dataList, columns, selectList, buttonList, loading, getAccountInOutApply } = useAccountInOut()
 
-getAccountInOutApply().catch((err) => {
-    ElMessage.error(err)
-})
+getAccountInOutApply().catch((err) => ElMessage.error(err))
 </script>

+ 2 - 4
src/packages/pc/views/system/menu/index.vue

@@ -30,7 +30,7 @@ const componentMap = new Map<string, unknown>([
 ])
 
 const { dataList, columns, getMenuList } = useMenu()
-const { componentId, openComponent, closeComponent } = useComponent(getMenuList)
+const { componentId, openComponent, closeComponent } = useComponent(() => getMenuList())
 const tableRef = ref()
 const isRowExpansion = ref(false)
 const selectedRow = ref<Ermcp.NewFuncmenuRsp>()
@@ -55,9 +55,7 @@ const tableExpandAll = () => {
     toggleRowExpansionAll(dataList.value)
 }
 
-getMenuList().catch((err) => {
-    ElMessage.error(err)
-})
+getMenuList().catch((err) => ElMessage.error(err))
 </script>
 
 <style lang="less">

+ 1 - 1
src/packages/pc/views/warehousing/stock/index.vue

@@ -21,7 +21,7 @@
             <template #operate="{ row }">
                 <app-auth-operation :menus="['details']" :options="{ selectedRow: row }" @closed="getDiamondList" />
             </template>
-            <template #footer v-if="total > pageSize">
+            <template #footer>
                 <app-pagination :total="total" v-model:page-size="pageSize" v-model:page-index="pageIndex"
                     @change="getDiamondList" />
             </template>

+ 1 - 1
src/packages/pc/views/warehousing/warehouse/index.vue

@@ -8,7 +8,7 @@
             <template #operate="{ row }">
                 <app-auth-operation :menus="['edit']" :options="{ selectedRow: row }" @closed="getWarehouseList" />
             </template>
-            <template #footer v-if="total > pageSize">
+            <template #footer>
                 <app-pagination :total="total" v-model:page-size="pageSize" v-model:page-index="pageIndex"
                     @change="getWarehouseList" />
             </template>

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

@@ -19,6 +19,13 @@ export function queryDiamondList(params: HttpRequest<{ req: Ermcp.MyWRPositionRe
 }
 
 /**
+ * 获取钻石详情
+ */
+export function queryDiamondDetails(params: HttpRequest<{ req: Ermcp.DiamondDetailsReq, rsp: Ermcp.DiamondDetailsRsp[] }>) {
+    return httpRequest('/Guangzuan/GetGoods', 'get', params);
+}
+
+/**
  * 新增钻石商品
  */
 export function addZSGoods(params: TradeRequest<Proto.AddZSGoodsReq, Proto.AddZSGoodsRsp>) {

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

@@ -19,6 +19,41 @@ export function zsSellOrderListing(params: TradeRequest<Proto.ZSSellOrderListing
 }
 
 /**
+ * 钻石买摘牌
+ */
+export function zsBuyOrderDesting(params: TradeRequest<Proto.ZSBuyOrderDestingReq, Proto.ZSBuyOrderDestingRsp>) {
+    return tradeServerRequest('ZSBuyOrderDestingReq', 'ZSBuyOrderDestingRsp', params, Market.GZ);
+}
+
+/**
+ * 钻石买摘牌询价
+ */
+export function zsBuyOrderDestingNegPrice(params: TradeRequest<Proto.ZSBuyOrderDestingNegPriceReq, Proto.ZSBuyOrderDestingNegPriceRsp>) {
+    return tradeServerRequest('ZSBuyOrderDestingNegPriceReq', 'ZSBuyOrderDestingNegPriceRsp', params, Market.GZ);
+}
+
+/**
+ * 钻石买摘牌询价操作
+ */
+export function zsBuyOrderDestingNegPriceOperate(params: TradeRequest<Proto.ZSBuyOrderDestingNegPriceOperateReq, Proto.ZSBuyOrderDestingNegPriceOperateRsp>) {
+    return tradeServerRequest('ZSBuyOrderDestingNegPriceOperateReq', 'ZSBuyOrderDestingNegPriceOperateRsp', params, Market.GZ);
+}
+
+/**
+ * 钻石卖摘牌申请
+ */
+export function zsSellOrderDestingApply(params: TradeRequest<Proto.ZSSellOrderDestingApplyReq, Proto.ZSSellOrderDestingApplyRsp>) {
+    return tradeServerRequest('ZSSellOrderDestingApplyReq', 'ZSSellOrderDestingApplyRsp', params, Market.GZ);
+}
+
+/**
+ * 钻石卖摘牌申请操作
+ */
+export function zsSellOrderDestingApplyOperate(params: TradeRequest<Proto.ZSSellOrderDestingApplyOperateReq, Proto.ZSSellOrderDestingApplyOperateRsp>) {
+    return tradeServerRequest('ZSSellOrderDestingApplyOperateReq', 'ZSSellOrderDestingApplyOperateRsp', params, Market.GZ);
+}
+
+/**
  * 查询求购大厅委托单
  */
 export function queryBuyOrder(params: HttpRequest<{ req: Ermcp.BuyOrderReq, rsp: Ermcp.BuyOrderRsp[] }>) {
@@ -51,4 +86,25 @@ export function querySellOrder(params: HttpRequest<{ req: Ermcp.SellOrderReq, rs
  */
 export function queryMySellOrder(params: HttpRequest<{ req: Ermcp.MySellOrderReq, rsp: Ermcp.MySellOrderRsp[] }>) {
     return httpRequest('/Guangzuan/QueryMySellOrder', 'get', params);
+}
+
+/**
+ * 查询我的摘牌
+ */
+export function queryMyDeListing(params: HttpRequest<{ req: Ermcp.MyDeListingReq, rsp: Ermcp.MyDeListingRsp[] }>) {
+    return httpRequest('/Guangzuan/QueryMyDeListing', 'get', params);
+}
+
+/**
+ * 查询我的询价-求购
+ */
+export function queryMyBargainApply(params: HttpRequest<{ req: Ermcp.MyBargainApplyReq, rsp: Ermcp.MyBargainApplyRsp[] }>) {
+    return httpRequest('/Guangzuan/QueryMyBargainApply', 'get', params);
+}
+
+/**
+ * 查询我的询价-出售
+ */
+export function queryMyDelistingApply(params: HttpRequest<{ req: Ermcp.MyDelistingApplyReq, rsp: Ermcp.MyBargainApplyRsp[] }>) {
+    return httpRequest('/Guangzuan/QueryMyDelistingApply', 'get', params);
 }

+ 18 - 17
src/services/socket/trade/index.ts

@@ -4,7 +4,7 @@ import { FunCode } from '@/constants/enum/funcode'
 import { sessionData } from '@/stores'
 import { IMessageHead } from './protobuf/proto'
 import { TradeRequest, TradeResponse } from './interface'
-import protobuf from './protobuf'
+import Protobuf from './protobuf'
 import socket from '../index'
 
 /**
@@ -27,37 +27,38 @@ function getProtoHeader(funCode: keyof typeof FunCode, header?: IMessageHead, ma
 /**
  * 向交易服务器发送请求
  * @param params 请求参数
- * @param reqCode 请求代码
- * @param rspCode 回调代码
+ * @param reqKey 请求代码
+ * @param rspKey 回调代码
  * @param marketId 市场ID
  */
-function tradeServerMiddleware<Req, Rsp>(reqCode: keyof typeof FunCode, rspCode: keyof typeof FunCode, params: TradeRequest<Req, Rsp>, marketId?: number): Promise<Rsp> {
-    params.data.Header = getProtoHeader(reqCode, params.data.Header, marketId);
-    console.log(reqCode, FunCode[reqCode], params.data);
+function tradeServerMiddleware<Req, Rsp>(reqKey: keyof typeof FunCode, rspKey: keyof typeof FunCode, params: TradeRequest<Req, Rsp>, marketId?: number): Promise<Rsp> {
+    params.data.Header = getProtoHeader(reqKey, params.data.Header, marketId);
+    console.log(reqKey, FunCode[reqKey], params.data);
 
     return new Promise((resolve, reject) => {
-        protobuf.requestEncode(reqCode, params.data).then((res) => {
+        Protobuf.requestEncode(reqKey, params.data).then((res) => {
             // 发送消息
             socket.sendTradeServer({
                 data: {
-                    payload: new Package50(FunCode[reqCode], res)
+                    rspCode: FunCode[rspKey],
+                    payload: new Package50(FunCode[reqKey], res)
                 },
                 success: (raw) => {
-                    protobuf.responseDecode<Rsp>(rspCode, raw.content).then((res) => {
-                        console.log(rspCode, FunCode[rspCode], res);
+                    Protobuf.responseDecode<Rsp>(rspKey, raw.content).then((res) => {
+                        console.log(rspKey, FunCode[rspKey], res);
                         resolve(res);
                     }).catch(() => {
-                        console.warn(rspCode, raw);
+                        console.error(rspKey, raw);
                         reject('报文解析失败');
                     })
                 },
                 fail: (err) => {
-                    console.error(reqCode, err);
+                    console.error(reqKey, err);
                     reject(err);
                 }
             })
         }).catch((msg) => {
-            console.error(reqCode, msg);
+            console.error(reqKey, msg);
             reject('报文构建失败');
         })
     })
@@ -65,15 +66,15 @@ function tradeServerMiddleware<Req, Rsp>(reqCode: keyof typeof FunCode, rspCode:
 
 /**
  * 向交易服务器发送请求
+ * @param reqKey 
+ * @param rspKey 
  * @param params 
- * @param reqCode 
- * @param rspCode 
  * @param marketId 
  */
-export async function tradeServerRequest<Req, Rsp>(reqCode: keyof typeof FunCode, rspCode: keyof typeof FunCode, params: TradeRequest<Req, Rsp & TradeResponse>, marketId?: number) {
+export async function tradeServerRequest<Req, Rsp>(reqKey: keyof typeof FunCode, rspKey: keyof typeof FunCode, params: TradeRequest<Req, Rsp & TradeResponse>, marketId?: number) {
     const { success, fail, complete } = params;
 
-    await tradeServerMiddleware(reqCode, rspCode, params, marketId).then((res) => {
+    await tradeServerMiddleware(reqKey, rspKey, params, marketId).then((res) => {
         const { RetCode, RetDesc } = res;
 
         switch (RetCode) {

+ 1 - 1
src/types/ermcp/account.d.ts

@@ -274,8 +274,8 @@ declare global {
             icon: string; // 菜单图标
             buttonName: string; // 按钮名称
             buttonType: string; // 按钮类型
-            sort: number; // 排序
             hidden: boolean; // 是否隐藏
+            sort: number; // 排序
             remark: string; // 备注
             children?: UserMenu[],
         }

+ 78 - 0
src/types/ermcp/goods.d.ts

@@ -95,4 +95,82 @@ declare namespace Ermcp {
         zssymmetrytype2: number; // 对称度2 - 枚举”ZSSymmetryType“ - 类型:1
         zssymmetrytype2display: string;
     }
+
+    /** 获取钻石详情请求 */
+    interface DiamondDetailsReq {
+        goodsno: string; // 商品编号
+    }
+
+    /** 获取钻石详情请求 */
+    interface DiamondDetailsRsp {
+        cerno: string; // 证书编号 - 类型:2,4,5
+        cpcertno: string; // 金伯利证书编号 - 类型:3
+        goodsno: string; // 商品编号
+        imagepath: string; // 商品照片(相对地址)
+        isvalid: number; // 是否有效 - 0:无效 1:有效
+        kppath: string; // 金伯利证书图片(相对地址) - 类型:3
+        kpweight: string; // 金伯利证书重量 - 类型:3
+        marketprice: string; // 市场价
+        mobile: string; // 手机号码
+        origin: string; // 原产地 - 类型:3
+        price: number; // 总价(价格) - 类型:1,2,3,4,5
+        priceper: string; // 克拉单价 - 类型:1,2,3,5
+        remark: string; // 备注
+        sellusername: string; // 账户名称(机构名称)
+        settingmaterial: string; // 镶嵌材料 - 类型:4
+        size1: string; // 尺寸1 - 类型:2,4,5
+        size2: string; // 尺寸2 - 类型:2,4,5
+        size3: string; // 尺寸3 - 类型:2,4,5
+        stonedesc: string; // 配石描述 - 类型:4
+        userid: number; // 用户ID
+        warehouseid: number; // 仓库ID
+        warehousenamedisplay: string;
+        weight: number; // 总重量(克拉重量) - 类型:1,2,3,4,5
+        weightavg: number; // 平均单颗重量 - 类型:1,3
+        wrpath: string; // 仓单扫描件(相对地址)
+        wrstandardid: number; // 现货商品ID
+        zscategory: number; // 钻石分类 - 枚举”ZSCategory“
+        zscategorydisplay: string;
+        zscerttype: number; // 证书类型 - 枚举”ZSCertType“ - 类型:2,4,5
+        zscerttypedisplay: string;
+        zsclaritytype1: number; // 净度1 - 枚举”ZSClarityType“ - 类型:1,2,3,4,5
+        zsclaritytype1display: string;
+        zsclaritytype2: number; // 净度2 - 枚举”ZSClarityType“ - 类型:1,3
+        zsclaritytype2display: string;
+        zscolortype1: number; // 颜色1 - 枚举”ZSColorType“ - 类型:1,2,3,4
+        zscolortype1display: string;
+        zscolortype2: number; // 颜色2 - 枚举”ZSColorType“ - 类型:1,3
+        zscolortype2display: string;
+        zscrystaltype: string; // 晶型范围 - 枚举“ZSCrystalType“ - 类型:3, 多个,逗号分隔
+        zscrystaltypedisplay: string;
+        zscurrencytype: number; // 货币类型 - 枚举“ZSCurrencyType”
+        zscurrencytypedisplay: string;
+        zscurrencytypedisplayunit: string;
+        zscuttype1: number; // 切工1 - 枚举”ZSCutType“ - 类型:1,2,4,5
+        zscuttype1display: string;
+        zscuttype2: number; // 切工2 - 枚举”ZSCutType“ - 类型:1
+        zscuttype2display: string;
+        zsczcolor1type: number; // 彩钻颜色1 - 枚举”ZSCZColor1Type“ - 类型:5
+        zsczcolor1typedisplay: string;
+        zsczcolor2type: number; // 彩钻颜色2 - 枚举”ZSCZColor2Type“ - 类型:5
+        zsczcolor2typedisplay: string;
+        zsczcolor3type: number; // 彩钻颜色3 - 枚举”ZSCZColor3Type“ - 类型:5
+        zsczcolor3typedisplay: string;
+        zsfluorescencetype1: number; // 荧光1 - 枚举”ZSFluorescenceType“ - 类型:1,2,3,4,5
+        zsfluorescencetype1display: string;
+        zsfluorescencetype2: number; // 荧光2 - 枚举”ZSFluorescenceType” - 类型:1,3
+        zsfluorescencetype2display: string;
+        zspolishtype1: number; // 抛光度1 - 枚举”ZSPolishType“ - 类型:1,2,4,5
+        zspolishtype1display: string;
+        zspolishtype2: number; // 抛光度2 - 枚举”ZSPolishType“ - 类型:1
+        zspolishtype2display: string;
+        zsshapetype: string; // 形状 - 枚举”ZSShapeType“ - 类型:1,2,4,5 ;(1为多个,逗号分隔)
+        zsshapetypedisplay: string;
+        zsstyletype: number; // 款式 - 类型:4
+        zsstyletypedisplay: string;
+        zssymmetrytype1: number; // 对称度1 - 枚举”ZSSymmetryType“ - 类型:1,2,4,5
+        zssymmetrytype1display: string;
+        zssymmetrytype2: number; // 对称度2 - 枚举”ZSSymmetryType“ - 类型:1
+        zssymmetrytype2display: string;
+    }
 }

+ 141 - 8
src/types/ermcp/order.d.ts

@@ -31,7 +31,7 @@ declare namespace Ermcp {
         pagesize?: number; // 每页条数
         zsallproperties?: string; // 商品(查询字段-模糊查询)
         zscategory?: number; // 钻石分类枚举ID
-        wrtradeorderid?: number; // 委托单号
+        wrtradeorderid?: string; // 委托单号
         buyusername?: string; // 卖方(查询字段-模糊查询)
     }
 
@@ -85,7 +85,7 @@ declare namespace Ermcp {
         wrfactortypeid: number; // 仓单要素类型ID/商品ID(77)
         wrpricetype: number; // 价格方式 - 1:固定价 2-浮动价 - [挂牌]
         wrstandardid: number; // 现货商品ID
-        wrtradeorderid: number; // 仓单贸易委托单ID(320+Unix秒时间戳(10位)+xxxxxx)
+        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; // 仓单受让用户 - [摘牌]
@@ -99,7 +99,7 @@ declare namespace Ermcp {
         pagesize?: number; // 每页条数
         zsallproperties?: string; // 商品(查询字段-模糊查询)
         zscategory?: number; // 钻石分类枚举ID
-        wrtradeorderid?: number; // 委托单号
+        wrtradeorderid?: string; // 委托单号
         buyusername?: string; // 买方(查询字段-模糊查询)
     }
 
@@ -116,7 +116,7 @@ declare namespace Ermcp {
         warehouseids: string; // 仓库ID - 多个, 逗号分隔
         warehouseinfosdisplay: string;
         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:撤单解冻贷款失败WRTrade_OrderDetail、
-        wrtradeorderid: number; // [委托单号]买委托单ID(320+Unix秒时间戳(10位)+xxxxxx)
+        wrtradeorderid: string; // [委托单号]买委托单ID(320+Unix秒时间戳(10位)+xxxxxx)
         zscategory: number; // 钻石分类 - 枚举”ZSCategory“
         zscategorydisplay: string;
         zsclaritytype: string; // 净度 - 两个, 逗号分隔
@@ -156,7 +156,7 @@ declare namespace Ermcp {
         pagesize?: number; // 每页条数
         zsallproperties?: string; // 商品(查询字段-模糊查询)
         zscategory?: number; // 钻石分类枚举ID
-        wrtradeorderid?: number; // 委托单号
+        wrtradeorderid?: string; // 委托单号
         ishis?: string; // 是否历史查询
     }
 
@@ -208,7 +208,7 @@ declare namespace Ermcp {
         wrfactortypeid: number; // 仓单要素类型ID/商品ID(77)
         wrpricetype: number; // 价格方式 - 1:固定价 2-浮动价 - [挂牌]
         wrstandardid: number; // 现货商品ID
-        wrtradeorderid: number; // 仓单贸易委托单ID(320+Unix秒时间戳(10位)+xxxxxx)
+        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; // 仓单受让用户 - [摘牌]
@@ -223,7 +223,7 @@ declare namespace Ermcp {
         pagesize?: number; // 每页条数
         zsallproperties?: string; // 商品(查询字段-模糊查询)
         zscategory?: number; // 钻石分类枚举ID
-        wrtradeorderid?: number; // 委托单号
+        wrtradeorderid?: string; // 委托单号
         ishis?: string; // 是否历史查询
     }
 
@@ -238,7 +238,7 @@ declare namespace Ermcp {
         validtime: string; // 有效期限
         warehouseids: string; // 仓库ID - 多个, 逗号分隔
         warehouseinfosdisplay: string;
-        wrtradeorderid: number; // [委托单号]买委托单ID(320+Unix秒时间戳(10位)+xxxxxx)
+        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:撤单解冻贷款失败WRTrade_OrderDetail、
         zscategory: number; // 钻石分类 - 枚举”ZSCategory“
         zscategorydisplay: string;
@@ -271,4 +271,137 @@ declare namespace Ermcp {
         zssymmetrytypedisplay: string;
         zstabledisplay: string; // 求购信息
     }
+
+    /** 查询我的摘牌请求 */
+    interface MyDeListingReq {
+        userid: number; // 用户ID
+        page?: number; // 页码
+        pagesize?: number; // 每页条数
+        zsallproperties?: string; // 商品(查询字段-模糊查询)
+        zscategorys?: string; // 钻石分类, 格式:1,2,3
+        wrtradedetailid?: number; // 成交单号
+        buyorsell?: number; // 方向,0-全部(可不传) 1-购买 2-出售
+        begindate?: string; // 开始交易日(yyyymmdd)
+        enddate?: string; // 结束交易日(yyyymmdd)
+    }
+
+    /** 查询我的摘牌响应 */
+    interface MyDeListingRsp {
+        buyaccountid: number; // 买方账号ID
+        buychargevalue: number; // 买方手续费
+        buyorsell: number; // 方向 - 0:全部 1:买 2:卖
+        buyuserid: number; // 买方用户ID
+        deliverygoodsid: number; // 现货品种ID
+        exchangerate: number; // 汇率
+        goodsno: string; // 商品编号
+        marketid: number; // 市场ID
+        matchusername: string; // 对手方
+        oritradeamount: number; // 成交金额[商品币种]
+        performanceplanid: number; // 履约计划ID/合同ID
+        qty: number; // 成交重量
+        sellaccountid: number; // 卖方账号ID
+        sellchargevalue: number; // 卖方手续费
+        selluserid: number; // 卖方用户ID
+        tradeamount: number; // 成交金额
+        tradedate: string; // 交易日(yyyyMMdd)
+        tradeprice: number; // 成交价格
+        tradetime: string; // 成交时间
+        userid: number; // 用户ID
+        warehousenamedisplay: string;
+        wrfactortypeid: number; // 仓单要素类型ID
+        wrstandardid: number; // 现货商品ID
+        wrtradedetailid: string; // 仓单贸易成交单ID(321+Unix秒时间戳(10位)+xxxxxx)
+        zscategory: number; // 钻石分类 - 枚举”ZSCategory“
+        zscategorydisplay: string;
+        zscerttypedisplay: string;
+        zsclaritytype1display: string;
+        zsclaritytype2display: string;
+        zscolortype1display: string;
+        zscolortype2display: 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 MyBargainApplyReq {
+        userid: number; // 用户ID
+        page?: number; // 页码
+        pagesize?: number; // 每页条数
+        applystatus?: number; // 申请状态(不传查全部) - 1:待确认 2:已确认 3:已拒绝 4:已撤销 5:系统撤销 6:处理失败 7:确认中
+    }
+
+    /** 查询我的询价-求购 响应 */
+    interface MyBargainApplyRsp {
+        accountid: number; // 摘牌资金账号
+        applyprice: string; // 申请价格
+        applyremark: string; // 申请备注
+        applystatus: number; // 申请状态 - 1:待确认 2:已确认 3:已拒绝 4:已撤销 5:系统撤销 6:处理失败 7:确认中
+        applytime: string; // 申请时间
+        buyorsell: number; // 买卖 - 0:买 1:卖
+        confirmprice: number; // 可接受价格(拒绝时填写)-作废
+        confirmqty: number; // 可接受数量(拒绝时填写)-作废
+        confirmremark: string; // 确认备注
+        confirmtime: string; // 确认时间
+        confirmuserid: number; // 确认人
+        handlestatus: number; // 处理状态
+        ladingbillid: number; // 摘牌方提单ID [卖]
+        marketid: number; // 市场ID
+        matchaccountid: number; // 挂牌方资金账号
+        matchuserid: number; // 挂牌方用户ID
+        qty: number; // 申请数量
+        refprice: string; // 参考价格
+        retcode: number; // 委托返回代码
+        sellusername: string; // 卖方
+        subnum: number; // 摘牌方提单子单号 [卖]
+        tradedate: string; // 交易日(yyyyMMdd)
+        userid: number; // 摘牌人用户ID
+        wrbargainid: number; // [询价单号]议价申请单ID(327+Unix秒时间戳(10位)+xxxxxx)
+        wrtradeorderid: number; // 关联委托单ID
+    }
+
+    /** 查询我的询价-出售 请求 */
+    interface MyDelistingApplyReq {
+        userid: number; // 用户ID
+        page?: number; // 页码
+        pagesize?: number; // 每页条数
+        applystatus?: number; // 申请状态(不传查全部) - 1:待确认 2:已确认 3:已拒绝 4:已撤销 5:系统撤销 6:处理失败 7:确认中
+    }
+
+    /** 查询我的询价-出售 响应 */
+    interface MyDelistingApplyRsp {
+        applyprice: number; // 申请价格
+        applyqty: number; // 申请数量
+        applyremark: string; // 申请备注
+        applystatus: number; // 申请状态 - 1:待确认 2:已确认 3:已拒绝 4:已撤销 5:系统撤销 6:处理失败 7:确认中
+        applytime: string; // 申请时间
+        auditremark: string; // 确认备注
+        audittime: string; // 确认时间
+        buyuserid: number; // 买方用户ID
+        buyusername: string; // 买方
+        buywrtradeorderid: number; // 买委托单ID
+        ladingbillid: number; // 卖方提单ID
+        marketid: number; // 市场ID
+        sellaccountid: number; // 卖方账户ID
+        selldelistingapplyid: number; // [询价单号]卖摘牌申请ID(916+Unix秒时间戳(10位)+xxxxxx)
+        selltradeorderid: number; // 卖方委托ID(买方确认成交后更新)
+        selluserid: number; // 卖方用户ID
+        subnum: number; // 卖方提单子单号
+        wrfactortypeid: number; // 仓单要素类型ID
+        wrstandardid: number; // 现货商品ID
+    }
 }

+ 140 - 0
src/types/proto/order.d.ts

@@ -85,5 +85,145 @@ declare global {
             OrderTime: string; // 接收委托交易的时间
             ClientSerialNo: string; // 客户端流水号
         }
+
+        /** 钻石买摘牌接口请求 */
+        interface ZSBuyOrderDestingReq {
+            Header?: IMessageHead; // 消息头
+            UserID: number; // 用户ID,必填
+            AccountID: number; // 资金账号,必填
+            RelatedWRTradeOrderID: Long; // 卖委托单号,必填
+            OrderQty: number; // 委托数量,必填2位小数,为WeigthAvg的整数倍
+            OrderSrc: number; // 委托来源
+            ClientSerialNo: string; // 客户端流水号
+            ClientOrderTime: string; // 客户端委托时间
+            ClientType: number; // 终端类型
+            OperatorID: number; // 操作员账号ID
+            MarketID: number; // 市场ID,必填
+        }
+
+        /** 钻石买摘牌接口响应 */
+        interface ZSBuyOrderDestingRsp {
+            Header?: IMessageHead; // 消息头
+            RetCode: number; // 返回码
+            RetDesc: string; // 描述信息
+            UserID: number; // 用户ID
+            AccountID: number; // 资金账号
+            WRTradeOrderID: number; // 仓单贸易委托单ID
+            RelatedWRTradeOrderID: number; // 关联委托单号(摘牌委托关联挂牌委托单ID)
+            FreezeAmount: number; // 冻结货款
+            OrderTime: string; // 接收委托交易的时间
+            ClientSerialNo: string; // 客户端流水号
+        }
+
+        /** 买摘牌询价接口请求 */
+        interface ZSBuyOrderDestingNegPriceReq {
+            Header?: IMessageHead; // 消息头
+            UserID: number; // 用户ID,必填
+            AccountID: number; // 资金账号,必填
+            RelatedOrderID: number; // 卖委托单号,必填
+            OrderQty: number; // 议价数量,2位小数,必填
+            ApplyPrice: string; // 协议价格,2位小数,必填
+            OrderSrc: number; // 委托来源
+            ClientSerialNo: string; // 客户端流水号
+            ClientOrderTime: string; // 客户端委托时间
+            ClientType: number; // 终端类型
+            OperatorID: number; // 操作员账号ID
+            MarketID: number; // 市场ID,必填
+        }
+
+        /** 买摘牌询价接口应答 */
+        interface ZSBuyOrderDestingNegPriceRsp {
+            Header?: IMessageHead; // 消息头
+            RetCode: number; // 返回码
+            RetDesc: string; // 描述信息
+            UserID: number; // 用户ID
+            AccountID: number; // 资金账号
+            WRTradeOrderID: number; // 摘牌委托单ID
+            WRBargainID: number; // 议价申请单ID
+            OrderTime: string; // 接收委托交易的时间
+            ClientSerialNo: string; // 客户端流水号
+        }
+
+        /** 买摘牌询价操作接口请求 */
+        interface ZSBuyOrderDestingNegPriceOperateReq {
+            Header?: IMessageHead; // 消息头
+            UserID: number; // 用户ID,必填
+            AccountID: number; // 资金账号,必填
+            WRBargainID: number; // 议价申请单ID,必填
+            AuditRemark: string; // 备注
+            OperateType: number; // 操作类型,1:撤销2:拒绝
+            MarketID: number; // 市场ID,必填
+            ClientType: number; // 终端类型
+            OrderSrc: number; // 委托来源
+            ClientSerialNo: string; // 客户端流水号
+        }
+
+        /** 买摘牌询价操作接口应答 */
+        interface ZSBuyOrderDestingNegPriceOperateRsp {
+            Header?: IMessageHead; // 消息头
+            RetCode: number; // 返回码
+            RetDesc: string; // 描述信息
+            UserID: number; // 用户ID
+            AccountID: number; // 资金账号
+            WRBargainID: number; // 卖委托单号
+            ClientSerialNo: string; // 客户端流水号
+        }
+
+        /** 钻石卖摘牌申请接口请求 */
+        interface ZSSellOrderDestingApplyReq {
+            Header?: IMessageHead; // 消息头
+            UserID: number; // 用户ID,必填
+            AccountID: number; // 资金账户ID,必填
+            BuyWRTradeOrderID: number; // 买挂牌委托单ID,必填
+            WRStandardID: number; // 现货商品ID,必填
+            WRFactorTypeID?: number; // 仓单要素类型ID,必填
+            ApplyQty: number; // 申请数量,必填,2位小数
+            ApplyPrice: number; // 申请价格,必填,2位小数
+            LadingBillID: number; // 提单ID,必填
+            SubNum: number; // 提单子单号,必填
+            ApplyRemark?: string; // 备注
+            ClientType: number; // 终端类型
+            ClientSerialNo: string; // 客户端流水号
+            MarketID: number; // 市场ID,必填
+        }
+
+        /** 钻石卖摘牌申请接口响应 */
+        interface ZSSellOrderDestingApplyRsp {
+            Header?: IMessageHead; // 消息头
+            RetCode: number; // 返回码
+            RetDesc: string; // 描述信息
+            UserID: number; // 用户ID
+            AccountID: number; // 资金账号
+            ApplyID: number; // 仓单贸易委托单ID
+            ClientSerialNo: string; // 客户端流水号
+        }
+
+        /** 钻石卖摘牌申请操作接口请求 */
+        interface ZSSellOrderDestingApplyOperateReq {
+            Header?: IMessageHead; // 消息头
+            UserID: number; // 用户ID,必填
+            AccountID: number; // 资金账号
+            SellDelistingApplyID: number; // 卖摘牌申请ID,必填
+            AuditRemark: string; // 备注
+            OperateType: number; // 操作类型,1:撤销2:拒绝
+            MarketID: number; // 市场ID,必填
+            ClientType: number; // 终端类型
+            OrderSrc: number; // 委托来源
+            ClientSerialNo: string; // 客户端流水号
+        }
+
+        /** 钻石卖摘牌申请操作接口应答 */
+        interface ZSSellOrderDestingApplyOperateRsp {
+            Header?: IMessageHead; // 消息头
+            RetCode: number; // 返回码
+            RetDesc: string; // 描述信息
+            UserID: number; // 用户ID
+            AccountID: number; // 资金账号
+            SellDelistingApplyID: number; // 卖摘牌申请ID
+            WRTradeOrderID: number; // 仓单贸易委托单ID
+            FreezeAmount: number; // 冻结货款
+            OrderTime: string; // 接收委托交易的时间
+            ClientSerialNo: string; // 客户端流水号
+        }
     }
 }

+ 21 - 34
src/utils/websocket/index.ts

@@ -26,7 +26,7 @@ export class MTP2WebSocket<T extends Package40 | Package50>{
     /** 当前流水号 */
     private currentSerial = 1;
     /** 信息发送异步建值对 */
-    private asyncTaskMap = new Map<string, AsyncTask<T>>();
+    private asyncTaskMap = new Map<number, AsyncTask<T>>();
     /** 初始默认重连间隔时长 */
     private defaultReconnectInterval = 5 * 1000;
     /** 连接准备完成 */
@@ -164,7 +164,7 @@ export class MTP2WebSocket<T extends Package40 | Package50>{
                 case Package50: {
                     // 5.0
                     this.send({
-                        data: { payload: new this.Package(0) }
+                        data: { rspCode: 0, payload: new this.Package(0) }
                     })
                     break;
                 }
@@ -223,35 +223,25 @@ export class MTP2WebSocket<T extends Package40 | Package50>{
      */
     send(msg: SendMessage<T>) {
         const { data, success, fail } = msg;
-        const { rspCode, payload } = data;
+        const { payload } = data;
 
         if (this.onReady) {
             this.onReady.then(() => {
-                // 设置流水号
-                payload.serialNumber = this.currentSerial;
-                this.currentSerial++;
-
-                let key = payload.serialNumber.toString();
-                // 4.0报文
-                if (payload instanceof Package40) {
-                    if (!rspCode && fail) {
-                        fail('缺少rspCode参数');
-                        return;
-                    }
-                    key += '_' + rspCode;
-                }
+                const mapKey = this.currentSerial;
+                payload.serialNumber = mapKey; // 设置流水号
 
                 // 判断是否需要异步回调
                 if (success || fail) {
                     // 保存发送任务,为任务设置一个自动超时定时器
-                    this.asyncTaskMap.set(key, {
+                    this.asyncTaskMap.set(mapKey, {
                         sendMessage: msg,
-                        timeoutId: window.setTimeout(() => this.asyncTimeout(key), this.timeoutInterval),
+                        timeoutId: window.setTimeout(() => this.asyncTimeout(mapKey), this.timeoutInterval),
                     })
                 }
 
                 // 发送信息
                 this.ws?.send(payload.data());
+                this.currentSerial++;
             })
         } else {
             fail && fail('服务未连接');
@@ -262,7 +252,7 @@ export class MTP2WebSocket<T extends Package40 | Package50>{
      * 异步任务超时
      * @param key key
      */
-    private asyncTimeout(key: string) {
+    private asyncTimeout(key: number) {
         // 获取对应异步任务对象
         const asyncTask = this.asyncTaskMap.get(key);
         const onFail = asyncTask?.sendMessage.fail;
@@ -331,19 +321,9 @@ export class MTP2WebSocket<T extends Package40 | Package50>{
      * 处理完整的报文
      */
     private disposePackageResult(p: T) {
-        let key = p.serialNumber.toString();
-        if (p instanceof Package40) {
-            key += '_' + p.mainClassNumber;
-        }
-        const asyncTask = this.asyncTaskMap.get(key);
+        const asyncTask = this.asyncTaskMap.get(p.serialNumber);
         const sendMessage = asyncTask?.sendMessage;
 
-        // 移除当前发送的任务请求
-        if (asyncTask) {
-            clearTimeout(asyncTask.timeoutId);
-            this.asyncTaskMap.delete(key);
-        }
-
         // 4.0报文
         if (p instanceof Package40) {
             // 推送类报文, 0x12 - 心跳, 0x41 - 实时行情推送, 0x42 - 控制信号
@@ -380,14 +360,21 @@ export class MTP2WebSocket<T extends Package40 | Package50>{
                 this.onPush && this.onPush(p);
             } else if (sendMessage) {
                 // 非推送类报文
-                const { data, success, fail } = sendMessage;
-                // 判断是否需要检验回复功能码
-                if (data.rspCode && data.rspCode !== p.funCode) {
-                    fail && fail('无效的rspCode:');
+                const { data, success } = sendMessage;
+                // 判断是否正确的回复功能吗
+                if (data.rspCode !== p.funCode) {
+                    //console.log('无效的rspCode', p.funCode)
+                    return
                 } else {
                     success && success(p);
                 }
             }
         }
+
+        // 移除当前发送的任务请求
+        if (asyncTask) {
+            clearTimeout(asyncTask.timeoutId);
+            this.asyncTaskMap.delete(p.serialNumber);
+        }
     }
 }

+ 1 - 1
src/utils/websocket/interface.ts

@@ -12,7 +12,7 @@ export enum ConnectionState {
  */
 export interface SendMessage<T = unknown> {
     data: {
-        rspCode?: number; // 回调码
+        rspCode: number; // 回调码
         payload: T // 待发送报文
     };
     success?: (res: T) => void; // 成功回调