Преглед на файлове

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

li.shaoyi преди 4 години
родител
ревизия
37a5b54241
променени са 40 файла, в които са добавени 1182 реда и са изтрити 914 реда
  1. 2 2
      src/assets/styles/mixin.less
  2. 2 2
      src/common/constants/enumsName.ts
  3. 1 1
      src/common/setup/table/tableQuote.ts
  4. 2 2
      src/common/setup/trade/index.ts
  5. 2 1
      src/services/bus/goods.ts
  6. 41 2
      src/services/bus/market.ts
  7. 2 0
      src/services/go/wrtrade/interface.ts
  8. 1 1
      src/views/market/spot_trade/components/buy-sell-market/components/delisting/setup.ts
  9. 1 1
      src/views/market/spot_trade/components/buy-sell-market/components/financing_delisting/setup.ts
  10. 23 8
      src/views/market/spot_trade/components/filter/index.vue
  11. 1 1
      src/views/market/spot_trade/components/post_buying/setup.ts
  12. 4 2
      src/views/market/spot_trade/interface.ts
  13. 7 4
      src/views/market/spot_trade/setup.ts
  14. 2 2
      src/views/market/spot_trade/spot_trade_order_transaction/components/stock-exchange/index.vue
  15. 5 3
      src/views/market/spot_trade/spot_trade_order_transaction/spot_trade_order_transaction_swap/components/delisting/index.vue
  16. 28 1
      src/views/market/spot_trade/spot_trade_order_transaction/spot_trade_order_transaction_swap/components/delisting/setup.ts
  17. 2 2
      src/views/market/spot_trade/spot_trade_order_transaction/spot_trade_order_transaction_swap/index.vue
  18. 6 4
      src/views/market/spot_trade/spot_trade_order_transaction/spot_trade_order_transaction_swap/setup.ts
  19. 63 60
      src/views/market/spot_trade/spot_trade_reference_market/components/container/index.vue
  20. 1 1
      src/views/market/spot_trade/spot_trade_reference_market/index.vue
  21. 6 2
      src/views/market/spot_trade/warehouse_pre_sale/warehouse_pre_sale_blocs/components/delisting/index.vue
  22. 168 160
      src/views/market/spot_trade/warehouse_pre_sale/warehouse_pre_sale_blocs/components/post-buying/index.vue
  23. 26 25
      src/views/market/spot_trade/warehouse_pre_sale/warehouse_pre_sale_floating_price/index.vue
  24. 26 24
      src/views/market/spot_trade/warehouse_pre_sale/warehouse_pre_sale_price/index.vue
  25. 19 23
      src/views/market/spot_trade/warehouse_receipt_trade/warehouse_receipt_trade_blocs/components/delisting/index.vue
  26. 155 154
      src/views/market/spot_trade/warehouse_receipt_trade/warehouse_receipt_trade_blocs/components/post-buying/index.vue
  27. 26 24
      src/views/market/spot_trade/warehouse_receipt_trade/warehouse_receipt_trade_floating_price/index.vue
  28. 5 1
      src/views/order/commodity_contract/components/commodity_contract_summary/index.vue
  29. 21 3
      src/views/order/financing_manager/components/financing_manager_apply_order/index.vue
  30. 17 6
      src/views/order/funding_information/components/funding_information_funding_summary/setup.ts
  31. 78 44
      src/views/order/pre_sale_warehouse_receipt/components/pre_sale_warehouse_receipt_bargain/components/bargain_detail/index.vue
  32. 2 4
      src/views/order/pre_sale_warehouse_receipt/components/pre_sale_warehouse_receipt_bargain/setup.ts
  33. 36 32
      src/views/order/pre_sale_warehouse_receipt/components/pre_sale_warehouse_receipt_deal/index.vue
  34. 27 5
      src/views/order/pre_sale_warehouse_receipt/components/pre_sale_warehouse_receipt_order_summary/components/listed/index.vue
  35. 2 1
      src/views/order/pre_sale_warehouse_receipt/components/pre_sale_warehouse_receipt_pending_order/index.vue
  36. 9 12
      src/views/order/setup.ts
  37. 68 33
      src/views/order/spot_warran/components/spot_warrant_bargain/components/bargain_detail/index.vue
  38. 2 4
      src/views/order/spot_warran/components/spot_warrant_bargain/setup.ts
  39. 1 0
      src/views/order/spot_warran/components/spot_warrant_pending_order/index.vue
  40. 292 257
      src/views/order/spot_warran/components/spot_warrant_spot_details/components/listing/index.vue

+ 2 - 2
src/assets/styles/mixin.less

