huangbin 4 rokov pred
rodič
commit
c19eb1104b

+ 66 - 49
src/views/market/spot_trade/spot_trade_order_transaction/components/buy-sell-market/index.vue

@@ -1,55 +1,72 @@
 <template>
-    <!-- 买卖大厅 -->
-    <div class="buy-sell-market">
-        <div class="buy-sell-market-title">
-            <a class="backIcon" @click="cancel">
-                <LeftOutlined />
-            </a>
-            <div class="titleBtn">
-                <div class="name">{{selectedRow.goodscode}} {{selectedRow.goodsname}}</div>
-                <div class="arrowRightIcon"></div>
-            </div>
-            <div class="priceBar bdf1 ml20">
-                <div class="greenBar green" @click="changeMarketOrDetail">
-                    <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 class="redBar red">
-                    <div class="numBlock">
-                        <div class="first">买价</div>
-                        <div class="last">{{selectedRow.buyprice}}</div>
-                    </div>
-                    <div class="numBlock">
-                        <div class="first">买量</div>
-                        <div class="last">{{selectedRow.buyqty}}</div>
-                    </div>
-                </div>
-            </div>
-            <BtnList :btnList="btnListData" :record="selectedRow" @click="openComponent" />
+  <!-- 买卖大厅 -->
+  <div class="buy-sell-market">
+    <div class="buy-sell-market-title">
+      <a class="backIcon"
+         @click="cancel">
+        <LeftOutlined />
+      </a>
+      <div class="titleBtn">
+        <div class="name">{{selectedRow.goodscode}} {{selectedRow.goodsname}}</div>
+        <div class="arrowRightIcon"></div>
+      </div>
+      <div class="priceBar bdf1 ml20">
+        <div class="greenBar green"
+             @click="changeMarketOrDetail">
+          <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>
-        <a-row class="buySellHall" v-if="showMarketOrDetail">
-            <a-col :span="12">
-                <Sell ref="sellRef" :parantSelectedRow="deliverGoods" />
-            </a-col>
-            <a-col :span="12">
-                <Buy ref="buyRef" :parantSelectedRow="deliverGoods" />
-            </a-col>
-        </a-row>
-        <StockExchange :deliverGoods="deliverGoods" v-else />
-        <component
-            :is="componentId"
-            v-if="componentId"
-            :selectedRow="deliverGoods"
-            :parantSelectedRow="deliverGoods"
-            @cancel="closeComponent"
-        ></component>
+        <div class="greenBar green"
+             @click="changeMarketOrDetail">
+          <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 class="redBar red">
+          <div class="numBlock">
+            <div class="first">买价</div>
+            <div class="last">{{selectedRow.buyprice}}</div>
+          </div>
+          <div class="numBlock">
+            <div class="first">买量</div>
+            <div class="last">{{selectedRow.buyqty}}</div>
+          </div>
+        </div>
+      </div>
+      <BtnList :btnList="btnListData"
+               :record="selectedRow"
+               @click="openComponent" />
     </div>
+    <a-row class="buySellHall"
+           v-if="showMarketOrDetail">
+      <a-col :span="12">
+        <Sell ref="sellRef"
+              :parantSelectedRow="deliverGoods" />
+      </a-col>
+      <a-col :span="12">
+        <Buy ref="buyRef"
+             :parantSelectedRow="deliverGoods" />
+      </a-col>
+    </a-row>
+    <StockExchange :deliverGoods="deliverGoods"
+                   v-else />
+    <component :is="componentId"
+               v-if="componentId"
+               :selectedRow="deliverGoods"
+               :parantSelectedRow="deliverGoods"
+               @cancel="closeComponent"></component>
+  </div>
 </template>
 
 <script lang="ts">

+ 8 - 8
src/views/market/spot_trade/spot_trade_order_transaction/components/listing/index.vue

@@ -122,15 +122,15 @@ import { _closeModal } from '@/common/setup/modal/modal';
 import { handleForm } from './setup';
 import { validateAction } from '@/common/setup/form';
 import { FormState } from './interface';
-import {BuyOrSell, DelistingType, PriceType} from '@/common/constants/enumCommon';
+import { BuyOrSell, DelistingType, PriceType } from '@/common/constants/enumCommon';
 import { EnumRouterName } from '@/common/constants/enumRouterName';
 import { getCanUseMoney } from '@/services/bus/account';
 import { QueryDeliveryRelationRsp } from '@/services/go/delivery/interface';
-import {ListingForm} from "@/views/market/spot_trade/spot_trade_order_transaction/components/delisting/interface";
-import {OrderReq} from "@/services/socket/order/interface";
-import {getLongTypeLoginID} from "@/services/bus/login";
-import {LongType} from "@/services/socket/login/interface";
-import {Order} from "@/services/socket/order";
+import { ListingForm } from '@/views/market/spot_trade/spot_trade_order_transaction/components/delisting/interface';
+import { OrderReq } from '@/services/socket/order/interface';
+import { getLongTypeLoginID } from '@/services/bus/login';
+import { LongType } from '@/services/socket/login/interface';
+import { Order } from '@/services/socket/order';
 export default defineComponent({
     name: ModalEnum.spot_trade_warehouse_financing_delisting,
     components: { Drawer, PlusOutlined, MinusOutlined },
@@ -161,7 +161,7 @@ export default defineComponent({
         function getMoney() {}
         // const { getMaxNum, getMoney, getMargin } = handleNumAndMoney(props.enumName, props.buyOrSell, props.selectedRow, props.parantSelectedRow, formState);
         function submit() {
-            // validateAction<ListingForm>(formRef, formState).then((res) => {
+            validateAction<FormState>(formRef, formState).then((res) => {
                 // 摘牌请求
                 // const param: OrderReq = {
                 //     ClientSerialNo: uuidv4(), // 客户端流水号
@@ -202,7 +202,7 @@ export default defineComponent({
                 // requestResultLoadingAndInfo(Order, param, loading, ['摘牌成功', '摘牌失败:']).then(() => {
                 //     cancel(true);
                 // });
-            // });
+            });
         }
 
         return {

+ 9 - 3
src/views/market/spot_trade/spot_trade_order_transaction/components/listing/setup.ts

@@ -10,10 +10,16 @@ export function handleForm() {
     })
     const rules = {
         accountid: [{ required: true, message: '请选择交易账户' }],
-        LadingBillId: [{ required: true, message: '请选择现货仓单' }],
-        num: [{ required: true, message: '请输入挂牌数量', trigger: 'blur', type: 'number' }],
-        price: [{ required: true, message: '请输入挂牌价格', trigger: 'blur', type: 'number' }],
+        num: [
+            { required: true, message: '请输入挂牌数量', trigger: 'blur', type: 'number' },
+            { message: '挂牌数量不能小于0', min: 1, type: 'number' }
+        ],
+        price: [
+            { required: true, message: '请输入挂牌价格', trigger: 'blur', type: 'number' },
+            { message: '挂牌价格不能小于0', min: 1, type: 'number' }
+        ],
 
     }
     return { rules, formState, formRef }
+
 }