|
|
@@ -2,6 +2,10 @@
|
|
|
<template>
|
|
|
<app-table :data="dataList" v-model:columns="tableColumns" :loading="loading" :row-key="rowKey"
|
|
|
:expand-row-keys="expandKeys" @row-click="rowClick">
|
|
|
+ <!-- 商品代码/名称-->
|
|
|
+ <template #goodscode="{ row }">
|
|
|
+ {{ row.goodsname }}/{{ row.goodscode }}
|
|
|
+ </template>
|
|
|
<!-- 可用数量-->
|
|
|
<template #enableqty="{ row }">
|
|
|
{{ row.buycurpositionqty - row.buyfrozenqty }}
|
|
|
@@ -37,13 +41,14 @@
|
|
|
</template>
|
|
|
|
|
|
<script lang="ts" setup>
|
|
|
-import { ref, defineAsyncComponent } from 'vue'
|
|
|
+import { shallowRef, defineAsyncComponent } from 'vue'
|
|
|
import { parsePercent, formatDecimal } from '@/filters'
|
|
|
import { useRequest } from '@/hooks/request'
|
|
|
import { queryMineTradePositionExs } from '@/services/api/transfer'
|
|
|
import { getPayStatusName, PayStatus } from '@/constants/order'
|
|
|
import { useComponent } from '@/hooks/component'
|
|
|
import { useComposeTable } from '@pc/components/base/table'
|
|
|
+import { useTableColumnsStore } from '@/stores'
|
|
|
import AppTable from '@pc/components/base/table/index.vue'
|
|
|
|
|
|
const componentMap = new Map<string, unknown>([
|
|
|
@@ -52,6 +57,9 @@ const componentMap = new Map<string, unknown>([
|
|
|
['listing', defineAsyncComponent(() => import('./listing/index.vue'))], // 转让
|
|
|
])
|
|
|
|
|
|
+const { getTableColumns } = useTableColumnsStore()
|
|
|
+const tableColumns = shallowRef<Model.TableColumn[]>([])
|
|
|
+
|
|
|
const { loading, dataList, run } = useRequest(queryMineTradePositionExs, {})
|
|
|
|
|
|
const { componentRef, componentId, openComponent, closeComponent } = useComponent(() => {
|
|
|
@@ -60,25 +68,12 @@ const { componentRef, componentId, openComponent, closeComponent } = useComponen
|
|
|
|
|
|
const { selectedRow, rowKey, expandKeys, rowClick } = useComposeTable<Model.MineTradePositionExsRsp>({ rowKey: 'goodsid' })
|
|
|
|
|
|
-const tableColumns = ref<Model.TableColumn[]>([
|
|
|
- { field: 'goodscode', label: '代码' },
|
|
|
- { field: 'goodsname', label: '名称' },
|
|
|
- { field: 'buycurholderamount', label: '持仓金额' },
|
|
|
- { field: 'buycurpositionqty', label: '持仓量' },
|
|
|
- { field: 'buyfrozenqty', label: '冻结量' },
|
|
|
- { field: 'enableqty', label: '可用量' },
|
|
|
- { field: 'sellname', label: '发售方' },
|
|
|
- { field: 'presaleprice', label: '订货价' },
|
|
|
- { field: 'totalamount', label: '总货款' },
|
|
|
- { field: 'transferdepositratio', label: '转让订金比例' },
|
|
|
- { field: 'transferdeposit', label: '转让订金' },
|
|
|
- { field: 'depositremain', label: '未付订金' },
|
|
|
- { field: 'paystatus', label: '支付状态' },
|
|
|
- { field: 'lasttradedate', label: '最后交易日' }
|
|
|
-])
|
|
|
-
|
|
|
const showComponent = (componentName: string, row?: Model.MineTradePositionExsRsp) => {
|
|
|
selectedRow.value = row
|
|
|
openComponent(componentName)
|
|
|
}
|
|
|
+
|
|
|
+getTableColumns('transfer-position').then((res) => {
|
|
|
+ tableColumns.value = res
|
|
|
+})
|
|
|
</script>
|