li.shaoyi 2 년 전
부모
커밋
b95ad0a6b9

+ 2 - 2
oem/qdhs/config/router.json

@@ -345,8 +345,8 @@
                                 "authType": 2,
                                 "sort": 3,
                                 "title": "全款挂牌",
-                                "code": "market_trade_presell_16201",
-                                "component": "views/market/trade/presell/transfer/index.vue"
+                                "code": "market_trade_goods_16201",
+                                "component": "views/market/trade/goods/list/index.vue"
                             }
                         ]
                     },

+ 5 - 5
oem/zrwyt/config/router.json

@@ -274,21 +274,21 @@
                         "children": [
                             {
                                 "authType": 2,
-                                "sort": 3,
+                                "sort": 1,
                                 "title": "全款挂牌",
-                                "code": "market_trade_presell_16201",
-                                "component": "views/market/trade/presell/transfer/index.vue"
+                                "code": "market_trade_goods_16201",
+                                "component": "views/market/trade/goods/list/index.vue"
                             },
                             {
                                 "authType": 2,
-                                "sort": 1,
+                                "sort": 2,
                                 "title": "预售中签",
                                 "code": "market_trade_presell_ballot",
                                 "component": "views/market/trade/presell/ballot/index.vue"
                             },
                             {
                                 "authType": 2,
-                                "sort": 2,
+                                "sort": 3,
                                 "title": "定金转让",
                                 "code": "market_trade_presell_49201",
                                 "component": "views/market/trade/presell/transfer/index.vue"

+ 2 - 2
public/config/appconfig.json

@@ -1,7 +1,7 @@
 {
   "appName": "多元世纪交易中心",
-  "version": "1.0.0",
-  "versionCode": "100000",
+  "version": "1.0.1",
+  "versionCode": "100001",
   "apiUrl": "http://103.40.249.126:18280/cfg?key=mtp_20",
   "tradeChannel": "ws",
   "modules": [

+ 2 - 2
public/config/router.json

@@ -286,8 +286,8 @@
                                 "authType": 2,
                                 "sort": 3,
                                 "title": "全款挂牌",
-                                "code": "market_trade_presell_16201",
-                                "component": "views/market/trade/presell/transfer/index.vue"
+                                "code": "market_trade_goods_16201",
+                                "component": "views/market/trade/goods/list/index.vue"
                             }
                         ]
                     },

+ 35 - 28
src/packages/mobile/views/goods/detail/components/listing/Index.vue

@@ -47,14 +47,14 @@
                             @click="onBeforeSubmit(EBuildType.BUILDTYPE_OPEN)">订立买入</Button>
                         <Button type="primary" block square
                             :disabled="!formData.OrderQty || !sellQty || (formData.OrderQty > sellQty)"
-                            @click="onBeforeSubmit(EBuildType.BUILDTYPE_CLOSE)" v-if="quote?.trademode !== 16">
+                            @click="onBeforeSubmit(EBuildType.BUILDTYPE_CLOSE)" v-if="!isTrademode16">
                             <span>转让买入</span>
                             <span v-if="sellQty">(≤{{ sellQty }})</span>
                         </Button>
                     </template>
                     <template v-if="buyOrSell === BuyOrSell.Sell">
                         <Button type="danger" block square :disabled="!formData.OrderQty"
-                            @click="onBeforeSubmit(EBuildType.BUILDTYPE_OPEN)" v-if="quote?.trademode !== 16">订立卖出</Button>
+                            @click="onBeforeSubmit(EBuildType.BUILDTYPE_OPEN)" v-if="!isTrademode16">订立卖出</Button>
                         <Button type="primary" block square
                             :disabled="!formData.OrderQty || !buyQty || (formData.OrderQty > buyQty)"
                             @click="onBeforeSubmit(EBuildType.BUILDTYPE_CLOSE)">
@@ -105,6 +105,8 @@ const refresh = shallowRef(true) // 是否刷新父组件数据
 const qtyStepList = [1, 5, 10, 20, 30, 50] // 数量步长列表
 const qtyStep = shallowRef(qtyStepList[0]) // 数量步长
 
+const isTrademode16 = computed(() => quote.value?.trademode === 16)
+
 // 价格步长
 const priceStep = computed(() => {
     const { quoteminunit = 0, decimalplace = 0 } = quote.value ?? {}
@@ -163,37 +165,42 @@ const onRadioChange = (value: number) => {
     formData.OrderQty = value
 }
 
+const onBeforeSubmit = (buildType: EBuildType) => {
+    formData.BuildType = buildType
+    if (isTrademode16.value) {
+        formRef.value?.submit()
+    } else {
+        dialog({
+            title: '确认要提交吗?',
+            message: '*若存在价格匹配的反方向委托订单,系统将会自动撤销',
+            showCancelButton: true,
+        }).then(() => {
+            formRef.value?.submit()
+        })
+    }
+}
+
 // 提交挂牌
 const onSubmit = () => {
-    dialog({
-        title: '确认要提交吗?',
-        message: '*若存在价格匹配的反方向委托订单,系统将会自动撤销',
-        showCancelButton: true,
-    }).then(() => {
-        const { marketid = 0, goodsid = 0 } = quote.value ?? {}
-        /// 获取对应的市场ID
-        formData.MarketID = marketid
-        formData.PriceMode = EPriceMode.PRICEMODE_LIMIT
-        formData.GoodsID = goodsid
-        formData.ListingSelectType = EListingSelectType.LISTINGSELECTTYPE_DELISTINGTHENLISTING
-        formData.DelistingType = EDelistingType.DELISTINGTYPE_PRICE
-        formData.TimevalidType = EValidType.VALIDTYPE_DR
-        formData.OperateType = EOrderOperateType.ORDEROPERATETYPE_NORMAL
-        formData.BuyOrSell = props.buyOrSell
-
-        fullloading((hideLoading) => {
-            formSubmit().then(() => {
-                hideLoading('提交成功。', 'success')
-            }).catch((err) => {
-                hideLoading(err, 'fail')
-            })
+    const { marketid = 0, goodsid = 0 } = quote.value ?? {}
+    /// 获取对应的市场ID
+    formData.MarketID = marketid
+    formData.PriceMode = EPriceMode.PRICEMODE_LIMIT
+    formData.GoodsID = goodsid
+    formData.ListingSelectType = EListingSelectType.LISTINGSELECTTYPE_DELISTINGTHENLISTING
+    formData.DelistingType = EDelistingType.DELISTINGTYPE_PRICE
+    formData.TimevalidType = EValidType.VALIDTYPE_DR
+    formData.OperateType = EOrderOperateType.ORDEROPERATETYPE_NORMAL
+    formData.BuyOrSell = props.buyOrSell
+
+    fullloading((hideLoading) => {
+        formSubmit().then(() => {
+            hideLoading('提交成功。', 'success')
+        }).catch((err) => {
+            hideLoading(err, 'fail')
         })
     })
-}
 
-const onBeforeSubmit = (buildType: EBuildType) => {
-    formData.BuildType = buildType
-    formRef.value?.submit()
 }
 
 // 关闭弹窗

+ 2 - 9
src/packages/mobile/views/transfer/listing/Index.vue

@@ -59,7 +59,6 @@ import { fullloading, dialog } from '@/utils/vant'
 import { useRequest } from '@/hooks/request'
 import { queryMineTradePositionExs } from '@/services/api/transfer'
 import { useOrder } from '@/business/trade'
-import { usePosition } from '@/business/position'
 import { useAccountStore, useFuturesStore } from '@/stores'
 import AppModal from '@/components/base/modal/index.vue'
 import { BuyOrSell } from '@/constants/order'
@@ -82,7 +81,6 @@ const props = defineProps({
 const { formData, formSubmit } = useOrder()
 const accountStore = useAccountStore()
 const futuresStore = useFuturesStore()
-const { positionList } = usePosition(16)
 const formRef = shallowRef<FormInstance>()
 const refresh = shallowRef(false) // 是否刷新父组件数据
 const showModal = shallowRef(true)
@@ -131,13 +129,8 @@ const formRules: { [key in keyof Proto.OrderReq]?: FieldRule[] } = {
 
 // 可用数量
 const enableqty = computed(() => {
-    if (quote.value?.trademode === 16) {
-        const item = positionList.value.find((e) => e.goodsid === quote.value?.goodsid)
-        return item?.enableqty ?? 0
-    } else {
-        const [firstItem] = dataList.value
-        return firstItem ? firstItem.buycurpositionqty - firstItem.buyfrozenqty : 0
-    }
+    const [firstItem] = dataList.value
+    return firstItem ? firstItem.buycurpositionqty - firstItem.buyfrozenqty : 0
 })
 
 const onPriceClick = (buyorsell: BuyOrSell, value: number) => {

+ 3 - 0
src/packages/pc/views/market/trade/goods/list/index.vue

@@ -135,6 +135,9 @@ onMounted(() => {
         case 'market_trade_goods_50104':
             setMarketId(50104)
             break
+        case 'market_trade_goods_16201':
+            setMarketId(16201)
+            break
     }
     globalStore.showGoodsListing = true
 })

+ 51 - 39
src/packages/pc/views/market/trade/goods/list/listing/index.vue

@@ -43,17 +43,18 @@
                         <el-radio-group size="small" v-model="qtyStep" :validate-event="false" @change="onRadioChange">
                             <el-radio v-for="(value, index) in qtyStepList" :key="index" :label="value" border />
                         </el-radio-group>
-                        <div style="line-height: 1;font-size: 12px;color: #7a8a94;" v-if="false">可用资金订立量:{{ enableQty }}</div>
+                        <div style="line-height: 1;font-size: 12px;color: #7a8a94;" v-if="false">可用资金订立量:{{ enableQty }}
+                        </div>
                     </div>
                 </el-form-item>
                 <el-form-item class="footer-btnbar">
                     <template v-if="formData.BuyOrSell === BuyOrSell.Buy">
                         <el-button ref="submitRef" type="primary" :loading="loading"
                             :disabled="!selectedGoodsId || !formData.OrderQty"
-                            @click="onSubmit(EBuildType.BUILDTYPE_OPEN)">订立</el-button>
+                            @click="onBeforeSubmit(EBuildType.BUILDTYPE_OPEN)">订立</el-button>
                         <el-button type="primary" :loading="loading"
                             :disabled="!formData.OrderQty || !sellQty || (formData.OrderQty > sellQty)"
-                            @click="onSubmit(EBuildType.BUILDTYPE_CLOSE)">
+                            @click="onBeforeSubmit(EBuildType.BUILDTYPE_CLOSE)" v-if="!isTrademode16">
                             <span>转让</span>
                             <span v-if="sellQty">(≤{{ sellQty }})</span>
                         </el-button>
@@ -61,10 +62,10 @@
                     <template v-if="formData.BuyOrSell === BuyOrSell.Sell">
                         <el-button ref="submitRef" type="primary" :loading="loading"
                             :disabled="!selectedGoodsId || !formData.OrderQty"
-                            @click="onSubmit(EBuildType.BUILDTYPE_OPEN)">订立</el-button>
+                            @click="onBeforeSubmit(EBuildType.BUILDTYPE_OPEN)" v-if="!isTrademode16">订立</el-button>
                         <el-button type="primary" :loading="loading"
                             :disabled="!formData.OrderQty || !buyQty || (formData.OrderQty > buyQty)"
-                            @click="onSubmit(EBuildType.BUILDTYPE_CLOSE)">
+                            @click="onBeforeSubmit(EBuildType.BUILDTYPE_CLOSE)">
                             <span>转让</span>
                             <span v-if="buyQty">(≤{{ buyQty }})</span>
                         </el-button>
@@ -92,7 +93,7 @@ const futuresStore = useFuturesStore()
 
 const { selectedGoodsId, selectedGoods, marketGoodsList } = futuresStore.$toRefs()
 const { formData, loading, formSubmit } = useOrder()
-const { getOrderQty } = usePosition(50)
+const { getOrderQty } = usePosition(selectedGoods.value?.trademode ?? 0)
 const formRef = shallowRef<FormInstance>()
 const qtyStepList = [1, 10, 100] // 数量步长列表
 const qtyStep = shallowRef(qtyStepList[0]) // 数量步长
@@ -101,6 +102,8 @@ const priceRef = shallowRef()
 const qtyRef = shallowRef()
 const submitRef = shallowRef()
 
+const isTrademode16 = computed(() => selectedGoods.value?.trademode === 16)
+
 // 价格步长
 const priceStep = computed(() => {
     const { quoteminunit = 0, decimalplace = 0 } = selectedGoods.value ?? {}
@@ -195,42 +198,51 @@ const onPriceClick = (buyorsell: BuyOrSell, value: number) => {
     }
 }
 
-// 提交挂牌
-const onSubmit = (buildType: number) => {
+const onBeforeSubmit = (buildType: EBuildType) => {
     formRef.value?.validate((valid) => {
         if (valid) {
-            ElMessageBox.confirm(
-                '*若存在价格匹配的反方向委托订单,系统将会自动撤销。',
-                '是否立即挂牌?'
-            ).then(() => {
-                const { marketid = 0, goodsid = 0 } = selectedGoods.value ?? {}
-                /// 获取对应的市场ID
-                formData.MarketID = marketid
-                formData.PriceMode = EPriceMode.PRICEMODE_LIMIT
-                formData.GoodsID = goodsid
-                formData.ListingSelectType = EListingSelectType.LISTINGSELECTTYPE_DELISTINGTHENLISTING
-                formData.DelistingType = EDelistingType.DELISTINGTYPE_PRICE
-                formData.TimevalidType = EValidType.VALIDTYPE_DR
-                formData.OperateType = EOrderOperateType.ORDEROPERATETYPE_NORMAL
-                formData.BuildType = buildType
+            formData.BuildType = buildType
+            if (isTrademode16.value) {
+                ElMessageBox.confirm(
+                    '是否立即挂牌?',
+                    '提示'
+                ).then(() => onSubmit())
+            } else {
+                ElMessageBox.confirm(
+                    '*若存在价格匹配的反方向委托订单,系统将会自动撤销。',
+                    '是否立即挂牌?'
+                ).then(() => onSubmit())
+            }
+        }
+    })
+}
 
-                formSubmit().then(() => {
-                    if (settingStore.getSettingValue('orderQtyIsEmpty')) {
-                        formData.OrderQty = undefined
-                        qtyStep.value = 0
-                    }
-                    ElMessage.success('挂牌成功')
-                }).catch((err) => {
-                    ElMessage.error('挂牌失败:' + err)
-                }).finally(() => {
-                    const focusType = settingStore.getSettingValue('orderFocusType')
-                    if (focusType === 2 || isDisabled.value) {
-                        qtyInputFocus()
-                    } else {
-                        priceInputFocus()
-                    }
-                })
-            })
+// 提交挂牌
+const onSubmit = () => {
+    const { marketid = 0, goodsid = 0 } = selectedGoods.value ?? {}
+    /// 获取对应的市场ID
+    formData.MarketID = marketid
+    formData.PriceMode = EPriceMode.PRICEMODE_LIMIT
+    formData.GoodsID = goodsid
+    formData.ListingSelectType = EListingSelectType.LISTINGSELECTTYPE_DELISTINGTHENLISTING
+    formData.DelistingType = EDelistingType.DELISTINGTYPE_PRICE
+    formData.TimevalidType = EValidType.VALIDTYPE_DR
+    formData.OperateType = EOrderOperateType.ORDEROPERATETYPE_NORMAL
+
+    formSubmit().then(() => {
+        if (settingStore.getSettingValue('orderQtyIsEmpty')) {
+            formData.OrderQty = undefined
+            qtyStep.value = 0
+        }
+        ElMessage.success('挂牌成功')
+    }).catch((err) => {
+        ElMessage.error('挂牌失败:' + err)
+    }).finally(() => {
+        const focusType = settingStore.getSettingValue('orderFocusType')
+        if (focusType === 2 || isDisabled.value) {
+            qtyInputFocus()
+        } else {
+            priceInputFocus()
         }
     })
 }

+ 0 - 3
src/packages/pc/views/market/trade/presell/transfer/index.vue

@@ -123,9 +123,6 @@ onMounted(() => {
         case 'market_trade_presell_49201':
             setMarketId(49201)
             break
-        case 'market_trade_presell_16201':
-            setMarketId(16201)
-            break
     }
     globalStore.showTransferListing = true
 })

+ 2 - 9
src/packages/pc/views/market/trade/presell/transfer/listing/index.vue

@@ -68,14 +68,12 @@ import { BuyOrSell, getBuyOrSellList } from '@/constants/order'
 import { useRequest } from '@/hooks/request'
 import { queryMineTradePositionExs } from '@/services/api/transfer'
 import { useOrder } from '@/business/trade'
-import { usePosition } from '@/business/position'
 import { useFuturesStore, useSettingStore } from '@/stores'
 import Forex from '@pc/components/modules/quote/forex/index.vue'
 import Icon from '@pc/components/base/icon/index.vue'
 
 const settingStore = useSettingStore()
 const futuresStore = useFuturesStore()
-const { positionList } = usePosition(16)
 const { selectedGoodsId, selectedGoods, marketGoodsList } = futuresStore.$toRefs()
 const { formData, loading, formSubmit } = useOrder()
 const formRef = shallowRef<FormInstance>()
@@ -99,13 +97,8 @@ const { dataList, run: getMineTradePositionExs } = useRequest(queryMineTradePosi
 
 // 可用数量
 const enableqty = computed(() => {
-    if (selectedGoods.value?.trademode === 16) {
-        const item = positionList.value.find((e) => e.goodsid === selectedGoodsId.value)
-        return item?.enableqty ?? 0
-    } else {
-        const [firstItem] = dataList.value
-        return firstItem ? firstItem.buycurpositionqty - firstItem.buyfrozenqty : 0
-    }
+    const [firstItem] = dataList.value
+    return firstItem ? firstItem.buycurpositionqty - firstItem.buyfrozenqty : 0
 })
 
 // 价格步长