|
|
@@ -157,7 +157,7 @@
|
|
|
<Button size="small" @click="showComponent('delivery')" round>
|
|
|
{{ selectedRow.tHDetailEx.buyOrSell === BuyOrSell.Buy ? '提料' : '交料' }}
|
|
|
</Button>
|
|
|
- <Button size="small" @click="showComponent('closeholder')" round>终止</Button>
|
|
|
+ <Button v-if="canClose" size="small" @click="showComponent('closeholder')" round>终止</Button>
|
|
|
</template>
|
|
|
<Button size="small" @click="showComponent('detail')" round>详情</Button>
|
|
|
</div>
|
|
|
@@ -184,6 +184,8 @@ import { BuyOrSell } from '@/constants/order'
|
|
|
import quoteSocket from '@/services/websocket/quote'
|
|
|
import { queryMdUserSwapProtocol } from '@/services/api/swap'
|
|
|
import { getUserId } from '@/services/methods/user'
|
|
|
+import { useRequest } from '@/hooks/request'
|
|
|
+import { queryUserTradeSettings } from '@/services/api/order'
|
|
|
|
|
|
const { getQueryString, router } = useNavigation()
|
|
|
const { formData, formSubmit } = useOrder()
|
|
|
@@ -252,6 +254,24 @@ const showChart = () => {
|
|
|
})
|
|
|
}
|
|
|
|
|
|
+// 获取用户交易个性化设置
|
|
|
+const { dataList: settings } = useRequest(queryUserTradeSettings, {})
|
|
|
+// 判断是否有终止按钮
|
|
|
+const canClose = computed(() => {
|
|
|
+ //1. 获取用户交易个性化设置(sbyj/QueryUserTradeSettings)
|
|
|
+ // 若有GoodsId对应配置,且goodstradetype in (1:可建可平, 3:不可建可平) 时则显示
|
|
|
+ const setting = settings.value.find(e => e.goodsid === goods?.goodsid)
|
|
|
+ console.log(setting)
|
|
|
+ if (setting) {
|
|
|
+ const goodstradetype = setting.goodstradetype
|
|
|
+ return ['1', '3'].includes(goodstradetype)
|
|
|
+ } else {
|
|
|
+ // 2. 若无GoodsId对应配置,则看商品缓存(Ermcp/GetErmcpGoods)返回对应商品的goodstradetype in (1:可建可平, 3:不可建可平) 时则显示
|
|
|
+ const { goodstradetype = 0 } = goods ?? {}
|
|
|
+ return [1, 3].includes(goodstradetype)
|
|
|
+ }
|
|
|
+})
|
|
|
+
|
|
|
const commit = (buyOrSell: BuyOrSell) => {
|
|
|
/// 这里要去判断是否已经实名认证
|
|
|
if (userStore.hasAuth) {
|
|
|
@@ -269,7 +289,6 @@ const commit = (buyOrSell: BuyOrSell) => {
|
|
|
|
|
|
// 下单
|
|
|
const onSubmit = () => {
|
|
|
-
|
|
|
// 计算提示信息
|
|
|
const { marketid = 0, goodsid = 0, goodunitid = 0 } = quote.value ?? {}
|
|
|
const { marginalgorithm = 0, transferdepositratio = 0.0 } = goods ?? {}
|