li.shaoyi пре 2 година
родитељ
комит
5e13415e27

+ 1 - 0
src/business/trade/index.ts

@@ -570,6 +570,7 @@ export function useOrder() {
         BuildType: EBuildType.BUILDTYPE_OPEN,
         TimevalidType: EValidType.VALIDTYPE_DR,
         OrderFlag: 1,
+        OrderQty: 1,
     })
 
     const formSubmit = async () => {

+ 80 - 80
src/hooks/echarts/candlestick/index.ts

@@ -1,5 +1,5 @@
 import { ref, computed, watch } from 'vue'
-import { timerInterceptor } from '@/utils/timer'
+//import { timerInterceptor } from '@/utils/timer'
 import { ChartCycleType } from '@/constants/chart'
 import { queryHistoryDatas } from '@/services/api/quote'
 import { useFuturesStore } from '@/stores'
@@ -125,88 +125,88 @@ export function useCandlestickChart(goodscode: string) {
             const oldTime = lastIndex === -1 ? moment(lasttime) : moment(candlestick.source[lastIndex].date); // 历史行情最后时间
             const diffTime = moment(lasttime).valueOf() - oldTime.valueOf(); // 计算时间差
 
-            if (diffTime > cycleMilliseconds * 2) {
-                // 时间间隔超过两个周期,重新请求历史数据,待优化
-                timerInterceptor.debounce(() => {
-                    queryHistoryDatas({
-                        data: {
-                            cycleType: options.cycleType,
-                            goodsCode: goodscode,
-                            count: 1440,
-                        }
-                    }).then((res) => {
-                        // 日期升序排序
-                        const data = res.data.sort((a, b) => moment(a.ts).valueOf() - moment(b.ts).valueOf());
-                        if (data.length) {
-                            dataIndex.value = data.length - 1
-                            clearData()
-                            handleData(data, updateOptions)
-                        }
-                    })
-                }, 1000, 'updateChart')
+            // if (diffTime > cycleMilliseconds * 2) {
+            //     // 时间间隔超过两个周期,重新请求历史数据,待优化
+            //     timerInterceptor.debounce(() => {
+            //         queryHistoryDatas({
+            //             data: {
+            //                 cycleType: options.cycleType,
+            //                 goodsCode: goodscode,
+            //                 count: 1440,
+            //             }
+            //         }).then((res) => {
+            //             // 日期升序排序
+            //             const data = res.data.sort((a, b) => moment(a.ts).valueOf() - moment(b.ts).valueOf());
+            //             if (data.length) {
+            //                 dataIndex.value = data.length - 1
+            //                 clearData()
+            //                 handleData(data, updateOptions)
+            //             }
+            //         })
+            //     }, 1000, 'updateChart')
+            // } else {
+            // 判断时间差是否大于周期时间
+            if (lastIndex === -1 || diffTime > cycleMilliseconds) {
+                oldTime.add(cycleMilliseconds, 'ms');
+                const lastDate = oldTime.format('YYYY-MM-DD HH:mm:ss');
+
+                // 新增K线数据
+                candlestick.source.push({
+                    date: lastDate,
+                    open: last,
+                    close: last,
+                    lowest: last,
+                    highest: last,
+                    ma5: '-',
+                    ma10: '-',
+                    ma15: '-',
+                })
+
+                // 新增MACD数据
+                macd.source.push({
+                    date: lastDate,
+                    ema12: 0,
+                    ema26: 0,
+                    dif: 0,
+                    dea: 0,
+                    macd: 0,
+                })
+
+                // 新增VOL数据
+                vol.source.push({
+                    date: lastDate,
+                    vol: 0,
+                })
+
+                // 新增KDJ数据
+                kdj.source.push({
+                    date: lastDate,
+                    k: '-',
+                    d: '-',
+                    j: '-',
+                })
+
+                // 新增CCI数据
+                cci.source.push({
+                    date: lastDate,
+                    cci: '-',
+                })
             } else {
-                // 判断时间差是否大于周期时间
-                if (lastIndex === -1 || diffTime > cycleMilliseconds) {
-                    oldTime.add(cycleMilliseconds, 'ms');
-                    const lastDate = oldTime.format('YYYY-MM-DD HH:mm:ss');
-
-                    // 新增K线数据
-                    candlestick.source.push({
-                        date: lastDate,
-                        open: last,
-                        close: last,
-                        lowest: last,
-                        highest: last,
-                        ma5: '-',
-                        ma10: '-',
-                        ma15: '-',
-                    })
-
-                    // 新增MACD数据
-                    macd.source.push({
-                        date: lastDate,
-                        ema12: 0,
-                        ema26: 0,
-                        dif: 0,
-                        dea: 0,
-                        macd: 0,
-                    })
-
-                    // 新增VOL数据
-                    vol.source.push({
-                        date: lastDate,
-                        vol: 0,
-                    })
-
-                    // 新增KDJ数据
-                    kdj.source.push({
-                        date: lastDate,
-                        k: '-',
-                        d: '-',
-                        j: '-',
-                    })
-
-                    // 新增CCI数据
-                    cci.source.push({
-                        date: lastDate,
-                        cci: '-',
-                    })
-                } else {
-                    // 更新列表中最后一条记录的数据
-                    const record = candlestick.source[lastIndex];
-                    if (record.lowest > last) {
-                        record.lowest = last; // 更新最低价
-                    }
-                    if (record.highest < last) {
-                        record.highest = last; // 更新最高价
-                    }
-                    record.close = last; // 更新收盘价
+                // 更新列表中最后一条记录的数据
+                const record = candlestick.source[lastIndex];
+                if (record.lowest > last) {
+                    record.lowest = last; // 更新最低价
                 }
-
-                // 计算各项指标
-                calcIndicator(lastIndex === -1 ? 0 : lastIndex);
-                updateOptions();
+                if (record.highest < last) {
+                    record.highest = last; // 更新最高价
+                }
+                record.close = last; // 更新收盘价
             }
+
+            // 计算各项指标
+            calcIndicator(lastIndex === -1 ? 0 : lastIndex);
+            updateOptions();
+            // }
         }
     }
 

+ 33 - 33
src/hooks/echarts/timeline/index.ts

@@ -1,5 +1,5 @@
 import { ref, computed, watch } from 'vue'
-import { timerInterceptor } from '@/utils/timer'
+//import { timerInterceptor } from '@/utils/timer'
 import { queryTSData } from '@/services/api/quote'
 import { useFuturesStore } from '@/stores'
 import { useDataset } from './dataset'
@@ -64,40 +64,40 @@ export function useTimelineChart(goodscode: string) {
             const oldTime = lastIndex === -1 ? moment(lasttime) : moment(dataset.rawDate[lastIndex]) // 历史行情最后时间
             const diffTime = moment(lasttime).valueOf() - oldTime.valueOf() // 计算时间差
 
-            if (diffTime > cycleMilliseconds * 2) {
-                // 时间间隔超过两个周期,重新请求历史数据,待优化
-                timerInterceptor.debounce(() => {
-                    queryTSData({
-                        data: {
-                            goodsCode: goodscode
-                        }
-                    }).then((res) => {
-                        const { historyDatas } = res.data
-                        if (historyDatas.length) {
-                            dataIndex.value = historyDatas.length - 1
-                            clearData()
-                            handleData(res.data, updateOptions)
-                        }
-                    })
-                }, 1000, 'updateChart')
-            } else {
-                // 判断时间差是否大于周期时间
-                if (lastIndex === -1 || diffTime > cycleMilliseconds) {
-                    oldTime.add(cycleMilliseconds, 'ms')
-                    const lastDate = oldTime.format('YYYY-MM-DD HH:mm:ss')
-
-                    // 新增分时数据
-                    dataset.rawDate.push(lastDate)
-                    close.push(last)
-                    ma5.push('-')
-                } else {
-                    close[lastIndex] = last // 更新最后一条记录的收盘价
-                }
+            // if (diffTime > cycleMilliseconds * 2) {
+            //     // 时间间隔超过两个周期,重新请求历史数据,待优化
+            //     timerInterceptor.debounce(() => {
+            //         queryTSData({
+            //             data: {
+            //                 goodsCode: goodscode
+            //             }
+            //         }).then((res) => {
+            //             const { historyDatas } = res.data
+            //             if (historyDatas.length) {
+            //                 dataIndex.value = historyDatas.length - 1
+            //                 clearData()
+            //                 handleData(res.data, updateOptions)
+            //             }
+            //         })
+            //     }, 1000, 'updateChart')
+            // } else {
+            // 判断时间差是否大于周期时间
+            if (lastIndex === -1 || diffTime > cycleMilliseconds) {
+                oldTime.add(cycleMilliseconds, 'ms')
+                const lastDate = oldTime.format('YYYY-MM-DD HH:mm:ss')
 
-                // 更新各种指标
-                calcIndicator(lastIndex === -1 ? 0 : lastIndex)
-                updateOptions()
+                // 新增分时数据
+                dataset.rawDate.push(lastDate)
+                close.push(last)
+                ma5.push('-')
+            } else {
+                close[lastIndex] = last // 更新最后一条记录的收盘价
             }
+
+            // 更新各种指标
+            calcIndicator(lastIndex === -1 ? 0 : lastIndex)
+            updateOptions()
+            // }
         }
     }
 

+ 15 - 42
src/packages/gstj/views/goods/detail/components/listing/Index.vue

@@ -15,11 +15,10 @@
                                 :auto-fixed="false" :decimal-length="quote?.decimalplace" :step="priceStep" />
                         </template>
                     </Field>
-                    <Field name="OrderQty" :rules="formRules.OrderQty"
-                        :label="`数量(${getGoodsUnitName(quote?.goodunitid)})`">
+                    <Field name="OrderQty" :rules="formRules.OrderQty" label="数量">
                         <template #input>
                             <div class="goods-listing__stepper">
-                                <Stepper v-model="orderQty" theme="round" button-size="22" :min="0" :step="qtyStep"
+                                <Stepper v-model="formData.OrderQty" theme="round" button-size="22" :min="0" :step="qtyStep"
                                     integer />
                                 <RadioGroup v-model="qtyStep" direction="horizontal" @change="onRadioChange">
                                     <Radio v-for="(value, index) in qtyStepList" :key="index" :name="value">{{ value }}
@@ -42,13 +41,13 @@
                         <Button type="primary" block square @click="onBeforeSubmit(BuyOrSell.Sell)">订立卖出</Button>
                     </template>
                     <template v-if="buildType === EBuildType.BUILDTYPE_CLOSE">
-                        <Button type="danger" :disabled="(sellQty === 0) || (orderQty > sellQty)" block square
-                            @click="onBeforeSubmit(BuyOrSell.Buy)">
+                        <Button type="danger" :disabled="!formData.OrderQty || !sellQty || (formData.OrderQty > sellQty)"
+                            block square @click="onBeforeSubmit(BuyOrSell.Buy)">
                             <span>转让买入</span>
                             <span v-if="sellQty">(≤{{ sellQty }})</span>
                         </Button>
-                        <Button type="primary" :disabled="(buyQty === 0) || (orderQty > buyQty)" block square
-                            @click="onBeforeSubmit(BuyOrSell.Sell)">
+                        <Button type="primary" :disabled="!formData.OrderQty || !buyQty || (formData.OrderQty > buyQty)"
+                            block square @click="onBeforeSubmit(BuyOrSell.Sell)">
                             <span>转让卖出</span>
                             <span v-if="buyQty">(≤{{ buyQty }})</span>
                         </Button>
@@ -63,7 +62,6 @@
 import { shallowRef, defineAsyncComponent, onMounted, computed } from 'vue'
 import { Form, FormInstance, Button, CellGroup, FieldRule, Field, Stepper, RadioGroup, Radio } from 'vant'
 import { fullloading, dialog } from '@/utils/vant'
-import { getGoodsUnitName } from '@/constants/unit'
 import { BuyOrSell } from '@/constants/order'
 import { useOrder } from '@/business/trade'
 import { useRequest } from '@/hooks/request'
@@ -93,8 +91,8 @@ const quote = futuresStore.getQuoteInfo(props.goodsCode)
 const formRef = shallowRef<FormInstance>()
 const showModal = shallowRef(true)
 const refresh = shallowRef(true) // 是否刷新父组件数据
-const orderQty = shallowRef(1) // 数量
-const qtyStep = shallowRef(1) // 数量步长
+const qtyStepList = [1, 5, 10, 20, 30, 50] // 数量步长列表
+const qtyStep = shallowRef(qtyStepList[0]) // 数量步长
 
 const { dataList: positionList } = useRequest(queryTradePosition, {
     params: {
@@ -102,9 +100,6 @@ const { dataList: positionList } = useRequest(queryTradePosition, {
     },
 })
 
-// 合约乘数
-const agreeunit = computed(() => quote.value?.agreeunit ?? 0)
-
 // 价格步长
 const priceStep = computed(() => {
     const { quoteminunit = 0, decimalplace = 0 } = quote.value ?? {}
@@ -114,34 +109,16 @@ const priceStep = computed(() => {
     return 1
 })
 
-// 数量步长列表
-const qtyStepList = computed(() => {
-    return [
-        agreeunit.value * 1,
-        agreeunit.value * 5,
-        agreeunit.value * 10,
-        agreeunit.value * 20,
-        agreeunit.value * 30,
-        agreeunit.value * 50,
-    ]
-})
-
 // 买方向持仓数量
 const buyQty = computed(() => {
     const item = positionList.value.find((e) => e.goodscode === props.goodsCode && e.buyorsell === BuyOrSell.Buy)
-    if (item) {
-        return item.enableqty * agreeunit.value
-    }
-    return 0
+    return item?.enableqty ?? 0
 })
 
 // 卖方向持仓数量
 const sellQty = computed(() => {
     const item = positionList.value.find((e) => e.goodscode === props.goodsCode && e.buyorsell === BuyOrSell.Sell)
-    if (item) {
-        return item.enableqty * agreeunit.value
-    }
-    return 0
+    return item?.enableqty ?? 0
 })
 
 // 表单验证规则
@@ -153,11 +130,9 @@ const formRules: { [key in keyof Proto.OrderReq]?: FieldRule[] } = {
         }
     }],
     OrderQty: [{
+        message: '请输入数量',
         validator: () => {
-            if (orderQty.value) {
-                return orderQty.value % agreeunit.value === 0 ? true : '只能输入合约乘数的整数倍'
-            }
-            return '请输入数量'
+            return !!formData.OrderQty
         }
     }],
 }
@@ -215,7 +190,7 @@ const onSellClick = (index: number) => {
 }
 
 const onRadioChange = (value: number) => {
-    orderQty.value = value
+    formData.OrderQty = value
 }
 
 // 提交挂牌
@@ -235,7 +210,6 @@ const onSubmit = () => {
         formData.TimevalidType = EValidType.VALIDTYPE_DR
         formData.OperateType = EOrderOperateType.ORDEROPERATETYPE_NORMAL
         formData.BuildType = props.buildType
-        formData.OrderQty = orderQty.value / agreeunit.value // 数量÷合约乘数
 
         fullloading((hideLoading) => {
             formSubmit().then(() => {
@@ -260,10 +234,9 @@ const closed = (isRefresh = true) => {
 }
 
 onMounted(() => {
-    const { last = 0, agreeunit = 0, presettle = 0 } = quote.value ?? {}
+    const { last = 0, presettle = 0 } = quote.value ?? {}
     formData.OrderPrice = last || presettle
-    orderQty.value = agreeunit
-    qtyStep.value = qtyStepList.value[0]
+    formData.OrderQty = qtyStep.value
 })
 
 // 暴露组件属性给父组件调用

+ 14 - 39
src/packages/gstj/views/goods/trade/components/delisting/index.vue

@@ -23,7 +23,7 @@
                     </Field>
                     <Field label="剩余数量">
                         <template #input>
-                            <span>{{ selectedRow.orderqty }} {{ getGoodsUnitName(quote?.goodunitid) }}</span>
+                            <span>{{ selectedRow.orderqty }}</span>
                         </template>
                     </Field>
                     <Field label="摘牌方向">
@@ -34,7 +34,7 @@
                     <Field name="OrderQty" :rules="formRules.OrderQty" label="摘牌数量">
                         <template #input>
                             <div class="goods-delisting__stepper">
-                                <Stepper v-model="orderQty" theme="round" button-size="22" :min="0" :step="qtyStep"
+                                <Stepper v-model="formData.OrderQty" theme="round" button-size="22" :min="0" :step="qtyStep"
                                     :max="selectedRow.orderqty" integer />
                                 <RadioGroup v-model="qtyStep" direction="horizontal" @change="onRadioChange">
                                     <Radio v-for="(value, index) in qtyStepList" :key="index" :name="value">{{ value }}
@@ -54,16 +54,16 @@
                 <div class="g-form__footer">
                     <template v-if="selectedRow.buyorsell === BuyOrSell.Buy">
                         <Button type="danger" block square @click="onBeforeSubmit(EBuildType.BUILDTYPE_OPEN)">订立卖出</Button>
-                        <Button type="primary" :disabled="(buyQty === 0) || (orderQty > buyQty)" block square
-                            @click="onBeforeSubmit(EBuildType.BUILDTYPE_CLOSE)">
+                        <Button type="primary" :disabled="!formData.OrderQty || !buyQty || (formData.OrderQty > buyQty)"
+                            block square @click="onBeforeSubmit(EBuildType.BUILDTYPE_CLOSE)">
                             <span>转让卖出</span>
                             <span v-if="buyQty">(≤{{ buyQty }})</span>
                         </Button>
                     </template>
                     <template v-if="selectedRow.buyorsell === BuyOrSell.Sell">
                         <Button type="danger" block square @click="onBeforeSubmit(EBuildType.BUILDTYPE_OPEN)">订立买入</Button>
-                        <Button type="primary" :disabled="(sellQty === 0) || (orderQty > sellQty)" block square
-                            @click="onBeforeSubmit(EBuildType.BUILDTYPE_CLOSE)">
+                        <Button type="primary" :disabled="!formData.OrderQty || !sellQty || (formData.OrderQty > sellQty)"
+                            block square @click="onBeforeSubmit(EBuildType.BUILDTYPE_CLOSE)">
                             <span>转让买入</span>
                             <span v-if="sellQty">(≤{{ sellQty }})</span>
                         </Button>
@@ -79,7 +79,6 @@ import { shallowRef, PropType, onMounted, computed } from 'vue'
 import { Form, FormInstance, Button, CellGroup, Field, FieldRule, Stepper, RadioGroup, Radio } from 'vant'
 import { fullloading, dialog } from '@/utils/vant'
 import { BuyOrSell, getBuyOrSellName } from '@/constants/order'
-import { getGoodsUnitName } from '@/constants/unit'
 import { useAccountStore, useFuturesStore } from '@/stores'
 import { EBuildType, EDelistingType, EListingSelectType, EOrderOperateType, EPriceMode, EValidType } from '@/constants/client'
 import { useOrder } from '@/business/trade'
@@ -102,8 +101,8 @@ const quote = futuresStore.getQuoteInfo(props.selectedRow.goodsid)
 const formRef = shallowRef<FormInstance>()
 const showModal = shallowRef(true)
 const refresh = shallowRef(false) // 是否刷新父组件数据
-const orderQty = shallowRef(1) // 数量
-const qtyStep = shallowRef(1) // 数量步长
+const qtyStepList = [1, 5, 10, 20, 30, 50] // 数量步长列表
+const qtyStep = shallowRef(qtyStepList[0]) // 数量步长
 
 const { dataList: positionList } = useRequest(queryTradePosition, {
     params: {
@@ -111,53 +110,30 @@ const { dataList: positionList } = useRequest(queryTradePosition, {
     },
 })
 
-// 合约乘数
-const agreeunit = computed(() => quote.value?.agreeunit ?? 0)
-
-// 数量步长列表
-const qtyStepList = computed(() => {
-    return [
-        agreeunit.value * 1,
-        agreeunit.value * 5,
-        agreeunit.value * 10,
-        agreeunit.value * 20,
-        agreeunit.value * 30,
-        agreeunit.value * 50,
-    ]
-})
-
 // 买方向持仓数量
 const buyQty = computed(() => {
     const item = positionList.value.find((e) => e.goodsid === props.selectedRow.goodsid && e.buyorsell === BuyOrSell.Buy)
-    if (item) {
-        return item.enableqty * agreeunit.value
-    }
-    return 0
+    return item?.enableqty ?? 0
 })
 
 // 卖方向持仓数量
 const sellQty = computed(() => {
     const item = positionList.value.find((e) => e.goodsid === props.selectedRow.goodsid && e.buyorsell === BuyOrSell.Sell)
-    if (item) {
-        return item.enableqty * agreeunit.value
-    }
-    return 0
+    return item?.enableqty ?? 0
 })
 
 // 表单验证规则
 const formRules: { [key in keyof Proto.OrderReq]?: FieldRule[] } = {
     OrderQty: [{
+        message: '请输入摘牌数量',
         validator: () => {
-            if (orderQty.value) {
-                return orderQty.value % agreeunit.value === 0 ? true : '只能输入合约乘数的整数倍'
-            }
-            return '请输入摘牌数量'
+            return !!formData.OrderQty
         }
     }],
 }
 
 const onRadioChange = (value: number) => {
-    orderQty.value = value
+    formData.OrderQty = value
 }
 
 // 提交摘牌
@@ -181,7 +157,6 @@ const onSubmit = () => {
         formData.DelistingType = EDelistingType.DELISTINGTYPE_SELECTED
         formData.TimevalidType = EValidType.VALIDTYPE_DR
         formData.OperateType = EOrderOperateType.ORDEROPERATETYPE_NORMAL
-        formData.OrderQty = orderQty.value / agreeunit.value // 数量÷合约乘数
 
         fullloading((hideLoading) => {
             formSubmit().then(() => {
@@ -206,7 +181,7 @@ const closed = (isRefresh = false) => {
 }
 
 onMounted(() => {
-    orderQty.value = agreeunit.value
+    formData.OrderQty = qtyStep.value
 })
 
 // 暴露组件属性给父组件调用

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

@@ -15,11 +15,10 @@
                                 :auto-fixed="false" :decimal-length="quote?.decimalplace" :step="priceStep" />
                         </template>
                     </Field>
-                    <Field name="OrderQty" :rules="formRules.OrderQty"
-                        :label="`数量(${getGoodsUnitName(quote?.goodunitid)})`">
+                    <Field name="OrderQty" :rules="formRules.OrderQty" label="数量">
                         <template #input>
                             <div class="goods-listing__stepper">
-                                <Stepper v-model="orderQty" theme="round" button-size="22" :min="0" :step="qtyStep"
+                                <Stepper v-model="formData.OrderQty" theme="round" button-size="22" :min="0" :step="qtyStep"
                                     integer />
                                 <RadioGroup v-model="qtyStep" direction="horizontal" @change="onRadioChange">
                                     <Radio v-for="(value, index) in qtyStepList" :key="index" :name="value">{{ value }}
@@ -42,13 +41,13 @@
                         <Button type="primary" block square @click="onBeforeSubmit(BuyOrSell.Sell)">订立卖出</Button>
                     </template>
                     <template v-if="buildType === EBuildType.BUILDTYPE_CLOSE">
-                        <Button type="danger" :disabled="(sellQty === 0) || (orderQty > sellQty)" block square
-                            @click="onBeforeSubmit(BuyOrSell.Buy)">
+                        <Button type="danger" :disabled="!formData.OrderQty || !sellQty || (formData.OrderQty > sellQty)"
+                            block square @click="onBeforeSubmit(BuyOrSell.Buy)">
                             <span>转让买入</span>
                             <span v-if="sellQty">(≤{{ sellQty }})</span>
                         </Button>
-                        <Button type="primary" :disabled="(buyQty === 0) || (orderQty > buyQty)" block square
-                            @click="onBeforeSubmit(BuyOrSell.Sell)">
+                        <Button type="primary" :disabled="!formData.OrderQty || !buyQty || (formData.OrderQty > buyQty)"
+                            block square @click="onBeforeSubmit(BuyOrSell.Sell)">
                             <span>转让卖出</span>
                             <span v-if="buyQty">(≤{{ buyQty }})</span>
                         </Button>
@@ -63,7 +62,6 @@
 import { shallowRef, defineAsyncComponent, onMounted, computed } from 'vue'
 import { Form, FormInstance, Button, CellGroup, FieldRule, Field, Stepper, RadioGroup, Radio } from 'vant'
 import { fullloading, dialog } from '@/utils/vant'
-import { getGoodsUnitName } from '@/constants/unit'
 import { BuyOrSell } from '@/constants/order'
 import { useOrder } from '@/business/trade'
 import { useRequest } from '@/hooks/request'
@@ -93,8 +91,8 @@ const quote = futuresStore.getQuoteInfo(props.goodsCode)
 const formRef = shallowRef<FormInstance>()
 const showModal = shallowRef(true)
 const refresh = shallowRef(true) // 是否刷新父组件数据
-const orderQty = shallowRef(1) // 数量
-const qtyStep = shallowRef(1) // 数量步长
+const qtyStepList = [1, 5, 10, 20, 30, 50] // 数量步长列表
+const qtyStep = shallowRef(qtyStepList[0]) // 数量步长
 
 const { dataList: positionList } = useRequest(queryTradePosition, {
     params: {
@@ -102,9 +100,6 @@ const { dataList: positionList } = useRequest(queryTradePosition, {
     },
 })
 
-// 合约乘数
-const agreeunit = computed(() => quote.value?.agreeunit ?? 0)
-
 // 价格步长
 const priceStep = computed(() => {
     const { quoteminunit = 0, decimalplace = 0 } = quote.value ?? {}
@@ -114,34 +109,16 @@ const priceStep = computed(() => {
     return 1
 })
 
-// 数量步长列表
-const qtyStepList = computed(() => {
-    return [
-        agreeunit.value * 1,
-        agreeunit.value * 5,
-        agreeunit.value * 10,
-        agreeunit.value * 20,
-        agreeunit.value * 30,
-        agreeunit.value * 50,
-    ]
-})
-
 // 买方向持仓数量
 const buyQty = computed(() => {
     const item = positionList.value.find((e) => e.goodscode === props.goodsCode && e.buyorsell === BuyOrSell.Buy)
-    if (item) {
-        return item.enableqty * agreeunit.value
-    }
-    return 0
+    return item?.enableqty ?? 0
 })
 
 // 卖方向持仓数量
 const sellQty = computed(() => {
     const item = positionList.value.find((e) => e.goodscode === props.goodsCode && e.buyorsell === BuyOrSell.Sell)
-    if (item) {
-        return item.enableqty * agreeunit.value
-    }
-    return 0
+    return item?.enableqty ?? 0
 })
 
 // 表单验证规则
@@ -153,11 +130,9 @@ const formRules: { [key in keyof Proto.OrderReq]?: FieldRule[] } = {
         }
     }],
     OrderQty: [{
+        message: '请输入数量',
         validator: () => {
-            if (orderQty.value) {
-                return orderQty.value % agreeunit.value === 0 ? true : '只能输入合约乘数的整数倍'
-            }
-            return '请输入数量'
+            return !!formData.OrderQty
         }
     }],
 }
@@ -215,7 +190,7 @@ const onSellClick = (index: number) => {
 }
 
 const onRadioChange = (value: number) => {
-    orderQty.value = value
+    formData.OrderQty = value
 }
 
 // 提交挂牌
@@ -235,7 +210,6 @@ const onSubmit = () => {
         formData.TimevalidType = EValidType.VALIDTYPE_DR
         formData.OperateType = EOrderOperateType.ORDEROPERATETYPE_NORMAL
         formData.BuildType = props.buildType
-        formData.OrderQty = orderQty.value / agreeunit.value // 数量÷合约乘数
 
         fullloading((hideLoading) => {
             formSubmit().then(() => {
@@ -262,8 +236,7 @@ const closed = (isRefresh = true) => {
 onMounted(() => {
     const { last = 0, agreeunit = 0, presettle = 0 } = quote.value ?? {}
     formData.OrderPrice = last || presettle
-    orderQty.value = agreeunit
-    qtyStep.value = qtyStepList.value[0]
+    formData.OrderQty = qtyStep.value
 })
 
 // 暴露组件属性给父组件调用

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

@@ -23,7 +23,7 @@
                     </Field>
                     <Field label="剩余数量">
                         <template #input>
-                            <span>{{ selectedRow.orderqty }} {{ getGoodsUnitName(quote?.goodunitid) }}</span>
+                            <span>{{ selectedRow.orderqty }}</span>
                         </template>
                     </Field>
                     <Field label="摘牌方向">
@@ -34,7 +34,7 @@
                     <Field name="OrderQty" :rules="formRules.OrderQty" label="摘牌数量">
                         <template #input>
                             <div class="goods-delisting__stepper">
-                                <Stepper v-model="orderQty" theme="round" button-size="22" :min="0" :step="qtyStep"
+                                <Stepper v-model="formData.OrderQty" theme="round" button-size="22" :min="0" :step="qtyStep"
                                     :max="selectedRow.orderqty" integer />
                                 <RadioGroup v-model="qtyStep" direction="horizontal" @change="onRadioChange">
                                     <Radio v-for="(value, index) in qtyStepList" :key="index" :name="value">{{ value }}
@@ -54,16 +54,16 @@
                 <div class="g-form__footer">
                     <template v-if="selectedRow.buyorsell === BuyOrSell.Buy">
                         <Button type="danger" block square @click="onBeforeSubmit(EBuildType.BUILDTYPE_OPEN)">订立卖出</Button>
-                        <Button type="primary" :disabled="(buyQty === 0) || (orderQty > buyQty)" block square
-                            @click="onBeforeSubmit(EBuildType.BUILDTYPE_CLOSE)">
+                        <Button type="primary" :disabled="!formData.OrderQty || !buyQty || (formData.OrderQty > buyQty)"
+                            block square @click="onBeforeSubmit(EBuildType.BUILDTYPE_CLOSE)">
                             <span>转让卖出</span>
                             <span v-if="buyQty">(≤{{ buyQty }})</span>
                         </Button>
                     </template>
                     <template v-if="selectedRow.buyorsell === BuyOrSell.Sell">
                         <Button type="danger" block square @click="onBeforeSubmit(EBuildType.BUILDTYPE_OPEN)">订立买入</Button>
-                        <Button type="primary" :disabled="(sellQty === 0) || (orderQty > sellQty)" block square
-                            @click="onBeforeSubmit(EBuildType.BUILDTYPE_CLOSE)">
+                        <Button type="primary" :disabled="!formData.OrderQty || !sellQty || (formData.OrderQty > sellQty)"
+                            block square @click="onBeforeSubmit(EBuildType.BUILDTYPE_CLOSE)">
                             <span>转让买入</span>
                             <span v-if="sellQty">(≤{{ sellQty }})</span>
                         </Button>
@@ -79,7 +79,6 @@ import { shallowRef, PropType, onMounted, computed } from 'vue'
 import { Form, FormInstance, Button, CellGroup, Field, FieldRule, Stepper, RadioGroup, Radio } from 'vant'
 import { fullloading, dialog } from '@/utils/vant'
 import { BuyOrSell, getBuyOrSellName } from '@/constants/order'
-import { getGoodsUnitName } from '@/constants/unit'
 import { useAccountStore, useFuturesStore } from '@/stores'
 import { EBuildType, EDelistingType, EListingSelectType, EOrderOperateType, EPriceMode, EValidType } from '@/constants/client'
 import { useOrder } from '@/business/trade'
@@ -102,8 +101,8 @@ const quote = futuresStore.getQuoteInfo(props.selectedRow.goodsid)
 const formRef = shallowRef<FormInstance>()
 const showModal = shallowRef(true)
 const refresh = shallowRef(false) // 是否刷新父组件数据
-const orderQty = shallowRef(1) // 数量
-const qtyStep = shallowRef(1) // 数量步长
+const qtyStepList = [1, 5, 10, 20, 30, 50] // 数量步长列表
+const qtyStep = shallowRef(qtyStepList[0]) // 数量步长
 
 const { dataList: positionList } = useRequest(queryTradePosition, {
     params: {
@@ -111,53 +110,30 @@ const { dataList: positionList } = useRequest(queryTradePosition, {
     },
 })
 
-// 合约乘数
-const agreeunit = computed(() => quote.value?.agreeunit ?? 0)
-
-// 数量步长列表
-const qtyStepList = computed(() => {
-    return [
-        agreeunit.value * 1,
-        agreeunit.value * 5,
-        agreeunit.value * 10,
-        agreeunit.value * 20,
-        agreeunit.value * 30,
-        agreeunit.value * 50,
-    ]
-})
-
 // 买方向持仓数量
 const buyQty = computed(() => {
     const item = positionList.value.find((e) => e.goodsid === props.selectedRow.goodsid && e.buyorsell === BuyOrSell.Buy)
-    if (item) {
-        return item.enableqty * agreeunit.value
-    }
-    return 0
+    return item?.enableqty ?? 0
 })
 
 // 卖方向持仓数量
 const sellQty = computed(() => {
     const item = positionList.value.find((e) => e.goodsid === props.selectedRow.goodsid && e.buyorsell === BuyOrSell.Sell)
-    if (item) {
-        return item.enableqty * agreeunit.value
-    }
-    return 0
+    return item?.enableqty ?? 0
 })
 
 // 表单验证规则
 const formRules: { [key in keyof Proto.OrderReq]?: FieldRule[] } = {
     OrderQty: [{
+        message: '请输入摘牌数量',
         validator: () => {
-            if (orderQty.value) {
-                return orderQty.value % agreeunit.value === 0 ? true : '只能输入合约乘数的整数倍'
-            }
-            return '请输入摘牌数量'
+            return !!formData.OrderQty
         }
     }],
 }
 
 const onRadioChange = (value: number) => {
-    orderQty.value = value
+    formData.OrderQty = value
 }
 
 // 提交摘牌
@@ -181,7 +157,6 @@ const onSubmit = () => {
         formData.DelistingType = EDelistingType.DELISTINGTYPE_SELECTED
         formData.TimevalidType = EValidType.VALIDTYPE_DR
         formData.OperateType = EOrderOperateType.ORDEROPERATETYPE_NORMAL
-        formData.OrderQty = orderQty.value / agreeunit.value // 数量÷合约乘数
 
         fullloading((hideLoading) => {
             formSubmit().then(() => {
@@ -206,7 +181,7 @@ const closed = (isRefresh = false) => {
 }
 
 onMounted(() => {
-    orderQty.value = agreeunit.value
+    formData.OrderQty = qtyStep.value
 })
 
 // 暴露组件属性给父组件调用

+ 25 - 54
src/packages/pc/components/modules/listing/index.vue

@@ -7,7 +7,7 @@
             <h4 class="header-title">订单挂牌</h4>
             <el-form ref="formRef" class="el-form--vertical" label-width="60px" :model="formData" :rules="formRules">
                 <el-form-item prop="GoodsID" label="商品">
-                    <el-select placeholder="请选择" v-model="goodsStore.goodsId">
+                    <el-select placeholder="请选择" v-model="goodsStore.goodsId" @change="getTradePosition">
                         <el-option :label="item.goodsname" :value="item.goodsid"
                             v-for="(item, index) in goodsStore.quoteGoodsList" :key="index" />
                     </el-select>
@@ -24,32 +24,31 @@
                         v-model="formData.OrderPrice" />
                 </el-form-item>
                 <el-form-item prop="OrderQty" label="数量">
-                    <div class="el-form-item--col">
-                        <div class="g-qty-group">
-                            <el-input-number placeholder="请输入" :min="agreeunit" :step="qtyStep" v-model="orderQty" />
-                            <el-radio-group size="small" v-model="qtyStep" @change="onRadioChange"
-                                v-if="qtyStepList.length">
-                                <el-radio v-for="(value, index) in qtyStepList" :key="index" :label="value" border />
-                            </el-radio-group>
-                        </div>
-                        <span>{{ getGoodsUnitName(quote?.goodunitid) }}</span>
+                    <div class="g-qty-group">
+                        <el-input-number placeholder="请输入" :min="0" :precision="0" :step="qtyStep"
+                            v-model="formData.OrderQty" />
+                        <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>
             <div class="footer-btnbar">
                 <template v-if="formData.BuyOrSell === BuyOrSell.Buy">
-                    <el-button type="primary" :loading="loading" :disabled="!goodsStore.goodsId"
+                    <el-button type="primary" :loading="loading" :disabled="!goodsStore.goodsId || !formData.OrderQty"
                         @click="onSubmit(EBuildType.BUILDTYPE_OPEN)">订立买入</el-button>
-                    <el-button type="primary" :loading="loading" :disabled="(sellQty === 0) || (orderQty > sellQty)"
+                    <el-button type="primary" :loading="loading"
+                        :disabled="!formData.OrderQty || !sellQty || (formData.OrderQty > sellQty)"
                         @click="onSubmit(EBuildType.BUILDTYPE_CLOSE)">
                         <span>转让买入</span>
                         <span v-if="sellQty">(≤{{ sellQty }})</span>
                     </el-button>
                 </template>
                 <template v-if="formData.BuyOrSell === BuyOrSell.Sell">
-                    <el-button type="primary" :loading="loading" :disabled="!goodsStore.goodsId"
+                    <el-button type="primary" :loading="loading" :disabled="!goodsStore.goodsId || !formData.OrderQty"
                         @click="onSubmit(EBuildType.BUILDTYPE_OPEN)">订立卖出</el-button>
-                    <el-button type="primary" :loading="loading" :disabled="(buyQty === 0) || (orderQty > buyQty)"
+                    <el-button type="primary" :loading="loading"
+                        :disabled="!formData.OrderQty || !buyQty || (formData.OrderQty > buyQty)"
                         @click="onSubmit(EBuildType.BUILDTYPE_CLOSE)">
                         <span>转让卖出</span>
                         <span v-if="buyQty">(≤{{ buyQty }})</span>
@@ -65,7 +64,6 @@ import { shallowRef, computed, watch } from 'vue'
 import { ElMessage, ElMessageBox, FormInstance, FormRules } from 'element-plus'
 import { EPriceMode, EListingSelectType, EDelistingType, EBuildType, EValidType, EOrderOperateType } from '@/constants/client'
 import { BuyOrSell, getBuyOrSellList } from '@/constants/order'
-import { getGoodsUnitName } from '@/constants/unit'
 import { useRequest } from '@/hooks/request'
 import { queryTradePosition } from '@/services/api/order'
 import { useOrder } from '@/business/trade'
@@ -77,8 +75,8 @@ const goodsStore = useGoodsStore()
 const futuresStore = useFuturesStore()
 const { formData, loading, formSubmit } = useOrder()
 const formRef = shallowRef<FormInstance>()
-const orderQty = shallowRef(1) // 数量
-const qtyStep = shallowRef(1) // 数量步长
+const qtyStepList = [1, 10, 100] // 数量步长列表
+const qtyStep = shallowRef(qtyStepList[0]) // 数量步长
 
 // 持仓列表
 const { dataList: positionList, run: getTradePosition } = useRequest(queryTradePosition, {
@@ -90,9 +88,6 @@ const { dataList: positionList, run: getTradePosition } = useRequest(queryTradeP
 // 商品盘面
 const quote = computed(() => futuresStore.getQuoteInfo(goodsStore.goodsCode).value)
 
-// 合约乘数
-const agreeunit = computed(() => quote.value?.agreeunit ?? 0)
-
 // 价格步长
 const priceStep = computed(() => {
     const { quoteminunit = 0, decimalplace = 0 } = quote.value ?? {}
@@ -102,34 +97,16 @@ const priceStep = computed(() => {
     return 1
 })
 
-// 数量步长列表
-const qtyStepList = computed(() => {
-    if (agreeunit.value) {
-        return [
-            agreeunit.value * 1,
-            agreeunit.value * 10,
-            agreeunit.value * 100,
-        ]
-    }
-    return []
-})
-
 // 买方向持仓数量
 const buyQty = computed(() => {
     const item = positionList.value.find((e) => e.goodscode === goodsStore.goodsCode && e.buyorsell === BuyOrSell.Buy)
-    if (item) {
-        return item.enableqty * agreeunit.value
-    }
-    return 0
+    return item?.enableqty ?? 0
 })
 
 // 卖方向持仓数量
 const sellQty = computed(() => {
     const item = positionList.value.find((e) => e.goodscode === goodsStore.goodsCode && e.buyorsell === BuyOrSell.Sell)
-    if (item) {
-        return item.enableqty * agreeunit.value
-    }
-    return 0
+    return item?.enableqty ?? 0
 })
 
 const formRules: FormRules = {
@@ -147,21 +124,17 @@ const formRules: FormRules = {
     OrderQty: [{
         required: true,
         validator: (rule, value, callback) => {
-            if (orderQty.value) {
-                if (orderQty.value % agreeunit.value === 0) {
-                    callback()
-                } else {
-                    callback(new Error('只能输入合约乘数的整数倍'))
-                }
+            if (value) {
+                callback()
             } else {
-                callback(new Error('请输入牌数量'))
+                callback(new Error('请输入挂牌数量'))
             }
         }
     }],
 }
 
 const onRadioChange = (value: number) => {
-    orderQty.value = value
+    formData.OrderQty = value
 }
 
 const onBuyClick = (price: number) => {
@@ -192,12 +165,11 @@ const onSubmit = (buildType: number) => {
                 formData.TimevalidType = EValidType.VALIDTYPE_DR
                 formData.OperateType = EOrderOperateType.ORDEROPERATETYPE_NORMAL
                 formData.BuildType = buildType
-                formData.OrderQty = orderQty.value / agreeunit.value // 数量÷合约乘数
 
                 formSubmit().then(() => {
-                    ElMessage.success('提交成功')
+                    ElMessage.success('挂牌成功')
                 }).catch((err) => {
-                    ElMessage.error('提交失败:' + err)
+                    ElMessage.error('挂牌失败:' + err)
                 })
             })
         }
@@ -205,10 +177,9 @@ const onSubmit = (buildType: number) => {
 }
 
 watch(() => goodsStore.goodsId, () => {
-    const { last = 0, agreeunit = 0, presettle = 0 } = quote.value ?? {}
+    const { last = 0, presettle = 0 } = quote.value ?? {}
     formData.OrderPrice = last || presettle
-    orderQty.value = agreeunit
-    qtyStep.value = qtyStepList.value[0]
+    formData.OrderQty = qtyStep.value
 }, {
     immediate: true
 })

+ 4 - 0
src/packages/pc/components/modules/quote/chart/kline/index.less

@@ -35,6 +35,10 @@
     &__indicator {
         height: 30%;
 
+        .app-tabs__container {
+            overflow: hidden;
+        }
+
         .tabs {
             width: 100%;
             font-size: 12px;

+ 2 - 2
src/packages/pc/components/modules/quote/tik/index.vue

@@ -38,7 +38,7 @@ const { run: getHistoryTikDatas } = useRequest(queryHistoryTikDatas, {
     manual: true,
     params: {
         goodsCode: props.goodsCode,
-        count: 20
+        count: 10
     },
     onSuccess: (res) => {
         dataList.value = res.data
@@ -63,7 +63,7 @@ useRequest(queryMarketRun, {
 watch(() => quote.value?.last, () => {
     if (quote.value) {
         const list = dataList.value
-        if (list.length > 19) {
+        if (list.length > 9) {
             // 移除列表最后一条记录
             list.pop()
         }

+ 10 - 9
src/packages/pc/views/footer/capital/summary/index.vue

@@ -38,6 +38,7 @@ const componentMap = new Map<string, unknown>([
 ])
 
 const accountStore = useAccountStore()
+const authStatus = shallowRef(AuthStatus.Uncertified) // 实名认证状态
 const { selectedRow, rowKey, expandKeys, rowClick } = useComposeTable<Model.TaAccountsRsp>({ rowKey: 'accountid' })
 const { componentRef, componentId, openComponent, closeComponent } = useComponent()
 
@@ -53,25 +54,25 @@ const tableColumns = shallowRef<Model.TableColumn[]>([
     { prop: 'tradestatus', label: '状态' },
 ])
 
-const authStatus = shallowRef(AuthStatus.Uncertified) // 实名认证状态
 /// 进行出入金操作判断
 const doInOutMoney = (code: string) => {
     if (authStatus.value === AuthStatus.Certified) {
         queryBankAccountSign().then((res) => {
-                const { signstatus } = res.data[0] ?? {}
-                /// 只有已签约的情况下才可以进行出入金
-                if (signstatus && signstatus === 4) {
-                    openComponent(code)
-                } else {
-                    ElMessage({ showClose: true, message: '请先添加签约账户信息!', })
-                }
-            })
+            const { signstatus } = res.data[0] ?? {}
+            /// 只有已签约的情况下才可以进行出入金
+            if (signstatus && signstatus === 4) {
+                openComponent(code)
+            } else {
+                ElMessage({ showClose: true, message: '请先添加签约账户信息!', })
+            }
+        })
     } else {
         ElMessage({ showClose: true, message: '请先实名认证,再进行该操作!' })
     }
 }
 
 onMounted(() => {
+    accountStore.getAccountList()
     if (authStatus.value !== AuthStatus.Certified) {
         // 获取用户账号信息
         queryUserAccount().then((res) => {

+ 18 - 49
src/packages/pc/views/market/trade/goods/detail/components/order/delisting/index.vue

@@ -9,34 +9,32 @@
                 <span>{{ selectedRow.orderprice }}</span>
             </el-form-item>
             <el-form-item label="剩余数量">
-                <span>{{ enableQty }}{{ getGoodsUnitName(quote?.goodunitid) }}</span>
+                <span>{{ selectedRow.orderqty }}{{ getGoodsUnitName(quote?.goodunitid) }}</span>
             </el-form-item>
             <el-form-item prop="OrderQty" label="摘牌数量">
-                <div class="el-form-item--col">
-                    <div class="g-qty-group">
-                        <el-input-number placeholder="请输入" :min="agreeunit" :step="qtyStep" v-model="orderQty" />
-                        <el-radio-group size="small" v-model="qtyStep" @change="onRadioChange" v-if="qtyStepList.length">
-                            <el-radio v-for="(value, index) in qtyStepList" :key="index" :label="value" border />
-                        </el-radio-group>
-                    </div>
-                    <span>{{ getGoodsUnitName(quote?.goodunitid) }}</span>
+                <div class="g-qty-group">
+                    <el-input-number placeholder="请输入" :min="0" :precision="0" :step="qtyStep"
+                        v-model="formData.OrderQty" />
+                    <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>
         <template #footer>
             <template v-if="selectedRow.buyorsell === BuyOrSell.Buy">
-                <el-button type="primary" :disabled="orderQty > enableQty"
+                <el-button type="primary" :disabled="!formData.OrderQty || formData.OrderQty > selectedRow.orderqty"
                     @click="onSubmit(EBuildType.BUILDTYPE_OPEN)">订立卖出</el-button>
-                <el-button type="primary" :disabled="(buyQty === 0) || (orderQty > buyQty)"
+                <el-button type="primary" :disabled="!formData.OrderQty || !buyQty || (formData.OrderQty > buyQty)"
                     @click="onSubmit(EBuildType.BUILDTYPE_CLOSE)">
                     <span>转让卖出</span>
                     <span v-if="buyQty">(≤{{ buyQty }})</span>
                 </el-button>
             </template>
             <template v-if="selectedRow.buyorsell === BuyOrSell.Sell">
-                <el-button type="primary" :disabled="orderQty > enableQty"
+                <el-button type="primary" :disabled="!formData.OrderQty || formData.OrderQty > selectedRow.orderqty"
                     @click="onSubmit(EBuildType.BUILDTYPE_OPEN)">订立买入</el-button>
-                <el-button type="primary" :disabled="(sellQty === 0) || (orderQty > sellQty)"
+                <el-button type="primary" :disabled="!formData.OrderQty || !sellQty || (formData.OrderQty > sellQty)"
                     @click="onSubmit(EBuildType.BUILDTYPE_CLOSE)">
                     <span>转让买入</span>
                     <span v-if="sellQty">(≤{{ sellQty }})</span>
@@ -70,8 +68,8 @@ const futuresStore = useFuturesStore()
 const show = shallowRef(true)
 const refresh = shallowRef(false)
 const formRef = shallowRef<FormInstance>()
-const orderQty = shallowRef(1) // 数量
-const qtyStep = shallowRef(1) // 数量步长
+const qtyStepList = [1, 5, 10, 20, 30, 50] // 数量步长列表
+const qtyStep = shallowRef(qtyStepList[0]) // 数量步长
 
 // 持仓列表
 const { dataList: positionList } = useRequest(queryTradePosition, {
@@ -83,52 +81,24 @@ const { dataList: positionList } = useRequest(queryTradePosition, {
 // 商品盘面
 const quote = futuresStore.getQuoteInfo(props.selectedRow.goodsid)
 
-// 合约乘数
-const agreeunit = computed(() => quote.value?.agreeunit ?? 0)
-
-// 剩余数量
-const enableQty = computed(() => props.selectedRow.orderqty * agreeunit.value)
-
-// 数量步长列表
-const qtyStepList = computed(() => {
-    return [
-        agreeunit.value * 1,
-        agreeunit.value * 5,
-        agreeunit.value * 10,
-        agreeunit.value * 20,
-        agreeunit.value * 30,
-        agreeunit.value * 50,
-    ]
-})
-
 // 买方向持仓数量
 const buyQty = computed(() => {
     const item = positionList.value.find((e) => e.goodsid === props.selectedRow.goodsid && e.buyorsell === BuyOrSell.Buy)
-    if (item) {
-        return item.enableqty * agreeunit.value
-    }
-    return 0
+    return item?.enableqty ?? 0
 })
 
 // 卖方向持仓数量
 const sellQty = computed(() => {
     const item = positionList.value.find((e) => e.goodsid === props.selectedRow.goodsid && e.buyorsell === BuyOrSell.Sell)
-    if (item) {
-        return item.enableqty * agreeunit.value
-    }
-    return 0
+    return item?.enableqty ?? 0
 })
 
 const formRules: FormRules = {
     OrderQty: [{
         required: true,
         validator: (rule, value, callback) => {
-            if (orderQty.value) {
-                if (orderQty.value % agreeunit.value === 0) {
-                    callback()
-                } else {
-                    callback(new Error('只能输入合约乘数的整数倍'))
-                }
+            if (value) {
+                callback()
             } else {
                 callback(new Error('请输入摘牌数量'))
             }
@@ -137,7 +107,7 @@ const formRules: FormRules = {
 }
 
 const onRadioChange = (value: number) => {
-    orderQty.value = value
+    formData.OrderQty = value
 }
 
 const onCancel = (isRefresh = false) => {
@@ -163,7 +133,6 @@ const onSubmit = (buildType: number) => {
             formData.BuildType = buildType
             formData.TimevalidType = EValidType.VALIDTYPE_DR
             formData.OperateType = EOrderOperateType.ORDEROPERATETYPE_NORMAL
-            formData.OrderQty = orderQty.value / agreeunit.value // 数量÷合约乘数
 
             formSubmit().then(() => {
                 ElMessage.success('提交成功')

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

@@ -1,6 +1,10 @@
 <!-- 交易市场-订单交易 -->
 <template>
     <app-table :data="tableList" v-model:columns="tableColumns" :loading="loading" @row-click="onRowClick" showIndex>
+        <!-- 规格 -->
+        <template #spec="{ row }">
+            {{ row.agreeunit + getGoodsUnitName(row.goodunitid) }}
+        </template>
         <!-- 卖价 -->
         <template #ask="{ row }">
             <span :class="row.askColor">{{ row.ask }}</span>
@@ -42,6 +46,7 @@
 import { shallowRef, computed, onMounted, onUnmounted, defineAsyncComponent } from 'vue'
 import { parsePercent, handleNumberValue } from '@/filters'
 import { useComponent } from '@/hooks/component'
+import { getGoodsUnitName } from '@/constants/unit'
 import { useFuturesStore, useGoodsStore } from '@/stores'
 import quoteSocket from '@/services/websocket/quote'
 import AppTable from '@pc/components/base/table/index.vue'
@@ -60,7 +65,7 @@ const { componentRef, componentId, openComponent, closeComponent } = useComponen
 const tableList = computed(() => {
     return quoteGoodsList.value.map((item) => {
         const quote = futuresStore.getQuoteInfo(item.goodscode)
-        const { bid, bidColor, bidvolume, ask, askColor, askvolume, limitdown, limitup, lastColor, openedColor, lowestColor, highestColor, last, presettle, rise, change, amplitude, highest, lowest, opened, decimalplace } = quote.value ?? {}
+        const { bid, bidColor, bidvolume, ask, askColor, askvolume, goodunitid, agreeunit, limitdown, limitup, lastColor, openedColor, lowestColor, highestColor, last, presettle, rise, change, amplitude, highest, lowest, opened, decimalplace } = quote.value ?? {}
         return {
             ...item,
             lastColor,
@@ -83,6 +88,8 @@ const tableList = computed(() => {
             amplitude: parsePercent(amplitude),
             limitdown: handleNumberValue(limitdown?.toFixed(decimalplace)),
             limitup: handleNumberValue(limitup?.toFixed(decimalplace)),
+            agreeunit,
+            goodunitid
         }
     })
 })
@@ -90,6 +97,7 @@ const tableList = computed(() => {
 const tableColumns = shallowRef<Model.TableColumn[]>([
     { prop: 'goodscode', label: '代码' },
     { prop: 'goodsname', label: '名称' },
+    { prop: 'spec', label: '规格' },
     { prop: 'bid', label: '买价' },
     { prop: 'bidvolume', label: '买量' },
     { prop: 'ask', label: '卖价' },