yu.jie пре 4 година
родитељ
комит
56def62e23

+ 132 - 125
src/views/information/account_info/compoments/cancel-futures/index.vue

@@ -1,145 +1,152 @@
 <template>
-  <!-- 注销账户 -->
-  <a-modal class="add-custom"
-           title="注销账户"
-           v-model:visible="visible"
-           @cancel="cancel"
-           centered
-           :maskClosable="false"
-           width="890px">
-    <template #footer>
-      <a-button key="submit"
-                type="primary"
-                :loading="loading"
-                @click="cancel">取消
-      </a-button>
-      <a-button key="submit"
-                type="primary"
-                :loading="loading"
-                @click="submit">注销
-      </a-button>
-    </template>
-    <a-form class="inlineForm">
-      <a-row :gutter="24">
-        <a-col :span="12">
-          <a-form-item label="所属期货账户"
-                       name="userinfotype">
-            <span class="white">{{selectedData.mainAcc.accountname}}/{{selectedData.mainAcc.hedgeaccountcode}}</span>
-          </a-form-item>
-        </a-col>
-        <a-col :span="12">
-          <a-form-item label="账户名称"
-                       name="accountname">
-            <span class="white">{{secondeData.accountname}}</span>
-          </a-form-item>
-        </a-col>
-        <a-col :span="12">
-          <a-form-item label="期货保证金"
-                       name="trademargintmpid">
+    <!-- 注销账户 -->
+    <a-modal class="add-custom"
+             title="注销账户"
+             v-model:visible="visible"
+             @cancel="cancel"
+             centered
+             :maskClosable="false"
+             width="890px">
+        <template #footer>
+            <a-button key="submit"
+                      type="primary"
+                      :loading="loading"
+                      @click="cancel">取消
+            </a-button>
+            <a-button key="submit"
+                      type="primary"
+                      :loading="loading"
+                      @click="submit">注销
+            </a-button>
+        </template>
+        <a-form class="inlineForm">
+            <a-row :gutter="24">
+                <a-col :span="12">
+                    <a-form-item label="所属期货账户"
+                                 name="userinfotype">
+                        <span class="white">{{selectedData.mainAcc.accountname}}/{{selectedData.mainAcc.hedgeaccountcode}}</span>
+                    </a-form-item>
+                </a-col>
+                <a-col :span="12">
+                    <a-form-item label="账户名称"
+                                 name="accountname">
+                        <span class="white">{{secondeData.accountname}}</span>
+                    </a-form-item>
+                </a-col>
+                <a-col :span="12">
+                    <a-form-item label="期货保证金"
+                                 name="trademargintmpid">
             <span class="white"
                   v-if="marginList.length">{{marginList[0].tradeconfigtmpname}}</span>
-            <span class="white"
-                  v-else>--</span>
-          </a-form-item>
-        </a-col>
-        <a-col :span="12">
-          <a-form-item label="期货手续费"
-                       name="tradefeetmpid">
+                        <span class="white"
+                              v-else>--</span>
+                    </a-form-item>
+                </a-col>
+                <a-col :span="12">
+                    <a-form-item label="期货手续费"
+                                 name="tradefeetmpid">
             <span class="white"
                   v-if="feeList.length">{{feeList[0].tradeconfigtmpname}}</span>
-            <span class="white"
-                  v-else>--</span>
-          </a-form-item>
-        </a-col>
-        <a-col :span="24">
-          <a-form-item label="指定交易用户"
-                       name="traderUserId">
+                        <span class="white"
+                              v-else>--</span>
+                    </a-form-item>
+                </a-col>
+                <a-col :span="24">
+                    <a-form-item label="指定交易用户"
+                                 name="traderUserId">
             <span class="white"
                   v-if="userList.length">{{userList[0].rolename}}</span>
-            <span class="white"
-                  v-else>--</span>
-          </a-form-item>
-        </a-col>
-      </a-row>
-    </a-form>
-  </a-modal>
+                        <span class="white"
+                              v-else>--</span>
+                    </a-form-item>
+                </a-col>
+            </a-row>
+        </a-form>
+    </a-modal>
 </template>
 
 <script lang="ts">
