Browse Source

Merge branch 'master' of http://47.101.159.18:3000/Muchinfo/MTP20_WEB_GLOBAL

li.shaoyi 2 năm trước cách đây
mục cha
commit
1ef94097dd

+ 34 - 0
src/constants/order.ts

@@ -51,6 +51,17 @@ export enum PaymentType {
     Blance = 2,
 }
 
+/// 交易状态 - 1:正常 2:受限 3:冻结 4:禁止建仓(人工受限) 5:禁止交易(人工冻结) 6:待激活 7:已注销
+export enum TradeStatus {
+    Normal = 1,
+    Limit = 2,
+    Freeze = 3,
+    NoOpen = 4,
+    NoTrade = 5,
+    UnActivate = 6,
+    LoginOut = 7
+}
+
 /**
  * 获取买卖方向列表
  * @returns 
@@ -62,6 +73,21 @@ export function getBuyOrSellList() {
     ]
 }
 
+/**
+ * 获取交易状态列表
+ * @returns 
+ */
+export function getTradeStatusList() {
+    return [
+        { label: '正常', value: TradeStatus.Normal },
+        { label: '受限', value: TradeStatus.Limit },
+        { label: '冻结', value: TradeStatus.Freeze },
+        { label: '禁止建仓(人工受限)', value: TradeStatus.NoOpen },
+        { label: '禁止交易(人工冻结)', value: TradeStatus.NoTrade },
+        { label: '待激活', value: TradeStatus.UnActivate },
+        { label: '已注销', value: TradeStatus.LoginOut },
+    ]
+}
 
 /**
  * 获取仓单贸易类型列表
@@ -98,6 +124,14 @@ export function getPaymentTypeList() {
 
 
 /**
+ * 获取交易状态名称
+ * @returns 
+ */
+export function getTradeStatusName(value: number) {
+    return getEnumTypeName(getTradeStatusList(), value)
+}
+
+/**
  * 获取买卖方向名称
  * @returns 
  */

+ 36 - 6
src/packages/pc/views/footer/capital/summary/index.vue

@@ -2,6 +2,34 @@
 <template>
     <app-table :data="accountList" v-model:columns="tableColumns" :row-key="rowKey" :expand-row-keys="expandKeys"
         @row-click="rowClick">
+         <!-- 余额 -->
+         <template #currentbalance>
+            {{ accountInfo.currentbalance?.toFixed(2) }}
+        </template>
+        <!-- 净值 -->
+        <template #balance>
+            {{ accountInfo.balance?.toFixed(2) }}
+        </template>
+        <!-- 持仓市值 -->
+        <template #curamount>
+            {{ accountInfo.curamount?.toFixed(2) }}
+        </template>
+        <!-- 占用资金 -->
+        <template #oriusedmargin>
+            {{ accountInfo.oriusedmargin?.toFixed(2) }}
+        </template>
+         <!-- 可用资金 -->
+         <template #avaiableMoney>
+            {{ avaiableMoney.toFixed(2) }}
+        </template>
+        <!-- 冻结资金 -->
+        <template #freezeMargin>
+            {{ freezeMargin.toFixed(2) }}
+        </template>
+        <!-- 状态 -->
+        <template #tradestatus="{ value }">
+            {{ getTradeStatusName(value) }}
+        </template>
         <!-- 展开行 -->
         <template #expand="{ row }">
             <app-auth-operation v-bind="{ code, options: { selectedRow: row } }" />
@@ -15,6 +43,7 @@ import { useAccountStore } from '@/stores'
 import { useComposeTable } from '@pc/components/base/table'
 import AppTable from '@pc/components/base/table/index.vue'
 import AppAuthOperation from '@pc/components/modules/auth-operation/index.vue'
