|
|
@@ -1,113 +1,85 @@
|
|
|
<template>
|
|
|
- <!-- 买卖大厅 -->
|
|
|
- <div class="buy-sell-market">
|
|
|
- <div class="buy-sell-market-title">
|
|
|
- <a class="backIcon"
|
|
|
- @click="cancel">
|
|
|
- <LeftOutlined />
|
|
|
- </a>
|
|
|
- <div class="titleBtn">
|
|
|
- <div class="name">{{selectedRow.deliverygoodsname}}</div>
|
|
|
- <div class="arrowRightIcon"></div>
|
|
|
- </div>
|
|
|
- <div class="titleBtn titleBtn2">
|
|
|
- <div class="arrowLeftIcon"></div>
|
|
|
- <div class="name">{{selectedRow.wrgoodsname}}</div>
|
|
|
- <div class="arrowRightIcon"></div>
|
|
|
- </div>
|
|
|
- <div class="titleBtn titleBtn2">
|
|
|
- <div class="arrowLeftIcon"></div>
|
|
|
- <div class="name">{{selectedRow.warehousename}}</div>
|
|
|
- <div class="arrowRightIcon"></div>
|
|
|
- </div>
|
|
|
- <div class="titleBtn titleBtn3"
|
|
|
- v-if="!isWR(enumName)">
|
|
|
- <div class="arrowLeftIcon"></div>
|
|
|
- <div class="name">
|
|
|
- <a-month-picker :allowClear="false"
|
|
|
- v-model:value="time"
|
|
|
- @change="timeChange"
|
|
|
- class="commonDatePicker conditionPicker" />
|
|
|
- </div>
|
|
|
- <DownOutlined />
|
|
|
- </div>
|
|
|
+ <!-- 买卖大厅 -->
|
|
|
+ <div class="buy-sell-market">
|
|
|
+ <div class="buy-sell-market-title">
|
|
|
+ <a class="backIcon" @click="cancel">
|
|
|
+ <LeftOutlined />
|
|
|
+ </a>
|
|
|
+ <div class="titleBtn">
|
|
|
+ <div class="name">{{ selectedRow.deliverygoodsname }}</div>
|
|
|
+ <div class="arrowRightIcon"></div>
|
|
|
+ </div>
|
|
|
+ <div class="titleBtn titleBtn2">
|
|
|
+ <div class="arrowLeftIcon"></div>
|
|
|
+ <div class="name">{{ selectedRow.wrgoodsname }}</div>
|
|
|
+ <div class="arrowRightIcon"></div>
|
|
|
+ </div>
|
|
|
+ <div class="titleBtn titleBtn2">
|
|
|
+ <div class="arrowLeftIcon"></div>
|
|
|
+ <div class="name">{{ selectedRow.warehousename }}</div>
|
|
|
+ <div class="arrowRightIcon"></div>
|
|
|
+ </div>
|
|
|
+ <div class="titleBtn titleBtn3" v-if="!isWR(enumName)">
|
|
|
+ <div class="arrowLeftIcon"></div>
|
|
|
+ <div class="name">
|
|
|
+ <a-month-picker :allowClear="false" v-model:value="time" @change="timeChange" class="commonDatePicker conditionPicker" />
|
|
|
+ </div>
|
|
|
+ <DownOutlined />
|
|
|
+ </div>
|
|
|
|
|
|
- <div class="priceBar bdf1 ml20">
|
|
|
- <div class="greenBar green">
|
|
|
- <div class="numBlock"
|
|
|
- v-if="isFloat()">
|
|
|
- <div class="first">卖基差</div>
|
|
|
- <div class="last">{{selectedRow.sellpricemove}}</div>
|
|
|
- </div>
|
|
|
- <div class="numBlock"
|
|
|
- v-else>
|
|
|
- <div class="first">卖价</div>
|
|
|
- <div class="last">{{selectedRow.sellprice}}</div>
|
|
|
- </div>
|
|
|
- <div class="numBlock">
|
|
|
- <div class="first">卖量</div>
|
|
|
- <div class="last">{{selectedRow.sellqty}}</div>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
- <div class="redBar red">
|
|
|
- <div class="numBlock"
|
|
|
- v-if="isFloat()">
|
|
|
- <div class="first">买基差</div>
|
|
|
- <div class="last">{{selectedRow.buypricemove}}</div>
|
|
|
- </div>
|
|
|
- <div class="numBlock ml15"
|
|
|
- v-else>
|
|
|
- <div class="first">买价</div>
|
|
|
- <div class="last">{{selectedRow.buyprice}}</div>
|
|
|
- </div>
|
|
|
- <div class="numBlock">
|
|
|
- <div class="first">买量</div>
|
|
|
- <div class="last">{{selectedRow.buyqty}}</div>
|
|
|
- </div>
|
|
|
+ <div class="priceBar bdf1 ml20">
|
|
|
+ <div class="greenBar green">
|
|
|
+ <div class="numBlock" v-if="isFloat()">
|
|
|
+ <div class="first">卖基差</div>
|
|
|
+ <div class="last">{{ selectedRow.sellpricemove }}</div>
|
|
|
+ </div>
|
|
|
+ <div class="numBlock" v-else>
|
|
|
+ <div class="first">卖价</div>
|
|
|
+ <div class="last">{{ selectedRow.sellprice }}</div>
|
|
|
+ </div>
|
|
|
+ <div class="numBlock">
|
|
|
+ <div class="first">卖量</div>
|
|
|
+ <div class="last">{{ selectedRow.sellqty }}</div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div class="redBar red">
|
|
|
+ <div class="numBlock" v-if="isFloat()">
|
|
|
+ <div class="first">买基差</div>
|
|
|
+ <div class="last">{{ selectedRow.buypricemove }}</div>
|
|
|
+ </div>
|
|
|
+ <div class="numBlock ml15" v-else>
|
|
|
+ <div class="first">买价</div>
|
|
|
+ <div class="last">{{ selectedRow.buyprice }}</div>
|
|
|
+ </div>
|
|
|
+ <div class="numBlock">
|
|
|
+ <div class="first">买量</div>
|
|
|
+ <div class="last">{{ selectedRow.buyqty }}</div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <a-button class="market" v-if="isFloat()" @click="openChartComponent">
|
|
|
+ <div class="first">{{ selectedRow.goodscode }}</div>
|
|
|
+ <div class="last red">{{ getGoodsPrice() }}</div>
|
|
|
+ <LineChartOutlined />
|
|
|
+ </a-button>
|
|
|
+ <!-- 历史走势按钮 -->
|
|
|
+ <a-button class="historyBtn" @click="openComponent({ code: 'HisChart' })">
|
|
|
+ 历史走势
|
|
|
+ <LineChartOutlined />
|
|
|
+ </a-button>
|
|
|
+ <BtnList :btnList="firstBtn" :record="selectedRow" @click="openComponent" />
|
|
|
</div>
|
|
|
- </div>
|
|
|
- <div class="market"
|
|
|
- v-if="isFloat()">
|
|
|
- <div class="first">{{selectedRow.goodscode}}</div>
|
|
|
- <div class="last red">{{getGoodsPrice()}}</div>
|
|
|
- <LineChartOutlined />
|
|
|
- </div>
|
|
|
- <!-- 历史走势按钮 -->
|
|
|
- <a-button class="historyBtn"
|
|
|
- @click="openComponent({code: 'HisChart'})">
|
|
|
- 历史走势
|
|
|
- <LineChartOutlined />
|
|
|
- </a-button>
|
|
|
- <BtnList :btnList="firstBtn"
|
|
|
- :record="selectedRow"
|
|
|
- @click="openComponent" />
|
|
|
+ <a-row class="buySellHall">
|
|
|
+ <a-col :span="12" v-if="sellMarket.isMarket">
|
|
|
+ <Sell :enumName="enumName" ref="sellRef" :parantSelectedRow="selectedRow" :time="time" :btnList="handleBtnList(sellMarket.btnList)" />
|
|
|
+ </a-col>
|
|
|
+ <a-col :span="12" v-if="buyMarket.isMarket">
|
|
|
+ <Buy :enumName="enumName" ref="buyRef" :time="time" :parantSelectedRow="selectedRow" :btnList="handleBtnList(buyMarket.btnList)" />
|
|
|
+ </a-col>
|
|
|
+ </a-row>
|
|
|
+ <GoodsChart v-if="showChartComponent" :enumName="enumName" :selectedRow="quoteDayInfo" @cancel="closeChartComponent" />
|
|
|
+ <component :is="componentId" v-if="componentId" :selectedRow="selectedRow" :goodsPrice="getGoodsPrice()" :enumName="enumName" :time="time" @cancel="closeComponent"> </component>
|
|
|
</div>
|
|
|
- <a-row class="buySellHall">
|
|
|
- <a-col :span="12"
|
|
|
- v-if="sellMarket.isMarket">
|
|
|
- <Sell :enumName="enumName"
|
|
|
- ref="sellRef"
|
|
|
- :parantSelectedRow="selectedRow"
|
|
|
- :time="time"
|
|
|
- :btnList="handleBtnList(sellMarket.btnList)" />
|
|
|
- </a-col>
|
|
|
- <a-col :span="12"
|
|
|
- v-if="buyMarket.isMarket">
|
|
|
- <Buy :enumName="enumName"
|
|
|
- ref="buyRef"
|
|
|
- :time="time"
|
|
|
- :parantSelectedRow="selectedRow"
|
|
|
- :btnList="handleBtnList(buyMarket.btnList)" />
|
|
|
- </a-col>
|
|
|
- </a-row>
|
|
|
- <component :is="componentId"
|
|
|
- v-if="componentId"
|
|
|
- :selectedRow="selectedRow"
|
|
|
- :goodsPrice="getGoodsPrice()"
|
|
|
- :enumName="enumName"
|
|
|
- :time="time"
|
|
|
- @cancel="closeComponent"></component>
|
|
|
- </div>
|
|
|
</template>
|
|
|
|
|
|
<script lang="ts">
|
|
|
@@ -126,11 +98,12 @@ import { handleSpotBtnList } from '../../setup';
|
|
|
import { v4 } from 'uuid';
|
|
|
import { addSubscribeQuotation, removeSubscribeQuotation } from '@/services/socket/quota';
|
|
|
import Bus from '@/utils/eventBus/index';
|
|
|
-import { getQuoteDayInfoByCodeFindPrice } from '@/services/bus/goods';
|
|
|
+import { getQuoteDayInfoByCodeFindPrice, getQuoteDayInfoByCode } from '@/services/bus/goods';
|
|
|
import TimerUtils from '@/utils/timer/timerUtil';
|
|
|
import { BtnListType } from '@/common/components/btnList/interface';
|
|
|
import moment, { Moment } from 'moment';
|
|
|
import { BuyOrSell } from '@/common/constants/enumCommon';
|
|
|
+import { QueryQuoteDayRsp } from '@/services/go/quote/interface';
|
|
|
|
|
|
export default defineComponent({
|
|
|
emits: ['cancel', 'update'],
|
|
|
@@ -155,12 +128,16 @@ export default defineComponent({
|
|
|
[ModalEnum.spot_trade_warehouse_detail]: defineAsyncComponent(() => import('../detail/index.vue')),
|
|
|
[ModalEnum.spot_trade_warehouse_post_buying]: defineAsyncComponent(() => import('../post_buying/index.vue')),
|
|
|
HisChart: defineAsyncComponent(() => import('../history-chart/index.vue')),
|
|
|
+ GoodsChart: defineAsyncComponent(() => import('../goods-chart/index.vue')), // 待优化
|
|
|
},
|
|
|
setup(props, context) {
|
|
|
const time = ref<Moment>(moment(props.selectedRow.deliverymonth)); // string 交收月
|
|
|
const loading = ref<boolean>(false);
|
|
|
const { visible, cancel } = _closeModal(context);
|
|
|
|
|
|
+ const showChartComponent = ref(false); // 显示/隐藏图表
|
|
|
+ const quoteDayInfo = ref<QueryQuoteDayRsp>(); // 盘口数据
|
|
|
+
|
|
|
const { isWR, isFloat } = handleIs(props.enumName, BuyOrSell.buy);
|
|
|
// 买卖大厅 配置数据
|
|
|
// 表格操作按钮列表
|
|
|
@@ -217,6 +194,19 @@ export default defineComponent({
|
|
|
// 单据挂牌成功 通知买大厅刷新数据
|
|
|
Bus.$on('spotTrade', queryFn);
|
|
|
|
|
|
+ const openChartComponent = () => {
|
|
|
+ quoteDayInfo.value = getQuoteDayInfoByCode(props.selectedRow.goodscode);
|
|
|
+ if (quoteDayInfo.value) {
|
|
|
+ showChartComponent.value = true;
|
|
|
+ } else {
|
|
|
+ console.error('盘口数据获取失败');
|
|
|
+ }
|
|
|
+ };
|
|
|
+
|
|
|
+ const closeChartComponent = () => {
|
|
|
+ showChartComponent.value = false;
|
|
|
+ };
|
|
|
+
|
|
|
return {
|
|
|
time,
|
|
|
buyRef,
|
|
|
@@ -235,6 +225,10 @@ export default defineComponent({
|
|
|
handleBtnList,
|
|
|
isWR,
|
|
|
timeChange,
|
|
|
+ quoteDayInfo,
|
|
|
+ showChartComponent,
|
|
|
+ openChartComponent,
|
|
|
+ closeChartComponent,
|
|
|
};
|
|
|
},
|
|
|
});
|