|
|
@@ -1,169 +0,0 @@
|
|
|
-<template>
|
|
|
- <!-- 新增账户 -->
|
|
|
- <a-modal class="commonModal add-account-info"
|
|
|
- title="新增账户"
|
|
|
- v-model:visible="visible"
|
|
|
- @cancel="cancel"
|
|
|
- centered
|
|
|
- :maskClosable="false"
|
|
|
- width="890px">
|
|
|
- <template #footer>
|
|
|
- <a-button key="submit"
|
|
|
- type="primary"
|
|
|
- :loading="loading"
|
|
|
- @click="submit">完成</a-button>
|
|
|
- </template>
|
|
|
- <a-form class="inlineForm"
|
|
|
- ref="formRef"
|
|
|
- :model="formState"
|
|
|
- :rules="rules">
|
|
|
- <a-row :gutter="24">
|
|
|
- <a-col :span="12">
|
|
|
- <a-form-item label="账户角色"
|
|
|
- name="userinfotype">
|
|
|
- <a-checkbox-group class="commonCheckboxGroup" v-model:value="formState.warehousetype">
|
|
|
- <a-row>
|
|
|
- <a-col :span="12">
|
|
|
- <a-checkbox value="A">业务员</a-checkbox>
|
|
|
- </a-col>
|
|
|
- <a-col :span="12">
|
|
|
- <a-checkbox value="B">跟单员</a-checkbox>
|
|
|
- </a-col>
|
|
|
- </a-row>
|
|
|
- </a-checkbox-group>
|
|
|
- </a-form-item>
|
|
|
- </a-col>
|
|
|
- <a-col :span="12">
|
|
|
- <a-form-item label="账户名称"
|
|
|
- name="customername">
|
|
|
- <a-input class="dialogInput"
|
|
|
- v-model:value="formState.customername"
|
|
|
- style="width: 200px"
|
|
|
- placeholder="请输入账户名称" />
|
|
|
- </a-form-item>
|
|
|
- </a-col>
|
|
|
- <a-col :span="12">
|
|
|
- <a-form-item label="登录账号"
|
|
|
- name="nickname">
|
|
|
- <a-input class="dialogInput"
|
|
|
- style="width: 200px"
|
|
|
- v-model:value="formState.nickname"
|
|
|
- placeholder="请输入登录账号" />
|
|
|
- </a-form-item>
|
|
|
- </a-col>
|
|
|
- <a-col :span="12">
|
|
|
- <a-form-item label="登录密码"
|
|
|
- name="cardtype">
|
|
|
- <a-input-password class="dialogInput"
|
|
|
- style="width: 200px"
|
|
|
- v-model:value="formState.legalpersonname"
|
|
|
- placeholder="请输入登录密码" />
|
|
|
- </a-form-item>
|
|
|
- </a-col>
|
|
|
- <a-col :span="24">
|
|
|
- <a-form-item label="手机号码"
|
|
|
- name="legalpersonname">
|
|
|
- <a-input class="dialogInput"
|
|
|
- style="width: 200px"
|
|
|
- v-model:value="formState.legalpersonname"
|
|
|
- placeholder="请输入手机号码" />
|
|
|
- </a-form-item>
|
|
|
- </a-col>
|
|
|
- </a-row>
|
|
|
- </a-form>
|
|
|
- </a-modal>
|
|
|
-</template>
|
|
|
-
|
|
|
-<script lang="ts">
|
|
|
-import { closeModal } from '@/common/setup/modal/index';
|
|
|
-import { initData } from '@/common/methods/index';
|
|
|
-import { defineComponent, ref, reactive, toRaw, UnwrapRef } from 'vue';
|
|
|
-import { getCardType, initFormState, handleApply } from './setup';
|
|
|
-import { AllEnums } from '@/services/go/commonService/interface';
|
|
|
-import { FormState } from './interface';
|
|
|
-import { RuleObject, ValidateErrorEntity } from 'ant-design-vue/es/form/interface';
|
|
|
-import {AddUserInfoApplyReq} from "@/services/go/ermcp/customInfo/interface";
|
|
|
-import {getUserId} from "@/services/bus/account";
|
|
|
-
|
|
|
-export default defineComponent({
|
|
|
- name: 'add-custom',
|
|
|
- components: {},
|
|
|
- setup() {
|
|
|
- // 控制关闭弹窗
|
|
|
- const { visible, cancel } = closeModal('custom_info_btn_add');
|
|
|
- // 证件类型
|
|
|
- const cardTypeList = ref<AllEnums[]>(getCardType());
|
|
|
- // 表单
|
|
|
- const formRef = ref();
|
|
|
- const formState: UnwrapRef<FormState> = reactive(initFormState());
|
|
|
- const rules = {
|
|
|
- userinfotype: [{ required: true, message: '请选择客户类型', trigger: 'change' }],
|
|
|
- customername: [{ required: true, message: '请输入企业名称', trigger: 'blur' }],
|
|
|
- nickname: [{ required: true, message: '请输入企业简称', trigger: 'blur' }],
|
|
|
- cardtype: [{ required: true, message: '请选择证件类型', trigger: 'change' }],
|
|
|
- };
|
|
|
- // 下单方法
|
|
|
- const { loading, applyAction } = handleApply();
|
|
|
- function isPersonal(): boolean {
|
|
|
- return formState.userinfotype === '1';
|
|
|
- }
|
|
|
- function submit() {
|
|
|
- formRef.value
|
|
|
- .validate()
|
|
|
- .then(() => {
|
|
|
- const param = toRaw(formState);
|
|
|
-
|
|
|
- const paramReq: AddUserInfoApplyReq = {
|
|
|
- customername: param.customername, // 必填
|
|
|
- userid: 1, // 写死 必填
|
|
|
- memberareaid: getUserId(),
|
|
|
- userinfotype: Number(param.userinfotype),
|
|
|
- username: param.customername,
|
|
|
- userstate: 1, // 1: 保存草稿 2: 新增
|
|
|
-
|
|
|
- // 以上必填
|
|
|
- cardtype: param.cardtype, // 证件类型
|
|
|
- cardnum: param.cardnum, // 证件号码
|
|
|
- nickname: param.nickname, // 昵称
|
|
|
- remark: param.remark, // 备注
|
|
|
- mobilephone: param.mobilephone, // 手机号码
|
|
|
- telphone: param.telphone, // 电话
|
|
|
- cardfrontphotourl: param.cardfrontphotourl, // 正面照片
|
|
|
- cardaddress: param.cardaddress, // 证件地址
|
|
|
- cityid: param.cityid, //
|
|
|
- districtid: param.districtid, // 地区
|
|
|
- // countryid: param.,
|
|
|
- provinceid: param.provinceid, //省
|
|
|
- contactname: param.contactname, // 联系人
|
|
|
- legalpersonname: param.legalpersonname, // 法人姓名(企业)
|
|
|
- taxpayernum: param.taxpayernum, // 纳税人识别号
|
|
|
- email: param.email, // email
|
|
|
- }
|
|
|
- applyAction(paramReq);
|
|
|
- console.log('values', formState);
|
|
|
- })
|
|
|
- .catch((error: ValidateErrorEntity<FormState>) => {
|
|
|
- console.log('error', error);
|
|
|
- });
|
|
|
- }
|
|
|
- initData(() => {});
|
|
|
- return {
|
|
|
- formState,
|
|
|
- rules,
|
|
|
- formRef,
|
|
|
- cardTypeList,
|
|
|
- isPersonal,
|
|
|
- visible,
|
|
|
- cancel,
|
|
|
- submit,
|
|
|
- loading,
|
|
|
- };
|
|
|
- },
|
|
|
-});
|
|
|
-</script>
|
|
|
-
|
|
|
-<style lang="less">
|
|
|
-.add-account-info {
|
|
|
-}
|
|
|
-</style
|
|
|
->;
|