li.shaoyi 2 лет назад
Родитель
Сommit
500f9ce527

+ 1 - 1
src/packages/mobile/components/modules/delivery/index.vue

@@ -22,7 +22,7 @@
                     <Field name="DeliveryQty" type="digit" :rules="formRules.DeliveryQty" label="交收数量">
                         <template #input>
                             <Stepper v-model="formData.DeliveryQty" theme="round" button-size="22" :min="0" :max="maxQty"
-                                :auto-fixed="false" integer />
+                                integer />
                         </template>
                     </Field>
                     <Field label="升贴水">

+ 11 - 14
src/packages/mobile/views/order/position/components/goods/close/Index.vue

@@ -16,7 +16,7 @@
                     <Cell title="持仓均价" :value="formatDecimal(selectedRow.averageprice)" />
                     <Cell title="参考损益">
                         <template #value>
-                            <span :class="handlePriceColor(closepl, 0.0)">{{ formatDecimal(closepl) }}</span>
+                            <span :class="selectedRow.closeplColor">{{ formatDecimal(selectedRow.closepl) }}</span>
                         </template>
                     </Cell>
                 </CellGroup>
@@ -37,18 +37,18 @@
                 </CellGroup>
             </Form>
             <template #footer>
-                <Button block square type="danger" @click="onCloseSumit">转让</Button>
+                <Button block square type="danger" @click="formRef?.submit">转让</Button>
             </template>
         </app-view>
     </app-modal>
 </template>
 
 <script lang="ts" setup>
-import { shallowRef, PropType, onMounted, computed } from 'vue'
+import { shallowRef, PropType, onMounted } from 'vue'
 import AppModal from '@/components/base/modal/index.vue'
-import { CellGroup, Cell, Button, FieldRule, Form, Field, Stepper } from 'vant'
+import { CellGroup, Cell, Button, FieldRule, Form, Field, Stepper, FormInstance } from 'vant'
 import { getBuyOrSellName, BuyOrSell } from '@/constants/order'
-import { formatDecimal, handleNumberValue, handlePriceColor } from '@/filters'
+import { formatDecimal, handleNumberValue } from '@/filters'
 import { useOrder } from '@/business/trade'
 import { dialog, fullloading } from '@/utils/vant'
 import { useFuturesStore } from '@/stores'
