|
|
@@ -5,24 +5,29 @@
|
|
|
</template>
|
|
|
<Form ref="formRef" class="goods-details__form" @submit="onSubmit">
|
|
|
<CellGroup>
|
|
|
- <Field name="PresaleApplyID" label="交割日期" :rules="formRules.TransferID" is-link>
|
|
|
+ <Field name="TransferID" label="交割日期" :rules="formRules.TransferID" is-link>
|
|
|
<template #input>
|
|
|
<app-select :options="deliveryDate" @confirm="onDateChange" />
|
|
|
</template>
|
|
|
</Field>
|
|
|
<Field label="原定金价" v-if="selectedDate?.tradeprice">
|
|
|
<template #input>
|
|
|
- <span>{{ selectedDate.enddate }}</span>
|
|
|
+ <span>{{ selectedDate.tradeprice }}</span>
|
|
|
</template>
|
|
|
</Field>
|
|
|
<Field label="数量" v-if="selectedDate?.tradeqty">
|
|
|
<template #input>
|
|
|
- <span>{{ selectedDate.enddate }}</span>
|
|
|
+ <span>{{ selectedDate.tradeqty }}</span>
|
|
|
</template>
|
|
|
</Field>
|
|
|
<Field label="转让价格" v-if="selectedDate?.transferprice">
|
|
|
<template #input>
|
|
|
- <span>{{ selectedDate.enddate }}</span>
|
|
|
+ <span>{{ selectedDate.transferprice }}</span>
|
|
|
+ </template>
|
|
|
+ </Field>
|
|
|
+ <Field label="转让金额" v-if="selectedDate?.transferamount">
|
|
|
+ <template #input>
|
|
|
+ <span>{{ selectedDate.transferamount }}</span>
|
|
|
</template>
|
|
|
</Field>
|
|
|
</CellGroup>
|
|
|
@@ -51,7 +56,7 @@
|
|
|
import { shallowRef, computed, defineAsyncComponent } from 'vue'
|
|
|
import { CellGroup, Button, Field, Form, FormInstance, Toast, FieldRule, Divider } from 'vant'
|
|
|
import { fullloading } from '@/utils/vant'
|
|
|
-import { getImageUrl } from '@/filters'
|
|
|
+import { getImageUrl, formatDate } from '@/filters'
|
|
|
import { useNavigation } from '@/hooks/navigation'
|
|
|
import { useContractDetails } from '@/business/contract'
|
|
|
import { useSpotPresaleTransferDesting } from '@/business/trade'
|
|
|
@@ -86,7 +91,7 @@ const formRules: { [key in keyof Proto.SpotPresaleTransferDestingReq]?: FieldRul
|
|
|
TransferID: [{
|
|
|
message: '请选择交割日期',
|
|
|
validator: () => {
|
|
|
- return !!formData.TransferID?.equals(0)
|
|
|
+ return !formData.TransferID?.equals(0)
|
|
|
}
|
|
|
}],
|
|
|
}
|
|
|
@@ -95,14 +100,17 @@ const formRules: { [key in keyof Proto.SpotPresaleTransferDestingReq]?: FieldRul
|
|
|
const deliveryDate = computed(() => {
|
|
|
const list = details.value.deliverydate ?? []
|
|
|
return list.map((e) => ({
|
|
|
- label: `${e.enddate} ${(e.depositrate * 100).toFixed(0)}%`,
|
|
|
+ label: `${formatDate(e.enddate, 'YYYY-MM-DD')} ${(e.depositrate * 100).toFixed(0)}%`,
|
|
|
value: e.transferid,
|
|
|
}))
|
|
|
})
|
|
|
|
|
|
// 切换交割日期
|
|
|
-const onDateChange = (value: string) => {
|
|
|
- formData.TransferID = Long.fromString(value)
|
|
|
+const onDateChange = (value: number) => {
|
|
|
+ const list = details.value.deliverydate ?? []
|
|
|
+ selectedDate.value = list.find((e) => e.transferid === value)
|
|
|
+
|
|
|
+ formData.TransferID = Long.fromString(value.toString())
|
|
|
formRef.value?.validate('TransferID')
|
|
|
}
|
|
|
|