@@ -1267,7 +1267,7 @@
 }
 
 .white {
-    color: @m-white6;
+    color: @m-white6 !important;
 }
 
 .blue {
@@ -2502,7 +2502,7 @@ input:-internal-autofill-selected {
         .market {
             margin-left: 28px;
             min-width: 160px;
-            height: 40px;
+            height: 28px;
             display: inline-flex;
             background: @m-blue3;
             border: 1px solid @m-blue13;

+ 2 - 2
src/common/constants/enumsName.ts

@@ -1008,7 +1008,7 @@ export function getInterestSettleModeName(type: number) {
 }
 
 //    interestratemode: number;//利率方式 - 1:年利率 2:日利率 3:日固定值
-export function getInterestrateModeName(mode: number, value: number) {
+export function getInterestrateModeName(mode: number, value: number, enumdicname: string) {
     let result = "--"
     switch (mode) {  // 1:年利率
         case 1:
@@ -1018,7 +1018,7 @@ export function getInterestrateModeName(mode: number, value: number) {
             result = (value * 10000).toFixed(2).toString() + '‱'
             break
         case 3: // 日固定值
-            result = value.toFixed(2).toString()
+            result = value.toFixed(2).toString() + '/' + enumdicname
             break;
     }
     return result

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

@@ -153,7 +153,7 @@ export function quoteChange(record: QueryQuoteDayRsp, decimalplace = 2) {
 // 幅度(最新价 - 昨结价) / 100 %
 export function quoteAmplitude(record: QueryQuoteDayRsp, decimalplace = 2) {
     const result = quoteChange(record, decimalplace)
-    return result === '--' ? '--' : (+result / 100).toFixed(decimalplace) + '%'
+    return result === '--' ? '--' : (+result / record.presettle * 100).toFixed(decimalplace) + '%'
 }
 
 // (最高价 - 最低价 ) / 最新价  * 100 %

+ 2 - 2
src/common/setup/trade/index.ts

@@ -46,7 +46,7 @@ export function useBuyFixedPricMaxNum<T extends CommomTradeForm>(formState: T, c
 
     // 处理 0 特殊情况
     if (marginValue) {
-        result = Math.floor(money / (marginValue * agreeunit))
+        result = Math.round(money / (marginValue * agreeunit))
     }
     return result
 }
@@ -60,7 +60,7 @@ export function useSellFixedPriceMaxNum<T extends CommomTradeForm>(formState: T,
     // 最大数量 = 可用资金/(履约保证金*挂牌价格)
     const marginValue = isRationInSellMarginType() ? (sellmarginvalue * formState.FixedPrice) : (sellmarginvalue + formState.FixedPrice)
     if (marginValue) { // 处理 0 特殊情况
-        result = Math.floor(money / (marginValue * agreeunit))
+        result = Math.round(money / (marginValue * agreeunit))
     }
     return result
 }

+ 2 - 1
src/services/bus/goods.ts

@@ -32,7 +32,8 @@ export function getQutoGoodsByTradeMode(trademode: TradeMode) {
         const marketInfo = getMarketByTradeMode(trademode)
         if (marketInfo) {
             // 过滤商品信息
-            const goodsList = getGoodsList().filter(e => e.marketid === marketInfo.marketid)
+            // goodsstatus: number;//商品状态- 1:待审核 2:未上市 3:上市 4:已注销 5:审核拒绝 6:退市 7:待退市
+            const goodsList = getGoodsList().filter(e => (e.goodsstatus === 3 && e.marketid === marketInfo.marketid))
             goodsList.forEach(el => {
                 // 找到行情数据
                 const quote = getQuoteDayInfoByCode(el.goodscode);

+ 41 - 2
src/services/bus/market.ts

@@ -1,15 +1,21 @@
 import { TradeMode } from "@/common/constants/enumCommon";
 import APP from '@/services';
+import { message } from "ant-design-vue";
 import { Marketrun } from "../go/commonMarket/interface";
 import { Market } from "../go/useInfo/interface";
+import { getGoodsList } from "./goods";
+
+export function getAllMarkets(): Market[] {
+    return APP.get('markets')
+}
 
 export function getMarketByTradeMode(trademode: TradeMode): Market | undefined {
-    return APP.get('markets').find((el: Market) => el.trademode === trademode)
+    return getAllMarkets().find((el: Market) => el.trademode === trademode)
 }
 
 // 通过 trademode 获取市场信息列表
 export function getMarketsByTradeMode(trademode: TradeMode): Market[] {
-    return APP.get('markets').filter((el: Market) => el.trademode === trademode)
+    return getAllMarkets().filter((el: Market) => el.trademode === trademode)
 }
 
 
@@ -30,4 +36,37 @@ export function getMarketRunByTradeMode(trademode: TradeMode): Marketrun | null
         result = temp ? temp : null;
     }
     return result
+}
+
+// 判断市场是否在运行
+export function marketIsRun(trademode: TradeMode) {
+    const marketInfo = getMarketRunByTradeMode(trademode)
+    let result = false
+    if (marketInfo) {
+        if (marketInfo.runstatus === 2) {
+            result = true
+        } else {
+            message.error(`市场未开市:runstatus${marketInfo.runstatus}`)
+            result = false
+        }
+
+    } else {
+        console.warn(`没有找到trademode${trademode}对应的市场信息`)
+    }
+    return result
+}
+
+// 通过 商品id查找 市场id
+export function getMarketByGoodsId(goodsid: number) {
+    return getGoodsList().find(e => e.goodsid === goodsid)?.marketid
+}
+// 通过 商品id查找 市场交易属性
+export function getMarketTradePropertyByGoodsId(goodsid: number) {
+    let result = null
+    const marketid = getMarketByGoodsId(goodsid)
+    if (marketid) {
+        const temp = getAllMarkets().find(el => el.marketid === marketid)?.tradeproperty
+        result = temp ? temp : null
+    }
+    return result
 }

+ 2 - 0
src/services/go/wrtrade/interface.ts

@@ -598,6 +598,8 @@ export interface WrFtWrstandard {
     wrstandardcode: string      //现货商品代码
     wrstandardid: number        //现货商品ID
     wrstandardname: string      //商品名称
+    enumdicname: string // 单位
+    minivalue: number // 最小值
 }
 
 /**

+ 1 - 1
src/views/market/spot_trade/components/buy-sell-market/components/delisting/setup.ts

@@ -117,7 +117,7 @@ export function handleNumAndMoney(enumName: EnumRouterName, buyOrSell: BuyOrSell
                 }
             }
         }
-        return Math.floor(result)
+        return Math.round(result)
     }
     //  摘牌金额
     function getMoney() {

+ 1 - 1
src/views/market/spot_trade/components/buy-sell-market/components/financing_delisting/setup.ts

@@ -139,7 +139,7 @@ export function handleNumAndMoney(enumName: EnumRouterName, buyOrSell: BuyOrSell
                 }
             }
         }
-        return Math.floor(result)
+        return Math.round(result)
     }
     //  摘牌金额
     function getMoney() {

+ 23 - 8
src/views/market/spot_trade/components/filter/index.vue

@@ -98,19 +98,20 @@ export default defineComponent({
                 TimerUtils.setTimeout(
                     () => {
                         selectedFT.value = undefined;
+                        wrLsit.value = [];
                     },
                     100,
                     'filterTimer'
                 );
-                return;
-            }
-            queryWrStandardFactoryItem({ wrstandardid: value }).then((res) => {
-                const result: SelectList[] = [];
-                res.forEach((el) => {
-                    result.push({ selected: undefined, ...el });
+            } else {
+                queryWrStandardFactoryItem({ wrstandardid: value }).then((res) => {
+                    const result: SelectList[] = [];
+                    res.forEach((el) => {
+                        result.push({ selected: undefined, ...el });
+                    });
+                    wrLsit.value = result;
                 });
-                wrLsit.value = result;
-            });
+            }
         }
 
         // 全部期货合约
@@ -176,6 +177,7 @@ export default defineComponent({
             return result;
         }
         function listingAction() {
+            debugger;
             if (!selectedFT.value) {
                 message.warn('请选中商品!');
                 return;
@@ -205,6 +207,19 @@ export default defineComponent({
                     setGoodsPrice(result);
                 }
                 const result = search(false);
+
+                const obj = {
+                    enumdicname: '',
+                    minivalue: 0,
+                };
+                FtDeliveryGoods.value.forEach((el) => {
+                    el.children?.forEach((e) => {
+                        e.key === selectedFT.value;
+                        obj.enumdicname = e.enumdicname;
+                        obj.minivalue = e.minivalue;
+                    });
+                });
+                Object.assign(result, obj);
                 context.emit('buy', result, selectedGoods.value);
             }
         }

+ 1 - 1
src/views/market/spot_trade/components/post_buying/setup.ts

@@ -53,7 +53,7 @@ export function handleNumAndPrice(enumName: EnumRouterName, selectedRow: WrOrder
         } else {
             const margin = marginMethod() ? (buymarginvalue * formState.FixedPrice) : (buymarginvalue + formState.FixedPrice)
             if (margin) {
-                result = Math.floor(canUseMoney / margin)
+                result = Math.round(canUseMoney / margin)
             }
         }
         return +result.toFixed(0)

+ 4 - 2
src/views/market/spot_trade/interface.ts

@@ -5,8 +5,10 @@ export interface BuyAndSellMarket {
 }
 
 export interface TreeDataItem {
-    value: number;
-    key: number;
+    value: number | string;
+    key: number | string;
+    enumdicname: string;
+    minivalue: number;
     title?: string;
     slots?: Record<string, string>;
     children?: TreeDataItem[];

+ 7 - 4
src/views/market/spot_trade/setup.ts

@@ -133,18 +133,21 @@ export function handleFtDeliveryGoods() {
     if (FtDeliveryGoods.value.length === 0) {
         initData(() => {
             queryFtDeliveryGoods().then(res => {
+                console.log('dddddddddd', res)
                 const result: TreeDataItem[] = []
                 res.forEach(el => {
                     const { deliverygoodsid, deliverygoodsname, wdlst } = el
                     const item: TreeDataItem = {
                         title: deliverygoodsname,
-                        key: deliverygoodsid,
-                        value: deliverygoodsid,
+                        key: deliverygoodsid + '--',
+                        value: deliverygoodsid + '--',
+                        enumdicname: '',
+                        minivalue: 0,
                         children: []
                     }
                     wdlst.forEach(e => {
-                        const { wrstandardid, wrstandardname } = e
-                        item.children?.push({ value: wrstandardid, key: wrstandardid, title: wrstandardname })
+                        const { wrstandardid, wrstandardname, enumdicname, minivalue } = e
+                        item.children?.push({ value: wrstandardid, key: wrstandardid, title: wrstandardname, enumdicname, minivalue })
                     })
                     result.push(item)
                 })

+ 2 - 2
src/views/market/spot_trade/spot_trade_order_transaction/components/stock-exchange/index.vue

@@ -46,8 +46,8 @@ import { formatTime } from '@/common/methods';
 
 const columnsList = [
     { title: '时间', key: 'TS', dataIndex: 'TS', align: 'center' },
-    { title: '成交价', key: 'Vol', dataIndex: 'Vol', align: 'center' },
-    { title: '成交量', key: 'PE', dataIndex: 'PE', align: 'center' },
+    { title: '成交价', key: 'PE', dataIndex: 'PE', align: 'center' },
+    { title: '成交量', key: 'Vol', dataIndex: 'Vol', align: 'center' },
 ];
 
 export default defineComponent({

+ 5 - 3
src/views/market/spot_trade/spot_trade_order_transaction/spot_trade_order_transaction_swap/components/delisting/index.vue

@@ -87,8 +87,8 @@
                                 :min="0"
                                 :max="99"
                                 v-model:value="formState.num" />
-                <MinusOutlined @click="decreasePrice" />
-                <PlusOutlined @click="increasePrice" />
+                <MinusOutlined @click="decreaseNumber" />
+                <PlusOutlined @click="increaseNumber" />
                 <span class="input-enumdicname">{{selectedRow.enumdicname}}</span>
               </a-form-item>
             </a-col>
@@ -172,7 +172,7 @@ import { v4 as uuidv4 } from 'uuid';
 import { defineComponent, PropType, ref } from 'vue';
 import { useUserType } from '../setup';
 import { FormParam } from './interface';
-import { handleForm } from './setup';
+import { handleForm, useBlocksPrice, useBlocksNumber } from './setup';
 
 export default defineComponent({
     emits: ['cancel', 'update'],
@@ -292,6 +292,8 @@ export default defineComponent({
             isBuy,
             useUserType,
             isLimit,
+            ...useBlocksPrice(),
+            ...useBlocksNumber(),
         };
     },
 });

+ 28 - 1
src/views/market/spot_trade/spot_trade_order_transaction/spot_trade_order_transaction_swap/components/delisting/setup.ts

@@ -28,4 +28,31 @@ export function handleForm() {
         formRef.value.resetFields()
     })
     return { rules, formState, formRef }
-}
+}
+
+// 价格
+export const useBlocksPrice = () => {
+    const priceCheck = ref<boolean>(false); // 是否可议价
+    function increasePrice() {
+        formState.price++;
+    }
+    function decreasePrice() {
+        if (formState.price) {
+            formState.price--;
+        }
+    }
+    return { priceCheck, increasePrice, decreasePrice };
+};
+
+// 数量
+export const useBlocksNumber = () => {
+    function increaseNumber() {
+        formState.num++;
+    }
+    function decreaseNumber() {
+        if (formState.num) {
+            formState.num--;
+        }
+    }
+    return { increaseNumber, decreaseNumber };
+};

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

@@ -1,5 +1,5 @@
 <template>
-  <!--订单交易 挂牌转让-->
+  <!--订单交易 商品掉期-->
   <div class="topTableHeight">
     <div class="filterTable">
       <div class="filter-custom-table">
@@ -115,7 +115,7 @@ export default defineComponent({
         let stopSubcribe = handleSubcriteOnDemandQuote<RefGoodsList>(goodsList);
         // 过滤标的合约
         function goodsChange(value: string) {
-            const goodsList = filterGoodsList(value);
+            filterGoodsList(value);
             // 停止上次订阅
             stopSubcribe();
             // 重新发起订阅

+ 6 - 4
src/views/market/spot_trade/spot_trade_order_transaction/spot_trade_order_transaction_swap/setup.ts

@@ -11,6 +11,7 @@ import { ref } from "vue"
 import { RefGoodsList } from './interface'
 
 const refGoods = ref<QueryQuoteGoodsListRsp[]>([])
+const allGoodsList = ref<RefGoodsList[]>([])
 
 export function findItemGoods(goodscode: string) {
     return refGoods.value.find(el => el.goodscode === goodscode)!
@@ -33,6 +34,7 @@ export const useSwapList = () => {
         queryTable(queryQuoteGoodsList, param).then(res => {
             refGoods.value = res
             goodsList.value.length = 0
+            allGoodsList.value.length = 0
             res.forEach(el => {
                 // 找到盘面数据
                 const quote = getQuoteDayInfoByCode(el.goodscode);
@@ -42,8 +44,10 @@ export const useSwapList = () => {
                         goodsname: el.goodsname, refgoodsname: el.refgoodsname
                     }
                     goodsList.value.push(result)
+                    allGoodsList.value.push(result)
                 }
             })
+            console.log(goodsList.value)
         })
     })
     // 获取标记商品列表
@@ -56,13 +60,11 @@ export const useSwapList = () => {
     }
     // 过滤标的合约
     function filterGoodsList(value: string) {
-        const result = ref<RefGoodsList[]>([])
         if (value === '全部标的合约') {
-            result.value = goodsList.value
+            goodsList.value = allGoodsList.value
         } else {
-            result.value = goodsList.value.filter(goods => goods.refgoodsname === value)
+            goodsList.value = allGoodsList.value.filter(goods => goods.refgoodsname === value)
         }
-        return result
     }
 
     return { loading, goodsList, getRefGoodsList, filterGoodsList }

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

@@ -1,68 +1,71 @@
 <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"
+               :class="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 class="inlineBar">
-                <div class="valNums bdf1 ml10">
-                    <!-- 最新价 -->
-                    <div class="firstNum start" :class="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 class="greenBar green">
-                            <div class="numBlock ml15">
-                                <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>
-                    <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>
+          </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" :selectedRow="selectedRow" />
-        <!-- 成交明细 -->
-        <StockExchange :selectedRow="selectedRow" v-if="showComponentsId === ComponentType.tradeDetail" />
+      </div>
     </div>
+    <!-- 交易图表 -->
+    <Chart v-if="showComponentsId === ComponentType.chart"
+           @update="changeComponent"
+           :selectedRow="selectedRow" />
+    <!-- 成交明细 -->
+    <StockExchange :selectedRow="selectedRow"
+                   v-if="showComponentsId === ComponentType.tradeDetail" />
+  </div>
 </template>
 
 <script lang="ts">

+ 1 - 1
src/views/market/spot_trade/spot_trade_reference_market/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 }">

+ 6 - 2
src/views/market/spot_trade/warehouse_pre_sale/warehouse_pre_sale_blocs/components/delisting/index.vue

@@ -164,14 +164,14 @@ import { DGFactoryItems, HdWRDealOrderReq, WrBargainApplyReq, WRGoodsInfo } from
 import { getAccountTypeList, getSelectedAccountId, getUserId } from '@/services/bus/account';
 import { v4 as uuidv4 } from 'uuid';
 import moment, { Moment } from 'moment';
-import { getMarketRunByTradeMode } from '@/services/bus/market';
+import { getMarketRunByTradeMode, marketIsRun } from '@/services/bus/market';
 import { QueryOrderQuoteMyqQsp, WrOrderQuote } from '@/services/go/wrtrade/interface';
 
 import { validateAction } from '@/common/setup/form';
 
 import { EnumRouterName } from '@/common/constants/enumRouterName';
 
-import { BuyOrSell } from '@/common/constants/enumCommon';
+import { BuyOrSell, TradeMode } from '@/common/constants/enumCommon';
 import { getCanUseMoney } from '@/services/bus/account';
 import { TempWrOrderQuoteDetail } from '@/views/market/spot_trade/components/post_buying/interface';
 import { handleForm, handleSpotWarrant } from './setup';
@@ -279,6 +279,10 @@ export default defineComponent({
         }
 
         function submit() {
+            // 判断是否开市
+            if (!marketIsRun(TradeMode.WarehouseReceiptTrade)) {
+                return;
+            }
             validateAction<ListingForm>(formRef, formState).then((res) => {
                 const price = getPrice();
                 const num = getNum();

+ 168 - 160
src/views/market/spot_trade/warehouse_pre_sale/warehouse_pre_sale_blocs/components/post-buying/index.vue

@@ -1,165 +1,168 @@
 <template>
-    <!--仓单贸易 贸易圈挂牌 挂牌求购 -->
-    <Drawer :title="'挂牌求购'" :placement="'right'" :visible="visible" @cancel="cancel" class="top486">
-        <div class="post_buying">
-            <a-form class="inlineForm dialogForm" ref="formRef" :model="formState" :rules="rules">
-                <div class="formBar">
-                    <a-row :gutter="24">
-                        <a-col :span="24">
-                            <a-form-item label="交易账户" name="accountid">
-                                <a-select
-                                    class="inlineFormSelect"
-                                    style="width: 260px"
-                                    v-model:value="formState.accountid"
-                                    placeholder="请选择"
-                                >
-                                    <a-select-option
-                                        v-for="item in accountList"
-                                        :value="item.accountid"
-                                        :key="item.accountid"
-                                    >{{item.accountid}}</a-select-option>
-                                </a-select>
-                            </a-form-item>
-                        </a-col>
-                        <a-col :span="24">
-                            <a-form-item label="挂牌价格" name="FixedPrice" class="inputIconBox">
-                                <a-input-number
-                                    class="commonInput"
-                                    style="width: 260px"
-                                    :min="0"
-                                    v-model:value="formState.FixedPrice"
-                                />
-                                <MinusOutlined @click="decreasePrice" />
-                                <PlusOutlined @click="increasePrice" />
-                                <a-checkbox class="commonCheckbox" v-model:checked="priceCheck">可议价</a-checkbox>
-                            </a-form-item>
-                        </a-col>
-                        <a-col :span="24">
-                            <a-form-item label="挂牌数量" name="OrderQty" class="inputIconBox">
-                                <a-input-number
-                                    class="commonInput"
-                                    style="width: 260px"
-                                    :min="0"
-                                    v-model:value="formState.OrderQty"
-                                />
-                                <MinusOutlined @click="decreaseNumber" />
-                                <PlusOutlined @click="increaseNumber" />
-                                <span class="input-enumdicname">{{selectedRow.enumdicname}}</span>
-                                <a-checkbox v-model:checked="numCheck" class="commonCheckbox">整单</a-checkbox>
-                            </a-form-item>
-                        </a-col>
+  <!--仓单贸易 贸易圈挂牌 挂牌求购 -->
+  <Drawer :title="'挂牌求购'"
+          :placement="'right'"
+          :visible="visible"
+          @cancel="cancel"
+          class="top486">
+    <div class="post_buying">
+      <a-form class="inlineForm dialogForm"
+              ref="formRef"
+              :model="formState"
+              :rules="rules">
+        <div class="formBar">
+          <a-row :gutter="24">
+            <a-col :span="24">
+              <a-form-item label="交易账户"
+                           name="accountid">
+                <a-select class="inlineFormSelect"
+                          style="width: 260px"
+                          v-model:value="formState.accountid"
+                          placeholder="请选择">
+                  <a-select-option v-for="item in accountList"
+                                   :value="item.accountid"
+                                   :key="item.accountid">{{item.accountid}}</a-select-option>
+                </a-select>
+              </a-form-item>
+            </a-col>
+            <a-col :span="24">
+              <a-form-item label="挂牌价格"
+                           name="FixedPrice"
+                           class="inputIconBox">
+                <a-input-number class="commonInput"
+                                style="width: 260px"
+                                :min="0"
+                                v-model:value="formState.FixedPrice" />
+                <MinusOutlined @click="decreasePrice" />
+                <PlusOutlined @click="increasePrice" />
+                <a-checkbox class="commonCheckbox"
+                            v-model:checked="priceCheck">可议价</a-checkbox>
+              </a-form-item>
+            </a-col>
+            <a-col :span="24">
+              <a-form-item label="挂牌数量"
+                           name="OrderQty"
+                           class="inputIconBox">
+                <a-input-number class="commonInput"
+                                style="width: 260px"
+                                :min="0"
+                                v-model:value="formState.OrderQty" />
+                <MinusOutlined @click="decreaseNumber" />
+                <PlusOutlined @click="increaseNumber" />
+                <span class="input-enumdicname">{{selectedRow.enumdicname}}</span>
+                <a-checkbox v-model:checked="numCheck"
+                            class="commonCheckbox">整单</a-checkbox>
+              </a-form-item>
+            </a-col>
 
-                        <a-col :span="24" v-if="!numCheck">
-                            <a-form-item label="起摘数量" name="delistingQty">
-                                <a-input-number
-                                    class="commonInput"
-                                    v-model:value="formState.delistingQty"
-                                    :min="0"
-                                    style="width: 260px !important"
-                                />
-                                <span class="input-enumdicname">{{selectedRow.enumdicname}}</span>
-                            </a-form-item>
-                        </a-col>
-                        <a-col :span="24">
-                            <a-form-item label="履约保证金" name="margin">
-                                <a-input-number
-                                    class="commonInput"
-                                    v-model:value="formState.margin"
-                                    :min="0"
-                                    style="width: 260px"
-                                />
-                                <span class="input-enumdicname">%</span>
-                            </a-form-item>
-                        </a-col>
-                        <a-col :span="24">
-                            <a-form-item label="交收月" name="DeliveryMonth">
-                                <a-month-picker
-                                    style="width: 140px"
-                                    v-model:value="formState.DeliveryMonth"
-                                    :allowClear="'false'"
-                                    class="commonDatePicker dialogDatePicker"
-                                />
-                            </a-form-item>
-                        </a-col>
-                        <a-col :span="24">
-                            <a-form-item label="挂牌有效期" name="vidaliteTime" class="inputIconBox">
-                                <a-date-picker
-                                    style="width: 260px"
-                                    v-model:value="formState.vidaliteTime"
-                                    :allowClear="false"
-                                    class="commonDatePicker dialogDatePicker"
-                                />
-                            </a-form-item>
-                        </a-col>
+            <a-col :span="24"
+                   v-if="!numCheck">
+              <a-form-item label="起摘数量"
+                           name="delistingQty">
+                <a-input-number class="commonInput"
+                                v-model:value="formState.delistingQty"
+                                :min="0"
+                                style="width: 260px !important" />
+                <span class="input-enumdicname">{{selectedRow.enumdicname}}</span>
+              </a-form-item>
+            </a-col>
+            <a-col :span="24">
+              <a-form-item label="履约保证金"
+                           name="margin">
+                <a-input-number class="commonInput"
+                                v-model:value="formState.margin"
+                                :min="0"
+                                style="width: 260px" />
+                <span class="input-enumdicname">%</span>
+              </a-form-item>
+            </a-col>
+            <a-col :span="24">
+              <a-form-item label="交收月"
+                           name="DeliveryMonth">
+                <a-month-picker style="width: 140px"
+                                v-model:value="formState.DeliveryMonth"
+                                :allowClear="'false'"
+                                class="commonDatePicker dialogDatePicker" />
+              </a-form-item>
+            </a-col>
+            <a-col :span="24">
+              <a-form-item label="挂牌有效期"
+                           name="vidaliteTime"
+                           class="inputIconBox">
+                <a-date-picker style="width: 260px"
+                               v-model:value="formState.vidaliteTime"
+                               :allowClear="false"
+                               class="commonDatePicker dialogDatePicker" />
+              </a-form-item>
+            </a-col>
 
-                        <a-col :span="24">
-                            <a-form-item label="履约方式" class="inputIconBox">
-                                <span
-                                    class="clickBox"
-                                    @click="openPermance"
-                                >{{formState.permanceTempName ? formState.permanceTempName : '选择履约模板'}}</span>
-                                <svg
-                                    class="icon svg-icon"
-                                    aria-hidden="true"
-                                    @click="openPermance"
-                                >
-                                    <use xlink:href="#icon-moban" />
-                                </svg>
-                            </a-form-item>
-                        </a-col>
-                        <a-col :span="24">
-                            <a-form-item label="指定朋友" class="inputIconBox">
-                                <span
-                                    class="clickBox"
-                                    @click="openFriend"
-                                >{{getFriendLength() ? `已选${getFriendLength() }人` : '选择朋友'}}</span>
-                                <svg class="icon svg-icon" aria-hidden="true" @click="openFriend">
-                                    <use xlink:href="#icon-pengyou1" />
-                                </svg>
-                                <a-checkbox
-                                    class="commonCheckbox"
-                                    v-model:checked="friendCheck"
-                                    @change="limiteFriends"
-                                >不限</a-checkbox>
-                            </a-form-item>
-                        </a-col>
-                        <a-col :span="24">
-                            <a-form-item label="挂牌金额">
-                                <span class="white ml8">{{getMoney()}}</span>
-                            </a-form-item>
-                        </a-col>
-                        <a-col :span="24">
-                            <a-form-item label="履约保证金">
-                                <span class="white ml8">{{getMargin()}}</span>
-                            </a-form-item>
-                        </a-col>
-                        <a-col :span="24">
-                            <a-form-item label="可用资金">
-                                <span class="white ml8">{{getCanUseMoney(getSelectedAccount())}}</span>
-                            </a-form-item>
-                        </a-col>
-                    </a-row>
-                </div>
-                <a-row :gutter="24">
-                    <a-col :span="24" class="fixedBtns">
-                        <a-form-item class="btnCenter">
-                            <a-button class="listedBtn" @click="submit">买入</a-button>
-                            <a-button class="ml10 cancelBtn" @click="cancel">取消</a-button>
-                        </a-form-item>
-                    </a-col>
-                </a-row>
-            </a-form>
+            <a-col :span="24">
+              <a-form-item label="履约方式"
+                           class="inputIconBox">
+                <span :class="['clickBox', formState.permanceTempName ? 'white' : '']"
+                      @click="openPermance">{{formState.permanceTempName ? formState.permanceTempName : '选择履约模板'}}</span>
+                <svg class="icon svg-icon"
+                     aria-hidden="true"
+                     @click="openPermance">
+                  <use xlink:href="#icon-moban" />
+                </svg>
+              </a-form-item>
+            </a-col>
+            <a-col :span="24">
+              <a-form-item label="指定朋友"
+                           class="inputIconBox">
+                <span :class="['clickBox', getFriendLength() ? 'white' : '']"
+                      @click="openFriend">{{getFriendLength() ? `已选${getFriendLength() }人` : '选择朋友'}}</span>
+                <svg class="icon svg-icon"
+                     aria-hidden="true"
+                     @click="openFriend">
+                  <use xlink:href="#icon-pengyou1" />
+                </svg>
+                <a-checkbox class="commonCheckbox"
+                            v-model:checked="friendCheck"
+                            @change="limiteFriends">不限</a-checkbox>
+              </a-form-item>
+            </a-col>
+            <a-col :span="24">
+              <a-form-item label="挂牌金额">
+                <span class="white ml8">{{getMoney()}}</span>
+              </a-form-item>
+            </a-col>
+            <a-col :span="24">
+              <a-form-item label="履约保证金">
+                <span class="white ml8">{{getMargin()}}</span>
+              </a-form-item>
+            </a-col>
+            <a-col :span="24">
+              <a-form-item label="可用资金">
+                <span class="white ml8">{{getCanUseMoney(getSelectedAccount())}}</span>
+              </a-form-item>
+            </a-col>
+          </a-row>
         </div>
-    </Drawer>
-    <!-- 选择朋友 -->
-    <Friend
-        v-if="showFriend"
-        :friends="formState.friends"
-        @cancel="chooseFriend"
-        @update="chooseFriend"
-    />
-    <!-- 选择履约模板 -->
-    <Permance v-if="showPermance" @cancel="choosePermance" @update="choosePermance" />
+        <a-row :gutter="24">
+          <a-col :span="24"
+                 class="fixedBtns">
+            <a-form-item class="btnCenter">
+              <a-button class="listedBtn"
+                        @click="submit">买入</a-button>
+              <a-button class="ml10 cancelBtn"
+                        @click="cancel">取消</a-button>
+            </a-form-item>
+          </a-col>
+        </a-row>
+      </a-form>
+    </div>
+  </Drawer>
+  <!-- 选择朋友 -->
+  <Friend v-if="showFriend"
+          :friends="formState.friends"
+          @cancel="chooseFriend"
+          @update="chooseFriend" />
+  <!-- 选择履约模板 -->
+  <Permance v-if="showPermance"
+            @cancel="choosePermance"
+            @update="choosePermance" />
 </template>
 
 <script lang="ts">
@@ -174,7 +177,7 @@ import { requestResultLoadingAndInfo } from '@/common/methods/request/resultInfo
 import { getUserId } from '@/services/bus/account';
 import { v3, v4 as uuidv4 } from 'uuid';
 import moment, { Moment } from 'moment';
-import { getMarketRunByTradeMode } from '@/services/bus/market';
+import { getMarketRunByTradeMode, marketIsRun } from '@/services/bus/market';
 import { validateAction } from '@/common/setup/form';
 import { getCanUseMoney } from '@/services/bus/account';
 import { TempWrOrderQuoteDetail } from '@/views/market/spot_trade/components/post_buying/interface';
@@ -183,6 +186,7 @@ import Permance from '@/common/components/permanceTemp/choosePermancePlanTmp.vue
 import { BlocsListingForm } from '@/common/setup/warehouse_receipt_trade/interface';
 import { message } from 'ant-design-vue';
 import { useBlocksPrice, useBlocksNumber, useBlocksAccount, useBlocksMoney, useBlocksFriends, useBlocksPermaceTemp, handleForm } from '@/common/setup/warehouse_receipt_trade/listing';
+import { TradeMode } from '@/common/constants/enumCommon';
 
 export default defineComponent({
     emits: ['cancel', 'update'],
@@ -213,7 +217,11 @@ export default defineComponent({
         // 摘牌数量
         const { numCheck, increaseNumber, decreaseNumber } = useBlocksNumber(formState);
         function submit() {
-            const marketInfo = getMarketRunByTradeMode(17);
+            // 判断是否开市
+            if (!marketIsRun(TradeMode.WarehouseReceiptTrade)) {
+                return;
+            }
+            const marketInfo = getMarketRunByTradeMode(TradeMode.WarehouseReceiptTrade);
             if (marketInfo) {
                 validateAction<BlocsListingForm>(formRef, formState).then((res) => {
                     if (!formState.permanceTempName) {

+ 26 - 25
src/views/market/spot_trade/warehouse_pre_sale/warehouse_pre_sale_floating_price/index.vue

@@ -1,28 +1,28 @@
 <template>
-    <!-- 仓单预售 浮动价预售-->
-    <div class="topTableHeight">
-        <Filter :enumName="name" @buy="buyOpen" @search="search" />
-        <a-table
-            :columns="columns"
-            :class="['srcollYTable', isBottom ? 'condSecondTabTable' : 'condSecondTabTableNoBottom', tableList.length ? 'noPlaceHolder' : 'hasPlaceHolder']"
-            :scroll="{ x: '100%', y: isBottom ? 'calc(100vh- 443px)' : 'calc(100vh - 196px)' }"
-            :pagination="false"
-            :loading="loading"
-            :expandedRowKeys="expandedRowKeys"
-            :customRow="Rowclick"
-            rowKey="key"
-            :data-source="tableList"
-        ></a-table>
-        <!-- 右键 -->
-        <contextMenu :contextMenu="contextMenu" @cancel="closeContext" :list="firstBtn"></contextMenu>
-        <component
-            :is="componentId"
-            v-if="componentId"
-            :enumName="name"
-            :selectedRow="selectedRow"
-            @cancel="closeComponent"
-        ></component>
-    </div>
+  <!-- 仓单预售 浮动价预售-->
+  <div class="topTableHeight">
+    <Filter :enumName="name"
+            @buy="buyOpen"
+            @search="search" />
+    <a-table :columns="columns"
+             :class="['srcollYTable', isBottom ? 'condSecondTabTable' : 'condSecondTabTableNoBottom', tableList.length ? 'noPlaceHolder' : 'hasPlaceHolder']"
+             :scroll="{ x: '100%', y: isBottom ? 'calc(100vh- 443px)' : 'calc(100vh - 196px)' }"
+             :pagination="false"
+             :loading="loading"
+             :expandedRowKeys="expandedRowKeys"
+             :customRow="Rowclick"
+             rowKey="key"
+             :data-source="tableList"></a-table>
+    <!-- 右键 -->
+    <contextMenu :contextMenu="contextMenu"
+                 @cancel="closeContext"
+                 :list="firstBtn"></contextMenu>
+    <component :is="componentId"
+               v-if="componentId"
+               :enumName="name"
+               :selectedRow="selectedRow"
+               @cancel="closeComponent"></component>
+  </div>
 </template>
 
 <script lang="ts">
@@ -35,6 +35,7 @@ import Filter from '../../components/filter/index.vue';
 import { Goods } from '@/services/go/ermcp/goodsInfo/interface';
 import { ref } from 'vue';
 import { getShowBottomValue } from '@/common/config/constrolBottom';
+import Bus from '@/utils/eventBus/index';
 
 export default defineComponent({
     name: EnumRouterName.warehouse_pre_sale_floating_price,
@@ -58,7 +59,7 @@ export default defineComponent({
             };
             queryTable(queryOrderQuote, param);
         };
-
+        Bus.$on('spotTrade', queryTableAction);
         // 表格通用逻辑
         const param: ComposeTableParam = {
             queryFn: queryTableAction,

+ 26 - 24
src/views/market/spot_trade/warehouse_pre_sale/warehouse_pre_sale_price/index.vue

@@ -1,28 +1,28 @@
 <template>
-    <!-- 仓单预售 一口价预售-->
-    <div class="topTableHeight">
-        <Filter :enumName="name" @search="search" @buy="buyOpen" />
-        <a-table
-            :columns="columns"
-            :class="['srcollYTable', isBottom ? 'condSecondTabTable' : 'condSecondTabTableNoBottom', tableList.length ? 'noPlaceHolder' : 'hasPlaceHolder']"
-            :scroll="{ x: '100%', y: isBottom ? 'calc(100vh- 443px)' : 'calc(100vh - 196px)' }"
-            :pagination="false"
-            :loading="loading"
-            :expandedRowKeys="expandedRowKeys"
-            :customRow="Rowclick"
-            rowKey="key"
-            :data-source="tableList"
-        ></a-table>
-        <!-- 右键 -->
-        <contextMenu :contextMenu="contextMenu" @cancel="closeContext" :list="firstBtn"></contextMenu>
-        <component
-            :is="componentId"
-            v-if="componentId"
-            :enumName="name"
-            :selectedRow="selectedRow"
-            @cancel="closeComponent"
-        ></component>
-    </div>
+  <!-- 仓单预售 一口价预售-->
+  <div class="topTableHeight">
+    <Filter :enumName="name"
+            @search="search"
+            @buy="buyOpen" />
+    <a-table :columns="columns"
+             :class="['srcollYTable', isBottom ? 'condSecondTabTable' : 'condSecondTabTableNoBottom', tableList.length ? 'noPlaceHolder' : 'hasPlaceHolder']"
+             :scroll="{ x: '100%', y: isBottom ? 'calc(100vh- 443px)' : 'calc(100vh - 196px)' }"
+             :pagination="false"
+             :loading="loading"
+             :expandedRowKeys="expandedRowKeys"
+             :customRow="Rowclick"
+             rowKey="key"
+             :data-source="tableList"></a-table>
+    <!-- 右键 -->
+    <contextMenu :contextMenu="contextMenu"
+                 @cancel="closeContext"
+                 :list="firstBtn"></contextMenu>
+    <component :is="componentId"
+               v-if="componentId"
+               :enumName="name"
+               :selectedRow="selectedRow"
+               @cancel="closeComponent"></component>
+  </div>
 </template>
 
 <script lang="ts">
@@ -33,6 +33,7 @@ import { queryOrderQuote } from '@/services/go/wrtrade';
 import { handleComposeTable } from '@/views/market/spot_trade/setup';
 import Filter from '../../components/filter/index.vue';
 import { getShowBottomValue } from '@/common/config/constrolBottom';
+import Bus from '@/utils/eventBus/index';
 
 export default defineComponent({
     name: EnumRouterName.warehouse_pre_sale_price,
@@ -56,6 +57,7 @@ export default defineComponent({
             };
             queryTable(queryOrderQuote, param);
         };
+        Bus.$on('spotTrade', queryTableAction);
         // 表格通用逻辑
         const param: ComposeTableParam = {
             queryFn: queryTableAction,

+ 19 - 23
src/views/market/spot_trade/warehouse_receipt_trade/warehouse_receipt_trade_blocs/components/delisting/index.vue

@@ -152,34 +152,26 @@
 </template>
 
 <script lang="ts">
-import { defineComponent, PropType, ref } from 'vue';
 import { Des } from '@/common/components/commonDes';
-import { _closeModal } from '@/common/setup/modal/modal';
-import { ModalEnum } from '@/common/constants/modalNameEnum';
 import Drawer from '@/common/components/drawer/index.vue';
-import { PlusOutlined, MinusOutlined } from '@ant-design/icons-vue';
-import { hdWROrder } from '@/services/proto/warehousetrade';
+import { BuyOrSell, TradeMode } from '@/common/constants/enumCommon';
 import { requestResultLoadingAndInfo } from '@/common/methods/request/resultInfo';
-import { DGFactoryItems, HdWRDealOrderReq, WrBargainApplyReq, WRGoodsInfo } from '@/services/proto/warehousetrade/interface';
-import { getAccountTypeList, getSelectedAccountId, getUserId } from '@/services/bus/account';
-import { v4 as uuidv4 } from 'uuid';
-import moment, { Moment } from 'moment';
-import { getMarketRunByTradeMode } from '@/services/bus/market';
-import { QueryOrderQuoteMyqQsp, WrOrderQuote } from '@/services/go/wrtrade/interface';
-
 import { validateAction } from '@/common/setup/form';
-
-import { EnumRouterName } from '@/common/constants/enumRouterName';
-
-import { BuyOrSell } from '@/common/constants/enumCommon';
-import { getCanUseMoney } from '@/services/bus/account';
-import { TempWrOrderQuoteDetail } from '@/views/market/spot_trade/components/post_buying/interface';
-import { handleForm, handleSpotWarrant } from './setup';
+import { _closeModal } from '@/common/setup/modal/modal';
+import { getAccountTypeList, getCanUseMoney, getSelectedAccountId, getUserId } from '@/services/bus/account';
+import { marketIsRun } from '@/services/bus/market';
 import { getRules } from '@/services/bus/rules';
-import { ListingForm } from './interface';
+import { QueryOrderQuoteMyqQsp } from '@/services/go/wrtrade/interface';
 import { HdWRDealOrder, wrBargainApply } from '@/services/proto/warehousetrade';
-import Long from 'long';
+import { WrBargainApplyReq } from '@/services/proto/warehousetrade/interface';
 import Bus from '@/utils/eventBus';
+import { MinusOutlined, PlusOutlined } from '@ant-design/icons-vue';
+import Long from 'long';
+import moment from 'moment';
+import { v4 as uuidv4 } from 'uuid';
+import { defineComponent, PropType, ref } from 'vue';
+import { ListingForm } from './interface';
+import { handleForm, handleSpotWarrant } from './setup';
 
 export default defineComponent({
     emits: ['cancel', 'update'],
@@ -224,7 +216,7 @@ export default defineComponent({
             const price = getPrice();
             const num = getNum();
             if (price) {
-                return (price * num).toFixed(2);
+                return Math.round(price * num * 100) / 100;
             } else {
                 return '--';
             }
@@ -238,7 +230,7 @@ export default defineComponent({
             if (price && num && marginvalue) {
                 result = price * num * marginvalue;
             }
-            return result ? Math.floor(2) : '--';
+            return result ? Math.round(result * 100) / 100 : '--';
         }
         function getMaxNum() {
             const qty = props.selectedRow.orderqty;
@@ -279,6 +271,10 @@ export default defineComponent({
         }
 
         function submit() {
+            // 判断是否开市
+            if (!marketIsRun(TradeMode.WarehouseReceiptTrade)) {
+                return;
+            }
             validateAction<ListingForm>(formRef, formState).then((res) => {
                 const price = getPrice();
                 const num = getNum();

+ 155 - 154
src/views/market/spot_trade/warehouse_receipt_trade/warehouse_receipt_trade_blocs/components/post-buying/index.vue

@@ -1,159 +1,155 @@
 <template>
-  <!--仓单贸易 贸易圈挂牌 挂牌求购 -->
-  <Drawer :title="'挂牌求购'"
-          :placement="'right'"
-          :visible="visible"
-          @cancel="cancel"
-          class="top486">
-    <div class="post_buying">
-      <a-form class="inlineForm dialogForm"
-              ref="formRef"
-              :model="formState"
-              :rules="rules">
-        <div class="formBar">
-          <a-row :gutter="24">
-            <a-col :span="24">
-              <a-form-item label="交易账户"
-                           name="accountid">
-                <a-select class="inlineFormSelect"
-                          style="width: 260px"
-                          v-model:value="formState.accountid"
-                          placeholder="请选择">
-                  <a-select-option v-for="item in accountList"
-                                   :value="item.accountid"
-                                   :key="item.accountid">{{item.accountid}}</a-select-option>
-                </a-select>
-              </a-form-item>
-            </a-col>
-            <a-col :span="24">
-              <a-form-item label="挂牌价格"
-                           name="FixedPrice"
-                           class="inputIconBox">
-                <a-input-number class="commonInput"
-                                style="width: 260px"
-                                :min="0"
-                                v-model:value="formState.FixedPrice" />
-                <MinusOutlined @click="decreasePrice" />
-                <PlusOutlined @click="increasePrice" />
-                <a-checkbox class="commonCheckbox"
-                            v-model:checked="priceCheck">可议价</a-checkbox>
-              </a-form-item>
-            </a-col>
-            <a-col :span="24">
-              <a-form-item label="挂牌数量"
-                           name="OrderQty"
-                           class="inputIconBox">
-                <a-input-number class="commonInput"
-                                style="width: 260px"
-                                :min="0"
-                                v-model:value="formState.OrderQty" />
-                <MinusOutlined @click="decreaseNumber" />
-                <PlusOutlined @click="increaseNumber" />
-                <span class="input-enumdicname">{{selectedRow.enumdicname}}</span>
-                <a-checkbox v-model:checked="numCheck"
-                            class="commonCheckbox">整单</a-checkbox>
-              </a-form-item>
-            </a-col>
+    <!--仓单贸易 贸易圈挂牌 挂牌求购 -->
+    <Drawer :title="'挂牌求购'" :placement="'right'" :visible="visible" @cancel="cancel" class="top486">
+        <div class="post_buying">
+            <a-form class="inlineForm dialogForm" ref="formRef" :model="formState" :rules="rules">
+                <div class="formBar">
+                    <a-row :gutter="24">
+                        <a-col :span="24">
+                            <a-form-item label="交易账户" name="accountid">
+                                <a-select
+                                    class="inlineFormSelect"
+                                    style="width: 260px"
+                                    v-model:value="formState.accountid"
+                                    placeholder="请选择"
+                                >
+                                    <a-select-option
+                                        v-for="item in accountList"
+                                        :value="item.accountid"
+                                        :key="item.accountid"
+                                    >{{item.accountid}}</a-select-option>
+                                </a-select>
+                            </a-form-item>
+                        </a-col>
+                        <a-col :span="24">
+                            <a-form-item label="挂牌价格" name="FixedPrice" class="inputIconBox">
+                                <a-input-number
+                                    class="commonInput"
+                                    style="width: 260px"
+                                    :min="0"
+                                    v-model:value="formState.FixedPrice"
+                                />
+                                <MinusOutlined @click="decreasePrice" />
+                                <PlusOutlined @click="increasePrice" />
+                                <a-checkbox class="commonCheckbox" v-model:checked="priceCheck">可议价</a-checkbox>
+                            </a-form-item>
+                        </a-col>
+                        <a-col :span="24">
+                            <a-form-item label="挂牌数量" name="OrderQty" class="inputIconBox">
+                                <a-input-number
+                                    class="commonInput"
+                                    style="width: 260px"
+                                    :min="0"
+                                    v-model:value="formState.OrderQty"
+                                />
+                                <MinusOutlined @click="decreaseNumber" />
+                                <PlusOutlined @click="increaseNumber" />
+                                <span class="input-enumdicname">{{selectedRow.enumdicname}}</span>
+                                <a-checkbox v-model:checked="numCheck" class="commonCheckbox">整单</a-checkbox>
+                            </a-form-item>
+                        </a-col>
 
-            <a-col :span="24"
-                   v-if="!numCheck">
-              <a-form-item label="起摘数量"
-                           name="delistingQty">
-                <a-input-number class="commonInput"
-                                v-model:value="formState.delistingQty"
-                                :min="0"
-                                style="width: 260px !important" />
-                <span class="input-enumdicname">{{selectedRow.enumdicname}}</span>
-              </a-form-item>
-            </a-col>
-            <a-col :span="24">
-              <a-form-item label="履约保证金"
-                           name="margin">
-                <a-input-number class="commonInput"
-                                v-model:value="formState.margin"
-                                :min="0"
-                                style="width: 260px" />
-                <span class="input-enumdicname">%</span>
-              </a-form-item>
-            </a-col>
-            <a-col :span="24">
-              <a-form-item label="挂牌有效期"
-                           name="vidaliteTime"
-                           class="inputIconBox">
-                <a-date-picker style="width: 260px"
-                               v-model:value="formState.vidaliteTime"
-                               :allowClear="false"
-                               class="commonDatePicker dialogDatePicker" />
-              </a-form-item>
-            </a-col>
+                        <a-col :span="24" v-if="!numCheck">
+                            <a-form-item label="起摘数量" name="delistingQty">
+                                <a-input-number
+                                    class="commonInput"
+                                    v-model:value="formState.delistingQty"
+                                    :min="0"
+                                    style="width: 260px !important"
+                                />
+                                <span class="input-enumdicname">{{selectedRow.enumdicname}}</span>
+                            </a-form-item>
+                        </a-col>
+                        <a-col :span="24">
+                            <a-form-item label="履约保证金" name="margin">
+                                <a-input-number
+                                    class="commonInput"
+                                    v-model:value="formState.margin"
+                                    :min="0"
+                                    style="width: 260px"
+                                />
+                                <span class="input-enumdicname">%</span>
+                            </a-form-item>
+                        </a-col>
+                        <a-col :span="24">
+                            <a-form-item label="挂牌有效期" name="vidaliteTime" class="inputIconBox">
+                                <a-date-picker
+                                    style="width: 260px"
+                                    v-model:value="formState.vidaliteTime"
+                                    :allowClear="false"
+                                    class="commonDatePicker dialogDatePicker"
+                                />
+                            </a-form-item>
+                        </a-col>
 
-            <a-col :span="24">
-              <a-form-item label="履约方式"
-                           class="inputIconBox">
-                <span class="clickBox"
-                      @click="openPermance">{{formState.permanceTempName ? formState.permanceTempName : '选择履约模板'}}</span>
-                <svg class="icon svg-icon"
-                     aria-hidden="true"
-                     @click="openPermance">
-                  <use xlink:href="#icon-moban" />
-                </svg>
-              </a-form-item>
-            </a-col>
-            <a-col :span="24">
-              <a-form-item label="指定朋友"
-                           class="inputIconBox">
-                <span class="clickBox"
-                      @click="openFriend">{{getFriendLength() ? `已选${getFriendLength() }人` : '选择朋友'}}</span>
-                <svg class="icon svg-icon"
-                     aria-hidden="true"
-                     @click="openFriend">
-                  <use xlink:href="#icon-pengyou1" />
-                </svg>
-                <a-checkbox class="commonCheckbox"
-                            v-model:checked="friendCheck"
-                            @change="limiteFriends">不限</a-checkbox>
-              </a-form-item>
-            </a-col>
-            <a-col :span="24">
-              <a-form-item label="挂牌金额">
-                <span class="white ml8">{{getMoney()}}</span>
-              </a-form-item>
-            </a-col>
-            <a-col :span="24">
-              <a-form-item label="履约保证金">
-                <span class="white ml8">{{getMargin()}}</span>
-              </a-form-item>
-            </a-col>
-            <a-col :span="24">
-              <a-form-item label="可用资金">
-                <span class="white ml8">{{getCanUseMoney(getSelectedAccount())}}</span>
-              </a-form-item>
-            </a-col>
-          </a-row>
+                        <a-col :span="24">
+                            <a-form-item label="履约方式" class="inputIconBox">
+                                <span
+                                    :class="['clickBox', formState.permanceTempName ? 'white' : '']"
+                                    @click="openPermance"
+                                >{{formState.permanceTempName ? formState.permanceTempName : '选择履约模板'}}</span>
+                                <svg
+                                    class="icon svg-icon"
+                                    aria-hidden="true"
+                                    @click="openPermance"
+                                >
+                                    <use xlink:href="#icon-moban" />
+                                </svg>
+                            </a-form-item>
+                        </a-col>
+                        <a-col :span="24">
+                            <a-form-item label="指定朋友" class="inputIconBox">
+                                <span
+                                    :class="['clickBox', getFriendLength() ? 'white' : '']"
+                                    @click="openFriend"
+                                >{{getFriendLength() ? `已选${getFriendLength() }人` : '选择朋友'}}</span>
+                                <svg class="icon svg-icon" aria-hidden="true" @click="openFriend">
+                                    <use xlink:href="#icon-pengyou1" />
+                                </svg>
+                                <a-checkbox
+                                    class="commonCheckbox"
+                                    v-model:checked="friendCheck"
+                                    @change="limiteFriends"
+                                >不限</a-checkbox>
+                            </a-form-item>
+                        </a-col>
+                        <a-col :span="24">
+                            <a-form-item label="挂牌金额">
+                                <span class="white ml8">{{getMoney()}}</span>
+                            </a-form-item>
+                        </a-col>
+                        <a-col :span="24">
+                            <a-form-item label="履约保证金">
+                                <span class="white ml8">{{getMargin()}}</span>
+                            </a-form-item>
+                        </a-col>
+                        <a-col :span="24">
+                            <a-form-item label="可用资金">
+                                <span class="white ml8">{{getCanUseMoney(getSelectedAccount())}}</span>
+                            </a-form-item>
+                        </a-col>
+                    </a-row>
+                </div>
+                <a-row :gutter="24">
+                    <a-col :span="24" class="fixedBtns">
+                        <a-form-item class="btnCenter">
+                            <a-button class="listedBtn" @click="submit">买入</a-button>
+                            <a-button class="ml10 cancelBtn" @click="cancel">取消</a-button>
+                        </a-form-item>
+                    </a-col>
+                </a-row>
+            </a-form>
         </div>
-        <a-row :gutter="24">
-          <a-col :span="24"
-                 class="fixedBtns">
-            <a-form-item class="btnCenter">
-              <a-button class="listedBtn"
-                        @click="submit">买入</a-button>
-              <a-button class="ml10 cancelBtn"
-                        @click="cancel">取消</a-button>
-            </a-form-item>
-          </a-col>
-        </a-row>
-      </a-form>
-    </div>
-  </Drawer>
-  <!-- 选择朋友 -->
-  <Friend v-if="showFriend"
-          :friends=formState.friends
-          @cancel="chooseFriend"
-          @update="chooseFriend" />
-  <!-- 选择履约模板 -->
-  <Permance v-if="showPermance"
-            @cancel="choosePermance"
-            @update="choosePermance" />
+    </Drawer>
+    <!-- 选择朋友 -->
+    <Friend
+        v-if="showFriend"
+        :friends="formState.friends"
+        @cancel="chooseFriend"
+        @update="chooseFriend"
+    />
+    <!-- 选择履约模板 -->
+    <Permance v-if="showPermance" @cancel="choosePermance" @update="choosePermance" />
 </template>
 
 <script lang="ts">
@@ -168,7 +164,7 @@ import { requestResultLoadingAndInfo } from '@/common/methods/request/resultInfo
 import { getUserId } from '@/services/bus/account';
 import { v3, v4 as uuidv4 } from 'uuid';
 import moment, { Moment } from 'moment';
-import { getMarketRunByTradeMode } from '@/services/bus/market';
+import { getMarketRunByTradeMode, marketIsRun } from '@/services/bus/market';
 import { validateAction } from '@/common/setup/form';
 import { getCanUseMoney } from '@/services/bus/account';
 import { TempWrOrderQuoteDetail } from '@/views/market/spot_trade/components/post_buying/interface';
@@ -178,6 +174,7 @@ import { message } from 'ant-design-vue';
 import { useBlocksPrice, useBlocksNumber, useBlocksAccount, useBlocksMoney, useBlocksFriends, useBlocksPermaceTemp, handleForm } from '@/common/setup/warehouse_receipt_trade/listing';
 
 import { BlocsListingForm } from '@/common/setup/warehouse_receipt_trade/interface';
+import { TradeMode } from '@/common/constants/enumCommon';
 
 export default defineComponent({
     emits: ['cancel', 'update'],
@@ -203,7 +200,11 @@ export default defineComponent({
         // 摘牌数量
         const { numCheck, increaseNumber, decreaseNumber } = useBlocksNumber(formState);
         function submit() {
-            const marketInfo = getMarketRunByTradeMode(17);
+            // 判断是否开市
+            if (!marketIsRun(TradeMode.WarehouseReceiptTrade)) {
+                return;
+            }
+            const marketInfo = getMarketRunByTradeMode(TradeMode.WarehouseReceiptTrade);
             if (marketInfo) {
                 validateAction<BlocsListingForm>(formRef, formState).then((res) => {
                     if (!formState.permanceTempName) {

+ 26 - 24
src/views/market/spot_trade/warehouse_receipt_trade/warehouse_receipt_trade_floating_price/index.vue

@@ -1,28 +1,28 @@
 <template>
-    <!-- 仓单贸易 浮动价挂牌-->
-    <div class="topTableHeight">
-        <Filter :enumName="name" @search="search" @buy="buyOpen" />
-        <a-table
-            :columns="columns"
-            :class="['srcollYTable', isBottom ? 'condSecondTabTable' : 'condSecondTabTableNoBottom', tableList.length ? 'noPlaceHolder' : 'hasPlaceHolder']"
-            :scroll="{ x: '100%', y: isBottom ? 'calc(100vh- 443px)' : 'calc(100vh - 196px)' }"
-            :pagination="false"
-            :loading="loading"
-            :expandedRowKeys="expandedRowKeys"
-            :customRow="Rowclick"
-            rowKey="key"
-            :data-source="tableList"
-        ></a-table>
-        <!-- 右键 -->
-        <contextMenu :contextMenu="contextMenu" @cancel="closeContext" :list="firstBtn"></contextMenu>
-        <component
-            :is="componentId"
-            v-if="componentId"
-            :enumName="name"
-            :selectedRow="selectedRow"
-            @cancel="closeComponent"
-        ></component>
-    </div>
+  <!-- 仓单贸易 浮动价挂牌-->
+  <div class="topTableHeight">
+    <Filter :enumName="name"
+            @search="search"
+            @buy="buyOpen" />
+    <a-table :columns="columns"
+             :class="['srcollYTable', isBottom ? 'condSecondTabTable' : 'condSecondTabTableNoBottom', tableList.length ? 'noPlaceHolder' : 'hasPlaceHolder']"
+             :scroll="{ x: '100%', y: isBottom ? 'calc(100vh- 443px)' : 'calc(100vh - 196px)' }"
+             :pagination="false"
+             :loading="loading"
+             :expandedRowKeys="expandedRowKeys"
+             :customRow="Rowclick"
+             rowKey="key"
+             :data-source="tableList"></a-table>
+    <!-- 右键 -->
+    <contextMenu :contextMenu="contextMenu"
+                 @cancel="closeContext"
+                 :list="firstBtn"></contextMenu>
+    <component :is="componentId"
+               v-if="componentId"
+               :enumName="name"
+               :selectedRow="selectedRow"
+               @cancel="closeComponent"></component>
+  </div>
 </template>
 
 <script lang="ts">
@@ -34,6 +34,7 @@ import { handleComposeTable } from '@/views/market/spot_trade/setup';
 import Filter from '../../components/filter/index.vue';
 import { Goods } from '@/services/go/ermcp/goodsInfo/interface';
 import { getShowBottomValue } from '@/common/config/constrolBottom';
+import Bus from '@/utils/eventBus/index';
 
 export default defineComponent({
     name: EnumRouterName.warehouse_receipt_trade_floating_price,
@@ -57,6 +58,7 @@ export default defineComponent({
             };
             queryTable(queryOrderQuote, param);
         };
+        Bus.$on('spotTrade', queryTableAction);
         // 表格通用逻辑
         const param: ComposeTableParam = {
             queryFn: queryTableAction,

+ 5 - 1
src/views/order/commodity_contract/components/commodity_contract_summary/index.vue

@@ -27,13 +27,17 @@
       <template #lastprice="{ record }">
         <a>{{ getLastprice(record) }}</a>
       </template>
+      <!-- 均价 -->
+      <template #averageprice="{ text }">
+        <a>{{ text ? text : 0 }}</a>
+      </template>
       <!-- 持仓金额  -->
       <template #holderprice="{ record }">
         <a>{{ useHolderprice(record) }}</a>
       </template>
       <!-- 持仓盈亏 -->
       <template #profitloss="{ record }">
-        <a>{{ useProfitloss(record) }}</a>
+        <span>{{ record.averageprice ? useProfitloss(record) : '--' }}</span>
       </template>
     </a-table>
     <component :is="componentId"

+ 21 - 3
src/views/order/financing_manager/components/financing_manager_apply_order/index.vue

@@ -10,7 +10,7 @@
              :customRow="Rowclick"
              :expandIcon="expandIcon"
              :expandIconAsCell="false"
-             rowKey="key"
+             rowKey="financeapplyid"
              :data-source="tableList">
       <!-- 额外的展开行 -->
       <template v-if="btnList.length"
@@ -39,7 +39,7 @@
       </template>
       <!-- 费用 -->
       <template #interestsettlevalue="{ record }">
-        <a>{{ getInterestrateModeName(record.interestratemode, record.interestrate) }}</a>
+        <a>{{ getInterestrateModeName(record.interestratemode, record.interestrate, record.enumdicname) }}</a>
       </template>
     </a-table>
     <component :is="componentId"
@@ -72,9 +72,27 @@ export default defineComponent({
     setup() {
         // 表格列表数据
         const { loading, tableList, queryTable } = queryTableList<WrFinanceBuyApply>();
+        function sortTime<T extends object>(arr: T[], key: keyof T, isUp = true) {
+            const result = arr.sort((a, b) => {
+                const time1 = new Date((a[key] as unknown) as string).getTime();
+                const time2 = new Date((b[key] as unknown) as string).getTime();
+                return isUp ? time1 - time2 : time2 - time1;
+            });
+            return result;
+        }
         // 获取列表数据
         const queryTableAction = () => {
-            queryTable(queryWrFinanceBuyApply);
+            queryTable(queryWrFinanceBuyApply).then((res) => {
+                const arr = res.map((e) => {
+                    return { ...e, key: e.financeapplyid };
+                });
+                const waiting = arr.filter((e) => e.applystatus === 1);
+                const other = arr.filter((e) => e.applystatus !== 1);
+                // 时间 倒序排序
+                const sortWaiting = sortTime<WrFinanceBuyApply>(waiting, 'applydate', false);
+                const sortOther = sortTime<WrFinanceBuyApply>(other, 'applydate', false);
+                tableList.value = [...sortWaiting, ...sortOther];
+            });
         };
         // 表格通用逻辑
         const param: ComposeOrderTableParam = {

+ 17 - 6
src/views/order/funding_information/components/funding_information_funding_summary/setup.ts

@@ -1,5 +1,6 @@
 import APP from '@/services';
 import { useHolderprice, useProfitloss } from '@/services/bus/holdPosition';
+import { getMarketTradePropertyByGoodsId } from '@/services/bus/market';
 import { QueryTradePositionRsp } from '@/services/go/ermcp/order/interface';
 import { Taaccount } from '@/services/go/TaAccount/interface';
 import { Systemparam } from '@/services/go/useInfo/interface';
@@ -105,7 +106,7 @@ export const useHazardRates = (positions: Ref<QueryTradePositionRsp[]>) => {
         return positions.value.length > 0 ? positions.value[0].decimalplace : 2
     }
     // 获取系统参数
-    const getSystemParam = (paramcode: string, value: string) => APP.getRef('systemParams').value.find((param: Systemparam) => param.paramcode)?.paramvalue === value
+    const getSystemParam = (paramcode: string, value: string) => APP.getRef('systemParams').value.find((param: Systemparam) => param.paramcode === paramcode)?.paramvalue === value
     // 获取当前资金账号对应的头寸
     function getTaaccountPosition(accountid: number) {
         return positions.value.filter(e => e.accountid === accountid)
@@ -114,8 +115,13 @@ export const useHazardRates = (positions: Ref<QueryTradePositionRsp[]>) => {
     function handleProfitloss({ accountid }: Taaccount, isDecimalPace = true) {
         const decimalplace = getDecimalplace()
         const result = getTaaccountPosition(accountid).reduce((acc: number, current: QueryTradePositionRsp) => {
-            const profitloos = useProfitloss(current)
-            const temp = profitloos === '--' ? 0 : Number(profitloos)
+            const tradeproperty = getMarketTradePropertyByGoodsId(current.goodsid)
+            let temp = 0
+            if (tradeproperty === 1) {
+                // 资金 只算 收益权
+                const profitloos = useProfitloss(current)
+                temp = profitloos === '--' ? 0 : Number(profitloos)
+            }
             return acc + temp
         }, 0)
         return isDecimalPace ? result.toFixed(decimalplace) : result
@@ -141,15 +147,20 @@ export const useHazardRates = (positions: Ref<QueryTradePositionRsp[]>) => {
         // 1. 风险净值=期末余额+市值+浮动盈亏(收益权)-其他冻结-出金冻结
         return currentbalance + price + profitloss - otherfreezemargin - outamountfreeze
     }
-    // 净值期 末余额+市值+浮动盈亏(收益权
+    // 净值
+    // 根据系统参数“307 账户净值是否减冻结资金 - 0:不减 1:减“
+    //0.净值=期末余额+市值+浮动盈亏(收益权)
+    //1.净值=期末余额+市值+浮动盈亏(收益权)-其他冻结-出金冻结
     function netWorth(taaccount: Taaccount) {
-        const { accountid, currentbalance } = taaccount
+        const { accountid, currentbalance, otherfreezemargin, outamountfreeze } = taaccount
         // 浮动盈亏
+        const free = getSystemParam('037', '1') ? (otherfreezemargin + outamountfreeze) : 0
+
         const profitloss = handleProfitloss(taaccount, false) as number
         // 市值
         const price = handleHoldPrice(accountid)
         const decimalplace = getDecimalplace()
-        return (currentbalance + profitloss + price).toFixed(decimalplace)
+        return (currentbalance + profitloss + price - free).toFixed(decimalplace)
     }
     // 风险率
     function hazardRates(taaccount: Taaccount) {

+ 78 - 44
src/views/order/pre_sale_warehouse_receipt/components/pre_sale_warehouse_receipt_bargain/components/bargain_detail/index.vue

@@ -9,13 +9,22 @@
       <a-form class="inlineForm dialogForm">
         <div class="formBar">
           <a-table :columns="columns"
-                   class="dialogTable dialogTable2"
+                   class="dialogTable dialogTable2 expandLeftTable"
                    :pagination="false"
                    :expandIcon="expandIcon"
+                   :expandedRowKeys="expandedRowKeys"
                    :loading="loading"
+                   :customRow="Rowclick"
                    :expandIconAsCell="false"
-                   rowKey="applyprice"
+                   rowKey="key"
                    :data-source="tableList">
+            <!-- 额外的展开行 -->
+            <template #expandedRowRender="{ record }">
+              <BtnList :btnList="handleBtnList(record)"
+                       class="btn-list-sticky"
+                       :record="record"
+                       @click="action" />
+            </template>
             <template #applystatus="{ text }">
               <span>{{ getBarmaginApplyStatus(text) }}</span>
             </template>
@@ -23,20 +32,12 @@
         </div>
         <a-row :gutter="24"
                type="flex"
-               justify="center"
-               v-if="isShowBtn()">
+               justify="center">
           <a-col :span="24"
                  class="fixedBtns">
             <a-form-item class="btnCenter">
               <a-button class="cancelBtn"
-                        v-if="isMy()"
-                        @click="cancelAction">撤销</a-button>
-              <template v-else>
-                <a-button class="listedBtn ml10"
-                          @click="submit">确认</a-button>
-                <a-button class="ml10 cancelBtn"
-                          @click="refuse">拒绝</a-button>
-              </template>
+                        @click="cancel">取消</a-button>
             </a-form-item>
           </a-col>
         </a-row>
@@ -46,45 +47,56 @@
 </template>
 
 <script lang="ts">
-import { defineComponent, PropType, ref } from 'vue';
-import { enumOrderComponents } from '@/common/constants/enumOrderComponents';
+import { BtnListType } from '@/common/components/btnList/interface';
 import Drawer from '@/common/components/drawer/index.vue';
-import { QueryWrPositionReq, QueryWrTradeBargainApplyReq, QueryWrTradeBargainApplyQsp, WrPosition } from '@/services/go/wrtrade/interface';
-import { getUserId } from '@/services/bus/account';
+import { getBarmaginApplyStatus } from '@/common/constants/enumsName';
+import { BtnList, ModalEnum, queryTableList } from '@/common/export/commonTable';
 import { requestResultLoadingAndInfo } from '@/common/methods/request/resultInfo';
-import { hdWROrder } from '@/services/proto/warehousetrade';
-import { v4 as uuidv4 } from 'uuid';
-import moment from 'moment';
-import { ModalEnum } from '@/common/constants/modalNameEnum';
-import { queryTableList } from '@/common/setup/table';
-import { queryQueryWrTradeBargainApply } from '@/services/go/wrtrade';
-import { getSpotWarrantBargainDetailColumns } from '../../setup';
-import { wrBargainNoAgree, wrBargainBack } from '@/services/proto/WrBargain';
 import { _closeModal } from '@/common/setup/modal/modal';
+import { getTableEvent } from '@/common/setup/table';
+import { expandIcon } from '@/common/setup/table/clolumn';
+import { queryQueryWrTradeBargainApply } from '@/services/go/wrtrade';
+import { QueryWrTradeBargainApplyQsp, QueryWrTradeBargainApplyReq, WrOrderDetail } from '@/services/go/wrtrade/interface';
+import { wrBargainBack, wrBargainNoAgree } from '@/services/proto/WrBargain';
 import { WrBargainBackReq, WrBargainNoAgreeReq } from '@/services/proto/WrBargain/interface';
 import Long from 'long';
-import { getBarmaginApplyStatus } from '@/common/constants/enumsName';
+import { defineComponent, PropType, ref } from 'vue';
+import { getSpotWarrantBargainDetailColumns } from '../../setup';
 
 export default defineComponent({
     name: ModalEnum.spot_warrant_bargain_detail,
-    components: { Drawer },
+    components: { Drawer, BtnList },
     emits: ['cancel', 'update'],
     props: {
         selectedRow: {
-            type: Object as PropType<QueryWrTradeBargainApplyQsp>,
+            type: Object as PropType<QueryWrTradeBargainApplyQsp | WrOrderDetail>,
             default: {},
         },
+        isMy: {
+            type: Boolean,
+            default: true,
+        },
     },
     setup(props, context) {
         // 表格列表数据
         const { loading, tableList, queryTable } = queryTableList<QueryWrTradeBargainApplyQsp>();
         const { visible, cancel } = _closeModal(context);
-        const { wrbargainid } = props.selectedRow;
         const param: QueryWrTradeBargainApplyReq = {
-            haswr: 0,
+            haswr: 1,
             wrtradeorderid: props.selectedRow.wrtradeorderid,
         };
-        // 判断是否有 待确认 状态的 数据,如果有需要显示操作按钮,没就无操作按钮
+        queryTable(queryQueryWrTradeBargainApply, param).then((res) => {
+            const arr = res.map((el) => {
+                return Object.assign(el, { key: el.wrbargainid });
+            });
+            // 时间 倒序排序
+            tableList.value = arr.sort((a, b) => {
+                const time1 = new Date(a.applytime).getTime();
+                const time2 = new Date(b.applytime).getTime();
+                return time2 - time1;
+            });
+        });
+
         function isShowBtn() {
             let result = false;
             tableList.value.forEach((el) => {
@@ -94,19 +106,37 @@ export default defineComponent({
             });
             return result;
         }
-        queryTable(queryQueryWrTradeBargainApply, param).then((res) => {
-            // 时间 倒序排序
-            tableList.value = res.sort((a, b) => {
-                const time1 = new Date(a.applytime).getTime();
-                const time2 = new Date(b.applytime).getTime();
-                return time2 - time1;
-            });
-        });
         // 我对别人的 => 撤销
         // 别人对我的 => 确认、拒绝
-        const { isMy, getColums } = getSpotWarrantBargainDetailColumns(props.selectedRow);
+        const { getColums, isMy } = getSpotWarrantBargainDetailColumns(props.isMy);
+        function handleBtnList(record: QueryWrTradeBargainApplyQsp) {
+            const result = ref<BtnListType[]>([]);
+            if (isMy()) {
+                result.value = [{ lable: '撤销', code: 'cancel', className: 'btnDanger' }];
+            } else {
+                result.value = [
+                    { lable: '确认', code: 'submit', className: 'operBtn' },
+                    { lable: '拒绝', code: 'refuse', className: 'btnDanger' },
+                ];
+            }
+            return record.applystatus === 1 ? result.value : [];
+        }
+        function action({ code }: BtnListType, { wrbargainid }: QueryWrTradeBargainApplyQsp) {
+            switch (code) {
+                case 'cancel':
+                    cancelAction(wrbargainid);
+                    break;
+                case 'submit':
+                    submit(wrbargainid);
+                    break;
+                case 'refuse':
+                    refuse(wrbargainid);
+                    break;
+            }
+        }
+
         // 确认
-        function submit() {
+        function submit(wrbargainid: string) {
             const param: WrBargainNoAgreeReq = {
                 WrBargainID: Long.fromString(wrbargainid),
                 Status: 1,
@@ -116,7 +146,7 @@ export default defineComponent({
             });
         }
         // 拒绝
-        function refuse() {
+        function refuse(wrbargainid: string) {
             const param: WrBargainNoAgreeReq = {
                 WrBargainID: Long.fromString(wrbargainid),
                 Status: 2,
@@ -126,7 +156,7 @@ export default defineComponent({
             });
         }
         // 撤销
-        function cancelAction() {
+        function cancelAction(wrbargainid: string) {
             const param: WrBargainBackReq = {
                 WrBargainID: Long.fromString(wrbargainid),
             };
@@ -135,17 +165,21 @@ export default defineComponent({
             });
         }
         return {
-            visible: true,
+            visible,
             columns: getColums(),
             loading,
             tableList,
             isMy,
             submit,
             refuse,
-            cancel,
             cancelAction,
+            cancel,
             getBarmaginApplyStatus,
             isShowBtn,
+            handleBtnList,
+            action,
+            expandIcon,
+            ...getTableEvent<QueryWrTradeBargainApplyQsp>(),
         };
     },
 });

+ 2 - 4
src/views/order/pre_sale_warehouse_receipt/components/pre_sale_warehouse_receipt_bargain/setup.ts

@@ -1,5 +1,3 @@
-import { getUserId } from "@/services/bus/account";
-import { QueryWrTradeBargainApplyQsp } from "@/services/go/wrtrade/interface";
 
 export function getSpotWarrantBargainColumns() {
     const columns = [
@@ -25,7 +23,7 @@ export function getSpotWarrantBargainColumns() {
     })
 }
 
-export function getSpotWarrantBargainDetailColumns(selectedRow: QueryWrTradeBargainApplyQsp) {
+export function getSpotWarrantBargainDetailColumns(is: boolean) {
     const columns = [
         { title: '数量', key: 'applyqty', dataIndex: 'applyqty', align: 'center' },
         { title: '价格', key: 'applyprice', dataIndex: 'applyprice', align: 'center' },
@@ -33,7 +31,7 @@ export function getSpotWarrantBargainDetailColumns(selectedRow: QueryWrTradeBarg
         { title: '状态', key: 'applystatus', dataIndex: 'applystatus', align: 'center', slots: { customRender: 'applystatus' } },
     ];
     function isMy() {
-        return selectedRow.userid === getUserId();
+        return is
     }
     function getColums() {
         return isMy() ? columns : [...columns, { title: '议价人', key: 'username', dataIndex: 'username', align: 'center' }]

+ 36 - 32
src/views/order/pre_sale_warehouse_receipt/components/pre_sale_warehouse_receipt_deal/index.vue

@@ -1,36 +1,38 @@
 <template>
-    <!-- 成交 -->
-    <section>
-        <a-table
-            :columns="columns"
-            class="srcollYTable expandLeftTable"
-            :scroll="{ x: '100%', y: '190px' }"
-            :pagination="false"
-            :loading="loading"
-            :expandedRowKeys="expandedRowKeys"
-            :customRow="Rowclick"
-            :expandIcon="expandIcon"
-            :expandIconAsCell="false"
-            rowKey="key"
-            :data-source="tableList"
-        >
-            <!-- 额外的展开行 -->
-            <template #expandedRowRender="{ record }">
-                <BtnList
-                    :btnList="btnList"
-                    class="btn-list-sticky"
-                    :record="record"
-                    @click="openComponent"
-                />
-            </template>
-        </a-table>
-        <component
-            :is="componentId"
-            v-if="componentId"
-            :selectedRow="selectedRow"
-            @cancel="closeComponent"
-        ></component>
-    </section>
+  <!-- 成交 -->
+  <section>
+    <a-table :columns="columns"
+             class="srcollYTable expandLeftTable"
+             :scroll="{ x: '100%', y: '190px' }"
+             :pagination="false"
+             :loading="loading"
+             :expandedRowKeys="expandedRowKeys"
+             :customRow="Rowclick"
+             :expandIcon="expandIcon"
+             :expandIconAsCell="false"
+             rowKey="key"
+             :data-source="tableList">
+      <!-- 额外的展开行 -->
+      <template #expandedRowRender="{ record }">
+        <BtnList :btnList="btnList"
+                 class="btn-list-sticky"
+                 :record="record"
+                 @click="openComponent" />
+      </template>
+      <!-- 成交金额 -->
+      <template #amount="{ record }">
+        <a>{{ record.tradeqty * record.tradeprice }}</a>
+      </template>
+      <!-- 挂牌类型 -->
+      <template #wrtradetype="{ record }">
+        <a>{{ getWrOrderTypeName(record.buyorsell, record.wrtradetype) }}</a>
+      </template>
+    </a-table>
+    <component :is="componentId"
+               v-if="componentId"
+               :selectedRow="selectedRow"
+               @cancel="closeComponent"></component>
+  </section>
 </template>
 
 <script lang="ts">
@@ -42,6 +44,7 @@ import { getRecordItemTab } from '@/common/setup/order/orderData';
 import { handleComposeOrderTable } from '@/common/setup/table/compose';
 import { ComposeOrderTableParam } from '@/common/setup/table/interface';
 import { expandIcon } from '@/common/setup/table/clolumn';
+import { getWrOrderTypeName } from '@/common/constants/enumsName';
 
 export default defineComponent({
     name: enumOrderComponents.pre_sale_warehouse_receipt_deal,
@@ -69,6 +72,7 @@ export default defineComponent({
             loading,
             tableList,
             expandIcon,
+            getWrOrderTypeName,
         };
     },
 });

+ 27 - 5
src/views/order/pre_sale_warehouse_receipt/components/pre_sale_warehouse_receipt_order_summary/components/listed/index.vue

@@ -90,7 +90,10 @@
                                 v-model:value="formState.DelistMinQty"
                                 style="width: 140px !important" />
                 <span class="input-enumdicname">{{selectedRow.enumdicname}}</span>
-                <div class="tip">最小单位:{{selectedRow.minivalue}}{{selectedRow.enumdicname}}</div>
+                <div class="tip">
+                  <span>最小单位:</span>
+                  <span>{{selectedRow.minivalue}}{{selectedRow.enumdicname}}</span>
+                </div>
               </a-form-item>
             </a-col>
           </a-row>
@@ -152,7 +155,7 @@
               <a-col :span="12">
                 <a-form-item label="履约方式"
                              class="inputIconBox">
-                  <span class="clickBox"
+                  <span :class="['clickBox', formState.permanceTempName ? 'white' : '']"
                         style="width: 140px"
                         @click="openPermance">{{formState.permanceTempName ? formState.permanceTempName : '选择履约模板'}}</span>
                   <svg class="icon svg-icon"
@@ -165,7 +168,7 @@
               <a-col :span="12">
                 <a-form-item label="指定朋友"
                              class="inputIconBox">
-                  <span class="clickBox"
+                  <span :class="['clickBox', getFriendLength() ? 'white' : '']"
                         style="width: 140px"
                         @click="openFriend">{{getFriendLength() ? `已选${getFriendLength() }人` : '选择朋友'}}</span>
                   <svg class="icon svg-icon"
@@ -227,6 +230,13 @@
               </a-form-item>
             </a-col>
             <a-col :span="24"
+                   v-if="isBlocs()"
+                   class="relative">
+              <a-form-item :label="'挂牌金额'">
+                <span class="white ml8">{{getMoney()}}</span>
+              </a-form-item>
+            </a-col>
+            <a-col :span="24"
                    v-if="getWrMargin() && !isBlocs()">
               <a-form-item :label="getWrMargin() ? '履约保证金' : ''">
                 <span class="white ml8">{{getWrMargin()}}</span>
@@ -265,7 +275,7 @@
   </Drawer>
   <!-- 选择朋友 -->
   <Friend v-if="showFriend"
-          :friends=formState.friends
+          :friends="formState.friends"
           :position="'bottom'"
           @cancel="chooseFriend"
           @update="chooseFriend" />
@@ -359,7 +369,7 @@ export default defineComponent({
                 validateAction<ListingForm>(formRef, formState).then((res) => {
                     const wrGoodsInfo: WRGoodsInfo = {
                         GoodsID: props.selectedRow.deliverygoodsid as number, // uint32 配置商品ID
-                        GoodsCode: props.selectedRow.deliverygoodscode, // string 配置商品代码
+                        GoodsCode: findGoodsCode(res.goodsid as number) as string, // string 配置商品代码
                         PriceFactor: 1, // double 商品价格系数
                         PriceMove: 0, // double 商品升贴水值
                         WeightRatio: 1, // double 商品重量系数
@@ -481,6 +491,18 @@ export default defineComponent({
 </script>
 
 <style lang="less" scoped>
+.inputIconBox .input-enumdicname {
+    right: 100px;
+}
+.ant-form.inlineForm .relative.ant-form-item .tip {
+    top: -5px;
+    left: calc(100% + 5px);
+    white-space: normal;
+    span {
+        display: block;
+        line-height: 15px;
+    }
+}
 .listed {
     width: 100%;
     height: 100%;

+ 2 - 1
src/views/order/pre_sale_warehouse_receipt/components/pre_sale_warehouse_receipt_pending_order/index.vue

@@ -38,6 +38,7 @@
   <component :is="componentId"
              v-if="componentId"
              :selectedRow="selectedRow"
+             :isMy="false"
              @cancel="closeComponent"></component>
 </template>
 
@@ -61,7 +62,7 @@ export default defineComponent({
         BtnList,
         [ModalEnum.pre_sale_warehouse_receipt_pending_order_cancel_order]: defineAsyncComponent(() => import('./components/cancle/index.vue')),
         detail: defineAsyncComponent(() => import('./components/detail/index.vue')),
-        spot_warrant_pending_order_bargain_order: defineAsyncComponent(() => import('@/views/order/spot_warran/components/spot_warrant_bargain/components/bargain_detail/index.vue')),
+        pre_sale_warehouse_receipt_pending_order_bargain_order: defineAsyncComponent(() => import('@/views/order/spot_warran/components/spot_warrant_bargain/components/bargain_detail/index.vue')),
     },
     setup() {
         // 表格列表数据

+ 9 - 12
src/views/order/setup.ts

@@ -4,13 +4,13 @@ export const useOrderWarrant = (hasWR: 0 | 1) => {
     const tableColumns = [
         {
             key: '0th',
-            dataIndex: 'tradeprice',
-            title: '挂牌价格',
+            dataIndex: 'wrtradeorderid',
+            title: '挂牌单号',
             align: 'center',
             slots: {
-                customRender: 'tradeprice',
+                customRender: 'wrtradeorderid',
             },
-            width: 120,
+            width: 180,
         },
         {
             key: '6th',
@@ -137,17 +137,14 @@ export const useOrderWarrant = (hasWR: 0 | 1) => {
         }
         tableColumns.splice(6, 0, obj)
     }
-    console.log('tableColumns', tableColumns)
     // 挂牌方式
-    function getWrPriceType({ wrpricetype, isspecified, canpart }: WrOrderDetail) {
+    function getWrPriceType({ wrpricetype, isspecified, canbargain }: WrOrderDetail) {
         let result = '--'
         if (isspecified) {
-            if (wrpricetype === 1) {
-                if (canpart) {
-                    result = '贸易圈-可议价'
-                } else {
-                    result = '贸易圈'
-                }
+            if (canbargain) {
+                result = '贸易圈-可议价'
+            } else {
+                result = '贸易圈'
             }
         } else {
             if (wrpricetype === 1) {

+ 68 - 33
src/views/order/spot_warran/components/spot_warrant_bargain/components/bargain_detail/index.vue

@@ -9,13 +9,22 @@
       <a-form class="inlineForm dialogForm">
         <div class="formBar">
           <a-table :columns="columns"
-                   class="dialogTable dialogTable2"
+                   class="dialogTable dialogTable2 expandLeftTable"
                    :pagination="false"
                    :expandIcon="expandIcon"
+                   :expandedRowKeys="expandedRowKeys"
                    :loading="loading"
+                   :customRow="Rowclick"
                    :expandIconAsCell="false"
-                   rowKey="applyprice"
+                   rowKey="key"
                    :data-source="tableList">
+            <!-- 额外的展开行 -->
+            <template #expandedRowRender="{ record }">
+              <BtnList :btnList="handleBtnList(record)"
+                       class="btn-list-sticky"
+                       :record="record"
+                       @click="action" />
+            </template>
             <template #applystatus="{ text }">
               <span>{{ getBarmaginApplyStatus(text) }}</span>
             </template>
@@ -23,20 +32,12 @@
         </div>
         <a-row :gutter="24"
                type="flex"
-               v-if="isShowBtn()"
                justify="center">
           <a-col :span="24"
                  class="fixedBtns">
             <a-form-item class="btnCenter">
               <a-button class="cancelBtn"
-                        v-if="isMy()"
-                        @click="cancelAction">撤销</a-button>
-              <template v-else>
-                <a-button class="listedBtn ml10"
-                          @click="submit">确认</a-button>
-                <a-button class="ml10 cancelBtn"
-                          @click="refuse">拒绝</a-button>
-              </template>
+                        @click="cancel">取消</a-button>
             </a-form-item>
           </a-col>
         </a-row>
@@ -46,52 +47,56 @@
 </template>
 
 <script lang="ts">
-import { defineComponent, PropType, ref } from 'vue';
-import { enumOrderComponents } from '@/common/constants/enumOrderComponents';
+import { BtnListType } from '@/common/components/btnList/interface';
 import Drawer from '@/common/components/drawer/index.vue';
-import { QueryWrPositionReq, QueryWrTradeBargainApplyQsp, QueryWrTradeBargainApplyReq, WrOrderDetail, WrPosition } from '@/services/go/wrtrade/interface';
-import { getUserId } from '@/services/bus/account';
+import { getBarmaginApplyStatus } from '@/common/constants/enumsName';
+import { BtnList, ModalEnum, queryTableList } from '@/common/export/commonTable';
 import { requestResultLoadingAndInfo } from '@/common/methods/request/resultInfo';
-import { hdWROrder } from '@/services/proto/warehousetrade';
-import { v4 as uuidv4 } from 'uuid';
-import moment from 'moment';
-import { ModalEnum } from '@/common/constants/modalNameEnum';
-import { queryTableList } from '@/common/setup/table';
-import { queryQueryWrTradeBargainApply } from '@/services/go/wrtrade';
-import { getSpotWarrantBargainDetailColumns } from '../../setup';
-import { wrBargainNoAgree, wrBargainBack } from '@/services/proto/WrBargain';
 import { _closeModal } from '@/common/setup/modal/modal';
+import { getTableEvent } from '@/common/setup/table';
+import { expandIcon } from '@/common/setup/table/clolumn';
+import { queryQueryWrTradeBargainApply } from '@/services/go/wrtrade';
+import { QueryWrTradeBargainApplyQsp, QueryWrTradeBargainApplyReq, WrOrderDetail } from '@/services/go/wrtrade/interface';
+import { wrBargainBack, wrBargainNoAgree } from '@/services/proto/WrBargain';
 import { WrBargainBackReq, WrBargainNoAgreeReq } from '@/services/proto/WrBargain/interface';
 import Long from 'long';
-import { getBarmaginApplyStatus } from '@/common/constants/enumsName';
+import { defineComponent, PropType, ref } from 'vue';
+import { getSpotWarrantBargainDetailColumns } from '../../setup';
 
 export default defineComponent({
     name: ModalEnum.spot_warrant_bargain_detail,
-    components: { Drawer },
+    components: { Drawer, BtnList },
     emits: ['cancel', 'update'],
     props: {
         selectedRow: {
-            type: Object as PropType<QueryWrTradeBargainApplyQsp>,
+            type: Object as PropType<QueryWrTradeBargainApplyQsp | WrOrderDetail>,
             default: {},
         },
+        isMy: {
+            type: Boolean,
+            default: true,
+        },
     },
     setup(props, context) {
         // 表格列表数据
         const { loading, tableList, queryTable } = queryTableList<QueryWrTradeBargainApplyQsp>();
         const { visible, cancel } = _closeModal(context);
-        const { wrbargainid } = props.selectedRow;
         const param: QueryWrTradeBargainApplyReq = {
             haswr: 1,
             wrtradeorderid: props.selectedRow.wrtradeorderid,
         };
         queryTable(queryQueryWrTradeBargainApply, param).then((res) => {
+            const arr = res.map((el) => {
+                return Object.assign(el, { key: el.wrbargainid });
+            });
             // 时间 倒序排序
-            tableList.value = res.sort((a, b) => {
+            tableList.value = arr.sort((a, b) => {
                 const time1 = new Date(a.applytime).getTime();
                 const time2 = new Date(b.applytime).getTime();
                 return time2 - time1;
             });
         });
+
         function isShowBtn() {
             let result = false;
             tableList.value.forEach((el) => {
@@ -103,9 +108,35 @@ export default defineComponent({
         }
         // 我对别人的 => 撤销
         // 别人对我的 => 确认、拒绝
-        const { isMy, getColums } = getSpotWarrantBargainDetailColumns(props.selectedRow);
+        const { getColums, isMy } = getSpotWarrantBargainDetailColumns(props.isMy);
+        function handleBtnList(record: QueryWrTradeBargainApplyQsp) {
+            const result = ref<BtnListType[]>([]);
+            if (isMy()) {
+                result.value = [{ lable: '撤销', code: 'cancel', className: 'btnDanger' }];
+            } else {
+                result.value = [
+                    { lable: '确认', code: 'submit', className: 'operBtn' },
+                    { lable: '拒绝', code: 'refuse', className: 'btnDanger' },
+                ];
+            }
+            return record.applystatus === 1 ? result.value : [];
+        }
+        function action({ code }: BtnListType, { wrbargainid }: QueryWrTradeBargainApplyQsp) {
+            switch (code) {
+                case 'cancel':
+                    cancelAction(wrbargainid);
+                    break;
+                case 'submit':
+                    submit(wrbargainid);
+                    break;
+                case 'refuse':
+                    refuse(wrbargainid);
+                    break;
+            }
+        }
+
         // 确认
-        function submit() {
+        function submit(wrbargainid: string) {
             const param: WrBargainNoAgreeReq = {
                 WrBargainID: Long.fromString(wrbargainid),
                 Status: 1,
@@ -115,7 +146,7 @@ export default defineComponent({
             });
         }
         // 拒绝
-        function refuse() {
+        function refuse(wrbargainid: string) {
             const param: WrBargainNoAgreeReq = {
                 WrBargainID: Long.fromString(wrbargainid),
                 Status: 2,
@@ -125,7 +156,7 @@ export default defineComponent({
             });
         }
         // 撤销
-        function cancelAction() {
+        function cancelAction(wrbargainid: string) {
             const param: WrBargainBackReq = {
                 WrBargainID: Long.fromString(wrbargainid),
             };
@@ -134,7 +165,7 @@ export default defineComponent({
             });
         }
         return {
-            visible: true,
+            visible,
             columns: getColums(),
             loading,
             tableList,
@@ -145,6 +176,10 @@ export default defineComponent({
             cancel,
             getBarmaginApplyStatus,
             isShowBtn,
+            handleBtnList,
+            action,
+            expandIcon,
+            ...getTableEvent<QueryWrTradeBargainApplyQsp>(),
         };
     },
 });

+ 2 - 4
src/views/order/spot_warran/components/spot_warrant_bargain/setup.ts

@@ -1,5 +1,3 @@
-import { getUserId } from "@/services/bus/account";
-import { QueryWrTradeBargainApplyQsp } from "@/services/go/wrtrade/interface";
 
 export function getSpotWarrantBargainColumns() {
     const columns = [
@@ -25,7 +23,7 @@ export function getSpotWarrantBargainColumns() {
     })
 }
 
-export function getSpotWarrantBargainDetailColumns(selectedRow: QueryWrTradeBargainApplyQsp) {
+export function getSpotWarrantBargainDetailColumns(is: boolean) {
     const columns = [
         { title: '数量', key: 'applyqty', dataIndex: 'applyqty', align: 'center' },
         { title: '价格', key: 'applyprice', dataIndex: 'applyprice', align: 'center' },
@@ -33,7 +31,7 @@ export function getSpotWarrantBargainDetailColumns(selectedRow: QueryWrTradeBarg
         { title: '状态', key: 'applystatus', dataIndex: 'applystatus', align: 'center', slots: { customRender: 'applystatus' } },
     ];
     function isMy() {
-        return selectedRow.userid === getUserId();
+        return is
     }
     function getColums() {
         return isMy() ? columns : [...columns, { title: '议价人', key: 'username', dataIndex: 'username', align: 'center' }]

+ 1 - 0
src/views/order/spot_warran/components/spot_warrant_pending_order/index.vue

@@ -40,6 +40,7 @@
     <component :is="componentId"
                v-if="componentId"
                :selectedRow="selectedRow"
+               :isMy="false"
                @cancel="closeComponent"></component>
   </section>
 </template>

+ 292 - 257
src/views/order/spot_warran/components/spot_warrant_spot_details/components/listing/index.vue

@@ -1,266 +1,289 @@
 <template>
-  <!-- 现货仓单 现货明细 挂牌 -->
-  <Drawer :title="'挂牌'"
-          :placement="'right'"
-          class="delistingBottom650"
-          :visible="visible"
-          @cancel="cancel">
-    <div class="listing">
-      <div class="condition">
-        <a-button class="conditionBtn">{{selectedRow.deliverygoodsname}}</a-button>
-        <a-button class="conditionBtn">{{selectedRow.wrtypename}}</a-button>
-        <a-button class="conditionBtn">{{selectedRow.warehousename}}</a-button>
-      </div>
+    <!-- 现货仓单 现货明细 挂牌 -->
+    <Drawer
+        :title="'挂牌'"
+        :placement="'right'"
+        class="delistingBottom650"
+        :visible="visible"
+        @cancel="cancel"
+    >
+        <div class="listing">
+            <div class="condition">
+                <a-button class="conditionBtn">{{selectedRow.deliverygoodsname}}</a-button>
+                <a-button class="conditionBtn">{{selectedRow.wrtypename}}</a-button>
+                <a-button class="conditionBtn">{{selectedRow.warehousename}}</a-button>
+            </div>
 
-      <a-form class="inlineForm dialogForm"
-              ref="formRef"
-              :model="formState"
-              :rules="rules">
-        <div class="formBar">
-          <a-row :gutter="24">
-            <a-col :span="12">
-              <a-form-item label="挂牌方式"
-                           name="WRPriceType">
-                <a-select class="inlineFormSelect"
-                          default-value="1"
-                          v-model:value="formState.WRPriceType"
-                          style="width: 140px">
-                  <a-select-option :value="1">一口价</a-select-option>
-                  <a-select-option :value="2">浮动价</a-select-option>
-                  <a-select-option :value="3">贸易圈</a-select-option>
-                </a-select>
-              </a-form-item>
-            </a-col>
-            <a-col :span="12"
-                   v-if="isFixed()">
-              <a-form-item label="挂牌价"
-                           name="FixedPrice">
-                <a-input-number class="dialogInput"
-                                :min="0"
-                                style="width: 140px"
-                                v-model:value="formState.FixedPrice"
-                                placeholder="请输入挂牌价" />
-              </a-form-item>
-            </a-col>
-            <a-col :span="12"
-                   v-if="isBlocs()">
-              <a-form-item label="挂牌价格"
-                           name="FixedPrice"
-                           class="inputIconBox">
-                <a-input-number class="commonInput"
-                                style="width: 140px"
-                                :min="0"
-                                v-model:value="formState.FixedPrice" />
-                <a-checkbox class="commonCheckbox"
-                            v-model:checked="priceCheck">可议价</a-checkbox>
-              </a-form-item>
-            </a-col>
-            <a-col :span="12"
-                   v-if="isFloat()">
-              <a-form-item label="基差"
-                           name="PriceMove">
-                <a-input-number class="commonInput"
-                                v-model:value="formState.PriceMove"
-                                style="width: 140px" />
-              </a-form-item>
-            </a-col>
-          </a-row>
-          <a-row :gutter="24">
-            <a-col :span="12">
-              <a-form-item label="挂牌数量"
-                           class="inputIconBox"
-                           name="OrderQty">
-                <a-input-number class="dialogInput"
-                                style="width: 140px !important"
-                                :min="0"
-                                v-model:value="formState.OrderQty"
-                                placeholder="请输入挂牌数量" />
-                <span class="input-enumdicname">{{selectedRow.enumdicname}}</span>
-                <a-checkbox class="commonCheckbox"
-                            v-if="isBlocs()"
-                            v-model:checked="numCheck">整单</a-checkbox>
-              </a-form-item>
-            </a-col>
-            <a-col :span="12"
-                   v-if="!numCheck">
-              <a-form-item label="起摘数量"
-                           class="relative"
-                           name="DelistMinQty">
-                <a-input-number class="commonInput"
-                                :min="0"
-                                v-model:value="formState.DelistMinQty"
-                                style="width: 140px !important" />
-                <span class="input-enumdicname">{{selectedRow.enumdicname}}</span>
-                <div class="tip">最小单位:{{selectedRow.minivalue}}{{selectedRow.enumdicname}}</div>
-              </a-form-item>
-            </a-col>
-          </a-row>
-          <a-row :gutter="24">
-            <a-col :span="12"
-                   class="mt-20">
-              <a-form-item>
-                <a-slider v-model:value="formState.OrderQty"
-                          ::min="0"
-                          :max="selectedRow.enableqty"
-                          class="formSlider"
-                          style="width: 140px;" />
-                <div class="unit">
-                  <span>0</span>
-                  <span>{{selectedRow.enableqty}}{{selectedRow.enumdicname}}</span>
-                </div>
-              </a-form-item>
-            </a-col>
-            <a-col :span="12">&nbsp;</a-col>
-          </a-row>
-          <template v-if="isBlocs()">
-            <a-row :gutter="24">
-              <a-col :span="12">
-                <a-form-item label="履约保证金"
-                             name="margin">
-                  <a-input-number class="commonInput"
-                                  v-model:value="formState.margin"
-                                  :min="0"
-                                  style="width: 140px" />
-                  <span class="input-enumdicname">%</span>
-                </a-form-item>
-              </a-col>
-              <a-col :span="12">
-                <a-form-item label="挂牌有效期"
-                             name="vidaliteTime"
-                             class="inputIconBox">
-                  <a-date-picker style="width: 140px"
-                                 v-model:value="formState.vidaliteTime"
-                                 :allowClear="false"
-                                 class="commonDatePicker dialogDatePicker" />
-                </a-form-item>
-              </a-col>
-            </a-row>
-            <a-row :gutter="24">
-              <a-col :span="12">
-                <a-form-item label="履约方式"
-                             class="inputIconBox">
-                  <span class="clickBox"
-                        style="width: 140px"
-                        @click="openPermance">{{formState.permanceTempName ? formState.permanceTempName : '选择履约模板'}}</span>
-                  <svg class="icon svg-icon"
-                       aria-hidden="true"
-                       @click="openPermance">
-                    <use xlink:href="#icon-moban" />
-                  </svg>
-                </a-form-item>
-              </a-col>
-              <a-col :span="12">
-                <a-form-item label="指定朋友"
-                             class="inputIconBox">
-                  <span class="clickBox"
-                        style="width: 140px"
-                        @click="openFriend">{{getFriendLength() ? `已选${getFriendLength() }人` : '选择朋友'}}</span>
-                  <svg class="icon svg-icon"
-                       aria-hidden="true"
-                       @click="openFriend">
-                    <use xlink:href="#icon-pengyou1" />
-                  </svg>
-                  <a-checkbox class="commonCheckbox"
-                              v-model:checked="friendCheck"
-                              @change="limiteFriends">不限</a-checkbox>
-                </a-form-item>
-              </a-col>
-            </a-row>
-          </template>
-          <a-row :gutter="24"
-                 v-if="isFloat()">
-            <a-col :span="24">
-              <a-form-item label="行情商品"
-                           name="goodsid">
-                <!-- <a-select class="inlineFormSelect"
+            <a-form class="inlineForm dialogForm" ref="formRef" :model="formState" :rules="rules">
+                <div class="formBar">
+                    <a-row :gutter="24">
+                        <a-col :span="12">
+                            <a-form-item label="挂牌方式" name="WRPriceType">
+                                <a-select
+                                    class="inlineFormSelect"
+                                    default-value="1"
+                                    v-model:value="formState.WRPriceType"
+                                    style="width: 140px"
+                                >
+                                    <a-select-option :value="1">一口价</a-select-option>
+                                    <a-select-option :value="2">浮动价</a-select-option>
+                                    <a-select-option :value="3">贸易圈</a-select-option>
+                                </a-select>
+                            </a-form-item>
+                        </a-col>
+                        <a-col :span="12" v-if="isFixed()">
+                            <a-form-item label="挂牌价" name="FixedPrice">
+                                <a-input-number
+                                    class="dialogInput"
+                                    :min="0"
+                                    style="width: 140px"
+                                    v-model:value="formState.FixedPrice"
+                                    placeholder="请输入挂牌价"
+                                />
+                            </a-form-item>
+                        </a-col>
+                        <a-col :span="12" v-if="isBlocs()">
+                            <a-form-item label="挂牌价格" name="FixedPrice" class="inputIconBox">
+                                <a-input-number
+                                    class="commonInput"
+                                    style="width: 140px"
+                                    :min="0"
+                                    v-model:value="formState.FixedPrice"
+                                />
+                                <a-checkbox class="commonCheckbox" v-model:checked="priceCheck">可议价</a-checkbox>
+                            </a-form-item>
+                        </a-col>
+                        <a-col :span="12" v-if="isFloat()">
+                            <a-form-item label="基差" name="PriceMove">
+                                <a-input-number
+                                    class="commonInput"
+                                    v-model:value="formState.PriceMove"
+                                    style="width: 140px"
+                                />
+                            </a-form-item>
+                        </a-col>
+                    </a-row>
+                    <a-row :gutter="24">
+                        <a-col :span="12">
+                            <a-form-item label="挂牌数量" class="inputIconBox" name="OrderQty">
+                                <a-input-number
+                                    class="dialogInput"
+                                    style="width: 140px !important"
+                                    :min="0"
+                                    v-model:value="formState.OrderQty"
+                                    placeholder="请输入挂牌数量"
+                                />
+                                <span class="input-enumdicname">{{selectedRow.enumdicname}}</span>
+                                <a-checkbox
+                                    class="commonCheckbox"
+                                    v-if="isBlocs()"
+                                    v-model:checked="numCheck"
+                                >整单</a-checkbox>
+                            </a-form-item>
+                        </a-col>
+                        <a-col :span="12" v-if="!numCheck">
+                            <a-form-item label="起摘数量" class="relative" name="DelistMinQty">
+                                <a-input-number
+                                    class="commonInput"
+                                    :min="0"
+                                    v-model:value="formState.DelistMinQty"
+                                    style="width: 140px !important"
+                                />
+                                <span class="input-enumdicname">{{selectedRow.enumdicname}}</span>
+                                <div class="tip">
+                                    <span>最小单位:</span>
+                                    <span>{{selectedRow.minivalue}}{{selectedRow.enumdicname}}</span>
+                                </div>
+                            </a-form-item>
+                        </a-col>
+                    </a-row>
+                    <a-row :gutter="24">
+                        <a-col :span="12" class="mt-20">
+                            <a-form-item>
+                                <a-slider
+                                    v-model:value="formState.OrderQty"
+                                    ::min="0"
+                                    :max="selectedRow.enableqty"
+                                    class="formSlider"
+                                    style="width: 140px;"
+                                />
+                                <div class="unit">
+                                    <span>0</span>
+                                    <span>{{selectedRow.enableqty}}{{selectedRow.enumdicname}}</span>
+                                </div>
+                            </a-form-item>
+                        </a-col>
+                        <a-col :span="12">&nbsp;</a-col>
+                    </a-row>
+                    <template v-if="isBlocs()">
+                        <a-row :gutter="24">
+                            <a-col :span="12">
+                                <a-form-item label="履约保证金" name="margin">
+                                    <a-input-number
+                                        class="commonInput"
+                                        v-model:value="formState.margin"
+                                        :min="0"
+                                        style="width: 140px"
+                                    />
+                                    <span class="input-enumdicname">%</span>
+                                </a-form-item>
+                            </a-col>
+                            <a-col :span="12">
+                                <a-form-item label="挂牌有效期" name="vidaliteTime" class="inputIconBox">
+                                    <a-date-picker
+                                        style="width: 140px"
+                                        v-model:value="formState.vidaliteTime"
+                                        :allowClear="false"
+                                        class="commonDatePicker dialogDatePicker"
+                                    />
+                                </a-form-item>
+                            </a-col>
+                        </a-row>
+                        <a-row :gutter="24">
+                            <a-col :span="12">
+                                <a-form-item label="履约方式" class="inputIconBox">
+                                    <span
+                                        :class="['clickBox', formState.permanceTempName ? 'white' : '']"
+                                        style="width: 140px"
+                                        @click="openPermance"
+                                    >{{formState.permanceTempName ? formState.permanceTempName : '选择履约模板'}}</span>
+                                    <svg
+                                        class="icon svg-icon"
+                                        aria-hidden="true"
+                                        @click="openPermance"
+                                    >
+                                        <use xlink:href="#icon-moban" />
+                                    </svg>
+                                </a-form-item>
+                            </a-col>
+                            <a-col :span="12">
+                                <a-form-item label="指定朋友" class="inputIconBox">
+                                    <span
+                                        :class="['clickBox', getFriendLength() ? 'white' : '']"
+                                        style="width: 140px"
+                                        @click="openFriend"
+                                    >{{getFriendLength() ? `已选${getFriendLength() }人` : '选择朋友'}}</span>
+                                    <svg
+                                        class="icon svg-icon"
+                                        aria-hidden="true"
+                                        @click="openFriend"
+                                    >
+                                        <use xlink:href="#icon-pengyou1" />
+                                    </svg>
+                                    <a-checkbox
+                                        class="commonCheckbox"
+                                        v-model:checked="friendCheck"
+                                        @change="limiteFriends"
+                                    >不限</a-checkbox>
+                                </a-form-item>
+                            </a-col>
+                        </a-row>
+                    </template>
+                    <a-row :gutter="24" v-if="isFloat()">
+                        <a-col :span="24">
+                            <a-form-item label="行情商品" name="goodsid">
+                                <!-- <a-select class="inlineFormSelect"
                           style="width: 135px"
                           placeholder="请择交易所">
                                 </a-select>-->
-                <a-select class="inlineFormSelect ml5"
-                          @change="handleGoodsGroups"
-                          style="width: 135px"
-                          v-model:value="formState.goodsgroupid"
-                          placeholder="请选择商品">
-                  <a-select-option v-for="item in goodsGroup"
-                                   :value="item.goodsgroupid"
-                                   :key="item.goodsgroupid">{{item.goodsgroupname}}
-                  </a-select-option>
-                </a-select>
-                <a-select class="inlineFormSelect ml5"
-                          style="width: 135px"
-                          @change="handleGoodsChange"
-                          v-model:value="formState.goodsid"
-                          placeholder="请选择合约">
-                  <a-select-option v-for="item in goodsList"
-                                   :value="item.goodsid"
-                                   :key="item.goodsid">{{item.goodsname}}</a-select-option>
-                </a-select>
-              </a-form-item>
-            </a-col>
-          </a-row>
-          <a-row :gutter="24">
-            <a-col :span="24"
-                   v-if="isFloat()"
-                   class="relative">
-              <a-form-item :label="'估算金额'">
-                <span class="white ml8">{{getWrMoney()}}</span>
-              </a-form-item>
-            </a-col>
-            <a-col :span="24"
-                   v-if="isFixed()"
-                   class="relative">
-              <a-form-item :label="'挂牌金额'">
-                <span class="white ml8">{{getWrMoney()}}</span>
-              </a-form-item>
-            </a-col>
-            <a-col :span="24"
-                   v-if="getWrMargin() && !isBlocs()">
-              <a-form-item :label="getWrMargin() ? '履约保证金' : ''">
-                <span class="white ml8">{{getWrMargin()}}</span>
-              </a-form-item>
-            </a-col>
-            <a-col :span="24"
-                   v-if="isBlocs()">
-              <a-form-item label="履约保证金">
-                <span class="white ml8">{{getMargin()}}</span>
-              </a-form-item>
-            </a-col>
-            <a-col :span="24">
-              <a-form-item label="可用资金">
-                <span class="white ml8">{{getCanUseMoney(handleSelectedAccount())}}</span>
-              </a-form-item>
-            </a-col>
-          </a-row>
+                                <a-select
+                                    class="inlineFormSelect ml5"
+                                    @change="handleGoodsGroups"
+                                    style="width: 135px"
+                                    v-model:value="formState.goodsgroupid"
+                                    placeholder="请选择商品"
+                                >
+                                    <a-select-option
+                                        v-for="item in goodsGroup"
+                                        :value="item.goodsgroupid"
+                                        :key="item.goodsgroupid"
+                                    >{{item.goodsgroupname}}</a-select-option>
+                                </a-select>
+                                <a-select
+                                    class="inlineFormSelect ml5"
+                                    style="width: 135px"
+                                    @change="handleGoodsChange"
+                                    v-model:value="formState.goodsid"
+                                    placeholder="请选择合约"
+                                >
+                                    <a-select-option
+                                        v-for="item in goodsList"
+                                        :value="item.goodsid"
+                                        :key="item.goodsid"
+                                    >{{item.goodsname}}</a-select-option>
+                                </a-select>
+                            </a-form-item>
+                        </a-col>
+                    </a-row>
+                    <a-row :gutter="24">
+                        <a-col :span="24" v-if="isFloat()" class="relative">
+                            <a-form-item :label="'估算金额'">
+                                <span class="white ml8">{{getWrMoney()}}</span>
+                            </a-form-item>
+                        </a-col>
+                        <a-col :span="24" v-if="isFixed()" class="relative">
+                            <a-form-item :label="'挂牌金额'">
+                                <span class="white ml8">{{getWrMoney()}}</span>
+                            </a-form-item>
+                        </a-col>
+                        <a-col :span="24" v-if="isBlocs()" class="relative">
+                            <a-form-item :label="'挂牌金额'">
+                                <span class="white ml8">{{getMoney()}}</span>
+                            </a-form-item>
+                        </a-col>
+                        <a-col :span="24" v-if="getWrMargin() && !isBlocs()">
+                            <a-form-item :label="getWrMargin() ? '履约保证金' : ''">
+                                <span class="white ml8">{{getWrMargin()}}</span>
+                            </a-form-item>
+                        </a-col>
+                        <a-col :span="24" v-if="isBlocs()">
+                            <a-form-item label="履约保证金">
+                                <span class="white ml8">{{getMargin()}}</span>
+                            </a-form-item>
+                        </a-col>
+                        <a-col :span="24">
+                            <a-form-item label="可用资金">
+                                <span class="white ml8">{{getCanUseMoney(handleSelectedAccount())}}</span>
+                            </a-form-item>
+                        </a-col>
+                    </a-row>
+                </div>
+                <a-row :gutter="24">
+                    <a-col :span="24" class="fixedBtns">
+                        <a-form-item class="btnCenter">
+                            <a-button
+                                class="listedBtn"
+                                :loading="loading"
+                                :disabled="loading"
+                                @click="submit"
+                            >卖出</a-button>
+                            <a-button
+                                class="ml10 cancelBtn"
+                                :loading="loading"
+                                :disabled="loading"
+                                @click="cancel"
+                            >取消</a-button>
+                        </a-form-item>
+                    </a-col>
+                </a-row>
+            </a-form>
         </div>
-        <a-row :gutter="24">
-          <a-col :span="24"
-                 class="fixedBtns">
-            <a-form-item class="btnCenter">
-              <a-button class="listedBtn"
-                        :loading="loading"
-                        :disabled="loading"
-                        @click="submit">卖出</a-button>
-              <a-button class="ml10 cancelBtn"
-                        :loading="loading"
-                        :disabled="loading"
-                        @click="cancel">取消</a-button>
-            </a-form-item>
-          </a-col>
-        </a-row>
-      </a-form>
-    </div>
-  </Drawer>
-  <!-- 选择朋友 -->
-  <Friend v-if="showFriend"
-          :friends=formState.friends
-          :position="'bottom'"
-          @cancel="chooseFriend"
-          @update="chooseFriend" />
-  <!-- 选择履约模板 -->
-  <Permance v-if="showPermance"
-            :position="'bottom'"
-            @cancel="choosePermance"
-            @update="choosePermance" />
+    </Drawer>
+    <!-- 选择朋友 -->
+    <Friend
+        v-if="showFriend"
+        :friends="formState.friends"
+        :position="'bottom'"
+        @cancel="chooseFriend"
+        @update="chooseFriend"
+    />
+    <!-- 选择履约模板 -->
+    <Permance
+        v-if="showPermance"
+        :position="'bottom'"
+        @cancel="choosePermance"
+        @update="choosePermance"
+    />
 </template>
 
 <script lang="ts">
@@ -468,6 +491,18 @@ export default defineComponent({
 </script>
 
 <style lang="less" scoped>
+.inputIconBox .input-enumdicname {
+    right: 100px;
+}
+.ant-form.inlineForm .relative.ant-form-item .tip {
+    top: -5px;
+    left: calc(100% + 5px);
+    white-space: normal;
+    span {
+        display: block;
+        line-height: 15px;
+    }
+}
 .listing {
     width: 100%;
     height: 100%;