-import { closeModal } from '@/common/setup/modal/index';
-import { defineComponent, ref, PropType, watchEffect } from 'vue';
-import { Modal } from 'ant-design-vue';
-import {LoginaccountOperateReq, TaaccountOperateReq} from '@/services/proto/accountinfo/interface';
-import { requestResultLoadingAndInfo } from '@/common/methods/request/resultInfo';
-import {loginAccountOperate, taAccountOperateReq} from '@/services/proto/accountinfo';
-import { ErmcpLoginUser, ErmcpLoginUserEx, ErmcpTaAccount, ErmcpTaAccountEx } from '@/services/go/ermcp/account/interface';
-import { handleBusinessForm, handleRoleName } from '../setup';
-import { mergeTwoObj } from '@/utils/objHandle';
-import {getLongTypeLoginID} from "@/services/bus/login";
-import { ErmcpTradeConfigTMP } from '@/services/go/ermcp/business-review/interface';
+    import {closeModal} from '@/common/setup/modal/index';
+    import {defineComponent, ref, PropType, watchEffect} from 'vue';
+    import {Modal} from 'ant-design-vue';
+    import {LoginaccountOperateReq, TaaccountOperateReq} from '@/services/proto/accountinfo/interface';
+    import {requestResultLoadingAndInfo} from '@/common/methods/request/resultInfo';
+    import {loginAccountOperate, taAccountOperateReq} from '@/services/proto/accountinfo';
+    import {
+        ErmcpLoginUser,
+        ErmcpLoginUserEx,
+        ErmcpTaAccount,
+        ErmcpTaAccountEx
+    } from '@/services/go/ermcp/account/interface';
+    import {handleBusinessForm, handleRoleName} from '../setup';
+    import {mergeTwoObj} from '@/utils/objHandle';
+    import {getLongTypeLoginID} from "@/services/bus/login";
+    import {ErmcpTradeConfigTMP} from '@/services/go/ermcp/business-review/interface';
 
-export default defineComponent({
-    name: 'account_info_futures_btn_child_cancel',
+    export default defineComponent({
+        name: 'account_info_futures_btn_child_cancel',
         components: {},
         props: {
-        selectedData: {
-            type: Object as PropType<ErmcpTaAccountEx>,
-            default: {},
-        },
-                secondeData: {
-            default: {},
-            type: Object as PropType<ErmcpTaAccount>,
-        },
-        userList: {
-            type: Array as PropType<ErmcpLoginUserEx[]>,
-            default: [],
+            selectedData: {
+                type: Object as PropType<ErmcpTaAccountEx>,
+                default: {},
+            },
+            secondeData: {
+                default: {},
+                type: Object as PropType<ErmcpTaAccount>,
+            },
+            userList: {
+                type: Array as PropType<ErmcpLoginUserEx[]>,
+                default: [],
+            },
+            marginList: {
+                type: Array as PropType<ErmcpTradeConfigTMP[]>,
+                default: [],
+            },
+            feeList: {
+                type: Array as PropType<ErmcpTradeConfigTMP[]>,
+                default: [],
+            },
         },
-        marginList: {
-            type: Array as PropType<ErmcpTradeConfigTMP[]>,
-            default: [],
-        },
-        feeList: {
-            type: Array as PropType<ErmcpTradeConfigTMP[]>,
-            default: [],
-        },
-    },
-    setup(props, context) {
-        // 控制关闭弹窗
-        const { visible, cancel } = closeModal('account_info_futures_btn_child_cancel');
-        const loading = ref<boolean>(false);
-        function submit() {
-            Modal.confirm({
-                title: '是否确认注销该账户',
-                okText: '确认注销',
-                cancelText: '取消',
-                onOk() {
-                    // let reqParam: TaaccountOperateReq = {
-                    //     accountid: props.selectedData.accountid, // uint64 期货账户ID
-                    //     tradestatus: 7,// double 授信金额正为加负为减
-                    //     modifierid: Number(getLongTypeLoginID()),// uint64 修改人
-                    //     areauserid: props.selectedData.relateduserid,// uint64 机构用户ID
-                    // };
-                    // requestResultLoadingAndInfo(taAccountOperateReq, reqParam, loading, ['账户注销成功', '账户注销失败:']).then(() => {
-                    //     cancel();
-                    //     context.emit('refresh');
-                    // });
-                },
-                onCancel() {},
-            });
-        }
+        setup(props, context) {
+            // 控制关闭弹窗
+            const {visible, cancel} = closeModal('account_info_futures_btn_child_cancel');
+            const loading = ref<boolean>(false);
 
-        return {
-            visible,
-            cancel,
-            submit,
-            loading,
-        };
-    },
-});
+            function submit() {
+                Modal.confirm({
+                    title: '是否确认注销该账户',
+                    okText: '确认注销',
+                    cancelText: '取消',
+                    onOk() {
+                        let reqParam: TaaccountOperateReq = {
+                            accountid: props.secondeData.accountid,  // uint64 期货账户ID
+                            tradestatus: 7, // uint32 7注销
+                            modifierid: Number(getLongTypeLoginID()), // uint64 修改人
+                            areauserid: Number(props.secondeData.relateduserid), // uint64 机构用户ID
+                        };
+                        requestResultLoadingAndInfo(taAccountOperateReq, reqParam, loading, ['账户注销成功', '账户注销失败:']).then(() => {
+                            cancel();
+                            context.emit('refresh');
+                        });
+                    },
+                    onCancel() {
+                    },
+                });
+            }
+
+            return {
+                visible,
+                cancel,
+                submit,
+                loading,
+            };
+        },
+    });
 </script>
 
 <style lang="less">
