Переглянути джерело

Merge branch 'master' of http://47.101.159.18:3000/Muchinfo/MTP2.0_WEB

li.shaoyi 4 роки тому
батько
коміт
4ad595eef7

+ 2 - 2
src/common/setup/table/tableQuote.ts

@@ -150,13 +150,13 @@ export function quoteChange(record: QueryQuoteDayRsp, decimalplace = 2) {
     return result
 }
 
-// 幅度(最新价 - 昨结价) / 100 %
+// 幅度(最新价 - 昨结价) / 昨结价) *  100 %
 export function quoteAmplitude(record: QueryQuoteDayRsp, decimalplace = 2) {
     const result = quoteChange(record, decimalplace)
     return result === '--' ? '--' : (+result / record.presettle * 100).toFixed(decimalplace) + '%'
 }
 
-// (最高价 - 最低价 ) / 最新价  * 100 %
+// 振幅 (最高价 - 最低价 ) / 最新价  * 100 %
 export function quoteAmplituOfVibration(record: QueryQuoteDayRsp, decimalplace = 2) {
     const { highest, lowest, last } = record
     let result = '--'

+ 9 - 1
src/services/socket/quota/adapter/index.ts

@@ -170,7 +170,15 @@ export function parseReceivePush(quotationData: any) {
 
                 // !goodsQuoteTik.bidvolume && (goodsQuoteTik.bidvolume = '--')
                 // !goodsQuoteTik.askvolume && (goodsQuoteTik.askvolume = '--')
-                !goodsQuoteTik.lastvolume && (goodsQuoteTik.lastvolume = '--')
+                // !goodsQuoteTik.lastvolume && (goodsQuoteTik.lastvolume = '--')
+                // 实时行情由于行情源的问题可能不会下发现量,这时用盘面的总量来计算
+                if (!goodsQuoteTik.lastvolume) {
+                    if (itemQuote.totalvolume) {
+                        goodsQuoteTik.lastvolume = goodsQuoteTik.totalvolume - itemQuote.totalvolume;
+                    } else {
+                        goodsQuoteTik.lastvolume = "--";
+                    }
+                }
                 !goodsQuoteTik.holdvolume && (goodsQuoteTik.holdvolume = '--')
                 !goodsQuoteTik.holdincrement && (goodsQuoteTik.holdincrement = '--')
                 // !goodsQuoteTik.totalturnover && (goodsQuoteTik.totalturnover = '--')

+ 83 - 87
src/views/market/spot_trade/spot_trade_order_transaction/components/buy-sell-market/index.vue

@@ -1,95 +1,91 @@
 <template>
-    <!-- 买卖大厅 -->
-    <div class="buy-sell-market">
-        <div class="buy-sell-market-title">
-            <a class="backIcon" @click="cancelAction">
-                <LeftOutlined />
-            </a>
-            <div class="titleBtn">
-                <div class="name">{{selectedRow.goodscode}} {{selectedRow.goodsname}}</div>
-                <div class="arrowRightIcon"></div>
+  <!-- 买卖大厅 -->
+  <div class="buy-sell-market">
+    <div class="buy-sell-market-title">
+      <a class="backIcon"
+         @click="cancelAction">
+        <LeftOutlined />
+      </a>
+      <div class="titleBtn">
+        <div class="name">{{selectedRow.goodscode}} {{selectedRow.goodsname}}</div>
+        <div class="arrowRightIcon"></div>
+      </div>
+      <div class="inlineBar">
+        <div class="valNums bdf1 ml10">
+          <!-- 最新价 -->
+          <div
+               :class="['firstNum', 'start', handleQuotePriceColor(selectedRow.last, selectedRow.presettle)]">
+            {{selectedRow.last}}</div>
+          <div class="lastNum start">
+            <!-- 涨跌值 -->
+            <div :class="handleQuotePriceColor(selectedRow.last, selectedRow.presettle)">
+              {{quoteChange(selectedRow, selectedRow.decimalplace)}}</div>
+            <!-- 涨跌幅 -->
+            <div class="ml20"
+                 :class="handleQuotePriceColor(selectedRow.last, selectedRow.presettle)">
+              {{quoteAmplitude(selectedRow, selectedRow.decimalplace)}}</div>
+          </div>
+        </div>
+        <div class="priceBar ml20">
+          <div class="inlineBar start">
+            <div class="greenBar green">
+              <div class="numBlock ml15">
+                <div class="first">卖价</div>
+                <div class="last"
+                     :class="handleQuotePriceColor(selectedRow.ask, selectedRow.presettle)">
+                  {{selectedRow.ask}}</div>
+              </div>
+              <div class="numBlock">
+                <div class="first">卖量</div>
+                <div class="last">{{selectedRow.askvolume}}</div>
+              </div>
             </div>
-            <div class="inlineBar">
-                <div class="valNums bdf1 ml10">
-                    <!-- 最新价 -->
-                    <div
-                        :class="['firstNum', 'start', handleQuotePriceColor(selectedRow.last, selectedRow.presettle)]"
-                    >{{selectedRow.last}}</div>
-                    <div class="lastNum start">
-                        <!-- 涨跌值 -->
-                        <div
-                            :class="handleQuotePriceColor(selectedRow.last, selectedRow.presettle)"
-                        >{{quoteChange(selectedRow, selectedRow.decimalplace)}}</div>
-                        <!-- 涨跌幅 -->
-                        <div
-                            class="ml20"
-                            :class="handleQuotePriceColor(selectedRow.last, selectedRow.presettle)"
-                        >{{quoteAmplituOfVibration(selectedRow, selectedRow.decimalplace)}}</div>
-                    </div>
-                </div>
-                <div class="priceBar ml20">
-                    <div class="inlineBar start">
-                        <div class="greenBar green">
-                            <div class="numBlock ml15">
-                                <div class="first">卖价</div>
-                                <div
-                                    class="last"
-                                    :class="handleQuotePriceColor(selectedRow.ask, selectedRow.presettle)"
-                                >{{selectedRow.ask}}</div>
-                            </div>
-                            <div class="numBlock">
-                                <div class="first">卖量</div>
-                                <div class="last">{{selectedRow.askvolume}}</div>
-                            </div>
-                        </div>
-                    </div>
-                    <div class="inlineBar start">
-                        <div class="redBar red1">
-                            <div class="numBlock">
-                                <div class="first">买价</div>
-                                <div
-                                    class="last"
-                                    :class="handleQuotePriceColor(selectedRow.bid, selectedRow.presettle)"
-                                >{{selectedRow.bid}}</div>
-                            </div>
-                            <div class="numBlock">
-                                <div class="first">买量</div>
-                                <div class="last">{{selectedRow.bidvolume}}</div>
-                            </div>
-                        </div>
-                    </div>
-                </div>
-                <BtnList :btnList="btnListData" :record="selectedRow" @click="openComponent" />
+          </div>
+          <div class="inlineBar start">
+            <div class="redBar red1">
+              <div class="numBlock">
+                <div class="first">买价</div>
+                <div class="last"
+                     :class="handleQuotePriceColor(selectedRow.bid, selectedRow.presettle)">
+                  {{selectedRow.bid}}</div>
+              </div>
+              <div class="numBlock">
+                <div class="first">买量</div>
+                <div class="last">{{selectedRow.bidvolume}}</div>
+              </div>
             </div>
+          </div>
         </div>
-        <!-- 交易图表 -->
-        <Chart
-            v-if="showComponentsId === ComponentType.chart"
-            @update="changeComponent"
-            :deliverGoods="deliverGoods"
-        />
-        <!-- 买卖大厅内容 -->
-        <a-row class="buySellHall" v-if="showComponentsId === ComponentType.marketContent">
-            <a-col :span="12">
-                <Sell ref="sellRef" :parantSelectedRow="deliverGoods" />
-            </a-col>
-            <a-col :span="12">
-                <Buy ref="buyRef" :parantSelectedRow="deliverGoods" />
-            </a-col>
-        </a-row>
-        <!-- 成交明细 -->
-        <StockExchange
-            :deliverGoods="deliverGoods"
-            v-if="showComponentsId === ComponentType.tradeDetail"
-        />
-        <component
-            :is="componentId"
-            v-if="componentId"
-            :selectedRow="selectedRow"
-            :deliverGoods="deliverGoods"
-            @cancel="closeComponent"
-        ></component>
+        <BtnList :btnList="btnListData"
+                 :record="selectedRow"
+                 @click="openComponent" />
+      </div>
     </div>
+    <!-- 交易图表 -->
+    <Chart v-if="showComponentsId === ComponentType.chart"
+           @update="changeComponent"
+           :deliverGoods="deliverGoods" />
+    <!-- 买卖大厅内容 -->
+    <a-row class="buySellHall"
+           v-if="showComponentsId === ComponentType.marketContent">
+      <a-col :span="12">
+        <Sell ref="sellRef"
+              :parantSelectedRow="deliverGoods" />
+      </a-col>
+      <a-col :span="12">
+        <Buy ref="buyRef"
+             :parantSelectedRow="deliverGoods" />
+      </a-col>
+    </a-row>
+    <!-- 成交明细 -->
+    <StockExchange :deliverGoods="deliverGoods"
+                   v-if="showComponentsId === ComponentType.tradeDetail" />
+    <component :is="componentId"
+               v-if="componentId"
+               :selectedRow="selectedRow"
+               :deliverGoods="deliverGoods"
+               @cancel="closeComponent"></component>
+  </div>
 </template>
 
 <script lang="ts">

+ 1 - 1
src/views/market/spot_trade/spot_trade_order_transaction/spot_trade_order_transaction_basis_difference/index.vue

@@ -20,7 +20,7 @@
       </template>
       <!-- 幅度 -->
       <template #amplitude="{ record }">
-        <span>{{quoteAmplituOfVibration(record, record.decimalplace)}}</span>
+        <span>{{quoteAmplitude(record, record.decimalplace)}}</span>
       </template>
       <!-- 振幅 -->
       <template #vibration="{ record }">

+ 1 - 1
src/views/market/spot_trade/spot_trade_order_transaction/spot_trade_order_transaction_listing_transfer/index.vue

@@ -20,7 +20,7 @@
       </template>
       <!-- 幅度 -->
       <template #amplitude="{ record }">
-        <span>{{quoteAmplituOfVibration(record, record.decimalplace)}}</span>
+        <span>{{quoteAmplitude(record, record.decimalplace)}}</span>
       </template>
       <!-- 振幅 -->
       <template #vibration="{ record }">

+ 1 - 1
src/views/market/spot_trade/spot_trade_order_transaction/spot_trade_order_transaction_swap/index.vue

@@ -35,7 +35,7 @@
       </template>
       <!-- 幅度 -->
       <template #amplitude="{ record }">
-        <span>{{quoteAmplituOfVibration(record, record.decimalplace)}}</span>
+        <span>{{quoteAmplitude(record, record.decimalplace)}}</span>
       </template>
       <!-- 振幅 -->
       <template #vibration="{ record }">

+ 1 - 1
src/views/market/spot_trade/spot_trade_reference_market/components/container/index.vue

@@ -23,7 +23,7 @@
             <!-- 涨跌幅 -->
             <div class="ml20"
                  :class="handleQuotePriceColor(selectedRow.last, selectedRow.presettle)">
-              {{ quoteAmplituOfVibration(selectedRow, selectedRow.decimalplace) }}</div>
+              {{ quoteAmplitude(selectedRow, selectedRow.decimalplace) }}</div>
           </div>
         </div>
         <div class="priceBar ml20">

+ 6 - 6
src/views/order/commodity_contract/components/commodity_contract_commission/components/cancel/index.vue

@@ -38,13 +38,13 @@ export default defineComponent({
 
         function submit() {
             const param = {
-                ClientSerialNo: uuidv4(), // string 客户端流水号
-                ClientOrderTime: moment().format('YYYY-MM-DD HH:mm:ss'), // string 客户端委托时间
-                ClientType: 4, // uint32 终端类型
-                OperateType: 5, // 操作类型
-                OldOrderId: props.selectedRow.orderid,
+                // ClientSerialNo: uuidv4(), // string 客户端流水号
+                // ClientOrderTime: moment().format('YYYY-MM-DD HH:mm:ss'), // string 客户端委托时间
+                // ClientType: 4, // uint32 终端类型
+                // OperateType: 5, // 操作类型
+                OldOrderId: Long.fromString(props.selectedRow.orderid),
                 AccountID: getInTaAccount(), // uint64 资金账号
-                OrderSrc: 1, // uint32 委托来源
+                // OrderSrc: 1, // uint32 委托来源
                 OperatorID: Number(geLoginID_number()), // uint64 操作员账号ID
                 MarketID: props.selectedRow.marketid,
                 GoodsID: props.selectedRow.goodsid,

+ 59 - 12
src/views/search/search_financing_inquiry/search_financing_inquiry_contract/index.vue

@@ -29,23 +29,45 @@
       </template>
 
     </a-table>
+    <!-- 明细 -->
+    <Description v-if="visible"
+                 @close="closeDrawer"
+                 :tabList="tabList">
+      <a-table :columns="FeeColumns"
+               class="topTable"
+               :pagination="false"
+               rowKey="key"
+               :data-source="feeList"
+               :scroll="{ x: '100%', y: 'calc(100vh - 163px)' }">
+        <template #updatetime="{ text }">
+          <span>{{ text === '--' ? text :  formatTime(text)}}</span>
+        </template>
+        <template #closeintereststatus="{ text }">
+          <span>{{ getCloseInterRestStatus(text)}}</span>
+        </template>
+      </a-table>
+    </Description>
   </section>
 </template>
 
 <script lang="ts">
-import { queryTableList, defineComponent } from '@/common/export/commonTable';
-import { queryWrScfContract } from '@/services/go/wrtrade';
-import { WrScfContract } from '@/services/go/wrtrade/interface';
-import { getRecordItemTab } from '@/common/setup/order/orderData';
-import { handleComposeOrderTable } from '@/common/setup/table/compose';
-import { ComposeOrderTableParam } from '@/common/setup/table/interface';
+import Description from '@/common/components/description/index.vue';
+import { EnumRouterName } from '@/common/constants/enumRouterName';
+import { getContractName, getFinanceTypeName, getScfContractTypeName } from '@/common/constants/enumsName';
+import { defineComponent, queryTableList } from '@/common/export/commonTable';
 import { formatTime } from '@/common/methods';
 import { expandIcon } from '@/common/setup/table/clolumn';
-import { getContractName, getFinanceTypeName, getScfContractTypeName } from '@/common/constants/enumsName';
-import { EnumRouterName } from '@/common/constants/enumRouterName';
+import { ComposeTableDetailParam, handleComposeTable_detail } from '@/common/setup/table/compose';
+import { queryWrScfContract } from '@/services/go/wrtrade';
+import { WrScfContract } from '@/services/go/wrtrade/interface';
+import { watchEffect } from 'vue';
+import { useFeeDetail } from './setup';
 
 export default defineComponent({
     name: EnumRouterName.search_financing_inquiry_contract,
+    components: {
+        Description,
+    },
     setup() {
         // 表格列表数据
         const { loading, tableList, queryTable } = queryTableList<WrScfContract>();
@@ -53,14 +75,38 @@ export default defineComponent({
         const queryTableAction = () => {
             queryTable(queryWrScfContract);
         };
-        // 表格通用逻辑
-        const param: ComposeOrderTableParam = {
+        const { FeeColumns, feeList, tabList, queryFeeDetail, getCloseInterRestStatus } = useFeeDetail();
+
+        const param: ComposeTableDetailParam = {
             queryFn: queryTableAction,
             tableName: 'table_pcweb_financing_manage_bottom_contract',
-            recordList: getRecordItemTab(),
+            tableFilterKey: [], // 表格过滤字段
+            menuType: EnumRouterName.search_financing_inquiry_apply_order, // 当前tab页对应的code
         };
+        const {
+            visible,
+            closeDrawer, // 控制 drawer 组件是否显示
+            columns,
+            detailTableList, // 明细表头数据
+            expandedRowKeys,
+            selectedRow,
+            Rowclick, // 表格事件
+        } = handleComposeTable_detail<WrScfContract>(param);
+
+        watchEffect(() => {
+            if (visible.value) {
+                queryFeeDetail(selectedRow.value!.scfcontractid);
+            }
+        });
         return {
-            ...handleComposeOrderTable<WrScfContract>(param),
+            visible,
+            closeDrawer, // 控制 drawer 组件是否显示
+            columns,
+            FeeColumns,
+            expandedRowKeys,
+            Rowclick, // 表格事件
+            tabList,
+            feeList,
             loading,
             tableList,
             formatTime,
@@ -68,6 +114,7 @@ export default defineComponent({
             getContractName,
             getFinanceTypeName,
             getScfContractTypeName,
+            getCloseInterRestStatus,
         };
     },
 });

+ 42 - 0
src/views/search/search_financing_inquiry/search_financing_inquiry_contract/setup.ts

@@ -0,0 +1,42 @@
+import { TabList } from "@/common/components/description/interface";
+import { queryTableList } from "@/common/setup/table";
+import { queryWrScfContractInterest } from "@/services/go/wrtrade";
+import { WrScfContractInterest } from "@/services/go/wrtrade/interface";
+
+// 费用明细
+export const useFeeDetail = () => {
+    // 表头
+    const FeeColumns = [
+        { title: '日期', dataIndex: 'updatetime', key: 'updatetime', align: 'center', slots: { customRender: 'updatetime' }, width: 160 },
+        { title: '费用', dataIndex: 'interestamount', key: 'interestamount', align: 'center', width: 160 },
+        { title: '已结', dataIndex: 'closeinterest', key: 'closeinterest', align: 'center', width: 160 },
+        { title: '状态', dataIndex: 'closeintereststatus', key: 'closeintereststatus', align: 'center', slots: { customRender: 'closeintereststatus' }, width: 160 }
+    ];
+    // 表格列表数据
+    const { tableList, queryTable } = queryTableList<WrScfContractInterest>();
+
+    //结息状态 - 1:未结 2:已结
+    const getCloseInterRestStatus = (status: number) => {
+        let result = '--'
+        switch (status) {
+            case 1:
+                result = '未结'
+                break
+            case 2:
+                result = '已结'
+                break
+        }
+        return result
+    }
+    const queryFeeDetail = (scfcontractid: string) => {
+        const param = { scfcontractid }
+        queryTable(queryWrScfContractInterest, param)
+    }
+
+    const tabList: TabList[] = [
+        { lable: '费用明细', code: 'fee-detail' }
+    ]
+
+    return { FeeColumns, feeList: tableList, tabList, queryFeeDetail, getCloseInterRestStatus }
+}
+