Explorar o código

增加详情信息

Handy_Cao %!s(int64=2) %!d(string=hai) anos
pai
achega
1bfd55307e

+ 26 - 1
src/packages/mobile/views/order/list/components/hisswaporder/detail/Index.vue

@@ -5,17 +5,42 @@
             <template #header>
                 <app-navbar title="详细" @back="closed" />
             </template>
+            <div v-if="selectedRow" class="order-detail__container g-form__container">
+                <CellGroup title="掉期委托信息">
+                    <Cell title="商品代码/名称" :value="selectedRow.goodscode+'/'+selectedRow.goodsname"/>
+                    <Cell title="方向" :value="getBuyOrSellName(selectedRow.buyorsell)" />
+                    <Cell title="委托数量" :value="formatDecimal(selectedRow.orderqty)" />
+                    <Cell title="委托价格" :value="formatDecimal(selectedRow.orderprice)" />
+                    <Cell title="成交数量" :value="formatDecimal(selectedRow.tradeqty)" />
+                    <Cell title="委托状态" :value="getWRTradeOrderStatusName(selectedRow.orderstatus)" />
+                    <Cell title="委托时间" :value="formatDate(selectedRow.ordertime)" />
+                    <Cell title="委托单号" :value="selectedRow.orderid" />
+                </CellGroup>
+            </div>
+            <div v-else>
+                <Empty />
+            </div>
         </app-view>
     </app-modal>
 </template>
 
 <script lang="ts" setup>
-import { shallowRef } from 'vue'
+import { shallowRef, PropType } from 'vue'
 import AppModal from '@/components/base/modal/index.vue'
+import { CellGroup, Cell } from 'vant'
+import { getBuyOrSellName, getWRTradeOrderStatusName } from '@/constants/order'
+import { formatDate, formatDecimal } from '@/filters'
 
 const showModal = shallowRef(true)
 const refresh = shallowRef(false) // 是否刷新父组件数据
 
