فهرست منبع

fiexd: 修改贸易圈摘牌 方向传错

huangbin 4 سال پیش
والد
کامیت
612be4fead

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

@@ -302,14 +302,14 @@ export default defineComponent({
                     };
                     // 摘买方向
                     if (isBuy()) {
+                      param.BuyOrSell = BuyOrSell.sell;
+                    } else {
                         param.BuyOrSell = BuyOrSell.buy;
                         param.LadingBillId = res.LadingBillId;
                         const item = wrHoldList.value.find((el) => el.id === res.LadingBillId);
                         if (item) {
                             param.SubNum = +item.subnum;
                         }
-                    } else {
-                        param.BuyOrSell = BuyOrSell.sell;
                     }
 
                     requestResultLoadingAndInfo(HdWRDealOrder, param, loading, ['摘牌成功', '摘牌失败:']).then(() => {

+ 4 - 1
src/views/market/spot_trade/warehouse_pre_sale/warehouse_pre_sale_blocs/index.vue

@@ -24,6 +24,7 @@ import Buy from './components/buy/index.vue';
 import Sell from './components/sell/index.vue';
 import { handleModalComponent } from '@/common/setup/asyncComponent';
 import { ref } from 'vue';
+import Bus from '@/utils/eventBus';
 
 export default defineComponent({
     name: EnumRouterName.warehouse_pre_sale_blocs,
@@ -36,7 +37,9 @@ export default defineComponent({
     setup() {
         const isBottom = getShowBottomValue();
         const selectedRow = ref();
-        function queryFn() {}
+        function queryFn() {
+            Bus.$emit('spotTrade', true);
+        }
         // 控制异步组件
         const { componentId, closeComponent } = handleModalComponent(queryFn, selectedRow);
         function search() {}

+ 6 - 2
src/views/market/spot_trade/warehouse_receipt_trade/warehouse_receipt_trade_blocs/components/delisting/index.vue

@@ -302,10 +302,14 @@ export default defineComponent({
                     };
                     // 摘买方向
                     if (isBuy()) {
+                        param.BuyOrSell = BuyOrSell.sell;
+                    } else {
                         param.BuyOrSell = BuyOrSell.buy;
                         param.LadingBillId = res.LadingBillId;
-                    } else {
-                        param.BuyOrSell = BuyOrSell.sell;
+                        const item = wrHoldList.value.find((el) => el.id === res.LadingBillId);
+                        if (item) {
+                            param.SubNum = +item.subnum;
+                        }
                     }
 
                     requestResultLoadingAndInfo(HdWRDealOrder, param, loading, ['摘牌成功', '摘牌失败:']).then(() => {

+ 6 - 1
src/views/market/spot_trade/warehouse_receipt_trade/warehouse_receipt_trade_blocs/components/delisting/setup.ts

@@ -1,8 +1,10 @@
 import { BuyOrSell } from "@/common/constants/enumCommon";
 import { queryResultLoadingAndInfo } from "@/common/methods/request/resultInfo";
+import { validateCommon } from "@/common/setup/validate";
 import { queryHoldLB } from "@/services/go/wrtrade";
 import { QueryOrderQuoteMyqQsp, WrHoldLB } from "@/services/go/wrtrade/interface";
 import { Wrhold } from "@/views/market/spot_trade/spot_trade_order_transaction/components/delisting/interface";
+import { RuleObject } from "ant-design-vue/lib/form/interface";
 import { reactive, Ref, ref, UnwrapRef } from "vue";
 import { ListingForm } from "./interface";
 
@@ -18,12 +20,15 @@ export function handleForm() {
         case: '',
         caseId: 0
     })
+    const v_ContractType = async (rule: RuleObject, value: number) => {
+        return validateCommon(value, '请输入摘牌数量');
+    };
     const rules = {
         accountid: [{ required: true, message: '请选择交易账户' }],
         LadingBillId: [{ required: true, message: '请选择现货仓单' }],
         caseId: [{ required: true, message: '请选择融资方案' }],
         num: [{ required: true, message: '请输入摘牌数量', trigger: 'blur', type: 'number', },
-        { min: 1, message: '请输入摘牌数量' }],
+        { required: true, validator: v_ContractType }],
 
     }
     return { rules, formState, formRef }

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

@@ -24,6 +24,7 @@ import Buy from './components/buy/index.vue';
 import Sell from './components/sell/index.vue';
 import { handleModalComponent } from '@/common/setup/asyncComponent';
 import { ref } from 'vue';
+import Bus from '@/utils/eventBus';
 
 export default defineComponent({
     name: EnumRouterName.warehouse_receipt_trade_blocs,
@@ -36,7 +37,9 @@ export default defineComponent({
     setup() {
         const isBottom = getShowBottomValue();
         const selectedRow = ref();
-        function queryFn() {}
+        function queryFn() {
+            Bus.$emit('spotTrade', true);
+        }
         // 控制异步组件
         const { componentId, closeComponent } = handleModalComponent(queryFn, selectedRow);
         function search() {}