huangbin 4 lat temu
rodzic
commit
fede792507

+ 8 - 5
src/views/platinum/platinum_agreement/compoments/add/index.vue

@@ -3,7 +3,7 @@
   <a-modal class="add-custom"
            title="新增协议"
            v-model:visible="visible"
-           @cancel="cancel"
+           @cancel="colseAction"
            centered
            :maskClosable="false"
            width="890px">
@@ -79,7 +79,7 @@
 <script lang="ts">
 import { closeModal } from '@/common/setup/modal/index';
 import { defineComponent, ref } from 'vue';
-import { handleForm } from './setup';
+import { handleForm, initFormState } from './setup';
 import { FormState } from './interface';
 import { validateAction } from '@/common/setup/form';
 import { requestResultLoadingAndInfo } from '@/common/methods/request/resultInfo';
@@ -100,7 +100,10 @@ export default defineComponent({
         const { getAgreementTypeList, getRate } = handleArgreementType(formState);
 
         const loading = ref<boolean>(false);
-
+        function colseAction() {
+            Object.assign(formState, initFormState());
+            cancel();
+        }
         function submit(OperateType: 1 | 2) {
             validateAction<FormState>(formRef, formState).then((param) => {
                 const reqParam: QHJAgreementConfigOperateReq = {
@@ -113,7 +116,7 @@ export default defineComponent({
                     operateid: getUserId(), // uint64 操作人
                 };
                 requestResultLoadingAndInfo(agreementConfigOperate, reqParam, loading, ['新增协议成功', '新增协议失败:']).then(() => {
-                    cancel();
+                    colseAction();
                     context.emit('refresh');
                 });
             });
@@ -126,7 +129,7 @@ export default defineComponent({
             rules,
             formRef,
             visible,
-            cancel,
+            colseAction,
             submit,
             loading,
         };