+const props = defineProps({
+    selectedRow: {
+        type: Object as PropType<Model.TradeOrderDetailRsp>,
+        required: true,
+    }
+})
+
 // 关闭弹窗
 const closed = (isRefresh = false) => {
     refresh.value = isRefresh

+ 28 - 1
src/packages/mobile/views/order/list/components/hisswaptrade/detail/Index.vue

@@ -5,17 +5,44 @@
             <template #header>
                 <app-navbar title="详细" @back="closed" />
             </template>
+            <div v-if="selectedRow" class="order-detail__container g-form__container">
+                <CellGroup title="掉期成交信息">
+                    <Cell title="商品代码/名称" :value="selectedRow.goodscode+'/'+selectedRow.goodsname"/>
+                    <Cell title="方向" :value="getBuyOrSellName(selectedRow.buyorsell)" />
+                    <Cell title="类型" :value="getBuildTypeName(selectedRow.buildtype)" />
+                    <Cell title="成交数量" :value="formatDecimal(selectedRow.tradeqty)" />
+                    <Cell title="成交价格" :value="formatDecimal(selectedRow.tradeprice)" />
+                    <Cell title="手续费" :value="formatDecimal(selectedRow.charge)" />
+                    <Cell title="平仓盈亏" :value="formatDecimal(selectedRow.closepl)" />
+                    <Cell title="对手方" :value="selectedRow.matchaccountid" />
+                    <Cell title="成交时间" :value="formatDate(selectedRow.tradetime)" />
+                    <Cell title="成交单号" :value="selectedRow.tradeid" />
+                </CellGroup>
+            </div>
+            <div v-else>
+                <Empty />
+            </div>
         </app-view>
     </app-modal>
 </template>
 
 <script lang="ts" setup>
-import { shallowRef } from 'vue'
+import { shallowRef, PropType } from 'vue'
+import { CellGroup, Cell } from 'vant'
 import AppModal from '@/components/base/modal/index.vue'
+import { formatDate, formatDecimal } from '@/filters'
+import { getBuyOrSellName, getBuildTypeName } from '@/constants/order'
 
 const showModal = shallowRef(true)
 const refresh = shallowRef(false) // 是否刷新父组件数据
 
+const props = defineProps({
+    selectedRow: {
+        type: Object as PropType<Model.HisTradeDetailRsp>,
+        required: true,
+    }
+})
+
 // 关闭弹窗
 const closed = (isRefresh = false) => {
     refresh.value = isRefresh

+ 26 - 17
src/packages/mobile/views/order/list/components/swaporder/detail/Index.vue

@@ -5,36 +5,45 @@
             <template #header>
                 <app-navbar title="详细" @back="closed" />
             </template>
-            <!-- <div v-if="detail" class="order-detail__container g-form__container">
-                <CellGroup title="掉期委托信息"> -->
-                    <!-- <Cell title="商品" :value="detail.wrstandardname" /> -->
-                    <!-- <Cell title="参考价" :value="detail.tradeprice.toFixed(2)" />
-                    <Cell title="数量" :value="detail.tradeqty" />
-                    <Cell title="预付款(含定金)" :value="handleNumberValue(detail.payeddeposit.toFixed(2))" />
-                    <Cell title="付款比例" :value="parsePercent(detail.depositrate)" />
-                    <Cell title="预付金" :value="handleNumberValue(detail.transferprice.toFixed(2))" />
-                    <Cell title="实际价" :value="handleNumberValue(detail.lastprice.toFixed(2))" />
-                    <Cell title="尾款" :value="handleNumberValue(detail.remainamount.toFixed(2))" />
-                    <Cell title="状态" :value="detail.thjorderstatusdisplay" />
-                    <Cell title="采购时间" :value="formatDate(detail.tradetime)" />
-                    <Cell title="到期日期" :value="detail.enddate" /> -->
-                <!-- </CellGroup>
+            <div v-if="selectedRow" class="order-detail__container g-form__container">
+                <CellGroup title="掉期委托信息">
+                    <Cell title="商品代码/名称" :value="selectedRow.goodscode+'/'+selectedRow.goodsname"/>
+                    <Cell title="方向" :value="getBuyOrSellName(selectedRow.buyorsell)" />
+                    <Cell title="委托数量" :value="formatDecimal(selectedRow.orderqty)" />
+                    <Cell title="委托价格" :value="formatDecimal(selectedRow.orderprice)" />
+                    <Cell title="成交数量" :value="formatDecimal(selectedRow.tradeqty)" />
+                    <Cell title="委托状态" :value="getWRTradeOrderStatusName(selectedRow.orderstatus)" />
+                    <Cell title="委托时间" :value="formatDate(selectedRow.ordertime)" />
+                    <Cell title="委托单号" :value="selectedRow.orderid" />
+                </CellGroup>
             </div>
             <div v-else>
                 <Empty />
-            </div> -->
+            </div>
+            <template #footer v-if="selectedRow.orderstatus === 3 || selectedRow.orderstatus === 7">
+                <Button type="primary" block round>撤销</Button>
+            </template>
         </app-view>
     </app-modal>
 </template>
 
 <script lang="ts" setup>
-import { shallowRef } from 'vue'
+import { shallowRef, PropType } from 'vue'
 import AppModal from '@/components/base/modal/index.vue'
-import { CellGroup } from 'vant'
+import { CellGroup, Cell, Button } from 'vant'
+import { getBuyOrSellName, getWRTradeOrderStatusName } from '@/constants/order'
+import { formatDate, formatDecimal } from '@/filters'
 
 const showModal = shallowRef(true)
 const refresh = shallowRef(false) // 是否刷新父组件数据
 
+const props = defineProps({
+    selectedRow: {
+        type: Object as PropType<Model.TradeOrderDetailRsp>,
+        required: true,
+    }
+})
+
 // 关闭弹窗
 const closed = (isRefresh = false) => {
     refresh.value = isRefresh

+ 28 - 1
src/packages/mobile/views/order/list/components/swaptrade/detail/Index.vue

@@ -5,17 +5,44 @@
             <template #header>
                 <app-navbar title="详细" @back="closed" />
             </template>
+            <div v-if="selectedRow" class="order-detail__container g-form__container">
+                <CellGroup title="掉期成交信息">
+                    <Cell title="商品代码/名称" :value="selectedRow.goodscode+'/'+selectedRow.goodsname"/>
+                    <Cell title="方向" :value="getBuyOrSellName(selectedRow.buyorsell)" />
+                    <Cell title="类型" :value="getBuildTypeName(selectedRow.buildtype)" />
+                    <Cell title="成交数量" :value="formatDecimal(selectedRow.tradeqty)" />
+                    <Cell title="成交价格" :value="formatDecimal(selectedRow.tradeprice)" />
+                    <Cell title="手续费" :value="formatDecimal(selectedRow.charge)" />
+                    <Cell title="平仓盈亏" :value="formatDecimal(selectedRow.closepl)" />
+                    <Cell title="对手方" :value="selectedRow.matchaccountid" />
+                    <Cell title="成交时间" :value="formatDate(selectedRow.tradetime)" />
+                    <Cell title="成交单号" :value="selectedRow.tradeid" />
+                </CellGroup>
+            </div>
+            <div v-else>
+                <Empty />
+            </div>
         </app-view>
     </app-modal>
 </template>
 
 <script lang="ts" setup>
-import { shallowRef } from 'vue'
+import { shallowRef, PropType } from 'vue'
+import { CellGroup, Cell } from 'vant'
+import { formatDate, formatDecimal } from '@/filters'
 import AppModal from '@/components/base/modal/index.vue'
+import { getBuyOrSellName, getBuildTypeName } from '@/constants/order'
 
 const showModal = shallowRef(true)
 const refresh = shallowRef(false) // 是否刷新父组件数据
 
+const props = defineProps({
+    selectedRow: {
+        type: Object as PropType<Model.TradeDetailRsp>,
+        required: true,
+    }
+})
+
 // 关闭弹窗
 const closed = (isRefresh = false) => {
     refresh.value = isRefresh

+ 0 - 1
src/packages/mobile/views/swap/detail/Index.vue

@@ -43,7 +43,6 @@ const goodsId = getQueryStringToNumber('id')
 const tabIndex = shallowRef(0)
 const selectedRow = shallowRef<Model.TjmdTradeOrderDetailRsp>()
 const error = shallowRef(false)
-const showModal = shallowRef(true)
 
 const dataList = shallowRef<Model.TjmdTradeOrderDetailRsp[]>([])