diff --git a/src/views/base/customer/CustomerMainForm.vue b/src/views/base/customer/CustomerMainForm.vue index 4888017..2cff6b1 100644 --- a/src/views/base/customer/CustomerMainForm.vue +++ b/src/views/base/customer/CustomerMainForm.vue @@ -24,12 +24,12 @@ - + - + {{ dict.label }} @@ -40,8 +40,12 @@ - - + + + @@ -174,6 +178,7 @@ export default { formLoading: false, //折叠面板默认展开 activeNames: ['1','2','3'], + typeCode:"", // 表单参数 formData: { id: undefined, @@ -202,7 +207,23 @@ export default { ], }, // 表单校验 - formRules: {}, + formRules: { + cusName: [ + { required: true, message: '请输入活动名称', trigger: 'blur' }, + ], + typeCode: [ + { required: true, message: '请选择客户类型', trigger: 'change' }, + ], + phoneNumber: [ + { required: true, message: '请输入客户联系方式', trigger: 'blur' }, + ], + dataFrom: [ + { required: true, message: '请选择客户来源', trigger: 'change' }, + ], + inviterType: [ + { required: true, message: '请选择注册方式', trigger: 'change' }, + ], + }, // 性别数据字典 sexDictDatas: getDictDatas(DICT_TYPE.DICT_SYS_USER_SEX), cusBusiTypeDictDatas: getDictDatas(DICT_TYPE.DICT_CUS_BUSI_TYPE) @@ -228,8 +249,9 @@ export default { }, /** 打开弹窗 */ - async open(id) { + async open(id,typeCode) { this.dialogVisible = true; + this.typeCode = typeCode this.reset(); // 修改时,设置数据 if (id) { @@ -237,12 +259,12 @@ export default { try { const res = await CustomerMainApi.getCustomerMain(id); this.formData = res.data; - this.title = "修改客户管理"; + this.dialogTitle = "修改客户信息"; } finally { this.formLoading = false; } } - this.title = "新增客户管理"; + this.dialogTitle = "新增客户"; }, /** 提交按钮 */ async submitForm() { @@ -251,6 +273,10 @@ export default { this.formLoading = true; try { const data = this.formData; + //如果客户类型不是政企客户,没有扩展表信息 + if(data.typeCode !== '03'){ + data.itemList = [] + } // 修改的提交 if (data.id) { await CustomerMainApi.updateCustomerMain(data); @@ -273,7 +299,7 @@ export default { this.formData = { id: undefined, userId: undefined, - typeCode: '01', + typeCode: this.typeCode, deptCode: undefined, cusName: undefined, phoneNumber: undefined, diff --git a/src/views/base/customer/components/PrivateCustomer.vue b/src/views/base/customer/components/PrivateCustomer.vue new file mode 100644 index 0000000..cac8651 --- /dev/null +++ b/src/views/base/customer/components/PrivateCustomer.vue @@ -0,0 +1,204 @@ + + + + diff --git a/src/views/base/customer/components/TodoCustomer.vue b/src/views/base/customer/components/TodoCustomer.vue new file mode 100644 index 0000000..8c8f2fb --- /dev/null +++ b/src/views/base/customer/components/TodoCustomer.vue @@ -0,0 +1,204 @@ + + + + diff --git a/src/views/base/customer/index.vue b/src/views/base/customer/index.vue index 70ac936..1820772 100644 --- a/src/views/base/customer/index.vue +++ b/src/views/base/customer/index.vue @@ -1,204 +1,41 @@