-.add-custom {
-}
+    .add-custom {
+    }
 </style
 >;

+ 148 - 145
src/views/information/account_info/compoments/credit-futures/index.vue

@@ -1,158 +1,161 @@
 <template>
-  <!-- 授信-->
-  <a-modal class="add-custom custom-detail"
-           title="授信"
-           v-model:visible="visible"
-           centered
-           :maskClosable="maskClosableFlag"
-           @cancel="cancel"
-           width="890px">
-    <template #footer>
-      <a-button key="submit"
-                type="primary"
-                :loading="loading"
-                @click="cancel">取消
-      </a-button>
-      <a-button key="submit"
-                type="primary"
-                :loading="loading"
-                @click="submit">授信
-      </a-button>
-    </template>
-    <a-form class="inlineForm">
-      <a-row :gutter="24">
-        <a-col :span="12">
-          <a-form-item label="账户名称"
-                       name="userid">
-            <span class="white">{{secondeData.accountname}}</span>
-          </a-form-item>
-        </a-col>
-        <a-col :span="12">
-          <a-form-item label="资金账号"
-                       name="">
-            <span class="white">{{secondeData.accountid}}</span>
-          </a-form-item>
-        </a-col>
-        <a-col :span="12">
-          <a-form-item label="授信总额"
-                       name="">
-            <span class="white"> {{mortgagecredit}}</span>
-          </a-form-item>
-        </a-col>
-        <a-col :span="12">
-          <a-form-item label="子账户当前余额"
-                       name="">
-            <span class="white">{{currentbalance}}</span>
-          </a-form-item>
-        </a-col>
-        <a-col :span="12">
-          <a-form-item label="授信金额"
-                       class="relative"
-                       name="">
-            <a-input class="dialogInput"
-                     style="width: 200px"
-                     v-model:value="money"
-                     placeholder="请输入授信金额"></a-input>
-            <div class="tip">正数为增加,负数为减少</div>
-          </a-form-item>
-        </a-col>
-      </a-row>
-    </a-form>
-  </a-modal>
+    <!-- 授信-->
+    <a-modal class="add-custom custom-detail"
+             title="授信"
+             v-model:visible="visible"
+             centered
+             :maskClosable="maskClosableFlag"
+             @cancel="cancel"
+             width="890px">
+        <template #footer>
+            <a-button key="submit"
+                      type="primary"
+                      :loading="loading"
+                      @click="cancel">取消
+            </a-button>
+            <a-button key="submit"
+                      type="primary"
+                      :loading="loading"
+                      @click="submit">授信
+            </a-button>
+        </template>
+        <a-form class="inlineForm">
+            <a-row :gutter="24">
+                <a-col :span="12">
+                    <a-form-item label="账户名称"
+                                 name="userid">
+                        <span class="white">{{secondeData.accountname}}</span>
+                    </a-form-item>
+                </a-col>
+                <a-col :span="12">
+                    <a-form-item label="资金账号"
+                                 name="">
+                        <span class="white">{{secondeData.accountid}}</span>
+                    </a-form-item>
+                </a-col>
+                <a-col :span="12">
+                    <a-form-item label="授信总额"
+                                 name="">
+                        <span class="white"> {{mortgagecredit}}</span>
+                    </a-form-item>
+                </a-col>
+                <a-col :span="12">
+                    <a-form-item label="子账户当前余额"
+                                 name="">
+                        <span class="white">{{currentbalance}}</span>
+                    </a-form-item>
+                </a-col>
+                <a-col :span="12">
+                    <a-form-item label="授信金额"
+                                 class="relative"
+                                 name="">
+                        <a-input class="dialogInput"
+                                 style="width: 200px"
+                                 v-model:value="money"
+                                 placeholder="请输入授信金额"></a-input>
+                        <div class="tip">正数为增加,负数为减少</div>
+                    </a-form-item>
+                </a-col>
+            </a-row>
+        </a-form>
+    </a-modal>
 </template>
 
 <script lang="ts">
