|
|
@@ -1,14 +1,34 @@
|
|
|
<template>
|
|
|
<div class="market-trade-goods-detail-order">
|
|
|
- <app-table :data-list="dataList" v-model:columns="buyColumns" showIndex></app-table>
|
|
|
- <app-table :data-list="dataList" v-model:columns="sellColumns" showIndex></app-table>
|
|
|
+ <app-table :data="buyList" v-model:columns="buyColumns" :row-key="rowKey" :expand-row-keys="expandKeys"
|
|
|
+ @row-click="rowClick" showIndex>
|
|
|
+ <!-- 展开行 -->
|
|
|
+ <template #expand>
|
|
|
+ <div class="buttonbar">
|
|
|
+ <el-button type="primary" size="small" @click="openComponent('delisting')">摘牌</el-button>
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+ </app-table>
|
|
|
+ <app-table :data="sellList" v-model:columns="sellColumns" :row-key="rowKey" :expand-row-keys="expandKeys"
|
|
|
+ @row-click="rowClick" showIndex>
|
|
|
+ <!-- 展开行 -->
|
|
|
+ <template #expand>
|
|
|
+ <div class="buttonbar">
|
|
|
+ <el-button type="primary" size="small" @click="openComponent('delisting')">摘牌</el-button>
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+ </app-table>
|
|
|
+ <component ref="componentRef" v-bind="{ selectedRow }" :is="componentMap.get(componentId)" @closed="closeComponent"
|
|
|
+ v-if="componentId" />
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
<script lang="ts" setup>
|
|
|
-import { shallowRef } from 'vue'
|
|
|
+import { shallowRef, defineAsyncComponent } from 'vue'
|
|
|
import { useRequest } from '@/hooks/request'
|
|
|
import { BuyOrSell } from '@/constants/order'
|
|
|
+import { useComponent } from '@/hooks/component'
|
|
|
+import { useComposeTable } from '@pc/components/base/table'
|
|
|
import { queryWrTradeOrderDetail } from '@/services/api/transfer'
|
|
|
import AppTable from '@pc/components/base/table/index.vue'
|
|
|
|
|
|
@@ -19,23 +39,37 @@ const props = defineProps({
|
|
|
},
|
|
|
})
|
|
|
|
|
|
-const { dataList } = useRequest(queryWrTradeOrderDetail, {
|
|
|
+const componentMap = new Map<string, unknown>([
|
|
|
+ ['delisting', defineAsyncComponent(() => import('./delisting/index.vue'))], // 摘牌
|
|
|
+])
|
|
|
+
|
|
|
+const { rowKey, expandKeys, selectedRow, rowClick } = useComposeTable<Model.WrTradeOrderDetailRsp>({ rowKey: 'orderid' })
|
|
|
+const { componentRef, componentId, openComponent, closeComponent } = useComponent()
|
|
|
+
|
|
|
+const { dataList: buyList } = useRequest(queryWrTradeOrderDetail, {
|
|
|
params: {
|
|
|
goodsid: props.goodsId,
|
|
|
buyorsell: BuyOrSell.Buy
|
|
|
},
|
|
|
})
|
|
|
|
|
|
+const { dataList: sellList } = useRequest(queryWrTradeOrderDetail, {
|
|
|
+ params: {
|
|
|
+ goodsid: props.goodsId,
|
|
|
+ buyorsell: BuyOrSell.Sell
|
|
|
+ },
|
|
|
+})
|
|
|
+
|
|
|
const buyColumns = shallowRef<Model.TableColumn[]>([
|
|
|
- { prop: 'goodscode', label: '销售方' },
|
|
|
- { prop: 'buildtype', label: '卖量' },
|
|
|
+ { prop: 'username', label: '销售方' },
|
|
|
+ { prop: 'orderqty', label: '卖量' },
|
|
|
{ prop: 'orderprice', label: '卖价' },
|
|
|
])
|
|
|
|
|
|
const sellColumns = shallowRef<Model.TableColumn[]>([
|
|
|
- { prop: 'goodscode', label: '买价' },
|
|
|
- { prop: 'buildtype', label: '买量' },
|
|
|
- { prop: 'orderprice', label: '购买方' },
|
|
|
+ { prop: 'orderprice', label: '买价' },
|
|
|
+ { prop: 'orderqty', label: '买量' },
|
|
|
+ { prop: 'username', label: '购买方' },
|
|
|
])
|
|
|
</script>
|
|
|
|