huangbin vor 4 Jahren
Ursprung
Commit
612b9fbe6a

+ 1 - 1
src/common/constants/enumCommon.ts

@@ -1,7 +1,7 @@
 /**
  * 买卖方向
  */
-export const enum BuyOrSell {
+export enum BuyOrSell {
     buy, // 买
     sell, // 卖
 }

+ 3 - 0
src/views/market/spot_trade/components/buy-sell-market/components/buy/index.vue

@@ -19,6 +19,7 @@
   <component :is="componentId"
              v-if="componentId"
              :selectedRow="selectedRow"
+             :buyOrSell="BuyOrSell.buy"
              :parantSelectedRow="parantSelectedRow"
              @cancel="closeComponent"></component>
 </template>
@@ -32,6 +33,7 @@ import { QueryOrderQuoteDetailReq, WrOrderQuote, WrOrderQuoteDetail } from '@/se
 import { defineAsyncComponent, PropType } from 'vue';
 import { BtnList as btnListType } from '@/common/components/btnList/interface';
 import { getBuyMarketParam } from '../../setup';
+import { BuyOrSell } from '@/common/constants/enumCommon';
 
 export default defineComponent({
     emits: ['cancel', 'openComponent'],
@@ -79,6 +81,7 @@ export default defineComponent({
         };
         return {
             ...handleComposeTable<WrOrderQuoteDetail>(param),
+            BuyOrSell,
             loading,
             tableList,
         };

+ 5 - 0
src/views/market/spot_trade/components/buy-sell-market/components/delisting/index.vue

@@ -118,6 +118,7 @@ import { message } from 'ant-design-vue';
 import { handleForm } from './setup';
 import { validateAction } from '@/common/setup/form';
 import { ListingForm } from './interface';
+import { BuyOrSell } from '@/common/constants/enumCommon';
 export default defineComponent({
     name: ModalEnum.spot_trade_warehouse_delisting,
     components: { Drawer, PlusOutlined, MinusOutlined },
@@ -131,6 +132,10 @@ export default defineComponent({
             type: Object as PropType<WrOrderQuote>,
             default: {},
         },
+        buyOrSell: {
+            type: Number as PropType<BuyOrSell>,
+            default: BuyOrSell.buy,
+        },
     },
 
     setup(props, context) {

+ 3 - 0
src/views/market/spot_trade/components/buy-sell-market/components/sell/index.vue

@@ -20,6 +20,7 @@
   <component :is="componentId"
              v-if="componentId"
              :selectedRow="selectedRow"
+             :buyOrSell="BuyOrSell.buy"
              :parantSelectedRow="parantSelectedRow"
              @cancel="closeComponent"></component>
 </template>
@@ -33,6 +34,7 @@ import { QueryOrderQuoteDetailReq, WrOrderQuote, WrOrderQuoteDetail } from '@/se
 import { defineAsyncComponent, PropType } from 'vue';
 import { BtnList as btnListType } from '@/common/components/btnList/interface';
 import { getSellMarketParam } from '../../setup';
+import { BuyOrSell } from '@/common/constants/enumCommon';
 
 export default defineComponent({
     emits: ['cancel', 'openComponent'],
@@ -83,6 +85,7 @@ export default defineComponent({
             ...handleComposeTable<WrOrderQuoteDetail>(param),
             loading,
             tableList,
+            BuyOrSell,
         };
     },
 });

+ 98 - 91
src/views/order/spot_warran/components/spot_warrant_inventory_summary/components/listing/index.vue

@@ -1,95 +1,101 @@
 <template>
-    <!-- 挂单 -->
-    <Drawer :title="'挂牌'" :placement="'bottom'" :visible="visible">
-        <div class="listed">
-            <div class="condition">
-                <a-button class="conditionBtn">螺纹钢</a-button>
-                <a-button class="conditionBtn">12mm-江铜</a-button>
-                <!-- <a-button class="conditionBtn">江铜</a-button> -->
-                <a-button class="conditionBtn">华南仓库</a-button>
-            </div>
-            <div class="formBar">
-                <a-form class="inlineForm dialogForm" :form="form" @submit="handleSearch">
-                    <a-row :gutter="24">
-                        <a-col :span="12">
-                            <a-form-item label="挂牌方式">
-                                <a-select
-                                    class="inlineFormSelect"
-                                    default-value="1"
-                                    style="width: 140px"
-                                >
-                                    <a-select-option value="1">一口价</a-select-option>
-                                    <a-select-option value="2">一口价2</a-select-option>
-                                </a-select>
-                            </a-form-item>
-                        </a-col>
-                        <a-col :span="12">
-                            <a-form-item label="挂牌价">
-                                <a-input class="commonInput" style="width: 140px" />
-                            </a-form-item>
-                        </a-col>
-                    </a-row>
-                    <a-row :gutter="24">
-                        <a-col :span="12">
-                            <a-form-item label="挂牌数量">
-                                <a-input class="commonInput" suffix="吨" style="width: 140px" />
-                            </a-form-item>
-                        </a-col>
-                        <a-col :span="12">
-                            <a-form-item label="起摘数量" class="relative">
-                                <a-input class="commonInput" suffix="吨" style="width: 140px" />
-                                <div class="tip">最小单位:1吨</div>
-                            </a-form-item>
-                        </a-col>
-                    </a-row>
-                    <a-row :gutter="24">
-                        <a-col :span="12" class="mt-20">
-                            <a-form-item>
-                                <a-progress class="formProgress" :percent="30" />
-                                <div class="unit">
-                                    <span>0</span>
-                                    <span>300吨</span>
-                                </div>
-                            </a-form-item>
-                        </a-col>
-                        <a-col :span="12">&nbsp;</a-col>
-                    </a-row>
-                    <a-row :gutter="24">
-                        <a-col :span="24">
-                            <a-form-item label="行情商品">
-                                <a-select
-                                    class="inlineFormSelect"
-                                    style="width: 135px"
-                                    placeholder="请选择交易所"
-                                >
-                                    <!-- <a-select-option value="1">一口价</a-select-option>
+  <!-- 挂单 -->
+  <Drawer :title="'挂牌'"
+          :placement="'bottom'"
+          :visible="visible">
+    <div class="listed">
+      <div class="condition">
+        <a-button class="conditionBtn">螺纹钢</a-button>
+        <a-button class="conditionBtn">12mm-江铜</a-button>
+        <!-- <a-button class="conditionBtn">江铜</a-button> -->
+        <a-button class="conditionBtn">华南仓库</a-button>
+      </div>
+      <div class="formBar">
+        <a-form class="inlineForm dialogForm"
+                :form="form"
+                @submit="handleSearch">
+          <a-row :gutter="24">
+            <a-col :span="12">
+              <a-form-item label="挂牌方式">
+                <a-select class="inlineFormSelect"
+                          default-value="1"
+                          style="width: 140px">
+                  <a-select-option value="1">一口价</a-select-option>
+                  <a-select-option value="2">一口价2</a-select-option>
+                </a-select>
+              </a-form-item>
+            </a-col>
+            <a-col :span="12">
+              <a-form-item label="挂牌价">
+                <a-input class="commonInput"
+                         style="width: 140px" />
+              </a-form-item>
+            </a-col>
+          </a-row>
+          <a-row :gutter="24">
+            <a-col :span="12">
+              <a-form-item label="挂牌数量">
+                <a-input class="commonInput"
+                         suffix="吨"
+                         style="width: 140px" />
+              </a-form-item>
+            </a-col>
+            <a-col :span="12">
+              <a-form-item label="起摘数量"
+                           class="relative">
+                <a-input class="commonInput"
+                         suffix="吨"
+                         style="width: 140px" />
+                <div class="tip">最小单位:1吨</div>
+              </a-form-item>
+            </a-col>
+          </a-row>
+          <a-row :gutter="24">
+            <a-col :span="12"
+                   class="mt-20">
+              <a-form-item>
+                <a-progress class="formProgress"
+                            :percent="30" />
+                <div class="unit">
+                  <span>0</span>
+                  <span>300吨</span>
+                </div>
+              </a-form-item>
+            </a-col>
+            <a-col :span="12">&nbsp;</a-col>
+          </a-row>
+          <a-row :gutter="24">
+            <a-col :span="24">
+              <a-form-item label="行情商品">
+                <a-select class="inlineFormSelect"
+                          style="width: 135px"
+                          placeholder="请选择交易所">
+                  <!-- <a-select-option value="1">一口价</a-select-option>
                                     <a-select-option value="2">一口价2</a-select-option>-->
-                                </a-select>
-                                <a-select
-                                    class="inlineFormSelect ml5"
-                                    style="width: 135px"
-                                    placeholder="请选择商品"
-                                ></a-select>
-                                <a-select
-                                    class="inlineFormSelect ml5"
-                                    style="width: 135px"
-                                    placeholder="请选择合约"
-                                ></a-select>
-                            </a-form-item>
-                        </a-col>
-                    </a-row>
-                    <a-row :gutter="24" type="flex" justify="center">
-                        <a-col :span="24">
-                            <a-form-item class="tc">
-                                <a-button class="listedBtn">卖出</a-button>
-                                <a-button class="ml10 cancelBtn">取消</a-button>
-                            </a-form-item>
-                        </a-col>
-                    </a-row>
-                </a-form>
-            </div>
-        </div>
-    </Drawer>
+                </a-select>
+                <a-select class="inlineFormSelect ml5"
+                          style="width: 135px"
+                          placeholder="请选择商品"></a-select>
+                <a-select class="inlineFormSelect ml5"
+                          style="width: 135px"
+                          placeholder="请选择合约"></a-select>
+              </a-form-item>
+            </a-col>
+          </a-row>
+          <a-row :gutter="24"
+                 type="flex"
+                 justify="center">
+            <a-col :span="24">
+              <a-form-item class="tc">
+                <a-button class="listedBtn">卖出</a-button>
+                <a-button class="ml10 cancelBtn">取消</a-button>
+              </a-form-item>
+            </a-col>
+          </a-row>
+        </a-form>
+      </div>
+    </div>
+  </Drawer>
 </template>
 
 <script lang="ts">
@@ -102,6 +108,7 @@ import { requestResultLoadingAndInfo } from '@/common/methods/request/resultInfo
 import { hdWROrder } from '@/services/proto/warehousetrade';
 import { v4 as uuidv4 } from 'uuid';
 import moment from 'moment';
+import { BuyOrSell } from '@/common/constants/enumCommon';
 
 export default defineComponent({
     name: enumOrderComponents.spot_warrant_pending_order,
@@ -144,7 +151,7 @@ export default defineComponent({
             PerformanceTemplateID: 0, // 履约计划模板ID
             UserID: getUserId(),
             OperatorID: getUserId(), // 操作员账号ID
-            BuyOrSell: 1, // 买卖方向 0买1卖
+            BuyOrSell: BuyOrSell.sell, // 买卖方向 0买1卖
             PriceDisplayMode: 1, // 浮动价显示方式 1:合并显示 2:分开显示
             CanBargain: 0, // 挂牌是否可议价0:不可1:可-摘牌是否议价
             Attachment1: '', // 附件1

+ 2 - 1
src/views/order/spot_warran/components/spot_warrant_spot_details/components/listing/index.vue

@@ -153,6 +153,7 @@ import { message } from 'ant-design-vue';
 import { getGoodsGroupsByTradeMode } from '@/services/bus/goods';
 import { TradeMode } from '@/common/constants/enumCommon';
 import { WRGoodsInfo } from '@/services/proto/warehousetrade/interface';
+import { BuyOrSell } from '@/common/constants/enumCommon';
 
 export default defineComponent({
     name: ModalEnum.spot_warrant_spot_details_listed,
@@ -211,7 +212,7 @@ export default defineComponent({
                         PerformanceTemplateID: 0, // 履约计划模板ID
                         UserID: getUserId(),
                         OperatorID: getUserId(), // 操作员账号ID
-                        BuyOrSell: 1, // 买卖方向 0买1卖
+                        BuyOrSell: BuyOrSell.sell, // 买卖方向 0买1卖
                         PriceDisplayMode: 1, // 浮动价显示方式 1:合并显示 2:分开显示
                         CanBargain: 0, // 挂牌是否可议价0:不可1:可-摘牌是否议价
                         Attachment1: '', // 附件1