li.shaoyi 2 роки тому
батько
коміт
7c2644f59d

+ 1 - 1
src/packages/mobile/views/swap/detail/Index.vue

@@ -24,7 +24,7 @@
                         <span>{{ row.userid }}/{{ row.username }}</span>
                     </template>
                     <template #operate="{ row }">
-                        <Button size="small" type="primary" :disabled="isDisable(row)">
+                        <Button size="small" type="primary" :disabled="isDisable(row)" @click="onDelisting(row)">
                             {{ getDelistingButtonTitles(tabIndex, row) }}
                         </Button>
                     </template>

+ 9 - 48
src/packages/pc/views/footer/inout/out/index.vue

@@ -6,24 +6,6 @@
                 <el-button type="primary" size="small" @click="openComponent('add')">新增</el-button>
             </div>
         </template>
-        <!-- 挂牌类型 -->
-        <template #buyorsell="{ value }">
-            {{ getBuyOrSellName(value) }}
-        </template>
-        <!-- 最新价 -->
-        <template #lastprice="{ row }">
-            <span :class="row.lastColor">
-                {{ handleNumberValue(formatDecimal(row.lastprice, row.decimalplace)) }}
-            </span>
-        </template>
-        <!-- 市值-->
-        <template #marketValue="{ value }">
-            {{ formatDecimal(value) }}
-        </template>
-        <!-- 浮动盈亏-->
-        <template #closepl="{ row }">
-            <span :class="row.closeplColor">{{ formatDecimal(row.closepl, row.decimalplace) }}</span>
-        </template>
         <!-- 操作 -->
         <template #footer>
             <component ref="componentRef" :is="componentMap.get(componentId)" @closed="closeComponent" v-if="componentId" />
@@ -33,17 +15,11 @@
 
 <script lang="ts" setup>
 import { shallowRef, defineAsyncComponent } from 'vue'
-import { handleNumberValue, formatDecimal } from '@/filters'
-import { getBuyOrSellName } from '@/constants/order'
 import { useComponent } from '@/hooks/component'
 import { useRequest } from '@/hooks/request'
 import { queryOutTradepositiontransfer } from '@/services/api/transfer'
 import AppTable from '@pc/components/base/table/index.vue'
 
-defineProps({
-    code: String
-})
-
 const componentMap = new Map<string, unknown>([
     ['add', defineAsyncComponent(() => import('./add/index.vue'))], // 新增
 ])
@@ -55,29 +31,14 @@ const { componentRef, componentId, openComponent, closeComponent } = useComponen
 const { dataList, run } = useRequest(queryOutTradepositiontransfer)
 
 const tableColumns = shallowRef<Model.TableColumn[]>([
-    { prop: 'goodsname', label: '订单合约' },
-    { prop: 'buyorsell', label: '方向' },
-    { prop: 'curpositionqty', label: '持有数量' },
-    { prop: 'enableqty', label: '可用数量' },
-    { prop: 'frozenqty', label: '预扣数量' },
-    { prop: 'averageprice', label: '均价' },
-    { prop: 'lastprice', label: '现价' },
-    { prop: 'curholderamount', label: '持仓金额' },
-    { prop: 'marketValue', label: '市值' },
-    { prop: 'closepl', label: '参考损益' },
-    { prop: 'operate', label: '操作', fixed: 'right', width: 140 },
+    { prop: 'goodsdisplay', label: '商品' },
+    { prop: 'inusername', label: '转入方' },
+    { prop: 'qty', label: '转让数量' },
+    { prop: 'transferprice', label: '转让价格' },
+    { prop: 'freezedays', label: '冻结天数' },
+    { prop: 'goodscurprice', label: '商品价格' },
+    { prop: 'outcharge', label: '手续费' },
+    { prop: 'transferapplystatus', label: '状态' },
+    { prop: 'applytime', label: '申请时间' }
 ])
