|
@@ -1,70 +1,54 @@
|
|
|
<!-- 持仓过户-我的转入 -->
|
|
<!-- 持仓过户-我的转入 -->
|
|
|
<template>
|
|
<template>
|
|
|
- <app-table :data="dataList" v-model:columns="tableColumns">
|
|
|
|
|
- <!-- 挂牌类型 -->
|
|
|
|
|
- <template #buyorsell="{ value }">
|
|
|
|
|
- {{ getBuyOrSellName(value) }}
|
|
|
|
|
|
|
+ <app-table :data="dataList" v-model:columns="tableColumns" :loading="loading" :row-key="rowKey"
|
|
|
|
|
+ :expand-row-keys="expandKeys" @row-click="rowClick">
|
|
|
|
|
+ <!-- 展开行 -->
|
|
|
|
|
+ <template #expand="{ row }">
|
|
|
|
|
+ <div class="buttonbar" v-if="row.transferapplystatus === 2">
|
|
|
|
|
+ <el-button type="primary" @click="showComponent('confirm', row)">确认</el-button>
|
|
|
|
|
+ </div>
|
|
|
</template>
|
|
</template>
|
|
|
- <!-- 最新价 -->
|
|
|
|
|
- <template #lastprice="{ row }">
|
|
|
|
|
- <span :class="row.lastColor">
|
|
|
|
|
- {{ handleNumberValue(formatDecimal(row.lastprice, row.decimalplace)) }}
|
|
|
|
|
- </span>
|
|
|
|
|
- </template>
|
|
|
|
|
- <!-- 市值-->
|
|
|
|
|
- <template #marketValue="{ value }">
|
|
|
|
|
- {{ formatDecimal(value) }}
|
|
|
|
|
- </template>
|
|
|
|
|
- <!-- 浮动盈亏-->
|
|
|
|
|
- <template #closepl="{ row }">
|
|
|
|
|
- <span :class="row.closeplColor">{{ formatDecimal(row.closepl, row.decimalplace) }}</span>
|
|
|
|
|
- </template>
|
|
|
|
|
- <!-- 操作 -->
|
|
|
|
|
- <template #operate="{ row }">
|
|
|
|
|
- <app-auth-operation :code="code" :menus="handleOperateButtons(row)" :options="{ selectedRow: row }" />
|
|
|
|
|
|
|
+ <template #footer>
|
|
|
|
|
+ <component ref="componentRef" v-bind="{ selectedRow }" :is="componentMap.get(componentId)"
|
|
|
|
|
+ @closed="closeComponent" v-if="componentId" />
|
|
|
</template>
|
|
</template>
|
|
|
</app-table>
|
|
</app-table>
|
|
|
</template>
|
|
</template>
|
|
|
|
|
|
|
|
<script lang="ts" setup>
|
|
<script lang="ts" setup>
|
|
|
-import { shallowRef } from 'vue'
|
|
|
|
|
-import { handleNumberValue, formatDecimal } from '@/filters'
|
|
|
|
|
-import { getBuyOrSellName } from '@/constants/order'
|
|
|
|
|
|
|
+import { shallowRef, defineAsyncComponent } from 'vue'
|
|
|
import { useRequest } from '@/hooks/request'
|
|
import { useRequest } from '@/hooks/request'
|
|
|
|
|
+import { useComponent } from '@/hooks/component'
|
|
|
|
|
+import { useComposeTable } from '@pc/components/base/table'
|
|
|
import { queryInTradePositionTransfer } from '@/services/api/transfer'
|
|
import { queryInTradePositionTransfer } from '@/services/api/transfer'
|
|
|
import AppTable from '@pc/components/base/table/index.vue'
|
|
import AppTable from '@pc/components/base/table/index.vue'
|
|
|
-import AppAuthOperation from '@pc/components/modules/auth-operation/index.vue'
|
|
|
|
|
|
|
|
|
|
-defineProps({
|
|
|
|
|
- code: String
|
|
|
|
|
|
|
+const componentMap = new Map<string, unknown>([
|
|
|
|
|
+ ['confirm', defineAsyncComponent(() => import('./confirm/index.vue'))], // 确认
|
|
|
|
|
+])
|
|
|
|
|
+
|
|
|
|
|
+const { rowKey, expandKeys, selectedRow, rowClick } = useComposeTable<Model.InTradePositionTransferRsp>({ rowKey: 'applyid' })
|
|
|
|
|
+
|
|
|
|
|
+const { componentRef, componentId, openComponent, closeComponent } = useComponent(() => {
|
|
|
|
|
+ run()
|
|
|
})
|
|
})
|
|
|
|
|
|
|
|
-const { dataList } = useRequest(queryInTradePositionTransfer)
|
|
|
|
|
|
|
+const { loading, dataList, run } = useRequest(queryInTradePositionTransfer)
|
|
|
|
|
|
|
|
const tableColumns = shallowRef<Model.TableColumn[]>([
|
|
const tableColumns = shallowRef<Model.TableColumn[]>([
|
|
|
- { prop: 'goodsname', label: '订单合约' },
|
|
|
|
|
- { prop: 'buyorsell', label: '方向' },
|
|
|
|
|
- { prop: 'curpositionqty', label: '持有数量' },
|
|
|
|
|
- { prop: 'enableqty', label: '可用数量' },
|
|
|
|
|
- { prop: 'frozenqty', label: '预扣数量' },
|
|
|
|
|
- { prop: 'averageprice', label: '均价' },
|
|
|
|
|
- { prop: 'lastprice', label: '现价' },
|
|
|
|
|
- { prop: 'curholderamount', label: '持仓金额' },
|
|
|
|
|
- { prop: 'marketValue', label: '市值' },
|
|
|
|
|
- { prop: 'closepl', label: '参考损益' },
|
|
|
|
|
- { prop: 'operate', label: '操作', fixed: 'right', width: 140 },
|
|
|
|
|
|
|
+ { prop: 'goodsdisplay', label: '商品' },
|
|
|
|
|
+ { prop: 'outusername', label: '转出方' },
|
|
|
|
|
+ { prop: 'qty', label: '转让数量' },
|
|
|
|
|
+ { prop: 'transferprice', label: '转让价格' },
|
|
|
|
|
+ { prop: 'freezedays', label: '冻结天数' },
|
|
|
|
|
+ { prop: 'goodscurprice', label: '商品价格' },
|
|
|
|
|
+ { prop: 'outcharge', label: '手续费' },
|
|
|
|
|
+ { prop: 'transferapplystatus', label: '状态' },
|
|
|
|
|
+ { prop: 'applytime', label: '申请时间' }
|
|
|
])
|
|
])
|
|
|
|
|
|
|
|
-const handleOperateButtons = (row: Model.TradePositionRsp) => {
|
|
|
|
|
- const buttons = ['bottom_goods_position_transfer']
|
|
|
|
|
- switch (row.trademode) {
|
|
|
|
|
- case 16:
|
|
|
|
|
- buttons.push('bottom_goods_position_delivery16')
|
|
|
|
|
- break;
|
|
|
|
|
- case 50:
|
|
|
|
|
- buttons.push('bottom_goods_position_delivery50')
|
|
|
|
|
- break;
|
|
|
|
|
- }
|
|
|
|
|
- return buttons
|
|
|
|
|
|
|
+const showComponent = (componentName: string, row: Model.InTradePositionTransferRsp) => {
|
|
|
|
|
+ selectedRow.value = row
|
|
|
|
|
+ openComponent(componentName)
|
|
|
}
|
|
}
|
|
|
</script>
|
|
</script>
|