|
@@ -25,10 +25,10 @@
|
|
|
v-model:value="formState.roleids">
|
|
v-model:value="formState.roleids">
|
|
|
<a-row>
|
|
<a-row>
|
|
|
<a-col :span="12">
|
|
<a-col :span="12">
|
|
|
- <a-checkbox value="22">业务员</a-checkbox>
|
|
|
|
|
|
|
+ <a-checkbox :value="22">业务员</a-checkbox>
|
|
|
</a-col>
|
|
</a-col>
|
|
|
<a-col :span="12">
|
|
<a-col :span="12">
|
|
|
- <a-checkbox value="23">跟单员</a-checkbox>
|
|
|
|
|
|
|
+ <a-checkbox :value="23">跟单员</a-checkbox>
|
|
|
</a-col>
|
|
</a-col>
|
|
|
</a-row>
|
|
</a-row>
|
|
|
</a-checkbox-group>
|
|
</a-checkbox-group>
|
|
@@ -77,73 +77,49 @@
|
|
|
|
|
|
|
|
<script lang="ts">
|
|
<script lang="ts">
|
|
|
import { closeModal } from '@/common/setup/modal/index';
|
|
import { closeModal } from '@/common/setup/modal/index';
|
|
|
-import { defineComponent, ref, toRaw } from 'vue';
|
|
|
|
|
|
|
+import { defineComponent, ref, toRaw, watchEffect } from 'vue';
|
|
|
import { ValidateErrorEntity } from 'ant-design-vue/es/form/interface';
|
|
import { ValidateErrorEntity } from 'ant-design-vue/es/form/interface';
|
|
|
-import { handleForm, FormState } from './setup';
|
|
|
|
|
-import {requestResultLoadingAndInfo} from "@/common/methods/request/resultInfo";
|
|
|
|
|
-import {QueryAddUserInfoApply} from "@/services/go/ermcp/customInfo";
|
|
|
|
|
-import {loginAccountOperate} from "@/services/proto/accountinfo";
|
|
|
|
|
-import {getUserId} from "@/services/bus/account";
|
|
|
|
|
-import {getLongTypeLoginID} from "@/services/bus/login";
|
|
|
|
|
-import {LoginaccountOperateReq} from "@/services/proto/accountinfo/interface";
|
|
|
|
|
|
|
+import { handleBusinessForm } from '../setup';
|
|
|
|
|
+import { BusinessFormState } from '../interface';
|
|
|
|
|
+import { requestResultLoadingAndInfo } from '@/common/methods/request/resultInfo';
|
|
|
|
|
+import { loginAccountOperate } from '@/services/proto/accountinfo';
|
|
|
|
|
|
|
|
export default defineComponent({
|
|
export default defineComponent({
|
|
|
name: 'add-business-info',
|
|
name: 'add-business-info',
|
|
|
components: {},
|
|
components: {},
|
|
|
|
|
+ props: {
|
|
|
|
|
+ roleid: {
|
|
|
|
|
+ default: 0,
|
|
|
|
|
+ type: Number,
|
|
|
|
|
+ },
|
|
|
|
|
+ },
|
|
|
setup(props, context) {
|
|
setup(props, context) {
|
|
|
// 控制关闭弹窗
|
|
// 控制关闭弹窗
|
|
|
const { visible, cancel } = closeModal('account_info_business_btn_add');
|
|
const { visible, cancel } = closeModal('account_info_business_btn_add');
|
|
|
const loading = ref<boolean>(false);
|
|
const loading = ref<boolean>(false);
|
|
|
- const { rules, formState, formRef } = handleForm();
|
|
|
|
|
- function submit() {
|
|
|
|
|
-
|
|
|
|
|
- let reqParam :LoginaccountOperateReq = {
|
|
|
|
|
- operatetype: 1, // uint32 操作类型-1:新增 2:修改 3:新增管理员 4:修改管理员 5:锁定 6:解锁 7:注销 8:恢复 9:重置密码 10:新增登录帐号 11:停用用户 12:恢复用户 13:修改用户信息
|
|
|
|
|
- // userid: number, // uint64 用户ID(新增成功接口返回的userid)
|
|
|
|
|
- // loginid: number, // uint64 登录ID(新增成功接口返回的loginid)
|
|
|
|
|
- areauserid: getUserId(), // uint64 所属机构(当前登录userid 必填)
|
|
|
|
|
- logincode: "10002130", // string 登录账号
|
|
|
|
|
- accountname: "test432423", // string 账户名称
|
|
|
|
|
- password: "123123", // string 登录密码(明文)
|
|
|
|
|
- mobile: "131111111111", // string 手机号码(明文)
|
|
|
|
|
- roleids: [22], // uint64 账号角色
|
|
|
|
|
- // logintaaccounts: LoginTaaccount[], // LoginTaaccount 期货账户(勾选交易员必填)
|
|
|
|
|
- modifierid: Number(getLongTypeLoginID()), // uint64 修改人ID(当前登录loginid 必填)
|
|
|
|
|
-
|
|
|
|
|
|
|
+ const { rules, formState, formRef } = handleBusinessForm();
|
|
|
|
|
+ watchEffect(() => {
|
|
|
|
|
+ if (visible.value) {
|
|
|
|
|
+ formState.roleids = [props.roleid];
|
|
|
}
|
|
}
|
|
|
- requestResultLoadingAndInfo(loginAccountOperate, reqParam, loading, ['新增账户成功', '新增账户失败:'] ).then(() => {
|
|
|
|
|
- cancel();
|
|
|
|
|
- context.emit('refresh');
|
|
|
|
|
- });
|
|
|
|
|
-
|
|
|
|
|
- // formRef.value
|
|
|
|
|
- // .validate()
|
|
|
|
|
- // .then(() => {
|
|
|
|
|
- // const param = toRaw(formState);
|
|
|
|
|
- // console.log('values', param);
|
|
|
|
|
- //
|
|
|
|
|
- // let reqParam :LoginaccountOperateReq = {
|
|
|
|
|
- // operatetype: 1, // uint32 操作类型-1:新增 2:修改 3:新增管理员 4:修改管理员 5:锁定 6:解锁 7:注销 8:恢复 9:重置密码 10:新增登录帐号 11:停用用户 12:恢复用户 13:修改用户信息
|
|
|
|
|
- // // userid: number, // uint64 用户ID(新增成功接口返回的userid)
|
|
|
|
|
- // // loginid: number, // uint64 登录ID(新增成功接口返回的loginid)
|
|
|
|
|
- // areauserid: getUserId(), // uint64 所属机构(当前登录userid 必填)
|
|
|
|
|
- // logincode: param.logincode, // string 登录账号
|
|
|
|
|
- // accountname: param.accountname, // string 账户名称
|
|
|
|
|
- // password: param.password, // string 登录密码(明文)
|
|
|
|
|
- // mobile: param.mobile, // string 手机号码(明文)
|
|
|
|
|
- // roleids: [22, 23], // uint64 账号角色
|
|
|
|
|
- // // logintaaccounts: LoginTaaccount[], // LoginTaaccount 期货账户(勾选交易员必填)
|
|
|
|
|
- // modifierid: getLongTypeLoginID(), // uint64 修改人ID(当前登录loginid 必填)
|
|
|
|
|
- // }
|
|
|
|
|
- // requestResultLoadingAndInfo(loginAccountOperate, reqParam, loading, OperateType === 1 ? ['保存草稿成功', '保存草稿失败:'] : ['新增客户资料成功', '新增客户资料失败:']).then(() => {
|
|
|
|
|
- // cancel();
|
|
|
|
|
- // context.emit('refresh');
|
|
|
|
|
- // });
|
|
|
|
|
- //
|
|
|
|
|
- // })
|
|
|
|
|
- // .catch((error: ValidateErrorEntity<FormState>) => {
|
|
|
|
|
- // console.log('error', error);
|
|
|
|
|
- // });
|
|
|
|
|
|
|
+ });
|
|
|
|
|
+ function submit() {
|
|
|
|
|
+ formRef.value
|
|
|
|
|
+ .validate()
|
|
|
|
|
+ .then(() => {
|
|
|
|
|
+ const param = toRaw(formState);
|
|
|
|
|
+ const reqParam = {
|
|
|
|
|
+ operatetype: 1,
|
|
|
|
|
+ };
|
|
|
|
|
+ Object.assign(reqParam, param);
|
|
|
|
|
+ requestResultLoadingAndInfo(loginAccountOperate, reqParam, loading, ['新增账户成功', '新增账户失败:']).then(() => {
|
|
|
|
|
+ cancel();
|
|
|
|
|
+ context.emit('refresh');
|
|
|
|
|
+ });
|
|
|
|
|
+ })
|
|
|
|
|
+ .catch((error: ValidateErrorEntity<BusinessFormState>) => {
|
|
|
|
|
+ console.log('error', error);
|
|
|
|
|
+ });
|
|
|
}
|
|
}
|
|
|
return {
|
|
return {
|
|
|
formState,
|
|
formState,
|