diff --git a/yxt-as-ui/src/components/publicPage/quickAddCustomer.vue b/yxt-as-ui/src/components/publicPage/quickAddCustomer.vue index cee218caa3..0a7385a5e1 100644 --- a/yxt-as-ui/src/components/publicPage/quickAddCustomer.vue +++ b/yxt-as-ui/src/components/publicPage/quickAddCustomer.vue @@ -394,7 +394,10 @@ export default { brakepads_km: '', brakepads_date: '', carRemarks: '', - byRemarks: '' + byRemarks: '', + vehState: '', + saleOrgName: '', + saleDate: '' }, rules: { name: [{ required: true, message: '客户名称不能为空', trigger: 'blur' }], @@ -487,45 +490,41 @@ export default { } return val }, - showAdd(value, sid) { + showAdd(value) { this.$nextTick(() => { this.$refs['form_obj'].clearValidate() }) this.init() - if (sid !== '') { - this.viewTitle = '【快捷新增】客户信息' - req.quickAddInit({ sid: sid }).then((resp) => { - if (resp.success) { - this.formobj = resp.data - this.basics(value) - } - }) - } else { - this.viewTitle = '【新增】客户信息' - this.basics(value) - } - }, - // 基础信息赋值 - basics(value) { - this.formobj.isOnRemind = '否' - this.formobj.isOnRemindKey = '0' - this.formobj.customerType = value.customerType - this.formobj.customerTypeKey = value.customerTypeKey - this.formobj.visitWay = value.visitWay - this.formobj.visitWayKey = value.visitWayKey - this.formobj.userSid = window.sessionStorage.getItem('userSid') - this.formobj.orgPath = window.sessionStorage.getItem('defaultOrgPath') - this.formobj.useOrgSid = window.sessionStorage.getItem('defaultOrgPath').substring(window.sessionStorage.getItem('defaultOrgPath').lastIndexOf('/') + 1) - if (this.formobj.customerType === '个人') { - this.formobj.certificateType = '身份证' - this.formobj.certificateTypeKey = '01' - } else { - this.formobj.certificateType = '营业执照' - this.formobj.certificateTypeKey = '02' - } - typeValues({ psid: value.psid, type: 'customerClass' }).then((res) => { + this.viewTitle = '【新增】客户信息' + req.customerInit(value).then((res) => { if (res.success) { - this.customerClass_list = res.data + this.formobj = res.data + typeValues({ type: 'customerType' }).then((resp) => { + if (resp.success) { + this.customerType_list = resp.data + this.customerType_list.forEach((e) => { + if (e.dictValue === this.formobj.customerType) { + typeValues({ psid: e.sid, type: 'customerClass' }).then((respsone) => { + if (respsone.success) { + this.customerClass_list = respsone.data + } + }) + } + }) + } + }) + // 该客户为新增客户(数据库中未查到该客户信息的),需要将以下字段进行默认赋值 + if (res.data.vehState !== '0') { + this.formobj.isOnRemind = '否' + this.formobj.isOnRemindKey = '0' + if (this.formobj.customerType === '个人') { + this.formobj.certificateType = '身份证' + this.formobj.certificateTypeKey = '01' + } else { + this.formobj.certificateType = '营业执照' + this.formobj.certificateTypeKey = '02' + } + } } }) }, @@ -627,7 +626,39 @@ export default { useOrgSid: '', sid: '', customerOrgName: '', - customerOrgSid: '' + customerOrgSid: '', + customerVehSid: '', + customerSid: '', + vehMark: '', + vinNo: '', + engineNo: '', + vehModelSid: '', + vehModel: '', + mileage: '', + lastMileage: '', + nextMaintainDate: '', + buyDate: '', + commercialInsuranceEndDate: '', + compulsoryInsuranceEndDate: '', + currentMileage: '', + monthKm: '', + filter_km: '', + filter_date: '', + engineoil_km: '', + engineoil_date: '', + gearoil_km: '', + gearoil_date: '', + treasurewheel_km: '', + treasurewheel_date: '', + fanbelt_km: '', + fanbelt_date: '', + brakepads_km: '', + brakepads_date: '', + carRemarks: '', + byRemarks: '', + vehState: '', + saleOrgName: '', + saleDate: '' } this.submitdisabled = false this.$emit('doback') diff --git a/yxt-as-ui/src/components/publicPage/selectCustomer.vue b/yxt-as-ui/src/components/publicPage/selectCustomer.vue index 5354962470..40b77cd31f 100644 --- a/yxt-as-ui/src/components/publicPage/selectCustomer.vue +++ b/yxt-as-ui/src/components/publicPage/selectCustomer.vue @@ -16,7 +16,7 @@ - + @@ -68,7 +68,7 @@ - + @@ -79,6 +79,8 @@ + +
客户类型
@@ -88,6 +90,17 @@
+ + +
车架号
+ +
+
+ + + 注:若填写的车架号为集团销售车辆,平台自动获取相应客户信息。 + +