From 753889fd379de0be1dde05f80e605030ca38805e Mon Sep 17 00:00:00 2001 From: yinq Date: Tue, 31 Mar 2026 17:35:49 +0800 Subject: [PATCH] =?UTF-8?q?1.1.8=20=E6=8A=A5=E4=BB=B7=E5=8D=95=E6=A8=A1?= =?UTF-8?q?=E5=9D=97=E5=89=8D=E5=90=8E=E7=AB=AF=E8=81=94=E5=8A=A8=E4=BC=98?= =?UTF-8?q?=E5=8C=96=EF=BC=8C=E5=8C=85=E6=8B=AC=E5=AE=A2=E6=88=B7=E5=90=8D?= =?UTF-8?q?=E7=A7=B0=E6=8C=89=E5=AE=A2=E6=88=B7ID=E4=B8=8B=E6=8B=89?= =?UTF-8?q?=E6=A3=80=E7=B4=A2=E3=80=81=E7=BC=96=E8=BE=91=E9=A1=B5=E5=AE=A2?= =?UTF-8?q?=E6=88=B7=E5=90=8D=E7=A7=B0=E5=BF=85=E5=A1=AB=E4=B8=94=E8=81=94?= =?UTF-8?q?=E7=B3=BB=E4=BA=BA=E9=9D=9E=E5=BF=85=E5=A1=AB=E3=80=81=E4=BB=98?= =?UTF-8?q?=E6=AC=BE=E6=96=B9=E5=BC=8F=E6=94=B9=E4=B8=BA=E5=9B=BA=E5=AE=9A?= =?UTF-8?q?=E4=B8=8B=E6=8B=89=E6=96=87=E6=9C=AC=E3=80=81=E6=8A=A5=E4=BB=B7?= =?UTF-8?q?=E6=97=A5=E6=9C=9F=E9=BB=98=E8=AE=A4=E5=BD=93=E5=A4=A9=E3=80=81?= =?UTF-8?q?=E8=A1=A5=E5=85=85=E8=B4=A8=E4=BF=9D=E6=9C=9F=E5=AD=97=E6=AE=B5?= =?UTF-8?q?=E5=8F=8A=E5=88=97=E8=A1=A8=E5=B1=95=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/oa/crm/crmQuoteInfo/types.ts | 40 ++ src/views/oa/crm/crmQuoteInfo/edit.vue | 78 +++- src/views/oa/crm/crmQuoteInfo/index.vue | 515 ++++-------------------- 3 files changed, 175 insertions(+), 458 deletions(-) diff --git a/src/api/oa/crm/crmQuoteInfo/types.ts b/src/api/oa/crm/crmQuoteInfo/types.ts index 8dc0a25..6252b8d 100644 --- a/src/api/oa/crm/crmQuoteInfo/types.ts +++ b/src/api/oa/crm/crmQuoteInfo/types.ts @@ -69,6 +69,11 @@ export interface CrmQuoteInfoVO { */ deliveryPeriod: number; + /** + * 质保期 + */ + warrantyPeriod: number; + /** * 交付/交货方式 */ @@ -114,6 +119,11 @@ export interface CrmQuoteInfoVO { */ totalIncludingTax: number; + /** + * 客户ID + */ + customerId: string | number; + /** * 客户方联系人ID */ @@ -272,6 +282,11 @@ export interface CrmQuoteInfoForm extends BaseEntity { */ deliveryPeriod?: number; + /** + * 质保期 + */ + warrantyPeriod?: number; + /** * 交付/交货方式 */ @@ -317,6 +332,16 @@ export interface CrmQuoteInfoForm extends BaseEntity { */ totalIncludingTax?: number; + /** + * 客户ID + */ + customerId?: string | number; + + /** + * 客户名称 + */ + customerName?: string; + /** * 客户方联系人ID */ @@ -480,6 +505,11 @@ export interface CrmQuoteInfoQuery extends PageQuery { */ deliveryPeriod?: number; + /** + * 质保期 + */ + warrantyPeriod?: number; + /** * 交付/交货方式 */ @@ -525,6 +555,16 @@ export interface CrmQuoteInfoQuery extends PageQuery { */ totalIncludingTax?: number; + /** + * 客户ID + */ + customerId?: string | number; + + /** + * 客户名称 + */ + customerName?: string; + /** * 客户方联系人ID */ diff --git a/src/views/oa/crm/crmQuoteInfo/edit.vue b/src/views/oa/crm/crmQuoteInfo/edit.vue index 4b59702..f45b41e 100644 --- a/src/views/oa/crm/crmQuoteInfo/edit.vue +++ b/src/views/oa/crm/crmQuoteInfo/edit.vue @@ -101,6 +101,11 @@ + + + + + @@ -109,7 +114,7 @@ - + @@ -176,7 +181,7 @@ @@ -211,13 +216,6 @@ - - - - 上传附件 -
支持格式:.rar .zip .doc .docx .pdf,单个文件不超过20MB
-
-
@@ -343,19 +341,27 @@ 客户方信息 + + + + + + + @@ -488,6 +494,7 @@ import { addCrmQuoteInfo, getCrmQuoteInfo, quoteSubmitAndFlowStart, updateCrmQuo import { CrmQuoteInfoForm } from '@/api/oa/crm/crmQuoteInfo/types'; import type { CrmQuoteMaterialForm } from '@/api/oa/crm/crmQuoteMaterial/types'; import { getCrmCustomerContactList } from '@/api/oa/crm/customerContact'; +import { getCrmCustomerInfoList } from '@/api/oa/crm/customerInfo'; import { getCrmSupplierInfoList } from '@/api/oa/crm/crmSupplierInfo'; import { getBaseUnitInfoList } from '@/api/oa/base/unitInfo'; import { getBasePrintTemplateList } from '@/api/oa/base/printTemplate'; @@ -498,8 +505,8 @@ import SubmitVerify from '@/components/Process/submitVerify.vue'; import { FlowCodeEnum } from '@/enums/OAEnum'; const { proxy } = getCurrentInstance() as ComponentInternalInstance; -const { business_direction, currency_type, quote_category, contract_type, material_flag, wf_business_status, payment_method } = toRefs( - proxy?.useDict('business_direction', 'currency_type', 'quote_category', 'contract_type', 'material_flag', 'wf_business_status', 'payment_method') +const { business_direction, currency_type, quote_category, contract_type, material_flag, wf_business_status } = toRefs( + proxy?.useDict('business_direction', 'currency_type', 'quote_category', 'contract_type', 'material_flag', 'wf_business_status') ); const router = useRouter(); @@ -530,11 +537,14 @@ const form = reactive({ validFrom: undefined, validTo: undefined, deliveryPeriod: undefined, + warrantyPeriod: undefined, deliveryMethod: undefined, paymentMethod: undefined, currencyType: undefined, taxIncludedInfo: undefined, taxRate: undefined, + customerId: undefined, + customerName: undefined, customerContactId: undefined, customerContactName: undefined, customerContactPhone: undefined, @@ -550,14 +560,27 @@ const form = reactive({ const rules = { quoteName: [{ required: true, message: '报价单名称不能为空', trigger: 'blur' }], - customerContactId: [{ required: true, message: '请选择客户联系人', trigger: 'change' }] + customerId: [{ required: true, message: '请选择客户名称', trigger: 'change' }] }; // 下拉数据 +const customerList = ref([]); const customerContactList = ref([]); const supplierList = ref([]); const printTemplateList = ref([]); const DEFAULT_SUPPLIER_ID = 1; +const filteredCustomerContactList = computed(() => { + if (!form.customerId) { + return customerContactList.value; + } + return customerContactList.value.filter((item: any) => String(item.customerId) === String(form.customerId)); +}); +const paymentMethodOptions = ['电汇', '银行承兑(6个月内)', '电汇/银行承兑(6个月内)', '商业承兑']; + +const setQuoteDateToday = () => { + const d = new Date(); + form.quoteDate = `${d.getFullYear()}-${String(d.getMonth() + 1).padStart(2, '0')}-${String(d.getDate()).padStart(2, '0')} 00:00:00`; +}; // 单位下拉数据 const unitInfoList = ref([]); @@ -849,10 +872,26 @@ const onIncludingPriceChange = (row: any, val: number) => { // 选中联系人后,自动带出姓名、电话、邮箱(可编辑,不影响再次选择) const onCustomerContactChanged = (id: any) => { const c = customerContactList.value.find((x: any) => x.contactId === id); + if (c?.customerId) { + form.customerId = c.customerId; + form.customerName = c.customerName || form.customerName; + } form.customerContactName = c?.contactName || ''; form.customerContactPhone = c?.phoneNumber || ''; form.customerContactEmail = c?.email || ''; }; +const onCustomerChanged = (customerId: any) => { + const customer = customerList.value.find((item: any) => String(item.customerId) === String(customerId)); + form.customerName = customer?.customerName || ''; + const currentContact = customerContactList.value.find((item: any) => item.contactId === form.customerContactId); + if (currentContact && String(currentContact.customerId) === String(customerId)) { + return; + } + form.customerContactId = undefined; + form.customerContactName = ''; + form.customerContactPhone = ''; + form.customerContactEmail = ''; +}; // 供应商选择变化处理 const onSupplierChanged = (supplierId: any) => { const supplier = supplierList.value.find((x: any) => x.supplierId === supplierId); @@ -1000,6 +1039,8 @@ onMounted(async () => { routeParams.value = { ...route.query }; // 下拉数据初始化 + const customerRes = await getCrmCustomerInfoList({}); + customerList.value = customerRes.data || []; const contactRes = await getCrmCustomerContactList({}); customerContactList.value = contactRes.data || []; // 加载供应商列表(计划内供应商) @@ -1016,9 +1057,15 @@ onMounted(async () => { form.quoteId = id as any; const res = await getCrmQuoteInfo(id as any); Object.assign(form, res.data); - console.log('crmQuoteInfo/edit.vue数据加载成功,ossId:', form.ossId); // 添加调试日志 // 编辑模式:已存在编号则禁用生成 isCodeGenerated.value = !!form.quoteCode; + if (!form.customerId && form.customerContactId) { + const currentContact = customerContactList.value.find((item: any) => item.contactId === form.customerContactId); + if (currentContact?.customerId) { + form.customerId = currentContact.customerId; + form.customerName = currentContact.customerName || form.customerName; + } + } // 根据已有联系人ID回填姓名、电话、邮箱(若后端已返回则保持) if (!form.customerContactPhone || !form.customerContactEmail || !form.customerContactName) { onCustomerContactChanged(form.customerContactId); @@ -1057,6 +1104,7 @@ onMounted(async () => { } // 新增模式:如已有编号则禁用生成按钮 if (!id) { + setQuoteDateToday(); applyDefaultSupplier(); isCodeGenerated.value = !!form.quoteCode; } diff --git a/src/views/oa/crm/crmQuoteInfo/index.vue b/src/views/oa/crm/crmQuoteInfo/index.vue index ca87aba..a5ee0c2 100644 --- a/src/views/oa/crm/crmQuoteInfo/index.vue +++ b/src/views/oa/crm/crmQuoteInfo/index.vue @@ -10,131 +10,11 @@ - - - - - - - 搜索 重置 @@ -160,9 +40,6 @@ >删除 - - - - + - - - - - + + + - + - - - - - - + + + + + + - + - + - + - - - - + + + + + - + - - - + + + - +