From 93d27bd1b93684b74fb18724e11e91ae3adead43 Mon Sep 17 00:00:00 2001 From: zy Date: Sun, 11 May 2025 12:29:47 +0800 Subject: [PATCH] =?UTF-8?q?=E7=BA=BF=E4=B8=8B=E4=BB=B7=E6=A0=BC-=E4=BB=BB?= =?UTF-8?q?=E5=8A=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/router/modules/remaining.ts | 24 +- src/utils/dict.ts | 1 + src/views/crm/contract/ContractForm.vue | 2 +- src/views/crm/quotation/QuotationDetail.vue | 16 ++ src/views/crm/quotation/QuotationForm.vue | 39 ++- .../components/QuotationProductDetail.vue | 15 +- .../components/QuotationProductForm.vue | 24 +- src/views/crm/quotation/index.vue | 33 ++- src/views/task/components/Bouns.vue | 9 +- src/views/task/components/ProjectTaskForm.vue | 90 +++++-- src/views/task/components/Task.vue | 50 +++- src/views/task/components/TaskDetail.vue | 234 ++++++++++++++++++ src/views/task/project/ProjectForm.vue | 4 +- src/views/task/project/index.vue | 2 +- 14 files changed, 486 insertions(+), 57 deletions(-) create mode 100644 src/views/task/components/TaskDetail.vue diff --git a/src/router/modules/remaining.ts b/src/router/modules/remaining.ts index bf160c921..7c1bfbef7 100644 --- a/src/router/modules/remaining.ts +++ b/src/router/modules/remaining.ts @@ -797,7 +797,7 @@ const remainingRouter: AppRouteRecordRaw[] = [ path: 'project/ProjectFormEdit', name: 'ProProEdit', meta: { - title: '项目管理新增', + title: '项目管理编辑', noCache: true, hidden: true, activeMenu: '/project/project' @@ -815,6 +815,28 @@ const remainingRouter: AppRouteRecordRaw[] = [ }, component: () => import('@/views/task/project/ProjectDetail.vue') }, + { + path: 'components/TaskDetail', + name: 'ProComDetail', + meta: { + title: '任务详情', + noCache: true, + hidden: true, + activeMenu: '/project/project' + }, + component: () => import('@/views/task/components/TaskDetail.vue') + }, + { + path: 'components/ProjectTaskForm', + name: 'ProComAdd', + meta: { + title: '任务新增', + noCache: true, + hidden: true, + activeMenu: '/project/project' + }, + component: () => import('@/views/task/components/ProjectTaskForm.vue') + }, ] }, { diff --git a/src/utils/dict.ts b/src/utils/dict.ts index 87bddb786..6aedadc1a 100644 --- a/src/utils/dict.ts +++ b/src/utils/dict.ts @@ -237,6 +237,7 @@ export enum DICT_TYPE { // ========== ERP - 企业资源计划模块 ========== TTS_PROJECT_LEVEL="tts_project_level", //项目级别 TTS_PROJECT_TYPE="tts_project_type", //项目类型 + TTS_TASK_LEVEL = 'tts_task_level', // ========== ERP - 企业资源计划模块 ========== diff --git a/src/views/crm/contract/ContractForm.vue b/src/views/crm/contract/ContractForm.vue index df6e6cefe..8571061d6 100644 --- a/src/views/crm/contract/ContractForm.vue +++ b/src/views/crm/contract/ContractForm.vue @@ -851,7 +851,7 @@ onMounted(async () => { // formData.value.ownerUserId = useUserStore().getUser.id // } // 获取联系人 - contactList.value = await ContactApi.getSimpleContactList() + contactList.value = await CustomerApi.getSelfCustomerSimpleList() const data = await ContractApi.getOrg({ pageNo: 1, pageSize: 1000 diff --git a/src/views/crm/quotation/QuotationDetail.vue b/src/views/crm/quotation/QuotationDetail.vue index 19a8c68ab..03e159027 100644 --- a/src/views/crm/quotation/QuotationDetail.vue +++ b/src/views/crm/quotation/QuotationDetail.vue @@ -564,7 +564,23 @@ const open = async (type: string) => { if (type) { formLoading.value = true try { + let totalOnlinePrice = 0; + let totalOfflinePrice = 0; + formData.value = await QuotationApi.getQuotation(type) + + for (const product of formData.value.products) { + if (typeof product.onlinePrice) { + totalOnlinePrice += Number(product.onlinePrice); + } + if (typeof product.offlinePrice) { + totalOfflinePrice += Number(product.offlinePrice); + } + } + formData.value.onlinePrice = totalOnlinePrice.toFixed(2) + formData.value.offlinePrice = (totalOfflinePrice + totalOnlinePrice).toFixed(2) + let all = totalOnlinePrice + totalOfflinePrice + totalOnlinePrice + formData.value.totalPrice = all.toFixed(2) formData.value.creditLimit = ((formData.value.creditAmount || 0) + (formData.value.creditLimitNum || 0)).toFixed(2) } finally { formLoading.value = false diff --git a/src/views/crm/quotation/QuotationForm.vue b/src/views/crm/quotation/QuotationForm.vue index db5498c10..98dd40f35 100644 --- a/src/views/crm/quotation/QuotationForm.vue +++ b/src/views/crm/quotation/QuotationForm.vue @@ -307,14 +307,15 @@ - + + @@ -374,7 +375,7 @@ - +
@@ -493,6 +494,37 @@ const formRef = ref() // 表单 Ref /** 子表的表单 */ const subTabsName = ref('quotationProduct') const quotationProductFormRef = ref() +watch( + () => formData.value.products, + (newProducts) => { + if (!Array.isArray(newProducts)) { + console.warn('formData.value.products is not an array'); + return; + } + + let totalOnlinePrice = 0; + let totalOfflinePrice = 0; + + for (const product of newProducts) { + if (typeof product.onlinePrice) { + totalOnlinePrice += Number(product.onlinePrice); + } + if (typeof product.offlinePrice) { + totalOfflinePrice += Number(product.offlinePrice); + } + } + formData.value.onlinePrice = totalOnlinePrice.toFixed(2) + formData.value.offlinePrice = (totalOfflinePrice + totalOnlinePrice).toFixed(2) + let all = totalOnlinePrice + totalOfflinePrice + totalOnlinePrice + formData.value.totalPrice = all.toFixed(2) + }, + { deep: true } +); + +const setSuccess = (val) => { + formData.value.products = val +} + const onBusinessChange = async (businessId: string) => { if (!businessId) return @@ -512,7 +544,6 @@ const onBusinessChange = async (businessId: string) => { formData.value.onlinePrice = res.onlinePrice; formData.value.totalPrice = res.totalPrice; formData.value.creditAmount = res.creditAmount; - console.log('%csrc/views/crm/quotation/QuotationForm.vue:516 (formData.value.creditAmount || 0) + (formData.value.creditLimitNum || 0)', 'color: #007acc;', (formData.value.creditAmount || 0) , (formData.value.creditLimitNum || 0)); // 🔁 自动加载客户详情 await onCustomerChange(res.customerId); diff --git a/src/views/crm/quotation/components/QuotationProductDetail.vue b/src/views/crm/quotation/components/QuotationProductDetail.vue index 3c3e3aa65..4cfdeabe1 100644 --- a/src/views/crm/quotation/components/QuotationProductDetail.vue +++ b/src/views/crm/quotation/components/QuotationProductDetail.vue @@ -41,6 +41,11 @@ + + + - + - + + - + + + + - -