-
-const handleOperateButtons = (row: Model.TradePositionRsp) => {
-    const buttons = ['bottom_goods_position_transfer']
-    switch (row.trademode) {
-        case 16:
-            buttons.push('bottom_goods_position_delivery16')
-            break;
-        case 50:
-            buttons.push('bottom_goods_position_delivery50')
-            break;
-    }
-    return buttons
-}
 </script>

+ 8 - 1
src/packages/pc/views/market/trade/spot/order/delisting/index.vue

@@ -16,7 +16,7 @@
             </el-form-item>
             <el-form-item prop="OrderQty" label="摘牌数量">
                 <div class="el-form-item--col">
-                    <el-input-number placeholder="请输入" :min="0" :precision="0" v-model="formData.OrderQty" />
+                    <el-input-number placeholder="请输入" :min="0" :max="maxQty" :precision="0" v-model="formData.OrderQty" />
                     <span>{{ quoteDetail.enumdicname }}</span>
                 </div>
             </el-form-item>
@@ -72,6 +72,13 @@ const { data: holdLB } = useRequest(queryHoldLB, {
     }
 })
 
+// 最大可摘牌数量
+const maxQty = computed(() => {
+    const a = props.quoteDetail.orderqty
+    const b = holdLB.value?.enableqty ?? 0
+    return Math.min(a, b)
+})
+
 // 货款金额
 const amount = computed(() => {
     const { OrderQty = 0 } = formData

+ 30 - 32
src/packages/pc/views/market/trade/swap/detail/listing/index.vue

@@ -15,20 +15,23 @@
                 </el-radio-group>
             </el-form-item>
             <el-form-item v-if="priceMove === 2" prop="OrderPrice" label="挂牌价格">
-                <el-input-number placeholder="请输入" :min="0" :step="Math.pow(10, -1*(goods?.decimalplace ?? 0))" :precision="(goods?.decimalplace ?? 2)" v-model="formData.OrderPrice" @change="calculateListingAmount"/>
+                <el-input-number placeholder="请输入" :min="0" :step="Math.pow(10, -1 * (goods?.decimalplace ?? 0))"
+                    :precision="(goods?.decimalplace ?? 2)" v-model="formData.OrderPrice"
+                    @change="calculateListingAmount" />
             </el-form-item>
             <el-form-item v-if="priceMove === 3" prop="MarketMaxSub" label="点差">
-                <el-input-number placeholder="请输入" :min="minBasis" :maxBasis="maxBasis" :precision="2" v-model="formData.MarketMaxSub" @change="calculateListingAmount" />
+                <el-input-number placeholder="请输入" :min="minBasis" :maxBasis="maxBasis" :precision="2"
+                    v-model="formData.MarketMaxSub" @change="calculateListingAmount" />
             </el-form-item>
             <el-form-item prop="OrderQty" label="挂牌数量">
                 <div class="g-qty-group">
-                    <el-input-number placeholder="请输入" :min="0" :precision="0" :step="qtyStep"
-                        v-model="formData.OrderQty" @change="calculateListingAmount" />
+                    <el-input-number placeholder="请输入" :min="0" :precision="0" :step="qtyStep" v-model="formData.OrderQty"
+                        @change="calculateListingAmount" />
                     <el-radio-group size="small" v-model="qtyStep" @change="onRadioChange">
                         <el-radio v-for="(value, index) in qtyStepList" :key="index" :label="value" border />
                     </el-radio-group>
                 </div>
-            </el-form-item> 
+            </el-form-item>
             <el-form-item label="交易账号">
                 <span>{{ accountStore.currentAccountId }}</span>
             </el-form-item>
@@ -102,7 +105,7 @@ const estimateprice = shallowRef(quote.value?.last ?? 0.0)
 /// 保证金参数设置
 const margin = shallowRef<Model.TjmdTodayAccountMarginRsp>()
 /// 商品信息
-const goods =  computed(() => futuresStore.getGoods(props.quoteGoods.goodsid) ) 
+const goods = computed(() => futuresStore.getGoods(props.quoteGoods.goodsid))
 /// 市场交易参数配置
 const config = shallowRef<Model.WrMarketTradeConfigRsp>()
 
@@ -161,13 +164,8 @@ const formRules: FormRules = {
     }],
     MarketMaxSub: [{
         required: true,
-        validator: (rule, value, callback) => {
-            if (value) {
-                callback()
-            } else {
-                callback(new Error('请输入点差'))
-            }
-        }
+        type: 'number',
+        message: '请输入点差'
     }],
 }
 
