|
|
@@ -0,0 +1,82 @@
|
|
|
+<!-- 掉期市场-委托 -->
|
|
|
+<template>
|
|
|
+ <app-table :data="dataList" v-model:columns="tableColumns" :loading="loading" :row-key="rowKey"
|
|
|
+ :expand-row-keys="expandKeys" @row-click="rowClick">
|
|
|
+ <!-- 商品代码/名称 -->
|
|
|
+ <template #wrtradetype="{ row }">
|
|
|
+ {{ row.goodscode }}/{{ row.goodsname }}
|
|
|
+ </template>
|
|
|
+ <!-- 方向 -->
|
|
|
+ <template #buyorsell="{ value }">
|
|
|
+ {{ getBuyOrSellName(value) }}
|
|
|
+ </template>
|
|
|
+ <!-- 委托状态 -->
|
|
|
+ <template #orderstatus="{ value }">
|
|
|
+ {{ getWRTradeOrderStatusName(value) }}
|
|
|
+ </template>
|
|
|
+ <!-- 委托状态 -->
|
|
|
+ <template #wrtradeorderstatus="{ value }">
|
|
|
+ {{ getWRTradeOrderStatusName(value) }}
|
|
|
+ </template>
|
|
|
+ <!-- 委托时间 -->
|
|
|
+ <template #ordertime="{ value }">
|
|
|
+ {{ formatDate(value) }}
|
|
|
+ </template>
|
|
|
+ <!-- 展开行 -->
|
|
|
+ <template #expand="{ row }">
|
|
|
+ <div class="buttonbar">
|
|
|
+ <el-button type="danger" v-if="[3, 7].includes(row.orderstatus)" size="small"
|
|
|
+ @click="showComponent('cancel', row)">撤销</el-button>
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+ <template #footer>
|
|
|
+ <component ref="componentRef" v-bind="{ selectedRow }" :is="componentMap.get(componentId)"
|
|
|
+ @closed="closeComponent" v-if="componentId" />
|
|
|
+ </template>
|
|
|
+ </app-table>
|
|
|
+</template>
|
|
|
+
|
|
|
+<script lang="ts" setup>
|
|
|
+import { shallowRef, defineAsyncComponent } from 'vue'
|
|
|
+import { formatDate } from '@/filters'
|
|
|
+import { useRequest } from '@/hooks/request'
|
|
|
+import { queryTradeOrderDetail } from '@/services/api/order'
|
|
|
+import { useComponent } from '@/hooks/component'
|
|
|
+import { getWRTradeOrderStatusName, getBuyOrSellName } from '@/constants/order'
|
|
|
+import { useComposeTable } from '@pc/components/base/table'
|
|
|
+import AppTable from '@pc/components/base/table/index.vue'
|
|
|
+
|
|
|
+const componentMap = new Map<string, unknown>([
|
|
|
+ ['cancel', defineAsyncComponent(() => import('./cancel/index.vue'))],
|
|
|
+])
|
|
|
+
|
|
|
+const { loading, dataList, run } = useRequest(queryTradeOrderDetail, {
|
|
|
+ params: {
|
|
|
+ tradeMode: '46'
|
|
|
+ },
|
|
|
+})
|
|
|
+
|
|
|
+const { componentRef, componentId, openComponent, closeComponent } = useComponent(() => {
|
|
|
+ run()
|
|
|
+})
|
|
|
+
|
|
|
+const { rowKey, expandKeys, rowClick } = useComposeTable<Model.TradeOrderDetailRsp>({ rowKey: 'orderid' })
|
|
|
+const selectedRow = shallowRef<Model.TradeOrderDetailRsp>()
|
|
|
+
|
|
|
+const tableColumns = shallowRef<Model.TableColumn[]>([
|
|
|
+ { prop: 'goodsname', label: '商品代码/名称' },
|
|
|
+ { prop: 'buyorsell', label: '方向' },
|
|
|
+ { prop: 'orderqty', label: '委托数量' },
|
|
|
+ { prop: 'orderprice', label: '委托价格' },
|
|
|
+ { prop: 'tradeqty', label: '成交数量' },
|
|
|
+ { prop: 'orderstatus', label: '委托状态' },
|
|
|
+ { prop: 'ordertime', label: '委托时间' },
|
|
|
+ { prop: 'orderid', label: '挂牌单号' },
|
|
|
+])
|
|
|
+
|
|
|
+const showComponent = (componentName: string, row: Model.TradeOrderDetailRsp) => {
|
|
|
+ selectedRow.value = row
|
|
|
+ openComponent(componentName)
|
|
|
+}
|
|
|
+
|
|
|
+</script>
|