|
@@ -0,0 +1,109 @@
|
|
|
|
|
+<!-- 查询管理-仓单类订单查询-委托单查询-详情 -->
|
|
|
|
|
+<template>
|
|
|
|
|
+ <app-drawer title="详情" width="960" v-model:show="show">
|
|
|
|
|
+ <app-table-details title="基本信息" :data="data?.wrTradeOrderDetail" :label-width="180" :cell-props="detailProps1"
|
|
|
|
|
+ :column="2" />
|
|
|
|
|
+ <app-table-details title="价格信息" :data="data?.wrTradeOrderDetail" :label-width="180" :cell-props="detailProps2"
|
|
|
|
|
+ :column="2" v-if="data?.wrTradeOrderDetail.wrtradetype === 1">
|
|
|
|
|
+ <app-table :data="data.wrTradeGoodsConfigs" v-model:columns="tableColumns"
|
|
|
|
|
+ v-if="data.wrTradeOrderDetail.wrpricetype == 2" />
|
|
|
|
|
+ </app-table-details>
|
|
|
|
|
+ <!-- <app-table-details title="对手信息" :data="data?.wrTradeOrderDetail" :label-width="180" :cell-props="detailProps1"
|
|
|
|
|
+ :column="2" v-if="data?.wrTradeOrderDetail.isspecified === 1" /> -->
|
|
|
|
|
+ <template #footer>
|
|
|
|
|
+ <el-button @click="onCancel(false)">关闭</el-button>
|
|
|
|
|
+ </template>
|
|
|
|
|
+ </app-drawer>
|
|
|
|
|
+</template>
|
|
|
|
|
+
|
|
|
|
|
+<script lang="ts" setup>
|
|
|
|
|
+import { shallowRef, PropType, computed } from 'vue'
|
|
|
|
|
+import { ElMessage } from 'element-plus'
|
|
|
|
|
+import { formatDate } from '@/filters'
|
|
|
|
|
+import { getBuyOrSellName } from '@/constants/order'
|
|
|
|
|
+import { useEnum } from '@/hooks/enum'
|
|
|
|
|
+import { useRequest } from '@/hooks/request'
|
|
|
|
|
+import { tradeOrderView } from '@/services/api/order'
|
|
|
|
|
+import { CellProp } from '@pc/components/base/table-details/types'
|
|
|
|
|
+import AppDrawer from '@pc/components/base/drawer/index.vue'
|
|
|
|
|
+import AppTable from '@pc/components/base/table/index.vue'
|
|
|
|
|
+import AppTableDetails from '@pc/components/base/table-details/index.vue'
|
|
|
|
|
+
|
|
|
|
|
+const props = defineProps({
|
|
|
|
|
+ selectedRow: {
|
|
|
|
|
+ type: Object as PropType<Model.WarehouseQueryRsp>,
|
|
|
|
|
+ required: true
|
|
|
|
|
+ }
|
|
|
|
|
+})
|
|
|
|
|
+
|
|
|
|
|
+const show = shallowRef(true)
|
|
|
|
|
+const refresh = shallowRef(false)
|
|
|
|
|
+
|
|
|
|
|
+// 委托类型
|
|
|
|
|
+const wrtradetype2Enum = useEnum('wrtradetype2')
|
|
|
|
|
+// 状态
|
|
|
|
|
+const wrTradeOrderStatusEnum = useEnum('WRTradeOrderStatus')
|
|
|
|
|
+
|
|
|
|
|
+const { data } = useRequest(tradeOrderView, {
|
|
|
|
|
+ params: {
|
|
|
|
|
+ ishis: props.selectedRow.ishis,
|
|
|
|
|
+ wrtradeorderid: props.selectedRow.wrtradeorderid
|
|
|
|
|
+ },
|
|
|
|
|
+ onError: (err) => {
|
|
|
|
|
+ ElMessage.error(err)
|
|
|
|
|
+ }
|
|
|
|
|
+})
|
|
|
|
|
+
|
|
|
|
|
+const detailProps1 = computed<CellProp[]>(() => {
|
|
|
|
|
+ const { userName, wrFactorTypeName, wrstandardname, marketName } = data.value ?? {}
|
|
|
|
|
+ return [
|
|
|
|
|
+ { prop: 'tradedate', label: '交易日:' },
|
|
|
|
|
+ { prop: 'wrtradeorderid', label: '委托单号:', formatValue: () => props.selectedRow.wrtradeorderid },
|
|
|
|
|
+ { prop: 'userName', label: '用户名称:', formatValue: () => userName },
|
|
|
|
|
+ { prop: 'accountid', label: '资金账号:' },
|
|
|
|
|
+ { prop: 'wrtradetype', label: '单据类型:', formatValue: (val) => wrtradetype2Enum.getEnumTypeName(val) },
|
|
|
|
|
+ { prop: 'buyorsell', label: '方向:', formatValue: (val) => getBuyOrSellName(val) },
|
|
|
|
|
+ { prop: 'isspecified', label: '是否指定对手:' },
|
|
|
|
|
+ { prop: 'wrstandardname', label: '现货商品:', formatValue: () => wrstandardname },
|
|
|
|
|
+ { prop: 'wrFactorTypeName', label: '仓单:', formatValue: () => wrFactorTypeName },
|
|
|
|
|
+ { prop: 'marketName', label: '市场:', formatValue: () => marketName },
|
|
|
|
|
+ { prop: 'orderqty', label: '委托数量:' },
|
|
|
|
|
+ { prop: 'tradeqty', label: '成交数量:' },
|
|
|
|
|
+ { prop: 'wrtradeorderstatus', label: '状态:', formatValue: (val) => wrTradeOrderStatusEnum.getEnumTypeName(val) },
|
|
|
|
|
+ { prop: 'ordertime', label: '委托时间:', formatValue: (val) => formatDate(val) },
|
|
|
|
|
+ { prop: 'attachment1', label: '附件1:' },
|
|
|
|
|
+ { prop: 'attachment2', label: '附件2:' },
|
|
|
|
|
+ { prop: 'remark', label: '备注:' },
|
|
|
|
|
+ ]
|
|
|
|
|
+})
|
|
|
|
|
+
|
|
|
|
|
+const detailProps2 = computed(() => {
|
|
|
|
|
+ const { goodsUnitName, isyijia, wrTradeOrderDetail } = data.value ?? {}
|
|
|
|
|
+ const result: CellProp[] = [
|
|
|
|
|
+ { prop: 'goodsUnitName', label: '价格设置:', formatValue: () => goodsUnitName && `元/${goodsUnitName}` },
|
|
|
|
|
+ { prop: 'canbargain', label: '是否议价:', show: !!isyijia },
|
|
|
|
|
+ { prop: 'wrpricetype', label: '价格方式:' },
|
|
|
|
|
+ { prop: 'fixedprice', label: '固定价格:', show: wrTradeOrderDetail?.wrpricetype === 1 },
|
|
|
|
|
+ ]
|
|
|
|
|
+ if (wrTradeOrderDetail?.wrpricetype == 2 && wrTradeOrderDetail?.wrtradetype === 1) {
|
|
|
|
|
+ result.push(
|
|
|
|
|
+ { prop: 'pricedisplaymode', label: '显示方式:' },
|
|
|
|
|
+ { prop: 'pricemove', label: '升贴水:' },
|
|
|
|
|
+ { prop: 'pricefactor', label: '价格系数:' },
|
|
|
|
|
+ )
|
|
|
|
|
+ }
|
|
|
|
|
+ return result
|
|
|
|
|
+})
|
|
|
|
|
+
|
|
|
|
|
+const tableColumns = shallowRef<Model.TableColumn[]>([
|
|
|
|
|
+ { field: 'goodscode', label: '商品' },
|
|
|
|
|
+ { field: 'pricefactor', label: '商品价格系数' },
|
|
|
|
|
+ { field: 'weightratio', label: '商品重量系数' },
|
|
|
|
|
+ { field: 'pricemove', label: '升贴水' },
|
|
|
|
|
+])
|
|
|
|
|
+
|
|
|
|
|
+const onCancel = (isRefresh = false) => {
|
|
|
|
|
+ show.value = false
|
|
|
|
|
+ refresh.value = isRefresh
|
|
|
|
|
+}
|
|
|
|
|
+</script>
|