li.shaoyi 2 yıl önce
ebeveyn
işleme
b1338b3f12

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

@@ -98,7 +98,7 @@ const accountStore = useAccountStore()
 const futuresStore = useFuturesStore()
 const quote = futuresStore.getGoodsQuote(props.goodsCode)
 
-const { getOrderQty } = usePosition(quote.value?.trademode ?? 0)
+const { getOrderQty } = usePosition()
 const { formData, formSubmit } = useOrder()
 const formRef = shallowRef<FormInstance>()
 const showModal = shallowRef(true)

+ 1 - 1
src/packages/mobile/views/goods/trade/components/delisting/index.vue

@@ -95,7 +95,7 @@ const props = defineProps({
 
 const accountStore = useAccountStore()
 const futuresStore = useFuturesStore()
-const { getOrderQty } = usePosition(50)
+const { getOrderQty } = usePosition()
 const { formData, formSubmit } = useOrder()
 
 const quote = futuresStore.getGoodsQuote(props.selectedRow.goodsid)

+ 1 - 0
src/packages/pc/components/layouts/page/index.vue

@@ -27,6 +27,7 @@
       </div>
     </div>
     <div class="app-page__footer">
+      <!-- <div style="height: 4px;background-color:coral;"></div> -->
       <app-footer />
     </div>
     <div class="app-page__statusbar">

+ 1 - 1
src/packages/pc/components/modules/goods-detail/order/delisting/index.vue

@@ -63,7 +63,7 @@ const props = defineProps({
 })
 
 const { formData, formSubmit, loading } = useOrder()
-const { getOrderQty } = usePosition(50)
+const { getOrderQty } = usePosition()
 const futuresStore = useFuturesStore()
 const show = shallowRef(true)
 const refresh = shallowRef(false)

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

@@ -97,7 +97,7 @@ const futuresStore = useFuturesStore()
 
 const { selectedGoodsId, selectedGoods, marketGoodsList } = futuresStore.$toRefs()
 const { formData, loading, formSubmit } = useOrder()
-const { getOrderQty } = usePosition(selectedGoods.value?.trademode ?? 0)
+const { getOrderQty } = usePosition()
 const formRef = shallowRef<FormInstance>()
 const qtyStepList = [1, 10, 100] // 数量步长列表
 const qtyStep = shallowRef(qtyStepList[0]) // 数量步长

+ 44 - 33
src/packages/pc/views/market/trade/presell/transfer/listing/index.vue

@@ -38,7 +38,8 @@
                 </el-form-item>
                 <el-form-item prop="OrderQty" label="数量">
                     <div class="g-qty-group">
-                        <el-input-number ref="qtyRef" placeholder="请输入" :min="0" :precision="0" :step="qtyStep || 1"
+                        <el-input-number ref="qtyRef" placeholder="请输入" :min="0"
+                            :max="settingStore.getSettingValue('orderMaxQty')" :precision="0" :step="qtyStep || 1"
                             v-model="formData.OrderQty" @keyup.enter="submitFocus" />
                         <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 />
@@ -47,10 +48,10 @@
                 </el-form-item>
                 <el-form-item class="footer-btnbar">
                     <el-button ref="submitRef" type="danger" :loading="loading" :disabled="!selectedGoodsId"
-                        @click="onSubmit"
+                        @click="onBeforeSubmit"
                         v-if="formData.BuyOrSell === BuyOrSell.Buy && !selectedGoods?.iscannotbuy">订立</el-button>
                     <el-button ref="submitRef" type="primary" :loading="loading"
-                        :disabled="!formData.OrderQty || !enableqty || (formData.OrderQty > enableqty)" @click="onSubmit"
+                        :disabled="!formData.OrderQty || !enableqty || (formData.OrderQty > enableqty)" @click="onBeforeSubmit"
                         v-if="formData.BuyOrSell === BuyOrSell.Sell">
                         <span>转让</span>
                         <span v-if="enableqty">(≤{{ enableqty }})</span>
@@ -171,39 +172,49 @@ const onPriceClick = (buyorsell: BuyOrSell, value: number) => {
     }
 }
 
-// 提交挂牌
-const onSubmit = () => {
+const onBeforeSubmit = () => {
     formRef.value?.validate((valid) => {
         if (valid) {
-            ElMessageBox.confirm(
-                '是否立即挂牌?',
-                '提示'
-            ).then(() => {
-                const { marketid = 0, goodsid = 0 } = selectedGoods.value ?? {}
-                formData.MarketID = marketid
-                formData.GoodsID = goodsid
-                formData.TimevalidType = EValidType.VALIDTYPE_YZ
-                formData.PriceMode = EPriceMode.PRICEMODE_LIMIT
-                formData.ListingSelectType = EListingSelectType.LISTINGSELECTTYPE_DELISTINGTHENLISTING
-                formData.BuildType = formData.BuyOrSell === BuyOrSell.Sell ? EBuildType.BUILDTYPE_CLOSE : EBuildType.BUILDTYPE_OPEN
-                formData.DelistingType = EDelistingType.DELISTINGTYPE_PRICE
+            if (settingStore.getSettingValue('showOrderDialog')) {
+                ElMessageBox.confirm(
+                    '是否立即挂牌?',
+                    '提示'
+                ).then(() => onSubmit())
+            } else {
+                onSubmit()
+            }
+        }
+    })
+}
 
-                formSubmit().then(() => {
-                    ElMessage.success('挂牌成功')
-                    getMineTradePositionExs({
-                        goodsid: selectedGoodsId.value
-                    })
-                }).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 ?? {}
+    formData.MarketID = marketid
+    formData.GoodsID = goodsid
+    formData.TimevalidType = EValidType.VALIDTYPE_YZ
+    formData.PriceMode = EPriceMode.PRICEMODE_LIMIT
+    formData.ListingSelectType = EListingSelectType.LISTINGSELECTTYPE_DELISTINGTHENLISTING
+    formData.BuildType = formData.BuyOrSell === BuyOrSell.Sell ? EBuildType.BUILDTYPE_CLOSE : EBuildType.BUILDTYPE_OPEN
+    formData.DelistingType = EDelistingType.DELISTINGTYPE_PRICE
+
+    formSubmit().then(() => {
+        if (settingStore.getSettingValue('showOrderSuccessMessage')) {
+            ElMessage.success('挂牌成功')
+        }
+        getMineTradePositionExs({
+            goodsid: selectedGoodsId.value
+        })
+    }).catch((err) => {
+        if (settingStore.getSettingValue('showOrderFailMessage')) {
+            ElMessage.error('挂牌失败:' + err)
+        }
+    }).finally(() => {
+        const focusType = settingStore.getSettingValue('orderFocusType')
+        if (focusType === 2 || isDisabled.value) {
+            qtyInputFocus()
+        } else {
+            priceInputFocus()
         }
     })
 }