|
|
@@ -27,7 +27,7 @@
|
|
|
<span>{{ selectedRow.matchname }}</span>
|
|
|
</el-form-item>
|
|
|
<el-form-item label="参考损益">
|
|
|
- <span :class="handlePriceColor(closepl(), 0)">{{ formatDecimal(closepl()) }}</span>
|
|
|
+ <span :class="handlePriceColor(closepl, 0)">{{ formatDecimal(closepl) }}</span>
|
|
|
</el-form-item>
|
|
|
<el-form-item prop="DeliveryLot" label="交收数量">
|
|
|
<el-input-number placeholder="请输入数量" v-model="formData.DeliveryLot" :precision="0" :max="selectedRow.enableqty" :min="0" />
|
|
|
@@ -44,7 +44,7 @@
|
|
|
</template>
|
|
|
|
|
|
<script lang="ts" setup>
|
|
|
-import { ref, PropType } from 'vue'
|
|
|
+import { ref, PropType, computed } from 'vue'
|
|
|
import { ElMessage, FormInstance, FormRules } from 'element-plus'
|
|
|
import { useOfflineDelivery } from '@/business/trade'
|
|
|
import { useFuturesStore } from '@/stores'
|
|
|
@@ -67,13 +67,11 @@ const futuresStore = useFuturesStore()
|
|
|
const quote = futuresStore.getQuoteInfo(props.selectedRow.goodscode)
|
|
|
|
|
|
/// 计算参考损益
|
|
|
-const closepl = () => {
|
|
|
- console.log('wwww',last)
|
|
|
+const closepl = computed(() => {
|
|
|
const { last = 0 } = quote.value ?? {}
|
|
|
const { curpositionqty, curholderamount, agreeunit, buyorsell } = props.selectedRow
|
|
|
-
|
|
|
return (last * curpositionqty * agreeunit - curholderamount) * (buyorsell === BuyOrSell.Buy ? 1 : -1)
|
|
|
-}
|
|
|
+})
|
|
|
|
|
|
// 表单验证规则
|
|
|
const formRules: FormRules = {
|