diff --git a/frontend/ops_vue_js/src/router/index.js b/frontend/ops_vue_js/src/router/index.js index cee3ed8..52c21f2 100644 --- a/frontend/ops_vue_js/src/router/index.js +++ b/frontend/ops_vue_js/src/router/index.js @@ -114,6 +114,11 @@ const router = createRouter({ name: 'customer', component: () => import('@/views/customer/CustomerList.vue'), }, + { + path: 'customer/add', + name: 'customer-add', + component: () => import('@/views/customer/CustomerFormPage.vue'), + }, { path: 'customer/detail/:id', name: 'customer-detail', @@ -122,12 +127,7 @@ const router = createRouter({ { path: 'customer/edit/:id', name: 'customer-edit', - component: () => import('@/views/customer/CustomerEdit.vue'), - }, - { - path: 'customer/edit/:id', - name: 'customer-edit', - component: () => import('@/views/customer/CustomerFormModal.vue'), + component: () => import('@/views/customer/CustomerFormPage.vue'), }, ], }, diff --git a/frontend/ops_vue_js/src/views/customer/CustomerDetail.vue b/frontend/ops_vue_js/src/views/customer/CustomerDetail.vue index 781fdf3..57e6102 100644 --- a/frontend/ops_vue_js/src/views/customer/CustomerDetail.vue +++ b/frontend/ops_vue_js/src/views/customer/CustomerDetail.vue @@ -16,6 +16,7 @@ const phones = ref([]) const emails = ref([]) const companies = ref([]) const loading = ref(false) +const canModify = ref(false) // 是否有权限修改此客户 // 主要联系方式 const primaryPhone = computed(() => phones.value.find(p => p.is_primary) || null) @@ -41,6 +42,7 @@ async function fetchCustomerDetail() { phones.value = res.data.phones || [] emails.value = res.data.emails || [] companies.value = res.data.companies || [] + canModify.value = res.data.canModify || false // 从后端获取权限信息 // 预加载创建者信息 if (customer.value?.created_by) { usersStore.fetchUser(customer.value.created_by) @@ -102,6 +104,17 @@ onMounted(() => {

{{ t('customer.detail_title') }}

+
+ +
diff --git a/frontend/ops_vue_js/src/views/customer/CustomerFormPage.vue b/frontend/ops_vue_js/src/views/customer/CustomerFormPage.vue new file mode 100644 index 0000000..a7a73c8 --- /dev/null +++ b/frontend/ops_vue_js/src/views/customer/CustomerFormPage.vue @@ -0,0 +1,319 @@ + + + diff --git a/frontend/ops_vue_js/src/views/customer/CustomerList.vue b/frontend/ops_vue_js/src/views/customer/CustomerList.vue index d128d69..1effe22 100644 --- a/frontend/ops_vue_js/src/views/customer/CustomerList.vue +++ b/frontend/ops_vue_js/src/views/customer/CustomerList.vue @@ -1,12 +1,13 @@