huangbin před 4 roky
rodič
revize
3647131102

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

@@ -173,7 +173,7 @@
 </template>
 
 <script lang="ts">
-import { defineComponent, onMounted, PropType, ref } from 'vue';
+import { defineComponent, onBeforeUnmount, onMounted, onUnmounted, PropType, ref } from 'vue';
 import { enumOrderComponents } from '@/common/constants/enumOrderComponents';
 import Drawer from '@/common/components/drawer/index.vue';
 import { QueryWrPositionReq, WrHoldLB, WrPosition } from '@/services/go/wrtrade/interface';

+ 4 - 1
src/views/order/spot_warran/components/spot_warrant_spot_details/components/listing/setup.ts

@@ -5,7 +5,7 @@ import { getRules } from '@/services/bus/rules';
 import { Goods } from "@/services/go/ermcp/goodsInfo/interface";
 import { WrHoldLB } from "@/services/go/wrtrade/interface";
 import { RuleObject } from 'ant-design-vue/lib/form/interface';
-import { reactive, ref, UnwrapRef } from "vue";
+import { onBeforeUnmount, reactive, ref, UnwrapRef } from "vue";
 import { ListingForm } from "./interface";
 
 const formState: UnwrapRef<ListingForm> = reactive({
@@ -47,6 +47,9 @@ export function handleForm(data: WrHoldLB) {
         PriceMove: [{ required: true, message: '请输入升贴水', trigger: 'blur', type: 'number', }],
         goodsid: [{ required: true, validator: v_group, }],
     }
+    onBeforeUnmount(() => {
+        formRef.value.resetFields();
+    });
     return { rules, formState, formRef }
 }