@@ -56,27 +56,24 @@ import { EBuildType, EDelistingType, EListingSelectType, EOrderOperateType, EPri
 
 const props = defineProps({
     selectedRow: {
-        type: Object as PropType<Model.TradePositionRsp>,
+        type: Object as PropType<Model.TradePositionRsp & {
+            closepl: number; // 浮动盈亏
+            closeplColor: string; // 浮动盈亏颜色
+        }>,
         required: true,
     }
 })
 
 const futuresStore = useFuturesStore()
 const quote = futuresStore.getGoodsQuote(props.selectedRow.goodscode)
+const formRef = shallowRef<FormInstance>()
 const showModal = shallowRef(true)
 // 是否刷新父组件数据
 const refresh = shallowRef(false)
 const { formSubmit, formData } = useOrder()
 
-// 损益
-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: { [key in keyof Proto.OrderReq]?: FieldRule[] } = {
+const formRules: { [key: string]: FieldRule[] } = {
     OrderPrice: [{
         message: '请输入转让价格',
         validator: () => {

+ 4 - 3
src/packages/mobile/views/order/position/components/goods/delivery50/index.vue

@@ -34,7 +34,7 @@
                 </CellGroup>
             </Form>
             <template #footer>
-                <Button block square type="danger" @click="onDeliverySumit">提交</Button>
+                <Button block square type="danger" @click="formRef?.submit">提交</Button>
             </template>
         </app-view>
     </app-modal>
@@ -43,7 +43,7 @@
 <script lang="ts" setup>
 import { shallowRef, PropType, computed } from 'vue'
 import AppModal from '@/components/base/modal/index.vue'
-import { CellGroup, Cell, Button, FieldRule, Form, Field, Stepper } from 'vant'
+import { CellGroup, Cell, Button, FieldRule, Form, Field, Stepper, FormInstance } from 'vant'
 import { getBuyOrSellName, BuyOrSell } from '@/constants/order'
 import { formatDecimal } from '@/filters'
 import { useOfflineDelivery } from '@/business/trade'
@@ -60,6 +60,7 @@ const props = defineProps({
 const showModal = shallowRef(true)
 // 是否刷新父组件数据
 const refresh = shallowRef(false)
+const formRef = shallowRef<FormInstance>()
 const { formSubmit, formData } = useOfflineDelivery()
 const futuresStore = useFuturesStore()
 const quote = futuresStore.getGoodsQuote(props.selectedRow.goodscode)
@@ -72,7 +73,7 @@ const closepl = computed(() => {
 })
 
 // 表单验证规则
-const formRules: { [key in keyof Proto.OfflineDeliveryReq]?: FieldRule[] } = {
+const formRules: { [key: string]: FieldRule[] } = {
     DeliveryLot: [{
         message: '请输入交收数量',
         validator: (val) => {

+ 4 - 4
src/packages/mobile/views/order/position/components/transfer/delivery/Index.vue

@@ -12,14 +12,14 @@
                     {{ payment(qty).toFixed(2) }}
                 </template>
             </Field>
-            <Field label="剩余货款">
+            <Field label="已付定金">
                 <template #input>
-                    {{ available(qty, discount).toFixed(2) }}
+                    {{ deposit(qty).toFixed(2) }}
                 </template>
             </Field>
-            <Field label="已付定金">
+            <Field label="剩余金额">
                 <template #input>
-                    {{ deposit(qty).toFixed(2) }}
+                    {{ available(qty, discount).toFixed(2) }}
                 </template>
             </Field>
         </template>

+ 1 - 1
src/packages/mobile/views/spot/list/Index.vue

@@ -4,7 +4,7 @@
             <app-navbar title="现货挂牌">
                 <template #right>
                     <Icon name="add" size=".4rem" @click="$router.push({ name: 'spot-add' })" />
-                    <Icon name="bars" size=".4rem" @click="isWaterfall = !isWaterfall" />
+                    <Icon name="bars" size=".4rem" @click="isWaterfall = !isWaterfall" style="margin-left: .2rem;" />
                 </template>
             </app-navbar>
         </template>

+ 6 - 3
src/packages/mobile/views/transfer/detail2/index.vue

@@ -6,7 +6,7 @@
         <component :is="Price" v-bind="{ goodsCode }" />
         <component :is="Chart" v-bind="{ goodsCode }" />
         <component :is="Forex" v-bind="{ goodsCode }" @more-click="onMoreClick" />
-        <div class="g-detail__desc">
+        <div class="g-detail__desc" v-if="detailImages.length">
             <template v-for="(url, index) in detailImages" :key="index">
                 <img :src="url" alt="" />
             </template>
@@ -62,8 +62,11 @@ const { data: detail, run: getPresaleDefault } = useRequest(queryPresaleDefault,
 
 // 商品图片列表
 const detailImages = computed(() => {
-    const pictureurls = detail.value?.pictureurls ?? ''
-    return pictureurls.split(',').map((path) => getFileUrl(path))
+    const pictureurls = detail.value?.pictureurls
+    if (pictureurls) {
+        return pictureurls.split(',').map((path) => getFileUrl(path))
+    }
+    return []
 })
 
 const showComponent = (type: BuyOrSell) => {

+ 2 - 2
src/packages/pc/views/footer/presell/transferposition/delivery/index.vue

@@ -24,10 +24,10 @@
             </ul>
             <ul>
                 <li>
-                    <span>剩余货款:{{ available(qty, discount).toFixed(2) }}</span>
+                    <span>已付定金:{{ deposit(qty).toFixed(2) }}</span>
                 </li>
                 <li>
-                    <span>已付定金:{{ deposit(qty).toFixed(2) }}</span>
+                    <span>剩余金额:{{ available(qty, discount).toFixed(2) }}</span>
                 </li>
             </ul>
         </template>