li.shaoyi 7 miesięcy temu
rodzic
commit
0ba66ba4dc

+ 3 - 3
oem/tss/config/appconfig.json

@@ -1,8 +1,8 @@
 {
-  "appId": "com.muchinfo.tss",
+  "appId": "com.muchinfo.tssvi",
   "appName": "Tce Vietnam",
-  "version": "1.0.52",
-  "versionCode": "100052",
+  "version": "1.0.53",
+  "versionCode": "100053",
   "apiUrl": "http://192.168.31.210:8080/cfg?key=test_210",
   "tradeChannel": "ws",
   "showLoginAlert": true,

+ 13 - 4
src/packages/sbyj/views/market/detail/index.vue

@@ -71,9 +71,13 @@
                     </td>
                     <td v-if="riskType === 1">
                         <span
-                            :class="item.tHDetailEx.depositRate <= item.tHDetailEx.promptDepositRate ? 'g-price-up' : ''">
+                            :class="{ 'g-price-up': item.tHDetailEx.depositRate <= item.tHDetailEx.promptDepositRate }"
+                            v-if="item.tHDetailEx.payedDeposit">
                             {{ parsePercent(item.tHDetailEx.depositRate) }}
                         </span>
+                        <span v-else>
+                            {{ handleNumberValue() }}
+                        </span>
                     </td>
                     <td v-if="riskType === 2">
                         <span :class="handlePriceColor(item.tHDetailEx.floatPL)">
@@ -98,8 +102,13 @@
                         </div>
                         <div class="right" v-if="riskType === 1">
                             <span
-                                :class="selectedRow.tHDetailEx.depositRate <= selectedRow.tHDetailEx.promptDepositRate ? 'g-price-up' : ''">{{
-                                    parsePercent(selectedRow.tHDetailEx.depositRate) }}</span>
+                                :class="{ 'g-price-up': selectedRow.tHDetailEx.depositRate <= selectedRow.tHDetailEx.promptDepositRate }"
+                                v-if="selectedRow.tHDetailEx.payedDeposit">
+                                {{ parsePercent(selectedRow.tHDetailEx.depositRate) }}
+                            </span>
+                            <span v-else>
+                                {{ handleNumberValue() }}
+                            </span>
                         </div>
                     </div>
                     <div class="g-order-list__content">
@@ -242,7 +251,7 @@ const qtyStepList = computed(() => {
         const { traderules = [], agreeunit = 0 } = quote.value ?? {}
         const { ParamValue = 1 } = traderules.find((e) => e.RuleID === 103) ?? {}
         const min = ParamValue * agreeunit // ParamValue 是数量
-        
+
         return values.map((value) => (+value) * min)
     }
 

+ 9 - 3
src/packages/sbyj/views/order/detail/index.vue

@@ -7,7 +7,9 @@
             </template>
             <div class="order-detail__container g-form__container">
                 <CellGroup inset>
-                    <Cell class="nowrap" :title="(detail.buyOrSell === BuyOrSell.Buy ? $t('enum.BuyOrSell.Buy') : $t('enum.BuyOrSell.Sell'))+'订单'" :value="detail.tradeID" />
+                    <Cell class="nowrap"
+                        :title="(detail.buyOrSell === BuyOrSell.Buy ? $t('enum.BuyOrSell.Buy') : $t('enum.BuyOrSell.Sell')) + '订单'"
+                        :value="detail.tradeID" />
                     <Cell title="商品代码/名称" :value="selectedRow.goodsCode + '/' + selectedRow.goodsName" />
                     <Cell title="订单重量"
                         :value="(detail.openQty * selectedRow.agreeUnit) + getGoodsUnitName(selectedRow.goodsUnitID)" />
@@ -29,9 +31,13 @@
                     <Cell :title="$t('mine.callAteFee')" :value="detail.callAteFee" />
                     <Cell title="定金率" v-if="riskType === 1">
                         <template #value>
-                            <span :class="detail.depositRate <= detail.promptDepositRate ? 'g-price-up' : ''">
+                            <span :class="{ 'g-price-up': detail.depositRate <= detail.promptDepositRate }"
+                                v-if="detail.payedDeposit">
                                 {{ parsePercent(detail.depositRate) }}
                             </span>
+                            <span v-else>
+                                {{ handleNumberValue() }}
+                            </span>
                         </template>
                     </Cell>
                     <Cell title="冻结重量"
@@ -63,7 +69,7 @@
 <script lang="ts" setup>
 import { shallowRef, PropType, computed } from 'vue'
 import { CellGroup, Cell, Button, Checkbox } from 'vant'
-import { parsePercent, handlePriceColor, formatDecimal, handleRequestBigNumber } from '@/filters'
+import { parsePercent, handlePriceColor, formatDecimal, handleRequestBigNumber, handleNumberValue } from '@/filters'
 import { BuyOrSell } from '@/constants/order'
 import { getGoodsUnitName } from '@/constants/unit'
 import { useGlobalStore, useFuturesStore } from '@/stores'

+ 0 - 2
src/packages/sbyj/views/order/list/components/market-order-delivery/index.vue

@@ -55,7 +55,6 @@ import { marketOrderDeliveryApply } from '@/services/api/trade'
 import { useGlobalStore, useUserStore, useFuturesStore } from '@/stores'
 import AppModal from '@/components/base/modal/index.vue'
 import moment from 'moment'
-import { i18n } from '@/stores'
 
 const props = defineProps({
     selectedRow: {
@@ -67,7 +66,6 @@ const props = defineProps({
 const userStore = useUserStore()
 const param326 = userStore.getSystemParamValue('326')
 const param327 = userStore.getSystemParamValue('327')
-const { global: { t } } = i18n
 
 const globalStore = useGlobalStore()
 const futuresStore = useFuturesStore()

+ 10 - 5
src/packages/sbyj/views/order/list/components/supplement-deposit/index.vue

@@ -10,16 +10,21 @@
                     <Cell title="定金率">
                         <template #value>
                             <span
-                                :class="selectedRow.tHDetailEx.depositRate <= selectedRow.tHDetailEx.promptDepositRate ? 'g-price-up' : ''">{{
+                                :class="{ 'g-price-up': selectedRow.tHDetailEx.depositRate <= selectedRow.tHDetailEx.promptDepositRate }"
+                                v-if="selectedRow.tHDetailEx.payedDeposit">{{
                                     parsePercent(selectedRow.tHDetailEx.depositRate) }}</span>
+                            <span v-else>
+                                {{ handleNumberValue() }}
+                            </span>
                         </template>
                     </Cell>
                     <Cell title="已付定金" :value="selectedRow.tHDetailEx.payedDeposit" />
                     <Cell title="已补定金" :value="selectedRow.tHDetailEx.restockDeposit" />
                     <Cell :title="$t('mine.callAteFee')" :value="selectedRow.tHDetailEx.callAteFee" />
-                    <Cell title="浮动权益" >
+                    <Cell title="浮动权益">
                         <template #value>
-                            <span :class="handlePriceColor(selectedRow.tHDetailEx.floatPL)">{{ selectedRow.tHDetailEx.floatPL }}</span>
+                            <span :class="handlePriceColor(selectedRow.tHDetailEx.floatPL)">{{
+                                selectedRow.tHDetailEx.floatPL }}</span>
                         </template>
                     </Cell>
                     <Cell title="可退定金" :value="formatDecimal(refundDespoit)" />
@@ -55,7 +60,7 @@
 import { shallowRef, PropType, onMounted, reactive, computed } from 'vue'
 import { CellGroup, Cell, Button, Stepper, Field, Form, FormInstance, FieldRule, RadioGroup, Radio } from 'vant'
 import { fullloading } from '@/utils/vant'
-import { handleRequestBigNumber, formatDecimal, handlePriceColor } from '@/filters'
+import { handleRequestBigNumber, formatDecimal, handlePriceColor, handleNumberValue } from '@/filters'
 import { parsePercent } from '@/filters'
 import { supplementDeposit, refundedDeposit } from '@/services/api/trade'
 import AppModal from '@/components/base/modal/index.vue'
@@ -78,7 +83,7 @@ const orderType = shallowRef(1) // 1-补充 2-退返
 // 浮动盈亏 根据行情实时变动
 const refundDespoit = computed(() => {
     const { restockDeposit, callAteFee, floatPL } = props.selectedRow.tHDetailEx
-    return Math.max(Math.min((restockDeposit + floatPL - callAteFee), restockDeposit) , 0)
+    return Math.max(Math.min((restockDeposit + floatPL - callAteFee), restockDeposit), 0)
 })
 
 // 表单验证规则

+ 11 - 7
src/packages/sbyj/views/order/list/index.vue

@@ -21,16 +21,21 @@
                     <div class="g-order-list__titlebar">
                         <div class="left">
                             <h4 :class="item.tHDetailEx.buyOrSell === BuyOrSell.Buy ? 'g-price-up' : 'g-price-down'">
-                                {{ item.tHDetailEx.buyOrSell === BuyOrSell.Buy ? $t('enum.BuyOrSell.Buy') : $t('enum.BuyOrSell.Sell') }}{{':'}}
+                                {{ item.tHDetailEx.buyOrSell === BuyOrSell.Buy ? $t('enum.BuyOrSell.Buy') :
+                                    $t('enum.BuyOrSell.Sell') }}{{ ':' }}
                                 {{ item.goodsCode + '/' + item.goodsName }}
                                 {{ formatDecimal(item.tHDetailEx.holderPrice, item.decimalPlace) }}
                             </h4>
                         </div>
                         <div class="right" v-if="riskType === 1">
                             <span
-                                :class="item.tHDetailEx.depositRate <= item.tHDetailEx.promptDepositRate ? 'g-price-up' : ''">
+                                :class="{ 'g-price-up': item.tHDetailEx.depositRate <= item.tHDetailEx.promptDepositRate }"
+                                v-if="item.tHDetailEx.payedDeposit">
                                 {{ parsePercent(item.tHDetailEx.depositRate) }}
                             </span>
+                            <span v-else>
+                                {{ handleNumberValue() }}
+                            </span>
                         </div>
                     </div>
                     <div class="g-order-list__content">
@@ -81,8 +86,9 @@
                             v-if="riskType === 1 && item.tHDetailEx.holderQty">补充</Button>
                         <template v-if="enableqty(item)">
                             <Button size="small" @click="showComponent('delivery', item)" round>{{
-                        getTagName(item.tHDetailEx.buyOrSell) }}</Button>
-                            <Button v-if="canClose(item)" size="small" @click="showComponent('closeholder', item)" round>终止</Button>
+                                getTagName(item.tHDetailEx.buyOrSell) }}</Button>
+                            <Button v-if="canClose(item)" size="small" @click="showComponent('closeholder', item)"
+                                round>终止</Button>
                         </template>
                         <Button size="small" @click="showComponent('detail', item)" round>详情</Button>
                     </div>
@@ -97,7 +103,7 @@
 <script lang="ts" setup>
 import { onMounted, shallowRef, defineAsyncComponent, computed } from 'vue'
 import { BuyOrSell } from '@/constants/order'
-import { formatDecimal, parsePercent, handlePriceColor } from '@/filters'
+import { formatDecimal, parsePercent, handlePriceColor, handleNumberValue } from '@/filters'
 import { getGoodsUnitName } from '@/constants/unit'
 import { useComponent } from '@/hooks/component'
 import { Button, Tabs, Tab } from 'vant'
@@ -105,7 +111,6 @@ import { useFuturesStore, useGlobalStore, useSBYJOrderStore } from '@/stores'
 import AppPullRefresh from '@mobile/components/base/pull-refresh/index.vue'
 import { useRequest } from '@/hooks/request'
 import { queryUserTradeSettings } from '@/services/api/order'
-import { i18n } from '@/stores'
 
 const componentMap = new Map<string, unknown>([
     ['detail', defineAsyncComponent(() => import('../detail/index.vue'))], // 详情
@@ -118,7 +123,6 @@ const active = shallowRef(0)
 
 const globalStore = useGlobalStore()
 const riskType = globalStore.getSystemInfo('riskType') // 风控类型
-const { global: { t } } = i18n
 
 const { getSBYJMyOrders, $toRefs } = useSBYJOrderStore()
 const { getGoods } = useFuturesStore()

+ 3 - 3
src/stores/modules/position.ts

@@ -162,14 +162,14 @@ export const useSBYJOrderStore = defineStore(() => {
         const float = price ? price * tHDetailEx.holderQty * agreeunit - tHDetailEx.holderAmount : 0
         const floatpl = float * (tHDetailEx.buyOrSell === BuyOrSell.Buy ? 1 : -1)
         // 计算定金率 (已付定金 + 补充定金 +盈亏 - 已计滞纳金) / 已付定金
-        const depositRate = (tHDetailEx.payedDeposit + tHDetailEx.restockDeposit + floatpl - tHDetailEx.callAteFee) / tHDetailEx.payedDeposit
+        const depositRate = tHDetailEx.payedDeposit && (tHDetailEx.payedDeposit + tHDetailEx.restockDeposit + floatpl - tHDetailEx.callAteFee) / tHDetailEx.payedDeposit
         return depositRate
     }
 
     // 计算风险率 
     const calRiskRate = (e: Model.SBYJMyOrderRsp) => {
         // 已付定金+补充定金
-        const useMargin = e.tHDetailEx.payedDeposit+e.tHDetailEx.restockDeposit
+        const useMargin = e.tHDetailEx.payedDeposit + e.tHDetailEx.restockDeposit
 
         const quote = futuresStore.getGoodsQuote(e.tHDetailEx.goodsID)
         const { ask = 0, bid = 0, agreeunit = 0 } = quote.value ?? {}
@@ -179,7 +179,7 @@ export const useSBYJOrderStore = defineStore(() => {
         const float = price ? price * e.tHDetailEx.holderQty * agreeunit - e.tHDetailEx.holderAmount : 0
         const floatpl = float * (e.tHDetailEx.buyOrSell === BuyOrSell.Buy ? 1 : -1)
         // 计算风险率 占用/占用+浮动盈亏
-        const  riskRate = useMargin/(useMargin+floatpl)
+        const riskRate = useMargin / (useMargin + floatpl)
         return riskRate
     }