|
|
@@ -14,50 +14,57 @@
|
|
|
</tr>
|
|
|
</table>
|
|
|
<Form class="pricing-detail__form" ref="formRef" style="padding: 0.2rem; background-color: white;"
|
|
|
- @submit="onSubmit">
|
|
|
- <Field name="OrderQty" :rules="formRules.OrderQty">
|
|
|
- <template #input>
|
|
|
- <div class="goods-listing__stepper">
|
|
|
- <div>
|
|
|
- <span><Stepper v-model="orderQty" theme="round" button-size="22" :min="0" :step="qtyStep"
|
|
|
- integer /></span>
|
|
|
- <span>{{ getGoodsUnitName(quote?.goodunitid) }}</span>
|
|
|
- </div>
|
|
|
- <RadioGroup v-model="qtyStep" direction="horizontal" @change="onRadioChange">
|
|
|
- <Radio v-for="(value, index) in qtyStepList" :key="index" :name="value">{{ value }} {{ getGoodsUnitName(quote?.goodunitid) }}
|
|
|
- </Radio>
|
|
|
- </RadioGroup>
|
|
|
- </div>
|
|
|
- </template>
|
|
|
- </Field>
|
|
|
- <div>
|
|
|
+ @submit="onSubmit">
|
|
|
+ <Field name="OrderQty" :rules="formRules.OrderQty">
|
|
|
+ <template #input>
|
|
|
+ <div class="goods-listing__stepper">
|
|
|
+ <div>
|
|
|
+ <span>
|
|
|
+ <Stepper v-model="orderQty" theme="round" button-size="22" :min="0" :step="qtyStep"
|
|
|
+ integer />
|
|
|
+ </span>
|
|
|
+ <span>{{ getGoodsUnitName(quote?.goodunitid) }}</span>
|
|
|
+ </div>
|
|
|
+ <RadioGroup v-model="qtyStep" direction="horizontal" @change="onRadioChange">
|
|
|
+ <Radio v-for="(value, index) in qtyStepList" :key="index" :name="value">{{ value }} {{
|
|
|
+ getGoodsUnitName(quote?.goodunitid) }}
|
|
|
+ </Radio>
|
|
|
+ </RadioGroup>
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+ </Field>
|
|
|
<div>
|
|
|
- <span><Button @click="commit(BuyOrSell.Sell)">我要卖料</Button></span>
|
|
|
- <span><Button @click="commit(BuyOrSell.Buy)">我要买料</Button></span>
|
|
|
+ <div>
|
|
|
+ <span><Button @click="commit(BuyOrSell.Sell)">我要卖料</Button></span>
|
|
|
+ <span><Button @click="commit(BuyOrSell.Buy)">我要买料</Button></span>
|
|
|
+ </div>
|
|
|
</div>
|
|
|
- </div>
|
|
|
</Form>
|
|
|
-
|
|
|
+
|
|
|
<div>订单明细</div>
|
|
|
<div class="g-order-list">
|
|
|
<div class="g-order-list__box" v-for="(item, index) in dataList" :key="index">
|
|
|
<div class="g-order-list__titlebar">
|
|
|
<div class="left">
|
|
|
- <h5> {{ item.tHDetailEx.buyOrSell === BuyOrSell.Buy ? '买料订单:' : '卖料订单:' }}{{ item.tHDetailEx.tradeID }} </h5>
|
|
|
+ <h5> {{ item.tHDetailEx.buyOrSell === BuyOrSell.Buy ? '买料订单:' : '卖料订单:' }}{{ item.tHDetailEx.tradeID
|
|
|
+ }} </h5>
|
|
|
</div>
|
|
|
<div class="right">
|
|
|
- <span :class="item.tHDetailEx.depositRate >= 0.4 ? 'g-price-up' : ''">{{ parsePercent(item.tHDetailEx.depositRate) }}</span>
|
|
|
+ <span :class="item.tHDetailEx.depositRate <= 0.4 ? 'g-price-up' : ''">{{
|
|
|
+ parsePercent(item.tHDetailEx.depositRate) }}</span>
|
|
|
</div>
|
|
|
</div>
|
|
|
<div class="g-order-list__content">
|
|
|
<ul>
|
|
|
<li>
|
|
|
<span>订单重量:</span>
|
|
|
- <span>{{ item.tHDetailEx.holderQty * item.agreeUnit }}{{ getGoodsUnitName(item.goodsUnitID) }}</span>
|
|
|
+ <span>{{ item.tHDetailEx.holderQty * item.agreeUnit }}{{ getGoodsUnitName(item.goodsUnitID)
|
|
|
+ }}</span>
|
|
|
</li>
|
|
|
<li>
|
|
|
<span>可用重量:</span>
|
|
|
- <span>{{ (item.tHDetailEx.holderQty - item.tHDetailEx.freezeQty ) * item.agreeUnit }}{{ getGoodsUnitName(item.goodsUnitID) }}</span>
|
|
|
+ <span>{{ (item.tHDetailEx.holderQty - item.tHDetailEx.freezeQty) * item.agreeUnit }}{{
|
|
|
+ getGoodsUnitName(item.goodsUnitID) }}</span>
|
|
|
</li>
|
|
|
<li>
|
|
|
<span>订单金额:</span>
|
|
|
@@ -87,19 +94,21 @@
|
|
|
</div>
|
|
|
<div class="g-order-list__btnbar">
|
|
|
<Button size="small" @click="showComponent('detail', item)" round>详情</Button>
|
|
|
- <Button size="small" round>补充</Button>
|
|
|
- <Button size="small" round>交收</Button>
|
|
|
- <Button size="small" round>转让</Button>
|
|
|
+ <Button size="small" @click="showComponent('supplement', item)" round>补充</Button>
|
|
|
+ <Button size="small" @click="showComponent('delivery', item)" round>交收</Button>
|
|
|
+ <Button size="small" @click="showComponent('closeholder', item)" round>转让</Button>
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
+ <component ref="componentRef" v-bind="{ selectedRow }" :is="componentMap.get(componentId)" @closed="closeComponent"
|
|
|
+ v-if="componentId" />
|
|
|
</app-view>
|
|
|
</template>
|
|
|
|
|
|
<script lang="ts" setup>
|
|
|
|
|
|
import { useOrder } from '@/business/trade'
|
|
|
-import { shallowRef, onMounted, onUnmounted, computed } from 'vue'
|
|
|
+import { shallowRef, onMounted, onUnmounted, computed, defineAsyncComponent } from 'vue'
|
|
|
import { Form, Field, Stepper, Button, FieldRule, FormInstance, Radio, RadioGroup, Checkbox } from 'vant'
|
|
|
import { useNavigation } from '@/packages/sbyj/router/navigation'
|
|
|
import { useFuturesStore } from '@/stores'
|
|
|
@@ -121,15 +130,18 @@ const futuresStore = useFuturesStore()
|
|
|
const goodscode = getQueryString('goodscode')
|
|
|
const quote = futuresStore.getQuoteInfo(goodscode)
|
|
|
const qtyStep = shallowRef(1) // 数量步长
|
|
|
-const dataList = shallowRef<Model.SBYJMyOrderRsp[]>([])
|
|
|
const error = shallowRef(false)
|
|
|
const subscribe = quoteSocket.createSubscribe()
|
|
|
const selectedRow = shallowRef<Model.SBYJMyOrderRsp>()
|
|
|
const orderQty = shallowRef(1) // 数量
|
|
|
|
|
|
-const { componentRef, componentId, openComponent, closeComponent } = useComponent(() => {
|
|
|
- // pullRefreshRef.value?.refresh()
|
|
|
-})
|
|
|
+const componentMap = new Map<string, unknown>([
|
|
|
+ ['detail', defineAsyncComponent(() => import('../../order/detail/index.vue'))], // 详情
|
|
|
+ ['supplement', defineAsyncComponent(() => import('../../order/list/components/supplement-deposit/index.vue'))], // 补充
|
|
|
+ ['delivery', defineAsyncComponent(() => import('../../order/list/components/market-order-delivery/index.vue'))], // 交收
|
|
|
+ ['closeholder', defineAsyncComponent(() => import('../../order/list/components/close-holder/index.vue'))], // 转让
|
|
|
+])
|
|
|
+const { componentRef, componentId, openComponent, closeComponent } = useComponent()
|
|
|
// 合约乘数
|
|
|
const agreeunit = computed(() => quote.value?.agreeunit ?? 0)
|
|
|
// 数量步长列表
|
|
|
@@ -142,16 +154,10 @@ const qtyStepList = computed(() => {
|
|
|
]
|
|
|
})
|
|
|
|
|
|
-const { loading, pageIndex, pageCount, run } = useRequest(querySBYJMyOrders, {
|
|
|
+const { dataList, run: getSBYJMyOrders } = useRequest(querySBYJMyOrders, {
|
|
|
params: {
|
|
|
goodsId: quote?.value?.goodsid
|
|
|
},
|
|
|
- onSuccess: (res) => {
|
|
|
- if (pageIndex.value === 1) {
|
|
|
- dataList.value = []
|
|
|
- }
|
|
|
- dataList.value.push(...res.data)
|
|
|
- },
|
|
|
onError: () => {
|
|
|
error.value = true
|
|
|
}
|
|
|
@@ -183,8 +189,9 @@ const onSubmit = () => {
|
|
|
|
|
|
fullloading((hideLoading) => {
|
|
|
formSubmit().then(() => {
|
|
|
- hideLoading()
|
|
|
- dialog('提交成功。').then(() => closed(true))
|
|
|
+ hideLoading('提交成功。', 'success')
|
|
|
+ // 刷新订单列表
|
|
|
+ getSBYJMyOrders()
|
|
|
}).catch((err) => {
|
|
|
hideLoading(err, 'fail')
|
|
|
})
|
|
|
@@ -219,10 +226,4 @@ const showComponent = (componentName: string, row: Model.SBYJMyOrderRsp) => {
|
|
|
openComponent(componentName)
|
|
|
}
|
|
|
|
|
|
-// 关闭弹窗
|
|
|
-const closed = (isRefresh = true) => {
|
|
|
- // refresh.value = isRefresh
|
|
|
- // showModal.value = false
|
|
|
-}
|
|
|
-
|
|
|
</script>
|