-import { defineComponent, PropType, ref, toRaw, watchEffect } from 'vue';
-import { closeModal } from '@/common/setup/modal/index';
-import {ErmcpLoginUser, ErmcpTaAccount, ErmcpTaAccountEx} from '@/services/go/ermcp/account/interface';
-import { message, Modal } from 'ant-design-vue';
-import { requestResultLoadingAndInfo } from '@/common/methods/request/resultInfo';
-import {LoginaccountOperateReq, TaaccountTransfersxmoneyReq} from '@/services/proto/accountinfo/interface';
-import {loginAccountOperate, taAccountTransfersXMoneyReq} from '@/services/proto/accountinfo';
-import {getLongTypeLoginID} from "@/services/bus/login";
-import { QueryAccMgrTaAccountInfo } from '@/services/go/ermcp/account';
-import { getUserId } from '@/services/bus/account';
+    import {defineComponent, PropType, ref, toRaw, watchEffect} from 'vue';
+    import {closeModal} from '@/common/setup/modal/index';
+    import {ErmcpLoginUser, ErmcpTaAccount, ErmcpTaAccountEx} from '@/services/go/ermcp/account/interface';
+    import {message, Modal} from 'ant-design-vue';
+    import {requestResultLoadingAndInfo} from '@/common/methods/request/resultInfo';
+    import {LoginaccountOperateReq, TaaccountTransfersxmoneyReq} from '@/services/proto/accountinfo/interface';
+    import {loginAccountOperate, taAccountTransfersXMoneyReq} from '@/services/proto/accountinfo';
+    import {getLongTypeLoginID} from "@/services/bus/login";
+    import {QueryAccMgrTaAccountInfo} from '@/services/go/ermcp/account';
+    import {getUserId} from '@/services/bus/account';
 