+import { getTradeStatusName } from '@/constants/order'
 
 defineProps({
     code: String
@@ -23,15 +52,16 @@ defineProps({
 const accountStore = useAccountStore()
 const { accountList } = accountStore.$toRefs()
 const { rowKey, expandKeys, rowClick } = useComposeTable<Model.TaAccountsRsp>({ rowKey: 'accountid' })
+const { accountInfo, freezeMargin, avaiableMoney } = accountStore.$toRefs()
 
 const tableColumns = shallowRef<Model.TableColumn[]>([
     { prop: 'accountid', label: '资金账号' },
-    { prop: 'unknown', label: '净值' },
-    { prop: 'unknown', label: '持仓市值' },
-    { prop: 'unknown', label: '余额' },
-    { prop: 'unknown', label: '可用资金' },
-    { prop: 'unknown', label: '冻结资金' },
-    { prop: 'unknown', label: '占用资金' },
+    { prop: 'balance', label: '净值' },
+    { prop: 'curamount', label: '持仓市值' },
+    { prop: 'currentbalance', label: '余额' },
+    { prop: 'avaiableMoney', label: '可用资金' },
+    { prop: 'freezeMargin', label: '冻结资金' },
+    { prop: 'oriusedmargin', label: '占用资金' },
     { prop: 'tradestatus', label: '状态' },
 ])
 </script>

+ 4 - 4
src/packages/sbyj/views/delivery/components/processing/list/index.vue

@@ -1,5 +1,5 @@
 <!-- 水贝亿爵-我的交收-待审核 -->
-<!-- <template>
+<template>
     <app-pull-refresh ref="pullRefreshRef" v-model:loading="loading" v-model:error="error" v-model:pageIndex="pageIndex"
         :page-count="pageCount" @refresh="run">
         <div class="g-order-list">
@@ -48,9 +48,9 @@
         <component ref="componentRef" v-bind="{ selectedRow }" :is="componentMap.get(componentId)" @closed="closeComponent"
             v-if="componentId" />
     </app-pull-refresh>
-</template> -->
+</template>
 
-<!-- <script lang="ts" setup>
+<script lang="ts" setup>
 import { shallowRef, defineAsyncComponent } from 'vue'
 import { Button } from 'vant'
 import { formatDate } from '@/filters'
@@ -91,4 +91,4 @@ const showComponent = (componentName: string, row: Model.MineTradeGoodsDeliveryO
     selectedRow.value = row
     openComponent(componentName)
 }
-</script> -->
+</script>

+ 49 - 48
src/packages/sbyj/views/market/detail/index.vue

@@ -14,50 +14,57 @@
             </tr>
         </table>
         <Form class="pricing-detail__form" ref="formRef" style="padding: 0.2rem; background-color: white;"
-                @submit="onSubmit">
-                <Field name="OrderQty" :rules="formRules.OrderQty">
-                        <template #input>
-                            <div class="goods-listing__stepper">
-                                <div>
-                                    <span><Stepper v-model="orderQty" theme="round" button-size="22" :min="0" :step="qtyStep"
-                                        integer /></span>
-                                    <span>{{ getGoodsUnitName(quote?.goodunitid) }}</span>
-                                </div>
-                                <RadioGroup v-model="qtyStep" direction="horizontal" @change="onRadioChange">
-                                    <Radio v-for="(value, index) in qtyStepList" :key="index" :name="value">{{ value }} {{ getGoodsUnitName(quote?.goodunitid) }}
-                                    </Radio>
-                                </RadioGroup>
-                            </div>
-                        </template>
-                    </Field>
-                    <div>
+            @submit="onSubmit">
+            <Field name="OrderQty" :rules="formRules.OrderQty">
+                <template #input>
+                    <div class="goods-listing__stepper">
+                        <div>
+                            <span>
+                                <Stepper v-model="orderQty" theme="round" button-size="22" :min="0" :step="qtyStep"
+                                    integer />
+                            </span>
+                            <span>{{ getGoodsUnitName(quote?.goodunitid) }}</span>
+                        </div>
+                        <RadioGroup v-model="qtyStep" direction="horizontal" @change="onRadioChange">
+                            <Radio v-for="(value, index) in qtyStepList" :key="index" :name="value">{{ value }} {{
+                                getGoodsUnitName(quote?.goodunitid) }}
+                            </Radio>
+                        </RadioGroup>
+                    </div>
+                </template>
+            </Field>
             <div>
-                <span><Button @click="commit(BuyOrSell.Sell)">我要卖料</Button></span>
-                <span><Button @click="commit(BuyOrSell.Buy)">我要买料</Button></span>
+                <div>
+                    <span><Button @click="commit(BuyOrSell.Sell)">我要卖料</Button></span>
+                    <span><Button @click="commit(BuyOrSell.Buy)">我要买料</Button></span>
+                </div>
             </div>
-        </div>
         </Form>
-        
+
         <div>订单明细</div>
         <div class="g-order-list">
             <div class="g-order-list__box" v-for="(item, index) in dataList" :key="index">
                 <div class="g-order-list__titlebar">
                     <div class="left">
-                        <h5> {{ item.tHDetailEx.buyOrSell === BuyOrSell.Buy ? '买料订单:' : '卖料订单:' }}{{ item.tHDetailEx.tradeID }} </h5>
+                        <h5> {{ item.tHDetailEx.buyOrSell === BuyOrSell.Buy ? '买料订单:' : '卖料订单:' }}{{ item.tHDetailEx.tradeID
+                        }} </h5>
                     </div>
                     <div class="right">
-                        <span :class="item.tHDetailEx.depositRate >= 0.4 ? 'g-price-up' : ''">{{ parsePercent(item.tHDetailEx.depositRate) }}</span>
+                        <span :class="item.tHDetailEx.depositRate <= 0.4 ? 'g-price-up' : ''">{{
+                            parsePercent(item.tHDetailEx.depositRate) }}</span>
                     </div>
                 </div>
                 <div class="g-order-list__content">
                     <ul>
                         <li>
                             <span>订单重量:</span>
-                            <span>{{ item.tHDetailEx.holderQty * item.agreeUnit }}{{ getGoodsUnitName(item.goodsUnitID) }}</span>
+                            <span>{{ item.tHDetailEx.holderQty * item.agreeUnit }}{{ getGoodsUnitName(item.goodsUnitID)
+                            }}</span>
                         </li>
                         <li>
                             <span>可用重量:</span>
-                            <span>{{ (item.tHDetailEx.holderQty - item.tHDetailEx.freezeQty ) * item.agreeUnit }}{{ getGoodsUnitName(item.goodsUnitID) }}</span>
+                            <span>{{ (item.tHDetailEx.holderQty - item.tHDetailEx.freezeQty) * item.agreeUnit }}{{
+                                getGoodsUnitName(item.goodsUnitID) }}</span>
                         </li>
                         <li>
                             <span>订单金额:</span>
@@ -87,19 +94,21 @@
                 </div>
                 <div class="g-order-list__btnbar">
                     <Button size="small" @click="showComponent('detail', item)" round>详情</Button>
-                    <Button size="small" round>补充</Button>
-                    <Button size="small" round>交收</Button>
-                    <Button size="small" round>转让</Button>
+                    <Button size="small" @click="showComponent('supplement', item)" round>补充</Button>
+                    <Button size="small" @click="showComponent('delivery', item)" round>交收</Button>
+                    <Button size="small" @click="showComponent('closeholder', item)" round>转让</Button>
                 </div>
             </div>
         </div>
+        <component ref="componentRef" v-bind="{ selectedRow }" :is="componentMap.get(componentId)" @closed="closeComponent"
+            v-if="componentId" />
     </app-view>
 </template>
 
 <script lang="ts" setup>
 
 import { useOrder } from '@/business/trade'
-import { shallowRef, onMounted, onUnmounted, computed } from 'vue'
+import { shallowRef, onMounted, onUnmounted, computed, defineAsyncComponent } from 'vue'
 import { Form, Field, Stepper, Button, FieldRule, FormInstance, Radio, RadioGroup, Checkbox } from 'vant'
 import { useNavigation } from '@/packages/sbyj/router/navigation'
 import { useFuturesStore } from '@/stores'
@@ -121,15 +130,18 @@ const futuresStore = useFuturesStore()
 const goodscode = getQueryString('goodscode')
 const quote = futuresStore.getQuoteInfo(goodscode)
 const qtyStep = shallowRef(1) // 数量步长
-const dataList = shallowRef<Model.SBYJMyOrderRsp[]>([])
 const error = shallowRef(false)
 const subscribe = quoteSocket.createSubscribe()
 const selectedRow = shallowRef<Model.SBYJMyOrderRsp>()
 const orderQty = shallowRef(1) // 数量
 
-const { componentRef, componentId, openComponent, closeComponent } = useComponent(() => {
-    // pullRefreshRef.value?.refresh()
-})
+const componentMap = new Map<string, unknown>([
+    ['detail', defineAsyncComponent(() => import('../../order/detail/index.vue'))], // 详情
+    ['supplement', defineAsyncComponent(() => import('../../order/list/components/supplement-deposit/index.vue'))], // 补充
+    ['delivery', defineAsyncComponent(() => import('../../order/list/components/market-order-delivery/index.vue'))], // 交收
+    ['closeholder', defineAsyncComponent(() => import('../../order/list/components/close-holder/index.vue'))], // 转让
+])
+const { componentRef, componentId, openComponent, closeComponent } = useComponent()
 // 合约乘数
 const agreeunit = computed(() => quote.value?.agreeunit ?? 0)
 // 数量步长列表
@@ -142,16 +154,10 @@ const qtyStepList = computed(() => {
     ]
 })
 
-const { loading, pageIndex, pageCount, run } = useRequest(querySBYJMyOrders, {
+const { dataList, run: getSBYJMyOrders } = useRequest(querySBYJMyOrders, {
     params: {
         goodsId: quote?.value?.goodsid
     },
-    onSuccess: (res) => {
-        if (pageIndex.value === 1) {
-            dataList.value = []
-        }
-        dataList.value.push(...res.data)
-    },
     onError: () => {
         error.value = true
     }
@@ -183,8 +189,9 @@ const onSubmit = () => {
 
         fullloading((hideLoading) => {
             formSubmit().then(() => {
-                hideLoading()
-                dialog('提交成功。').then(() => closed(true))
+                hideLoading('提交成功。', 'success')
+                // 刷新订单列表
+                getSBYJMyOrders()
             }).catch((err) => {
                 hideLoading(err, 'fail')
             })
@@ -219,10 +226,4 @@ const showComponent = (componentName: string, row: Model.SBYJMyOrderRsp) => {
     openComponent(componentName)
 }
 
-// 关闭弹窗
-const closed = (isRefresh = true) => {
-    // refresh.value = isRefresh
-    // showModal.value = false
-}
-
 </script>

+ 60 - 0
src/packages/sbyj/views/order/detail/index.vue

@@ -0,0 +1,60 @@
+<!-- 水贝亿爵 - 我的订单 - 详情 -->
+<template>
+    <app-modal direction="right" height="100%" v-model:show="showModal" :refresh="refresh">
+        <app-view class="g-form">
+            <template #header>
+                <app-navbar title="订单详情" @back="closed" />
+            </template>
+            <div class="order-detail__container g-form__container">
+                <CellGroup inset>
+                    <Cell title="商品代码/名称" :value="selectedRow.goodsCode + '/' + selectedRow.goodsName" />
+                    <Cell title="订单重量" :value="(selectedRow.tHDetailEx.holderQty * selectedRow.agreeUnit) + getGoodsUnitName(selectedRow.goodsUnitID)" />
+                    <Cell title="可用数量" :value="((selectedRow.tHDetailEx.holderQty - selectedRow.tHDetailEx.freezeQty) * selectedRow.agreeUnit) + getGoodsUnitName(selectedRow.goodsUnitID)" />
+                    <Cell title="订单价格" :value="selectedRow.tHDetailEx.holderPrice" />
+                    <Cell title="已付定金" :value="selectedRow.tHDetailEx.payedDeposit" />
+                    <Cell title="已补定金" :value="selectedRow.tHDetailEx.restockDeposit" />
+                    <Cell title="订单天数" :value="selectedRow.tHDetailEx.holdDays" />
+                    <Cell title="滞纳金" :value="selectedRow.tHDetailEx.callAteFee" />
+                    <Cell  title="定金率">
+                        <template #value>
+                            <span :class="selectedRow.tHDetailEx.depositRate <= 0.4 ? 'g-price-up' : ''">{{ parsePercent(selectedRow.tHDetailEx.depositRate) }}</span>
+                        </template>
+                    </Cell>
+                    <Cell title="冻结重量" :value="(selectedRow.tHDetailEx.freezeQty * selectedRow.agreeUnit) + getGoodsUnitName(selectedRow.goodsUnitID)" />
+                    <Cell title="交收重量" :value="(selectedRow.tHDetailEx.deliveryQty * selectedRow.agreeUnit) + getGoodsUnitName(selectedRow.goodsUnitID)" />
+                    <Cell title="订单时间" :value="(selectedRow.tHDetailEx.deliveryQty * selectedRow.agreeUnit) + getGoodsUnitName(selectedRow.goodsUnitID)" />
+                </CellGroup>
+            </div>
+        </app-view>
+    </app-modal>
+</template>
+
+<script lang="ts" setup>
+import { shallowRef, PropType } from 'vue'
+import { CellGroup, Cell } from 'vant'
+import { formatDate, formatDecimal, parsePercent } from '@/filters'
+import AppModal from '@/components/base/modal/index.vue'
+import { getBuyOrSellName, getWrTradeTypeName } from '@/constants/order'
+import { getGoodsUnitName } from '@/constants/unit'
+
+const showModal = shallowRef(true)
+const refresh = shallowRef(false) // 是否刷新父组件数据
+
+defineProps({
+    selectedRow: {
+        type: Object as PropType<Model.SBYJMyOrderRsp>,
+        required: true,
+    }
+})
+
+// 关闭弹窗
+const closed = (isRefresh = false) => {
+    refresh.value = isRefresh
+    showModal.value = false
+}
+
+// 暴露组件属性给父组件调用
+defineExpose({
+    closed,
+})
+</script>

+ 146 - 0
src/packages/sbyj/views/order/list/components/close-holder/index.vue

@@ -0,0 +1,146 @@
+<!-- 水贝亿爵-我的订单-转让 -->
+<template>
+    <app-modal direction="right" height="100%" v-model:show="showModal" :refresh="refresh">
+        <app-view class="g-form">
+            <template #header>
+                <app-navbar title="订单转让" @back="closed" />
+            </template>
+            <Form ref="formRef" class="g-form__container" @submit="onSubmit">
+                <CellGroup inset>
+                    <Cell title="可用重量"
+                        :value="((selectedRow.tHDetailEx.holderPrice - selectedRow.tHDetailEx.freezeQty) * selectedRow.agreeUnit) + getGoodsUnitName(selectedRow.goodsUnitID)" />
+                    <Field name="OrderQty" :rules="formRules.OrderQty">
+                        <template #input>
+                            <div class="goods-listing__stepper">
+                                <div>
+                                    <span>
+                                        <Stepper v-model="orderQty" theme="round" button-size="22" :min="0" :step="qtyStep"
+                                            integer />
+                                    </span>
+                                    <span>{{ getGoodsUnitName(selectedRow.goodsUnitID) }}</span>
+                                </div>
+                                <RadioGroup v-model="qtyStep" direction="horizontal" @change="onRadioChange" title="转让重量">
+                                    <Radio v-for="(value, index) in qtyStepList" :key="index" :name="value">{{ value }} {{
+                                        getGoodsUnitName(selectedRow.goodsUnitID) }}
+                                    </Radio>
+                                </RadioGroup>
+                            </div>
+                        </template>
+                    </Field>
+                </CellGroup>
+            </Form>
+            <template #footer>
+                <div class="g-form__footer">
+                    <Button block square type="danger" @click="formRef?.submit">提交</Button>
+                </div>
+            </template>
+        </app-view>
+    </app-modal>
+</template>
+
+<script lang="ts" setup>
+import { shallowRef, PropType, onMounted,onUnmounted, computed, reactive } from 'vue'
+import { CellGroup, Cell, Button, Stepper, Field, Form, FormInstance, FieldRule } from 'vant'
+import { fullloading } from '@/utils/vant'
+import AppModal from '@/components/base/modal/index.vue'
+import { formatDate, formatDecimal, parsePercent } from '@/filters'
+import { getGoodsUnitName } from '@/constants/unit'
+import { useOrder } from '@/business/trade'
+import quoteSocket from '@/services/websocket/quote'
+import { useFuturesStore } from '@/stores'
+import { EPriceMode, EValidType, EOrderOperateType, EBuildType } from '@/constants/client'
+import { BuyOrSell } from '@/constants/order'
+
+const props = defineProps({
+    selectedRow: {
+        type: Object as PropType<Model.SBYJMyOrderRsp>,
+        required: true,
+    }
+})
+
+const futuresStore = useFuturesStore()
+const quote = futuresStore.getQuoteInfo(props.selectedRow.goodsCode)
+const { formData, formSubmit } = useOrder()
+const formRef = shallowRef<FormInstance>()
+const showModal = shallowRef(true)
+const refresh = shallowRef(false) // 是否刷新父组件数据
+const orderQty = shallowRef(1) // 数量
+const qtyStep = shallowRef(1) // 数量步长
+const subscribe = quoteSocket.createSubscribe()
+// 合约乘数
+const agreeunit = computed(() => props.selectedRow.agreeUnit ?? 0)
+// 数量步长列表
+const qtyStepList = computed(() => {
+    return [
+        agreeunit.value * 1,
+        agreeunit.value * 5,
+        agreeunit.value * 10,
+        agreeunit.value * 50,
+    ]
+})
+
+// 表单验证规则
+const formRules:{ [key in keyof Proto.OrderReq]?: FieldRule[] } = {
+    OrderQty: [{
+        message: '请输入转让重量',
+        validator: (val) => {
+            if (val) {
+                if (val > (props.selectedRow.tHDetailEx.holderPrice - props.selectedRow.tHDetailEx.freezeQty)) {
+                    return '可用重量不足'
+                }
+
+                return true
+            }
+            return false
+        }
+    }],
+}
+
+const onRadioChange = (value: number) => {
+    orderQty.value = value
+}
+
+// 下单
+const onSubmit = () => {
+    const { tHDetailEx } = props.selectedRow ?? {}
+    const { marketid = 0, goodsid = 0 } = quote.value ?? {}
+        /// 获取对应的市场ID
+        formData.MarketID = marketid
+        formData.PriceMode = EPriceMode.PRICEMODE_MARKET
+        formData.GoodsID = goodsid
+        formData.TimevalidType = EValidType.VALIDTYPE_DR
+        formData.OperateType = EOrderOperateType.ORDEROPERATETYPE_NORMAL
+        formData.BuildType = EBuildType.BUILDTYPE_CLOSE
+        formData.OrderQty = orderQty.value / agreeunit.value // 数量÷合约乘数
+        formData.RelatedID = tHDetailEx.tradeID // 关联单号
+        formData.BuyOrSell = tHDetailEx.buyOrSell === BuyOrSell.Buy ? BuyOrSell.Sell : BuyOrSell.Buy // 持仓反方向
+
+        fullloading((hideLoading) => {
+            formSubmit().then(() => {
+                hideLoading('提交成功', 'success')
+                closed(true)
+            }).catch((err) => {
+                hideLoading(err, 'fail')
+            })
+        })
+}
+
+// 关闭弹窗
+const closed = (isRefresh = false) => {
+    refresh.value = isRefresh
+    showModal.value = false
+}
+
+onMounted(() => {
+    subscribe.start(props.selectedRow.goodsCode)
+    qtyStep.value = qtyStepList.value[0]
+    orderQty.value = (props.selectedRow.tHDetailEx.holderQty - props.selectedRow.tHDetailEx.freezeQty) * props.selectedRow.agreeUnit
+})
+
+onUnmounted(() => subscribe.stop())
+
+// 暴露组件属性给父组件调用
+defineExpose({
+    closed,
+})
+</script>

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

@@ -0,0 +1,126 @@
+<!-- 水贝亿爵-我的订单-交收 -->
+<template>
+    <app-modal direction="right" height="100%" v-model:show="showModal" :refresh="refresh">
+        <app-view class="g-form">
+            <template #header>
+                <app-navbar title="交收申请" @back="closed" />
+            </template>
+            <Form ref="formRef" class="g-form__container" @submit="onSubmit">
+                <CellGroup inset>
+                    <Cell title="可用重量"
+                        :value="((selectedRow.tHDetailEx.holderPrice - selectedRow.tHDetailEx.freezeQty) * selectedRow.agreeUnit) + getGoodsUnitName(selectedRow.goodsUnitID)" />
+                    <Field name="OrderQty" :rules="formRules.OrderQty">
+                        <template #input>
+                            <div class="goods-listing__stepper">
+                                <div>
+                                    <span>
+                                        <Stepper v-model="orderQty" theme="round" button-size="22" :min="0" :step="qtyStep"
+                                            integer />
+                                    </span>
+                                    <span>{{ getGoodsUnitName(selectedRow.goodsUnitID) }}</span>
+                                </div>
+                                <RadioGroup v-model="qtyStep" direction="horizontal" @change="onRadioChange" title="交收重量">
+                                    <Radio v-for="(value, index) in qtyStepList" :key="index" :name="value">{{ value }} {{
+                                        getGoodsUnitName(selectedRow.goodsUnitID) }}
+                                    </Radio>
+                                </RadioGroup>
+                            </div>
+                        </template>
+                    </Field>
+                </CellGroup>
+            </Form>
+            <template #footer>
+                <div class="g-form__footer">
+                    <Button block square type="danger" @click="formRef?.submit">提交</Button>
+                </div>
+            </template>
+        </app-view>
+    </app-modal>
+</template>
+
+<script lang="ts" setup>
+import { shallowRef, PropType, onMounted, computed, reactive } from 'vue'
+import { CellGroup, Cell, Button, Stepper, Field, Form, FormInstance, FieldRule } from 'vant'
+import { fullloading } from '@/utils/vant'
+import AppModal from '@/components/base/modal/index.vue'
+import { formatDate, formatDecimal, parsePercent } from '@/filters'
+import { marketOrderDeliveryApply } from '@/services/api/trade'
+import { getGoodsUnitName } from '@/constants/unit'
+
+const props = defineProps({
+    selectedRow: {
+        type: Object as PropType<Model.SBYJMyOrderRsp>,
+        required: true,
+    }
+})
+
+const formData = reactive<Proto.MarketOrderDeliveryApplyReq>({ HoldDetails: [] })
+const formRef = shallowRef<FormInstance>()
+const showModal = shallowRef(true)
+const refresh = shallowRef(false) // 是否刷新父组件数据
+const orderQty = shallowRef(1) // 数量
+const qtyStep = shallowRef(1) // 数量步长
+// 合约乘数
+const agreeunit = computed(() => props.selectedRow.agreeUnit ?? 0)
+// 数量步长列表
+const qtyStepList = computed(() => {
+    return [
+        agreeunit.value * 1,
+        agreeunit.value * 5,
+        agreeunit.value * 10,
+        agreeunit.value * 50,
+    ]
+})
+
+// 表单验证规则
+const formRules:{ OrderQty?: FieldRule[] } = {
+    OrderQty: [{
+        message: '请输入交收重量',
+        validator: (val) => {
+            if (val) {
+                if (val > (props.selectedRow.tHDetailEx.holderPrice - props.selectedRow.tHDetailEx.freezeQty)) {
+                    return '可用重量不足'
+                }
+
+                return true
+            }
+            return false
+        }
+    }],
+}
+
+const onRadioChange = (value: number) => {
+    orderQty.value = value
+}
+
+const onSubmit = () => {
+    const { tHDetailEx } = props.selectedRow ?? {}
+
+    formData.BuyOrSell = tHDetailEx.buyOrSell
+    formData.HoldDetails = [{ TradeID: tHDetailEx.tradeID, DeliveryQty: orderQty.value }] // 交收接口要的是数量不是手数,所以不用除以agreeunit
+
+    fullloading((hideLoading) => {
+        marketOrderDeliveryApply({ data: formData }).then(() => {
+            hideLoading('提交成功', 'success')
+            closed(true)
+        }).catch((err) => {
+            hideLoading(err, 'fail')
+        })
+    })
+}
+
+// 关闭弹窗
+const closed = (isRefresh = false) => {
+    refresh.value = isRefresh
+    showModal.value = false
+}
+
+onMounted(() => {
+    orderQty.value = (props.selectedRow.tHDetailEx.holderQty - props.selectedRow.tHDetailEx.freezeQty) * props.selectedRow.agreeUnit
+})
+
+// 暴露组件属性给父组件调用
+defineExpose({
+    closed,
+})
+</script>

+ 143 - 0
src/packages/sbyj/views/order/list/components/supplement-deposit/index.vue

@@ -0,0 +1,143 @@
+<!-- 水贝亿爵-我的订单-补充(订金) -->
+<template>
+    <app-modal direction="right" height="100%" v-model:show="showModal" :refresh="refresh">
+        <app-view class="g-form">
+            <template #header>
+                <app-navbar title="补充订金" @back="closed" />
+            </template>
+            <Form ref="formRef" class="g-form__container" @submit="onSubmit">
+                <CellGroup inset>
+                    <Cell title="定金率">
+                        <template #value>
+                            <span :class="selectedRow.tHDetailEx.depositRate <= 0.4 ? 'g-price-up' : ''">{{
+                                parsePercent(selectedRow.tHDetailEx.depositRate) }}</span>
+                        </template>
+                    </Cell>
+                    <Cell title="已付定金" :value="selectedRow.tHDetailEx.payedDeposit" />
+                    <Cell title="已补定金" :value="selectedRow.tHDetailEx.restockDeposit" />
+                    <Cell title="滞纳金" :value="selectedRow.tHDetailEx.callAteFee" />
+                    <Field label="类型">
+                        <template #input>
+                            <RadioGroup v-model="orderType" @click="onTypeChanged">
+                                <Radio :name="1">补充</Radio>
+                                <Radio :name="2">退返</Radio>
+                            </RadioGroup>
+                        </template>
+                    </Field>
+                    <Field name="RestockDeposit" :rules="formRules.RestockDeposit"
+                        :label="orderType === 1 ? '补充订金' : '退返订金'">
+                        <template #input>
+                            <Stepper v-if="orderType === 1" v-model="supplementDepositReq.RestockDeposit" theme="round"
+                                button-size="22" :auto-fixed="false" />
+                            <Stepper v-if="orderType === 2" v-model="refundedDepositReq.RestockDeposit" theme="round"
+                                button-size="22" :auto-fixed="false" :max="selectedRow.tHDetailEx.refundableDeposit" />
+                        </template>
+                    </Field>
+                </CellGroup>
+            </Form>
+            <template #footer>
+                <div class="g-form__footer">
+                    <Button block square type="danger" @click="formRef?.submit">提交</Button>
+                </div>
+            </template>
+        </app-view>
+    </app-modal>
+</template>
+
+<script lang="ts" setup>
+import { shallowRef, PropType, onMounted, reactive } from 'vue'
+import { CellGroup, Cell, Button, Stepper, Field, Form, FormInstance, FieldRule, RadioGroup, Radio } from 'vant'
+import { fullloading } from '@/utils/vant'
+import AppModal from '@/components/base/modal/index.vue'
+import { formatDate, formatDecimal, parsePercent } from '@/filters'
+import { supplementDeposit, refundedDeposit } from '@/services/api/trade'
+
+const props = defineProps({
+    selectedRow: {
+        type: Object as PropType<Model.SBYJMyOrderRsp>,
+        required: true,
+    }
+})
+
+const supplementDepositReq = reactive<Proto.SupplementDepositReq>({})
+const refundedDepositReq = reactive<Proto.RefundedDepositReq>({})
+const formRef = shallowRef<FormInstance>()
+const showModal = shallowRef(true)
+const refresh = shallowRef(false) // 是否刷新父组件数据
+const orderType = shallowRef(1) // 1-补充 2-退返
+
+// 表单验证规则
+const formRules:{ [key: string]: FieldRule[] } = {
+    RestockDeposit: [{
+        message: '请输入定金额',
+        validator: (val) => {
+            if (val) {
+                if (orderType.value === 2) {
+                    if (val > props.selectedRow.tHDetailEx.refundableDeposit) {
+                        return '可退定金不足'
+                    }
+                }
+
+                return true
+            }
+            return false
+        }
+    }],
+}
+
+const onTypeChanged = () => {
+    if (orderType.value === 2) {
+        refundedDepositReq.RestockDeposit = props.selectedRow.tHDetailEx.refundableDeposit
+    }
+}
+
+const onSubmit = () => {
+    const { tHDetailEx } = props.selectedRow ?? {}
+
+    if (orderType.value === 1) {
+        // 补充
+
+        supplementDepositReq.TradeID = tHDetailEx.tradeID
+        supplementDepositReq.BuyOrSell = tHDetailEx.buyOrSell
+        fullloading((hideLoading) => {
+            supplementDeposit({ data: supplementDepositReq }).then(() => {
+                hideLoading('提交成功', 'success')
+                closed(true)
+            }).catch((err) => {
+                hideLoading(err, 'fail')
+            })
+        })
+    }
+
+    if (orderType.value === 2) {
+        // 退返
+
+        refundedDepositReq.TradeID = tHDetailEx.tradeID
+        refundedDepositReq.BuyOrSell = tHDetailEx.buyOrSell
+        fullloading((hideLoading) => {
+            refundedDeposit({ data: refundedDepositReq }).then(() => {
+                hideLoading('提交成功', 'success')
+                closed(true)
+            }).catch((err) => {
+                hideLoading(err, 'fail')
+            })
+        })
+    }
+
+}
+
+// 关闭弹窗
+const closed = (isRefresh = false) => {
+    refresh.value = isRefresh
+    showModal.value = false
+}
+
+onMounted(() => {
+    // formData.FixedPrice = props.selectedRow.spotgoodsprice
+})
+
+// 暴露组件属性给父组件调用
+defineExpose({
+    closed,
+})
+</script>

+ 4 - 4
src/services/api/trade/index.ts

@@ -272,7 +272,7 @@ export function offlineDelivery(config: RequestConfig<Partial<Proto.OfflineDeliv
 /**
  * 补充定金接口请求(水贝亿爵)
  */
-export function SupplementDeposit(config: RequestConfig<Partial<Proto.SupplementDepositReq>>) {
+export function supplementDeposit(config: RequestConfig<Partial<Proto.SupplementDepositReq>>) {
     return http.mqRequest<Proto.SupplementDepositRsp>({
         data: {
             AccountID: accountStore.accountId,
@@ -289,7 +289,7 @@ export function SupplementDeposit(config: RequestConfig<Partial<Proto.Supplement
 /**
  * 退返定金接口请求(水贝亿爵)
  */
-export function RefundedDeposit(config: RequestConfig<Partial<Proto.RefundedDepositReq>>) {
+export function refundedDeposit(config: RequestConfig<Partial<Proto.RefundedDepositReq>>) {
     return http.mqRequest<Proto.RefundedDepositRsp>({
         data: {
             AccountID: accountStore.accountId,
@@ -306,7 +306,7 @@ export function RefundedDeposit(config: RequestConfig<Partial<Proto.RefundedDepo
 /**
  * 按单做市交收申请接口请求(水贝亿爵)
  */
-export function MarketOrderDeliveryApply(config: RequestConfig<Partial<Proto.MarketOrderDeliveryApplyReq>>) {
+export function marketOrderDeliveryApply(config: RequestConfig<Partial<Proto.MarketOrderDeliveryApplyReq>>) {
     return http.mqRequest<Proto.MarketOrderDeliveryApplyRsp>({
         data: {
             AccountID: accountStore.accountId,
@@ -323,7 +323,7 @@ export function MarketOrderDeliveryApply(config: RequestConfig<Partial<Proto.Mar
 /**
  * 交收终端操作接口请求(水贝亿爵)
  */
-export function DeliveryClientOperator(config: RequestConfig<Partial<Proto.DeliveryClientOperatorReq>>) {
+export function deliveryClientOperator(config: RequestConfig<Partial<Proto.DeliveryClientOperatorReq>>) {
     return http.mqRequest<Proto.DeliveryClientOperatorRsp>({
         data: {
             AccountID: accountStore.accountId,

+ 6 - 2
src/types/model/order.d.ts

@@ -1452,7 +1452,7 @@ declare namespace Model {
 
     interface TradeHolderDetailEx {
         /// 成交单号(101+Unix秒时间戳(10位)+2位(MarketServiceID)+xxxx)
-        tradeID: number;
+        tradeID: string;
         /// 方向 - 0:买 1:卖
         buyOrSell: number;
         /// 交易日(yyyyMMdd)
@@ -1515,6 +1515,8 @@ declare namespace Model {
         depositRate: number;
         /// 可退定金
         refundableDeposit: number;
+        /// 交易时间
+        tradeTime: string;
     }
 
     /// 交易持仓扩展表记录
@@ -1677,7 +1679,9 @@ declare namespace Model {
         confirmstatus?: number
     }
 
-    /* 查询我的交收-操作流水 回复*/
+    /**
+     * 查询我的交收-操作流水 回复
+     */
     interface MyDeliveryOfflineOperateLogRsp {
         /// 明细单号(907+Unix秒时间戳(10位)+2位(MarketServiceID)+xxxx)
         operatelogid?: number;

+ 3 - 3
src/types/proto/trade.d.ts

@@ -604,7 +604,7 @@ declare global {
         // 补充定金接口请求
         interface SupplementDepositReq {
             Header?: MessageHead;
-            TradeID?: number; // 成交单号,必填
+            TradeID?: string; // 成交单号,必填
             BuyOrSell?: number; // 买卖方向,必填
             UserID?: number; // 用户ID,必填
             AccountID?: number; // 交易账号,必填
@@ -628,7 +628,7 @@ declare global {
         // 退返定金接口请求
         interface RefundedDepositReq {
             Header?: MessageHead;
-            TradeID?: number; // 成交单号,必填
+            TradeID?: string; // 成交单号,必填
             BuyOrSell?: number; // 买卖方向,必填
             UserID?: number; // 用户ID,必填
             AccountID?: number; // 交易账号,必填
@@ -651,7 +651,7 @@ declare global {
 
         // 持仓明细
         interface MarketOrderHoldDetails {
-            TradeID?: number; // 成交单号,必填
+            TradeID?: string; // 成交单号,必填
             DeliveryQty?: number; // 交收数量,必填
         }