|
|
@@ -309,7 +309,7 @@ onMounted(async () => {
|
|
|
const _id = route.query.id;
|
|
|
if (_id) {
|
|
|
isEdit.value = true;
|
|
|
- await loadMaintainData(_id);
|
|
|
+ await loadMaintainData(_id as any);
|
|
|
}
|
|
|
});
|
|
|
|
|
|
@@ -345,8 +345,7 @@ const handleCustomerChange = async (customerId: string | number) => {
|
|
|
|
|
|
// 填充企业基本信息 - 使用API获取真实数据
|
|
|
customerInfo.customerNo = data.customerNo;
|
|
|
- customerInfo.cooperationLevel = getCustomerLevelName(data.customerLevelId);
|
|
|
- customerInfo.memberLevel = getCustomerLevelName(data.customerLevelId);
|
|
|
+ // customerInfo.memberLevel = getCustomerLevelName(data.customerLevelId);
|
|
|
customerInfo.phone = data.landline || '';
|
|
|
customerInfo.address = data.address || '';
|
|
|
customerInfo.provincialCityCounty = data.provincialCityCounty || '';
|
|
|
@@ -355,31 +354,14 @@ const handleCustomerChange = async (customerId: string | number) => {
|
|
|
|
|
|
// 填充销售信息
|
|
|
if (data.customerSalesInfoVo) {
|
|
|
- customerInfo.salesPerson = getSalesPersonName(data.customerSalesInfoVo.salesPersonId);
|
|
|
- customerInfo.servicePerson = getServiceStaffName(data.customerSalesInfoVo.serviceStaffId);
|
|
|
+ customerInfo.salesPerson = res.data.customerSalesInfoVo?.salesPerson;
|
|
|
+ customerInfo.servicePerson = res.data.customerSalesInfoVo?.serviceStaff;
|
|
|
}
|
|
|
} catch (error) {
|
|
|
- console.error('加载企业信息失败:', error);
|
|
|
ElMessage.error('加载企业信息失败');
|
|
|
}
|
|
|
};
|
|
|
|
|
|
-// 格式化方法
|
|
|
-const getCustomerLevelName = (id: string | number | undefined) => {
|
|
|
- const map: Record<string, string> = { '1': 'A级', '2': 'B级', '3': 'C级', '4': 'D级' };
|
|
|
- return map[String(id)] || '-';
|
|
|
-};
|
|
|
-
|
|
|
-const getSalesPersonName = (id: string | number | undefined) => {
|
|
|
- const map: Record<string, string> = { '1': '张三', '2': '李四', '3': '王五', '4': '赵六' };
|
|
|
- return map[String(id)] || '-';
|
|
|
-};
|
|
|
-
|
|
|
-const getServiceStaffName = (id: string | number | undefined) => {
|
|
|
- const map: Record<string, string> = { '1': '客服A', '2': '客服B', '3': '客服C', '4': '客服D' };
|
|
|
- return map[String(id)] || '-';
|
|
|
-};
|
|
|
-
|
|
|
// 加载维保数据
|
|
|
const loadMaintainData = async (id: string | number) => {
|
|
|
try {
|
|
|
@@ -398,7 +380,6 @@ const loadMaintainData = async (id: string | number) => {
|
|
|
await handleCustomerChange(form.customerId);
|
|
|
}
|
|
|
} catch (error) {
|
|
|
- console.error('加载维保数据失败:', error);
|
|
|
ElMessage.error('加载维保数据失败');
|
|
|
}
|
|
|
};
|