@@ -188,45 +186,45 @@ const calculateListingAmount = () => {
             const { agreeunit = 0 } = goods.value ?? {}
             /// 按比例
             if (MarginAlgorithm === 1) {
-                permargin.value = OrderPrice*OrderQty*agreeunit*MarketMarginValue
+                permargin.value = OrderPrice * OrderQty * agreeunit * MarketMarginValue
             } else {
-                permargin.value = OrderQty*MarketMarginValue
+                permargin.value = OrderQty * MarketMarginValue
             }
-            amount.value = OrderQty*OrderPrice*agreeunit
+            amount.value = OrderQty * OrderPrice * agreeunit
         } else {
             const last = futuresStore.getQuotePrice(props.quoteGoods.refgoodscode)
             const basic = formData.MarketMaxSub ?? 0.0
             /// 浮动估算价价
-            estimateprice.value = basic+last.value
+            estimateprice.value = basic + last.value
             const { MarginAlgorithm, MarketMarginValue } = margin.value?.infoc
             const { OrderQty = 0 } = formData
             const { agreeunit = 0 } = goods.value ?? {}
             /// 按比例
             if (MarginAlgorithm === 1) {
-                permargin.value = estimateprice.value*OrderQty*agreeunit*MarketMarginValue
+                permargin.value = estimateprice.value * OrderQty * agreeunit * MarketMarginValue
             } else {
-                permargin.value = OrderQty*MarketMarginValue
+                permargin.value = OrderQty * MarketMarginValue
             }
-            amount.value = OrderQty*estimateprice.value*agreeunit
+            amount.value = OrderQty * estimateprice.value * agreeunit
         }
     }
 }
 
 /// 计算基差范围
 const calculateBasis = () => {
-     /// 获取配置
-     if (config.value) {
-        const { basisdownratio, basisupratio} = config.value
+    /// 获取配置
+    if (config.value) {
+        const { basisdownratio, basisupratio } = config.value
         const { preclose = 0 } = quote.value ?? {}
         console.log(basisdownratio, basisupratio, preclose)
-         /* 基差范围大小
-           基差价格可以为负或为0
-           基差范围:
-           最大值=基差取值上限百分比*关联期货合约昨收价
-           最小值= -1 * 基差取值下限百分比*关联期货合约昨收价 */
-        maxBasis.value = basisupratio*preclose
-        minBasis.value = -1.0*basisdownratio*preclose
-     }
+        /* 基差范围大小
+          基差价格可以为负或为0
+          基差范围:
+          最大值=基差取值上限百分比*关联期货合约昨收价
+          最小值= -1 * 基差取值下限百分比*关联期货合约昨收价 */
+        maxBasis.value = basisupratio * preclose
+        minBasis.value = -1.0 * basisdownratio * preclose
+    }
 }
 
 const onCancel = (isRefresh = false) => {
@@ -239,7 +237,7 @@ const onSubmit = () => {
         if (valid) {
             ElMessageBox.confirm('是否立即挂牌?').then(() => {
                 /// 买卖方向
-                const { goodsid } = props.quoteGoods?? {}
+                const { goodsid } = props.quoteGoods ?? {}
                 /// 获取对应的市场ID
                 formData.MarketID = futuresStore.getGoodsMarket(goodsid)
                 formData.OrderPrice = priceMove.value === EPriceMode.PRICEMODE_LIMIT ? formData.OrderPrice : 0.0

+ 16 - 10
src/packages/pc/views/market/trade/swap/detail/order/index.vue

@@ -3,26 +3,32 @@
     <div class="app-goods-detail-order">
         <app-table class="sell" :data="sellList" v-model:columns="sellColumns" :row-key="rowKey"
             :expand-row-keys="expandKeys" @row-click="rowClick" showIndex>
+            <template #username="{ row }">
+                <span>{{ row.userid }}/{{ row.username }}</span>
+            </template>
             <!-- 展开行 -->
             <template #expand="{ row }">
                 <div class="buttonbar">
                     <el-button type="primary" size="small" :disabled="row.userid === loginStore.userId"
-                        @click="onDelisting(row)">{{ getDelistingButtonTitles( 0, row ) }}</el-button>
+                        @click="onDelisting(row)">{{ getDelistingButtonTitles(0, row) }}</el-button>
                 </div>
             </template>
         </app-table>
         <app-table class="buy" :data="buyList" v-model:columns="buyColumns" :row-key="rowKey" :expand-row-keys="expandKeys"
             @row-click="rowClick" showIndex>
+            <template #username="{ row }">
+                <span>{{ row.userid }}/{{ row.username }}</span>
+            </template>
             <!-- 展开行 -->
             <template #expand="{ row }">
                 <div class="buttonbar">
-                    <el-button type="primary" size="small" :disabled="isDisable(row)"
-                        @click="onDelisting(row)">{{ getDelistingButtonTitles( 1, row ) }}</el-button>
+                    <el-button type="primary" size="small" :disabled="isDisable(row)" @click="onDelisting(row)">{{
+                        getDelistingButtonTitles(1, row) }}</el-button>
                 </div>
             </template>
         </app-table>
-        <component ref="componentRef" v-bind="{ selectedRow, quoteGoods }" :is="componentMap.get(componentId)" @closed="closeComponent"
-            v-if="componentId" />
+        <component ref="componentRef" v-bind="{ selectedRow, quoteGoods }" :is="componentMap.get(componentId)"
+            @closed="closeComponent" v-if="componentId" />
     </div>
 </template>
 
@@ -59,7 +65,7 @@ const futuresStore = useFuturesStore()
 const quote = futuresStore.getGoodsQuote(props.goodsId)
 
 /// 查询用户掉期协议签署表
-const { dataList: protocolList} = useRequest(queryMdUserSwapProtocol, {
+const { dataList: protocolList } = useRequest(queryMdUserSwapProtocol, {
     params: {
         userId: getUserId()
     }
@@ -74,7 +80,7 @@ const status = (row: Model.TjmdTradeOrderDetailRsp) => {
 }
 
 const { rowKey, expandKeys, selectedRow, rowClick } = useComposeTable<Model.TjmdTradeOrderDetailRsp>({ rowKey: 'orderid' })
-const { componentRef, componentId, openComponent, closeComponent } = useComponent(()=> {
+const { componentRef, componentId, openComponent, closeComponent } = useComponent(() => {
     // 获取买大厅数据
     getBuyList()
     // 获取卖大厅数据
@@ -113,13 +119,13 @@ const { dataList: sellList, run: getSellList } = useRequest(queryTjmdTradeOrderD
 const onDelisting = (row: Model.TjmdTradeOrderDetailRsp) => {
     switch (status(row)) {
         case 4: /// 已签署
-        showComponent('delisting', row)
+            showComponent('delisting', row)
             break;
         case 1:  /// 未签署
             /// 传对应的机构 ID
             /// 进行下一步
             openComponent('protocol')
-            break; 
+            break;
         default: /// 其他状态
             break;
     }
@@ -131,7 +137,7 @@ setTimeout(() => {
     getBuyList()
     // 获取卖大厅数据
     getSellList()
-}, 30*1000)
+}, 30 * 1000)
 
 const buyColumns = shallowRef<Model.TableColumn[]>([
     { prop: 'orderprice', label: '买价' },