|
|
@@ -3,7 +3,7 @@
|
|
|
<a-modal class="commonModal add-futures"
|
|
|
title="修改期货账户"
|
|
|
v-model:visible="visible"
|
|
|
- @cancel="cancel"
|
|
|
+ @cancel="closeAction"
|
|
|
centered
|
|
|
:maskClosable="false"
|
|
|
width="890px">
|
|
|
@@ -55,6 +55,7 @@
|
|
|
name="password">
|
|
|
<a-input-password class="dialogInput"
|
|
|
style="width: 200px"
|
|
|
+ autocomplete="new-password"
|
|
|
v-model:value="formState.password"
|
|
|
placeholder="请输入登录密码" />
|
|
|
</a-form-item>
|
|
|
@@ -97,10 +98,13 @@ export default defineComponent({
|
|
|
const { visible, cancel } = closeModal('account_info_futures_btn_modify');
|
|
|
const loading = ref<boolean>(false);
|
|
|
const companyList = ref<ErmcpFuturesCompany[]>([]);
|
|
|
- const { rules, formState, formRef } = handleAddOrModifyFuturesForm();
|
|
|
+ const { rules, formState, formRef, initFormData } = handleAddOrModifyFuturesForm();
|
|
|
watchEffect(() => {
|
|
|
if (visible.value) {
|
|
|
- mergeTwoObj(formState, props.selectedData.mainAcc);
|
|
|
+ mergeTwoObj(formState, props.selectedData?.mainAcc);
|
|
|
+ if(props.selectedData?.mainAcc) {
|
|
|
+ formState.accountid = props.selectedData.mainAcc.accountid.toString()
|
|
|
+ }
|
|
|
queryResultLoadingAndInfo(QueryFuturesCompany, loading).then((res) => {
|
|
|
companyList.value = res;
|
|
|
});
|
|
|
@@ -121,17 +125,21 @@ export default defineComponent({
|
|
|
// };
|
|
|
|
|
|
requestResultLoadingAndInfo(hedgeOutMainReq, {}, loading, ['新增账户成功', '新增账户失败:']).then(() => {
|
|
|
- cancel();
|
|
|
+ closeAction();
|
|
|
context.emit('refresh');
|
|
|
});
|
|
|
});
|
|
|
}
|
|
|
+ function closeAction() {
|
|
|
+ Object.assign(formState, initFormData())
|
|
|
+ cancel();
|
|
|
+ }
|
|
|
return {
|
|
|
formState,
|
|
|
rules,
|
|
|
formRef,
|
|
|
visible,
|
|
|
- cancel,
|
|
|
+ closeAction,
|
|
|
companyList,
|
|
|
getUserName,
|
|
|
submit,
|