|
|
@@ -275,10 +275,10 @@
|
|
|
</a-col>
|
|
|
<a-col :span="24">
|
|
|
<a-form-item label=" "
|
|
|
- name="cardaddress">
|
|
|
+ name="ipaddress">
|
|
|
<a-input class="dialogInput"
|
|
|
style="width: 635px"
|
|
|
- v-model:value="formState.cardaddress"
|
|
|
+ v-model:value="formState.ipaddress"
|
|
|
placeholder="请输入详细地址" />
|
|
|
</a-form-item>
|
|
|
</a-col>
|
|
|
@@ -306,12 +306,13 @@ import { getAddress } from '@/services/go/adress';
|
|
|
import { ModifyUserInfoApplyReq, QueryCustomInfoType } from '@/services/go/ermcp/customInfo/interface';
|
|
|
import { getUserId } from '@/services/bus/account';
|
|
|
import { requestResultLoadingAndInfo } from '@/common/methods/request/resultInfo';
|
|
|
-import { QueryModifyUserInfoApply } from '@/services/go/ermcp/customInfo';
|
|
|
+import { addCustomerInfoOperate } from '@/services/proto/accountinfo';
|
|
|
import { mergeTwoObj } from '@/utils/objHandle';
|
|
|
import { validateAction } from '@/common/setup/form';
|
|
|
import { delAddress } from '@/services/socket/address';
|
|
|
import UploadImg from '@/common/components/uploadImg/index.vue';
|
|
|
import { getUploadImg } from '@/common/setup/upload';
|
|
|
+import { CustomerInfoOperateReq } from '@/services/proto/accountinfo/interface';
|
|
|
|
|
|
export default defineComponent({
|
|
|
name: 'modify-custom',
|
|
|
@@ -319,7 +320,7 @@ export default defineComponent({
|
|
|
props: {
|
|
|
selectedRow: {
|
|
|
default: initFormState,
|
|
|
- type: Object as PropType<QueryCustomInfoType>,
|
|
|
+ type: Object as PropType<CustomerInfoOperateReq>,
|
|
|
},
|
|
|
},
|
|
|
setup(props, context) {
|
|
|
@@ -332,11 +333,11 @@ export default defineComponent({
|
|
|
// 地址
|
|
|
const { cityList, districtList, provinceList, getCityList, getDistrictList } = getAddress();
|
|
|
// 营业执照
|
|
|
- const { uploadImgAction: attachmentUpload, uploadImgList: attachmentImgList, handleImg: attachmentHandle } = getUploadImg();
|
|
|
+ const { getFirstImg: getAttachmentImg, uploadImgAction: attachmentUpload, uploadImgList: attachmentImgList, handleImg: attachmentHandle } = getUploadImg();
|
|
|
// 背面证件照地址
|
|
|
- const { uploadImgAction: cardbackUpload, uploadImgList: cardbackImgList, handleImg: cardbackHandle } = getUploadImg();
|
|
|
+ const { getFirstImg: getBackImg, uploadImgAction: cardbackUpload, uploadImgList: cardbackImgList, handleImg: cardbackHandle } = getUploadImg();
|
|
|
// 正面证件照地址
|
|
|
- const { uploadImgAction: cardfrontUpload, uploadImgList: cardfrontImgList, handleImg: cardfrontHandle } = getUploadImg();
|
|
|
+ const { getFirstImg: getFrontImg, uploadImgAction: cardfrontUpload, uploadImgList: cardfrontImgList, handleImg: cardfrontHandle } = getUploadImg();
|
|
|
|
|
|
function isPersonal(): boolean {
|
|
|
return formState.userinfotype === '1';
|
|
|
@@ -347,19 +348,13 @@ export default defineComponent({
|
|
|
watchEffect(() => {
|
|
|
if (visible.value) {
|
|
|
userid.value = props.selectedRow.userid;
|
|
|
- countryid.value = props.selectedRow.countryid;
|
|
|
mergeTwoObj(formState, props.selectedRow);
|
|
|
- if (isPersonal()) {
|
|
|
- formState.username = props.selectedRow.customername;
|
|
|
- }
|
|
|
- const { provinceid, cityid, address, mobile, attachment1, cardfrontphotourl, cardbackphotourl } = props.selectedRow;
|
|
|
- formState.cardaddress = address;
|
|
|
- formState.mobilephone = mobile;
|
|
|
+ const { provinceid, cityid, proxystatementurl, cardfrontphotourl, cardbackphotourl } = props.selectedRow;
|
|
|
provinceid ? getCityList(provinceid) : (formState.provinceid = undefined);
|
|
|
cityid ? getDistrictList(cityid) : ((formState.cityid = undefined), (formState.districtid = undefined));
|
|
|
- if (attachment1) {
|
|
|
+ if (proxystatementurl) {
|
|
|
// 营业执照
|
|
|
- attachmentImgList.value = attachmentHandle(attachment1);
|
|
|
+ attachmentImgList.value = attachmentHandle(proxystatementurl);
|
|
|
}
|
|
|
if (cardbackphotourl) {
|
|
|
// 背面证件照地址
|
|
|
@@ -373,31 +368,33 @@ export default defineComponent({
|
|
|
});
|
|
|
function submit(OperateType: 1 | 2) {
|
|
|
validateAction<FormState>(formRef, formState).then((param) => {
|
|
|
- const reqParam: ModifyUserInfoApplyReq = {
|
|
|
- customername: Number(param.userinfotype) === 1 ? param.username : param.customername, // 必填
|
|
|
+ const reqParam: CustomerInfoOperateReq = {
|
|
|
+ operatetype: 2,
|
|
|
+ areaid: param.areaid as number,
|
|
|
+ logincode: param.logincode,
|
|
|
+ loginpwd: param.loginpwd,
|
|
|
username: param.username,
|
|
|
userid: userid.value,
|
|
|
- memberareaid: getUserId(),
|
|
|
userinfotype: Number(param.userinfotype),
|
|
|
- userstate: OperateType, // 1: 保存草稿 2: 新增
|
|
|
- cardtype: param.cardtype, // 证件类型
|
|
|
+ cardtype: param.cardtype as number, // 证件类型
|
|
|
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: countryid.value,
|
|
|
- provinceid: param.provinceid, //省
|
|
|
+ cardfrontphotourl: isPersonal() ? getFrontImg() : '', // 正面照片
|
|
|
+ cardbackphotourl: isPersonal() ? getBackImg() : '', // 背面证件照地址
|
|
|
+ proxystatementurl: isPersonal() ? '' : getAttachmentImg(), // 营业执照
|
|
|
+ ipaddress: param.ipaddress, // 证件地址
|
|
|
+ cityid: param.cityid as number, //
|
|
|
+ districtid: param.districtid as number, // 地区
|
|
|
+ provinceid: param.provinceid as number, //省
|
|
|
contactname: param.contactname, // 联系人
|
|
|
legalpersonname: param.legalpersonname, // 法人姓名(企业)
|
|
|
taxpayernum: param.taxpayernum, // 纳税人识别号
|
|
|
email: param.email, // email
|
|
|
};
|
|
|
- requestResultLoadingAndInfo(QueryModifyUserInfoApply, reqParam, loading, OperateType === 1 ? ['保存草稿成功', '保存草稿失败:'] : ['新增客户资料成功', '新增客户资料失败:']).then(() => {
|
|
|
+ requestResultLoadingAndInfo(addCustomerInfoOperate, reqParam, loading, OperateType === 1 ? ['保存草稿成功', '保存草稿失败:'] : ['新增客户资料成功', '新增客户资料失败:']).then(() => {
|
|
|
cancel();
|
|
|
context.emit('refresh');
|
|
|
});
|