|
|
@@ -45,13 +45,15 @@ import { useRequest } from '@/hooks/request'
|
|
|
import { useNavigation } from '@mobile/router/navigation'
|
|
|
import { useComponent } from '@/hooks/component'
|
|
|
import { BuyOrSell } from '@/constants/order'
|
|
|
+import { dialog } from '@/utils/vant'
|
|
|
import { queryTjmdTradeOrderDetail, queryMdUserSwapProtocol } from '@/services/api/swap'
|
|
|
+import { requestInitMdUserSwapProtocol } from '@/services/api/account'
|
|
|
import { useFuturesStore } from '@/stores'
|
|
|
import { useLoginStore, useUserStore } from '@/stores'
|
|
|
-import AppList from '@mobile/components/base/list/index.vue'
|
|
|
import { getUserId } from '@/services/methods/user'
|
|
|
import { formatDecimal } from '@/filters'
|
|
|
-import { onActivated } from 'vue'
|
|
|
+import AppList from '@mobile/components/base/list/index.vue'
|
|
|
+import service from '@/services'
|
|
|
|
|
|
const Price = defineAsyncComponent(() => import('@mobile/components/modules/quote/price/index.vue'))
|
|
|
const Chart = defineAsyncComponent(() => import('@mobile/components/modules/hqchart/index.vue'))
|
|
|
@@ -71,7 +73,7 @@ const futuresStore = useFuturesStore()
|
|
|
const quote = futuresStore.getGoodsQuote(item.refgoodsid)
|
|
|
const goodsCode = computed(() => quote.value?.goodscode ?? '')
|
|
|
const userStore = useUserStore()
|
|
|
-
|
|
|
+const oem = service.getConfig('oem')
|
|
|
const { componentRef, componentId, openComponent, closeComponent } = useComponent(() => onRefresh())
|
|
|
|
|
|
/// 查询用户掉期协议签署表
|
|
|
@@ -82,6 +84,20 @@ const { dataList: protocolList, run: runMdUserSwapProtocol } = useRequest(queryM
|
|
|
}
|
|
|
})
|
|
|
|
|
|
+/// 创建电子签合同
|
|
|
+const initMdUserSwapProtocol = (memberUserId: number) => {
|
|
|
+ useRequest(requestInitMdUserSwapProtocol, {
|
|
|
+ params: {
|
|
|
+ userId: getUserId(),
|
|
|
+ memberUserId: memberUserId
|
|
|
+ },
|
|
|
+ onSuccess: () => {
|
|
|
+ /// 重新请求
|
|
|
+ runMdUserSwapProtocol()
|
|
|
+ }
|
|
|
+ })
|
|
|
+}
|
|
|
+
|
|
|
/// 估算价格
|
|
|
const estimateprice = (row: Model.TjmdTradeOrderDetailRsp) => {
|
|
|
const { last = 0, presettle = 0 } = quote.value ?? {}
|
|
|
@@ -153,8 +169,18 @@ const onDelisting = (row: Model.TjmdTradeOrderDetailRsp) => {
|
|
|
break;
|
|
|
case 1: /// 未签署
|
|
|
/// 传对应的机构 ID
|
|
|
- /// 进行下一步
|
|
|
- router.push({ name: 'account-protocol', query: { memberUserId: row.userid.toString() } })
|
|
|
+ if (oem === 'tjmd') {
|
|
|
+ /// 进行下一步
|
|
|
+ router.push({ name: 'account-protocol', query: { memberUserId: row.userid.toString() } })
|
|
|
+ } else {
|
|
|
+ dialog({
|
|
|
+ message: '申请交易',
|
|
|
+ showCancelButton: true,
|
|
|
+ confirmButtonText: '去申请'
|
|
|
+ }).then(() => {
|
|
|
+ initMdUserSwapProtocol(row.userid)
|
|
|
+ })
|
|
|
+ }
|
|
|
break;
|
|
|
default: /// 其他状态
|
|
|
break;
|
|
|
@@ -165,9 +191,4 @@ const onListing = () => {
|
|
|
openComponent('listing')
|
|
|
}
|
|
|
|
|
|
-onActivated(() => {
|
|
|
- /// 查询
|
|
|
- runMdUserSwapProtocol()
|
|
|
-})
|
|
|
-
|
|
|
</script>
|