-export default defineComponent({
-    name: 'account_info_futures_btn_child_credit',
-    components: {},
-    props: {
-        selectedData: {
-            type: Object as PropType<ErmcpTaAccount>,
-            default: {},
+    export default defineComponent({
+        name: 'account_info_futures_btn_child_credit',
+        components: {},
+        props: {
+            selectedData: {
+                type: Object as PropType<ErmcpTaAccount>,
+                default: {},
+            },
+            secondeData: {
+                default: {},
+                type: Object as PropType<ErmcpTaAccount>,
+            },
         },
-                secondeData: {
-            default: {},
-            type: Object as PropType<ErmcpTaAccount>,
-        },
-    },
-    setup(props, context) {
-        const { visible, cancel } = closeModal('account_info_futures_btn_child_credit');
-        const loading = ref<boolean>(false);
-        // 当前余额
-        const currentbalance  = ref<number>(0)
-        // 授信总额
-        const mortgagecredit  = ref<number>(0)
-        const money = ref<number | null>(null)
-        watchEffect(() => {
-          if(visible.value && props.secondeData?.accountid) {
-            const param = {
-              userid: getUserId(),
-              accountid: props.secondeData.accountid
-            }
-            QueryAccMgrTaAccountInfo(param).then(res => {
-              console.log(res);
-              if (res.length) {
-                currentbalance.value = res[0].currentbalance
-                mortgagecredit.value = res[0].mortgagecredit
-              }
+        setup(props, context) {
+            const {visible, cancel} = closeModal('account_info_futures_btn_child_credit');
+            const loading = ref<boolean>(false);
+            // 当前余额
+            const currentbalance = ref<number>(0)
+            // 授信总额
+            const mortgagecredit = ref<number>(0)
+            const money = ref<number | null>(null)
+            watchEffect(() => {
+                if (visible.value && props.secondeData?.accountid) {
+                    const param = {
+                        userid: getUserId(),
+                        accountid: props.secondeData.accountid
+                    }
+                    QueryAccMgrTaAccountInfo(param).then(res => {
+                        console.log(res);
+                        if (res.length) {
+                            currentbalance.value = res[0].currentbalance
+                            mortgagecredit.value = res[0].mortgagecredit
+                        }
+                    })
+                }
             })
-          }
-        })
-        function submit() {
-            Modal.confirm({
-                title: '是否确认授信账户',
-                okText: '确认授信',
-                cancelText: '取消',
-                onOk() {
-                  const param = toRaw(money)
-                  if (param) {
-                                        let reqParam: TaaccountTransfersxmoneyReq = {
-                        accountid: props.selectedData.accountid, // uint64 期货账户ID
-                        sxmoney: 1,// double 授信金额正为加负为减
-                        modifierid: Number(getLongTypeLoginID()),// uint64 修改人
-                        areauserid: props.selectedData.relateduserid,// uint64 机构用户ID
-                    };
-                    requestResultLoadingAndInfo(taAccountTransfersXMoneyReq, reqParam, loading, ['账户授信成功', '账户授信失败:']).then(() => {
-                        cancel();
-                        context.emit('refresh');
-                    });
-                  } else {
-                    message.error('请输入授信金额')
-                  }
 
-                },
-                onCancel() {},
-            });
-        }
-        return {
-            visible,
-            cancel,
-            maskClosableFlag: false,
-            submit,
-            loading,
-            currentbalance,
-            mortgagecredit,
-            money,
-        };
-    },
-});
+            function submit() {
+                Modal.confirm({
+                    title: '是否确认授信账户',
+                    okText: '确认授信',
+                    cancelText: '取消',
+                    onOk() {
+                        const param = toRaw(money)
+                        if (param) {
+                            let reqParam: TaaccountTransfersxmoneyReq = {
+                                accountid: props.secondeData.accountid, // uint64 期货账户ID
+                                sxmoney: Number(param.value as number),// double 授信金额正为加负为减
+                                modifierid: Number(getLongTypeLoginID()),// uint64 修改人
+                                areauserid: Number(props.secondeData.relateduserid),// uint64 机构用户ID
+                            };
+                            requestResultLoadingAndInfo(taAccountTransfersXMoneyReq, reqParam, loading, ['账户授信成功', '账户授信失败:']).then(() => {
+                                cancel();
+                                context.emit('refresh');
+                            });
+                        } else {
+                            message.error('请输入授信金额')
+                        }
+
+                    },
+                    onCancel() {
+                    },
+                });
+            }
+
+            return {
+                visible,
+                cancel,
+                maskClosableFlag: false,
+                submit,
+                loading,
+                currentbalance,
+                mortgagecredit,
+                money,
+            };
+        },
+    });
 </script>
 
 <style lang="less">
-.custom-detail {
-    .ant-form.inlineForm {
-        margin-top: 20px;
+    .custom-detail {
+        .ant-form.inlineForm {
+            margin-top: 20px;
+        }
     }
-}
 </style>;