huangbin 4 years ago
parent
commit
703cd2e0c6

+ 2 - 2
src/services/proto/accountinfo/interface.ts

@@ -156,8 +156,8 @@ export interface CustomerInfoOperateReq {
     operatetype: number // uint32 操作类型-1:新增 2:修改
     userid: number // uint64 用户ID(修改时必填)
     areaid: number // uint64 所属机构
-    logincode: string // string 登录帐号
-    loginpwd: string  // string 登录密码
+    logincode?: string // string 登录帐号
+    loginpwd?: string  // string 登录密码
     userinfotype: number // uint32 客户类型 1:个人  2:企业
     username: string // string 姓名、企业名称
     nickname: string // string 企业简称(企业)

+ 18 - 14
src/views/information/custom/compoments/add/index.vue

@@ -273,6 +273,9 @@ import { QueryAddUserInfoApply } from '@/services/go/ermcp/customInfo';
 import { validateAction } from '@/common/setup/form';
 import UploadImg from '@/common/components/uploadImg/index.vue';
 import { getUploadImg } from '@/common/setup/upload';
+import { addCustomerInfoOperate } from '@/services/proto/accountinfo';
+import { CustomerInfoOperateReq } from '@/services/proto/accountinfo/interface';
+import { getAreaUserId } from '@/services/bus/user';
 
 export default defineComponent({
     name: 'add-custom',
@@ -299,34 +302,35 @@ export default defineComponent({
 
         function submit(OperateType: 1 | 2) {
             validateAction<FormState>(formRef, formState).then((param) => {
-                const reqParam: AddUserInfoApplyReq = {
-                    customername: Number(param.userinfotype) === 1 ? param.username : param.customername, // 必填
-                    userid: 1, // 写死 必填
-                    memberareaid: getUserId(),
+                const reqParam: CustomerInfoOperateReq = {
+                    operatetype: OperateType,
+                    // userid: 1, // 写死 必填
+                    userid: getUserId(), // 写死 必填
+                    areaid: getAreaUserId(),
                     userinfotype: Number(param.userinfotype),
                     username: param.username,
-                    userstate: OperateType, // 1: 保存草稿 2: 新增
+                    userstate: 2, // 1: 保存草稿 2: 新增
                     // 以上必填
-                    cardtype: param.cardtype, // 证件类型
+                    cardtype: (param.cardtype as number) !== undefined ? (param.cardtype as number) : 0, // 证件类型
                     cardnum: param.cardnum, // 证件号码
                     nickname: param.nickname, // 昵称
                     remark: param.remark, // 备注
                     mobilephone: param.mobilephone, //  手机号码
                     telphone: param.telphone, // 电话
-                    cardfrontphotourl: getFrontImg(), // 正面照片
-                    cardbackphotourl: getBackImg(), // 背面证件照地址
-                    cardaddress: param.cardaddress, // 证件地址
-                    cityid: param.cityid, //
-                    districtid: param.districtid, // 地区
+                    cardfrontphotourl: isPersonal() ? getFrontImg() : getAttachmentImg(), // 正面照片
+                    cardbackphotourl: isPersonal() ? getBackImg() : '', // 背面证件照地址
+                    ipaddress: param.cardaddress, // 证件地址
+                    cityid: (param.cityid as number) !== undefined ? (param.cityid as number) : 0, //城市
+                    districtid: (param.districtid as number) !== undefined ? (param.districtid as number) : 0, // 地区
                     // countryid: param.,9
-                    provinceid: param.provinceid, //省
+                    provinceid: (param.provinceid as number) !== undefined ? (param.provinceid as number) : 0, //省
                     contactname: param.contactname, // 联系人
                     legalpersonname: param.legalpersonname, // 法人姓名(企业)
                     taxpayernum: param.taxpayernum, // 纳税人识别号
                     email: param.email, // email
-                    attachment1: getAttachmentImg(), // 营业执照
+                    proxystatementurl: '',
                 };
-                requestResultLoadingAndInfo(QueryAddUserInfoApply, reqParam, loading, OperateType === 1 ? ['保存草稿成功', '保存草稿失败:'] : ['新增客户资料成功', '新增客户资料失败:']).then(() => {
+                requestResultLoadingAndInfo(addCustomerInfoOperate, reqParam, loading, OperateType === 1 ? ['保存草稿成功', '保存草稿失败:'] : ['新增客户资料成功', '新增客户资料失败:']).then(() => {
                     cancel();
                     context.emit('refresh');
                 });