Jelajahi Sumber

修改 仓单贸易 权限对应的code

huangbin 4 tahun lalu
induk
melakukan
620c412d6e

+ 1 - 1
public/config/app.config.json

@@ -1,3 +1,3 @@
 {
-    "apiUrl": "http://192.168.31.139:8080/cfg?key=test_139"
+    "apiUrl": "http://192.168.31.204:8080/cfg?key=test_204"
 }

+ 16 - 5
src/views/market/spot_trade/setup.ts

@@ -2,6 +2,7 @@ import { BtnListType } from '@/common/components/btnList/interface';
 import { ContextMenuTemp } from "@/common/components/contextMenu/interface";
 import { handleContextMenu } from "@/common/components/contextMenu/setup";
 import { EnumRouterName } from '@/common/constants/enumRouterName';
+import { ModalEnum } from '@/common/constants/modalNameEnum';
 import { getTableColumns, getTableEvent, initData } from "@/common/export/table";
 import { findChildList, getClassName } from "@/common/setup/table/button";
 import { ComposeTableParam, TableEventCB } from "@/common/setup/table/interface";
@@ -33,15 +34,25 @@ export function handleSpotBtnList(menuType: EnumRouterName) {
         const fnMap = (arr: OperationTabMenu[]) => {
             return arr.map(e => {
                 const { code, title } = e;
-                return { lable: title, code, className: getClassName(code) }
+                // 处理 多对一
+                let result = code
+                if (code.includes(ModalEnum.spot_trade_warehouse_post_buying)) {
+                    // 挂牌求购
+                    result = ModalEnum.spot_trade_warehouse_post_buying
+                } else if (code.includes(ModalEnum.spot_trade_warehouse_detail)) {
+                    // 详情
+                    result = ModalEnum.spot_trade_warehouse_detail
+                }
+
+                return { lable: title, code: result, className: getClassName(code) }
             })
         }
         // 过滤报价大厅按钮列表
         const temp = list.children.filter(e => e.type === 2)
         firstBtn = fnMap(temp)
 
-        const fn = (code: EnumRouterName) => {
-            const findResult = list.children.find(e => e.code === code)
+        const fn = (code: string) => {
+            const findResult = list.children.find(e => e.code.includes(code))
             const result: BuyAndSellMarket = { isMarket: false, btnList: [] }
             if (findResult) {
                 result.isMarket = true
@@ -52,9 +63,9 @@ export function handleSpotBtnList(menuType: EnumRouterName) {
         }
 
         // 处理买大厅
-        Object.assign(buyMarket, fn(EnumRouterName.spot_trade_warehouse_buy_hall))
+        Object.assign(buyMarket, fn('buy'))
         // 处理卖大厅
-        Object.assign(sellMarket, fn(EnumRouterName.spot_trade_warehouse_sell_hall))
+        Object.assign(sellMarket, fn('sell'))
     }
     return { firstBtn, buyMarket, sellMarket }
 }

+ 7 - 2
src/views/market/spot_trade/spot_trade_order_transaction/spot_trade_order_transaction_swap/components/buy/index.vue

@@ -53,9 +53,11 @@ import { queryTjmdTradeOrderDetail } from '@/services/go/Tjmd';
 import { QueryTjmdTradeOrderDetailReq, QueryTjmdTradeOrderDetailRsp } from '@/services/go/Tjmd/interface';
 import { getUserId } from '@/services/bus/account';
 import { getUserAccountType } from '@/services/bus/user';
-import { useBuyOrSellBtnList, getBuyOrSellMarketPrice } from '../setup';
+import { useBuyOrSellBtnList, getBuyOrSellMarketPrice, sortPirce } from '../setup';
 import { findItemGoods } from '../../setup';
 import { RefGoodsList } from '../../interface';
+import { sortTime } from '@/utils/time';
+import TimerUtils from '@/utils/timer/timerUtil';
 
 const columns = [
     {
@@ -128,7 +130,10 @@ export default defineComponent({
                 usertype: getUserAccountType(),
                 goodsid: findItemGoods(props.parantSelectedRow.goodscode)?.goodsid,
             };
-            queryTable(queryTjmdTradeOrderDetail, param);
+            queryTable(queryTjmdTradeOrderDetail, param).then((res) => {
+                console.log('ddddddddddddddddddd', res);
+                tableList.value = sortPirce(res);
+            });
         };
         // 表格通用逻辑
         const param: ComposeTableParam = {

+ 7 - 5
src/views/market/spot_trade/spot_trade_order_transaction/spot_trade_order_transaction_swap/components/sell/index.vue

@@ -47,11 +47,11 @@ import { ColumnType } from '@/common/methods/table/interface';
 import { Moment } from 'moment';
 import moment from 'moment';
 import { getShowBottomValue } from '@/common/config/constrolBottom';
-import { useBuyOrSellBtnList, getBuyOrSellMarketPrice } from '../setup';
+import { useBuyOrSellBtnList, getBuyOrSellMarketPrice, sortPirce } from '../setup';
 import { getUserId } from '@/services/bus/account';
 import { getUserAccountType } from '@/services/bus/user';
 import { queryTjmdTradeOrderDetail } from '@/services/go/Tjmd';
-import { QueryTjmdTradeOrderDetailReq } from '@/services/go/Tjmd/interface';
+import { QueryTjmdTradeOrderDetailReq, QueryTjmdTradeOrderDetailRsp } from '@/services/go/Tjmd/interface';
 import { findItemGoods } from '../../setup';
 import { RefGoodsList } from '../../interface';
 
@@ -118,7 +118,7 @@ export default defineComponent({
         const isBottom = getShowBottomValue();
         console.log(isBottom.value, 'isBottom');
         // 表格列表数据
-        const { loading, tableList, queryTable } = queryTableList<WrOrderQuoteDetail>();
+        const { loading, tableList, queryTable } = queryTableList<QueryTjmdTradeOrderDetailRsp>();
 
         // 获取列表数据
         const queryTableAction = () => {
@@ -128,7 +128,9 @@ export default defineComponent({
                 usertype: getUserAccountType(),
                 goodsid: findItemGoods(props.parantSelectedRow.goodscode)?.goodsid,
             };
-            queryTable(queryTjmdTradeOrderDetail, param);
+            queryTable(queryTjmdTradeOrderDetail, param).then((res) => {
+                tableList.value = sortPirce(res);
+            });
         };
         // 表格通用逻辑
         const param: ComposeTableParam = {
@@ -149,7 +151,7 @@ export default defineComponent({
         }
         return {
             isBottom,
-            ...handleComposeTable<WrOrderQuoteDetail>(param),
+            ...handleComposeTable<QueryTjmdTradeOrderDetailRsp>(param),
             queryTableAction,
             loading,
             tableList,

+ 8 - 0
src/views/market/spot_trade/spot_trade_order_transaction/spot_trade_order_transaction_swap/components/setup.ts

@@ -66,4 +66,12 @@ export function getBuyOrSellMarketPrice(record: QueryTjmdTradeOrderDetailRsp, se
         }
     }
     return result
+}
+
+// 价格排序
+export function sortPirce(arr: QueryTjmdTradeOrderDetailRsp[]) {
+    const fn = ({ pricemode, marketmaxsub, orderprice }: QueryTjmdTradeOrderDetailRsp) => {
+        return pricemode === 3 ? orderprice + marketmaxsub : orderprice
+    }
+    return arr.sort((a, b) => fn(a) - fn(b))
 }

+ 4 - 4
src/views/market/spot_trade/warehouse_receipt_trade/warehouse_receipt_trade_price/index.vue

@@ -40,10 +40,10 @@ export default defineComponent({
     components: {
         contextMenu,
         Filter,
-        [ModalEnum.spot_trade_warehouse_detail]: defineAsyncComponent(() => import('../../components/detail/index.vue')),
-        [ModalEnum.spot_trade_warehouse_post_buying]: defineAsyncComponent(() => import('../../components/post_buying/index.vue')),
+        warehouse_receipt_trade_price_spot_trade_warehouse_detail: defineAsyncComponent(() => import('../../components/detail/index.vue')),
+        warehouse_receipt_trade_price_spot_trade_warehouse_post_buying: defineAsyncComponent(() => import('../../components/post_buying/index.vue')),
         buyAndSell: defineAsyncComponent(() => import('../../components/buy-sell-market/index.vue')),
-        postBuying: defineAsyncComponent(() => import('../../components/post_buying/index.vue')),
+        // postBuying: defineAsyncComponent(() => import('../../components/post_buying/index.vue')),
     },
     setup() {
         const isBottom = getShowBottomValue();
@@ -92,7 +92,7 @@ export default defineComponent({
             componentId.value = 'postBuying';
             selectedRow.value = value;
         }
-
+        console.log('firstBtn', firstBtn);
         return {
             isBottom,
             contextMenu,