Handy_Cao %!s(int64=2) %!d(string=hai) anos
pai
achega
eb7b61f31d

+ 26 - 0
src/constants/order.ts

@@ -33,6 +33,12 @@ export enum WrTradeType {
     DeListing = 2,
 }
 
+/// 价格方式 - 1:固定价 2-浮动价 - [挂牌]
+export enum WrPriceType {
+    Fix = 1,
+    Float = 2,
+}
+
 /// 支付状态
 export enum PayStatus {
     UnPay = 1,
@@ -63,6 +69,18 @@ export function getWrTradeTypeList() {
 }
 
 /**
+ * 获取仓单贸易价格方式类型列表
+ * @returns 
+ */
+export function getWRPriceTypeList() {
+    return [
+        { label: '一口价', value: WrPriceType.Fix},
+        { label: '浮动价', value: WrPriceType.Float },
+    ]
+}
+
+
+/**
  * 获取买卖方向名称
  * @returns 
  */
@@ -80,6 +98,14 @@ export function getWrTradeTypeName(value: number) {
 }
 
 /**
+ * 获取仓单贸易价格类型名称
+ * @returns 
+ */
+export function getWrPriceTypeName(value: number) {
+    return getEnumTypeName(getWRPriceTypeList(), value)
+}
+
+/**
  * 获取委托单据类型列表
  * @returns 
  */

+ 77 - 2
src/packages/pc/views/query/order/spot/history/index.vue

@@ -1,12 +1,87 @@
 <!-- 委托记录-现货仓单-历史记录 -->
 <template>
-    <app-table :data="[]" v-model:columns="tableColumns" />
+    <app-table :data="dataList" v-model:columns="tableColumns" :loading="loading">
+        <template #header>
+            <app-filter :options="filterOptons" :loading="loading">
+                <template #before>
+                    <el-date-picker type="daterange" start-placeholder="开始日期" end-placeholder="结束日期" value-format="YYYYMMDD"
+                        v-model="filterDate" />
+                </template>
+            </app-filter>
+        </template>
+        <!-- 类型 -->
+        <template #wrtradetype="{ value }">
+            {{ getWrTradeTypeName(value) }}
+        </template>
+        <!-- 挂牌方式 -->
+        <template #wrpricetype="{ value }">
+            {{ getWrPriceTypeName(value) }}
+        </template>
+        <!-- 委托时间 -->
+        <template #ordertime="{ value }">
+            {{ formatDate(value) }}
+        </template>
+        <!-- 状态 -->
+        <template #wrtradeorderstatus="{ value }">
+            {{ getWRTradeOrderStatusName(value) }}
+        </template>
+    </app-table>
 </template>
 
 <script lang="ts" setup>
-import { shallowRef } from 'vue'
+import { shallowRef, reactive } from 'vue'
+import { formatDate } from '@/filters'
+import { useDataFilter } from '@/hooks/datatable'
+import { useRequest } from '@/hooks/request'
+import { queryWrOrderDetail } from '@/services/api/order'
+import { getWrTradeTypeName, getWrPriceTypeName, getWRTradeOrderStatusName } from '@/constants/order'
 import AppTable from '@pc/components/base/table/index.vue'
+import AppFilter from '@pc/components/base/table-filter/index.vue'
+
+const { filterOptons, getQueryParams } = useDataFilter<Model.WrOrderDetailRsp>()
+const filterDate = shallowRef<string[]>([])
+
+const formData = reactive<Model.WrOrderDetailReq>({
+    wrtradetype: 1,
+    marketid: 17201,
+    haswr: 1,
+})
+
+const { loading, dataList, run } = useRequest(queryWrOrderDetail, {
+    params: {
+        ...formData
+    },
+})
 
 const tableColumns = shallowRef<Model.TableColumn[]>([
+    { prop: 'wrtradeorderid', label: '挂牌单号' },
+    { prop: 'wrtradetype', label: '挂牌类型' },
+    { prop: 'deliverygoodsname', label: '品种' },
+    { prop: 'wrstandardname', label: '商品' },
+    { prop: 'warehousename', label: '仓库' },
+    { prop: 'wrpricetype', label: '挂牌方式' },
+    { prop: 'wrtypename', label: '期货合约' },
+    { prop: 'fixedprice', label: '价格/基差' },
+    { prop: 'orderqty', label: '挂牌数量' },
+    { prop: 'tradeqty', label: '成交数量' },
+    { prop: 'ordertime', label: '挂牌时间' },
+    { prop: 'wrtradeorderstatus', label: '状态' },
 ])
+
+filterOptons.buttonList = [
+    { lable: '重置', onClick: () => onSearch(true) },
+    { lable: '查询', className: 'el-button--primary', onClick: () => onSearch() }
+]
+
+const onSearch = (clear = false) => {
+    if (clear) {
+        filterDate.value = []
+    }
+    getQueryParams((qs) => {
+        qs.begindate = filterDate.value[0]
+        qs.enddate = filterDate.value[1]
+        run(qs)
+    }, clear)
+}
+
 </script>

+ 42 - 1
src/packages/pc/views/query/order/spot/list/index.vue

@@ -1,12 +1,53 @@
 <!-- 委托记录-现货仓单-当前记录 -->
 <template>
-    <app-table :data="[]" v-model:columns="tableColumns" />
+    <app-table :data="dataList" v-model:columns="tableColumns" :loading="loading">
+         <!-- 类型 -->
+         <template #wrtradetype="{ value }">
+            {{ getWrTradeTypeName(value) }}
+        </template>
+        <!-- 挂牌方式 -->
+        <template #wrpricetype="{ value }">
+            {{ getWrPriceTypeName(value) }}
+        </template>
+        <!-- 委托时间 -->
+        <template #ordertime="{ value }">
+            {{ formatDate(value) }}
+        </template>
+        <!-- 状态 -->
+        <template #wrtradeorderstatus="{ value }">
+            {{ getWRTradeOrderStatusName(value) }}
+        </template>
+    </app-table>
 </template>
 
 <script lang="ts" setup>
 import { shallowRef } from 'vue'
+import { formatDate } from '@/filters'
+import { useRequest } from '@/hooks/request'
+import { queryWrOrderDetail } from '@/services/api/order'
+import { getWrTradeTypeName, getWrPriceTypeName, getWRTradeOrderStatusName } from '@/constants/order'
 import AppTable from '@pc/components/base/table/index.vue'
 
+const { loading, dataList } = useRequest(queryWrOrderDetail, {
+    params: {
+        wrtradetype: 1,
+        marketid: 17201,
+        haswr: 1 
+    },
+})
+
 const tableColumns = shallowRef<Model.TableColumn[]>([
+    { prop: 'wrtradeorderid', label: '挂牌单号' },
+    { prop: 'wrtradetype', label: '挂牌类型' },
+    { prop: 'deliverygoodsname', label: '品种' },
+    { prop: 'wrstandardname', label: '商品' },
+    { prop: 'warehousename', label: '仓库' },
+    { prop: 'wrpricetype', label: '挂牌方式' },
+    { prop: 'wrtypename', label: '期货合约' },
+    { prop: 'fixedprice', label: '价格/基差' },
+    { prop: 'orderqty', label: '挂牌数量' },
+    { prop: 'tradeqty', label: '成交数量' },
+    { prop: 'ordertime', label: '挂牌时间' },
+    { prop: 'wrtradeorderstatus', label: '状态' },
 ])
 </script>