|
|
@@ -7,7 +7,7 @@
|
|
|
<template #expand="{ row }">
|
|
|
<div class="buttonbar">
|
|
|
<el-button type="primary" size="small" :disabled="row.userid === loginStore.userId"
|
|
|
- @click="showComponent('delisting', row)">摘牌</el-button>
|
|
|
+ @click="onDelisting(row)">{{ getDelistingButtonTitles( 0, row ) }}</el-button>
|
|
|
</div>
|
|
|
</template>
|
|
|
</app-table>
|
|
|
@@ -17,7 +17,7 @@
|
|
|
<template #expand="{ row }">
|
|
|
<div class="buttonbar">
|
|
|
<el-button type="primary" size="small" :disabled="row.userid === loginStore.userId"
|
|
|
- @click="showComponent('delisting', row)">摘牌</el-button>
|
|
|
+ @click="onDelisting(row)">{{ getDelistingButtonTitles( 1, row ) }}</el-button>
|
|
|
</div>
|
|
|
</template>
|
|
|
</app-table>
|
|
|
@@ -32,10 +32,12 @@ import { useRequest } from '@/hooks/request'
|
|
|
import { BuyOrSell } from '@/constants/order'
|
|
|
import { useComponent } from '@/hooks/component'
|
|
|
import { useComposeTable } from '@pc/components/base/table'
|
|
|
-import { queryTjmdTradeOrderDetail } from '@/services/api/swap'
|
|
|
+import { queryTjmdTradeOrderDetail, queryMdUserSwapProtocol } from '@/services/api/swap'
|
|
|
import { useLoginStore, useFuturesStore } from '@/stores'
|
|
|
import AppTable from '@pc/components/base/table/index.vue'
|
|
|
import eventBus from '@/services/bus'
|
|
|
+import { getUserId } from '@/services/methods/user'
|
|
|
+import { ElMessage } from 'element-plus'
|
|
|
|
|
|
const props = defineProps({
|
|
|
goodsId: {
|
|
|
@@ -56,6 +58,17 @@ const loginStore = useLoginStore()
|
|
|
const futuresStore = useFuturesStore()
|
|
|
const quote = futuresStore.getGoodsQuote(props.goodsId)
|
|
|
|
|
|
+/// 查询用户掉期协议签署表
|
|
|
+const { dataList: protocolList} = useRequest(queryMdUserSwapProtocol, {
|
|
|
+ params: {
|
|
|
+ userId: getUserId()
|
|
|
+ }
|
|
|
+})
|
|
|
+
|
|
|
+const status = (row: Model.TjmdTradeOrderDetailRsp) => {
|
|
|
+ return protocolList.value.find((e) => e.areauserid === row.userid)?.protocolstatus ?? 1
|
|
|
+}
|
|
|
+
|
|
|
const { rowKey, expandKeys, selectedRow, rowClick } = useComposeTable<Model.TjmdTradeOrderDetailRsp>({ rowKey: 'orderid' })
|
|
|
const { componentRef, componentId, openComponent, closeComponent } = useComponent(()=> {
|
|
|
// 获取买大厅数据
|
|
|
@@ -64,6 +77,19 @@ const { componentRef, componentId, openComponent, closeComponent } = useComponen
|
|
|
getSellList()
|
|
|
})
|
|
|
|
|
|
+const getDelistingButtonTitles = (tab: number, row: Model.TjmdTradeOrderDetailRsp) => {
|
|
|
+ switch (status(row)) {
|
|
|
+ case 1:
|
|
|
+ return '签署'
|
|
|
+ case 2:
|
|
|
+ return '待审核'
|
|
|
+ case 3:
|
|
|
+ return '待审核'
|
|
|
+ default:
|
|
|
+ return tab === BuyOrSell.Buy ? '卖出' : '买入'
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
const { dataList: buyList, run: getBuyList } = useRequest(queryTjmdTradeOrderDetail, {
|
|
|
params: {
|
|
|
pagesize: 20,
|
|
|
@@ -72,6 +98,21 @@ const { dataList: buyList, run: getBuyList } = useRequest(queryTjmdTradeOrderDet
|
|
|
},
|
|
|
})
|
|
|
|
|
|
+const onDelisting = (row: Model.TjmdTradeOrderDetailRsp) => {
|
|
|
+ switch (status(row)) {
|
|
|
+ case 4: /// 已签署
|
|
|
+ showComponent('delisting', row)
|
|
|
+ break;
|
|
|
+ case 1: /// 未签署
|
|
|
+ /// 传对应的机构 ID
|
|
|
+ /// 进行下一步
|
|
|
+ ElMessage('请登录手机 App进行合同签署!')
|
|
|
+ break;
|
|
|
+ default: /// 其他状态
|
|
|
+ break;
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
const { dataList: sellList, run: getSellList } = useRequest(queryTjmdTradeOrderDetail, {
|
|
|
params: {
|
|
|
pagesize: 20,
|