|
@@ -1,7 +1,11 @@
|
|
|
<template>
|
|
<template>
|
|
|
<app-view class="pricing-trade">
|
|
<app-view class="pricing-trade">
|
|
|
<template #header>
|
|
<template #header>
|
|
|
- <app-navbar :title="quote ? `${quote.goodscode}` : $t('quote.pricing.title')" >
|
|
|
|
|
|
|
+ <app-navbar>
|
|
|
|
|
+ <app-select v-model="goodsCode" :options="goodsList" :optionProps="{ label: 'goodscode', value: 'goodscode' }" @confirm="onConfirm" >
|
|
|
|
|
+ {{ quote ? `${quote.goodscode}` : $t('quote.pricing.title') }}
|
|
|
|
|
+ <Icon name="arrow-down" size="16" style="padding-left: 5px;" />
|
|
|
|
|
+ </app-select>
|
|
|
<template #right>
|
|
<template #right>
|
|
|
<Icon v-if="system_1012 != '0'" name="bars" size="20px" @click="openComponent('detail')" />
|
|
<Icon v-if="system_1012 != '0'" name="bars" size="20px" @click="openComponent('detail')" />
|
|
|
</template>
|
|
</template>
|
|
@@ -97,28 +101,31 @@ import { fullloading, dialog } from '@/utils/vant'
|
|
|
import { formatDecimal, handleNumberValue } from '@/filters'
|
|
import { formatDecimal, handleNumberValue } from '@/filters'
|
|
|
import Stepper from '@mobile/components/base/stepper/index.vue'
|
|
import Stepper from '@mobile/components/base/stepper/index.vue'
|
|
|
import eventBus from '@/services/bus'
|
|
import eventBus from '@/services/bus'
|
|
|
|
|
+import AppSelect from '@mobile/components/base/select/index.vue'
|
|
|
|
|
|
|
|
const { getQueryString, getQueryStringToNumber } = useNavigation()
|
|
const { getQueryString, getQueryStringToNumber } = useNavigation()
|
|
|
const { global: { t } } = i18n
|
|
const { global: { t } } = i18n
|
|
|
|
|
|
|
|
-const goodsCode = getQueryString('goodscode') ?? ''
|
|
|
|
|
-const goodsid = getQueryStringToNumber('goodsid')
|
|
|
|
|
|
|
+const goodsCode = shallowRef(getQueryString('goodscode') ?? '')
|
|
|
|
|
+const goodsid = shallowRef(getQueryStringToNumber('goodsid'))
|
|
|
const buyOrSell = getQueryStringToNumber('buyOrSell')
|
|
const buyOrSell = getQueryStringToNumber('buyOrSell')
|
|
|
const buildType = getQueryStringToNumber('buildType')
|
|
const buildType = getQueryStringToNumber('buildType')
|
|
|
const orderQty = getQueryStringToNumber('orderQty')
|
|
const orderQty = getQueryStringToNumber('orderQty')
|
|
|
const futuresStore = useFuturesStore()
|
|
const futuresStore = useFuturesStore()
|
|
|
-const quote = futuresStore.getGoodsQuote(goodsCode)
|
|
|
|
|
-const { pictureurl } = futuresStore.getGoods(goodsCode) ?? {}
|
|
|
|
|
|
|
+const quote = shallowRef<Model.GoodsQuote>()
|
|
|
// 小数位以及步进值
|
|
// 小数位以及步进值
|
|
|
const { decimalplace = 0.0 } = quote.value ?? {}
|
|
const { decimalplace = 0.0 } = quote.value ?? {}
|
|
|
const quoteminunit = quote.value?.quoteminunit ?? 1.0
|
|
const quoteminunit = quote.value?.quoteminunit ?? 1.0
|
|
|
const decimalvalue = Math.pow(10.0, -decimalplace)*(quoteminunit == 0 ? 1 : quoteminunit)
|
|
const decimalvalue = Math.pow(10.0, -decimalplace)*(quoteminunit == 0 ? 1 : quoteminunit)
|
|
|
const isTrademode16 = computed(() => quote.value?.trademode === 16)
|
|
const isTrademode16 = computed(() => quote.value?.trademode === 16)
|
|
|
-
|
|
|
|
|
-const selectedRow = shallowRef<Model.SBYJMyOrderRsp>()
|
|
|
|
|
-
|
|
|
|
|
const { getSystemParamValue } = useUserStore()
|
|
const { getSystemParamValue } = useUserStore()
|
|
|
const system_1012 = getSystemParamValue('1012') ?? '1'
|
|
const system_1012 = getSystemParamValue('1012') ?? '1'
|
|
|
|
|
+// 选中的单据数据
|
|
|
|
|
+const selectedRow = shallowRef<Model.SBYJMyOrderRsp>()
|
|
|
|
|
+
|
|
|
|
|
+const pictureurl = computed(() => {
|
|
|
|
|
+ return futuresStore.getGoods(goodsCode.value)?.pictureurl ?? {}
|
|
|
|
|
+})
|
|
|
|
|
|
|
|
const { formData, formSubmit } = useOrder()
|
|
const { formData, formSubmit } = useOrder()
|
|
|
const formRef = shallowRef<FormInstance>()
|
|
const formRef = shallowRef<FormInstance>()
|
|
@@ -133,26 +140,33 @@ const fromTrade = true
|
|
|
// 持仓汇总
|
|
// 持仓汇总
|
|
|
const position = shallowRef<Model.TradePositionRsp[]>([])
|
|
const position = shallowRef<Model.TradePositionRsp[]>([])
|
|
|
|
|
|
|
|
|
|
+const goodsList = computed(() => {
|
|
|
|
|
+ return futuresStore.getGoodsListByTradeMode(10)
|
|
|
|
|
+})
|
|
|
|
|
+
|
|
|
|
|
+const onConfirm = (() => {
|
|
|
|
|
+ selectedRow.value = undefined
|
|
|
|
|
+ quote.value = futuresStore.getGoodsQuote(goodsCode.value).value
|
|
|
|
|
+ goodsid.value = quote.value?.goodsid ?? 0
|
|
|
|
|
+})
|
|
|
|
|
+
|
|
|
// 点击返回
|
|
// 点击返回
|
|
|
const itemBack = (isPosition: number, buyorsell: BuyOrSell, tradeId: string, item: Model.SBYJMyOrderRsp) => {
|
|
const itemBack = (isPosition: number, buyorsell: BuyOrSell, tradeId: string, item: Model.SBYJMyOrderRsp) => {
|
|
|
formData.BuyOrSell = buyorsell === BuyOrSell.Buy ? BuyOrSell.Sell : BuyOrSell.Buy
|
|
formData.BuyOrSell = buyorsell === BuyOrSell.Buy ? BuyOrSell.Sell : BuyOrSell.Buy
|
|
|
- if (isPosition === 2) {
|
|
|
|
|
- selectedRow.value = item
|
|
|
|
|
- // 打开退订
|
|
|
|
|
- openComponent('transfer')
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ selectedRow.value = item
|
|
|
|
|
+ // 打开退订
|
|
|
|
|
+ openComponent(isPosition === 2 ? 'transfer' : 'delivery')
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+const active = shallowRef(pictureurl.value != '' ? 'images' : 'cancel')
|
|
|
const { componentRef, componentId, openComponent, closeComponent } = useComponent()
|
|
const { componentRef, componentId, openComponent, closeComponent } = useComponent()
|
|
|
|
|
|
|
|
-const active = shallowRef(pictureurl != '' ? 'images' : 'cancel')
|
|
|
|
|
-
|
|
|
|
|
const components = [
|
|
const components = [
|
|
|
{
|
|
{
|
|
|
name: 'images',
|
|
name: 'images',
|
|
|
title: t('operation.details'),
|
|
title: t('operation.details'),
|
|
|
component: defineAsyncComponent(() => import('../images/Index.vue')),
|
|
component: defineAsyncComponent(() => import('../images/Index.vue')),
|
|
|
- show: pictureurl != ''
|
|
|
|
|
|
|
+ show: pictureurl.value != ''
|
|
|
},
|
|
},
|
|
|
{
|
|
{
|
|
|
name: 'cancel',
|
|
name: 'cancel',
|
|
@@ -177,7 +191,8 @@ const components = [
|
|
|
|
|
|
|
|
const componentMap = new Map<string, unknown>([
|
|
const componentMap = new Map<string, unknown>([
|
|
|
['detail', defineAsyncComponent(() => import('../components/detail/Index.vue'))],
|
|
['detail', defineAsyncComponent(() => import('../components/detail/Index.vue'))],
|
|
|
- ['transfer', defineAsyncComponent(() => import('@mobile/views/order/position/components/pricing/detail2/components/transfer/Index.vue'))]
|
|
|
|
|
|
|
+ ['transfer', defineAsyncComponent(() => import('@mobile/views/order/position/components/pricing/detail2/components/transfer/Index.vue'))],
|
|
|
|
|
+ ['delivery', defineAsyncComponent(() => import('@mobile/views/order/position/components/pricing/detail2/components/delivery/Index.vue'))]
|
|
|
])
|
|
])
|
|
|
|
|
|
|
|
// 计算市价
|
|
// 计算市价
|
|
@@ -268,6 +283,7 @@ const onRadioChange = (value: number) => {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
onMounted(() => {
|
|
onMounted(() => {
|
|
|
|
|
+ quote.value = futuresStore.getGoodsQuote(goodsCode.value).value
|
|
|
formData.BuyOrSell = BuyOrSell.Buy
|
|
formData.BuyOrSell = BuyOrSell.Buy
|
|
|
formData.BuildType = BuildType.Open
|
|
formData.BuildType = BuildType.Open
|
|
|
formData.PriceMode = PriceMode.Market
|
|
formData.PriceMode = PriceMode.Market
|