|
|
@@ -7,35 +7,29 @@
|
|
|
</template>
|
|
|
<Form ref="formRef" class="g-form__container" @submit="onDeliverySumit">
|
|
|
<CellGroup :title="$t('position.goods.subtitle')" inset>
|
|
|
+ <Cell :title="$t('position.goods.orderid')" :value="`${selectedRow.tHDetailEx.tradeID}`" />
|
|
|
<Cell :title="$t('position.goods.goodsname')" :value="`${selectedRow.goodsCode}`" />
|
|
|
+ <Cell :title="$t('position.goods.agreeunit')" :value="`${selectedRow.agreeUnit}${selectedRow.goodsUnit}`" />
|
|
|
<Cell :title="$t('position.goods.buyorsell')" :value="getBuyOrSellName(selectedRow.tHDetailEx.buyOrSell)" />
|
|
|
- <Cell :title="$t('position.goods.curholderamount')" :value="formatDecimal(selectedRow.tHDetailEx.holderAmount, selectedRow.decimalPlace)" />
|
|
|
+ <Cell :title="$t('position.goods.holderprice')" :value="formatDecimal(selectedRow.tHDetailEx.holderPrice, selectedRow.decimalPlace)" />
|
|
|
<Cell :title="$t('position.goods.curpositionqty')" :value="selectedRow.tHDetailEx.holderQty" />
|
|
|
- <!-- <Cell :title="$t('position.goods.frozenqty')" :value="selectedRow.tHDetailEx.freezeQty*selectedRow.agreeUnit + getGoodsUnitName(selectedRow.goodsUnitID)" /> -->
|
|
|
- <Cell :title="$t('position.goods.enableqty')" :value="enableqty" />
|
|
|
- <Cell :title="$t('position.goods.mindeliverylot')" :value="mindeliverylot" />
|
|
|
- <Cell :title="$t('position.goods.closepl')">
|
|
|
- <template #value>
|
|
|
- <span :class="handlePriceColor(selectedRow.tHDetailEx.floatPL)">
|
|
|
- {{ formatDecimal(selectedRow.tHDetailEx.floatPL, selectedRow.decimalPlace) }}
|
|
|
- </span>
|
|
|
- </template>
|
|
|
- </Cell>
|
|
|
- <Cell :title="$t('position.goods.fees')" :value="formatDecimal(fee)" />
|
|
|
- <Cell :title="$t('position.goods.deposit')" :value="formatDecimal(deposit)" />
|
|
|
- <Cell :title="$t('position.goods.tradetime')" :value="selectedRow.tHDetailEx.tradeTime" />
|
|
|
+ <Cell :title="$t('position.goods.curholderamount')" :value="formatDecimal(selectedRow.tHDetailEx.holderAmount, selectedRow.decimalPlace)" />
|
|
|
+ <Cell :title="$t('position.goods.preamounts')" :value="formatDecimal(usedMargin, selectedRow.decimalPlace)" />
|
|
|
+ <Cell v-if="selectedRow.tHDetailEx.buyOrSell === BuyOrSell.Buy" :title="$t('position.goods.deposit')" :value="formatDecimal(deposit)" />
|
|
|
+ <Cell v-if="selectedRow.tHDetailEx.buyOrSell === BuyOrSell.Buy" :title="$t('position.goods.fees1')" :value="formatDecimal(serivcefee)" />
|
|
|
+ <Cell v-if="selectedRow.tHDetailEx.buyOrSell === BuyOrSell.Sell" :title="$t('position.goods.fees2')" :value="formatDecimal(serivcefee)" />
|
|
|
+ <Cell :title="$t('position.goods.pricemove')" :value="formatDecimal(pricemove)" />
|
|
|
+ <Cell :title="$t('position.goods.expressfees')" :value="formatDecimal(shipping)" />
|
|
|
+ <Cell :title="$t('position.goods.otherfees')" :value="formatDecimal(otherfees)" />
|
|
|
+ <Cell v-if="selectedRow.tHDetailEx.buyOrSell === BuyOrSell.Buy" :title="$t('position.goods.deposit1')" :value="formatDecimal(deposit+serivcefee+pricemove+shipping+otherfees)" />
|
|
|
+ <Cell v-if="selectedRow.tHDetailEx.buyOrSell === BuyOrSell.Sell" :title="$t('position.goods.totalfees')" :value="formatDecimal(serivcefee+pricemove+shipping+otherfees)" />
|
|
|
</CellGroup>
|
|
|
<CellGroup :title="$t('position.goods.subtitle2')" inset>
|
|
|
- <!-- <Field name="DeliveryLot" type="digit" :rules="formRules.DeliveryLot" :label="$t('position.goods.deliverylot')">
|
|
|
- <template #input>
|
|
|
- <Stepper v-model="formData.DeliveryLot" theme="round" button-size="22" :min="0"
|
|
|
- :max="enableqty" :auto-fixed="false" integer />
|
|
|
- </template>
|
|
|
- </Field> -->
|
|
|
<Cell :title="$t('position.goods.deliveryqty')" :value="((formData.DeliveryLot ?? 0) * selectedRow.agreeUnit) + getGoodsUnitName(selectedRow.goodsUnitID)" />
|
|
|
- <Field name="DeliveryInfo" v-model="formData.DeliveryInfo" type="textarea" autosize clearable
|
|
|
- :rules="formRules.DeliveryInfo" maxlength="50"
|
|
|
- :label="selectedRow.tHDetailEx.buyOrSell === BuyOrSell.Buy ? $t('position.goods.address') : $t('position.goods.deliveryinfo')" :placeholder="$t('common.required')">
|
|
|
+ <Field :label="selectedRow.tHDetailEx.buyOrSell === BuyOrSell.Buy ? $t('position.goods.address') : $t('position.goods.deliveryid')"
|
|
|
+ name="DeliveryInfo" v-model="formData.DeliveryInfo" type="textarea" autosize clearable
|
|
|
+ :rules="formRules.DeliveryInfo" maxlength="50"
|
|
|
+ :placeholder="$t('common.required')">
|
|
|
<template #right-icon v-if="selectedRow.tHDetailEx.buyOrSell === BuyOrSell.Buy">
|
|
|
<Icon name="add-o" @click="showContact = true" />
|
|
|
</template>
|
|
|
@@ -56,7 +50,7 @@
|
|
|
import { shallowRef, PropType, computed, onMounted } from 'vue'
|
|
|
import { CellGroup, Cell, Button, FieldRule, Form, Field, FormInstance, Icon } from 'vant'
|
|
|
import { getBuyOrSellName, BuyOrSell } from '@/constants/order'
|
|
|
-import { formatDecimal, handlePriceColor, handleRequestBigNumber } from '@/filters'
|
|
|
+import { formatDecimal, handleRequestBigNumber } from '@/filters'
|
|
|
import { useOfflineDelivery } from '@/business/trade'
|
|
|
import { dialog, fullloading } from '@/utils/vant'
|
|
|
import { i18n, useFuturesStore } from '@/stores'
|
|
|
@@ -106,6 +100,42 @@ const formRules: { [key: string]: FieldRule[] } = {
|
|
|
}],
|
|
|
}
|
|
|
|
|
|
+// 升贴水
|
|
|
+const pricemove = computed(() => {
|
|
|
+ const { buypricemovealgorithm, buypricemovevalue = 0.0, sellpricemovevalue = 0.0, sellpricemovealgorithm } = goods ?? {}
|
|
|
+ const { buyOrSell } = props.selectedRow.tHDetailEx
|
|
|
+ const { agreeUnit } = props.selectedRow
|
|
|
+ if (buyOrSell === BuyOrSell.Buy) {
|
|
|
+ return buypricemovealgorithm === 1 ? 0.0 : buypricemovevalue * agreeUnit * enableqty.value
|
|
|
+ } else {
|
|
|
+ return sellpricemovealgorithm === 1 ? 0.0 : sellpricemovevalue * agreeUnit * enableqty.value
|
|
|
+ }
|
|
|
+})
|
|
|
+
|
|
|
+// 其他费用
|
|
|
+const otherfees = computed(() => {
|
|
|
+ const { buyotherfeealgorithm, buyotherfeevalue = 0.0, sellotherfeevalue = 0.0, sellotherfeealgorithm } = goods ?? {}
|
|
|
+ const { buyOrSell } = props.selectedRow.tHDetailEx
|
|
|
+ const { agreeUnit } = props.selectedRow
|
|
|
+ if (buyOrSell === BuyOrSell.Buy) {
|
|
|
+ return buyotherfeealgorithm === 1 ? 0.0 : buyotherfeevalue * agreeUnit * enableqty.value
|
|
|
+ } else {
|
|
|
+ return sellotherfeealgorithm === 1 ? 0.0 : sellotherfeevalue * agreeUnit * enableqty.value
|
|
|
+ }
|
|
|
+})
|
|
|
+
|
|
|
+// 运费
|
|
|
+const shipping = computed(() => {
|
|
|
+ const { buyshippingfeealgorithm, buyshippingfeevalue = 0.0, sellshippingfeevalue = 0.0, sellshippingfeealgorithm } = goods ?? {}
|
|
|
+ const { buyOrSell } = props.selectedRow.tHDetailEx
|
|
|
+ const { agreeUnit } = props.selectedRow
|
|
|
+ if (buyOrSell === BuyOrSell.Buy) {
|
|
|
+ return buyshippingfeealgorithm === 1 ? 0.0 : buyshippingfeevalue * agreeUnit * enableqty.value
|
|
|
+ } else {
|
|
|
+ return sellshippingfeealgorithm === 1 ? 0.0 : sellshippingfeevalue * agreeUnit * enableqty.value
|
|
|
+ }
|
|
|
+})
|
|
|
+
|
|
|
// 可用重量
|
|
|
const enableqty = computed(() => {
|
|
|
const { tHDetailEx, agreeUnit } = props.selectedRow
|
|
|
@@ -117,12 +147,18 @@ const deposit = computed(() => {
|
|
|
return props.selectedRow.tHDetailEx.holderAmount - (props.selectedRow.tHDetailEx.payedDeposit + props.selectedRow.tHDetailEx.restockDeposit )
|
|
|
})
|
|
|
|
|
|
+// 预付款
|
|
|
+const usedMargin = computed(() => {
|
|
|
+ return props.selectedRow.tHDetailEx.payedDeposit+props.selectedRow.tHDetailEx.restockDeposit
|
|
|
+})
|
|
|
+
|
|
|
// 提货费 = 取交易费用配置 105
|
|
|
// 固定: 可用量*合约单位*配置值
|
|
|
// 比率:订单金额*配置值
|
|
|
-const fee = computed(() => {
|
|
|
+const serivcefee = computed(() => {
|
|
|
+ const { buyOrSell } = props.selectedRow.tHDetailEx
|
|
|
const { tradefees = [], agreeunit = 0 } = quote.value ?? {}
|
|
|
- const { FeeAlgorithm = 1, ExchangeValue = 0.0 } = tradefees.find((e) => e.FeeID === 105) ?? {}
|
|
|
+ const { FeeAlgorithm = 1, ExchangeValue = 0.0 } = tradefees.find((e) => e.FeeID === (buyOrSell === BuyOrSell.Buy ? 105 : 106)) ?? {}
|
|
|
// 比例
|
|
|
if (FeeAlgorithm === 1) {
|
|
|
return enableqty.value * agreeunit * ExchangeValue
|